text
stringlengths
2
1.04M
meta
dict
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <stroke android:width="2dp" android:color="#FFFFFF"/> <gradient android:angle="225" android:startColor="#DD2ECCFA" android:endColor="#df3342e4"/> <corners android:bottomLeftRadius="7dp" android:bottomRightRadius="7dp" android:topLeftRadius="7dp" android:topRightRadius="7dp" /> </shape>
{ "content_hash": "5e8e6786dabf25ce16e8c143674417d8", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 67, "avg_line_length": 33.5, "alnum_prop": 0.6332622601279317, "repo_name": "vidhyadhari1989/Learnopedia-C2C", "id": "311760b51f420d8e5faa41e1d1923f5dbcbf5fa7", "size": "469", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/drawable/button_shape.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "92247" } ], "symlink_target": "" }
package com.github.ljtfreitas.restify.http.contract; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Header(name = "Accept", value = "application/xml") public @interface AcceptXml { }
{ "content_hash": "399a57ac54c77d4f536af5cd4e1ca4ce", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 52, "avg_line_length": 29.615384615384617, "alnum_prop": 0.8051948051948052, "repo_name": "ljtfreitas/java-restify", "id": "2a00cefb84b9ef1c02608c15d168892ccdbff3d8", "size": "1690", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "java-restify-contract/src/main/java/com/github/ljtfreitas/restify/http/contract/AcceptXml.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "3295925" } ], "symlink_target": "" }
/** * Created by Florin Chelaru ( florin [dot] chelaru [at] gmail [dot] com ) * Date: 11/8/2015 * Time: 1:23 AM */ /** * @fileoverview * @suppress {globalThis} */ if (COMPILED) { goog.provide('vs.models'); } // Extend the namespaces defined here with the ones in the base vis.js package (function() { u.extend(vs, this['vs']); u.extend(vs.models, this['vs']['models']); }).call(this);
{ "content_hash": "26e1497381133935b9b99da73328b39a", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 78, "avg_line_length": 20.05, "alnum_prop": 0.6234413965087282, "repo_name": "florin-chelaru/vs.models.plugins.js", "id": "2745598909544bcac23eac567184c939862e3fe0", "size": "401", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/vs/models/base.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "7381" }, { "name": "JavaScript", "bytes": "140342" } ], "symlink_target": "" }
AWS Setup Instructions ====================== Get AWS API credentials ----------------------- 1. [AWS credentials documentation](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSGettingStartedGuide/AWSCredentials.html) Create a credentials file ------------------------- 1. Create a credentials file (eg ~/.aws_creds) that looks something like this (variables must have have these exact names). ``` export AWS_ACCESS_KEY_ID='AKIASTUFF' export AWS_SECRET_ACCESS_KEY='STUFF' ``` 2. source this file ``` source ~/.aws_creds ``` Note: You must source this file before running any Ansible commands. Alternatively, you could configure credentials in either ~/.boto or ~/.aws/credentials, see the [boto docs](http://docs.pythonboto.org/en/latest/boto_config_tut.html) for the format. (Optional) Setup your $HOME/.ssh/config file ------------------------------------------- In case of a cluster creation, or any other case where you don't know the machine hostname in advance, you can use `.ssh/config` to setup a private key file to allow ansible to connect to the created hosts. To do so, add the the following entry to your $HOME/.ssh/config file and make it point to the private key file which allows you to login on AWS. ``` Host *.compute-1.amazonaws.com PrivateKey $HOME/.ssh/my_private_key.pem ``` Alternatively, you can configure your ssh-agent to hold the credentials to connect to your AWS instances. (Optional) Choose where the cluster will be launched ---------------------------------------------------- By default, a cluster is launched with the following configuration: - Instance type: m3.large - AMI: ami-307b3658 (for online deployments, ami-acd999c4 for origin deployments and ami-10663b78 for enterprise deployments) - Region: us-east-1 - Keypair name: libra - Security group: public Master specific defaults: - Master root volume size: 10 (in GiBs) - Master root volume type: gp2 - Master root volume iops: 500 (only applicable when volume type is io1) Node specific defaults: - Node root volume size: 10 (in GiBs) - Node root volume type: gp2 - Node root volume iops: 500 (only applicable when volume type is io1) - Docker volume size: 25 (in GiBs) - Docker volume ephemeral: true (Whether the docker volume is ephemeral) - Docker volume type: gp2 (only applicable if ephemeral is false) - Docker volume iops: 500 (only applicable when volume type is io1) If needed, these values can be changed by setting environment variables on your system. - export ec2_instance_type='m3.large' - export ec2_image='ami-307b3658' - export ec2_region='us-east-1' - export ec2_keypair='libra' - export ec2_security_groups="['public']" - export ec2_vpc_subnet='my_vpc_subnet' - export ec2_assign_public_ip='true' - export os_etcd_root_vol_size='20' - export os_etcd_root_vol_type='standard' - export os_etcd_vol_size='20' - export os_etcd_vol_type='standard' - export os_master_root_vol_size='20' - export os_master_root_vol_type='standard' - export os_node_root_vol_size='15' - export os_docker_vol_size='50' - export os_docker_vol_ephemeral='false' Install Dependencies -------------------- 1. Ansible requires python-boto for aws operations: RHEL/CentOS/Fedora ``` yum install -y ansible python-boto ``` OSX: ``` pip install -U boto ``` Test The Setup -------------- 1. cd openshift-ansible 1. Try to list all instances (Passing an empty string as the cluster_id argument will result in all ec2 instances being listed) ``` bin/cluster list aws '' ``` Creating a cluster ------------------ 1. To create a cluster with one master and two nodes ``` bin/cluster create aws <cluster-id> ``` Updating a cluster --------------------- 1. To update the cluster ``` bin/cluster update aws <cluster-id> ``` Terminating a cluster --------------------- 1. To terminate the cluster ``` bin/cluster terminate aws <cluster-id> ``` Specifying a deployment type --------------------------- The --deployment-type flag can be passed to bin/cluster to specify the deployment type 1. To launch an online cluster (requires access to private repositories and amis): ``` bin/cluster create aws --deployment-type=online <cluster-id> ``` Note: If no deployment type is specified, then the default is origin.
{ "content_hash": "78876294b0cec35ff7dba5c0da01ba94", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 182, "avg_line_length": 32.343511450381676, "alnum_prop": 0.6990795374085438, "repo_name": "cgwalters/openshift-ansible", "id": "0e3128a927e13db96cb562ac96d76886c7cd7ca2", "size": "4238", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "README_AWS.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "215010" }, { "name": "Ruby", "bytes": "3270" }, { "name": "Shell", "bytes": "10297" }, { "name": "VimL", "bytes": "459" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title><%= title %></title> <meta name="description" content=""> <!-- 兼容性问题,使用浏览器最高版本来渲染--> <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1"> <% include ../../themes/themes/themes.html %> </head> <body ng-app="hopefutureBlogApp" ng-controller="HopefutureBlogCtrl"> <% include ../../views/common/header.html %> <% if (overdue) { %> <div class="container"> <p class="well margin-top-hg">您的重置密码链接已过期,请重新 <a ng-href="/forgot#/password">申请</a>。</p> </div> <% }else { %> <div ng-include="'../views/account/reset-password.html'" ng-controller="ResetPasswordCtrl" ng-init="accountId='<%= accountId %>'"></div> <% } %> <% include ../../views/common/footer.html %> <!-- build:js ../../scripts/vendor3.js --> <script src="../../bower_components/jquery/dist/jquery.js"></script> <script src="../../bower_components/angular/angular.js"></script> <script src="../../bower_components/jquery-validation/dist/jquery.validate.js"></script> <script src="../../bower_components/bootstrap/dist/js/bootstrap.js"></script> <script src="../../bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script> <!--校验国际化 --> <script src="../../bower_components/jquery-validation/src/localization/messages_zh.js"></script> <!-- endbuild --> <!-- build:js ../../scripts/reset-password.js --> <script src="../../scripts/hopefuture/hf_validate.js"></script> <script src="../../scripts/apps/account/app-reset-password.js"></script> <script src="../../scripts/services/httpInterceptor.js"></script> <script src="../../scripts/services/account/service-reset-password.js"></script> <script src="../../scripts/controllers/controller-common.js"></script> <script src="../../scripts/controllers/controller-hopefuture-blog.js"></script> <script src="../../scripts/controllers/account/controller-reset-password.js"></script> <script src="../../scripts/directives/account/directive-reset-password.js"></script> <!-- endbuild --> </body> </html>
{ "content_hash": "4e1a283ba21a94012d1a34ca5a551099", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 136, "avg_line_length": 40.509803921568626, "alnum_prop": 0.6761858664085189, "repo_name": "linder0209/hopefuture-blog", "id": "4a314e71f841517f5b2ee49c248e5b336f2c899b", "size": "2148", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/account/reset-password/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "24137" }, { "name": "CSS", "bytes": "28503419" }, { "name": "HTML", "bytes": "1924116" }, { "name": "JavaScript", "bytes": "2314577" } ], "symlink_target": "" }
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <!-- Copyright (C) 2006 Joe Walnes. Copyright (C) 2006, 2007, 2009, 2011, 2012, 2013 XStream committers. All rights reserved. The software in this package is published under the terms of the BSD style license a copy of which has been included with this distribution in the LICENSE.txt file. Created on 18. October 2006 by Mauro Talevi --> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.thoughtworks.xstream</groupId> <artifactId>xstream-parent</artifactId> <version>1.4.8</version> </parent> <artifactId>xstream-benchmark</artifactId> <packaging>jar</packaging> <name>XStream Benchmark</name> <description>Benchmark suite of XStream.</description> <profiles> <profile> <id>jdk18-ge</id> <activation> <jdk>[1.8,)</jdk> </activation> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <configuration> <excludePackageNames>com.thoughtworks.xstream.tools.benchmark.model</excludePackageNames> </configuration> </plugin> </plugins> </build> <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>${version.plugin.maven.javadoc}</version> <configuration> <excludePackageNames>com.thoughtworks.xstream.tools.benchmark.model</excludePackageNames> <additionalparam>${javadoc.xdoclint}</additionalparam> <detectJavaApiLink>false</detectJavaApiLink> <source>${version.java.source}</source> <links> <link>${link.javadoc.javase}</link> </links> </configuration> </plugin> </plugins> </reporting> </profile> <profile> <id>jdk15-ge</id> <activation> <jdk>[1.5,)</jdk> </activation> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive combine.children="append"> <manifestFile>${project.build.directory}/OSGi/MANIFEST.MF</manifestFile> </archive> </configuration> </plugin> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <configuration> <instructions combine.children="append"> <Export-Package>!com.thoughtworks.xstream.tools.benchmark.model,com.thoughtworks.xstream.tools.benchmark.*;-noimport:=true</Export-Package> </instructions> </configuration> </plugin> </plugins> </build> </profile> </profiles> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>com.thoughtworks.xstream</groupId> <artifactId>xstream</artifactId> </dependency> <dependency> <groupId>net.sf.kxml</groupId> <artifactId>kxml2-min</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>commons-cli</groupId> <artifactId>commons-cli</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> </dependency> </dependencies> </project>
{ "content_hash": "c7043e70b0ed0efc5eea721ed477a75d", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 201, "avg_line_length": 32.588235294117645, "alnum_prop": 0.5981498194945848, "repo_name": "Groostav/XStream-GG", "id": "d6fb34a596964be9757f0ac103d42c87253a03a7", "size": "4432", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "xstream-benchmark/pom.xml", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "6974" }, { "name": "HTML", "bytes": "414213" }, { "name": "Java", "bytes": "2370913" }, { "name": "XSLT", "bytes": "1101" } ], "symlink_target": "" }
; Load 32 bytes (background and spite, 1st background) of palette from address ; PARAM1 - high byte of palette address ; PARAM2 - low byte of palette address ; Example: Loadpalette HIGH(palette), LOW(palette) LoadPalette .macro LDA #$3F ; set PPU working address 3F00 - palette STA $2006 LDA #$00 STA $2006 LDX #$00 ; reset counter LoadPaletteLoop\@: LDA \1, x ; load data from address (high byte PARAM1 and low byte PARAM2 + the value in x) STA $2007 INX CPX #$20 ; Compare X to 32, looping if not equal BNE LoadPaletteLoop\@ .endm ; Copies 1 tile from param 1 to video memory ; PARAM1 - Tile number in Name Table ; Example: Drawtile #$24 DrawTile .macro LDA \1 STA $2007 .endm ; Clear background ; PARAM1 - base adress of PPU page, allowed values $20, $24, $28, $2C ; PARAM2 - Tile Id that will fill rect ; Example: Clearscreen #$24 ClearScreen .macro MoveTo \1, #0, #0 LDA \2 LDY #0 ClearScreenRowLoop\@: LDX #0 ClearScreenColLoop\@: STA $2007 INX CPX #32 BNE ClearScreenColLoop\@ INY CPY #30 BNE ClearScreenRowLoop\@ LDA #$00 STA $2006 STA $2006 .endm ; Return address of VRAM for column and row parameters ; PARAM1 - column ; PARAM2 - row ; Example: ScreenAddress(5, 7) ScreenAddress .func (\1) + ((\2) << 5) ; Set PPU start adress ; PARAM1 - base adress of PPU page, allowed values $20, $24, $28, $2C ; PARAM2 - X position ; PARAM2 - Y position ; Example: MoveTo $20, #10, #7 MoveTo .macro LDA \1 ; Load page address STA TMP LDA \3 ; Load Y position, extract from it bits 3, 4 and store them to bit 2, 3 in high byte LSR A LSR A LSR A ADC TMP STA $2006 LDA \3 ; Load Y position, extract from it bits 0, 1 and 2 and store them to bits 5, 6 and 7 in low byte AND #%00000111 ASL A ASL A ASL A ASL A ASL A LDX \2 STX TMP ADC TMP STA $2006 .endm
{ "content_hash": "59a6ab3fda55ee29676169ce830d596c", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 105, "avg_line_length": 23.392857142857142, "alnum_prop": 0.6335877862595419, "repo_name": "yevgeniy-logachev/nesdev", "id": "90e1d4242f6af8c33141e7034ce487c77a1fe0be", "size": "1965", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "scrolltext/macros_video.asm", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "9957" } ], "symlink_target": "" }
package org.example.api; import java.util.Date; public class Person { private final String name; private final String firstname; private final Date birthDate; private Address address; public Person(String name, String firstname, Date birthDate, Address address){ this.name = name; this.firstname = firstname; this.birthDate = birthDate; this.address = address; } public Address getAddress() { return address; } public void setAddress(Address address) { this.address = address; } public String getName() { return name; } public String getFirstname() { return firstname; } public Date getBirthDate() { return birthDate; } }
{ "content_hash": "0de65f14b4f3c513a3718e86951de80e", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 79, "avg_line_length": 16.365853658536587, "alnum_prop": 0.7168405365126677, "repo_name": "ibcn-cloudlet/example", "id": "966226549bc9baf98260d0ef27bb130e6076d00e", "size": "2424", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "org.example.api/src/org/example/api/Person.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "30283" } ], "symlink_target": "" }
<?php namespace Native5\Services\Messaging; use Native5\Services\Messaging\MessagingException; use Native5\Services\Common\ApiClient; use Native5\Services\Messaging\Notifier; use Native5\Services\Messaging\Message; /** * RemoteMailNotifier */ class RemoteMailNotifier extends ApiClient implements Notifier { const MAX_ATTACHMENTS = 3; /** * notify * * @param Message $message Message to send * * @access public * @return NotificationStatus * @throws MessagingException */ public function notify(Message $message, $options = array()) { $logger = $GLOBALS['logger']; $logger->debug( 'Sending Mail ', array( $message->getRecipients(), $message->getBody(), ) ); $path = 'notifications/mail/send'; // Check for number of attachments at the top $attachments = $message->getAttachments(); if (count($attachments) > self::MAX_ATTACHMENTS) throw new \InvalidArgumentException("Can only send maximum ".self::MAX_ATTACHMENTS." attachments in a single mail."); // The base request $request = $this->_remoteServer->post($path) ->setPostField('type', 'sms') ->setPostField('subject', $message->getSubject()) ->setPostField('to', implode(';', $message->getRecipients())) ->setPostField('content', $message->getBody()); // Add options if present if (isset($options['priority'])) $request->setPostField('priority', $options['priority']); if (isset($options['priority'])) $request->setPostField('format', $options['format']); if (!empty($attachments) && is_array($attachments)) { foreach($attachments as $idx=>$attachment) { if (!empty($attachment) && file_exists($attachment)) // TODO: Remove HACK - sending files as attach[0], attach[1], attach[2] $request->addPostFile('attach['.$idx.']', $attachment); } } else // Force a multipart form data by attaching /dev/null $request->addPostFile('nullfile', '@/dev/null'); //// Add the duplicate aggregator for attachments //$request->getQuery()->setAggregator(new \Guzzle\Http\QueryAggregator\DuplicateAggregator); // Send the remote request try { $response = $request->send(); if ($response->getStatusCode() !== 200) { throw new MessagingException(); } $rawResponse = $response->getBody('true'); return $rawResponse; } catch (\Exception $e) { throw new MessagingException(); } }//end notify() } //end class
{ "content_hash": "c07e5df6be003f1688bacd7f24598c63", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 129, "avg_line_length": 32.40229885057471, "alnum_prop": 0.5753813409010288, "repo_name": "native5/native5-sdk-services-php", "id": "7f55ffc24abc31ace0114b91fbc1923b74808c25", "size": "3646", "binary": false, "copies": "1", "ref": "refs/heads/development", "path": "src/Native5/Services/Messaging/RemoteMailNotifier.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "PHP", "bytes": "65741" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>dpdgraph: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.5.2~camlp4 / dpdgraph - 0.6.9</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> dpdgraph <small> 0.6.9 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-11-08 00:01:27 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-11-08 00:01:27 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp4 4.03+1 Camlp4 is a system for writing extensible parsers for programming languages conf-findutils 1 Virtual package relying on findutils conf-which 1 Virtual package relying on which coq 8.5.2~camlp4 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.03.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.03.0 Official 4.03.0 release ocaml-config 1 OCaml Switch Configuration ocamlbuild 0.14.2 OCamlbuild is a build system with builtin rules to easily build most OCaml projects # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; license: &quot;LGPL-2.1-only&quot; homepage: &quot;https://github.com/karmaki/coq-dpdgraph&quot; build: [ [&quot;./configure&quot;] [&quot;echo&quot; &quot;%{jobs}%&quot; &quot;jobs for the linter&quot;] [make &quot;-j%{jobs}%&quot; &quot;WARN_ERR=&quot;] ] bug-reports: &quot;https://github.com/karmaki/coq-dpdgraph/issues&quot; dev-repo: &quot;git+https://github.com/karmaki/coq-dpdgraph.git&quot; install: [ [make &quot;install&quot; &quot;BINDIR=%{bin}%&quot;] ] depends: [ &quot;ocaml&quot; {} &quot;coq&quot; {&gt;= &quot;8.13&quot; &amp; &lt; &quot;8.14~&quot;} &quot;ocamlgraph&quot; ] authors: [ &quot;Anne Pacalet&quot; &quot;Yves Bertot&quot;] synopsis: &quot;Compute dependencies between Coq objects (definitions, theorems) and produce graphs&quot; url { src: &quot;https://github.com/Karmaki/coq-dpdgraph/releases/download/v0.6.9/coq-dpdgraph-0.6.9.tgz&quot; checksum: &quot;sha256=0858014eb3fa35be67a626478d1d5cf1f953cf329d39c372d08657dfd1fa0545&quot; } </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-dpdgraph.0.6.9 coq.8.5.2~camlp4</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.5.2~camlp4). The following dependencies couldn&#39;t be met: - coq-dpdgraph -&gt; coq &gt;= 8.13 -&gt; ocaml &gt;= 4.05.0 base of this switch (use `--unlock-base&#39; to force) 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-dpdgraph.0.6.9</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": "a3532ba1617ba8c68ad515e959c1a626", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 159, "avg_line_length": 41.49101796407186, "alnum_prop": 0.5388945013710492, "repo_name": "coq-bench/coq-bench.github.io", "id": "6725bc55cbc0054802c2efaa1748c6397f4ab4e1", "size": "6954", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.03.0-2.0.5/released/8.5.2~camlp4/dpdgraph/0.6.9.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
"""Manages the v6 batch definition schema""" from __future__ import unicode_literals from jsonschema import validate from jsonschema.exceptions import ValidationError from batch.definition.definition import BatchDefinition from batch.definition.exceptions import InvalidDefinition from recipe.diff.json.forced_nodes_v6 import convert_forced_nodes_to_v6, ForcedNodesV6 SCHEMA_VERSION = '7' SCHEMA_VERSIONS = ['6', '7'] BATCH_DEFINITION_SCHEMA = { 'type': 'object', 'required': ['version'], 'additionalProperties': False, 'properties': { 'version': { 'description': 'Version of the batch definition schema', 'type': 'string', }, 'supersedes': { 'description': 'If the batch should reprocess vs create new', 'type': 'boolean' }, 'dataset': { 'description': 'Id of the dataset on which the batch runs', 'type': 'integer', }, 'forced_nodes': { 'description': 'The recipe nodes that should be forced to re-process', 'type': 'object', }, 'previous_batch': { '$ref': '#/definitions/previous_batch', } }, 'definitions': { 'previous_batch': { 'description': 'Links this batch to a previous batch and re-processes the previous batch\'s recipes', 'type': 'object', 'required': ['root_batch_id'], 'additionalProperties': False, 'properties': { 'root_batch_id': { 'description': 'The root ID of the previous batch', 'type': 'integer', }, 'forced_nodes': { 'description': 'The recipe nodes that should be forced to re-process', 'type': 'object', }, }, }, }, } def convert_definition_to_v6(definition): """Returns the v6 definition JSON for the given batch definition :param definition: The batch definition :type definition: :class:`batch.definition.definition.BatchDefinition` :returns: The v6 definition JSON :rtype: :class:`batch.definition.json.definition_v6.BatchDefinitionV6` """ json_dict = {'version': SCHEMA_VERSION} if definition.root_batch_id is not None: prev_batch_dict = {'root_batch_id': definition.root_batch_id} if definition.forced_nodes: prev_batch_dict['forced_nodes'] = convert_forced_nodes_to_v6(definition.forced_nodes).get_dict() json_dict['previous_batch'] = prev_batch_dict if definition.dataset: json_dict['dataset'] = definition.dataset if definition.supersedes is not None: json_dict['supersedes'] = definition.supersedes if definition.forced_nodes: json_dict['forced_nodes'] = convert_forced_nodes_to_v6(definition.forced_nodes).get_dict() return BatchDefinitionV6(definition=json_dict, do_validate=False) class BatchDefinitionV6(object): """Represents a v6 definition JSON for a batch""" def __init__(self, definition=None, do_validate=False): """Creates a v6 batch definition JSON object from the given dictionary :param definition: The batch definition JSON dict :type definition: dict :param do_validate: Whether to perform validation on the JSON schema :type do_validate: bool :raises :class:`batch.definition.exceptions.InvalidDefinition`: If the given definition is invalid """ if not definition: definition = {} self._definition = definition if 'version' not in self._definition: self._definition['version'] = SCHEMA_VERSION if self._definition['version'] not in SCHEMA_VERSIONS: msg = '%s is an unsupported version number' % self._definition['version'] raise InvalidDefinition('INVALID_BATCH_DEFINITION', msg) try: if do_validate: validate(self._definition, BATCH_DEFINITION_SCHEMA) if 'previous_batch' in self._definition and 'forced_nodes' in self._definition['previous_batch']: ForcedNodesV6(self._definition['previous_batch']['forced_nodes'], do_validate=True) if 'forced_nodes' in self._definition: ForcedNodesV6(self._definition['forced_nodes'], do_validate=True) except ValidationError as ex: raise InvalidDefinition('INVALID_BATCH_DEFINITION', 'Invalid batch definition: %s' % unicode(ex)) def get_definition(self): """Returns the batch definition represented by this JSON :returns: The batch definition :rtype: :class:`batch.definition.definition.BatchDefinition`: """ definition = BatchDefinition() if 'dataset' in self._definition: definition.dataset = self._definition['dataset'] if 'forced_nodes' in self._definition: definition.forced_nodes = ForcedNodesV6(self._definition['forced_nodes']).get_forced_nodes() if 'supersedes' in self._definition: definition.supersedes = self._definition['supersedes'] if 'previous_batch' in self._definition: prev_batch_dict = self._definition['previous_batch'] definition.root_batch_id = prev_batch_dict['root_batch_id'] if 'forced_nodes' in prev_batch_dict: definition.forced_nodes = ForcedNodesV6(prev_batch_dict['forced_nodes']).get_forced_nodes() return definition def get_dict(self): """Returns the internal dictionary :returns: The internal dictionary :rtype: dict """ return self._definition
{ "content_hash": "0f8317a1a0d1f6a0c3a7792b6d377f51", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 113, "avg_line_length": 37.73202614379085, "alnum_prop": 0.61285293608176, "repo_name": "ngageoint/scale", "id": "a09469c5828bf292240bf35d2c198c5a6e32b0a1", "size": "5773", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "scale/batch/definition/json/definition_v6.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "7219" }, { "name": "CSS", "bytes": "12193" }, { "name": "Dockerfile", "bytes": "14853" }, { "name": "HCL", "bytes": "301" }, { "name": "HTML", "bytes": "48818" }, { "name": "JavaScript", "bytes": "503" }, { "name": "Makefile", "bytes": "5852" }, { "name": "Python", "bytes": "5295677" }, { "name": "Shell", "bytes": "26650" } ], "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_75) on Sun Mar 01 12:04:18 AEDT 2015 --> <title>TimeStampResponse (Bouncy Castle Library 1.52 API Specification)</title> <meta name="date" content="2015-03-01"> <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="TimeStampResponse (Bouncy Castle Library 1.52 API Specification)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em><b>Bouncy Castle Cryptography Library 1.52</b></em></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../org/bouncycastle/tsp/TimeStampRequestGenerator.html" title="class in org.bouncycastle.tsp"><span class="strong">Prev Class</span></a></li> <li><a href="../../../org/bouncycastle/tsp/TimeStampResponseGenerator.html" title="class in org.bouncycastle.tsp"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/bouncycastle/tsp/TimeStampResponse.html" target="_top">Frames</a></li> <li><a href="TimeStampResponse.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:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.bouncycastle.tsp</div> <h2 title="Class TimeStampResponse" class="title">Class TimeStampResponse</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.bouncycastle.tsp.TimeStampResponse</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="strong">TimeStampResponse</span> extends java.lang.Object</pre> <div class="block">Base class for an RFC 3161 Time Stamp Response object.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../org/bouncycastle/tsp/TimeStampResponse.html#TimeStampResponse(byte[])">TimeStampResponse</a></strong>(byte[]&nbsp;resp)</code> <div class="block">Create a TimeStampResponse from a byte array containing an ASN.1 encoding.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><code><strong><a href="../../../org/bouncycastle/tsp/TimeStampResponse.html#TimeStampResponse(java.io.InputStream)">TimeStampResponse</a></strong>(java.io.InputStream&nbsp;in)</code> <div class="block">Create a TimeStampResponse from an input stream containing an ASN.1 encoding.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../org/bouncycastle/tsp/TimeStampResponse.html#TimeStampResponse(org.bouncycastle.asn1.tsp.TimeStampResp)">TimeStampResponse</a></strong>(org.bouncycastle.asn1.tsp.TimeStampResp&nbsp;resp)</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</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>byte[]</code></td> <td class="colLast"><code><strong><a href="../../../org/bouncycastle/tsp/TimeStampResponse.html#getEncoded()">getEncoded</a></strong>()</code> <div class="block">return the ASN.1 encoded representation of this object.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>org.bouncycastle.asn1.cmp.PKIFailureInfo</code></td> <td class="colLast"><code><strong><a href="../../../org/bouncycastle/tsp/TimeStampResponse.html#getFailInfo()">getFailInfo</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../org/bouncycastle/tsp/TimeStampResponse.html#getStatus()">getStatus</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../org/bouncycastle/tsp/TimeStampResponse.html#getStatusString()">getStatusString</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../org/bouncycastle/tsp/TimeStampToken.html" title="class in org.bouncycastle.tsp">TimeStampToken</a></code></td> <td class="colLast"><code><strong><a href="../../../org/bouncycastle/tsp/TimeStampResponse.html#getTimeStampToken()">getTimeStampToken</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../org/bouncycastle/tsp/TimeStampResponse.html#validate(org.bouncycastle.tsp.TimeStampRequest)">validate</a></strong>(<a href="../../../org/bouncycastle/tsp/TimeStampRequest.html" title="class in org.bouncycastle.tsp">TimeStampRequest</a>&nbsp;request)</code> <div class="block">Check this response against to see if it a well formed response for the passed in request.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="TimeStampResponse(org.bouncycastle.asn1.tsp.TimeStampResp)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>TimeStampResponse</h4> <pre>public&nbsp;TimeStampResponse(org.bouncycastle.asn1.tsp.TimeStampResp&nbsp;resp) throws <a href="../../../org/bouncycastle/tsp/TSPException.html" title="class in org.bouncycastle.tsp">TSPException</a>, java.io.IOException</pre> <dl><dt><span class="strong">Throws:</span></dt> <dd><code><a href="../../../org/bouncycastle/tsp/TSPException.html" title="class in org.bouncycastle.tsp">TSPException</a></code></dd> <dd><code>java.io.IOException</code></dd></dl> </li> </ul> <a name="TimeStampResponse(byte[])"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>TimeStampResponse</h4> <pre>public&nbsp;TimeStampResponse(byte[]&nbsp;resp) throws <a href="../../../org/bouncycastle/tsp/TSPException.html" title="class in org.bouncycastle.tsp">TSPException</a>, java.io.IOException</pre> <div class="block">Create a TimeStampResponse from a byte array containing an ASN.1 encoding.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>resp</code> - the byte array containing the encoded response.</dd> <dt><span class="strong">Throws:</span></dt> <dd><code><a href="../../../org/bouncycastle/tsp/TSPException.html" title="class in org.bouncycastle.tsp">TSPException</a></code> - if the response is malformed.</dd> <dd><code>java.io.IOException</code> - if the byte array doesn't represent an ASN.1 encoding.</dd></dl> </li> </ul> <a name="TimeStampResponse(java.io.InputStream)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>TimeStampResponse</h4> <pre>public&nbsp;TimeStampResponse(java.io.InputStream&nbsp;in) throws <a href="../../../org/bouncycastle/tsp/TSPException.html" title="class in org.bouncycastle.tsp">TSPException</a>, java.io.IOException</pre> <div class="block">Create a TimeStampResponse from an input stream containing an ASN.1 encoding.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>in</code> - the input stream containing the encoded response.</dd> <dt><span class="strong">Throws:</span></dt> <dd><code><a href="../../../org/bouncycastle/tsp/TSPException.html" title="class in org.bouncycastle.tsp">TSPException</a></code> - if the response is malformed.</dd> <dd><code>java.io.IOException</code> - if the stream doesn't represent an ASN.1 encoding.</dd></dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getStatus()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getStatus</h4> <pre>public&nbsp;int&nbsp;getStatus()</pre> </li> </ul> <a name="getStatusString()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getStatusString</h4> <pre>public&nbsp;java.lang.String&nbsp;getStatusString()</pre> </li> </ul> <a name="getFailInfo()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getFailInfo</h4> <pre>public&nbsp;org.bouncycastle.asn1.cmp.PKIFailureInfo&nbsp;getFailInfo()</pre> </li> </ul> <a name="getTimeStampToken()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getTimeStampToken</h4> <pre>public&nbsp;<a href="../../../org/bouncycastle/tsp/TimeStampToken.html" title="class in org.bouncycastle.tsp">TimeStampToken</a>&nbsp;getTimeStampToken()</pre> </li> </ul> <a name="validate(org.bouncycastle.tsp.TimeStampRequest)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>validate</h4> <pre>public&nbsp;void&nbsp;validate(<a href="../../../org/bouncycastle/tsp/TimeStampRequest.html" title="class in org.bouncycastle.tsp">TimeStampRequest</a>&nbsp;request) throws <a href="../../../org/bouncycastle/tsp/TSPException.html" title="class in org.bouncycastle.tsp">TSPException</a></pre> <div class="block">Check this response against to see if it a well formed response for the passed in request. Validation will include checking the time stamp token if the response status is GRANTED or GRANTED_WITH_MODS.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>request</code> - the request to be checked against</dd> <dt><span class="strong">Throws:</span></dt> <dd><code><a href="../../../org/bouncycastle/tsp/TSPException.html" title="class in org.bouncycastle.tsp">TSPException</a></code> - if the request can not match this response.</dd></dl> </li> </ul> <a name="getEncoded()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getEncoded</h4> <pre>public&nbsp;byte[]&nbsp;getEncoded() throws java.io.IOException</pre> <div class="block">return the ASN.1 encoded representation of this object.</div> <dl><dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code></dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em><b>Bouncy Castle Cryptography Library 1.52</b></em></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../org/bouncycastle/tsp/TimeStampRequestGenerator.html" title="class in org.bouncycastle.tsp"><span class="strong">Prev Class</span></a></li> <li><a href="../../../org/bouncycastle/tsp/TimeStampResponseGenerator.html" title="class in org.bouncycastle.tsp"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/bouncycastle/tsp/TimeStampResponse.html" target="_top">Frames</a></li> <li><a href="TimeStampResponse.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:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "b01e3191dd86c9a8746ee5ae4c8c1186", "timestamp": "", "source": "github", "line_count": 385, "max_line_length": 308, "avg_line_length": 39.95064935064935, "alnum_prop": 0.6637409791300956, "repo_name": "GaloisInc/hacrypto", "id": "95a349913ea0552df3a018158176f11c3a5f8b7d", "size": "15381", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Java/BouncyCastle/bcpkix-jdk15on-152/javadoc/org/bouncycastle/tsp/TimeStampResponse.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AGS Script", "bytes": "62991" }, { "name": "Ada", "bytes": "443" }, { "name": "AppleScript", "bytes": "4518" }, { "name": "Assembly", "bytes": "25398957" }, { "name": "Awk", "bytes": "36188" }, { "name": "Batchfile", "bytes": "530568" }, { "name": "C", "bytes": "344517599" }, { "name": "C#", "bytes": "7553169" }, { "name": "C++", "bytes": "36635617" }, { "name": "CMake", "bytes": "213895" }, { "name": "CSS", "bytes": "139462" }, { "name": "Coq", "bytes": "320964" }, { "name": "Cuda", "bytes": "103316" }, { "name": "DIGITAL Command Language", "bytes": "1545539" }, { "name": "DTrace", "bytes": "33228" }, { "name": "Emacs Lisp", "bytes": "22827" }, { "name": "GDB", "bytes": "93449" }, { "name": "Gnuplot", "bytes": "7195" }, { "name": "Go", "bytes": "393057" }, { "name": "HTML", "bytes": "41466430" }, { "name": "Hack", "bytes": "22842" }, { "name": "Haskell", "bytes": "64053" }, { "name": "IDL", "bytes": "3205" }, { "name": "Java", "bytes": "49060925" }, { "name": "JavaScript", "bytes": "3476841" }, { "name": "Jolie", "bytes": "412" }, { "name": "Lex", "bytes": "26290" }, { "name": "Logos", "bytes": "108920" }, { "name": "Lua", "bytes": "427" }, { "name": "M4", "bytes": "2508986" }, { "name": "Makefile", "bytes": "29393197" }, { "name": "Mathematica", "bytes": "48978" }, { "name": "Mercury", "bytes": "2053" }, { "name": "Module Management System", "bytes": "1313" }, { "name": "NSIS", "bytes": "19051" }, { "name": "OCaml", "bytes": "981255" }, { "name": "Objective-C", "bytes": "4099236" }, { "name": "Objective-C++", "bytes": "243505" }, { "name": "PHP", "bytes": "22677635" }, { "name": "Pascal", "bytes": "99565" }, { "name": "Perl", "bytes": "35079773" }, { "name": "Prolog", "bytes": "350124" }, { "name": "Python", "bytes": "1242241" }, { "name": "Rebol", "bytes": "106436" }, { "name": "Roff", "bytes": "16457446" }, { "name": "Ruby", "bytes": "49694" }, { "name": "Scheme", "bytes": "138999" }, { "name": "Shell", "bytes": "10192290" }, { "name": "Smalltalk", "bytes": "22630" }, { "name": "Smarty", "bytes": "51246" }, { "name": "SourcePawn", "bytes": "542790" }, { "name": "SystemVerilog", "bytes": "95379" }, { "name": "Tcl", "bytes": "35696" }, { "name": "TeX", "bytes": "2351627" }, { "name": "Verilog", "bytes": "91541" }, { "name": "Visual Basic", "bytes": "88541" }, { "name": "XS", "bytes": "38300" }, { "name": "Yacc", "bytes": "132970" }, { "name": "eC", "bytes": "33673" }, { "name": "q", "bytes": "145272" }, { "name": "sed", "bytes": "1196" } ], "symlink_target": "" }
initializeWorkingDirAndScriptDir() { # Set working directory and remove all symbolic links workingDir=`pwd -P` # Go the script directory cd `dirname $0` # If the file itself is a symbolic link (ignoring parent directory links), then follow that link recursively # Note that scriptDir=`pwd -P` does not do that and cannot cope with a link directly to the file scriptFileBasename=`basename $0` while [ -L "$scriptFileBasename" ] ; do scriptFileBasename=`readlink $scriptFileBasename` # Follow the link cd `dirname $scriptFileBasename` scriptFileBasename=`basename $scriptFileBasename` done # Set script directory and remove other symbolic links (parent directory links) scriptDir=`pwd -P` } initializeWorkingDirAndScriptDir droolsjbpmOrganizationDir="$scriptDir/../../.." if [ $# != 1 ] && [ $# != 2 ] ; then echo echo "Usage:" echo " $0 kie version" echo "For example:" echo " $0 6.1.0.Final" echo exit 1 fi kieVersion=$1 echo "The kie-version: ${kieVersion}" echo -n "Is this ok? (Hit control-c if is not): " read ok cd $droolsjbpmOrganizationDir mkdir filemgmt_links cd filemgmt_links urlBase_drools="[email protected]:" ############################################################################### # latest drools links ############################################################################### touch ${kieVersion} rm latest ln -s ${kieVersion} latest echo "Uploading normal links..." rsync -a -e "ssh -i $HOME/.ssh/drools/id_rsa" --protocol=28 latest $urlBase_drools/downloads_htdocs/drools/release/ rsync -a -e "ssh -i $HOME/.ssh/drools/id_rsa" --protocol=28 latest $urlBase_drools/docs_htdocs/drools/release/ ############################################################################### # latestFinal drools links ############################################################################### if [[ "${kieVersion}" == *Final* ]]; then rm latestFinal ln -s ${kieVersion} latestFinal echo "Uploading Final links..." rsync -a -e "ssh -i $HOME/.ssh/drools/id_rsa" --protocol=28 latestFinal $urlBase_drools/downloads_htdocs/drools/release/ rsync -a -e "ssh -i $HOME/.ssh/drools/id_rsa" --protocol=28 latestFinal $urlBase_drools/docs_htdocs/drools/release/ fi urlBase_optaplanner="[email protected]:" ############################################################################### # latest optaplanner links ############################################################################### touch ${kieVersion} rm latest ln -s ${kieVersion} latest echo "Uploading normal links for optaplanner..." rsync -a -e "ssh -i $HOME/.ssh/optaplanner/id_rsa" --protocol=28 latest $urlBase_optaplanner/downloads_htdocs/optaplanner/release/ rsync -a -e "ssh -i $HOME/.ssh/optaplanner/id_rsa" --protocol=28 latest $urlBase_optaplanner/docs_htdocs/optaplanner/release/ ############################################################################### # latestFinal optaplanner links ############################################################################### if [[ "${kieVersion}" == *Final* ]]; then rm latestFinal ln -s ${kieVersion} latestFinal echo "Uploading Final links for optaplanner..." rsync -a -e "ssh -i $HOME/.ssh/optaplanner/id_rsa" --protocol=28 latestFinal $urlBase_optaplanner/downloads_htdocs/optaplanner/release/ rsync -a -e "ssh -i $HOME/.ssh/optaplanner/id_rsa" --protocol=28 latestFinal $urlBase_optaplanner/docs_htdocs/optaplanner/release/ fi urlBase_jbpm="[email protected]:" ############################################################################### # latest jbpm links ############################################################################### touch ${kieVersion} rm latest ln -s ${kieVersion} latest echo "Uploading normal links for jbpm..." rsync -a -e "ssh -i $HOME/.ssh/jbpm/id_rsa" --protocol=28 latest $urlBase_jbpm/downloads_htdocs/jbpm/release/ rsync -a -e "ssh -i $HOME/.ssh/jbpm/id_rsa" --protocol=28 latest $urlBase_jbpm/docs_htdocs/jbpm/release/ ############################################################################### # latestFinal jbpm links ############################################################################### if [[ "${kieVersion}" == *Final* ]]; then rm latestFinal ln -s ${kieVersion} latestFinal echo "Uploading Final links for jbpm..." rsync -a -e "ssh -i $HOME/.ssh/jbpm/id_rsa" --protocol=28 latestFinal $urlBase_jbpm/downloads_htdocs/jbpm/release/ rsync -a -e "ssh -i $HOME/.ssh/jbpm/id_rsa" --protocol=28 latestFinal $urlBase_jbpm/docs_htdocs/jbpm/release/ fi ############################################################################### # remove filemgmt_links directory ############################################################################### cd .. rm -rf filemgmt_links
{ "content_hash": "66e65d4a56b7b65a4637d59e4702594b", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 139, "avg_line_length": 39.85245901639344, "alnum_prop": 0.5462772521596051, "repo_name": "droolsjbpm/droolsjbpm-build-bootstrap", "id": "af24a76fd9fd23e38303b62d0d391a9bb2fe5499", "size": "5346", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "script/release/create_filemgmt_links.sh", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5929" }, { "name": "Perl", "bytes": "17192" }, { "name": "Shell", "bytes": "39438" } ], "symlink_target": "" }
SameOriginObserver::SameOriginObserver( content::WebContents* observed_contents, const url::Origin& reference_origin, base::RepeatingCallback<void(content::WebContents*)> on_same_origin_state_changed) : content::WebContentsObserver(observed_contents), reference_origin_(reference_origin), on_same_origin_state_changed_(on_same_origin_state_changed) { DCHECK(observed_contents); is_same_origin_ = reference_origin_.IsSameOriginWith( observed_contents->GetMainFrame()->GetLastCommittedOrigin()); } SameOriginObserver::~SameOriginObserver() = default; void SameOriginObserver::PrimaryPageChanged(content::Page& page) { bool is_now_same_origin = reference_origin_.IsSameOriginWith( page.GetMainDocument().GetLastCommittedOrigin()); if (is_same_origin_ != is_now_same_origin) { is_same_origin_ = is_now_same_origin; on_same_origin_state_changed_.Run(web_contents()); } }
{ "content_hash": "0574e4b2f95f4515793e05207ea12080", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 67, "avg_line_length": 38.958333333333336, "alnum_prop": 0.7315508021390374, "repo_name": "scheib/chromium", "id": "bcd2583fdc81ada255f5f34c7bcb4f8001c461e7", "size": "1214", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "chrome/browser/media/webrtc/same_origin_observer.cc", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_51) on Fri Jul 19 02:58:57 EDT 2013 --> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> <TITLE> Uses of Class org.apache.solr.request.SimpleFacets (Solr 4.4.0 API) </TITLE> <META NAME="date" CONTENT="2013-07-19"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.solr.request.SimpleFacets (Solr 4.4.0 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/solr/request/SimpleFacets.html" title="class in org.apache.solr.request"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/solr/request//class-useSimpleFacets.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="SimpleFacets.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>org.apache.solr.request.SimpleFacets</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../org/apache/solr/request/SimpleFacets.html" title="class in org.apache.solr.request">SimpleFacets</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.solr.handler.component"><B>org.apache.solr.handler.component</B></A></TD> <TD> <A HREF="../../../../../org/apache/solr/handler/component/SearchComponent.html" title="class in org.apache.solr.handler.component"><CODE>SearchComponent</CODE></A> implementations for use in <A HREF="../../../../../org/apache/solr/handler/component/SearchHandler.html" title="class in org.apache.solr.handler.component"><CODE>SearchHandler</CODE></A>&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.solr.handler.component"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../org/apache/solr/request/SimpleFacets.html" title="class in org.apache.solr.request">SimpleFacets</A> in <A HREF="../../../../../org/apache/solr/handler/component/package-summary.html">org.apache.solr.handler.component</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Subclasses of <A HREF="../../../../../org/apache/solr/request/SimpleFacets.html" title="class in org.apache.solr.request">SimpleFacets</A> in <A HREF="../../../../../org/apache/solr/handler/component/package-summary.html">org.apache.solr.handler.component</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/solr/handler/component/PivotFacetHelper.html" title="class in org.apache.solr.handler.component">PivotFacetHelper</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/solr/request/SimpleFacets.html" title="class in org.apache.solr.request"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/solr/request//class-useSimpleFacets.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="SimpleFacets.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <i>Copyright &copy; 2000-2013 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> </BODY> </HTML>
{ "content_hash": "40c4d25677da1d0028865c66d02a5d40", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 300, "avg_line_length": 43.03045685279188, "alnum_prop": 0.6188510086115371, "repo_name": "vertexinc/solr-4.4.0", "id": "92550e37d1f6308e927b8d6f49161c807b8db09e", "size": "8477", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "docs/solr-core/org/apache/solr/request/class-use/SimpleFacets.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "36397" }, { "name": "JavaScript", "bytes": "21408" }, { "name": "Shell", "bytes": "7165" }, { "name": "XSLT", "bytes": "48649" } ], "symlink_target": "" }
from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtNetwork import * import sys import struct import time from oscutil import * class OSCController(QWidget): '''A simple widget that creates some basic controls that send OSC events''' def __init__(self): super(OSCController,self).__init__() self.oscsocket = QUdpSocket() self.oschost = QHostAddress(QHostAddress.LocalHost) self.oscport = 8000 self.toplayout = QVBoxLayout(self) self.slider = QSlider(Qt.Horizontal) self.slider.setMinimum(0) self.slider.setMaximum(1000) self.slider.setTracking(True) self.slider.valueChanged.connect(self.sliderCB) self.toplayout.addWidget(self.slider) self.trigger = QPushButton('Impulse') self.trigger.clicked.connect(self.triggerCB) self.toplayout.addWidget(self.trigger) self.bundle = QPushButton('Bundle') self.bundle.clicked.connect(self.bundleCB) self.toplayout.addWidget(self.bundleCB) self.gridlayout = QGridLayout() # we need an intermediate function to capture the values of i,j def toggleCBFor(i,j): return lambda val: self.toggleCB(val,i,j) for i in range(8): for j in range(8): toggle = QCheckBox() toggle.clicked.connect(toggleCBFor(i,j)) self.gridlayout.addWidget(toggle,i,j) self.toplayout.addLayout(self.gridlayout) def sliderCB(self,value): self.sendOSC(osc_message('/slider',[float(value)/1000.0])) def triggerCB(self): self.sendOSC(osc_message('/trigger',[Impulse()])) def bundleCB(self): self.sendOSC(osc_bundle(Timetag(time.time()), [osc_bundle(Timetag(time.time()), [osc_message('/trigger',[Impulse()]), osc_bundle(Timetag(time.time()),[])])])) def toggleCB(self,state,i,j): self.sendOSC(osc_message('/toggle%d%d'%(i,j),[bool(state)])) def sendOSC(self,m): self.oscsocket.writeDatagram(QByteArray(m),self.oschost,self.oscport) app = QApplication(sys.argv) osc = OSCController() osc.show() # the following line makes the window appear on top # of the other windows on OSX osc.raise_() sys.exit(app.exec_())
{ "content_hash": "cd5ebe4996c94816b555088dd2502650", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 85, "avg_line_length": 31.76, "alnum_prop": 0.6192275398824517, "repo_name": "synaesthetic/osctools", "id": "bc1fa63e6e13970ddd57facc663c11da4451c109", "size": "2511", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "oscpy/qclient.py", "mode": "33261", "license": "mit", "language": [ { "name": "Python", "bytes": "13082" } ], "symlink_target": "" }
package toml import ( "errors" "io/ioutil" "runtime" "strings" ) // Definition of a TomlTree. // This is the result of the parsing of a TOML file. type TomlTree map[string]interface{} // Keys returns the keys of the toplevel tree. // Warning: this is a costly operation. func (t *TomlTree) Keys() []string { keys := make([]string, 0) mp := (map[string]interface{})(*t) for k, _ := range mp { keys = append(keys, k) } return keys } // Get the value at key in the TomlTree. // Key is a dot-separated path (e.g. a.b.c). // Returns nil if the path does not exist in the tree. func (t *TomlTree) Get(key string) interface{} { subtree := t keys := strings.Split(key, ".") for _, intermediate_key := range keys[:len(keys)-1] { _, exists := (*subtree)[intermediate_key] if !exists { return nil } subtree = (*subtree)[intermediate_key].(*TomlTree) } return (*subtree)[keys[len(keys)-1]] } // Same as Get but with a default value func (t *TomlTree) GetDefault(key string, def interface{}) interface{} { val := t.Get(key) if val == nil { return def } return val } // Set an element in the tree. // Key is a dot-separated path (e.g. a.b.c). // Creates all necessary intermediates trees, if needed. func (t *TomlTree) Set(key string, value interface{}) { subtree := t keys := strings.Split(key, ".") for _, intermediate_key := range keys[:len(keys)-1] { _, exists := (*subtree)[intermediate_key] if !exists { var new_tree TomlTree = make(TomlTree) (*subtree)[intermediate_key] = &new_tree } subtree = (*subtree)[intermediate_key].(*TomlTree) } (*subtree)[keys[len(keys)-1]] = value } // createSubTree takes a tree and a key and create the necessary intermediate // subtrees to create a subtree at that point. In-place. // // e.g. passing a.b.c will create (assuming tree is empty) tree[a], tree[a][b] // and tree[a][b][c] func (t *TomlTree) createSubTree(key string) { subtree := t for _, intermediate_key := range strings.Split(key, ".") { _, exists := (*subtree)[intermediate_key] if !exists { var new_tree TomlTree = make(TomlTree) (*subtree)[intermediate_key] = &new_tree } subtree = ((*subtree)[intermediate_key]).(*TomlTree) } } // Create a TomlTree from a string. func Load(content string) (tree *TomlTree, err error) { defer func() { if r := recover(); r != nil { if _, ok := r.(runtime.Error); ok { panic(r) } err = errors.New(r.(string)) } }() _, flow := lex(content) tree = parse(flow) return } // Create a TomlTree from a file. func LoadFile(path string) (tree *TomlTree, err error) { buff, ferr := ioutil.ReadFile(path) if ferr != nil { err = ferr } else { s := string(buff) tree, err = Load(s) } return }
{ "content_hash": "1249d1742db3920c3696e9616c298639", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 78, "avg_line_length": 24.70909090909091, "alnum_prop": 0.6431199411331862, "repo_name": "vimeo/carbon-tagger", "id": "e5e9c1a79541d73acf337658ab1a2495a8c5ac75", "size": "2893", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_third_party/github.com/pelletier/go-toml/toml.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "11497" }, { "name": "Shell", "bytes": "997" } ], "symlink_target": "" }
jQuery(document).ready(function($){ //detect address change and determine lat and long values from entry. $("#Form_ItemEditForm_Address").on("change",function(e){ if($.trim(e.target.value).length > 0 ){ $.ajax({ type: "POST", url: "AddressLookup_Controller/findLatLongForAddress", data: { address: e.target.value } }).done(function( msg ) { var data = JSON.parse(msg); $("#Form_ItemEditForm_Latitude").val(data.Latitude); $("#Form_ItemEditForm_Longitude").val(data.Longitude); //e.preventDefault(); }); } }); });
{ "content_hash": "6adb0095341548303ce2a9f472f46b5e", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 73, "avg_line_length": 38.333333333333336, "alnum_prop": 0.5202898550724637, "repo_name": "cbryer/silverstripe-google-store-finder", "id": "a29fc7fc82c562276835f198cae98b2dd424b036", "size": "690", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "javascript/store-creator.js", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
namespace autofill_assistant { // An action to display a message. class TellAction : public Action { public: explicit TellAction(ActionDelegate* delegate, const ActionProto& proto); TellAction(const TellAction&) = delete; TellAction& operator=(const TellAction&) = delete; ~TellAction() override; private: // Overrides Action: void InternalProcessAction(ProcessActionCallback callback) override; }; } // namespace autofill_assistant #endif // COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_ACTIONS_TELL_ACTION_H_
{ "content_hash": "62e928c3c5caadd40cdd126101586b72", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 74, "avg_line_length": 29.11111111111111, "alnum_prop": 0.7633587786259542, "repo_name": "ric2b/Vivaldi-browser", "id": "1c4304c1c0c848df603c9d25edc00d2915814e4b", "size": "896", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "chromium/components/autofill_assistant/browser/actions/tell_action.h", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
package org.beiter.michael.eaudit4j.common; /** * This interface defines specification (getters, setters, maintenance methods) for fields to be used in audit events. */ public interface Field { /** * Get the name of the field. * <p> * This name is set, for instance, when the field is created. * * @return The name of the field */ String getName(); /** * Set the value of the field. * <p> * This method sets the encoding to {@link Encodings#PLAIN} (i.e. unencoded). * <p> * See {@link Field#setValue(byte[], Encodings)}. * * @param value The value to set */ void setValue(byte[] value); /** * Set the value of the field, indicating the encoding that has been used on the data represented by the value of * this field. * <p> * Note that, depending on the implementation, the value of the field may always be internal represented as binary * data, with this binary data being a binary representation of a plain text string, or a binary representation of * a hex-encoded string that represents some non-printable binary data. * <p> * When the encoding is set to a different value than {@link Encodings#PLAIN}, consumers of the field information * (e.g. processors) should attempt to decode the value of this field before further processing. * <p> * Note that implementations of this method <strong>should</strong> create a defensive copy of the provided * {@code value}), and store the copy in the field. You need to explicitly clear the data provided to this method * if it contains confidential information that you wish to destroy. * * @param value The value to set * @param encoding The encoding that was used to produce the data in the byte[] array */ void setValue(byte[] value, Encodings encoding); /** * Get the value of the field. * <p> * Use the {@link Field#getEncoding()} method to get an understanding if the value returned by this method * represents an unencoded or an encoded byte array, and what decoding mechanism would have to be used to restore * the plain value. * * @return The value of the field. */ byte[] getValue(); /** * Get the value of the field as an (encoded) char[]. * <p> * Use the {@link Field#getEncoding()} method to get an understanding if the value returned by this method * represents an unencoded or an encoded char array, and what decoding mechanism would have to be used to restore * the plain value. * * @param stringEncoding The String encoding to use when converting the byte value to a char value (e.g. UTF-8) * @return The value of the field as an (encoded) char[]. */ char[] getCharValue(String stringEncoding); /** * Get an indication on whether the binary data returned by {@link Field#getValue()} represents a encoded data, and * would have to be encoded e.g. for display. * * @return The recommended encoding for the value of this field. */ Encodings getEncoding(); /** * Create a copy of the field. * <p> * All elements of the field are copied into a new instance, which is returned to the caller. * * @return A copy of the field */ Field getCopy(); /** * Clears the content of the field's value. * <p> * This method overwrites the internal representation of the field value in the instance. Use this call to wipe * potentially confidential information from memory. */ void clear(); }
{ "content_hash": "88b5ecfb5e25d4b6c2d3bedc7b0c4dc1", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 119, "avg_line_length": 37.854166666666664, "alnum_prop": 0.6571271326362136, "repo_name": "mbeiter/eaudit4j", "id": "1a740cddbbfa01b7b740c1ffd96963f2ff5214fd", "size": "5364", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "common/src/main/java/org/beiter/michael/eaudit4j/common/Field.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "FreeMarker", "bytes": "1329" }, { "name": "Java", "bytes": "1073140" } ], "symlink_target": "" }
<?php /** * Based heavily on Tim Whitlock's VarnishAdminSocket.php from php-varnish * @link https://github.com/timwhitlock/php-varnish * * Copyright (c) 2010 Tim Whitlock * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /** * @method array help() * @method array ping() * @method array auth() * @method array banner() * @method array vcl_load() * @method array vcl_inline() * @method array vcl_use() * @method array vcl_discard() * @method array vcl_list() * @method array vcl_show() * @method array param_show() * @method array param_set() * Warning: ban_url does a non-lurker-friendly ban. This means it is not cleaned * up from the ban list. A long ban list will slow down Varnish. * @method array ban_url() * @method array ban() * @method array ban_list() */ class Nexcessnet_Turpentine_Model_Varnish_Admin_Socket { // possible command return codes, from vcli.h const CODE_SYNTAX = 100; const CODE_UNKNOWN = 101; const CODE_UNIMPL = 102; const CODE_TOOFEW = 104; const CODE_TOOMANY = 105; const CODE_PARAM = 106; const CODE_AUTH = 107; const CODE_OK = 200; const CODE_CANT = 300; const CODE_COMMS = 400; const CODE_CLOSE = 500; const READ_CHUNK_SIZE = 1024; // varnish default, can only be changed at Varnish startup time // if data to write is over this limit the actual run-time limit is checked // and used const CLI_CMD_LENGTH_LIMIT = 8192; /** * VCL config versions, should match config select values */ static protected $_VERSIONS = array( '2.1', '3.0' ); /** * Varnish socket connection * * @var resource */ protected $_varnishConn = null; protected $_host = '127.0.0.1'; protected $_port = 6082; protected $_private = null; protected $_authSecret = null; protected $_timeout = 5; protected $_version = null; //auto-detect public function __construct( array $options=array() ) { foreach( $options as $key => $value ) { switch( $key ) { case 'host': $this->setHost( $value ); break; case 'port': $this->setPort( $value ); break; case 'auth_secret': $this->setAuthSecret( $value ); break; case 'timeout': $this->setTimeout( $value ); break; case 'version': $this->setVersion( $value ); break; default: break; } } } /** * Provide simple Varnish methods * * Methods provided: help [command] ping [timestamp] auth response banner stats vcl.load <configname> <filename> vcl.inline <configname> <quoted_VCLstring> vcl.use <configname> vcl.discard <configname> vcl.list vcl.show <configname> param.show [-l] [<param>] param.set <param> <value> purge.url <regexp> purge <field> <operator> <arg> [&& <field> <oper> <arg>]... purge.list * * @param string $name method name * @param array $args method args * @return array */ public function __call( $name, $args ) { array_unshift( $args, self::CODE_OK ); array_unshift( $args, $this->_translateCommandMethod( $name ) ); return call_user_func_array( array( $this, '_command' ), $args ); } /** * Get the connection string for this socket (<host>:<port>) * * @return string */ public function getConnectionString() { return sprintf( '%s:%d', $this->getHost(), $this->getPort() ); } /** * Get the set host for this instance * * @return string */ public function getHost() { return $this->_host; } /** * Set the Varnish host name/ip to connect to * * @param string $host hostname or ip */ public function setHost( $host ) { $this->_close(); $this->_host = $host; return $this; } /** * Get the port set for this instance * * @return int */ public function getPort() { return $this->_port; } /** * Set the Varnish admin port * * @param int $port */ public function setPort( $port ) { $this->_close(); $this->_port = (int)$port; return $this; } /** * Set the Varnish admin auth secret, use null to indicate there isn't one * * @param string $authSecret */ public function setAuthSecret( $authSecret=null ) { $this->_authSecret = $authSecret; return $this; } /** * Set the timeout to connect to the varnish instance * * @param int $timeout */ public function setTimeout( $timeout ) { $this->_timeout = (int)$timeout; if( !is_null( $this->_varnishConn ) ) { stream_set_timeout( $this->_varnishConn, $this->_timeout ); } return $this; } /** * Explicitly set the version of the varnish instance we're connecting to * * @param string $version version from $_VERSIONS */ public function setVersion( $version ) { if( in_array( $version, self::$_VERSIONS ) ) { $this->_version = $version; } else { Mage::throwException( 'Unsupported Varnish version: ' . $version ); } } /** * Check if we're connected to Varnish * * @return boolean */ public function isConnected() { return !is_null( $this->_varnishConn ); } /** * Find out what version mode we're running in * * @return string */ public function getVersion() { if( is_null( $this->_version ) ) { $this->_version = $this->_determineVersion(); } return $this->_version; } /** * Stop the Varnish instance */ public function quit() { $this->_command( 'quit', self::CODE_CLOSE ); $this->_close(); } /** * Check if Varnish has a child running or not * * @return boolean */ public function status() { $response = $this->_command( 'status' ); if( !preg_match( '~Child in state (\w+)~', $response['text'], $match ) ) { return false; } else { return $match[1] === 'running'; } } /** * Stop the running child (if it is running) * * @return $this */ public function stop() { if( $this->status() ) { $this->_command( 'stop' ); } return $this; } /** * Start running the Varnish child * * @return $this */ public function start() { $this->_command( 'start' ); return $this; } /** * Establish a connection to the configured Varnish instance * * @return array */ protected function _connect() { $this->_varnishConn = fsockopen( $this->_host, $this->_port, $errno, $errstr, $this->_timeout ); if( !is_resource( $this->_varnishConn ) ) { Mage::throwException( sprintf( 'Failed to connect to Varnish on [%s:%d]: (%d) %s', $this->_host, $this->_port, $errno, $errstr ) ); } stream_set_blocking( $this->_varnishConn, 1 ); stream_set_timeout( $this->_varnishConn, $this->_timeout ); //varnish 2.0 doesn't spit out a banner on connection, this will need //to be changed if 2.0 support is ever added $banner = $this->_read(); if( $banner['code'] === self::CODE_AUTH ) { $challenge = substr( $banner['text'], 0, 32 ); $response = hash( 'sha256', sprintf( "%s\n%s%s\n", $challenge, $this->_authSecret, $challenge ) ); $this->_command( 'auth', self::CODE_OK, $response ); } else if( $banner['code'] !== self::CODE_OK ) { Mage::throwException( 'Varnish admin authentication failed: ' . $banner['text'] ); } return $this->isConnected(); } /** * Close the connection (if we're connected) * * @return $this */ protected function _close() { if( $this->isConnected() ) { fclose( $this->_varnishConn ); $this->_varnishConn = null; } return $this; } /** * Write data to the Varnish instance, a newline is automatically appended * * @param string $data data to write * @return $this */ protected function _write( $data ) { if( is_null( $this->_varnishConn ) ) { $this->_connect(); } $data = rtrim( $data ) . PHP_EOL; $dataLength = strlen( $data ); if( $dataLength >= self::CLI_CMD_LENGTH_LIMIT ) { $cliBufferResponse = $this->param_show( 'cli_buffer' ); if( preg_match( '~^cli_buffer\s+(\d+)\s+\[bytes\]~', $cliBufferResponse['text'], $match ) ) { $realLimit = (int)$match[1]; } else { Mage::helper( 'turpentine/debug' )->logWarn( 'Failed to determine Varnish cli_buffer limit, using default' ); $realLimit = self::CLI_CMD_LENGTH_LIMIT; } if( $dataLength >= $realLimit ) { Mage::throwException( sprintf( 'Varnish data to write over length limit by %d characters', $dataLength - $realLimit ) ); } } if( ( $byteCount = fwrite( $this->_varnishConn, $data ) ) !== $dataLength ) { Mage::throwException( sprintf( 'Varnish socket write error: %d != %d', $byteCount, $dataLength ) ); } return $this; } /** * Read a response from Varnish instance * * @return array tuple of the response (code, text) */ protected function _read() { $code = null; $len = -1; while( !feof( $this->_varnishConn ) ) { $response = fgets( $this->_varnishConn, self::READ_CHUNK_SIZE ); if( empty( $response ) ) { $streamMeta = stream_get_meta_data( $this->_varnishConn ); if( $streamMeta['timed_out'] ) { Mage::throwException( 'Varnish admin socket timeout' ); } } if( preg_match( '~^(\d{3}) (\d+)~', $response, $match ) ) { $code = (int)$match[1]; $len = (int)$match[2]; break; } } if( is_null( $code ) ) { Mage::throwException( 'Failed to read response code from Varnish' ); } else { $response = array( 'code' => $code, 'text' => '' ); while( !feof( $this->_varnishConn ) && strlen( $response['text'] ) < $len ) { $response['text'] .= fgets( $this->_varnishConn, self::READ_CHUNK_SIZE ); } return $response; } } /** * [_command description] * @param string $verb command name * @param integer $okCode=200 code that indicates command was successful * @param string ... command args * @return array */ protected function _command( $verb, $okCode=200 ) { $params = func_get_args(); //remove $verb array_shift( $params ); //remove $okCode (if it exists) array_shift( $params ); $cleanedParams = array(); foreach( $params as $param ) { $cp = addcslashes( $param, "\"\\" ); $cp = str_replace( PHP_EOL, '\n', $cp ); $cleanedParams[] = sprintf( '"%s"', $cp ); } $data = implode( ' ', array_merge( array( sprintf( '"%s"', $verb ) ), $cleanedParams ) ); $response = $this->_write( $data )->_read(); if( $response['code'] !== $okCode && !is_null( $okCode ) ) { Mage::helper( 'turpentine/debug' )->logDebug( 'Error on Varnish command: %s', $data ); Mage::throwException( sprintf( "Got unexpected response code from Varnish: %d\n%s", $response['code'], $response['text'] ) ); } else { return $response; } } /** * Handle v2.1 <> v3.0 command compatibility * * @param string $verb command to check * @return string */ protected function _translateCommandMethod( $verb ) { $command = str_replace( '_', '.', $verb ); switch( $this->getVersion() ) { case '2.1': $command = str_replace( 'ban', 'purge', $command ); break; case '3.0': $command = str_replace( 'purge', 'ban', $command ); break; default: Mage::throwException( 'Unrecognized Varnish version: ' . $this->_version ); } return $command; } /** * Guess the Varnish version based on the availability of the 'banner' command * * @return string */ protected function _determineVersion() { $resp = $this->_write( 'help' )->_read(); if( strpos( $resp['text'], 'ban.url' ) !== false ) { return '3.0'; } elseif( strpos( $resp['text'], 'purge.url' ) !== false && strpos( $resp['text'], 'banner' ) ) { return '2.1'; } else { Mage::throwException( 'Unable to determine instance version' ); } } }
{ "content_hash": "c3d44d59ece358553d2cfa8f92964d39", "timestamp": "", "source": "github", "line_count": 482, "max_line_length": 85, "avg_line_length": 31.12655601659751, "alnum_prop": 0.5168966206758648, "repo_name": "mikrotikAhmet/mbe-cpdev", "id": "db7580084943ccef15c3905238c159896f9ea78f", "size": "15820", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "app/code/community/Nexcessnet/Turpentine/Model/Varnish/Admin/Socket.php", "mode": "33261", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "19946" }, { "name": "ApacheConf", "bytes": "1148" }, { "name": "Batchfile", "bytes": "1036" }, { "name": "C", "bytes": "653" }, { "name": "CSS", "bytes": "2469504" }, { "name": "HTML", "bytes": "6706314" }, { "name": "JavaScript", "bytes": "1271689" }, { "name": "PHP", "bytes": "50903014" }, { "name": "Perl", "bytes": "30260" }, { "name": "PowerShell", "bytes": "1028" }, { "name": "Ruby", "bytes": "288" }, { "name": "Shell", "bytes": "11651" }, { "name": "XSLT", "bytes": "2135" } ], "symlink_target": "" }
/* * The following is auto-generated. Do not manually edit. See scripts/loops.js. */ #ifndef STDLIB_STRIDED_BASE_UNARY_T_T_H #define STDLIB_STRIDED_BASE_UNARY_T_T_H #include <stdint.h> /* * If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. */ #ifdef __cplusplus extern "C" { #endif /** * Applies a unary callback to strided input array elements and assigns results to elements in a strided output array. */ void stdlib_strided_t_t( uint8_t *arrays[], int64_t *shape, int64_t *strides, void *fcn ); #ifdef __cplusplus } #endif #endif // !STDLIB_STRIDED_BASE_UNARY_T_T_H
{ "content_hash": "34a126d4204178e1fc930afb0920ffc0", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 143, "avg_line_length": 23.892857142857142, "alnum_prop": 0.7219730941704036, "repo_name": "stdlib-js/stdlib", "id": "7f0b40870129d014d35bfa09baa07fcc51bfb7b9", "size": "1285", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "lib/node_modules/@stdlib/strided/base/unary/include/stdlib/strided/base/unary/t_t.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "21739" }, { "name": "C", "bytes": "15336495" }, { "name": "C++", "bytes": "1349482" }, { "name": "CSS", "bytes": "58039" }, { "name": "Fortran", "bytes": "198059" }, { "name": "HTML", "bytes": "56181" }, { "name": "Handlebars", "bytes": "16114" }, { "name": "JavaScript", "bytes": "85975525" }, { "name": "Julia", "bytes": "1508654" }, { "name": "Makefile", "bytes": "4806816" }, { "name": "Python", "bytes": "3343697" }, { "name": "R", "bytes": "576612" }, { "name": "Shell", "bytes": "559315" }, { "name": "TypeScript", "bytes": "19309407" }, { "name": "WebAssembly", "bytes": "5980" } ], "symlink_target": "" }
<?php /** * Gravatar shortcode for avatar and profile. * * Usage: * * [gravatar email="[email protected]" size="48"] * [gravatar_profile who="[email protected]"] * * @package Jetpack */ add_shortcode( 'gravatar', 'jetpack_gravatar_shortcode' ); add_shortcode( 'gravatar_profile', 'jetpack_gravatar_profile_shortcode' ); /** * Get gravatar using the email provided at the specified size. * * @since 4.5.0 * * @param array $atts Shortcode attributes. * * @return bool|string */ function jetpack_gravatar_shortcode( $atts ) { $atts = shortcode_atts( array( 'email' => '', 'size' => 96, ), $atts ); if ( empty( $atts['email'] ) || ! is_email( $atts['email'] ) ) { return false; } $atts['size'] = intval( $atts['size'] ); if ( 0 > $atts['size'] ) { $atts['size'] = 96; } return get_avatar( $atts['email'], $atts['size'] ); } /** * Display Gravatar profile * * @since 4.5.0 * * @param array $atts Shortcode attributes. * * @uses shortcode_atts() * @uses get_user_by() * @uses is_email() * @uses sanitize_email() * @uses sanitize_user() * @uses set_url_scheme() * @uses wpcom_get_avatar_url() * @uses get_user_attribute() * @uses esc_url() * @uses esc_html() * @uses _e() * * @return string */ function jetpack_gravatar_profile_shortcode( $atts ) { // Give each use of the shortcode a unique ID. static $instance = 0; // Process passed attributes. $atts = shortcode_atts( array( 'who' => null, ), $atts, 'jetpack_gravatar_profile' ); // Can specify username, user ID, or email address. if ( is_numeric( $atts['who'] ) ) { $user = get_user_by( 'id', (int) $atts['who'] ); } elseif ( is_email( $atts['who'] ) ) { $user = get_user_by( 'email', sanitize_email( $atts['who'] ) ); } elseif ( is_string( $atts['who'] ) ) { $user = get_user_by( 'login', sanitize_user( $atts['who'] ) ); } else { $user = false; } // Bail if we don't have a user. if ( false === $user ) { return false; } // Render the shortcode. $gravatar_url = 'https://gravatar.com/' . $user->user_login; if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { $avatar_url = wpcom_get_avatar_url( $user->ID, 96 ); $avatar_url = $avatar_url[0]; $user_location = get_user_attribute( $user->ID, 'location' ); } else { $avatar_url = get_avatar_url( $user->user_email, array( 'size' => 96 ) ); $user_location = get_user_meta( $user->ID, 'location', true ); } ob_start(); if ( class_exists( 'Jetpack_AMP_Support' ) && Jetpack_AMP_Support::is_amp_request() ) { wp_enqueue_style( 'gravatar-style', plugins_url( '/css/gravatar-amp.css', __FILE__ ), array(), JETPACK__VERSION ); } else { ?> <script type="text/javascript"> ( function() { if ( null === document.getElementById( 'gravatar-profile-embed-styles' ) ) { var headID = document.getElementsByTagName( 'head' )[0]; var styleNode = document.createElement( 'style' ); styleNode.type = 'text/css'; styleNode.id = 'gravatar-profile-embed-styles'; var gCSS = '.grofile-wrap { border: solid 1px #eee; padding: 10px; } .grofile { padding: 0 0 5px 0; } .grofile-left { float: left; display: block; width: 96px; margin-right: 15px; } .grofile .gravatar { margin-bottom: 5px; } .grofile-clear { clear: left; font-size: 1px; height: 1px; } .grofile ul li a { text-indent: -99999px; } .grofile .grofile-left a:hover { text-decoration: none !important; border: none !important; } .grofile-name { margin-top: 0; }'; if ( document.all ) { styleNode.innerText = gCSS; } else { styleNode.textContent = gCSS; } headID.appendChild( styleNode ); } } )(); </script> <?php } ?> <div class="grofile vcard" id="grofile-embed-<?php echo esc_attr( $instance ); ?>"> <div class="grofile-inner"> <div class="grofile-left"> <div class="grofile-img"> <a href="<?php echo esc_url( $gravatar_url ); ?>"> <img src="<?php echo esc_url( $avatar_url ); ?>" width="96" height="96" class="no-grav gravatar photo" /> </a> </div> </div> <div class="grofile-right"> <p class="grofile-name fn"> <strong><?php echo esc_html( $user->display_name ); ?></strong> <?php if ( ! empty( $user_location ) ) : ?> <br><span class="grofile-location adr"><?php echo esc_html( $user_location ); ?></span><?php endif; ?> </p> <p class="grofile-bio"><strong><?php esc_html_e( 'Bio:', 'jetpack' ); ?></strong> <?php echo wp_kses_post( $user->description ); ?></p> <p class="grofile-view"> <a href="<?php echo esc_url( $gravatar_url ); ?>"><?php esc_html_e( 'View complete profile', 'jetpack' ); ?></a> </p> </div> <span class="grofile-clear">&nbsp;</span> </div> </div> <?php // Increment and return the rendered profile. $instance++; return ob_get_clean(); }
{ "content_hash": "27ed6b9c2b847e4890720c74a3787b20", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 463, "avg_line_length": 28.39644970414201, "alnum_prop": 0.5999166493019379, "repo_name": "pjhooker/monferratopaesaggi", "id": "6a8e550929b9370ccda2f536458152b32c15fe5c", "size": "4799", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "trunk/wp-content/plugins/jetpack/modules/shortcodes/gravatar.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1796" } ], "symlink_target": "" }
static inline int sgx_wrapper_shutdown(int fd, int how) { int retval; ocall_shutdown(&retval, fd, how); return retval; } static inline ssize_t sgx_wrapper_recv(int fd, void *buf, size_t len, int flags) { ssize_t retval; ocall_recv(&retval, fd, buf, len, flags); return retval; } static inline ssize_t sgx_wrapper_send(int fd, const void *buf, size_t len, int flags) { ssize_t retval; ocall_send(&retval, fd, buf, len, flags); return retval; } static inline int sgx_wrapper_connect(int soc, const struct sockaddr *address, socklen_t address_len) { // printf("Call sgx_wrapper_connect: %d \n", soc); int retval = -1; sgx_status_t status; if (!sgx_is_within_enclave(address, sizeof(struct sockaddr))) { printf("\n WARNING: Call ocall_connect with sockaddr pointer outside enclave \n"); struct sockaddr *dup = (struct sockaddr *)malloc(sizeof(struct sockaddr)); memcpy(dup, address, sizeof(struct sockaddr)); status = ocall_connect(&retval, soc, dup, address_len); free(dup); } else { status = ocall_connect(&retval, soc, address, address_len); } if (status != SGX_SUCCESS) { printf("Ret error code: %x\n", status); } // printf("Return sgx_wrapper_connect: %d \n", retval); return retval; } static inline int sgx_wrapper_socket(int domain, int type, int protocol) { // printf("Call sgx_wrapper_socket: %d \n", domain); int retval; ocall_socket(&retval, domain, type, protocol); return retval; } static inline int sgx_wrapper_accept(int sockfd, struct sockaddr *address, socklen_t *addrlen) { // printf("Call sgx_wrapper_accept \n"); int retval; sgx_status_t status; if (address!=NULL) { // printf("\n WARNING: Call ocall_connect with sockaddr pointer outside enclave \n"); struct sockaddr *dup = (struct sockaddr *)malloc(sizeof(struct sockaddr)); memcpy(dup, address, sizeof(struct sockaddr)); status = ocall_accept(&retval, sockfd, dup, addrlen); memcpy(address, dup, sizeof(struct sockaddr)); free(dup); } else { // printf("right before ocall_accept\n"); status = ocall_accept(&retval, sockfd, address, addrlen); } if (status != SGX_SUCCESS) { printf("Ret error code: %x\n", status); } // printf("Return sgx_wrapper_accept: %d \n", retval); return retval; } static inline ssize_t sgx_wrapper_sendto(int sockfd, const void *buf, size_t len, int flags, const void *dest_addr_cast, unsigned int addrlen) { ssize_t retval; ocall_sendto(&retval, sockfd, buf, len, flags, dest_addr_cast, addrlen); return retval; } static inline int sgx_wrapper_socketpair(int domain, int type, int protocol, int sv[2]) { int retval; ocall_socketpair(&retval, domain, type, protocol, sv); return retval; } static inline int sgx_wrapper_setsockopt(int sockfd, int level, int optname, const void *optval, unsigned int optlen) { int retval; printf("The len is : %d - %d\n", optlen, sizeof(int)); printf("original opt value : %d \n", *((int*)optval)); ocall_setsockopt(&retval, sockfd, level, optname, optval, optlen); return retval; } static inline int sgx_wrapper_getsockopt(int sockfd, int level, int optname, void *optval, unsigned int *optlen) { int retval; ocall_getsockopt(&retval, sockfd, level, optname, optval, optlen); return retval; } static inline int sgx_wrapper_bind(int sockfd, const struct sockaddr * address, socklen_t addrlen) { // printf("Call sgx_wrapper_bind \n"); int retval = -1; sgx_status_t status; if (!sgx_is_within_enclave(address, sizeof(struct sockaddr))) { printf("\n WARNING: Call ocall_bind with sockaddr pointer outside enclave \n"); struct sockaddr *dup = (struct sockaddr *)malloc(sizeof(struct sockaddr)); memcpy(dup, address, sizeof(struct sockaddr)); status = ocall_bind(&retval, sockfd, dup, addrlen); free(dup); } else { // printf("Address before ocall: %p", address); status = ocall_bind(&retval, sockfd, address, addrlen); } if (status != SGX_SUCCESS) { printf("Ret error code: %x\n", status); } // printf("Return sgx_wrapper_bind: %d \n", retval); return retval; } static inline int sgx_wrapper_listen(int fd, int n) { int retval; ocall_listen(&retval, fd, n); return retval; } static inline int sgx_wrapper_getsockname(int fd, struct sockaddr * addr, socklen_t *len) { int retval; ocall_getsockname(&retval, fd, addr, len); return retval; } static inline int sgx_wrapper_getpeername(int fd, struct sockaddr * addr, socklen_t *len) { int retval; ocall_getpeername(&retval, fd, addr, len); return retval; } static inline ssize_t sgx_wrapper_recvfrom(int fd, void *buf, size_t n, int flags, struct sockaddr * addr, socklen_t *addr_len) { ssize_t retval; ocall_recvfrom(&retval, fd, buf, n, flags, addr, addr_len); return retval; } static inline ssize_t sgx_wrapper_sendmsg(int fd, const struct msghdr *message, int flags) { ssize_t retval; ocall_sendmsg(&retval, fd, message, flags); return retval; } static inline ssize_t sgx_wrapper_recvmsg(int fd, struct msghdr *message, int flags) { ssize_t retval; ocall_recvmsg(&retval, fd, message, flags); return retval; } #define shutdown(A, B) sgx_wrapper_shutdown(A,B) #define recv(A, B, C, D) sgx_wrapper_recv(A, B, C, D) #define send(A, B, C, D) sgx_wrapper_send(A, B, C, D) #define connect(A, B, C) sgx_wrapper_connect(A, B, C) #define socket(A, B, C) sgx_wrapper_socket(A, B, C) #define accept(A, B, C) sgx_wrapper_accept(A, B, C) #define sendto(A, B, C, D, E, F) sgx_wrapper_sendto(A, B, C, D, E, F) #define recvfrom(A, B, C, D, E, F) sgx_wrapper_recvfrom(A, B, C, D, E, F) #define socketpair(A, B, C, D) sgx_wrapper_socketpair(A, B, C, D) #define setsockopt(A, B, C, D, E) sgx_wrapper_setsockopt(A, B, C, D, E) #define getsockopt(A, B, C, D, E) sgx_wrapper_getsockopt(A, B, C, D, E) #define bind(A, B, C) sgx_wrapper_bind(A, B, C) #define listen(A, B) sgx_wrapper_listen(A, B) #define getsockname(A, B, C) sgx_wrapper_getsockname(A, B, C) #define getpeername(A, B, C) sgx_wrapper_getpeername(A, B, C) #define sendmsg(A, B, C) sgx_wrapper_sendmsg(A, B, C) #define recvmsg(A, B, C) sgx_wrapper_recvmsg(A, B, C) #endif
{ "content_hash": "2e492137ff39a658dec944d32204b281", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 142, "avg_line_length": 31.335051546391753, "alnum_prop": 0.6882710972199375, "repo_name": "shwetasshinde24/Panoply", "id": "18c5923dcd56b623f71cebf5a220784dabb5b687", "size": "6309", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "case-studies/openssl/topenssl/include/sgx_syssocket_util.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "3113146" }, { "name": "Batchfile", "bytes": "209548" }, { "name": "C", "bytes": "73361373" }, { "name": "C++", "bytes": "17167221" }, { "name": "CMake", "bytes": "14751" }, { "name": "CSS", "bytes": "7612" }, { "name": "DIGITAL Command Language", "bytes": "1268877" }, { "name": "Emacs Lisp", "bytes": "6556" }, { "name": "Groovy", "bytes": "841" }, { "name": "HTML", "bytes": "509176" }, { "name": "Java", "bytes": "182900" }, { "name": "M4", "bytes": "332844" }, { "name": "Makefile", "bytes": "4675748" }, { "name": "NSIS", "bytes": "2661" }, { "name": "OCaml", "bytes": "113154" }, { "name": "Objective-C", "bytes": "588278" }, { "name": "PHP", "bytes": "11225" }, { "name": "Perl", "bytes": "9089211" }, { "name": "PowerShell", "bytes": "1362" }, { "name": "Prolog", "bytes": "116708" }, { "name": "Python", "bytes": "252825" }, { "name": "Roff", "bytes": "1966528" }, { "name": "Ruby", "bytes": "717" }, { "name": "Scheme", "bytes": "16996" }, { "name": "Shell", "bytes": "1447986" }, { "name": "TeX", "bytes": "117609" }, { "name": "XS", "bytes": "17276" }, { "name": "eC", "bytes": "20508" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name Pleospora equiseti A.L. Sm., 1909 ### Remarks null
{ "content_hash": "858c80bf54e92cb6d89b036c86d6924d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 12.538461538461538, "alnum_prop": 0.6993865030674846, "repo_name": "mdoering/backbone", "id": "855bb020f958741a5e58c265d5908075b84ed6b5", "size": "220", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Dothideomycetes/Pleosporales/Pleosporaceae/Pleospora/Pleospora equiseti/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
#ifndef __WINE_SSPI_H__ #define __WINE_SSPI_H__ /* FIXME: #include <sdkddkver.h> */ #ifdef __cplusplus extern "C" { #endif #define SEC_ENTRY __stdcall typedef WCHAR SEC_WCHAR; typedef CHAR SEC_CHAR; #ifndef __SECSTATUS_DEFINED__ #define __SECSTATUS_DEFINED__ typedef LONG SECURITY_STATUS; #endif #ifdef UNICODE typedef SEC_WCHAR * SECURITY_PSTR; typedef const SEC_WCHAR * SECURITY_PCSTR; #else typedef SEC_CHAR * SECURITY_PSTR; typedef const SEC_CHAR * SECURITY_PCSTR; #endif #ifndef __SECHANDLE_DEFINED__ #define __SECHANDLE_DEFINED__ typedef struct _SecHandle { ULONG_PTR dwLower; ULONG_PTR dwUpper; } SecHandle, *PSecHandle; #endif #define SecInvalidateHandle(x) do { \ ((PSecHandle)(x))->dwLower = ((ULONG_PTR)((INT_PTR)-1)); \ ((PSecHandle)(x))->dwUpper = ((ULONG_PTR)((INT_PTR)-1)); \ } while (0) #define SecIsValidHandle(x) \ ((((PSecHandle)(x))->dwLower != ((ULONG_PTR)(INT_PTR)-1)) && \ (((PSecHandle)(x))->dwUpper != ((ULONG_PTR)(INT_PTR)-1))) typedef SecHandle CredHandle; typedef PSecHandle PCredHandle; #ifndef __WINE_CTXTHANDLE_DEFINED__ #define __WINE_CTXTHANDLE_DEFINED__ typedef SecHandle CtxtHandle; typedef PSecHandle PCtxtHandle; #endif typedef struct _SECURITY_INTEGER { ULONG LowPart; LONG HighPart; } SECURITY_INTEGER, *PSECURITY_INTEGER; typedef SECURITY_INTEGER TimeStamp, *PTimeStamp; #ifndef __UNICODE_STRING_DEFINED__ #define __UNICODE_STRING_DEFINED__ typedef struct _UNICODE_STRING { USHORT Length; /* bytes */ USHORT MaximumLength; /* bytes */ PWSTR Buffer; } UNICODE_STRING, *PUNICODE_STRING; #endif typedef UNICODE_STRING SECURITY_STRING, *PSECURITY_STRING; typedef struct _SecPkgInfoA { ULONG fCapabilities; USHORT wVersion; USHORT wRPCID; ULONG cbMaxToken; SEC_CHAR *Name; SEC_CHAR *Comment; } SecPkgInfoA, *PSecPkgInfoA; typedef struct _SecPkgInfoW { ULONG fCapabilities; USHORT wVersion; USHORT wRPCID; ULONG cbMaxToken; SEC_WCHAR *Name; SEC_WCHAR *Comment; } SecPkgInfoW, *PSecPkgInfoW; #define SecPkgInfo WINELIB_NAME_AW(SecPkgInfo) #define PSecPkgInfo WINELIB_NAME_AW(PSecPkgInfo) /* fCapabilities field of SecPkgInfo */ #define SECPKG_FLAG_INTEGRITY 0x00000001 #define SECPKG_FLAG_PRIVACY 0x00000002 #define SECPKG_FLAG_TOKEN_ONLY 0x00000004 #define SECPKG_FLAG_DATAGRAM 0x00000008 #define SECPKG_FLAG_CONNECTION 0x00000010 #define SECPKG_FLAG_MULTI_REQUIRED 0x00000020 #define SECPKG_FLAG_CLIENT_ONLY 0x00000040 #define SECPKG_FLAG_EXTENDED_ERROR 0x00000080 #define SECPKG_FLAG_IMPERSONATION 0x00000100 #define SECPKG_FLAG_ACCEPT_WIN32_NAME 0x00000200 #define SECPKG_FLAG_STREAM 0x00000400 #define SECPKG_FLAG_NEGOTIABLE 0x00000800 #define SECPKG_FLAG_GSS_COMPATIBLE 0x00001000 #define SECPKG_FLAG_LOGON 0x00002000 #define SECPKG_FLAG_ASCII_BUFFERS 0x00004000 #define SECPKG_FLAG_FRAGMENT 0x00008000 #define SECPKG_FLAG_MUTUAL_AUTH 0x00010000 #define SECPKG_FLAG_DELEGATION 0x00020000 #define SECPKG_FLAG_READONLY_WITH_CHECKSUM 0x00040000 #define SECPKG_FLAG_RESTRICTED_TOKENS 0x00080000 #define SECPKG_FLAG_NEGO_EXTENDER 0x00100000 #define SECPKG_FLAG_NEGOTIABLE2 0x00200000 #define SECPKG_FLAG_APPCONTAINER_PASSTHROUGH 0x00400000 #define SECPKG_FLAG_APPCONTAINER_CHECKS 0x00800000 #define SECPKG_ID_NONE 0xffff typedef struct _SecBuffer { ULONG cbBuffer; ULONG BufferType; PVOID pvBuffer; } SecBuffer, *PSecBuffer; /* values for BufferType */ #define SECBUFFER_EMPTY 0 #define SECBUFFER_DATA 1 #define SECBUFFER_TOKEN 2 #define SECBUFFER_PKG_PARAMS 3 #define SECBUFFER_MISSING 4 #define SECBUFFER_EXTRA 5 #define SECBUFFER_STREAM_TRAILER 6 #define SECBUFFER_STREAM_HEADER 7 #define SECBUFFER_NEGOTIATION_INFO 8 #define SECBUFFER_PADDING 9 #define SECBUFFER_STREAM 10 #define SECBUFFER_MECHLIST 11 #define SECBUFFER_MECHLIST_SIGNATURE 12 #define SECBUFFER_TARGET 13 #define SECBUFFER_CHANNEL_BINDINGS 14 #define SECBUFFER_ATTRMASK 0xf0000000 #define SECBUFFER_READONLY 0x80000000 #define SECBUFFER_READONLY_WITH_CHECKSUM 0x10000000 #define SECBUFFER_RESERVED 0x60000000 typedef struct _SecBufferDesc { ULONG ulVersion; ULONG cBuffers; PSecBuffer pBuffers; } SecBufferDesc, *PSecBufferDesc; /* values for ulVersion */ #define SECBUFFER_VERSION 0 typedef void (SEC_ENTRY *SEC_GET_KEY_FN)(void *Arg, void *Principal, ULONG KeyVer, void **Key, SECURITY_STATUS *Status); SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesA(PULONG pcPackages, PSecPkgInfoA *ppPackageInfo); SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesW(PULONG pcPackages, PSecPkgInfoW *ppPackageInfo); #define EnumerateSecurityPackages WINELIB_NAME_AW(EnumerateSecurityPackages) typedef SECURITY_STATUS (SEC_ENTRY *ENUMERATE_SECURITY_PACKAGES_FN_A)(PULONG, PSecPkgInfoA *); typedef SECURITY_STATUS (SEC_ENTRY *ENUMERATE_SECURITY_PACKAGES_FN_W)(PULONG, PSecPkgInfoW *); #define ENUMERATE_SECURITY_PACKAGES_FN WINELIB_NAME_AW(ENUMERATE_SECURITY_PACKAGES_FN_) SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesA( PCredHandle phCredential, ULONG ulAttribute, void *pBuffer); SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesW( PCredHandle phCredential, ULONG ulAttribute, void *pBuffer); #define QueryCredentialsAttributes WINELIB_NAME_AW(QueryCredentialsAttributes) typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CREDENTIALS_ATTRIBUTES_FN_A) (PCredHandle, ULONG, PVOID); typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CREDENTIALS_ATTRIBUTES_FN_W) (PCredHandle, ULONG, PVOID); #define QUERY_CREDENTIALS_ATTRIBUTES_FN WINELIB_NAME_AW(QUERY_CREDENTIALS_ATTRIBUTES_FN_) /* values for QueryCredentialsAttributes ulAttribute */ #define SECPKG_CRED_ATTR_NAMES 1 /* types for QueryCredentialsAttributes */ typedef struct _SecPkgCredentials_NamesA { SEC_CHAR *sUserName; } SecPkgCredentials_NamesA, *PSecPkgCredentials_NamesA; typedef struct _SecPkgCredentials_NamesW { SEC_WCHAR *sUserName; } SecPkgCredentials_NamesW, *PSecPkgCredentials_NamesW; #define SecPkgCredentials_Names WINELIB_NAME_AW(SecPkgCredentials_Names) SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleA( SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialsUse, PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry); SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleW( SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialsUse, PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry); #define AcquireCredentialsHandle WINELIB_NAME_AW(AcquireCredentialsHandle) /* flags for fCredentialsUse */ #define SECPKG_CRED_INBOUND 0x00000001 #define SECPKG_CRED_OUTBOUND 0x00000002 #define SECPKG_CRED_BOTH (SECPKG_CRED_INBOUND | SECPKG_CRED_OUTBOUND) #define SECPKG_CRED_DEFAULT 0x00000004 #define SECPKG_CRED_RESERVED 0xf0000000 typedef SECURITY_STATUS (SEC_ENTRY *ACQUIRE_CREDENTIALS_HANDLE_FN_A)( SEC_CHAR *, SEC_CHAR *, ULONG, PLUID, PVOID, SEC_GET_KEY_FN, PVOID, PCredHandle, PTimeStamp); typedef SECURITY_STATUS (SEC_ENTRY *ACQUIRE_CREDENTIALS_HANDLE_FN_W)( SEC_WCHAR *, SEC_WCHAR *, ULONG, PLUID, PVOID, SEC_GET_KEY_FN, PVOID, PCredHandle, PTimeStamp); #define ACQUIRE_CREDENTIALS_HANDLE_FN WINELIB_NAME_AW(ACQUIRE_CREDENTIALS_HANDLE_FN_) SECURITY_STATUS SEC_ENTRY FreeContextBuffer(PVOID pv); typedef SECURITY_STATUS (SEC_ENTRY *FREE_CONTEXT_BUFFER_FN)(PVOID); SECURITY_STATUS SEC_ENTRY FreeCredentialsHandle(PCredHandle phCredential); #define FreeCredentialHandle FreeCredentialsHandle typedef SECURITY_STATUS (SEC_ENTRY *FREE_CREDENTIALS_HANDLE_FN)(PCredHandle); SECURITY_STATUS SEC_ENTRY InitializeSecurityContextA( PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry); SECURITY_STATUS SEC_ENTRY InitializeSecurityContextW( PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry); #define InitializeSecurityContext WINELIB_NAME_AW(InitializeSecurityContext) typedef SECURITY_STATUS (SEC_ENTRY *INITIALIZE_SECURITY_CONTEXT_FN_A) (PCredHandle, PCtxtHandle, SEC_CHAR *, ULONG, ULONG, ULONG, PSecBufferDesc, ULONG, PCtxtHandle, PSecBufferDesc, ULONG *, PTimeStamp); typedef SECURITY_STATUS (SEC_ENTRY *INITIALIZE_SECURITY_CONTEXT_FN_W) (PCredHandle, PCtxtHandle, SEC_WCHAR *, ULONG, ULONG, ULONG, PSecBufferDesc, ULONG, PCtxtHandle, PSecBufferDesc, ULONG *, PTimeStamp); #define INITIALIZE_SECURITY_CONTEXT_FN WINELIB_NAME_AW(INITIALIZE_SECURITY_CONTEXT_FN_) /* flags for InitializeSecurityContext fContextReq and pfContextAttr */ #define ISC_REQ_DELEGATE 0x00000001 #define ISC_REQ_MUTUAL_AUTH 0x00000002 #define ISC_REQ_REPLAY_DETECT 0x00000004 #define ISC_REQ_SEQUENCE_DETECT 0x00000008 #define ISC_REQ_CONFIDENTIALITY 0x00000010 #define ISC_REQ_USE_SESSION_KEY 0x00000020 #define ISC_REQ_PROMPT_FOR_CREDS 0x00000040 #define ISC_REQ_USE_SUPPLIED_CREDS 0x00000080 #define ISC_REQ_ALLOCATE_MEMORY 0x00000100 #define ISC_REQ_USE_DCE_STYLE 0x00000200 #define ISC_REQ_DATAGRAM 0x00000400 #define ISC_REQ_CONNECTION 0x00000800 #define ISC_REQ_CALL_LEVEL 0x00001000 #define ISC_REQ_FRAGMENT_SUPPLIED 0x00002000 #define ISC_REQ_EXTENDED_ERROR 0x00004000 #define ISC_REQ_STREAM 0x00008000 #define ISC_REQ_INTEGRITY 0x00010000 #define ISC_REQ_IDENTIFY 0x00020000 #define ISC_REQ_NULL_SESSION 0x00040000 #define ISC_REQ_MANUAL_CRED_VALIDATION 0x00080000 #define ISC_REQ_RESERVED1 0x00100000 #define ISC_REQ_FRAGMENT_TO_FIT 0x00200000 #define ISC_RET_DELEGATE 0x00000001 #define ISC_RET_MUTUAL_AUTH 0x00000002 #define ISC_RET_REPLAY_DETECT 0x00000004 #define ISC_RET_SEQUENCE_DETECT 0x00000008 #define ISC_RET_CONFIDENTIALITY 0x00000010 #define ISC_RET_USE_SESSION_KEY 0x00000020 #define ISC_RET_USED_COLLECTED_CREDS 0x00000040 #define ISC_RET_USED_SUPPLIED_CREDS 0x00000080 #define ISC_RET_ALLOCATED_MEMORY 0x00000100 #define ISC_RET_USED_DCE_STYLE 0x00000200 #define ISC_RET_DATAGRAM 0x00000400 #define ISC_RET_CONNECTION 0x00000800 #define ISC_RET_INTERMEDIATE_RETURN 0x00001000 #define ISC_RET_CALL_LEVEL 0x00002000 #define ISC_RET_EXTENDED_ERROR 0x00004000 #define ISC_RET_STREAM 0x00008000 #define ISC_RET_INTEGRITY 0x00010000 #define ISC_RET_IDENTIFY 0x00020000 #define ISC_RET_NULL_SESSION 0x00040000 #define ISC_RET_MANUAL_CRED_VALIDATION 0x00080000 #define ISC_RET_RESERVED1 0x00100000 #define ISC_RET_FRAGMENT_ONLY 0x00200000 SECURITY_STATUS SEC_ENTRY AcceptSecurityContext( PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry); typedef SECURITY_STATUS (SEC_ENTRY *ACCEPT_SECURITY_CONTEXT_FN)(PCredHandle, PCtxtHandle, PSecBufferDesc, ULONG, ULONG, PCtxtHandle, PSecBufferDesc, ULONG *, PTimeStamp); /* flags for AcceptSecurityContext fContextReq and pfContextAttr */ #define ASC_REQ_DELEGATE 0x00000001 #define ASC_REQ_MUTUAL_AUTH 0x00000002 #define ASC_REQ_REPLAY_DETECT 0x00000004 #define ASC_REQ_SEQUENCE_DETECT 0x00000008 #define ASC_REQ_CONFIDENTIALITY 0x00000010 #define ASC_REQ_USE_SESSION_KEY 0x00000020 #define ASC_REQ_ALLOCATE_MEMORY 0x00000100 #define ASC_REQ_USE_DCE_STYLE 0x00000200 #define ASC_REQ_DATAGRAM 0x00000400 #define ASC_REQ_CONNECTION 0x00000800 #define ASC_REQ_CALL_LEVEL 0x00001000 #define ASC_REQ_FRAGMENT_SUPPLIED 0x00002000 #define ASC_REQ_EXTENDED_ERROR 0x00008000 #define ASC_REQ_STREAM 0x00010000 #define ASC_REQ_INTEGRITY 0x00020000 #define ASC_REQ_LICENSING 0x00040000 #define ASC_REQ_IDENTIFY 0x00080000 #define ASC_REQ_ALLOW_NULL_SESSION 0x00100000 #define ASC_REQ_ALLOW_NON_USER_LOGONS 0x00200000 #define ASC_REQ_ALLOW_CONTEXT_REPLAY 0x00400000 #define ASC_REQ_FRAGMENT_TO_FIT 0x00800000 #define ASC_REQ_FRAGMENT_NO_TOKEN 0x01000000 #define ASC_RET_DELEGATE 0x00000001 #define ASC_RET_MUTUAL_AUTH 0x00000002 #define ASC_RET_REPLAY_DETECT 0x00000004 #define ASC_RET_SEQUENCE_DETECT 0x00000008 #define ASC_RET_CONFIDENTIALITY 0x00000010 #define ASC_RET_USE_SESSION_KEY 0x00000020 #define ASC_RET_ALLOCATED_MEMORY 0x00000100 #define ASC_RET_USED_DCE_STYLE 0x00000200 #define ASC_RET_DATAGRAM 0x00000400 #define ASC_RET_CONNECTION 0x00000800 #define ASC_RET_CALL_LEVEL 0x00002000 #define ASC_RET_THIRD_LEG_FAILED 0x00004000 #define ASC_RET_EXTENDED_ERROR 0x00008000 #define ASC_RET_STREAM 0x00010000 #define ASC_RET_INTEGRITY 0x00020000 #define ASC_RET_LICENSING 0x00040000 #define ASC_RET_IDENTIFY 0x00080000 #define ASC_RET_NULL_SESSION 0x00100000 #define ASC_RET_ALLOW_NON_USER_LOGONS 0x00200000 #define ASC_RET_ALLOW_CONTEXT_REPLAY 0x00400000 #define ASC_RET_FRAGMENT_ONLY 0x00800000 #define ASC_RET_NO_TOKEN 0x01000000 /* values for TargetDataRep */ #define SECURITY_NATIVE_DREP 0x00000010 #define SECURITY_NETWORK_DREP 0x00000000 SECURITY_STATUS SEC_ENTRY CompleteAuthToken(PCtxtHandle phContext, PSecBufferDesc pToken); typedef SECURITY_STATUS (SEC_ENTRY *COMPLETE_AUTH_TOKEN_FN)(PCtxtHandle, PSecBufferDesc); SECURITY_STATUS SEC_ENTRY DeleteSecurityContext(PCtxtHandle phContext); typedef SECURITY_STATUS (SEC_ENTRY *DELETE_SECURITY_CONTEXT_FN)(PCtxtHandle); SECURITY_STATUS SEC_ENTRY ApplyControlToken(PCtxtHandle phContext, PSecBufferDesc pInput); typedef SECURITY_STATUS (SEC_ENTRY *APPLY_CONTROL_TOKEN_FN)(PCtxtHandle, PSecBufferDesc); SECURITY_STATUS SEC_ENTRY QueryContextAttributesA(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer); SECURITY_STATUS SEC_ENTRY QueryContextAttributesW(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer); #define QueryContextAttributes WINELIB_NAME_AW(QueryContextAttributes) typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CONTEXT_ATTRIBUTES_FN_A)(PCtxtHandle, ULONG, void *); typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle, ULONG, void *); #define QUERY_CONTEXT_ATTRIBUTES_FN WINELIB_NAME_AW(QUERY_CONTEXT_ATTRIBUTES_FN_) /* values for QueryContextAttributes/SetContextAttributes ulAttribute */ #define SECPKG_ATTR_SIZES 0 #define SECPKG_ATTR_NAMES 1 #define SECPKG_ATTR_LIFESPAN 2 #define SECPKG_ATTR_DCE_INFO 3 #define SECPKG_ATTR_STREAM_SIZES 4 #define SECPKG_ATTR_KEY_INFO 5 #define SECPKG_ATTR_AUTHORITY 6 #define SECPKG_ATTR_PROTO_INFO 7 #define SECPKG_ATTR_PASSWORD_EXPIRY 8 #define SECPKG_ATTR_SESSION_KEY 9 #define SECPKG_ATTR_PACKAGE_INFO 10 #define SECPKG_ATTR_USER_FLAGS 11 #define SECPKG_ATTR_NEGOTIATION_INFO 12 #define SECPKG_ATTR_NATIVE_NAMES 13 #define SECPKG_ATTR_FLAGS 14 #define SECPKG_ATTR_USE_VALIDATED 15 #define SECPKG_ATTR_CREDENTIAL_NAME 16 #define SECPKG_ATTR_TARGET_INFORMATION 17 #define SECPKG_ATTR_ACCESS_TOKEN 18 #define SECPKG_ATTR_TARGET 19 #define SECPKG_ATTR_AUTHENTICATION_ID 20 /* types for QueryContextAttributes/SetContextAttributes */ typedef struct _SecPkgContext_Sizes { ULONG cbMaxToken; ULONG cbMaxSignature; ULONG cbBlockSize; ULONG cbSecurityTrailer; } SecPkgContext_Sizes, *PSecPkgContext_Sizes; typedef struct _SecPkgContext_StreamSizes { ULONG cbHeader; ULONG cbTrailer; ULONG cbMaximumMessage; ULONG cbBuffers; ULONG cbBlockSize; } SecPkgContext_StreamSizes, *PSecPkgContext_StreamSizes; typedef struct _SecPkgContext_NamesA { SEC_CHAR *sUserName; } SecPkgContext_NamesA, *PSecPkgContext_NamesA; typedef struct _SecPkgContext_NamesW { SEC_WCHAR *sUserName; } SecPkgContext_NamesW, *PSecPkgContext_NamesW; #define SecPkgContext_Names WINELIB_NAME_AW(SecPkgContext_Names) #define PSecPkgContext_Names WINELIB_NAME_AW(PSecPkgContext_Names) typedef struct _SecPkgContext_Lifespan { TimeStamp tsStart; TimeStamp tsExpiry; } SecPkgContext_Lifespan, *PSecPkgContext_Lifespan; typedef struct _SecPkgContext_DceInfo { ULONG AuthzSvc; PVOID pPac; } SecPkgContext_DceInfo, *PSecPkgContext_DceInfo; typedef struct _SecPkgContext_KeyInfoA { SEC_CHAR *sSignatureAlgorithmName; SEC_CHAR *sEncryptAlgorithmName; ULONG KeySize; ULONG SignatureAlgorithm; ULONG EncryptAlgorithm; } SecPkgContext_KeyInfoA, *PSecPkgContext_KeyInfoA; typedef struct _SecPkgContext_KeyInfoW { SEC_WCHAR *sSignatureAlgorithmName; SEC_WCHAR *sEncryptAlgorithmName; ULONG KeySize; ULONG SignatureAlgorithm; ULONG EncryptAlgorithm; } SecPkgContext_KeyInfoW, *PSecPkgContext_KeyInfoW; #define SecPkgContext_KeyInfo WINELIB_NAME_AW(SecPkgContext_KeyInfo) #define PSecPkgContext_KeyInfo WINELIB_NAME_AW(PSecPkgContext_KeyInfo) typedef struct _SecPkgContext_AuthorityA { SEC_CHAR *sAuthorityName; } SecPkgContext_AuthorityA, *PSecPkgContext_AuthorityA; typedef struct _SecPkgContext_AuthorityW { SEC_WCHAR *sAuthorityName; } SecPkgContext_AuthorityW, *PSecPkgContext_AuthorityW; #define SecPkgContext_Authority WINELIB_NAME_AW(SecPkgContext_Authority) #define PSecPkgContext_Authority WINELIB_NAME_AW(PSecPkgContext_Authority) typedef struct _SecPkgContext_ProtoInfoA { SEC_CHAR *sProtocolName; ULONG majorVersion; ULONG minorVersion; } SecPkgContext_ProtoInfoA, *PSecPkgContext_ProtoInfoA; typedef struct _SecPkgContext_ProtoInfoW { SEC_WCHAR *sProtocolName; ULONG majorVersion; ULONG minorVersion; } SecPkgContext_ProtoInfoW, *PSecPkgContext_ProtoInfoW; #define SecPkgContext_ProtoInfo WINELIB_NAME_AW(SecPkgContext_ProtoInfo) #define PSecPkgContext_ProtoInfo WINELIB_NAME_AW(PSecPkgContext_ProtoInfo) typedef struct _SecPkgContext_PasswordExpiry { TimeStamp tsPasswordExpires; } SecPkgContext_PasswordExpiry, *PSecPkgContext_PasswordExpiry; typedef struct _SecPkgContext_SessionKey { ULONG SessionKeyLength; unsigned char *SessionKey; } SecPkgContext_SessionKey, *PSecPkgContext_SessionKey; typedef struct _SecPkgContext_PackageInfoA { PSecPkgInfoA PackageInfo; } SecPkgContext_PackageInfoA, *PSecPkgContext_PackageInfoA; typedef struct _SecPkgContext_PackageInfoW { PSecPkgInfoW PackageInfo; } SecPkgContext_PackageInfoW, *PSecPkgContext_PackageInfoW; #define SecPkgContext_PackageInfo WINELIB_NAME_AW(SecPkgContext_PackageInfo) #define PSecPkgContext_PackageInfo WINELIB_NAME_AW(PSecPkgContext_PackageInfo) typedef struct _SecPkgContext_Flags { ULONG Flags; } SecPkgContext_Flags, *PSecPkgContext_Flags; typedef struct _SecPkgContext_UserFlags { ULONG UserFlags; } SecPkgContext_UserFlags, *PSecPkgContext_UserFlags; typedef struct _SecPkgContext_NegotiationInfoA { PSecPkgInfoA PackageInfo; ULONG NegotiationState; } SecPkgContext_NegotiationInfoA, *PSecPkgContext_NegotiationInfoA; typedef struct _SecPkgContext_NegotiationInfoW { PSecPkgInfoW PackageInfo; ULONG NegotiationState; } SecPkgContext_NegotiationInfoW, *PSecPkgContext_NegotiationInfoW; #define SecPkgContext_NegotiationInfo WINELIB_NAME_AW(SecPkgContext_NegotiationInfo) #define PSecPkgContext_NegotiationInfo WINELIB_NAME_AW(PSecPkgContext_NegotiationInfo) /* values for NegotiationState */ #define SECPKG_NEGOTIATION_COMPLETE 0 #define SECPKG_NEGOTIATION_OPTIMISTIC 1 #define SECPKG_NEGOTIATION_IN_PROGRESS 2 #define SECPKG_NEGOTIATION_DIRECT 3 #define SECPKG_NEGOTIATION_TRY_MULTICRED 4 typedef struct _SecPkgContext_NativeNamesA { SEC_CHAR *sClientName; SEC_CHAR *sServerName; } SecPkgContext_NativeNamesA, *PSecPkgContext_NativeNamesA; typedef struct _SecPkgContext_NativeNamesW { SEC_WCHAR *sClientName; SEC_WCHAR *sServerName; } SecPkgContext_NativeNamesW, *PSecPkgContext_NativeNamesW; #define SecPkgContext_NativeNames WINELIB_NAME_AW(SecPkgContext_NativeNames) #define PSecPkgContext_NativeNames WINELIB_NAME_AW(PSecPkgContext_NativeNames) typedef struct _SecPkgContext_CredentialNameA { ULONG CredentialType; SEC_CHAR *sCredentialName; } SecPkgContext_CredentialNameA, *PSecPkgContext_CredentialNameA; typedef struct _SecPkgContext_CredentialNameW { ULONG CredentialType; SEC_WCHAR *sCredentialName; } SecPkgContext_CredentialNameW, *PSecPkgContext_CredentialNameW; #define SecPkgContext_CredentialName WINELIB_NAME_AW(SecPkgContext_CredentialName) #define PSecPkgContext_CredentialName WINELIB_NAME_AW(PSecPkgContext_CredentialName) typedef struct _SecPkgContext_AccessToken { void *AccessToken; } SecPkgContext_AccessToken, *PSecPkgContext_AccessToken; typedef struct _SecPkgContext_TargetInformation { ULONG MarshalledTargetInfoLength; unsigned char *MarshalledTargetInfo; } SecPkgContext_TargetInformation, *PSecPkgContext_TargetInformation; typedef struct _SecPkgContext_AuthzID { ULONG AuthzIDLength; char *AuthzID; } SecPkgContext_AuthzID, *PSecPkgContext_AuthzID; typedef struct _SecPkgContext_Target { ULONG TargetLength; char *Target; } SecPkgContext_Target, *PSecPkgContext_Target; SECURITY_STATUS SEC_ENTRY ImpersonateSecurityContext(PCtxtHandle phContext); typedef SECURITY_STATUS (SEC_ENTRY *IMPERSONATE_SECURITY_CONTEXT_FN) (PCtxtHandle); SECURITY_STATUS SEC_ENTRY RevertSecurityContext(PCtxtHandle phContext); typedef SECURITY_STATUS (SEC_ENTRY *REVERT_SECURITY_CONTEXT_FN)(PCtxtHandle); SECURITY_STATUS SEC_ENTRY MakeSignature(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo); typedef SECURITY_STATUS (SEC_ENTRY *MAKE_SIGNATURE_FN)(PCtxtHandle, ULONG, PSecBufferDesc, ULONG); SECURITY_STATUS SEC_ENTRY VerifySignature(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP); typedef SECURITY_STATUS (SEC_ENTRY *VERIFY_SIGNATURE_FN)(PCtxtHandle, PSecBufferDesc, ULONG, PULONG); SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoA( SEC_CHAR *pszPackageName, PSecPkgInfoA *ppPackageInfo); SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoW( SEC_WCHAR *pszPackageName, PSecPkgInfoW *ppPackageInfo); #define QuerySecurityPackageInfo WINELIB_NAME_AW(QuerySecurityPackageInfo) typedef SECURITY_STATUS (SEC_ENTRY *QUERY_SECURITY_PACKAGE_INFO_FN_A) (SEC_CHAR *, PSecPkgInfoA *); typedef SECURITY_STATUS (SEC_ENTRY *QUERY_SECURITY_PACKAGE_INFO_FN_W) (SEC_WCHAR *, PSecPkgInfoW *); #define QUERY_SECURITY_PACKAGE_INFO_FN WINELIB_NAME_AW(QUERY_SECURITY_PACKAGE_INFO_FN_) SECURITY_STATUS SEC_ENTRY ExportSecurityContext(PCtxtHandle phContext, ULONG fFlags, PSecBuffer pPackedContext, void **pToken); typedef SECURITY_STATUS (SEC_ENTRY *EXPORT_SECURITY_CONTEXT_FN)(PCtxtHandle, ULONG, PSecBuffer, void **); /* values for ExportSecurityContext fFlags */ #define SECPKG_CONTEXT_EXPORT_RESET_NEW 0x00000001 #define SECPKG_CONTEXT_EXPORT_DELETE_OLD 0x00000002 SECURITY_STATUS SEC_ENTRY ImportSecurityContextA(SEC_CHAR *pszPackage, PSecBuffer pPackedContext, void *Token, PCtxtHandle phContext); SECURITY_STATUS SEC_ENTRY ImportSecurityContextW(SEC_WCHAR *pszPackage, PSecBuffer pPackedContext, void *Token, PCtxtHandle phContext); #define ImportSecurityContext WINELIB_NAME_AW(ImportSecurityContext) typedef SECURITY_STATUS (SEC_ENTRY *IMPORT_SECURITY_CONTEXT_FN_A)(SEC_CHAR *, PSecBuffer, void *, PCtxtHandle); typedef SECURITY_STATUS (SEC_ENTRY *IMPORT_SECURITY_CONTEXT_FN_W)(SEC_WCHAR *, PSecBuffer, void *, PCtxtHandle); #define IMPORT_SECURITY_CONTEXT_FN WINELIB_NAME_AW(IMPORT_SECURITY_CONTEXT_FN_) SECURITY_STATUS SEC_ENTRY AddCredentialsA(PCredHandle hCredentials, SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialUse, void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument, PTimeStamp ptsExpiry); SECURITY_STATUS SEC_ENTRY AddCredentialsW(PCredHandle hCredentials, SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialUse, void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument, PTimeStamp ptsExpiry); #define AddCredentials WINELIB_NAME_AW(AddCredentials) typedef SECURITY_STATUS (SEC_ENTRY *ADD_CREDENTIALS_FN_A)(PCredHandle, SEC_CHAR *, SEC_CHAR *, ULONG, void *, SEC_GET_KEY_FN, void *, PTimeStamp); typedef SECURITY_STATUS (SEC_ENTRY *ADD_CREDENTIALS_FN_W)(PCredHandle, SEC_WCHAR *, SEC_WCHAR *, ULONG, void *, SEC_GET_KEY_FN, void *, PTimeStamp); SECURITY_STATUS SEC_ENTRY QuerySecurityContextToken(PCtxtHandle phContext, HANDLE *phToken); typedef SECURITY_STATUS (SEC_ENTRY *QUERY_SECURITY_CONTEXT_TOKEN_FN) (PCtxtHandle, HANDLE *); SECURITY_STATUS SEC_ENTRY EncryptMessage(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo); SECURITY_STATUS SEC_ENTRY DecryptMessage(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP); /* values for EncryptMessage fQOP */ #define SECQOP_WRAP_NO_ENCRYPT 0x80000001 typedef SECURITY_STATUS (SEC_ENTRY *ENCRYPT_MESSAGE_FN)(PCtxtHandle, ULONG, PSecBufferDesc, ULONG); typedef SECURITY_STATUS (SEC_ENTRY *DECRYPT_MESSAGE_FN)(PCtxtHandle, PSecBufferDesc, ULONG, PULONG); SECURITY_STATUS SEC_ENTRY SetContextAttributesA(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer, ULONG cbBuffer); SECURITY_STATUS SEC_ENTRY SetContextAttributesW(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer, ULONG cbBuffer); #define SetContextAttributes WINELIB_NAME_AW(SetContextAttributes) typedef SECURITY_STATUS (SEC_ENTRY *SET_CONTEXT_ATTRIBUTES_FN_A)(PCtxtHandle, ULONG, void *, ULONG); typedef SECURITY_STATUS (SEC_ENTRY *SET_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle, ULONG, void *, ULONG); #define SECURITY_ENTRYPOINT_ANSIA "InitSecurityInterfaceA" #define SECURITY_ENTRYPOINT_ANSIW "InitSecurityInterfaceW" #define SECURITY_ENTRYPOINT_ANSI WINELIB_NAME_AW(SECURITY_ENTRYPOINT_ANSI) typedef struct _SECURITY_FUNCTION_TABLE_A { ULONG dwVersion; ENUMERATE_SECURITY_PACKAGES_FN_A EnumerateSecurityPackagesA; QUERY_CREDENTIALS_ATTRIBUTES_FN_A QueryCredentialsAttributesA; ACQUIRE_CREDENTIALS_HANDLE_FN_A AcquireCredentialsHandleA; FREE_CREDENTIALS_HANDLE_FN FreeCredentialsHandle; void *Reserved2; INITIALIZE_SECURITY_CONTEXT_FN_A InitializeSecurityContextA; ACCEPT_SECURITY_CONTEXT_FN AcceptSecurityContext; COMPLETE_AUTH_TOKEN_FN CompleteAuthToken; DELETE_SECURITY_CONTEXT_FN DeleteSecurityContext; APPLY_CONTROL_TOKEN_FN ApplyControlToken; QUERY_CONTEXT_ATTRIBUTES_FN_A QueryContextAttributesA; IMPERSONATE_SECURITY_CONTEXT_FN ImpersonateSecurityContext; REVERT_SECURITY_CONTEXT_FN RevertSecurityContext; MAKE_SIGNATURE_FN MakeSignature; VERIFY_SIGNATURE_FN VerifySignature; FREE_CONTEXT_BUFFER_FN FreeContextBuffer; QUERY_SECURITY_PACKAGE_INFO_FN_A QuerySecurityPackageInfoA; void *Reserved3; void *Reserved4; EXPORT_SECURITY_CONTEXT_FN ExportSecurityContext; IMPORT_SECURITY_CONTEXT_FN_A ImportSecurityContextA; ADD_CREDENTIALS_FN_A AddCredentialsA; void *Reserved8; QUERY_SECURITY_CONTEXT_TOKEN_FN QuerySecurityContextToken; ENCRYPT_MESSAGE_FN EncryptMessage; DECRYPT_MESSAGE_FN DecryptMessage; SET_CONTEXT_ATTRIBUTES_FN_A SetContextAttributesA; } SecurityFunctionTableA, *PSecurityFunctionTableA; typedef struct _SECURITY_FUNCTION_TABLE_W { ULONG dwVersion; ENUMERATE_SECURITY_PACKAGES_FN_W EnumerateSecurityPackagesW; QUERY_CREDENTIALS_ATTRIBUTES_FN_W QueryCredentialsAttributesW; ACQUIRE_CREDENTIALS_HANDLE_FN_W AcquireCredentialsHandleW; FREE_CREDENTIALS_HANDLE_FN FreeCredentialsHandle; void *Reserved2; INITIALIZE_SECURITY_CONTEXT_FN_W InitializeSecurityContextW; ACCEPT_SECURITY_CONTEXT_FN AcceptSecurityContext; COMPLETE_AUTH_TOKEN_FN CompleteAuthToken; DELETE_SECURITY_CONTEXT_FN DeleteSecurityContext; APPLY_CONTROL_TOKEN_FN ApplyControlToken; QUERY_CONTEXT_ATTRIBUTES_FN_W QueryContextAttributesW; IMPERSONATE_SECURITY_CONTEXT_FN ImpersonateSecurityContext; REVERT_SECURITY_CONTEXT_FN RevertSecurityContext; MAKE_SIGNATURE_FN MakeSignature; VERIFY_SIGNATURE_FN VerifySignature; FREE_CONTEXT_BUFFER_FN FreeContextBuffer; QUERY_SECURITY_PACKAGE_INFO_FN_W QuerySecurityPackageInfoW; void *Reserved3; void *Reserved4; EXPORT_SECURITY_CONTEXT_FN ExportSecurityContext; IMPORT_SECURITY_CONTEXT_FN_W ImportSecurityContextW; ADD_CREDENTIALS_FN_W AddCredentialsW; void *Reserved8; QUERY_SECURITY_CONTEXT_TOKEN_FN QuerySecurityContextToken; ENCRYPT_MESSAGE_FN EncryptMessage; DECRYPT_MESSAGE_FN DecryptMessage; SET_CONTEXT_ATTRIBUTES_FN_W SetContextAttributesW; } SecurityFunctionTableW, *PSecurityFunctionTableW; #define SecurityFunctionTable WINELIB_NAME_AW(SecurityFunctionTable) #define PSecurityFunctionTable WINELIB_NAME_AW(PSecurityFunctionTable) #define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION 1 #define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2 2 PSecurityFunctionTableA SEC_ENTRY InitSecurityInterfaceA(void); PSecurityFunctionTableW SEC_ENTRY InitSecurityInterfaceW(void); #define InitSecurityInterface WINELIB_NAME_AW(InitSecurityInterface) typedef PSecurityFunctionTableA (SEC_ENTRY *INIT_SECURITY_INTERFACE_A)(void); typedef PSecurityFunctionTableW (SEC_ENTRY *INIT_SECURITY_INTERFACE_W)(void); #define INIT_SECURITY_INTERFACE WINELIB_NAME_AW(INIT_SECURITY_INTERFACE_) #ifdef __cplusplus } #endif #endif /* ndef __WINE_SSPI_H__ */
{ "content_hash": "a7ecd21cb7d8368d18e486aa3bb20364", "timestamp": "", "source": "github", "line_count": 816, "max_line_length": 89, "avg_line_length": 38.39950980392157, "alnum_prop": 0.7493457586008808, "repo_name": "howard5888/wine", "id": "15adb5993981539675d9d5044e94a26771f71809", "size": "32111", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "wine-1.7.7/include/sspi.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "3308" }, { "name": "C", "bytes": "118195026" }, { "name": "C++", "bytes": "180964" }, { "name": "JavaScript", "bytes": "300874" }, { "name": "Logos", "bytes": "4941" }, { "name": "Objective-C", "bytes": "247341" }, { "name": "Perl", "bytes": "339801" }, { "name": "Ruby", "bytes": "10503" }, { "name": "Shell", "bytes": "83026" }, { "name": "Visual Basic", "bytes": "53047" }, { "name": "XSLT", "bytes": "544" } ], "symlink_target": "" }
package com.dysania.eventbusdemo; import android.app.Application; import org.greenrobot.eventbus.EventBus; /** * Created by DysaniazzZ on 2016/11/3. */ public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); // 配置当一个事件没有订阅者订阅时不打印日志和发送无订阅者的事件 // EventBus eventBus = EventBus.builder() // .logNoSubscriberMessages(false) // .sendNoSubscriberEvent(false) // .build(); // 配置当订阅者收到事件的方法有异常时是否抛出 // EventBus eventBus = EventBus.builder().throwSubscriberException(true).build(); //配置默认的EventBus实例(installDefaultEventBus方法只能调用一次,后面的都会抛出异常) EventBus.builder().throwSubscriberException(BuildConfig.DEBUG).installDefaultEventBus(); } }
{ "content_hash": "8ee4f9796e61fcb09e5c73adbe95e7a4", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 96, "avg_line_length": 28.178571428571427, "alnum_prop": 0.679340937896071, "repo_name": "DysaniazzZ/AndroidPracticeDemos", "id": "940be7ed85490be42cf3b5256550cff1b6fd5869", "size": "943", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "EventBusDemo/app/src/main/java/com/dysania/eventbusdemo/MyApplication.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "718" }, { "name": "Java", "bytes": "162632" } ], "symlink_target": "" }
function spyc(S,marker,markersize); % PURPOSE: produces a spy plot with colors % that reflect the magnitude of the non-zero numbers % ----------------------------------------------------- % USAGE: spyc(S) or spyc(S,marker,markersize) if nargin == 2 markersize = 5; elseif nargin == 1 markersize = 5; marker = '.'; elseif nargin == 3 % do nothing else error('spyc: Wrong # of input arguments'); end; [n,m] = size(S); [i,j,ss] = find(S); % Note we need the values of the nonzeros as % well as their indices if isempty(i), i = NaN; j = NaN; end if isempty(S), marker = 'none'; end scatter(i,j,markersize,ss,marker); xlabel(['nz = ',num2str(length(ss))]); set(gca,'xlim',[0 n+1],'ylim',[0 m+1],'ydir','reverse', ... 'grid','none','plotboxaspectratio',[n+1 m+1 1]);
{ "content_hash": "f1064bfcb0a7890961e98b796c1d7427", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 66, "avg_line_length": 31.115384615384617, "alnum_prop": 0.580964153275649, "repo_name": "pradlanka/malini", "id": "0ca4e4bb91ee89f1cd2c20a1b54b0868e09564f6", "size": "809", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Codes/FC_EC_calculation code/DynamicFC/jplv7/graphs/spyc.m", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1556591" }, { "name": "C++", "bytes": "1112" }, { "name": "HTML", "bytes": "73524" }, { "name": "M", "bytes": "44313" }, { "name": "MATLAB", "bytes": "15262482" }, { "name": "Makefile", "bytes": "16489" }, { "name": "Mathematica", "bytes": "10015" }, { "name": "Mercury", "bytes": "855" }, { "name": "Objective-C", "bytes": "1987" }, { "name": "Rich Text Format", "bytes": "2705" }, { "name": "Roff", "bytes": "303696" }, { "name": "TeX", "bytes": "1048938" } ], "symlink_target": "" }
package com.google.api.ads.adwords.jaxws.v201601.cm; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; /** * * Base class for exceptions. * * * <p>Java class for ApplicationException complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ApplicationException"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="message" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ApplicationException.Type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ApplicationException", propOrder = { "message", "applicationExceptionType" }) @XmlSeeAlso({ ApiException.class }) public class ApplicationException { protected String message; @XmlElement(name = "ApplicationException.Type") protected String applicationExceptionType; /** * Gets the value of the message property. * * @return * possible object is * {@link String } * */ public String getMessage() { return message; } /** * Sets the value of the message property. * * @param value * allowed object is * {@link String } * */ public void setMessage(String value) { this.message = value; } /** * Gets the value of the applicationExceptionType property. * * @return * possible object is * {@link String } * */ public String getApplicationExceptionType() { return applicationExceptionType; } /** * Sets the value of the applicationExceptionType property. * * @param value * allowed object is * {@link String } * */ public void setApplicationExceptionType(String value) { this.applicationExceptionType = value; } }
{ "content_hash": "a631ddca4e81cc6e6f00cedee13ab8ff", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 119, "avg_line_length": 24.75257731958763, "alnum_prop": 0.6197417742607247, "repo_name": "gawkermedia/googleads-java-lib", "id": "490d2fd00b8817b827469665ecfd4dcf3d5f4e6f", "size": "2401", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201601/cm/ApplicationException.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "107468648" } ], "symlink_target": "" }
import { lang } from '../index'; export default { computed: { language() { return document.documentElement.lang; } }, methods: { l: lang } } export let LocalizationBase = baseKey => { return { methods: { lSub(key) { return lang(`${baseKey}.${key}`) } } } };
{ "content_hash": "d619308194d004ae07ca27ae0804f633", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 49, "avg_line_length": 17.80952380952381, "alnum_prop": 0.4411764705882353, "repo_name": "code16/sharp", "id": "91ceabd0222ae8fbf34b51aa2bb7e3fbb8450527", "size": "374", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "resources/assets/js/mixins/Localization.js", "mode": "33188", "license": "mit", "language": [ { "name": "Blade", "bytes": "15976" }, { "name": "HTML", "bytes": "618" }, { "name": "JavaScript", "bytes": "389380" }, { "name": "PHP", "bytes": "1008422" }, { "name": "SCSS", "bytes": "83744" }, { "name": "Vue", "bytes": "386688" } ], "symlink_target": "" }
using System.Net; using System.Net.Http; using System.Web.Http; using RopeWebApp2.Services; using RopeWebApp2.Models; namespace RopeWebApp2.Controllers { public class BigListApiController : ApiController { // Run and return BigList tests public HttpResponseMessage GetBigListFillTestResults(int iterations) { TestModel resultBL = new TestModel(); TestService testService = new Services.TestService(); testService.ReadFiles(); resultBL = testService.FillTest(iterations, "BigList"); return Request.CreateResponse(HttpStatusCode.OK, resultBL); } public HttpResponseMessage GetBigListPrependTestResults(int iterations) { TestModel resultBL = new TestModel(); TestService testService = new Services.TestService(); testService.ReadFiles(); resultBL = testService.PrependTest(iterations, "BigList"); return Request.CreateResponse(HttpStatusCode.OK, resultBL); } public HttpResponseMessage GetBigListMidInsertTestResults(int iterations) { TestModel resultBL = new TestModel(); TestService testService = new Services.TestService(); testService.ReadFiles(); resultBL = testService.MidInsertTest(iterations, "BigList"); return Request.CreateResponse(HttpStatusCode.OK, resultBL); } // This method calls the Stringbuilder append test and sends results. public HttpResponseMessage GetBigListAppendTestResults(int iterations) { TestModel resultBL = new TestModel(); TestService testService = new TestService(); testService.ReadFiles(); resultBL = testService.AppendTest(iterations, "BigList"); return Request.CreateResponse(HttpStatusCode.OK, resultBL); } } }
{ "content_hash": "b51f9f466038903fedcca6150b2990ee", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 81, "avg_line_length": 39.895833333333336, "alnum_prop": 0.6616187989556136, "repo_name": "RopeLEAP/rope", "id": "2a23732cbcef9149695045426437d8fdd42b400f", "size": "1917", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "RopeWebApp2/Controllers/BigListApiController.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "203" }, { "name": "C#", "bytes": "177548" }, { "name": "CSS", "bytes": "1026" }, { "name": "HTML", "bytes": "10254" }, { "name": "JavaScript", "bytes": "32020" } ], "symlink_target": "" }
package com.microsoft.azure.management.storage.v2019_04_01.implementation; import com.microsoft.azure.arm.model.implementation.WrapperImpl; import com.microsoft.azure.management.storage.v2019_04_01.Usages; import rx.Observable; import rx.functions.Func1; import java.util.List; import com.microsoft.azure.management.storage.v2019_04_01.Usage; class UsagesImpl extends WrapperImpl<UsagesInner> implements Usages { private final StorageManager manager; UsagesImpl(StorageManager manager) { super(manager.inner().usages()); this.manager = manager; } public StorageManager manager() { return this.manager; } private UsageImpl wrapModel(UsageInner inner) { return new UsageImpl(inner, manager()); } @Override public Observable<Usage> listByLocationAsync(String location) { UsagesInner client = this.inner(); return client.listByLocationAsync(location) .flatMap(new Func1<List<UsageInner>, Observable<UsageInner>>() { @Override public Observable<UsageInner> call(List<UsageInner> innerList) { return Observable.from(innerList); } }) .map(new Func1<UsageInner, Usage>() { @Override public Usage call(UsageInner inner) { return wrapModel(inner); } }); } }
{ "content_hash": "7dc2777a06027e2420ca2ca2221969ee", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 76, "avg_line_length": 30.043478260869566, "alnum_prop": 0.662807525325615, "repo_name": "selvasingh/azure-sdk-for-java", "id": "5c9e32de4d54b82e8d262b7684fb9830e9612d78", "size": "1615", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/UsagesImpl.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "29891970" }, { "name": "JavaScript", "bytes": "6198" }, { "name": "PowerShell", "bytes": "160" }, { "name": "Shell", "bytes": "609" } ], "symlink_target": "" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("CloudBuilder.Logger")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CloudBuilder.Logger")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("a47ea763-0262-437c-9886-de7a38d58829")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "content_hash": "ddf4acb582dd1d5380e694d5189a03d2", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 39.19444444444444, "alnum_prop": 0.7462792345854005, "repo_name": "kzu/CloudBuilder", "id": "fe0df3d71af78eddd324f23d6f6d57c43abd7165", "size": "1414", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/CloudBuilder.Logger/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "6408" }, { "name": "HTML", "bytes": "2417" }, { "name": "JavaScript", "bytes": "122396" }, { "name": "PowerShell", "bytes": "78618" } ], "symlink_target": "" }
<?php /* Safe sample input : get the $_GET['userData'] in an array sanitize : cast in float construction : concatenation with simple quote */ /*Copyright 2015 Bertrand STIVALET Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.*/ $array = array(); $array[] = 'safe' ; $array[] = $_GET['userData'] ; $array[] = 'safe' ; $tainted = $array[1] ; $tainted = (float) $tainted ; $query = "SELECT Trim(a.FirstName) & ' ' & Trim(a.LastName) AS employee_name, a.city, a.street & (' ' +a.housenum) AS address FROM Employees AS a WHERE a.supervisor='". $tainted . "'"; $conn = mysql_connect('localhost', 'mysql_user', 'mysql_password'); // Connection to the database (address, user, password) mysql_select_db('dbname') ; echo "query : ". $query ."<br /><br />" ; $res = mysql_query($query); //execution while($data =mysql_fetch_array($res)){ print_r($data) ; echo "<br />" ; } mysql_close($conn); ?>
{ "content_hash": "24d43c111a4d0fb1f50a15c93568c7f0", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 185, "avg_line_length": 25.65671641791045, "alnum_prop": 0.7196044211751018, "repo_name": "stivalet/PHP-Vulnerability-test-suite", "id": "4d745cfb38f5994d2222dcdc99171a0c52625a25", "size": "1719", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Injection/CWE_89/safe/CWE_89__array-GET__CAST-cast_float__multiple_AS-concatenation_simple_quote.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "64184004" } ], "symlink_target": "" }
package blue.lapis.pore.impl.entity; import blue.lapis.pore.converter.type.material.PotionEffectConverter; import blue.lapis.pore.converter.type.material.PotionEffectTypeConverter; import blue.lapis.pore.converter.vector.LocationConverter; import blue.lapis.pore.converter.wrapper.WrapperConverter; import blue.lapis.pore.util.ProjectileUtil; import org.apache.commons.lang3.NotImplementedException; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Arrow; import org.bukkit.entity.Bat; import org.bukkit.entity.Egg; import org.bukkit.entity.EnderDragon; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; import org.bukkit.entity.Snowball; import org.bukkit.entity.Witch; import org.bukkit.entity.Wither; import org.bukkit.inventory.EntityEquipment; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.util.Vector; import org.spongepowered.api.data.manipulator.DisplayNameData; import org.spongepowered.api.data.manipulator.PotionEffectData; import org.spongepowered.api.data.manipulator.entity.BreathingData; import org.spongepowered.api.data.manipulator.entity.DamageableData; import org.spongepowered.api.data.manipulator.entity.EyeLocationData; import org.spongepowered.api.data.manipulator.entity.HealthData; import org.spongepowered.api.data.manipulator.entity.LeashData; import org.spongepowered.api.entity.living.Agent; import org.spongepowered.api.entity.living.Living; import org.spongepowered.api.entity.projectile.source.ProjectileSource; import org.spongepowered.api.text.Text; import org.spongepowered.api.text.Text.Literal; import org.spongepowered.api.text.Texts; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; public class PoreLivingEntity extends PoreEntity implements LivingEntity { public static PoreLivingEntity of(Living handle) { return WrapperConverter.of(PoreLivingEntity.class, handle); } protected PoreLivingEntity(Living handle) { super(handle); } @Override public Living getHandle() { return (Living) super.getHandle(); } @Override public double getEyeHeight() { return get(EyeLocationData.class).getEyeHeight(); } @Override public double getEyeHeight(boolean ignoreSneaking) { return getEyeHeight(); // oddly enough, CraftBukkit does the exact same thing } @Override public Location getEyeLocation() { return LocationConverter.fromVector3d(getHandle().getWorld(), get(EyeLocationData.class).getEyeLocation()); } @Override public List<Block> getLineOfSight(HashSet<Byte> transparent, int maxDistance) { throw new NotImplementedException("TODO"); //TODO } @Override public List<Block> getLineOfSight(Set<Material> transparent, int maxDistance) { throw new NotImplementedException("TODO"); // TODO } @Override public Block getTargetBlock(HashSet<Byte> transparent, int maxDistance) { throw new NotImplementedException("TODO"); //TODO } @Override public Block getTargetBlock(Set<Material> transparent, int maxDistance) { throw new NotImplementedException("TODO"); // TODO } @Override public List<Block> getLastTwoTargetBlocks(HashSet<Byte> transparent, int maxDistance) { throw new NotImplementedException("TODO"); //TODO } @Override public List<Block> getLastTwoTargetBlocks(Set<Material> transparent, int maxDistance) { throw new NotImplementedException("TODO"); // TODO } @Override public Egg throwEgg() { if (getHandle() instanceof ProjectileSource) { return PoreEgg.of( ((ProjectileSource) getHandle()).launchProjectile( org.spongepowered.api.entity.projectile.Egg.class ) ); } return null; //TODO: should an UnsupportedOperationException be thrown? } @Override public Snowball throwSnowball() { if (getHandle() instanceof ProjectileSource) { return PoreSnowball.of( ((ProjectileSource) getHandle()).launchProjectile( org.spongepowered.api.entity.projectile.Snowball.class ) ); } return null; //TODO: should an UnsupportedOperationException be thrown? } @Override public Arrow shootArrow() { if (getHandle() instanceof ProjectileSource) { return PoreArrow.of( ((ProjectileSource) getHandle()).launchProjectile( org.spongepowered.api.entity.projectile.Arrow.class ) ); } return null; //TODO: should an UnsupportedOperationException be thrown? } @Override public int getRemainingAir() { return get(BreathingData.class).getRemainingAir(); } @Override public void setRemainingAir(int ticks) { get(BreathingData.class).setRemainingAir(ticks); } @Override public int getMaximumAir() { return get(BreathingData.class).getMaxAir(); } @Override public void setMaximumAir(int ticks) { get(BreathingData.class).setMaxAir(ticks); } @Override public int getMaximumNoDamageTicks() { return get(DamageableData.class).getMaxInvulnerabilityTicks(); } @Override public void setMaximumNoDamageTicks(int ticks) { get(DamageableData.class).setMaxInvulnerabilityTicks(ticks); } @Override public double getLastDamage() { return get(DamageableData.class).getLastDamage().get(); } @Override public int _INVALID_getLastDamage() { return (int) this.getLastDamage(); } @Override public void setLastDamage(double damage) { get(DamageableData.class).setLastDamage(damage); } @Override public void _INVALID_setLastDamage(int damage) { this.setLastDamage(damage); } @Override public int getNoDamageTicks() { return get(DamageableData.class).getInvulnerabilityTicks(); } @Override public void setNoDamageTicks(int ticks) { get(DamageableData.class).setInvulnerabilityTicks(ticks); } @Override public Player getKiller() { throw new NotImplementedException("TODO"); //TODO } @Override public boolean addPotionEffect(PotionEffect effect) { return addPotionEffect(effect, false); } @Override public boolean addPotionEffect(PotionEffect effect, boolean force) { org.spongepowered.api.potion.PotionEffect eff = PotionEffectConverter.of(effect); get(PotionEffectData.class).addPotionEffect(eff, force); return get(PotionEffectData.class).hasPotionEffect(eff.getType()); } @Override public boolean addPotionEffects(Collection<PotionEffect> effects) { boolean success = true; for (PotionEffect effect : effects) { this.addPotionEffect(effect); if (!this.hasPotionEffect(effect.getType())) { success = false; } } return success; } @Override public boolean hasPotionEffect(PotionEffectType type) { return get(PotionEffectData.class).hasPotionEffect(PotionEffectTypeConverter.of(type)); } @Override public void removePotionEffect(PotionEffectType type) { get(PotionEffectData.class).removePotionEffect(PotionEffectTypeConverter.of(type)); } @Override public Collection<PotionEffect> getActivePotionEffects() { List<PotionEffect> effects = new ArrayList<PotionEffect>(); for (org.spongepowered.api.potion.PotionEffect effect : get(PotionEffectData.class).getPotionEffects()) { effects.add(PotionEffectConverter.of(effect)); } return effects; } @Override public boolean hasLineOfSight(Entity other) { throw new NotImplementedException("TODO"); //TODO } @Override public boolean getRemoveWhenFarAway() { throw new NotImplementedException("TODO"); //TODO } @Override public void setRemoveWhenFarAway(boolean remove) { throw new NotImplementedException("TODO"); //TODO } @Override public EntityEquipment getEquipment() { throw new NotImplementedException("TODO"); //TODO } @Override public void setCanPickupItems(boolean pickup) { throw new NotImplementedException("TODO"); //TODO } @Override public boolean getCanPickupItems() { throw new NotImplementedException("TODO"); //TODO } @Override @SuppressWarnings("deprecation") public void setCustomName(String name) { get(DisplayNameData.class).setDisplayName(Texts.fromLegacy(name)); //TODO deprecated } @Override public String getCustomName() { Text.Literal text = (Literal) get(DisplayNameData.class).getDisplayName();//TODO Working? return text.getContent(); } @Override public void setCustomNameVisible(boolean flag) { get(DisplayNameData.class).setCustomNameVisible(flag); } @Override public boolean isCustomNameVisible() { return get(DisplayNameData.class).isCustomNameVisible(); } @Override public boolean isLeashed() { return getHandle() instanceof Agent && has(LeashData.class); } @Override public Entity getLeashHolder() throws IllegalStateException { if (getHandle() instanceof Agent) { return get(LeashData.class).getLeashHolder() != null ? PoreEntity.of(get(LeashData.class).getLeashHolder()) : null; } return null; } @Override public boolean setLeashHolder(Entity holder) { if (getHandle() instanceof Agent) { if (!(this instanceof Bat) && !(this instanceof EnderDragon) && !(this instanceof Witch) && !(this instanceof Wither)) { getOrCreate(LeashData.class).setLeashHolder(((PoreEntity) holder).getHandle()); return true; } } return false; } @Override public void damage(double amount) { get(HealthData.class).damage(amount); } @Override public void damage(double amount, Entity source) { damage(amount); //TODO } @Override public void _INVALID_damage(int amount) { get(HealthData.class).damage(amount); } @Override public void _INVALID_damage(int amount, Entity source) { damage(amount); //TODO } @Override public double getHealth() { return get(HealthData.class).getHealth(); } @Override public int _INVALID_getHealth() { return (int) get(HealthData.class).getHealth(); } @Override public void setHealth(double health) { getOrCreate(HealthData.class).setHealth(health); } @Override public void _INVALID_setHealth(int health) { getOrCreate(HealthData.class).setHealth(health); } @Override public double getMaxHealth() { return get(HealthData.class).getMaxHealth(); } @Override public int _INVALID_getMaxHealth() { return (int) getMaxHealth(); } @Override public void setMaxHealth(double health) { getOrCreate(HealthData.class).setMaxHealth(health); } @Override public void _INVALID_setMaxHealth(int health) { setMaxHealth(health); } @Override public void resetMaxHealth() { throw new NotImplementedException("TODO"); } @Override public <T extends Projectile> T launchProjectile(Class<? extends T> projectile) { return launchProjectile(projectile, null); } @Override public <T extends Projectile> T launchProjectile(Class<? extends T> projectile, Vector velocity) { if (getHandle() instanceof ProjectileSource) { return ProjectileUtil.launchProjectile((ProjectileSource) getHandle(), projectile, velocity); } throw new UnsupportedOperationException(); } }
{ "content_hash": "5f3cb50b2b46b221f4a1aaa3ccbd7297", "timestamp": "", "source": "github", "line_count": 409, "max_line_length": 115, "avg_line_length": 30.117359413202934, "alnum_prop": 0.6746225036531904, "repo_name": "Lamp-Post/Pore", "id": "dc994562070bcd873cb778d87ec72d51887c29d1", "size": "13494", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/blue/lapis/pore/impl/entity/PoreLivingEntity.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "4136" }, { "name": "Java", "bytes": "1257134" }, { "name": "Shell", "bytes": "3767" } ], "symlink_target": "" }
@interface ViewController : UIViewController @end
{ "content_hash": "985505fbe9caceddf0d56c6872143fe4", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 44, "avg_line_length": 10.6, "alnum_prop": 0.7924528301886793, "repo_name": "wokalski/gobi", "id": "5e3c54e8e6c6ea4999b20dc98d908723c9882113", "size": "225", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "OCamlTest/OCamlTest/ViewController.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1345" }, { "name": "Makefile", "bytes": "2266" }, { "name": "OCaml", "bytes": "34" }, { "name": "Objective-C", "bytes": "4372" }, { "name": "Shell", "bytes": "2989" } ], "symlink_target": "" }
<Spinner xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:entries="@array/sort_order"/>
{ "content_hash": "1778c83e616f5944a519eee0884703ad", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 67, "avg_line_length": 47.5, "alnum_prop": 0.7368421052631579, "repo_name": "navdeepsekhon/PopMovies", "id": "04e843b402f22f53bb27147a91d2c73622e3079e", "size": "190", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/action_sort.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "55780" } ], "symlink_target": "" }
using FinnAngelo.DALifyTests.Properties; using System; using System.Collections.Generic; using System.Data.SqlClient; using System.Linq; using System.Text; namespace FinnAngelo.DALifyTests { public static class Setup { public static void DropExampleStuff(this SqlConnection conn) { using (var cmd = new SqlCommand(Resources.PROCEDURE_FinnAngelo_UpdateExample_DROP, conn)) cmd.ExecuteNonQuery(); using (var cmd = new SqlCommand(Resources.PROCEDURE_FinnAngelo_GetExample_DROP, conn)) cmd.ExecuteNonQuery(); using (var cmd = new SqlCommand(Resources.PROCEDURE_FinnAngelo_GetExamples_DROP, conn)) cmd.ExecuteNonQuery(); using (var cmd = new SqlCommand(Resources.PROCEDURE_FinnAngelo_GetInt_DROP, conn)) cmd.ExecuteNonQuery(); using (var cmd = new SqlCommand(Resources.TABLE_FinnAngelo_Examples_DROP, conn)) cmd.ExecuteNonQuery(); using (var cmd = new SqlCommand(Resources.SCHEMA_FinnAngelo_DROP, conn)) cmd.ExecuteNonQuery(); } public static void CreateExampleStuff(this SqlConnection conn) { conn.DropExampleStuff(); using (var cmd = new SqlCommand(Resources.SCHEMA_FinnAngelo_CREATE, conn)) cmd.ExecuteNonQuery(); using (var cmd = new SqlCommand(Resources.TABLE_FinnAngelo_Examples_CREATE, conn)) cmd.ExecuteNonQuery(); using (var cmd = new SqlCommand(Resources.PROCEDURE_FinnAngelo_GetInt_CREATE, conn)) cmd.ExecuteNonQuery(); using (var cmd = new SqlCommand(Resources.PROCEDURE_FinnAngelo_GetExamples_CREATE, conn)) cmd.ExecuteNonQuery(); using (var cmd = new SqlCommand(Resources.PROCEDURE_FinnAngelo_GetExample_CREATE, conn)) cmd.ExecuteNonQuery(); using (var cmd = new SqlCommand(Resources.PROCEDURE_FinnAngelo_UpdateExample_CREATE, conn)) cmd.ExecuteNonQuery(); } } }
{ "content_hash": "6a357a6904d984cc27f1fb7bd0bf08e0", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 103, "avg_line_length": 40.40384615384615, "alnum_prop": 0.6377915278438838, "repo_name": "FinnAngelo/Tomfoolery", "id": "304d27747d9ca1f3adbee3f395b71e36b28df55a", "size": "2103", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_Archive/DALify/FinnAngelo.DALifyTests/Setup.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "2582" }, { "name": "AutoHotkey", "bytes": "7089" }, { "name": "Batchfile", "bytes": "242" }, { "name": "C", "bytes": "3631617" }, { "name": "C#", "bytes": "4036348" }, { "name": "C++", "bytes": "113526" }, { "name": "CSS", "bytes": "253" }, { "name": "CoffeeScript", "bytes": "3821" }, { "name": "F#", "bytes": "1942" }, { "name": "HTML", "bytes": "66835" }, { "name": "Java", "bytes": "641016" }, { "name": "Lex", "bytes": "4989" }, { "name": "M4", "bytes": "231887" }, { "name": "Makefile", "bytes": "91421" }, { "name": "Objective-C", "bytes": "88666" }, { "name": "Perl", "bytes": "152182" }, { "name": "Perl 6", "bytes": "8131" }, { "name": "PowerShell", "bytes": "12075" }, { "name": "Roff", "bytes": "202777" }, { "name": "Shell", "bytes": "25482" }, { "name": "Yacc", "bytes": "10585" } ], "symlink_target": "" }
 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Pirate.PiVote.Crypto; namespace Pirate.PiVote.Gui { public partial class DecryptPrivateKeyDialog : Form { public DecryptPrivateKeyDialog() { InitializeComponent(); } private void EncryptPrivateKeyDialog_Load(object sender, EventArgs e) { CenterToScreen(); Text = GuiResources.EncryptPrivateKeyTitle; this.certificateIdLabel.Text = GuiResources.EncryptPrivateKeyCertificateId; this.certificateTypeLabel.Text = GuiResources.EncryptPrivateKeyCertificateType; this.actionLabel.Text = GuiResources.EncryptPrivateKeyUnlockAction; this.passphraseLabel.Text = GuiResources.EncryptPrivateKeyPassphrase; this.okButton.Text = GuiResources.ButtonOk; this.cancelButton.Text = GuiResources.ButtonCancel; this.okButton.Enabled = Valid; } private void okButton_Click(object sender, EventArgs e) { if (Valid) { DialogResult = DialogResult.OK; Close(); } } private void cancelButton_Click(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; Close(); } private bool Valid { get { return this.passphraseTextBox.Text.Length >= 1; } } private void passphraseTextBox_TextChanged(object sender, EventArgs e) { this.okButton.Enabled = Valid; } private void repeatTextBox_TextChanged(object sender, EventArgs e) { this.okButton.Enabled = Valid; } private void EncryptPrivateKeyDialog_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.Escape: DialogResult = DialogResult.Cancel; Close(); break; case Keys.Enter: if (Valid) { DialogResult = DialogResult.OK; Close(); } break; } } public static string ShowSetPassphrase(string certificateId, string certificateType, string actionName, string message) { DecryptPrivateKeyDialog dialog = new DecryptPrivateKeyDialog(); dialog.certificateIdTextBox.Text = certificateId; dialog.certificateTypeTextBox.Text = certificateType; dialog.actionTextBox.Text = actionName; if (message == null) { dialog.infoLabel.Text = GuiResources.EncryptPrivateKeyEncrypted; } else { dialog.infoLabel.ForeColor = Color.Red; dialog.infoLabel.Text = message; } if (dialog.ShowDialog() == DialogResult.OK) { return dialog.passphraseTextBox.Text; } else { return null; } } public static bool TryDecryptIfNessecary(Certificate certificate, string actionName) { if (certificate.PrivateKeyStatus == PrivateKeyStatus.Encrypted) { bool unlocked = false; string message = null; while (!unlocked) { string passphrase = ShowSetPassphrase(certificate.Id.ToString(), certificate.TypeText, actionName, message); if (passphrase.IsNullOrEmpty()) break; try { certificate.Unlock(passphrase); unlocked = true; } catch { message = GuiResources.EncryptPrivateKeyWrongPassphrase; } } return unlocked; } else if (certificate.PrivateKeyStatus == PrivateKeyStatus.Unavailable) { return false; } else { return true; } } } }
{ "content_hash": "0631fea369590b4fd168769ccef2be8b", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 123, "avg_line_length": 25.473684210526315, "alnum_prop": 0.6035640495867769, "repo_name": "dbrgn/pi-vote", "id": "57c66929afc7c02e00c45c8b6ea54ce8936e43cb", "size": "4022", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Gui/Phassphrase/DecryptPrivateKeyDialog.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "2523" }, { "name": "C#", "bytes": "2753753" }, { "name": "PowerShell", "bytes": "9210" } ], "symlink_target": "" }
Vignet::Vignet(const IplImage &img) : Filter(img, "Vignet") { m_pointGrad = new PointGradient(cvPoint(img.width/2, img.height/2), 0.5, 1.0); m_maskImg = cvCreateImage(cvGetSize(&img), IPL_DEPTH_64F, 1); m_labImg = cvCreateImage(cvGetSize(&img), IPL_DEPTH_8U, 3); } Vignet::~Vignet() { delete m_pointGrad; cvReleaseImage(&m_labImg); cvReleaseImage(&m_maskImg); } // Virtual function implementation void Vignet::filtering(const IplImage &src, IplImage* rst) { CvScalar value; m_pointGrad->generateGradient(m_maskImg); cvCvtColor(&src, m_labImg, CV_BGR2Lab); for (int row = 0; row < m_labImg->height; row++) { for (int col = 0; col < m_labImg->width; col++) { value = cvGet2D(m_labImg, row, col); value.val[0] *= cvGet2D(m_maskImg, row, col).val[0]; cvSet2D(m_labImg, row, col, value); } } cvCvtColor(m_labImg, rst, CV_Lab2BGR); cvCopy(rst, backupResultImg); } void Vignet::reset() { } void Vignet::importSettings(string fileName, int suffix) { } void Vignet::exportSettings(string fileName, int suffix) { }
{ "content_hash": "07e3555f233ff1494a9ee62c318019f1", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 82, "avg_line_length": 20.6, "alnum_prop": 0.6284201235657546, "repo_name": "browny/filters-fun", "id": "a2db67619ccd953cf979813e168ecb27874ccdde", "size": "1166", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "filter/src/vignet.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C++", "bytes": "62347" } ], "symlink_target": "" }
import codecs import os import re from setuptools import setup, find_packages with open('README.md') as f: long_description = f.read() ################################################################### NAME = "required" PACKAGES = find_packages(where="src") META_PATH = os.path.join("src", "required", "__init__.py") KEYWORDS = ["dependency", "validator"] CLASSIFIERS = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Natural Language :: English", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Libraries :: Python Modules", ] INSTALL_REQUIRES = [ "six", "lark-parser" ] ################################################################### HERE = os.path.abspath(os.path.dirname(__file__)) def read(*parts): """ Build an absolute path from *parts* and and return the contents of the resulting file. Assume UTF-8 encoding. """ with codecs.open(os.path.join(HERE, *parts), "rb", "utf-8") as f: return f.read() META_FILE = read(META_PATH) def find_meta(meta): """ Extract __*meta*__ from META_FILE. """ meta_match = re.search( r"^__{meta}__ = ['\"]([^'\"]*)['\"]".format(meta=meta), META_FILE, re.M ) if meta_match: return meta_match.group(1) raise RuntimeError("Unable to find __{meta}__ string.".format(meta=meta)) if __name__ == "__main__": setup( name=NAME, description=find_meta("description"), license=find_meta("license"), url=find_meta("uri"), version=find_meta("version"), author=find_meta("author"), author_email=find_meta("email"), maintainer=find_meta("author"), maintainer_email=find_meta("email"), keywords=KEYWORDS, long_description=long_description, long_description_content_type='text/markdown', packages=PACKAGES, package_dir={"": "src"}, package_data={"": ['src/required/grammer.lark']}, include_package_data=True, zip_safe=False, classifiers=CLASSIFIERS, install_requires=INSTALL_REQUIRES, )
{ "content_hash": "745a1d9b0378c1558c57f672349193ae", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 77, "avg_line_length": 29.43820224719101, "alnum_prop": 0.5732824427480916, "repo_name": "shezadkhan137/required", "id": "9c7cddf50205ba15bbdbea09d76faf23ebeb3268", "size": "2620", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "setup.py", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "174" }, { "name": "Python", "bytes": "51411" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>coquelicot: 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.15.0 / coquelicot - 3.1.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> coquelicot <small> 3.1.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-10-01 08:46:06 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-01 08:46:06 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.15.0 Formal proof management system dune 3.4.1 Fast, portable, and opinionated build system ocaml 4.06.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.06.1 Official 4.06.1 release ocaml-config 1 OCaml Switch Configuration ocaml-secondary-compiler 4.08.1-1 OCaml 4.08.1 Secondary Switch Compiler ocamlfind 1.9.1 A library manager for OCaml ocamlfind-secondary 1.9.1 Adds support for ocaml-secondary-compiler to ocamlfind zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;http://coquelicot.saclay.inria.fr/&quot; dev-repo: &quot;git+https://gitlab.inria.fr/coquelicot/coquelicot.git&quot; bug-reports: &quot;https://gitlab.inria.fr/coquelicot/coquelicot/issues&quot; license: &quot;LGPL-3.0-or-later&quot; patches: [ &quot;remake.patch&quot; ] build: [ [&quot;autoconf&quot;] {dev} [&quot;./configure&quot;] [&quot;./remake&quot; &quot;-j%{jobs}%&quot;] ] install: [&quot;./remake&quot; &quot;install&quot;] depends: [ &quot;coq&quot; {&gt;= &quot;8.8&quot; &amp; &lt; &quot;8.14&quot;} &quot;coq-mathcomp-ssreflect&quot; {&gt;= &quot;1.6&quot;} &quot;conf-autoconf&quot; {build &amp; dev} (&quot;conf-g++&quot; {build} | &quot;conf-clang&quot; {build}) ] tags: [ &quot;keyword:real analysis&quot; &quot;keyword:topology&quot; &quot;keyword:filters&quot; &quot;keyword:metric spaces&quot; &quot;category:Mathematics/Real Calculus and Topology&quot; &quot;logpath:Coquelicot&quot; &quot;date:2020-02-24&quot; ] authors: [ &quot;Sylvie Boldo &lt;[email protected]&gt;&quot; &quot;Catherine Lelay &lt;[email protected]&gt;&quot; &quot;Guillaume Melquiond &lt;[email protected]&gt;&quot; ] synopsis: &quot;A Coq formalization of real analysis compatible with the standard library&quot; url { src: &quot;https://coquelicot.gitlabpages.inria.fr/releases/coquelicot-3.1.0.tar.gz&quot; checksum: &quot;sha512=f9aa6279250d3bf47255273d7af96d1d1845bc531426e4ce8de7ede183975cfd894d88baaa13af6cd056656ad434add4d9fd2e5f9b4d59f6887cc235ec6f0a5b&quot; } </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-coquelicot.3.1.0 coq.8.15.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.15.0). The following dependencies couldn&#39;t be met: - coq-coquelicot -&gt; coq &lt; 8.14 -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;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-coquelicot.3.1.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": "1bff06eb5e0dfc233a89ff8830d27325", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 253, "avg_line_length": 44.43604651162791, "alnum_prop": 0.5571110820358498, "repo_name": "coq-bench/coq-bench.github.io", "id": "ced1f70e6c790441309c5a5de1b776608088a440", "size": "7668", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.06.1-2.0.5/released/8.15.0/coquelicot/3.1.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package io.github.daviddenton.finagle.aws case class AwsRegion(name: String) extends AnyVal { override def toString = name } object AwsRegion { val usEast = AwsRegion("us-east") }
{ "content_hash": "4b1f4113dbb066163b86d84fe0aa5b30", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 51, "avg_line_length": 20.555555555555557, "alnum_prop": 0.7513513513513513, "repo_name": "daviddenton/finagle-aws", "id": "d9249badbdf79149f09bacfe26b7ca6f1795a0e8", "size": "185", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/scala/io/github/daviddenton/finagle/aws/AwsRegion.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "4491" }, { "name": "Scala", "bytes": "26358" }, { "name": "Shell", "bytes": "474" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>equations: 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.11.2 / equations - 1.3+8.15</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> equations <small> 1.3+8.15 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-05-12 07:16:56 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-12 07:16:56 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 coq 8.11.2 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.10.2 The OCaml compiler (virtual package) ocaml-base-compiler 4.10.2 Official release 4.10.2 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.3 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; authors: [ &quot;Matthieu Sozeau &lt;[email protected]&gt;&quot; &quot;Cyprien Mangin &lt;[email protected]&gt;&quot; ] dev-repo: &quot;git+https://github.com/mattam82/Coq-Equations.git&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://mattam82.github.io/Coq-Equations&quot; bug-reports: &quot;https://github.com/mattam82/Coq-Equations/issues&quot; license: &quot;LGPL-2.1-or-later&quot; synopsis: &quot;A function definition package for Coq&quot; description: &quot;&quot;&quot; Equations is a function definition plugin for Coq, that allows the definition of functions by dependent pattern-matching and well-founded, mutual or nested structural recursion and compiles them into core terms. It automatically derives the clauses equations, the graph of the function and its associated elimination principle. &quot;&quot;&quot; tags: [ &quot;keyword:dependent pattern-matching&quot; &quot;keyword:functional elimination&quot; &quot;category:Miscellaneous/Coq Extensions&quot; &quot;logpath:Equations&quot; ] build: [ [&quot;./configure.sh&quot; &quot;--enable-hott&quot; {coq-hott:installed}] [make &quot;-j%{jobs}%&quot;] ] install: [ [make &quot;install&quot;] ] run-test: [ [make &quot;test-suite&quot;] ] depends: [ &quot;coq&quot; {&gt;= &quot;8.15&quot; &amp; &lt; &quot;8.16~&quot;} &quot;ocamlfind&quot; {build} ] depopts: [ &quot;coq-hott&quot; ] url { src: &quot;https://github.com/mattam82/Coq-Equations/archive/refs/tags/v1.3-8.15.tar.gz&quot; checksum: &quot;sha512=ec281fca0b148d9297f2c871a5485649bb93f24e8723f56a4a78d2bc6224984de16e0d6438fd3f7ee98ea0e69487208480bd44d3a30a92af667e38926b8dab0e&quot; } </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-equations.1.3+8.15 coq.8.11.2</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.11.2). The following dependencies couldn&#39;t be met: - coq-equations -&gt; coq &gt;= 8.15 Your request can&#39;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-equations.1.3+8.15</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": "5d03774d173ea1da461cfa641d217ed0", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 159, "avg_line_length": 40.171270718232044, "alnum_prop": 0.560858203823408, "repo_name": "coq-bench/coq-bench.github.io", "id": "97122502c1b98189dacc04eeef9c9c7af84679cd", "size": "7296", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.10.2-2.0.6/released/8.11.2/equations/1.3+8.15.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package org.apache.guacamole.rest.history; import org.apache.guacamole.net.auth.ActivityRecordSet; import org.apache.guacamole.net.auth.ConnectionRecord; /** * A REST resource for retrieving and managing the history records of Guacamole * connections. Connection history records describe the start/end times of each * usage of a connection (when a user connects and disconnects), as well as the * specific user that connected/disconnected. */ public class ConnectionHistoryResource extends ActivityRecordSetResource<ConnectionRecord, APIConnectionRecord> { /** * Creates a new ConnectionHistoryResource which exposes the connection * history records of the given ActivityRecordSet. * * @param history * The ActivityRecordSet whose records should be exposed. */ public ConnectionHistoryResource(ActivityRecordSet<ConnectionRecord> history) { super(history); } @Override protected APIConnectionRecord toExternalRecord(ConnectionRecord record) { return new APIConnectionRecord(record); } }
{ "content_hash": "889905a930b3bc1326a4010c8829dbe5", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 113, "avg_line_length": 33.53125, "alnum_prop": 0.7576887232059646, "repo_name": "mike-jumper/incubator-guacamole-client", "id": "42e8a8581ae50af603ee8a18a461f0aa61d55193", "size": "1880", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "guacamole/src/main/java/org/apache/guacamole/rest/history/ConnectionHistoryResource.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "112209" }, { "name": "HTML", "bytes": "64819" }, { "name": "Java", "bytes": "2156652" }, { "name": "JavaScript", "bytes": "1352512" }, { "name": "PLSQL", "bytes": "2094" }, { "name": "Roff", "bytes": "2434" }, { "name": "SQLPL", "bytes": "2374" }, { "name": "Shell", "bytes": "20170" } ], "symlink_target": "" }
// Blueberry #include <berryISelectionService.h> #include <berryIWorkbenchWindow.h> // Qmitk #include "QmitkFiberQuantificationView.h" // Qt #include <QMessageBox> // MITK #include <mitkNodePredicateProperty.h> #include <mitkImageCast.h> #include <mitkPointSet.h> #include <mitkPlanarCircle.h> #include <mitkPlanarPolygon.h> #include <mitkPlanarRectangle.h> #include <mitkPlanarFigureInteractor.h> #include <mitkImageAccessByItk.h> #include <mitkDataNodeObject.h> #include <mitkTensorImage.h> // ITK #include <itkResampleImageFilter.h> #include <itkGaussianInterpolateImageFunction.h> #include <itkImageRegionIteratorWithIndex.h> #include <itkTractsToFiberEndingsImageFilter.h> #include <itkTractDensityImageFilter.h> #include <itkImageRegion.h> #include <itkTractsToRgbaImageFilter.h> #include <itkTractsToVectorImageFilter.h> #include <math.h> #include <boost/lexical_cast.hpp> const std::string QmitkFiberQuantificationView::VIEW_ID = "org.mitk.views.fiberquantification"; const std::string id_DataManager = "org.mitk.views.datamanager"; using namespace mitk; QmitkFiberQuantificationView::QmitkFiberQuantificationView() : QmitkAbstractView() , m_Controls( 0 ) , m_UpsamplingFactor(5) { } // Destructor QmitkFiberQuantificationView::~QmitkFiberQuantificationView() { } void QmitkFiberQuantificationView::CreateQtPartControl( QWidget *parent ) { // build up qt view, unless already done if ( !m_Controls ) { // create GUI widgets from the Qt Designer's .ui file m_Controls = new Ui::QmitkFiberQuantificationViewControls; m_Controls->setupUi( parent ); connect( m_Controls->m_ProcessFiberBundleButton, SIGNAL(clicked()), this, SLOT(ProcessSelectedBundles()) ); connect( m_Controls->m_ExtractFiberPeaks, SIGNAL(clicked()), this, SLOT(CalculateFiberDirections()) ); } } void QmitkFiberQuantificationView::SetFocus() { m_Controls->m_ProcessFiberBundleButton->setFocus(); } void QmitkFiberQuantificationView::CalculateFiberDirections() { typedef itk::Image<unsigned char, 3> ItkUcharImgType; typedef itk::Image< itk::Vector< float, 3>, 3 > ItkDirectionImage3DType; typedef itk::VectorContainer< unsigned int, ItkDirectionImage3DType::Pointer > ItkDirectionImageContainerType; // load fiber bundle mitk::FiberBundle::Pointer inputTractogram = dynamic_cast<mitk::FiberBundle*>(m_SelectedFB.back()->GetData()); itk::TractsToVectorImageFilter<float>::Pointer fOdfFilter = itk::TractsToVectorImageFilter<float>::New(); if (m_SelectedImage.IsNotNull()) { ItkUcharImgType::Pointer itkMaskImage = ItkUcharImgType::New(); mitk::CastToItkImage<ItkUcharImgType>(m_SelectedImage, itkMaskImage); fOdfFilter->SetMaskImage(itkMaskImage); } // extract directions from fiber bundle fOdfFilter->SetFiberBundle(inputTractogram); fOdfFilter->SetAngularThreshold(cos(m_Controls->m_AngularThreshold->value()*M_PI/180)); fOdfFilter->SetNormalizeVectors(m_Controls->m_NormalizeDirectionsBox->isChecked()); fOdfFilter->SetUseWorkingCopy(true); fOdfFilter->SetCreateDirectionImages(m_Controls->m_DirectionImagesBox->isChecked()); fOdfFilter->SetSizeThreshold(m_Controls->m_PeakThreshold->value()); fOdfFilter->SetMaxNumDirections(m_Controls->m_MaxNumDirections->value()); fOdfFilter->Update(); QString name = m_SelectedFB.back()->GetName().c_str(); if (m_Controls->m_VectorFieldBox->isChecked()) { float minSpacing = 1; if (m_SelectedImage.IsNotNull()) { mitk::Vector3D outImageSpacing = m_SelectedImage->GetGeometry()->GetSpacing(); if(outImageSpacing[0]<outImageSpacing[1] && outImageSpacing[0]<outImageSpacing[2]) minSpacing = outImageSpacing[0]; else if (outImageSpacing[1] < outImageSpacing[2]) minSpacing = outImageSpacing[1]; else minSpacing = outImageSpacing[2]; } mitk::FiberBundle::Pointer directions = fOdfFilter->GetOutputFiberBundle(); mitk::DataNode::Pointer node = mitk::DataNode::New(); node->SetData(directions); node->SetName((name+"_VECTOR_FIELD").toStdString().c_str()); node->SetProperty("Fiber2DSliceThickness", mitk::FloatProperty::New(minSpacing)); node->SetProperty("Fiber2DfadeEFX", mitk::BoolProperty::New(false)); node->SetProperty("color", mitk::ColorProperty::New(1.0f, 1.0f, 1.0f)); GetDataStorage()->Add(node, m_SelectedFB.back()); } if (m_Controls->m_NumDirectionsBox->isChecked()) { mitk::Image::Pointer mitkImage = mitk::Image::New(); mitkImage->InitializeByItk( fOdfFilter->GetNumDirectionsImage().GetPointer() ); mitkImage->SetVolume( fOdfFilter->GetNumDirectionsImage()->GetBufferPointer() ); mitk::DataNode::Pointer node = mitk::DataNode::New(); node->SetData(mitkImage); node->SetName((name+"_NUM_DIRECTIONS").toStdString().c_str()); GetDataStorage()->Add(node, m_SelectedFB.back()); } if (m_Controls->m_DirectionImagesBox->isChecked()) { itk::TractsToVectorImageFilter<float>::ItkDirectionImageType::Pointer itkImg = fOdfFilter->GetDirectionImage(); if (itkImg.IsNull()) return; mitk::Image::Pointer mitkImage = mitk::Image::New(); mitkImage->InitializeByItk( itkImg.GetPointer() ); mitkImage->SetVolume( itkImg->GetBufferPointer() ); mitk::DataNode::Pointer node = mitk::DataNode::New(); node->SetData(mitkImage); node->SetName( (name+"_DIRECTIONS").toStdString().c_str()); GetDataStorage()->Add(node, m_SelectedFB.back()); } } void QmitkFiberQuantificationView::UpdateGui() { m_Controls->m_ProcessFiberBundleButton->setEnabled(!m_SelectedFB.empty()); m_Controls->m_ExtractFiberPeaks->setEnabled(!m_SelectedFB.empty()); } void QmitkFiberQuantificationView::OnSelectionChanged(berry::IWorkbenchPart::Pointer /*part*/, const QList<mitk::DataNode::Pointer>& nodes) { //reset existing Vectors containing FiberBundles and PlanarFigures from a previous selection m_SelectedFB.clear(); m_SelectedSurfaces.clear(); m_SelectedImage = NULL; for (mitk::DataNode::Pointer node: nodes) { if ( dynamic_cast<mitk::FiberBundle*>(node->GetData()) ) { m_SelectedFB.push_back(node); } else if (dynamic_cast<mitk::Image*>(node->GetData())) m_SelectedImage = dynamic_cast<mitk::Image*>(node->GetData()); else if (dynamic_cast<mitk::Surface*>(node->GetData())) { m_SelectedSurfaces.push_back(dynamic_cast<mitk::Surface*>(node->GetData())); } } UpdateGui(); GenerateStats(); } void QmitkFiberQuantificationView::GenerateStats() { if ( m_SelectedFB.empty() ) return; QString stats(""); for( int i=0; i<m_SelectedFB.size(); i++ ) { mitk::DataNode::Pointer node = m_SelectedFB[i]; if (node.IsNotNull() && dynamic_cast<mitk::FiberBundle*>(node->GetData())) { if (i>0) stats += "\n-----------------------------\n"; stats += QString(node->GetName().c_str()) + "\n"; mitk::FiberBundle::Pointer fib = dynamic_cast<mitk::FiberBundle*>(node->GetData()); stats += "Number of fibers: "+ QString::number(fib->GetNumFibers()) + "\n"; stats += "Number of points: "+ QString::number(fib->GetNumberOfPoints()) + "\n"; stats += "Min. length: "+ QString::number(fib->GetMinFiberLength(),'f',1) + " mm\n"; stats += "Max. length: "+ QString::number(fib->GetMaxFiberLength(),'f',1) + " mm\n"; stats += "Mean length: "+ QString::number(fib->GetMeanFiberLength(),'f',1) + " mm\n"; stats += "Median length: "+ QString::number(fib->GetMedianFiberLength(),'f',1) + " mm\n"; stats += "Standard deviation: "+ QString::number(fib->GetLengthStDev(),'f',1) + " mm\n"; vtkSmartPointer<vtkFloatArray> weights = fib->GetFiberWeights(); if (weights!=NULL) { stats += "Detected fiber weights\n"; // stats += "Detected fiber weights:\n"; // float weight=-1; // int c = 0; // for (int i=0; i<weights->GetSize(); i++) // if (!mitk::Equal(weights->GetValue(i),weight,0.00001)) // { // c++; // if (weight>0) // stats += QString::number(i) + ": "+ QString::number(weights->GetValue(i)) + "\n"; // stats += QString::number(c) + ". Fibers " + QString::number(i+1) + "-"; // weight = weights->GetValue(i); // } // stats += QString::number(weights->GetSize()) + ": "+ QString::number(weight) + "\n"; } else stats += "No fiber weight array found.\n"; } } this->m_Controls->m_StatsTextEdit->setText(stats); } void QmitkFiberQuantificationView::ProcessSelectedBundles() { if ( m_SelectedFB.empty() ){ QMessageBox::information( NULL, "Warning", "No fibe bundle selected!"); MITK_WARN("QmitkFiberQuantificationView") << "no fibe bundle selected"; return; } int generationMethod = m_Controls->m_GenerationBox->currentIndex(); for( int i=0; i<m_SelectedFB.size(); i++ ) { mitk::DataNode::Pointer node = m_SelectedFB[i]; if (node.IsNotNull() && dynamic_cast<mitk::FiberBundle*>(node->GetData())) { mitk::FiberBundle::Pointer fib = dynamic_cast<mitk::FiberBundle*>(node->GetData()); QString name(node->GetName().c_str()); DataNode::Pointer newNode = NULL; switch(generationMethod){ case 0: newNode = GenerateTractDensityImage(fib, false, true); name += "_TDI"; break; case 1: newNode = GenerateTractDensityImage(fib, false, false); name += "_TDI"; break; case 2: newNode = GenerateTractDensityImage(fib, true, false); name += "_envelope"; break; case 3: newNode = GenerateColorHeatmap(fib); break; case 4: newNode = GenerateFiberEndingsImage(fib); name += "_fiber_endings"; break; case 5: newNode = GenerateFiberEndingsPointSet(fib); name += "_fiber_endings"; break; } if (newNode.IsNotNull()) { newNode->SetName(name.toStdString()); GetDataStorage()->Add(newNode); } } } } // generate pointset displaying the fiber endings mitk::DataNode::Pointer QmitkFiberQuantificationView::GenerateFiberEndingsPointSet(mitk::FiberBundle::Pointer fib) { mitk::PointSet::Pointer pointSet = mitk::PointSet::New(); vtkSmartPointer<vtkPolyData> fiberPolyData = fib->GetFiberPolyData(); vtkSmartPointer<vtkCellArray> vLines = fiberPolyData->GetLines(); vLines->InitTraversal(); int count = 0; int numFibers = fib->GetNumFibers(); for( int i=0; i<numFibers; i++ ) { vtkIdType numPoints(0); vtkIdType* points(NULL); vLines->GetNextCell ( numPoints, points ); if (numPoints>0) { double* point = fiberPolyData->GetPoint(points[0]); itk::Point<float,3> itkPoint; itkPoint[0] = point[0]; itkPoint[1] = point[1]; itkPoint[2] = point[2]; pointSet->InsertPoint(count, itkPoint); count++; } if (numPoints>2) { double* point = fiberPolyData->GetPoint(points[numPoints-1]); itk::Point<float,3> itkPoint; itkPoint[0] = point[0]; itkPoint[1] = point[1]; itkPoint[2] = point[2]; pointSet->InsertPoint(count, itkPoint); count++; } } mitk::DataNode::Pointer node = mitk::DataNode::New(); node->SetData( pointSet ); return node; } // generate image displaying the fiber endings mitk::DataNode::Pointer QmitkFiberQuantificationView::GenerateFiberEndingsImage(mitk::FiberBundle::Pointer fib) { typedef unsigned char OutPixType; typedef itk::Image<OutPixType,3> OutImageType; typedef itk::TractsToFiberEndingsImageFilter< OutImageType > ImageGeneratorType; ImageGeneratorType::Pointer generator = ImageGeneratorType::New(); generator->SetFiberBundle(fib); generator->SetUpsamplingFactor(m_Controls->m_UpsamplingSpinBox->value()); if (m_SelectedImage.IsNotNull()) { OutImageType::Pointer itkImage = OutImageType::New(); CastToItkImage(m_SelectedImage, itkImage); generator->SetInputImage(itkImage); generator->SetUseImageGeometry(true); } generator->Update(); // get output image OutImageType::Pointer outImg = generator->GetOutput(); mitk::Image::Pointer img = mitk::Image::New(); img->InitializeByItk(outImg.GetPointer()); img->SetVolume(outImg->GetBufferPointer()); // init data node mitk::DataNode::Pointer node = mitk::DataNode::New(); node->SetData(img); return node; } // generate rgba heatmap from fiber bundle mitk::DataNode::Pointer QmitkFiberQuantificationView::GenerateColorHeatmap(mitk::FiberBundle::Pointer fib) { typedef itk::RGBAPixel<unsigned char> OutPixType; typedef itk::Image<OutPixType, 3> OutImageType; typedef itk::TractsToRgbaImageFilter< OutImageType > ImageGeneratorType; ImageGeneratorType::Pointer generator = ImageGeneratorType::New(); generator->SetFiberBundle(fib); generator->SetUpsamplingFactor(m_Controls->m_UpsamplingSpinBox->value()); if (m_SelectedImage.IsNotNull()) { itk::Image<unsigned char, 3>::Pointer itkImage = itk::Image<unsigned char, 3>::New(); CastToItkImage(m_SelectedImage, itkImage); generator->SetInputImage(itkImage); generator->SetUseImageGeometry(true); } generator->Update(); // get output image typedef itk::Image<OutPixType,3> OutType; OutType::Pointer outImg = generator->GetOutput(); mitk::Image::Pointer img = mitk::Image::New(); img->InitializeByItk(outImg.GetPointer()); img->SetVolume(outImg->GetBufferPointer()); // init data node mitk::DataNode::Pointer node = mitk::DataNode::New(); node->SetData(img); return node; } // generate tract density image from fiber bundle mitk::DataNode::Pointer QmitkFiberQuantificationView::GenerateTractDensityImage(mitk::FiberBundle::Pointer fib, bool binary, bool absolute) { mitk::DataNode::Pointer node = mitk::DataNode::New(); if (binary) { typedef unsigned char OutPixType; typedef itk::Image<OutPixType, 3> OutImageType; itk::TractDensityImageFilter< OutImageType >::Pointer generator = itk::TractDensityImageFilter< OutImageType >::New(); generator->SetFiberBundle(fib); generator->SetBinaryOutput(binary); generator->SetOutputAbsoluteValues(absolute); generator->SetUpsamplingFactor(m_Controls->m_UpsamplingSpinBox->value()); if (m_SelectedImage.IsNotNull()) { OutImageType::Pointer itkImage = OutImageType::New(); CastToItkImage(m_SelectedImage, itkImage); generator->SetInputImage(itkImage); generator->SetUseImageGeometry(true); } generator->Update(); // get output image typedef itk::Image<OutPixType,3> OutType; OutType::Pointer outImg = generator->GetOutput(); mitk::Image::Pointer img = mitk::Image::New(); img->InitializeByItk(outImg.GetPointer()); img->SetVolume(outImg->GetBufferPointer()); // init data node node->SetData(img); } else { typedef float OutPixType; typedef itk::Image<OutPixType, 3> OutImageType; itk::TractDensityImageFilter< OutImageType >::Pointer generator = itk::TractDensityImageFilter< OutImageType >::New(); generator->SetFiberBundle(fib); generator->SetBinaryOutput(binary); generator->SetOutputAbsoluteValues(absolute); generator->SetUpsamplingFactor(m_Controls->m_UpsamplingSpinBox->value()); if (m_SelectedImage.IsNotNull()) { OutImageType::Pointer itkImage = OutImageType::New(); CastToItkImage(m_SelectedImage, itkImage); generator->SetInputImage(itkImage); generator->SetUseImageGeometry(true); } //generator->SetDoFiberResampling(false); generator->Update(); // get output image typedef itk::Image<OutPixType,3> OutType; OutType::Pointer outImg = generator->GetOutput(); mitk::Image::Pointer img = mitk::Image::New(); img->InitializeByItk(outImg.GetPointer()); img->SetVolume(outImg->GetBufferPointer()); // init data node node->SetData(img); } return node; }
{ "content_hash": "5588e56c835ecdd6f1b32065eea655e2", "timestamp": "", "source": "github", "line_count": 463, "max_line_length": 139, "avg_line_length": 37.68034557235421, "alnum_prop": 0.625300928579617, "repo_name": "RabadanLab/MITKats", "id": "75abea2c2291bf16d7acfc40001d064d8cf45260", "size": "17944", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Plugins/org.mitk.gui.qt.diffusionimaging.fiberprocessing/src/internal/QmitkFiberQuantificationView.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "3346369" }, { "name": "C++", "bytes": "31343449" }, { "name": "CMake", "bytes": "1009499" }, { "name": "CSS", "bytes": "118558" }, { "name": "HTML", "bytes": "102168" }, { "name": "JavaScript", "bytes": "162600" }, { "name": "Jupyter Notebook", "bytes": "228462" }, { "name": "Makefile", "bytes": "25077" }, { "name": "Objective-C", "bytes": "26578" }, { "name": "Python", "bytes": "275885" }, { "name": "QML", "bytes": "28009" }, { "name": "QMake", "bytes": "5583" }, { "name": "Shell", "bytes": "1261" } ], "symlink_target": "" }
/*****************************************************************************/ /** * * @file xsdps_host.c * @addtogroup sdps_v3_9 * @{ * * Contains the interface functions of the XSdPs driver. * See xsdps.h for a detailed description of the device and driver. * * <pre> * MODIFICATION HISTORY: * * Ver Who Date Changes * ----- --- -------- ----------------------------------------------- * 3.9 mn 03/03/20 Restructured the code for more readability and modularity * mn 03/16/20 Add code to get card ID for MMC/eMMC * * </pre> * ******************************************************************************/ /***************************** Include Files *********************************/ #include "xsdps_core.h" /************************** Constant Definitions *****************************/ /**************************** Type Definitions *******************************/ /***************** Macros (Inline Functions) Definitions *********************/ /************************** Function Prototypes ******************************/ #if EL1_NONSECURE && defined (__aarch64__) void XSdps_Smc(XSdPs *InstancePtr, u32 RegOffset, u32 Mask, u32 Val) { (void)Xil_Smc(MMIO_WRITE_SMC_FID, (u64)(InstancePtr->SlcrBaseAddr + RegOffset) | ((u64)Mask << 32), (u64)Val, 0, 0, 0, 0, 0); } #endif /*****************************************************************************/ /** * * @brief * Switches the SD card voltage from 3v3 to 1v8 * * * @param InstancePtr is a pointer to the XSdPs instance. * ******************************************************************************/ s32 XSdPs_Switch_Voltage(XSdPs *InstancePtr) { s32 Status; /* Setup the voltage switching sequence */ Status = XSdPs_SetupVoltageSwitch(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Set the card voltage to 1.8V */ Status = XSdPs_CardSetVoltage18(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Check if the bus is high */ Status = XSdPs_CheckBusHigh(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; } RETURN_PATH: return Status; } /*****************************************************************************/ /** * @brief * This function initiates the transfer to or from SD card. * * @param InstancePtr is a pointer to the instance to be worked on. * * @return * - XST_SUCCESS if initialization was successful * - XST_FAILURE if failure * ******************************************************************************/ s32 XSdPs_SetupTransfer(XSdPs *InstancePtr) { u32 PresentStateReg; s32 Status; if ((InstancePtr->HC_Version != XSDPS_HC_SPEC_V3) || ((InstancePtr->Host_Caps & XSDPS_CAPS_SLOT_TYPE_MASK) != XSDPS_CAPS_EMB_SLOT)) { if(InstancePtr->Config.CardDetect != 0U) { /* Check status to ensure card is initialized */ PresentStateReg = XSdPs_ReadReg(InstancePtr->Config.BaseAddress, XSDPS_PRES_STATE_OFFSET); if ((PresentStateReg & XSDPS_PSR_CARD_INSRT_MASK) == 0x0U) { Status = XST_FAILURE; goto RETURN_PATH; } } } /* Set block size to 512 if not already set */ if(XSdPs_ReadReg(InstancePtr->Config.BaseAddress, XSDPS_BLK_SIZE_OFFSET) != XSDPS_BLK_SIZE_512_MASK ) { Status = XSdPs_SetBlkSize(InstancePtr, XSDPS_BLK_SIZE_512_MASK); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } } Status = XST_SUCCESS; RETURN_PATH: return Status; } /*****************************************************************************/ /** * @brief * This function resets the SD card. * * @param InstancePtr is a pointer to the instance to be worked on. * @param Value is the type of reset * * @return * - XST_SUCCESS if initialization was successful * - XST_FAILURE if failure * ******************************************************************************/ s32 XSdPs_Reset(XSdPs *InstancePtr, u8 Value) { s32 Status; /* "Software reset for all" is initiated */ XSdPs_WriteReg8(InstancePtr->Config.BaseAddress, XSDPS_SW_RST_OFFSET, Value); Status = XSdPs_CheckResetDone(InstancePtr, Value); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH ; } RETURN_PATH: return Status; } /*****************************************************************************/ /** * @brief * This function sets bit to start execution of tuning. * * @param InstancePtr is a pointer to the instance to be worked on. * * @return None * ******************************************************************************/ void XSdPs_SetExecTuning(XSdPs *InstancePtr) { u16 CtrlReg; CtrlReg = XSdPs_ReadReg16(InstancePtr->Config.BaseAddress, XSDPS_HOST_CTRL2_OFFSET); CtrlReg |= XSDPS_HC2_EXEC_TNG_MASK; XSdPs_WriteReg16(InstancePtr->Config.BaseAddress, XSDPS_HOST_CTRL2_OFFSET, CtrlReg); } /*****************************************************************************/ /** * @brief * This function does SD mode initialization. * * @param InstancePtr is a pointer to the instance to be worked on. * * @return * - XST_SUCCESS if initialization is successful * - XST_FAILURE if failure * ******************************************************************************/ s32 XSdPs_SdModeInit(XSdPs *InstancePtr) { s32 Status; #ifdef __ICCARM__ #pragma data_alignment = 32 static u8 SCR[8] = { 0U }; #else static u8 SCR[8] __attribute__ ((aligned(32))) = { 0U }; #endif u8 ReadBuff[64] = { 0U }; Status = XSdPs_Get_BusWidth(InstancePtr, SCR); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } if ((SCR[1] & WIDTH_4_BIT_SUPPORT) != 0U) { InstancePtr->BusWidth = XSDPS_4_BIT_WIDTH; Status = XSdPs_Change_BusWidth(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } } /* Get speed supported by device */ Status = XSdPs_Get_BusSpeed(InstancePtr, ReadBuff); if (Status != XST_SUCCESS) { goto RETURN_PATH; } if (((SCR[2] & SCR_SPEC_VER_3) != 0U) && (ReadBuff[13] >= UHS_SDR50_SUPPORT) && (InstancePtr->Config.BusWidth == XSDPS_WIDTH_8) && (InstancePtr->Switch1v8 == 0U)) { InstancePtr->Switch1v8 = 1U; Status = XSdPs_CardSetVoltage18(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } } if (InstancePtr->Switch1v8 != 0U) { /* Identify the UHS mode supported by card */ XSdPs_Identify_UhsMode(InstancePtr, ReadBuff); Status = XSdPs_Change_BusSpeed(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } } else { /* * card supports CMD6 when SD_SPEC field in SCR register * indicates that the Physical Layer Specification Version * is 1.10 or later. So for SD v1.0 cmd6 is not supported. */ if (SCR[0] != 0U) { /* Check for high speed support */ if (((ReadBuff[13] & HIGH_SPEED_SUPPORT) != 0U) && (InstancePtr->BusWidth >= XSDPS_4_BIT_WIDTH)) { InstancePtr->Mode = XSDPS_HIGH_SPEED_MODE; InstancePtr->OTapDelay = SD_OTAPDLYSEL_SD_HSD; InstancePtr->ITapDelay = SD_ITAPDLYSEL_HSD; Status = XSdPs_Change_BusSpeed(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } } } } Status = XSdPs_SetBlkSize(InstancePtr, XSDPS_BLK_SIZE_512_MASK); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } Status = XST_SUCCESS; RETURN_PATH: return Status; } /*****************************************************************************/ /** * @brief * This function does MMC mode initialization. * * @param InstancePtr is a pointer to the instance to be worked on. * * @return * - XST_SUCCESS if initialization is successful * - XST_FAILURE if failure * ******************************************************************************/ s32 XSdPs_MmcModeInit(XSdPs *InstancePtr) { s32 Status; #ifdef __ICCARM__ #pragma data_alignment = 32 static u8 ExtCsd[512]; #else static u8 ExtCsd[512] __attribute__ ((aligned(32))); #endif InstancePtr->BusWidth = XSDPS_4_BIT_WIDTH; Status = XSdPs_Change_BusWidth(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } Status = XSdPs_Get_Mmc_ExtCsd(InstancePtr, ExtCsd); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } InstancePtr->SectorCount = ((u32)ExtCsd[EXT_CSD_SEC_COUNT_BYTE4]) << 24; InstancePtr->SectorCount |= (u32)ExtCsd[EXT_CSD_SEC_COUNT_BYTE3] << 16; InstancePtr->SectorCount |= (u32)ExtCsd[EXT_CSD_SEC_COUNT_BYTE2] << 8; InstancePtr->SectorCount |= (u32)ExtCsd[EXT_CSD_SEC_COUNT_BYTE1]; if (((ExtCsd[EXT_CSD_DEVICE_TYPE_BYTE] & EXT_CSD_DEVICE_TYPE_HIGH_SPEED) != 0U) && (InstancePtr->BusWidth >= XSDPS_4_BIT_WIDTH)) { InstancePtr->Mode = XSDPS_HIGH_SPEED_MODE; Status = XSdPs_Change_BusSpeed(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } Status = XSdPs_Get_Mmc_ExtCsd(InstancePtr, ExtCsd); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } if (ExtCsd[EXT_CSD_HS_TIMING_BYTE] != EXT_CSD_HS_TIMING_HIGH) { Status = XST_FAILURE; goto RETURN_PATH; } } Status = XST_SUCCESS; RETURN_PATH: return Status; } /*****************************************************************************/ /** * @brief * This function does eMMC mode initialization. * * @param InstancePtr is a pointer to the instance to be worked on. * * @return * - XST_SUCCESS if initialization is successful * - XST_FAILURE if failure * ******************************************************************************/ s32 XSdPs_EmmcModeInit(XSdPs *InstancePtr) { s32 Status; #ifdef __ICCARM__ #pragma data_alignment = 32 static u8 ExtCsd[512]; #else static u8 ExtCsd[512] __attribute__ ((aligned(32))); #endif if ((InstancePtr->HC_Version == XSDPS_HC_SPEC_V3) && (InstancePtr->Config.BusWidth == XSDPS_WIDTH_8)) { /* in case of eMMC data width 8-bit */ InstancePtr->BusWidth = XSDPS_8_BIT_WIDTH; } else if (InstancePtr->Config.BusWidth == XSDPS_WIDTH_4) { /* in case of eMMC data width 4-bit */ InstancePtr->BusWidth = XSDPS_4_BIT_WIDTH; } else { /* in case of eMMC data width 1-bit */ InstancePtr->BusWidth = XSDPS_1_BIT_WIDTH; } Status = XSdPs_Change_BusWidth(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Get Extended CSD */ Status = XSdPs_Get_Mmc_ExtCsd(InstancePtr, ExtCsd); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } InstancePtr->SectorCount = ((u32)ExtCsd[EXT_CSD_SEC_COUNT_BYTE4]) << 24; InstancePtr->SectorCount |= (u32)ExtCsd[EXT_CSD_SEC_COUNT_BYTE3] << 16; InstancePtr->SectorCount |= (u32)ExtCsd[EXT_CSD_SEC_COUNT_BYTE2] << 8; InstancePtr->SectorCount |= (u32)ExtCsd[EXT_CSD_SEC_COUNT_BYTE1]; XSdPs_IdentifyEmmcMode(InstancePtr, ExtCsd); if (InstancePtr->Mode != XSDPS_DEFAULT_SPEED_MODE) { Status = XSdPs_Change_BusSpeed(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } Status = XSdPs_CheckEmmcTiming(InstancePtr, ExtCsd); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } } /* Enable Rst_n_Fun bit if it is disabled */ if(ExtCsd[EXT_CSD_RST_N_FUN_BYTE] == EXT_CSD_RST_N_FUN_TEMP_DIS) { Status = XSdPs_Set_Mmc_ExtCsd(InstancePtr, XSDPS_MMC_RST_FUN_EN_ARG); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } } Status = XST_SUCCESS; RETURN_PATH: return Status; } /*****************************************************************************/ /** * @brief * This function disables the bus power. * * @param InstancePtr is a pointer to the instance to be worked on. * * @return None * ******************************************************************************/ void XSdPs_DisableBusPower(XSdPs *InstancePtr) { /* Disable SD bus power and issue eMMC HW reset */ if (InstancePtr->HC_Version == XSDPS_HC_SPEC_V3) { XSdPs_WriteReg8(InstancePtr->Config.BaseAddress, XSDPS_POWER_CTRL_OFFSET, XSDPS_PC_EMMC_HW_RST_MASK); } else { XSdPs_WriteReg8(InstancePtr->Config.BaseAddress, XSDPS_POWER_CTRL_OFFSET, 0x0); } /* 1ms delay to poweroff card */ (void)usleep(1000U); } /*****************************************************************************/ /** * @brief * This function enables the bus power. * * @param InstancePtr is a pointer to the instance to be worked on. * * @return None * ******************************************************************************/ void XSdPs_EnableBusPower(XSdPs *InstancePtr) { /* Select voltage and enable bus power. */ if (InstancePtr->HC_Version == XSDPS_HC_SPEC_V3) { XSdPs_WriteReg8(InstancePtr->Config.BaseAddress, XSDPS_POWER_CTRL_OFFSET, (XSDPS_PC_BUS_VSEL_3V3_MASK | XSDPS_PC_BUS_PWR_MASK) & ~XSDPS_PC_EMMC_HW_RST_MASK); } else { XSdPs_WriteReg8(InstancePtr->Config.BaseAddress, XSDPS_POWER_CTRL_OFFSET, XSDPS_PC_BUS_VSEL_3V3_MASK | XSDPS_PC_BUS_PWR_MASK); } /* 0.2ms Delay after bus power on*/ usleep(200); } /*****************************************************************************/ /** * @brief * This function enumerates the SD card. * * @param InstancePtr is a pointer to the instance to be worked on. * * @return None * ******************************************************************************/ s32 XSdPs_SdCardEnum(XSdPs *InstancePtr) { s32 Status; /* Check if the card is present */ Status = XSdPs_CheckCardDetect(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Reset the SD card */ Status = XSdPs_CardReset(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Get the card interface condition */ Status = XSdPs_CardIfCond(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Get the card operating condition */ Status = XSdPs_CardOpCond(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Get the card ID */ Status = XSdPs_GetCardId(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Get the CSD register */ Status = XSdPs_GetCsd(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Change clock to default clock 25MHz */ /* * SD default speed mode timing should be closed at 19 MHz. * The reason for this is SD requires a voltage level shifter. * This limitation applies to ZynqMPSoC. */ if (InstancePtr->HC_Version == XSDPS_HC_SPEC_V3) { InstancePtr->BusSpeed = SD_CLK_19_MHZ; } else { InstancePtr->BusSpeed = SD_CLK_25_MHZ; } Status = XSdPs_Change_ClkFreq(InstancePtr, InstancePtr->BusSpeed); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Select the card to transition to transfer state */ Status = XSdPs_Select_Card(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Pull-up disconnected during data transfer */ Status = XSdPs_Pullup(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } Status = XST_SUCCESS; RETURN_PATH: return Status; } /*****************************************************************************/ /** * @brief * This function enumerates the MMC card. * * @param InstancePtr is a pointer to the instance to be worked on. * * @return None * ******************************************************************************/ s32 XSdPs_MmcCardEnum(XSdPs *InstancePtr) { s32 Status; /* Check if the card is preset */ Status = XSdPs_CheckCardDetect(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Reset the card */ Status = XSdPs_CardReset(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Get the card operating condition */ Status = XSdPs_CardOpCond(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Get the card ID */ Status = XSdPs_GetCardId(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Get the CSD register */ Status = XSdPs_GetCsd(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Change clock to default clock 26MHz */ InstancePtr->BusSpeed = SD_CLK_26_MHZ; Status = XSdPs_Change_ClkFreq(InstancePtr, InstancePtr->BusSpeed); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Send select card command to transition to transfer state */ Status = XSdPs_Select_Card(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } Status = XST_SUCCESS; RETURN_PATH: return Status; } /*****************************************************************************/ /** * @brief * This function performs SD tuning. * * @param InstancePtr is a pointer to the instance to be worked on. * * @return None * ******************************************************************************/ s32 XSdPs_Execute_Tuning(XSdPs *InstancePtr) { s32 Status; #ifndef versal /* Issue DLL Reset to load new SDHC tuned tap values */ Status = XSdPs_DllReset(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } #endif /* Perform the auto tuning */ Status = XSdPs_AutoTuning(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } #ifndef versal /* Issue DLL Reset to load new SDHC tuned tap values */ Status = XSdPs_DllReset(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } #endif Status = XST_SUCCESS; RETURN_PATH: return Status; } /*****************************************************************************/ /** * @brief * This function is used to enable the clock. * * @param InstancePtr is a pointer to the instance to be worked on. * @param ClockReg is the clock value to be set. * * @return * - XST_SUCCESS if success * - XST_FAILURE if failure * ******************************************************************************/ s32 XSdPs_EnableClock(XSdPs *InstancePtr, u16 ClockReg) { u32 Timeout = 150000U; s32 Status; u16 ReadReg; ClockReg |= (u16)XSDPS_CC_INT_CLK_EN_MASK; XSdPs_WriteReg16(InstancePtr->Config.BaseAddress, XSDPS_CLK_CTRL_OFFSET, ClockReg); /* Wait for 150ms for internal clock to stabilize */ do { ReadReg = XSdPs_ReadReg16(InstancePtr->Config.BaseAddress, XSDPS_CLK_CTRL_OFFSET); Timeout = Timeout - 1U; usleep(1); } while (((ReadReg & XSDPS_CC_INT_CLK_STABLE_MASK) == 0U) && (Timeout != 0U)); if (Timeout == 0U) { Status = XST_FAILURE; goto RETURN_PATH ; } /* Enable SD clock */ ClockReg |= XSDPS_CC_SD_CLK_EN_MASK; XSdPs_WriteReg16(InstancePtr->Config.BaseAddress, XSDPS_CLK_CTRL_OFFSET, ClockReg); Status = XST_SUCCESS; RETURN_PATH: return Status; } /*****************************************************************************/ /** * @brief * This function is used to calculate the bus speed. * * @param InstancePtr is a pointer to the instance to be worked on. * @param Arg is the argument to be sent along with the command. * This could be address or any other information * * @return * - XST_SUCCESS if success * - XST_FAILURE if failure * ******************************************************************************/ s32 XSdPs_CalcBusSpeed(XSdPs *InstancePtr, u32 *Arg) { s32 Status = XST_SUCCESS; if (InstancePtr->CardType == XSDPS_CARD_SD) { switch (InstancePtr->Mode) { case XSDPS_UHS_SPEED_MODE_SDR12: *Arg = XSDPS_SWITCH_CMD_SDR12_SET; InstancePtr->BusSpeed = XSDPS_SD_SDR12_MAX_CLK; break; case XSDPS_UHS_SPEED_MODE_SDR25: *Arg = XSDPS_SWITCH_CMD_SDR25_SET; InstancePtr->BusSpeed = XSDPS_SD_SDR25_MAX_CLK; break; case XSDPS_UHS_SPEED_MODE_SDR50: *Arg = XSDPS_SWITCH_CMD_SDR50_SET; InstancePtr->BusSpeed = XSDPS_SD_SDR50_MAX_CLK; break; case XSDPS_UHS_SPEED_MODE_SDR104: *Arg = XSDPS_SWITCH_CMD_SDR104_SET; InstancePtr->BusSpeed = XSDPS_SD_SDR104_MAX_CLK; break; case XSDPS_UHS_SPEED_MODE_DDR50: *Arg = XSDPS_SWITCH_CMD_DDR50_SET; InstancePtr->BusSpeed = XSDPS_SD_DDR50_MAX_CLK; break; case XSDPS_HIGH_SPEED_MODE: *Arg = XSDPS_SWITCH_CMD_HS_SET; InstancePtr->BusSpeed = XSDPS_CLK_50_MHZ; break; default: Status = XST_FAILURE; break; } } else { switch (InstancePtr->Mode) { case XSDPS_HS200_MODE: *Arg = XSDPS_MMC_HS200_ARG; InstancePtr->BusSpeed = XSDPS_MMC_HS200_MAX_CLK; break; case XSDPS_DDR52_MODE: *Arg = XSDPS_MMC_HIGH_SPEED_ARG; InstancePtr->BusSpeed = XSDPS_MMC_DDR_MAX_CLK; break; case XSDPS_HIGH_SPEED_MODE: *Arg = XSDPS_MMC_HIGH_SPEED_ARG; InstancePtr->BusSpeed = XSDPS_MMC_HSD_MAX_CLK; break; default: Status = XST_FAILURE; break; } } return Status; } /*****************************************************************************/ /** * @brief * This function is used to do the DMA transfer to or from SD card. * * @param InstancePtr is a pointer to the instance to be worked on. * @param BlkCnt - Block count passed by the user. * @param BlkSize - Block size passed by the user. * @param Buff - Pointer to the data buffer for a DMA transfer. * * @return * - XST_SUCCESS if initialization was successful * - XST_FAILURE if failure - could be because another transfer * is in progress or command or data inhibit is set * ******************************************************************************/ void XSdPs_SetupReadDma(XSdPs *InstancePtr, u16 BlkCnt, u16 BlkSize, u8 *Buff) { BlkSize &= XSDPS_BLK_SIZE_MASK; XSdPs_WriteReg16(InstancePtr->Config.BaseAddress, XSDPS_BLK_SIZE_OFFSET, BlkSize); if (InstancePtr->Dma64BitAddr >= ADDRESS_BEYOND_32BIT) { XSdPs_SetupADMA2DescTbl64Bit(InstancePtr, BlkCnt); } else { XSdPs_SetupADMA2DescTbl(InstancePtr, BlkCnt, Buff); if (InstancePtr->Config.IsCacheCoherent == 0U) { Xil_DCacheInvalidateRange((INTPTR)Buff, (INTPTR)BlkCnt * BlkSize); } } if (BlkCnt == 1U) { InstancePtr->TransferMode = XSDPS_TM_BLK_CNT_EN_MASK | XSDPS_TM_DAT_DIR_SEL_MASK | XSDPS_TM_DMA_EN_MASK; } else { InstancePtr->TransferMode = XSDPS_TM_AUTO_CMD12_EN_MASK | XSDPS_TM_BLK_CNT_EN_MASK | XSDPS_TM_DAT_DIR_SEL_MASK | XSDPS_TM_DMA_EN_MASK | XSDPS_TM_MUL_SIN_BLK_SEL_MASK; } } /*****************************************************************************/ /** * @brief * This function is used to do the DMA transfer to or from SD card. * * @param InstancePtr is a pointer to the instance to be worked on. * @param BlkCnt - Block count passed by the user. * @param BlkSize - Block size passed by the user. * @param Buff - Pointer to the data buffer for a DMA transfer. * * @return * - XST_SUCCESS if initialization was successful * - XST_FAILURE if failure - could be because another transfer * is in progress or command or data inhibit is set * ******************************************************************************/ void XSdPs_SetupWriteDma(XSdPs *InstancePtr, u16 BlkCnt, u16 BlkSize, const u8 *Buff) { BlkSize &= XSDPS_BLK_SIZE_MASK; XSdPs_WriteReg16(InstancePtr->Config.BaseAddress, XSDPS_BLK_SIZE_OFFSET, BlkSize); if (InstancePtr->Dma64BitAddr >= ADDRESS_BEYOND_32BIT) { XSdPs_SetupADMA2DescTbl64Bit(InstancePtr, BlkCnt); } else { XSdPs_SetupADMA2DescTbl(InstancePtr, BlkCnt, Buff); if (InstancePtr->Config.IsCacheCoherent == 0U) { Xil_DCacheFlushRange((INTPTR)Buff, (INTPTR)BlkCnt * BlkSize); } } if (BlkCnt == 1U) { InstancePtr->TransferMode = XSDPS_TM_BLK_CNT_EN_MASK | XSDPS_TM_DMA_EN_MASK; } else { InstancePtr->TransferMode = XSDPS_TM_AUTO_CMD12_EN_MASK | XSDPS_TM_BLK_CNT_EN_MASK | XSDPS_TM_MUL_SIN_BLK_SEL_MASK | XSDPS_TM_DMA_EN_MASK; } } /*****************************************************************************/ /** * * @brief * API to setup ADMA2 descriptor table for 32-bit DMA * * * @param InstancePtr is a pointer to the XSdPs instance. * @param BlkCnt - block count. * @param Buff pointer to data buffer. * * @return None * * @note None. * ******************************************************************************/ void XSdPs_Setup32ADMA2DescTbl(XSdPs *InstancePtr, u32 BlkCnt, const u8 *Buff) { #ifdef __ICCARM__ #pragma data_alignment = 32 static XSdPs_Adma2Descriptor32 Adma2_DescrTbl[32]; #else static XSdPs_Adma2Descriptor32 Adma2_DescrTbl[32] __attribute__ ((aligned(32))); #endif u32 TotalDescLines; u64 DescNum; u32 BlkSize; /* Setup ADMA2 - Write descriptor table and point ADMA SAR to it */ BlkSize = (u32)XSdPs_ReadReg16(InstancePtr->Config.BaseAddress, XSDPS_BLK_SIZE_OFFSET) & XSDPS_BLK_SIZE_MASK; if((BlkCnt*BlkSize) < XSDPS_DESC_MAX_LENGTH) { TotalDescLines = 1U; } else { TotalDescLines = ((BlkCnt*BlkSize) / XSDPS_DESC_MAX_LENGTH); if (((BlkCnt * BlkSize) % XSDPS_DESC_MAX_LENGTH) != 0U) { TotalDescLines += 1U; } } for (DescNum = 0U; DescNum < (TotalDescLines-1); DescNum++) { Adma2_DescrTbl[DescNum].Address = (u32)((UINTPTR)Buff + (DescNum*XSDPS_DESC_MAX_LENGTH)); Adma2_DescrTbl[DescNum].Attribute = XSDPS_DESC_TRAN | XSDPS_DESC_VALID; Adma2_DescrTbl[DescNum].Length = 0U; } Adma2_DescrTbl[TotalDescLines-1].Address = (u32)((UINTPTR)Buff + (DescNum*XSDPS_DESC_MAX_LENGTH)); Adma2_DescrTbl[TotalDescLines-1].Attribute = XSDPS_DESC_TRAN | XSDPS_DESC_END | XSDPS_DESC_VALID; Adma2_DescrTbl[TotalDescLines-1].Length = (u16)((BlkCnt*BlkSize) - (u32)(DescNum*XSDPS_DESC_MAX_LENGTH)); XSdPs_WriteReg(InstancePtr->Config.BaseAddress, XSDPS_ADMA_SAR_OFFSET, (u32)((UINTPTR)&(Adma2_DescrTbl[0]) & (u32)~0x0)); if (InstancePtr->Config.IsCacheCoherent == 0U) { Xil_DCacheFlushRange((INTPTR)&(Adma2_DescrTbl[0]), sizeof(XSdPs_Adma2Descriptor32) * 32U); } } /*****************************************************************************/ /** * * @brief * API to setup ADMA2 descriptor table for 64-bit DMA * * * @param InstancePtr is a pointer to the XSdPs instance. * @param BlkCnt - block count. * @param Buff pointer to data buffer. * * @return None * * @note None. * ******************************************************************************/ void XSdPs_Setup64ADMA2DescTbl(XSdPs *InstancePtr, u32 BlkCnt, const u8 *Buff) { #ifdef __ICCARM__ #pragma data_alignment = 32 static XSdPs_Adma2Descriptor64 Adma2_DescrTbl[32]; #else static XSdPs_Adma2Descriptor64 Adma2_DescrTbl[32] __attribute__ ((aligned(32))); #endif u32 TotalDescLines; u64 DescNum; u32 BlkSize; /* Setup ADMA2 - Write descriptor table and point ADMA SAR to it */ BlkSize = (u32)XSdPs_ReadReg16(InstancePtr->Config.BaseAddress, XSDPS_BLK_SIZE_OFFSET) & XSDPS_BLK_SIZE_MASK; if((BlkCnt*BlkSize) < XSDPS_DESC_MAX_LENGTH) { TotalDescLines = 1U; } else { TotalDescLines = ((BlkCnt*BlkSize) / XSDPS_DESC_MAX_LENGTH); if (((BlkCnt * BlkSize) % XSDPS_DESC_MAX_LENGTH) != 0U) { TotalDescLines += 1U; } } for (DescNum = 0U; DescNum < (TotalDescLines-1); DescNum++) { Adma2_DescrTbl[DescNum].Address = ((UINTPTR)Buff + (DescNum*XSDPS_DESC_MAX_LENGTH)); Adma2_DescrTbl[DescNum].Attribute = XSDPS_DESC_TRAN | XSDPS_DESC_VALID; Adma2_DescrTbl[DescNum].Length = 0U; } Adma2_DescrTbl[TotalDescLines-1].Address = (u64)((UINTPTR)Buff + (DescNum*XSDPS_DESC_MAX_LENGTH)); Adma2_DescrTbl[TotalDescLines-1].Attribute = XSDPS_DESC_TRAN | XSDPS_DESC_END | XSDPS_DESC_VALID; Adma2_DescrTbl[TotalDescLines-1].Length = (u16)((BlkCnt*BlkSize) - (u32)(DescNum*XSDPS_DESC_MAX_LENGTH)); #if defined(__aarch64__) || defined(__arch64__) XSdPs_WriteReg(InstancePtr->Config.BaseAddress, XSDPS_ADMA_SAR_EXT_OFFSET, (u32)((UINTPTR)(Adma2_DescrTbl)>>32U)); #endif XSdPs_WriteReg(InstancePtr->Config.BaseAddress, XSDPS_ADMA_SAR_OFFSET, (u32)((UINTPTR)&(Adma2_DescrTbl[0]) & (u32)~0x0)); if (InstancePtr->Config.IsCacheCoherent == 0U) { Xil_DCacheFlushRange((INTPTR)&(Adma2_DescrTbl[0]), sizeof(XSdPs_Adma2Descriptor64) * 32U); } } /*****************************************************************************/ /** * @brief * This function is used calculate the clock divisor value. * * @param InstancePtr is a pointer to the instance to be worked on. * @param SelFreq is the selected frequency * * @return Clock divisor value * ******************************************************************************/ u32 XSdPs_CalcClock(XSdPs *InstancePtr, u32 SelFreq) { u16 ClockVal = 0U; u16 DivCnt; u16 Divisor = 0U; if (InstancePtr->HC_Version == XSDPS_HC_SPEC_V3) { /* Calculate divisor */ for (DivCnt = 0x1U; DivCnt <= XSDPS_CC_EXT_MAX_DIV_CNT; DivCnt++) { if (((InstancePtr->Config.InputClockHz) / DivCnt) <= SelFreq) { Divisor = DivCnt >> 1; break; } } } else { /* Calculate divisor */ for (DivCnt = 0x1U; DivCnt <= XSDPS_CC_MAX_DIV_CNT; DivCnt <<= 1U) { if (((InstancePtr->Config.InputClockHz) / DivCnt) <= SelFreq) { Divisor = DivCnt / 2U; break; } } } ClockVal |= (Divisor & XSDPS_CC_SDCLK_FREQ_SEL_MASK) << XSDPS_CC_DIV_SHIFT; ClockVal |= ((Divisor >> 8U) & XSDPS_CC_SDCLK_FREQ_SEL_EXT_MASK) << XSDPS_CC_EXT_DIV_SHIFT; return ClockVal; } /*****************************************************************************/ /** * * @brief * API to Set or Reset the DLL * * * @param InstancePtr is a pointer to the XSdPs instance. * @param EnRst is a flag indicating whether to Assert or De-assert Reset. * * @return None * * @note None. * ******************************************************************************/ void XSdPs_DllRstCtrl(XSdPs *InstancePtr, u8 EnRst) { u32 DeviceId; u32 DllCtrl; DeviceId = InstancePtr->Config.DeviceId; #ifdef versal #ifdef XPAR_PSV_PMC_SD_0_DEVICE_ID if (DeviceId == 0U) { #if EL1_NONSECURE && defined (__aarch64__) (void)DllCtrl; XSdps_Smc(InstancePtr, SD0_DLL_CTRL, SD_DLL_RST, (EnRst == 1U) ? SD0_DLL_RST : 0U); #else /* EL1_NONSECURE && defined (__aarch64__) */ DllCtrl = XSdPs_ReadReg(InstancePtr->SlcrBaseAddr, SD0_DLL_CTRL); if (EnRst == 1U) { DllCtrl |= SD_DLL_RST; } else { DllCtrl &= ~SD_DLL_RST; } XSdPs_WriteReg(InstancePtr->SlcrBaseAddr, SD0_DLL_CTRL, DllCtrl); #endif /* EL1_NONSECURE && defined (__aarch64__) */ } else { #endif /* XPAR_PSV_PMC_SD_0_DEVICE_ID */ (void) DeviceId; #if EL1_NONSECURE && defined (__aarch64__) (void)DllCtrl; XSdps_Smc(InstancePtr, SD1_DLL_CTRL, SD_DLL_RST, (EnRst == 1U) ? SD_DLL_RST : 0U); #else DllCtrl = XSdPs_ReadReg(InstancePtr->SlcrBaseAddr, SD1_DLL_CTRL); if (EnRst == 1U) { DllCtrl |= SD_DLL_RST; } else { DllCtrl &= ~SD_DLL_RST; } XSdPs_WriteReg(InstancePtr->SlcrBaseAddr, SD1_DLL_CTRL, DllCtrl); #endif #ifdef XPAR_PSV_PMC_SD_0_DEVICE_ID } #endif /* XPAR_PSV_PMC_SD_0_DEVICE_ID */ #else /* versal */ #ifdef XPAR_PSU_SD_0_DEVICE_ID if (DeviceId == 0U) { #if EL1_NONSECURE && defined (__aarch64__) (void)DllCtrl; XSdps_Smc(InstancePtr, SD_DLL_CTRL, SD0_DLL_RST, (EnRst == 1U) ? SD0_DLL_RST : 0U); #else DllCtrl = XSdPs_ReadReg(InstancePtr->SlcrBaseAddr, SD_DLL_CTRL); if (EnRst == 1U) { DllCtrl |= SD0_DLL_RST; } else { DllCtrl &= ~SD0_DLL_RST; } XSdPs_WriteReg(InstancePtr->SlcrBaseAddr, SD_DLL_CTRL, DllCtrl); #endif } else { #endif /* XPAR_PSU_SD_0_DEVICE_ID */ (void) DeviceId; #if EL1_NONSECURE && defined (__aarch64__) (void)DllCtrl; XSdps_Smc(InstancePtr, SD_DLL_CTRL, SD1_DLL_RST, (EnRst == 1U) ? SD1_DLL_RST : 0U); #else DllCtrl = XSdPs_ReadReg(InstancePtr->SlcrBaseAddr, SD_DLL_CTRL); if (EnRst == 1U) { DllCtrl |= SD1_DLL_RST; } else { DllCtrl &= ~SD1_DLL_RST; } XSdPs_WriteReg(InstancePtr->SlcrBaseAddr, SD_DLL_CTRL, DllCtrl); #endif #ifdef XPAR_PSU_SD_0_DEVICE_ID } #endif #endif } /*****************************************************************************/ /** * * @brief * Function to configure the Tap Delays. * * * @param InstancePtr is a pointer to the XSdPs instance. * * @return None * * @note None. * ******************************************************************************/ void XSdPs_ConfigTapDelay(XSdPs *InstancePtr) { u32 DeviceId; u32 TapDelay; u32 ITapDelay; u32 OTapDelay; DeviceId = InstancePtr->Config.DeviceId ; TapDelay = 0U; ITapDelay = InstancePtr->ITapDelay; OTapDelay = InstancePtr->OTapDelay; #ifdef versal (void) DeviceId; if (ITapDelay) { TapDelay = SD_ITAPCHGWIN; XSdPs_WriteReg(InstancePtr->Config.BaseAddress, SD_ITAPDLY, TapDelay); /* Program the ITAPDLY */ TapDelay |= SD_ITAPDLYENA; XSdPs_WriteReg(InstancePtr->Config.BaseAddress, SD_ITAPDLY, TapDelay); TapDelay |= ITapDelay; XSdPs_WriteReg(InstancePtr->Config.BaseAddress, SD_ITAPDLY, TapDelay); TapDelay &= ~SD_ITAPCHGWIN; XSdPs_WriteReg(InstancePtr->Config.BaseAddress, SD_ITAPDLY, TapDelay); } if (OTapDelay) { /* Program the OTAPDLY */ TapDelay = SD_OTAPDLYENA; XSdPs_WriteReg(InstancePtr->Config.BaseAddress, SD_OTAPDLY, TapDelay); TapDelay |= OTapDelay; XSdPs_WriteReg(InstancePtr->Config.BaseAddress, SD_OTAPDLY, TapDelay); } #else #ifdef XPAR_PSU_SD_0_DEVICE_ID if (DeviceId == 0U) { #if EL1_NONSECURE && defined (__aarch64__) (void)TapDelay; if (ITapDelay) { XSdps_Smc(InstancePtr, SD_ITAPDLY, SD0_ITAPCHGWIN, SD0_ITAPCHGWIN); XSdps_Smc(InstancePtr, SD_ITAPDLY, SD0_ITAPDLYENA, SD0_ITAPDLYENA); XSdps_Smc(InstancePtr, SD_ITAPDLY, SD0_ITAPDLY_SEL_MASK, ITapDelay); XSdps_Smc(InstancePtr, SD_ITAPDLY, SD0_ITAPCHGWIN, 0U); } if (OTapDelay) { XSdps_Smc(InstancePtr, SD_OTAPDLY, SD0_OTAPDLY_SEL_MASK, OTapDelay); } #else if (ITapDelay) { TapDelay = XSdPs_ReadReg(InstancePtr->SlcrBaseAddr, SD_ITAPDLY); TapDelay |= SD0_ITAPCHGWIN; XSdPs_WriteReg(InstancePtr->SlcrBaseAddr, SD_ITAPDLY, TapDelay); /* Program the ITAPDLY */ TapDelay |= SD0_ITAPDLYENA; XSdPs_WriteReg(InstancePtr->SlcrBaseAddr, SD_ITAPDLY, TapDelay); TapDelay |= ITapDelay; XSdPs_WriteReg(InstancePtr->SlcrBaseAddr, SD_ITAPDLY, TapDelay); TapDelay &= ~SD0_ITAPCHGWIN; XSdPs_WriteReg(InstancePtr->SlcrBaseAddr, SD_ITAPDLY, TapDelay); } if (OTapDelay) { /* Program the OTAPDLY */ TapDelay = XSdPs_ReadReg(InstancePtr->SlcrBaseAddr, SD_OTAPDLY); TapDelay &= ~SD0_OTAPDLY_SEL_MASK; TapDelay |= OTapDelay; XSdPs_WriteReg(InstancePtr->SlcrBaseAddr, SD_OTAPDLY, TapDelay); } #endif } else { #endif (void) DeviceId; ITapDelay = ITapDelay << 16U; OTapDelay = OTapDelay << 16U; #if EL1_NONSECURE && defined (__aarch64__) (void)TapDelay; if (ITapDelay) { XSdps_Smc(InstancePtr, SD_ITAPDLY, SD1_ITAPCHGWIN, SD1_ITAPCHGWIN); XSdps_Smc(InstancePtr, SD_ITAPDLY, SD1_ITAPDLYENA, SD1_ITAPDLYENA); XSdps_Smc(InstancePtr, SD_ITAPDLY, SD1_ITAPDLY_SEL_MASK, ITapDelay); XSdps_Smc(InstancePtr, SD_ITAPDLY, SD1_ITAPCHGWIN, 0U); } if (OTapDelay) { XSdps_Smc(InstancePtr, SD_OTAPDLY, SD1_OTAPDLY_SEL_MASK, OTapDelay); } #else if (ITapDelay) { TapDelay = XSdPs_ReadReg(InstancePtr->SlcrBaseAddr, SD_ITAPDLY); TapDelay |= SD1_ITAPCHGWIN; XSdPs_WriteReg(InstancePtr->SlcrBaseAddr, SD_ITAPDLY, TapDelay); /* Program the ITAPDLY */ TapDelay |= SD1_ITAPDLYENA; XSdPs_WriteReg(InstancePtr->SlcrBaseAddr, SD_ITAPDLY, TapDelay); TapDelay |= ITapDelay; XSdPs_WriteReg(InstancePtr->SlcrBaseAddr, SD_ITAPDLY, TapDelay); TapDelay &= ~SD1_ITAPCHGWIN; XSdPs_WriteReg(InstancePtr->SlcrBaseAddr, SD_ITAPDLY, TapDelay); } if (OTapDelay) { /* Program the OTAPDLY */ TapDelay = XSdPs_ReadReg(InstancePtr->SlcrBaseAddr, SD_OTAPDLY); TapDelay &= ~SD1_OTAPDLY_SEL_MASK; TapDelay |= OTapDelay; XSdPs_WriteReg(InstancePtr->SlcrBaseAddr, SD_OTAPDLY, TapDelay); } #endif #ifdef XPAR_PSU_SD_0_DEVICE_ID } #endif #endif /* versal */ } /*****************************************************************************/ /** * @brief * This function is used to set voltage to 1.8V. * * @param InstancePtr is a pointer to the instance to be worked on. * * @return * - XST_SUCCESS if successful * - XST_FAILURE if failure * ******************************************************************************/ s32 XSdPs_SetVoltage18(XSdPs *InstancePtr) { s32 Status; u16 CtrlReg; /* Enabling 1.8V in controller */ CtrlReg = XSdPs_ReadReg16(InstancePtr->Config.BaseAddress, XSDPS_HOST_CTRL2_OFFSET); CtrlReg |= XSDPS_HC2_1V8_EN_MASK; XSdPs_WriteReg16(InstancePtr->Config.BaseAddress, XSDPS_HOST_CTRL2_OFFSET, CtrlReg); /* Wait minimum 5mSec */ (void)usleep(5000U); /* Check for 1.8V signal enable bit is cleared by Host */ Status = XSdPs_CheckVoltage18(InstancePtr); if (Status != XST_SUCCESS) { Status = XST_FAILURE; } return Status; } /*****************************************************************************/ /** * @brief * This function is used configure the Power Level. * * @param InstancePtr is a pointer to the instance to be worked on. * * @return None * ******************************************************************************/ void XSdPs_ConfigPower(XSdPs *InstancePtr) { u8 PowerLevel; if ((InstancePtr->Host_Caps & XSDPS_CAP_VOLT_3V3_MASK) != 0U) { PowerLevel = XSDPS_PC_BUS_VSEL_3V3_MASK; } else if ((InstancePtr->Host_Caps & XSDPS_CAP_VOLT_3V0_MASK) != 0U) { PowerLevel = XSDPS_PC_BUS_VSEL_3V0_MASK; } else if ((InstancePtr->Host_Caps & XSDPS_CAP_VOLT_1V8_MASK) != 0U) { PowerLevel = XSDPS_PC_BUS_VSEL_1V8_MASK; } else { PowerLevel = 0U; } /* Select voltage based on capability and enable bus power. */ XSdPs_WriteReg8(InstancePtr->Config.BaseAddress, XSDPS_POWER_CTRL_OFFSET, PowerLevel | XSDPS_PC_BUS_PWR_MASK); } /*****************************************************************************/ /** * @brief * This function is used configure the DMA. * * @param InstancePtr is a pointer to the instance to be worked on. * * @return None * ******************************************************************************/ void XSdPs_ConfigDma(XSdPs *InstancePtr) { if (InstancePtr->HC_Version == XSDPS_HC_SPEC_V3) { /* Enable ADMA2 in 64bit mode. */ XSdPs_WriteReg8(InstancePtr->Config.BaseAddress, XSDPS_HOST_CTRL1_OFFSET, XSDPS_HC_DMA_ADMA2_64_MASK); } else { /* Enable ADMA2 in 32bit mode. */ XSdPs_WriteReg8(InstancePtr->Config.BaseAddress, XSDPS_HOST_CTRL1_OFFSET, XSDPS_HC_DMA_ADMA2_32_MASK); } } /*****************************************************************************/ /** * @brief * This function is used configure the Interrupts. * * @param InstancePtr is a pointer to the instance to be worked on. * * @return None * ******************************************************************************/ void XSdPs_ConfigInterrupt(XSdPs *InstancePtr) { /* Enable all interrupt status except card interrupt initially */ XSdPs_WriteReg16(InstancePtr->Config.BaseAddress, XSDPS_NORM_INTR_STS_EN_OFFSET, XSDPS_NORM_INTR_ALL_MASK & (~XSDPS_INTR_CARD_MASK)); XSdPs_WriteReg16(InstancePtr->Config.BaseAddress, XSDPS_ERR_INTR_STS_EN_OFFSET, XSDPS_ERROR_INTR_ALL_MASK); /* Disable all interrupt signals by default. */ XSdPs_WriteReg16(InstancePtr->Config.BaseAddress, XSDPS_NORM_INTR_SIG_EN_OFFSET, 0x0U); XSdPs_WriteReg16(InstancePtr->Config.BaseAddress, XSDPS_ERR_INTR_SIG_EN_OFFSET, 0x0U); } /*****************************************************************************/ /** * This function does SD command generation. * * @param InstancePtr is a pointer to the instance to be worked on. * @param Cmd is the command to be sent. * @param Arg is the argument to be sent along with the command. * This could be address or any other information * @param BlkCnt - Block count passed by the user. * * @return * - XST_SUCCESS if initialization was successful * - XST_FAILURE if failure - could be because another transfer * is in progress or command or data inhibit is set * ******************************************************************************/ s32 XSdPs_CmdTransfer(XSdPs *InstancePtr, u32 Cmd, u32 Arg, u32 BlkCnt) { u32 Timeout = 10000000U; u32 StatusReg; s32 Status; Status = XSdPs_SetupCmd(InstancePtr, Arg, BlkCnt); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } Status = XSdPs_SendCmd(InstancePtr, Cmd); if (Status != XST_SUCCESS) { Status = XST_FAILURE; goto RETURN_PATH; } /* Polling for response for now */ do { StatusReg = XSdPs_ReadReg16(InstancePtr->Config.BaseAddress, XSDPS_NORM_INTR_STS_OFFSET); if ((Cmd == CMD21) || (Cmd == CMD19)) { if ((XSdPs_ReadReg16(InstancePtr->Config.BaseAddress, XSDPS_NORM_INTR_STS_OFFSET) & XSDPS_INTR_BRR_MASK) != 0U){ XSdPs_WriteReg16(InstancePtr->Config.BaseAddress, XSDPS_NORM_INTR_STS_OFFSET, XSDPS_INTR_BRR_MASK); break; } } if ((StatusReg & XSDPS_INTR_ERR_MASK) != 0U) { Status = (s32)XSdPs_ReadReg16(InstancePtr->Config.BaseAddress, XSDPS_ERR_INTR_STS_OFFSET); if (((u32)Status & ~XSDPS_INTR_ERR_CT_MASK) == 0U) { Status = XSDPS_CT_ERROR; } /* Write to clear error bits */ XSdPs_WriteReg16(InstancePtr->Config.BaseAddress, XSDPS_ERR_INTR_STS_OFFSET, XSDPS_ERROR_INTR_ALL_MASK); goto RETURN_PATH; } Timeout = Timeout - 1U; } while (((StatusReg & XSDPS_INTR_CC_MASK) == 0U) && (Timeout != 0U)); /* Write to clear bit */ XSdPs_WriteReg16(InstancePtr->Config.BaseAddress, XSDPS_NORM_INTR_STS_OFFSET, XSDPS_INTR_CC_MASK); Status = XST_SUCCESS; RETURN_PATH: return Status; } /*****************************************************************************/ /** * This function is used to check if the transfer is completed successfully. * * @param InstancePtr is a pointer to the instance to be worked on. * * @return None * ******************************************************************************/ s32 XSdps_CheckTransferDone(XSdPs *InstancePtr) { u32 Timeout = 5000000U; u16 StatusReg; s32 Status; /* * Check for transfer complete * Polling for response for now */ do { StatusReg = XSdPs_ReadReg16(InstancePtr->Config.BaseAddress, XSDPS_NORM_INTR_STS_OFFSET); if ((StatusReg & XSDPS_INTR_ERR_MASK) != 0U) { /* Write to clear error bits */ XSdPs_WriteReg16(InstancePtr->Config.BaseAddress, XSDPS_ERR_INTR_STS_OFFSET, XSDPS_ERROR_INTR_ALL_MASK); Status = XST_FAILURE; goto RETURN_PATH; } Timeout = Timeout - 1U; usleep(1); } while (((StatusReg & XSDPS_INTR_TC_MASK) == 0U) && (Timeout != 0U)); if (Timeout == 0U) { Status = XST_FAILURE; goto RETURN_PATH ; } /* Write to clear bit */ XSdPs_WriteReg16(InstancePtr->Config.BaseAddress, XSDPS_NORM_INTR_STS_OFFSET, XSDPS_INTR_TC_MASK); Status = XST_SUCCESS; RETURN_PATH: return Status; } /*****************************************************************************/ /** * @brief * This function is used to check if the CMD/DATA bus is idle or not. * * @param InstancePtr is a pointer to the instance to be worked on. * @param Value is to selct Cmd bus or Dat bus * * @return None * ******************************************************************************/ s32 XSdPs_CheckBusIdle(XSdPs *InstancePtr, u32 Value) { u32 Timeout = 10000000U; u32 PresentStateReg; u32 StatusReg; s32 Status; PresentStateReg = XSdPs_ReadReg(InstancePtr->Config.BaseAddress, XSDPS_PRES_STATE_OFFSET); /* Check for Card Present */ if ((PresentStateReg & XSDPS_PSR_CARD_INSRT_MASK) != 0U) { /* Check for SD idle */ do { StatusReg = XSdPs_ReadReg(InstancePtr->Config.BaseAddress, XSDPS_PRES_STATE_OFFSET); Timeout = Timeout - 1; usleep(1); } while (((StatusReg & Value) != 0U) && (Timeout != 0U)); } if (Timeout == 0U) { Status = XST_FAILURE; goto RETURN_PATH ; } Status = XST_SUCCESS; RETURN_PATH: return Status; } /*****************************************************************************/ /** * @brief * This function frames the Command register for a particular command. * Note that this generates only the command register value i.e. * the upper 16 bits of the transfer mode and command register. * This value is already shifted to be upper 16 bits and can be directly * OR'ed with transfer mode register value. * * @param InstancePtr is a pointer to the instance to be worked on. * @param Cmd is the Command to be sent. * * @return Command register value complete with response type and * data, CRC and index related flags. * ******************************************************************************/ u32 XSdPs_FrameCmd(XSdPs *InstancePtr, u32 Cmd) { u32 RetVal; RetVal = Cmd; #if 0 switch(Cmd) { case CMD0: RetVal |= RESP_NONE; break; case CMD1: RetVal |= RESP_R3; break; case CMD2: RetVal |= RESP_R2; break; case CMD3: if (InstancePtr->CardType == XSDPS_CARD_SD) { RetVal |= RESP_R6; } else { RetVal |= RESP_R1; } break; case CMD4: RetVal |= RESP_NONE; break; case CMD5: RetVal |= RESP_R1B; break; case CMD6: if (InstancePtr->CardType == XSDPS_CARD_SD) { RetVal |= RESP_R1 | (u32)XSDPS_DAT_PRESENT_SEL_MASK; } else { RetVal |= RESP_R1B; } break; case ACMD6: RetVal |= RESP_R1; break; case CMD7: RetVal |= RESP_R1; break; case CMD8: if (InstancePtr->CardType == XSDPS_CARD_SD) { RetVal |= RESP_R1; } else { RetVal |= RESP_R1 | (u32)XSDPS_DAT_PRESENT_SEL_MASK; } break; case CMD9: RetVal |= RESP_R2; break; case CMD11: case CMD10: case CMD12: RetVal |= RESP_R1; break; case ACMD13: RetVal |= RESP_R1 | (u32)XSDPS_DAT_PRESENT_SEL_MASK; break; case CMD16: RetVal |= RESP_R1; break; case CMD17: case CMD18: case CMD19: case CMD21: RetVal |= RESP_R1 | (u32)XSDPS_DAT_PRESENT_SEL_MASK; break; case CMD23: case ACMD23: case CMD24: case CMD25: RetVal |= RESP_R1 | (u32)XSDPS_DAT_PRESENT_SEL_MASK; break; case ACMD41: RetVal |= RESP_R3; break; case ACMD42: RetVal |= RESP_R1; break; case ACMD51: RetVal |= RESP_R1 | (u32)XSDPS_DAT_PRESENT_SEL_MASK; break; case CMD52: case CMD55: RetVal |= RESP_R1; break; case CMD58: break; default : RetVal |= Cmd; break; } #else switch(Cmd) { case CMD0: RetVal |= XSDPS_RESP_NONE; break; case CMD1: RetVal |= XSDPS_RESP_R3; break; case CMD2: RetVal |= XSDPS_RESP_R2; break; case CMD3: if (InstancePtr->CardType == XSDPS_CARD_SD) { RetVal |= XSDPS_RESP_R6; } else { RetVal |= XSDPS_RESP_R1; } break; case CMD4: RetVal |= XSDPS_RESP_NONE; break; case CMD5: RetVal |= XSDPS_RESP_R1B; break; case CMD6: if (InstancePtr->CardType == XSDPS_CARD_SD) { RetVal |= XSDPS_RESP_R1 | (u32)XSDPS_DAT_PRESENT_SEL_MASK; } else { RetVal |= XSDPS_RESP_R1B; } break; case ACMD6: RetVal |= XSDPS_RESP_R1; break; case CMD7: RetVal |= XSDPS_RESP_R1; break; case CMD8: if (InstancePtr->CardType == XSDPS_CARD_SD) { RetVal |= XSDPS_RESP_R1; } else { RetVal |= XSDPS_RESP_R1 | (u32)XSDPS_DAT_PRESENT_SEL_MASK; } break; case CMD9: RetVal |= XSDPS_RESP_R2; break; case CMD11: case CMD10: case CMD12: RetVal |= XSDPS_RESP_R1; break; case ACMD13: RetVal |= XSDPS_RESP_R1 | (u32)XSDPS_DAT_PRESENT_SEL_MASK; break; case CMD16: RetVal |= XSDPS_RESP_R1; break; case CMD17: case CMD18: case CMD19: case CMD21: RetVal |= XSDPS_RESP_R1 | (u32)XSDPS_DAT_PRESENT_SEL_MASK; break; case CMD23: case ACMD23: case CMD24: case CMD25: RetVal |= XSDPS_RESP_R1 | (u32)XSDPS_DAT_PRESENT_SEL_MASK; break; case ACMD41: RetVal |= XSDPS_RESP_R3; break; case ACMD42: RetVal |= XSDPS_RESP_R1; break; case ACMD51: RetVal |= XSDPS_RESP_R1 | (u32)XSDPS_DAT_PRESENT_SEL_MASK; break; case CMD52: case CMD55: RetVal |= XSDPS_RESP_R1; break; case CMD58: break; default : RetVal |= Cmd; break; } #endif return RetVal; } /** @} */
{ "content_hash": "33098fe3b193e4594eb2edf497dbadd0", "timestamp": "", "source": "github", "line_count": 1798, "max_line_length": 92, "avg_line_length": 26.512791991101224, "alnum_prop": 0.6091042584434655, "repo_name": "armink/rt-thread", "id": "25b5bc54cc01f0baebb2ef5904057ff8a28e8430", "size": "47923", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "bsp/zynqmp-r5-axu4ev/drivers/Zynq_HAL_Driver/sdps_v3_9/xsdps_host.c", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "15182128" }, { "name": "Batchfile", "bytes": "183497" }, { "name": "C", "bytes": "698243428" }, { "name": "C++", "bytes": "684162" }, { "name": "CMake", "bytes": "139410" }, { "name": "CSS", "bytes": "22422" }, { "name": "GDB", "bytes": "11796" }, { "name": "HTML", "bytes": "1509964" }, { "name": "JavaScript", "bytes": "637" }, { "name": "LLVM", "bytes": "10344" }, { "name": "Lex", "bytes": "7026" }, { "name": "Logos", "bytes": "7238" }, { "name": "M4", "bytes": "17515" }, { "name": "Makefile", "bytes": "444599" }, { "name": "Pawn", "bytes": "1427" }, { "name": "Perl", "bytes": "16728" }, { "name": "Python", "bytes": "2028276" }, { "name": "RPC", "bytes": "14162" }, { "name": "Rich Text Format", "bytes": "177701" }, { "name": "Shell", "bytes": "415474" }, { "name": "Tcl", "bytes": "179" }, { "name": "Yacc", "bytes": "30555" } ], "symlink_target": "" }
'use strict'; function DeviceCtrl($rootScope, $scope, $route, $interval, GreenhouseService, $$getDevice, $$getEnvironment, $$getOutsideDataNow) { var vm = this; vm.device = $$getDevice.data; vm.environment = $$getEnvironment.data; vm.outsideData = $$getOutsideDataNow.data; vm.temperatureData = []; vm.hideDetails = true; $rootScope.breadCrumbs = [{'name': 'devices', 'url': '/device'}, {'name': vm.device.name, 'url': '/device/' + vm.device.coreid}]; $rootScope.deviceDescription = vm.device.description; vm.temperatureWarning = (vm.environment.fahrenheit <= 34 || vm.environment.fahrenheit >= 85); vm.refreshData = refreshData; console.log($route); $scope.chartConfig = { rangeSelector: { selected: 1 }, options: { chart: { type: 'areaspline', threshold: null, zoomType: 'x' } }, series: [{ name: 'Inside Temperature', data: [], lineWidth: 0.1, tooltip: { valueDecimals: 2, xDateFormat: "%m/%e/%y %l:%M %p" }, fillColor: { linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, stops: [ [0, Highcharts.getOptions().colors[0]], [1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')] ] } }, { name: 'Outside Temperature', data: [], lineWidth: 0.1, tooltip: { valueDecimals: 2, xDateFormat: "%m/%e/%y %l:%M %p" }, fillColor: { linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, stops: [ [0, Highcharts.Color(Highcharts.getOptions().colors[1]).setOpacity(.3).get('rgba')], [1, Highcharts.Color(Highcharts.getOptions().colors[1]).setOpacity(0).get('rgba')] ] } }], title: { text: 'History' }, xAxis: {type: 'datetime'}, yAxis: {title: {text: 'Temperature (F°)'}}, loading: false }; function refreshData(id) { GreenhouseService.getEnvironment(id) .then(function (resp) { vm.environment = resp.data; }, function (err) { console.error(err); }); } var intervalPromise = $interval(function () { this.refreshData($route.current.params.id); }.bind(this), 15000); $scope.$on('$destroy', function () { $interval.cancel(intervalPromise); }); function getLocalTimeFromGMT(sTime) { var dte = new Date(Date.parse(sTime)); dte.setTime(dte.getTime() - dte.getTimezoneOffset() * 60 * 1000); return Date.parse(dte); } // Collect our grid data (function () { GreenhouseService.getTempHist($route.current.params.id).then(function (res) { var data = []; for (var rec in res.data) { data.push([getLocalTimeFromGMT(res.data[rec].time), res.data[rec].fahrenheit]); } var oldData = $scope.chartConfig.series[0].data; $scope.chartConfig.series[0].data = data.concat(oldData); }); GreenhouseService.getTempData($route.current.params.id).then(function (res) { var data = []; for (var rec in res.data) { data.push([getLocalTimeFromGMT(res.data[rec].time), res.data[rec].fahrenheit]); } var oldData = $scope.chartConfig.series[0].data; $scope.chartConfig.series[0].data = oldData.concat(data); }); GreenhouseService.getOutsideData($route.current.params.id).then(function (res) { var data = []; for (var rec in res.data) { data.push([getLocalTimeFromGMT(res.data[rec].time), res.data[rec].temp_f]); } $scope.chartConfig.series[1].data = data; }); })(); } DeviceCtrl.resolve = { '$$getDevice': function (GreenhouseService, $route) { return GreenhouseService.getDevice($route.current.params.id); }, '$$getEnvironment': function (GreenhouseService, $route) { return GreenhouseService.getEnvironment($route.current.params.id); }, '$$getOutsideDataNow': function(GreenhouseService, $route) { return GreenhouseService.getOutsideDataNow($route.current.params.id); } }; angular .module('app') .controller('DeviceCtrl', DeviceCtrl);
{ "content_hash": "1c38be0b754039201de85fe7c586ebee", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 133, "avg_line_length": 34.270833333333336, "alnum_prop": 0.5015197568389058, "repo_name": "jkusnier/greenhouse-web", "id": "7fb796b019ea871c218794d9282fb0bf368454c2", "size": "4936", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/controllers/DeviceCtrl.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "425" }, { "name": "JavaScript", "bytes": "14637" } ], "symlink_target": "" }
<!DOCTYPE html> <meta charset=utf8> <script src="../../resources/js-test.js"></script> <p id="description"></p> <div id="console"> Tests that hidden in markup works: <div hidden><span class=fail>FAIL</span> - this line should not appear</div><div hidden=hidden><span class=fail>FAIL</span> - this line should not appear</div><div hidden=false><span class=fail>FAIL</span> - this line should not appear</div><p hidden><span class=fail>FAIL</span> - this line should not appear</p><span hidden><span class=fail>FAIL</span> - this line should not appear</span><img width=400px alt="FAIL - this should not appear" src="resources/xxx-missing.jpeg" hidden> Tests that dynamically adding/removing hidden works: <div hidden id=test1><span class=pass>PASS</span> - this line should appear<div id=test2><span class=fail>FAIL</span> - this line should not appear</div> </div> <script> description('Various tests for the hidden attribute.'); document.getElementById("test1").removeAttribute("hidden"); document.getElementById("test2").setAttribute("hidden", ""); var testParent = document.createElement('div'); document.body.appendChild(testParent); debug('Dynamic changing of hidden and effects on style:'); testParent.innerHTML="<div id=test3 hidden>a</div><div id=test4>b</div>" var test3 = document.getElementById("test3"); var test4 = document.getElementById("test4"); shouldBe('getComputedStyle(test3, false).display', '"none"'); test3.removeAttribute("hidden"); debug('test3.removeAttribute("hidden")'); shouldBe('getComputedStyle(test3, false).display', '"block"'); shouldBe('getComputedStyle(test4, false).display', '"block"'); test4.setAttribute("hidden", ""); debug('test4.setAttribute("hidden", "")'); shouldBe('getComputedStyle(test4, false).display', '"none"'); </script> </body> </html>
{ "content_hash": "dad32f13ca09495035f571767c96b26a", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 484, "avg_line_length": 47.1025641025641, "alnum_prop": 0.718562874251497, "repo_name": "lordmos/blink", "id": "38fdd01cdf5c32b4b950e36d4e12b50fd5bf62e6", "size": "1837", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "LayoutTests/fast/html/hidden-attr.html", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "6433" }, { "name": "C", "bytes": "753714" }, { "name": "C++", "bytes": "40028043" }, { "name": "CSS", "bytes": "539440" }, { "name": "F#", "bytes": "8755" }, { "name": "Java", "bytes": "18650" }, { "name": "JavaScript", "bytes": "25700387" }, { "name": "Objective-C", "bytes": "426711" }, { "name": "PHP", "bytes": "141755" }, { "name": "Perl", "bytes": "901523" }, { "name": "Python", "bytes": "3748305" }, { "name": "Ruby", "bytes": "141818" }, { "name": "Shell", "bytes": "9635" }, { "name": "XSLT", "bytes": "49328" } ], "symlink_target": "" }
class AnnotationDocument < ApplicationRecord include Swagger::Blocks serialize :payload, JSON serialize :meta, JSON belongs_to :project belongs_to :raw_datum belongs_to :interface_type belongs_to :annotable, polymorphic: true before_validation do self.project = raw_datum.project if raw_datum end swagger_schema :AnnotationDocument do key :required, [ :interface_type, :payload, :raw_datum_id, :meta ] property :id do key :description, I18n.t('api.annotation_document.description.id') key :type, :integer end property :rank do key :description, I18n.t('api.annotation_document.description.rank') key :type, :integer end property :raw_datum_id do key :description, I18n.t('api.annotation_document.description.raw_datum_id') key :type, :integer end property :payload do key :description, I18n.t('api.annotation_document.description.payload') key :example, JSON.parse( '{"label":"testlabel","options":["option1","option2"],"content":"testcontent"}' ) key :type, :string end property :meta do key :description, I18n.t('api.annotation_document.description.meta') key :example, JSON.parse( '{"annotator_twitter_handles":["@john"]}' ) key :type, :string end property :skipped do key :description, I18n.t('api.annotation_document.description.skipped') key :type, :boolean end property :interface_type do key :description, I18n.t('api.annotation_document.description.interface_type') key :example, 'text_nominal' key :type, :string end end validates :raw_datum, :interface_type, presence: true validates :payload, presence: true, uniqueness: { scope: :project } validates :rank, allow_nil: true, numericality: { only_integer: true, greater_than_or_equal_to: 0 } validate do |annotation_document| AnnotationDocumentValidator.validate_requested_at(annotation_document) end def relevant_attributes { id: id, interface_type: interface_type.name, meta: meta, payload: payload, rank: rank, raw_datum_id: raw_datum_id, requested_at: requested_at.to_s, skipped: skipped, updated_at: updated_at.to_s } end end
{ "content_hash": "50418b05089ff74dc7a7aaeb713a9522", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 91, "avg_line_length": 24.07920792079208, "alnum_prop": 0.6291118421052632, "repo_name": "Dalphi/dalphi", "id": "52fc424aa34e7299651f25c61a338417ab296e95", "size": "2432", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/models/annotation_document.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "18406" }, { "name": "CoffeeScript", "bytes": "32350" }, { "name": "Dockerfile", "bytes": "185" }, { "name": "HTML", "bytes": "80515" }, { "name": "JavaScript", "bytes": "101" }, { "name": "Ruby", "bytes": "353596" }, { "name": "Shell", "bytes": "2694" } ], "symlink_target": "" }
Absolutezero::Application.config.session_store :cookie_store, key: '_absolutezero_session'
{ "content_hash": "06e779e77a3084701e35486ebc9fb3be", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 90, "avg_line_length": 91, "alnum_prop": 0.8131868131868132, "repo_name": "Chun-Yang/absolutezero", "id": "fd10e452d57a54280ee9e1a24348b83da614b53c", "size": "152", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/initializers/session_store.rb", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "40506" }, { "name": "JavaScript", "bytes": "190021" }, { "name": "Ruby", "bytes": "49926" } ], "symlink_target": "" }
import * as vscode from 'vscode'; import { ElixirSenseClient } from './elixirSenseClient'; import { checkElixirSenseClientInitialized, checkTokenCancellation } from './elixirSenseValidations'; export class ElixirSenseDefinitionProvider implements vscode.DefinitionProvider { elixirSenseClient: ElixirSenseClient; constructor(elixirSenseClient: ElixirSenseClient) { this.elixirSenseClient = elixirSenseClient; } provideDefinition(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Thenable<vscode.Definition> { const wordAtPosition = document.getWordRangeAtPosition(position); const word = document.getText(wordAtPosition); return new Promise<vscode.Definition>((resolve, reject) => { const payload = { buffer : document.getText(), line : position.line + 1, column : position.character + 1 }; return Promise.resolve(this.elixirSenseClient) .then((elixirSenseClient) => checkElixirSenseClientInitialized(elixirSenseClient)) .then((elixirSenseClient) => elixirSenseClient.send('definition', payload)) .then((result) => checkTokenCancellation(token, result)) .then((result) => { const filePath = result.substring(0, result.lastIndexOf(':')); const lineNumberStr = result.substring(result.lastIndexOf(':') + 1, result.length); const lineNumber = Number(lineNumberStr) - 1; if (!filePath || filePath === 'non_existing') { resolve(undefined); return; } let location; if (lineNumber >= 0) { location = new vscode.Location(vscode.Uri.file(filePath), new vscode.Position(lineNumber, 0)); } else { location = new vscode.Location(vscode.Uri.file(filePath), new vscode.Position(0, 0)); } resolve(location); }) .catch((err) => { console.error('rejecting', err); reject(); }); }); } }
{ "content_hash": "9cf3b0b0e0d351caac89ea0a84a6c55e", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 143, "avg_line_length": 41.924528301886795, "alnum_prop": 0.5922592259225923, "repo_name": "mat-mcloughlin/vscode-elixir", "id": "9517c168a3a19276bd232cea374d040ce5afc99c", "size": "2222", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/elixirSenseDefinitionProvider.ts", "mode": "33188", "license": "mit", "language": [ { "name": "Elixir", "bytes": "99666" }, { "name": "Makefile", "bytes": "934" }, { "name": "TypeScript", "bytes": "55707" } ], "symlink_target": "" }
Forms TODO ========== BETA4 MUST HAVES ---------------- * CAPTCHA view helper * Accept an element, pull the "captcha" attribute, and call render() on the captcha * Potentially a "captcha" element, with a dedicated property? * Remove "InputFilterAwareInterface" from forms RFC Items --------- * Builder component * Introspect a class for annotations and build a form * Each "element" can specify: * filters and validators to use to build an input for the input filter * attributes for use with the form element * Should be able to generate a form class WISH LIST --------- ### View helpers * HTML4/XHTML1 element types * formText(ElementInterface $element) * allows "dirname" -- directionality of the text * formButton(ElementInterface $element) * formFile(ElementInterface $element) * allows "accept" (comma-separated MIME types) * formHidden(ElementInterface $element) * formImage(ElementInterface $element) * allows "alt", "height", and "width" * requires "src" * HTML5 allows "formaction", non-empty URL potentially surrounded by spaces * HTML5 allows "formenctype" ("application/x-www-form-urlencoded", "multipart/form-data", or "text/plain") * HTML5 allows "formmethod" ("get" or "post" * HTML5 allows "formtarget" (browsing-context name, or one of "\_blank", "\_self", "\_parent", or "\_top"); * HTML5 allows "formnovalidate" ("formnovalidate" or "") * formPassword(ElementInterface $element) * formReset(ElementInterface $element) * formSubmit(ElementInterface $element) * HTML5 allows "formaction", non-empty URL potentially surrounded by spaces * HTML5 allows "formenctype" ("application/x-www-form-urlencoded", "multipart/form-data", or "text/plain") * HTML5 allows "formmethod" ("get" or "post" * HTML5 allows "formtarget" (browsing-context name, or one of "\_blank", "\_self", "\_parent", or "\_top") * HTML5 allows "formnovalidate" ("formnovalidate" or "") * HTML5 element types * formColor(ElementInterface $element) * allows `#[0-9a-fA-F]{6}` * formDate(ElementInterface $element) * min/max/value must be RFC3339 date (Y-m-d) * allows step (positive integer) * formDatetime(ElementInterface $element) * min/max/value must follow RFC3339, and T and Z (if used) in format MUST be uppercase * allows step (positive float) * formDatetimeLocal(ElementInterface $element) * min/max/value are of form <date>T<time>: 1985-04-12T23:20:40 * allows step (positive float) * formEmail(ElementInterface $element) * value can actually be a single email or comma-separated list of emails if "multiple" is specified * formMonth(ElementInterface $element) * min/max/value must be in format "Y-m" * allows step (positive integer) * formNumber(ElementInterface $element) * should look for min/max (floating point) * allows step (positive float) * formRange(ElementInterface $element) * should look for min/max (floating point) * allows step (positive float) * formSearch(ElementInterface $element) * allows "dirname" -- directionality of the text * formTel(ElementInterface $element) * formTime(ElementInterface $element) * min/max/value must be in RFC3339 partial-time format (`H:i:m[.s]`) * allows step (positive float) * formUrl(ElementInterface $element) * formWeek(ElementInterface $element) * min/max/value must follow format "Y-W\<int\>": 1996-W16 * allows step (positive integer)
{ "content_hash": "400a668403af52d53f830345d289ef22", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 111, "avg_line_length": 41.63953488372093, "alnum_prop": 0.6808154146886345, "repo_name": "OtsList/OtsList.eu-AAC-for-OpenTibia", "id": "d61f07929b33579be12f1e6df7281b4ada77c526", "size": "3581", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/ZF2/library/Zend/Form/TODO.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "PHP", "bytes": "464533" } ], "symlink_target": "" }
ACCEPTED #### According to NUB Generator [implicit canonical] #### Published in null #### Original name null ### Remarks null
{ "content_hash": "acaebd65bfc92e04d3c1b6151a2fbc96", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 34, "avg_line_length": 9.923076923076923, "alnum_prop": 0.6976744186046512, "repo_name": "mdoering/backbone", "id": "b7f0fc2eaf0685710f63dd188d3a673548fba098", "size": "179", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Cactaceae/Coryphantha/Coryphantha rhaphidacantha/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
MModify::MModify(void) { // Bei Beginn ist das Objekt nicht angehalten setLock(false); } MModify::~MModify(void) {} void MModify::display(OpenGL &aOpenGL){ aOpenGL.display(this); } void MModify::update(void){ update3(); } void MModify::update(GLubyte aKey){ update2(); } void MModify::update(GLint aKey){ update2(); } void MModify::setLock(bool lock){ this->lock = lock; } bool MModify::isLock(void){ return lock; } void MModify::update2(void){ setLock(!isLock()); } void MModify::update3(void){ if ( isLock() ) { // Keine Veraenderung } else { // Veraenderung update4(); }; } void MModify::update4(void){ // Es passiert nur was in den abgeleiteten Klassen }
{ "content_hash": "443834782b159be98e1f2010a96d714c", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 52, "avg_line_length": 14.333333333333334, "alnum_prop": 0.6361149110807114, "repo_name": "hemmerling/cpp-3dogs", "id": "3fdfd87ed38ca2996bd15119a0b1c29d7a14aa33", "size": "774", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/modell/objects/MModify.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "1412" }, { "name": "C++", "bytes": "427830" } ], "symlink_target": "" }
[![Gem Version](https://badge.fury.io/rb/refile.svg)](http://badge.fury.io/rb/refile) [![Build Status](https://travis-ci.org/refile/refile.svg?branch=master)](https://travis-ci.org/refile/refile) [![Inline docs](http://inch-ci.org/github/refile/refile.svg?branch=master)](http://inch-ci.org/github/refile/refile) Refile is a modern file upload library for Ruby applications. It is simple, yet powerful. Links: - [API documentation](http://www.rubydoc.info/gems/refile) - [Source Code](https://github.com/refile/refile) - [Contributing](https://github.com/refile/refile/blob/master/CONTRIBUTING.md) - [Code of Conduct](https://github.com/refile/refile/blob/master/CODE_OF_CONDUCT.md) - [Example Application](https://github.com/refile/refile_example_app) Features: - Configurable backends, file system, S3, etc... - Convenient integration with ORMs - On the fly manipulation of images and other files - Streaming IO for fast and memory friendly uploads - Works across form redisplays, i.e. when validations fail, even on S3 - Effortless direct uploads, even to S3 - Support for multiple file uploads - Support for single file upload Sponsored by: [<img src="http://d3cv91luii1z1d.cloudfront.net/logo-gh.png" alt="Elabs" height="50px"/>](http://elabs.se) ## Quick start, Rails Add the gem: ``` ruby gem "refile", require: "refile/rails" gem "refile-mini_magick" ``` We're requiring both Refile's Rails integration and image processing via the [MiniMagick](https://github.com/minimagick/minimagick) gem, which requires [ImageMagick](http://imagemagick.org/) (or [GraphicsMagick](http://www.graphicsmagick.org/)) to be installed. To install it simply run: ``` sh brew install imagemagick # OS X sudo apt-get install imagemagick # Ubuntu ``` Use the `attachment` method to use Refile in a model: ``` ruby class User < ActiveRecord::Base attachment :profile_image end ``` Generate a migration: ``` sh rails generate migration add_profile_image_to_users profile_image_id:string && profile_image_filename:string && profile_image_size:string && profile_image_content_type:string rake db:migrate ``` Add an attachment field to your form: ``` erb <%= form_for @user do |form| %> <%= form.attachment_field :profile_image %> <% end %> ``` Set up strong parameters: ``` ruby def user_params params.require(:user).permit(:profile_image) end ``` And start uploading! Finally show the file in your view: ``` erb <%= image_tag attachment_url(@user, :profile_image, :fill, 300, 300, format: "jpg") %> ``` ## How it works Refile consists of several parts: 1. Backends: cache and persist files 2. Model attachments: map files to model columns 3. A Rack application: streams files and accepts uploads 4. Rails helpers: conveniently generate markup in your views 5. A JavaScript library: facilitates direct uploads Let's look at each of these in more detail! ## 1. Backend Files are uploaded to a backend. The backend assigns an ID to this file, which will be unique for this file within the backend. Let's look at a simple example of using the backend: ``` ruby backend = Refile::Backend::FileSystem.new("tmp") file = backend.upload(StringIO.new("hello")) file.id # => "b205bc..." file.read # => "hello" backend.get(file.id).read # => "hello" ``` As you may notice, backends are "flat". Files do not have directories, nor do they have names or permissions, they are only identified by their ID. Refile has a global registry of backends, accessed through `Refile.backends`. There are two "special" backends, which are only really special in that they are the default backends for attachments. They are `cache` and `store`. By default files will be uploaded to `./tmp/uploads/store`. If you would like to persist them between deploys of your application, you can override the upload folder by adding an initializer like this: ```ruby # config/initializers/refile.rb Refile.backends['store'] = Refile::Backend::FileSystem.new('/etc/projectname-uploads/') ``` The cache is intended to be transient. Files are added here before they are meant to be permanently stored. Usually files are then moved to the store for permanent storage, but this isn't always the case. Suppose for example that a user uploads a file in a form and receives a validation error. In that case the file has been temporarily stored in the cache. The user might decide to fix the error and resubmit, at which point the file will be promoted to the store. On the other hand, the user might simply give up and leave, now the file is left in the cache for later cleanup. Refile has convenient accessors for setting the `cache` and `store`, so for example if you add the refile-s3 gem to your Gemfile: ``` ruby gem "refile-s3" ``` Now you can upload files to S3 easily by using these accessors: ``` ruby # config/initializers/refile.rb require "refile/s3" aws = { access_key_id: "xyz", secret_access_key: "abc", region: "sa-east-1", bucket: "my-bucket", } Refile.cache = Refile::S3.new(prefix: "cache", **aws) Refile.store = Refile::S3.new(prefix: "store", **aws) ``` Try this in the quick start example above and your files are now uploaded to S3. Backends also provide the option of restricting the size of files they accept. For example: ``` ruby Refile.cache = Refile::S3.new(max_size: 10.megabytes, ...) ``` The Refile gem only ships with a [FileSystem](lib/refile/backend/file_system.rb) backend. Additional backends are provided by other gems. - [Amazon S3](https://github.com/refile/refile-s3) - [Fog](https://github.com/refile/refile-fog) provides support for a ton of different cloud storage providers, including Google Storage and Rackspace CloudFiles. - [Postgresql](https://github.com/krists/refile-postgres) - [Gridfs](https://github.com/Titinux/refile-gridfs) - [In Memory](https://github.com/refile/refile-memory) ### Uploadable The `upload` method on backends can be called with a variety of objects. It requires that the object passed to it behaves similarly to Ruby IO objects, in particular it must implement the methods `size`, `read(length = nil, buffer = nil)`, `eof?`, `rewind`, and `close`. All of `File`, `Tempfile`, `ActionDispatch::UploadedFile` and `StringIO` implement this interface, however `String` does not. If you want to upload a file from a `String` you must wrap it in a `StringIO` first. ## 2. Attachments You've already seen the `attachment` method: ``` ruby class User < ActiveRecord::Base attachment :profile_image end ``` Calling `attachment` generates a getter and setter with the given name. When you assign a file to the setter, it is uploaded to the cache: ``` ruby User.new # with a ActionDispatch::UploadedFile user.profile_image = params[:file] # with a regular File object File.open("/some/path", "rb") do |file| user.profile_image = file end # or a StringIO user.profile_image = StringIO.new("hello world") user.profile_image.id # => "fec421..." user.profile_image.read # => "hello world" ``` When you call `save` on the record, the uploaded file is transferred from the cache to the store. Where possible, Refile does this move efficiently. For example if both `cache` and `store` are on the same S3 account, instead of downloading the file and uploading it again, Refile will simply issue a copy command to S3. ### Other ORMs Refile comes with [ActiveRecord integration](lib/refile/attachment/active_record.rb) built-in, but is built to integrate with any ORM, so building your own should not be too difficult. Some integrations are already available via gems: * [refile-sequel](https://github.com/refile/refile-sequel) * [refile-mongoid](https://github.com/krettan/refile-mongoid) ### Pure Ruby classes You can also use attachments in pure Ruby classes like this: ``` ruby class User extend Refile::Attachment attr_accessor :profile_image_id attachment :profile_image end ``` ### Keeping uploaded files By default Refile will delete a stored file when its model is destroyed. You can change this behaviour by passing in the `destroy` option. ```ruby class User < ActiveRecord::Base attachment :profile_image, destroy: false end ``` Now Refile will not delete the `profile_image` file from the store if the user is destroyed. ## 3. Rack Application Refile includes a Rack application (an endpoint, not a middleware), written in Sinatra. This application streams files from backends and can even accept file uploads and upload them to backends. **Important:** Unlike other file upload solutions, Refile always streams your files through your application. It cannot generate URLs to your files. This means that you should **always** put a CDN or other HTTP cache in front of your application. Serving files through your app takes a lot of resources and you want it to happen rarely. Setting this up is actually quite simple, you can use the same CDN you would use for your application's static assets. [This blog post](http://www.happybearsoftware.com/use-cloudfront-and-the-rails-asset-pipeline-to-speed-up-your-app.html) explains how to set this up (bonus: faster static assets!). Once you've set this up, simply configure Refile to use your CDN: ``` ruby Refile.cdn_host = "https://your-dist-url.cloudfront.net" ``` Using [the HTTPS protocol](https://www.eff.org/encrypt-the-web-report) for `Refile.cdn_host` is recommended. There aren't [any performance concerns](https://istlsfastyet.com/), and it is always safe to request HTTPS assets. ### Mounting If you are using Rails and have required [refile/rails.rb](lib/refile/rails.rb), then the Rack application is mounted for you at `/attachments`. You should be able to see this when you run `rake routes`. You can configure Refile to use a different `mount_point` than `/attachments`: ``` ruby Refile.mount_point = "/your-preferred-mount-point" ``` You could also run the application on its own, it doesn't need to be mounted to work. If you are using a catch-all route (such as required by Comfy CMS), you will need to turn off Automounting and add the refile route before your catch all route. (in initializers/refile.rb) ``` ruby Refile.automount = false ``` in routes.rb ``` ruby mount Refile.app, at: Refile.mount_point, as: :refile_app # Make sure this routeset is defined last comfy_route :cms, :path => '/', :sitemap => true ``` ### Retrieving files Files can be retrieved from the application by calling: ``` GET /attachments/:token/:backend_name/:id/:filename ``` The `:filename` serves no other purpose than generating a nice name when the user downloads the file, it does not in any way affect the downloaded file. For caching purposes you should always use the same filename for the same file. The Rails helpers default this to the name of the column. The `:token` is a generated digest of the request path when the `Refile.secret_key` is configured; otherwise, the application will raise an error. The digest feature provides a security measure against unverified requests. **NOTICE:** If you don't set the `Refile.secret_key` we will use rails `secret_key_base` to generate the token. We suggest you not to change the `secret_key_base` after you generated and hardcoded some attachment URLs in your application (e.g. blog post images), because the token will change and you'll not be able to retrieve in this case, the images. ### Processing Refile provides on the fly processing of files. You can trigger it by calling a URL like this: ``` GET /attachments/:token/:backend_name/:processor_name/*args/:id/:filename ``` Suppose we have uploaded a file: ``` ruby Refile.cache.upload(StringIO.new("hello")).id # => "a4e8ce" ``` And we've defined a processor like this: ``` ruby Refile.processor :reverse do |file| StringIO.new(file.read.reverse) end ``` Then you could do the following. ``` sh curl http://127.0.0.1:3000/attachments/token/cache/reverse/a4e8ce/some_file.txt elloh ``` Refile calls `call` on the processor and passes in the retrieved file, as well as all additional arguments sent through the URL. ## 4. Rails helpers Refile provides the `attachment_field` form helper which generates a file field as well as a hidden field. This field keeps track of the file in case it is not yet permanently stored, for example if validations fail. It is also used for direct and presigned uploads. For this reason it is highly recommended to use `attachment_field` instead of `file_field`. ``` erb <%= form_for @user do |form| %> <%= form.attachment_field :profile_image %> <% end %> ``` Will generate something like: ``` html <form action="/users" enctype="multipart/form-data" method="post"> <input name="user[profile_image]" type="hidden"> <input name="user[profile_image]" type="file"> </form> ``` The `attachment_url` helper can then be used for generating URLs for the uploaded files: ``` erb <%= link_to "Image", attachment_url(@user, :profile_image) %> ``` Any additional arguments to it are included in the URL as processor arguments: ``` erb <%= link_to "Image", attachment_url(@user, :profile_image, :fill, 300, 300) %> ``` There's also a helper for generating image tags: ``` erb <%= attachment_image_tag(@user, :profile_image, :fill, 300, 300) %> ``` You can also provide a limit to the image: ``` erb <%= link_to "Image", attachment_url(@user, :profile_image, :limit, 400, 500) %> ``` If you don't care about the aspect ratio and want an exact dimension, you can use `!`: ``` erb <%= link_to "Image", attachment_url(@user, :profile_image, :limit, 400, "1000!") %> ``` Keep in mind that it's also important to remember you can not stretch the image, even you set a larger width or height the image will keep its default dimensions. For example: if you set `400x1000!` for an image `600x800` it'll keep its height of `400x800`. If you just care about limit only one dimension, you can use `nil` in widht or height: ``` erb <%= link_to "Image", attachment_url(@user, :profile_image, :limit, 400, nil) %> <%= link_to "Image", attachment_url(@user, :profile_image, :limit, nil, 400) %> ``` With this helper you can specify an image/asset which is used as a fallback in case no file has been uploaded: ``` erb <%= attachment_url(@user, :profile_image, :fill, 300, 300, fallback: "default.png") %> <%= attachment_image_tag(@user, :profile_image, :fill, 300, 300, fallback: "default.png") %> ``` You can also set the URL to force the download of the uploaded file: ``` erb <%= link_to "Download", attachment_url(@user, :profile_image, force_download: true) %> ``` Use `Refile.attachment_url` if you already have `attachment` in your routes. ## 5. JavaScript library Refile's JavaScript library is small but powerful. Uploading files is slow, so anything we can do to speed up the process is going to lead to happier users. One way to cheat is to start uploading files directly after the user has chosen a file, instead of waiting until they hit the submit button. This provides a significantly better user experience. Implementing this is usually tricky, but thankfully Refile makes it very easy. First, load the JavaScript file. If you're using the asset pipeline, you can simply include it like this: ``` javascript //= require refile ``` Otherwise you can grab a copy [here](https://raw.githubusercontent.com/refile/refile/master/app/assets/javascripts/refile.js). Be sure to always update your copy of this file when you upgrade to the latest Refile version. Now mark the field for direct upload: ``` erb <%= form.attachment_field :profile_image, direct: true %> ``` There is no step 3 ;) The file is now uploaded to the `cache` immediately after the user chooses a file. If you try this in the browser, you'll notice that an AJAX request is fired as soon as you choose a file. Then when you submit to the server, the file is no longer submitted, only its id. If you want to improve the experience of this, the JavaScript library fires a couple of custom DOM events. These events bubble, so you can also listen for them on the form for example: ``` javascript form.addEventListener("upload:start", function() { // ... }); form.addEventListener("upload:success", function() { // ... }); input.addEventListener("upload:progress", function() { // ... }); ``` You can also listen for them with jQuery, even with event delegation: ``` javascript $(document).on("upload:start", "form", function(e) { // ... }); ``` This way you could for example disable the submit button until all files have uploaded: ``` javascript $(document).on("upload:start", "form", function(e) { $(this).find("input[type=submit]").attr("disabled", true) }); $(document).on("upload:complete", "form", function(e) { if(!$(this).find("input.uploading").length) { $(this).find("input[type=submit]").removeAttr("disabled") } }); ``` ### Presigned uploads Amazon S3 supports uploads directly from the browser to S3 buckets. With this feature you can bypass your application entirely; uploads never hit your application at all. Unfortunately the default configuration of S3 buckets does not allow cross site AJAX requests from posting to buckets. Fixing this is easy though. - Open the AWS S3 console and locate your bucket - Right click on it and choose "Properties" - Open the "Permission" section - Click "Add CORS Configuration" The default configuration only allows "GET", you'll want to allow "POST" as well. You'll also want to permit the "Content-Type" and "Origin" headers. It could look something like this: ``` xml <CORSConfiguration> <CORSRule> <AllowedOrigin>*</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <AllowedMethod>POST</AllowedMethod> <MaxAgeSeconds>3000</MaxAgeSeconds> <AllowedHeader>Authorization</AllowedHeader> <AllowedHeader>Content-Type</AllowedHeader> <AllowedHeader>Origin</AllowedHeader> </CORSRule> </CORSConfiguration> ``` If you're paranoid you can restrict the allowed origin to only your domain, but since your bucket is only writable with authentication anyway, this shouldn't be necessary. Note that you do not need to, and in fact you shouldn't, make your bucket world writable. Once you've put in the new configuration, click "Save". After that it may take some time for the CORS setup to kick in (because of DNS propagation). Now you can enable presigned uploads: ``` erb <%= form.attachment_field :profile_image, presigned: true %> ``` You can also enable both direct and presigned uploads, and it'll fall back to direct uploads if presigned uploads aren't available. This is useful if you're using the FileSystem backend in development or test mode and the S3 backend in production mode. ``` erb <%= form.attachment_field :profile_image, direct: true, presigned: true %> ``` ### Browser compatibility Refile's JavaScript library requires HTML5 features which are unavailable on IE9 and earlier versions. All other major browsers are supported. ## Authentication URLs generated by Refile are cryptographically signed. This ensures that a file cannot be downloaded unless you hand someone the URL to that file. This is essentially equivalent to token base authentication. Unfortunately a similar system is not in place for file uploads, meaning that direct file uploads are open to anyone. By default only the `cache` backend can be uploaded to, and you are encouraged to purge unused files from this backend periodically. This might seem insecure, but consider the fact that anyone who can access file uploads in your application will be able to upload files into it anyway. Nevertheless, you can disable direct file uploads by setting: ``` Refile.allow_uploads_to = [] ``` You also have the option of explicitly authenticating anyone who tries to access the Refile application. Since the Refile application is a Sinatra application, you can use Sinatra's before hooks to set up authentication like this: ``` Refile::App.before do halt 403 unless User.find_by(id: session[:user_id]) end ``` ## Additional metadata In the quick start example above, we chose to only store the file id, but often it is useful to store the file's filename, size and content type as well. Refile makes it easy to extract this data and store it alongside the id. All you need to do is add columns for these: ``` ruby class StoreMetadata < ActiveRecord::Migration def change add_column :users, :profile_image_filename, :string add_column :users, :profile_image_size, :integer add_column :users, :profile_image_content_type, :string end end ``` These columns will now be filled automatically. ## File type validations Refile can check that attached files have a given content type or extension. This allows you to warn users if they try to upload an invalid file. **Important:** You should regard this as a convenience feature for your users, not a security feature. Both file extension and content type can easily be spoofed. In order to limit attachments to an extension or content type, you can provide them like this: ``` ruby attachment :cv, extension: "pdf" attachment :profile_image, content_type: "image/jpeg" ``` You can also provide a list of content types or extensions: ``` ruby attachment :cv, extension: ["pdf", "doc"] attachment :profile_image, content_type: ["image/jpeg", "image/png", "image/gif"] ``` Since the combination of JPEG, PNG and GIF is so common, you can also specify this more succinctly like this: ``` ruby attachment :profile_image, type: :image ``` When a user uploads a file with an invalid extension or content type and submits the form, they'll be presented with a validation error. If you use a particular content type or set of content types frequently you can define your own types like this: ``` ruby Refile.types[:document] = Refile::Type.new(:document, content_type: %w[text/plain application/pdf] ) ``` Now you can use them like this: ``` ruby attachment :profile_image, type: :document ``` ## Multiple file uploads File input fields support the `multiple` attribute which allows users to attach multiple files at once. Refile supports this attribute. You can add the attribute to your attachment fields like this: ``` erb <%= form.attachment_field :images_files, multiple: true %> ``` Multiple file uploads also work nicely with direct and presigned uploads: ``` erb <%= form.attachment_field :images_files, multiple: true, direct: true, presigned: true %> ``` Note that you will get separate events for each uploaded file. So when you attach two files, the `upload:start` event and other events will be triggered twice, once for each file. When you upload multiple files, your application will receive an array of files, instead of a single file. To map these files to model object, Refile's ActiveRecord integration ships with a nice macro that makes this trivial. Suppose you have an image model like this: ``` ruby class Image < ActiveRecord::Base belongs_to :post attachment :file end ``` Note it must be possible to persist images given only the associated post and a file. There must not be any other validations or constraints which prevent images from being saved. From the post model, you can use the `accepts_attachments_for` macro: ``` ruby class Post < ActiveRecord::Base has_many :images, dependent: :destroy, autosave: true accepts_attachments_for :images, attachment: :file end ``` The `attachment` option defaults to `:file`, so we could have left it out in this case. ``` ruby class Post < ActiveRecord::Base has_many :images, dependent: :destroy, autosave: true accepts_attachments_for :images end ``` Note: Leaving out the `autosave` option will only save the attachments when the post is created. You can add the attachment field to your post form: ``` erb <%= form_for @post do |form| %> <%= form.label :images_files %> <%= form.attachment_field :images_files, multiple: true %> <% end %> ``` Now you only need to permit the generated accessor in your controller. Since `images_files` is an array, you need to tell Rails to allow array values for it: ``` ruby def post_params params.require(:post).permit(images_files: []) end ``` When editing a record with `accepts_attachments_for`, the default behaviour is to replace the entire list of attachments when new attachments are uploaded. It is also possible to append the new attachments to the list of attachments instead so that older attachments are kept. To enable this, set the `append` option to `true`. ``` ruby class Post < ActiveRecord::Base has_many :images, dependent: :destroy accepts_attachments_for :images, append: true end ``` ### Multiple file uploads for pure Ruby classes You can also use `accepts_attachments_for` macro in pure Ruby classes. Suppose you have a `Document` class to be associated with a `Post` class. A post has many documents, and each document has a file. First, you will need to use the `attachment` macro in the `Document` class to declare your `:file` attachment, and also implement a constructor to receive the attachment: ```ruby class Document extend Refile::Attachment attr_accessor :file_id attachment :file def initialize(attributes = {}) self.file = attributes[:file] end end ``` In the `Post` class, you will need a constructor to initialize the `@documents` variable and an `attr_accessor :documents`. Then you can use the `accepts_attachments_for` macro for declaring the `:documents` collection: ```ruby class Post extend Refile::Attachment include ActiveModel::Model attr_accessor :documents accepts_attachments_for( :documents, accessor_prefix: 'documents_files', collection_class: Document ) def initialize(attributes = {}) @documents = attributes[:documents] || [] end end ``` In this example, we specified the following options: - `collection_class` is the attachments class, `Document` - `accessor_prefix` gives a prefix to the generated accessors, `documents_files`. Now you can append attachments with your HTML form in the following way: ```erb <%= form_for @post do |form| %> <%= form.label :documents_files %> <%= form.attachment_field :documents_files, multiple: true %> <% end %> ``` The default values for the `accepts_attachments_for` macro are `{ attachment: :file, append: false }`. Everything else should be similar to the Active Record version of this macro. ## Single file upload File input fields support single file upload, allows users to attach one file at the time instead of the common multiple files feature. Let's suppose you have an image model like this: ``` ruby class Image < ActiveRecord::Base belongs_to :post attachment :file end ``` Note it must be possible to persist images given only the associated post and a file. There must not be any other validations or constraints which prevent images from being saved. From the post model, you can use the `accepts_attachments_for` macro: ``` ruby class Post < ActiveRecord::Base has_many :images, dependent: :destroy accepts_attachments_for :images, attachment: :file end ``` The `attachment` option defaults to `:file`, so we could have left it out in this case. ``` ruby class Post < ActiveRecord::Base has_many :images, dependent: :destroy accepts_attachments_for :images end ``` You can add the attachment field to your post form without using the `multiple` attribute: ``` erb <%= form_for @post do |form| %> <%= form.label :images_files %> <%= form.attachment_field :images_files %> <% end %> ``` Now you only need to permit the generated accessor in your controller. Since `images_files` is not an array, you need to tell Rails to only allow the attribute symbol: ``` ruby def post_params params.require(:post).permit(:images_files) end ``` ## Removing attached files File input fields unfortunately do not have the option of removing an already uploaded file. This is problematic when editing a model which has a file attached and the user wants to remove this file. To work around this, Refile automatically adds an attribute to your model when you use the `attachment` method, which is designed to be used with a checkbox in a form. ``` erb <%= form_for @user do |form| %> <%= form.label :profile_image %> <%= form.attachment_field :profile_image %> <%= form.check_box :remove_profile_image %> <%= form.label :remove_profile_image %> <% end %> ``` Don't forget to permit this attribute in your controller: ``` ruby def user_params params.require(:user).permit(:profile_image, :remove_profile_image) end ``` Now when you check this checkbox and submit the form, the previously attached file will be removed. ## Fetching remote files by URL You might want to give you users the option of uploading a file by its URL. This could be either just via a textfield or through some other interface. Refile makes it easy to fetch this file and upload it. Just add a field like this: ``` erb <%= form_for @user do |form| %> <%= form.label :profile_image, "Attach image" %> <%= form.attachment_field :profile_image %> <%= form.label :remote_profile_image_url, "Or specify URL" %> <%= form.text_field :remote_profile_image_url %> <% end %> ``` Then permit this field in your controller: ``` ruby def user_params params.require(:user).permit(:profile_image, :remote_profile_image_url) end ``` Refile will now fetch the file from the given URL, following redirects if needed. ## Cache expiry Files will accumulate in your cache, and you'll probably want to remove them after some time. The FileSystem backend does not currently provide any method of doing this. PRs welcome ;) On S3 this can be conveniently handled through lifecycle rules. Exactly how depends a bit on your setup. If you are using the suggested setup of having one bucket with `cache` and `store` being directories in that bucket (or prefixes in S3 parlance), then follow the following steps, otherwise adapt them to your needs: - Open the AWS S3 console and locate your bucket - Right click on it and choose "Properties" - Open the "Lifecycle" section - Click "Add rule" - Choose "Apply the rule to: A prefix" - Enter "cache/" as the prefix (trailing slash!) - Click "Configure rule" - For "Action on Objects" you'll probably want to choose "Permanently Delete Only" - Choose whatever number of days you're comfortable with, I chose "1" - Click "Review" and finally "Create and activate Rule" ## Testing When testing your own classes that use Refile, you can use `Refile::FileDouble` objects instead of real files. ```ruby # app/models/post.rb class Post < ActiveRecord::Base attachment :image, type: :image end # spec/models/post_spec.rb require "rails_helper" require "refile/file_double" RSpec.describe Post, type: :model do it "allows attaching an image" do post = Post.new post.image = Refile::FileDouble.new("dummy", "logo.png", content_type: "image/png") post.save expect(post.image_id).not_to be_nil end it "doesn't allow attaching other files" do post = Post.new post.image = Refile::FileDouble.new("dummy", "file.txt", content_type: "text/plain") post.save expect(post.image_id).to be_nil end end ``` ## simple_form simple_form gem is also supported: ```Ruby # in initializer or Gemfile require 'refile/simple_form' # in forms <%= f.input :cover_image, as: :attachment, direct: true, presigned: true %> ``` ## License [MIT](LICENSE.txt)
{ "content_hash": "320658fb047d2760918647f8ba19a022", "timestamp": "", "source": "github", "line_count": 1038, "max_line_length": 223, "avg_line_length": 30.23699421965318, "alnum_prop": 0.7391512139170331, "repo_name": "refile/refile", "id": "f6d7f70e1589d60ac548bdd400bf213f77423782", "size": "31396", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "3781" }, { "name": "JavaScript", "bytes": "5937" }, { "name": "Ruby", "bytes": "173510" } ], "symlink_target": "" }
<?xml version="1.0" encoding="ISO-8859-1" ?> <configuration> <testPath>/a/b/c</testPath> <testValue>Hello</testValue> <baseValue>Hello</baseValue> </configuration>
{ "content_hash": "2e341826817d2218c90a60420d61d2d3", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 44, "avg_line_length": 24.285714285714285, "alnum_prop": 0.7, "repo_name": "richkadel/flip.tv", "id": "dafea0f451e43ad96d9718729d5e8efdaddcc044", "size": "170", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "configuration/src/main/test/config/base/system.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ActionScript", "bytes": "16304" }, { "name": "C", "bytes": "120606" }, { "name": "C++", "bytes": "52224" }, { "name": "Java", "bytes": "1484591" }, { "name": "JavaScript", "bytes": "4614326" }, { "name": "Objective-C", "bytes": "1273" }, { "name": "Perl", "bytes": "169" }, { "name": "Shell", "bytes": "26465" } ], "symlink_target": "" }
{% extends "base.html" %} {% load i18n %} {% block main_class %}d-flex ovhd{% endblock %} {% block main_content %} <div class="row flex-1 d-flex w100 ovhd"> {# 'ovhd' is for Firefox #} <div id="side-nav" class="side-nav side-tabnav col-md-3" > <a href="#" title="{% trans "Close" %}" aria-label="{% trans "Close" %}" class="sf2-icon-x1 sf-popover-close op-icon hidden-md-up js-close-side-nav fright"></a> {% block left_panel %} <h3 class="hd">{% trans "Files" %}</h3> <ul class="side-tabnav-tabs"> {% if user.permissions.can_add_repo %} <li class="tab"><a href="{{ SITE_ROOT }}my-libs/" class="ellipsis" title="{% trans "My Libraries" %}"><span class="sf2-icon-user" aria-hidden="true"></span>{% trans "My Libraries" %}</a></li> {% endif %} <li class="tab"><a href="{{ SITE_ROOT }}shared-libs/" class="ellipsis" title="{% trans "Shared with me" %}"><span class="sf2-icon-share" aria-hidden="true"></span>{% trans "Shared with me" %}</a></li> {% if user.permissions.can_view_org %} <li class="tab"><a href="{{ SITE_ROOT }}#org/" class="ellipsis" title="{% trans "Shared with all" %}"><span class="sf2-icon-organization" aria-hidden="true"></span>{% trans "Shared with all" %}</a></li> {% endif %} <li class="tab" id="group-nav"> <a href="#" class="ellipsis" title="{% trans "Shared with groups" %}"><span class="toggle-icon icon-caret-left fright" aria-hidden="true"></span><span class="sf2-icon-group" aria-hidden="true"></span>{% trans "Shared with groups" %}</a> <ul class="grp-list hide"> <li> <a href="{{ SITE_ROOT }}groups/"><span class="sharp" aria-hidden="true">#</span>{% trans "All Groups" %}</a> </li> {% for grp in grps %} <li> <a class="ellipsis" href="{{SITE_ROOT}}group/{{ grp.id }}/" title="{{ grp.group_name }}"><span class="sharp" aria-hidden="true">#</span>{{ grp.group_name }}</a> </li> {% endfor %} </ul> </li> </ul> <div class="hd w100 ovhd"> <h3 class="fleft">{% trans "Tools" %}</h3> </div> <ul class="side-tabnav-tabs"> <li class="tab"><a href="{{ SITE_ROOT }}starred/"><span class="sf2-icon-star" aria-hidden="true"></span>{% trans "Favorites" %}</a></li> {% if events_enabled %} <li class="tab"><a href="{{ SITE_ROOT }}dashboard/"><span class="sf2-icon-clock" aria-hidden="true"></span>{% trans "Activities" %}</a></li> {% endif %} {% for mod in request.user.mods_enabled %} {% if mod == 'personal wiki' %} <li class="tab {% block cur_personal_wiki %}{% endblock %}"><a href="{% url 'wiki:list' %}"><span class="sf2-icon-wiki" aria-hidden="true"></span>{% trans "Wikis" %}</a></li> {% endif %} {% endfor %} <li class="tab"><a href="{{ SITE_ROOT }}#devices/" class="ellipsis" title="{% trans "Linked Devices" %}"><span class="sf2-icon-monitor" aria-hidden="true"></span>{% trans "Linked Devices" %}</a></li> {% if enable_guest_invitation and user.permissions.can_invite_guest %} <li class="tab"> <a href="{{ SITE_ROOT }}#invitations/"><span aria-hidden="true" class="sf2-icon-invite"></span>{% trans "Invite People" %}</a> </li> {% endif %} <li class="tab"><a href="{{ SITE_ROOT }}drafts/"><span class="sf2-icon-edit2" aria-hidden="true"></span>{% trans "Drafts" %}</a></li> <li class="tab" id="share-admin-nav"> <a href="#" class="ellipsis" title="{% trans "Share Admin" %}"><span class="toggle-icon icon-caret-left fright" aria-hidden="true"></span><span aria-hidden="true" class="sf2-icon-wrench"></span>{% trans "Share Admin" %}</a> <ul class="hide"> {% if user.permissions.can_add_repo %} <li> <a href="{{ SITE_ROOT }}share-admin-libs/"><span aria-hidden="true" class="sharp">#</span>{% trans "Libraries" %}</a> </li> <li> <a href="{{ SITE_ROOT }}share-admin-folders/"><span aria-hidden="true" class="sharp">#</span>{% trans "Folders" %}</a> </li> {% endif %} {% if user.permissions.can_generate_share_link %} <li> <a href="{{ SITE_ROOT }}share-admin-share-links/"><span aria-hidden="true" class="sharp">#</span>{% trans "Links" %}</a> </li> {% elif user.permissions.can_generate_upload_link %} <li> <a href="{{ SITE_ROOT }}share-admin-upload-links/"><span aria-hidden="true" class="sharp">#</span>{% trans "Links" %}</a> </li> {% endif %} </ul> </li> </ul> {% endblock %} </div> <div id="right-panel" class="col-md-9 ov-auto flex-1"> {% block right_panel %}{% endblock %} </div> {% if user.permissions.can_add_repo %} <form id="mods-enable-form" method="post" action="{% url 'toggle_modules' %}" class="hide">{% csrf_token%} <h3>{% trans "Enable Modules"%}</h3> <ul> {% for mod in request.user.mods_available %} {% if mod == 'personal wiki' %} <li> <label class="checkbox-label"> <input type="checkbox" name="personal_wiki" class="vam" {%if mod in request.user.mods_enabled%}checked="checked"{% endif%} /> <span class="checkbox-option vam">{% trans "Personal Wiki" %}</span> </label> </li> {% endif %} {% endfor %} </ul> <input type="submit" id="mods-enable-submit" value="{% trans "Submit"%}" class="submit" /> </form> {% endif %} </div> {% endblock %} {% block extra_script %} <script type="text/javascript"> $('#group-nav a:first').on('click', function() { $('#group-nav .toggle-icon').toggleClass('icon-caret-left icon-caret-down'); $('#group-nav .grp-list').slideToggle(); return false; }); $('#share-admin-nav').on('click', 'a:first', function() { var $shareAdmin = $('#share-admin-nav'); $('.toggle-icon', $shareAdmin).toggleClass('icon-caret-left icon-caret-down'); $('ul', $shareAdmin).slideToggle(250); return false; }); </script> {% endblock %}
{ "content_hash": "85e2915cc2e0fa8502490bb4c84dd717", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 252, "avg_line_length": 53.556451612903224, "alnum_prop": 0.5112181900316217, "repo_name": "miurahr/seahub", "id": "267b8a9d400999e8afbae25d276546d1d0bc6e5a", "size": "6641", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "seahub/templates/home_base.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "231001" }, { "name": "HTML", "bytes": "750509" }, { "name": "JavaScript", "bytes": "2430915" }, { "name": "Python", "bytes": "1500021" }, { "name": "Shell", "bytes": "8856" } ], "symlink_target": "" }
from __future__ import unicode_literals from django.db import models, migrations # This migration and the following one have been edited to be no-ops; # previously, they set up django-markupfield's MarkupField for several # fields on the blog models, then returned those fields to their # original TextField definitions once I decided not to use # MarkupField. Preserving these migrations as they originally were # would require maintaining a dependency on django-markupfield (to # make MarkupField importable for these migrations) despite it no # longer being used. class Migration(migrations.Migration): dependencies = [ ('blog', '0001_initial'), ] operations = [ migrations.RunPython( migrations.RunPython.noop, migrations.RunPython.noop ) ]
{ "content_hash": "79cc08b563fac25dba184daf61851519", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 70, "avg_line_length": 33.875, "alnum_prop": 0.7269372693726938, "repo_name": "ubernostrum/blog", "id": "c1b2045a483f8e83e618c78f0cfb1065eb3aef0e", "size": "837", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "blog/migrations/0002_markupfield.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "18846" } ], "symlink_target": "" }
namespace Facebook.CSSLayout { /** * Class representing CSS spacing (padding, margin, and borders). This is mostly necessary to * properly implement interactions and updates for properties like margin, marginLeft, and * marginHorizontal. */ sealed class Spacing { /** * Spacing type that represents the left direction. E.g. {@code marginLeft}. */ internal const int LEFT = (int)CSSSpacingType.Left; /** * Spacing type that represents the top direction. E.g. {@code marginTop}. */ internal const int TOP = (int)CSSSpacingType.Top; /** * Spacing type that represents the right direction. E.g. {@code marginRight}. */ internal const int RIGHT = (int)CSSSpacingType.Right; /** * Spacing type that represents the bottom direction. E.g. {@code marginBottom}. */ internal const int BOTTOM = (int)CSSSpacingType.Bottom; /** * Spacing type that represents vertical direction (top and bottom). E.g. {@code marginVertical}. */ internal const int VERTICAL = (int)CSSSpacingType.Vertical; /** * Spacing type that represents horizontal direction (left and right). E.g. * {@code marginHorizontal}. */ internal const int HORIZONTAL = (int)CSSSpacingType.Horizontal; /** * Spacing type that represents start direction e.g. left in left-to-right, right in right-to-left. */ internal const int START = (int)CSSSpacingType.Start; /** * Spacing type that represents end direction e.g. right in left-to-right, left in right-to-left. */ internal const int END = (int)CSSSpacingType.End; /** * Spacing type that represents all directions (left, top, right, bottom). E.g. {@code margin}. */ internal const int ALL = (int)CSSSpacingType.All; static readonly int[] sFlagsMap = { 1, /*LEFT*/ 2, /*TOP*/ 4, /*RIGHT*/ 8, /*BOTTOM*/ 16, /*VERTICAL*/ 32, /*HORIZONTAL*/ 64, /*START*/ 128, /*END*/ 256 /*ALL*/ }; float[] mSpacing = newFullSpacingArray(); [Nullable] float[] mDefaultSpacing = null; int mValueFlags = 0; bool mHasAliasesSet; /** * Set a spacing value. * * @param spacingType one of {@link #LEFT}, {@link #TOP}, {@link #RIGHT}, {@link #BOTTOM}, * {@link #VERTICAL}, {@link #HORIZONTAL}, {@link #ALL} * @param value the value for this direction * @return {@code true} if the spacing has changed, or {@code false} if the same value was already * set */ internal bool set(int spacingType, float value) { if (!FloatUtil.floatsEqual(mSpacing[spacingType], value)) { mSpacing[spacingType] = value; if (CSSConstants.IsUndefined(value)) { mValueFlags &= ~sFlagsMap[spacingType]; } else { mValueFlags |= sFlagsMap[spacingType]; } mHasAliasesSet = (mValueFlags & sFlagsMap[ALL]) != 0 || (mValueFlags & sFlagsMap[VERTICAL]) != 0 || (mValueFlags & sFlagsMap[HORIZONTAL]) != 0; return true; } return false; } /** * Set a default spacing value. This is used as a fallback when no spacing has been set for a * particular direction. * * @param spacingType one of {@link #LEFT}, {@link #TOP}, {@link #RIGHT}, {@link #BOTTOM} * @param value the default value for this direction * @return */ internal bool setDefault(int spacingType, float value) { if (mDefaultSpacing == null) mDefaultSpacing = newSpacingResultArray(); if (!FloatUtil.floatsEqual(mDefaultSpacing[spacingType], value)) { mDefaultSpacing[spacingType] = value; return true; } return false; } /** * Get the spacing for a direction. This takes into account any default values that have been set. * * @param spacingType one of {@link #LEFT}, {@link #TOP}, {@link #RIGHT}, {@link #BOTTOM} */ internal float get(int spacingType) { float defaultValue = (mDefaultSpacing != null) ? mDefaultSpacing[spacingType] : (spacingType == START || spacingType == END ? CSSConstants.Undefined : 0); if (mValueFlags == 0) { return defaultValue; } if ((mValueFlags & sFlagsMap[spacingType]) != 0) { return mSpacing[spacingType]; } if (mHasAliasesSet) { int secondType = spacingType == TOP || spacingType == BOTTOM ? VERTICAL : HORIZONTAL; if ((mValueFlags & sFlagsMap[secondType]) != 0) { return mSpacing[secondType]; } else if ((mValueFlags & sFlagsMap[ALL]) != 0) { return mSpacing[ALL]; } } return defaultValue; } /** * Get the raw value (that was set using {@link #set(int, float)}), without taking into account * any default values. * * @param spacingType one of {@link #LEFT}, {@link #TOP}, {@link #RIGHT}, {@link #BOTTOM}, * {@link #VERTICAL}, {@link #HORIZONTAL}, {@link #ALL} */ internal float getRaw(int spacingType) { return mSpacing[spacingType]; } /** * Try to get start value and fallback to given type if not defined. This is used privately * by the layout engine as a more efficient way to fetch direction-aware values by * avoid extra method invocations. */ internal float getWithFallback(int spacingType, int fallbackType) { return (mValueFlags & sFlagsMap[spacingType]) != 0 ? mSpacing[spacingType] : get(fallbackType); } static float[] newFullSpacingArray() { return new[] { CSSConstants.Undefined, CSSConstants.Undefined, CSSConstants.Undefined, CSSConstants.Undefined, CSSConstants.Undefined, CSSConstants.Undefined, CSSConstants.Undefined, CSSConstants.Undefined, CSSConstants.Undefined }; } static float[] newSpacingResultArray() { return newSpacingResultArray(0); } static float[] newSpacingResultArray(float defaultValue) { return new[] { defaultValue, defaultValue, defaultValue, defaultValue, defaultValue, defaultValue, CSSConstants.Undefined, CSSConstants.Undefined, defaultValue }; } } }
{ "content_hash": "52a5946d684a7da11103425620dde76e", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 107, "avg_line_length": 33.392070484581495, "alnum_prop": 0.512401055408971, "repo_name": "gethinw/css-layout", "id": "8c718e2573448f56d9900a52e7bb4682d35afa78", "size": "7880", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/csharp/Facebook.CSSLayout/Spacing.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "501436" }, { "name": "C#", "bytes": "469387" }, { "name": "Java", "bytes": "454971" }, { "name": "JavaScript", "bytes": "308946" }, { "name": "Makefile", "bytes": "796" } ], "symlink_target": "" }
<?php namespace Ublaboo\DataGrid\GroupAction; use Nette; /** * @method void onSelect() */ class GroupMultiSelectAction extends GroupSelectAction { /** * @var string */ protected $class = 'form-control input-sm selectpicker'; }
{ "content_hash": "04c0f88cc84f41f4c6832f775a01822b", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 57, "avg_line_length": 12.1, "alnum_prop": 0.6942148760330579, "repo_name": "chapcz/datagrid", "id": "47a448706c7cbc500491830850ec202ab18ac1aa", "size": "389", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/GroupAction/GroupMultiSelectAction.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "12865" }, { "name": "CoffeeScript", "bytes": "19141" }, { "name": "HTML", "bytes": "32145" }, { "name": "PHP", "bytes": "277127" } ], "symlink_target": "" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("TradeHub.OrderExecutionEngine.OrderExecutionProviderGateway")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("TradeHub.OrderExecutionEngine.OrderExecutionProviderGateway")] [assembly: AssemblyCopyright("Copyright © 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("0c5a1772-2ca2-4c96-bf73-48f1772f3201")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "content_hash": "556119532557e052ccc364e1c90f43bf", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 90, "avg_line_length": 38.30769230769231, "alnum_prop": 0.7570281124497992, "repo_name": "trade-nexus/tradesharp-core", "id": "482d00021bba5f89ac088b3aa2f0cea481006329", "size": "3034", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Backend/OrderExecutionEngine/TradeHub.OrderExecutionEngine.OrderExecutionProviderGateway/Properties/AssemblyInfo.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "3043" }, { "name": "C#", "bytes": "5343670" }, { "name": "HTML", "bytes": "5598" }, { "name": "PowerShell", "bytes": "892" } ], "symlink_target": "" }
var app = angular.module("ethics-app"); // User delete controller app.controller("userDeleteController", function($scope, $rootScope, $routeParams, $filter, $translate, $location, config, $window, $authenticationService, $userService) { /************************************************* FUNCTIONS *************************************************/ /** * [redirect description] * @param {[type]} path [description] * @return {[type]} [description] */ $scope.redirect = function(path){ $location.url(path); }; /** * [description] * @return {[type]} [description] */ $scope.delete = function(){ $scope.$parent.loading = { status: true, message: $filter('translate')('DELETING_USER') }; // Delete user $userService.remove($scope.user.user_id) .then(function onSuccess(response) { $scope.redirect("/users"); }) .catch(function onError(response) { $window.alert(response.data); }); }; /************************************************* INIT *************************************************/ $scope.$parent.loading = { status: true, message: $filter('translate')('LOADING_USER') }; $scope.input = ""; // Load user $userService.retrieve($routeParams.user_id) .then(function onSuccess(response) { $scope.user = response.data; // Create full name if($scope.user.title !== null){ $scope.user.fullname = $scope.user.title + " " + $scope.user.first_name + " " + $scope.user.last_name; } else { $scope.user.fullname = $scope.user.first_name + " " + $scope.user.last_name; } $scope.$parent.loading = { status: false, message: "" }; }) .catch(function onError(response) { $window.alert(response.data); }); });
{ "content_hash": "562a7572365aa886da498b8d5d02f983", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 170, "avg_line_length": 31.75, "alnum_prop": 0.5034120734908136, "repo_name": "sitcomlab/Ethics-app", "id": "e17b33b5248d6397484867a555e42d18794f3908", "size": "1905", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/member-client/js/controllers/user/deleteController.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4652" }, { "name": "HTML", "bytes": "1366015" }, { "name": "JavaScript", "bytes": "946510" }, { "name": "PLSQL", "bytes": "6025" }, { "name": "SQLPL", "bytes": "40046" }, { "name": "Shell", "bytes": "263" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.me.diankun.commonview"> <!-- 访问网络权限 --> <uses-permission android:name="android.permission.INTERNET" /> <application android:name=".App" android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".RadioCheckActivity" /> <activity android:name=".TextViewActivity" /> <activity android:name=".EditActivity" /> <activity android:name=".LayoutActivity" /> <!--listview相关的Activity --> <activity android:name=".ListViewActivity" /> <activity android:name=".ListViewChatActivity" /> <activity android:name=".ListViewEditActivity" android:windowSoftInputMode="adjustPan|stateHidden"/> <activity android:name=".ListViewFlexibleActivity" /> <activity android:name=".ListViewNotifyActivity" /> <activity android:name=".ListViewGetViewActivity" /> <activity android:name=".ListViewScrollHideActivity" /> <!-- Service --> <service android:name=".service.UpdateTextService" /> </application> </manifest>
{ "content_hash": "605c90c62b15d2c57a116d98c6bd9e48", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 76, "avg_line_length": 39.095238095238095, "alnum_prop": 0.6169305724725944, "repo_name": "qdiankun/androidbase", "id": "bc6f9c9061dcb882d3ed5da43eb38cf7bca8422a", "size": "1660", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "andoridbase/commonview/src/main/AndroidManifest.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "470241" } ], "symlink_target": "" }
/************************************* // // rfid-socketio app // **************************************/ // express magic var express = require('express'); var app = express(); var server = require('http').createServer(app) var io = require('socket.io').listen(server); var serialPort = require("serialport"); var SerialPort = serialPort.SerialPort; var sp; var device = require('express-device'); var runningPortNumber = 1337; app.configure(function(){ // I need to access everything in '/public' directly app.use(express.static(__dirname + '/public')); //set the view engine app.set('view engine', 'ejs'); app.set('views', __dirname +'/views'); app.use(device.capture()); }); // logs every request app.use(function(req, res, next){ // output every request in the array console.log({method:req.method, url: req.url, device: req.device}); // goes onto the next function in line next(); }); app.get("/", function(req, res){ res.render('index', {}); }); io.sockets.on('connection', function (socket) { socket.on('port:list', function(data, fn) { // reload the serial port serialPort.list(function(err, ports) { var names = []; ports.forEach(function(item) { names.push(item.comName); }) fn({ports: names}); }); }); socket.on('port:connect', function(data, fn) { console.log(data) // add parser data.options.parser = serialPort.parsers.readline("\r\n"); if (sp) { fn('A serial port has already connected, reconnecting...'); sp.close(function(err) {}); sp = new SerialPort(data.portName, data.options, true); } else { if (!data.portName) { socket.emit('port:connect:error', {msg: 'Please specify port name!'}); return; } else { sp = new SerialPort(data.portName, data.options, true); } } sp.on('error', function(error) { socket.emit('port:connect:error', { msg: 'Connection error !' }) }); sp.on("open", function () { console.log('open'); sp.on('data', function(data) { var decArr = data.replace('SERIAL:', '').split(','); var hexString = ''; var decToHex = function(dec) { var theInt = parseInt(dec); if (theInt < 17) { return '0' + theInt.toString(16); } else { return theInt.toString(16); } } decArr.forEach(function(dec) { hexString += decToHex(dec); }); var result = hexString.toUpperCase(); if (result.length == 10) { socket.emit('port:data', hexString.toUpperCase()); } }); fn(true); }); }); socket.on('port:close', function(data, fn){ sp.close(function(err) { if (err) { fn(false); } else { fn(true); } }); }); // io.sockets.emit('blast', {msg:"<span style=\"color:red !important\">someone connected</span>"}); // socket.on('blast', function(data, fn){ // console.log(data); // io.sockets.emit('blast', {msg:data.msg}); // fn();//call the client back to clear out the field // }); }); server.listen(runningPortNumber);
{ "content_hash": "9b32287cf4f222b6212bcb3a8fe88c69", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 100, "avg_line_length": 22.62686567164179, "alnum_prop": 0.5857519788918206, "repo_name": "OpenUSJ/webrfid", "id": "4888c1b163c9602f2e112324cd6608cb0387d1b2", "size": "3032", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "nodejs/server.js", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "83" }, { "name": "JavaScript", "bytes": "15726" }, { "name": "Processing", "bytes": "22240" } ], "symlink_target": "" }
<?php namespace tests\ObjectElement; use Mockery\Adapter\Phpunit\MockeryTestCase; use PHPCD\Element\ObjectElement\GenericProperty; use Mockery; use PHPCD\Element\ClassInfo\ClassInfo; class GenericPropertyTest extends MockeryTestCase { public function testConstructor() { $classInfo = Mockery::mock(ClassInfo::class); $classInfo->shouldReceive('getName')->andReturn('Bar'); $propInfo = new GenericProperty('Foo', $classInfo, 'protected', false); $this->assertTrue($propInfo->isProtected()); $this->assertFalse($propInfo->isStatic()); $this->assertEquals('Bar', $propInfo->getClass()->getName()); } }
{ "content_hash": "80b73f8aaec8e0209132cb470bc00e66", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 79, "avg_line_length": 30.136363636363637, "alnum_prop": 0.698340874811463, "repo_name": "przepompownia/phpcd.vim", "id": "a86a2d5862943711cffaff6027c7f2ff779ce159", "size": "663", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/php/ObjectElement/GenericPropertyTest.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "PHP", "bytes": "152441" }, { "name": "Python", "bytes": "619" }, { "name": "Shell", "bytes": "1555" }, { "name": "Vim script", "bytes": "63704" } ], "symlink_target": "" }
<span></table><span>
{ "content_hash": "05dcd68e70c300ad19d9d21a03b75a1b", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 20, "avg_line_length": 22, "alnum_prop": 0.5909090909090909, "repo_name": "robashton/zombify", "id": "1839ecc88c90d593ba5f72a8da10ca5ebf1efe19", "size": "22", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/node_modules/zombie/node_modules/html5/data/tree-construction/tests_innerHTML_1.dat-35/input.html", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "910" }, { "name": "C#", "bytes": "73681" }, { "name": "CoffeeScript", "bytes": "4176" }, { "name": "JavaScript", "bytes": "5758" } ], "symlink_target": "" }
#region Copyright // // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation // // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated // documentation files (the "Software"), to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("TestUtilities")] [assembly: AssemblyDescription("Open Source Web Application Framework")] [assembly: AssemblyCompany("DotNetNuke Corporation")] [assembly: AssemblyProduct("https://www.dnnsoftware.com")] [assembly: AssemblyCopyright("DotNetNuke is copyright 2002-2018 by DotNetNuke Corporation. All Rights Reserved.")] [assembly: AssemblyTrademark("DotNetNuke")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("f9904f9b-176f-469d-a5fd-f3011b2cc52e")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "content_hash": "06b3a726bd655b88c06a67840f7f89ad", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 116, "avg_line_length": 44.932203389830505, "alnum_prop": 0.7578272350056583, "repo_name": "RichardHowells/Dnn.Platform", "id": "5a15c3ed68e04da639fc1ef6c8071b3c767522c3", "size": "2654", "binary": false, "copies": "2", "ref": "refs/heads/development", "path": "DNN Platform/Tests/DotNetNuke.Tests.Utilities/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "1325033" }, { "name": "Batchfile", "bytes": "374" }, { "name": "C#", "bytes": "20877202" }, { "name": "CSS", "bytes": "1028965" }, { "name": "Erlang", "bytes": "2168" }, { "name": "HTML", "bytes": "629809" }, { "name": "JavaScript", "bytes": "3825173" }, { "name": "PHP", "bytes": "2199" }, { "name": "Smalltalk", "bytes": "66184" }, { "name": "Visual Basic", "bytes": "139461" }, { "name": "XSLT", "bytes": "16560" } ], "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_51) on Thu Apr 28 18:37:27 UTC 2016 --> <title>EncryptionOptions.ServerEncryptionOptions.InternodeEncryption (apache-cassandra API)</title> <meta name="date" content="2016-04-28"> <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="EncryptionOptions.ServerEncryptionOptions.InternodeEncryption (apache-cassandra API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.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/cassandra/config/EncryptionOptions.ServerEncryptionOptions.html" title="class in org.apache.cassandra.config"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/cassandra/config/IndexType.html" title="enum in org.apache.cassandra.config"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html" target="_top">Frames</a></li> <li><a href="EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.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:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#enum_constant_summary">Enum Constants</a>&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#enum_constant_detail">Enum Constants</a>&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.apache.cassandra.config</div> <h2 title="Enum EncryptionOptions.ServerEncryptionOptions.InternodeEncryption" class="title">Enum EncryptionOptions.ServerEncryptionOptions.InternodeEncryption</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>java.lang.Enum&lt;<a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html" title="enum in org.apache.cassandra.config">EncryptionOptions.ServerEncryptionOptions.InternodeEncryption</a>&gt;</li> <li> <ul class="inheritance"> <li>org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions.InternodeEncryption</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd>java.io.Serializable, java.lang.Comparable&lt;<a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html" title="enum in org.apache.cassandra.config">EncryptionOptions.ServerEncryptionOptions.InternodeEncryption</a>&gt;</dd> </dl> <dl> <dt>Enclosing class:</dt> <dd><a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.html" title="class in org.apache.cassandra.config">EncryptionOptions.ServerEncryptionOptions</a></dd> </dl> <hr> <br> <pre>public static enum <span class="strong">EncryptionOptions.ServerEncryptionOptions.InternodeEncryption</span> extends java.lang.Enum&lt;<a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html" title="enum in org.apache.cassandra.config">EncryptionOptions.ServerEncryptionOptions.InternodeEncryption</a>&gt;</pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== ENUM CONSTANT SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="enum_constant_summary"> <!-- --> </a> <h3>Enum Constant Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Constant Summary table, listing enum constants, and an explanation"> <caption><span>Enum Constants</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Enum Constant and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html#all">all</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html#dc">dc</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html#none">none</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html#rack">rack</a></strong></code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</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>static <a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html" title="enum in org.apache.cassandra.config">EncryptionOptions.ServerEncryptionOptions.InternodeEncryption</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html#valueOf(java.lang.String)">valueOf</a></strong>(java.lang.String&nbsp;name)</code> <div class="block">Returns the enum constant of this type with the specified name.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html" title="enum in org.apache.cassandra.config">EncryptionOptions.ServerEncryptionOptions.InternodeEncryption</a>[]</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html#values()">values</a></strong>()</code> <div class="block">Returns an array containing the constants of this enum type, in the order they are declared.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Enum"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Enum</h3> <code>clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>getClass, notify, notifyAll, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ ENUM CONSTANT DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="enum_constant_detail"> <!-- --> </a> <h3>Enum Constant Detail</h3> <a name="all"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>all</h4> <pre>public static final&nbsp;<a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html" title="enum in org.apache.cassandra.config">EncryptionOptions.ServerEncryptionOptions.InternodeEncryption</a> all</pre> </li> </ul> <a name="none"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>none</h4> <pre>public static final&nbsp;<a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html" title="enum in org.apache.cassandra.config">EncryptionOptions.ServerEncryptionOptions.InternodeEncryption</a> none</pre> </li> </ul> <a name="dc"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>dc</h4> <pre>public static final&nbsp;<a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html" title="enum in org.apache.cassandra.config">EncryptionOptions.ServerEncryptionOptions.InternodeEncryption</a> dc</pre> </li> </ul> <a name="rack"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>rack</h4> <pre>public static final&nbsp;<a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html" title="enum in org.apache.cassandra.config">EncryptionOptions.ServerEncryptionOptions.InternodeEncryption</a> rack</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="values()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>values</h4> <pre>public static&nbsp;<a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html" title="enum in org.apache.cassandra.config">EncryptionOptions.ServerEncryptionOptions.InternodeEncryption</a>[]&nbsp;values()</pre> <div class="block">Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows: <pre> for (EncryptionOptions.ServerEncryptionOptions.InternodeEncryption c : EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.values()) &nbsp; System.out.println(c); </pre></div> <dl><dt><span class="strong">Returns:</span></dt><dd>an array containing the constants of this enum type, in the order they are declared</dd></dl> </li> </ul> <a name="valueOf(java.lang.String)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>valueOf</h4> <pre>public static&nbsp;<a href="../../../../org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html" title="enum in org.apache.cassandra.config">EncryptionOptions.ServerEncryptionOptions.InternodeEncryption</a>&nbsp;valueOf(java.lang.String&nbsp;name)</pre> <div class="block">Returns the enum constant of this type with the specified name. The string must match <i>exactly</i> an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - the name of the enum constant to be returned.</dd> <dt><span class="strong">Returns:</span></dt><dd>the enum constant with the specified name</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.lang.IllegalArgumentException</code> - if this enum type has no constant with the specified name</dd> <dd><code>java.lang.NullPointerException</code> - if the argument is null</dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.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/cassandra/config/EncryptionOptions.ServerEncryptionOptions.html" title="class in org.apache.cassandra.config"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/cassandra/config/IndexType.html" title="enum in org.apache.cassandra.config"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html" target="_top">Frames</a></li> <li><a href="EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.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:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#enum_constant_summary">Enum Constants</a>&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#enum_constant_detail">Enum Constants</a>&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</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>Copyright &copy; 2016 The Apache Software Foundation</small></p> </body> </html>
{ "content_hash": "e72216a484dbd58ab6f597f1ae6c7589", "timestamp": "", "source": "github", "line_count": 350, "max_line_length": 297, "avg_line_length": 43.84571428571429, "alnum_prop": 0.6954255180503063, "repo_name": "elisska/cloudera-cassandra", "id": "6f0e94b4ff11e5ff6890facc6a0f77af8c3b485f", "size": "15346", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DATASTAX_CASSANDRA-2.2.6/javadoc/org/apache/cassandra/config/EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "75145" }, { "name": "CSS", "bytes": "4112" }, { "name": "HTML", "bytes": "331372" }, { "name": "PowerShell", "bytes": "77673" }, { "name": "Python", "bytes": "979128" }, { "name": "Shell", "bytes": "143685" }, { "name": "Thrift", "bytes": "80564" } ], "symlink_target": "" }
// Copyright (c) DotSpatial Team. All rights reserved. // Licensed under the MIT license. See License.txt file in the project root for full license information. using System; namespace DotSpatial.Controls.Header { /// <summary> /// By using this interface, the developers can create a button, menu, ribbon tab. etc /// without considering whether the user interface is ribbon style or standard toolbar /// style. /// </summary> public interface IHeaderControl { #region Events /// <summary> /// This event occurs when a root item is selected /// </summary> event EventHandler<RootItemEventArgs> RootItemSelected; #endregion #region Methods /// <summary> /// This will add a new item that will appear on the standard toolbar or ribbon control. /// </summary> /// <param name="item">The item that gets added.</param> /// <returns>Added GUI item.</returns> object Add(HeaderItem item); /// <summary> /// Remove item from the standard toolbar or ribbon control. /// </summary> /// <param name="key">The string itemName to remove from the standard toolbar or ribbon control.</param> void Remove(string key); /// <summary> /// Removes all items the plugin created. /// </summary> void RemoveAll(); /// <summary> /// Selects the root, making it the active root. /// </summary> /// <param name="key">The key.</param> void SelectRoot(string key); #endregion } }
{ "content_hash": "5104904761b3e54e5f92cfdf731ff52f", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 112, "avg_line_length": 31.134615384615383, "alnum_prop": 0.6046942557134033, "repo_name": "DotSpatial/DotSpatial", "id": "8f3078301de2dd02faeeba10a1db251f4c22318c", "size": "1621", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/Core/DotSpatial.Controls/Header/IHeaderControl.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP.NET", "bytes": "1639" }, { "name": "Batchfile", "bytes": "4625" }, { "name": "C#", "bytes": "15483649" }, { "name": "CSS", "bytes": "490" }, { "name": "HTML", "bytes": "8176" }, { "name": "JavaScript", "bytes": "133570" }, { "name": "Smalltalk", "bytes": "406360" }, { "name": "Visual Basic .NET", "bytes": "451767" } ], "symlink_target": "" }
NAME = airdock/node VERSION = 10 .PHONY: all clean build tag_latest release debug run all: build clean: @CID=$(shell docker ps -a | awk '{ print $$1 " " $$2 }' | grep $(NAME) | awk '{ print $$1 }'); if [ ! -z "$$CID" ]; then echo "Removing container which reference $(NAME)"; for container in $(CID); do docker rm -f $$container; done; fi; @if docker images $(NAME) | awk '{ print $$2 }' | grep -q -F $(VERSION); then docker rmi -f $(NAME):$(VERSION); fi @if docker images $(NAME) | awk '{ print $$2 }' | grep -q -F latest; then docker rmi -f $(NAME):latest; fi build: clean docker build -t $(NAME):$(VERSION) --rm . tag_latest: @docker tag $(NAME):$(VERSION) $(NAME):latest release: build tag_latest docker push $(NAME) @echo "Create a tag v-$(VERSION)" @git tag v-$(VERSION) @git push origin v-$(VERSION) debug: docker run -t -i $(NAME):$(VERSION) /bin/bash -l run: docker run $(NAME):$(VERSION)
{ "content_hash": "1f4b0e5646717df841f242864f8899af", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 236, "avg_line_length": 30.6, "alnum_prop": 0.6220043572984749, "repo_name": "airdock-io/docker-node", "id": "7eb462775ef911b27290d3142747da0c9896fc4f", "size": "918", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "node-10/Makefile", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "3092" } ], "symlink_target": "" }
package com.sun.org.apache.xerces.internal.util; import java.util.Enumeration; import java.util.Vector; import javax.xml.namespace.NamespaceContext; /** * Writing a wrapper to re-use most of the namespace functionality * already provided by NamespaceSupport, which implements NamespaceContext * from XNI. It would be good if we can change the XNI NamespaceContext * interface to implement the JAXP NamespaceContext interface. * * Note that NamespaceSupport assumes the use of symbols. Since this class * can be exposed to the application, we must intern all Strings before * calling NamespaceSupport methods. * * @author Neeraj Bajaj, Sun Microsystems, inc. * @author [email protected] * */ public class NamespaceContextWrapper implements NamespaceContext { private com.sun.org.apache.xerces.internal.xni.NamespaceContext fNamespaceContext; public NamespaceContextWrapper(NamespaceSupport namespaceContext) { fNamespaceContext = namespaceContext ; } public String getNamespaceURI(String prefix) { if (prefix == null) { throw new IllegalArgumentException("Prefix can't be null"); } return fNamespaceContext.getURI(prefix.intern()); } public String getPrefix(String namespaceURI) { if (namespaceURI == null) { throw new IllegalArgumentException("URI can't be null."); } return fNamespaceContext.getPrefix(namespaceURI.intern()); } /** * TODO: Namespace doesn't give information giving multiple prefixes for * the same namespaceURI. */ public java.util.Iterator getPrefixes(String namespaceURI) { if (namespaceURI == null) { throw new IllegalArgumentException("URI can't be null."); } else { Vector vector = ((NamespaceSupport) fNamespaceContext).getPrefixes(namespaceURI.intern()); return vector.iterator(); } } /** * This method supports all functions in the NamespaceContext utility class */ public com.sun.org.apache.xerces.internal.xni.NamespaceContext getNamespaceContext() { return fNamespaceContext; } }
{ "content_hash": "63f6e570ff8c38426c6083553cd2bc0e", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 90, "avg_line_length": 32.80597014925373, "alnum_prop": 0.6965423111919927, "repo_name": "rokn/Count_Words_2015", "id": "214315946fce0f7c2848d42fe55932dbf596a3f2", "size": "3410", "binary": false, "copies": "43", "ref": "refs/heads/master", "path": "testing/openjdk2/jaxp/src/com/sun/org/apache/xerces/internal/util/NamespaceContextWrapper.java", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "61802" }, { "name": "Ruby", "bytes": "18888605" } ], "symlink_target": "" }
/* * File: ParallelSuite.h * Author: daniel * * Created on September 13, 2015, 5:14 PM */ #ifndef PARALLELSUITE_H #define PARALLELSUITE_H #include <thread> #include <future> #include "TestSuite.h" #include "SynchronizedOutput.h" namespace Test { /*! * A suite which calls every sub-suite in an own thread and therefore in parallel. * ParallelSuite does not support adding test-methods directly to the suite. * All test-methods must be added via a sub-suite */ class ParallelSuite : public Suite { public: ParallelSuite(); ParallelSuite(const std::string& suiteName); ~ParallelSuite(); bool run(Output& output, bool continueAfterFail = true); private: bool runSuite(unsigned int suiteIndex); }; }; #endif /* PARALLELSUITE_H */
{ "content_hash": "5fd5cdc7cf9fb5934df83cd37b24fe73", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 86, "avg_line_length": 20.9, "alnum_prop": 0.6507177033492823, "repo_name": "Kaayy-J/OHMComm-Light", "id": "d171e0fc6d80f917547d3fd9370aaa08ea9fb47f", "size": "836", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/cpptest-lite/include/ParallelSuite.h", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "19964" }, { "name": "Batchfile", "bytes": "918" }, { "name": "C", "bytes": "2576177" }, { "name": "C++", "bytes": "783133" }, { "name": "CMake", "bytes": "14856" }, { "name": "CSS", "bytes": "37758" }, { "name": "HTML", "bytes": "404913" }, { "name": "JavaScript", "bytes": "2983" }, { "name": "Makefile", "bytes": "6017" }, { "name": "Objective-C", "bytes": "42889" }, { "name": "Perl", "bytes": "8945" }, { "name": "Shell", "bytes": "340516" } ], "symlink_target": "" }
using namespace std; int str_len; void printAll(string text,int index,string str){ if(index==str_len) {cout<<str<<endl;return;} else { printAll(text,index+1,str); str+=text[index]; printAll(text,index+1,str); } } int main(int argc, char const *argv[]) { string str=""; string text="ABCD"; str_len=4; printAll(text,0,str); return 0; }
{ "content_hash": "f22d1d59e4949eadacab44fb2e4247ae", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 48, "avg_line_length": 17.45, "alnum_prop": 0.667621776504298, "repo_name": "AadityaJ/Spoj", "id": "e025373d7718e681fa7271a391d6190905c7fe7e", "size": "387", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Jun2016/permu.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "43817" }, { "name": "C++", "bytes": "82886" }, { "name": "Python", "bytes": "645" } ], "symlink_target": "" }
import string from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import Select from selenium.common.exceptions import StaleElementReferenceException from selenium.common.exceptions import NoSuchElementException import time import objects import numpy as np class Crawler(object): def __init__(self,url,dropdownName): self.url = url self.driver = webdriver.Chrome() self.driver.get(self.url) self.names = [] self.entryIDs = ['sectiontableentry1','sectiontableentry2'] self.dropdownName = dropdownName self.curr_style_val = 1 self.curr_style_str = '' def selectStyle(self,value): #change the page using the dropdown style selector menu driver = self.driver select = Select(driver.find_element_by_name(self.dropdownName)) select.select_by_value(str(value)) self.curr_style_val = value def getTableContents(self): def getElementNames(soup): names = [] for header in soup.findAll('td',{'class':'sectiontableheader'}): names.append(str(header.string)) return names def getElements(soup): element_array = np.empty((1,len(self.names)),dtype='object') add_row = element_array for eind, elt in enumerate(soup.findAll('tr',{'class':self.entryIDs[0],'class':self.entryIDs[1]})): printable = set(string.printable) components = len(elt.findAll('td')) for iind,item in enumerate(elt.findAll('td')): try: item = filter(lambda x: x in printable, item.string) except TypeError: item = '' element_array[eind,iind] = str(item).replace('\n','').replace('\t','') element_array = np.vstack((element_array,add_row)) return element_array driver = self.driver WebDriverWait(driver, 10).until(lambda driver: driver.find_element_by_name(self.dropdownName)) source_code = driver.page_source soup = BeautifulSoup(source_code,'lxml') curr_style_list = soup.findAll('option',{'value':str(self.curr_style_val)}) self.curr_style_str = str(curr_style_list[0].string.replace(u'ö','o').replace(u'ü','u')) if len(self.names) == 0: self.names = getElementNames(soup) output_array = getElements(soup) return self.curr_style_str, self.names, output_array def endDriver(self): self.driver.quit() def setupCrawler(baseurl,crawl_type): if crawl_type[0].lower() == 'h': #crawl hops page url = baseurl+'hops' dropdown = 'style' elif crawl_type[0].lower() == 'y': #crawl yeast page url = baseurl+'yeast' dropdown = 'style' elif crawl_type[0].lower() == 'g': #crawl grains page url = baseurl+'grains' dropdown = 'gtype' else: return '#####ERROR: crawl_type must be \'hops\', \'yeast\', or \'grains\'' crawler = Crawler(url=url, dropdownName=dropdown) return crawler def crawlStyle(crawler,style_id,problem_child=0,print_details=False): try: crawler.selectStyle(style_id) problem_child=0 except NoSuchElementException: print '\n----------------\n######ERROR: revise styleslist (element ',str(i),' not found)\n----------------\n\n' problem_child += 1 if problem_child > 2: print '\n----------------\n######ERROR: problem_child done run a muck. Iteration ended.\n----------------\n\n' return crawler,problem_child def crawlMultiple(baseurl,styleslist,crawl_type): #setup crawler url and dropdown selection based on crawl_type crawler = setupCrawler(baseurl,crawl_type) #go through styleslist numbers problem_child = 0 for i in styleslist: try: crawler.selectStyle(i) problem_child=0 except NoSuchElementException: print '\n----------------\n######ERROR: revise styleslist (element ',str(i),' not found)\n----------------\n\n' problem_child += 1 if problem_child > 2: print '\n----------------\n######ERROR: problem_child done run a muck. Iteration ended.\n----------------\n\n' break continue style, names, output = crawler.getTableContents() #print the current page crawl results print style, i #print names #print output #print '--------\n\n' #terminate the driver connection crawler.endDriver() return style, names, output def main(): #crawl type is either 'hops', 'yeast', or 'grains', styleslist is the list of values associated with the dropdown html options baseurl = 'https://byo.com/resources/' styleslist = np.arange(28)+1 crawl_type = 'hops' style,names,output = crawlMultiple(baseurl,styleslist=styleslist,crawl_type=crawl_type) return style,names,output if __name__ == '__main__': main() ''' American Lager 1 American Amber & Pale Ale 2 Barleywine and Imperial Stout 3 Belgian and French Ale 4 Belgian Lambic and Sour Ale 5 Belgian Strong Ale 6 Bock 7 Brown Ale 8 Cider 9 English & Scottish Strong Ale 10 English Bitter & Pale Ale 11 European Dark Lager 12 European Pale Lager 13 Fruit Beer 14 German Amber Lager 15 India Pale Ale 16 Kolsch & Altbier 17 Light Ale 18 Mead 19 Porter 20 Scottish Ale 21 Smoked Beer 22 Soda Pop 23 Specialty & Experimental Beer 24 Spice, Herb & Vegetable Beer 25 Stout 26 Wheat Beer 27 American Pale Ale 28 '''
{ "content_hash": "835a48b9fc8768e5013ca5914228e28b", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 127, "avg_line_length": 29.65497076023392, "alnum_prop": 0.6933543679747585, "repo_name": "jvahala/brew-thing", "id": "4ac64c15b9841d1ac7ae07f0aa11a24fd7f58f2f", "size": "5089", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "py-modules/crawler.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "3521" }, { "name": "HTML", "bytes": "76171" }, { "name": "JavaScript", "bytes": "7488" }, { "name": "Processing", "bytes": "5309" }, { "name": "Python", "bytes": "55943" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@color/ct_white" /> <stroke android:color="@color/ct_divider" android:width="@dimen/ct_single_px"/> <corners android:topLeftRadius="3dp" android:topRightRadius="3dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp"/> </shape>
{ "content_hash": "f533e20b4a5224ae5d2ebbbca3237e99", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 83, "avg_line_length": 53, "alnum_prop": 0.6981132075471698, "repo_name": "fuhongliang/CuiTrip", "id": "56ba2ab89010e9c3d4a2b1bbfde1cb2984c33dd6", "size": "424", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "TripApp/src/main/res/drawable/ct_gray_around.xml", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "7988" }, { "name": "Java", "bytes": "1252509" } ], "symlink_target": "" }
package com.george.plugins.jira; import java.io.File; import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class GenerateReleaseNotesMojoTest extends AbstractMojoTestCase { private GenerateReleaseNotesMojo mojo; @Override public void setUp() throws Exception { super.setUp(); mojo = (GenerateReleaseNotesMojo) lookupMojo("generate-release-notes", "src/test/resources/GenerateReleaseNotesMojoTest.xml"); } @Ignore @Test public void testDoExecute() throws Exception { mojo.execute(); assertTrue("Release Notes not generated", new File( "target/releaseNotes.txt").exists()); } }
{ "content_hash": "a8a2c00811c65362dfc9fa5525c0941b", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 72, "avg_line_length": 24.75, "alnum_prop": 0.7411616161616161, "repo_name": "maxifier/jira-maven-plugin", "id": "51c81cc87fcbcee37a29cd5cb423b916e3592f10", "size": "792", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/com/george/plugins/jira/GenerateReleaseNotesMojoTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "779451" } ], "symlink_target": "" }
http://jasmine.github.io/1.3/introduction.html https://github.com/mhevery/jasmine-node jasmine-node jasmine-spec --verbose
{ "content_hash": "95e59e2a4418ab8c2b449660fc87e945", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 46, "avg_line_length": 41, "alnum_prop": 0.7967479674796748, "repo_name": "osser/nodejs-sample", "id": "50b1c0e5e23a8eac6b0f78067a45acb6f658d933", "size": "123", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jasmine-spec/readme.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "314140" }, { "name": "JavaScript", "bytes": "80574" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>interval: 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.11.0 / interval - 3.3.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> interval <small> 3.3.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-10-28 20:25:49 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-28 20:25:49 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 coq 8.11.0 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.06.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.06.1 Official 4.06.1 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.5 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://coqinterval.gitlabpages.inria.fr/&quot; dev-repo: &quot;git+https://gitlab.inria.fr/coqinterval/interval.git&quot; bug-reports: &quot;https://gitlab.inria.fr/coqinterval/interval/issues&quot; license: &quot;CeCILL-C&quot; build: [ [&quot;./configure&quot;] [&quot;./remake&quot; &quot;-j%{jobs}%&quot;] ] install: [&quot;./remake&quot; &quot;install&quot;] depends: [ &quot;coq&quot; {&gt;= &quot;8.5&quot; &amp; &lt; &quot;8.7&quot;} | (&quot;coq&quot; {&gt;= &quot;8.7&quot;} &amp; &quot;coq-bignums&quot;) &quot;coq-flocq&quot; {&gt;= &quot;2.5.0&quot; &amp; &lt; &quot;3.0~&quot;} &quot;coq-mathcomp-ssreflect&quot; {&gt;= &quot;1.6&quot;} &quot;coq-coquelicot&quot; {&gt;= &quot;3.0&quot;} ] tags: [ &quot;keyword:interval arithmetic&quot; &quot;keyword:decision procedure&quot; &quot;keyword:floating-point arithmetic&quot; &quot;keyword:reflexive tactic&quot; &quot;keyword:Taylor models&quot; &quot;category:Mathematics/Real Calculus and Topology&quot; &quot;category:Computer Science/Decision Procedures and Certified Algorithms/Decision procedures&quot; ] authors: [ &quot;Guillaume Melquiond &lt;[email protected]&gt;&quot; ] synopsis: &quot;A Coq tactic for proving bounds on real-valued expressions automatically&quot; url { src: &quot;https://coqinterval.gitlabpages.inria.fr/releases/interval-3.3.0.tar.gz&quot; checksum: &quot;md5=5b50705041b3c95a43fa6789cca0aa89&quot; } </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-interval.3.3.0 coq.8.11.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.11.0). The following dependencies couldn&#39;t be met: - coq-interval -&gt; coq-flocq &lt; 3.0~ -&gt; coq &lt; 8.9~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;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-interval.3.3.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": "c761d82789f7da372b42ae5737d040ed", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 159, "avg_line_length": 41.78488372093023, "alnum_prop": 0.5489077501043551, "repo_name": "coq-bench/coq-bench.github.io", "id": "94ddad7a39d7a1a00a88baf1f462603808c94aa9", "size": "7212", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.06.1-2.0.5/released/8.11.0/interval/3.3.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
var expect = require('chai').expect; var uniq = require('lodash').uniq; var config = require('../../../../config'); // NOTE: we run tests in chrome only, because we mainly test server API functionality. describe('[API] fixture.beforeEach/fixture.afterEach hooks', function () { it('Should run hooks for all tests', function () { var test1Err = null; return runTests('./testcafe-fixtures/run-all.js', 'Test1', { shouldFail: true, only: 'chrome' }) .catch(function (errs) { test1Err = errs[0]; return runTests('./testcafe-fixtures/run-all.js', 'Test2', { shouldFail: true, only: 'chrome' }); }) .catch(function (errs) { expect(errs[0]).eql(test1Err); expect(errs[0].indexOf( '- Error in fixture.afterEach hook - ' + 'Error on page "http://localhost:3000/fixtures/api/es-next/hooks/pages/index.html": ' + 'Uncaught Error: [beforeEach][test][afterEach]' )).eql(0); expect(errs[0]).contains("> 9 | .click('#failAndReport');"); }); }); it('Should not run test and afterEach if fails in beforeEach', function () { return runTests('./testcafe-fixtures/fail-in-before-each.js', 'Test', { shouldFail: true, only: 'chrome' }) .catch(function (errs) { expect(errs[0].indexOf( '- Error in fixture.beforeEach hook - ' + 'Error on page "http://localhost:3000/fixtures/api/es-next/hooks/pages/index.html": ' + 'Uncaught Error: [beforeEach]' )).eql(0); expect(errs[0]).contains("> 6 | .click('#failAndReport');"); }); }); it('Should run test and afterEach and beforeEach if test fails', function () { return runTests('./testcafe-fixtures/fail-in-test.js', 'Test', { shouldFail: true, only: 'chrome' }) .catch(function (errs) { expect(errs[0].indexOf( 'Error on page "http://localhost:3000/fixtures/api/es-next/hooks/pages/index.html": ' + 'Uncaught Error: [beforeEach] ' )).eql(0); expect(errs[1].indexOf( '- Error in fixture.afterEach hook - ' + 'Error on page "http://localhost:3000/fixtures/api/es-next/hooks/pages/index.html": ' + 'Uncaught Error: [beforeEach][afterEach]' )).eql(0); expect(errs[0]).contains("> 13 | await t.click('#failAndReport');"); expect(errs[1]).contains("> 9 | .click('#failAndReport');"); }); }); }); describe('[API] test.before/test.after hooks', function () { it('Should run hooks before and after test and override fixture hooks', function () { return runTests('./testcafe-fixtures/run-all.js', 'Test3', { shouldFail: true, only: 'chrome' }) .catch(function (errs) { expect(errs[0]).contains('- Error in test.after hook - '); expect(errs[0]).contains('[testBefore][test][testAfter]'); }); }); }); describe('[API] t.ctx', function () { it('Should pass context object to tests and hooks', function () { return runTests('./testcafe-fixtures/run-all.js', 't.ctx', { shouldFail: true, only: 'chrome,ie,firefox' }) .catch(function (errs) { var testedBrowsers = config.currentEnvironment.browsers; if (testedBrowsers.length === 1 && Array.isArray(errs)) errs = { [testedBrowsers[0].alias]: errs }; var browsers = []; Object.keys(errs).forEach(function (browser) { var dataJson = errs[browser][0].match(/###(.+)###/)[1]; var data = JSON.parse(dataJson); // NOTE: check context assignment expect(data.ctx).eql(123); // NOTE: check that we have same browser for each stage expect(uniq(data.val.browsers).length).eql(1); expect(data.val.steps).eql(['before', 'test', 'after']); browsers.push(data.val.browsers[0]); }); // NOTE: check that each context is from different browsers expect(uniq(browsers).length).eql(config.currentEnvironment.browsers.length); }); }); }); describe('[API] fixture.before/fixture.after hooks', function () { it('Should run hooks before and after fixture', function () { return runTests('./testcafe-fixtures/fixture-hooks.js', null); }); it('Should keep sequential reports with long executing hooks', function () { return runTests('./testcafe-fixtures/fixture-hooks-seq.js', null, { shouldFail: true, only: 'chrome' }).catch(function (errs) { expect(errs[0]).contains('$$test1$$'); expect(errs[1]).contains('$$afterhook1$$'); expect(errs[2]).contains('$$test2$$'); expect(errs[3]).contains('$$afterhook2$$'); expect(errs[4]).contains('$$test3$$'); }); }); it('Should fail all tests in fixture if fixture.before hooks fails', function () { return runTests('./testcafe-fixtures/fixture-before-fail.js', null, { shouldFail: true, only: 'chrome, firefox' }).catch(function (errs) { var allErrors = errs['chrome'].concat(errs['firefox']); expect(allErrors.length).eql(6); allErrors.forEach(function (err) { expect(err).contains('Error in fixture.before hook'); expect(err).contains('$$before$$'); }); }); }); it('Fixture context', function () { return runTests('./testcafe-fixtures/fixture-ctx.js', null, { only: 'chrome, firefox' }); }); });
{ "content_hash": "60aae3a50cf76e8781698e8176d0b5c7", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 115, "avg_line_length": 43.25, "alnum_prop": 0.5321222130470685, "repo_name": "churkin/testcafe", "id": "0825c814836db4376df3998a29f90a1d09759c03", "size": "6055", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/functional/fixtures/api/es-next/hooks/test.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "19732" }, { "name": "Dockerfile", "bytes": "472" }, { "name": "HTML", "bytes": "186603" }, { "name": "JavaScript", "bytes": "2549826" }, { "name": "Shell", "bytes": "307" }, { "name": "TypeScript", "bytes": "65892" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `GLOB_DOOFFS` constant in crate `libc`."> <meta name="keywords" content="rust, rustlang, rust-lang, GLOB_DOOFFS"> <title>libc::GLOB_DOOFFS - Rust</title> <link rel="stylesheet" type="text/css" href="../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../main.css"> <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <a href='../libc/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='' width='100'></a> <p class='location'><a href='index.html'>libc</a></p><script>window.sidebarCurrent = {name: 'GLOB_DOOFFS', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='index.html'>libc</a>::<wbr><a class='constant' href=''>GLOB_DOOFFS</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-1895' class='srclink' href='../src/libc/unix/notbsd/linux/mod.rs.html#310' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const GLOB_DOOFFS: <a class='type' href='../libc/type.c_int.html' title='libc::c_int'>c_int</a><code> = </code><code>1 << 3</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </aside> <script> window.rootPath = "../"; window.currentCrate = "libc"; window.playgroundUrl = ""; </script> <script src="../jquery.js"></script> <script src="../main.js"></script> <script defer src="../search-index.js"></script> </body> </html>
{ "content_hash": "a80ceff7e5fab69be38321235f538511", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 199, "avg_line_length": 37.252252252252255, "alnum_prop": 0.5136638452237001, "repo_name": "ebfull/ebfull.github.io", "id": "43dbd753491fec224045592125a550d81db36414", "size": "4145", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pcap/libc/constant.GLOB_DOOFFS.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "89807" }, { "name": "HTML", "bytes": "19107011" }, { "name": "JavaScript", "bytes": "448228" } ], "symlink_target": "" }
package net.bull.javamelody; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Desktop; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.io.IOException; import java.io.Serializable; import java.util.List; import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTable; import net.bull.javamelody.internal.model.Action; import net.bull.javamelody.internal.model.RemoteCollector; import net.bull.javamelody.internal.model.SamplingProfiler.SampledMethod; import net.bull.javamelody.internal.web.pdf.PdfOtherReport; import net.bull.javamelody.swing.MButton; import net.bull.javamelody.swing.Utilities; import net.bull.javamelody.swing.table.MDefaultTableCellRenderer; import net.bull.javamelody.swing.table.MDoubleTableCellRenderer; import net.bull.javamelody.swing.table.MTable; import net.bull.javamelody.swing.table.MTableScrollPane; /** * Panel des hotspots du sampling. * @author Emeric Vernat */ class HotspotsPanel extends MelodyPanel { private static final ImageIcon CLEAR_HOTSPOTS_ICON = ImageIconCache .getScaledImageIcon("user-trash.png", 16, 16); private static final long serialVersionUID = 1L; @SuppressWarnings("all") private List<SampledMethod> hotspots; private long totalCount; private MTable<SampledMethod> table; private class MethodTableCellRenderer extends MDefaultTableCellRenderer { private static final long serialVersionUID = 1L; MethodTableCellRenderer() { super(); } @Override public Component getTableCellRendererComponent(JTable jtable, Object value, boolean isSelected, boolean hasFocus, int row, int column) { final String text; if (row == -1) { text = null; } else { final MTable<SampledMethod> myTable = getTable(); final SampledMethod method = myTable.getList() .get(myTable.convertRowIndexToModel(row)); text = "<html>" + method.getClassName() + ".<b>" + method.getMethodName() + "</b>"; } // et texte selon la méthode return super.getTableCellRendererComponent(jtable, text, isSelected, hasFocus, row, column); } } private class CountTableCellRenderer extends MDoubleTableCellRenderer { private static final long serialVersionUID = 1L; CountTableCellRenderer() { super(); } @Override public void setValue(final Object value) { final Long count = (Long) value; super.setValue(100d * count / getTotalCount()); } } HotspotsPanel(RemoteCollector remoteCollector) throws IOException { super(remoteCollector); refresh(); } final void refresh() throws IOException { removeAll(); this.hotspots = getRemoteCollector().collectHotspots(); long total = 0; for (final SampledMethod hotspot : hotspots) { total += hotspot.getCount(); } this.totalCount = total; setName(getString("hotspots")); final JLabel titleLabel = Utilities.createParagraphTitle(getName(), "clock.png"); add(titleLabel, BorderLayout.NORTH); final MTableScrollPane<SampledMethod> scrollPane = createScrollPane(); this.table = scrollPane.getTable(); table.setList(hotspots); add(scrollPane, BorderLayout.CENTER); add(createButtonsPanel(), BorderLayout.SOUTH); } private MTableScrollPane<SampledMethod> createScrollPane() { final MTableScrollPane<SampledMethod> tableScrollPane = new MTableScrollPane<>(); final MTable<SampledMethod> myTable = tableScrollPane.getTable(); myTable.addColumn("methodName", getString("Methode_executee")); myTable.addColumn("count", getString("percent_time")); myTable.setColumnCellRenderer("methodName", new MethodTableCellRenderer()); myTable.setColumnCellRenderer("count", new CountTableCellRenderer()); return tableScrollPane; } private JPanel createButtonsPanel() { final MButton pdfButton = createPdfButton(); pdfButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { actionPdf(); } catch (final IOException ex) { showException(ex); } } }); final MButton xmlJsonButton = createXmlJsonButton((Serializable) hotspots); final MButton clearHotspotsButton = createClearHotspotsButton(); final MButton refreshButton = createRefreshButton(); refreshButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { refresh(); } catch (final IOException ex) { showException(ex); } } }); return Utilities.createButtonsPanel(refreshButton, pdfButton, xmlJsonButton, clearHotspotsButton); } private MButton createClearHotspotsButton() { final MButton clearHotspotsButton = new MButton(getString("clear_hotspots"), CLEAR_HOTSPOTS_ICON); clearHotspotsButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (confirm(getFormattedString("confirm_clear_hotspots"))) { actionClearHotspots(); } } }); return clearHotspotsButton; } final void actionClearHotspots() { try { final String message = getRemoteCollector().executeActionAndCollectData( Action.CLEAR_HOTSPOTS, null, null, null, null, null); showMessage(message); refresh(); } catch (final IOException ex) { showException(ex); } } final void actionPdf() throws IOException { final File tempFile = createTempFileForPdf(); final PdfOtherReport pdfOtherReport = createPdfOtherReport(tempFile); try { pdfOtherReport.writeHotspots(hotspots); } finally { pdfOtherReport.close(); } Desktop.getDesktop().open(tempFile); } MTable<SampledMethod> getTable() { return table; } long getTotalCount() { return totalCount; } }
{ "content_hash": "c618b3780ed3cb1526194ef69b01ac2b", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 87, "avg_line_length": 29.147783251231527, "alnum_prop": 0.7201284434679737, "repo_name": "javamelody/javamelody", "id": "823a67fb471c0cee53d0bc3648dd98f30ab9a266", "size": "6582", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "javamelody-swing/src/main/java/net/bull/javamelody/HotspotsPanel.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "12173" }, { "name": "CSS", "bytes": "14285" }, { "name": "HTML", "bytes": "110910" }, { "name": "Java", "bytes": "2860334" }, { "name": "JavaScript", "bytes": "105190" } ], "symlink_target": "" }
from setuptools import setup, find_packages import glob # Get __version__ exec(open('nbserve/meta.py').read()) requires = ['flask', 'runipy', 'jupyter', 'tornado', 'jinja2', 'pyzmq'] setup( name=__progname__, version=__version__, long_description=__description__, author=__author__, author_email=__author_email__, url=__url__, keywords=__keywords__, packages=find_packages(exclude=['tests*']), data_files=[('nbserve/templates', glob.glob('nbserve/templates/*.tpl'))], include_package_data=True, zip_safe=False, install_requires=requires, entry_points = { 'console_scripts': ['nbserve=nbserve.cli:main'] } )
{ "content_hash": "3a4b03030d2b188455def6c0c0893249", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 77, "avg_line_length": 25.448275862068964, "alnum_prop": 0.5772357723577236, "repo_name": "robchambers/nbserve", "id": "188e486e80ece96f44dbbfbbf675c5e58a27137d", "size": "738", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "setup.py", "mode": "33188", "license": "mit", "language": [ { "name": "Jupyter Notebook", "bytes": "102197" }, { "name": "Python", "bytes": "13697" }, { "name": "Smarty", "bytes": "944" } ], "symlink_target": "" }
class Ticket < ActiveRecord::Base include Interactable attr_accessible :attendee, :event, :kind, :eventbrite_xid belongs_to :attendee belongs_to :event has_many :interactions, as: :interactable validates :eventbrite_xid, presence: true, uniqueness: true validates :attendee_id, presence: true validates :event_id, presence: true, uniqueness: { scope: :attendee_id } validates :kind, presence: true, inclusion: { in: Ticket::Kind::TYPES } before_validation :set_kind after_create :generate_retain_token RETAIN_TOKEN = "retain_token".freeze def set_kind self.kind ||= Ticket::Kind::REGULAR true end private def generate_retain_token has RETAIN_TOKEN, SecureRandom.urlsafe_base64 end end
{ "content_hash": "6672d9acbfbca00388ed6a2810b471bc", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 74, "avg_line_length": 23.870967741935484, "alnum_prop": 0.7216216216216216, "repo_name": "geeksoflondon/hamster", "id": "de495033a01b903f43348fa4910abe76008212d9", "size": "740", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/models/ticket.rb", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1909" }, { "name": "Ruby", "bytes": "74006" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- Generated 17-April-2008 11:26:55.8906250 --> <!-- Generated by MathSBML 2.7.2b --> <!-- Generated using Mathematica Version 5.2 for Microsoft Windows (June 20, 2005) --> <sbml xmlns="http://www.sbml.org/sbml/level2/version3" level="2" version="3"> <model id="case00421" name="case00421" metaid="_case00421"> <!-- <listOfFunctionDefinitions/> --> <!-- <listOfUnitDefinitions/> --> <!-- <listOfCompartmentTypes/> --> <!-- <listOfSpeciesTypes/> --> <listOfCompartments> <compartment id="C" name="C" spatialDimensions="1" units="length" size="1"/> </listOfCompartments> <listOfSpecies> <species id="S1" name="S1" compartment="C" boundaryCondition="false" constant="false" initialAmount="1." substanceUnits="substance" hasOnlySubstanceUnits="false"/> <species id="S2" name="S2" compartment="C" boundaryCondition="false" constant="false" initialAmount="2." substanceUnits="substance" hasOnlySubstanceUnits="false"/> <species id="S3" name="S3" compartment="C" boundaryCondition="false" constant="false" initialAmount="1." substanceUnits="substance" hasOnlySubstanceUnits="false"/> </listOfSpecies> <listOfParameters> <parameter id="k1" name="k1" value="0.075"/> <parameter id="k2" name="k2" value="0.025"/> </listOfParameters> <!-- <listOfInitialAssignments/> --> <!-- <listOfRules/> --> <!-- <listOfConstraints/> --> <listOfReactions> <reaction id="reaction1" name="reaction1" reversible="false" fast="false"> <listOfReactants> <speciesReference species="S1"/> <speciesReference species="S2"/> </listOfReactants> <listOfProducts> <speciesReference species="S3"/> </listOfProducts> <!-- <listOfModifiers/> --> <kineticLaw> <math xmlns="http://www.w3.org/1998/Math/MathML"> <apply> <times/> <ci>C</ci> <ci>k1</ci> <ci>S1</ci> <ci>S2</ci> </apply> </math> <!-- <listOfParameters/> --> </kineticLaw> </reaction> <reaction id="reaction2" name="reaction2" reversible="false" fast="false"> <listOfReactants> <speciesReference species="S3"/> </listOfReactants> <listOfProducts> <speciesReference species="S1"/> <speciesReference species="S2"/> </listOfProducts> <!-- <listOfModifiers/> --> <kineticLaw> <math xmlns="http://www.w3.org/1998/Math/MathML"> <apply> <times/> <ci>C</ci> <ci>k2</ci> <ci>S3</ci> </apply> </math> <!-- <listOfParameters/> --> </kineticLaw> </reaction> </listOfReactions> <listOfEvents> <event id="event1" name="event1"> <trigger> <math xmlns="http://www.w3.org/1998/Math/MathML"> <apply> <lt/> <ci>S1</ci> <cn type="real">0.65</cn> </apply> </math> </trigger> <delay> <math xmlns="http://www.w3.org/1998/Math/MathML"> <cn type="real">7.5</cn> </math> </delay> <listOfEventAssignments> <eventAssignment variable="S2"> <math xmlns="http://www.w3.org/1998/Math/MathML"> <cn type="integer">1</cn> </math> </eventAssignment> </listOfEventAssignments> </event> <event id="event2" name="event2"> <trigger> <math xmlns="http://www.w3.org/1998/Math/MathML"> <apply> <gt/> <ci>S3</ci> <cn type="real">1.2</cn> </apply> </math> </trigger> <delay> <math xmlns="http://www.w3.org/1998/Math/MathML"> <cn type="real">4.5</cn> </math> </delay> <listOfEventAssignments> <eventAssignment variable="S1"> <math xmlns="http://www.w3.org/1998/Math/MathML"> <cn type="integer">1</cn> </math> </eventAssignment> </listOfEventAssignments> </event> </listOfEvents> </model> </sbml>
{ "content_hash": "f8001eb7d64dbea7d5108a2f1363ee0e", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 86, "avg_line_length": 25.41614906832298, "alnum_prop": 0.5625610948191594, "repo_name": "stanleygu/sbmltest2archive", "id": "2791a5da6f76998c2d2bf97bb90c20fc26ce7ca0", "size": "4092", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "sbml-test-cases/cases/semantic/00421/00421-sbml-l2v3.xml", "mode": "33188", "license": "mit", "language": [ { "name": "M", "bytes": "12509" }, { "name": "Mathematica", "bytes": "721776" }, { "name": "Matlab", "bytes": "1729754" }, { "name": "Objective-C", "bytes": "144988" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <title>DOM manipulation with jQuery</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script type="text/javascript" src="jquery_example.js"></script> </head> <body> <h1> Hello. Welcome to the jQuery DOM Manipulation Challenge! </h1> <div class="mascot"> <h1><span class="bold"> My DBC Mascot </span></h1> <img src="dbc_logo.png" /> </div> <h1>Another H1</h1> <h1>One more H1</h1> <img src="poop.jpg" /> </body> </html>
{ "content_hash": "703852f3d5804d64867bb1da39b8c409", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 89, "avg_line_length": 26.15, "alnum_prop": 0.6462715105162524, "repo_name": "ZABarton/phase-0", "id": "b685cab2f2f051e661d6b13e28d7ae278f4b55ea", "size": "523", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "week-9/jquery/jquery-example.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "5393" }, { "name": "HTML", "bytes": "19295" }, { "name": "JavaScript", "bytes": "66103" }, { "name": "Ruby", "bytes": "165147" } ], "symlink_target": "" }
@interface FirstViewController () @end @implementation FirstViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end
{ "content_hash": "a437d368071d8514a1ea8c4b7f19e107", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 76, "avg_line_length": 19.941176470588236, "alnum_prop": 0.7315634218289085, "repo_name": "iqv8/ios.iqv8", "id": "b61a20c3d3dd7519f21bc7d53f4b6c5a5c119fbf", "size": "500", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "yiqu/yiqu/FirstViewController.m", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "4864" } ], "symlink_target": "" }
namespace { // A class used to wait for animations. class TestAPIAnimationObserver : public views::BoundsAnimatorObserver { public: TestAPIAnimationObserver() {} virtual ~TestAPIAnimationObserver() {} // views::BoundsAnimatorObserver overrides: virtual void OnBoundsAnimatorProgressed( views::BoundsAnimator* animator) OVERRIDE {} virtual void OnBoundsAnimatorDone(views::BoundsAnimator* animator) OVERRIDE { MessageLoop::current()->Quit(); } private: DISALLOW_COPY_AND_ASSIGN(TestAPIAnimationObserver); }; } // namespace namespace ash { namespace test { LauncherViewTestAPI::LauncherViewTestAPI(internal::LauncherView* launcher_view) : launcher_view_(launcher_view) { } LauncherViewTestAPI::~LauncherViewTestAPI() { } int LauncherViewTestAPI::GetButtonCount() { return launcher_view_->view_model_->view_size(); } internal::LauncherButton* LauncherViewTestAPI::GetButton(int index) { // App list button is not a LauncherButton. if (launcher_view_->model_->items()[index].type == ash::TYPE_APP_LIST) return NULL; return static_cast<internal::LauncherButton*>( launcher_view_->view_model_->view_at(index)); } int LauncherViewTestAPI::GetLastVisibleIndex() { return launcher_view_->last_visible_index_; } bool LauncherViewTestAPI::IsOverflowButtonVisible() { return launcher_view_->overflow_button_->visible(); } const gfx::Rect& LauncherViewTestAPI::GetBoundsByIndex(int index) { return launcher_view_->view_model_->view_at(index)->bounds(); } const gfx::Rect& LauncherViewTestAPI::GetIdealBoundsByIndex(int index) { return launcher_view_->view_model_->ideal_bounds(index); } void LauncherViewTestAPI::SetAnimationDuration(int duration_ms) { launcher_view_->bounds_animator_->SetAnimationDuration(duration_ms); } void LauncherViewTestAPI::RunMessageLoopUntilAnimationsDone() { if (!launcher_view_->bounds_animator_->IsAnimating()) return; scoped_ptr<TestAPIAnimationObserver> observer(new TestAPIAnimationObserver()); launcher_view_->bounds_animator_->AddObserver(observer.get()); // This nested loop will quit when TestAPIAnimationObserver's // OnBoundsAnimatorDone is called. MessageLoop::current()->Run(); launcher_view_->bounds_animator_->RemoveObserver(observer.get()); } } // namespace test } // namespace ash
{ "content_hash": "b72bb715076ca2a2e3ccfd789b37d499", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 80, "avg_line_length": 28.9125, "alnum_prop": 0.748378728923476, "repo_name": "junmin-zhu/chromium-rivertrail", "id": "8d2885bb33e457543e09fe437244946bf20afd4d", "size": "2807", "binary": false, "copies": "4", "ref": "refs/heads/v8-binding", "path": "ash/test/launcher_view_test_api.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "853" }, { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "1172794" }, { "name": "Awk", "bytes": "9519" }, { "name": "C", "bytes": "75806807" }, { "name": "C#", "bytes": "1132" }, { "name": "C++", "bytes": "145161929" }, { "name": "DOT", "bytes": "1559" }, { "name": "F#", "bytes": "381" }, { "name": "Java", "bytes": "1546515" }, { "name": "JavaScript", "bytes": "18675242" }, { "name": "Logos", "bytes": "4517" }, { "name": "Matlab", "bytes": "5234" }, { "name": "Objective-C", "bytes": "6981387" }, { "name": "PHP", "bytes": "97817" }, { "name": "Perl", "bytes": "926245" }, { "name": "Python", "bytes": "8088373" }, { "name": "R", "bytes": "262" }, { "name": "Ragel in Ruby Host", "bytes": "3239" }, { "name": "Shell", "bytes": "1513486" }, { "name": "Tcl", "bytes": "277077" }, { "name": "XML", "bytes": "13493" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "3a5a2d8b79277a45ca73ee46cff4cbc2", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "48dbfcc29b391ff6ee7ca435d3c13af3cbbe8d82", "size": "197", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Malpighiales/Putranjivaceae/Drypetes/Drypetes thouarsii/ Syn. Henribaillonia thouarsii/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package com.runetooncraft.warpigeon.engine.entity.mob; import com.runetooncraft.warpigeon.engine.entity.Entity; import com.runetooncraft.warpigeon.engine.graphics.AnimatedSprite; import com.runetooncraft.warpigeon.engine.graphics.ScreenEngine2D; import com.runetooncraft.warpigeon.engine.graphics.Sprite; import com.runetooncraft.warpigeon.engine.level.CollisionType; import com.runetooncraft.warpigeon.engine.level.Tile; public abstract class Mob extends Entity { protected Sprite sprite; protected int dir,LastDir = 0; protected boolean moving = false; protected boolean animate = false; protected AnimatedSprite ForwardAnims; protected AnimatedSprite BackwardAnims; protected AnimatedSprite LeftAnims; protected AnimatedSprite RightAnims; protected int AnimationCooldown = 10; private int AnimationCooldownToggle = 0; public int xas,yas; protected boolean Sideways = false; public int layerPresent = 1; public int collisionOffsetX = 0; public int collisionOffsetY = 0; public int xSize,ySize; public boolean forcedir = false; private boolean Collide = true; //Don't worry about this unless the game is a sidescroller public int weight = 0; /** * * @param x * @param y * @param ForwardAnims ForwardAnims[0] Used as Forward Idle Sprite * @param BackwardAnims BackwardAnims[0] used as Backward Idle Sprite * @param LeftAnims LeftAnims[0] used as Left Idle Sprite * @param RightAnims RightAnims[0] used as Right Idle Sprite * @param xSize * @param ySize */ public Mob(int x, int y, Sprite[] ForwardAnims, Sprite[] BackwardAnims, Sprite[] LeftAnims, Sprite[] RightAnims, int xSize, int ySize) { this.x = x << 4; this.y = y << 4; this.ForwardAnims = new AnimatedSprite(ForwardAnims, ForwardAnims[0]); this.BackwardAnims = new AnimatedSprite(BackwardAnims, BackwardAnims[0]); this.LeftAnims = new AnimatedSprite(LeftAnims, LeftAnims[0]); this.RightAnims = new AnimatedSprite(RightAnims, RightAnims[0]); this.xSize = xSize; this.ySize = ySize; sprite = this.ForwardAnims.idleNoCounter(); animate = true; } public Mob(int x, int y, Sprite[] ForwardAnims, Sprite IdleForward, Sprite[] BackwardAnims, Sprite IdleBackward, Sprite[] LeftAnims, Sprite IdleLeft, Sprite[] RightAnims, Sprite IdleRight, int xSize, int ySize) { this.x = x << 4; this.y = y << 4; this.ForwardAnims = new AnimatedSprite(ForwardAnims, IdleForward); this.BackwardAnims = new AnimatedSprite(BackwardAnims,IdleBackward); this.LeftAnims = new AnimatedSprite(LeftAnims, IdleLeft); this.RightAnims = new AnimatedSprite(RightAnims,IdleRight); this.xSize = xSize; this.ySize = ySize; sprite = this.ForwardAnims.idleNoCounter(); animate = true; } public Mob(int x, int y, AnimatedSprite ForwardAnims, AnimatedSprite BackwardAnims, AnimatedSprite LeftAnims, AnimatedSprite RightAnims, int xSize, int ySize) { this.x = x << 4; this.y = y << 4; this.ForwardAnims = ForwardAnims; this.BackwardAnims = BackwardAnims; this.LeftAnims = LeftAnims; this.RightAnims = RightAnims; this.xSize = xSize; this.ySize = ySize; sprite = ForwardAnims.idleNoCounter(); animate = true; } public Mob(int x, int y) { this.x = x << 4; this.y = y << 4; animate = false; } public abstract void update(); public void render(ScreenEngine2D screen) { screen.renderSprite(x - screen.XMid, y - screen.YMid, sprite); } public void render(int x, int y, ScreenEngine2D screen) { screen.renderSprite(x - screen.XMid, y - screen.YMid, sprite); } public void setCollisionOffset(int x, int y) { collisionOffsetX = x; collisionOffsetY = y; } public void moveNoAnimate(int xa, int ya) { if(xa != 0 && ya != 0) { move(xa,0); move(0,ya); return; } xas = xa; yas = ya; LastDir = dir; if (xa < 0) dir = 1; // 0 - north| 1- east | 2 - south | 3 - west | if (xa > 0) dir = 3; if (ya < 0) dir = 2; if (ya > 0) dir = 0; if(!collision(0,ya)) { y += ya; } if(!collision(xa,0)) { x += xa; } } public int absInt(int value) { if (value < 0) return -1; return 1; } public void move(int xa, int ya) { if(!animate) { if(xa != 0 && ya != 0) { moveNoAnimate(xa,0); moveNoAnimate(0,ya); return; } moveNoAnimate(xa,ya); return; } if(xa != 0 && ya != 0) { Collide = true; if (ya > 0 && xa < 0) dir = 4; if (ya > 0 && xa > 0) dir = 5; if (ya < 0 && xa > 0) dir = 6; if (ya < 0 && xa < 0) dir = 7; for(int x = 0; x < Math.abs(xa); x++) { if (!collision(absInt(xa), ya)) { Collide = false; } } for(int y = 0; y < Math.abs(ya); y++) { if (!collision(xa, absInt(ya))) { Collide = false; } } forcedir = true; move(xa,0); move(0,ya); animate(); forcedir = false; return; } xas = xa; yas = ya; LastDir = dir; if(!forcedir) { Collide = true; if (xa < 0) dir = 1; // 0 - north| 1- east | 2 - south | 3 - west | if (xa > 0) dir = 3; if (ya < 0) dir = 2; if (ya > 0) dir = 0; if (ya > 0 && xa < 0) dir = 4; if (ya > 0 && xa > 0) dir = 5; if (ya < 0 && xa > 0) dir = 6; if (ya < 0 && xa < 0) dir = 7; } for(int x = 0; x < Math.abs(xa); x++) { if (!collision(absInt(xa), ya)) { Collide = false; this.x += absInt(xa); } } for(int y = 0; y < Math.abs(ya); y++) { if (!collision(xa, absInt(ya))) { Collide = false; this.y += absInt(ya); } } // System.out.println("Dir: " + dir); if(!forcedir) { animate(); } } private void animate() { if(Collide == false) { if(dir != LastDir) { DirDoesNotEqualLastDir(LastDir); AnimationCooldownToggle = AnimationCooldown; } else { } if(AnimationCooldownToggle == AnimationCooldown) { AnimationCooldownToggle = 0; if(dir == 0 || dir == 4 || dir == 5) { sprite = ForwardAnims.next(); } else if(dir == 1) { sprite = LeftAnims.next(); } else if(dir == 2 || dir == 6 || dir == 7) { sprite = BackwardAnims.next(); } else if(dir == 3) { sprite = RightAnims.next(); } }else{ if(AnimationCooldownToggle < AnimationCooldown) { AnimationCooldownToggle++; } else { AnimationCooldownToggle = 0; } } } } public void DirDoesNotEqualLastDir(int LastDir) { if(dir == 0) { sprite = ForwardAnims.idle(); }else if(dir == 1) { sprite = LeftAnims.idle(); }else if(dir == 2) { sprite = BackwardAnims.idle(); }else if(dir == 3) { sprite = RightAnims.idle(); } } public boolean checksolidBelow(int xa, int ya) { boolean solid = false; for(int i = 0; i < 4; i++) { int xp = ((x + xa) + i % 2 * 12 - 7) / engine.getScreenEngine2D().PixelWidth; int yp = ((y + ya) + i / 2 * 12 + 7) / engine.getScreenEngine2D().PixelHeight; if (level.colltype.equals(CollisionType.BASIC)) { if (level.getTileLayer(level.getLayer(layerPresent), xp, yp).collide(i)) solid = true; } else if(level.colltype.equals(CollisionType.ADVANCED_COLLBOX)) { if (level.getTileLayerCollision(level.getCollisionLayer(layerPresent), xp, yp) != null) { Tile t = level.getTileLayerCollision(level.getCollisionLayer(layerPresent), xp, yp); if (t.collide(i)) { solid = true; } } else { System.out.println("Nulled tile in Collision" + layerPresent + " at " + xp + "," + yp); } } } return solid; } public boolean collision(double xa, double ya) { boolean coll = level.tileCollision((int)(xa+x), (int)(ya+y), xSize, ySize, layerPresent,collisionOffsetX,collisionOffsetY); if(coll) { //System.out.println(this + "is colliding at " + (xa+x) + "," + (ya+y)); } return coll; } public boolean checkCollideBelow() { return checksolidBelow(xas, (yas - engine.getScreenEngine2D().PixelHeight)); } public Sprite getSprite() { return sprite; } }
{ "content_hash": "2e5b4d9a4f51c98b75e4919fb657174f", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 213, "avg_line_length": 29.262589928057555, "alnum_prop": 0.6122925629993854, "repo_name": "WarPigeon/War-Pigeon-Engine", "id": "b32c5bbb92a302128589e5018ab35d67923bb263", "size": "8135", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/runetooncraft/warpigeon/engine/entity/mob/Mob.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "257427" } ], "symlink_target": "" }
/* * Reset styles * ---------------------------------------------------------------------------- */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; } body { line-height: 1; } ol, ul { list-style: none; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; } :focus { outline: 0; } ins { text-decoration: none; } del { text-decoration: line-through; } table { border-collapse: collapse; border-spacing: 0; } a, a:visited, a:hover, a:active { outline: none; } input { background-color: transparent; border: none; } textarea { background-color: transparent; border: none; display: block; resize: none; } /* * Global settings * ---------------------------------------------------------------------------- */ .remove { display: none !important; } .hidden { visibility: hidden; } .postmile-loading { display: none; visibility: hidden; } .clearfix { clear: both; } .blue-button { float: left; border-radius: 7px; background: -moz-linear-gradient(top, #7fbbd8 0%, #328dc1 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#7fbbd8), color-stop(100%,#328dc1)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #7fbbd8 0%,#328dc1 100%); /* Chrome10+,Safari5.1+ */ background: linear-gradient(top, #7fbbd8 0%,#328dc1 100%); /* W3C */ font-weight: bold; font-size: 16px; padding: 4px 10px; color: #ffffff; cursor: default; border: 1px solid #2a7098; margin: 10px 5px; text-shadow: 0 1px 0px rgba(0,0,0,.55); } .blue-button:hover { background: -moz-linear-gradient(top, #78cfe4 0%, #41afd3 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#78cfe4), color-stop(100%,#41afd3)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #78cfe4 0%,#41afd3 100%); /* Chrome10+,Safari5.1+ */ background: linear-gradient(top, #78cfe4 0%,#41afd3 100%); /* W3C */ border: 1px solid #3c9bb7; } .orange .blue-button { background: -moz-linear-gradient(top, #ff6600 0%, #fd8739 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ff6600), color-stop(100%,#fd8739)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #ff6600 0%,#fd8739 100%); /* Chrome10+,Safari5.1+ */ background: linear-gradient(top, #ff6600 0%,#fd8739 100%); /* W3C */ border: 1px solid #d95700; } .orange .blue-button:hover { background: -moz-linear-gradient(top, #ff8e00 0%, #ffb247 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ff8e00), color-stop(100%,#ffb247)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #ff8e00 0%,#ffb247 100%); /* Chrome10+,Safari5.1+ */ background: linear-gradient(top, #ff8e00 0%,#ffb247 100%); /* W3C */ border: 1px solid #ff7a00; } .closex { font-size: 18px; font-weight: bold; float: right; color: #999999; cursor: pointer; position: relative; top: -6px; } .closex a:hover { color: #ff6600 } .right { float: right; } .menu-box { background: -moz-linear-gradient(top, #dddddd 0%, #f5f5f5 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dddddd), color-stop(100%,#f5f5f5)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #dddddd 0%,#f5f5f5 100%); /* Chrome10+,Safari5.1+ */ background: linear-gradient(top, #dddddd 0%,#f5f5f5 100%); /* W3C */ border: 1px solid #dddddd; color: #2a2a2a; font-size: 12px; line-height: 20px; } .above .menu-box { background: -moz-linear-gradient(top, #f5f5f5 0%, #dddddd 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(100%,#dddddd)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #f5f5f5 0%,#dddddd 100%); /* Chrome10+,Safari5.1+ */ background: linear-gradient(top, #f5f5f5 0%,#dddddd 100%); /* W3C */ } .menu-box li:hover { background-color: #b3b3b3; } .menu-box ul.break { border-top: solid 1px #b6b6b6; padding-top: 6px; margin-top: 6px; } body { background-color: #c6e7f1; } #background { position: fixed; width: 100%; height: 100%; background: url('../images/background.png') no-repeat #c6e7f1; background-size: 100% 100%; background-position: right bottom; z-index: -1; } * { font-family: Arial, Verdana, sans-serif; } /* * Project menu * ---------------------------------------------------------------------------- */ .menu .menu-label { position: absolute; z-index: 2; } .menu .menu { position: absolute; z-index: 1; } .menu-hidden { visibility: hidden; display: none; } .menu li { list-style-type: none; } .menu-label, .menuitem-content { text-align: left; white-space: nowrap; display: block; } /* * Top Bar * ---------------------------------------------------------------------------- */ #top-bar { margin: 0 auto; padding: 0; height: 45px; position: relative; } #top-bar a#logo { display: block; width: 79px; height: 49px; background: url('../images/colage.png') 0 0 no-repeat; text-indent: -9999px; overflow: hidden; position: absolute; top: 5px; left: 30px; } #top-bar span.logo { float: left; width: 30%; margin-bottom: 10px; } #top-bar span.logo h1 { margin: 0; padding: 0; } #top-bar a.feedback { color: #6e6e6e; font-size: 12px; text-decoration: underline; float: right; position: relative; top: 6px; right: 20px; } #top-bar a.feedback:hover { color: #ff6600; } /* * Account menu * ---------------------------------------------------------------------------- */ #account .menu-label { right: 10px; top: 40px; color: #3373a0; font-size: 12px; padding-left: 26px; text-decoration: none; } #account .menu-label .account-icon { display: inline-block; width: 20px; height: 18px; background: url('../images/colage.png') 0 -216px no-repeat; } #account .menu-label:hover .account-icon { background: url('../images/colage.png') 0 -198px no-repeat; } #account .menu-label #name { display: inline-block; font-weight: bold; margin: 0 10px; position: relative; top: -3px; } #account .menu-label:hover #name { color: #ff6600; } #account .menu-label .menu-arrow { display: inline-block; width: 20px; height: 14px; background: url('../images/colage.png') 0 -491px no-repeat; } #account .menu-label:hover .menu-arrow { background: url('../images/colage.png') 0 -503px no-repeat; } #account-menu { right: 11px; top: 40px; -moz-box-shadow: 3px 3px 2px #aaaaaa; -webkit-box-shadow: 3px 3px 2px #aaaaaa; box-shadow: 3px 3px 2px #aaaaaa; border-radius: 10px; border-top-right-radius: 0; } #account-menu .icon-tab { float: right; display: block; height: 20px; width: 24px; background-color: #dddddd; } #account-menu .menu-content { clear: right; padding: 10px 0; border-radius: 10px; border-top-right-radius: 0; width: 148px; } #account-menu ul { list-style-type: none; } #account-menu li { cursor: default; padding: 0 10px 0 20px; } #account-menu .enabled { font-weight: bold; } /* * Main white round box * ---------------------------------------------------------------------------- */ #main-box { margin: 20px auto 0 auto; padding: 15px; background: #f8f8f8; border-radius: 10px; box-shadow: 0 0 5px #888888; -moz-box-shadow: 0 0 5px #888888; -webkit-box-shadow: 0 0 5px #888888; } /* * Project details bar * ---------------------------------------------------------------------------- */ #project-details-bar { margin-left: 10px; position: relative; height: 75px; } /* * Projects menu * ---------------------------------------------------------------------------- */ .project-title-box { display: inline-block; position: absolute; width: 410px; height: 28px; border: 2px solid #cccccc; border-right: none; border-radius: 6px; border-top-right-radius: 0; border-bottom-right-radius: 0; background-color: #ffffff; } #project-title { position: relative; top: 5px; padding: 6px 10px; font-weight: bold; color: #3373a0; z-index: 5; width: 390px; } #project-title-input { position: relative; top: 1px; left: 3px; padding: 4px 10px 4px 6px; font-weight: bold; font-size: 16px; color: #3373a0; background: #ffffff; width: 390px; } #project-title-menu-box { display: inline-block; position: absolute; left: 412px; background-color: #ffffff; border: 2px solid #cccccc; border-left: 1px solid #cccccc; border-radius: 6px; border-top-left-radius: 0; border-bottom-left-radius: 0; width: 26px; height: 28px; } #projects-list { position: relative; display: inline-block; } #projects-list .menu-label { top: -61px; left: 413px; display: inline-block; width: 14px; height: 14px; background: url('../images/colage.png') 0 -491px no-repeat; background-color: #ffffff; border: 6px solid #ffffff; border-top: 7px solid #ffffff; border-bottom: 5px solid #ffffff; border-radius: 6px; } #projects-list .menu-label:hover { background: url('../images/colage.png') 0 -503px no-repeat; background-color: #ffffff; } #projects-menu { position: absolute; top: -64px; left: 0px; border-radius: 6px; border: 2px solid #cccccc; background-color: #ffffff; background: -moz-linear-gradient(top, #ffffff 0%, #f0f0f0 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#f0f0f0)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #ffffff 0%,#f0f0f0 100%); /* Chrome10+,Safari5.1+ */ background: linear-gradient(top, #ffffff 0%,#f0f0f0 100%); /* W3C */ width: 437px; -moz-box-shadow: 3px 3px 2px #aaaaaa; -webkit-box-shadow: 3px 3px 2px #aaaaaa; box-shadow: 3px 3px 2px #aaaaaa; } #projects-menu .icon-tab { float: right; display: inline-block; width: 6px; height: 16px; padding: 6px 10px; border-left: 1px solid #cccccc; border-top-right-radius: 6px; } #projects-menu .menu-content { clear: both; padding: 5px 0 0 0; color: #3373a0; font-size: 14px; line-height: 26px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; border-top: 1px solid #cccccc; } #projects-menu .menuitem a { padding: 0 10px; } #projects-menu .menuitem a:hover { background-color: #e3e3e3; cursor: default; } #projects-menu ul.break { border-top: solid 1px #b6b6b6; padding-top: 6px; margin-top: 6px; } #projects-menu #projects a { font-weight: bold; } /* * Project details * ---------------------------------------------------------------------------- */ #project-details { display: inline-block; height: 15px; margin: 50px 0 10px 0; } #project-details input { font-size: 12px; font-weight: bold; color: #6e6e6e; position: relative; top: -3px; cursor: default; padding: 0 0 0 20px; } #project-details .date { background: url('../images/colage.png') 0 -339px no-repeat; width: 80px; height: 15px; } #project-details .date:hover, #project-details .date:focus { background: url('../images/colage.png') 0 -354px no-repeat; } #project-details .time { background: url('../images/colage.png') 0 -369px no-repeat; width: 60px; height: 15px; } #project-details .time:hover { background: url('../images/colage.png') 0 -384px no-repeat; } #project-details .place { background: url('../images/colage.png') 0 -399px no-repeat; width: 320px; height: 15px; margin: 0 20px; } #project-details .place:hover, #project-details .place:focus { background: url('../images/colage.png') 0 -414px no-repeat; } /* * Project participants menu * ---------------------------------------------------------------------------- */ #project-participants { position: relative; } #project-participants .menu-label { display: inline-block; top: -5px; left: 0px; color: #3373a0; font-size: 12px; text-decoration: none; } #project-participants .menu-label .participants-icon { display: inline-block; width: 25px; height: 20px; background: url('../images/colage.png') 0 -234px no-repeat; } #project-participants .menu-label:hover .participants-icon { background: url('../images/colage.png') 0 -124px no-repeat; } #project-participants.multi-participants .menu-label .participants-icon { background: url('../images/colage.png') 0 -599px no-repeat; } #project-participants.multi-participants .menu-label:hover .participants-icon { background: url('../images/colage.png') 0 -619px no-repeat; } #participants-count { display: inline-block; position: relative; top: -11px; left: -122px; color: #ffffff; font-size: 10px; } #participants-count.two-digits { left: -123px; font-size: 8px; } #project-participants .menu-label .name { display: inline-block; color: #3474a1; font-weight: bold; margin: 0 10px 0 5px; position: relative; top: -3px; } #project-participants .menu-label:hover .name { color: #ff6600; } #project-participants .menu-label .menu-arrow { display: inline-block; width: 20px; height: 14px; background: url('../images/colage.png') 0 -491px no-repeat; } #project-participants .menu-label:hover .menu-arrow { background: url('../images/colage.png') 0 -503px no-repeat; } #project-participants-menu { right: -134px; top: -3px; -moz-box-shadow: 3px 3px 2px #aaaaaa; -webkit-box-shadow: 3px 3px 2px #aaaaaa; box-shadow: 3px 3px 2px #aaaaaa; border-radius: 10px; border-top-right-radius: 0; width: 250px; } #project-participants-menu .icon-tab { float: right; display: block; height: 20px; width: 24px; background-color: #dddddd; } #project-participants-menu .menu-content { clear: right; padding: 10px 0; border-radius: 10px; border-top-right-radius: 0; width: 248px; display: inline-block; } #project-participants-menu li { cursor: default; padding: 0 10px 0 20px; } #project-participants-menu li a { overflow: hidden; text-overflow: ellipsis; width: inherit; } #project-participants-menu #participants li:hover { background-color: transparent; } #project-participants-menu #participants li a { padding-left: 20px; background: url('../images/colage.png') 0 -579px no-repeat; } /* * Blue box background for task list * ---------------------------------------------------------------------------- */ #bluebox { clear: both; float: left; margin: 0; background: #71b8d0; border: 4px solid #d4d4d4; border-radius: 10px; } #bluebox-loading { display: none; height: 64px; width: 64px; background: url('../images/tasks-loading.gif') top left no-repeat; text-indent: -99999em; position: relative; } /* * Drag and drop * ---------------------------------------------------------------------------- */ div.yui3-dd-proxy { border: none !important; background-color: transparent !important; cursor: move; } div.yui3-dd-proxy li, div.yui3-dd-proxy li.task, div.yui3-dd-proxy li.suggestion { margin: 0 !important; cursor: move; } div.yui3-dd-proxy span { cursor: move; } /* * Task list area * ---------------------------------------------------------------------------- */ #tasks { list-style-type: none; padding-top: 15px; padding-bottom: 20px; } #tasks li, div.yui3-dd-proxy li.task { position: relative; margin: 7px 20px 0 20px; padding: 2px 2px 2px 40px; display: block; height: 30px; background-color: #ffffff; border: 3px solid transparent; border-radius: 10px; box-shadow: 1px 1px 2px #666666; -moz-box-shadow: 1px 1px 2px #666666; -webkit-box-shadow: 1px 1px 2px #666666; } #tasks li.active, div.yui3-dd-proxy li.task.active { border: 3px solid #666; box-shadow: 0 0 0 #666666; -moz-box-shadow: 0 0 0 #666666; -webkit-box-shadow: 0 0 0 #666666; } #tasks li .titlearea, div.yui3-dd-proxy li.task .titlearea { display: inline-block; width: 100%; } #tasks li .titletext, div.yui3-dd-proxy li.task .titletext { display: inline-block; max-width: 100%; overflow: hidden; } #tasks li a, #tasks li a:visited, #tasks li a:hover, #tasks li a:active, div.yui3-dd-proxy li.task a, div.yui3-dd-proxy li.task a:visited, div.yui3-dd-proxy li.task a:hover, div.yui3-dd-proxy li.task a:active { margin: 0; padding: 0; font-size: 14px; line-height: 30px; font-weight: normal; color: #ff6600; font-style: italic; } #tasks li h3, div.yui3-dd-proxy li.task h3 { margin: 5px 0; padding: 0; font-size: 11px; font-weight: normal; color: #999999; } #tasks li.editing .titletext, div.yui3-dd-proxy li.task.editing .titletext { width: 100%; } #tasks li .edited-by, div.yui3-dd-proxy li.task .edited-by { font-size: 10px; font-weight: normal; color: #7c7c7c; display: none; margin-bottom: 10px; } #tasks li.open .edited-by, div.yui3-dd-proxy li.task.open .edited-by { display: block; } #tasks li .updatedAgo, div.yui3-dd-proxy li.task .updatedAgo { position: absolute; bottom: 10px; padding-left: 5px; font-size: 50%; } #tasks li.long-title .updatedAgo, div.yui3-dd-proxy .updatedAgo { display: none; } #tasks li.updatedago-would-wrap .updatedAgo, #tasks li.editing .updatedAgo, #tasks li.open .updatedAgo { display: none; } #tasks li .updatedAgo:hover, div.yui3-dd-proxy li.task .updatedAgo:hover { display: none; } #tasks li.long-title .ellipses { position: relative; bottom: 8px; } #tasks li.short-title .ellipses, #tasks li.editing .ellipses, #tasks li.open .ellipses, div.yui3-dd-proxy .ellipses { display: none; } #tasks li .iconsright .deleteTask, div.yui3-dd-proxy li.task .iconsright .deleteTask { display: inline-block; height: 10px; width: 10px; margin-left: 5px; margin-right: 2px; background-repeat: no-repeat; position: relative; top: -3px; } #tasks li:hover .iconsright .deleteTask, #tasks li.participantsMenu .iconsright .deleteTask, div.yui3-dd-proxy li.task:hover .iconsright .deleteTask { background: url('../images/colage.png') 0 -471px no-repeat; } #tasks li .iconsright .deleteTask:hover, div.yui3-dd-proxy li.task .iconsright .deleteTask:hover { background: url('../images/colage.png') 0 -481px no-repeat; } #tasks li.open .iconsright .deleteTask, div.yui3-dd-proxy li.task.open .iconsright .deleteTask { background-image: none; } #tasks li.open, div.yui3-dd-proxy li.task.open { height: auto; } #tasks li.completed, div.yui3-dd-proxy li.task.completed { background-color: #e6e6e6; } #tasks li.open .tab, div.yui3-dd-proxy li.task.open .tab { display: block; width: 23px; height: 22px; background: url('../images/colage.png') 0 -555px no-repeat; position: absolute; top: -3px; right: -3px; } #tasks li .check-boxes, div.yui3-dd-proxy li.task .check-boxes { display: block; width: 18px; height: 18px; text-indent: -9999px; overflow: hidden; position: absolute; top: 8px; left: 7px; } #tasks li .in-progress, div.yui3-dd-proxy li.task .in-progress { background: url('../images/colage.png') 0 -67px no-repeat; } #tasks li .completed, div.yui3-dd-proxy li.task .completed { background: url('../images/colage.png') 0 -85px no-repeat; top: 5px; height: 21px; } #tasks li .default, div.yui3-dd-proxy li.task .default { background: url('../images/colage.png') 0 -49px no-repeat; } #tasks li a.addTaskDetail, div.yui3-dd-proxy li.task a.addTaskDetail { display: none; } #tasks li.open a.addTaskDetail, div.yui3-dd-proxy li.task.open a.addTaskDetail { display: inline-block; padding-left: 12px; margin: 0; font-size: 12px; color: #7f7f7f; text-decoration: underline; font-style: normal; position: relative; top: -2px; cursor: pointer; } #tasks li.open a.addTaskDetail:hover, div.yui3-dd-proxy li.task.open a.addTaskDetail:hover { display: inline-block; padding-left: 12px; margin: 0; font-size: 12px; color: #ff6600; text-decoration: underline; font-style: normal; } .iconsright { float: right; margin-top: 5px; margin-right: 10px; } .iconsright img { width: 16px; border: none; visibility: hidden; } .active .iconsright img { visibility: visible; } .participantcountparent { position: relative; } .participantcount { position: absolute; right: 25%; font-size: 0.5em; } .taskicon { width: 12px; } .taskdetails { width: 96%; } #tasks span.notes, div.yui3-dd-proxy span.notes { display: block; width: 16px; height: 17px; position: absolute; top: 8px; left: 36px; } #tasks span.notes.noteEmpty, div.yui3-dd-proxy span.notes.noteEmpty { background: url('../images/colage.png') 0 -254px no-repeat; } #tasks span.notes.noteEmpty:hover, #tasks li.completed span.notes.noteEmpty:hover, div.yui3-dd-proxy span.notes.noteEmpty:hover, div.yui3-dd-proxy li.task.completed span.notes.noteEmpty:hover { background: url('../images/colage.png') 0 -271px no-repeat; } #tasks span.notes.noteContent, div.yui3-dd-proxy span.notes.noteContent { background: url('../images/colage.png') 0 -288px no-repeat; } #tasks span.notes.noteNew:hover, #tasks span.notes.noteContent:hover, div.yui3-dd-proxy span.notes.noteNew:hover, div.yui3-dd-proxy span.notes.noteContent:hover { background: url('../images/colage.png') 0 -305px no-repeat; } #tasks span.notes.noteNew, div.yui3-dd-proxy span.notes.noteNew { background: url('../images/colage.png') 0 -322px no-repeat; } #tasks li span.iamaparticipant, div.yui3-dd-proxy li.task span.iamaparticipant { visibility: hidden; display: inline-block; background: url('../images/colage.png') 0 -106px no-repeat; width: 32px; height: 18px; } #tasks li.me span.iamaparticipant, div.yui3-dd-proxy li.task.me span.iamaparticipant { visibility: visible; display: inline-block; } #tasks li span.participants, div.yui3-dd-proxy li.task span.participants { visibility: hidden; display: inline-block; width: 25px; height: 18px; } #tasks li.single span.participants, #tasks li.multiple span.participants, div.yui3-dd-proxy li.task.single span.participants, div.yui3-dd-proxy li.task.multiple span.participants { visibility: visible; } #tasks li.active span.participants, div.yui3-dd-proxy li.task.active span.participants { visibility: visible; background: url('../images/colage.png') 0 -180px no-repeat; } #tasks li.single span.participants, div.yui3-dd-proxy li.task.single span.participants { background: url('../images/colage.png') 0 -162px no-repeat; } #tasks li.single span.participants:hover, div.yui3-dd-proxy li.task.single span.participants:hover { background: url('../images/colage.png') 0 -198px no-repeat; } #tasks li.multiple span.participants, div.yui3-dd-proxy li.task.multiple span.participants { background:url('../images/colage.png') 0 -144px no-repeat; } #tasks li.multiple span.participants:hover, div.yui3-dd-proxy li.task.multiple span.participants:hover { background: url('../images/colage.png') 0 -126px no-repeat; } #tasks li span.participants:hover, #tasks li.none span.participants:hover, div.yui3-dd-proxy li.task span.participants:hover, div.yui3-dd-proxy li.task.none span.participants:hover { visibility: visible; display: inline-block; background: url('../images/colage.png') 0 -198px no-repeat; } #tasks li .titletext, div.yui3-dd-proxy li.task .titletext { margin: 0 0 0 22px; padding: 0 0 0 0px; font-size: 18px; line-height:30px; font-weight: normal; color: #4c4c4c; } #tasks li.noteNew .titletext, div.yui3-dd-proxy li.task.noteNew .titletext { font-weight: bold; } #tasks li.completed .titletext, div.yui3-dd-proxy li.task.completed .titletext { color: #999999; } #tasks li .titletext .time, div.yui3-dd-proxy li.task .titletext .time { font-size: 11px; color: #999999; } #tasks li .message, div.yui3-dd-proxy li.task .message { width: 96%; border-radius: 10px; margin: 5px 0 0 0; padding: 5px 10px 5px 10px; float: left; display: none; clear: both; } #tasks li .message.odd, div.yui3-dd-proxy li.task .message.odd { background-color: #f3f3f3; } #tasks li .message.even, div.yui3-dd-proxy li.task .message.even { background-color: #d8d8d8; } #tasks li.open .message, div.yui3-dd-proxy li.task.open .message { display: inline; } #tasks li .message p.details-meta, div.yui3-dd-proxy li.task .message p.details-meta { font-size: 10px; font-weight: normal; color: #7c7c7c; margin-top: 2px; margin-bottom: 10px; } #tasks li .taskdetails em, div.yui3-dd-proxy li.task .taskdetails em { font-size: 11px; font-weight: bolder; font-style: normal; } #tasks li .taskdetails, div.yui3-dd-proxy li.task .taskdetails { font-size: 14px; font-style: normal; overflow: hidden; height: auto; resize: none; } #tasks li .message p.details-content, div.yui3-dd-proxy li.task .message p.details-content { font-size: 14px; font-weight: 500; line-height: 16px; color: #4c4c4c; margin-top: 2px; margin-bottom: 2px; } #tasks li .message p.details-content .break, div.yui3-dd-proxy li.task .message p.details-content .break { display: block; height: 10px; } #tasks li .bottom-links, div.yui3-dd-proxy li.task .bottom-links { display: none; clear: both; position: relative; bottom: 0; left: 0; } #tasks li.open .bottom-links, div.yui3-dd-proxy li.task.open .bottom-links { display: block; } #tasks li .bottom-links a, #tasks li .bottom-links a:visited, #tasks li .bottom-links a:active, div.yui3-dd-proxy li.task .bottom-links a, div.yui3-dd-proxy li.task .bottom-links a:visited, div.yui3-dd-proxy li.task .bottom-links a:active { margin: 0; padding: 0 20px 0 0; font-size: 12px; color: #7f7f7f; text-decoration: underline; font-style: normal; cursor: pointer; } #tasks li .bottom-links a:hover, div.yui3-dd-proxy li.task .bottom-links a:hover { color: #ff6600 } #tasks li .bottom-links a.deleteTask, div.yui3-dd-proxy li.task .bottom-links a.deleteTask { float: right; width: auto; display: inline; margin-right: 60px; } #tasks input.tasktitle, div.yui3-dd-proxy input.tasktitle, #tasks textarea.tasktitle, div.yui3-dd-proxy textarea.tasktitle { width: 88%; position: relative; left: -1px; font-size: 18px; } #tasks input.measureText, #tasks textarea.measureText { width: 0; visibility: hidden; position: absolute; font-size: 18px; } #tasks li.noteNew .measureText { font-weight: bold; } div.yui3-dd-proxy .measureText { display: none; } #tasks li.addnewtask input { width: 80%; } #tasks li.noteNew input.tasktitle, div.yui3-dd-proxy li.noteNew input.tasktitle, #tasks li.noteNew textarea.tasktitle, div.yui3-dd-proxy li.noteNew textarea.tasktitle { font-weight: bold; } .taskdetails input, .taskdetails textarea { display: none; width: 92%; } li.open .taskdetails input, li.open .taskdetails textarea { display: inline-block; } input.taskdetails, textarea.taskdetails { margin-top: 20px; border:1px solid #666; padding: 5px; border-radius:5px; } /* * Task list participants menu * ---------------------------------------------------------------------------- */ #task-participants { width: 250px; position: relative; right: -3px; top: -25px; -moz-box-shadow: 3px 3px 2px #aaaaaa; -webkit-box-shadow: 3px 3px 2px #aaaaaa; box-shadow: 3px 3px 2px #aaaaaa; border-radius: 10px; border-top-right-radius: 0; } #task-participants .icon-tab { float: right; display: block; height: 19px; width: 30px; background: url('../images/colage.png') 4px -162px no-repeat; background-color: #dddddd; border: 2px solid #dddddd; border-top: 7px solid #dddddd; } #task-participants.multiple .icon-tab { background: url('../images/colage.png') 4px -144px no-repeat; background-color: #dddddd; } #task-participants .menu-box { clear: both; padding: 3px 0; border-radius: 10px; border-top-right-radius: 0; } #task-participants.above { top: -10px; right: -3px; border-top-right-radius: 10px; } #task-participants.above .icon-tab { border: 2px solid #dddddd; border-bottom: 8px solid #dddddd; border-top: 12px solid #dddddd; position: absolute; bottom: -37px; right: 0; -moz-box-shadow: 3px 3px 2px #aaaaaa; -webkit-box-shadow: 3px 3px 2px #aaaaaa; box-shadow: 3px 3px 2px #aaaaaa; margin-left: 220px; } #task-participants.above .menu-box { clear: both; border-radius: 10px; border-bottom-right-radius: 0; } #task-participants ul { margin: 0; padding-left: 0; list-style-type: none; } #task-participants li { padding: 4px; } #task-participants li label { padding-left: 20px; background: url('../images/colage.png') 5px -577px no-repeat; position: relative; top: -2px; } #task-participants label { padding: 2px 4px; } /* * Side panel (suggestions and tips) * ---------------------------------------------------------------------------- */ #suggestions-loading { display: none; height: 64px; width: 64px; background: url('../images/suggestions-loading.gif') top left no-repeat; text-indent: -99999em; position: relative; top: 30px; left: 80px; } #side-panel { margin: 5px 0 0 20px; width: 225px; float: left; display: inline; } #side-panel h2 { margin: 5px 0; padding: 0; font-size: 18px; font-weight: normal; color: #3474a1; } #side-panel .suggestion-box { margin: 10px 0 0 0; padding: 5px; width: 215px; background: #f3f3f3; border: 4px solid #d4d4d4; border-radius: 10px; } #side-panel #suggestions a { cursor: default; } #side-panel .suggestion-box ul { margin: 0; padding: 0; } #side-panel .suggestion-box ul li, div.yui3-dd-proxy li.suggestion { margin: 10px 0; padding: 5px 5px 5px 40px; display: block; width: 166px; height: 30px; background: url('../images/line.png') 30px 0 repeat-y #e6e6e6; border-radius: 10px; box-shadow: 1px 1px 2px #888; -moz-box-shadow: 1px 1px 2px #888; -webkit-box-shadow: 1px 1px 2px #888; position: relative; } #side-panel .suggestion-box ul li:hover { background: url('../images/line.png') 30px 0 repeat-y #ffffff; } #side-panel .suggestion-box ul li .arrow, div.yui3-dd-proxy li.suggestion .arrow { display: block; width: 14px; height: 14px; text-indent: -9999px; overflow: hidden; position: absolute; top: 12px; left: 9px; background: url('../images/colage.png') 0 -429px no-repeat; } #side-panel .suggestion-box ul li .clickableArrow { display: block; width: 30px; height: 40px; position: absolute; top: 0px; left: 0px; background: transparent; cursor: pointer; } #side-panel .suggestion-box ul li a.add, div.yui3-dd-proxy li.suggestion a.add { font-size: 15px; display: block; width: 150px; height: 30px; line-height: 30px; float: left; text-decoration: none; } #side-panel .suggestion-box ul li a.removeSuggestion, #side-panel .suggestion-box ul li a.removeSuggestion:visited, div.yui3-dd-proxy li.suggestion a.removeSuggestion, div.yui3-dd-proxy li.suggestion a.removeSuggestion:visited { display: block; width: 14px; height: 14px; line-height: 30px; background: url('../images/colage.png') 0 -443px no-repeat; text-indent: -9999px; overflow: hidden; float: left; position: relative; top: 9px; } #side-panel .suggestion-box ul li a.removeSuggestion:hover { background: url('../images/colage.png') 0 -457px no-repeat; } #side-panel .suggestion-box p { margin: 5px 0; padding: 0; font-size: 12px; line-height: 14px; } #side-panel .suggestion-box p.right { float: right; width: auto; display: inline; margin-right: 10px; } #side-panel div.tips a, #side-panel div.tips a:visited { margin: 0; padding: 0; font-size: 12px; text-decoration: underline; } #side-panel div.tips a:hover, #side-panel div.tips a:active { color: #ff6600 } #side-panel div.tips div.nav a, #side-panel div.tips div.nav a:visited { margin: 0 0 0 5px; padding: 0; font-size: 12px; text-decoration: underline; } #side-panel div.tips div.nav a:hover, #side-panel div.tips div.nav a:active { color: #ff6600 } #side-panel div.tips p.show-me { display: none; } #side-panel div.tips p.show-me-showable { display: block; } .tips.hr { padding-top: 3px; } .tips { color:#4c4c4c; margin-left: 5px; margin-top: 10px; } .tips .nav { float: right; margin: 5px; cursor: pointer; } #showtips { display: none; } /* * Tips highlighting * ---------------------------------------------------------------------------- */ .pointTo { background: transparent; border: 5px solid #ff6600; border-radius: 10px; } /* * Footer * ---------------------------------------------------------------------------- */ #footer { position: fixed; bottom: 0; width: 100%; height: 80px; } #footer-background { position: relative; top: -70px; width: 100%; height: 100%; background: url('../images/mountains.png') bottom center no-repeat; z-index: -1; } #footer-bar { padding-top: 69px; margin-left: auto; margin-right: auto; width: 875px; } #footer ul.links-left li { float: left; display: block; } #footer ul.links-left li a { margin: 0 10px; font-size: 12px; color: #8d8d8d; font-weight: bold; text-decoration: none; float: left; } #footer ul.links-left li a.facebook-footer { margin: 0 5px; width: 18px; height: 17px; background: url('../images/colage.png') 0 -538px no-repeat; text-indent: -9999px; position: relative; top: -2px; } #footer ul.links-left li a.twitter-footer { width: 18px; height: 18px; background: url('../images/colage.png') 0 -520px no-repeat; text-indent: -9999px; position: relative; top: -2px; } #footer .copyright { text-align: right; margin-left: 300px; font-size: 10px; color: #8d8d8d; } /* * System Status Bar (top center) * ---------------------------------------------------------------------------- */ #status { z-index: 10000; position: fixed; top: 0; left: 0; width: 100%; text-align:center; -webkit-transition: all 100ms ease-in-out; -moz-transition: all; -moz-transition-duration: 100ms; -moz-transition-timing-function: ease-in-out; } #status.show { opacity: 0.5; } #status.hide { opacity: 0; height: 0; } #status.remove { display: none; } #status .middleStatus { display: inline-block; background-color: #ec5320; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; width: 40%; padding: 5px; } #status h1 { opacity: 1.0 color: #000000; } /* * System Confirmation Dialog (center center) * ---------------------------------------------------------------------------- */ .confirm { position: fixed; top: 0; left: 0; width: 100%; height: 100%; text-align: center; -webkit-transition: opacity 100ms ease-in-out; -moz-transition: opacity; -moz-transition-duration: 100ms; -moz-transition-timing-function: ease-in-out; } .confirm .dialog { display: inline-block; background: #f3f3f3; border: 5px solid #cbcbcb; padding: 10px; border-radius: 10px; width: 260px; } .confirm .title { font-size: 18px; line-height: 1.3em; font-weight: bold; color: #777777; margin-left: 5px; text-align: left; } .confirm .text { background: #e6e6e6; color: #5c5c5c; padding: 20px; border-radius: 10px; margin: 10px 0; font-weight: normal; font-size: 16px; line-height: 1.3em; width: auto; text-align: left; } .confirm.underlay { z-index: 9999; background-color: #000000; } .confirm.underlay.hide { left: -9999px; opacity: 0; } .confirm.underlay.show { left: 0; opacity: 0.35; } .confirm.overlay { z-index: 10000; } .confirm.overlay.hide { left: -9999px; opacity: 0; } .confirm.overlay.show { left: 0; opacity: 1.0; } .confirm div { width: 100%; height: 33%; } .confirm #confirm-cancel.hide { display: none; } .confirm .dialog.orange { border-color: #ded6cc; } /* * Task title tooltip * ---------------------------------------------------------------------------- */ .yui3-tooltip { position: absolute; } .yui3-tooltip-hidden { visibility: hidden; } .yui3-tooltip-content { background-color: #eeeeee; font-size: 18px; line-height:30px; font-weight: normal; color: #4c4c4c; position: relative; border-radius: 10px; border-bottom-left-radius: 0; border-top-left-radius: 0; } /* * Common participants list (invite and manage) * ---------------------------------------------------------------------------- */ .participant-overlay-header { color: #7b7b7b; font-weight: bold; font-size:1.1em; padding-bottom: 10px; } .invite-participants-list, .participants-list { padding-left: 0; list-style-type: none; } .participants-row { padding: 0; list-style-type: none; } ul.participants-list span.participant { color: #000000; } .invite-participants-list li { padding: 5px 0 0 5px; color: #3373a0; } .invite-participants-list li.participants-pane .participants-list { padding: 0; } .participant .person { display: inline-block; background: url('../images/colage.png') 0 -216px no-repeat; border: none; border-right: 1px solid grey; width: 21px; height: 18px; margin: 0 4px -6px 0; padding-right: 5px; position: relative; top: -5px; right: 10px; } span.participant { float: left; padding: 10px; margin: 0 18px 10px 0; display: inline-block; width: 180px; border-radius: 10px; -moz-box-shadow: 2px 2px 0 #aaaaaa; -webkit-box-shadow: 2px 2px 0 #aaaaaa; box-shadow: 2px 2px 0 #aaaaaa; border: 2px solid #ffffff; background-color: #ffffff; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; cursor: default; } span.participant:hover { background-color: #d3d3d3; border-radius: 10px; -moz-box-shadow: 2px 2px 0 #aaaaaa; -webkit-box-shadow: 2px 2px 0 #aaaaaa; box-shadow: 1px 1px 0 #aaaaaa; border: 2px solid #a9a9a9; } .invite-participants-list { background: #e6e6e6; padding: 3px; border: 2px solid #e6e6e6; border-radius: 10px; margin-bottom: 10px; } /* * Participants Invite * ---------------------------------------------------------------------------- */ #invite-overlay { background-color: #f5f5f5; border:5px solid #cbcbcb; padding: 10px; width: 500px; border-radius: 10px; position: relative; z-index: 6; } #invite-overlay .invite-label { font-size: 75%; padding-left: 5px; color: #a9a9a9; } #invite-overlay input, #invite-overlay textarea { border:1px solid grey; width: 85%; height: 40px; resize: none; margin-left: 5%; } #invite-message { height: 60px; } #invite-overlay span.participant.selected { background-color: #ffffff; border-radius: 10px; -moz-box-shadow: 2px 2px 0 #aaaaaa; -webkit-box-shadow: 2px 2px 0 #aaaaaa; box-shadow: 2px 2px 0 #aaaaaa; border: 2px solid #3373a0; } #invite-overlay ul.participants-list { width: 480px; height: 155px; overflow-y: auto; overflow-x: hidden; } #invite-emails, #invite-message { margin:10px 0; border-radius: 10px; -moz-box-shadow: -1px -1px 0 #aaaaaa; -webkit-box-shadow: -1px -1px 0 #aaaaaa; box-shadow: -1px -1px 0 #aaaaaa; border:none; padding: 5px 10px; } #invite-overlay span.participant.selected { border-color: #3373a0; background-color: #d3d3d3; } /* * Manage participants dialog * ---------------------------------------------------------------------------- */ #manage-overlay { background-color: #f5f5f5; border:5px solid #cbcbcb; padding: 10px; width: 260px; border-radius: 10px; position: relative; z-index: 6; } #manage-overlay span.participant.selected { border-color: #b22222; background-color: #d3d3d3; } #manage-overlay span.person .selected { background-color: #ffffff; border-radius: 10px; -moz-box-shadow: 2px 2px 0 #aaaaaa; -webkit-box-shadow: 2px 2px 0 #aaaaaa; box-shadow: 2px 2px 0 #aaaaaa; border: 2px solid #FF464D; } #manage-overlay ul.invite-participants-list { width: 250px; height: 280px; overflow-y: auto; overflow-x: hidden; } /* * Tour guide * ---------------------------------------------------------------------------- */ #tour-guide-alignment { position: absolute; top: 20px; margin-left: -15px; margin-top: 16px; z-index: 10000; } #tour-guide-alignment.hide { display: none; } #tour-guide-alignment .hide { visibility: hidden; } #tour-guide { position: relative; border: 5px solid #ff6600; border-radius: 10px; top: 32px; left: 10px; height: 0; width: 0; } #tour-narative .dialog { width: 350px; -moz-box-shadow: 3px 3px 2px #aaaaaa; -webkit-box-shadow: 3px 3px 2px #aaaaaa; box-shadow: 3px 3px 2px #aaaaaa; } #tour-narative .text { height: 180px; padding-top: 10px; } #tour-narative .image { display: block; width: 200px; height: 140px; margin: 10px auto; } #tour-narative .image.assign { background: url('../images/tour-assign.png') 0 0 no-repeat; } #tour-narative .image.assigned { background: url('../images/tour-assigned.png') 0 0 no-repeat; } #tour-narative .image.comments { background: url('../images/tour-comments.png') 0 0 no-repeat; } #tour-narative .image.checkbox { background: url('../images/tour-checkbox.png') 0 0 no-repeat; } #tour-narative .mini { font-size: 12px; width: 70%; text-align: center; position: relative; top: 92px; left: 10px; } #tour-narative .counter { text-align: right; position: relative; top: -35px; left: 125px; font-size: 12px; font-weight: bold; color: #9a9a9a; } #tour-end { position: relative; left: 70px; } /* * Misc * ---------------------------------------------------------------------------- */ .diminishedtextitem { color: grey !important; } .disabledtextitem { color: #d3d3d3 !important; } .addnewitem { /* width: 100%; */ margin:0; padding:0 0 0 0; line-height:30px; font-weight:500 !important; font-size: 16px !important; color: #F60 !important; font-style: italic; } /* * Calendar * ---------------------------------------------------------------------------- */ .calendar { background: white; border: 1px solid #82c2d5; border-radius: 5px; font-size: 12px; font-family: Tahoma; -moz-box-shadow: 3px 3px 5px #aaaaaa; -webkit-box-shadow: 3px 3px 5px #aaaaaa; box-shadow: 3px 3px 5px #aaaaaa; float: left; position: relative; } .calendar a, .calendar a:hover { cursor: default; text-decoration: none; } .calendar .header { width: 190px; height: 24px; background-color: #82c2d5; position: relative; } .calendar .header .title { color: #ffffff; position: relative; margin-left: auto; margin-right: auto; width: 90px; top: 5px; text-align: center; font-size: 11px; font-weight: bold; } .calendar .header a { position: absolute; top: 5px; font-size: 14px; font-weight: bold; color: #ffffff; } .calendar .header .prev { left: 3px; } .calendar .header .next { right: 3px; } .calendar .days { width: 190px; } .calendar .days .weekdays { height: 19px; background-color: #a1d7e7; padding-left: 2px; width: 189px; font-size: 10px; } .calendar .days .weekdays span { float: left; width: 26px; text-align: center; line-height: 19px; } .calendar .days .row { background-color: #ffffff; padding-left: 3px; width: 189px; } .calendar .days .row a { color: #6c6c6c; float: left; width: 26px; text-align: center; line-height: 22px; border-radius: 3px; } .calendar .days .row a:hover { background-color: #cccccc; } .calendar .days .row .hide { visibility: hidden; } .calendar .days .row .today { color: #ff6600; font-weight: bolder; } .calendar .days .row .selected { background-color: #ffbd7a; }
{ "content_hash": "beb083400eb68df0dbc4dee54602f906", "timestamp": "", "source": "github", "line_count": 2274, "max_line_length": 133, "avg_line_length": 19.38258575197889, "alnum_prop": 0.6422542880479173, "repo_name": "hueniverse/postmile-web", "id": "12e1e9f7e3807d5f9c7309720bcd8571740b4893", "size": "44076", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/static/view/css/styles.css", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "69799" }, { "name": "JavaScript", "bytes": "389122" }, { "name": "Shell", "bytes": "206" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Nane.Views; using Xamarin.Forms; namespace Nane { public class App : Application { public App() { // The root page of your application MainPage = new Nane.Views.MainPage(); } protected override void OnStart() { // Handle when your app starts } protected override void OnSleep() { // Handle when your app sleeps } protected override void OnResume() { // Handle when your app resumes } } }
{ "content_hash": "271e3f39383742813e9f6289db01446e", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 48, "avg_line_length": 19.515151515151516, "alnum_prop": 0.5574534161490683, "repo_name": "SezginEge/Nane", "id": "725a6d32404fb089793e8337613989e7b3058a56", "size": "646", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Nane/Nane/App.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "102" }, { "name": "C#", "bytes": "187593" } ], "symlink_target": "" }
<?php require_once 'Twitter.php'; require_once 'mongoQueue.php'; require_once 'config.php'; $logFile = "crawler.log"; echo "You can kill this process ONLY when this is sleeping.\n\n"; // DBへ接続してコレクションを指定 $mongo = new Mongo(); $db = $mongo->selectDB(DB_NAME); $dataCol = $db->selectCollection(DATA_COLLECTION_NAME); //キューの用意 $queue = new mongoQueue(DB_NAME, QUEUE_COLLECTION_NAME); //twitterの認証 $twitter = new Twitter(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET); //キューが空の時はじめのユーザのidを取得してenqueue if($queue->is_empty() == true){ $userId = $twitter->getUserIdFromScreenName(INITIAL_SCREEN_NAME); $queue->enqueue(array("user_id" => $userId)); file_put_contents($logFile, '----crawlering starts from @'.INITIAL_SCREEN_NAME.'----'."\n\n"); } $i = $dataCol->count(); //キューを使ってfriendsを幅優先で取得 for (; $i < MAX; $i++) { // API制限かかっているかの確認。かかっていたら5分待つ $limitation = $twitter->getFrendIdsAPILimit(); while($limitation == 0){ echo "sleeping...", "\n"; sleep(300); $limitation = $twitter->getFrendIdsAPILimit(); } // キューから取り出してきて、鍵アカなら取得できないのでとばす $userId = $queue->dequeue()["user_id"]; $screenName = $twitter->getScreenNameFromUserId($userId); if($twitter->isProtected($userId)) { $i--; echo $msg = "スキップ:\tid = {$userId},\tscreen_name = {$screenName}\n"; file_put_contents($logFile, $msg, FILE_APPEND); continue; } echo "ターゲット({$i}):\tid = {$userId},\tscreen_name = {$screenName}..."; //各種データを取得、オブジェクトのメンバに代入 $data = new stdClass(); $data->user_id = $userId; $data->screen_name = $screenName; $data->friends = $twitter->getFriendIds($userId); $dataCol->insert($data); // まだ取得してないかつキューにも入っていないアカウントのidのみキューに入れる foreach ($data->friends as $key => $waitingUserId) { $param = array('user_id' => $waitingUserId); $collected = $dataCol->count($param) == 0 ? false : true; $enqueued = $queue->isEnqueued($param); if(!$collected && !$enqueued){ $queue->enqueue(array("user_id" => $waitingUserId)); } } echo $msg = "完了\n"; file_put_contents($logFile, $msg, FILE_APPEND); $data = null; sleep(1); }
{ "content_hash": "052da3270f560874d522818f0a18651f", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 95, "avg_line_length": 27.56, "alnum_prop": 0.6690856313497823, "repo_name": "tcyyky/twitter_crawler", "id": "4d9e75d0e7d3442b9e76b2b78a130efb22b363f6", "size": "2423", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "crawler.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "5483" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; namespace _05.Only_Letters { class OnlyLetters { static void Main() { string input = Console.ReadLine(); var matches = Regex.Matches(input, @"(?<digits>\d+)(?<letter>[A-Za-z]{0,1})"); foreach (Match match in matches) { var digits = match.Groups["digits"].Value; var letter = match.Groups["letter"].Value; if (letter.Length > 0) { input = Regex.Replace(input, digits, letter); } } Console.WriteLine(input); } } }
{ "content_hash": "41ac6b2eb6b28dd6addc40967b907cd7", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 90, "avg_line_length": 24.193548387096776, "alnum_prop": 0.5133333333333333, "repo_name": "Shtereva/Fundamentals-with-CSharp", "id": "b9c33ba9562e0eff7876a9ffcf29927a65f93147", "size": "752", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Regex/05. Only Letters/OnlyLetters.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "201" }, { "name": "C#", "bytes": "1263790" }, { "name": "CSS", "bytes": "1026" }, { "name": "HTML", "bytes": "10254" }, { "name": "JavaScript", "bytes": "42472" }, { "name": "PowerShell", "bytes": "264844" } ], "symlink_target": "" }
import expect = require('expect.js'); import { CommandRegistry } from '@phosphor/commands'; import { h, VirtualNode, VirtualDOM } from '@phosphor/virtualdom'; import { simulate } from 'simulate-event'; import { CommandLinker } from '@jupyterlab/apputils'; describe('@jupyterlab/apputils', () => { describe('CommandLinker', () => { describe('#constructor()', () => { it('should create a command linker', () => { let linker = new CommandLinker({ commands: new CommandRegistry() }); expect(linker).to.be.a(CommandLinker); linker.dispose(); }); }); describe('#isDisposed', () => { it('should test whether a command linker has been disposed', () => { let linker = new CommandLinker({ commands: new CommandRegistry() }); expect(linker.isDisposed).to.be(false); linker.dispose(); expect(linker.isDisposed).to.be(true); }); }); describe('#connectNode()', () => { it('should connect a node to a command', () => { let called = false; let command = 'commandlinker:connect-node'; let commands =new CommandRegistry(); let linker = new CommandLinker({ commands }); let node = document.createElement('div'); let disposable = commands.addCommand(command, { execute: () => { called = true; } }); document.body.appendChild(node); linker.connectNode(node, command, null); expect(called).to.be(false); simulate(node, 'click'); expect(called).to.be(true); document.body.removeChild(node); linker.dispose(); disposable.dispose(); }); }); describe('#disconnectNode()', () => { it('should disconnect a node from a command', () => { let called = false; let command = 'commandlinker:disconnect-node'; let commands =new CommandRegistry(); let linker = new CommandLinker({ commands }); let node = document.createElement('div'); let disposable = commands.addCommand(command, { execute: () => { called = true; } }); document.body.appendChild(node); linker.connectNode(node, command, null); // Make sure connection is working. expect(called).to.be(false); simulate(node, 'click'); expect(called).to.be(true); // Reset flag. called = false; // Make sure disconnection is working. linker.disconnectNode(node); expect(called).to.be(false); simulate(node, 'click'); expect(called).to.be(false); document.body.removeChild(node); linker.dispose(); disposable.dispose(); }); }); describe('#dispose()', () => { it('should dispose the resources held by the linker', () => { let linker = new CommandLinker({ commands: new CommandRegistry() }); expect(linker.isDisposed).to.be(false); linker.dispose(); expect(linker.isDisposed).to.be(true); }); }); describe('#populateVNodeDataset()', () => { it('should connect a node to a command', () => { let called = false; let command = 'commandlinker:connect-node'; let commands =new CommandRegistry(); let linker = new CommandLinker({ commands }); let node: HTMLElement; let vnode: VirtualNode; let disposable = commands.addCommand(command, { execute: () => { called = true; } }); vnode = h.div({ dataset: linker.populateVNodeDataset(command, null) }); node = VirtualDOM.realize(vnode); document.body.appendChild(node); expect(called).to.be(false); simulate(node, 'click'); expect(called).to.be(true); document.body.removeChild(node); linker.dispose(); disposable.dispose(); }); }); }); });
{ "content_hash": "9a53793e9763e74b8ce2df40a4983c4e", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 79, "avg_line_length": 26.47972972972973, "alnum_prop": 0.571829548354172, "repo_name": "eskirk/jupyterlab", "id": "295b7128fea027bd9cb3cdd18126606edf9b7246", "size": "4023", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "test/src/apputils/commandlinker.spec.ts", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "7475" }, { "name": "CSS", "bytes": "112150" }, { "name": "HTML", "bytes": "1497" }, { "name": "JavaScript", "bytes": "14700" }, { "name": "Makefile", "bytes": "7654" }, { "name": "Python", "bytes": "58709" }, { "name": "Shell", "bytes": "4729" }, { "name": "TypeScript", "bytes": "2173634" } ], "symlink_target": "" }
package org.jgroups.raft.client; import org.jgroups.protocols.raft.CLIENT; import org.jgroups.util.Util; import java.net.InetAddress; import java.util.concurrent.CompletableFuture; /** * Client which accesses the {@link org.jgroups.protocols.raft.CLIENT} protocol through a socket. Currently used to * submit addServer and remove Server commands * @author Bela Ban * @since 0.2 */ public class Client { protected static void start(InetAddress dest, int port, String add_server, String remove_server) throws Throwable { try(ClientStub stub=new ClientStub(dest, port).start()) { CLIENT.RequestType type=add_server != null? CLIENT.RequestType.add_server : CLIENT.RequestType.remove_server; byte[] buf=Util.stringToBytes(add_server != null? add_server : remove_server); CompletableFuture<byte[]> cf=stub.setAsync(type, buf, 0, buf.length); cf.whenComplete((rsp, ex) -> { if(ex != null) System.err.printf("-- exception: %s\n", ex); else { try { Object response=Util.objectFromByteBuffer(rsp); if(response instanceof Throwable) throw (Throwable)response; System.out.printf("-- response: %s\n", response); } catch(Throwable t) { t.printStackTrace(); } } }); } catch(Exception ex) { ex.printStackTrace(); } } public static void main(String[] args) throws Throwable { InetAddress dest=InetAddress.getLocalHost(); int port=1965; String add_server=null, remove_server=null; for(int i=0; i < args.length; i++) { if(args[i].equals("-dest")) { dest=InetAddress.getByName(args[++i]); continue; } if(args[i].equals("-port")) { port=Integer.parseInt(args[++i]); continue; } if(args[i].equals("-add")) { add_server=args[++i]; continue; } if(args[i].equals("-remove")) { remove_server=args[++i]; continue; } help(); } if(add_server == null && remove_server == null) { System.err.println("no server to be added or removed was given"); return; } if(add_server != null && remove_server != null) { System.err.println("only one server can be added or removed at a time"); return; } Client.start(dest, port, add_server, remove_server); } protected static void help() { System.out.println("Client [-dest <destination address>] [-port <port>] (-add <server> | -remove <server>)"); } }
{ "content_hash": "2a6a7f92e2b7d564f4cb953ccfa9e533", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 121, "avg_line_length": 35.63855421686747, "alnum_prop": 0.5267072346179851, "repo_name": "belaban/jgroups-raft", "id": "224739d0e79523333cfd1570460b3d09eadd4301", "size": "2958", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/org/jgroups/raft/client/Client.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "1722" }, { "name": "Java", "bytes": "622364" }, { "name": "Shell", "bytes": "5007" } ], "symlink_target": "" }
"use strict"; /** Information about an XLSX file * @author TeamworkGuy2 * @since 2016-5-27 * @see OpenXmlIo.XlsxFileType */ var XlsxFileTypeImpl = /** @class */ (function () { function XlsxFileTypeImpl(schemaUrl, contentType, schemaTarget, xlsxFilePath, pathIsTemplate, pathTemplateToken) { this.schemaUrl = schemaUrl; this.contentType = contentType; this.schemaTarget = schemaTarget; this.xlsxFilePath = xlsxFilePath; this.pathIsTemplate = pathIsTemplate; this.pathTemplateToken = pathTemplateToken; } XlsxFileTypeImpl.getXmlFilePath = function (sheetNum, info) { // TODO the path template token may not be a sheet number, could be a resource identifier (i.e. an image or item prop number) return (info.pathIsTemplate ? info.xlsxFilePath.split(info.pathTemplateToken).join(sheetNum) : info.xlsxFilePath); }; return XlsxFileTypeImpl; }()); module.exports = XlsxFileTypeImpl;
{ "content_hash": "da7be40bd18fb9616eefde2e6926d07c", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 133, "avg_line_length": 43.77272727272727, "alnum_prop": 0.7102803738317757, "repo_name": "TeamworkGuy2/xlsx-spec-utils", "id": "735ceb4764f621b6a4cd862e692858b94afa2bc0", "size": "963", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "files/XlsxFileType.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "74247" }, { "name": "TypeScript", "bytes": "78347" } ], "symlink_target": "" }
""" Url Length Spider Middleware See documentation in docs/topics/spider-middleware.rst """ import logging from scrapy.http import Request from scrapy.exceptions import NotConfigured logger = logging.getLogger(__name__) class UrlLengthMiddleware: def __init__(self, maxlength): self.maxlength = maxlength @classmethod def from_settings(cls, settings): maxlength = settings.getint('URLLENGTH_LIMIT') if not maxlength: raise NotConfigured return cls(maxlength) def process_spider_output(self, response, result, spider): def _filter(request): if isinstance(request, Request) and len(request.url) > self.maxlength: logger.debug("Ignoring link (url length > %(maxlength)d): %(url)s ", {'maxlength': self.maxlength, 'url': request.url}, extra={'spider': spider}) return False else: return True return (r for r in result or () if _filter(r))
{ "content_hash": "15bd7dd928d79fa681a885fe57df953d", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 84, "avg_line_length": 28.405405405405407, "alnum_prop": 0.6060894386298763, "repo_name": "dangra/scrapy", "id": "5be1f80cb05f181421a11e16291b4b3f97c80ec8", "size": "1051", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "scrapy/spidermiddlewares/urllength.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "HTML", "bytes": "2790" }, { "name": "Python", "bytes": "1670720" }, { "name": "Roff", "bytes": "2010" }, { "name": "Shell", "bytes": "259" } ], "symlink_target": "" }
package ch.harmen.iot.tinkerforge; import com.tinkerforge.IPConnection; interface ComponentFactory { Object createComponent(final String uid, final IPConnection ipConnection); }
{ "content_hash": "c53574cce94d58ff6de27441932d384f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 54, "avg_line_length": 21.818181818181817, "alnum_prop": 0.625, "repo_name": "harmenweber/space-project", "id": "59626136ff907c0f0aac7a7dc05771e3ef6bdd5a", "size": "240", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/ch/harmen/iot/tinkerforge/ComponentFactory.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "239843" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="Musician & technologist; alumni of Cornell University and Fullstack Academy. Previously @ PwC Advisory. Currently a student in the Berkeley Haas Full-Time MBA Program."> <meta name="author" content="Dean Guo"> <title>Contact</title> <!-- Main CSS --> <link href="css/main.css" rel="stylesheet"> <link href="css/contact.css" rel="stylesheet"> <!-- FA Icons --> <script src="https://use.fontawesome.com/665f8d3210.js"></script> <!-- Google Fonts --> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700|Open+Sans" rel="stylesheet"> <!-- Favicon --> <link rel="shortcut icon" href="img/musicbars.ico" type="image/x-icon"/> <!-- Google Analytics --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-73120949-1', 'auto'); ga('send', 'pageview'); </script> </head> <body> <section id="hero"> <nav> <div id="nav"> <a href="./"> <i class="fa fa-arrow-left" aria-hidden="true"></i> Back </a> <div class="nav-group"> <a href="./index.html#projects">Projects</a> <a href="./media.html">Media</a> <a href="./contact.html">Contact</a> </div> </div> </nav> <div id="herotext"> <div class="flex"> <p>Contact me at [email protected] or reach out via one of the links below. </p> <p> I'd love to hear from you! </p> <p> &nbsp; </p> <p> &nbsp; </p> <div class="flex"> <a href="https://www.linkedin.com/in/deanguo"><i class="fa fa-linkedin-square fa-fw"></i> LinkedIn </a> <a href="https://github.com/fourestfire"><i class="fa fa-github-square fa-fw"></i> GitHub </a> <a href="https://www.facebook.com/dean.guo"><i class="fa fa-facebook-square fa-fw"></i> Facebook </a> <a href="http://soundcloud.com/fourestfire"><i class="fa fa-soundcloud fa-fw"></i> SoundCloud </a> </div> </div> </div> </section> <script src="js/three.js"></script> <script> var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 ); // field of view, aspect ratio, near and far clipping panes var renderer = new THREE.WebGLRenderer(); renderer.setSize( window.innerWidth, window.innerHeight ); document.body.appendChild( renderer.domElement ); var geometry = new THREE.BoxGeometry( 2, 2, 1 ); // x, y, z var material = new THREE.MeshLambertMaterial ( { color: 'pink' } ); var cube = new THREE.Mesh( geometry, material ); var cube2 = new THREE.Mesh( geometry, material ) cube2.position.y = 9 cube.position.y = -2 scene.add( cube ); camera.position.z = 9; // move camera away from origin so they're not on top of each other // create a point light const pointLight = new THREE.PointLight('white', 1); // color, intensity, distance, decay // set its position pointLight.position.x = 10; pointLight.position.y = 50; pointLight.position.z = 130; // add to the scene scene.add(pointLight); var render = function () { requestAnimationFrame( render ); // cube.rotation.x += 0.025; cube.rotation.y += 0.015; renderer.setClearColor( 'darkgrey', 1.0 ); renderer.render(scene, camera); }; render(); </script> </body> </html>
{ "content_hash": "2d9384c12a270652b1a48554d5f6b5a9", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 207, "avg_line_length": 34.333333333333336, "alnum_prop": 0.594722429673886, "repo_name": "fourestfire/fourestfire.github.io", "id": "c2d17ba10acbe79af6387e5e123d79895dc5a2c8", "size": "4017", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "contact.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "6572" }, { "name": "HTML", "bytes": "50475" }, { "name": "JavaScript", "bytes": "1032867" } ], "symlink_target": "" }