text stringlengths 2 1.04M | meta dict |
|---|---|
Dialog::Dialog(QWidget* parent) :
ControlShow(parent)
{
ControlBase::setControlShow(this);
}
Dialog::~Dialog()
{
} | {
"content_hash": "687ed32938e4f43041383f0244cb5831",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 35,
"avg_line_length": 11.636363636363637,
"alnum_prop": 0.6484375,
"repo_name": "xylsxyls/xueyelingshuang",
"id": "cb8f81a30b92497fab5509556ef1c071356ffd1d",
"size": "149",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/QtControls/QtControls/src/Dialog.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "70916"
},
{
"name": "C",
"bytes": "15759114"
},
{
"name": "C++",
"bytes": "10113598"
},
{
"name": "CMake",
"bytes": "226509"
},
{
"name": "COBOL",
"bytes": "20676"
},
{
"name": "HTML",
"bytes": "417"
},
{
"name": "Makefile",
"bytes": "303"
},
{
"name": "Python",
"bytes": "1481199"
},
{
"name": "QML",
"bytes": "266"
},
{
"name": "Shell",
"bytes": "93441"
}
],
"symlink_target": ""
} |
package org.apache.camel.component.jetty.rest;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.jetty.BaseJettyTest;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class RestBridgeEndpointTest extends BaseJettyTest {
@Test
public void testJettyBridgeEndpoint() throws Exception {
getMockEndpoint("mock:result").expectedMessageCount(1);
String out = template.requestBody("http://localhost:" + getPort() + "/api/123/", null, String.class);
assertEquals("Bye 123", out);
MockEndpoint.assertIsSatisfied(context);
}
@Override
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
@Override
public void configure() {
// configure to use jetty on localhost with the given port
restConfiguration().component("jetty").host("localhost").port(getPort());
rest("/api/").get("/{id}/").to("http://localhost:" + getPort2() + "?bridgeEndpoint=true");
from("jetty:http://localhost:" + getPort2() + "?matchOnUriPrefix=true").to("mock:result").transform()
.simple("Bye ${header.id}");
}
};
}
}
| {
"content_hash": "b716e478a5fe62bac2bee54ab59c944b",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 117,
"avg_line_length": 34.41025641025641,
"alnum_prop": 0.6438152011922503,
"repo_name": "tadayosi/camel",
"id": "a69ce3d5b48df417178b5eecc6ef25eb27eb4ed8",
"size": "2144",
"binary": false,
"copies": "4",
"ref": "refs/heads/main",
"path": "components/camel-jetty/src/test/java/org/apache/camel/component/jetty/rest/RestBridgeEndpointTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Apex",
"bytes": "6695"
},
{
"name": "Batchfile",
"bytes": "2353"
},
{
"name": "CSS",
"bytes": "5472"
},
{
"name": "Dockerfile",
"bytes": "5676"
},
{
"name": "Elm",
"bytes": "10852"
},
{
"name": "FreeMarker",
"bytes": "8015"
},
{
"name": "Groovy",
"bytes": "405043"
},
{
"name": "HTML",
"bytes": "212954"
},
{
"name": "Java",
"bytes": "114726986"
},
{
"name": "JavaScript",
"bytes": "103655"
},
{
"name": "Jsonnet",
"bytes": "1734"
},
{
"name": "Kotlin",
"bytes": "41869"
},
{
"name": "Mustache",
"bytes": "525"
},
{
"name": "RobotFramework",
"bytes": "8461"
},
{
"name": "Ruby",
"bytes": "88"
},
{
"name": "Shell",
"bytes": "15327"
},
{
"name": "Tcl",
"bytes": "4974"
},
{
"name": "Thrift",
"bytes": "6979"
},
{
"name": "XQuery",
"bytes": "699"
},
{
"name": "XSLT",
"bytes": "276597"
}
],
"symlink_target": ""
} |
#region Copyright
// Copyright 2014 Myrcon Pty. Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion
using System;
namespace Potato.Fuzzy.Tokens.Primitive.Temporal.Variable.Days {
public class ThursdayDaysVariableTemporalPrimitiveToken : DaysVariableTemporalPrimitiveToken {
public static Phrase Parse(IFuzzyState state, Phrase phrase) {
return TokenReflection.CreateDescendants<ThursdayDaysVariableTemporalPrimitiveToken>(state, phrase);
}
public ThursdayDaysVariableTemporalPrimitiveToken() {
DateTime dt = DateTime.Now;
while (dt.DayOfWeek != DayOfWeek.Thursday) {
dt = dt.AddDays(1);
}
this.Pattern = new FuzzyDateTimePattern() {
Rule = TimeType.Definitive,
Year = dt.Year,
Month = dt.Month,
Day = dt.Day,
DayOfWeek = DayOfWeek.Thursday
};
}
}
} | {
"content_hash": "9d101cb96c772ebcc3980f32046291e1",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 112,
"avg_line_length": 38.07692307692308,
"alnum_prop": 0.663973063973064,
"repo_name": "phogue/Potato",
"id": "c2d69037b3c4fdaec6f662e1ccb0b3dd403aef78",
"size": "1487",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Potato.Fuzzy/Tokens/Primitive/Temporal/Variable/Days/ThursdayDaysVariableTemporalPrimitiveToken.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "3865563"
},
{
"name": "CSS",
"bytes": "63"
},
{
"name": "JavaScript",
"bytes": "4406"
},
{
"name": "Python",
"bytes": "15262"
}
],
"symlink_target": ""
} |
using System;
using Autofac;
using Autofac.Multitenant;
using Autofac.Multitenant.Test.Stubs;
using Xunit;
namespace Autofac.Multitenant.Test
{
public class ConfigurationActionBuilderFixture
{
[Fact]
public void Build_NoActionsRegistered()
{
var builder = new ConfigurationActionBuilder();
Assert.NotNull(builder.Build());
}
[Fact]
public void Build_MultipleActionsRegistered()
{
var builder = new ConfigurationActionBuilder();
builder.Add(b => b.RegisterType<StubDependency1Impl1>().As<IStubDependency1>());
builder.Add(b => b.RegisterType<StubDependency2Impl1>().As<IStubDependency2>());
var built = builder.Build();
var container = new ContainerBuilder().Build();
using (var scope = container.BeginLifetimeScope(built))
{
Assert.IsType<StubDependency1Impl1>(scope.Resolve<IStubDependency1>());
Assert.IsType<StubDependency2Impl1>(scope.Resolve<IStubDependency2>());
}
}
[Fact]
public void Build_SingleActionRegistered()
{
var builder = new ConfigurationActionBuilder();
builder.Add(b => b.RegisterType<StubDependency1Impl1>().As<IStubDependency1>());
var built = builder.Build();
var container = new ContainerBuilder().Build();
using (var scope = container.BeginLifetimeScope(built))
{
Assert.IsType<StubDependency1Impl1>(scope.Resolve<IStubDependency1>());
}
}
}
}
| {
"content_hash": "1d0d6cb0c48e87b226804c892eff9a09",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 92,
"avg_line_length": 34.0625,
"alnum_prop": 0.6091743119266055,
"repo_name": "autofac/Autofac.Multitenant",
"id": "ca4b950710f32b892ca617ccf0c214c01d6dbb2e",
"size": "1637",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "test/Autofac.Multitenant.Test/ConfigurationActionBuilderFixture.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "80941"
},
{
"name": "PowerShell",
"bytes": "7972"
}
],
"symlink_target": ""
} |
<?php Class UserController extends Controller{
private $database;
static $activeUser = array();
public function __construct(){
$this->database =Controller::loading_controller('Database');
}
public function getActiveUser($opt){
if(isset(UserController::$activeUser['user'])){
return UserController::$activeUser['user']->$opt;
}
if(isset($_SESSION["user_id"]) && !empty($_SESSION["user_id"])){
$actUser = current($this->database->sqlquery('SELECT * FROM '.CONFIG::PREFIX.'_users WHERE id='.$this->database->secure($_SESSION["user_id"]),'query'));
UserController::$activeUser['user'] = $actUser;
return $actUser->$opt;
}
}
public function getUserById($id){
return current($this->database->sqlquery('SELECT * FROM '.CONFIG::PREFIX.'_users WHERE id="'.$this->database->secure($id).'"','query'));
}
public function getUserByName($name){
return current($this->database->sqlquery('SELECT * FROM '.CONFIG::PREFIX.'_users WHERE name="'.$this->database->secure($name).'"','query'));
}
public function getUserAvatar($id){
if(is_numeric($id)){
$avatar = current($this->database->sqlquery('SELECT avatar FROM '.CONFIG::PREFIX.'_users WHERE id="'.$this->database->secure($id).'"','query'));
$return = Dispatcher::base()."template/images/settee.png";
if(!empty($avatar)){
if($avatar->avatar != null){
if(file_exists(ROOT.DS.$avatar->avatar)){
$return = Dispatcher::base().$avatar->avatar;
}
}
}
return $return;
}
}
public function getAllUsers(){
return $this->database->sqlquery('SELECT id, surname, email, name, type FROM '.CONFIG::PREFIX.'_users','query');
}
} | {
"content_hash": "542225271fc9068319a30da9ff2d98a4",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 155,
"avg_line_length": 33.46938775510204,
"alnum_prop": 0.6579268292682927,
"repo_name": "Settee/Settee",
"id": "f57491eec7bee7016386b159ab442649afb5be9b",
"size": "1640",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "controller/UserController.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "23536"
},
{
"name": "JavaScript",
"bytes": "3867"
},
{
"name": "PHP",
"bytes": "106088"
}
],
"symlink_target": ""
} |
package com.freshsoft.matterbridge.client.rss
import java.time.OffsetDateTime
import java.time.format.DateTimeFormatter
import akka.actor.{Actor, ActorRef, Props}
import akka.event.{Logging, LoggingAdapter}
import com.freshsoft.matterbridge.server.{MatterBridgeContext, RssConfigActorService}
import com.freshsoft.matterbridge.util.MatterBridgeHttpClient
import model.MatterBridgeEntities.{RssReaderIncomingModel, RssReaderModel}
import model.RssEntity
import net.ruippeixotog.scalascraper.browser.JsoupBrowser
import net.ruippeixotog.scalascraper.dsl.DSL.Extract._
import net.ruippeixotog.scalascraper.dsl.DSL._
import org.joda.time.DateTime
import scala.language.postfixOps
import scala.xml.{NodeSeq, XML}
/**
* The rss reader worker actor fetch the rss feed and build a Message for the rssReaderSenderActor
*/
class RssReaderWorkerActor extends Actor with MatterBridgeContext with RssConfigActorService {
val log: LoggingAdapter = Logging.getLogger(system, this)
val readerActor: ActorRef = context.actorOf(Props(classOf[RssReaderSenderActor]))
override def receive: Receive = {
case x: RssEntity =>
retrieveRssData(x) foreach {
case Some(model) => readerActor ! model
case None =>
log.info("Got no rss items to send. No rss content was sent")
}
}
/**
* Retrieves the raw rss feed data and build the raw rss model to send
*
* @param rssConfig the rss configuration
* @return A rss reader incoming model or none when parsing was not successful
*/
private def retrieveRssData(rssConfig: RssEntity) = {
val rawRssData = MatterBridgeHttpClient.getUrlContent(rssConfig.rssUrl)
rawRssData map { rssContent =>
if (rssContent.nonEmpty) buildRssModel(rssConfig, rssContent) else None
}
}
/**
* Check if the given pudDate String of an article is newer then the old search time
*
* @param actualPubDate The actual rss feed item article time
* @param lastScanDate The last actor run time saved in a model
* @param isRssFeed Indicator if it is an rss feed or an atom feed
* @return true when the actual rss item (pubDate) is new
*/
private def isArticleNew(actualPubDate: String, lastScanDate: String, isRssFeed: Boolean) = {
val rssFeedTime = (x: String) => OffsetDateTime.parse(x, DateTimeFormatter.RFC_1123_DATE_TIME)
val atomFeedTime = (x: String) => OffsetDateTime.parse(x, DateTimeFormatter.ISO_DATE_TIME)
if (isRssFeed) {
rssFeedTime(actualPubDate).isAfter(atomFeedTime(lastScanDate))
} else {
atomFeedTime(actualPubDate).isAfter(atomFeedTime(lastScanDate))
}
}
/**
* Looks in the description tag for a image link
*
* @param description The content of a rss item description tag
* @return A link of an image otherwise an empty string (compatibility)
*/
private def extractImageFromContent(description: String) = {
try {
val doc = JsoupBrowser().parseString(description)
(doc >> element("img")).attr("src")
} catch {
case _: Throwable => ""
}
}
/**
* Build a optional RssReaderIncomingModel which belongs to a rss feed config entry
*
* @param rssConfig The rss config entry to retrieve the necessary information
* @param content The raw rss feed content as string
* @return A optional RssReaderIncomingModel
*/
private def buildRssModel(rssConfig: RssEntity,
content: String): Option[RssReaderIncomingModel] = {
try {
val xml = XML.loadString(content)
val items = xml \\ "item"
val entries = xml \\ "entry"
val isRssFeed = items.nonEmpty
val allRssModels =
if (isRssFeed) getRssFeedModels(rssConfig, items)
else getAtomFeedModels(rssConfig, entries)
val lastTime =
rssConfig.updatedAt.getOrElse(DateTime.now().minusDays(3)) toDateTimeISO () toString
val rssModels =
allRssModels.filter(m => isArticleNew(m.pubDate, lastTime, isRssFeed))
if (rssModels.nonEmpty) {
rssConfigService.update(rssConfig.id)
}
Some(RssReaderIncomingModel(rssConfig, rssModels))
} catch {
case e: Throwable =>
log.error(s"Could not parse rss content $content", e)
None
}
}
private def getRssFeedModels(rssConfig: RssEntity, rssNodeSeq: NodeSeq) = {
(for {
i <- rssNodeSeq
title = (i \ "title").text
link = (i \ "link").text
pubDate = (i \ "pubDate").text
description = (i \ "description").text
imageLink = extractImageFromContent(description)
} yield RssReaderModel(title, link, pubDate, description, imageLink, rssConfig.name)).toList
}
private def getAtomFeedModels(rssConfig: RssEntity, atomNodeSeq: NodeSeq) = {
(for {
i <- atomNodeSeq
title = (i \ "title").text
link = (i \ "link").text
pubDate = (i \ "updated").text
description = (i \ "summary").text
imageLink = extractImageFromContent(description)
} yield RssReaderModel(title, link, pubDate, description, imageLink, rssConfig.name)).toList
}
}
| {
"content_hash": "0e28ccc40c8d8bcd2cbbf8bec897611c",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 98,
"avg_line_length": 34.889655172413796,
"alnum_prop": 0.7021150424985175,
"repo_name": "Freshwood/matterbridge",
"id": "b876ad82c0b9b8181d3b7a26603e1e3cf0732ad9",
"size": "5059",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/scala/com/freshsoft/matterbridge/client/rss/RssReaderWorkerActor.scala",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "67277"
},
{
"name": "HTML",
"bytes": "18074"
},
{
"name": "JavaScript",
"bytes": "226240"
},
{
"name": "Scala",
"bytes": "93886"
}
],
"symlink_target": ""
} |
layout: post
title: "LaTeX BR"
categories: jekyll update
link-telegram: https://telegram.me/latexbr
---
Grupo de discussão: https://telegram.me/latexbr
Canal com aulas, dicas e tutoriais: https://telegram.me/latexfacil
Colaboração: Juliano Dorneles dos Santos (@julianodorneles - https://telegram.me/julianodorneles)
| {
"content_hash": "e3bb190121472d5ed2405865c1f44bae",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 97,
"avg_line_length": 35.44444444444444,
"alnum_prop": 0.780564263322884,
"repo_name": "listatelegram/listatelegram.github.io",
"id": "bfb7afc5fd5382ebffaa25eb45e4f7f7bf46a26c",
"size": "326",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2016-05-30-LaTeX-BR.markdown",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "24894"
},
{
"name": "HTML",
"bytes": "106407"
}
],
"symlink_target": ""
} |
<#
.EXAMPLE
This example sets the password change settings for managed accounts in the local farm
#>
Configuration Example
{
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost {
SPPasswordChangeSettings ManagedAccountPasswordResetSettings
{
MailAddress = "sharepoint`@contoso.com"
DaysBeforeExpiry = "14"
PasswordChangeWaitTimeSeconds = "60"
NumberOfRetries = "3"
PsDscRunAsCredential = $SetupAccount
}
}
}
| {
"content_hash": "3a767fbdd417b80b1261b4d6d28294a9",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 89,
"avg_line_length": 30.08,
"alnum_prop": 0.5186170212765957,
"repo_name": "mrpullen/xSharePoint",
"id": "972e00116f78cd9e40c6408e13f38c433a7c8e74",
"size": "752",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Modules/SharePointDsc/Examples/Resources/SPPasswordChangeSettings/1-Example.ps1",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1357"
},
{
"name": "JavaScript",
"bytes": "789"
},
{
"name": "PowerShell",
"bytes": "3096791"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.redshift.model.transform;
import org.w3c.dom.Node;
import javax.annotation.Generated;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.transform.StandardErrorUnmarshaller;
import com.amazonaws.services.redshift.model.ClusterSnapshotQuotaExceededException;
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ClusterSnapshotQuotaExceededExceptionUnmarshaller extends StandardErrorUnmarshaller {
public ClusterSnapshotQuotaExceededExceptionUnmarshaller() {
super(ClusterSnapshotQuotaExceededException.class);
}
@Override
public AmazonServiceException unmarshall(Node node) throws Exception {
// Bail out if this isn't the right error code that this
// marshaller understands
String errorCode = parseErrorCode(node);
if (errorCode == null || !errorCode.equals("ClusterSnapshotQuotaExceeded"))
return null;
ClusterSnapshotQuotaExceededException e = (ClusterSnapshotQuotaExceededException) super.unmarshall(node);
return e;
}
}
| {
"content_hash": "62198ea23360530f0c690375d40d829c",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 113,
"avg_line_length": 33.9375,
"alnum_prop": 0.7716390423572744,
"repo_name": "dagnir/aws-sdk-java",
"id": "4107d487cf7dc4d345d69798b6debec0e73abf28",
"size": "1666",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-redshift/src/main/java/com/amazonaws/services/redshift/model/transform/ClusterSnapshotQuotaExceededExceptionUnmarshaller.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "FreeMarker",
"bytes": "157317"
},
{
"name": "Gherkin",
"bytes": "25556"
},
{
"name": "Java",
"bytes": "165755153"
},
{
"name": "Scilab",
"bytes": "3561"
}
],
"symlink_target": ""
} |
typedef UITableViewCell* (^ConfigureCellBlock)(id indexPath);
typedef NSInteger (^NumberOfRowsInSectionBlock)();
@interface TSEDataSource : NSObject <UITableViewDataSource, UITableViewDelegate>
-(id)initWithConfigureCellBlock:(ConfigureCellBlock)aConfigureCellBlock
NumberOfRowsInSectionBlock:(NumberOfRowsInSectionBlock)aNumberOfRowsInSectionBlock;
@end
| {
"content_hash": "d9f8052daefad7af0bc39bb53e08f1fa",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 88,
"avg_line_length": 40.333333333333336,
"alnum_prop": 0.8539944903581267,
"repo_name": "woudini/TiltSelector",
"id": "dcaad3f40318e333d1ae4a809bdc6ad7cfe2aa21",
"size": "566",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "TiltSelectorExample/TSEDataSource.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "49478"
}
],
"symlink_target": ""
} |
var assert = require("assert");
var testUtils = require("./helpers/util.js");
describe("regressions", function() {
specify("should be able to call .then more than once inside that promise's handler", function() {
var called = 0;
var resolve;
var promise = new Promise(function() {
resolve = arguments[0];
});
return new Promise(function(resolve) {
promise.then(function() {
called++;
promise.then(function(){
called++;
});
promise.then(function(){
called++;
assert.equal(4, called);
resolve();
});
});
promise.then(function() {
called++;
});
setTimeout(resolve, 1);
});
});
specify("should be able to nest arbitrary amount of then handlers on already resolved promises", function() {
var called = 0;
var resolve;
var promise = Promise.resolve();
return new Promise(function(resolve) {
promise.then(function() {
called++;
promise.then(function(){
called++;
promise.then(function(){
called++;
});
promise.then(function(){
called++;
});
});
promise.then(function(){
promise.then(function(){
called++;
});
promise.then(function(){
called++;
assert.equal(8, called);
resolve();
});
called++;
});
});
promise.then(function() {
called++;
});
});
});
specify("github-682", function() {
var o = {
then: function(f) {
setTimeout(function() {
delete o.then;
f(o);
}, 1);
}
};
return Promise.resolve(o).then(function(value) {
assert.equal(o, value);
});
});
specify("gh-1006", function() {
return Promise.resolve().then(function() {
new Promise(function() {}).tap(function() {}).cancel();
});
});
if (testUtils.isNodeJS) {
describe("github-689", function() {
var originalProperty = Object.getOwnPropertyDescriptor(process, "domain");
var bindCalls = 0;
beforeEach(function() {
bindCalls = 0;
});
before(function() {
Object.defineProperty(process, "domain", {
writable: true,
enumerable: true,
configurable: true,
value: {
bind: function(fn) {
bindCalls++;
// Ensure non-strict mode.
return new Function("fn", "return function() {return fn.apply(this, arguments);}")(fn);
},
enter: function() {},
exit: function() {}
}
});
});
after(function() {
Object.defineProperty(process, "domain", originalProperty);
});
specify(".return", function() {
return Promise.resolve().thenReturn(true).then(function(val) {
assert.strictEqual(val, true);
assert.strictEqual(bindCalls, 4);
});
});
specify(".throw", function() {
return Promise.resolve().thenThrow(true).then(assert.fail, function(err) {
assert.strictEqual(err, true);
assert.strictEqual(bindCalls, 5);
});
});
specify(".finally", function() {
return Promise.resolve(true).lastly(function() {
return Promise.delay(1);
}).then(function(val) {
assert.strictEqual(val, true);
assert.strictEqual(bindCalls, 6);
});
});
});
describe("long promise chain stack overflow", function() {
specify("mapSeries", function() {
var array = new Array(5000);
for (var i = 0; i < array.length; ++i) {
array[i] = null;
}
var theError = new Error();
var queryAsync = Promise.promisify(function(cb) {
process.nextTick(function() {
cb(theError);
}, 1);
});
return Promise.mapSeries(array, function() {
return queryAsync();
}).caught(function(e) {
assert.strictEqual(e.cause, theError);
});
});
});
}
});
| {
"content_hash": "87476fa600edad4069f55270fa501f91",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 115,
"avg_line_length": 31.285714285714285,
"alnum_prop": 0.4056316590563166,
"repo_name": "justsml/bluebird",
"id": "380060ea47a58426b6bc607d33e4b1f755a9cbee",
"size": "5256",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/mocha/regress.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4242"
},
{
"name": "HTML",
"bytes": "657"
},
{
"name": "JavaScript",
"bytes": "1223650"
},
{
"name": "Shell",
"bytes": "1121"
}
],
"symlink_target": ""
} |
package com.linkedin.thirdeye.detector.email.filter;
import com.linkedin.thirdeye.datalayer.DaoTestUtils;
import com.linkedin.thirdeye.datalayer.bao.DAOTestBase;
import com.linkedin.thirdeye.datalayer.dto.AnomalyFunctionDTO;
import org.testng.Assert;
import org.testng.annotations.Test;
public class TestAlertFilterFactory {
private static AlertFilterFactory alertFilterFactory;
private static String collection = "my dataset";
private static String metricName = "__counts";
private TestAlertFilterFactory() {
String mappingsPath = ClassLoader.getSystemResource("sample-alertfilter.properties").getPath();
alertFilterFactory = new AlertFilterFactory(mappingsPath);
}
@Test
public void fromSpecNullAlertFilter() throws Exception {
AlertFilter alertFilter = alertFilterFactory.fromSpec(null);
Assert.assertEquals(alertFilter.getClass(), DummyAlertFilter.class);
}
@Test
public void testFromAnomalyFunctionSpecToAlertFilter() throws Exception {
AnomalyFunctionDTO anomalyFunctionSpec = DaoTestUtils.getTestFunctionSpec(metricName, collection);
AlertFilter alertFilter = alertFilterFactory.fromSpec(anomalyFunctionSpec.getAlertFilter());
Assert.assertEquals(alertFilter.getClass(), DummyAlertFilter.class);
anomalyFunctionSpec = DaoTestUtils.getTestFunctionAlphaBetaAlertFilterSpec(metricName, collection);
alertFilter = alertFilterFactory.fromSpec(anomalyFunctionSpec.getAlertFilter());
Assert.assertEquals(alertFilter.getClass(), AlphaBetaAlertFilter.class);
}
} | {
"content_hash": "911a81285b146865823db3163919a038",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 103,
"avg_line_length": 39.282051282051285,
"alnum_prop": 0.8093994778067886,
"repo_name": "fx19880617/pinot-1",
"id": "77a41a71b154f48d0fb1aab07b4d441e2bdc6b1b",
"size": "2169",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "thirdeye/thirdeye-pinot/src/test/java/com/linkedin/thirdeye/detector/email/filter/TestAlertFilterFactory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "4620"
},
{
"name": "Batchfile",
"bytes": "7738"
},
{
"name": "CSS",
"bytes": "925082"
},
{
"name": "FreeMarker",
"bytes": "243834"
},
{
"name": "HTML",
"bytes": "275258"
},
{
"name": "Java",
"bytes": "14422749"
},
{
"name": "JavaScript",
"bytes": "5194066"
},
{
"name": "Makefile",
"bytes": "8076"
},
{
"name": "Python",
"bytes": "36574"
},
{
"name": "Shell",
"bytes": "51677"
},
{
"name": "Thrift",
"bytes": "5028"
}
],
"symlink_target": ""
} |
using CoreGraphics;
using Foundation;
using UIKit;
using mTouchPDFReader.Library.Managers;
using mTouchPDFReader.Library.Data.Enums;
using System;
namespace mTouchPDFReader.Library.Views.Core
{
public class PageView : UIScrollView
{
#region Data
private const float ContentViewPadding = 5.0f;
private const int ThumbContentSize = 500;
private readonly PageContentView _pageContentView;
// TODO: private readonly ThumbView _thumbView;
private readonly UIView _pageContentContainerView;
private nfloat _zoomScaleStep;
public nint PageNumber {
get {
return _pageContentView.PageNumber;
}
set {
_pageContentView.PageNumber = value;
}
}
public bool NeedUpdateZoomAndOffset { get; set; }
public AutoScaleModes AutoScaleMode { get; set; }
#endregion
#region Logic
public PageView(CGRect frame, AutoScaleModes autoScaleMode, nint pageNumber) : base(frame)
{
ScrollsToTop = false;
DelaysContentTouches = false;
ShowsVerticalScrollIndicator = false;
ShowsHorizontalScrollIndicator = false;
ContentMode = UIViewContentMode.Redraw;
AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
UserInteractionEnabled = true;
AutosizesSubviews = false;
BackgroundColor = UIColor.Clear;
ViewForZoomingInScrollView = delegate(UIScrollView sender) {
return _pageContentContainerView;
};
AutoScaleMode = autoScaleMode;
NeedUpdateZoomAndOffset = true;
_pageContentView = new PageContentView(PageContentView.GetPageViewSize(pageNumber), pageNumber);
_pageContentContainerView = new UIView(_pageContentView.Bounds);
_pageContentContainerView.AutosizesSubviews = false;
_pageContentContainerView.UserInteractionEnabled = false;
_pageContentContainerView.ContentMode = UIViewContentMode.Redraw;
_pageContentContainerView.AutoresizingMask = UIViewAutoresizing.None;
_pageContentContainerView.Layer.CornerRadius = 5;
_pageContentContainerView.Layer.ShadowOffset = new CGSize(2.0f, 2.0f);
_pageContentContainerView.Layer.ShadowRadius = 4.0f;
_pageContentContainerView.Layer.ShadowOpacity = 1.0f;
_pageContentContainerView.Layer.ShadowPath = UIBezierPath.FromRect(_pageContentContainerView.Bounds).CGPath;
_pageContentContainerView.BackgroundColor = UIColor.White;
// TODO: _ThumbView = new ThumbView(_PageContentView.Bounds, ThumbContentSize, pageNumber);
// TODO: _PageContentContainerView.AddSubview(_ThumbView);
_pageContentContainerView.AddSubview(_pageContentView);
AddSubview(_pageContentContainerView);
ContentSize = _pageContentView.Bounds.Size;
ContentOffset = new CGPoint((0.0f - ContentViewPadding), (0.0f - ContentViewPadding));
ContentInset = new UIEdgeInsets(ContentViewPadding, ContentViewPadding, ContentViewPadding, ContentViewPadding);
ContentSize = _pageContentContainerView.Bounds.Size;
}
public override void LayoutSubviews()
{
base.LayoutSubviews();
if (NeedUpdateZoomAndOffset) {
updateMinimumMaximumZoom();
resetZoom();
resetScrollOffset();
NeedUpdateZoomAndOffset = false;
}
alignPageContentView();
}
public override void TouchesBegan(NSSet touches, UIEvent evt)
{
base.TouchesBegan(touches, evt);
if (MgrAccessor.SettingsMgr.Settings.AllowZoomByDoubleTouch) {
var touch = touches.AnyObject as UITouch;
if (touch.TapCount == 2) {
ZoomIncrement();
}
}
}
private void alignPageContentView()
{
CGSize boundsSize = Bounds.Size;
CGRect viewFrame = _pageContentContainerView.Frame;
if (viewFrame.Size.Width < boundsSize.Width) {
viewFrame.X = (boundsSize.Width - viewFrame.Size.Width) / 2.0f + ContentOffset.X;
} else {
viewFrame.X = 0.0f;
}
if (viewFrame.Size.Height < boundsSize.Height) {
viewFrame.Y = (boundsSize.Height - viewFrame.Size.Height) / 2.0f + ContentOffset.Y;
} else {
viewFrame.Y = 0.0f;
}
_pageContentContainerView.Frame = viewFrame;
}
private nfloat getZoomScaleThatFits(CGSize target, CGSize source)
{
nfloat wScale = target.Width / source.Width;
nfloat hScale = target.Height / source.Height;
var factor = AutoScaleMode == AutoScaleModes.AutoWidth
? (wScale < hScale ? hScale : wScale)
: (wScale < hScale ? wScale : hScale);
return factor;
}
private void updateMinimumMaximumZoom()
{
CGRect targetRect = RectangleFExtensions.Inset(Bounds, ContentViewPadding, ContentViewPadding);
nfloat zoomScale = getZoomScaleThatFits(targetRect.Size, _pageContentView.Bounds.Size);
MinimumZoomScale = zoomScale;
MaximumZoomScale = zoomScale * MgrAccessor.SettingsMgr.Settings.ZoomScaleLevels;
_zoomScaleStep = (MaximumZoomScale - MinimumZoomScale) / MgrAccessor.SettingsMgr.Settings.ZoomScaleLevels;
}
private void resetScrollOffset()
{
SetContentOffset(new CGPoint(0.0f, 0.0f), false);
}
private void resetZoom()
{
ZoomScale = MinimumZoomScale;
}
public void ZoomDecrement()
{
nfloat zoomScale = ZoomScale;
if (zoomScale > MinimumZoomScale) {
zoomScale -= _zoomScaleStep;
if (zoomScale < MinimumZoomScale) {
zoomScale = MinimumZoomScale;
}
SetZoomScale(zoomScale, true);
}
}
public void ZoomIncrement()
{
nfloat zoomScale = ZoomScale;
if (zoomScale < MaximumZoomScale) {
zoomScale += _zoomScaleStep;
if (zoomScale > MaximumZoomScale) {
zoomScale = MaximumZoomScale;
}
SetZoomScale(zoomScale, true);
}
}
#endregion
}
}
| {
"content_hash": "a8a0b5fbd34f9cd3bd42f56aee937f87",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 115,
"avg_line_length": 31.702857142857145,
"alnum_prop": 0.7326964671953857,
"repo_name": "Manne990/ManneDoForms",
"id": "dd33f161b1f716f546595d433b69373b00589d0e",
"size": "6752",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dependencies/mTouchPDFReader/Views/Core/PageView.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "260723"
}
],
"symlink_target": ""
} |
package org.apache.hyracks.api.context;
import org.apache.hyracks.api.application.INCApplicationContext;
import org.apache.hyracks.api.io.IWorkspaceFileFactory;
import org.apache.hyracks.api.job.JobId;
import org.apache.hyracks.api.job.profiling.counters.ICounterContext;
import org.apache.hyracks.api.resources.IDeallocatableRegistry;
public interface IHyracksJobletContext extends IWorkspaceFileFactory, IDeallocatableRegistry {
public INCApplicationContext getApplicationContext();
public JobId getJobId();
public ICounterContext getCounterContext();
public Object getGlobalJobData();
public Class<?> loadClass(String className);
public ClassLoader getClassLoader();
} | {
"content_hash": "acae3c6d742018d0aeecc0832ce2024d",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 94,
"avg_line_length": 31.954545454545453,
"alnum_prop": 0.813655761024182,
"repo_name": "tectronics/hyracks",
"id": "5702aa3e68e4a6e5d46c888aab4ef64b56fe98f0",
"size": "1338",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/context/IHyracksJobletContext.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2606"
},
{
"name": "CSS",
"bytes": "722"
},
{
"name": "HTML",
"bytes": "8070"
},
{
"name": "Java",
"bytes": "8126194"
},
{
"name": "JavaScript",
"bytes": "24354"
},
{
"name": "Shell",
"bytes": "14510"
}
],
"symlink_target": ""
} |
package io.github.opencubicchunks.cubicchunks.core.world.column;
import io.github.opencubicchunks.cubicchunks.api.world.IColumn;
import io.github.opencubicchunks.cubicchunks.api.world.ICube;
import io.github.opencubicchunks.cubicchunks.api.util.Coords;
import io.github.opencubicchunks.cubicchunks.core.world.cube.Cube;
import mcp.MethodsReturnNonnullByDefault;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import java.util.AbstractCollection;
import java.util.AbstractSet;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.Map.Entry;
@MethodsReturnNonnullByDefault
@ParametersAreNonnullByDefault
public class ColumnTileEntityMap implements Map<BlockPos, TileEntity> {
private final IColumn column;
public ColumnTileEntityMap(IColumn column) {
this.column = column;
}
@Override public int size() {
return column.getLoadedCubes().stream()
.map(ICube::getTileEntityMap)
.map(Map::size)
.reduce(Integer::sum).orElse(0);
}
@Override public boolean isEmpty() {
return column.getLoadedCubes().stream()
.map(ICube::getTileEntityMap)
.allMatch(Map::isEmpty);
}
@Override public boolean containsKey(Object o) {
if (!(o instanceof BlockPos)) {
return false;
}
BlockPos pos = (BlockPos) o;
int y = Coords.blockToCube(pos.getY());
ICube cube = column.getCube(y); // see comment in get() for why getCube instead of getLoadedCube is used
return cube.getTileEntityMap().containsKey(o);
}
@Override public boolean containsValue(Object o) {
if (!(o instanceof TileEntity)) {
return false;
}
BlockPos pos = ((TileEntity) o).getPos();
int y = Coords.blockToCube(pos.getY());
ICube cube = column.getLoadedCube(y);
assert cube != null : "Cube is null but tile entity in it exists!";
return cube.getTileEntityMap().containsValue(o);
}
@Nullable
@Override public TileEntity get(Object o) {
if (!(o instanceof BlockPos)) {
return null;
}
BlockPos pos = (BlockPos) o;
int y = Coords.blockToCube(pos.getY());
// when something other than CHECK is passed into Chunk.getTileEntity, then if the current TE is null
// it will try to create a new one. To do that it will get a block which will load the cube
// with the already existing TE. But the "create new TE" code will continue not knowing the TE just got loaded
// and will replace the newly loaded one
// so load the cube here to avoid problems. Other places use getCube() for consistency
ICube cube = column.getCube(y);
return cube.getTileEntityMap().get(o);
}
@Override public TileEntity put(BlockPos blockPos, TileEntity tileEntity) {
int y = Coords.blockToCube(blockPos.getY());
ICube cube = column.getCube(y);
return cube.getTileEntityMap().put(blockPos, tileEntity);
}
@Nullable
@Override public TileEntity remove(Object o) {
if (!(o instanceof BlockPos)) {
return null;
}
BlockPos pos = (BlockPos) o;
int y = Coords.blockToCube(pos.getY());
ICube cube = column.getLoadedCube(y);
return cube == null ? null : cube.getTileEntityMap().remove(pos);
}
@Override public void putAll(Map<? extends BlockPos, ? extends TileEntity> map) {
map.forEach(this::put);
}
@Override public void clear() {
throw new UnsupportedOperationException();
}
@Override public Set<BlockPos> keySet() {
return new AbstractSet<BlockPos>() {
@Override public int size() {
return ColumnTileEntityMap.this.size();
}
@Override public boolean isEmpty() {
return ColumnTileEntityMap.this.isEmpty();
}
@Override public boolean contains(Object o) {
return ColumnTileEntityMap.this.containsKey(o);
}
@Nonnull @Override public Iterator<BlockPos> iterator() {
return new Iterator<BlockPos>() {
Iterator<? extends ICube> cubes = column.getLoadedCubes().iterator();
Iterator<BlockPos> curIt = !cubes.hasNext() ? null : cubes.next().getTileEntityMap().keySet().iterator();
BlockPos nextVal;
@Override public boolean hasNext() {
if (nextVal != null) {
return true;
}
if (curIt == null) {
return false;
}
while (!curIt.hasNext() && cubes.hasNext()) {
curIt = cubes.next().getTileEntityMap().keySet().iterator();
}
if (!curIt.hasNext()) {
return false;
}
nextVal = curIt.next();
return true;
}
@Override public BlockPos next() {
if (hasNext()) {
BlockPos next = nextVal;
nextVal = null;
return next;
}
throw new NoSuchElementException();
}
};
}
@Override public boolean remove(Object o) {
return ColumnTileEntityMap.this.remove(o) != null;
}
@Override public void clear() {
throw new UnsupportedOperationException();
}
};
}
@Override public Collection<TileEntity> values() {
return new AbstractCollection<TileEntity>() {
@Override public int size() {
return ColumnTileEntityMap.this.size();
}
@Override public boolean isEmpty() {
return ColumnTileEntityMap.this.isEmpty();
}
@Override public boolean contains(Object o) {
return ColumnTileEntityMap.this.containsValue(o);
}
@Override public Iterator<TileEntity> iterator() {
return new Iterator<TileEntity>() {
Iterator<? extends ICube> cubes = column.getLoadedCubes().iterator();
Iterator<TileEntity> curIt = !cubes.hasNext() ? null : cubes.next().getTileEntityMap().values().iterator();
TileEntity nextVal;
@Override public boolean hasNext() {
if (nextVal != null) {
return true;
}
if (curIt == null) {
return false;
}
while (!curIt.hasNext() && cubes.hasNext()) {
curIt = cubes.next().getTileEntityMap().values().iterator();
}
if (!curIt.hasNext()) {
return false;
}
nextVal = curIt.next();
return true;
}
@Override public TileEntity next() {
if (hasNext()) {
TileEntity next = nextVal;
nextVal = null;
return next;
}
throw new NoSuchElementException();
}
};
}
@Override public boolean add(TileEntity tileEntity) {
return ColumnTileEntityMap.this.put(tileEntity.getPos(), tileEntity) == null;
}
@Override public boolean remove(Object o) {
if (!(o instanceof TileEntity)) {
return false;
}
TileEntity te = (TileEntity) o;
return ColumnTileEntityMap.this.remove(te.getPos(), te);
}
@Override public void clear() {
throw new UnsupportedOperationException();
}
};
}
@Override public Set<Entry<BlockPos, TileEntity>> entrySet() {
return new AbstractSet<Entry<BlockPos, TileEntity>>() {
@Override public int size() {
return ColumnTileEntityMap.this.size();
}
@Override public boolean isEmpty() {
return ColumnTileEntityMap.this.isEmpty();
}
@Override public boolean contains(Object o) {
return ColumnTileEntityMap.this.containsKey(o);
}
@Nonnull @Override public Iterator<Entry<BlockPos, TileEntity>> iterator() {
return new Iterator<Entry<BlockPos, TileEntity>>() {
Iterator<? extends ICube> cubes = column.getLoadedCubes().iterator();
Iterator<Entry<BlockPos, TileEntity>> curIt = !cubes.hasNext() ? null : cubes.next().getTileEntityMap().entrySet().iterator();
Entry<BlockPos, TileEntity> nextVal;
@Override public boolean hasNext() {
if (nextVal != null) {
return true;
}
if (curIt == null) {
return false;
}
while (!curIt.hasNext() && cubes.hasNext()) {
curIt = cubes.next().getTileEntityMap().entrySet().iterator();
}
if (!curIt.hasNext()) {
return false;
}
nextVal = curIt.next();
return true;
}
@Override public Entry<BlockPos, TileEntity> next() {
if (hasNext()) {
Entry<BlockPos, TileEntity> e = nextVal;
nextVal = null;
return e;
}
throw new NoSuchElementException();
}
};
}
@Override public boolean remove(Object o) {
return ColumnTileEntityMap.this.remove(o) != null;
}
@Override public void clear() {
throw new UnsupportedOperationException();
}
};
}
}
| {
"content_hash": "f2dada2dd7e3118968e51375b2418f86",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 146,
"avg_line_length": 37.18027210884354,
"alnum_prop": 0.5135852163571494,
"repo_name": "OpenCubicChunks/CubicChunks",
"id": "83d370cdcebd5f46dcd335b07a55880565733a4b",
"size": "12196",
"binary": false,
"copies": "1",
"ref": "refs/heads/MC_1.12",
"path": "src/main/java/io/github/opencubicchunks/cubicchunks/core/world/column/ColumnTileEntityMap.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "1715857"
},
{
"name": "Kotlin",
"bytes": "22981"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<link rel="shortcut icon" type="image/x-icon" href="../../../../favicon.ico" />
<title>Drawable.Callback - Android SDK | Android Developers</title>
<!-- STYLESHEETS -->
<link rel="stylesheet"
href="http://fonts.googleapis.com/css?family=Roboto+Condensed">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold"
title="roboto">
<link href="../../../../assets/css/default.css?v=7" rel="stylesheet" type="text/css">
<!-- FULLSCREEN STYLESHEET -->
<link href="../../../../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
type="text/css">
<!-- JAVASCRIPT -->
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script src="../../../../assets/js/android_3p-bundle.js" type="text/javascript"></script>
<script type="text/javascript">
var toRoot = "../../../../";
var metaTags = [];
var devsite = false;
</script>
<script src="../../../../assets/js/docs.js?v=6" type="text/javascript"></script>
<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-5831155-1', 'android.com');
ga('create', 'UA-49880327-2', 'android.com', {'name': 'universal'}); // New tracker);
ga('send', 'pageview');
ga('universal.send', 'pageview'); // Send page view for new tracker.
</script>
</head>
<body class="gc-documentation
develop reference" itemscope itemtype="http://schema.org/Article">
<div id="doc-api-level" class="1" style="display:none"></div>
<a name="top"></a>
<a name="top"></a>
<!-- dialog to prompt lang pref change when loaded from hardcoded URL
<div id="langMessage" style="display:none">
<div>
<div class="lang en">
<p>You requested a page in English, would you like to proceed with this language setting?</p>
</div>
<div class="lang es">
<p>You requested a page in Spanish (Español), would you like to proceed with this language setting?</p>
</div>
<div class="lang ja">
<p>You requested a page in Japanese (日本語), would you like to proceed with this language setting?</p>
</div>
<div class="lang ko">
<p>You requested a page in Korean (한국어), would you like to proceed with this language setting?</p>
</div>
<div class="lang ru">
<p>You requested a page in Russian (Русский), would you like to proceed with this language setting?</p>
</div>
<div class="lang zh-cn">
<p>You requested a page in Simplified Chinese (简体中文), would you like to proceed with this language setting?</p>
</div>
<div class="lang zh-tw">
<p>You requested a page in Traditional Chinese (繁體中文), would you like to proceed with this language setting?</p>
</div>
<a href="#" class="button yes" onclick="return false;">
<span class="lang en">Yes</span>
<span class="lang es">Sí</span>
<span class="lang ja">Yes</span>
<span class="lang ko">Yes</span>
<span class="lang ru">Yes</span>
<span class="lang zh-cn">是的</span>
<span class="lang zh-tw">没有</span>
</a>
<a href="#" class="button" onclick="$('#langMessage').hide();return false;">
<span class="lang en">No</span>
<span class="lang es">No</span>
<span class="lang ja">No</span>
<span class="lang ko">No</span>
<span class="lang ru">No</span>
<span class="lang zh-cn">没有</span>
<span class="lang zh-tw">没有</span>
</a>
</div>
</div> -->
<!-- Header -->
<div id="header-wrapper">
<div class="dac-header" id="header">
<div class="dac-header-inner">
<a class="dac-nav-toggle" data-dac-toggle-nav href="javascript:;" title="Open navigation">
<span class="dac-nav-hamburger">
<span class="dac-nav-hamburger-top"></span>
<span class="dac-nav-hamburger-mid"></span>
<span class="dac-nav-hamburger-bot"></span>
</span>
</a>
<a class="dac-header-logo" href="../../../../index.html">
<img class="dac-header-logo-image" src="../../../../assets/images/android_logo.png"
srcset="../../../../assets/images/android_logo@2x.png 2x"
width="32" height="36" alt="Android" /> Developers
</a>
<ul class="dac-header-crumbs">
<li class="dac-header-crumbs-item"><span class="dac-header-crumbs-link current ">Drawable.Callback - Android SDK</a></li>
</ul>
<div class="dac-header-search" id="search-container">
<div class="dac-header-search-inner">
<div class="dac-sprite dac-search dac-header-search-btn" id="search-btn"></div>
<form class="dac-header-search-form" onsubmit="return submit_search()">
<input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, '../../../../')"
onkeyup="return search_changed(event, false, '../../../../')"
class="dac-header-search-input" placeholder="Search" />
<a class="dac-header-search-close hide" id="search-close">close</a>
</form>
</div><!-- end dac-header-search-inner -->
</div><!-- end dac-header-search -->
<div class="search_filtered_wrapper">
<div class="suggest-card reference no-display">
<ul class="search_filtered">
</ul>
</div>
<div class="suggest-card develop no-display">
<ul class="search_filtered">
</ul>
<div class="child-card guides no-display">
</div>
<div class="child-card training no-display">
</div>
<div class="child-card samples no-display">
</div>
</div>
<div class="suggest-card design no-display">
<ul class="search_filtered">
</ul>
</div>
<div class="suggest-card distribute no-display">
<ul class="search_filtered">
</ul>
</div>
</div>
<a class="dac-header-console-btn" href="https://play.google.com/apps/publish/">
<span class="dac-sprite dac-google-play"></span>
<span class="dac-visible-desktop-inline">Developer</span>
Console
</a>
</div><!-- end header-wrap.wrap -->
</div><!-- end header -->
<div id="searchResults" class="wrap" style="display:none;">
<h2 id="searchTitle">Results</h2>
<div id="leftSearchControl" class="search-control">Loading...</div>
</div>
</div> <!--end header-wrapper -->
<!-- Navigation-->
<nav class="dac-nav">
<div class="dac-nav-dimmer" data-dac-toggle-nav></div>
<ul class="dac-nav-list" data-dac-nav>
<li class="dac-nav-item dac-nav-head">
<a class="dac-nav-link dac-nav-logo" data-dac-toggle-nav href="javascript:;" title="Close navigation">
<img class="dac-logo-image" src="../../../../assets/images/android_logo.png"
srcset="../../../../assets/images/android_logo@2x.png 2x"
width="32" height="36" alt="Android" /> Developers
</a>
</li>
<li class="dac-nav-item home">
<a class="dac-nav-link dac-visible-mobile-block" href="../../../../index.html">Home</a>
<ul class="dac-nav-secondary about">
<li class="dac-nav-item about">
<a class="dac-nav-link" href="../../../../about/index.html">Android</a>
</li>
<li class="dac-nav-item wear">
<a class="dac-nav-link" href="../../../../wear/index.html">Wear</a>
</li>
<li class="dac-nav-item tv">
<a class="dac-nav-link" href="../../../../tv/index.html">TV</a>
</li>
<li class="dac-nav-item auto">
<a class="dac-nav-link" href="../../../../auto/index.html">Auto</a>
</li>
</ul>
</li>
<li class="dac-nav-item design">
<a class="dac-nav-link" href="../../../../design/index.html"
zh-tw-lang="設計"
zh-cn-lang="设计"
ru-lang="Проектирование"
ko-lang="디자인"
ja-lang="設計"
es-lang="Diseñar">Design</a>
</li>
<li class="dac-nav-item develop">
<a class="dac-nav-link" href="../../../../develop/index.html"
zh-tw-lang="開發"
zh-cn-lang="开发"
ru-lang="Разработка"
ko-lang="개발"
ja-lang="開発"
es-lang="Desarrollar">Develop</a>
<ul class="dac-nav-secondary develop">
<li class="dac-nav-item training">
<a class="dac-nav-link" href="../../../../training/index.html"
zh-tw-lang="訓練課程"
zh-cn-lang="培训"
ru-lang="Курсы"
ko-lang="교육"
ja-lang="トレーニング"
es-lang="Capacitación">Training</a>
</li>
<li class="dac-nav-item guide">
<a class="dac-nav-link" href="../../../../guide/index.html"
zh-tw-lang="API 指南"
zh-cn-lang="API 指南"
ru-lang="Руководства по API"
ko-lang="API 가이드"
ja-lang="API ガイド"
es-lang="Guías de la API">API Guides</a>
</li>
<li class="dac-nav-item reference">
<a class="dac-nav-link" href="../../../../reference/packages.html"
zh-tw-lang="參考資源"
zh-cn-lang="参考"
ru-lang="Справочник"
ko-lang="참조문서"
ja-lang="リファレンス"
es-lang="Referencia">Reference</a>
</li>
<li class="dac-nav-item tools">
<a class="dac-nav-link" href="../../../../sdk/index.html"
zh-tw-lang="相關工具"
zh-cn-lang="工具"
ru-lang="Инструменты"
ko-lang="도구"
ja-lang="ツール"
es-lang="Herramientas">Tools</a></li>
<li class="dac-nav-item google">
<a class="dac-nav-link" href="../../../../google/index.html">Google Services</a>
</li>
<li class="dac-nav-item preview">
<a class="dac-nav-link" href="../../../../preview/index.html">Preview</a>
</li>
</ul>
</li>
<li class="dac-nav-item distribute">
<a class="dac-nav-link" href="../../../../distribute/googleplay/index.html"
zh-tw-lang="發佈"
zh-cn-lang="分发"
ru-lang="Распространение"
ko-lang="배포"
ja-lang="配布"
es-lang="Distribuir">Distribute</a>
<ul class="dac-nav-secondary distribute">
<li class="dac-nav-item googleplay">
<a class="dac-nav-link" href="../../../../distribute/googleplay/index.html">Google Play</a></li>
<li class="dac-nav-item essentials">
<a class="dac-nav-link" href="../../../../distribute/essentials/index.html">Essentials</a></li>
<li class="dac-nav-item users">
<a class="dac-nav-link" href="../../../../distribute/users/index.html">Get Users</a></li>
<li class="dac-nav-item engage">
<a class="dac-nav-link" href="../../../../distribute/engage/index.html">Engage & Retain</a></li>
<li class="dac-nav-item monetize">
<a class="dac-nav-link" href="../../../../distribute/monetize/index.html">Earn</a>
</li>
<li class="dac-nav-item analyze">
<a class="dac-nav-link" href="../../../../distribute/analyze/index.html">Analyze</a>
</li>
<li class="dac-nav-item stories">
<a class="dac-nav-link" href="../../../../distribute/stories/index.html">Stories</a>
</li>
</ul>
</li>
</ul>
</nav>
<!-- end navigation-->
<div class="wrap clearfix" id="body-content"><div class="cols">
<div class="col-4 dac-hidden-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
<div id="devdoc-nav">
<div id="api-nav-header">
<div id="api-level-toggle">
<label for="apiLevelCheckbox" class="disabled"
title="Select your target API level to dim unavailable APIs">API level: </label>
<div class="select-wrapper">
<select id="apiLevelSelector">
<!-- option elements added by buildApiLevelSelector() -->
</select>
</div>
</div><!-- end toggle -->
<div id="api-nav-title">Android APIs</div>
</div><!-- end nav header -->
<script>
var SINCE_DATA = [ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23' ];
buildApiLevelSelector();
</script>
<div id="swapper">
<div id="nav-panels">
<div id="resize-packages-nav">
<div id="packages-nav" class="scroll-pane">
<ul>
<li class="api apilevel-1">
<a href="../../../../reference/android/package-summary.html">android</a></li>
<li class="api apilevel-4">
<a href="../../../../reference/android/accessibilityservice/package-summary.html">android.accessibilityservice</a></li>
<li class="api apilevel-5">
<a href="../../../../reference/android/accounts/package-summary.html">android.accounts</a></li>
<li class="api apilevel-11">
<a href="../../../../reference/android/animation/package-summary.html">android.animation</a></li>
<li class="api apilevel-16">
<a href="../../../../reference/android/annotation/package-summary.html">android.annotation</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/app/package-summary.html">android.app</a></li>
<li class="api apilevel-8">
<a href="../../../../reference/android/app/admin/package-summary.html">android.app.admin</a></li>
<li class="api apilevel-23">
<a href="../../../../reference/android/app/assist/package-summary.html">android.app.assist</a></li>
<li class="api apilevel-8">
<a href="../../../../reference/android/app/backup/package-summary.html">android.app.backup</a></li>
<li class="api apilevel-21">
<a href="../../../../reference/android/app/job/package-summary.html">android.app.job</a></li>
<li class="api apilevel-21">
<a href="../../../../reference/android/app/usage/package-summary.html">android.app.usage</a></li>
<li class="api apilevel-3">
<a href="../../../../reference/android/appwidget/package-summary.html">android.appwidget</a></li>
<li class="api apilevel-5">
<a href="../../../../reference/android/bluetooth/package-summary.html">android.bluetooth</a></li>
<li class="api apilevel-21">
<a href="../../../../reference/android/bluetooth/le/package-summary.html">android.bluetooth.le</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/content/package-summary.html">android.content</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/content/pm/package-summary.html">android.content.pm</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/content/res/package-summary.html">android.content.res</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/database/package-summary.html">android.database</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/database/sqlite/package-summary.html">android.database.sqlite</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/databinding/package-summary.html">android.databinding</a></li>
<li class="api apilevel-11">
<a href="../../../../reference/android/drm/package-summary.html">android.drm</a></li>
<li class="api apilevel-4">
<a href="../../../../reference/android/gesture/package-summary.html">android.gesture</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/graphics/package-summary.html">android.graphics</a></li>
<li class="selected api apilevel-1">
<a href="../../../../reference/android/graphics/drawable/package-summary.html">android.graphics.drawable</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/graphics/drawable/shapes/package-summary.html">android.graphics.drawable.shapes</a></li>
<li class="api apilevel-19">
<a href="../../../../reference/android/graphics/pdf/package-summary.html">android.graphics.pdf</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/hardware/package-summary.html">android.hardware</a></li>
<li class="api apilevel-21">
<a href="../../../../reference/android/hardware/camera2/package-summary.html">android.hardware.camera2</a></li>
<li class="api apilevel-21">
<a href="../../../../reference/android/hardware/camera2/params/package-summary.html">android.hardware.camera2.params</a></li>
<li class="api apilevel-17">
<a href="../../../../reference/android/hardware/display/package-summary.html">android.hardware.display</a></li>
<li class="api apilevel-23">
<a href="../../../../reference/android/hardware/fingerprint/package-summary.html">android.hardware.fingerprint</a></li>
<li class="api apilevel-16">
<a href="../../../../reference/android/hardware/input/package-summary.html">android.hardware.input</a></li>
<li class="api apilevel-12">
<a href="../../../../reference/android/hardware/usb/package-summary.html">android.hardware.usb</a></li>
<li class="api apilevel-3">
<a href="../../../../reference/android/inputmethodservice/package-summary.html">android.inputmethodservice</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/location/package-summary.html">android.location</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/media/package-summary.html">android.media</a></li>
<li class="api apilevel-9">
<a href="../../../../reference/android/media/audiofx/package-summary.html">android.media.audiofx</a></li>
<li class="api apilevel-21">
<a href="../../../../reference/android/media/browse/package-summary.html">android.media.browse</a></li>
<li class="api apilevel-14">
<a href="../../../../reference/android/media/effect/package-summary.html">android.media.effect</a></li>
<li class="api apilevel-23">
<a href="../../../../reference/android/media/midi/package-summary.html">android.media.midi</a></li>
<li class="api apilevel-21">
<a href="../../../../reference/android/media/projection/package-summary.html">android.media.projection</a></li>
<li class="api apilevel-21">
<a href="../../../../reference/android/media/session/package-summary.html">android.media.session</a></li>
<li class="api apilevel-21">
<a href="../../../../reference/android/media/tv/package-summary.html">android.media.tv</a></li>
<li class="api apilevel-12">
<a href="../../../../reference/android/mtp/package-summary.html">android.mtp</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/net/package-summary.html">android.net</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/net/http/package-summary.html">android.net.http</a></li>
<li class="api apilevel-16">
<a href="../../../../reference/android/net/nsd/package-summary.html">android.net.nsd</a></li>
<li class="api apilevel-12">
<a href="../../../../reference/android/net/rtp/package-summary.html">android.net.rtp</a></li>
<li class="api apilevel-9">
<a href="../../../../reference/android/net/sip/package-summary.html">android.net.sip</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/net/wifi/package-summary.html">android.net.wifi</a></li>
<li class="api apilevel-14">
<a href="../../../../reference/android/net/wifi/p2p/package-summary.html">android.net.wifi.p2p</a></li>
<li class="api apilevel-16">
<a href="../../../../reference/android/net/wifi/p2p/nsd/package-summary.html">android.net.wifi.p2p.nsd</a></li>
<li class="api apilevel-9">
<a href="../../../../reference/android/nfc/package-summary.html">android.nfc</a></li>
<li class="api apilevel-19">
<a href="../../../../reference/android/nfc/cardemulation/package-summary.html">android.nfc.cardemulation</a></li>
<li class="api apilevel-10">
<a href="../../../../reference/android/nfc/tech/package-summary.html">android.nfc.tech</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/opengl/package-summary.html">android.opengl</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/os/package-summary.html">android.os</a></li>
<li class="api apilevel-9">
<a href="../../../../reference/android/os/storage/package-summary.html">android.os.storage</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/preference/package-summary.html">android.preference</a></li>
<li class="api apilevel-19">
<a href="../../../../reference/android/print/package-summary.html">android.print</a></li>
<li class="api apilevel-19">
<a href="../../../../reference/android/print/pdf/package-summary.html">android.print.pdf</a></li>
<li class="api apilevel-19">
<a href="../../../../reference/android/printservice/package-summary.html">android.printservice</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/provider/package-summary.html">android.provider</a></li>
<li class="api apilevel-11">
<a href="../../../../reference/android/renderscript/package-summary.html">android.renderscript</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/sax/package-summary.html">android.sax</a></li>
<li class="api apilevel-14">
<a href="../../../../reference/android/security/package-summary.html">android.security</a></li>
<li class="api apilevel-23">
<a href="../../../../reference/android/security/keystore/package-summary.html">android.security.keystore</a></li>
<li class="api apilevel-22">
<a href="../../../../reference/android/service/carrier/package-summary.html">android.service.carrier</a></li>
<li class="api apilevel-23">
<a href="../../../../reference/android/service/chooser/package-summary.html">android.service.chooser</a></li>
<li class="api apilevel-17">
<a href="../../../../reference/android/service/dreams/package-summary.html">android.service.dreams</a></li>
<li class="api apilevel-21">
<a href="../../../../reference/android/service/media/package-summary.html">android.service.media</a></li>
<li class="api apilevel-18">
<a href="../../../../reference/android/service/notification/package-summary.html">android.service.notification</a></li>
<li class="api apilevel-21">
<a href="../../../../reference/android/service/restrictions/package-summary.html">android.service.restrictions</a></li>
<li class="api apilevel-14">
<a href="../../../../reference/android/service/textservice/package-summary.html">android.service.textservice</a></li>
<li class="api apilevel-21">
<a href="../../../../reference/android/service/voice/package-summary.html">android.service.voice</a></li>
<li class="api apilevel-7">
<a href="../../../../reference/android/service/wallpaper/package-summary.html">android.service.wallpaper</a></li>
<li class="api apilevel-3">
<a href="../../../../reference/android/speech/package-summary.html">android.speech</a></li>
<li class="api apilevel-4">
<a href="../../../../reference/android/speech/tts/package-summary.html">android.speech.tts</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/annotation/package-summary.html">android.support.annotation</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/app/recommendation/package-summary.html">android.support.app.recommendation</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/customtabs/package-summary.html">android.support.customtabs</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/design/package-summary.html">android.support.design</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/design/widget/package-summary.html">android.support.design.widget</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/multidex/package-summary.html">android.support.multidex</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/percent/package-summary.html">android.support.percent</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v13/app/package-summary.html">android.support.v13.app</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v14/preference/package-summary.html">android.support.v14.preference</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v17/leanback/package-summary.html">android.support.v17.leanback</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v17/leanback/app/package-summary.html">android.support.v17.leanback.app</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v17/leanback/database/package-summary.html">android.support.v17.leanback.database</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v17/leanback/graphics/package-summary.html">android.support.v17.leanback.graphics</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v17/leanback/system/package-summary.html">android.support.v17.leanback.system</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v17/leanback/widget/package-summary.html">android.support.v17.leanback.widget</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v17/preference/package-summary.html">android.support.v17.preference</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/accessibilityservice/package-summary.html">android.support.v4.accessibilityservice</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/animation/package-summary.html">android.support.v4.animation</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/app/package-summary.html">android.support.v4.app</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/content/package-summary.html">android.support.v4.content</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/content/pm/package-summary.html">android.support.v4.content.pm</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/content/res/package-summary.html">android.support.v4.content.res</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/database/package-summary.html">android.support.v4.database</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/graphics/package-summary.html">android.support.v4.graphics</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/graphics/drawable/package-summary.html">android.support.v4.graphics.drawable</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/hardware/display/package-summary.html">android.support.v4.hardware.display</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/hardware/fingerprint/package-summary.html">android.support.v4.hardware.fingerprint</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/media/package-summary.html">android.support.v4.media</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/media/session/package-summary.html">android.support.v4.media.session</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/net/package-summary.html">android.support.v4.net</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/os/package-summary.html">android.support.v4.os</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/print/package-summary.html">android.support.v4.print</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/provider/package-summary.html">android.support.v4.provider</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/text/package-summary.html">android.support.v4.text</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/util/package-summary.html">android.support.v4.util</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/view/package-summary.html">android.support.v4.view</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/view/accessibility/package-summary.html">android.support.v4.view.accessibility</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/view/animation/package-summary.html">android.support.v4.view.animation</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v4/widget/package-summary.html">android.support.v4.widget</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v7/app/package-summary.html">android.support.v7.app</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v7/appcompat/package-summary.html">android.support.v7.appcompat</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v7/cardview/package-summary.html">android.support.v7.cardview</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v7/graphics/package-summary.html">android.support.v7.graphics</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v7/graphics/drawable/package-summary.html">android.support.v7.graphics.drawable</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v7/gridlayout/package-summary.html">android.support.v7.gridlayout</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v7/media/package-summary.html">android.support.v7.media</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v7/mediarouter/package-summary.html">android.support.v7.mediarouter</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v7/preference/package-summary.html">android.support.v7.preference</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v7/recyclerview/package-summary.html">android.support.v7.recyclerview</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v7/util/package-summary.html">android.support.v7.util</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v7/view/package-summary.html">android.support.v7.view</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v7/widget/package-summary.html">android.support.v7.widget</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v7/widget/helper/package-summary.html">android.support.v7.widget.helper</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v7/widget/util/package-summary.html">android.support.v7.widget.util</a></li>
<li class="api apilevel-">
<a href="../../../../reference/android/support/v8/renderscript/package-summary.html">android.support.v8.renderscript</a></li>
<li class="api apilevel-21">
<a href="../../../../reference/android/system/package-summary.html">android.system</a></li>
<li class="api apilevel-21">
<a href="../../../../reference/android/telecom/package-summary.html">android.telecom</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/telephony/package-summary.html">android.telephony</a></li>
<li class="api apilevel-5">
<a href="../../../../reference/android/telephony/cdma/package-summary.html">android.telephony.cdma</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/telephony/gsm/package-summary.html">android.telephony.gsm</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/test/package-summary.html">android.test</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/test/mock/package-summary.html">android.test.mock</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/test/suitebuilder/package-summary.html">android.test.suitebuilder</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/test/suitebuilder/annotation/package-summary.html">android.test.suitebuilder.annotation</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/text/package-summary.html">android.text</a></li>
<li class="api apilevel-3">
<a href="../../../../reference/android/text/format/package-summary.html">android.text.format</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/text/method/package-summary.html">android.text.method</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/text/style/package-summary.html">android.text.style</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/text/util/package-summary.html">android.text.util</a></li>
<li class="api apilevel-19">
<a href="../../../../reference/android/transition/package-summary.html">android.transition</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/util/package-summary.html">android.util</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/view/package-summary.html">android.view</a></li>
<li class="api apilevel-4">
<a href="../../../../reference/android/view/accessibility/package-summary.html">android.view.accessibility</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/view/animation/package-summary.html">android.view.animation</a></li>
<li class="api apilevel-3">
<a href="../../../../reference/android/view/inputmethod/package-summary.html">android.view.inputmethod</a></li>
<li class="api apilevel-14">
<a href="../../../../reference/android/view/textservice/package-summary.html">android.view.textservice</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/webkit/package-summary.html">android.webkit</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/android/widget/package-summary.html">android.widget</a></li>
<li class="api apilevel-">
<a href="../../../../reference/com/android/internal/backup/package-summary.html">com.android.internal.backup</a></li>
<li class="api apilevel-">
<a href="../../../../reference/com/android/internal/logging/package-summary.html">com.android.internal.logging</a></li>
<li class="api apilevel-">
<a href="../../../../reference/com/android/internal/os/package-summary.html">com.android.internal.os</a></li>
<li class="api apilevel-">
<a href="../../../../reference/com/android/internal/statusbar/package-summary.html">com.android.internal.statusbar</a></li>
<li class="api apilevel-">
<a href="../../../../reference/com/android/internal/widget/package-summary.html">com.android.internal.widget</a></li>
<li class="api apilevel-">
<a href="../../../../reference/com/android/test/runner/package-summary.html">com.android.test.runner</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/dalvik/annotation/package-summary.html">dalvik.annotation</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/dalvik/bytecode/package-summary.html">dalvik.bytecode</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/dalvik/system/package-summary.html">dalvik.system</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/awt/font/package-summary.html">java.awt.font</a></li>
<li class="api apilevel-3">
<a href="../../../../reference/java/beans/package-summary.html">java.beans</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/io/package-summary.html">java.io</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/lang/package-summary.html">java.lang</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/lang/annotation/package-summary.html">java.lang.annotation</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/lang/ref/package-summary.html">java.lang.ref</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/lang/reflect/package-summary.html">java.lang.reflect</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/math/package-summary.html">java.math</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/net/package-summary.html">java.net</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/nio/package-summary.html">java.nio</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/nio/channels/package-summary.html">java.nio.channels</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/nio/channels/spi/package-summary.html">java.nio.channels.spi</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/nio/charset/package-summary.html">java.nio.charset</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/nio/charset/spi/package-summary.html">java.nio.charset.spi</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/security/package-summary.html">java.security</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/security/acl/package-summary.html">java.security.acl</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/security/cert/package-summary.html">java.security.cert</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/security/interfaces/package-summary.html">java.security.interfaces</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/security/spec/package-summary.html">java.security.spec</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/sql/package-summary.html">java.sql</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/text/package-summary.html">java.text</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/util/package-summary.html">java.util</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/util/concurrent/package-summary.html">java.util.concurrent</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/util/concurrent/atomic/package-summary.html">java.util.concurrent.atomic</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/util/concurrent/locks/package-summary.html">java.util.concurrent.locks</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/util/jar/package-summary.html">java.util.jar</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/util/logging/package-summary.html">java.util.logging</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/util/prefs/package-summary.html">java.util.prefs</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/util/regex/package-summary.html">java.util.regex</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/java/util/zip/package-summary.html">java.util.zip</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/javax/crypto/package-summary.html">javax.crypto</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/javax/crypto/interfaces/package-summary.html">javax.crypto.interfaces</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/javax/crypto/spec/package-summary.html">javax.crypto.spec</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/javax/microedition/khronos/egl/package-summary.html">javax.microedition.khronos.egl</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/javax/microedition/khronos/opengles/package-summary.html">javax.microedition.khronos.opengles</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/javax/net/package-summary.html">javax.net</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/javax/net/ssl/package-summary.html">javax.net.ssl</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/javax/security/auth/package-summary.html">javax.security.auth</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/javax/security/auth/callback/package-summary.html">javax.security.auth.callback</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/javax/security/auth/login/package-summary.html">javax.security.auth.login</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/javax/security/auth/x500/package-summary.html">javax.security.auth.x500</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/javax/security/cert/package-summary.html">javax.security.cert</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/javax/sql/package-summary.html">javax.sql</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/javax/xml/package-summary.html">javax.xml</a></li>
<li class="api apilevel-8">
<a href="../../../../reference/javax/xml/datatype/package-summary.html">javax.xml.datatype</a></li>
<li class="api apilevel-8">
<a href="../../../../reference/javax/xml/namespace/package-summary.html">javax.xml.namespace</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/javax/xml/parsers/package-summary.html">javax.xml.parsers</a></li>
<li class="api apilevel-8">
<a href="../../../../reference/javax/xml/transform/package-summary.html">javax.xml.transform</a></li>
<li class="api apilevel-8">
<a href="../../../../reference/javax/xml/transform/dom/package-summary.html">javax.xml.transform.dom</a></li>
<li class="api apilevel-8">
<a href="../../../../reference/javax/xml/transform/sax/package-summary.html">javax.xml.transform.sax</a></li>
<li class="api apilevel-8">
<a href="../../../../reference/javax/xml/transform/stream/package-summary.html">javax.xml.transform.stream</a></li>
<li class="api apilevel-8">
<a href="../../../../reference/javax/xml/validation/package-summary.html">javax.xml.validation</a></li>
<li class="api apilevel-8">
<a href="../../../../reference/javax/xml/xpath/package-summary.html">javax.xml.xpath</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/junit/framework/package-summary.html">junit.framework</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/junit/runner/package-summary.html">junit.runner</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/org/apache/http/conn/package-summary.html">org.apache.http.conn</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/org/apache/http/conn/scheme/package-summary.html">org.apache.http.conn.scheme</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/org/apache/http/conn/ssl/package-summary.html">org.apache.http.conn.ssl</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/org/apache/http/params/package-summary.html">org.apache.http.params</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/org/json/package-summary.html">org.json</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/org/w3c/dom/package-summary.html">org.w3c.dom</a></li>
<li class="api apilevel-8">
<a href="../../../../reference/org/w3c/dom/ls/package-summary.html">org.w3c.dom.ls</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/org/xml/sax/package-summary.html">org.xml.sax</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/org/xml/sax/ext/package-summary.html">org.xml.sax.ext</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/org/xml/sax/helpers/package-summary.html">org.xml.sax.helpers</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/org/xmlpull/v1/package-summary.html">org.xmlpull.v1</a></li>
<li class="api apilevel-1">
<a href="../../../../reference/org/xmlpull/v1/sax2/package-summary.html">org.xmlpull.v1.sax2</a></li>
</ul><br/>
</div> <!-- end packages-nav -->
</div> <!-- end resize-packages -->
<div id="classes-nav" class="scroll-pane">
<ul>
<li><h2>Interfaces</h2>
<ul>
<li class="api apilevel-4"><a href="../../../../reference/android/graphics/drawable/Animatable.html">Animatable</a></li>
<li class="api apilevel-23"><a href="../../../../reference/android/graphics/drawable/Animatable2.html">Animatable2</a></li>
<li class="selected api apilevel-1"><a href="../../../../reference/android/graphics/drawable/Drawable.Callback.html">Drawable.Callback</a></li>
<li class="api apilevel-23"><a href="../../../../reference/android/graphics/drawable/Icon.OnDrawableLoadedListener.html">Icon.OnDrawableLoadedListener</a></li>
</ul>
</li>
<li><h2>Classes</h2>
<ul>
<li class="api apilevel-23"><a href="../../../../reference/android/graphics/drawable/Animatable2.AnimationCallback.html">Animatable2.AnimationCallback</a></li>
<li class="api apilevel-21"><a href="../../../../reference/android/graphics/drawable/AnimatedStateListDrawable.html">AnimatedStateListDrawable</a></li>
<li class="api apilevel-21"><a href="../../../../reference/android/graphics/drawable/AnimatedVectorDrawable.html">AnimatedVectorDrawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/AnimationDrawable.html">AnimationDrawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/BitmapDrawable.html">BitmapDrawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/ClipDrawable.html">ClipDrawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/ColorDrawable.html">ColorDrawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/Drawable.html">Drawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/Drawable.ConstantState.html">Drawable.ConstantState</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/DrawableContainer.html">DrawableContainer</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/DrawableContainer.DrawableContainerState.html">DrawableContainer.DrawableContainerState</a></li>
<li class="api apilevel-23"><a href="../../../../reference/android/graphics/drawable/DrawableWrapper.html">DrawableWrapper</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/GradientDrawable.html">GradientDrawable</a></li>
<li class="api apilevel-23"><a href="../../../../reference/android/graphics/drawable/Icon.html">Icon</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/InsetDrawable.html">InsetDrawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/LayerDrawable.html">LayerDrawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/LevelListDrawable.html">LevelListDrawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/NinePatchDrawable.html">NinePatchDrawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/PaintDrawable.html">PaintDrawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/PictureDrawable.html">PictureDrawable</a></li>
<li class="api apilevel-21"><a href="../../../../reference/android/graphics/drawable/RippleDrawable.html">RippleDrawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/RotateDrawable.html">RotateDrawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/ScaleDrawable.html">ScaleDrawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/ShapeDrawable.html">ShapeDrawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/ShapeDrawable.ShaderFactory.html">ShapeDrawable.ShaderFactory</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/StateListDrawable.html">StateListDrawable</a></li>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/TransitionDrawable.html">TransitionDrawable</a></li>
<li class="api apilevel-21"><a href="../../../../reference/android/graphics/drawable/VectorDrawable.html">VectorDrawable</a></li>
</ul>
</li>
<li><h2>Enums</h2>
<ul>
<li class="api apilevel-1"><a href="../../../../reference/android/graphics/drawable/GradientDrawable.Orientation.html">GradientDrawable.Orientation</a></li>
</ul>
</li>
</ul><br/>
</div><!-- end classes -->
</div><!-- end nav-panels -->
<div id="nav-tree" style="display:none" class="scroll-pane">
<div id="tree-list"></div>
</div><!-- end nav-tree -->
</div><!-- end swapper -->
<div id="nav-swap">
<a class="fullscreen">fullscreen</a>
<a href='#' onclick='swapNav();return false;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>
</div>
</div> <!-- end devdoc-nav -->
</div> <!-- end side-nav -->
<script type="text/javascript">
// init fullscreen based on user pref
var fullscreen = readCookie("fullscreen");
if (fullscreen != 0) {
if (fullscreen == "false") {
toggleFullscreen(false);
} else {
toggleFullscreen(true);
}
}
// init nav version for mobile
if (isMobile) {
swapNav(); // tree view should be used on mobile
$('#nav-swap').hide();
} else {
chooseDefaultNav();
if ($("#nav-tree").is(':visible')) {
init_default_navtree("../../../../");
}
}
// scroll the selected page into view
$(document).ready(function() {
scrollIntoView("packages-nav");
scrollIntoView("classes-nav");
});
</script>
<div class="col-12" id="doc-col">
<div id="api-info-block">
<div class="sum-details-links">
Summary:
<a href="#pubmethods">Methods</a>
| <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a>
</div><!-- end sum-details-links -->
<div class="api-level">
Added in <a href="../../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a>
</div>
</div><!-- end api-info-block -->
<!-- ======== START OF CLASS DATA ======== -->
<div id="jd-header">
public
static
interface
<h1 itemprop="name">Drawable.Callback</h1>
</div><!-- end header -->
<div id="naMessage"></div>
<div id="jd-content" class="api apilevel-1">
<table class="jd-inheritance-table">
<tr>
<td colspan="1" class="jd-inheritance-class-cell">android.graphics.drawable.Drawable.Callback</td>
</tr>
</table>
<table class="jd-sumtable jd-sumtable-subclasses"><tr><td colspan="12" style="border:none;margin:0;padding:0;">
<a href="#" onclick="return toggleInherited(this, null)" id="subclasses-indirect" class="jd-expando-trigger closed"
><img id="subclasses-indirect-trigger"
src="../../../../assets/images/triangle-closed.png"
class="jd-expando-trigger-img" /></a>Known Indirect Subclasses
<div id="subclasses-indirect">
<div id="subclasses-indirect-list"
class="jd-inheritedlinks"
>
<a href="../../../../reference/android/widget/AbsListView.html">AbsListView</a>,
<a href="../../../../reference/android/widget/AbsSeekBar.html">AbsSeekBar</a>,
<a href="../../../../reference/android/widget/AbsSpinner.html">AbsSpinner</a>,
<a href="../../../../reference/android/widget/AbsoluteLayout.html">AbsoluteLayout</a>,
<a href="../../../../reference/android/widget/ActionMenuView.html">ActionMenuView</a>,
<a href="../../../../reference/android/widget/AdapterView.html">AdapterView</a><T extends <a href="../../../../reference/android/widget/Adapter.html">Adapter</a>>,
<a href="../../../../reference/android/widget/AdapterViewAnimator.html">AdapterViewAnimator</a>,
<a href="../../../../reference/android/widget/AdapterViewFlipper.html">AdapterViewFlipper</a>,
and
<a href="#" onclick="return toggleInherited(document.getElementById('subclasses-indirect', null))">122 others.</a>
</div>
<div id="subclasses-indirect-summary"
style="display: none;"
>
<table class="jd-sumtable-expando">
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/AbsListView.html">AbsListView</a></td>
<td class="jd-descrcol" width="100%">
Base class that can be used to implement virtualized lists of items.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/AbsSeekBar.html">AbsSeekBar</a></td>
<td class="jd-descrcol" width="100%">
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/AbsSpinner.html">AbsSpinner</a></td>
<td class="jd-descrcol" width="100%">
An abstract base class for spinner widgets.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/AbsoluteLayout.html">AbsoluteLayout</a></td>
<td class="jd-descrcol" width="100%">
<em>
This class was deprecated
in API level 3.
Use <code><a href="../../../../reference/android/widget/FrameLayout.html">FrameLayout</a></code>, <code><a href="../../../../reference/android/widget/RelativeLayout.html">RelativeLayout</a></code>
or a custom layout instead.
</em>
</td>
</tr>
<tr class="alt-color api apilevel-21" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/ActionMenuView.html">ActionMenuView</a></td>
<td class="jd-descrcol" width="100%">
ActionMenuView is a presentation of a series of menu options as a View.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/AdapterView.html">AdapterView</a><T extends <a href="../../../../reference/android/widget/Adapter.html">Adapter</a>></td>
<td class="jd-descrcol" width="100%">
An AdapterView is a view whose children are determined by an <code><a href="../../../../reference/android/widget/Adapter.html">Adapter</a></code>.
</td>
</tr>
<tr class="alt-color api apilevel-11" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/AdapterViewAnimator.html">AdapterViewAnimator</a></td>
<td class="jd-descrcol" width="100%">
Base class for a <code><a href="../../../../reference/android/widget/AdapterView.html">AdapterView</a></code> that will perform animations
when switching between its views.
</td>
</tr>
<tr class=" api apilevel-11" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/AdapterViewFlipper.html">AdapterViewFlipper</a></td>
<td class="jd-descrcol" width="100%">
Simple <code><a href="../../../../reference/android/widget/ViewAnimator.html">ViewAnimator</a></code> that will animate between two or more views
that have been added to it.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/AnalogClock.html">AnalogClock</a></td>
<td class="jd-descrcol" width="100%">
<em>
This class was deprecated
in API level 23.
This widget is no longer supported.
</em>
</td>
</tr>
<tr class=" api apilevel-21" >
<td class="jd-linkcol"><a href="../../../../reference/android/graphics/drawable/AnimatedStateListDrawable.html">AnimatedStateListDrawable</a></td>
<td class="jd-descrcol" width="100%">
Drawable containing a set of Drawable keyframes where the currently displayed
keyframe is chosen based on the current state set.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/graphics/drawable/AnimationDrawable.html">AnimationDrawable</a></td>
<td class="jd-descrcol" width="100%">
An object used to create frame-by-frame animations, defined by a series of
Drawable objects, which can be used as a View object's background.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/design/widget/AppBarLayout.html">AppBarLayout</a></td>
<td class="jd-descrcol" width="100%">
AppBarLayout is a vertical <code><a href="../../../../reference/android/widget/LinearLayout.html">LinearLayout</a></code> which implements many of the features of
material designs app bar concept, namely scrolling gestures.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v7/widget/AppCompatAutoCompleteTextView.html">AppCompatAutoCompleteTextView</a></td>
<td class="jd-descrcol" width="100%">
A <code><a href="../../../../reference/android/widget/AutoCompleteTextView.html">AutoCompleteTextView</a></code> which supports compatible features on older version of the
platform, including:
<ul>
<li>Supports <code><a href="../../../../reference/android/support/v7/appcompat/R.attr.html#textAllCaps">textAllCaps</a></code> style attribute which works back to
<code><a href="../../../../reference/android/os/Build.VERSION_CODES.html#ECLAIR_MR1">Eclair MR1</a></code>.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v7/widget/AppCompatButton.html">AppCompatButton</a></td>
<td class="jd-descrcol" width="100%">
A <code><a href="../../../../reference/android/widget/Button.html">Button</a></code> which supports compatible features on older version of the platform,
including:
<ul>
<li>Supports <code><a href="../../../../reference/android/support/v7/appcompat/R.attr.html#textAllCaps">textAllCaps</a></code> style attribute which works back to
<code><a href="../../../../reference/android/os/Build.VERSION_CODES.html#ECLAIR_MR1">Eclair MR1</a></code>.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v7/widget/AppCompatCheckBox.html">AppCompatCheckBox</a></td>
<td class="jd-descrcol" width="100%">
A <code><a href="../../../../reference/android/widget/CheckBox.html">CheckBox</a></code> which supports compatible features on older version of the platform,
including:
<ul>
<li>Allows dynamic tint of it background via the background tint methods in
<code><a href="../../../../reference/android/support/v4/widget/CompoundButtonCompat.html">CompoundButtonCompat</a></code>.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v7/widget/AppCompatCheckedTextView.html">AppCompatCheckedTextView</a></td>
<td class="jd-descrcol" width="100%">
A <code><a href="../../../../reference/android/widget/CheckedTextView.html">CheckedTextView</a></code> which supports compatible features on older version of the platform.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v7/widget/AppCompatEditText.html">AppCompatEditText</a></td>
<td class="jd-descrcol" width="100%">
A <code><a href="../../../../reference/android/widget/EditText.html">EditText</a></code> which supports compatible features on older version of the platform,
including:
<ul>
<li>Supports <code><a href="../../../../reference/android/support/v7/appcompat/R.attr.html#textAllCaps">textAllCaps</a></code> style attribute which works back to
<code><a href="../../../../reference/android/os/Build.VERSION_CODES.html#ECLAIR_MR1">Eclair MR1</a></code>.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v7/widget/AppCompatMultiAutoCompleteTextView.html">AppCompatMultiAutoCompleteTextView</a></td>
<td class="jd-descrcol" width="100%">
A <code><a href="../../../../reference/android/widget/MultiAutoCompleteTextView.html">MultiAutoCompleteTextView</a></code> which supports compatible features on older version of the
platform, including:
<ul>
<li>Supports <code><a href="../../../../reference/android/support/v7/appcompat/R.attr.html#textAllCaps">textAllCaps</a></code> style attribute which works back to
<code><a href="../../../../reference/android/os/Build.VERSION_CODES.html#ECLAIR_MR1">Eclair MR1</a></code>.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v7/widget/AppCompatRadioButton.html">AppCompatRadioButton</a></td>
<td class="jd-descrcol" width="100%">
A <code><a href="../../../../reference/android/widget/RadioButton.html">RadioButton</a></code> which supports compatible features on older version of the platform,
including:
<ul>
<li>Allows dynamic tint of it background via the background tint methods in
<code><a href="../../../../reference/android/support/v4/widget/CompoundButtonCompat.html">CompoundButtonCompat</a></code>.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v7/widget/AppCompatRatingBar.html">AppCompatRatingBar</a></td>
<td class="jd-descrcol" width="100%">
A <code><a href="../../../../reference/android/widget/RatingBar.html">RatingBar</a></code> which supports compatible features on older version of the platform.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v7/widget/AppCompatSpinner.html">AppCompatSpinner</a></td>
<td class="jd-descrcol" width="100%">
A <code><a href="../../../../reference/android/widget/Spinner.html">Spinner</a></code> which supports compatible features on older version of the platform,
including:
<ul>
<li>Allows dynamic tint of it background via the background tint methods in
<code><a href="../../../../reference/android/support/v4/view/ViewCompat.html">ViewCompat</a></code>.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v7/widget/AppCompatTextView.html">AppCompatTextView</a></td>
<td class="jd-descrcol" width="100%">
A <code><a href="../../../../reference/android/widget/TextView.html">TextView</a></code> which supports compatible features on older version of the platform,
including:
<ul>
<li>Supports <code><a href="../../../../reference/android/support/v7/appcompat/R.attr.html#textAllCaps">textAllCaps</a></code> style attribute which works back to
<code><a href="../../../../reference/android/os/Build.VERSION_CODES.html#ECLAIR_MR1">Eclair MR1</a></code>.
</td>
</tr>
<tr class="alt-color api apilevel-3" >
<td class="jd-linkcol"><a href="../../../../reference/android/appwidget/AppWidgetHostView.html">AppWidgetHostView</a></td>
<td class="jd-descrcol" width="100%">
Provides the glue to show AppWidget views.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/AutoCompleteTextView.html">AutoCompleteTextView</a></td>
<td class="jd-descrcol" width="100%">
<p>An editable text view that shows completion suggestions automatically
while the user is typing.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v17/leanback/widget/BaseCardView.html">BaseCardView</a></td>
<td class="jd-descrcol" width="100%">
A card style layout that responds to certain state changes.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v17/leanback/widget/BrowseFrameLayout.html">BrowseFrameLayout</a></td>
<td class="jd-descrcol" width="100%">
A ViewGroup for managing focus behavior between overlapping views.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/Button.html">Button</a></td>
<td class="jd-descrcol" width="100%">
Represents a push-button widget.
</td>
</tr>
<tr class=" api apilevel-11" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/CalendarView.html">CalendarView</a></td>
<td class="jd-descrcol" width="100%">
This class is a calendar widget for displaying and selecting dates.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v7/widget/CardView.html">CardView</a></td>
<td class="jd-descrcol" width="100%">
A FrameLayout with a rounded corner background and shadow.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/CheckBox.html">CheckBox</a></td>
<td class="jd-descrcol" width="100%">
<p>
A checkbox is a specific type of two-states button that can be either
checked or unchecked.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/CheckedTextView.html">CheckedTextView</a></td>
<td class="jd-descrcol" width="100%">
An extension to <code><a href="../../../../reference/android/widget/TextView.html">TextView</a></code> that supports the <code><a href="../../../../reference/android/widget/Checkable.html">Checkable</a></code>
interface and displays.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/Chronometer.html">Chronometer</a></td>
<td class="jd-descrcol" width="100%">
Class that implements a simple timer.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/graphics/drawable/ClipDrawable.html">ClipDrawable</a></td>
<td class="jd-descrcol" width="100%">
A Drawable that clips another Drawable based on this Drawable's current
level value.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/design/widget/CollapsingToolbarLayout.html">CollapsingToolbarLayout</a></td>
<td class="jd-descrcol" width="100%">
CollapsingToolbarLayout is a wrapper for <code><a href="../../../../reference/android/support/v7/widget/Toolbar.html">Toolbar</a></code> which implements a collapsing app bar.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/CompoundButton.html">CompoundButton</a></td>
<td class="jd-descrcol" width="100%">
<p>
A button with two states, checked and unchecked.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v4/widget/ContentLoadingProgressBar.html">ContentLoadingProgressBar</a></td>
<td class="jd-descrcol" width="100%">
ContentLoadingProgressBar implements a ProgressBar that waits a minimum time to be
dismissed before showing.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/design/widget/CoordinatorLayout.html">CoordinatorLayout</a></td>
<td class="jd-descrcol" width="100%">
CoordinatorLayout is a super-powered <code><a href="../../../../reference/android/widget/FrameLayout.html">FrameLayout</a></code>.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/DatePicker.html">DatePicker</a></td>
<td class="jd-descrcol" width="100%">
Provides a widget for selecting a date.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/DialerFilter.html">DialerFilter</a></td>
<td class="jd-descrcol" width="100%">
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/DigitalClock.html">DigitalClock</a></td>
<td class="jd-descrcol" width="100%">
<em>
This class was deprecated
in API level 17.
It is recommended you use <code><a href="../../../../reference/android/widget/TextClock.html">TextClock</a></code> instead.
</em>
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/graphics/drawable/DrawableContainer.html">DrawableContainer</a></td>
<td class="jd-descrcol" width="100%">
A helper class that contains several <code><a href="../../../../reference/android/graphics/drawable/Drawable.html">Drawable</a></code>s and selects which one to use.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v4/widget/DrawerLayout.html">DrawerLayout</a></td>
<td class="jd-descrcol" width="100%">
DrawerLayout acts as a top-level container for window content that allows for
interactive "drawer" views to be pulled out from the edge of the window.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/EditText.html">EditText</a></td>
<td class="jd-descrcol" width="100%">
EditText is a thin veneer over TextView that configures itself
to be editable.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/ExpandableListView.html">ExpandableListView</a></td>
<td class="jd-descrcol" width="100%">
A view that shows items in a vertically scrolling two-level list.
</td>
</tr>
<tr class="alt-color api apilevel-3" >
<td class="jd-linkcol"><a href="../../../../reference/android/inputmethodservice/ExtractEditText.html">ExtractEditText</a></td>
<td class="jd-descrcol" width="100%">
Specialization of <code><a href="../../../../reference/android/widget/EditText.html">EditText</a></code> for showing and interacting with the
extracted text in a full-screen input method.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/design/widget/FloatingActionButton.html">FloatingActionButton</a></td>
<td class="jd-descrcol" width="100%">
Floating action buttons are used for a special type of promoted action.
</td>
</tr>
<tr class="alt-color api apilevel-11" >
<td class="jd-linkcol"><a href="../../../../reference/android/app/FragmentBreadCrumbs.html">FragmentBreadCrumbs</a></td>
<td class="jd-descrcol" width="100%">
<em>
This class was deprecated
in API level 21.
This widget is no longer supported.
</em>
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v4/app/FragmentTabHost.html">FragmentTabHost</a></td>
<td class="jd-descrcol" width="100%">
Special TabHost that allows the use of <code><a href="../../../../reference/android/support/v4/app/Fragment.html">Fragment</a></code> objects for
its tab content.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/FrameLayout.html">FrameLayout</a></td>
<td class="jd-descrcol" width="100%">
FrameLayout is designed to block out an area on the screen to display
a single item.
</td>
</tr>
<tr class=" api apilevel-3" >
<td class="jd-linkcol"><a href="../../../../reference/android/opengl/GLSurfaceView.html">GLSurfaceView</a></td>
<td class="jd-descrcol" width="100%">
An implementation of SurfaceView that uses the dedicated surface for
displaying OpenGL rendering.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/Gallery.html">Gallery</a></td>
<td class="jd-descrcol" width="100%">
<em>
This class was deprecated
in API level 16.
This widget is no longer supported. Other horizontally scrolling
widgets include <code><a href="../../../../reference/android/widget/HorizontalScrollView.html">HorizontalScrollView</a></code> and <code><a href="../../../../reference/android/support/v4/view/ViewPager.html">ViewPager</a></code>
from the support library.
</em>
</td>
</tr>
<tr class=" api apilevel-4" >
<td class="jd-linkcol"><a href="../../../../reference/android/gesture/GestureOverlayView.html">GestureOverlayView</a></td>
<td class="jd-descrcol" width="100%">
A transparent overlay for gesture input that can be placed on top of other
widgets or contain other widgets.
</td>
</tr>
<tr class="alt-color api apilevel-14" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/GridLayout.html">GridLayout</a></td>
<td class="jd-descrcol" width="100%">
A layout that places its children in a rectangular <em>grid</em>.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/GridView.html">GridView</a></td>
<td class="jd-descrcol" width="100%">
A view that shows items in two-dimensional scrolling grid.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v17/leanback/widget/HorizontalGridView.html">HorizontalGridView</a></td>
<td class="jd-descrcol" width="100%">
A <code><a href="../../../../reference/android/view/ViewGroup.html">ViewGroup</a></code> that shows items in a horizontal scrolling list.
</td>
</tr>
<tr class=" api apilevel-3" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/HorizontalScrollView.html">HorizontalScrollView</a></td>
<td class="jd-descrcol" width="100%">
Layout container for a view hierarchy that can be scrolled by the user,
allowing it to be larger than the physical display.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/ImageButton.html">ImageButton</a></td>
<td class="jd-descrcol" width="100%">
<p>
Displays a button with an image (instead of text) that can be pressed
or clicked by the user.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v17/leanback/widget/ImageCardView.html">ImageCardView</a></td>
<td class="jd-descrcol" width="100%">
A subclass of <code><a href="../../../../reference/android/support/v17/leanback/widget/BaseCardView.html">BaseCardView</a></code> with an <code><a href="../../../../reference/android/widget/ImageView.html">ImageView</a></code> as its main region.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/ImageSwitcher.html">ImageSwitcher</a></td>
<td class="jd-descrcol" width="100%">
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/ImageView.html">ImageView</a></td>
<td class="jd-descrcol" width="100%">
Displays an arbitrary image, such as an icon.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/graphics/drawable/InsetDrawable.html">InsetDrawable</a></td>
<td class="jd-descrcol" width="100%">
A Drawable that insets another Drawable by a specified distance.
</td>
</tr>
<tr class=" api apilevel-3" >
<td class="jd-linkcol"><a href="../../../../reference/android/inputmethodservice/KeyboardView.html">KeyboardView</a></td>
<td class="jd-descrcol" width="100%">
A view that renders a virtual <code><a href="../../../../reference/android/inputmethodservice/Keyboard.html">Keyboard</a></code>.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/graphics/drawable/LayerDrawable.html">LayerDrawable</a></td>
<td class="jd-descrcol" width="100%">
A Drawable that manages an array of other Drawables.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/graphics/drawable/LevelListDrawable.html">LevelListDrawable</a></td>
<td class="jd-descrcol" width="100%">
A resource that manages a number of alternate Drawables, each assigned a maximum numerical value.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/LinearLayout.html">LinearLayout</a></td>
<td class="jd-descrcol" width="100%">
A Layout that arranges its children in a single column or a single row.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v7/widget/LinearLayoutCompat.html">LinearLayoutCompat</a></td>
<td class="jd-descrcol" width="100%">
A Layout that arranges its children in a single column or a single row.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v17/leanback/widget/ListRowHoverCardView.html">ListRowHoverCardView</a></td>
<td class="jd-descrcol" width="100%">
ListRowHoverCardView contains a title and description.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v17/leanback/widget/ListRowView.html">ListRowView</a></td>
<td class="jd-descrcol" width="100%">
ListRowView is a <code><a href="../../../../reference/android/view/ViewGroup.html">ViewGroup</a></code> which always contains a
<code><a href="../../../../reference/android/support/v17/leanback/widget/HorizontalGridView.html">HorizontalGridView</a></code>, and may optionally include a hover card.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/ListView.html">ListView</a></td>
<td class="jd-descrcol" width="100%">
A view that shows items in a vertically scrolling list.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/MediaController.html">MediaController</a></td>
<td class="jd-descrcol" width="100%">
A view containing controls for a MediaPlayer.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v7/app/MediaRouteButton.html">MediaRouteButton</a></td>
<td class="jd-descrcol" width="100%">
The media route button allows the user to select routes and to control the
currently selected route.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/MultiAutoCompleteTextView.html">MultiAutoCompleteTextView</a></td>
<td class="jd-descrcol" width="100%">
An editable text view, extending <code><a href="../../../../reference/android/widget/AutoCompleteTextView.html">AutoCompleteTextView</a></code>, that
can show completion suggestions for the substring of the text where
the user is typing instead of necessarily for the entire thing.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/design/widget/NavigationView.html">NavigationView</a></td>
<td class="jd-descrcol" width="100%">
Represents a standard navigation menu for application.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v4/widget/NestedScrollView.html">NestedScrollView</a></td>
<td class="jd-descrcol" width="100%">
NestedScrollView is just like <code><a href="../../../../reference/android/widget/ScrollView.html">ScrollView</a></code>, but it supports acting
as both a nested scrolling parent and child on both new and old versions of Android.
</td>
</tr>
<tr class="alt-color api apilevel-11" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/NumberPicker.html">NumberPicker</a></td>
<td class="jd-descrcol" width="100%">
A widget that enables the user to select a number from a predefined range.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v4/view/PagerTabStrip.html">PagerTabStrip</a></td>
<td class="jd-descrcol" width="100%">
PagerTabStrip is an interactive indicator of the current, next,
and previous pages of a <code><a href="../../../../reference/android/support/v4/view/ViewPager.html">ViewPager</a></code>.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v4/view/PagerTitleStrip.html">PagerTitleStrip</a></td>
<td class="jd-descrcol" width="100%">
PagerTitleStrip is a non-interactive indicator of the current, next,
and previous pages of a <code><a href="../../../../reference/android/support/v4/view/ViewPager.html">ViewPager</a></code>.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/percent/PercentFrameLayout.html">PercentFrameLayout</a></td>
<td class="jd-descrcol" width="100%">
Subclass of <code><a href="../../../../reference/android/widget/FrameLayout.html">FrameLayout</a></code> that supports percentage based dimensions and
margins.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/percent/PercentRelativeLayout.html">PercentRelativeLayout</a></td>
<td class="jd-descrcol" width="100%">
Subclass of <code><a href="../../../../reference/android/widget/RelativeLayout.html">RelativeLayout</a></code> that supports percentage based dimensions and
margins.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/ProgressBar.html">ProgressBar</a></td>
<td class="jd-descrcol" width="100%">
<p>
Visual indicator of progress in some operation.
</td>
</tr>
<tr class="alt-color api apilevel-5" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/QuickContactBadge.html">QuickContactBadge</a></td>
<td class="jd-descrcol" width="100%">
Widget used to show an image with the standard QuickContact badge
and on-click behavior.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/RadioButton.html">RadioButton</a></td>
<td class="jd-descrcol" width="100%">
<p>
A radio button is a two-states button that can be either checked or
unchecked.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/RadioGroup.html">RadioGroup</a></td>
<td class="jd-descrcol" width="100%">
<p>This class is used to create a multiple-exclusion scope for a set of radio
buttons.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/RatingBar.html">RatingBar</a></td>
<td class="jd-descrcol" width="100%">
A RatingBar is an extension of SeekBar and ProgressBar that shows a rating in
stars.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v7/widget/RecyclerView.html">RecyclerView</a></td>
<td class="jd-descrcol" width="100%">
A flexible view for providing a limited window into a large data set.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/RelativeLayout.html">RelativeLayout</a></td>
<td class="jd-descrcol" width="100%">
A Layout where the positions of the children can be described in relation to each other or to the
parent.
</td>
</tr>
<tr class="alt-color api apilevel-21" >
<td class="jd-linkcol"><a href="../../../../reference/android/graphics/drawable/RippleDrawable.html">RippleDrawable</a></td>
<td class="jd-descrcol" width="100%">
Drawable that shows a ripple effect in response to state changes.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/graphics/drawable/RotateDrawable.html">RotateDrawable</a></td>
<td class="jd-descrcol" width="100%">
<p>
A Drawable that can rotate another Drawable based on the current level value.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v17/leanback/widget/RowHeaderView.html">RowHeaderView</a></td>
<td class="jd-descrcol" width="100%">
RowHeaderView is a header text view.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/graphics/drawable/ScaleDrawable.html">ScaleDrawable</a></td>
<td class="jd-descrcol" width="100%">
A Drawable that changes the size of another Drawable based on its current
level value.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/ScrollView.html">ScrollView</a></td>
<td class="jd-descrcol" width="100%">
Layout container for a view hierarchy that can be scrolled by the user,
allowing it to be larger than the physical display.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v17/leanback/widget/SearchBar.html">SearchBar</a></td>
<td class="jd-descrcol" width="100%">
A search widget containing a search orb and a text entry view.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v17/leanback/widget/SearchEditText.html">SearchEditText</a></td>
<td class="jd-descrcol" width="100%">
EditText widget that monitors keyboard changes.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v17/leanback/widget/SearchOrbView.html">SearchOrbView</a></td>
<td class="jd-descrcol" width="100%">
<p>A widget that draws a search affordance, represented by a round background and an icon.
</td>
</tr>
<tr class="alt-color api apilevel-11" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/SearchView.html">SearchView</a></td>
<td class="jd-descrcol" width="100%">
A widget that provides a user interface for the user to enter a search query and submit a request
to a search provider.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/SeekBar.html">SeekBar</a></td>
<td class="jd-descrcol" width="100%">
A SeekBar is an extension of ProgressBar that adds a draggable thumb.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v17/leanback/widget/ShadowOverlayContainer.html">ShadowOverlayContainer</a></td>
<td class="jd-descrcol" width="100%">
Provides an SDK version-independent wrapper to support shadows, color overlays, and rounded
corners.
</td>
</tr>
<tr class=" api apilevel-3" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/SlidingDrawer.html">SlidingDrawer</a></td>
<td class="jd-descrcol" width="100%">
<em>
This class was deprecated
in API level 17.
This class is not supported anymore. It is recommended you
base your own implementation on the source code for the Android Open
Source Project if you must use it in your application.
</em>
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v4/widget/SlidingPaneLayout.html">SlidingPaneLayout</a></td>
<td class="jd-descrcol" width="100%">
SlidingPaneLayout provides a horizontal, multi-pane layout for use at the top level
of a UI.
</td>
</tr>
<tr class=" api apilevel-14" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/Space.html">Space</a></td>
<td class="jd-descrcol" width="100%">
Space is a lightweight View subclass that may be used to create gaps between components
in general purpose layouts.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v17/leanback/widget/SpeechOrbView.html">SpeechOrbView</a></td>
<td class="jd-descrcol" width="100%">
A subclass of <code><a href="../../../../reference/android/support/v17/leanback/widget/SearchOrbView.html">SearchOrbView</a></code> that visualizes the state of an ongoing speech recognition.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/Spinner.html">Spinner</a></td>
<td class="jd-descrcol" width="100%">
A view that displays one child at a time and lets the user pick among them.
</td>
</tr>
<tr class="alt-color api apilevel-11" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/StackView.html">StackView</a></td>
<td class="jd-descrcol" width="100%">
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/graphics/drawable/StateListDrawable.html">StateListDrawable</a></td>
<td class="jd-descrcol" width="100%">
Lets you assign a number of graphic images to a single Drawable and swap out the visible item by a string
ID value.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/view/SurfaceView.html">SurfaceView</a></td>
<td class="jd-descrcol" width="100%">
Provides a dedicated drawing surface embedded inside of a view hierarchy.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v4/widget/SwipeRefreshLayout.html">SwipeRefreshLayout</a></td>
<td class="jd-descrcol" width="100%">
The SwipeRefreshLayout should be used whenever the user can refresh the
contents of a view via a vertical swipe gesture.
</td>
</tr>
<tr class="alt-color api apilevel-14" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/Switch.html">Switch</a></td>
<td class="jd-descrcol" width="100%">
A Switch is a two-state toggle switch widget that can select between two
options.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v7/widget/SwitchCompat.html">SwitchCompat</a></td>
<td class="jd-descrcol" width="100%">
SwitchCompat is a version of the Switch widget which on devices back to API v7.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/TabHost.html">TabHost</a></td>
<td class="jd-descrcol" width="100%">
Container for a tabbed window view.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/design/widget/TabLayout.html">TabLayout</a></td>
<td class="jd-descrcol" width="100%">
TabLayout provides a horizontal layout to display tabs.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/TabWidget.html">TabWidget</a></td>
<td class="jd-descrcol" width="100%">
Displays a list of tab labels representing each page in the parent's tab
collection.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/TableLayout.html">TableLayout</a></td>
<td class="jd-descrcol" width="100%">
<p>A layout that arranges its children into rows and columns.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/TableRow.html">TableRow</a></td>
<td class="jd-descrcol" width="100%">
<p>A layout that arranges its children horizontally.
</td>
</tr>
<tr class=" api apilevel-17" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/TextClock.html">TextClock</a></td>
<td class="jd-descrcol" width="100%">
<p><code>TextClock</code> can display the current date and/or time as
a formatted string.
</td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/design/widget/TextInputLayout.html">TextInputLayout</a></td>
<td class="jd-descrcol" width="100%">
Layout which wraps an <code><a href="../../../../reference/android/widget/EditText.html">EditText</a></code> (or descendant) to show a floating label
when the hint is hidden due to the user inputting text.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/TextSwitcher.html">TextSwitcher</a></td>
<td class="jd-descrcol" width="100%">
Specialized <code><a href="../../../../reference/android/widget/ViewSwitcher.html">ViewSwitcher</a></code> that contains
only children of type <code><a href="../../../../reference/android/widget/TextView.html">TextView</a></code>.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/TextView.html">TextView</a></td>
<td class="jd-descrcol" width="100%">
Displays text to the user and optionally allows them to edit it.
</td>
</tr>
<tr class=" api apilevel-14" >
<td class="jd-linkcol"><a href="../../../../reference/android/view/TextureView.html">TextureView</a></td>
<td class="jd-descrcol" width="100%">
<p>A TextureView can be used to display a content stream.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/TimePicker.html">TimePicker</a></td>
<td class="jd-descrcol" width="100%">
A widget for selecting the time of day, in either 24-hour or AM/PM mode.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v17/leanback/widget/TitleView.html">TitleView</a></td>
<td class="jd-descrcol" width="100%">
Title view for a leanback fragment.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/ToggleButton.html">ToggleButton</a></td>
<td class="jd-descrcol" width="100%">
Displays checked/unchecked states as a button
with a "light" indicator and by default accompanied with the text "ON" or "OFF".
</td>
</tr>
<tr class=" api apilevel-21" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/Toolbar.html">Toolbar</a></td>
<td class="jd-descrcol" width="100%">
A standard toolbar for use within application content.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/graphics/drawable/TransitionDrawable.html">TransitionDrawable</a></td>
<td class="jd-descrcol" width="100%">
An extension of LayerDrawables that is intended to cross-fade between
the first and second layer.
</td>
</tr>
<tr class=" api apilevel-21" >
<td class="jd-linkcol"><a href="../../../../reference/android/media/tv/TvView.html">TvView</a></td>
<td class="jd-descrcol" width="100%">
Displays TV contents.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/TwoLineListItem.html">TwoLineListItem</a></td>
<td class="jd-descrcol" width="100%">
<em>
This class was deprecated
in API level 17.
This class can be implemented easily by apps using a <code><a href="../../../../reference/android/widget/RelativeLayout.html">RelativeLayout</a></code>
or a <code><a href="../../../../reference/android/widget/LinearLayout.html">LinearLayout</a></code>.
</em>
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v17/leanback/widget/VerticalGridView.html">VerticalGridView</a></td>
<td class="jd-descrcol" width="100%">
A <code><a href="../../../../reference/android/view/ViewGroup.html">ViewGroup</a></code> that shows items in a vertically scrolling list.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/VideoView.html">VideoView</a></td>
<td class="jd-descrcol" width="100%">
Displays a video file.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/view/View.html">View</a></td>
<td class="jd-descrcol" width="100%">
<p>
This class represents the basic building block for user interface components.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/ViewAnimator.html">ViewAnimator</a></td>
<td class="jd-descrcol" width="100%">
Base class for a <code><a href="../../../../reference/android/widget/FrameLayout.html">FrameLayout</a></code> container that will perform animations
when switching between its views.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/ViewFlipper.html">ViewFlipper</a></td>
<td class="jd-descrcol" width="100%">
Simple <code><a href="../../../../reference/android/widget/ViewAnimator.html">ViewAnimator</a></code> that will animate between two or more views
that have been added to it.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/view/ViewGroup.html">ViewGroup</a></td>
<td class="jd-descrcol" width="100%">
<p>
A <code>ViewGroup</code> is a special view that can contain other views
(called children.) The view group is the base class for layouts and views
containers.
</td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../reference/android/support/v4/view/ViewPager.html">ViewPager</a></td>
<td class="jd-descrcol" width="100%">
Layout manager that allows the user to flip left and right
through pages of data.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/view/ViewStub.html">ViewStub</a></td>
<td class="jd-descrcol" width="100%">
A ViewStub is an invisible, zero-sized View that can be used to lazily inflate
layout resources at runtime.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/ViewSwitcher.html">ViewSwitcher</a></td>
<td class="jd-descrcol" width="100%">
<code><a href="../../../../reference/android/widget/ViewAnimator.html">ViewAnimator</a></code> that switches between two views, and has a factory
from which these views are created.
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/webkit/WebView.html">WebView</a></td>
<td class="jd-descrcol" width="100%">
<p>A View that displays web pages.
</td>
</tr>
<tr class=" api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/ZoomButton.html">ZoomButton</a></td>
<td class="jd-descrcol" width="100%">
</td>
</tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-linkcol"><a href="../../../../reference/android/widget/ZoomControls.html">ZoomControls</a></td>
<td class="jd-descrcol" width="100%">
The <code>ZoomControls</code> class displays a simple set of controls used for zooming and
provides callbacks to register for events.
</td>
</tr>
</table>
</div>
</div>
</td></tr></table>
<div class="jd-descr">
<h2>Class Overview</h2>
<p itemprop="articleBody">Implement this interface if you want to create an animated drawable that
extends <code><a href="../../../../reference/android/graphics/drawable/Drawable.html">Drawable</a></code>.
Upon retrieving a drawable, use
<code><a href="../../../../reference/android/graphics/drawable/Drawable.html#setCallback(android.graphics.drawable.Drawable.Callback)">setCallback(android.graphics.drawable.Drawable.Callback)</a></code>
to supply your implementation of the interface to the drawable; it uses
this interface to schedule and execute animation changes.
</p>
</div><!-- jd-descr -->
<div class="jd-descr">
<h2>Summary</h2>
<!-- ========== METHOD SUMMARY =========== -->
<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
abstract
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../../reference/android/graphics/drawable/Drawable.Callback.html#invalidateDrawable(android.graphics.drawable.Drawable)">invalidateDrawable</a></span>(<a href="../../../../reference/android/graphics/drawable/Drawable.html">Drawable</a> who)</nobr>
<div class="jd-descrdiv">
Called when the drawable needs to be redrawn.
</div>
</td></tr>
<tr class=" api apilevel-1" >
<td class="jd-typecol"><nobr>
abstract
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../../reference/android/graphics/drawable/Drawable.Callback.html#scheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable, long)">scheduleDrawable</a></span>(<a href="../../../../reference/android/graphics/drawable/Drawable.html">Drawable</a> who, <a href="../../../../reference/java/lang/Runnable.html">Runnable</a> what, long when)</nobr>
<div class="jd-descrdiv">
A Drawable can call this to schedule the next frame of its
animation.
</div>
</td></tr>
<tr class="alt-color api apilevel-1" >
<td class="jd-typecol"><nobr>
abstract
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../../reference/android/graphics/drawable/Drawable.Callback.html#unscheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable)">unscheduleDrawable</a></span>(<a href="../../../../reference/android/graphics/drawable/Drawable.html">Drawable</a> who, <a href="../../../../reference/java/lang/Runnable.html">Runnable</a> what)</nobr>
<div class="jd-descrdiv">
A Drawable can call this to unschedule an action previously
scheduled with <code><a href="../../../../reference/android/graphics/drawable/Drawable.Callback.html#scheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable, long)">scheduleDrawable(Drawable, Runnable, long)</a></code>.
</div>
</td></tr>
</table>
</div><!-- jd-descr (summary) -->
<!-- Details -->
<!-- XML Attributes -->
<!-- Enum Values -->
<!-- Constants -->
<!-- Fields -->
<!-- Public ctors -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- Protected ctors -->
<!-- ========= METHOD DETAIL ======== -->
<!-- Public methdos -->
<h2>Public Methods</h2>
<A NAME="invalidateDrawable(android.graphics.drawable.Drawable)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
abstract
void
</span>
<span class="sympad">invalidateDrawable</span>
<span class="normal">(<a href="../../../../reference/android/graphics/drawable/Drawable.html">Drawable</a> who)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Called when the drawable needs to be redrawn. A view at this point
should invalidate itself (or at least the part of itself where the
drawable appears).</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Parameters</h5>
<table class="jd-tagtable">
<tr>
<th>who</td>
<td>The drawable that is requesting the update.
</td>
</tr>
</table>
</div>
</div>
</div>
<A NAME="scheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable, long)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
abstract
void
</span>
<span class="sympad">scheduleDrawable</span>
<span class="normal">(<a href="../../../../reference/android/graphics/drawable/Drawable.html">Drawable</a> who, <a href="../../../../reference/java/lang/Runnable.html">Runnable</a> what, long when)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>A Drawable can call this to schedule the next frame of its
animation. An implementation can generally simply call
<code><a href="../../../../reference/android/os/Handler.html#postAtTime(java.lang.Runnable, java.lang.Object, long)">postAtTime(Runnable, Object, long)</a></code> with
the parameters <var>(what, who, when)</var> to perform the
scheduling.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Parameters</h5>
<table class="jd-tagtable">
<tr>
<th>who</td>
<td>The drawable being scheduled.</td>
</tr>
<tr>
<th>what</td>
<td>The action to execute.</td>
</tr>
<tr>
<th>when</td>
<td>The time (in milliseconds) to run. The timebase is
<code><a href="../../../../reference/android/os/SystemClock.html#uptimeMillis()">uptimeMillis()</a></code>
</td>
</tr>
</table>
</div>
</div>
</div>
<A NAME="unscheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable)"></A>
<div class="jd-details api apilevel-1">
<h4 class="jd-details-title">
<span class="normal">
public
abstract
void
</span>
<span class="sympad">unscheduleDrawable</span>
<span class="normal">(<a href="../../../../reference/android/graphics/drawable/Drawable.html">Drawable</a> who, <a href="../../../../reference/java/lang/Runnable.html">Runnable</a> what)</span>
</h4>
<div class="api-level">
<div>
Added in <a href="../../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>A Drawable can call this to unschedule an action previously
scheduled with <code><a href="../../../../reference/android/graphics/drawable/Drawable.Callback.html#scheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable, long)">scheduleDrawable(Drawable, Runnable, long)</a></code>. An implementation can
generally simply call
<code><a href="../../../../reference/android/os/Handler.html#removeCallbacks(java.lang.Runnable, java.lang.Object)">removeCallbacks(Runnable, Object)</a></code> with
the parameters <var>(what, who)</var> to unschedule the drawable.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Parameters</h5>
<table class="jd-tagtable">
<tr>
<th>who</td>
<td>The drawable being unscheduled.</td>
</tr>
<tr>
<th>what</td>
<td>The action being unscheduled.
</td>
</tr>
</table>
</div>
</div>
</div>
<!-- ========= METHOD DETAIL ======== -->
<!-- ========= END OF CLASS DATA ========= -->
<A NAME="navbar_top"></A>
</div> <!-- jd-content -->
<div class="wrap">
<div class="dac-footer">
<div class="cols dac-footer-main">
<div class="col-1of2">
<a class="dac-footer-getnews" data-modal-toggle="newsletter" href="javascript:;">Get news & tips <span
class="dac-fab dac-primary"><i class="dac-sprite dac-mail"></i></span></a>
</div>
<div class="col-1of2 dac-footer-reachout">
<div class="dac-footer-contact">
<a class="dac-footer-contact-link" href="http://android-developers.blogspot.com/">Blog</a>
<a class="dac-footer-contact-link" href="/support.html">Support</a>
</div>
<div class="dac-footer-social">
<a class="dac-fab dac-footer-social-link" href="https://www.youtube.com/user/androiddevelopers"><i class="dac-sprite dac-youtube"></i></a>
<a class="dac-fab dac-footer-social-link" href="https://plus.google.com/+AndroidDevelopers"><i class="dac-sprite dac-gplus"></i></a>
<a class="dac-fab dac-footer-social-link" href="https://twitter.com/AndroidDev"><i class="dac-sprite dac-twitter"></i></a>
</div>
</div>
</div>
<hr class="dac-footer-separator"/>
<p class="dac-footer-copyright">
Except as noted, this content is licensed under <a
href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>.
For details and restrictions, see the <a href="../../../../license.html">
Content License</a>.
</p>
<p class="dac-footer-build">
Android 6.0 r1 —
<script src="../../../../timestamp.js" type="text/javascript"></script>
<script>document.write(BUILD_TIMESTAMP)</script>
</p>
<p class="dac-footer-links">
<a href="/about/index.html">About Android</a>
<a href="/auto/index.html">Auto</a>
<a href="/tv/index.html">TV</a>
<a href="/wear/index.html">Wear</a>
<a href="/legal.html">Legal</a>
<span id="language" class="locales">
<select name="language" onchange="changeLangPref(this.value, true)">
<option value="en" selected="selected">English</option>
<option value="es">Español</option>
<option value="ja">日本語</option>
<option value="ko">한국어</option>
<option value="pt-br">Português Brasileiro</option>
<option value="ru">Русский</option>
<option value="zh-cn">中文(简体)</option>
<option value="zh-tw">中文(繁體)</option>
</select>
</span>
</p>
</div>
</div> <!-- end footer -->
<div data-modal="newsletter" data-newsletter data-swap class="dac-modal newsletter">
<div class="dac-modal-container">
<div class="dac-modal-window">
<header class="dac-modal-header">
<button class="dac-modal-header-close" data-modal-toggle><i class="dac-sprite dac-close"></i></button>
<div class="dac-swap" data-swap-container>
<section class="dac-swap-section dac-active dac-down">
<h2 class="norule dac-modal-header-title">Get the latest Android developer news and tips that will help you find success on Google Play.</h2>
<p class="dac-modal-header-subtitle">* Required Fields</p>
</section>
<section class="dac-swap-section dac-up">
<h2 class="norule dac-modal-header-title">Hooray!</h2>
</section>
</div>
</header>
<div class="dac-swap" data-swap-container>
<section class="dac-swap-section dac-active dac-left">
<form action="https://docs.google.com/forms/d/1QgnkzbEJIDu9lMEea0mxqWrXUJu0oBCLD7ar23V0Yys/formResponse" class="dac-form" method="post" target="dac-newsletter-iframe">
<section class="dac-modal-content">
<fieldset class="dac-form-fieldset">
<div class="cols">
<div class="col-1of2 newsletter-leftCol">
<div class="dac-form-input-group">
<label for="newsletter-full-name" class="dac-form-floatlabel">Full name</label>
<input type="text" class="dac-form-input" name="entry.1357890476" id="newsletter-full-name" required>
<span class="dac-form-required">*</span>
</div>
<div class="dac-form-input-group">
<label for="newsletter-email" class="dac-form-floatlabel">Email address</label>
<input type="email" class="dac-form-input" name="entry.472100832" id="newsletter-email" required>
<span class="dac-form-required">*</span>
</div>
</div>
<div class="col-1of2 newsletter-rightCol">
<div class="dac-form-input-group">
<label for="newsletter-company" class="dac-form-floatlabel">Company / developer name</label>
<input type="text" class="dac-form-input" name="entry.1664780309" id="newsletter-company">
</div>
<div class="dac-form-input-group">
<label for="newsletter-play-store" class="dac-form-floatlabel">One of your Play Store app URLs</label>
<input type="url" class="dac-form-input" name="entry.47013838" id="newsletter-play-store" required>
<span class="dac-form-required">*</span>
</div>
</div>
</div>
</fieldset>
<fieldset class="dac-form-fieldset">
<div class="cols">
<div class="col-1of2 newsletter-leftCol">
<legend class="dac-form-legend">Which best describes your business:<span class="dac-form-required">*</span>
</legend>
<div class="dac-form-radio-group">
<input type="radio" value="Apps" class="dac-form-radio" name="entry.1796324055" id="newsletter-business-type-app" required>
<label for="newsletter-business-type-app" class="dac-form-radio-button"></label>
<label for="newsletter-business-type-app" class="dac-form-label">Apps</label>
</div>
<div class="dac-form-radio-group">
<input type="radio" value="Games" class="dac-form-radio" name="entry.1796324055" id="newsletter-business-type-games" required>
<label for="newsletter-business-type-games" class="dac-form-radio-button"></label>
<label for="newsletter-business-type-games" class="dac-form-label">Games</label>
</div>
<div class="dac-form-radio-group">
<input type="radio" value="Apps and Games" class="dac-form-radio" name="entry.1796324055" id="newsletter-business-type-appsgames" required>
<label for="newsletter-business-type-appsgames" class="dac-form-radio-button"></label>
<label for="newsletter-business-type-appsgames" class="dac-form-label">Apps & Games</label>
</div>
</div>
<div class="col-1of2 newsletter-rightCol newsletter-checkboxes">
<div class="dac-form-radio-group">
<div class="dac-media">
<div class="dac-media-figure">
<input type="checkbox" class="dac-form-checkbox" name="entry.732309842" id="newsletter-add" required value="Add me to the mailing list for the monthly newsletter and occasional emails about development and Google Play opportunities.">
<label for="newsletter-add" class="dac-form-checkbox-button"></label>
</div>
<div class="dac-media-body">
<label for="newsletter-add" class="dac-form-label dac-form-aside">Add me to the mailing list for the monthly newsletter and occasional emails about development and Google Play opportunities.<span class="dac-form-required">*</span></label>
</div>
</div>
</div>
<div class="dac-form-radio-group">
<div class="dac-media">
<div class="dac-media-figure">
<input type="checkbox" class="dac-form-checkbox" name="entry.2045036090" id="newsletter-terms" required value="I acknowledge that the information provided in this form will be subject to Google's privacy policy (https://www.google.com/policies/privacy/).">
<label for="newsletter-terms" class="dac-form-checkbox-button"></label>
</div>
<div class="dac-media-body">
<label for="newsletter-terms" class="dac-form-label dac-form-aside">I acknowledge that the information provided in this form will be subject to <a href="https://www.google.com/policies/privacy/">Google's privacy policy</a>.<span class="dac-form-required">*</span></label>
</div>
</div>
</div>
</div>
</div>
</fieldset>
</section>
<footer class="dac-modal-footer">
<div class="cols">
<div class="col-2of5">
</div>
</div>
<button type="submit" value="Submit" class="dac-fab dac-primary dac-large dac-modal-action"><i class="dac-sprite dac-arrow-right"></i></button>
</footer>
</form>
</section>
<section class="dac-swap-section dac-right">
<div class="dac-modal-content">
<p class="newsletter-success-message">
You have successfully signed up for the latest Android developer news and tips.
</p>
</div>
</section>
</div>
</div>
</div>
</div> <!-- end footer -->
</div><!-- end doc-content -->
</div> <!-- end .cols -->
</div> <!-- end body-content -->
</body>
</html>
| {
"content_hash": "f8809989b541e50c77fc6d8fdcea1286",
"timestamp": "",
"source": "github",
"line_count": 3367,
"max_line_length": 399,
"avg_line_length": 39.01989901989902,
"alnum_prop": 0.5852108387882479,
"repo_name": "anas-ambri/androidcompat",
"id": "dc36e33453f7a3d5ebadbc96c4895e885ffdfc13",
"size": "131707",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/android/graphics/drawable/Drawable.Callback.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "261862"
},
{
"name": "HTML",
"bytes": "581707522"
},
{
"name": "JavaScript",
"bytes": "639438"
},
{
"name": "Makefile",
"bytes": "229"
},
{
"name": "Shell",
"bytes": "138"
}
],
"symlink_target": ""
} |
package networking
import (
"fmt"
"io/ioutil"
"log"
"os"
"path"
"sort"
"github.com/coreos/rkt/common"
rktnet "github.com/coreos/rkt/networking/net"
)
// Net encodes a network plugin.
type Net struct {
rktnet.Net
args string
}
// Absolute path where users place their net configs
const UserNetPath = "/etc/rkt/net.d"
// Default net path relative to stage1 root
const DefaultNetPath = "etc/rkt/net.d/99-default.conf"
func listFiles(dir string) ([]string, error) {
dirents, err := ioutil.ReadDir(dir)
switch {
case err == nil:
case os.IsNotExist(err):
return nil, nil
default:
return nil, err
}
files := []string{}
for _, dent := range dirents {
if dent.IsDir() {
continue
}
files = append(files, dent.Name())
}
return files, nil
}
func netExists(nets []Net, name string) bool {
for _, n := range nets {
if n.Name == name {
return true
}
}
return false
}
func loadUserNets() ([]Net, error) {
files, err := listFiles(UserNetPath)
if err != nil {
return nil, err
}
sort.Strings(files)
nets := make([]Net, 0, len(files))
for _, filename := range files {
filepath := path.Join(UserNetPath, filename)
n := Net{}
if err := rktnet.LoadNet(filepath, &n); err != nil {
return nil, fmt.Errorf("error loading %v: %v", filepath, err)
}
if n.Name == "default" {
log.Printf(`Overriding "default" network with %v`, filename)
}
if netExists(nets, n.Name) {
// "default" is slightly special
log.Printf("%q network already defined, ignoring %v", filename)
continue
}
nets = append(nets, n)
}
return nets, nil
}
// Loads nets specified by user and default one from stage1
func (e *podEnv) loadNets() ([]Net, error) {
nets, err := loadUserNets()
if err != nil {
return nil, err
}
if !netExists(nets, "default") {
defPath := path.Join(common.Stage1RootfsPath(e.rktRoot), DefaultNetPath)
defNet := Net{}
if err := rktnet.LoadNet(defPath, &defNet); err != nil {
return nil, fmt.Errorf("error loading net: %v", err)
}
nets = append(nets, defNet)
}
return nets, nil
}
| {
"content_hash": "10054e3fb5736f0532468a23d5b5defe",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 74,
"avg_line_length": 19.14814814814815,
"alnum_prop": 0.6484526112185687,
"repo_name": "ramitsurana05/rkt",
"id": "4fb06899008b430aa37b653b447a924bc5003904",
"size": "2658",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "networking/net.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "20564"
},
{
"name": "Go",
"bytes": "392294"
},
{
"name": "Makefile",
"bytes": "5718"
},
{
"name": "Shell",
"bytes": "15275"
}
],
"symlink_target": ""
} |
using System.Collections.Generic;
namespace KeahelnawwalyoNelwerchaje
{
public class Device
{
public string MainIp { set; get; }
public int DeviceCount { set; get; }
public List<Node> NodeList { set; get; }
}
} | {
"content_hash": "41f6d8b48e08212aa647cb765d34065a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 48,
"avg_line_length": 19.153846153846153,
"alnum_prop": 0.6345381526104418,
"repo_name": "lindexi/lindexi_gd",
"id": "b8813c0426d6733d4b5834a879b2b3114700ea5a",
"size": "249",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "KeahelnawwalyoNelwerchaje/KeahelnawwalyoNelwerchaje/Device.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP.NET",
"bytes": "29822"
},
{
"name": "Batchfile",
"bytes": "57394"
},
{
"name": "C",
"bytes": "983450"
},
{
"name": "C#",
"bytes": "36237467"
},
{
"name": "C++",
"bytes": "316762"
},
{
"name": "CSS",
"bytes": "121116"
},
{
"name": "Dockerfile",
"bytes": "882"
},
{
"name": "HTML",
"bytes": "113044"
},
{
"name": "JavaScript",
"bytes": "3323"
},
{
"name": "Q#",
"bytes": "556"
},
{
"name": "Roff",
"bytes": "450615"
},
{
"name": "ShaderLab",
"bytes": "3270"
},
{
"name": "Smalltalk",
"bytes": "18"
},
{
"name": "TSQL",
"bytes": "23558"
}
],
"symlink_target": ""
} |
import sys
import time
import threading
import random
import telepot
import pickledb
import os
from telepot.namedtuple import ReplyKeyboardMarkup, KeyboardButton, ReplyKeyboardHide, ForceReply
from telepot.namedtuple import InlineKeyboardMarkup, InlineKeyboardButton
from telepot.namedtuple import InlineQueryResultArticle, InlineQueryResultPhoto, InputTextMessageContent
"""
$ python3.4 skeleton_extend.py <token>
A skeleton for your telepot programs - extend from `Bot` and define handler methods as needed.
"""
db = pickledb.load(os.environ['HOME'] + '/douglas_db/douglas.db', True)
class DogBot(telepot.Bot):
def __init__(self, *args, **kwargs):
super(DogBot, self).__init__(*args, **kwargs)
self._answerer = telepot.helper.Answerer(self)
self._message_with_inline_keyboard = None
def on_chat_message(self, msg):
content_type, chat_type, chat_id = telepot.glance(msg)
print('Chat:', content_type, chat_type, chat_id)
if content_type != 'text':
return
command = msg['text'][-1:].lower()
if command == 'c':
markup = ReplyKeyboardMarkup(keyboard=[
['Plain text', KeyboardButton(text='Text only')],
[dict(text='Phone', request_contact=True), KeyboardButton(text='Location', request_location=True)],
])
self.sendMessage(chat_id, 'Custom keyboard with various buttons', reply_markup=markup)
elif command == 'i':
markup = InlineKeyboardMarkup(inline_keyboard=[
[dict(text='Telegram URL', url='https://core.telegram.org/')],
[InlineKeyboardButton(text='Callback - show notification', callback_data='notification')],
[dict(text='Callback - show alert', callback_data='alert')],
[InlineKeyboardButton(text='Callback - edit message', callback_data='edit')],
[dict(text='Switch to using bot inline', switch_inline_query='initial query')],
])
self._message_with_inline_keyboard = self.sendMessage(chat_id, 'Inline keyboard with various buttons', reply_markup=markup)
elif command == 'h':
markup = ReplyKeyboardHide()
self.sendMessage(chat_id, 'Hide custom keyboard', reply_markup=markup)
elif command == 'f':
markup = ForceReply()
self.sendMessage(chat_id, 'Force reply', reply_markup=markup)
def on_callback_query(self, msg):
query_id, from_id, data = telepot.glance(msg, flavor='callback_query')
print('Callback query:', query_id, from_id, data)
if data == 'notification':
self.answerCallbackQuery(query_id, text='Notification at top of screen')
elif data == 'alert':
self.answerCallbackQuery(query_id, text='Alert!', show_alert=True)
elif data == 'edit':
if self._message_with_inline_keyboard:
msgid = (from_id, self._message_with_inline_keyboard['message_id'])
self.editMessageText(msgid, 'NEW MESSAGE HERE!!!!!')
else:
self.answerCallbackQuery(query_id, text='No previous message to edit')
def on_inline_query(self, msg):
def compute():
query_id, from_id, query_string = telepot.glance(msg, flavor='inline_query')
print('%s: Computing for: %s' % (threading.current_thread().name, query_string))
articles = [InlineQueryResultArticle(
id='abcde', title='Telegram', input_message_content=InputTextMessageContent(message_text='Telegram is a messaging app')),
dict(type='article',
id='fghij', title='Google', input_message_content=dict(message_text='Google is a search engine'))]
photo1_url = 'https://core.telegram.org/file/811140934/1/tbDSLHSaijc/fdcc7b6d5fb3354adf'
photo2_url = 'https://www.telegram.org/img/t_logo.png'
photos = [InlineQueryResultPhoto(
id='12345', photo_url=photo1_url, thumb_url=photo1_url),
dict(type='photo',
id='67890', photo_url=photo2_url, thumb_url=photo2_url)]
result_type = query_string[-1:].lower()
if result_type == 'a':
return articles
elif result_type == 'p':
return photos
else:
results = articles if random.randint(0,1) else photos
if result_type == 'b':
return dict(results=results, switch_pm_text='Back to Bot', switch_pm_parameter='Optional start parameter')
else:
return dict(results=results)
self._answerer.answer(msg, compute)
def on_chosen_inline_result(self, msg):
result_id, from_id, query_string = telepot.glance(msg, flavor='chosen_inline_result')
print('Chosen Inline Result:', result_id, from_id, query_string)
bot = DogBot(db.get('TOKEN'))
bot.message_loop()
print('Listening ...')
# Keep the program running.
while 1:
time.sleep(10)
| {
"content_hash": "123337dc192013905859c1dc15cceefc",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 149,
"avg_line_length": 44.41880341880342,
"alnum_prop": 0.6024629593996537,
"repo_name": "alexfalcucc/douglas_bot",
"id": "1dadd7f551908f567c02e7db5c63d3ada9f30975",
"size": "5197",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "skeleton_class.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "64740"
}
],
"symlink_target": ""
} |
package org.onosproject.ovsdb.rfc.message;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Map;
import java.util.Objects;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
/**
* TableUpdate is an object that maps from the row's UUID to a RowUpdate object.
*/
public final class TableUpdate {
private final Map<UUID, RowUpdate> rows;
/**
* Constructs a TableUpdate object.
* @param rows the parameter of TableUpdate entity
*/
private TableUpdate(Map<UUID, RowUpdate> rows) {
this.rows = rows;
}
/**
* Get TableUpdate entity.
* @param rows the parameter of TableUpdate entity
* @return TableUpdate entity
*/
public static TableUpdate tableUpdate(Map<UUID, RowUpdate> rows) {
checkNotNull(rows, "rows cannot be null");
return new TableUpdate(rows);
}
/**
* Return old row.
* @param uuid the key of rows
* @return Row old row
*/
public Row getOld(UUID uuid) {
RowUpdate rowUpdate = rows.get(uuid);
if (rowUpdate == null) {
return null;
}
return rowUpdate.oldRow();
}
/**
* Return new row.
* @param uuid the key of rows
* @return Row new row
*/
public Row getNew(UUID uuid) {
RowUpdate rowUpdate = rows.get(uuid);
if (rowUpdate == null) {
return null;
}
return rowUpdate.newRow();
}
/**
* Return rows.
* @return rows
*/
public Map<UUID, RowUpdate> rows() {
return rows;
}
@Override
public int hashCode() {
return Objects.hash(rows);
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof TableUpdate) {
final TableUpdate other = (TableUpdate) obj;
return Objects.equals(this.rows, other.rows);
}
return false;
}
@Override
public String toString() {
return toStringHelper(this).add("rows", rows).toString();
}
}
| {
"content_hash": "9ab0322f8e1f2b5914f1cb919a705edf",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 80,
"avg_line_length": 24.806451612903224,
"alnum_prop": 0.5743389683571738,
"repo_name": "kuangrewawa/OnosFw",
"id": "4b18d96d266be12da07b5d5f0714bd9437488b8a",
"size": "2930",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/TableUpdate.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "66669"
},
{
"name": "HTML",
"bytes": "456196"
},
{
"name": "Java",
"bytes": "10031446"
},
{
"name": "JavaScript",
"bytes": "608492"
},
{
"name": "Shell",
"bytes": "2625"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
Mycol. Writ. 4: 11 (1914)
#### Original name
Odontia crocea Lloyd
### Remarks
null | {
"content_hash": "94de6991bbd6e5cd81d4172c47923213",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 25,
"avg_line_length": 11.23076923076923,
"alnum_prop": 0.684931506849315,
"repo_name": "mdoering/backbone",
"id": "d65e01599c6985ac5850ad15848274412260c69b",
"size": "190",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Basidiomycota/Agaricomycetes/Polyporales/Meruliaceae/Steccherinum/Odontia crocea/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
**Karo** is a command line companion for a rails application which makes performing routine commands locally or on the server easier.
Example of things it can do, for rest please refer to ```karo help```
```bash
karo db pull # Will sync the production MySQL database on to local machine
karo db console # Will open MySQL console on the server
karo console # Will open Rails console on the server
karo assets pull -e staging # Will sync the dragonfly assets from staging on to the local machine
karo log -f # Will tail the production log with -f argument
karo vim app/models/user.rb # Will open the user.rb file on the server using vim for editing
```
You can also write your custom commands
```bash
karo server {command} # Will try to find a command from .karo.yml or execute the one provided on the server
karo client {command} # Will try to find a command from .karo.yml or execute the one provided on the client
```
## Few Assumptions
- You have SSH access to your servers
- You have the [Capistrano](https://github.com/capistrano/capistrano) deploy directory structure on your server
[deploy_to]
[deploy_to]/releases
[deploy_to]/releases/20080819001122
[deploy_to]/releases/...
[deploy_to]/shared
[deploy_to]/shared/config/database.yml
[deploy_to]/shared/log
[deploy_to]/shared/pids
[deploy_to]/shared/system
[deploy_to]/current -> [deploy_to]/releases/20100819001122
- You are using MySQL as your database server
- You are using Dragonfly to store your assets
I am working on supporting other databases and assets managers for future releases
## Installation
Karo is released as a Ruby Gem. The gem is to be installed within a Ruby
on Rails application. To install, simply add the following to your Gemfile:
```ruby
# Gemfile
gem 'karo'
```
After updating your bundle, you can use Karo function from the command line
## Usage (command line)
```bash
karo help
```
## Default configuration file (.karo.yml)
```yml
production:
host: example.com
user: deploy
path: /data/app_name
commands:
server:
memory: watch vmstat -sSM
top_5_memory: ps aux | sort -nk +4 | tail
client:
deploy: cap production deploy
staging:
host: example.com
user: deploy
path: /data/app_name
commands:
server:
memory: vmstat -sSM
client:
deploy: ey deploy -e staging -r staging
```
| {
"content_hash": "20dcc119391a49dadca920a04d407690",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 133,
"avg_line_length": 29.4125,
"alnum_prop": 0.730556736081598,
"repo_name": "dbezborodovrp/karo",
"id": "359ce6767de20313616778f642b05b1e5025ad79",
"size": "2850",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Cucumber",
"bytes": "842"
},
{
"name": "Ruby",
"bytes": "23417"
}
],
"symlink_target": ""
} |
require "spec_helper"
describe Lita::Handlers::Gimli, lita_handler: true do
it { is_expected.to route("Anything").to(:contribute_an_axe) }
describe "#contribute_an_axe" do
context "two fellowship members have contributed" do
it "contributes an axe" do
send_message "AND you'll have my sword..."
send_message "AND my bow!"
expect(replies.last).to eq("AND MY AXE!")
end
context "another fellowship member contributes after Gimli pipes in" do
it "Gimli only contributes one axe" do
send_message "AND you'll have my sword..."
expect{
send_message "AND my bow!"
}.to change(replies, :count).by 1
expect {
send_message "AND also some other weapon!"
}.to_not change(replies, :count)
end
end
context "fellowship member messages are case insensitive" do
it "contributes an axe" do
send_message "and you'll have my sword..."
send_message "AnD my bow!"
expect(replies.last).to eq("AND MY AXE!")
end
end
end
context "no fellowship members have contributed" do
it "does nothing" do
send_message "share the load, frodo"
expect(replies.last).to be_nil
end
end
context "only one fellowship member has contributed" do
it "does nothing" do
send_message "AND my bow!"
expect(replies.last).to be_nil
end
end
end
end
| {
"content_hash": "067bf7e6080ff7ab4a3c25da3539e753",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 77,
"avg_line_length": 29.137254901960784,
"alnum_prop": 0.6049798115746972,
"repo_name": "gschorkopf/lita-gimli",
"id": "0999a593b5a8917423306f61711046cc11437142",
"size": "1486",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/lita/handlers/gimli_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "4169"
}
],
"symlink_target": ""
} |
// HTMLParser Library $Name: $ - A java-based parser for HTML
// http://sourceforge.org/projects/htmlparser
// Copyright (C) 2004 Somik Raha
//
//
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
package org.htmlparser.tags;
//import checkers.inference.ownership.quals.*;
/**
* A text area tag within a form.
*/
public class TextareaTag extends CompositeTag
{
/**
* The set of names handled by this tag.
*/
private static final String[] mIds = new String[] {"TEXTAREA"};
/**
* The set of tag names that indicate the end of this tag.
*/
private static final String[] mEnders = new String[] {"INPUT", "TEXTAREA", "SELECT", "OPTION"};
/**
* The set of end tag names that indicate the end of this tag.
*/
private static final String[] mEndTagEnders = new String[] {"FORM", "BODY", "HTML"};
/**
* Create a new text area tag.
*/
public TextareaTag ()
{
}
/**
* Return the set of names handled by this tag.
* @return The names to be matched that create tags of this type.
*/
public String[] getIds ()
{
return (mIds);
}
/**
* Return the set of tag names that cause this tag to finish.
* @return The names of following tags that stop further scanning.
*/
public String[] getEnders ()
{
return (mEnders);
}
/**
* Return the set of end tag names that cause this tag to finish.
* @return The names of following end tags that stop further scanning.
*/
public String[] getEndTagEnders ()
{
return (mEndTagEnders);
}
/**
* Return the plain text contents from this text area.
* @return The text of the children of this <code>TEXTAREA</code> tag.
*/
public String getValue() {
return toPlainTextString();
}
}
| {
"content_hash": "a97b7ce9142930a1f7d70ae57612087b",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 99,
"avg_line_length": 29.38372093023256,
"alnum_prop": 0.6485951721408785,
"repo_name": "kcsl/immutability-benchmark",
"id": "491da65a5dc67da751e581382f0991ad47cce8fb",
"size": "2527",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "benchmark-applications/reiminfer-oopsla-2012/source/HTMLParser/src/org/htmlparser/tags/TextareaTag.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "166132"
},
{
"name": "Java",
"bytes": "21727669"
},
{
"name": "Lex",
"bytes": "26800"
},
{
"name": "Makefile",
"bytes": "14271"
},
{
"name": "Rascal",
"bytes": "264"
},
{
"name": "Ruby",
"bytes": "6521"
},
{
"name": "Shell",
"bytes": "1343"
}
],
"symlink_target": ""
} |
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<metainfo>
<schemaVersion>2.0</schemaVersion>
<services>
<service>
<name>SQOOP</name>
<version>1.4.6.2.5</version>
<configuration-dependencies>
<config-type>application-properties</config-type>
</configuration-dependencies>
</service>
</services>
</metainfo>
| {
"content_hash": "e7f1b423f77fe8c74097f8f166323446",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 75,
"avg_line_length": 38.86206896551724,
"alnum_prop": 0.7240461401952085,
"repo_name": "radicalbit/ambari",
"id": "f4e2e9557ef167bd9335825c69029156dc870028",
"size": "1127",
"binary": false,
"copies": "3",
"ref": "refs/heads/trunk",
"path": "ambari-server/src/main/resources/stacks/HDP/2.5/services/SQOOP/metainfo.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "42212"
},
{
"name": "C",
"bytes": "331204"
},
{
"name": "C#",
"bytes": "182799"
},
{
"name": "C++",
"bytes": "257"
},
{
"name": "CSS",
"bytes": "1287531"
},
{
"name": "CoffeeScript",
"bytes": "4323"
},
{
"name": "FreeMarker",
"bytes": "2654"
},
{
"name": "Groovy",
"bytes": "88056"
},
{
"name": "HTML",
"bytes": "5098825"
},
{
"name": "Java",
"bytes": "29006663"
},
{
"name": "JavaScript",
"bytes": "17274453"
},
{
"name": "Makefile",
"bytes": "11111"
},
{
"name": "PHP",
"bytes": "149648"
},
{
"name": "PLSQL",
"bytes": "2160"
},
{
"name": "PLpgSQL",
"bytes": "314333"
},
{
"name": "PowerShell",
"bytes": "2087991"
},
{
"name": "Python",
"bytes": "14584206"
},
{
"name": "R",
"bytes": "1457"
},
{
"name": "Roff",
"bytes": "13935"
},
{
"name": "Ruby",
"bytes": "14478"
},
{
"name": "SQLPL",
"bytes": "2117"
},
{
"name": "Shell",
"bytes": "741459"
},
{
"name": "Vim script",
"bytes": "5813"
}
],
"symlink_target": ""
} |
TODO: write [great documentation](http://jacobian.org/writing/what-to-write/)
| {
"content_hash": "d71cf02cba0ff91553da8359cf25a979",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 77,
"avg_line_length": 78,
"alnum_prop": 0.7692307692307693,
"repo_name": "mertnuhoglu/study",
"id": "d5cb8187d1e0e968083e0f806c0fbbfcb5f7406f",
"size": "117",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clj/ex/study_deps_cli/rebel-readline-lein/doc/intro.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "1346"
},
{
"name": "Batchfile",
"bytes": "2299"
},
{
"name": "C",
"bytes": "174"
},
{
"name": "CSS",
"bytes": "236474"
},
{
"name": "Clojure",
"bytes": "629884"
},
{
"name": "Dockerfile",
"bytes": "979"
},
{
"name": "Emacs Lisp",
"bytes": "1702"
},
{
"name": "HTML",
"bytes": "23846866"
},
{
"name": "Java",
"bytes": "69706"
},
{
"name": "JavaScript",
"bytes": "11626914"
},
{
"name": "Jupyter Notebook",
"bytes": "372344"
},
{
"name": "Lua",
"bytes": "31206"
},
{
"name": "Mermaid",
"bytes": "55"
},
{
"name": "PLpgSQL",
"bytes": "41904"
},
{
"name": "Procfile",
"bytes": "293"
},
{
"name": "Python",
"bytes": "8861"
},
{
"name": "R",
"bytes": "168361"
},
{
"name": "Ruby",
"bytes": "453"
},
{
"name": "Sass",
"bytes": "1120"
},
{
"name": "Scala",
"bytes": "837"
},
{
"name": "Shell",
"bytes": "81225"
},
{
"name": "TeX",
"bytes": "453"
},
{
"name": "TypeScript",
"bytes": "465092"
},
{
"name": "Vim Script",
"bytes": "4860"
},
{
"name": "sed",
"bytes": "3"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>worker</groupId>
<artifactId>worker</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20140107</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.7.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.3.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<finalName>worker</finalName>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>worker.Worker</mainClass>
<classpathPrefix>dependency-jars/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>attached</goal>
</goals>
<phase>package</phase>
<configuration>
<finalName>worker</finalName>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>worker.Worker</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project> | {
"content_hash": "c20b7b22f33963ab52689b8e2006db6c",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 108,
"avg_line_length": 36.857142857142854,
"alnum_prop": 0.45542635658914726,
"repo_name": "emmetog/demo-docker-microservice-app",
"id": "74e14eb6484d890be712a2589532a0e22a06f65c",
"size": "3096",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "worker/pom.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "80"
},
{
"name": "Gherkin",
"bytes": "479"
},
{
"name": "HTML",
"bytes": "292"
},
{
"name": "Java",
"bytes": "1893"
},
{
"name": "JavaScript",
"bytes": "3493"
},
{
"name": "PHP",
"bytes": "1437"
},
{
"name": "Shell",
"bytes": "4706"
},
{
"name": "TypeScript",
"bytes": "8391"
}
],
"symlink_target": ""
} |
<div class="commune_descr limited">
<p>
Pléguien est
une commune localisée dans le département de Côtes-d'Armor en Bretagne. Elle comptait 1 053 habitants en 2008.</p>
<p>À proximité de Pléguien sont positionnées géographiquement les villes de
<a href="{{VLROOT}}/immobilier/saint-laurent_22310/">Saint-Laurent</a> à 4 km, 409 habitants,
<a href="{{VLROOT}}/immobilier/plourhan_22232/">Plourhan</a> à 5 km, 1 880 habitants,
<a href="{{VLROOT}}/immobilier/lannebert_22112/">Lannebert</a> à 5 km, 394 habitants,
<a href="{{VLROOT}}/immobilier/saint-barnabe_22275/">Saint-Barnabé</a> localisée à 5 km, 1 272 habitants,
<a href="{{VLROOT}}/immobilier/lantic_22117/">Lantic</a> située à 5 km, 1 399 habitants,
<a href="{{VLROOT}}/immobilier/pludual_22236/">Pludual</a> localisée à 4 km, 623 habitants,
entre autres. De plus, Pléguien est située à seulement 18 km de <a href="{{VLROOT}}/immobilier/saint-brieuc_22278/">Saint-Brieuc</a>.</p>
<p>À Pléguien, le prix moyen à la vente d'un appartement s'évalue à 1 329 € du m² en vente. la valorisation moyenne d'une maison à l'achat se situe à 1 380 € du m². À la location la valorisation moyenne se situe à 4,79 € du m² mensuel.</p>
<p>Le nombre de logements, à Pléguien, était réparti en 2011 en 21 appartements et 653 maisons soit
un marché plutôt équilibré.</p>
<p>La ville offre de multiples équipements, elle dispose, entre autres, de un terrain de tennis, un centre d'équitation, un terrain de sport et une boucle de randonnée.</p>
</div>
| {
"content_hash": "4517c8404f60204f1a47d1b0f323eb04",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 264,
"avg_line_length": 92.82352941176471,
"alnum_prop": 0.7389100126742713,
"repo_name": "donaldinou/frontend",
"id": "49d3453c385015d083b384497e5ecc2ebfe48b65",
"size": "1623",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Viteloge/CoreBundle/Resources/descriptions/22177.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3073"
},
{
"name": "CSS",
"bytes": "111338"
},
{
"name": "HTML",
"bytes": "58634405"
},
{
"name": "JavaScript",
"bytes": "88564"
},
{
"name": "PHP",
"bytes": "841919"
}
],
"symlink_target": ""
} |
package io.sarl.maven.docs.generator.tests.markdown;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import java.io.File;
import java.net.URL;
import com.google.common.io.Resources;
import com.google.inject.Injector;
import org.arakhne.afc.vmutil.FileSystem;
import org.eclipse.xtext.xbase.lib.IntegerRange;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import io.sarl.lang.SARLStandaloneSetup;
import io.sarl.maven.docs.markdown.MarkdownParser;
/**
* @author $Author: sgalland$
* @version $FullVersion$
* @mavengroupid $GroupId$
* @mavenartifactid $ArtifactId$
* @since 0.6
*/
@SuppressWarnings("all")
@DisplayName("MarkdownParser")
@org.junit.jupiter.api.Tag("maven")
public class MarkdownParserTest {
private static File file(String basename) {
URL url = Resources.getResource(MarkdownParserTest.class, basename);
assumeTrue(url != null);
File file = FileSystem.convertURLToFile(url);
assumeTrue(file != null);
return file;
}
@Nested
@org.junit.jupiter.api.Tag("unit")
public class TransformTest {
private MarkdownParser parser;
@BeforeEach
public void setUp() {
Injector injector = SARLStandaloneSetup.doSetup();
this.parser = injector.getInstance(MarkdownParser.class);
this.parser.setOutlineStyleId(null);
}
@Test
public void outline01_level1() throws Exception {
File file = file("outline.txt");
this.parser.setOutlineDepthRange(new IntegerRange(1, Integer.MAX_VALUE));
this.parser.setAutoSectionNumbering(true);
String value = this.parser.transform(file);
assertEquals("# 1. Title\n\n## 1.1. Title 0\n\nthis is a fake text done for testing. this is a fake text done "
+ "for testing. this is a fake text done for testing.\n\n\n"
+ "> * [1. Title](#1-title)\n"
+ "> \t* [1.1. Title 0](#1-1-title-0)\n"
+ "> * [2. Title 1](#2-title-1)\n"
+ "> \t* [2.1. Title 2](#2-1-title-2)\n"
+ "> \t\t* [2.1.1. Title 3](#2-1-1-title-3)\n"
+ "> \t* [2.2. Title 4](#2-2-title-4)\n"
+ "> \t* [2.3. Title 5](#2-3-title-5)\n"
+ "> * [3. Title 6](#3-title-6)\n"
+ "\n\n\nthis is a fake text done for testing.\n\n# 2. Title 1\n\n"
+ "this is a fake text done for testing. this is a fake text done for testing. this is a\n"
+ "\n## 2.1. Title 2\n\nfake text done for testing. this is a fake text\n\n### 2.1.1. Title 3\n\n"
+ "## 2.2. Title 4\n\n## 2.3. Title 5\n\ndone for testing. this is a fake text done\nfor testing. "
+ "this is a fake text done for testing. this is a fake text done for testing. this is a fake "
+ "text done\n\n# 3. Title 6\n\nfor testing. this is a fake text done for testing. this is a fake "
+ "text done for testing.",
value);
}
@Test
public void outline01_level2() throws Exception {
File file = file("outline.txt");
this.parser.setOutlineDepthRange(new IntegerRange(2, Integer.MAX_VALUE));
this.parser.setAutoSectionNumbering(true);
String value = this.parser.transform(file);
assertEquals("# Title\n\n## 1. Title 0\n\nthis is a fake text done for testing. this is a fake text done "
+ "for testing. this is a fake text done for testing.\n\n\n"
+ "> * [1. Title 0](#1-title-0)\n"
+ "> * [2. Title 2](#2-title-2)\n"
+ "> \t* [2.1. Title 3](#2-1-title-3)\n"
+ "> * [3. Title 4](#3-title-4)\n"
+ "> * [4. Title 5](#4-title-5)\n"
+ "\n\n\nthis is a fake text done for testing.\n\n# Title 1\n\n"
+ "this is a fake text done for testing. this is a fake text done for testing. this is a\n"
+ "\n## 2. Title 2\n\nfake text done for testing. this is a fake text\n\n### 2.1. Title 3\n\n"
+ "## 3. Title 4\n\n## 4. Title 5\n\ndone for testing. this is a fake text done\nfor testing. "
+ "this is a fake text done for testing. this is a fake text done for testing. this is a fake "
+ "text done\n\n# Title 6\nfor testing. this is a fake text done for testing. this is a fake "
+ "text done for testing.",
value);
}
@Test
public void outline01_level3() throws Exception {
File file = file("outline.txt");
this.parser.setOutlineDepthRange(new IntegerRange(3, Integer.MAX_VALUE));
this.parser.setAutoSectionNumbering(true);
String value = this.parser.transform(file);
assertEquals("# Title\n\n## Title 0\n\nthis is a fake text done for testing. this is a fake text done "
+ "for testing. this is a fake text done for testing.\n\n\n"
+ "> * [1. Title 3](#1-title-3)\n"
+ "\n\n\nthis is a fake text done for testing.\n\n# Title 1\n\n"
+ "this is a fake text done for testing. this is a fake text done for testing. this is a\n"
+ "\n## Title 2\n\nfake text done for testing. this is a fake text\n\n### 1. Title 3\n\n"
+ "## Title 4\n\n## Title 5\n\ndone for testing. this is a fake text done\nfor testing. "
+ "this is a fake text done for testing. this is a fake text done for testing. this is a fake "
+ "text done\n\n# Title 6\nfor testing. this is a fake text done for testing. this is a fake "
+ "text done for testing.",
value);
}
@Test
public void outline02_level1() throws Exception {
File file = file("outline.txt");
this.parser.setOutlineDepthRange(new IntegerRange(1, Integer.MAX_VALUE));
this.parser.setAutoSectionNumbering(false);
String value = this.parser.transform(file);
assertEquals("# Title\n\n## Title 0\n\nthis is a fake text done for testing. this is a fake text "
+ "done for testing. this is a fake text done for testing.\n\n\n"
+ "> * [Title](#title)\n"
+ "> \t* [Title 0](#title-0)\n"
+ "> * [Title 1](#title-1)\n"
+ "> \t* [Title 2](#title-2)\n"
+ "> \t\t* [Title 3](#title-3)\n"
+ "> \t* [Title 4](#title-4)\n"
+ "> \t* [Title 5](#title-5)\n"
+ "> * [Title 6](#title-6)\n"
+ "\n\n\nthis is a fake text done for testing.\n\n# Title 1\n\nthis is a fake "
+ "text done for testing. this is a fake text done for testing. this is a\n\n## Title 2\n"
+ "\nfake text done for testing. this is a fake text\n\n### Title 3\n\n## Title 4\n"
+ "\n## Title 5\n\ndone for testing. this is a fake text done\nfor testing. this is a "
+ "fake text done for testing. this is a fake text done for testing. this is a fake text "
+ "done\n\n# Title 6\nfor testing. this is a fake text done for testing. this is a fake "
+ "text done for testing.",
value);
}
@Test
public void outline02_level2() throws Exception {
File file = file("outline.txt");
this.parser.setOutlineDepthRange(new IntegerRange(2, Integer.MAX_VALUE));
this.parser.setAutoSectionNumbering(false);
String value = this.parser.transform(file);
assertEquals("# Title\n\n## Title 0\n\nthis is a fake text done for testing. this is a fake text "
+ "done for testing. this is a fake text done for testing.\n\n\n"
+ "> * [Title 0](#title-0)\n"
+ "> * [Title 2](#title-2)\n"
+ "> \t* [Title 3](#title-3)\n"
+ "> * [Title 4](#title-4)\n"
+ "> * [Title 5](#title-5)\n"
+ "\n\n\nthis is a fake text done for testing.\n\n# Title 1\n\nthis is a fake "
+ "text done for testing. this is a fake text done for testing. this is a\n\n## Title 2\n"
+ "\nfake text done for testing. this is a fake text\n\n### Title 3\n\n## Title 4\n"
+ "\n## Title 5\n\ndone for testing. this is a fake text done\nfor testing. this is a "
+ "fake text done for testing. this is a fake text done for testing. this is a fake text "
+ "done\n\n# Title 6\nfor testing. this is a fake text done for testing. this is a fake "
+ "text done for testing.",
value);
}
@Test
public void outline02_level3() throws Exception {
File file = file("outline.txt");
this.parser.setOutlineDepthRange(new IntegerRange(3, Integer.MAX_VALUE));
this.parser.setAutoSectionNumbering(false);
String value = this.parser.transform(file);
assertEquals("# Title\n\n## Title 0\n\nthis is a fake text done for testing. this is a fake text "
+ "done for testing. this is a fake text done for testing.\n\n\n"
+ "> * [Title 3](#title-3)\n"
+ "\n\n\nthis is a fake text done for testing.\n\n# Title 1\n\nthis is a fake "
+ "text done for testing. this is a fake text done for testing. this is a\n\n## Title 2\n"
+ "\nfake text done for testing. this is a fake text\n\n### Title 3\n\n## Title 4\n"
+ "\n## Title 5\n\ndone for testing. this is a fake text done\nfor testing. this is a "
+ "fake text done for testing. this is a fake text done for testing. this is a fake text "
+ "done\n\n# Title 6\nfor testing. this is a fake text done for testing. this is a fake "
+ "text done for testing.",
value);
}
@Test
public void hrefMapping01() throws Exception {
File file = file("hrefmapping.txt");
String value = this.parser.transform(file);
assertEquals("My link to [local MD file](./outline.html)\n\nMy link to [local file](./outline.txt)\n\n"
+ "My link to [remote file](http://www.sarl.io)",
value);
}
@Test
public void image01() throws Exception {
File file = file("image.txt");
String value = this.parser.transform(file);
assertEquals("My link to ", value);
}
}
}
| {
"content_hash": "3da0ad20260e6f25cb3e34561c6bdb97",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 114,
"avg_line_length": 44.81428571428572,
"alnum_prop": 0.6466900435660398,
"repo_name": "sarl/sarl",
"id": "939f9d7f38207c6c02814763fb766688b3d5b517",
"size": "10146",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/io.sarl.maven.docs.generator.tests/src/test/java/io/sarl/maven/docs/generator/tests/markdown/MarkdownParserTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1718"
},
{
"name": "GAP",
"bytes": "1574648"
},
{
"name": "HTML",
"bytes": "1314"
},
{
"name": "Java",
"bytes": "24901728"
},
{
"name": "JavaScript",
"bytes": "2352"
},
{
"name": "Perl",
"bytes": "28685"
},
{
"name": "Python",
"bytes": "35706"
},
{
"name": "Shell",
"bytes": "10357"
},
{
"name": "TeX",
"bytes": "12146"
},
{
"name": "Vim Script",
"bytes": "5516"
},
{
"name": "Xtend",
"bytes": "1612"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
<link href='./dist/css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='./dist/css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='./dist/css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='./dist/css/reset.css' media='print' rel='stylesheet' type='text/css'/>
<link href='./dist/css/print.css' media='print' rel='stylesheet' type='text/css'/>
<script src='./dist/lib/object-assign-pollyfill.js' type='text/javascript'></script>
<script src='./dist/lib/jquery-1.8.0.min.js' type='text/javascript'></script>
<script src='./dist/lib/jquery.slideto.min.js' type='text/javascript'></script>
<script src='./dist/lib/jquery.wiggle.min.js' type='text/javascript'></script>
<script src='./dist/lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
<script src='./dist/lib/handlebars-4.0.5.js' type='text/javascript'></script>
<script src='./dist/lib/lodash.min.js' type='text/javascript'></script>
<script src='./dist/lib/backbone-min.js' type='text/javascript'></script>
<script src='./dist/swagger-ui.min.js' type='text/javascript'></script>
<script src='./dist/lib/highlight.9.1.0.pack.js' type='text/javascript'></script>
<script src='./dist/lib/jsoneditor.min.js' type='text/javascript'></script>
<script src='./dist/lib/marked.js' type='text/javascript'></script>
<script src='./dist/lib/swagger-oauth.js' type='text/javascript'></script>
<!-- Some basic translations -->
<!-- <script src='lang/translator.js' type='text/javascript'></script> -->
<!-- <script src='lang/ru.js' type='text/javascript'></script> -->
<!-- <script src='lang/en.js' type='text/javascript'></script> -->
<script type="text/javascript">
$(function() {
var springfox = {
"baseUrl": function() {
var urlMatches = /(.*)\/swagger-ui\/index.html.*/.exec(window.location.href);
return urlMatches[1];
},
"securityConfig": function(cb) {
$.getJSON(this.baseUrl() + "/swagger-resources/configuration/security", function(data) {
cb(data);
});
},
"uiConfig": function(cb) {
$.getJSON(this.baseUrl() + "/swagger-resources/configuration/ui", function(data) {
cb(data);
});
}
};
window.springfox = springfox;
window.oAuthRedirectUrl = springfox.baseUrl() + './dist/o2c.html'
window.springfox.uiConfig(function(data) {
window.swaggerUi = new SwaggerUi({
dom_id: "swagger-ui-container",
validatorUrl: data.validatorUrl,
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
onComplete: function(swaggerApi, swaggerUi) {
initializeSpringfox();
if (window.SwaggerTranslator) {
window.SwaggerTranslator.translate();
}
$('pre code').each(function(i, e) {
hljs.highlightBlock(e)
});
},
onFailure: function(data) {
log("Unable to Load SwaggerUI");
},
docExpansion: "none",
apisSorter: "alpha",
showRequestHeaders: false
});
initializeBaseUrl();
$('#select_baseUrl').change(function() {
window.swaggerUi.headerView.trigger('update-swagger-ui', {
url: $('#select_baseUrl').val()
});
addApiKeyAuthorization();
});
function addApiKeyAuthorization() {
<%_ if (authenticationType === 'session') { _%>
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("X-XSRF-TOKEN", getCSRF(), "header");
window.swaggerUi.api.clientAuthorizations.add("key", apiKeyAuth);
<%_ } else if (authenticationType === 'oauth2') { _%>
var authToken = JSON.parse(localStorage.getItem("jhi-authenticationtoken")).access_token;
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("Authorization",
"Bearer " + authToken, "header");
window.swaggerUi.api.clientAuthorizations.add("key", apiKeyAuth);
<%_ } else if (authenticationType === 'jwt' || authenticationType === 'uaa') { _%>
var authToken = JSON.parse(localStorage.getItem("jhi-authenticationtoken") || sessionStorage.getItem("jhi-authenticationtoken"));
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("Authorization", "Bearer " + authToken, "header");
window.swaggerUi.api.clientAuthorizations.add("bearer", apiKeyAuth);
<%_ } _%>
}
function getCSRF() {
var name = "XSRF-TOKEN=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1);
if (c.indexOf(name) != -1) return c.substring(name.length,c.length);
}
return "";
}
function log() {
if ('console' in window) {
console.log.apply(console, arguments);
}
}
function oAuthIsDefined(security) {
return security.clientId
&& security.clientSecret
&& security.appName
&& security.realm;
}
function initializeSpringfox() {
var security = {};
window.springfox.securityConfig(function(data) {
security = data;
if (typeof initOAuth == "function" && oAuthIsDefined(security)) {
initOAuth(security);
}
});
}
});
function maybePrefix(location, withRelativePath) {
var pat = /^https?:\/\//i;
if (pat.test(location)) {
return location;
}
return withRelativePath + location;
}
function initializeBaseUrl() {
var relativeLocation = springfox.baseUrl();
$('#input_baseUrl').hide();
$.getJSON(relativeLocation + "/swagger-resources", function(data) {
var $urlDropdown = $('#select_baseUrl');
$urlDropdown.empty();
$.each(data, function(i, resource) {
var option = $('<option></option>')
.attr("value", maybePrefix(resource.location, relativeLocation))
.text(resource.name + " (" + resource.location + ")");
$urlDropdown.append(option);
});
$urlDropdown.change();
});
}
});
</script>
</head>
<body class="swagger-section">
<div id='header'>
<div class="swagger-ui-wrap">
<a id="logo" href="http://swagger.io">swagger</a>
<form id='api_selector'>
<div class='input'>
<select id="select_baseUrl" name="select_baseUrl"></select>
</div>
<div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/>
</div>
</form>
</div>
</div>
<div id="message-bar" class="swagger-ui-wrap" data-sw-translate> </div>
<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
</body>
</html>
| {
"content_hash": "865bd6fb11c1af1e993d190419dda523",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 149,
"avg_line_length": 45.645161290322584,
"alnum_prop": 0.5025912838633687,
"repo_name": "deepu105/generator-jhipster",
"id": "330c1280988976e26768f5f1631814e5e92bbe62",
"size": "8490",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "generators/client/templates/react/src/main/webapp/swagger-ui/_index.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5006"
},
{
"name": "CSS",
"bytes": "87951"
},
{
"name": "Gherkin",
"bytes": "179"
},
{
"name": "HTML",
"bytes": "434215"
},
{
"name": "Java",
"bytes": "1054668"
},
{
"name": "JavaScript",
"bytes": "1322229"
},
{
"name": "Scala",
"bytes": "7783"
},
{
"name": "Shell",
"bytes": "32658"
},
{
"name": "TypeScript",
"bytes": "550321"
}
],
"symlink_target": ""
} |
package org.apache.airavata.registry.core.experiment.catalog.model;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
public class ProcessErrorPK implements Serializable {
private final static Logger logger = LoggerFactory.getLogger(ProcessErrorPK.class);
private String errorId;
private String processId;
@Id
@Column(name = "ERROR_ID")
public String getErrorId() {
return errorId;
}
public void setErrorId(String errorId) {
this.errorId = errorId;
}
@Id
@Column(name = "PROCESS_ID")
public String getProcessId() {
return processId;
}
public void setProcessId(String processId) {
this.processId = processId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ProcessErrorPK that = (ProcessErrorPK) o;
if (getErrorId() != null ? !getErrorId().equals(that.getErrorId()) : that.getErrorId() != null) return false;
if (getProcessId() != null ? !getProcessId().equals(that.getProcessId()) : that.getProcessId() != null) return false;
return true;
}
@Override
public int hashCode() {
int result = getErrorId() != null ? getErrorId().hashCode() : 0;
result = 31 * result + (getProcessId() != null ? getProcessId().hashCode() : 0);
return result;
}
} | {
"content_hash": "2a2bf5b5c2d0212b39304cc6b239609b",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 125,
"avg_line_length": 27.69090909090909,
"alnum_prop": 0.6447800393959291,
"repo_name": "gouravshenoy/airavata",
"id": "c85eec2defef70fca49faae14cb6489593bfda70",
"size": "2334",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessErrorPK.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5598"
},
{
"name": "C",
"bytes": "53885"
},
{
"name": "C++",
"bytes": "7147253"
},
{
"name": "CSS",
"bytes": "26656"
},
{
"name": "HTML",
"bytes": "84328"
},
{
"name": "Java",
"bytes": "34853075"
},
{
"name": "PHP",
"bytes": "294193"
},
{
"name": "Python",
"bytes": "295765"
},
{
"name": "Shell",
"bytes": "58504"
},
{
"name": "Thrift",
"bytes": "423314"
},
{
"name": "XSLT",
"bytes": "34643"
}
],
"symlink_target": ""
} |
package response
import (
"database/sql"
"errors"
"net/http"
"os"
pkgErrors "github.com/pkg/errors"
"github.com/lxc/lxd/lxd/db"
"github.com/lxc/lxd/shared/api"
)
var httpResponseErrors = map[int][]error{
http.StatusNotFound: {os.ErrNotExist, sql.ErrNoRows, db.ErrNoSuchObject},
http.StatusForbidden: {os.ErrPermission},
http.StatusConflict: {db.ErrAlreadyDefined},
}
// SmartError returns the right error message based on err.
// It uses both the stdlib errors and the github.com/pkg/errors packages to unwrap the error and find the cause.
func SmartError(err error) Response {
if err == nil {
return EmptySyncResponse
}
if statusCode, found := api.StatusErrorMatch(err); found {
return &errorResponse{statusCode, err.Error()}
}
for httpStatusCode, checkErrs := range httpResponseErrors {
for _, checkErr := range checkErrs {
if errors.Is(err, checkErr) || pkgErrors.Cause(err) == checkErr {
if err != checkErr {
// If the error has been wrapped return the top-level error message.
return &errorResponse{httpStatusCode, err.Error()}
}
// If the error hasn't been wrapped, replace the error message with the generic
// HTTP status text.
return &errorResponse{httpStatusCode, http.StatusText(httpStatusCode)}
}
}
}
return &errorResponse{http.StatusInternalServerError, err.Error()}
}
| {
"content_hash": "896aac46a392b006c2a3d3ec96cd457a",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 112,
"avg_line_length": 28.208333333333332,
"alnum_prop": 0.7223042836041359,
"repo_name": "atxwebs/lxd",
"id": "c97282353df6e76c729a9dc34ac00ba234439af5",
"size": "1354",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lxd/response/smart.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "31634"
},
{
"name": "Emacs Lisp",
"bytes": "255"
},
{
"name": "Go",
"bytes": "4103545"
},
{
"name": "Makefile",
"bytes": "6469"
},
{
"name": "Python",
"bytes": "13894"
},
{
"name": "Shell",
"bytes": "411105"
},
{
"name": "TSQL",
"bytes": "1600"
}
],
"symlink_target": ""
} |
module soundbox.domain.sounds {
export class SoundCategoryDto extends EntityBaseDto {
public Name: string;
public Sounds: SoundDto[];
}
} | {
"content_hash": "97ec993c7967c4a2a633701fd6023801",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 57,
"avg_line_length": 27,
"alnum_prop": 0.6728395061728395,
"repo_name": "zyborgLP/Soundbox.Reloaded",
"id": "1f43397c5470a40a9abed47bebabb111efb51ee0",
"size": "164",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Soundbox.Reloaded.Ui.Web/scripts/domain/sounds/SoundCategoryDto.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "118"
},
{
"name": "C#",
"bytes": "69564"
},
{
"name": "CSS",
"bytes": "104855"
},
{
"name": "JavaScript",
"bytes": "122843"
},
{
"name": "TypeScript",
"bytes": "34561"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "df372527d38a667bac708bb4e2f571cd",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "a3b22dd96e9f752a65e726ccb6c55b0f29ce8bc7",
"size": "186",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Chromista/Ochrophyta/Chrysophyceae/Dictyochales/Dictyochaceae/Septamesocena/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
/*************************************************************************/
/* sample.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "sample.h"
void Sample::_set_data(const Dictionary &p_data) {
ERR_FAIL_COND(!p_data.has("packing"));
String packing = p_data["packing"];
if (packing == "raw") {
ERR_FAIL_COND(!p_data.has("stereo"));
ERR_FAIL_COND(!p_data.has("format"));
ERR_FAIL_COND(!p_data.has("length"));
bool stereo = p_data["stereo"];
int length = p_data["length"];
Format fmt;
String fmtstr = p_data["format"];
if (fmtstr == "pcm8")
fmt = FORMAT_PCM8;
else if (fmtstr == "pcm16")
fmt = FORMAT_PCM16;
else if (fmtstr == "ima_adpcm")
fmt = FORMAT_IMA_ADPCM;
else {
ERR_EXPLAIN("Invalid format for sample: " + fmtstr);
ERR_FAIL();
}
ERR_FAIL_COND(!p_data.has("data"));
create(fmt, stereo, length);
set_data(p_data["data"]);
} else {
ERR_EXPLAIN("Invalid packing for sample data: " + packing);
ERR_FAIL();
}
}
Dictionary Sample::_get_data() const {
Dictionary d;
switch (get_format()) {
case FORMAT_PCM8: d["format"] = "pcm8"; break;
case FORMAT_PCM16: d["format"] = "pcm16"; break;
case FORMAT_IMA_ADPCM: d["format"] = "ima_adpcm"; break;
}
d["stereo"] = is_stereo();
d["length"] = get_length();
d["packing"] = "raw";
d["data"] = get_data();
return d;
}
void Sample::create(Format p_format, bool p_stereo, int p_length) {
if (p_length < 1)
return;
if (sample.is_valid())
AudioServer::get_singleton()->free(sample);
mix_rate = 44100;
stereo = p_stereo;
length = p_length;
format = p_format;
loop_format = LOOP_NONE;
loop_begin = 0;
loop_end = 0;
sample = AudioServer::get_singleton()->sample_create((AudioServer::SampleFormat)p_format, p_stereo, p_length);
}
Sample::Format Sample::get_format() const {
return format;
}
bool Sample::is_stereo() const {
return stereo;
}
int Sample::get_length() const {
return length;
}
void Sample::set_data(const DVector<uint8_t> &p_buffer) {
if (sample.is_valid())
AudioServer::get_singleton()->sample_set_data(sample, p_buffer);
}
DVector<uint8_t> Sample::get_data() const {
if (sample.is_valid())
return AudioServer::get_singleton()->sample_get_data(sample);
return DVector<uint8_t>();
}
void Sample::set_mix_rate(int p_rate) {
mix_rate = p_rate;
if (sample.is_valid())
return AudioServer::get_singleton()->sample_set_mix_rate(sample, mix_rate);
}
int Sample::get_mix_rate() const {
return mix_rate;
}
void Sample::set_loop_format(LoopFormat p_format) {
if (sample.is_valid())
AudioServer::get_singleton()->sample_set_loop_format(sample, (AudioServer::SampleLoopFormat)p_format);
loop_format = p_format;
}
Sample::LoopFormat Sample::get_loop_format() const {
return loop_format;
}
void Sample::set_loop_begin(int p_pos) {
if (sample.is_valid())
AudioServer::get_singleton()->sample_set_loop_begin(sample, p_pos);
loop_begin = p_pos;
}
int Sample::get_loop_begin() const {
return loop_begin;
}
void Sample::set_loop_end(int p_pos) {
if (sample.is_valid())
AudioServer::get_singleton()->sample_set_loop_end(sample, p_pos);
loop_end = p_pos;
}
int Sample::get_loop_end() const {
return loop_end;
}
RID Sample::get_rid() const {
return sample;
}
void Sample::_bind_methods() {
ObjectTypeDB::bind_method(_MD("create", "format", "stereo", "length"), &Sample::create);
ObjectTypeDB::bind_method(_MD("get_format"), &Sample::get_format);
ObjectTypeDB::bind_method(_MD("is_stereo"), &Sample::is_stereo);
ObjectTypeDB::bind_method(_MD("get_length"), &Sample::get_length);
ObjectTypeDB::bind_method(_MD("set_data", "data"), &Sample::set_data);
ObjectTypeDB::bind_method(_MD("get_data"), &Sample::get_data);
ObjectTypeDB::bind_method(_MD("set_mix_rate", "hz"), &Sample::set_mix_rate);
ObjectTypeDB::bind_method(_MD("get_mix_rate"), &Sample::get_mix_rate);
ObjectTypeDB::bind_method(_MD("set_loop_format", "format"), &Sample::set_loop_format);
ObjectTypeDB::bind_method(_MD("get_loop_format"), &Sample::get_loop_format);
ObjectTypeDB::bind_method(_MD("set_loop_begin", "pos"), &Sample::set_loop_begin);
ObjectTypeDB::bind_method(_MD("get_loop_begin"), &Sample::get_loop_begin);
ObjectTypeDB::bind_method(_MD("set_loop_end", "pos"), &Sample::set_loop_end);
ObjectTypeDB::bind_method(_MD("get_loop_end"), &Sample::get_loop_end);
ObjectTypeDB::bind_method(_MD("_set_data"), &Sample::_set_data);
ObjectTypeDB::bind_method(_MD("_get_data"), &Sample::_get_data);
ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), _SCS("_set_data"), _SCS("_get_data"));
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "stereo"), _SCS(""), _SCS("is_stereo"));
ADD_PROPERTY(PropertyInfo(Variant::INT, "length", PROPERTY_HINT_RANGE, "0,999999999"), _SCS(""), _SCS("get_length"));
ADD_PROPERTY(PropertyInfo(Variant::INT, "mix_rate", PROPERTY_HINT_RANGE, "1,192000,1"), _SCS("set_mix_rate"), _SCS("get_mix_rate"));
ADD_PROPERTY(PropertyInfo(Variant::INT, "loop_format", PROPERTY_HINT_ENUM, "None,Forward,PingPong"), _SCS("set_loop_format"), _SCS("get_loop_format"));
ADD_PROPERTY(PropertyInfo(Variant::INT, "loop_begin", PROPERTY_HINT_RANGE, "0," + itos(999999999) + ",1"), _SCS("set_loop_begin"), _SCS("get_loop_begin"));
ADD_PROPERTY(PropertyInfo(Variant::INT, "loop_end", PROPERTY_HINT_RANGE, "0," + itos(999999999) + ",1"), _SCS("set_loop_end"), _SCS("get_loop_end"));
BIND_CONSTANT(FORMAT_PCM8);
BIND_CONSTANT(FORMAT_PCM16);
BIND_CONSTANT(FORMAT_IMA_ADPCM);
BIND_CONSTANT(LOOP_NONE);
BIND_CONSTANT(LOOP_FORWARD);
BIND_CONSTANT(LOOP_PING_PONG);
}
Sample::Sample() {
format = FORMAT_PCM8;
length = 0;
stereo = false;
loop_format = LOOP_NONE;
loop_begin = 0;
loop_end = 0;
mix_rate = 44100;
}
Sample::~Sample() {
if (sample.is_valid())
AudioServer::get_singleton()->free(sample);
}
| {
"content_hash": "3d42e12fd9eeb6aa3b29cc962f4ad31d",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 156,
"avg_line_length": 33.81196581196581,
"alnum_prop": 0.6038928210313448,
"repo_name": "pixelpicosean/my-godot-2.1",
"id": "4e8fd22773dd87eed7c6be94eaadfedb3916ec28",
"size": "7912",
"binary": false,
"copies": "1",
"ref": "refs/heads/2.1",
"path": "scene/resources/sample.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "64353"
},
{
"name": "C++",
"bytes": "15758022"
},
{
"name": "Java",
"bytes": "497185"
},
{
"name": "Makefile",
"bytes": "451"
},
{
"name": "Objective-C",
"bytes": "2643"
},
{
"name": "Objective-C++",
"bytes": "158269"
},
{
"name": "Python",
"bytes": "247513"
},
{
"name": "Shell",
"bytes": "11099"
}
],
"symlink_target": ""
} |
package org.pentaho.big.data.impl.vfs.hdfs;
import org.apache.commons.vfs2.FileName;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.commons.vfs2.FileType;
import org.apache.commons.vfs2.provider.AbstractFileName;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.pentaho.bigdata.api.hdfs.HadoopFileStatus;
import org.pentaho.bigdata.api.hdfs.HadoopFileSystem;
import org.pentaho.bigdata.api.hdfs.HadoopFileSystemPath;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
/**
* Created by bryan on 8/7/15.
*/
public class HDFSFileObjectTest {
private AbstractFileName abstractFileName;
private HDFSFileSystem hdfsFileSystem;
private HadoopFileSystem hadoopFileSystem;
private HDFSFileObject hdfsFileObject;
private HadoopFileSystemPath hadoopFileSystemPath;
@Before
public void setup() throws FileSystemException {
abstractFileName = mock( AbstractFileName.class );
hadoopFileSystem = mock( HadoopFileSystem.class );
hdfsFileSystem =
new HDFSFileSystem( mock( AbstractFileName.class ), null, hadoopFileSystem );
hdfsFileObject = new HDFSFileObject( abstractFileName, hdfsFileSystem );
String path = "fake-path";
hadoopFileSystemPath = mock( HadoopFileSystemPath.class );
when( abstractFileName.getPath() ).thenReturn( path );
when( hadoopFileSystem.getPath( path ) ).thenReturn( hadoopFileSystemPath );
}
@Test
public void testGetContentSize() throws Exception {
long len = 321L;
HadoopFileStatus hadoopFileStatus = mock( HadoopFileStatus.class );
when( hadoopFileSystem.getFileStatus( hadoopFileSystemPath ) ).thenReturn( hadoopFileStatus );
when( hadoopFileStatus.getLen() ).thenReturn( len );
assertEquals( len, hdfsFileObject.doGetContentSize() );
}
@Test
public void testDoGetOutputStreamAppend() throws Exception {
OutputStream outputStream = mock( OutputStream.class );
when( hadoopFileSystem.append( hadoopFileSystemPath ) ).thenReturn( outputStream );
assertEquals( outputStream, hdfsFileObject.doGetOutputStream( true ) );
}
@Test
public void testDoGetOutputStreamCreate() throws Exception {
OutputStream outputStream = mock( OutputStream.class );
when( hadoopFileSystem.create( hadoopFileSystemPath ) ).thenReturn( outputStream );
assertEquals( outputStream, hdfsFileObject.doGetOutputStream( false ) );
}
@Test
public void testDoGetInputStream() throws Exception {
InputStream inputStream = mock( InputStream.class );
when( hadoopFileSystem.open( hadoopFileSystemPath ) ).thenReturn( inputStream );
assertEquals( inputStream, hdfsFileObject.doGetInputStream() );
}
@Test
public void testDoGetTypeFile() throws Exception {
HadoopFileStatus hadoopFileStatus = mock( HadoopFileStatus.class );
when( hadoopFileSystem.getFileStatus( hadoopFileSystemPath ) ).thenReturn( hadoopFileStatus );
when( hadoopFileStatus.isDir() ).thenReturn( false );
assertEquals( FileType.FILE, hdfsFileObject.doGetType() );
}
@Test
public void testDoGetTypeFolder() throws Exception {
HadoopFileStatus hadoopFileStatus = mock( HadoopFileStatus.class );
when( hadoopFileSystem.getFileStatus( hadoopFileSystemPath ) ).thenReturn( hadoopFileStatus );
when( hadoopFileStatus.isDir() ).thenReturn( true );
assertEquals( FileType.FOLDER, hdfsFileObject.doGetType() );
}
@Test
public void testDoGetTypeImaginary() throws Exception {
assertEquals( FileType.IMAGINARY, hdfsFileObject.doGetType() );
}
@Test
public void testDoCreateFolder() throws Exception {
hdfsFileObject.doCreateFolder();
verify( hadoopFileSystem ).mkdirs( hadoopFileSystemPath );
}
@Test
public void testDoRename() throws Exception {
FileObject fileObject = mock( FileObject.class );
FileName fileName = mock( FileName.class );
when( fileObject.getName() ).thenReturn( fileName );
String path2 = "fake-path-2";
when( fileName.getPath() ).thenReturn( path2 );
HadoopFileSystemPath newPath = mock( HadoopFileSystemPath.class );
when( hadoopFileSystem.getPath( path2 ) ).thenReturn( newPath );
hdfsFileObject.doRename( fileObject );
verify( hadoopFileSystem ).rename( hadoopFileSystemPath, newPath );
}
@Test
public void testDoGetLastModifiedTime() throws Exception {
long modificationTime = 8988L;
HadoopFileStatus hadoopFileStatus = mock( HadoopFileStatus.class );
when( hadoopFileSystem.getFileStatus( hadoopFileSystemPath ) ).thenReturn( hadoopFileStatus );
when( hadoopFileStatus.getModificationTime() ).thenReturn( modificationTime );
assertEquals( modificationTime, hdfsFileObject.doGetLastModifiedTime() );
}
@Test
public void testDoSetLastModifiedTime() throws Exception {
long modtime = 48933L;
long start = System.currentTimeMillis();
assertTrue( hdfsFileObject.doSetLastModifiedTime( modtime ) );
ArgumentCaptor<Long> longArgumentCaptor = ArgumentCaptor.forClass( Long.class );
verify( hadoopFileSystem ).setTimes( eq( hadoopFileSystemPath ), eq( modtime ), longArgumentCaptor.capture() );
Long accessTime = longArgumentCaptor.getValue();
assertTrue( start <= accessTime );
assertTrue( accessTime <= System.currentTimeMillis() );
}
@Test
public void testDoListChildren() throws Exception {
String childPathName = "fake-path-child";
HadoopFileStatus hadoopFileStatus = mock( HadoopFileStatus.class );
HadoopFileStatus[] hadoopFileStatuses = {
hadoopFileStatus
};
HadoopFileSystemPath childPath = mock( HadoopFileSystemPath.class );
when( hadoopFileStatus.getPath() ).thenReturn( childPath );
when( childPath.getName() ).thenReturn( childPathName );
when( hadoopFileSystem.listStatus( hadoopFileSystemPath ) ).thenReturn( hadoopFileStatuses );
String[] children = hdfsFileObject.doListChildren();
assertEquals( 1, children.length );
assertEquals( childPathName, children[0] );
}
}
| {
"content_hash": "e36dcc271fa379fdf676e295f9e824a7",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 115,
"avg_line_length": 40.197452229299365,
"alnum_prop": 0.7575661543337031,
"repo_name": "CapeSepias/big-data-plugin",
"id": "1c8c2aa50627539ac8d3bffea0654074cef30c43",
"size": "7205",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "impl/vfs/hdfs/src/test/java/org/pentaho/big/data/impl/vfs/hdfs/HDFSFileObjectTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2763604"
},
{
"name": "PigLatin",
"bytes": "11262"
}
],
"symlink_target": ""
} |
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:a]
@protocol NoteViewControllerDelegate;
@interface NoteViewController : UIViewController <UITextViewDelegate, ABPeoplePickerNavigationControllerDelegate,
UISearchBarDelegate,
UITableViewDataSource,
UITableViewDelegate,
UIKeyInput,
UIGestureRecognizerDelegate>
@property (nonatomic, weak) id<NoteViewControllerDelegate> delegate;
@property (weak, nonatomic) IBOutlet UIView *searchView;
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (weak, nonatomic) IBOutlet UITextView *personsTaggedView;
@property (weak, nonatomic) IBOutlet UITextView *notesTextView;
//@property (weak, nonatomic) IBOutlet UIButton *tagFriendsButton;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *verticalSpaceTopToView;
@property (strong, nonatomic) Note *currentNote;
@property (strong, nonatomic) Person *personForNewNote;
// The Address Book to browse. All contacts returned will be from that ABAddressBook instance.
// If not set, a new ABAddressBookRef will be created the first time the property is accessed.
@property (nonatomic, readwrite) ABAddressBookRef addressBook;
// Color of tokens. Default is the global tintColor
@property (nonatomic, strong) UIColor *tokenColor;
// Color of selected token. Default is blackColor.
@property (nonatomic, strong) UIColor *selectedTokenColor;
- (IBAction)saveButtonPressed:(id)sender;
@end
@protocol NoteViewControllerDelegate <NSObject>
// Called after the user has pressed Done.
// The delegate is responsible for dismissing the NoteViewController.
- (void)noteViewControllerDidFinish:(NoteViewController *)noteViewController;
// Called after the user has pressed Cancel.
// The delegate is responsible for dismissing the NoteViewController.
- (void)noteViewControllerDidCancel:(NoteViewController *)noteViewController;
@end
| {
"content_hash": "36170d43c4beee0b53b2c1b9465cf60e",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 113,
"avg_line_length": 39.411764705882355,
"alnum_prop": 0.7776119402985074,
"repo_name": "ceaseless-prayer/CeaselessIOS",
"id": "51ded3e100bdbe39f0efd508ab8b7ee72f34506b",
"size": "2345",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Ceaseless/NoteViewControllerWithTagging.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "103"
},
{
"name": "Objective-C",
"bytes": "431759"
},
{
"name": "Ruby",
"bytes": "579"
},
{
"name": "Shell",
"bytes": "328"
},
{
"name": "Swift",
"bytes": "18491"
}
],
"symlink_target": ""
} |
require_relative '../../../spec_helper'
describe "Process::Sys.setrgid" do
it "needs to be reviewed for spec completeness"
end
| {
"content_hash": "46038ee72abb021975efe3d1ae4a9f09",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 49,
"avg_line_length": 26,
"alnum_prop": 0.7153846153846154,
"repo_name": "eregon/rubyspec",
"id": "27eea2ed86d6ae69a48e22236c59183b711c5ee1",
"size": "130",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "core/process/sys/setrgid_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "168258"
},
{
"name": "Ruby",
"bytes": "6350118"
},
{
"name": "Shell",
"bytes": "65"
}
],
"symlink_target": ""
} |
DATE=`date`
BUILD_HASH=`git log -n 1 | grep commit | cut -d " " -f 2`
VERSION="0.0" # `git describe --abbrev=0`
git --no-pager diff --exit-code "$VERSION" master > /dev/null 2>&1
PRE_RELEASE=$?
# TODO: Hash should not be added when building from a tagged version
# but it looks like it currently does. This can be fixed later.
if [ $PRE_RELEASE ]; then
VERSION="$VERSION.$BUILD_HASH"
fi
CODE="// gen is a generated package, DO NOT EDIT!\n
\n
package gen\n
\n
var Version string = \"$VERSION\"\n
var BuildDate string = \"$DATE\"\n
var BuildHash string = \"$BUILD_HASH\"\n
"
TMP=`go-bindata -version`
if [ $? -ne 0 ]
then
# go-bindata is required to embed assets into binary
echo "Downloading go-bindata"
go get -u github.com/jteeuwen/go-bindata/...
fi
# generate all the files we need
mkdir -p gen
go-bindata -pkg gen -ignore="/*.pyxel" -o gen/assets.go assets/
echo -e $CODE | gofmt > gen/build_info.go
| {
"content_hash": "99b6228277b7e140bb2e616523a714e3",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 70,
"avg_line_length": 27.147058823529413,
"alnum_prop": 0.6749729144095341,
"repo_name": "hurricanerix/FlappyDisk",
"id": "03b7b2734bb293d89283478c37f8d0d9c39c0933",
"size": "1520",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gen_build_info.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "13995"
},
{
"name": "Shell",
"bytes": "1520"
}
],
"symlink_target": ""
} |
using SlimDX;
using SlimDX.Direct3D11;
namespace Core.FX {
public class WavesEffect : DisplacementMapEffect {
private readonly EffectMatrixVariable _waveDispTexTransform0;
private readonly EffectMatrixVariable _waveDispTexTransform1;
private readonly EffectMatrixVariable _waveNormalTexTransform0;
private readonly EffectMatrixVariable _waveNormalTexTransform1;
private readonly EffectScalarVariable _heightScale0;
private readonly EffectScalarVariable _heightScale1;
private readonly EffectResourceVariable _normalMap0;
private readonly EffectResourceVariable _normalMap1;
public void SetWaveDispTexTransform0(Matrix m) { _waveDispTexTransform0.SetMatrix(m); }
public void SetWaveDispTexTransform1(Matrix m) { _waveDispTexTransform1.SetMatrix(m); }
public void SetWaveNormalTexTransform0(Matrix m) { _waveNormalTexTransform0.SetMatrix(m); }
public void SetWaveNormalTexTransform1(Matrix m) { _waveNormalTexTransform1.SetMatrix(m); }
public void SetHeightScale0(float f) { _heightScale0.Set(f); }
public void SetHeightScale1(float f) { _heightScale1.Set(f); }
public void SetNormalMap0(ShaderResourceView srv) { _normalMap0.SetResource(srv); }
public void SetNormalMap1(ShaderResourceView srv) { _normalMap1.SetResource(srv); }
public WavesEffect(Device device, string filename) : base(device, filename) {
_waveDispTexTransform0 = FX.GetVariableByName("gWaveDispTexTransform0").AsMatrix();
_waveDispTexTransform1 = FX.GetVariableByName("gWaveDispTexTransform1").AsMatrix();
_waveNormalTexTransform0 = FX.GetVariableByName("gWaveNormalTexTransform0").AsMatrix();
_waveNormalTexTransform1 = FX.GetVariableByName("gWaveNormalTexTransform1").AsMatrix();
_heightScale0 = FX.GetVariableByName("gHeightScale0").AsScalar();
_heightScale1 = FX.GetVariableByName("gHeightScale1").AsScalar();
_normalMap0 = FX.GetVariableByName("gNormalMap0").AsResource();
_normalMap1 = FX.GetVariableByName("gNormalMap1").AsResource();
}
}
} | {
"content_hash": "9deabf426832a9ca7e8e1db519add28b",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 99,
"avg_line_length": 55.275,
"alnum_prop": 0.7168701944821347,
"repo_name": "ericrrichards/dx11",
"id": "979662e8c1f14d56ca5495c4c55e7b2a62f6c324",
"size": "2213",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "DX11/Core/FX/WavesEffect.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1257114"
},
{
"name": "FLUX",
"bytes": "1198127"
},
{
"name": "JavaScript",
"bytes": "16520"
},
{
"name": "Logos",
"bytes": "577807"
}
],
"symlink_target": ""
} |
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
// +----------------------------------------------------------------------+
// | PEAR_Exception |
// +----------------------------------------------------------------------+
// | Copyright (c) 2004 The PEAR Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Tomas V.V.Cox <cox@idecnet.com> |
// | Hans Lellelid <hans@velum.net> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// | Greg Beaver <cellog@php.net> |
// +----------------------------------------------------------------------+
//
// $Id: Exception.php,v 1.4.2.2 2004/12/31 19:01:52 cellog Exp $
/**
* Base PEAR_Exception Class
*
* WARNING: This code should be considered stable, but the API is
* subject to immediate and drastic change, so API stability is
* at best alpha
*
* 1) Features:
*
* - Nestable exceptions (throw new PEAR_Exception($msg, $prev_exception))
* - Definable triggers, shot when exceptions occur
* - Pretty and informative error messages
* - Added more context info available (like class, method or cause)
* - cause can be a PEAR_Exception or an array of mixed
* PEAR_Exceptions/PEAR_ErrorStack warnings
* - callbacks for specific exception classes and their children
*
* 2) Ideas:
*
* - Maybe a way to define a 'template' for the output
*
* 3) Inherited properties from PHP Exception Class:
*
* protected $message
* protected $code
* protected $line
* protected $file
* private $trace
*
* 4) Inherited methods from PHP Exception Class:
*
* __clone
* __construct
* getMessage
* getCode
* getFile
* getLine
* getTraceSafe
* getTraceSafeAsString
* __toString
*
* 5) Usage example
*
* <code>
* require_once 'PEAR/Exception.php';
*
* class Test {
* function foo() {
* throw new PEAR_Exception('Error Message', ERROR_CODE);
* }
* }
*
* function myLogger($pear_exception) {
* echo $pear_exception->getMessage();
* }
* // each time a exception is thrown the 'myLogger' will be called
* // (its use is completely optional)
* PEAR_Exception::addObserver('myLogger');
* $test = new Test;
* try {
* $test->foo();
* } catch (PEAR_Exception $e) {
* print $e;
* }
* </code>
*
* @since PHP 5
* @package PEAR
* @version $Revision: 1.4.2.2 $
* @author Tomas V.V.Cox <cox@idecnet.com>
* @author Hans Lellelid <hans@velum.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
*
*/
class PEAR_Exception extends Exception
{
const OBSERVER_PRINT = -2;
const OBSERVER_TRIGGER = -4;
const OBSERVER_DIE = -8;
protected $cause;
private static $_observers = array();
private static $_uniqueid = 0;
private $_trace;
/**
* Supported signatures:
* PEAR_Exception(string $message);
* PEAR_Exception(string $message, int $code);
* PEAR_Exception(string $message, Exception $cause);
* PEAR_Exception(string $message, Exception $cause, int $code);
* PEAR_Exception(string $message, array $causes);
* PEAR_Exception(string $message, array $causes, int $code);
*/
public function __construct($message, $p2 = null, $p3 = null)
{
if (is_int($p2)) {
$code = $p2;
$this->cause = null;
} elseif ($p2 instanceof Exception || is_array($p2)) {
$code = $p3;
if (is_array($p2) && isset($p2['message'])) {
// fix potential problem of passing in a single warning
$p2 = array($p2);
}
$this->cause = $p2;
} else {
$code = null;
$this->cause = null;
}
parent::__construct($message, $code);
$this->signal();
}
/**
* @param mixed $callback - A valid php callback, see php func is_callable()
* - A PEAR_Exception::OBSERVER_* constant
* - An array(const PEAR_Exception::OBSERVER_*,
* mixed $options)
* @param string $label The name of the observer. Use this if you want
* to remove it later with removeObserver()
*/
public static function addObserver($callback, $label = 'default')
{
self::$_observers[$label] = $callback;
}
public static function removeObserver($label = 'default')
{
unset(self::$_observers[$label]);
}
/**
* @return int unique identifier for an observer
*/
public static function getUniqueId()
{
return self::$_uniqueid++;
}
private function signal()
{
foreach (self::$_observers as $func) {
if (is_callable($func)) {
call_user_func($func, $this);
continue;
}
settype($func, 'array');
switch ($func[0]) {
case self::OBSERVER_PRINT :
$f = (isset($func[1])) ? $func[1] : '%s';
printf($f, $this->getMessage());
break;
case self::OBSERVER_TRIGGER :
$f = (isset($func[1])) ? $func[1] : E_USER_NOTICE;
trigger_error($this->getMessage(), $f);
break;
case self::OBSERVER_DIE :
$f = (isset($func[1])) ? $func[1] : '%s';
die(printf($f, $this->getMessage()));
break;
default:
trigger_error('invalid observer type', E_USER_WARNING);
}
}
}
/**
* Return specific error information that can be used for more detailed
* error messages or translation.
*
* This method may be overridden in child exception classes in order
* to add functionality not present in PEAR_Exception and is a placeholder
* to define API
*
* The returned array must be an associative array of parameter => value like so:
* <pre>
* array('name' => $name, 'context' => array(...))
* </pre>
* @return array
*/
public function getErrorData()
{
return array();
}
/**
* Returns the exception that caused this exception to be thrown
* @access public
* @return Exception|array The context of the exception
*/
public function getCause()
{
return $this->cause;
}
/**
* Function must be public to call on caused exceptions
* @param array
*/
public function getCauseMessage(&$causes)
{
$trace = $this->getTraceSafe();
$cause = array('class' => get_class($this),
'message' => $this->message,
'file' => 'unknown',
'line' => 'unknown');
if (isset($trace[0])) {
if (isset($trace[0]['file'])) {
$cause['file'] = $trace[0]['file'];
$cause['line'] = $trace[0]['line'];
}
}
if ($this->cause instanceof PEAR_Exception) {
$this->cause->getCauseMessage($causes);
}
if (is_array($this->cause)) {
foreach ($this->cause as $cause) {
if ($cause instanceof PEAR_Exception) {
$cause->getCauseMessage($causes);
} elseif (is_array($cause) && isset($cause['message'])) {
// PEAR_ErrorStack warning
$causes[] = array(
'class' => $cause['package'],
'message' => $cause['message'],
'file' => isset($cause['context']['file']) ?
$cause['context']['file'] :
'unknown',
'line' => isset($cause['context']['line']) ?
$cause['context']['line'] :
'unknown',
);
}
}
}
}
public function getTraceSafe()
{
if (!isset($this->_trace)) {
$this->_trace = $this->getTrace();
if (empty($this->_trace)) {
$backtrace = debug_backtrace();
$this->_trace = array($backtrace[count($backtrace)-1]);
}
}
return $this->_trace;
}
public function getErrorClass()
{
$trace = $this->getTraceSafe();
return $trace[0]['class'];
}
public function getErrorMethod()
{
$trace = $this->getTraceSafe();
return $trace[0]['function'];
}
public function __toString()
{
if (isset($_SERVER['REQUEST_URI'])) {
return $this->toHtml();
}
return $this->toText();
}
public function toHtml()
{
$trace = $this->getTraceSafe();
$causes = array();
$this->getCauseMessage($causes);
$html = '<table border="1" cellspacing="0">' . "\n";
foreach ($causes as $i => $cause) {
$html .= '<tr><td colspan="3" bgcolor="#ff9999">'
. str_repeat('-', $i) . ' <b>' . $cause['class'] . '</b>: '
. htmlspecialchars($cause['message']) . ' in <b>' . $cause['file'] . '</b> '
. 'on line <b>' . $cause['line'] . '</b>'
. "</td></tr>\n";
}
$html .= '<tr><td colspan="3" bgcolor="#aaaaaa" align="center"><b>Exception trace</b></td></tr>' . "\n"
. '<tr><td align="center" bgcolor="#cccccc" width="20"><b>#</b></td>'
. '<td align="center" bgcolor="#cccccc"><b>Function</b></td>'
. '<td align="center" bgcolor="#cccccc"><b>Location</b></td></tr>' . "\n";
foreach ($trace as $k => $v) {
$html .= '<tr><td align="center">' . $k . '</td>'
. '<td>';
if (!empty($v['class'])) {
$html .= $v['class'] . $v['type'];
}
$html .= $v['function'];
$args = array();
if (!empty($v['args'])) {
foreach ($v['args'] as $arg) {
if (is_null($arg)) $args[] = 'null';
elseif (is_array($arg)) $args[] = 'Array';
elseif (is_object($arg)) $args[] = 'Object('.get_class($arg).')';
elseif (is_bool($arg)) $args[] = $arg ? 'true' : 'false';
elseif (is_int($arg) || is_double($arg)) $args[] = $arg;
else {
$arg = (string)$arg;
$str = htmlspecialchars(substr($arg, 0, 16));
if (strlen($arg) > 16) $str .= '…';
$args[] = "'" . $str . "'";
}
}
}
$html .= '(' . implode(', ',$args) . ')'
. '</td>'
. '<td>' . $v['file'] . ':' . $v['line'] . '</td></tr>' . "\n";
}
$html .= '<tr><td align="center">' . ($k+1) . '</td>'
. '<td>{main}</td>'
. '<td> </td></tr>' . "\n"
. '</table>';
return $html;
}
public function toText()
{
$causes = array();
$this->getCauseMessage($causes);
$causeMsg = '';
foreach ($causes as $i => $cause) {
$causeMsg .= str_repeat(' ', $i) . $cause['class'] . ': '
. $cause['message'] . ' in ' . $cause['file']
. ' on line ' . $cause['line'] . "\n";
}
return $causeMsg . $this->getTraceAsString();
}
}
?> | {
"content_hash": "63c09d98fb9aaf36341af9d76a0ed917",
"timestamp": "",
"source": "github",
"line_count": 359,
"max_line_length": 111,
"avg_line_length": 35.682451253481894,
"alnum_prop": 0.44715066354410615,
"repo_name": "bantudevelopment/polysmis",
"id": "27d9ebb318e13b792c91f5bd0d3a6a9259d1acfe",
"size": "12810",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "vendor/Plugins/Pear/PEAR/Exception.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "711"
},
{
"name": "CSS",
"bytes": "26533"
},
{
"name": "HTML",
"bytes": "652480"
},
{
"name": "JavaScript",
"bytes": "760168"
},
{
"name": "PHP",
"bytes": "665494"
}
],
"symlink_target": ""
} |
import re
from trac.upgrades import backup_config_file
def do_upgrade(env, version, cursor):
"""Change [notification] ticket_subject_template and [notification]
batch_subject_template to use syntax compatible with Jinja2.
"""
config = env.config
section = 'notification'
re_template_var = re.compile(r'\$([\w.]+)')
def update_template(name):
old_value = config.get(section, name)
if old_value:
if re_template_var.match(old_value):
new_value = re_template_var.sub(r'${\1}', old_value)
env.log.info("Replaced value of [%s] %s: %s -> %s",
section, name, old_value, new_value)
config.set(section, name, new_value)
return True
return False
updated = update_template('ticket_subject_template')
updated |= update_template('batch_subject_template')
if updated:
backup_config_file(env, '.db45.bak')
config.save()
| {
"content_hash": "976829031f6ca8aaec3696ba7210aa82",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 71,
"avg_line_length": 33.166666666666664,
"alnum_prop": 0.5939698492462312,
"repo_name": "rbaumg/trac",
"id": "e04a545115d3b0e9b4634a5407c1662729f6ba2e",
"size": "1484",
"binary": false,
"copies": "1",
"ref": "refs/heads/trunk",
"path": "trac/upgrades/db45.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "1085"
},
{
"name": "C#",
"bytes": "114293"
},
{
"name": "CSS",
"bytes": "40666"
},
{
"name": "Groff",
"bytes": "1497"
},
{
"name": "JavaScript",
"bytes": "16747"
},
{
"name": "Python",
"bytes": "1287818"
},
{
"name": "Shell",
"bytes": "481"
},
{
"name": "Smalltalk",
"bytes": "11753"
}
],
"symlink_target": ""
} |
package com.reactnative.newarchitecture.modules;
import com.facebook.jni.HybridData;
import com.facebook.react.ReactPackage;
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.soloader.SoLoader;
import java.util.List;
/**
* Class responsible to load the TurboModules. This class has native methods and needs a
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
* folder for you).
*
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
* `newArchEnabled` property). Is ignored otherwise.
*/
public class MainApplicationTurboModuleManagerDelegate
extends ReactPackageTurboModuleManagerDelegate {
private static volatile boolean sIsSoLibraryLoaded;
protected MainApplicationTurboModuleManagerDelegate(
ReactApplicationContext reactApplicationContext, List<ReactPackage> packages) {
super(reactApplicationContext, packages);
}
protected native HybridData initHybrid();
native boolean canCreateTurboModule(String moduleName);
public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {
protected MainApplicationTurboModuleManagerDelegate build(
ReactApplicationContext context, List<ReactPackage> packages) {
return new MainApplicationTurboModuleManagerDelegate(context, packages);
}
}
@Override
protected synchronized void maybeLoadOtherSoLibraries() {
if (!sIsSoLibraryLoaded) {
// If you change the name of your application .so file in the Android.mk file,
// make sure you update the name here as well.
SoLoader.loadLibrary("reactnative_appmodules");
sIsSoLibraryLoaded = true;
}
}
}
| {
"content_hash": "8f05fd2b6b4ee0d86c8449225fc389dd",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 97,
"avg_line_length": 37.3125,
"alnum_prop": 0.7855946398659966,
"repo_name": "bugsnag/bugsnag-js",
"id": "1743c28afb211074f784902d6ca4c42e8c14a399",
"size": "1791",
"binary": false,
"copies": "2",
"ref": "refs/heads/next",
"path": "test/react-native/features/fixtures/rn0.69/android/app/src/main/java/com/reactnative/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "167202"
},
{
"name": "C++",
"bytes": "20909"
},
{
"name": "CSS",
"bytes": "80"
},
{
"name": "Dockerfile",
"bytes": "2918"
},
{
"name": "Gherkin",
"bytes": "240291"
},
{
"name": "HTML",
"bytes": "61460"
},
{
"name": "Java",
"bytes": "154475"
},
{
"name": "JavaScript",
"bytes": "372812"
},
{
"name": "Kotlin",
"bytes": "8175"
},
{
"name": "Makefile",
"bytes": "4544"
},
{
"name": "Objective-C",
"bytes": "115492"
},
{
"name": "Objective-C++",
"bytes": "12540"
},
{
"name": "Python",
"bytes": "1188"
},
{
"name": "Ruby",
"bytes": "56532"
},
{
"name": "Shell",
"bytes": "27389"
},
{
"name": "Starlark",
"bytes": "17520"
},
{
"name": "Swift",
"bytes": "364"
},
{
"name": "TypeScript",
"bytes": "749182"
}
],
"symlink_target": ""
} |
set -e
# Perform all actions as $POSTGRES_USER
export PGUSER="$POSTGRES_USER"
# https://pgtune.leopard.in.ua/
# DB Version: 11
# OS Type: linux
# DB Type: web
# Total Memory (RAM): 4 GB
# CPUs num: 2
# Connections num: 150
# Data Storage: ssd
psql -c "ALTER SYSTEM SET max_connections = '150';"
psql -c "ALTER SYSTEM SET shared_buffers = '1GB';"
psql -c "ALTER SYSTEM SET effective_cache_size = '3GB';"
psql -c "ALTER SYSTEM SET maintenance_work_mem = '256MB';"
psql -c "ALTER SYSTEM SET checkpoint_completion_target = '0.7';"
psql -c "ALTER SYSTEM SET wal_buffers = '16MB';"
psql -c "ALTER SYSTEM SET default_statistics_target = '100';"
psql -c "ALTER SYSTEM SET random_page_cost = '1.1';"
psql -c "ALTER SYSTEM SET effective_io_concurrency = '200';"
psql -c "ALTER SYSTEM SET work_mem = '6990kB';"
psql -c "ALTER SYSTEM SET min_wal_size = '1GB';"
psql -c "ALTER SYSTEM SET max_wal_size = '2GB';"
psql -c "ALTER SYSTEM SET max_worker_processes = '2';"
psql -c "ALTER SYSTEM SET max_parallel_workers_per_gather = '1';"
psql -c "ALTER SYSTEM SET max_parallel_workers = '2';"
| {
"content_hash": "a8209ff5ece1b0d702ad29762e8c367f",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 65,
"avg_line_length": 38.42857142857143,
"alnum_prop": 0.6914498141263941,
"repo_name": "fegyi001/osmgwc",
"id": "f61fa439cfcdeb234e452dceb096998b3ffb4164",
"size": "1087",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docker/db/initdb-postgis.sh",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "11655"
},
{
"name": "Dockerfile",
"bytes": "577"
},
{
"name": "Shell",
"bytes": "1136"
}
],
"symlink_target": ""
} |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/style/ash_color_provider.h"
#include <math.h>
#include "ash/constants/ash_constants.h"
#include "ash/constants/ash_features.h"
#include "ash/constants/ash_pref_names.h"
#include "ash/public/cpp/style/color_mode_observer.h"
#include "ash/session/session_controller_impl.h"
#include "ash/shell.h"
#include "ash/wallpaper/wallpaper_controller_impl.h"
#include "base/bind.h"
#include "base/check_op.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/string_number_conversions.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "ui/chromeos/styles/cros_styles.h"
#include "ui/gfx/color_analysis.h"
#include "ui/gfx/color_utils.h"
namespace ash {
using ColorName = cros_styles::ColorName;
namespace {
// Opacity of the light/dark indrop.
constexpr float kLightInkDropOpacity = 0.08f;
constexpr float kDarkInkDropOpacity = 0.06f;
// The disabled color is always 38% opacity of the enabled color.
constexpr float kDisabledColorOpacity = 0.38f;
// Color of second tone is always 30% opacity of the color of first tone.
constexpr float kSecondToneOpacity = 0.3f;
// Different alpha values that can be used by Shield and Base layers.
constexpr int kAlpha20 = 51; // 20%
constexpr int kAlpha40 = 102; // 40%
constexpr int kAlpha60 = 153; // 60%
constexpr int kAlpha80 = 204; // 80%
constexpr int kAlpha90 = 230; // 90%
constexpr int kAlpha95 = 242; // 95%
// Alpha value that is used to calculate themed color. Please see function
// GetBackgroundThemedColor() about how the themed color is calculated.
constexpr int kDarkBackgroundBlendAlpha = 127; // 50%
constexpr int kLightBackgroundBlendAlpha = 127; // 50%
AshColorProvider* g_instance = nullptr;
// Get the corresponding ColorName for |type|. ColorName is an enum in
// cros_styles.h file that is generated from cros_colors.json5, which
// includes the color IDs and colors that will be used by ChromeOS WebUI.
ColorName TypeToColorName(AshColorProvider::ContentLayerType type) {
switch (type) {
case AshColorProvider::ContentLayerType::kTextColorPrimary:
return ColorName::kTextColorPrimary;
case AshColorProvider::ContentLayerType::kTextColorSecondary:
return ColorName::kTextColorSecondary;
case AshColorProvider::ContentLayerType::kTextColorAlert:
return ColorName::kTextColorAlert;
case AshColorProvider::ContentLayerType::kTextColorWarning:
return ColorName::kTextColorWarning;
case AshColorProvider::ContentLayerType::kTextColorPositive:
return ColorName::kTextColorPositive;
case AshColorProvider::ContentLayerType::kIconColorPrimary:
return ColorName::kIconColorPrimary;
case AshColorProvider::ContentLayerType::kIconColorAlert:
return ColorName::kIconColorAlert;
case AshColorProvider::ContentLayerType::kIconColorWarning:
return ColorName::kIconColorWarning;
case AshColorProvider::ContentLayerType::kIconColorPositive:
return ColorName::kIconColorPositive;
default:
DCHECK_EQ(AshColorProvider::ContentLayerType::kIconColorProminent, type);
return ColorName::kIconColorProminent;
}
}
// Get the color from cros_styles.h header file that is generated from
// cros_colors.json5. Colors there will also be used by ChromeOS WebUI.
SkColor ResolveColor(AshColorProvider::ContentLayerType type,
bool use_dark_color) {
return cros_styles::ResolveColor(TypeToColorName(type), use_dark_color);
}
// Notify all the other components besides the System UI to update on the color
// mode or theme changes. E.g, Chrome browser, WebUI. And since AshColorProvider
// is kind of NativeTheme of ChromeOS. This will notify the View::OnThemeChanged
// to live update the colors on color mode or theme changes as well.
void NotifyColorModeAndThemeChanges(bool is_dark_mode_enabled) {
auto* native_theme = ui::NativeTheme::GetInstanceForNativeUi();
native_theme->set_use_dark_colors(is_dark_mode_enabled);
native_theme->NotifyOnNativeThemeUpdated();
auto* native_theme_web = ui::NativeTheme::GetInstanceForWeb();
native_theme_web->set_preferred_color_scheme(
is_dark_mode_enabled ? ui::NativeTheme::PreferredColorScheme::kDark
: ui::NativeTheme::PreferredColorScheme::kLight);
native_theme_web->NotifyOnNativeThemeUpdated();
}
} // namespace
AshColorProvider::AshColorProvider() {
DCHECK(!g_instance);
g_instance = this;
// May be null in unit tests.
if (Shell::HasInstance())
Shell::Get()->session_controller()->AddObserver(this);
cros_styles::SetDebugColorsEnabled(base::FeatureList::IsEnabled(
ash::features::kSemanticColorsDebugOverride));
}
AshColorProvider::~AshColorProvider() {
DCHECK_EQ(g_instance, this);
g_instance = nullptr;
// May be null in unit tests.
if (Shell::HasInstance())
Shell::Get()->session_controller()->RemoveObserver(this);
cros_styles::SetDebugColorsEnabled(false);
cros_styles::SetDarkModeEnabled(false);
}
// static
AshColorProvider* AshColorProvider::Get() {
return g_instance;
}
// static
SkColor AshColorProvider::GetDisabledColor(SkColor enabled_color) {
return SkColorSetA(enabled_color, std::round(SkColorGetA(enabled_color) *
kDisabledColorOpacity));
}
// static
SkColor AshColorProvider::GetSecondToneColor(SkColor color_of_first_tone) {
return SkColorSetA(
color_of_first_tone,
std::round(SkColorGetA(color_of_first_tone) * kSecondToneOpacity));
}
// static
void AshColorProvider::RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(prefs::kDarkModeEnabled,
kDefaultDarkModeEnabled);
registry->RegisterBooleanPref(prefs::kColorModeThemed,
kDefaultColorModeThemed);
}
void AshColorProvider::OnActiveUserPrefServiceChanged(PrefService* prefs) {
if (!features::IsDarkLightModeEnabled())
return;
active_user_pref_service_ = prefs;
pref_change_registrar_ = std::make_unique<PrefChangeRegistrar>();
pref_change_registrar_->Init(prefs);
pref_change_registrar_->Add(
prefs::kDarkModeEnabled,
base::BindRepeating(&AshColorProvider::NotifyDarkModeEnabledPrefChange,
base::Unretained(this)));
pref_change_registrar_->Add(
prefs::kColorModeThemed,
base::BindRepeating(&AshColorProvider::NotifyColorModeThemedPrefChange,
base::Unretained(this)));
// Immediately tell all the observers to load this user's saved preferences.
NotifyDarkModeEnabledPrefChange();
NotifyColorModeThemedPrefChange();
}
void AshColorProvider::OnSessionStateChanged(
session_manager::SessionState state) {
if (!features::IsDarkLightModeEnabled())
return;
NotifyDarkModeEnabledPrefChange();
NotifyColorModeThemedPrefChange();
}
SkColor AshColorProvider::GetShieldLayerColor(ShieldLayerType type) const {
return GetShieldLayerColorImpl(type, /*inverted=*/false);
}
SkColor AshColorProvider::GetBaseLayerColor(BaseLayerType type) const {
return GetBaseLayerColorImpl(type, /*inverted=*/false);
}
SkColor AshColorProvider::GetControlsLayerColor(ControlsLayerType type) const {
return GetControlsLayerColorImpl(type, IsDarkModeEnabled());
}
SkColor AshColorProvider::GetContentLayerColor(ContentLayerType type) const {
return GetContentLayerColorImpl(type, IsDarkModeEnabled());
}
SkColor AshColorProvider::GetActiveDialogTitleBarColor() const {
return cros_styles::ResolveColor(cros_styles::ColorName::kDialogTitleBarColor,
IsDarkModeEnabled());
}
SkColor AshColorProvider::GetInactiveDialogTitleBarColor() const {
// TODO(wenbojie): Use a different inactive color in future.
return GetActiveDialogTitleBarColor();
}
std::pair<SkColor, float> AshColorProvider::GetInkDropBaseColorAndOpacity(
SkColor background_color) const {
if (background_color == gfx::kPlaceholderColor)
background_color = GetBackgroundColor();
const bool is_dark = color_utils::IsDark(background_color);
const SkColor base_color = is_dark ? SK_ColorWHITE : SK_ColorBLACK;
const float opacity = is_dark ? kLightInkDropOpacity : kDarkInkDropOpacity;
return std::make_pair(base_color, opacity);
}
SkColor AshColorProvider::GetInvertedShieldLayerColor(
ShieldLayerType type) const {
return GetShieldLayerColorImpl(type, /*inverted=*/true);
}
SkColor AshColorProvider::GetInvertedBaseLayerColor(BaseLayerType type) const {
return GetBaseLayerColorImpl(type, /*inverted=*/true);
}
SkColor AshColorProvider::GetInvertedControlsLayerColor(
ControlsLayerType type) const {
return GetControlsLayerColorImpl(type, !IsDarkModeEnabled());
}
SkColor AshColorProvider::GetInvertedContentLayerColor(
ContentLayerType type) const {
return GetContentLayerColorImpl(type, !IsDarkModeEnabled());
}
SkColor AshColorProvider::GetBackgroundColor() const {
return IsThemed() ? GetBackgroundThemedColor() : GetBackgroundDefaultColor();
}
SkColor AshColorProvider::GetInvertedBackgroundColor() const {
return IsThemed() ? GetInvertedBackgroundThemedColor()
: GetInvertedBackgroundDefaultColor();
}
SkColor AshColorProvider::GetBackgroundColorInMode(bool use_dark_color) const {
return cros_styles::ResolveColor(cros_styles::ColorName::kBgColor,
use_dark_color);
}
void AshColorProvider::AddObserver(ColorModeObserver* observer) {
observers_.AddObserver(observer);
}
void AshColorProvider::RemoveObserver(ColorModeObserver* observer) {
observers_.RemoveObserver(observer);
}
bool AshColorProvider::IsDarkModeEnabled() const {
if (!features::IsDarkLightModeEnabled() && override_light_mode_as_default_)
return false;
// Keep colors in OOBE as LIGHT when D/L is enabled. When the feature is
// disabled, lots of colors are hard coded in OOBE for now.
if (features::IsDarkLightModeEnabled() &&
Shell::Get()->session_controller()->GetSessionState() ==
session_manager::SessionState::OOBE) {
return false;
}
// Keep it at dark mode if it is not in an active user session or
// kDarkLightMode feature is not enabled.
// TODO(minch): Besides OOBE, make LIGHT as the color mode for other
// non-active user session as well while enabling D/L feature.
if (!active_user_pref_service_ || !features::IsDarkLightModeEnabled())
return true;
return active_user_pref_service_->GetBoolean(prefs::kDarkModeEnabled);
}
void AshColorProvider::SetDarkModeEnabledForTest(bool enabled) {
DCHECK(features::IsDarkLightModeEnabled());
if (IsDarkModeEnabled() != enabled) {
ToggleColorMode();
}
}
bool AshColorProvider::IsThemed() const {
if (!active_user_pref_service_)
return kDefaultColorModeThemed;
return active_user_pref_service_->GetBoolean(prefs::kColorModeThemed);
}
void AshColorProvider::ToggleColorMode() {
DCHECK(active_user_pref_service_);
const bool value = !IsDarkModeEnabled();
active_user_pref_service_->SetBoolean(prefs::kDarkModeEnabled, value);
active_user_pref_service_->CommitPendingWrite();
NotifyDarkModeEnabledPrefChange();
base::UmaHistogramBoolean("Ash.DarkTheme.SystemTray.IsDarkModeEnabled",
value);
}
void AshColorProvider::UpdateColorModeThemed(bool is_themed) {
if (is_themed == IsThemed())
return;
DCHECK(active_user_pref_service_);
active_user_pref_service_->SetBoolean(prefs::kColorModeThemed, is_themed);
active_user_pref_service_->CommitPendingWrite();
NotifyColorModeThemedPrefChange();
}
SkColor AshColorProvider::GetShieldLayerColorImpl(ShieldLayerType type,
bool inverted) const {
constexpr int kAlphas[] = {kAlpha20, kAlpha40, kAlpha60,
kAlpha80, kAlpha90, kAlpha95};
DCHECK_LT(static_cast<size_t>(type), std::size(kAlphas));
return SkColorSetA(
inverted ? GetInvertedBackgroundColor() : GetBackgroundColor(),
kAlphas[static_cast<int>(type)]);
}
SkColor AshColorProvider::GetBaseLayerColorImpl(BaseLayerType type,
bool inverted) const {
constexpr int kAlphas[] = {kAlpha20, kAlpha40, kAlpha60, kAlpha80,
kAlpha90, kAlpha95, 0xFF};
DCHECK_LT(static_cast<size_t>(type), std::size(kAlphas));
return SkColorSetA(
inverted ? GetInvertedBackgroundColor() : GetBackgroundColor(),
kAlphas[static_cast<int>(type)]);
}
SkColor AshColorProvider::GetControlsLayerColorImpl(ControlsLayerType type,
bool use_dark_color) const {
switch (type) {
case ControlsLayerType::kHairlineBorderColor:
return use_dark_color ? SkColorSetA(SK_ColorWHITE, 0x24)
: SkColorSetA(SK_ColorBLACK, 0x24);
case ControlsLayerType::kControlBackgroundColorActive:
return use_dark_color ? gfx::kGoogleBlue300 : gfx::kGoogleBlue600;
case ControlsLayerType::kControlBackgroundColorInactive:
return use_dark_color ? SkColorSetA(SK_ColorWHITE, 0x1A)
: SkColorSetA(SK_ColorBLACK, 0x0D);
case ControlsLayerType::kControlBackgroundColorAlert:
return use_dark_color ? gfx::kGoogleRed300 : gfx::kGoogleRed600;
case ControlsLayerType::kControlBackgroundColorWarning:
return use_dark_color ? gfx::kGoogleYellow300 : gfx::kGoogleYellow600;
case ControlsLayerType::kControlBackgroundColorPositive:
return use_dark_color ? gfx::kGoogleGreen300 : gfx::kGoogleGreen600;
case ControlsLayerType::kFocusAuraColor:
return use_dark_color ? SkColorSetA(gfx::kGoogleBlue300, 0x3D)
: SkColorSetA(gfx::kGoogleBlue600, 0x3D);
case ControlsLayerType::kFocusRingColor:
return use_dark_color ? gfx::kGoogleBlue300 : gfx::kGoogleBlue600;
case ControlsLayerType::kHighlightColor1:
return use_dark_color ? SkColorSetA(SK_ColorWHITE, 0x14)
: SkColorSetA(SK_ColorWHITE, 0x4C);
case ControlsLayerType::kBorderColor1:
return use_dark_color ? GetBaseLayerColor(BaseLayerType::kTransparent80)
: SkColorSetA(SK_ColorBLACK, 0x0F);
case ControlsLayerType::kHighlightColor2:
return use_dark_color ? SkColorSetA(SK_ColorWHITE, 0x0F)
: SkColorSetA(SK_ColorWHITE, 0x33);
case ControlsLayerType::kBorderColor2:
return use_dark_color ? GetBaseLayerColor(BaseLayerType::kTransparent60)
: SkColorSetA(SK_ColorBLACK, 0x0F);
}
}
SkColor AshColorProvider::GetContentLayerColorImpl(ContentLayerType type,
bool use_dark_color) const {
switch (type) {
case ContentLayerType::kSeparatorColor:
case ContentLayerType::kShelfHandleColor:
return use_dark_color ? SkColorSetA(SK_ColorWHITE, 0x24)
: SkColorSetA(SK_ColorBLACK, 0x24);
case ContentLayerType::kIconColorSecondary:
return gfx::kGoogleGrey500;
case ContentLayerType::kIconColorSecondaryBackground:
return use_dark_color ? gfx::kGoogleGrey100 : gfx::kGoogleGrey800;
case ContentLayerType::kAppStateIndicatorColor:
case ContentLayerType::kScrollBarColor:
case ContentLayerType::kSliderColorInactive:
case ContentLayerType::kRadioColorInactive:
return use_dark_color ? gfx::kGoogleGrey200 : gfx::kGoogleGrey700;
case ContentLayerType::kSwitchKnobColorInactive:
return use_dark_color ? gfx::kGoogleGrey400 : SK_ColorWHITE;
case ContentLayerType::kSwitchTrackColorInactive:
return GetSecondToneColor(use_dark_color ? gfx::kGoogleGrey200
: gfx::kGoogleGrey700);
case ContentLayerType::kButtonLabelColorBlue:
case ContentLayerType::kTextColorURL:
case ContentLayerType::kSliderColorActive:
case ContentLayerType::kRadioColorActive:
case ContentLayerType::kSwitchKnobColorActive:
case ContentLayerType::kProgressBarColorForeground:
return use_dark_color ? gfx::kGoogleBlue300 : gfx::kGoogleBlue600;
case ContentLayerType::kProgressBarColorBackground:
return SkColorSetA(
use_dark_color ? gfx::kGoogleBlue300 : gfx::kGoogleBlue600, 0x4C);
case ContentLayerType::kSwitchTrackColorActive:
return GetSecondToneColor(GetContentLayerColorImpl(
ContentLayerType::kSwitchKnobColorActive, use_dark_color));
case ContentLayerType::kButtonLabelColorPrimary:
case ContentLayerType::kButtonIconColorPrimary:
case ContentLayerType::kBatteryBadgeColor:
return use_dark_color ? gfx::kGoogleGrey900 : gfx::kGoogleGrey200;
case ContentLayerType::kAppStateIndicatorColorInactive:
return GetDisabledColor(GetContentLayerColorImpl(
ContentLayerType::kAppStateIndicatorColor, use_dark_color));
case ContentLayerType::kCurrentDeskColor:
return use_dark_color ? SK_ColorWHITE : SK_ColorBLACK;
case ContentLayerType::kSwitchAccessInnerStrokeColor:
return gfx::kGoogleBlue300;
case ContentLayerType::kSwitchAccessOuterStrokeColor:
return gfx::kGoogleBlue900;
case ContentLayerType::kHighlightColorHover:
return use_dark_color ? SkColorSetA(SK_ColorWHITE, 0x0D)
: SkColorSetA(SK_ColorBLACK, 0x14);
case ContentLayerType::kButtonIconColor:
case ContentLayerType::kButtonLabelColor:
return use_dark_color ? gfx::kGoogleGrey200 : gfx::kGoogleGrey900;
default:
return ResolveColor(type, use_dark_color);
}
}
SkColor AshColorProvider::GetBackgroundDefaultColor() const {
return GetBackgroundColorInMode(IsDarkModeEnabled());
}
SkColor AshColorProvider::GetInvertedBackgroundDefaultColor() const {
return GetBackgroundColorInMode(!IsDarkModeEnabled());
}
SkColor AshColorProvider::GetBackgroundThemedColor() const {
return GetBackgroundThemedColorImpl(GetBackgroundDefaultColor(),
IsDarkModeEnabled());
}
SkColor AshColorProvider::GetInvertedBackgroundThemedColor() const {
return GetBackgroundThemedColorImpl(GetInvertedBackgroundDefaultColor(),
!IsDarkModeEnabled());
}
SkColor AshColorProvider::GetBackgroundThemedColorImpl(
SkColor default_color,
bool use_dark_color) const {
// May be null in unit tests.
if (!Shell::HasInstance())
return default_color;
WallpaperControllerImpl* wallpaper_controller =
Shell::Get()->wallpaper_controller();
if (!wallpaper_controller)
return default_color;
color_utils::LumaRange luma_range = use_dark_color
? color_utils::LumaRange::DARK
: color_utils::LumaRange::LIGHT;
SkColor muted_color =
wallpaper_controller->GetProminentColor(color_utils::ColorProfile(
luma_range, color_utils::SaturationRange::MUTED));
if (muted_color == kInvalidWallpaperColor)
return default_color;
return color_utils::GetResultingPaintColor(
SkColorSetA(use_dark_color ? SK_ColorBLACK : SK_ColorWHITE,
use_dark_color ? kDarkBackgroundBlendAlpha
: kLightBackgroundBlendAlpha),
muted_color);
}
void AshColorProvider::NotifyDarkModeEnabledPrefChange() {
const bool is_enabled = IsDarkModeEnabled();
cros_styles::SetDarkModeEnabled(is_enabled);
for (auto& observer : observers_)
observer.OnColorModeChanged(is_enabled);
NotifyColorModeAndThemeChanges(IsDarkModeEnabled());
}
void AshColorProvider::NotifyColorModeThemedPrefChange() {
const bool is_themed = IsThemed();
for (auto& observer : observers_)
observer.OnColorModeThemed(is_themed);
NotifyColorModeAndThemeChanges(IsDarkModeEnabled());
}
} // namespace ash
| {
"content_hash": "feac3923fd896508efeb9ea27f11f4de",
"timestamp": "",
"source": "github",
"line_count": 502,
"max_line_length": 80,
"avg_line_length": 40.04780876494024,
"alnum_prop": 0.7253780342220454,
"repo_name": "scheib/chromium",
"id": "93332df3ab5abdf5cb08f655c731a21c4c7fff2d",
"size": "20104",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "ash/style/ash_color_provider.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None
class Span:
"""
Span covers a portion of text.
<code>start</code> - start index of span in the raw text (inclusive).<br/>
<code>ending</code> - end index of span in the raw text (exclusive).<br/>
<code>label</code> - label for span.<br/>
<code>score</code> - score of span.<br/>
<code>source</code> - the source annotator of this span.<br/>
<code>attributes</code> - any additional attributes assoicated with this span. a map of attribute_name => value.<br/>
<code>multiIndex</code> - if associated with a MultiRecord which Record object is this span for.
Attributes:
- start: start index of span in the raw text (inclusive).
- ending: ending index of span in the raw text (exclusive).
- label: label for span.
- score: score of span.
- source: source of span.
- attributes: any additional attributes assoicated with this span.
- multiIndex: index of the text (in the multirecord) to which this span references.
"""
thrift_spec = (
None, # 0
(1, TType.I32, 'start', None, None, ), # 1
(2, TType.I32, 'ending', None, None, ), # 2
(3, TType.STRING, 'label', None, None, ), # 3
(4, TType.DOUBLE, 'score', None, None, ), # 4
(5, TType.STRING, 'source', None, None, ), # 5
(6, TType.MAP, 'attributes', (TType.STRING,None,TType.STRING,None), None, ), # 6
(7, TType.I32, 'multiIndex', None, None, ), # 7
)
def __init__(self, start=None, ending=None, label=None, score=None, source=None, attributes=None, multiIndex=None,):
self.start = start
self.ending = ending
self.label = label
self.score = score
self.source = source
self.attributes = attributes
self.multiIndex = multiIndex
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.I32:
self.start = iprot.readI32();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.I32:
self.ending = iprot.readI32();
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.STRING:
self.label = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 4:
if ftype == TType.DOUBLE:
self.score = iprot.readDouble();
else:
iprot.skip(ftype)
elif fid == 5:
if ftype == TType.STRING:
self.source = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 6:
if ftype == TType.MAP:
self.attributes = {}
(_ktype1, _vtype2, _size0 ) = iprot.readMapBegin()
for _i4 in xrange(_size0):
_key5 = iprot.readString();
_val6 = iprot.readString();
self.attributes[_key5] = _val6
iprot.readMapEnd()
else:
iprot.skip(ftype)
elif fid == 7:
if ftype == TType.I32:
self.multiIndex = iprot.readI32();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('Span')
if self.start is not None:
oprot.writeFieldBegin('start', TType.I32, 1)
oprot.writeI32(self.start)
oprot.writeFieldEnd()
if self.ending is not None:
oprot.writeFieldBegin('ending', TType.I32, 2)
oprot.writeI32(self.ending)
oprot.writeFieldEnd()
if self.label is not None:
oprot.writeFieldBegin('label', TType.STRING, 3)
oprot.writeString(self.label)
oprot.writeFieldEnd()
if self.score is not None:
oprot.writeFieldBegin('score', TType.DOUBLE, 4)
oprot.writeDouble(self.score)
oprot.writeFieldEnd()
if self.source is not None:
oprot.writeFieldBegin('source', TType.STRING, 5)
oprot.writeString(self.source)
oprot.writeFieldEnd()
if self.attributes is not None:
oprot.writeFieldBegin('attributes', TType.MAP, 6)
oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes))
for kiter7,viter8 in self.attributes.items():
oprot.writeString(kiter7)
oprot.writeString(viter8)
oprot.writeMapEnd()
oprot.writeFieldEnd()
if self.multiIndex is not None:
oprot.writeFieldBegin('multiIndex', TType.I32, 7)
oprot.writeI32(self.multiIndex)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.start is None:
raise TProtocol.TProtocolException(message='Required field start is unset!')
if self.ending is None:
raise TProtocol.TProtocolException(message='Required field ending is unset!')
return
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class Labeling:
"""
A labeling of text. Really a list of Spans.
<code>labels</code> - the labels for this labeling. Each label represented as a Span.<br/>
<code>source</code> - the source annotator this labeling came from.<br/>
<code>score</code> - the score for this labeling.<br/>
<code>rawText</code> - the raw text for this labeling (if null then consult the labeling's parent's rawText field, i.e., the Record's)
Attributes:
- labels: the labels as spans.
- source: the source of this labeling came from.
- score: score for this labeling.
- rawText: the raw text for this labeling (if null then consult the labeling's parent's rawText field)
"""
thrift_spec = (
None, # 0
(1, TType.LIST, 'labels', (TType.STRUCT,(Span, Span.thrift_spec)), None, ), # 1
(2, TType.STRING, 'source', None, None, ), # 2
(3, TType.DOUBLE, 'score', None, None, ), # 3
(4, TType.STRING, 'rawText', None, None, ), # 4
)
def __init__(self, labels=None, source=None, score=None, rawText=None,):
self.labels = labels
self.source = source
self.score = score
self.rawText = rawText
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.LIST:
self.labels = []
(_etype12, _size9) = iprot.readListBegin()
for _i13 in xrange(_size9):
_elem14 = Span()
_elem14.read(iprot)
self.labels.append(_elem14)
iprot.readListEnd()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.source = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.DOUBLE:
self.score = iprot.readDouble();
else:
iprot.skip(ftype)
elif fid == 4:
if ftype == TType.STRING:
self.rawText = iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('Labeling')
if self.labels is not None:
oprot.writeFieldBegin('labels', TType.LIST, 1)
oprot.writeListBegin(TType.STRUCT, len(self.labels))
for iter15 in self.labels:
iter15.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
if self.source is not None:
oprot.writeFieldBegin('source', TType.STRING, 2)
oprot.writeString(self.source)
oprot.writeFieldEnd()
if self.score is not None:
oprot.writeFieldBegin('score', TType.DOUBLE, 3)
oprot.writeDouble(self.score)
oprot.writeFieldEnd()
if self.rawText is not None:
oprot.writeFieldBegin('rawText', TType.STRING, 4)
oprot.writeString(self.rawText)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.labels is None:
raise TProtocol.TProtocolException(message='Required field labels is unset!')
return
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class Clustering:
"""
A clustering of labels for the text. Each cluster is represented
as a Labeling which in turn will have labels (list<Span>)
representing each item in the cluster.
<code>clusters</code> - the clusters for the this clustering. Each cluster represented as a Labeling.<br/>
<code>source</code> - the source annotator this clustering came from.<br/>
<code>score</code> - the score for this clustering.<br/>
<code>rawText</code> - the raw text for this clustering (if null then consult the labeling's parent's rawText field, i.e., the Record's)
Attributes:
- clusters: the clusters, each cluster is a Labeling.
- source: the source of this Clustering
- score: score for this clustering
- rawText: the raw text for this clustering (if null then consult the clustering's parent's rawText field)
"""
thrift_spec = (
None, # 0
(1, TType.LIST, 'clusters', (TType.STRUCT,(Labeling, Labeling.thrift_spec)), None, ), # 1
(2, TType.STRING, 'source', None, None, ), # 2
(3, TType.DOUBLE, 'score', None, None, ), # 3
(4, TType.STRING, 'rawText', None, None, ), # 4
)
def __init__(self, clusters=None, source=None, score=None, rawText=None,):
self.clusters = clusters
self.source = source
self.score = score
self.rawText = rawText
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.LIST:
self.clusters = []
(_etype19, _size16) = iprot.readListBegin()
for _i20 in xrange(_size16):
_elem21 = Labeling()
_elem21.read(iprot)
self.clusters.append(_elem21)
iprot.readListEnd()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.source = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.DOUBLE:
self.score = iprot.readDouble();
else:
iprot.skip(ftype)
elif fid == 4:
if ftype == TType.STRING:
self.rawText = iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('Clustering')
if self.clusters is not None:
oprot.writeFieldBegin('clusters', TType.LIST, 1)
oprot.writeListBegin(TType.STRUCT, len(self.clusters))
for iter22 in self.clusters:
iter22.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
if self.source is not None:
oprot.writeFieldBegin('source', TType.STRING, 2)
oprot.writeString(self.source)
oprot.writeFieldEnd()
if self.score is not None:
oprot.writeFieldBegin('score', TType.DOUBLE, 3)
oprot.writeDouble(self.score)
oprot.writeFieldEnd()
if self.rawText is not None:
oprot.writeFieldBegin('rawText', TType.STRING, 4)
oprot.writeString(self.rawText)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.clusters is None:
raise TProtocol.TProtocolException(message='Required field clusters is unset!')
return
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class Node:
"""
Nodes store their children. Referenced as index into list<Node> in
the containing struct.
Here the link between Node can be labeled.
<code>label</code> - the label for this Node.<br/>
<code>span</code> - the span this node covers.<br/>
<code>children</code> - the children of the node represented as a map of <child index, edge label>. Empty string implies no label. The index is the index of the node in the parent data structure (i.e., the tree's nodes).<br/>
<code>source</code> - the source annotator this node came from.<br/>
<code>score</code> - the score for this node.<br/>
Attributes:
- label: the label of the node.
- span: the span this node covers.
- children: the children of the node represented as a map of <child index, edge label>. Empty string implies no label.
- source: source of the node .
- score: the score for this node.
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'label', None, None, ), # 1
(2, TType.STRUCT, 'span', (Span, Span.thrift_spec), None, ), # 2
(3, TType.MAP, 'children', (TType.I32,None,TType.STRING,None), None, ), # 3
(4, TType.STRING, 'source', None, None, ), # 4
(5, TType.DOUBLE, 'score', None, None, ), # 5
)
def __init__(self, label=None, span=None, children=None, source=None, score=None,):
self.label = label
self.span = span
self.children = children
self.source = source
self.score = score
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.STRING:
self.label = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
self.span = Span()
self.span.read(iprot)
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.MAP:
self.children = {}
(_ktype24, _vtype25, _size23 ) = iprot.readMapBegin()
for _i27 in xrange(_size23):
_key28 = iprot.readI32();
_val29 = iprot.readString();
self.children[_key28] = _val29
iprot.readMapEnd()
else:
iprot.skip(ftype)
elif fid == 4:
if ftype == TType.STRING:
self.source = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 5:
if ftype == TType.DOUBLE:
self.score = iprot.readDouble();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('Node')
if self.label is not None:
oprot.writeFieldBegin('label', TType.STRING, 1)
oprot.writeString(self.label)
oprot.writeFieldEnd()
if self.span is not None:
oprot.writeFieldBegin('span', TType.STRUCT, 2)
self.span.write(oprot)
oprot.writeFieldEnd()
if self.children is not None:
oprot.writeFieldBegin('children', TType.MAP, 3)
oprot.writeMapBegin(TType.I32, TType.STRING, len(self.children))
for kiter30,viter31 in self.children.items():
oprot.writeI32(kiter30)
oprot.writeString(viter31)
oprot.writeMapEnd()
oprot.writeFieldEnd()
if self.source is not None:
oprot.writeFieldBegin('source', TType.STRING, 4)
oprot.writeString(self.source)
oprot.writeFieldEnd()
if self.score is not None:
oprot.writeFieldBegin('score', TType.DOUBLE, 5)
oprot.writeDouble(self.score)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.label is None:
raise TProtocol.TProtocolException(message='Required field label is unset!')
return
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class Tree:
"""
Trees are a set of connected nodes with a top node.
<code>nodes</code> - the list of labeled nodes. <br/>
<code>top</code> - the index in nodes of the top node. <br/>
<code>source</code> - the source annotator this Tree came from.<br/>
<code>score</code> - the score for this Tree.
Attributes:
- nodes: list of labeled nodes.
- top: the index of top/root node in nodes.
- source: the source of this tree.
- score: the score of this tree.
"""
thrift_spec = (
None, # 0
(1, TType.LIST, 'nodes', (TType.STRUCT,(Node, Node.thrift_spec)), None, ), # 1
(2, TType.I32, 'top', None, None, ), # 2
(3, TType.STRING, 'source', None, None, ), # 3
(4, TType.DOUBLE, 'score', None, None, ), # 4
)
def __init__(self, nodes=None, top=None, source=None, score=None,):
self.nodes = nodes
self.top = top
self.source = source
self.score = score
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.LIST:
self.nodes = []
(_etype35, _size32) = iprot.readListBegin()
for _i36 in xrange(_size32):
_elem37 = Node()
_elem37.read(iprot)
self.nodes.append(_elem37)
iprot.readListEnd()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.I32:
self.top = iprot.readI32();
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.STRING:
self.source = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 4:
if ftype == TType.DOUBLE:
self.score = iprot.readDouble();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('Tree')
if self.nodes is not None:
oprot.writeFieldBegin('nodes', TType.LIST, 1)
oprot.writeListBegin(TType.STRUCT, len(self.nodes))
for iter38 in self.nodes:
iter38.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
if self.top is not None:
oprot.writeFieldBegin('top', TType.I32, 2)
oprot.writeI32(self.top)
oprot.writeFieldEnd()
if self.source is not None:
oprot.writeFieldBegin('source', TType.STRING, 3)
oprot.writeString(self.source)
oprot.writeFieldEnd()
if self.score is not None:
oprot.writeFieldBegin('score', TType.DOUBLE, 4)
oprot.writeDouble(self.score)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.nodes is None:
raise TProtocol.TProtocolException(message='Required field nodes is unset!')
if self.top is None:
raise TProtocol.TProtocolException(message='Required field top is unset!')
return
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class Forest:
"""
Forest is a set of trees.
<code>trees</code> - the trees for the this forest.<br/>
<code>source</code> - the source annotator this forest came from.<br/>
<code>score</code> - the score for this forest.<br/>
<code>rawText</code> - the raw text for this forest (if null then consult the labeling's parent's rawText field, i.e., the Record's)
Attributes:
- trees: the trees in this Forest
- rawText: the raw text for this Forest (if null then consult the tree's parent's rawText field)
- source: the source of this Forest
"""
thrift_spec = (
None, # 0
(1, TType.LIST, 'trees', (TType.STRUCT,(Tree, Tree.thrift_spec)), None, ), # 1
(2, TType.STRING, 'rawText', None, None, ), # 2
(3, TType.STRING, 'source', None, None, ), # 3
)
def __init__(self, trees=None, rawText=None, source=None,):
self.trees = trees
self.rawText = rawText
self.source = source
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.LIST:
self.trees = []
(_etype42, _size39) = iprot.readListBegin()
for _i43 in xrange(_size39):
_elem44 = Tree()
_elem44.read(iprot)
self.trees.append(_elem44)
iprot.readListEnd()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.rawText = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.STRING:
self.source = iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('Forest')
if self.trees is not None:
oprot.writeFieldBegin('trees', TType.LIST, 1)
oprot.writeListBegin(TType.STRUCT, len(self.trees))
for iter45 in self.trees:
iter45.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
if self.rawText is not None:
oprot.writeFieldBegin('rawText', TType.STRING, 2)
oprot.writeString(self.rawText)
oprot.writeFieldEnd()
if self.source is not None:
oprot.writeFieldBegin('source', TType.STRING, 3)
oprot.writeString(self.source)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.trees is None:
raise TProtocol.TProtocolException(message='Required field trees is unset!')
return
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class Relation:
"""
Relations are between two spans.
<code>start</code> - the index of the span that starts this relation.<br/>
<code>ending</code> - the index of the span that ends this relation.<br/>
<code>label</code> - the label for this relation.<br/>
<code>source</code> - where this relation came from.<br/>
<code>score</code> - the score for this relation.<br/>
Attributes:
- start
- ending
- label
- source
- score
"""
thrift_spec = (
None, # 0
(1, TType.I32, 'start', None, None, ), # 1
(2, TType.I32, 'ending', None, None, ), # 2
(3, TType.STRING, 'label', None, None, ), # 3
(4, TType.STRING, 'source', None, None, ), # 4
(5, TType.DOUBLE, 'score', None, None, ), # 5
)
def __init__(self, start=None, ending=None, label=None, source=None, score=None,):
self.start = start
self.ending = ending
self.label = label
self.source = source
self.score = score
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.I32:
self.start = iprot.readI32();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.I32:
self.ending = iprot.readI32();
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.STRING:
self.label = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 4:
if ftype == TType.STRING:
self.source = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 5:
if ftype == TType.DOUBLE:
self.score = iprot.readDouble();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('Relation')
if self.start is not None:
oprot.writeFieldBegin('start', TType.I32, 1)
oprot.writeI32(self.start)
oprot.writeFieldEnd()
if self.ending is not None:
oprot.writeFieldBegin('ending', TType.I32, 2)
oprot.writeI32(self.ending)
oprot.writeFieldEnd()
if self.label is not None:
oprot.writeFieldBegin('label', TType.STRING, 3)
oprot.writeString(self.label)
oprot.writeFieldEnd()
if self.source is not None:
oprot.writeFieldBegin('source', TType.STRING, 4)
oprot.writeString(self.source)
oprot.writeFieldEnd()
if self.score is not None:
oprot.writeFieldBegin('score', TType.DOUBLE, 5)
oprot.writeDouble(self.score)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.start is None:
raise TProtocol.TProtocolException(message='Required field start is unset!')
if self.ending is None:
raise TProtocol.TProtocolException(message='Required field ending is unset!')
return
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class View:
"""
A View is the most general data structure. Spans and their relations.
<code>spans</code> - the spans of for this view.<br/>
<code>relations</code> - the relations of this view.<br/>
<code>source</code> - the source annotator this view came from.<br/>
<code>score</code> - the score for this view.<br/>
<code>rawText</code> - the raw text for this view (if null then consult the labeling's parent's rawText field, i.e., the Record's)
Attributes:
- spans
- relations
- rawText
- source
- score
"""
thrift_spec = (
None, # 0
(1, TType.LIST, 'spans', (TType.STRUCT,(Span, Span.thrift_spec)), None, ), # 1
(2, TType.LIST, 'relations', (TType.STRUCT,(Relation, Relation.thrift_spec)), None, ), # 2
(3, TType.STRING, 'rawText', None, None, ), # 3
(4, TType.STRING, 'source', None, None, ), # 4
(5, TType.DOUBLE, 'score', None, None, ), # 5
)
def __init__(self, spans=None, relations=None, rawText=None, source=None, score=None,):
self.spans = spans
self.relations = relations
self.rawText = rawText
self.source = source
self.score = score
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.LIST:
self.spans = []
(_etype49, _size46) = iprot.readListBegin()
for _i50 in xrange(_size46):
_elem51 = Span()
_elem51.read(iprot)
self.spans.append(_elem51)
iprot.readListEnd()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.LIST:
self.relations = []
(_etype55, _size52) = iprot.readListBegin()
for _i56 in xrange(_size52):
_elem57 = Relation()
_elem57.read(iprot)
self.relations.append(_elem57)
iprot.readListEnd()
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.STRING:
self.rawText = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 4:
if ftype == TType.STRING:
self.source = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 5:
if ftype == TType.DOUBLE:
self.score = iprot.readDouble();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('View')
if self.spans is not None:
oprot.writeFieldBegin('spans', TType.LIST, 1)
oprot.writeListBegin(TType.STRUCT, len(self.spans))
for iter58 in self.spans:
iter58.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
if self.relations is not None:
oprot.writeFieldBegin('relations', TType.LIST, 2)
oprot.writeListBegin(TType.STRUCT, len(self.relations))
for iter59 in self.relations:
iter59.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
if self.rawText is not None:
oprot.writeFieldBegin('rawText', TType.STRING, 3)
oprot.writeString(self.rawText)
oprot.writeFieldEnd()
if self.source is not None:
oprot.writeFieldBegin('source', TType.STRING, 4)
oprot.writeString(self.source)
oprot.writeFieldEnd()
if self.score is not None:
oprot.writeFieldBegin('score', TType.DOUBLE, 5)
oprot.writeDouble(self.score)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.spans is None:
raise TProtocol.TProtocolException(message='Required field spans is unset!')
if self.relations is None:
raise TProtocol.TProtocolException(message='Required field relations is unset!')
return
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class ServiceUnavailableException(TException):
"""
Attributes:
- reason
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'reason', None, None, ), # 1
)
def __init__(self, reason=None,):
self.reason = reason
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.STRING:
self.reason = iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('ServiceUnavailableException')
if self.reason is not None:
oprot.writeFieldBegin('reason', TType.STRING, 1)
oprot.writeString(self.reason)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __str__(self):
return repr(self)
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class ServiceSecurityException(TException):
"""
Attributes:
- reason
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'reason', None, None, ), # 1
)
def __init__(self, reason=None,):
self.reason = reason
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.STRING:
self.reason = iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('ServiceSecurityException')
if self.reason is not None:
oprot.writeFieldBegin('reason', TType.STRING, 1)
oprot.writeString(self.reason)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __str__(self):
return repr(self)
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class AnnotationFailedException(TException):
"""
Attributes:
- reason
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'reason', None, None, ), # 1
)
def __init__(self, reason=None,):
self.reason = reason
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.STRING:
self.reason = iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('AnnotationFailedException')
if self.reason is not None:
oprot.writeFieldBegin('reason', TType.STRING, 1)
oprot.writeString(self.reason)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __str__(self):
return repr(self)
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
| {
"content_hash": "4042d339a8b549a2babcdec7f0fc89de",
"timestamp": "",
"source": "github",
"line_count": 1193,
"max_line_length": 228,
"avg_line_length": 33.773679798826485,
"alnum_prop": 0.6224312518614117,
"repo_name": "rigatoni/linguine-python",
"id": "99cb9bdbac8ca106dcb5df35d706ff27e50b1d0d",
"size": "40433",
"binary": false,
"copies": "2",
"ref": "refs/heads/dev",
"path": "cogcomp/base/ttypes.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "14230"
}
],
"symlink_target": ""
} |
"""Fichier contenant le poste officier."""
from . import Poste
class Officier(Poste):
"""Classe définissant le poste officier."""
nom = "officier"
autorite = 50
points = 6
nom_parent = "maître d'équipage"
| {
"content_hash": "16a22fff3fbb9e0a20391521b3b4a71b",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 47,
"avg_line_length": 19.083333333333332,
"alnum_prop": 0.6462882096069869,
"repo_name": "vlegoff/tsunami",
"id": "1c6da93f9e47e8ec99daadd4f1c292a22087e01c",
"size": "1799",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/secondaires/navigation/equipage/postes/officier.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "7930908"
},
{
"name": "Ruby",
"bytes": "373"
}
],
"symlink_target": ""
} |
class Questions < ActiveRecord::Migration
def change
create_table :questions do |t|
t.string :title
t.string :body
t.integer :user_id
t.timestamps
end
end
end
| {
"content_hash": "c83f68c68161e52af95979e8f4841708",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 41,
"avg_line_length": 19.5,
"alnum_prop": 0.6358974358974359,
"repo_name": "nyc-coyotes-2016/4M",
"id": "62230afb503d54523332864189de9be904707b52",
"size": "195",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "db/migrate/20161103112149_questions.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3431"
},
{
"name": "HTML",
"bytes": "8721"
},
{
"name": "JavaScript",
"bytes": "1199"
},
{
"name": "Ruby",
"bytes": "16261"
}
],
"symlink_target": ""
} |
package gcc
import (
"github.com/godfried/impendulo/config"
"github.com/godfried/impendulo/tool"
"labix.org/v2/mgo/bson"
)
type (
Tool struct {
cmd string
path string
}
)
const (
NAME = "Clang"
)
func New() (ret *Tool, err error) {
cmd, err := config.CLANG.Path()
if err != nil {
return
}
ret = &Tool{
cmd: cmd,
}
return
}
//Lang
func (this *Tool) Lang() tool.Language {
return tool.C
}
//Name
func (this *Tool) Name() string {
return NAME
}
func (t *Tool) Run(fileId bson.ObjectId, ti *tool.TargetInfo) (tool.ToolResult, error) {
a := []string{t.cmd, "-Wall", "-Wextra", "-Wno-variadic-macros", "-pedantic", "-O0", "-o", ti.Name, ti.FilePath()}
r, e := tool.RunCommand(a, nil)
if e != nil {
if !tool.IsEndError(e) {
return nil, e
}
//Unsuccessfull compile.
nr, e2 = NewResult(fileId, execRes.StdErr)
if e2 != nil {
return nil, e
}
return nr, tool.NewCompileError(ti.FullName(), string(r.StdErr))
} else if r.HasStdErr() {
//Compiler warnings.
return NewResult(fileId, r.StdErr)
}
return NewResult(fileId, tool.COMPILE_SUCCESS)
}
| {
"content_hash": "ed845ad9ead252eb747167c54d5c279a",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 115,
"avg_line_length": 18.47457627118644,
"alnum_prop": 0.6403669724770642,
"repo_name": "godfried/impendulo",
"id": "7e263ba8f9c55a53f91b4db97826e12f13a04346",
"size": "1090",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tool/clang/tool.go",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "133729"
},
{
"name": "Go",
"bytes": "549130"
},
{
"name": "Java",
"bytes": "21892"
},
{
"name": "JavaScript",
"bytes": "173019"
},
{
"name": "Shell",
"bytes": "3012"
}
],
"symlink_target": ""
} |
"""Utilities for creating and managing moving averages."""
import chex
import jax
import jax.numpy as jnp
@chex.dataclass(frozen=True)
class EmaMoments:
"""data-class holding the latest mean and variance estimates."""
# The tree of means.
mean: chex.ArrayTree
# The tree of variances.
variance: chex.ArrayTree
@chex.dataclass(frozen=True)
class EmaState:
"""data-class holding the exponential moving average state."""
# The tree of exponential moving averages of the values
mu: chex.ArrayTree
# The tree of exponential moving averages of the squared values
nu: chex.ArrayTree
# The product of the all decays from the start of accumulating.
decay_product: float
def debiased_moments(self):
"""Returns debiased moments as in Adam."""
tiny = jnp.finfo(self.decay_product).tiny
debias = 1.0 / jnp.maximum(1 - self.decay_product, tiny)
mean = jax.tree_map(lambda m1: m1 * debias, self.mu)
# This computation of the variance may lose some numerical precision, if
# the mean is not approximately zero.
variance = jax.tree_map(
lambda m2, m: jnp.maximum(0.0, m2 * debias - jnp.square(m)),
self.nu, mean)
return EmaMoments(mean=mean, variance=variance)
def create_ema(decay=0.999, pmean_axis_name=None):
"""An updater of moments.
Given a `tree` it will track first and second moments of the leaves.
Args:
decay: The decay of the moments. I.e., the learning rate is `1 - decay`.
pmean_axis_name: If not None, use lax.pmean to average the moment updates.
Returns:
Two functions: `(init_state, update_moments)`.
"""
def init_state(template_tree):
zeros = jax.tree_map(lambda x: jnp.zeros_like(jnp.mean(x)), template_tree)
scalar_zero = jnp.ones([], dtype=jnp.float32)
return EmaState(mu=zeros, nu=zeros, decay_product=scalar_zero)
def _update(moment, value):
mean = jnp.mean(value)
# Compute the mean across all learner devices involved in the `pmap`.
if pmean_axis_name is not None:
mean = jax.lax.pmean(mean, axis_name=pmean_axis_name)
return decay * moment + (1 - decay) * mean
def update_moments(tree, state):
squared_tree = jax.tree_map(jnp.square, tree)
mu = jax.tree_map(_update, state.mu, tree)
nu = jax.tree_map(_update, state.nu, squared_tree)
state = EmaState(
mu=mu, nu=nu, decay_product=state.decay_product * decay)
return state.debiased_moments(), state
return init_state, update_moments
| {
"content_hash": "c8063046b9cf8a4e9a32e4c48b3f9a22",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 78,
"avg_line_length": 33.84931506849315,
"alnum_prop": 0.6932416025900445,
"repo_name": "deepmind/rlax",
"id": "bf1d02a4470b4e1038a6e167c949ab23c4d069f4",
"size": "3167",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "rlax/_src/moving_averages.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "382255"
},
{
"name": "Shell",
"bytes": "2413"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
Medical mycology. Fungous diseases of men and other mammals 155 (1935)
#### Original name
Posadasia pyriformis M. Moore
### Remarks
null | {
"content_hash": "b2115f2ac7a946de837a217785e02aa1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 70,
"avg_line_length": 15.384615384615385,
"alnum_prop": 0.74,
"repo_name": "mdoering/backbone",
"id": "fba4668e3e36dba10cb436be2607cf1e6cd92a04",
"size": "267",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Eurotiomycetes/Onygenales/Ajellomycetaceae/Histoplasma/Histoplasma pyriforme/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
function WELOCALLY_GoogleDocsLoad (cfg) {
this.cfg;
this.jqxhr;
this.observers;
this.init = function() {
var error = [];
if (!cfg) {
error.push("Please provide configuration for the widget");
cfg = {};
}
if (!cfg.key) {
error.push("A key is required to open a spreadsheet.");
}
if (!cfg.row) {
error.push("Please specify the row for the place.");
}
this.cfg = cfg;
return this;
};
}
WELOCALLY_GoogleDocsLoad.prototype.load = function() {
//requires event data has the search instance
var _instance = this;
var surl = 'https://spreadsheets.google.com/feeds/cells/'+_instance.cfg.key
+'/default/public/basic?alt=json-in-script&callback=?';
//notify all observers
jQuery.each(_instance.cfg.observers, function(i,observer) {
WELOCALLY.ui.setStatus(observer.getStatusArea(), 'Finding places','wl_update',true);
});
jQuery.ajax({
url: surl,
dataType: "jsonp",
success: function(data) {
//set to result bounds if enough results
if(data != null && data.errors != null) {
//notify all observers
jQuery.each(_instance.cfg.observers, function(i,observer) {
WELOCALLY.ui.setStatus(observer.getStatusArea(),'ERROR:'+WELOCALLY.util.getErrorString(data.errors), 'wl_error', false);
});
} else if(data != null && data.feed.entry.length>0){
var places = [];
var row = 0;
var currentPlace = null;
jQuery.each(data.feed.entry, function(i,entry) {
var rownum = eval(entry.title.$t.substring(1, entry.title.$t.length));
if(rownum==_instance.cfg.row){
if((/A/).test(entry.title.$t)){
if(currentPlace != null)
places.push(currentPlace);
currentPlace = {};
currentPlace.properties = {};
currentPlace.properties.classifiers = [];
currentPlace.properties.classifiers[0] = {};
currentPlace.geometry = {};
currentPlace.geometry.type = 'Point';
currentPlace.geometry.coordinates = [];
currentPlace.properties.name = entry.content.$t;
} else if((/B/).test(entry.title.$t)){
currentPlace.properties.address = entry.content.$t;
} else if((/C/).test(entry.title.$t)){
currentPlace.properties.city = entry.content.$t;
} else if((/D/).test(entry.title.$t)){
currentPlace.properties.province = entry.content.$t;
} else if((/E/).test(entry.title.$t)){
currentPlace.properties.postcode = entry.content.$t;
} else if((/F/).test(entry.title.$t)){
currentPlace.properties.country = entry.content.$t;
} else if((/G/).test(entry.title.$t)){
currentPlace.properties.website = entry.content.$t;
} else if((/H/).test(entry.title.$t)){
currentPlace.properties.phone = entry.content.$t;
} else if((/I/).test(entry.title.$t)){
currentPlace.properties.classifiers[0].type = entry.content.$t;
} else if((/J/).test(entry.title.$t)){
currentPlace.properties.classifiers[0].category = entry.content.$t;
} else if((/K/).test(entry.title.$t)){
currentPlace.properties.classifiers[0].subcategory = entry.content.$t;
} else if((/L/).test(entry.title.$t)){
currentPlace.geometry.coordinates[1] = entry.content.$t;
} else if((/M/).test(entry.title.$t)){
currentPlace.geometry.coordinates[0] = entry.content.$t;
}
}
});
//notify all observers
jQuery.each(_instance.cfg.observers, function(i,observer) {
WELOCALLY.ui.setStatus(observer.getStatusArea(), '','wl_message',false);
if(currentPlace != null)
observer.load(currentPlace);
});
} else {
jQuery.each(_instance.cfg.observers, function(i,observer) {
WELOCALLY.ui.setStatus(observer.getStatusArea(), 'No results were found matching your search.','wl_warning',false);
});
}
}
});
return false;
};
| {
"content_hash": "65d3dfdacc0eeefce01a42b2ae820312",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 126,
"avg_line_length": 31.40625,
"alnum_prop": 0.6042288557213931,
"repo_name": "claytantor/welocally-places",
"id": "037c38f3197f8f6dc0c89d0bd2b44871fd04c65d",
"size": "4075",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "resources/javascripts/wl_googledocs_load.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "181586"
},
{
"name": "PHP",
"bytes": "147236"
}
],
"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 `EKEYREVOKED` constant in crate `libc`.">
<meta name="keywords" content="rust, rustlang, rust-lang, EKEYREVOKED">
<title>libc::EKEYREVOKED - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<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 constant">
<!--[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='logo' width='100'></a>
<p class='location'><a href='index.html'>libc</a></p><script>window.sidebarCurrent = {name: 'EKEYREVOKED', 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">
<h1 class='fqn'><span class='in-band'>Constant <a href='index.html'>libc</a>::<wbr><a class="constant" href=''>EKEYREVOKED</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'>−</span>]
</a>
</span><a class='srclink' href='../src/libc/unix/notbsd/linux/other/b64/x86_64.rs.html#214' title='goto source code'>[src]</a></span></h1>
<pre class='rust const'>pub const EKEYREVOKED: <a class="type" href="../libc/type.c_int.html" title="type libc::c_int">c_int</a><code> = </code><code>128</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>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</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> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "libc";
</script>
<script src="../jquery.js"></script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html> | {
"content_hash": "087d96f88e60f70c91a0ec4a0b0e32f0",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 199,
"avg_line_length": 38.26548672566372,
"alnum_prop": 0.5131822386679001,
"repo_name": "nitro-devs/nitro-game-engine",
"id": "a371a647c4a0cef5537d9a7bb603da784ebb639e",
"size": "4334",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/libc/constant.EKEYREVOKED.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CMake",
"bytes": "1032"
},
{
"name": "Rust",
"bytes": "59380"
}
],
"symlink_target": ""
} |
package org.oscm.billingservice.business.calculation.revenue;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import org.oscm.billingservice.business.calculation.revenue.model.EventCosts;
import org.oscm.billingservice.business.calculation.revenue.model.PriceModelInput;
import org.oscm.billingservice.business.model.billingresult.BillingResultAssembler;
import org.oscm.billingservice.business.model.billingresult.PriceModelType;
import org.oscm.billingservice.dao.BillingDataRetrievalServiceLocal;
import org.oscm.billingservice.dao.model.EventCount;
import org.oscm.billingservice.dao.model.EventPricingData;
import org.oscm.billingservice.service.model.BillingInput;
import org.oscm.domobjects.BillingResult;
import org.oscm.i18nservice.local.LocalizerServiceLocal;
/**
* @author kulle
*
*/
public class EventCalculator {
private final BillingResultAssembler assembler = new BillingResultAssembler();
private final LocalizerServiceLocal localizer;
private final BillingDataRetrievalServiceLocal bdr;
public EventCalculator(BillingDataRetrievalServiceLocal bdr,
LocalizerServiceLocal localizer) {
this.bdr = bdr;
this.localizer = localizer;
}
public BigDecimal calculateEventCosts(final BillingInput billingInput,
final PriceModelInput priceModelInput, final BillingResult result,
final PriceModelType priceModelType) {
EventCosts eventCosts = computeEventRevenue(billingInput,
priceModelInput);
assembler.addEvents(priceModelType, eventCosts, localizer);
updateGatheredEvents(billingInput, priceModelInput, result);
return eventCosts.getNormalizedTotalCosts();
}
private EventCosts computeEventRevenue(final BillingInput billingInput,
final PriceModelInput priceModelInput) {
final Map<String, EventPricingData> eventPrices = bdr.loadEventPricing(
priceModelInput.getPriceModelKey(),
priceModelInput.getPriceModelPeriodEnd());
long adjStartTime = adjustStartTimeForPerUnitPriceModel(billingInput,
priceModelInput);
long adjEndTime = adjustEndTimeForPerUnitPriceModel(billingInput,
priceModelInput);
final List<EventCount> eventStatistics = bdr.loadEventStatistics(
billingInput.getSubscriptionKey(), adjStartTime, adjEndTime);
CostCalculator calculator = priceModelInput.getCostCalculator();
return calculator.calculateCostsForGatheredEventsInPeriod(eventPrices,
eventStatistics);
}
/**
* Used to compute event costs. The start date of a price model must be
* moved to the billing period start in case of an overlapping unit. The
* start of the unit would result in reading to much event history data.
*/
private long adjustStartTimeForPerUnitPriceModel(
final BillingInput billingInput,
final PriceModelInput priceModelInput) {
long adjustedStartTime = priceModelInput
.getPmStartAdjustedToFreePeriod();
if (priceModelInput.isPerUnitPriceModel()) {
if (priceModelInput.isYoungestPriceModelOfPeriod()
&& !priceModelInput.isResumedPriceModel()) {
if (priceModelInput.getFreePeriodEnd() > billingInput
.getBillingPeriodStart()) {
// free period end is smaller than price model period
// end checked by billPriceModel method
adjustedStartTime = priceModelInput.getFreePeriodEnd();
} else {
adjustedStartTime = billingInput.getBillingPeriodStart();
}
}
}
return adjustedStartTime;
}
/**
* Used to compute event costs. The end date of a price model must be moved
* to the billing period end in case of an overlapping unit. The end of the
* unit will result in reading to less event history data.
*/
private long adjustEndTimeForPerUnitPriceModel(
final BillingInput billingInput,
final PriceModelInput priceModelInput) {
long adjustetEndTime = priceModelInput.getPriceModelPeriodEnd();
if (priceModelInput.getPriceModelHistory().getDataContainer().getType() == org.oscm.internal.types.enumtypes.PriceModelType.PER_UNIT) {
if (priceModelInput.isOldestPriceModelOfPeriod()
&& priceModelInput.getDeactivationTime() == -1) {
adjustetEndTime = billingInput.getBillingPeriodEnd();
}
}
return adjustetEndTime;
}
private void updateGatheredEvents(final BillingInput billingInput,
final PriceModelInput priceModelInput, final BillingResult result) {
if (billingInput.isStoreBillingResult()) {
// for all events considered in the previous step, create a
// reference to the billing result object
bdr.updateEvent(priceModelInput.getPmStartAdjustedToFreePeriod(),
priceModelInput.getPriceModelPeriodEnd(),
billingInput.getSubscriptionKey(), result);
}
}
}
| {
"content_hash": "0191e3d9ed7773551a75c6f6c5dfccd1",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 143,
"avg_line_length": 42.29838709677419,
"alnum_prop": 0.6972354623450906,
"repo_name": "opetrovski/development",
"id": "b54c373ac3c21817a27bdaf0a1f0c88efbf6525f",
"size": "5820",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "oscm-billing/javasrc/org/oscm/billingservice/business/calculation/revenue/EventCalculator.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "5304"
},
{
"name": "Batchfile",
"bytes": "273"
},
{
"name": "CSS",
"bytes": "389539"
},
{
"name": "HTML",
"bytes": "1884410"
},
{
"name": "Java",
"bytes": "41884121"
},
{
"name": "JavaScript",
"bytes": "259479"
},
{
"name": "PHP",
"bytes": "620531"
},
{
"name": "PLSQL",
"bytes": "4929"
},
{
"name": "SQLPL",
"bytes": "25278"
},
{
"name": "Shell",
"bytes": "3250"
}
],
"symlink_target": ""
} |
<?php
return [
// string, required, root directory of all source files
'sourcePath' => __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..',
// array, required, list of language codes that the extracted messages
// should be translated to. For example, ['zh-CN', 'de'].
'languages' => ['es-ES'],
// string, the name of the function for translating messages.
// Defaults to 'Yii::t'. This is used as a mark to find the messages to be
// translated. You may use a string for single function name or an array for
// multiple function names.
'translator' => 'Yii::t',
// boolean, whether to sort messages by keys when merging new messages
// with the existing ones. Defaults to false, which means the new (untranslated)
// messages will be separated from the old (translated) ones.
//'sort' => false,
// boolean, whether to remove messages that no longer appear in the source code.
// Defaults to false, which means each of these messages will be enclosed with a pair of '@@' marks.
'removeUnused' => true,
// array, list of patterns that specify which files (not directories) should be processed.
// If empty or not set, all files will be processed.
// Please refer to "except" for details about the patterns.
'only' => ['*.php'],
// array, list of patterns that specify which files/directories should NOT be processed.
// If empty or not set, all files/directories will be processed.
// A path matches a pattern if it contains the pattern string at its end. For example,
// '/a/b' will match all files and directories ending with '/a/b';
// the '*.svn' will match all files and directories whose name ends with '.svn'.
// and the '.svn' will match all files and directories named exactly '.svn'.
// Note, the '/' characters in a pattern matches both '/' and '\'.
// See helpers/FileHelper::findFiles() description for more details on pattern matching rules.
// If a file/directory matches both a pattern in "only" and "except", it will NOT be processed.
'except' => [
'.svn',
'.git',
'.gitignore',
'.gitkeep',
'.hgignore',
'.hgkeep',
'/messages',
'/frontend',
'/vendor',
'/environments',
],
// 'php' output format is for saving messages to php files.
'format' => 'php',
// Root directory containing message translations.
'messagePath' => __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'messages',
// boolean, whether the message file should be overwritten with the merged messages
'overwrite' => true,
// Message categories to ignore
'ignoreCategories' => [
'yii',
],
'translations' => [
'*' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@backend/messages',
'sourceLanguage' => 'en-US',
'fileMap' => [
'general' => 'general.php',
//'app/error' => 'error.php',
],
],
],
// 'db' output format is for saving messages to database.
// 'format' => 'db',
// Connection component to use. Optional.
//'db' => 'db',
// Custom source message table. Optional.
// 'sourceMessageTable' => '{{%source_message}}',
// Custom name for translation message table. Optional.
// 'messageTable' => '{{%translated_message}}',
/*
// 'po' output format is for saving messages to gettext po files.
'format' => 'po',
// Root directory containing message translations.
'messagePath' => __DIR__ . DIRECTORY_SEPARATOR . 'messages',
// Name of the file that will be used for translations.
'catalog' => 'messages',
// boolean, whether the message file should be overwritten with the merged messages
'overwrite' => true,
*/
];
| {
"content_hash": "d454ebe241652eae40a1d54f292816f7",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 104,
"avg_line_length": 43.561797752808985,
"alnum_prop": 0.6172298168687129,
"repo_name": "HeavyDots/heavyCMS",
"id": "b7c2f09c07b27a6d0c6808319052d7dbcc878198",
"size": "3877",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "backend/config/message.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "628"
},
{
"name": "Batchfile",
"bytes": "1541"
},
{
"name": "CSS",
"bytes": "3995"
},
{
"name": "JavaScript",
"bytes": "1871"
},
{
"name": "PHP",
"bytes": "339718"
}
],
"symlink_target": ""
} |
package com.javarush.task.task22.task2207;
import java.util.LinkedList;
import java.util.List;
/*
Обращенные слова
В методе main с консоли считать имя файла, который содержит слова, разделенные пробелами.
Найти в тексте все пары слов, которые являются обращением друг друга. Добавить их в result.
Использовать StringBuilder.
Пример содержимого файла
рот тор торт о
о тот тот тот
Вывод:
рот тор
о о
тот тот
Требования:
1. Метод main должен считывать имя файла с клавиатуры.
2. В методе main должен быть использован StringBuilder
3. Список result должен быть заполнен корректными парами согласно условию задачи.
4. В классе Solution должен содержаться вложенный класс Pair.
*/
public class Solution {
public static List<Pair> result = new LinkedList<>();
public static void main(String[] args) {
}
public static class Pair {
String first;
String second;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Pair pair = (Pair) o;
if (first != null ? !first.equals(pair.first) : pair.first != null) return false;
return second != null ? second.equals(pair.second) : pair.second == null;
}
@Override
public int hashCode() {
int result = first != null ? first.hashCode() : 0;
result = 31 * result + (second != null ? second.hashCode() : 0);
return result;
}
@Override
public String toString() {
return first == null && second == null ? "" :
first == null && second != null ? second :
second == null && first != null ? first :
first.compareTo(second) < 0 ? first + " " + second : second + " " + first;
}
}
}
| {
"content_hash": "40d8c1439dbb591241ef40486eb37bbc",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 94,
"avg_line_length": 27.558823529411764,
"alnum_prop": 0.6077908217716115,
"repo_name": "Alik72/JAVA_RUSH",
"id": "24ca33ee895eea9cf4b3aa03ddc306bfbb2373bd",
"size": "2286",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "JavaRushTasks/JavaRushTasks/3.JavaMultithreading/src/com/javarush/task/task22/task2207/Solution.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "489983"
}
],
"symlink_target": ""
} |
<div class='header ui-widget-header'><?php eT("Add user group"); ?></div>
<br />
<?php echo CHtml::form(array("admin/usergroups/sa/add"), 'post', array('class'=>'form30', 'id'=>'usergroupform')); ?>
<ul>
<li>
<label for='group_name'><?php eT("Name:"); ?></label>
<input type='text' size='50' maxlength='20' id='group_name' name='group_name' required="required" autofocus="autofocus" />
<font color='red' face='verdana' size='1'> <?php eT("Required"); ?></font>
</li>
<li>
<label for='group_description'><?php eT("Description:"); ?></label>
<textarea cols='50' rows='4' id='group_description' name='group_description'></textarea>
</li>
</ul>
<p>
<input type='submit' value='<?php eT("Add group"); ?>' />
<input type='hidden' name='action' value='usergroupindb' />
</p>
</form> | {
"content_hash": "4a5c0bde43ef9ece21a8e99b9c332905",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 134,
"avg_line_length": 47.31578947368421,
"alnum_prop": 0.5494994438264739,
"repo_name": "rccoder/HIT-Survey",
"id": "470eda5e6f1a434a421ebdf29c16644f97e78c72",
"size": "899",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "application/views/admin/usergroup/addUserGroup_view.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "354"
},
{
"name": "Batchfile",
"bytes": "2101"
},
{
"name": "CSS",
"bytes": "2641300"
},
{
"name": "HTML",
"bytes": "1352965"
},
{
"name": "JavaScript",
"bytes": "7856120"
},
{
"name": "PHP",
"bytes": "24055312"
}
],
"symlink_target": ""
} |
% initialize the PASCAL development kit
tmp = pwd;
cd(VOCdevkit);
addpath('.\VOCcode');
cd('VOCcode');
VOCinit;
cd(tmp);
| {
"content_hash": "6be0c03079e69d4ea0250217dc54a878",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 40,
"avg_line_length": 17.428571428571427,
"alnum_prop": 0.6967213114754098,
"repo_name": "luckykelfor/DPM4.01_windows",
"id": "3d80b3716c34e1f24daebc7b5d8d66b516a7c2a2",
"size": "123",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pascal_init.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "64583"
},
{
"name": "M",
"bytes": "3262"
},
{
"name": "Makefile",
"bytes": "117"
},
{
"name": "Matlab",
"bytes": "150985"
},
{
"name": "Objective-C",
"bytes": "358"
}
],
"symlink_target": ""
} |
package net.unit8.solr.jdbc.impl;
import net.unit8.solr.jdbc.message.DbException;
import net.unit8.solr.jdbc.message.ErrorCode;
import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.response.UpdateResponse;
import java.io.IOException;
import java.sql.*;
import java.util.Map;
import java.util.Properties;
/**
* implements Connection
*
* @author kawasima
*/
public abstract class SolrConnection implements Connection {
private SolrServer solrServer;
private DatabaseMetaDataImpl metaData;
private final Boolean isClosed = false;
private int holdability = ResultSet.HOLD_CURSORS_OVER_COMMIT;
private boolean autoCommit = false;
private String catalog;
protected Statement executingStatement;
private boolean updatedInTx = false;
private boolean softCommit = true;
protected SolrConnection(String serverUrl) {
}
protected void setSolrServer(SolrServer solrServer) {
this.solrServer = solrServer;
}
public SolrServer getSolrServer() {
return solrServer;
}
public void refreshMetaData() {
metaData = null;
}
@Override
public void clearWarnings() throws SQLException {
checkClosed();
}
@Override
public void commit() throws SQLException {
try {
if(updatedInTx) {
UpdateResponse response = solrServer.commit(true, true, softCommit);
if (response.getStatus() != 0)
throw DbException.get(ErrorCode.GENERAL_ERROR, "");
}
} catch (SolrServerException e) {
throw new SQLException(e);
} catch (IOException e) {
throw DbException.get(ErrorCode.IO_EXCEPTION, e);
} finally {
updatedInTx = false;
softCommit = true;
}
}
@Override
public Array createArrayOf(String arg0, Object[] arg1) throws SQLException {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED, "createArrayOf");
}
@Override
public Blob createBlob() throws SQLException {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED, "createBlob");
}
@Override
public Clob createClob() throws SQLException {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED, "createClob");
}
@Override
public NClob createNClob() throws SQLException {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED, "createNClob");
}
@Override
public SQLXML createSQLXML() throws SQLException {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED, "createSQLXML");
}
@Override
public Struct createStruct(String arg0, Object[] arg1) throws SQLException {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED, "createStruct");
}
@Override
public Statement createStatement() throws SQLException {
checkClosed();
return new StatementImpl(this, ResultSet.FETCH_FORWARD,
ResultSet.CONCUR_READ_ONLY);
}
@Override
public Statement createStatement(int resultSetType, int resultSetConcurrency)
throws SQLException {
checkClosed();
return new StatementImpl(this, resultSetType, resultSetConcurrency);
}
@Override
public Statement createStatement(int resultSetType,
int resultSetConcurrency, int resultSetHoldability)
throws SQLException {
checkClosed();
return new StatementImpl(this, resultSetType, resultSetConcurrency);
}
@Override
public boolean getAutoCommit() throws SQLException {
checkClosed();
return autoCommit;
}
@Override
public void setAutoCommit(boolean autoCommit) throws SQLException {
checkClosed();
this.autoCommit = autoCommit;
}
@Override
public String getCatalog() throws SQLException {
checkClosed();
return catalog;
}
@Override
public void setCatalog(String catalog) throws SQLException {
checkClosed();
// ignore
}
@Override
public Properties getClientInfo() throws SQLException {
throw new SQLClientInfoException();
}
@Override
public String getClientInfo(String name) throws SQLException {
throw new SQLClientInfoException();
}
@Override
public void setClientInfo(Properties properties)
throws SQLClientInfoException {
throw new SQLClientInfoException();
}
@Override
public void setClientInfo(String arg0, String arg1)
throws SQLClientInfoException {
throw new SQLClientInfoException();
}
@Override
public int getHoldability() throws SQLException {
checkClosed();
return holdability;
}
@Override
public void setHoldability(int holdability) throws SQLException {
checkClosed();
this.holdability = holdability;
}
@Override
public DatabaseMetaData getMetaData() throws SQLException {
if (metaData == null) {
metaData = new DatabaseMetaDataImpl(this);
}
return metaData;
}
public DatabaseMetaDataImpl getMetaDataImpl() {
if (metaData == null) {
metaData = new DatabaseMetaDataImpl(this);
}
return metaData;
}
@Override
public int getTransactionIsolation() throws SQLException {
return Connection.TRANSACTION_READ_COMMITTED;
}
@Override
public void setTransactionIsolation(int arg0) throws SQLException {
throw DbException
.get(ErrorCode.FEATURE_NOT_SUPPORTED, "setTransaction")
.getSQLException();
}
@Override
public boolean isReadOnly() throws SQLException {
checkClosed();
return false;
}
/**
* According to the JDBC specs, this setting is only a hint to the database
* to enable optimizations - it does not cause writes to be prohibited.
*
* @throws SQLException
* if the connection is closed
*/
@Override
public void setReadOnly(boolean readOnly) throws SQLException {
checkClosed();
}
@Override
public Savepoint setSavepoint() throws SQLException {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED, "setSavepoint")
.getSQLException();
}
@Override
public Savepoint setSavepoint(String arg0) throws SQLException {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED, "setSavepoint")
.getSQLException();
}
@Override
public Map<String, Class<?>> getTypeMap() throws SQLException {
checkClosed();
return null;
}
@Override
public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
// do nothing
}
@Override
public SQLWarning getWarnings() throws SQLException {
checkClosed();
return null;
}
@Override
public boolean isClosed() throws SQLException {
return isClosed;
}
@Override
public boolean isValid(int timeout) throws SQLException {
return isClosed();
}
@Override
public String nativeSQL(String sql) throws SQLException {
return sql;
}
@Override
public CallableStatement prepareCall(String sql) throws SQLException {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED, "prepareCall")
.getSQLException();
}
@Override
public CallableStatement prepareCall(String sql, int resultSetType,
int resultSetConcurrency) throws SQLException {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED, "prepareCall")
.getSQLException();
}
@Override
public CallableStatement prepareCall(String sql, int resultSetType,
int resultSetConcurrency, int resultSetHoldability)
throws SQLException {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED, "prepareCall")
.getSQLException();
}
@Override
public PreparedStatement prepareStatement(String sql) throws SQLException {
checkClosed();
PreparedStatementImpl stmt;
try {
stmt = new PreparedStatementImpl(this, sql,
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
} catch (DbException e) {
throw e.getSQLException();
}
return stmt;
}
@Override
public PreparedStatement prepareStatement(String sql, int autoGeneratedKey)
throws SQLException {
return prepareStatement(sql);
}
@Override
public PreparedStatement prepareStatement(String sql, int[] columnIndexes)
throws SQLException {
return prepareStatement(sql);
}
@Override
public PreparedStatement prepareStatement(String sql, String[] columnNames)
throws SQLException {
return prepareStatement(sql);
}
@Override
public PreparedStatement prepareStatement(String sql, int resultSetType,
int resultSetConcurrency) throws SQLException {
checkClosed();
PreparedStatementImpl stmt;
try {
stmt = new PreparedStatementImpl(this, sql, resultSetType,
resultSetConcurrency);
} catch (DbException e) {
throw e.getSQLException();
}
return stmt;
}
@Override
public PreparedStatement prepareStatement(String sql, int resultSetType,
int resultSetConcurrency, int resultSetHoldability)
throws SQLException {
checkClosed();
PreparedStatementImpl stmt;
try {
stmt = new PreparedStatementImpl(this, sql, resultSetType,
resultSetConcurrency);
} catch (DbException e) {
throw e.getSQLException();
}
return stmt;
}
@Override
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED,
"releaseSavepoint").getSQLException();
}
@Override
public void rollback() throws SQLException {
try {
if(updatedInTx)
solrServer.rollback();
} catch (Exception e) {
throw new SQLException(e);
} finally {
updatedInTx = false;
}
}
@Override
public void rollback(Savepoint savePoint) throws SQLException {
this.rollback();
}
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED, "isWrapperFor");
}
@Override
public <T> T unwrap(Class<T> arg0) throws SQLException {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED, "unwrap")
.getSQLException();
}
public boolean isUpdatedInTx() {
return updatedInTx;
}
public void setUpdatedInTx(boolean updateInTx) {
this.updatedInTx = updateInTx;
}
public void setSoftCommit(boolean softCommit) {
this.softCommit = softCommit;
}
public abstract void setQueryTimeout(int second);
public abstract int getQueryTimeout();
protected void checkClosed() throws SQLException {
if (isClosed) {
throw DbException.get(ErrorCode.OBJECT_CLOSED, "Connection");
}
}
protected void setExecutingStatement(Statement statement) {
this.executingStatement = statement;
}
}
| {
"content_hash": "8aeebd71498f6d6f1421771c57d7ced8",
"timestamp": "",
"source": "github",
"line_count": 411,
"max_line_length": 78,
"avg_line_length": 24.46228710462287,
"alnum_prop": 0.7445792719315695,
"repo_name": "kawasima/solr-jdbc",
"id": "efddf142b2c1d14b532a38ac041a64ccd418bf7c",
"size": "10054",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/net/unit8/solr/jdbc/impl/SolrConnection.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "227772"
}
],
"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 (1.8.0_101) on Mon Aug 01 12:52:00 EET 2016 -->
<title>Uses of Package org.brickmvc.core.services</title>
<meta name="date" content="2016-08-01">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Package org.brickmvc.core.services";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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</li>
<li class="navBarCell1Rev">Use</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/brickmvc/core/services/package-use.html" target="_top">Frames</a></li>
<li><a href="package-use.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Uses of Package org.brickmvc.core.services" class="title">Uses of Package<br>org.brickmvc.core.services</h1>
</div>
<div class="contentContainer">No usage of org.brickmvc.core.services</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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</li>
<li class="navBarCell1Rev">Use</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/brickmvc/core/services/package-use.html" target="_top">Frames</a></li>
<li><a href="package-use.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {
"content_hash": "df70cf563944f7dee2202b54c2e182a2",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 119,
"avg_line_length": 32.564516129032256,
"alnum_prop": 0.6104507181773156,
"repo_name": "MostafaMatar/BrickMVC",
"id": "e425daeffc7cb4a79587891bb8649fbaae336435",
"size": "4038",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Docs/org/brickmvc/core/services/package-use.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "18015"
}
],
"symlink_target": ""
} |
<!--
Copyright (c) 2015 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
-->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>Codelabs</title>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Code+Pro:400|Roboto:400,300,400italic,500,700|Roboto+Mono">
<link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="google_codelab_index_scss_bin.css">
<style>
body {
transition: opacity ease-in 0.2s;
}
body[unresolved] {
opacity: 0;
display: block;
overflow: hidden;
position: relative;
margin: 0;
}
</style>
</head>
<body unresolved>
<google-codelab-index>
<header id="toolbar">
<div class="site-width">
<div class="logo">
<a href="https://codelabs.developers.google.com/" title="Google Developers"></a>
<img src="https://codelabs.developers.google.com/images/developers-logo.svg" class="logo-icon">
<img src="https://codelabs.developers.google.com/images/lockup_developers_light_color.svg" class="logo-devs">
</a>
</div>
<div id="searchbar">
<i id="search-icon" class="material-icons">search</i>
<input placeholder="Search" id="search-field" type="text">
<a href="#" id="clear-icon" hide class="material-icons">close</a>
</div>
</div>
</header>
<header id="banner">
<div class="site-width">
<h2>Welcome to Codelabs!</h2>
<p>Google Developers Codelabs provide a guided, tutorial, hands-on coding experience. Most codelabs will step you through
the process of building a small application, or adding a new feature to an existing application. They cover a wide
range of topics such as Android Wear, Google Compute Engine, ARCore, and Google APIs on iOS.</p>
</div>
</header>
<main>
<div class="main-inner site-width">
<ul>
<li>
<a href="/accelerated-mobile-pages-advanced/index.html?index=..%2F..%2Findex"
id="accelerated-mobile-pages-advanced"
category="Web"
title="Accelerated Mobile Pages Advanced Concepts"
authors="lukem"
duration="60"
steps="11"
updated="2016-06-16T18:24:24Z"
tags="io2016,kiosk,pwa-dev-summit,web">
Accelerated Mobile Pages Advanced Concepts
</a>
</li>
<li>
<a href="/accelerated-mobile-pages-foundations/index.html?index=..%2F..%2Findex" category="Web" title="Accelerated Mobile Pages Foundations"
duration="39" updated="2017-05-30T13:20:27Z" tags="io2016,kiosk,pwa-dev-summit,web">
Accelerated Mobile Pages Foundations
</a>
</li>
<li>
<a href="/appauth-android-codelab/index.html?index=..%2F..%2Findex" category="Android" title="Achieving Single Sign-on with AppAuth"
duration="39" updated="2016-05-20T04:42:50Z" tags="android,io2016,kiosk">
Achieving Single Sign-on with AppAuth
</a>
</li>
<li>
<a href="/admob-native-advanced-feed-android/index.html?index=..%2F..%2Findex" category="Ads" title="AdMob Native Advanced Ads in an Android Feed"
duration="60" updated="2018-01-11T22:43:37Z" tags="io2017,kiosk,web">
AdMob Native Advanced Ads in an Android Feed
</a>
</li>
<li>
<a href="/admob-native-advanced-feed-ios/index.html?index=..%2F..%2Findex" category="Ads" title="AdMob Native Advanced Ads in an iOS Feed"
duration="55" updated="2018-02-20T19:15:26Z" tags="io2017,kiosk,web">
AdMob Native Advanced Ads in an iOS Feed
</a>
</li>
<li>
<a href="/admob-rewarded-video-android/index.html?index=..%2F..%2Findex" category="Ads" title="Add Rewarded Video Ads to your Android App"
duration="35" updated="2018-02-13T02:05:50Z" tags="io2017,kiosk,web">
Add Rewarded Video Ads to your Android App
</a>
</li>
<li>
<a href="/admob-rewarded-video-ios/index.html?index=..%2F..%2Findex" category="Ads" title="Add Rewarded Video Ads to your iOS App"
duration="30" updated="2017-05-24T00:57:49Z" tags="io2017,kiosk,web">
Add Rewarded Video Ads to your iOS App
</a>
</li>
<li>
<a href="/voice-interaction/index.html?index=..%2F..%2Findex" category="Search,Android" title="Add Voice Interactions to Your App"
duration="20" updated="2015-11-23" tags="web,kiosk,android-dev-summit">
Add Voice Interactions to Your App
</a>
</li>
<li>
<a href="/add-to-home-screen/index.html?index=..%2F..%2Findex" category="Web,Progressive Web Apps" title="Add Your Web App to a User's Home Screen"
duration="29" updated="2016-06-16T18:22:41Z" tags="io2016,kiosk,pwa-dev-summit,web">
Add Your Web App to a User's Home Screen
</a>
</li>
<li>
<a href="/complications/index.html?index=..%2F..%2Findex" category="Android Wear" title="Adding Complications to your Android Wear Watch Face"
duration="55" updated="2017-05-17T15:59:39Z" tags="io2017,kiosk-wear,ubiquity,web">
Adding Complications to your Android Wear Watch Face
</a>
</li>
<li>
<a href="/androidtv-adding-leanback/index.html?index=..%2F..%2Findex" category="Android TV" title="Adding Leanback
to your Android TV app" duration="240" updated="2016-05-18T15:42:54Z" tags="android-dev-summit,io2016,kiosk,ubiquity,web">
Adding Leanback to your Android TV app
</a>
</li>
<li>
<a href="/push-notifications/index.html?index=..%2F..%2Findex" category="Web" title="Adding Push Notifications to a Web App"
duration="0" updated="2017-10-18T21:54:10Z" tags="cds17,chrome-dev-summit,chrome-dev-summit-2016,io2016,io2017,kiosk,pwa-dev-summit,pwa-roadshow,web"
pin="" wait-for-ripple="">
Adding Push Notifications to a Web App
</a>
</li>
<li>
<a href="/offline/index.html?index=..%2F..%2Findex" category="Web" title="Adding a Service Worker and Offline into your Web App"
duration="23" updated="2016-07-18T20:46:36Z" tags="chrome-dev-summit,io2016,kiosk,pwa-dev-summit,web">
Adding a Service Worker and Offline into your Web App
</a>
</li>
<li>
<a href="/sw-precache/index.html?index=..%2F..%2Findex" category="Web" title="Adding a Service Worker with sw-precache" duration="13"
updated="2016-06-16T18:20:36Z" tags="chrome-dev-summit,io2016,kiosk,pwa-dev-summit,web">
Adding a Service Worker with sw-precache
</a>
</li>
<li>
<a href="/advanced-interactivity-in-amp/index.html?index=..%2F..%2Findex" category="Web" title="Advanced Interactivity in AMP"
duration="30" updated="2017-10-18T21:12:42Z" tags="cds17,io2017,kiosk,web">
Advanced Interactivity in AMP
</a>
</li>
<li>
<a href="/android-agera/index.html?index=..%2F..%2Findex" category="Android" title="Agera: reactive Android apps" duration="73"
updated="2016-08-02T08:46:16Z" tags="web">
Agera: reactive Android apps
</a>
</li>
<li>
<a href="/web-assembly-intro/index.html?index=..%2F..%2Findex" category="Web" title="An Introduction to Web Assembly" duration="60"
updated="2017-10-18T21:13:12Z" tags="cds17,io2017,kiosk,web">
An Introduction to Web Assembly
</a>
</li>
<li>
<a href="/tensorflow-style-transfer-android/index.html?index=..%2F..%2Findex" category="TensorFlow" title="Android & TensorFlow: Artistic Style Transfer"
duration="22" updated="2017-11-28T23:07:25Z" tags="devfest-lon,gdd17,io2017,kiosk,typtwd17,web" pin="" wait-for-ripple="">
Android & TensorFlow: Artistic Style Transfer
</a>
</li>
<li>
<a href="/android-n-quick-settings/index.html?index=..%2F..%2Findex" category="Android" title="Android N: Quick Settings"
duration="13" updated="2016-11-09T14:13:01Z" tags="io2016,kiosk,web">
Android N: Quick Settings
</a>
</li>
<li>
<a href="/android-network-security-config/index.html?index=..%2F..%2Findex" category="Android" title="Android Network Security Configuration Codelab"
duration="40" updated="2018-01-12T02:21:01Z" tags="io2017,kiosk,web">
Android Network Security Configuration Codelab
</a>
</li>
<li>
<a href="/android-paging/index.html?index=..%2F..%2Findex" category="Android" title="Android Paging codelab" duration="40"
updated="2018-04-16T09:32:43Z" tags="io2018,kiosk,web">
Android Paging codelab
</a>
</li>
<li>
<a href="/android-persistence/index.html?index=..%2F..%2Findex" category="Android" title="Android Persistence codelab" duration="0"
updated="2017-11-15T15:46:29Z" tags="gdd17,io2017,kiosk,web">
Android Persistence codelab
</a>
</li>
<li>
<a href="/android-room-with-a-view/index.html?index=..%2F..%2Findex" category="Android" title="Android Room with a View"
duration="58" updated="2018-02-08T19:31:17Z" tags="gdd17,web">
Android Room with a View
</a>
</li>
<li>
<a href="/playservices_atv_unity/index.html?index=..%2F..%2Findex" category="Unity,Virtual Reality,Games" title="Android TV Games in Unity"
duration="52" updated="2015-10-21" tags="web,unity,games">
Android TV Games in Unity
</a>
</li>
<li>
<a href="/android-testing/index.html?index=..%2F..%2Findex" category="Android" title="Android Testing Codelab" duration="120"
updated="2017-05-22T20:16:59Z" tags="android-dev-summit,babbq-2015,io2016,io2017,kiosk,offline,web">
Android Testing Codelab
</a>
</li>
<li>
<a href="/androidthings-assistant/index.html?index=..%2F..%2Findex" category="IoT" title="Android Things Assistant" duration="55"
updated="2018-03-19T20:21:44Z" tags="gdd17,io2017,kiosk-iot,web">
Android Things Assistant
</a>
</li>
<li>
<a href="/androidthings-classifier/index.html?index=..%2F..%2Findex" category="IoT" title="Android Things Image Classifier"
duration="75" updated="2018-03-14T19:24:09Z" tags="gdd17,io2017,kiosk-iot,web">
Android Things Image Classifier
</a>
</li>
<li>
<a href="/androidthings-peripherals/index.html?index=..%2F..%2Findex" category="IoT" title="Android Things Peripheral I/O"
duration="50" updated="2018-03-20T17:54:47Z" tags="gdd17,io2017,kiosk-iot,web">
Android Things Peripheral I/O
</a>
</li>
<li>
<a href="/androidthings-weatherstation/index.html?index=..%2F..%2Findex" category="IoT" title="Android Things Weather Station"
duration="50" updated="2018-03-14T19:24:22Z" tags="gdd17,io2017,kiosk-iot,web">
Android Things Weather Station
</a>
</li>
<li>
<a href="/android-vts/index.html?index=..%2F..%2Findex" category="Android" title="Android VTS v9
.
0 Codelab" duration="0" updated="2018-03-02T05:43:32Z" tags="io2018,kiosk,web">
Android VTS v9 . 0 Codelab
</a>
</li>
<li>
<a href="/always-on/index.html?index=..%2F..%2Findex" category="Android Wear" title="Android Wear Always-on Application"
duration="90" updated="2016-10-14T08:39:06Z" tags="android-dev-summit,kiosk,ubiquity,web">
Android Wear Always-on Application
</a>
</li>
<li>
<a href="/android-lifecycles/index.html?index=..%2F..%2Findex" category="Android" title="Android lifecycle-aware components codelab"
duration="0" updated="2018-02-13T10:14:45Z" tags="gdd17,io2017,kiosk,web">
Android lifecycle-aware components codelab
</a>
</li>
<li>
<a href="/cloud-stackdriver-apm/index.html?index=..%2F..%2Findex" category="Cloud,Monitoring" title="Application Performance Management (APM) with Stackdriver"
duration="0" updated="2018-02-28T13:46:29Z" tags="cloud,kiosk,qwiklabs,sac18,web">
Application Performance Management (APM) with Stackdriver
</a>
</li>
<li>
<a href="/android-style-transfer/index.html?index=..%2F..%2Findex" category="Android" title="Artistic style transfer & other advanced image editing"
duration="0" updated="2017-05-19T16:32:10Z" tags="io2017,kiosk,web">
Artistic style transfer & other advanced image editing
</a>
</li>
<li>
<a href="/android-backup-codelab/index.html?index=..%2F..%2Findex" category="Android" title="Auto Backup for Android codelab"
duration="40" updated="2017-11-29T11:12:55Z" tags="devfest-lon,gdd17,kiosk,web">
Auto Backup for Android codelab
</a>
</li>
<li>
<a href="/autocomplete/index.html?index=..%2F..%2Findex" category="Web" title="Autocomplete To Improve Your Forms" duration="20"
updated="2016-06-16T19:03:19Z" tags="chrome-dev-summit,kiosk,pwa-dev-summit,web">
Autocomplete To Improve Your Forms
</a>
</li>
<li>
<a href="/android-perf-testing/index.html?index=..%2F..%2Findex" category="Android" title="Automated Performance Testing Codelab"
duration="78" updated="2016-05-18T22:13:45Z" tags="android-dev-summit,babbq-2015,io2016,kiosk,web">
Automated Performance Testing Codelab
</a>
</li>
<li>
<a href="/awwvision-cloud-vision-api-from-a-kubernetes-cluster/index.html?index=..%2F..%2Findex" category="Cloud,Machine Learning"
title="Awwvision: Cloud Vision API from a Kubernetes Cluster" duration="0" updated="2018-02-24T09:12:18Z" tags="cloud,kiosk,qwiklabs,sac18,web">
Awwvision: Cloud Vision API from a Kubernetes Cluster
</a>
</li>
<li>
<a href="/background-location-updates-android-o/index.html?index=..%2F..%2Findex" category="Android,Location" title="Background Location Updates in Android "O""
duration="0" updated="2017-08-31T18:22:43Z" tags="gdd17,io2017,kiosk,web">
Background Location Updates in Android "O"
</a>
</li>
<li>
<a href="/barcodes/index.html?index=..%2F..%2Findex" category="Android" title="Barcode Detection with the Mobile Vision API"
duration="22" updated="2016-06-29T08:02:33Z" tags="web">
Barcode Detection with the Mobile Vision API
</a>
</li>
<li>
<a href="/basic-android-accessibility/index.html?index=..%2F..%2Findex" category="Android" title="Basic Android Accessibility
: making sure everyone can use what you create!" duration="38" updated="2016-05-18T21:27:26Z" tags="io2016,kiosk,web">
Basic Android Accessibility : making sure everyone can use what you create!
</a>
</li>
<li>
<a href="/angular-codelab/index.html?index=..%2F..%2Findex" category="Web" title="Basics of Angular" duration="0" updated="2017-05-16T23:15:15Z"
tags="io2017,kiosk,web">
Basics of Angular
</a>
</li>
<li>
<a href="/typescript-codelab/index.html?index=..%2F..%2Findex" category="Web" title="Basics of TypeScript" duration="0" updated="2017-05-16T22:45:47Z"
tags="io2017,kiosk,web">
Basics of TypeScript
</a>
</li>
<li>
<a href="/cloud-bigquery-load-data/index.html?index=..%2F..%2Findex" category="Cloud,Data" title="Batch load Wikimedia CSV data into BigQuery"
duration="16" updated="2017-11-08T05:29:00Z" tags="cloud,gcp-next,gdc2017,hadoop-summit,kiosk,mongodb-world,qwiklabs,sc16,sc17,springone,strata,strata-ny,sxsw,web">
Batch load Wikimedia CSV data into BigQuery
</a>
</li>
<li>
<a href="/amp-beautiful-interactive-canonical/index.html?index=..%2F..%2Findex" category="Web" title="Beautiful, interactive, canonical AMP pages"
duration="0" updated="2018-02-05T19:52:47Z" tags="amp-conf,cds17,devfest-lon,io2017,kiosk,web">
Beautiful, interactive, canonical AMP pages
</a>
</li>
<li>
<a href="/cosu/index.html?index=..%2F..%2Findex" category="Android" title="Build Applications for Single-Use Devices" duration="53"
updated="2016-05-20T05:24:20Z" tags="io2016,kiosk,web">
Build Applications for Single-Use Devices
</a>
</li>
<li>
<a href="/polymer-maps/index.html?index=..%2F..%2Findex" category="Web" title="Build Google Maps Using Web Components & No Code!"
duration="17" updated="2017-08-29T13:38:37Z" tags="chrome-dev-summit,io2016,kiosk,polymer-summit,polytechnic,typtwd17,web">
Build Google Maps Using Web Components & No Code!
</a>
</li>
<li>
<a href="/build-your-first-android-app/index.html?index=..%2F..%2Findex" category="Android" title="Build Your First Android App in Java"
duration="0" updated="2018-02-08T17:15:35Z" tags="gdd17,io2017,kiosk,typtwd17,web">
Build Your First Android App in Java
</a>
</li>
<li>
<a href="/build-your-first-android-app-kotlin/index.html?index=..%2F..%2Findex" category="Android" title="Build Your First Android App in Kotlin"
duration="0" updated="2017-11-07T12:24:40Z" tags="devfest-lon,kiosk,web">
Build Your First Android App in Kotlin
</a>
</li>
<li>
<a href="/appmaker/index.html?index=..%2F..%2Findex" category="Web" title="Build a Database Web App in App Maker" duration="0"
updated="2018-03-28T14:56:34Z" tags="kiosk,next2018,trailheadx18,web">
Build a Database Web App in App Maker
</a>
</li>
<li>
<a href="/material-design-style/index.html?index=..%2F..%2Findex" category="Android" title="Build a Material Design App with the Android Design Support Library"
duration="90" updated="2016-08-17T05:40:17Z" tags="android-dev-summit,babbq-2015,io2016,web">
Build a Material Design App with the Android Design Support Library
</a>
</li>
<li>
<a href="/polymer-drive-client/index.html?index=..%2F..%2Findex" category="Web" title="Build a Mobile-First Google Drive Client"
duration="28" updated="2016-02-18" tags="polymer-summit,web,kiosk,chrome-dev-summit,polytechnic">
Build a Mobile-First Google Drive Client
</a>
</li>
<li>
<a href="/cloud-cardboard-viewer/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Build a Node.js & Angular 2 Web App using Google Cloud Platform"
duration="48" updated="2017-02-23T23:25:17Z" tags="cloud,kiosk,ng-conf,qwiklabs,web">
Build a Node.js & Angular 2 Web App using Google Cloud Platform
</a>
</li>
<li>
<a href="/cloud-nodejs/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Build a Node.js Web App using Google Cloud Platform"
duration="43" updated="2017-01-14T00:13:21Z" tags="cloud,gcp-next,io2016,kiosk,mongodb-world,web">
Build a Node.js Web App using Google Cloud Platform
</a>
</li>
<li>
<a href="/workbox-lab/index.html?index=..%2F..%2Findex" category="Web" title="Build a PWA using Workbox" duration="0" updated="2018-03-28T15:40:43Z"
tags="cds17,devfest-lon,gdd17,kiosk,web">
Build a PWA using Workbox
</a>
</li>
<li>
<a href="/amp-pwa-workbox/index.html?index=..%2F..%2Findex" category="Web" title="Build a Progressive Web AMP" duration="0"
updated="2018-03-22T23:32:22Z" tags="cds17,gdd17,kiosk,web">
Build a Progressive Web AMP
</a>
</li>
<li>
<a href="/polymer-firebase-pwa/index.html?index=..%2F..%2Findex" category="Web,Firebase,Polymer,Progressive Web Apps" title="Build a Progressive Web App with Firebase, Polymerfire and Polymer Components"
duration="55" updated="2016-11-02T09:59:51Z" tags="chrome-dev-summit-2016,io2016,kiosk,polymer-summit-2016,pwa-dev-summit,web">
Build a Progressive Web App with Firebase, Polymerfire and Polymer Components
</a>
</li>
<li>
<a href="/cloud-slack-bot/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Build a Slack Bot with Node.js on Kubernetes"
duration="43" updated="2017-03-17T19:53:56Z" tags="cloud,gcp-next,io2016,kiosk,mongodb-world,qwiklabs,web">
Build a Slack Bot with Node.js on Kubernetes
</a>
</li>
<li>
<a href="/openthread-hardware/index.html?index=..%2F..%2Findex" category="IoT" title="Build a Thread network with nRF52840 boards and OpenThread"
duration="88" updated="2017-11-16T12:29:37Z" tags="web">
Build a Thread network with nRF52840 boards and OpenThread
</a>
</li>
<li>
<a href="/angulardart-firebase-web-app/index.html?index=..%2F..%2Findex" category="Web" title="Build an AngularDart & Firebase Web App"
duration="31" updated="2017-10-18T21:15:57Z" tags="cds17,io2017,kiosk,web">
Build an AngularDart & Firebase Web App
</a>
</li>
<li>
<a href="/build-app-with-arch-components/index.html?index=..%2F..%2Findex" category="Android" title="Build an App with Architecture Components"
duration="110" updated="2017-09-04T09:44:44Z" tags="gdd17,kiosk,web">
Build an App with Architecture Components
</a>
</li>
<li>
<a href="/polymer-es2015/index.html?index=..%2F..%2Findex" category="Web" title="Build an ES2015/ES6 app with the Polymer Starter Kit"
duration="36" updated="2016-03-16" tags="polymer-summit,web,kiosk,chrome-dev-summit,polytechnic">
Build an ES2015/ES6 app with the Polymer Starter Kit
</a>
</li>
<li>
<a href="/polymer-offline-weather/index.html?index=..%2F..%2Findex" category="Web" title="Build an Offline Weather Web App with <platinum-sw>"
duration="18" updated="2016-06-16T18:27:22Z" tags="chrome-dev-summit,kiosk,polymer-summit,polytechnic,pwa-dev-summit,web">
Build an Offline Weather Web App with <platinum-sw>
</a>
</li>
<li>
<a href="/workbox-indexeddb/index.html?index=..%2F..%2Findex" category="Web" title="Build an offline-first, driven PWA" duration="0"
updated="2018-04-04T17:13:34Z" tags="cds17,gdd17,kiosk,web">
Build an offline-first, driven PWA
</a>
</li>
<li>
<a href="/whose-flag/index.html?index=..%2F..%2Findex" category="Web" title="Build and Deploy a Polymer 2.0 App From Scratch"
duration="0" updated="2017-11-07T12:31:11Z" tags="devfest-lon,kiosk,polymer-summit-2017,web">
Build and Deploy a Polymer 2.0 App From Scratch
</a>
</li>
<li>
<a href="/cloud-springboot-cloudshell/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Build and Launch Spring Boot Java-based Web Application from Google Cloud Shell"
duration="14" updated="2018-04-12T21:03:41Z" tags="cloud,devoxx,devoxx-us,kiosk,qwiklabs,spring,springone,web">
Build and Launch Spring Boot Java-based Web Application from Google Cloud Shell
</a>
</li>
<li>
<a href="/cloud-aspnetcore-cloudshell/index.html?index=..%2F..%2Findex" category="Cloud,General" title="Build and launch an ASP.NET Core app from Google Cloud Shell"
duration="9" updated="2018-04-03T14:10:31Z" tags="cloud,devint,kiosk,ndc,propelify17,qwiklabs,vslive,web,windows">
Build and launch an ASP.NET Core app from Google Cloud Shell
</a>
</li>
<li>
<a href="/android-instant-apps/index.html?index=..%2F..%2Findex" category="Android" title="Build your First Android Instant App"
duration="55" updated="2017-11-21T01:56:49Z" tags="gdd17,io2017,kiosk,web">
Build your First Android Instant App
</a>
</li>
<li>
<a href="/chrome-es2015/index.html?index=..%2F..%2Findex" category="Web" title="Build your first ES2015/ES6 application"
duration="47" updated="2016-07-05T14:20:55Z" tags="chrome-dev-summit,kiosk,pwa-dev-summit,web">
Build your first ES2015/ES6 application
</a>
</li>
<li>
<a href="/polymer-first-elements/index.html?index=..%2F..%2Findex" category="Web" title="Build your first Polymer element"
duration="40" updated="2016-05-17T15:23:48Z" tags="chrome-dev-summit,io2016,kiosk,polymer-summit,polytechnic,web">
Build your first Polymer element
</a>
</li>
<li>
<a href="/sign-in/index.html?index=..%2F..%2Findex" category="Android" title="Building Apps that Sign In with Google" duration="0"
updated="2015-05-28" tags="web,kiosk">
Building Apps that Sign In with Google
</a>
</li>
<li>
<a href="/mdc-android/index.html?index=..%2F..%2Findex" category="Android" title="Building Beautiful Apps Faster with Material Components on Android"
duration="16" updated="2018-03-10T22:51:37Z" tags="devfest-lon,gdd17,io2017,kiosk,web">
Building Beautiful Apps Faster with Material Components on Android
</a>
</li>
<li>
<a href="/mdc-android-kotlin/index.html?index=..%2F..%2Findex" category="Android" title="Building Beautiful Apps Faster with Material Components on Android (Kotlin)"
duration="16" updated="2017-08-31T18:31:17Z" tags="gdd17,io2017,kiosk,web">
Building Beautiful Apps Faster with Material Components on Android (Kotlin)
</a>
</li>
<li>
<a href="/mdc-ios/index.html?index=..%2F..%2Findex" class="codelab-card category-apps" category="Apps" title="Building Beautiful Apps Faster with Material Components on iOS"
duration="15" updated="2018-03-10T22:51:21Z" tags="io2017,kiosk,web">
Building Beautiful Apps Faster with Material Components on iOS
</a>
</li>
<li>
<a href="/mdc-ios-swift/index.html?index=..%2F..%2Findex" class="codelab-card category-apps" category="Apps" title="Building Beautiful Apps Faster with Material Components on iOS in Swift"
duration="15" updated="2017-06-08T21:05:34Z" tags="io2017,kiosk,web">
Building Beautiful Apps Faster with Material Components on iOS in Swift
</a>
</li>
<li>
<a href="/mdc-web/index.html?index=..%2F..%2Findex" category="Web" title="Building Beautiful Sites Faster with Material Components for the web"
duration="21" updated="2018-03-10T22:51:55Z" tags="cds17,io2017,kiosk,web">
Building Beautiful Sites Faster with Material Components for the web
</a>
</li>
<li>
<a href="/flutter/index.html?index=..%2F..%2Findex" class="codelab-card category-flutter" category="Flutter" title="Building Beautiful UIs with Flutter"
duration="102" updated="2018-04-16T21:55:25Z" tags="devfest-lon,gdd17,io2017,kiosk,web">
Building Beautiful UIs with Flutter
</a>
</li>
<li>
<a href="/building-custom-overlays/index.html?index=..%2F..%2Findex" category="Web" title="Building Custom Overlays" duration="36"
updated="2016-11-14T19:13:44Z" tags="chrome-dev-summit-2016,polymer-summit-2016,web">
Building Custom Overlays
</a>
</li>
<li>
<a href="/pwa-from-scratch/index.html?index=..%2F..%2Findex" category="Web" title="Building a Progressive Web App in Polymer from scratch"
duration="49" updated="2016-11-02T10:01:47Z" tags="chrome-dev-summit-2016,polymer-summit-2016,web">
Building a Progressive Web App in Polymer from scratch
</a>
</li>
<li>
<a href="/iot-pipeline/index.html?index=..%2F..%2Findex" category="Cloud,Pub/Sub,Functions,Big Query,Data Studio,IoT" title="Building a Serverless Data Pipeline: IoT to Analytics"
duration="44" updated="2018-04-17T04:29:51Z" tags="kiosk,web">
Building a Serverless Data Pipeline: IoT to Analytics
</a>
</li>
<li>
<a href="/cloud-grpc-csharp/index.html?index=..%2F..%2Findex" category="Cloud,General" title="Building a gRPC service with C#"
duration="31" updated="2017-10-31T11:26:20Z" tags="cloud,devint,kiosk,ndc,qwiklabs,vslive,web,windows">
Building a gRPC service with C#
</a>
</li>
<li>
<a href="/cloud-grpc-java/index.html?index=..%2F..%2Findex" category="Cloud,General" title="Building a gRPC service with Java"
duration="22" updated="2017-11-08T17:44:18Z" tags="cloud,devoxx,java,kiosk,qwiklabs,springone,web">
Building a gRPC service with Java
</a>
</li>
<li>
<a href="/cloud-grpc/index.html?index=..%2F..%2Findex" category="Cloud,General" title="Building a gRPC service with Node.js"
duration="45" updated="2017-06-30T20:21:08Z" tags="cloud,gcp-next,io2016,kiosk,mongodb-world,qwiklabs,ubiquity,web">
Building a gRPC service with Node.js
</a>
</li>
<li>
<a href="/polymer-2-carousel/index.html?index=..%2F..%2Findex" category="Web" title="Building an Image Carousel Element with Polymer 2.0"
duration="41" updated="2017-06-23T22:59:56Z" tags="chrome-dev-summit-2016,polymer-summit-2016,web">
Building an Image Carousel Element with Polymer 2.0
</a>
</li>
<li>
<a href="/lovefield/index.html?index=..%2F..%2Findex" category="Web,Chrome" title="Building rich web apps with Lovefield"
duration="35" updated="2016-06-16T18:32:13Z" tags="chrome-dev-summit,kiosk,pwa-dev-summit,web">
Building rich web apps with Lovefield
</a>
</li>
<li>
<a href="/webvr/index.html?index=..%2F..%2Findex" category="Web" title="Building for VR on the Web" duration="20" updated="2017-10-18T21:17:43Z"
tags="cds17,io2017,web">
Building for VR on the Web
</a>
</li>
<li>
<a href="/play-billing-codelab/index.html?index=..%2F..%2Findex" category="Android" title="Buy and Subscribe: Monetize your app on Google Play"
duration="34" updated="2017-09-19T18:33:31Z" tags="io2017,kiosk,web">
Buy and Subscribe: Monetize your app on Google Play
</a>
</li>
<li>
<a href="/using-caching/index.html?index=..%2F..%2Findex" category="Web,Progressive Web Apps" title="Caching with progressive libraries"
duration="44" updated="2016-06-16T18:23:20Z" tags="io2016,kiosk,pwa-dev-summit,web">
Caching with progressive libraries
</a>
</li>
<li>
<a href="/cast-videos-android/index.html?index=..%2F..%2Findex" class="codelab-card category-cast" category="Cast,Android"
title="Cast SDK v3 Android Codelab" duration="148" updated="2017-05-09T00:34:13Z" tags="kiosk,web">
Cast SDK v3 Android Codelab
</a>
</li>
<li>
<a href="/cast-videos-ios/index.html?index=..%2F..%2Findex" class="codelab-card category-cast" category="Cast,iOS" title="Cast SDK v3 iOS Codelab"
duration="128" updated="2016-11-04T21:38:55Z" tags="kiosk,web">
Cast SDK v3 iOS Codelab
</a>
</li>
<li>
<a href="/polymer-cast-elements/index.html?index=..%2F..%2Findex" category="Web" title="Chromecast elements" duration="1"
updated="2015-11-16" tags="polymer-summit,web">
Chromecast elements
</a>
</li>
<li>
<a href="/cast-elements/index.html?index=..%2F..%2Findex" class="codelab-card category-cast" category="Cast" title="Chromecast elements"
duration="31" updated="2015-12-15" tags="polymer-summit,web,ubiquity,chrome-dev-summit,polytechnic">
Chromecast elements
</a>
</li>
<li>
<a href="/cloud-nl-text-classification/index.html?index=..%2F..%2Findex" category="Cloud,Machine Learning" title="Classify Text into Categories with the Natural Language API"
duration="23" updated="2018-02-07T09:22:47Z" tags="kiosk,qwiklabs,web">
Classify Text into Categories with the Natural Language API
</a>
</li>
<li>
<a href="/cloud-automl-vision-intro/index.html?index=..%2F..%2Findex" category="Cloud,Machine Learning" title="Classify images of clouds in the cloud with AutoML Vision"
duration="36" updated="2018-03-27T05:03:26Z" tags="kiosk,qwiklabs,web">
Classify images of clouds in the cloud with AutoML Vision
</a>
</li>
<li>
<a href="/cpb100-datalab-jp/index.html?index=..%2F..%2Findex" category="Cloud,CPB100" title="Cloud Datalab の起動(日本語版)" duration="9"
updated="2018-03-30T18:03:50Z" tags="cpb100,sc17,web">
Cloud Datalab の起動(日本語版)
</a>
</li>
<li>
<a href="/firestore-android/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase"
title="Cloud Firestore Android Codelab" duration="37" updated="2017-11-07T12:23:36Z" tags="devfest-lon,firebase17,kiosk,web">
Cloud Firestore Android Codelab
</a>
</li>
<li>
<a href="/firestore-web/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase" title="Cloud Firestore Web Codelab"
duration="0" updated="2018-03-19T15:12:12Z" tags="firebase17,gdd17,kiosk,web">
Cloud Firestore Web Codelab
</a>
</li>
<li>
<a href="/firestore-ios/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase" title="Cloud Firestore iOS Codelab"
duration="0" updated="2017-10-31T06:21:14Z" tags="firebase17,kiosk,web">
Cloud Firestore iOS Codelab
</a>
</li>
<li>
<a href="/firebase-cloud-functions/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase,Web"
title="Cloud Functions for Firebase" duration="69" updated="2018-04-16T08:02:54Z" tags="chromeos,devfest-lon,firebase-dev-summit-2016,firebase17,gdd17,io2016,io2017,kiosk,sxsw,web">
Cloud Functions for Firebase
</a>
</li>
<li>
<a href="/firebase-cloud-functions-angular/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase,Web"
title="Cloud Functions for Firebase (Angular)" duration="85" updated="2017-10-22T16:37:57Z" tags="firebase-dev-summit-2016,gdd17,io2016,jsconfeu,kiosk,qwiklabs,sxsw,web">
Cloud Functions for Firebase (Angular)
</a>
</li>
<li>
<a href="/bigquery-maps-api/index.html?index=..%2F..%2Findex" category="Web,Geo,Big Data" title="Codelab: Querying and Visualising Location Data in BigQuery using Google Maps API"
duration="115" updated="2017-08-18T16:23:20Z" tags="web">
Codelab: Querying and Visualising Location Data in BigQuery using Google Maps API
</a>
</li>
<li>
<a href="/cloud-compute-kubernetes/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Compute Engine & Kubernetes (Container Engine)"
duration="130" updated="2016-12-01T19:31:35Z" tags="gcp-next,io2016,kiosk,web">
Compute Engine & Kubernetes (Container Engine)
</a>
</li>
<li>
<a href="/cloud-compute-the-cosmos/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Compute the Cosmos with Google Compute Engine"
duration="54" updated="2017-02-24T21:25:54Z" tags="cloud,gcp-next,gdc2017,io2016,kiosk,mongodb-world,web">
Compute the Cosmos with Google Compute Engine
</a>
</li>
<li>
<a href="/cloud-monitoring-alerting/index.html?index=..%2F..%2Findex" category="Cloud,Monitoring" title="Configure an Uptime Check and Alerting Policy"
duration="14" updated="2017-11-08T09:48:12Z" tags="cloud,devoxx,gcp-next,kiosk,nodejs-interactive,qwiklabs,sc17,springone,sxsw,web">
Configure an Uptime Check and Alerting Policy
</a>
</li>
<li>
<a href="/cloud-spinnaker-kubernetes-cd/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Continuous Delivery to Kubernetes Using Spinnaker"
duration="46" updated="2018-04-11T19:24:40Z" tags="kiosk,web">
Continuous Delivery to Kubernetes Using Spinnaker
</a>
</li>
<li>
<a href="/nest-cloud-nodejs/index.html?index=..%2F..%2Findex" class="codelab-card category-nest" category="Nest" title="Control Nest Devices using a Web App"
duration="39" updated="2018-03-28T15:13:30Z" tags="io2016,nest,web">
Control Nest Devices using a Web App
</a>
</li>
<li>
<a href="/candle-bluetooth/index.html?index=..%2F..%2Findex" category="Web" title="Control a PLAYBULB candle with Web Bluetooth"
duration="48" updated="2016-12-14T13:57:21Z" tags="bluetooth,chrome-dev-summit,chrome-dev-summit-2016,io2016,pwa-dev-summit,ubiquity,web">
Control a PLAYBULB candle with Web Bluetooth
</a>
</li>
<li>
<a href="/sw-precache-to-workbox/index.html?index=..%2F..%2Findex" category="Web" title="Convert an app to Workbox from sw-precache and sw-toolbox"
duration="0" updated="2018-04-09T18:24:27Z" tags="cds17,google-developer-training,kiosk,web">
Convert an app to Workbox from sw-precache and sw-toolbox
</a>
</li>
<li>
<a href="/conversation-design/index.html?index=..%2F..%2Findex" class="codelab-card category-assistant" category="Assistant"
title="Crafting a Character: Design an engaging Assistant app" duration="30" updated="2017-11-07T12:29:28Z" tags="devfest-lon,gdd17,io2017,kiosk,web">
Crafting a Character: Design an engaging Assistant app
</a>
</li>
<li>
<a href="/android-studio-cmake/index.html?index=..%2F..%2Findex" category="Android" title="Create Hello-CMake with Android Studio"
duration="10" updated="2018-02-10T03:08:53Z" tags="kiosk,web">
Create Hello-CMake with Android Studio
</a>
</li>
<li>
<a href="/android-studio-jni/index.html?index=..%2F..%2Findex" category="Android" title="Create Hello-JNI with Android Studio"
duration="1" updated="2017-11-08T09:41:49Z" tags="android-dev-summit,kiosk,web">
Create Hello-JNI with Android Studio
</a>
</li>
<li>
<a href="/cloud-create-cloud-sql-db/index.html?index=..%2F..%2Findex" category="Cloud,Data" title="Create a Managed MySQL database with Cloud SQL"
duration="19" updated="2017-11-03T14:52:26Z" tags="cloud,devoxx,gcp-next,gdc2017,hadoop-summit,kiosk,mongodb-world,nodejs-interactive,sc16,springone,strata,strata-ny,sxsw,web">
Create a Managed MySQL database with Cloud SQL
</a>
</li>
<li>
<a href="/watchface/index.html?index=..%2F..%2Findex" category="Android Wear" title="Create a watchface for Android Wear"
duration="70" updated="2017-09-03T09:17:28Z" tags="android-dev-summit,gdd17,io2017,kiosk-wear,ubiquity,web">
Create a watchface for Android Wear
</a>
</li>
<li>
<a href="/drx-custom-rendering-android/index.html?index=..%2F..%2Findex" category="Ads" title="Create custom rendered native ads"
duration="80" updated="2016-11-11T18:33:11Z" tags="">
Create custom rendered native ads
</a>
</li>
<li>
<a href="/nearbycontroller_unity/index.html?index=..%2F..%2Findex" category="Unity,Games,Nearby Connections" title="Creating Virtual Controllers with Nearby Connections"
duration="17" updated="2015-12-04" tags="web,unity,games">
Creating Virtual Controllers with Nearby Connections
</a>
</li>
<li>
<a href="/cloud-persistent-disk/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Creating a Persistent Disk"
duration="14" updated="2017-11-08T06:05:01Z" tags="cloud,devoxx,gcp-next,hadoop-summit,kiosk,propelify17,qwiklabs,sc16,sc17,springone,strata,strata-ny,sxsw,web">
Creating a Persistent Disk
</a>
</li>
<li>
<a href="/cloud-create-a-vm/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Creating a Virtual Machine"
duration="10" updated="2017-11-08T08:11:04Z" tags="cloud,devoxx,gcp-next,gdc2017,hadoop-summit,io2017,kiosk,mongodb-world,propelify17,qwiklabs,sc16,sc17,springone,strata,strata-ny,sxsw,web">
Creating a Virtual Machine
</a>
</li>
<li>
<a href="/app-maker-creating-webapp/index.html?index=..%2F..%2Findex" category="Web" title="Creating a web application with App Maker"
duration="55" updated="2018-03-27T15:11:32Z" tags="app maker,web">
Creating a web application with App Maker
</a>
</li>
<li>
<a href="/shopping-account-linking/index.html?index=..%2F..%2Findex" category="Ads" title="Creating and Linking AdWords and Merchant Center Sub-accounts"
duration="35" updated="2018-03-29T18:39:34Z" tags="web">
Creating and Linking AdWords and Merchant Center Sub-accounts
</a>
</li>
<li>
<a href="/creating-your-first-amp-component/index.html?index=..%2F..%2Findex" category="Web" title="Creating your first AMP Component"
duration="0" updated="2017-04-04T08:20:12Z" tags="amp-conf,kiosk,web">
Creating your first AMP Component
</a>
</li>
<li>
<a href="/cloud-subnetworks/index.html?index=..%2F..%2Findex" category="Cloud,Networking" title="Customize Network Topology with Subnetworks"
duration="22" updated="2018-04-12T21:04:41Z" tags="cloud,gcp-next,kiosk,nodejs-interactive,qwiklabs,rsa,sc17,sxsw,web">
Customize Network Topology with Subnetworks
</a>
</li>
<li>
<a href="/ng2-dart/index.html?index=..%2F..%2Findex" category="Web" title="Dart + Angular: Try the Tech Stack Powering the Next Generation of AdWords"
duration="57" updated="2017-04-06T17:46:13Z" tags="io2016,web">
Dart + Angular: Try the Tech Stack Powering the Next Generation of AdWords
</a>
</li>
<li>
<a href="/polymer-webgl/index.html?index=..%2F..%2Findex" category="Web" title="Data Visualization Using Polymer and WebGL"
duration="17" updated="2015-11-03" tags="polymer-summit,web,kiosk,chrome-dev-summit,polytechnic">
Data Visualization Using Polymer and WebGL
</a>
</li>
<li>
<a href="/debugging-service-workers/index.html?index=..%2F..%2Findex" category="Web" title="Debugging Service Workers" duration="0"
updated="2017-10-18T21:18:10Z" tags="cds17,io2017,kiosk,pwa-roadshow,web">
Debugging Service Workers
</a>
</li>
<li>
<a href="/tv-channels-programs/index.html?index=..%2F..%2Findex" category="Android TV" title="Deeper Content Integration with the New Android TV Home Screen"
duration="85" updated="2018-01-18T00:18:24Z" tags="android-dev-summit,gdd17,io2017,kiosk,ubiquity,web">
Deeper Content Integration with the New Android TV Home Screen
</a>
</li>
<li>
<a href="/cloud-kubernetes-aspnetcore/index.html?index=..%2F..%2Findex" category="Cloud,General" title="Deploy ASP.NET Core app to Kubernetes on Google Kubernetes Engine"
duration="74" updated="2018-04-03T15:11:39Z" tags="cloud,devint,kiosk,ndc,qwiklabs,vslive,web,windows">
Deploy ASP.NET Core app to Kubernetes on Google Kubernetes Engine
</a>
</li>
<li>
<a href="/cloud-compute-engine-aspnet/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Deploy ASP.NET app to Windows Server on Compute Engine"
duration="24" updated="2017-10-31T11:28:19Z" tags="cloud,devint,kiosk,ndc,pass2017,qwiklabs,vslive,web,windows">
Deploy ASP.NET app to Windows Server on Compute Engine
</a>
</li>
<li>
<a href="/gcp-aws-vms/index.html?index=..%2F..%2Findex" category="Cloud" title="Deploy Instances and Apps by Console and Command-Line"
duration="0" updated="2017-11-08T09:47:44Z" tags="sc17,web">
Deploy Instances and Apps by Console and Command-Line
</a>
</li>
<li>
<a href="/cloud-create-sql-server/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Deploy Microsoft SQL Server to Compute Engine"
duration="12" updated="2017-10-25T20:51:17Z" tags="cloud,devint,kiosk,ndc,pass2017,propelify17,qwiklabs,vslive,web,windows">
Deploy Microsoft SQL Server to Compute Engine
</a>
</li>
<li>
<a href="/cloud-app-engine-node/index.html?index=..%2F..%2Findex" category="Cloud,Compute,App Engine" title="Deploy Node.js Express Application in App Engine"
duration="16" updated="2017-09-05T18:11:50Z" tags="cloud,gdd17,jsconfeu,kiosk,nodejs-interactive,qwiklabs,web"
pin="" wait-for-ripple="">
Deploy Node.js Express Application in App Engine
</a>
</li>
<li>
<a href="/cloud-app-engine-springboot/index.html?index=..%2F..%2Findex" category="Cloud,Compute,App Engine" title="Deploy Spring Boot Application in App Engine standard"
duration="11" updated="2018-02-06T10:39:47Z" tags="cloud,devoxx,devoxx-us,java,jfokus,kiosk,propelify17,qwiklabs,spring,springone,web">
Deploy Spring Boot Application in App Engine standard
</a>
</li>
<li>
<a href="/cloud-create-vm-windows-dotnet/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Deploy Windows Server with ASP.NET Framework to Compute Engine"
duration="13" updated="2017-10-25T20:54:25Z" tags="cloud,devint,kiosk,ndc,pass2017,propelify17,qwiklabs,vslive,web,windows">
Deploy Windows Server with ASP.NET Framework to Compute Engine
</a>
</li>
<li>
<a href="/gcp-aws-deployment-manager/index.html?index=..%2F..%2Findex" category="Cloud" title="Deploy Your Infrastructure Using Deployment Manager"
duration="0" updated="2017-11-08T09:47:00Z" tags="sc17,web">
Deploy Your Infrastructure Using Deployment Manager
</a>
</li>
<li>
<a href="/cloud-springboot-kubernetes/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Deploy a Java application to Kubernetes on Google Kubernetes Engine"
duration="36" updated="2018-02-09T16:01:10Z" tags="cloud,devoxx,devoxx-us,kiosk,qwiklabs,spring,springone,web">
Deploy a Java application to Kubernetes on Google Kubernetes Engine
</a>
</li>
<li>
<a href="/cloud-app-engine-ruby-on-rails/index.html?index=..%2F..%2Findex" category="Cloud" title="Deploy a Ruby on Rails app to App Engine Flexible Environment"
duration="42" updated="2017-07-31T07:03:59Z" tags="cloud,io2017,kiosk,qwiklabs,web">
Deploy a Ruby on Rails app to App Engine Flexible Environment
</a>
</li>
<li>
<a href="/cloud-app-engine-aspnetcore/index.html?index=..%2F..%2Findex" category="Cloud,General" title="Deploy an ASP.NET Core app to App Engine"
duration="25" updated="2017-11-26T14:53:13Z" tags="cloud,devint,kiosk,ndc,qwiklabs,vslive,web,windows">
Deploy an ASP.NET Core app to App Engine
</a>
</li>
<li>
<a href="/cloud-vision-app-engine/index.html?index=..%2F..%2Findex" category="Web" title="Deploying a Python Flask Web Application to App Engine Flexible"
duration="34" updated="2017-11-07T12:54:26Z" tags="chrome-dev-summit-2016,devfest-lon,io2016,kiosk,pwa-dev-summit,pwa-roadshow,qwiklabs,web">
Deploying a Python Flask Web Application to App Engine Flexible
</a>
</li>
<li>
<a href="/android-audio-high-performance/index.html?index=..%2F..%2Findex" category="Android" title="Deprecated: Echo with Android Howie Library"
duration="21" updated="2017-03-23T10:08:30Z" tags="android-dev-summit,babbq-2015,kiosk,web" pin="" wait-for-ripple="">
Deprecated: Echo with Android Howie Library
</a>
</li>
<li>
<a href="/cloud-vision-intro/index.html?index=..%2F..%2Findex" category="Cloud,Machine Learning" title="Detect Labels, Faces, and Landmarks in Images with the Cloud Vision API"
duration="21" updated="2018-03-20T19:14:06Z" tags="cloud,devoxx,gcp-edu,gcp-next,gdc2017,gdd17,io2017,jsconfeu,kiosk,nodejs-interactive,qwiklabs,sc16,sc17,springone,strata-ny,trailheadx18,web">
Detect Labels, Faces, and Landmarks in Images with the Cloud Vision API
</a>
</li>
<li>
<a href="/developing-android-a11y-service/index.html?index=..%2F..%2Findex" category="Android" title="Developing an Accessibility Service for Android"
duration="0" updated="2016-12-13T09:45:02Z" tags="web">
Developing an Accessibility Service for Android
</a>
</li>
<li>
<a href="/daydream-video-ui/index.html?index=..%2F..%2Findex" class="codelab-card category-virtual-reality" category="Virtual Reality"
title="Displaying Video and UI in Daydream" duration="83" updated="2018-01-16T15:19:42Z" tags="io2017,kiosk-daydream,web">
Displaying Video and UI in Daydream
</a>
</li>
<li>
<a href="/cloud-spring-cloud-gcp-trace/index.html?index=..%2F..%2Findex" category="Cloud,Compute,App Engine" title="Distributed tracing with Spring Cloud Sleuth and Stackdriver Trace"
duration="14" updated="2018-04-12T18:04:57Z" tags="cloud,devoxx,devoxx-us,java,jfokus,kiosk,propelify17,qwiklabs,spring,springone,web">
Distributed tracing with Spring Cloud Sleuth and Stackdriver Trace
</a>
</li>
<li>
<a href="/cloud-spring-runtime-config/index.html?index=..%2F..%2Findex" category="Cloud,Compute,Java,Spring,Configuration"
title="Dynamic configuration for Spring Boot applications using Spring Cloud GCP Config starter" duration="19"
updated="2018-04-12T20:00:27Z" tags="cloud,devoxx,devoxx-us,jfokus,kiosk,propelify17,qwiklabs,spring,springone,web">
Dynamic configuration for Spring Boot applications using Spring Cloud GCP Config starter
</a>
</li>
<li>
<a href="/polymer-checkout-form/index.html?index=..%2F..%2Findex" category="Web" title="Easy Checkout Forms with Autofill & <gold-elements>"
duration="26" updated="2015-12-01" tags="polymer-summit,web,kiosk,chrome-dev-summit,polytechnic">
Easy Checkout Forms with Autofill & <gold-elements>
</a>
</li>
<li>
<a href="/android-deep-linking/index.html?index=..%2F..%2Findex" category="Search" title="Enable Deep Linking to your App"
duration="14" updated="2016-05-09T23:38:08Z" tags="kiosk,web">
Enable Deep Linking to your App
</a>
</li>
<li>
<a href="/credential-management-api/index.html?index=..%2F..%2Findex" category="Web" title="Enabling auto sign-in with the Credential Management API"
duration="26" updated="2018-03-07T07:26:42Z" tags="cds17,chrome-dev-summit-2016,io2016,io2017,kiosk,pwa-dev-summit,web">
Enabling auto sign-in with the Credential Management API
</a>
</li>
<li>
<a href="/cloud-bookshelf-java-cloud-kms/index.html?index=..%2F..%2Findex" category="Cloud,Security" title="Encrypt a Java application with Cloud KMS"
duration="32" updated="2017-02-21T20:00:26Z" tags="gcp-next,kiosk,rsa,web">
Encrypt a Java application with Cloud KMS
</a>
</li>
<li>
<a href="/end-to-end-ml/index.html?index=..%2F..%2Findex" category="Cloud,Data" title="End-to-end Machine Learning with Tensorflow on GCP"
duration="213" updated="2018-01-23T23:11:35Z" tags="web">
End-to-end Machine Learning with Tensorflow on GCP
</a>
</li>
<li>
<a href="/cloud-nl-intro/index.html?index=..%2F..%2Findex" category="Cloud,Machine Learning" title="Entity, Sentiment, and Syntax Analysis with the Natural Language API"
duration="23" updated="2018-03-20T19:13:28Z" tags="cloud,devoxx,gcp-edu,gcp-next,gdd17,jsconfeu,kiosk,nodejs-interactive,qwiklabs,rsa,sc16,sc17,springone,strata-ny,trailheadx18,web">
Entity, Sentiment, and Syntax Analysis with the Natural Language API
</a>
</li>
<li>
<a href="/providers/index.html?index=..%2F..%2Findex" category="Android Wear" title="Exposing data to watch face Complications on Android Wear"
duration="45" updated="2017-05-17T08:47:52Z" tags="io2017,kiosk-wear,ubiquity,web">
Exposing data to watch face Complications on Android Wear
</a>
</li>
<li>
<a href="/device-messaging/index.html?index=..%2F..%2Findex" class="codelab-card category-android-auto" category="Android Auto,Android Wear"
title="Extending messaging apps for cars and Wear" duration="24" updated="2017-08-31T19:12:14Z" tags="gdd17,io2017,kiosk-wear,web">
Extending messaging apps for cars and Wear
</a>
</li>
<li>
<a href="/face-detection/index.html?index=..%2F..%2Findex" category="Android" title="Face Detection with the Mobile Vision API"
duration="23" updated="2016-06-29T08:01:33Z" tags="web">
Face Detection with the Mobile Vision API
</a>
</li>
<li>
<a href="/assistant-dialogflow-nodejs/index.html?index=..%2F..%2Findex" class="codelab-card category-assistant" category="Assistant"
title="Facts about You: Build a conversational app for the Google Assistant" duration="75" updated="2018-04-16T23:23:35Z"
tags="gdd17,kiosk,web">
Facts about You: Build a conversational app for the Google Assistant
</a>
</li>
<li>
<a href="/cloud-mongodb-federated-ingress/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Federated Clusters and Global Ingress with Kubernetes"
duration="22" updated="2017-03-01T19:45:41Z" tags="cloud,kiosk,qwiklabs,web">
Federated Clusters and Global Ingress with Kubernetes
</a>
</li>
<li>
<a href="/web-perf/index.html?index=..%2F..%2Findex" category="Web" title="Find and Fix Web App Performance Issues" duration="0"
updated="2016-06-16T18:31:26Z" tags="chrome-dev-summit,io2016,kiosk,pwa-dev-summit,web">
Find and Fix Web App Performance Issues
</a>
</li>
<li>
<a href="/firebase-android/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase,Android"
title="Firebase Android Codelab" duration="40" updated="2018-02-26T16:04:46Z" tags="firebase-dev-summit-2016,firebase17,gdd17,io2016,io2017,kiosk,web">
Firebase Android Codelab
</a>
</li>
<li>
<a href="/app-indexing/index.html?index=..%2F..%2Findex" category="Search" title="Firebase App Indexing Android API: Logging User Actions and Getting Personal Content into Search"
duration="28" updated="2016-12-01T21:38:58Z" tags="android-dev-summit,io2016,kiosk,web">
Firebase App Indexing Android API: Logging User Actions and Getting Personal Content into Search
</a>
</li>
<li>
<a href="/firebase-appquality-objc/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase,iOS"
title="Firebase App Quality Codelab Objective-C" duration="8" updated="2018-01-31T20:00:34Z" tags="kiosk,web">
Firebase App Quality Codelab Objective-C
</a>
</li>
<li>
<a href="/firebase-appquality-swift/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase,iOS"
title="Firebase App Quality Codelab Swift" duration="8" updated="2018-01-31T19:59:57Z" tags="kiosk,web">
Firebase App Quality Codelab Swift
</a>
</li>
<li>
<a href="/firebase-web/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase,Web" title="Firebase Web Codelab"
duration="81" updated="2018-03-28T13:10:05Z" tags="chromeos,firebase-dev-summit-2016,firebase17,gdd17,io2016,io2017,kiosk,qwiklabs,sxsw,typtwd17,web"
pin="" wait-for-ripple="">
Firebase Web Codelab
</a>
</li>
<li>
<a href="/flutter-firebase/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase" title="Firebase for Flutter"
duration="81" updated="2018-02-27T18:54:58Z" tags="devfest-lon,firebase17,gdd17,io2017,kiosk,web">
Firebase for Flutter
</a>
</li>
<li>
<a href="/firebase-ios-objc/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase,iOS"
title="Firebase iOS Codelab Objective-C" duration="35" updated="2018-03-18T16:40:27Z" tags="firebase-dev-summit-2016,gdd17,io2016,io2017,kiosk,web">
Firebase iOS Codelab Objective-C
</a>
</li>
<li>
<a href="/firebase-ios-swift/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase,iOS"
title="Firebase iOS Codelab Swift" duration="34" updated="2018-01-30T19:46:37Z" tags="firebase-dev-summit-2016,firebase17,gdd17,io2016,io2017,kiosk,web">
Firebase iOS Codelab Swift
</a>
</li>
<li>
<a href="/payment-request-api/index.html?index=..%2F..%2Findex" category="Web" title="Frictionless payment with Payment Request API"
duration="44" updated="2017-10-18T21:19:18Z" tags="cds17,io2017,kiosk,web">
Frictionless payment with Payment Request API
</a>
</li>
<li>
<a href="/es003l-storage/index.html?index=..%2F..%2Findex" category="Cloud" title="GCS (Google Cloud Storage) Demo Lab" duration="47"
updated="2017-03-20T22:08:28Z" tags="es003l-storage,gcp-edu,web">
GCS (Google Cloud Storage) Demo Lab
</a>
</li>
<li>
<a href="/android-doze-standby/index.html?index=..%2F..%2Findex" category="Android" title="Get your app ready for Doze and App Standby"
duration="17" updated="2015-12-10" tags="web,kiosk,android-dev-summit">
Get your app ready for Doze and App Standby
</a>
</li>
<li>
<a href="/cloud-app-engine-python/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Getting Started with App Engine (Python)"
duration="13" updated="2017-05-12T10:20:47Z" tags="cloud,gcp-edu,gcp-next,hadoop-summit,kiosk,propelify17,strata,strata-ny,sxsw,web">
Getting Started with App Engine (Python)
</a>
</li>
<li>
<a href="/chatbase/index.html?index=..%2F..%2Findex" category="Web" title="Getting Started with Chatbase chatbot analytics"
duration="30" updated="2018-03-21T23:37:50Z" tags="io2017,kiosk,web">
Getting Started with Chatbase chatbot analytics
</a>
</li>
<li>
<a href="/cloud-encrypt-with-kms/index.html?index=..%2F..%2Findex" category="Cloud,Security" title="Getting Started with Cloud KMS"
duration="29" updated="2018-01-02T18:39:04Z" tags="cloud-summit-ny,gdd17,io2017,kiosk,qwiklabs,rsa,web">
Getting Started with Cloud KMS
</a>
</li>
<li>
<a href="/cloud-shell/index.html?index=..%2F..%2Findex" category="Cloud,Cloud Tools" title="Getting Started with Cloud Shell & gcloud"
duration="6" updated="2017-11-28T05:52:34Z" tags="cloud,devoxx,devoxx-us,gcp-next,gdd17,hadoop-summit,io2017,jsconfeu,kiosk,mongodb-world,nodejs-interactive,propelify17,qwiklabs,rsa,sc16,sc17,springone,strata,strata-ny,sxsw,web">
Getting Started with Cloud Shell & gcloud
</a>
</li>
<li>
<a href="/cloud-endpoints-appengine/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Getting Started with Endpoints Frameworks on App Engine"
duration="17" updated="2017-11-14T14:02:31Z" tags="cloud,devoxx,kiosk,qwiklabs,springone,web" pin="" wait-for-ripple="">
Getting Started with Endpoints Frameworks on App Engine
</a>
</li>
<li>
<a href="/happy-weave-getting-started/index.html?index=..%2F..%2Findex" category="IoT" title="Getting Started with Happy and Weave"
duration="42" updated="2018-03-15T22:37:43Z" tags="web">
Getting Started with Happy and Weave
</a>
</li>
<li>
<a href="/vr_view_app_101/index.html?index=..%2F..%2Findex" class="codelab-card category-virtual-reality" category="Virtual Reality"
title="Getting started with VR View for Android" duration="41" updated="2017-01-12T18:12:42Z" tags="io2016,vr,web">
Getting started with VR View for Android
</a>
</li>
<li>
<a href="/vr_view_101/index.html?index=..%2F..%2Findex" class="codelab-card category-virtual-reality" category="Virtual Reality"
title="Getting started with VR view for HTML" duration="40" updated="2017-01-12T00:07:53Z" tags="io2016,vr,web">
Getting started with VR view for HTML
</a>
</li>
<li>
<a href="/getting-ready-for-android-n/index.html?index=..%2F..%2Findex" category="Android" title="Getting your app ready for Android N"
duration="45" updated="2016-05-18T13:14:42Z" tags="io2016,kiosk,web">
Getting your app ready for Android N
</a>
</li>
<li>
<a href="/gmail-add-ons/index.html?index=..%2F..%2Findex" class="codelab-card category-apps" category="Apps" title="Gmail Add-ons"
duration="34" updated="2018-03-20T22:41:39Z" tags="gdd17,kiosk,trailheadx18,web">
Gmail Add-ons
</a>
</li>
<li>
<a href="/fire-place/index.html?index=..%2F..%2Findex" class="codelab-card category-geo" category="Geo,Cloud,Android" title="Going Places with Android"
duration="31" updated="2015-11-24" tags="web,kiosk,android-dev-summit">
Going Places with Android
</a>
</li>
<li>
<a href="/app-citizenship-with-intents/index.html?index=..%2F..%2Findex" category="Search" title="Good App Citizenship with Intents"
duration="20" updated="2017-01-17T22:35:39Z" tags="android-dev-summit,babbq-2015,kiosk,web">
Good App Citizenship with Intents
</a>
</li>
<li>
<a href="/cast-game-manager/index.html?index=..%2F..%2Findex" class="codelab-card category-cast" category="Cast" title="Google Cast Game Manager API Codelab"
duration="103" updated="2015-12-14T21:45:25Z" tags="kiosk,ubiquity,web">
Google Cast Game Manager API Codelab
</a>
</li>
<li>
<a href="/cast-unity-plugin/index.html?index=..%2F..%2Findex" class="codelab-card category-cast" category="Cast,Unity,Games,Android"
title="Google Cast Remote Display Plugin For Unity Codelab" duration="162" updated="2016-01-15T15:02:00Z" tags="kiosk,ubiquity,web">
Google Cast Remote Display Plugin For Unity Codelab
</a>
</li>
<li>
<a href="/cloud-speech-nodejs/index.html?index=..%2F..%2Findex" category="Cloud,Machine Learning" title="Google Cloud Speech API : Node.js example"
duration="21" updated="2017-11-08T06:12:29Z" tags="cloud,sc17,web">
Google Cloud Speech API : Node.js example
</a>
</li>
<li>
<a href="/google-maps-web-services-proxy/index.html?index=..%2F..%2Findex" class="codelab-card category-geo" category="Geo,Cloud"
title="Google Maps Web Services Proxy for Mobile Applications" duration="45" updated="2017-11-09T16:06:02Z" tags="io2017,kiosk,qwiklabs,web">
Google Maps Web Services Proxy for Mobile Applications
</a>
</li>
<li>
<a href="/apps-script-intro/index.html?index=..%2F..%2Findex" class="codelab-card category-apps" category="Apps" title="Hands-on with Google Apps Script: accessing Google Sheets, Maps & Gmail in 4 lines of code!"
duration="25" updated="2018-03-20T22:41:07Z" tags="devfest-lon,gdd17,kiosk,trailheadx18,web" pin="" wait-for-ripple="">
Hands-on with Google Apps Script: accessing Google Sheets, Maps & Gmail in 4 lines of code!
</a>
</li>
<li>
<a href="/chat-apps-script/index.html?index=..%2F..%2Findex" class="codelab-card category-apps" category="Apps" title="Hangouts Chat bot with Apps Script"
duration="10" updated="2018-03-07T21:23:35Z" tags="kiosk,web">
Hangouts Chat bot with Apps Script
</a>
</li>
<li>
<a href="/cloud-hello-istio/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Hello Istio Codelab
(with Google Kubernetes Engine)" duration="30" updated="2018-04-18T11:39:53Z" tags="cloud,devoxx,kiosk,qwiklabs,sac18,springone,web">
Hello Istio Codelab (with Google Kubernetes Engine)
</a>
</li>
<li>
<a href="/cloud-hello-kubernetes/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Hello Node Kubernetes Codelab"
duration="50" updated="2018-01-12T12:38:36Z" tags="cloud,gcp-next,io2017,kiosk,qwiklabs,web">
Hello Node Kubernetes Codelab
</a>
</li>
<li>
<a href="/hello-beacons/index.html?index=..%2F..%2Findex" category="Android" title="Hello, Beacons! Proximity & Context-aware Apps"
duration="30" updated="2016-07-20T13:21:41Z" tags="beacons,io2016,web">
Hello, Beacons! Proximity & Context-aware Apps
</a>
</li>
<li>
<a href="/adaptive-web-media/index.html?index=..%2F..%2Findex" category="Web" title="High performance video for the mobile web"
duration="16" updated="2016-06-16T18:28:36Z" tags="io2016,kiosk,pwa-dev-summit,web">
High performance video for the mobile web
</a>
</li>
<li>
<a href="/web-components-how-to-contribute/index.html?index=..%2F..%2Findex" category="Web" title="How to Contribute to the Web Components ecosystem"
duration="0" updated="2017-10-18T21:19:55Z" tags="cds17,io2017,kiosk,web">
How to Contribute to the Web Components ecosystem
</a>
</li>
<li>
<a href="/ima-html5/index.html?index=..%2F..%2Findex" category="Web" title="IMA SDK for HTML5 Codelab" duration="7" updated="2018-03-13T14:41:50Z"
tags="io2018,kiosk,web">
IMA SDK for HTML5 Codelab
</a>
</li>
<li>
<a href="/cpb102-txf-learning/index.html?index=..%2F..%2Findex" category="Cloud" title="Image Classification Transfer Learning with Inception v3"
duration="90" updated="2017-01-20T23:55:57Z" tags="cpb102,web">
Image Classification Transfer Learning with Inception v3
</a>
</li>
<li>
<a href="/cloud-ml-engine-image-classification/index.html?index=..%2F..%2Findex" category="Cloud,Data,ML" title="Image Classification Using Cloud ML Engine & Datalab"
duration="58" updated="2018-03-20T22:34:52Z" tags="cloud,devoxx,gcp-next,hadoop-summit,kiosk,mongodb-world,qwiklabs,sc16,springone,strata-ny,web">
Image Classification Using Cloud ML Engine & Datalab
</a>
</li>
<li>
<a href="/image-styling-web-components/index.html?index=..%2F..%2Findex" category="Web" title="Image Styling with Web Components"
duration="22" updated="2017-10-23T07:49:23Z" tags="cds17,kiosk,web">
Image Styling with Web Components
</a>
</li>
<li>
<a href="/cpb100-datalab-es/index.html?index=..%2F..%2Findex" category="Cloud,CPB100" title="Inicie Cloud Datalab en Español"
duration="9" updated="2018-03-30T17:30:48Z" tags="cpb100,sc17,web">
Inicie Cloud Datalab en Español
</a>
</li>
<li>
<a href="/cloud-windows-powershell/index.html?index=..%2F..%2Findex" category="Cloud,General" title="Install and use Cloud Tools for PowerShell"
duration="20" updated="2017-10-19T10:45:41Z" tags="cloud,devint,kiosk,ndc,qwiklabs,vslive,web,windows">
Install and use Cloud Tools for PowerShell
</a>
</li>
<li>
<a href="/cloud-visual-studio/index.html?index=..%2F..%2Findex" category="Cloud,General" title="Install and use Cloud Tools for Visual Studio"
duration="26" updated="2017-10-19T10:45:54Z" tags="cloud,devint,kiosk,ndc,qwiklabs,vslive,web,windows">
Install and use Cloud Tools for Visual Studio
</a>
</li>
<li>
<a href="/firebase-analytics/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase"
title="Instrumenting your Android App with Google Analytics for Firebase" duration="30" updated="2017-05-17T17:02:12Z"
tags="io2016,kiosk,web">
Instrumenting your Android App with Google Analytics for Firebase
</a>
</li>
<li>
<a href="/android-pay-web/index.html?index=..%2F..%2Findex" category="Web" title="Integrating Android Pay on Mobile Web"
duration="46" updated="2017-05-17T17:32:31Z" tags="io2017,web">
Integrating Android Pay on Mobile Web
</a>
</li>
<li>
<a href="/polymer-bluetooth/index.html?index=..%2F..%2Findex" category="Web" title="Interact with Bluetooth devices on the Web with Polymer"
duration="22" updated="2016-12-15T13:27:51Z" tags="bluetooth,chrome-dev-summit,io2016,polymer-summit,polytechnic,ubiquity,web">
Interact with Bluetooth devices on the Web with Polymer
</a>
</li>
<li>
<a href="/polymer-firebase/index.html?index=..%2F..%2Findex" category="Web" title="Interacting with data using the <firebase-element>"
duration="0" updated="2016-01-27" tags="polymer-summit,web,kiosk,chrome-dev-summit,polytechnic">
Interacting with data using the <firebase-element>
</a>
</li>
<li>
<a href="/daydream-controller/index.html?index=..%2F..%2Findex" class="codelab-card category-virtual-reality" category="Virtual Reality"
title="Interacting with the Daydream Controller Touchpad" duration="104" updated="2017-08-16T14:30:00Z" tags="io2017,kiosk-daydream,web">
Interacting with the Daydream Controller Touchpad
</a>
</li>
<li>
<a href="/from-java-to-dart/index.html?index=..%2F..%2Findex" category="Web" title="Intro to Dart for Java Developers" duration="20"
updated="2017-05-30T20:16:44Z" tags="io2017,kiosk,web">
Intro to Dart for Java Developers
</a>
</li>
<li>
<a href="/arcore-intro/index.html?index=..%2F..%2Findex" class="codelab-card category-virtual-reality" category="Virtual Reality,Unity"
title="Introduction to ARCore in Unity" duration="60" updated="2018-04-10T13:21:36Z" tags="web">
Introduction to ARCore in Unity
</a>
</li>
<li>
<a href="/cloud-dataproc-starter/index.html?index=..%2F..%2Findex" category="Cloud,Data" title="Introduction to Cloud Dataproc: Hadoop and Spark on Google Cloud Platform"
duration="14" updated="2018-01-29T15:03:13Z" tags="cloud,cloud-summit-ny,devoxx,gcp-next,gdd17,hadoop-summit,io2017,kiosk,mongodb-world,nodejs-interactive,qwiklabs,sc16,sc17,springone,strata-ny,web">
Introduction to Cloud Dataproc: Hadoop and Spark on Google Cloud Platform
</a>
</li>
<li>
<a href="/permissions-introduction/index.html?index=..%2F..%2Findex" category="Web" title="Introduction to Permissions API"
duration="23" updated="2016-05-19T20:50:30Z" tags="chrome-dev-summit,io2016,kiosk,web">
Introduction to Permissions API
</a>
</li>
<li>
<a href="/android-storage-permissions/index.html?index=..%2F..%2Findex" category="Android" title="Keep Sensitive Data Safe and Private"
duration="40" updated="2018-01-12T02:24:07Z" tags="io2017,kiosk,web">
Keep Sensitive Data Safe and Private
</a>
</li>
<li>
<a href="/cpb100-datalab/index.html?index=..%2F..%2Findex" category="Cloud,CPB100" title="Launch Cloud Datalab" duration="9"
updated="2017-11-08T06:16:47Z" tags="cpb100,sc17,web">
Launch Cloud Datalab
</a>
</li>
<li>
<a href="/blockly-ios/index.html?index=..%2F..%2Findex" class="codelab-card category-blockly" category="Blockly" title="Learning to use Blockly iOS"
duration="60" updated="2017-10-13T23:50:31Z" tags="kiosk,web">
Learning to use Blockly iOS
</a>
</li>
<li>
<a href="/blockly-web/index.html?index=..%2F..%2Findex" class="codelab-card category-blockly" category="Blockly" title="Learning to use Blockly on the Web"
duration="35" updated="2017-09-27T12:06:01Z" tags="kiosk,web">
Learning to use Blockly on the Web
</a>
</li>
<li>
<a href="/gcp-aws-bigquery/index.html?index=..%2F..%2Findex" category="Cloud" title="Load and Analyze Data in BigQuery" duration="0"
updated="2017-05-16T15:21:19Z" tags="web">
Load and Analyze Data in BigQuery
</a>
</li>
<li>
<a href="/cloud-bq-campaign-finance/index.html?index=..%2F..%2Findex" category="Cloud,Data" title="Looking at campaign finance with BigQuery"
duration="22" updated="2018-03-20T22:47:53Z" tags="cloud,devoxx,gcp-next,gdc2017,io2016,kiosk,mongodb-world,rsa,sc16,springone,trailheadx18,web">
Looking at campaign finance with BigQuery
</a>
</li>
<li>
<a href="/making-waves-2-sampler/index.html?index=..%2F..%2Findex" category="Android" title="Making More Waves - Sampler"
duration="56" updated="2018-01-30T21:45:49Z" tags="web">
Making More Waves - Sampler
</a>
</li>
<li>
<a href="/making-waves-1-synth/index.html?index=..%2F..%2Findex" category="Android" title="Making Waves Part 1 - Build a Synthesizer"
duration="53" updated="2018-02-22T10:46:17Z" tags="web">
Making Waves Part 1 - Build a Synthesizer
</a>
</li>
<li>
<a href="/apigee-spike-arrest/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Manage your APIs using Apigee Edge - Protect your API from Traffic Spikes"
duration="15" updated="2017-12-07T18:47:03Z" tags="kiosk,qwiklabs,springone,web">
Manage your APIs using Apigee Edge - Protect your API from Traffic Spikes
</a>
</li>
<li>
<a href="/apigee-pcf-orgplan/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Manage your Pivotal Cloud Foundry App's using Apigee Edge"
duration="26" updated="2017-12-06T18:32:40Z" tags="kiosk,qwiklabs,springone,web">
Manage your Pivotal Cloud Foundry App's using Apigee Edge
</a>
</li>
<li>
<a href="/nyc-subway-station-locator/index.html?index=..%2F..%2Findex" class="codelab-card category-geo" category="Geo" title="Mapping the NYC Subway"
duration="59" updated="2017-08-31T18:47:55Z" tags="gdd17,io2017,kiosk,web">
Mapping the NYC Subway
</a>
</li>
<li>
<a href="/performance-analytics/index.html?index=..%2F..%2Findex" class="codelab-card category-analytics" category="Analytics"
title="Measuring Critical Performance Metrics with Google Analytics" duration="35" updated="2016-07-21T16:17:06Z"
tags="io2016,kiosk,pwa-dev-summit,web">
Measuring Critical Performance Metrics with Google Analytics
</a>
</li>
<li>
<a href="/exoplayer-intro/index.html?index=..%2F..%2Findex" category="Android" title="Media streaming with ExoPlayer" duration="67"
updated="2018-01-12T14:31:48Z" tags="io2017,kiosk,web">
Media streaming with ExoPlayer
</a>
</li>
<li>
<a href="/cloud-spring-cloud-gcp-pubsub-integration/index.html?index=..%2F..%2Findex" category="Cloud" title="Messaging with Spring Integration and Google Cloud Pub/Sub"
duration="10" updated="2018-04-12T18:28:21Z" tags="cloud,devoxx,java,jfokus,kiosk,qwiklabs,spring,springone,web">
Messaging with Spring Integration and Google Cloud Pub/Sub
</a>
</li>
<li>
<a href="/firebase-monetization/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase"
title="Monetization from Good to Great with Firebase, in 10 mins" duration="16" updated="2017-07-17T23:34:52Z"
tags="io2017,kiosk,web">
Monetization from Good to Great with Firebase, in 10 mins
</a>
</li>
<li>
<a href="/cloud-monitoring-codelab/index.html?index=..%2F..%2Findex" category="Cloud,Monitoring" title="Monitoring Cloud Infrastructure with Stackdriver"
duration="15" updated="2017-11-14T14:00:10Z" tags="cloud,devoxx,devoxx-us,gcp-next,gdc2017,kiosk,nodejs-interactive,qwiklabs,rsa,springone,sxsw,web"
pin="" wait-for-ripple="">
Monitoring Cloud Infrastructure with Stackdriver
</a>
</li>
<li>
<a href="/wear-nav-action/index.html?index=..%2F..%2Findex" category="Android Wear" title="Navigation and Actions with Wear 2.0"
duration="17" updated="2017-09-03T09:16:31Z" tags="gdd17,io2017,kiosk-wear,web">
Navigation and Actions with Wear 2.0
</a>
</li>
<li>
<a href="/nest-camera-api/index.html?index=..%2F..%2Findex" category="IoT" title="Nest Cam & TensorFlow Codelab" duration="35"
updated="2018-03-21T15:27:06Z" tags="io2017,kiosk-iot,web">
Nest Cam & TensorFlow Codelab
</a>
</li>
<li>
<a href="/nest-ten-tips-for-success/index.html?index=..%2F..%2Findex" class="codelab-card category-nest" category="Nest"
title="Nest – 10 tips for your successful integration" duration="67" updated="2018-04-09T23:14:59Z" tags="web">
Nest – 10 tips for your successful integration
</a>
</li>
<li>
<a href="/android-network-manager/index.html?index=..%2F..%2Findex" category="Android" title="Network Manager In Your App"
duration="21" updated="2016-01-11T23:14:58Z" tags="android-dev-summit,babbq-2015,kiosk,web">
Network Manager In Your App
</a>
</li>
<li>
<a href="/cloud-networking-101/index.html?index=..%2F..%2Findex" category="Cloud,Networking" title="Networking 101" duration="44"
updated="2017-11-08T06:18:58Z" tags="cloud,gcp-next,kiosk,qwiklabs,rsa,sc17,web">
Networking 101
</a>
</li>
<li>
<a href="/cloud-networking-102/index.html?index=..%2F..%2Findex" category="Cloud,Networking" title="Networking 102" duration="73"
updated="2017-03-06T20:01:42Z" tags="cloud,gcp-next,kiosk,qwiklabs,rsa,web">
Networking 102
</a>
</li>
<li>
<a href="/notification-channels-java/index.html?index=..%2F..%2Findex" category="Android" title="Notification Channels and Badges (Java)"
duration="32" updated="2017-11-07T12:23:05Z" tags="devfest-lon,gdd17,io2017,kiosk,web">
Notification Channels and Badges (Java)
</a>
</li>
<li>
<a href="/notification-channels-kotlin/index.html?index=..%2F..%2Findex" category="Android" title="Notification Channels and Badges (Kotlin)"
duration="32" updated="2017-09-03T09:12:15Z" tags="gdd17,io2017,kiosk,web">
Notification Channels and Badges (Kotlin)
</a>
</li>
<li>
<a href="/gcp-aws-accounts-and-billing/index.html?index=..%2F..%2Findex" category="Cloud" title="Open an Account and Manage Billing and Projects"
duration="0" updated="2017-11-08T09:38:35Z" tags="sc17,web">
Open an Account and Manage Billing and Projects
</a>
</li>
<li>
<a href="/gcp-aws-accounts-and-billing-v2/index.html?index=..%2F..%2Findex" category="Cloud" title="Open an Account and Manage Billing and Projects"
duration="0" updated="2018-02-08T08:47:31Z" tags="web">
Open an Account and Manage Billing and Projects
</a>
</li>
<li>
<a href="/optimize-autofill/index.html?index=..%2F..%2Findex" category="Web" title="Optimize your app for autofill" duration="0"
updated="2018-04-17T00:28:53Z" tags="io2018,kiosk,web">
Optimize your app for autofill
</a>
</li>
<li>
<a href="/draco-3d/index.html?index=..%2F..%2Findex" category="Web" title="Optimizing 3D data with Draco Geometry Compression"
duration="40" updated="2017-10-06T15:57:46Z" tags="io2017,kiosk,web">
Optimizing 3D data with Draco Geometry Compression
</a>
</li>
<li>
<a href="/vp9-video/index.html?index=..%2F..%2Findex" category="Web" title="Optimizing video quality with VP9 video compression"
duration="51" updated="2017-05-17T16:28:08Z" tags="io2017,kiosk,web">
Optimizing video quality with VP9 video compression
</a>
</li>
<li>
<a href="/cloud-orchestrate-with-kubernetes/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Orchestrating the Cloud with Kubernetes"
duration="60" updated="2017-02-24T21:32:41Z" tags="cloud,gdc2017,io2016,kiosk,mongodb-world,web" pin="" wait-for-ripple="">
Orchestrating the Cloud with Kubernetes
</a>
</li>
<li>
<a href="/prpl-ce-firebase/index.html?index=..%2F..%2Findex" category="Web" title="PRPL with Custom Elements and Firebase"
duration="30" updated="2018-03-23T22:39:38Z" tags="io2017,kiosk,polymer-summit-2017,web">
PRPL with Custom Elements and Firebase
</a>
</li>
<li>
<a href="/expand-collapse-animations/index.html?index=..%2F..%2Findex" category="Web" title="Performant Expand & Collapse Animations"
duration="24" updated="2017-08-21T14:02:08Z" tags="polymer-summit-2017,web">
Performant Expand & Collapse Animations
</a>
</li>
<li>
<a href="/firebase-auth-android/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase"
title="Personalize your Android App with Firebase User Management" duration="0" updated="2017-11-07T12:24:01Z"
tags="devfest-lon,io2016,kiosk,web">
Personalize your Android App with Firebase User Management
</a>
</li>
<li>
<a href="/firebase-auth-ios/index.html?index=..%2F..%2Findex" class="codelab-card category-firebase" category="Firebase"
title="Personalize your iOS App with Firebase User Management" duration="0" updated="2016-05-18T18:00:36Z" tags="io2016,kiosk,web">
Personalize your iOS App with Firebase User Management
</a>
</li>
<li>
<a href="/daydream-picking-pushing/index.html?index=..%2F..%2Findex" class="codelab-card category-virtual-reality" category="Virtual Reality"
title="Picking, Pushing, and Throwing with the Daydream Controller" duration="104" updated="2017-08-16T14:30:03Z"
tags="io2017,kiosk-daydream,web">
Picking, Pushing, and Throwing with the Daydream Controller
</a>
</li>
<li>
<a href="/playservices_unity/index.html?index=..%2F..%2Findex" category="Unity,Games" title="Play Game Services in Unity"
duration="78" updated="2016-05-18T17:18:46Z" tags="games,io2016,kiosk,unity,web">
Play Game Services in Unity
</a>
</li>
<li>
<a href="/android-music-player/index.html?index=..%2F..%2Findex" class="codelab-card category-android-auto" category="Android Auto,Android Wear"
title="Playing music on cars and wearables" duration="48" updated="2018-03-05T21:27:05Z" tags="io2017,kiosk-wear,web">
Playing music on cars and wearables
</a>
</li>
<li>
<a href="/cloud-using-cloud-launcher/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Provision Services with Cloud Launcher"
duration="7" updated="2018-04-12T21:11:59Z" tags="cloud,gcp-next,gdc2017,gdd17,hadoop-summit,jsconfeu,kiosk,mongodb-world,nodejs-interactive,propelify17,qwiklabs,sc17,strata,sxsw,web">
Provision Services with Cloud Launcher
</a>
</li>
<li>
<a href="/cloud-dataproc-gcloud/index.html?index=..%2F..%2Findex" category="Cloud,Data" title="Provisioning and Using a Managed Hadoop/Spark Cluster with Cloud Dataproc (Command Line)"
duration="20" updated="2017-11-14T09:57:26Z" tags="cloud,devoxx,gcp-next,hadoop-summit,kiosk,mongodb-world,qwiklabs,sc16,sc17,springone,strata-ny,web">
Provisioning and Using a Managed Hadoop/Spark Cluster with Cloud Dataproc (Command Line)
</a>
</li>
<li>
<a href="/bigquery-github/index.html?index=..%2F..%2Findex" category="Cloud,Data" title="Query Github Data Using BigQuery"
duration="0" updated="2018-02-21T04:35:51Z" tags="web">
Query Github Data Using BigQuery
</a>
</li>
<li>
<a href="/cloud-bigquery-wikipedia/index.html?index=..%2F..%2Findex" category="Cloud,Data" title="Query the Wikipedia dataset in BigQuery"
duration="19" updated="2018-03-20T22:46:43Z" tags="cloud,devoxx,gcp-next,gdc2017,gdd17,hadoop-summit,jsconfeu,kiosk,mongodb-world,nodejs-interactive,qwiklabs,sc16,sc17,springone,strata,strata-ny,sxsw,trailheadx18,web">
Query the Wikipedia dataset in BigQuery
</a>
</li>
<li>
<a href="/orbitera-multi-cloud-billing/index.html?index=..%2F..%2Findex" category="Cloud" title="Quickstart: Get started with multi-cloud billing"
duration="47" updated="2018-04-13T00:24:36Z" tags="web">
Quickstart: Get started with multi-cloud billing
</a>
</li>
<li>
<a href="/orbitera-powered-marketplace/index.html?index=..%2F..%2Findex" category="Cloud" title="Quickstart: Get started with white-label marketplaces"
duration="54" updated="2018-02-21T18:45:51Z" tags="web">
Quickstart: Get started with white-label marketplaces
</a>
</li>
<li>
<a href="/tv-watch-next/index.html?index=..%2F..%2Findex" category="Android TV" title="Raise engagement on Android TV by integrating with the Play Next row"
duration="33" updated="2018-03-31T20:24:29Z" tags="android-dev-summit,gdd18,io2018,kiosk,ubiquity,web">
Raise engagement on Android TV by integrating with the Play Next row
</a>
</li>
<li>
<a href="/spring-cloud-gcp-gcs/index.html?index=..%2F..%2Findex" category="Cloud" title="Reading and Writing Files with Spring Resource Abstraction for Google Cloud Storage"
duration="14" updated="2018-04-12T18:30:34Z" tags="cloud,devoxx,java,kiosk,qwiklabs,spring,springone,web">
Reading and Writing Files with Spring Resource Abstraction for Google Cloud Storage
</a>
</li>
<li>
<a href="/webrtc-web/index.html?index=..%2F..%2Findex" category="Web,Mobile" title="Real time communication with WebRTC"
duration="34" updated="2018-02-21T09:25:11Z" tags="io2016,web,webrtc">
Real time communication with WebRTC
</a>
</li>
<li>
<a href="/realtime-asset-tracking/index.html?index=..%2F..%2Findex" class="codelab-card category-geo" category="Geo,Cloud,Android,Mobile"
title="Real-time Asset Tracking" duration="70" updated="2017-09-05T09:02:18Z" tags="gdd17,web">
Real-time Asset Tracking
</a>
</li>
<li>
<a href="/android-migrate-to-jobs/index.html?index=..%2F..%2Findex" category="Android" title="Removing dependencies on background services"
duration="40" updated="2016-05-19T19:55:16Z" tags="io2016,web. kiosk">
Removing dependencies on background services
</a>
</li>
<li>
<a href="/cloud-dataflow-starter/index.html?index=..%2F..%2Findex" category="Cloud,Data" title="Run a Big Data Text Processing Pipeline in Cloud Dataflow"
duration="21" updated="2017-11-08T06:24:34Z" tags="cloud,devoxx,gcp-next,gdc2017,hadoop-summit,io2017,kiosk,mongodb-world,nodejs-interactive,qwiklabs,sc16,sc17,springone,strata-ny,web">
Run a Big Data Text Processing Pipeline in Cloud Dataflow
</a>
</li>
<li>
<a href="/cloud-create-a-nodejs-vm/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Running Node.js on a Virtual Machine"
duration="12" updated="2017-09-05T09:07:17Z" tags="cloud,gdd17,jsconfeu,kiosk,nodejs-interactive,propelify17,web">
Running Node.js on a Virtual Machine
</a>
</li>
<li>
<a href="/cloud-windows-containers-computeengine/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Running Windows Containers on Compute Engine"
duration="16" updated="2018-02-23T12:41:48Z" tags="cloud,devint,kiosk,ndc,qwiklabs,vslive,web,windows">
Running Windows Containers on Compute Engine
</a>
</li>
<li>
<a href="/cloud-wordpress-on-flex/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Running WordPress on App Engine Flexible Environment"
duration="29" updated="2017-03-02T20:22:11Z" tags="cloud,gcp-next,kiosk,qwiklabs,web">
Running WordPress on App Engine Flexible Environment
</a>
</li>
<li>
<a href="/cloud-running-a-container/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Running a Container in Kubernetes with Container Engine"
duration="0" updated="2018-04-19T11:28:37Z" tags="cloud,gcp-next,gdc2017,hadoop-summit,kiosk,mongodb-world,nodejs-interactive,sc16,springone,strata,strata-ny,sxsw,web">
Running a Container in Kubernetes with Container Engine
</a>
</li>
<li>
<a href="/cloud-mongodb-statefulset/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Running a MongoDB Database in Kubernetes with StatefulSets"
duration="38" updated="2017-02-28T14:17:26Z" tags="cloud,kiosk,qwiklabs,web">
Running a MongoDB Database in Kubernetes with StatefulSets
</a>
</li>
<li>
<a href="/cloud-running-a-nodejs-container/index.html?index=..%2F..%2Findex" category="Cloud,Compute" title="Running a Node.js Container in Kubernetes with Container Engine"
duration="33" updated="2017-09-03T09:03:34Z" tags="cloud,gdd17,jsconfeu,kiosk,nodejs-interactive,web">
Running a Node.js Container in Kubernetes with Container Engine
</a>
</li>
<li>
<a href="/cloud-dataproc-opencv/index.html?index=..%2F..%2Findex" category="Cloud,Data" title="Running a Spark Application with OpenCV on Cloud Dataproc"
duration="26" updated="2017-11-08T06:25:24Z" tags="cloud,kiosk,qwiklabs,sc17,web">
Running a Spark Application with OpenCV on Cloud Dataproc
</a>
</li>
<li>
<a href="/gcp-aws-scaling-and-balancing/index.html?index=..%2F..%2Findex" category="Cloud" title="Scale and Load Balance Instances and Apps"
duration="0" updated="2017-05-11T08:44:13Z" tags="web">
Scale and Load Balance Instances and Apps
</a>
</li>
<li>
<a href="/android-smart-lock/index.html?index=..%2F..%2Findex" category="Android" title="Seamless Sign In with Smart Lock"
duration="33" updated="2017-11-30T08:03:23Z" tags="android-dev-summit,babbq-2015,gdd17,io2016,kiosk,web">
Seamless Sign In with Smart Lock
</a>
</li>
<li>
<a href="/gcp-aws-custom-networks/index.html?index=..%2F..%2Findex" category="Cloud" title="Secure Instances and Apps with Custom Networks"
duration="0" updated="2017-05-16T20:58:59Z" tags="web">
Secure Instances and Apps with Custom Networks
</a>
</li>
<li>
<a href="/cloud-lamp-migration/index.html?index=..%2F..%2Findex" category="Cloud,Security" title="Secure On-premise to Hybrid LAMP Stack Migration"
duration="120" updated="2017-02-21T20:03:20Z" tags="cloud,kiosk,rsa,web">
Secure On-premise to Hybrid LAMP Stack Migration
</a>
</li>
<li>
<a href="/mobile-vision-ocr/index.html?index=..%2F..%2Findex" category="Android" title="See and Understand Text
using OCR with Mobile Vision Text API for Android" duration="32" updated="2017-05-16T03:34:02Z" tags="io2016,io2017,kiosk,web">
See and Understand Text using OCR with Mobile Vision Text API for Android
</a>
</li>
<li>
<a href="/dataeng-machine-learning/index.html?index=..%2F..%2Findex" category="Cloud" title="Serverless Machine Learning"
duration="143" updated="2017-08-08T20:27:06Z" tags="dataengineer,qwiklabs,web">
Serverless Machine Learning
</a>
</li>
<li>
<a href="/cloud-load-balancers/index.html?index=..%2F..%2Findex" category="Cloud,Networking" title="Setup Network and HTTP Load Balancers"
duration="26" updated="2018-04-12T21:09:09Z" tags="cloud,gcp-edu,gcp-next,kiosk,nodejs-interactive,qwiklabs,rsa,sxsw,web">
Setup Network and HTTP Load Balancers
</a>
</li>
<li>
<a href="/google-maps-simple-store-locator/index.html?index=..%2F..%2Findex" class="codelab-card category-geo" category="Geo,Cloud"
title="Simple Store Locator with Google Maps" duration="35" updated="2017-09-05T08:30:22Z" tags="io2017,kiosk,qwiklabs,web">
Simple Store Locator with Google Maps
</a>
</li>
<li>
<a href="/openthread-simulation/index.html?index=..%2F..%2Findex" category="IoT" title="Simulating a Thread network using OpenThread"
duration="37" updated="2018-02-01T01:19:42Z" tags="io2017,kiosk,web">
Simulating a Thread network using OpenThread
</a>
</li>
<li>
<a href="/slides-api/index.html?index=..%2F..%2Findex" class="codelab-card category-apps" category="Apps" title="Slides API"
duration="36" updated="2018-03-20T22:42:12Z" tags="gdd17,kiosk,trailheadx18,web">
Slides API
</a>
</li>
<li>
<a href="/speaking-with-a-webpage/index.html?index=..%2F..%2Findex" category="Cloud" title="Speaking with a Webpage - Streaming speech transcripts"
duration="55" updated="2017-03-20T21:35:25Z" tags="gcp-edu,gcp-next,kiosk,qwiklabs,web">
Speaking with a Webpage - Streaming speech transcripts
</a>
</li>
<li>
<a href="/cloud-speech-intro/index.html?index=..%2F..%2Findex" category="Cloud,Machine Learning" title="Speech to Text Transcription with the Cloud Speech API"
duration="14" updated="2018-03-20T19:12:53Z" tags="cloud,devoxx,gcp-next,gdd17,jsconfeu,kiosk,nodejs-interactive,qwiklabs,sc16,sc17,springone,strata-ny,trailheadx18,web">
Speech to Text Transcription with the Cloud Speech API
</a>
</li>
<li>
<a href="/android-pay/index.html?index=..%2F..%2Findex" category="Android" title="Speedy Mobile Checkout with Android Pay"
duration="38" updated="2016-10-17T14:08:28Z" tags="android-dev-summit,android-pay,io2016,web">
Speedy Mobile Checkout with Android Pay
</a>
</li>
<li>
<a href="/gcp-aws-networking/index.html?index=..%2F..%2Findex" category="Cloud" title="Spin Up Instances and Check Connectivity"
duration="0" updated="2017-11-08T09:38:05Z" tags="sc17,web">
Spin Up Instances and Check Connectivity
</a>
</li>
<li>
<a href="/cloud-spring-petclinic-cloudsql/index.html?index=..%2F..%2Findex" category="Cloud,Compute,Java,Spring,Cloud SQL"
title="Spring Pet Clinic using Cloud SQL" duration="10" updated="2018-02-06T00:15:07Z" tags="cloud,devoxx,devoxx-us,jfokus,kiosk,propelify17,qwiklabs,spring,springone,web">
Spring Pet Clinic using Cloud SQL
</a>
</li>
<li>
<a href="/cloud-stackdriver-qwikstart/index.html?index=..%2F..%2Findex" category="Cloud,Monitoring" title="Stackdriver: Qwik Start"
duration="0" updated="2018-02-24T09:13:01Z" tags="cloud,kiosk,qwiklabs,sac18,web">
Stackdriver: Qwik Start
</a>
</li>
<li>
<a href="/cloud-ml-engine-sd-regression/index.html?index=..%2F..%2Findex" category="Cloud,Data,ML" title="Structured Data Regression Using Cloud ML Engine & Datalab"
duration="58" updated="2018-03-20T22:39:47Z" tags="cloud,devoxx,gcp-next,hadoop-summit,kiosk,mongodb-world,qwiklabs,sc16,springone,strata-ny,web">
Structured Data Regression Using Cloud ML Engine & Datalab
</a>
</li>
<li>
<a href="/taking-advantage-of-kotlin/index.html?index=..%2F..%2Findex" category="Android" title="Taking Advantage of Kotlin"
duration="75" updated="2017-11-07T12:25:13Z" tags="devfest-lon,gdd17,kiosk,web">
Taking Advantage of Kotlin
</a>
</li>
<li>
<a href="/tensorflow-for-poets/index.html?index=..%2F..%2Findex" class="codelab-card category-tensorflow" category="TensorFlow"
title="TensorFlow For Poets" duration="77" updated="2018-04-11T19:15:33Z" tags="devfest-lon,gdd17,io2016,io2017,kiosk,web">
TensorFlow For Poets
</a>
</li>
<li>
<a href="/cloud-tensorflow-mnist/index.html?index=..%2F..%2Findex" category="Cloud,Machine Learning" title="TensorFlow and deep learning, without a PhD"
duration="149" updated="2018-04-18T17:50:21Z" tags="web">
TensorFlow and deep learning, without a PhD
</a>
</li>
<li>
<a href="/tensorflow-for-poets-2/index.html?index=..%2F..%2Findex" class="codelab-card category-tensorflow" category="TensorFlow,Android"
title="TensorFlow for Poets 2: Optimize for Mobile" duration="65" updated="2017-12-06T18:26:05Z" tags="gdd17,io2017,kiosk,web">
TensorFlow for Poets 2: Optimize for Mobile
</a>
</li>
<li>
<a href="/tensorflow-for-poets-2-tflite/index.html?index=..%2F..%2Findex" category="TensorFlow,Android" title="TensorFlow for Poets 2: TFLite"
duration="55" updated="2018-02-12T20:16:33Z" tags="kiosk,none,web">
TensorFlow for Poets 2: TFLite
</a>
</li>
<li>
<a href="/unity-firebase-test-lab-game-loop/index.html?index=..%2F..%2Findex" category="Unity,Firebase,Testing" title="Testing a Unity Project with Firebase Test Lab for Android"
duration="79" updated="2017-07-06T17:29:24Z" tags="web">
Testing a Unity Project with Firebase Test Lab for Android
</a>
</li>
<li>
<a href="/deeplink-referrer/index.html?index=..%2F..%2Findex" category="Search" title="Track Deep Link Referrals" duration="30"
updated="2015-11-25T00:12:09Z" tags="web">
Track Deep Link Referrals
</a>
</li>
<li>
<a href="/cloud-translation-intro/index.html?index=..%2F..%2Findex" category="Cloud,Machine Learning" title="Translate Text with the Translation API"
duration="27" updated="2018-03-20T19:08:38Z" tags="cloud,gcp-edu,gcp-next,kiosk,qwiklabs,sc17,trailheadx18,web">
Translate Text with the Translation API
</a>
</li>
<li>
<a href="/transport-tracker-backend/index.html?index=..%2F..%2Findex" class="codelab-card category-geo" category="Geo" title="Transport Tracker Backend"
duration="47" updated="2017-08-31T23:52:04Z" tags="gdd17,io2017,kiosk,web">
Transport Tracker Backend
</a>
</li>
<li>
<a href="/transport-tracker-map/index.html?index=..%2F..%2Findex" class="codelab-card category-geo" category="Geo" title="Transport Tracker Map"
duration="31" updated="2017-08-31T23:52:23Z" tags="gdd17,io2017,kiosk,web">
Transport Tracker Map
</a>
</li>
<li>
<a href="/location-places-android/index.html?index=..%2F..%2Findex" class="codelab-card category-geo" category="Geo" title="Understand your Place in this World -- Getting Started with the Places API on Android"
duration="0" updated="2016-05-17T03:15:00Z" tags="io2016,kiosk,web">
Understand your Place in this World -- Getting Started with the Places API on Android
</a>
</li>
<li>
<a href="/location-places-ios/index.html?index=..%2F..%2Findex" class="codelab-card category-geo" category="Geo" title="Understand your Place in this World -- Getting Started with the Places API on iOS"
duration="0" updated="2016-05-14T16:26:26Z" tags="io2016,kiosk,web">
Understand your Place in this World -- Getting Started with the Places API on iOS
</a>
</li>
<li>
<a href="/cloud-upload-objects-to-cloud-storage/index.html?index=..%2F..%2Findex" category="Cloud,Data" title="Upload Objects to Cloud Storage"
duration="11" updated="2017-11-08T06:30:15Z" tags="cloud,devoxx,gcp-next,gdd17,hadoop-summit,jsconfeu,kiosk,mongodb-world,nodejs-interactive,propelify17,sc16,sc17,springone,strata,sxsw,web">
Upload Objects to Cloud Storage
</a>
</li>
<li>
<a href="/sheets-api/index.html?index=..%2F..%2Findex" class="codelab-card category-sheets" category="Sheets" title="Use Google Sheets as your application's reporting tool"
duration="34" updated="2018-03-23T16:20:39Z" tags="gdd17,io2016,kiosk,web">
Use Google Sheets as your application's reporting tool
</a>
</li>
<li>
<a href="/gcp-aws-gsutil/index.html?index=..%2F..%2Findex" category="Cloud" title="Use gsutil to Perform Operations on Buckets and Objects"
duration="0" updated="2017-11-08T09:37:12Z" tags="sc17,web">
Use gsutil to Perform Operations on Buckets and Objects
</a>
</li>
<li>
<a href="/cloud-vision-nodejs/index.html?index=..%2F..%2Findex" category="Cloud,Data" title="Using Cloud Vision with Node.js"
duration="48" updated="2016-12-01T19:36:48Z" tags="cloud,kiosk,web">
Using Cloud Vision with Node.js
</a>
</li>
<li>
<a href="/firebase-test-lab/index.html?index=..%2F..%2Findex" category="Web" title="Using Firebase Test Lab to Improve the Quality of your Mobile Apps"
duration="74" updated="2016-05-18T19:55:52Z" tags="io2016,kiosk,web">
Using Firebase Test Lab to Improve the Quality of your Mobile Apps
</a>
</li>
<li>
<a href="/cloud-test-lab/index.html?index=..%2F..%2Findex" category="Android" title="Using Google Cloud Test Lab to improve the quality of your mobile apps"
duration="79" updated="2016-12-01T19:36:11Z" tags="babbq-2015,kiosk,web">
Using Google Cloud Test Lab to improve the quality of your mobile apps
</a>
</li>
<li>
<a href="/cloud-stackdriver-debug/index.html?index=..%2F..%2Findex" category="Cloud,Monitoring" title="Using Google Stackdriver Debug, Traces, Logging and Logpoints"
duration="41" updated="2018-03-27T17:01:23Z" tags="cloud,gcp-next,kiosk,qwiklabs,web">
Using Google Stackdriver Debug, Traces, Logging and Logpoints
</a>
</li>
<li>
<a href="/cloud-ruby-on-rails-cloud-sql-postgres-ruby/index.html?index=..%2F..%2Findex" category="Cloud" title="Using Ruby on Rails with Cloud SQL for PostgreSQL"
duration="52" updated="2018-03-20T17:05:23Z" tags="cloud,io2017,kiosk,qwiklabs,web">
Using Ruby on Rails with Cloud SQL for PostgreSQL
</a>
</li>
<li>
<a href="/cloud-stackdriver-getting-started/index.html?index=..%2F..%2Findex" category="Cloud,Monitoring" title="Using Stackdriver's monitoring and logging to get better visibility into your application's health"
duration="58" updated="2016-12-01T19:35:56Z" tags="cloud,gcp-next,kiosk,web">
Using Stackdriver's monitoring and logging to get better visibility into your application's health
</a>
</li>
<li>
<a href="/nlp-from-google-docs/index.html?index=..%2F..%2Findex" category="Web" title="Using the Natural Language API from Google Docs"
duration="18" updated="2018-03-21T06:59:01Z" tags="kiosk,next2017,qwiklabs,trailheadx18,web">
Using the Natural Language API from Google Docs
</a>
</li>
<li>
<a href="/cloud-natural-language-ruby/index.html?index=..%2F..%2Findex" category="Cloud" title="Using the Natural Language API with Ruby"
duration="32" updated="2018-02-15T00:37:50Z" tags="cloud,io2017,kiosk,qwiklabs,web">
Using the Natural Language API with Ruby
</a>
</li>
<li>
<a href="/cloud-vision-api-python/index.html?index=..%2F..%2Findex" category="Cloud" title="Using the Vision API with Python"
duration="15" updated="2018-04-17T22:42:15Z" tags="cloud,kiosk,qwiklabs,web">
Using the Vision API with Python
</a>
</li>
<li>
<a href="/cloud-vision-api-ruby/index.html?index=..%2F..%2Findex" category="Cloud" title="Using the Vision API with Ruby"
duration="17" updated="2018-02-22T00:49:50Z" tags="cloud,io2017,kiosk,qwiklabs,sc17,web">
Using the Vision API with Ruby
</a>
</li>
<li>
<a href="/wear-maps/index.html?index=..%2F..%2Findex" class="codelab-card category-geo" category="Geo,Android Wear" title="Wearable Maps"
duration="37" updated="2015-12-12" tags="web,kiosk">
Wearable Maps
</a>
</li>
<li>
<a href="/web-animations-transitions-playbackcontrol/index.html?index=..%2F..%2Findex" category="Web,Chrome" title="Web Animations Transitions and Playback Control"
duration="25" updated="2015-11-11" tags="web,kiosk">
Web Animations Transitions and Playback Control
</a>
</li>
<li>
<a href="/wwn-api-quickstart/index.html?index=..%2F..%2Findex" class="codelab-card category-nest" category="Nest" title="Works with Nest API Quick Start Guide"
duration="51" updated="2018-04-09T20:15:07Z" tags="io2017,kiosk-iot,web">
Works with Nest API Quick Start Guide
</a>
</li>
<li>
<a href="/your-first-angulardart-web-app/index.html?index=..%2F..%2Findex" category="Web" title="Write a Material Design AngularDart Web App"
duration="20" updated="2017-09-02T00:15:59Z" tags="io2017,kiosk,none,web">
Write a Material Design AngularDart Web App
</a>
</li>
<li>
<a href="/gsuite-apis-intro/index.html?index=..%2F..%2Findex" class="codelab-card category-apps" category="Apps" title="Writing apps that access G Suite APIs: displaying the first 100 files & folders in your Google Drive"
duration="25" updated="2018-03-20T22:40:24Z" tags="devfest-lon,gdd17,kiosk,trailheadx18,web" pin="" wait-for-ripple="">
Writing apps that access G Suite APIs: displaying the first 100 files & folders in your Google Drive
</a>
</li>
<li>
<a href="/youtube-in-your-app/index.html?index=..%2F..%2Findex" category="Web" title="YouTube in Your App" duration="12"
updated="2016-05-18T20:23:25Z" tags="io2016,kiosk,web">
YouTube in Your App
</a>
</li>
<li>
<a href="/your-first-pwapp/index.html?index=..%2F..%2Findex" category="Web" title="Your First Progressive Web App" duration="0"
updated="2018-04-13T14:47:14Z" tags="cds17,chrome-dev-summit-2016,gdd17,io2016,io2017,kiosk,pwa-dev-summit,pwa-roadshow,typtwd17,web"
pin="" wait-for-ripple="">
Your First Progressive Web App
</a>
</li>
<li>
<a href="/clasp/index.html?index=..%2F..%2Findex" class="codelab-card category-apps" category="Apps" title="clasp - The Apps Script CLI"
duration="13" updated="2018-03-28T16:56:31Z" tags="kiosk,web">
clasp - The Apps Script CLI
</a>
</li>
<li>
<a href="/reCAPTCHA/index.html?index=..%2F..%2Findex" category="Web,Android" title="reCAPTCHA - Protect your website from spam and abuse"
duration="25" updated="2017-10-18T21:21:04Z" tags="cds17,io2017,kiosk,web">
reCAPTCHA - Protect your website from spam and abuse
</a>
</li>
<li>
<a href="/migrate-to-progressive-web-apps/index.html?index=..%2F..%2Findex" category="Web" title="🎉 Migrate your site to a Progressive Web App 🐲"
duration="31" updated="2018-01-18T22:21:25Z" tags="cds17,devfest-lon,gdd17,io2016,io2017,kiosk,pwa-dev-summit,web"
pin="" wait-for-ripple="">
🎉 Migrate your site to a Progressive Web App 🐲
</a>
</li>
</ul>
</div>
</main>
<footer>
<div class="footer-wrapper site-width">
<div class="link-list">
<label>Connect</label>
<ul>
<li>
<a href="https://googledevelopers.blogspot.com/">Blog</a>
</li>
<li>
<a href="https://www.facebook.com/pages/Google-Developers/967415219957038">Facebook</a>
</li>
<li>
<a href="https://plus.google.com/+GoogleDevelopers/posts">Google+</a>
</li>
<li>
<a href="https://medium.com/google-developers">Medium</a>
</li>
<li>
<a href="https://twitter.com/googledevs">Twitter</a>
</li>
<li>
<a href="https://www.youtube.com/user/GoogleDevelopers">YouTube</a>
</li>
</ul>
</div>
<div class="link-list">
<label>Programs</label>
<ul>
<li>
<a href="https://www.womentechmakers.com/">Women Techmakers</a>
</li>
<li>
<a href="https://developers.google.com/agency/">Agency Program</a>
</li>
<li>
<a href="https://developers.google.com/groups/">Google Developer Groups</a>
</li>
<li>
<a href="https://developers.google.com/experts/">Google Developer Experts</a>
</li>
<li>
<a href="https://developers.google.com/startups/">Startup Launchpad</a>
</li>
</ul>
</div>
<div class="link-list">
<label>Developer Consoles</label>
<ul>
<li>
<a href="https://console.developers.google.com/">Google API Console</a>
</li>
<li>
<a href="https://console.cloud.google.com/">Google Cloud Developer Console</a>
</li>
<li>
<a href="https://play.google.com/apps/publish/">Google Play Developer Console</a>
</li>
<li>
<a href="https://firebase.google.com/console/">Firebase Console</a>
</li>
<li>
<a href="https://cast.google.com/publish/">Cast SDK Developer Console</a>
</li>
<li>
<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Web Store Dashboard</a>
</li>
</ul>
</div>
<div class="link-list">
<label>Explore</label>
<ul>
<li>
<a href="https://developers.google.com/android/">Android</a>
</li>
<li>
<a href="https://developers.google.com/ios/">iOS</a>
</li>
<li>
<a href="https://developers.google.com/web/">Web</a>
</li>
<li>
<a href="https://developers.google.com/games/">Games</a>
</li>
<li>
<a href="https://developers.google.com/products/">All Products</a>
</li>
<li>
<a href="https://www.google.com/about/careers/">Careers</a>
</li>
</ul>
</div>
</div>
<div class="footerbar">
<div class="site-width">
<span>
<a href="https://developers.google.com/site-terms/">Terms</a>
|
<a href="https://www.google.com/intl/en/privacy/" class="gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Privacy Link">Privacy</a>
</span>
</div>
</div>
</footer>
</google-codelab-index>
<script src="/external/polyfill/src/native-shim.js"></script>
<script src="/external/polyfill/custom-elements.min.js"></script>
<script src="google_codelab_index_bin.js"></script>
</body>
</html>
| {
"content_hash": "2f0fb40880e414c74fbe4e2e55efb2b7",
"timestamp": "",
"source": "github",
"line_count": 3021,
"max_line_length": 246,
"avg_line_length": 40.91459781529295,
"alnum_prop": 0.5907542697183725,
"repo_name": "googlecodelabs/tools",
"id": "7d3b0ceb60dad14976b59cc377d6413ea5762abe",
"size": "123657",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "codelab-elements/google-codelab-index/index.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Closure Templates",
"bytes": "11725"
},
{
"name": "Go",
"bytes": "385782"
},
{
"name": "HTML",
"bytes": "298234"
},
{
"name": "JavaScript",
"bytes": "220239"
},
{
"name": "Makefile",
"bytes": "1987"
},
{
"name": "SCSS",
"bytes": "74923"
},
{
"name": "Shell",
"bytes": "4487"
},
{
"name": "Starlark",
"bytes": "26935"
}
],
"symlink_target": ""
} |
Huginn is a system for building agents that perform automated tasks for you online. They can read the web, watch for events, and take actions on your behalf. Huginn's Agents create and consume events, propagating them along a directed graph. Think of it as a hackable Yahoo! Pipes plus IFTTT on your own server. You always know who has your data. You do.

#### Here are some of the things that you can do with Huginn right now:
* Track the weather and get an email when it's going to rain (or snow) tomorrow ("Don't forget your umbrella!")
* List terms that you care about and receive emails when their occurrence on Twitter changes. (For example, want to know when something interesting has happened in the world of Machine Learning? Huginn will watch the term "machine learning" on Twitter and tell you when there is a large spike.)
* Watch for air travel or shopping deals
* Follow your project names on Twitter and get updates when people mention them
* Scrape websites and receive emails when they change
* Connect to Adioso, HipChat, Basecamp, Growl, FTP, IMAP, Jabber, JIRA, MQTT, nextbus, Pushbullet, Pushover, RSS, Bash, Slack, StubHub, translation APIs, Twilio, Twitter, Wunderground, and Weibo, to name a few.
* Compose digest emails about things you care about to be sent at specific times of the day
* Track counts of high frequency events and send an SMS within moments when they spike, such as the term "san francisco emergency"
* Send and receive WebHooks
* Run arbitrary JavaScript Agents on the server
* Track your location over time
* Create Amazon Mechanical Turk workflows as the inputs, or outputs, of agents (the Amazon Turk Agent is called the "HumanTaskAgent"). For example: "Once a day, ask 5 people for a funny cat photo; send the results to 5 more people to be rated; send the top-rated photo to 5 people for a funny caption; send to 5 final people to rate for funniest caption; finally, post the best captioned photo on my blog."
[](https://gitter.im/cantino/huginn?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Follow [@tectonic](https://twitter.com/tectonic) for updates as Huginn evolves, and join us in our [Gitter room](https://gitter.im/cantino/huginn) to discuss the project.
### We need your help!
Want to help with Huginn? All contributions are encouraged! You could make UI improvements, [add new Agents](https://github.com/cantino/huginn/wiki/Creating-a-new-agent), write documentation and tutorials, or try tackling [issues tagged with #help-wanted](https://github.com/cantino/huginn/issues?direction=desc&labels=help-wanted&page=1&sort=created&state=open).
Really want an issue fixed/feature implemented? Or maybe you just want to solve some community issues and earn some extra coffee money? Then you should take a look at the [current bounties on Bountysource](https://www.bountysource.com/trackers/282580-huginn).
Have an awesome an idea but not feeling quite up to contributing yet? Head over to our [Official 'suggest an agent' thread ](https://github.com/cantino/huginn/issues/353) and tell us about your cool idea!
## Examples
Please checkout the [Huginn Introductory Screencast](http://vimeo.com/61976251)!
And now, some example screenshots. Below them are instructions to get you started.





## Getting Started
### Quick Start
If you just want to play around, you can simply fork this repository, then perform the following steps:
* Run `git remote add upstream https://github.com/cantino/huginn.git` to add the main repository as a remote for your fork.
* Copy `.env.example` to `.env` (`cp .env.example .env`) and edit `.env`, at least updating the `APP_SECRET_TOKEN` variable.
* Run `bundle` to install dependencies
* Run `bundle exec rake db:create`, `bundle exec rake db:migrate`, and then `bundle exec rake db:seed` to create a development MySQL database with some example Agents.
* Run `bundle exec foreman start`, visit [http://localhost:3000/][localhost], and login with the username of `admin` and the password of `password`.
* Setup some Agents!
* Read the [wiki][wiki] for usage examples and to get started making new Agents.
* Periodically run `git fetch upstream` and then `git checkout master && git merge upstream/master` to merge in the newest version of Huginn.
Note: by default, emails are not sent in the `development` Rails environment, which is what you just setup. If you'd like to enable emails when playing with Huginn locally, edit `config.action_mailer.perform_deliveries` in `config/environments/development.rb`.
If you need more detailed instructions, see the [Novice setup guide][novice-setup-guide].
[localhost]: http://localhost:3000/
[wiki]: https://github.com/cantino/huginn/wiki
[novice-setup-guide]: https://github.com/cantino/huginn/wiki/Novice-setup-guide
### Develop
All agents have specs! Test all specs with `bundle exec rspec`, or test a specific spec with `bundle exec rspec path/to/specific/spec.rb`. Read more about rspec for rails [here](https://github.com/rspec/rspec-rails).
## Deployment
[](https://heroku.com/deploy) (Takes a few minutes to setup. Be sure to click 'View it' after launch!)
Huginn can run on Heroku for free! Please see [the Huginn Wiki](https://github.com/cantino/huginn/wiki#deploying-huginn) for detailed deployment strategies for different providers.
### Optional Setup
#### Setup for private development
See [private development instructions](https://github.com/cantino/huginn/wiki/Private-development-instructions) on the wiki.
#### Enable the WeatherAgent
In order to use the WeatherAgent you need an [API key with Wunderground](http://www.wunderground.com/weather/api/). Signup for one and then change the value of `api_key: your-key` in your seeded WeatherAgent.
#### Disable SSL
We assume your deployment will run over SSL. This is a very good idea! However, if you wish to turn this off, you'll probably need to edit `config/initializers/devise.rb` and modify the line containing `config.rememberable_options = { :secure => true }`. You will also need to edit `config/environments/production.rb` and modify the value of `config.force_ssl`.
## License
Huginn is provided under the MIT License.
## Community
Huginn has its own IRC channel on freenode: #huginn.
Some of us are hanging out there, come and say hello.
## Contribution
Huginn is a work in progress and is just getting started. Please get involved! You can [add new Agents](https://github.com/cantino/huginn/wiki/Creating-a-new-agent), expand the [Wiki](https://github.com/cantino/huginn/wiki), or help us simplify and strengthen the Agent API or core application.
Please fork, add specs, and send pull requests!
[](https://travis-ci.org/cantino/huginn) [](https://coveralls.io/r/cantino/huginn) [](https://bitdeli.com/free "Bitdeli Badge") [](https://gemnasium.com/cantino/huginn) [](https://www.bountysource.com/trackers/282580-huginn?utm_source=282580&utm_medium=shield&utm_campaign=TRACKER_BADGE)
| {
"content_hash": "0c3dd6050a2eef6dbff26fe8f13a9cda",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 634,
"avg_line_length": 70.25454545454545,
"alnum_prop": 0.7668219461697723,
"repo_name": "lgwapnitsky/huginn-lgw",
"id": "5968c50c6ef4464fa95130250f4f9aba2d4b8330",
"size": "7789",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3893"
},
{
"name": "CoffeeScript",
"bytes": "18306"
},
{
"name": "HTML",
"bytes": "99378"
},
{
"name": "Makefile",
"bytes": "41"
},
{
"name": "Nginx",
"bytes": "780"
},
{
"name": "Ruby",
"bytes": "828962"
},
{
"name": "Shell",
"bytes": "11466"
}
],
"symlink_target": ""
} |
/**
* Google Glass utility functions
*
* @author jottley
* @author wabson
*/
(function() {
/**
* Google Glass namespace
*/
Alfresco.GoogleGlass = Alfresco.GoogleGlass || {};
/*
* YUI aliases
*/
var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event;
/*
* Static user-displayed message, timer and status
*/
var userMessage = null, userMessageText = "";
/*
* OAuth dialog width and height in pixels
*/
var OAUTH_WINDOW_WIDTH = 480, OAUTH_WINDOW_HEIGHT = 480;
/**
* Destroy the message displayed to the user
*
* @method hideMessage
* @static
*/
Alfresco.GoogleGlass.hideMessage = function GGA_hideMessage()
{
if (userMessage)
{
if (userMessage.element)
{
userMessage.destroy();
}
userMessage = null;
userMessageText = "";
}
};
/**
* Remove any existing popup message and show a new message
*
* @method showMessage
* @static
* @param config {object} object literal containing success callback
* - text {String} The message text to display
* - displayTime {int} Display time in seconds. Defaults to zero, i.e. show forever
* - showSpinner {boolean} Whether to display the spinner image or not, default is true
*/
Alfresco.GoogleGlass.showMessage = function GGA_showMessage(config)
{
if (userMessageText != config.text) // only update if text has changed
{
Alfresco.GoogleGlass.hideMessage();
var displayTime = (config.displayTime === null || typeof config.displayTime == "undefined") ? 0 : config.displayTime,
showSpinner = (config.showSpinner === null || typeof config.showSpinner == "undefined") ? true : config.showSpinner;
userMessage = Alfresco.util.PopupManager.displayMessage({
displayTime: displayTime,
text: showSpinner ? '<span class="wait">' + config.text + '</span>' : config.text,
noEscape: true,
modal: true
});
userMessageText = config.text;
}
};
/**
* Insert the Google accounts logo into the Dom with event handlers, in order for us to detect whether or not the user
* is currently logged into Google or not
*
* @function loadAccountsLogo
* @static
* @param config {object} object literal containing success callback
* - onLoad: object literal of form { fn: ..., scope: ... } to be executed if the image loads correctly (i.e. user is logged in)
* - onError: object literal of form { fn: ..., scope: ... } to be executed if the image loads with errors (i.e. user not logged in)
*
*/
Alfresco.GoogleGlass.loadAccountsLogo = function GGA_loadAccountsLogo(config)
{
// create the profile image element
var imgEl = document.createElement("IMG");
Dom.setAttribute(imgEl, "src", "https://accounts.google.com/CheckCookie?" +
"continue=https%3A%2F%2Fwww.google.com%2Fintl%2Fen%2Fimages%2Flogos%2Faccounts_logo.png&" +
"followup=https%3A%2F%2Fwww.google.com%2Fintl%2Fen%2Fimages%2Flogos%2Faccounts_logo.png&" +
"chtml=LoginDoneHtml&checkedDomains=youtube&checkConnection=youtube%3A291%3A1&" +
"ts=" + new Date().getTime());
Dom.setStyle(imgEl, "display", "none");
Event.addListener(imgEl, "load", config.onLoad.fn, config.onLoad.scope, true);
Event.addListener(imgEl, "error", config.onError.fn, config.onError.scope, true);
document.body.appendChild(imgEl);
};
/**
* Perform some work, checking first that the user is logged in to Google in the client. If they are not logged in then
* an attempt is made to force them to re-login by prompting them to run through the OAuth process again, before doing the
* work.
*
* @function checkGoogleLogin
* @static
* @param config {object} object literal containing success callback
* - onLoggedIn: object literal of form { fn: ..., scope: ... } to be executed if the user is logged in to Google
*
*/
Alfresco.GoogleGlass.checkGoogleLogin = function GGA_checkGoogleLogin(config)
{
Alfresco.GoogleGlass.loadAccountsLogo.call(this, {
onLoad:
{
fn: function GGA_checkGoogleLogin_onLoad()
{
if (Alfresco.logger.isDebugEnabled() )
{
Alfresco.logger.debug("Google accounts logo loaded successfully. Continuing.");
}
config.onLoggedIn.fn.call(config.onLoggedIn.scope);
},
scope: this
},
onError:
{
// Re-start OAuth to force the user to log in
fn: function GGA_checkGoogleLogin_onError()
{
if (Alfresco.logger.isDebugEnabled() )
{
Alfresco.logger.debug("Google accounts logo loaded with errors. Re-requesting OAuth.");
}
Alfresco.GoogleGlass.requestOAuthURL({
onComplete: {
fn: config.onLoggedIn.fn,
scope: config.onLoggedIn.scope
},
override: true
});
},
scope: this
}
});
};
/**
* Start the OAuth process in the client. A popup window is opened using the supplied URL, which should present an appropriate
* authorization screen, and hand back control to the parent window.
*
* When control is received back again the callback supplied in the config will be executed
*
* @method doOAuth
* @static
*
* @param authURL {String} URL to use in the popup to start authorization
* @param config {object} object literal containing success callback
* - onComplete: object literal of form { fn: ..., scope: ... } to be executed when OAuth has completed
*/
Alfresco.GoogleGlass.doOAuth = function GGA_launchOAuth(authURL, config)
{
var returnFn = function(result)
{
if (result)
{
// execute the handler only when the process has completed
config.onComplete.fn.call(config.onComplete.scope);
}
};
/*
* Throw up a prompt to the user telling them they need to reauthorize Alfresco. This prepares them for
* the OAuth popup and allows us to launch the new window without this getting blocked by the browser.
*/
Alfresco.util.PopupManager.displayPrompt(
{
title: Alfresco.util.message("title.googleglass.reAuthorize"),
text: Alfresco.util.message("text.googleglass.reAuthorize"),
noEscape: true,
buttons: [
{
text: Alfresco.util.message("button.ok", this.name),
handler: function GGA_doOAuth_okHandler()
{
this.destroy();
Alfresco.GoogleGlass.onOAuthReturn = returnFn;
/*
* Modal dialogs do not work properly in IE, they are unable to navigate to cross-domain URL such as the return page,
* causing a second popup window to be opened which then does not close
*
* See https://issues.alfresco.com/jira/browse/GOOGLEDOCS-100
*/
if (typeof window.showModalDialog == "function" && !YAHOO.env.ua.ie)
{
var returnVal = window.showModalDialog(authURL, {onOAuthReturn: returnFn}, "dialogwidth:" + OAUTH_WINDOW_WIDTH + ";dialogheight:" + OAUTH_WINDOW_HEIGHT); // only returns on popup close
}
else
{
var popup = window.open(authURL, "GGOAuth", "menubar=no,location=no,resizable=no,scrollbars=yes,status=no,width=" + OAUTH_WINDOW_WIDTH + ",height=" + OAUTH_WINDOW_HEIGHT + ",modal=yes"); // returns straight away
}
}
},
{
text: Alfresco.util.message("button.cancel", this.name),
handler: function GGA_doOAuth_cancelHandler()
{
this.destroy();
},
isDefault: true
}]
});
Alfresco.GoogleGlass.hideMessage.call(this);
};
/**
* Make a request to the repository to get the OAuth URL to be used to authorize against Google Glass, and start the
* OAuth process in the client if required. Normally authorization is performed only if not currently authorized, but
* the override flag can be used to force re-authentication.
*
* @method requestOAuthURL
* @static
*
* @param config {object} object literal containing success callback
* - onComplete: object literal of form { fn: ..., scope: ... } to be executed when OAuth has completed
* - override: {boolean} Normally OAuth will be attempted only if the repository indicates the user is not
* authenticated. Use this flag to force re-authorization regardless of the current state.
*/
Alfresco.GoogleGlass.requestOAuthURL = function GGA_requestOAuthURL(config)
{
if (Alfresco.logger.isDebugEnabled())
{
Alfresco.logger.debug("Checking Google authorization status");
Alfresco.logger.debug("Override status: " + config.override);
}
Alfresco.util.Ajax.jsonGet({
url: Alfresco.constants.PROXY_URI + "googleglass/authurl",
dataObj : {
state: Alfresco.constants.PROXY_URI,
override: "true",
nodeRef: config.nodeRef || ""
},
successCallback: {
fn: function(response) {
if (Alfresco.logger.isDebugEnabled())
{
Alfresco.logger.debug("Authorized: " + response.json.authenticated);
}
if (!response.json.authenticated || config.override == true)
{
if (Alfresco.logger.isDebugEnabled())
{
Alfresco.logger.debug("Authorizing using URL: " + response.json.authURL);
}
// TODO Must pass authurl response through here
Alfresco.GoogleGlass.doOAuth(response.json.authURL, {
onComplete: {
fn: config.onComplete.fn,
scope: config.onComplete.scope
}
/*onComplete: {
fn: function() {
Alfresco.GoogleGlass.requestOAuthURL.call(this); // Recursively call outer function
}
}*/
});
}
else
{
config.onComplete.fn.call(config.onComplete.scope, response);
}
},
scope: this
},
failureCallback: {
fn: function() {
Alfresco.GoogleGlass.showMessage({
text: this.msg("googleglass.actions.authentication.failure"),
displayTime: 2.5,
showSpinner: false
});
},
scope: this
}
});
};
/**
* Make a request to the repository to perform a Google Glass related action
*
* The request is executed via an async call and the status of the reponse is checked. If a 502 response is returned, then
* an attempt is made to re-authorize the repository to Google Glass via OAuth, before the request is re-tried.
*
* @method request
* @static
*
* @param config {object} object literal containing success and failure callbacks
* - successCallback: object literal of form { fn: ..., scope: ... } to be executed when the request succeeds
* - failureCallback: object literal of form { fn: ..., scope: ... } to be executed when the request succeeds
*/
Alfresco.GoogleGlass.request = function GGA_request(config)
{
var success = config.successCallback;
var failure =
{
fn: function(response)
{
if (response.serverResponse.status == 502) // Remote authentication has failed
{
if (Alfresco.logger.isDebugEnabled() )
{
Alfresco.logger.debug("Google Glass request requires authorization but repository does not appear to be authorized. Re-requesting OAuth.");
}
Alfresco.GoogleGlass.requestOAuthURL({
onComplete: {
fn: function() {
Alfresco.GoogleGlass.request.call(this, config); // Recursively call outer function
},
scope: this
},
override: true
});
}
else
{
config.failureCallback.fn.call(config.failureCallback.scope, response);
}
},
scope: this
};
Alfresco.util.Ajax.jsonRequest({
url: config.url,
method: config.method || "GET",
dataObj: config.dataObj,
requestContentType: config.requestContentType || null,
successCallback: success,
failureCallback: failure
});
};
/**
* OAuth return handler - used for returning from OAuth popup.
*
* @method onOAuthReturn
* @static
* @default null
*/
Alfresco.GoogleGlass.onOAuthReturn = null;
})(); | {
"content_hash": "728a7c53000fef80b5ea7de4de4d7fab",
"timestamp": "",
"source": "github",
"line_count": 359,
"max_line_length": 229,
"avg_line_length": 38.128133704735376,
"alnum_prop": 0.5685271770894214,
"repo_name": "jottley/stainedglass",
"id": "897f88d3e78396808c6a1b7aecaab28038a4351a",
"size": "14445",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "stainedglass-share/src/main/resources/META-INF/googleglass/components/documentlibrary/actions-common.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1458"
},
{
"name": "Java",
"bytes": "29737"
},
{
"name": "JavaScript",
"bytes": "19641"
}
],
"symlink_target": ""
} |
#include <cc7tests/CC7Tests.h>
namespace cc7
{
namespace tests
{
const UnitTestCreationInfoList _GetDefaultUnitTestCreationInfoList()
{
UnitTestCreationInfoList list;
// cc7::tests framework tests
CC7_ADD_UNIT_TEST(tt7Testception, list);
CC7_ADD_UNIT_TEST(tt7JSONReaderTests, list);
// cc7 framework tests
CC7_ADD_UNIT_TEST(cc7PlatformTests, list);
CC7_ADD_UNIT_TEST(cc7ByteArrayTests, list);
CC7_ADD_UNIT_TEST(cc7ByteRangeTests, list);
CC7_ADD_UNIT_TEST(cc7Base64Tests, list);
CC7_ADD_UNIT_TEST(cc7HexStringTests, list);
return list;
}
} // cc7::tests
} // cc7 | {
"content_hash": "c5757a6dc0d34f645093cec196e94b4f",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 69,
"avg_line_length": 21.428571428571427,
"alnum_prop": 0.7333333333333333,
"repo_name": "hvge/cc7",
"id": "1024f07bf25056732cd4412be719e9c5c3c2283f",
"size": "1216",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/cc7tests/tests/EmbeddedTestsList.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1666"
},
{
"name": "C++",
"bytes": "244520"
},
{
"name": "Makefile",
"bytes": "4985"
},
{
"name": "Objective-C",
"bytes": "9347"
},
{
"name": "Objective-C++",
"bytes": "5049"
},
{
"name": "Shell",
"bytes": "4867"
}
],
"symlink_target": ""
} |
<?php
namespace Stockbase\Integration\Model\Inventory;
use Magento\CatalogInventory\Api\Data\StockItemInterface;
/**
* Class CombinedStockbaseStockItem
*/
class CombinedStockbaseStockItem implements StockItemInterface
{
/**
* @var StockItemInterface
*/
private $magentoStockItem;
/**
* @var float
*/
private $stockbaseQty;
/**
* CombinedStockbaseStockItem constructor.
* @param StockItemInterface $magentoStockItem
* @param float $stockbaseQty
*/
public function __construct(StockItemInterface $magentoStockItem, $stockbaseQty)
{
$this->magentoStockItem = $magentoStockItem;
$this->stockbaseQty = $stockbaseQty;
}
/**
* {@inheritdoc}
*/
public function __call($name, $arguments)
{
// @codingStandardsIgnoreStart
return call_user_func_array([$this->magentoStockItem, $name], $arguments);
// @codingStandardsIgnoreEnd
}
/**
* {@inheritdoc}
*/
public function getQty()
{
return $this->magentoStockItem->getQty() + $this->stockbaseQty;
}
/**
* {@inheritdoc}
*/
public function setQty($qty)
{
throw new \Exception('Can not set quantity on combined Stockbase stock item.');
}
/**
* {@inheritdoc}
*/
public function getItemId()
{
return $this->magentoStockItem->getItemId();
}
/**
* {@inheritdoc}
*/
public function setItemId($itemId)
{
$this->magentoStockItem->setItemId($itemId);
return $this;
}
/**
* {@inheritdoc}
*/
public function getProductId()
{
return $this->magentoStockItem->getProductId();
}
/**
* {@inheritdoc}
*/
public function setProductId($productId)
{
$this->magentoStockItem->setProductId($productId);
return $this;
}
/**
* {@inheritdoc}
*/
public function getStockId()
{
return $this->magentoStockItem->getStockId();
}
/**
* {@inheritdoc}
*/
public function setStockId($stockId)
{
$this->magentoStockItem->setStockId($stockId);
return $this;
}
/**
* {@inheritdoc}
*/
public function getIsInStock()
{
return $this->magentoStockItem->getIsInStock();
}
/**
* {@inheritdoc}
*/
public function setIsInStock($isInStock)
{
$this->magentoStockItem->setIsInStock($isInStock);
return $this;
}
/**
* {@inheritdoc}
*/
public function getIsQtyDecimal()
{
return $this->magentoStockItem->getIsQtyDecimal();
}
/**
* {@inheritdoc}
*/
public function setIsQtyDecimal($isQtyDecimal)
{
$this->magentoStockItem->setIsQtyDecimal($isQtyDecimal);
return $this;
}
/**
* {@inheritdoc}
*/
public function getShowDefaultNotificationMessage()
{
return $this->magentoStockItem->getShowDefaultNotificationMessage();
}
/**
* {@inheritdoc}
*/
public function getUseConfigMinQty()
{
return $this->magentoStockItem->getUseConfigMinQty();
}
/**
* {@inheritdoc}
*/
public function setUseConfigMinQty($useConfigMinQty)
{
$this->magentoStockItem->setUseConfigMinQty($useConfigMinQty);
return $this;
}
/**
* {@inheritdoc}
*/
public function getMinQty()
{
return $this->magentoStockItem->getMinQty();
}
/**
* {@inheritdoc}
*/
public function setMinQty($minQty)
{
$this->magentoStockItem->setMinQty($minQty);
return $this;
}
/**
* {@inheritdoc}
*/
public function getUseConfigMinSaleQty()
{
return $this->magentoStockItem->getUseConfigMinSaleQty();
}
/**
* {@inheritdoc}
*/
public function setUseConfigMinSaleQty($useConfigMinSaleQty)
{
$this->magentoStockItem->setUseConfigMinSaleQty($useConfigMinSaleQty);
return $this;
}
/**
* {@inheritdoc}
*/
public function getMinSaleQty()
{
return $this->magentoStockItem->getMinSaleQty();
}
/**
* {@inheritdoc}
*/
public function setMinSaleQty($minSaleQty)
{
$this->magentoStockItem->setMinSaleQty($minSaleQty);
return $this;
}
/**
* {@inheritdoc}
*/
public function getUseConfigMaxSaleQty()
{
return $this->magentoStockItem->getUseConfigMaxSaleQty();
}
/**
* {@inheritdoc}
*/
public function setUseConfigMaxSaleQty($useConfigMaxSaleQty)
{
$this->magentoStockItem->setUseConfigMaxSaleQty($useConfigMaxSaleQty);
return $this;
}
/**
* {@inheritdoc}
*/
public function getMaxSaleQty()
{
return $this->magentoStockItem->getMaxSaleQty();
}
/**
* {@inheritdoc}
*/
public function setMaxSaleQty($maxSaleQty)
{
$this->magentoStockItem->setMaxSaleQty($maxSaleQty);
return $this;
}
/**
* {@inheritdoc}
*/
public function getUseConfigBackorders()
{
return $this->magentoStockItem->getUseConfigBackorders();
}
/**
* {@inheritdoc}
*/
public function setUseConfigBackorders($useConfigBackorders)
{
$this->magentoStockItem->setUseConfigBackorders($useConfigBackorders);
return $this;
}
/**
* {@inheritdoc}
*/
public function getBackorders()
{
return $this->magentoStockItem->getBackorders();
}
/**
* {@inheritdoc}
*/
public function setBackorders($backOrders)
{
$this->magentoStockItem->setBackorders($backOrders);
return $this;
}
/**
* {@inheritdoc}
*/
public function getUseConfigNotifyStockQty()
{
return $this->magentoStockItem->getUseConfigNotifyStockQty();
}
/**
* {@inheritdoc}
*/
public function setUseConfigNotifyStockQty($useConfigNotifyStockQty)
{
$this->magentoStockItem->setUseConfigNotifyStockQty($useConfigNotifyStockQty);
return $this;
}
/**
* {@inheritdoc}
*/
public function getNotifyStockQty()
{
return $this->magentoStockItem->getNotifyStockQty();
}
/**
* {@inheritdoc}
*/
public function setNotifyStockQty($notifyStockQty)
{
$this->magentoStockItem->setNotifyStockQty($notifyStockQty);
return $this;
}
/**
* {@inheritdoc}
*/
public function getUseConfigQtyIncrements()
{
return $this->magentoStockItem->getUseConfigQtyIncrements();
}
/**
* {@inheritdoc}
*/
public function setUseConfigQtyIncrements($useConfigQtyIncrements)
{
$this->magentoStockItem->setUseConfigQtyIncrements($useConfigQtyIncrements);
return $this;
}
/**
* {@inheritdoc}
*/
public function getQtyIncrements()
{
return $this->magentoStockItem->getQtyIncrements();
}
/**
* {@inheritdoc}
*/
public function setQtyIncrements($qtyIncrements)
{
$this->magentoStockItem->setQtyIncrements($qtyIncrements);
return $this;
}
/**
* {@inheritdoc}
*/
public function getUseConfigEnableQtyInc()
{
return $this->magentoStockItem->getUseConfigEnableQtyInc();
}
/**
* {@inheritdoc}
*/
public function setUseConfigEnableQtyInc($useConfigEnableQtyInc)
{
$this->magentoStockItem->setUseConfigEnableQtyInc($useConfigEnableQtyInc);
return $this;
}
/**
* {@inheritdoc}
*/
public function getEnableQtyIncrements()
{
return $this->magentoStockItem->getEnableQtyIncrements();
}
/**
* {@inheritdoc}
*/
public function setEnableQtyIncrements($enableQtyIncrements)
{
$this->magentoStockItem->setEnableQtyIncrements($enableQtyIncrements);
return $this;
}
/**
* {@inheritdoc}
*/
public function getUseConfigManageStock()
{
return $this->magentoStockItem->getUseConfigManageStock();
}
/**
* {@inheritdoc}
*/
public function setUseConfigManageStock($useConfigManageStock)
{
$this->magentoStockItem->setUseConfigManageStock($useConfigManageStock);
return $this;
}
/**
* {@inheritdoc}
*/
public function getManageStock()
{
return $this->magentoStockItem->getManageStock();
}
/**
* {@inheritdoc}
*/
public function setManageStock($manageStock)
{
$this->magentoStockItem->setManageStock($manageStock);
return $this;
}
/**
* {@inheritdoc}
*/
public function getLowStockDate()
{
return $this->magentoStockItem->getLowStockDate();
}
/**
* {@inheritdoc}
*/
public function setLowStockDate($lowStockDate)
{
$this->magentoStockItem->setLowStockDate($lowStockDate);
return $this;
}
/**
* {@inheritdoc}
*/
public function getIsDecimalDivided()
{
return $this->magentoStockItem->getIsDecimalDivided();
}
/**
* {@inheritdoc}
*/
public function setIsDecimalDivided($isDecimalDivided)
{
$this->magentoStockItem->setIsDecimalDivided($isDecimalDivided);
return $this;
}
/**
* {@inheritdoc}
*/
public function getStockStatusChangedAuto()
{
return $this->magentoStockItem->getStockStatusChangedAuto();
}
/**
* {@inheritdoc}
*/
public function setStockStatusChangedAuto($stockStatusChangedAuto)
{
$this->magentoStockItem->setStockStatusChangedAuto($stockStatusChangedAuto);
return $this;
}
/**
* {@inheritdoc}
*/
public function getExtensionAttributes()
{
return $this->magentoStockItem->getExtensionAttributes();
}
/**
* {@inheritdoc}
*/
public function setExtensionAttributes(
\Magento\CatalogInventory\Api\Data\StockItemExtensionInterface $extensionAttributes
) {
$this->magentoStockItem->setExtensionAttributes($extensionAttributes);
return $this;
}
}
| {
"content_hash": "11d03df1fde68077cedb08a445a8aaa6",
"timestamp": "",
"source": "github",
"line_count": 518,
"max_line_length": 91,
"avg_line_length": 20.347490347490346,
"alnum_prop": 0.5749525616698292,
"repo_name": "Stockbase-Connect/magento2-module",
"id": "94aae84ebadcc35b015e0c75dd294f4643b310b2",
"size": "10540",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Model/Inventory/CombinedStockbaseStockItem.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2761"
},
{
"name": "PHP",
"bytes": "194597"
}
],
"symlink_target": ""
} |
{% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/checkbox.html" import checkbox %}
{% from "components/page-footer.html" import page_footer %}
{% block service_page_title %}
Edit email reply to address
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">
Edit email reply to address
</h1>
<form method="post">
{{ textbox(
form.email_address,
width='2-3',
safe_error_message=True
) }}
{% if form.is_default.data %}
<p class="form-group">
This is the default reply to address for {{ current_service.name }} emails
</p>
{% else %}
<div class="form-group">
{{ checkbox(form.is_default) }}
</div>
{% endif %}
{{ page_footer(
'Save',
back_link=url_for('.service_email_reply_to', service_id=current_service.id),
back_link_text='Back'
) }}
</form>
{% endblock %}
| {
"content_hash": "32ef7eea6fd5de4e58542d2a53c87ece",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 82,
"avg_line_length": 25.81081081081081,
"alnum_prop": 0.5989528795811518,
"repo_name": "gov-cjwaszczuk/notifications-admin",
"id": "fb0fd6473c3d971caf8afcb55a73964c8af7551b",
"size": "955",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/templates/views/service-settings/email-reply-to/edit.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "62775"
},
{
"name": "HTML",
"bytes": "300104"
},
{
"name": "JavaScript",
"bytes": "33859"
},
{
"name": "Makefile",
"bytes": "9209"
},
{
"name": "Python",
"bytes": "1013002"
},
{
"name": "Shell",
"bytes": "5460"
}
],
"symlink_target": ""
} |
package org.apache.sshd.client.subsystem.sftp.extensions.impl;
import java.io.IOException;
import java.io.StreamCorruptedException;
import java.util.Collection;
import org.apache.sshd.client.subsystem.sftp.RawSftpClient;
import org.apache.sshd.client.subsystem.sftp.SftpClient;
import org.apache.sshd.client.subsystem.sftp.extensions.SpaceAvailableExtension;
import org.apache.sshd.common.subsystem.sftp.SftpConstants;
import org.apache.sshd.common.subsystem.sftp.extensions.SpaceAvailableExtensionInfo;
import org.apache.sshd.common.util.buffer.Buffer;
/**
* @author <a href="mailto:dev@mina.apache.org">Apache MINA SSHD Project</a>
*/
public class SpaceAvailableExtensionImpl extends AbstractSftpClientExtension implements SpaceAvailableExtension {
public SpaceAvailableExtensionImpl(SftpClient client, RawSftpClient raw, Collection<String> extra) {
super(SftpConstants.EXT_SPACE_AVAILABLE, client, raw, extra);
}
@Override
public SpaceAvailableExtensionInfo available(String path) throws IOException {
Buffer buffer = getCommandBuffer(path);
buffer.putString(path);
buffer = checkExtendedReplyBuffer(receive(sendExtendedCommand(buffer)));
if (buffer == null) {
throw new StreamCorruptedException("Missing extended reply data");
}
return new SpaceAvailableExtensionInfo(buffer);
}
}
| {
"content_hash": "26221aeea73bef57d4b4cfbed61a8677",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 113,
"avg_line_length": 38.416666666666664,
"alnum_prop": 0.7722342733188721,
"repo_name": "landro/mina-sshd",
"id": "52807e515f0c7e1ccac449c1944b063547741c8f",
"size": "2184",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/impl/SpaceAvailableExtensionImpl.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "6194"
},
{
"name": "HTML",
"bytes": "5769"
},
{
"name": "Java",
"bytes": "3133019"
},
{
"name": "Shell",
"bytes": "13910"
}
],
"symlink_target": ""
} |
package com.hpe.caf.services.admin;
import com.google.gson.Gson;
import com.hpe.caf.services.configuration.AppConfigProvider;
import com.hpe.caf.services.db.client.DatabaseConnectionProvider;
import com.hpe.caf.util.rabbitmq.RabbitUtil;
import com.rabbitmq.client.Channel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.sql.Connection;
import java.sql.Statement;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeoutException;
public class HealthCheck extends HttpServlet
{
private final static Logger LOG = LoggerFactory.getLogger(HealthCheck.class);
@Override
public void doGet(final HttpServletRequest req, final HttpServletResponse res) throws IOException
{
// Construct response payload.
final Map<String, Map<String, String>> statusResponseMap = new HashMap<>();
// Health check that the DB and RabbitMQ can be contacted
final boolean isDBHealthy = performDBHealthCheck(statusResponseMap);
final boolean isRabbitMQHealthy = performRabbitMQHealthCheck(statusResponseMap);
final boolean isHealthy = isDBHealthy && isRabbitMQHealthy;
final Gson gson = new Gson();
final String responseBody = gson.toJson(statusResponseMap);
// Get response body bytes.
final byte[] responseBodyBytes = responseBody.getBytes(StandardCharsets.UTF_8);
// Set content type and length.
res.setContentType("application/json");
res.setContentLength(responseBodyBytes.length);
// Add CacheControl header to specify directives for caching mechanisms.
res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
// Set status code.
if (isHealthy) {
res.setStatus(200);
} else {
res.setStatus(503);
}
// Output response body.
try (ServletOutputStream out = res.getOutputStream())
{
out.write(responseBodyBytes);
out.flush();
}
}
private boolean performRabbitMQHealthCheck(final Map<String, Map<String, String>> statusResponseMap) throws IOException
{
LOG.debug("RabbitMQ Health Check: Starting...");
final com.rabbitmq.client.Connection conn;
final Channel channel;
// Attempt to create a connection and channel to RabbitMQ. If an error occurs update the statueResponseMap and
// return.
try {
conn = createConnection();
channel = conn.createChannel();
} catch (IOException | TimeoutException e) {
LOG.error("RabbitMQ Health Check: Unhealthy, " + e.toString());
return updateStatusResponseWithHealthOfComponent(statusResponseMap, false, e.toString(), "queue");
}
// Attempt to create a open a connection and channel to RabbitMQ. If an error occurs update the
// statueResponseMap and return.
try {
if (!conn.isOpen()) {
LOG.error("RabbitMQ Health Check: Unhealthy, unable to open connection");
return updateStatusResponseWithHealthOfComponent(statusResponseMap, false,
"Attempt to open connection to RabbitMQ failed", "queue");
} else if (!channel.isOpen()) {
LOG.error("RabbitMQ Health Check: Unhealthy, unable to open channel");
return updateStatusResponseWithHealthOfComponent(statusResponseMap, false,
"Attempt to open channel to RabbitMQ failed", "queue");
}
} catch (final Exception e) {
LOG.error("RabbitMQ Health Check: Unhealthy, " + e.toString());
return updateStatusResponseWithHealthOfComponent(statusResponseMap, false, e.toString(), "queue");
} finally {
conn.close();
}
// There where no issues in attempting to create and open a connection and channel to RabbitMQ.
return updateStatusResponseWithHealthOfComponent(statusResponseMap, true, null, "queue");
}
private static boolean updateStatusResponseWithHealthOfComponent(
final Map<String, Map<String, String>> statusResponseMap, final boolean isHealthy, final String message,
final String component)
{
final Map<String, String> healthMap = new HashMap<>();
if (isHealthy) {
healthMap.put("healthy", "true");
} else {
healthMap.put("healthy", "false");
}
if (message != null) {
healthMap.put("message", message);
}
statusResponseMap.put(component, healthMap);
return isHealthy;
}
private static com.rabbitmq.client.Connection createConnection() throws IOException, TimeoutException
{
return RabbitUtil.createRabbitConnection(
System.getenv("CAF_RABBITMQ_HOST"),
Integer.parseInt(System.getenv("CAF_RABBITMQ_PORT")),
System.getenv("CAF_RABBITMQ_USERNAME"),
System.getenv("CAF_RABBITMQ_PASSWORD"));
}
private boolean performDBHealthCheck(final Map<String, Map<String, String>> statusResponseMap)
{
LOG.debug("Database Health Check: Starting...");
try (final Connection conn = DatabaseConnectionProvider.getConnection(
AppConfigProvider.getAppConfigProperties())) {
LOG.debug("Database Health Check: Attempting to Contact Database");
final Statement stmt = conn.createStatement();
stmt.execute("SELECT 1");
LOG.debug("Database Health Check: Healthy");
return updateStatusResponseWithHealthOfComponent(statusResponseMap, true, null, "database");
} catch (final Exception e) {
LOG.error("Database Health Check: Unhealthy : " + e.toString());
return updateStatusResponseWithHealthOfComponent(statusResponseMap, false, e.toString(), "database");
}
}
}
| {
"content_hash": "d4515c6eef2c0aad9e78c8d0529bacc1",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 123,
"avg_line_length": 40.86842105263158,
"alnum_prop": 0.6633934320669672,
"repo_name": "JobService/job-service",
"id": "11bfde01b9f2aa369d7322420003e928ee9490f6",
"size": "6838",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "job-service-admin/src/main/java/com/hpe/caf/services/admin/HealthCheck.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "881"
},
{
"name": "Java",
"bytes": "782078"
},
{
"name": "JavaScript",
"bytes": "4377"
},
{
"name": "Limbo",
"bytes": "12424"
},
{
"name": "PLpgSQL",
"bytes": "99900"
},
{
"name": "Python",
"bytes": "7718"
},
{
"name": "Shell",
"bytes": "10324"
}
],
"symlink_target": ""
} |
iD.ui.Splash = function(context) {
return function(selection) {
if (context.storage('sawSplash'))
return;
context.storage('sawSplash', true);
var modal = iD.ui.modal(selection);
modal.select('.modal')
.attr('class', 'modal-splash modal col6');
var introModal = modal.select('.content')
.append('div')
.attr('class', 'fillL');
introModal.append('div')
.attr('class','modal-section cf')
.append('h3').text(t('splash.welcome'));
introModal.append('div')
.attr('class','modal-section')
.append('p')
.html(t('splash.text', {
version: iD.version,
website: '<a href="http://ideditor.com/">ideditor.com</a>',
github: '<a href="https://github.com/openstreetmap/iD">github.com</a>'
}));
var buttons = introModal.append('div').attr('class', 'modal-actions cf');
buttons.append('button')
.attr('class', 'col6 walkthrough')
.text(t('splash.walkthrough'))
.on('click', function() {
d3.select(document.body).call(iD.ui.intro(context));
modal.close();
});
buttons.append('button')
.attr('class', 'col6 start')
.text(t('splash.start'))
.on('click', modal.close);
modal.select('button.close').attr('class','hide');
};
};
| {
"content_hash": "e9f653fdba83c5d5399feb0e39564490",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 86,
"avg_line_length": 31.145833333333332,
"alnum_prop": 0.5036789297658862,
"repo_name": "daumann/chronas-application",
"id": "72385ed4afd70e4b65671e96027bdf356d293360",
"size": "1495",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "umap/static/js/id/ui/splash.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "341963"
},
{
"name": "HTML",
"bytes": "204199"
},
{
"name": "JavaScript",
"bytes": "8777866"
},
{
"name": "Python",
"bytes": "31031"
},
{
"name": "Shell",
"bytes": "114"
}
],
"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 (1.8.0_60) on Tue Aug 25 11:39:37 BST 2015 -->
<title>All Classes</title>
<meta name="date" content="2015-08-25">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<h1 class="bar">All Classes</h1>
<div class="indexContainer">
<ul>
<li><a href="tradingstrategy/BaseTradingStrategy.html" title="class in tradingstrategy">BaseTradingStrategy</a></li>
<li><a href="dataobjects/DailyInput.html" title="class in dataobjects">DailyInput</a></li>
<li><a href="game/DailyOutput.html" title="class in game">DailyOutput</a></li>
<li><a href="dataobjects/DailyTrades.html" title="class in dataobjects">DailyTrades</a></li>
<li><a href="game/TradingManager.html" title="class in game">TradingManager</a></li>
</ul>
</div>
</body>
</html>
| {
"content_hash": "418ccd88c3a5129fd946b688e134edec",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 116,
"avg_line_length": 43.391304347826086,
"alnum_prop": 0.7034068136272545,
"repo_name": "tpkelly/Hackathon",
"id": "a7f1e832f67e47c39a16a3ed257c5181994cc702",
"size": "998",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/allclasses-noframe.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "976"
},
{
"name": "HTML",
"bytes": "783"
},
{
"name": "Java",
"bytes": "5276"
},
{
"name": "JavaScript",
"bytes": "74306"
}
],
"symlink_target": ""
} |
package ru.otus.l42;
import org.junit.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import static org.junit.Assert.*;
/**
* 1
* Created by tully.
*/
public class LotteryMachineTest {
LotteryMachine lotteryMachine;
@BeforeClass
public static void beforeClass() {
System.out.println("Before all LotteryMachineTest tests");
}
//before() is overridden in sub class
@Before
//public void beforeLotteryMachineTest() {
public void before() {
System.out.println("Before LotteryMachineTest");
lotteryMachine = new LotteryMachine(5);
}
@After
public void afterLotteryMachineTest() {
System.out.println("After LotteryMachineTest");
lotteryMachine.dispose();
}
@AfterClass
public static void afterClass() {
System.out.println("After all LotteryMachineTest tests");
}
@Test(timeout = 10)
public void oneEmail() throws InterruptedException {
LotteryMachine machine = new LotteryMachine(2);
List<String> result = machine.draw(Collections.singletonList("test"));
Assert.assertEquals(1, result.size());
}
@Ignore("todo: 13131")
@Test(timeout = 100)
public void fiveEmails() {
List<String> result = lotteryMachine
.draw(Arrays.asList("0", "1", "2", "3", "4"));
assertEquals(5, result.size());
Assert.assertTrue(result.contains("0"));
Assert.assertTrue(result.contains("1"));
Assert.assertTrue(result.contains("2"));
Assert.assertTrue(result.contains("3"));
Assert.assertTrue(result.contains("4"));
}
@Test(expected = NullPointerException.class)
public void NPETest() {
List<String> result = lotteryMachine.setSeed(100500)
.draw(null);
Assert.assertEquals(0, result.size());
}
}
| {
"content_hash": "84b6ef751fc55e069745f1d02eeac7c3",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 78,
"avg_line_length": 26.23611111111111,
"alnum_prop": 0.6384330333509793,
"repo_name": "vitaly-chibrikov/otus_java_2017_06",
"id": "33e3568e1d872c3a9eed783f4c888ed164137a34",
"size": "1889",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "L4.2/src/test/java/ru/otus/l42/LotteryMachineTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "13227"
},
{
"name": "Java",
"bytes": "348805"
},
{
"name": "JavaScript",
"bytes": "1886"
},
{
"name": "Prolog",
"bytes": "306"
},
{
"name": "Shell",
"bytes": "1794"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<!-- Latest compiled and minified CSS -->
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> -->
<link href="dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="SignUp.css">
<!-- Optional theme -->
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"> -->
<!-- Latest compiled and minified JavaScript -->
<!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> -->
<title></title>
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="index.html"><span class="glyphicon glyphicon-home" aria-hidden="true"></span></a>
</div>
</div>
</nav>
<div class="page-header">
<h1>Sign up for UPS EMS</h1>
<div class="container">
<form class="well span8" role="form">
<div class="row">
<div class="col-xs-12">
<!-- Username -->
<div class="form-group">
<input class="form-control" placeholder="Username" type="text">
</div>
<!-- Password -->
<div class="form-group">
<input class="form-control" placeholder="Password" type="password">
</div>
<!-- Confirm Password -->
<div class="form-group">
<input class="form-control" placeholder="Confirm Password" type="password">
</div>
<!-- First Name & Last name -->
<div class="form-group">
<div class="row">
<div class="col-xs-6">
<input class="form-control" placeholder="First Name" type="text">
</div>
<div class="col-xs-6">
<input class="form-control" placeholder="Last Name" type="text">
</div>
</div>
</div>
</div>
<!-- Email -->
<div class="form-group">
<input class="form-control" placeholder="Email address" type="text">
</div>
<!-- Student ID -->
<div class="form-group">
<input class="form-control" placeholder="Student ID" type="text">
</div>
<!-- Gender buttons -->
<div class="form-group">
<label class="col-xs-12 col-form-label">Gender</label>
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-info">
<input type="radio" name="options" id="male"> Male
</label>
<label class="btn btn-info">
<input type="radio" name="options" id="female"> Female
</label>
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-info">
<input type="radio" name="options" id="other"> Other
</label>
</div>
</div>
</div>
<!-- Faculty chooser -->
<div class="form-group row">
<label class="col-xs-12 col-form-label">Faculty</label>
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-info">
<input type="radio" name="options" id="arts"> Arts
</label>
<label class="btn btn-info">
<input type="radio" name="options" id="science"> Science
</label>
<label class="btn btn-info">
<input type="radio" name="options" id="commerce"> Commerce
</label>
<label class="btn btn-info">
<input type="radio" name="options" id="eng/it"> Engineering / IT
</label>
<label class="btn btn-info">
<input type="radio" name="options" id="law"> Law
</label>
</div>
</div>
<!-- Address thing -->
<div class="form-group">
<input class="form-control" placeholder="Your Street Address, City, State, and Country" type="text">
<p class="help-block">E.g "1/45 John St, Lane Cove, NSW Australia"</p>
</div>
<div class="form-group row">
<button class="btn btn-lg btn-info" type="submit">Submit</button>
</div>
</div>
</form>
</div>
</body>
</html> | {
"content_hash": "c756bfbe401a31ad74c85bb33643a238",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 223,
"avg_line_length": 42.29661016949152,
"alnum_prop": 0.5217391304347826,
"repo_name": "racheldowavic/w10a_project",
"id": "77d39ae6b08c7bedd81aacf78d014782cfaa583b",
"size": "4991",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SignUp copy.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "12314"
},
{
"name": "CSS",
"bytes": "257625"
},
{
"name": "HTML",
"bytes": "79727"
},
{
"name": "Java",
"bytes": "276400"
},
{
"name": "JavaScript",
"bytes": "228214"
},
{
"name": "PowerShell",
"bytes": "1016"
}
],
"symlink_target": ""
} |
ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
neutron_installed=$(echo "import neutron" | python 2>/dev/null ; echo $?)
# Neutron branch to be used
BRANCH_NAME=master
set -e
CONSTRAINTS_FILE=$1
shift
install_cmd="pip install"
if [ $CONSTRAINTS_FILE != "unconstrained" ]; then
install_cmd="$install_cmd -c$CONSTRAINTS_FILE"
fi
if [ $neutron_installed -eq 0 ]; then
echo "ALREADY INSTALLED" > /tmp/tox_install.txt
echo "Neutron already installed; using existing package"
elif [ -x "$ZUUL_CLONER" ]; then
echo "ZUUL CLONER" > /tmp/tox_install.txt
cwd=$(/bin/pwd)
cd /tmp
$ZUUL_CLONER --cache-dir \
/opt/git \
--branch $BRANCH_NAME \
https://git.openstack.org \
openstack/neutron
cd openstack/neutron
$install_cmd -e .
cd "$cwd"
else
echo "PIP HARDCODE" > /tmp/tox_install.txt
$install_cmd -U -egit+https://git.openstack.org/openstack/neutron.git@$BRANCH_NAME#egg=neutron
fi
$install_cmd -U $*
exit $?
| {
"content_hash": "ae04be7c0cfe52c467abdad21a14b523",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 98,
"avg_line_length": 26.16216216216216,
"alnum_prop": 0.6663223140495868,
"repo_name": "openstack/networking-nec",
"id": "d34cf233691226593e88cec0b418b108ec5222db",
"size": "1451",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tools/tox_install.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Mako",
"bytes": "431"
},
{
"name": "Python",
"bytes": "387801"
},
{
"name": "Shell",
"bytes": "8526"
}
],
"symlink_target": ""
} |
% MATLAB wrapper for the X6 driver.
%
% Usage notes: The channelizer creates multiple data streams per physical
% input channel. These are indexed by a 3-parameter label (a,b,c), where a
% is the 1-indexed physical channel, b is the 0-indexed virtual channel
% (b=0 is the raw stream, b>1 are demodulated streams, and c indicates
% demodulated (c=0) or demodulated and integrated (c = 1).
% Original authors: Blake Johnson and Colm Ryan
% Date: August 25, 2014
% Copyright 2014 Raytheon BBN Technologies
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
classdef X6 < hgsetget
properties
samplingRate = 1e9;
triggerSource
reference
digitizerMode
deviceID = 0;
enabledStreams = {} %keep track of enabled streams so we can transfer them all
dataTimer
nbrSegments
recordLength
nbrWaveforms
nbrRoundRobins
end
properties(Access = private)
lastBufferTimeStamp
end
properties(Constant)
LIBRARY_PATH = '../../build/';
DSP_WB_OFFSET = [hex2dec('2000'), hex2dec('2100')];
SPI_ADDRS = containers.Map({'adc0', 'adc1', 'dac0', 'dac1'}, {16, 18, 144, 146});
end
events
DataReady
end
methods
function obj = X6()
X6.load_library();
obj.set_debug_level(4);
end
function x6_call(obj, func, varargin)
% Make void call to the library
status = calllib('libx6', func, obj.deviceID, varargin{:});
X6.check_status(status);
end
function val = x6_getter(obj, func, varargin)
% Make a getter call to the library passing and returning a pointer
[status, val] = calllib('libx6', func, obj.deviceID, varargin{:}, 0);
X6.check_status(status);
end
function val = x6_channel_getter(obj, func, varargin)
% Specialized getter for API's that also take a ChannelTuple pointer
[status, ~, val] = calllib('libx6', func, obj.deviceID, varargin{:}, 0);
X6.check_status(status);
end
function connect(obj, id)
if ischar(id)
id = str2double(id);
end
obj.deviceID = id;
x6_call(obj, 'connect_x6');
end
function disconnect(obj)
x6_call(obj, 'disconnect_x6');
end
function delete(obj)
try
disconnect(obj);
catch
end
if ~isempty(obj.dataTimer)
delete(obj.dataTimer);
end
end
function init(obj)
x6_call(obj, 'initX6');
end
function val = get.samplingRate(obj)
val = x6_getter(obj, 'get_sampleRate');
end
function val = get.triggerSource(obj)
val = x6_getter(obj, 'get_trigger_source');
end
function set.triggerSource(obj, source)
x6_call(obj, 'set_trigger_source', source)
end
function set.reference(obj, ref)
%If passed simple `internal` or `external` map to enum
map = containers.Map({'external', 'internal'}, {'EXTERNAL_REFERENCE', 'INTERNAL_REFERENCE'});
if isKey(map, ref)
ref = map(ref);
end
x6_call(obj, 'set_reference_source', ref);
end
function val = get.reference(obj)
val = x6_getter(obj, 'get_reference_source');
end
function set.digitizerMode(obj, dig_mode)
x6_call(obj, 'set_digitizer_mode', dig_mode);
end
function val = get.digitizerMode(obj)
val = x6_getter(obj, 'get_digitizer_mode');
end
function enable_stream(obj, a, b, c)
x6_call(obj, 'enable_stream', a, b, c)
obj.enabledStreams{end+1} = [a,b,c];
end
function disable_stream(obj, a, b, c)
x6_call(obj, 'disable_stream', a, b, c);
% remove the stream from the enabledStreams list
idx = find(cellfun(@(x) isequal(x, [a,b,c]), obj.enabledStreams));
if ~isempty(idx)
obj.enabledStreams(idx) = [];
end
end
function set_averager_settings(obj, recordLength, nbrSegments, waveforms, roundRobins)
x6_call(obj, 'set_averager_settings', recordLength, nbrSegments, waveforms, roundRobins);
obj.recordLength = recordLength;
obj.nbrSegments = nbrSegments;
obj.nbrWaveforms = waveforms;
obj.nbrRoundRobins = roundRobins;
end
function acquire(obj)
x6_call(obj, 'acquire');
pause(0.75); % makes sure that the digitizers are ready before starting acquisition
% Since we cannot easily pass callbacks to the C library to fire
% on new data arriving we resort to polling on a timer
% We also fire on stopping to catch any last data
recsPerRoundRobin = obj.nbrSegments*obj.nbrWaveforms;
function do_poll(~,~)
nRecords = x6_getter(obj, 'get_num_new_records');
if nRecords == 0
return
end
obj.lastBufferTimeStamp = tic();
% in digitizer mode, insist on collecting a complete round robin
if strcmp(obj.digitizerMode, 'DIGITIZER') && nRecords < recsPerRoundRobin
return
end
notify(obj, 'DataReady');
end
% grab initial timestamp for calculating timeout
obj.lastBufferTimeStamp = tic();
obj.dataTimer = timer('TimerFcn', @do_poll, 'StopFcn', @(~,~) notify(obj, 'DataReady'), 'Period', 0.1, 'ExecutionMode', 'fixedSpacing');
start(obj.dataTimer);
end
function val = wait_for_acquisition(obj, timeout)
val = -1;
while toc(obj.lastBufferTimeStamp) < timeout
if ~x6_getter(obj, 'get_is_running')
val = 0;
break
end
pause(0.1)
end
if val==-1
warning('X6:TIMEOUT', 'X6 timed out while waiting for acquisition');
end
stop(obj);
end
function stop(obj)
x6_call(obj, 'stop');
if ~isempty(obj.dataTimer)
stop(obj.dataTimer);
delete(obj.dataTimer);
obj.dataTimer = [];
end
end
function data = transfer_waveform(obj, channel)
% returns a structure of streams associated with the given
% channel
data = struct();
for stream = obj.enabledStreams
if stream{1}(1) == channel
s = struct('a', stream{1}(1), 'b', stream{1}(2), 'c', stream{1}(3));
data.(['s' sprintf('%d',stream{1})]) = obj.transfer_stream(s);
end
end
end
function wf = transfer_stream(obj, channels)
% expects channels to be a vector of structs of the form:
% struct('a', X, 'b', Y, 'c', Z)
% when passed a single channel struct, returns the corresponding waveform
% when passed multiple channels, returns the correlation of the channels
bufSize = x6_channel_getter(obj, 'get_buffer_size', channels, length(channels));
% In digitizer mode we want integer number of round robins
recLength = x6_channel_getter(obj, 'get_record_length', channels);
samplesPerRR = recLength*obj.nbrWaveforms*obj.nbrSegments;
if strcmp(obj.digitizerMode, 'DIGITIZER')
bufSize = samplesPerRR * idivide(bufSize, samplesPerRR);
end
if bufSize == 0
wf = [];
return
end
wfPtr = libpointer('doublePtr', zeros(bufSize, 1, 'double'));
x6_call(obj, 'transfer_stream', channels, length(channels), wfPtr, bufSize);
if channels(1).b == 0 && channels(1).c == 0 % physical channel
wf = wfPtr.Value;
else
% For complex data real/imag are interleaved
wf = wfPtr.Value(1:2:end) + 1i*wfPtr.Value(2:2:end);
recLength = recLength/2;
samplesPerRR = samplesPerRR/2;
end
if strcmp(obj.digitizerMode, 'DIGITIZER')
rrsPerBuf = length(wf)/samplesPerRR;
wf = reshape(wf, recLength, obj.nbrWaveforms, obj.nbrSegments, rrsPerBuf);
else
wf = reshape(wf, recLength, obj.nbrSegments);
end
end
function wf = transfer_stream_variance(obj, channels)
% expects channels to be a vector of structs of the form:
% struct('a', X, 'b', Y, 'c', Z)
bufSize = x6_channel_getter(obj, 'get_variance_buffer_size', channels, length(channels));
wfPtr = libpointer('doublePtr', zeros(bufSize, 1, 'double'));
x6_call(obj, 'transfer_variance', channels, length(channels), wfPtr, bufSize);
wf = struct('real', [], 'imag', [], 'prod', []);
if channels(1).b == 0 && channels(1).c == 0 % physical channel
wf.real = wfPtr.Value;
wf.imag = zeros(length(wfPtr.Value), 1);
wf.prod = zeros(length(wfPtr.Value), 1);
else
wf.real = wfPtr.Value(1:3:end);
wf.imag = wfPtr.Value(2:3:end);
wf.prod = wfPtr.Value(3:3:end);
end
if channels(1).c == 0 % non-results streams should be reshaped
wf.real = reshape(wf.real, length(wf.real)/obj.nbrSegments, obj.nbrSegments);
wf.imag = reshape(wf.imag, length(wf.imag)/obj.nbrSegments, obj.nbrSegments);
wf.prod = reshape(wf.prod, length(wf.prod)/obj.nbrSegments, obj.nbrSegments);
end
end
function write_register(obj, addr, offset, data)
x6_call(obj, 'write_register', addr, offset, data);
end
function val = read_register(obj, addr, offset)
val = x6_getter(obj, 'read_register', addr, offset);
end
function write_spi(obj, chip, addr, data)
% read flag is low so just address
val = bitshift(addr, 16) + data;
obj.write_register(hex2dec('0800'), obj.SPI_ADDRS(chip), val);
end
function val = read_spi(obj, chip, addr)
% read flag is high
val = bitshift(1, 28) + bitshift(addr, 16);
obj.write_register(hex2dec('0800'), obj.SPI_ADDRS(chip), val);
val = int32(obj.read_register(hex2dec('0800'), obj.SPI_ADDRS(chip)+1));
assert(bitget(val, 32) == 1, 'Oops! Read valid flag was not set!');
end
function val = get_logic_temperature(obj)
val = x6_getter(obj, 'get_logic_temperature');
end
function [ver, ver_str, git_sha1, build_timestamp] = get_firmware_version(obj)
[status, ver, git_sha1, build_timestamp, ver_str] = calllib('libx6', 'get_firmware_version', obj.deviceID, 0, 0, 0, blanks(64));
X6.check_status(status);
end
function set_nco_frequency(obj, a, b, freq)
x6_call(obj, 'set_nco_frequency', a, b, freq);
end
function val = get_nco_frequency(obj, a, b)
val = x6_getter(obj, 'get_nco_frequency', a, b);
end
function write_kernel(obj, a, b, c, kernel)
% The C library takes a double complex* but we're faking a double* so pack the data manually
packedKernel = [real(kernel(:))'; imag(kernel(:))'];
x6_call(obj, 'write_kernel', a, b, c, packedKernel(:), numel(packedKernel)/2);
end
function val = read_kernel(obj, a, b, c, addr)
% The C library takes a double complex* but we're faking a double*
ptr = libpointer('doublePtr', zeros(2));
x6_call(obj, 'read_kernel', a, b, c, addr-1, ptr);
val = ptr.Value(1) + 1i*ptr.Value(2);
end
function set_kernel_bias(obj, a, b, c, bias)
% The C library takes a double complex* but we're faking a double* so pack the data manually
packed_bias = [real(bias); imag(bias)];
x6_call(obj, 'set_kernel_bias', a, b, c, packed_bias);
end
function val = get_kernel_bias(obj, a, b, c)
% The C library takes a double complex* but we're faking a double*
ptr = libpointer('doublePtr', zeros(2));
x6_call(obj, 'get_kernel_bias', a, b, c, ptr);
val = ptr.Value(1) + 1i*ptr.Value(2);
end
function set_threshold(obj, a, c, threshold)
x6_call(obj, 'set_threshold', a, c, threshold);
end
function val = get_threshold(obj, a, c)
val = x6_getter(obj, 'get_threshold', a, c);
end
function set_threshold_invert(obj, a, c, invert)
x6_call(obj, 'set_threshold_invert', a, c, invert);
end
function val = get_threshold_invert(obj, a, c)
val = logical(x6_getter(obj, 'get_threshold_invert', a, c));
end
function write_pulse_waveform(obj, pg, waveform)
x6_call(obj, 'write_pulse_waveform', pg, waveform, length(waveform));
end
function val = read_pulse_waveform(obj, pg, addr)
val = x6_getter(obj, 'read_pulse_waveform', pg, addr-1);
end
function val = get_input_channel_enable(obj, chan)
val = x6_getter(obj, 'get_input_channel_enable', chan-1);
end
function set_input_channel_enable(obj, chan, enable)
x6_call(obj, 'set_input_channel_enable', chan-1, enable);
end
function val = get_output_channel_enable(obj, chan)
val = x6_getter(obj, 'get_output_channel_enable', chan-1);
end
function set_output_channel_enable(obj, chan, enable)
x6_call(obj, 'set_output_channel_enable', chan-1, enable);
end
% Instrument meta-setter that sets all parameters
function setAll(obj, settings)
fields = fieldnames(settings);
for tmpName = fields'
switch tmpName{1}
case 'horizontal'
% Skip for now. Eventually this is where you'd want
% to pass thru trigger delay
case 'averager'
obj.set_averager_settings( ...
settings.averager.recordLength, ...
settings.averager.nbrSegments, ...
settings.averager.nbrWaveforms, ...
settings.averager.nbrRoundRobins);
case 'channels'
for channel = fieldnames(settings.channels)'
obj.set_channel_settings( channel{1}, settings.channels.(channel{1}) );
end
case 'enableRawStreams'
if settings.enableRawStreams
obj.enable_stream(1, 0, 0);
obj.enable_stream(2, 0, 0);
end
otherwise
if ismember(tmpName{1}, methods(obj))
feval(['obj.' tmpName{1}], settings.(tmpName{1}));
elseif ismember(tmpName{1}, properties(obj))
obj.(tmpName{1}) = settings.(tmpName{1});
end
end
end
end
function set_channel_settings(obj, label, settings)
% channel labels are of the form 'sAB'
a = str2double(label(2));
b = str2double(label(3));
if settings.enableDemodStream
obj.enable_stream(a, b, 0);
else
obj.disable_stream(a, b, 0);
end
if settings.enableDemodResultStream
obj.enable_stream(a, b, 1);
else
obj.disable_stream(a, b, 1);
end
if settings.enableRawResultStream
obj.enable_stream(a, 0, b)
else
obj.disable_stream(a, 0, b)
end
obj.set_nco_frequency(a, b, settings.IFfreq);
if ~isempty(settings.demodKernel)
%Try to decode base64 encoded kernels
if (ischar(settings.demodKernel))
tmp = typecast(org.apache.commons.codec.binary.Base64.decodeBase64(uint8(settings.demodKernel)), 'uint8');
tmp = typecast(tmp, 'double');
settings.demodKernel = tmp(1:2:end) + 1j*tmp(2:2:end);
end
obj.write_kernel(a, b, 1, settings.demodKernel);
end
if ~isempty(settings.demodKernelBias)
%Try to decode base64 encoded kernels
if (ischar(settings.demodKernelBias))
tmp = typecast(org.apache.commons.codec.binary.Base64.decodeBase64(uint8(settings.demodKernelBias)), 'uint8');
tmp = typecast(tmp, 'double');
settings.demodKernelBias = tmp(1) + 1j*tmp(2);
end
set_kernel_bias(obj, a, b, 1, settings.demodKernelBias);
else
set_kernel_bias(obj, a, b, 1, 0)
end
if ~isempty(settings.rawKernel)
%Try to decode base64 encoded kernels
if (ischar(settings.rawKernel))
tmp = typecast(org.apache.commons.codec.binary.Base64.decodeBase64(uint8(settings.rawKernel)), 'uint8');
tmp = typecast(tmp, 'double');
settings.rawKernel = tmp(1:2:end) + 1j*tmp(2:2:end);
end
obj.write_kernel(a, 0, b, settings.rawKernel);
end
if ~isempty(settings.rawKernelBias)
%Try to decode base64 encoded kernels
if (ischar(settings.rawKernelBias))
tmp = typecast(org.apache.commons.codec.binary.Base64.decodeBase64(uint8(settings.rawKernelBias)), 'uint8');
tmp = typecast(tmp, 'double');
settings.rawKernelBias = tmp(1) + 1j*tmp(2);
end
set_kernel_bias(obj, a, 0, b, settings.rawKernelBias);
else
set_kernel_bias(obj, a, 0, b, 0)
end
obj.set_threshold(a, b, settings.threshold);
obj.set_threshold_invert(a, b, settings.thresholdInvert);
end
end
methods (Static)
function load_library()
% Helper functtion to load the platform dependent library
switch computer()
case 'PCWIN64'
libfname = 'libx6.dll';
libheader = 'libx6.matlab.h';
%protoFile = @obj.libx6;
otherwise
error('Unsupported platform.');
end
% build library path and load it if necessary
if ~libisloaded('libx6')
myPath = fileparts(mfilename('fullpath'));
[~,~] = loadlibrary(fullfile(myPath, X6.LIBRARY_PATH, libfname), fullfile(myPath, libheader));
end
end
function check_status(status)
X6.load_library();
assert(strcmp(status, 'X6_OK'),...
'X6:Fail',...
'X6 library call failed with status: %s', calllib('libx6', 'get_error_msg', status));
end
function val = num_devices()
X6.load_library();
[status, val] = calllib('libx6', 'get_num_devices', 0);
X6.check_status(status);
end
function set_debug_level(level)
% sets logging level in libx6.log
% level = {logERROR=0, logWARNING, logINFO, logDEBUG, logDEBUG1, logDEBUG2, logDEBUG3, logDEBUG4}
calllib('libx6', 'set_logging_level', level);
end
end
end
| {
"content_hash": "a7784f22ab0ab8aef399f87cc47b70ba",
"timestamp": "",
"source": "github",
"line_count": 529,
"max_line_length": 148,
"avg_line_length": 39.338374291115315,
"alnum_prop": 0.5380105718404613,
"repo_name": "BBN-Q/libx6",
"id": "970c3d08931e35e378ed958f4d373290f466b014",
"size": "20810",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/matlab/X6.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "686"
},
{
"name": "C++",
"bytes": "119772"
},
{
"name": "CMake",
"bytes": "4556"
},
{
"name": "Julia",
"bytes": "5142"
},
{
"name": "MATLAB",
"bytes": "48618"
},
{
"name": "Python",
"bytes": "21435"
},
{
"name": "Shell",
"bytes": "477"
}
],
"symlink_target": ""
} |
require "gerencianet"
require "date"
require_relative "../../credentials"
options = {
client_id: CREDENTIALS::CLIENT_ID,
client_secret: CREDENTIALS::CLIENT_SECRET,
sandbox: CREDENTIALS::SANDBOX
}
expireAt = Date.today + 3
params = {
id: 1000
}
body = {
billet_discount: 0,
card_discount: 0,
message: "",
expire_at: expireAt.strftime,
request_delivery_address: false,
payment_method: "all"
}
gerencianet = Gerencianet.new(options)
puts gerencianet.update_charge_link(params: params, body: body)
| {
"content_hash": "39206a81596cec7ef93507d95cc03ace",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 63,
"avg_line_length": 19.22222222222222,
"alnum_prop": 0.7090558766859345,
"repo_name": "gerencianet/gn-api-sdk-ruby",
"id": "4041ee43335554ad0129541a167f8aa93b7750f6",
"size": "519",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/default/charge/update_charge_link.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "13642"
},
{
"name": "Shell",
"bytes": "115"
}
],
"symlink_target": ""
} |
#if defined (JUCE_AUDIO_BASICS_H_INCLUDED) && ! JUCE_AMALGAMATED_INCLUDE
/* When you add this cpp file to your project, you mustn't include it in a file where you've
already included any other headers - just put it inside a file on its own, possibly with your config
flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
header files that the compiler may be using.
*/
#error "Incorrect use of JUCE cpp file"
#endif
// Your project must contain an AppConfig.h file with your project-specific settings in it,
// and your header search path must make it accessible to the module's files.
#include "AppConfig.h"
#include "juce_audio_basics.h"
#if JUCE_MINGW && ! defined (__SSE2__)
#define JUCE_USE_SSE_INTRINSICS 0
#endif
#ifndef JUCE_USE_SSE_INTRINSICS
#define JUCE_USE_SSE_INTRINSICS 1
#endif
#if ! JUCE_INTEL
#undef JUCE_USE_SSE_INTRINSICS
#endif
#if JUCE_USE_SSE_INTRINSICS
#include <emmintrin.h>
#endif
#ifndef JUCE_USE_VDSP_FRAMEWORK
#define JUCE_USE_VDSP_FRAMEWORK 1
#endif
#if (JUCE_MAC || JUCE_IOS) && JUCE_USE_VDSP_FRAMEWORK
#define Point CarbonDummyPointName // (workaround to avoid definition of "Point" by old Carbon headers)
#include <Accelerate/Accelerate.h>
#undef Point
#else
#undef JUCE_USE_VDSP_FRAMEWORK
#endif
#if __ARM_NEON__ && ! (JUCE_USE_VDSP_FRAMEWORK || defined (JUCE_USE_ARM_NEON))
#define JUCE_USE_ARM_NEON 1
#include <arm_neon.h>
#endif
namespace juce
{
#include "buffers/juce_AudioDataConverters.cpp"
#include "buffers/juce_AudioSampleBuffer.cpp"
#include "buffers/juce_FloatVectorOperations.cpp"
#include "effects/juce_IIRFilter.cpp"
#include "effects/juce_LagrangeInterpolator.cpp"
#include "midi/juce_MidiBuffer.cpp"
#include "midi/juce_MidiFile.cpp"
#include "midi/juce_MidiKeyboardState.cpp"
#include "midi/juce_MidiMessage.cpp"
#include "midi/juce_MidiMessageSequence.cpp"
#include "sources/juce_BufferingAudioSource.cpp"
#include "sources/juce_ChannelRemappingAudioSource.cpp"
#include "sources/juce_IIRFilterAudioSource.cpp"
#include "sources/juce_MixerAudioSource.cpp"
#include "sources/juce_ResamplingAudioSource.cpp"
#include "sources/juce_ReverbAudioSource.cpp"
#include "sources/juce_ToneGeneratorAudioSource.cpp"
#include "synthesisers/juce_Synthesiser.cpp"
}
| {
"content_hash": "4a0d55cf5b559e3c5984a0fcfad736f0",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 105,
"avg_line_length": 31.805555555555557,
"alnum_prop": 0.7672489082969433,
"repo_name": "JTriggerFish/protoplug",
"id": "4bd50c3c2ac60d05a235ab2b1328ae0901da7eec",
"size": "3212",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "Frameworks/JuceModules/juce_audio_basics/juce_audio_basics.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1786"
},
{
"name": "C",
"bytes": "11919891"
},
{
"name": "C++",
"bytes": "10482104"
},
{
"name": "CSS",
"bytes": "14142"
},
{
"name": "HTML",
"bytes": "341856"
},
{
"name": "Java",
"bytes": "24637"
},
{
"name": "Lua",
"bytes": "2028856"
},
{
"name": "Makefile",
"bytes": "22091"
},
{
"name": "Objective-C",
"bytes": "120110"
},
{
"name": "Objective-C++",
"bytes": "534975"
},
{
"name": "R",
"bytes": "2856"
},
{
"name": "Shell",
"bytes": "2757"
}
],
"symlink_target": ""
} |
<#PSScriptInfo
.VERSION 1.0.0
.GUID e1a46ec1-73ff-49e6-849b-81b13917d2b0
.AUTHOR DSC Community
.COMPANYNAME DSC Community
.COPYRIGHT Copyright the DSC Community contributors. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/dsccommunity/NetworkingDsc/blob/main/LICENSE
.PROJECTURI https://github.com/dsccommunity/NetworkingDsc
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES First version.
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
#>
#Requires -module NetworkingDsc
<#
.DESCRIPTION
Removes the NIC Team 'HostTeam' from the interfaces NIC1, NIC2 and NIC3.
#>
Configuration NetworkTeam_RemoveNetworkTeam_Config
{
Import-DSCResource -ModuleName NetworkingDsc
Node localhost
{
NetworkTeam RemoveNetworkTeam
{
Name = 'HostTeam'
Ensure = 'Absent'
TeamMembers = 'NIC1', 'NIC2', 'NIC3'
}
}
}
| {
"content_hash": "545464643b792bc0354aea798a4e6b79",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 76,
"avg_line_length": 26.2972972972973,
"alnum_prop": 0.7307297019527236,
"repo_name": "PlagueHO/xNetworking",
"id": "85fb8a597c090a5c6a4b93016c375232e5be7582",
"size": "973",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "source/Examples/Resources/NetworkTeam/2-NetworkTeam_RemoveNetworkTeam_Config.ps1",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PowerShell",
"bytes": "1028459"
}
],
"symlink_target": ""
} |
extern "C" int __openal__JNI_OnLoad(void* vm);
#elif defined(_IOS)
#include <sys/sysctl.h>
void OpenAL_iOS_init();
void OpenAL_iOS_destroy();
bool OpenAL_iOS_isAudioSessionActive();
bool restoreiOSAudioSession();
bool hasiOSAudioSessionRestoreFailed();
static bool gAudioSuspended = false; // iOS specific hack as well
#endif
#define _CASE_STRING(x) case x: return #x;
static hstr alGetErrorString(ALenum error)
{
switch (error)
{
_CASE_STRING(AL_NO_ERROR);
_CASE_STRING(AL_INVALID_NAME);
_CASE_STRING(AL_INVALID_ENUM);
_CASE_STRING(AL_INVALID_VALUE);
_CASE_STRING(AL_INVALID_OPERATION);
_CASE_STRING(AL_OUT_OF_MEMORY);
default:
return "AL_UNKNOWN";
};
}
static hstr alcGetErrorString(ALCenum error)
{
switch (error)
{
_CASE_STRING(ALC_NO_ERROR);
_CASE_STRING(ALC_INVALID_DEVICE);
_CASE_STRING(ALC_INVALID_CONTEXT);
_CASE_STRING(ALC_INVALID_ENUM);
_CASE_STRING(ALC_INVALID_VALUE);
_CASE_STRING(ALC_OUT_OF_MEMORY);
default:
return "ALC_UNKNOWN";
};
}
namespace xal
{
OpenAL_AudioManager::OpenAL_AudioManager(void* backendId, bool threaded, float updateTime, chstr deviceName) :
AudioManager(backendId, threaded, updateTime, deviceName), device(NULL), context(NULL)
{
this->name = XAL_AS_OPENAL;
hlog::write(logTag, "Initializing OpenAL.");
#ifdef _ANDROID
__openal__JNI_OnLoad(backendId);
#endif
this->numActiveSources = 0;
this->initOpenAL();
}
OpenAL_AudioManager::~OpenAL_AudioManager()
{
hlog::write(logTag, "Destroying OpenAL.");
destroyOpenAL();
}
void OpenAL_AudioManager::initOpenAL()
{
ALCdevice* currentDevice = alcOpenDevice(this->deviceName.cStr());
ALenum error = alcGetError(currentDevice);
if (error != ALC_NO_ERROR)
{
hlog::error(logTag, "Could not create device!, " + alcGetErrorString(error));
return;
}
this->deviceName = alcGetString(currentDevice, ALC_DEVICE_SPECIFIER);
hlog::write(logTag, "Audio device: " + this->deviceName);
#ifdef _IOS
// iOS generates only 4 stereo sources by default, so lets override that
ALCint params[5] = {ALC_STEREO_SOURCES, 16, ALC_MONO_SOURCES, 16, 0};
ALCcontext* currentContext = alcCreateContext(currentDevice, params);
#else
ALCcontext* currentContext = alcCreateContext(currentDevice, NULL);
#endif
error = alcGetError(currentDevice);
if (error != ALC_NO_ERROR)
{
hlog::error(logTag, "Could not create context!, " + alcGetErrorString(error));
return;
}
alcMakeContextCurrent(currentContext);
error = alcGetError(currentDevice);
if (error != ALC_NO_ERROR)
{
hlog::error(logTag, "Could not set context as current!, " + alcGetErrorString(error));
return;
}
this->device = currentDevice;
this->context = currentContext;
this->enabled = true;
#ifdef _IOS
this->pendingResume = false;
OpenAL_iOS_init();
#endif
}
void OpenAL_AudioManager::destroyOpenAL()
{
#ifdef _IOS // you can't touch this, there may be dragons
OpenAL_iOS_destroy();
#endif
if (this->device != NULL)
{
alcMakeContextCurrent(NULL);
alcDestroyContext(this->context);
alcCloseDevice(this->device);
}
}
void OpenAL_AudioManager::resetOpenAL()
{
hlog::write(logTag, "Restarting OpenAL.");
foreach (Player*, it, this->players)
{
((OpenAL_Player*)*it)->destroyOpenALBuffers();
}
destroyOpenAL();
initOpenAL();
foreach (Player*, it, this->players)
{
((OpenAL_Player*)*it)->createOpenALBuffers();
}
}
Player* OpenAL_AudioManager::_createSystemPlayer(Sound* sound)
{
return new OpenAL_Player(sound);
}
unsigned int OpenAL_AudioManager::_allocateSourceId()
{
unsigned int id = 0;
alGenSources(1, &id);
ALenum error = alGetError();
if (error != AL_NO_ERROR)
{
hlog::warn(logTag, hsprintf("Unable to allocate audio source! error = %s, numActiveSources = %d",alGetErrorString(error).cStr(), this->numActiveSources));
return 0;
}
++this->numActiveSources;
#ifdef _DEBUG
// hlog::write(logTag, hsprintf("Allocated source: %d, currently active sources: %d", id, this->numActiveSources));
#endif
return id;
}
void OpenAL_AudioManager::_releaseSourceId(unsigned int sourceId)
{
if (sourceId != 0)
{
--this->numActiveSources;
alDeleteSources(1, &sourceId);
}
#ifdef _DEBUG
// hlog::write(logTag, hsprintf("Released source: %d, currently active sources: %d", sourceId, this->numActiveSources));
#endif
}
#ifdef _IOS
void OpenAL_AudioManager::_resumeAudio()
{
if (!OpenAL_iOS_isAudioSessionActive())
{
this->pendingResume = true;
return;
}
AudioManager::_resumeAudio();
this->pendingResume = false;
}
void OpenAL_AudioManager::_suspendAudio()
{
this->pendingResume = false;
AudioManager::_suspendAudio();
}
void OpenAL_AudioManager::_update(float timeDelta)
{
if (hasiOSAudioSessionRestoreFailed())
{
if (!restoreiOSAudioSession())
{
hthread::sleep(50);
return;
}
}
if (this->pendingResume)
{
this->_resumeAudio();
}
AudioManager::_update(timeDelta);
}
void OpenAL_AudioManager::suspendOpenALContext() // iOS specific hack
{
hmutex::ScopeLock lock(&this->mutex);
hlog::write(logTag, "Suspending OpenAL Context.");
gAudioSuspended = this->isSuspended();
if (!gAudioSuspended)
{
this->_suspendAudio();
}
alcSuspendContext(this->context);
alcMakeContextCurrent(NULL);
}
bool OpenAL_AudioManager::resumeOpenALContext() // iOS specific hack
{
static int reset = -1;
ALCenum err = ALC_NO_ERROR;
hmutex::ScopeLock lock;
if (!hasiOSAudioSessionRestoreFailed())
{
lock.acquire(&this->mutex); // otherwise don't lock because at this point we're already locked
}
hlog::write(logTag, "Resuming OpenAL Context.");
if (reset == -1) // only check once, for performance reasons.
{
size_t size = 255;
char cname[256] = {'\0'};
sysctlbyname("hw.machine", cname, &size, NULL, 0);
hstr name = cname;
// So far, only iPhone3GS (iPhone2,1) has problems restoring OpenAL context
// so instead of a restoration, a reset is used (destroy and re-init OpenAL)
// if another device with similar problems is found in the future, it should
// be added to the code below. --kspes @ March 13th, 2013
reset = (name == "iPhone2,1" ? 1 : 0);
}
if (reset)
{
resetOpenAL();
}
else
{
alcMakeContextCurrent(this->context);
if ((err = alcGetError(this->device)) == ALC_NO_ERROR)
{
alcProcessContext(this->context);
if ((err = alcGetError(this->device)) == ALC_NO_ERROR && !gAudioSuspended)
{
this->_resumeAudio();
}
}
}
if (!gAudioSuspended)
{
this->_resumeAudio();
}
if (!hasiOSAudioSessionRestoreFailed())
{
lock.release();
}
if (err != ALC_NO_ERROR)
{
hlog::write(logTag, "Failed resuming OpenAL Context, will try again later. error: " + alcGetErrorString(err));
return false;
}
return true;
}
#else
void OpenAL_AudioManager::suspendOpenALContext() // iOS specific hack
{
hlog::debug(logTag, "Not iOS, suspendOpenALContext call ignored.");
}
bool OpenAL_AudioManager::resumeOpenALContext() // iOS specific hack
{
hlog::debug(logTag, "Not iOS, resumeOpenALContext ignored.");
return true;
}
#endif
}
#endif
| {
"content_hash": "a91508a7a53f6a874241f073a4535dea",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 157,
"avg_line_length": 25.226148409893995,
"alnum_prop": 0.6870710183499089,
"repo_name": "klangobjekte/libxal",
"id": "9c3da2a7f3d9308f9941434c8294057599d99873",
"size": "7972",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/audiosystems/OpenAL/OpenAL_AudioManager.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "3186578"
},
{
"name": "C++",
"bytes": "420745"
},
{
"name": "Objective-C++",
"bytes": "5437"
},
{
"name": "Perl",
"bytes": "3982"
}
],
"symlink_target": ""
} |
package com.planet57.gshell.commands.shell;
import java.lang.reflect.Method;
import java.util.List;
import com.planet57.gshell.command.Command;
import com.planet57.gshell.command.CommandContext;
import com.planet57.gshell.command.CommandActionSupport;
import com.planet57.gshell.util.cli2.Argument;
import com.planet57.gshell.util.cli2.Option;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
* Execute a Java standard application.
*
* By default looks for static main(String[]) to execute, but
* you can specify a different static method that takes a String[]
* to execute instead.
*
* @since 2.0
*/
@Command(name = "java", description = "Execute a Java standard application")
public class JavaAction
extends CommandActionSupport
{
@Option(name = "m", longName = "method", description = "Invoke a named method", token = "METHOD")
private String methodName = "main";
@Argument(index = 0, required = true, description = "The name of the class to invoke", token = "CLASSNAME")
private String className;
@Nullable
@Argument(index = 1, description = "Arguments to pass to the METHOD of CLASSNAME", token = "ARGS")
private List<String> args;
@Override
public Object execute(@Nonnull final CommandContext context) throws Exception {
log.debug("Class-name: {}", className);
log.debug("Method-name: {}", methodName);
Class<?> type = Thread.currentThread().getContextClassLoader().loadClass(className);
log.debug("Using type: {}", type);
Method method = type.getMethod(methodName, String[].class);
log.debug("Using method: {}", method);
log.debug("Invoking w/arguments: {}", args);
Object result = method.invoke(null, new Object[] { convert(args) });
log.debug("Result: {}", result);
return result;
}
private static String[] convert(@Nullable final List<?> source) {
if (source == null) {
return new String[0];
}
String[] result = new String[source.size()];
for (int i = 0; i < source.size(); i++) {
result[i] = String.valueOf(source.get(i));
}
return result;
}
}
| {
"content_hash": "8eb10487ed3ba5ea2173ba4da667365a",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 109,
"avg_line_length": 31.37313432835821,
"alnum_prop": 0.6941008563273073,
"repo_name": "jdillon/gshell",
"id": "5e6bee0a07a9186c78e5a77c9b73e9f7496ce6e2",
"size": "2724",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gshell-commands/gshell-shell/src/main/java/com/planet57/gshell/commands/shell/JavaAction.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1395"
},
{
"name": "Groovy",
"bytes": "170957"
},
{
"name": "Java",
"bytes": "701886"
},
{
"name": "JavaScript",
"bytes": "670"
},
{
"name": "Python",
"bytes": "8281"
},
{
"name": "Shell",
"bytes": "12192"
}
],
"symlink_target": ""
} |
The new module ``cosmology/tests/helper.py`` has been added to provide tools
for testing the cosmology module and related extensions.
| {
"content_hash": "4fb7629ca4a3246861acbddb99ed1925",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 76,
"avg_line_length": 67,
"alnum_prop": 0.8059701492537313,
"repo_name": "saimn/astropy",
"id": "51bdb4afb0e0a8ecfdba290cb775938a2e45d44d",
"size": "134",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "docs/changes/cosmology/12966.feature.rst",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "11034753"
},
{
"name": "C++",
"bytes": "47001"
},
{
"name": "Cython",
"bytes": "78631"
},
{
"name": "HTML",
"bytes": "1172"
},
{
"name": "Lex",
"bytes": "183333"
},
{
"name": "M4",
"bytes": "18757"
},
{
"name": "Makefile",
"bytes": "52457"
},
{
"name": "Python",
"bytes": "12214998"
},
{
"name": "Shell",
"bytes": "17024"
},
{
"name": "TeX",
"bytes": "853"
}
],
"symlink_target": ""
} |
<?php
// to remove excess redirect stuff
function modifyServerSuperGlobalVariable($dir = __DIR__) {
if (!isset($_SERVER['REQUEST_URI']) || !isset($_SERVER['REDIRECT_URL']))
return false;
// change back slash to forward slash - only on windows
$__DIR__ = str_replace('\\', '/', $dir);
// take the (DOCUMENT_ROOT) & the (current folder out) of (__DIR__)
$remove = str_replace([$_SERVER['DOCUMENT_ROOT']], "", $__DIR__);
$remove = strtolower($remove);
// take the (DOCUMENT_ROOT) out of the (REQUEST_URI) & (REDIRECT_URL)
$_SERVER['REQUEST_URI'] = str_replace($_SERVER['DOCUMENT_ROOT'], "", $_SERVER['REQUEST_URI']);
$_SERVER['REDIRECT_URL'] = str_replace($_SERVER['DOCUMENT_ROOT'], "", $_SERVER['REDIRECT_URL']);
// make them lowercase
$_SERVER['REQUEST_URI'] = strtolower($_SERVER['REQUEST_URI']);
$_SERVER['REDIRECT_URL'] = strtolower($_SERVER['REDIRECT_URL']);
// replace part of the directory with nothing
$_SERVER['REQUEST_URI'] = str_replace($remove, "", $_SERVER['REQUEST_URI']);
$_SERVER['REDIRECT_URL'] = str_replace($remove, "", $_SERVER['REDIRECT_URL']);
}
| {
"content_hash": "c2395896da8054b2424f0df922fc5f6f",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 100,
"avg_line_length": 42.48148148148148,
"alnum_prop": 0.6085440278988666,
"repo_name": "aretecode/Todo",
"id": "4af94a37170bf66a53dfbbf3f3551f02f22b2a9b",
"size": "1147",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Utilities/modifyServerSuperGlobal.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "471"
},
{
"name": "JavaScript",
"bytes": "17479"
},
{
"name": "PHP",
"bytes": "61002"
}
],
"symlink_target": ""
} |
require "mscorlib"
require "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
require "System.Collections.Generic, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
require "System.Linq, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
require "System.Text, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
require "System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
module CodeBuilder.Configuration
class TemplateSection < ConfigurationSection
def Templates
return self["templates"]
end
def PostDeserialize()
self.PostDeserialize()
end
end
end | {
"content_hash": "e052a7e1a8ed387901cfd26f8e7f0841",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 103,
"avg_line_length": 37.72222222222222,
"alnum_prop": 0.801178203240059,
"repo_name": "xianrendzw/CodeBuilder.Ruby",
"id": "815bba5c76de9fed6ba537293f10d3e0c01ae3b6",
"size": "681",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CodeBuilder.Framework/Configuration/Template/TemplateSection.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "255096"
}
],
"symlink_target": ""
} |
FROM nerro/base:wheezy
RUN wget --output-document /javinla https://github.com/nerro/javinla/releases/download/v1.1.0/javinla \
&& wget --output-document /javinla.sha1 https://github.com/nerro/javinla/releases/download/v1.1.0/javinla.sha1 \
&& sha1sum -c javinla.sha1 \
&& chmod +x /javinla \
&& /javinla version \
&& /javinla install 8u92 \
&& rm -rf /javinla*
| {
"content_hash": "48645067dc9a62d61ea0f60540068010",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 116,
"avg_line_length": 42.888888888888886,
"alnum_prop": 0.6761658031088082,
"repo_name": "nerro/docker-images",
"id": "fdea46d97d355a19b3569795da3beb0ad6b2d1ed",
"size": "386",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "java/server-jre/8u92/Dockerfile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Shell",
"bytes": "7316"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "00c447e153c13d1b00620aa3e7e86526",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "7f0b8e556a443b45f9ee42ae8be09bff71331ad8",
"size": "206",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Bryophyta/Bryopsida/Hypnales/Hypnaceae/Hypnum/Hypnum skottsbergii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"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_04) on Tue Sep 11 01:30:15 EDT 2012 -->
<title>BridgeAccess</title>
<meta name="date" content="2012-09-11">
<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="BridgeAccess";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/midlocanics/frc/zooey/BallCollection.html" title="class in com.midlocanics.frc.zooey"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../com/midlocanics/frc/zooey/DriveTrain.html" title="class in com.midlocanics.frc.zooey"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/midlocanics/frc/zooey/BridgeAccess.html" target="_top">Frames</a></li>
<li><a href="BridgeAccess.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field_summary">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field_detail">Field</a> | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.midlocanics.frc.zooey</div>
<h2 title="Class BridgeAccess" class="title">Class BridgeAccess</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../com/midlocanics/frc/gongaware/RobotComponent.html" title="class in com.midlocanics.frc.gongaware">com.midlocanics.frc.gongaware.RobotComponent</a></li>
<li>
<ul class="inheritance">
<li>com.midlocanics.frc.zooey.BridgeAccess</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">BridgeAccess</span>
extends <a href="../../../../com/midlocanics/frc/gongaware/RobotComponent.html" title="class in com.midlocanics.frc.gongaware">RobotComponent</a></pre>
<dl><dt><span class="strong">Author:</span></dt>
<dd>Ross Gongaware</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../com/midlocanics/frc/zooey/BridgeAccess.html#BUTTON">BUTTON</a></strong></code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="fields_inherited_from_class_com.midlocanics.frc.gongaware.RobotComponent">
<!-- -->
</a>
<h3>Fields inherited from class com.midlocanics.frc.gongaware.<a href="../../../../com/midlocanics/frc/gongaware/RobotComponent.html" title="class in com.midlocanics.frc.gongaware">RobotComponent</a></h3>
<code><a href="../../../../com/midlocanics/frc/gongaware/RobotComponent.html#controller">controller</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../com/midlocanics/frc/zooey/BridgeAccess.html#BridgeAccess(com.midlocanics.frc.gongaware.Controller, edu.wpi.first.wpilibj.Relay, edu.wpi.first.wpilibj.Relay)">BridgeAccess</a></strong>(<a href="../../../../com/midlocanics/frc/gongaware/Controller.html" title="class in com.midlocanics.frc.gongaware">Controller</a> dual,
edu.wpi.first.wpilibj.Relay left,
edu.wpi.first.wpilibj.Relay right)</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../com/midlocanics/frc/zooey/BridgeAccess.html#check()">check</a></strong>()</code>
<div class="block">Checks to see if the component needs to run.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../com/midlocanics/frc/zooey/BridgeAccess.html#isDown()">isDown</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/midlocanics/frc/zooey/BridgeAccess.html#putDown()">putDown</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/midlocanics/frc/zooey/BridgeAccess.html#putUp()">putUp</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/midlocanics/frc/zooey/BridgeAccess.html#reset()">reset</a></strong>()</code>
<div class="block">Resets the running of the component to it's initial state.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/midlocanics/frc/zooey/BridgeAccess.html#run()">run</a></strong>()</code>
<div class="block">Runs the component.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/midlocanics/frc/zooey/BridgeAccess.html#stop()">stop</a></strong>()</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_com.midlocanics.frc.gongaware.RobotComponent">
<!-- -->
</a>
<h3>Methods inherited from class com.midlocanics.frc.gongaware.<a href="../../../../com/midlocanics/frc/gongaware/RobotComponent.html" title="class in com.midlocanics.frc.gongaware">RobotComponent</a></h3>
<code><a href="../../../../com/midlocanics/frc/gongaware/RobotComponent.html#getTimeSinceLastRun()">getTimeSinceLastRun</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>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">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="BUTTON">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>BUTTON</h4>
<pre>public static final int BUTTON</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#com.midlocanics.frc.zooey.BridgeAccess.BUTTON">Constant Field Values</a></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="BridgeAccess(com.midlocanics.frc.gongaware.Controller, edu.wpi.first.wpilibj.Relay, edu.wpi.first.wpilibj.Relay)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>BridgeAccess</h4>
<pre>public BridgeAccess(<a href="../../../../com/midlocanics/frc/gongaware/Controller.html" title="class in com.midlocanics.frc.gongaware">Controller</a> dual,
edu.wpi.first.wpilibj.Relay left,
edu.wpi.first.wpilibj.Relay right)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="reset()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reset</h4>
<pre>public void reset()</pre>
<div class="block"><strong>Description copied from class: <code><a href="../../../../com/midlocanics/frc/gongaware/RobotComponent.html#reset()">RobotComponent</a></code></strong></div>
<div class="block">Resets the running of the component to it's initial state. Called at the
beginning of tele-op once to ensure everything is in it's initial state.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../com/midlocanics/frc/gongaware/RobotComponent.html#reset()">reset</a></code> in class <code><a href="../../../../com/midlocanics/frc/gongaware/RobotComponent.html" title="class in com.midlocanics.frc.gongaware">RobotComponent</a></code></dd>
</dl>
</li>
</ul>
<a name="isDown()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isDown</h4>
<pre>public boolean isDown()</pre>
</li>
</ul>
<a name="check()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>check</h4>
<pre>public boolean check()</pre>
<div class="block"><strong>Description copied from class: <code><a href="../../../../com/midlocanics/frc/gongaware/RobotComponent.html#check()">RobotComponent</a></code></strong></div>
<div class="block">Checks to see if the component needs to run. If true, should be followed
by a <code> run() </code> call.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../com/midlocanics/frc/gongaware/RobotComponent.html#check()">check</a></code> in class <code><a href="../../../../com/midlocanics/frc/gongaware/RobotComponent.html" title="class in com.midlocanics.frc.gongaware">RobotComponent</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>Whether component needs to be run</dd></dl>
</li>
</ul>
<a name="run()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>run</h4>
<pre>public void run()</pre>
<div class="block"><strong>Description copied from class: <code><a href="../../../../com/midlocanics/frc/gongaware/RobotComponent.html#run()">RobotComponent</a></code></strong></div>
<div class="block">Runs the component. Should return quickly and not hold up the running of
the robot. Will be called successively.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../../com/midlocanics/frc/gongaware/RobotComponent.html#run()">run</a></code> in class <code><a href="../../../../com/midlocanics/frc/gongaware/RobotComponent.html" title="class in com.midlocanics.frc.gongaware">RobotComponent</a></code></dd>
</dl>
</li>
</ul>
<a name="putUp()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>putUp</h4>
<pre>public void putUp()</pre>
</li>
</ul>
<a name="putDown()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>putDown</h4>
<pre>public void putDown()</pre>
</li>
</ul>
<a name="stop()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>stop</h4>
<pre>public void stop()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/midlocanics/frc/zooey/BallCollection.html" title="class in com.midlocanics.frc.zooey"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../com/midlocanics/frc/zooey/DriveTrain.html" title="class in com.midlocanics.frc.zooey"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/midlocanics/frc/zooey/BridgeAccess.html" target="_top">Frames</a></li>
<li><a href="BridgeAccess.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field_summary">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field_detail">Field</a> | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {
"content_hash": "8a1eae701bc54f273714cab3bc5e3566",
"timestamp": "",
"source": "github",
"line_count": 421,
"max_line_length": 378,
"avg_line_length": 38.04513064133017,
"alnum_prop": 0.6470000624336643,
"repo_name": "rossgong/midlocanics-robot",
"id": "f66207a9ed7ae93d6722ced0d093ffc7bcd12aee",
"size": "16017",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/com/midlocanics/frc/zooey/BridgeAccess.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "36690"
}
],
"symlink_target": ""
} |
package com.github.gfronza.mods.bayeux.impl.functions;
import io.vertx.core.http.HttpServerRequest;
import com.github.gfronza.mods.bayeux.impl.protocol.Message;
/**
* Represents an incoming or outgoing extension.
* Extensions allows you to intercept incoming or outgoing messages as they pass in and out.
* This lets you mofidy the content of them for whatever purpose.<br/><br/>
*
* PS: you can use this as a lambda expression.
* @author Germano
*
*/
@FunctionalInterface
public interface BayeuxExtension {
public void handle(Message message, HttpServerRequest request);
}
| {
"content_hash": "464eeffba9fa6d1070e8b5658174db6c",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 92,
"avg_line_length": 26.818181818181817,
"alnum_prop": 0.7677966101694915,
"repo_name": "gfronza/mod-bayeux",
"id": "c67d9f774fc917731d7948ea1c3d3f39553b539b",
"size": "1191",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/github/gfronza/mods/bayeux/impl/functions/BayeuxExtension.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "23895"
}
],
"symlink_target": ""
} |
package filings
import "strconv"
type ReportFile struct {
ReportFileId int64
CIK, Year, Quarter int64
Filepath string
FormType string
Parsed bool
ParseError bool
}
func (rf *ReportFile) GetLogStr() string {
return "report file cik <" + strconv.FormatInt(rf.CIK, 10) +
"> with year <" + strconv.FormatInt(rf.Year, 10) +
"> and quarter <" + strconv.FormatInt(rf.Quarter, 10) +
"> and file path <" + rf.Filepath + "> and report file id: " +
strconv.FormatInt(rf.ReportFileId, 10)
}
//func (rf *ReportFile) IsFinancialReport() {
//}
| {
"content_hash": "f4cc837f7cb42a7c19395b7138a6bfe2",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 64,
"avg_line_length": 24.791666666666668,
"alnum_prop": 0.6352941176470588,
"repo_name": "ProfessorBeekums/PbStockResearcher",
"id": "4b51600abb11f02743c71f5d51d27201b720d130",
"size": "595",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "filings/ReportFile.go",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "108"
},
{
"name": "Go",
"bytes": "76335"
},
{
"name": "HTML",
"bytes": "1795"
},
{
"name": "JavaScript",
"bytes": "9719"
}
],
"symlink_target": ""
} |
// OCHamcrest by Jon Reid, http://qualitycoding.org/about/
// Copyright 2016 hamcrest.org. See LICENSE.txt
#import <OCHamcrestIOS/HCBaseMatcher.h>
/*!
* @abstract Supporting class for matching a feature of an object.
* @discussion Tests whether the result of passing the specified invocation to the value satisfies
* the specified matcher.
*/
@interface HCInvocationMatcher : HCBaseMatcher
{
NSInvocation *_invocation;
id <HCMatcher> _subMatcher;
}
/*!
* @abstract Determines whether a mismatch will be described in short form.
* @discussion Default is long form, which describes the object, the name of the invocation, and the
* sub-matcher's mismatch diagnosis. Short form only has the sub-matcher's mismatch diagnosis.
*/
@property (nonatomic, assign) BOOL shortMismatchDescription;
/*!
* @abstract Initializes a newly allocated HCInvocationMatcher with an invocation and a matcher.
*/
- (instancetype)initWithInvocation:(NSInvocation *)anInvocation matching:(id <HCMatcher>)aMatcher;
/*!
* @abstract Invokes stored invocation on the specified item and returns the result.
*/
- (id)invokeOn:(id)item;
/*!
* @abstract Returns string representation of the invocation's selector.
*/
- (NSString *)stringFromSelector;
@end
| {
"content_hash": "fdd404c7a0f130f3813545a5554b1f79",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 100,
"avg_line_length": 31.35,
"alnum_prop": 0.75518341307815,
"repo_name": "momotw/TDD_Day2_Homework",
"id": "ea5cbfcbac2a32ef345a62c191d6e202c6731543",
"size": "1254",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "OCHamcrestIOS.framework/Versions/A/Headers/HCInvocationMatcher.h",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "155489"
}
],
"symlink_target": ""
} |
Catarse::Application.routes.draw do
mount RedactorRails::Engine => '/redactor_rails'
mount JasmineRails::Engine => '/specs' if defined?(JasmineRails)
devise_for(
:users,
{
path: '',
path_names: { sign_in: :login, sign_out: :logout, sign_up: :sign_up },
controllers: { omniauth_callbacks: :omniauth_callbacks, passwords: :passwords }
}
)
devise_scope :user do
post '/sign_up', {to: 'devise/registrations#create', as: :sign_up}
end
get '/thank_you' => "static#thank_you"
filter :locale, exclude: /\/auth\//
mount CatarseMoip::Engine => "/", as: :catarse_moip
mount CatarsePagarme::Engine => "/", as: :catarse_pagarme
mount CatarseApi::Engine => "/api", as: :catarse_api
#mount CatarseWepay::Engine => "/", as: :catarse_wepay
mount Dbhero::Engine => "/dbhero", as: :dbhero
resources :bank_accounts, except: [:destroy, :index] do
member do
get 'confirm'
put 'request_refund'
end
end
resources :categories, only: [] do
member do
get :subscribe, to: 'categories/subscriptions#create'
get :unsubscribe, to: 'categories/subscriptions#destroy'
end
end
resources :auto_complete_projects, only: [:index]
resources :donations, only: [:create] do
collection do
get :confirm
end
end
resources :auto_complete_cities, only: [:index]
resources :flexible_projects do
member do
get :publish
get :finish
end
end
resources :projects, only: [ :index, :create, :update, :edit, :new, :show] do
resources :accounts, only: [:create, :update]
resources :posts, controller: 'projects/posts', only: [ :destroy ]
resources :rewards do
post :sort, on: :member
end
resources :contributions, {except: [:index], controller: 'projects/contributions'} do
collection do
get :fallback_create, to: 'projects/contributions#create'
end
member do
get 'toggle_anonymous'
get :second_slip
get :no_account_refund
end
put :credits_checkout, on: :member
end
get 'video', on: :collection
member do
get 'insights'
put 'pay'
get 'embed'
get 'video_embed'
get 'embed_panel'
get 'send_to_analysis'
get 'publish'
end
end
resources :users do
resources :credit_cards, controller: 'users/credit_cards', only: [ :destroy ]
member do
get :unsubscribe_notifications
get :credits
get :settings
get :billing
get :reactivate
post :new_password
end
resources :unsubscribes, only: [:create]
member do
get 'projects'
put 'unsubscribe_update'
put 'update_email'
put 'update_password'
end
end
get "/terms-of-use" => 'high_voltage/pages#show', id: 'terms_of_use'
get "/privacy-policy" => 'high_voltage/pages#show', id: 'privacy_policy'
get "/start" => 'high_voltage/pages#show', id: 'start'
get "/jobs" => 'high_voltage/pages#show', id: 'jobs'
get "/hello" => 'high_voltage/pages#show', id: 'hello'
get "/press" => 'high_voltage/pages#show', id: 'press'
get "/assets" => 'high_voltage/pages#show', id: 'assets'
get "/guides" => 'high_voltage/pages#show', id: 'guides', as: :guides
get "/new-admin" => 'high_voltage/pages#show', id: 'new_admin'
get "/explore" => 'high_voltage/pages#show', id: 'explore'
get "/team" => 'high_voltage/pages#show', id: 'team'
get "/flex" => 'high_voltage/pages#show', id: 'flex'
# User permalink profile
constraints SubdomainConstraint do
get "/", to: 'users#show'
end
# Root path should be after channel constraints
root to: 'projects#index'
namespace :reports do
resources :contribution_reports_for_project_owners, only: [:index]
end
# Feedback form
resources :feedbacks, only: [:create]
namespace :admin do
resources :projects, only: [ :index, :update, :destroy ] do
member do
put 'approve'
put 'push_to_online'
put 'reject'
put 'push_to_draft'
put 'push_to_trash'
end
end
resources :financials, only: [ :index ]
resources :contributions, only: [ :index, :update, :show ] do
member do
get :second_slip
put 'pay'
put 'change_reward'
put 'refund'
put 'trash'
put 'request_refund'
put 'chargeback'
put 'gateway_refund'
end
end
resources :users, only: [ :index ]
namespace :reports do
resources :contribution_reports, only: [ :index ]
end
end
resource :api_token, only: [:show]
get "/:permalink" => "projects#show", as: :project_by_slug
end
| {
"content_hash": "5c051795a85b988b669233aa3ead2c0b",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 89,
"avg_line_length": 27.790419161676645,
"alnum_prop": 0.6199095022624435,
"repo_name": "rjschultz18/rachel-catarse-crowdfunding",
"id": "4fe02500dd1b6c697e4a17d2cab8b1052417462e",
"size": "4641",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config/routes.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "147235"
},
{
"name": "CoffeeScript",
"bytes": "11495"
},
{
"name": "HTML",
"bytes": "294339"
},
{
"name": "JavaScript",
"bytes": "113957"
},
{
"name": "Ruby",
"bytes": "1223291"
}
],
"symlink_target": ""
} |
import java.net.*;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import java.awt.EventQueue;
import java.io.*;
public class Client implements Runnable
{
private Socket socket = null;
private Thread thread = null;
private DataOutputStream streamOut = null;
//private ClientThread client = null;
private String username;
private ChatGUI frame;
public Client(String ipAddr, String username, int serverPort)
{
this.username = username;
// set up the socket to connect to the gui
try
{
socket = new Socket(ipAddr, serverPort);
start();
} catch (UnknownHostException h)
{
JOptionPane.showMessageDialog(new JFrame(), "Unknown Host " + h.getMessage());
System.exit(1);
} catch (IOException e)
{
JOptionPane.showMessageDialog(new JFrame(), "IO exception: " + e.getMessage());
System.exit(1);
}
}
public void run()
{
//TODO check for a new message, once we receive it, steamOut will send it to the server
}
public synchronized void handleChat(String msg)
{
//TODO
}
public void start() throws IOException
{
frame = new ChatGUI(username);
frame.setVisible(true);
//TODO
}
public void stop()
{
//TODO
}
}
| {
"content_hash": "5ce4079fa82236e0010d694207b281ae",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 89,
"avg_line_length": 18.861538461538462,
"alnum_prop": 0.6941272430668842,
"repo_name": "jkrajcir/SE319",
"id": "8465d1cef6867cd1746cea2c03e50f0adcfe4874",
"size": "1228",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lab1/Lab01_ServerClient/Template/Client.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "118127"
},
{
"name": "Java",
"bytes": "73936"
},
{
"name": "JavaScript",
"bytes": "61274"
},
{
"name": "PHP",
"bytes": "926966"
}
],
"symlink_target": ""
} |
package net.sourceforge.mayfly.evaluation.expression;
import java.util.Collection;
import net.sourceforge.mayfly.datastore.Cell;
import net.sourceforge.mayfly.evaluation.Expression;
import net.sourceforge.mayfly.evaluation.ResultRow;
import net.sourceforge.mayfly.evaluation.select.Evaluator;
import net.sourceforge.mayfly.parser.Location;
public class Sum extends AggregateExpression {
public Sum(Expression column, String functionName, boolean distinct,
Location location) {
super(column, functionName, distinct, location);
}
public Sum(Expression column, String functionName, boolean distinct) {
this(column, functionName, distinct, Location.UNKNOWN);
}
@Override
Cell aggregate(Collection values) {
return aggregateSumAverage(values, true);
}
@Override
public Expression resolve(ResultRow row, Evaluator evaluator) {
return new Sum(column.resolve(row, evaluator), functionName, distinct, location);
}
}
| {
"content_hash": "73b0ee68a012f0617e8da5572fa51f76",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 89,
"avg_line_length": 31.125,
"alnum_prop": 0.748995983935743,
"repo_name": "jsampson/mayfly",
"id": "3c4c54d13cc2709b9ca2a01f17442b4cd4e79b4f",
"size": "996",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/net/sourceforge/mayfly/evaluation/expression/Sum.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
import {seq, ver, tok, plus, opt, optPrio, altPrio, Expression} from "../combi";
import {FieldSub, ClassName, Constant, Source, MethodCallChain, CompareOperator, SourceFieldSymbol} from ".";
import {WParenLeft, ParenRightW} from "../../1_lexer/tokens";
import {Version} from "../../../version";
import {IStatementRunnable} from "../statement_runnable";
export class Compare extends Expression {
public getRunnable(): IStatementRunnable {
const val = altPrio(FieldSub, Constant);
const list = seq(tok(WParenLeft),
val,
plus(seq(",", val)),
tok(ParenRightW));
const inn = seq(optPrio("NOT"), "IN", altPrio(Source, list));
const sopt = seq("IS",
optPrio("NOT"),
altPrio("SUPPLIED",
"BOUND",
ver(Version.v750, seq("INSTANCE OF", ClassName)),
"REQUESTED",
"INITIAL"));
const between = seq(optPrio("NOT"), "BETWEEN", Source, "AND", Source);
const predicate = ver(Version.v740sp08, MethodCallChain);
const rett = seq(Source, altPrio(seq(CompareOperator, Source), inn, between, sopt));
const fsassign = seq(SourceFieldSymbol, "IS", optPrio("NOT"), "ASSIGNED");
const ret = seq(opt("NOT"), altPrio(rett, predicate, fsassign));
return ret;
}
} | {
"content_hash": "1577d9497865c7f5168532a548d0527e",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 109,
"avg_line_length": 37.05263157894737,
"alnum_prop": 0.5738636363636364,
"repo_name": "larshp/abaplint",
"id": "3f12a5fde8f87490fda845392cbcb2b611f9b2cc",
"size": "1408",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "packages/core/src/abap/2_statements/expressions/compare.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1169"
},
{
"name": "HTML",
"bytes": "3454"
},
{
"name": "JavaScript",
"bytes": "14602"
},
{
"name": "Shell",
"bytes": "1357"
},
{
"name": "TypeScript",
"bytes": "941953"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Monograph of the Genus Diaporthe Nitschke & its Segregates 194 (1933)
#### Original name
Sphaeria salicina Curr., 1858
### Remarks
null | {
"content_hash": "b77a3468faba69deb6f8270cdfaf4061",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 69,
"avg_line_length": 17.23076923076923,
"alnum_prop": 0.7366071428571429,
"repo_name": "mdoering/backbone",
"id": "960bf1b83b088a6bc665291931ea6cb5eccd8804",
"size": "284",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Sordariomycetes/Diaporthales/Gnomoniaceae/Cryptodiaporthe/Cryptodiaporthe salicina/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
/**
* http://github.com/Valums-File-Uploader/file-uploader
*
* Multiple file upload component with progress-bar, drag-and-drop.
*
* Have ideas for improving this JS for the general community?
* Submit your changes at: https://github.com/Valums-File-Uploader/file-uploader
*
* VERSION 2.0 beta
* Original version 1.0 © 2010 Andrew Valums ( andrew(at)valums.com )
* Licensed under GNU GPL 2 or later and GNU LGPL 2 or later, see license.txt.
*/
//
// Helper functions
//
var qq = qq || {};
/**
* Adds all missing properties from second obj to first obj
*/
qq.extend = function(first, second){
for (var prop in second){
first[prop] = second[prop];
}
};
/**
* Searches for a given element in the array, returns -1 if it is not present.
* @param {Number} [from] The index at which to begin the search
*/
qq.indexOf = function(arr, elt, from){
if (arr.indexOf) return arr.indexOf(elt, from);
from = from || 0;
var len = arr.length;
if (from < 0) from += len;
for (; from < len; from++){
if (from in arr && arr[from] === elt){
return from;
}
}
return -1;
};
qq.getUniqueId = (function(){
var id = 0;
return function(){ return id++; };
})();
//
// Browsers and platforms detection
qq.ie = function(){ return navigator.userAgent.indexOf('MSIE') != -1; };
qq.safari = function(){ return navigator.vendor != undefined && navigator.vendor.indexOf("Apple") != -1; };
qq.chrome = function(){ return navigator.vendor != undefined && navigator.vendor.indexOf('Google') != -1; };
qq.firefox = function(){ return (navigator.userAgent.indexOf('Mozilla') != -1 && navigator.vendor != undefined && navigator.vendor == ''); };
qq.windows = function(){ return navigator.platform == "Win32"; };
//
// Events
/** Returns the function which detaches attached event */
qq.attach = function(element, type, fn){
if (element.addEventListener){
element.addEventListener(type, fn, false);
} else if (element.attachEvent){
element.attachEvent('on' + type, fn);
}
return function() {
qq.detach(element, type, fn)
}
};
qq.detach = function(element, type, fn){
if (element.removeEventListener){
element.removeEventListener(type, fn, false);
} else if (element.attachEvent){
element.detachEvent('on' + type, fn);
}
};
qq.preventDefault = function(e){
if (e.preventDefault){
e.preventDefault();
} else{
e.returnValue = false;
}
};
//
// Node manipulations
/**
* Insert node a before node b.
*/
qq.insertBefore = function(a, b){
b.parentNode.insertBefore(a, b);
};
qq.remove = function(element){
element.parentNode.removeChild(element);
};
qq.contains = function(parent, descendant){
// compareposition returns false in this case
if (parent == descendant) return true;
if (parent.contains){
return parent.contains(descendant);
} else {
return !!(descendant.compareDocumentPosition(parent) & 8);
}
};
/**
* Creates and returns element from html string
* Uses innerHTML to create an element
*/
qq.toElement = (function(){
var div = document.createElement('div');
return function(html){
div.innerHTML = html;
var element = div.firstChild;
div.removeChild(element);
return element;
};
})();
//
// Node properties and attributes
/**
* Sets styles for an element.
* Fixes opacity in IE6-8.
*/
qq.css = function(element, styles){
if (styles.opacity != null){
if (typeof element.style.opacity != 'string' && typeof(element.filters) != 'undefined'){
styles.filter = 'alpha(opacity=' + Math.round(100 * styles.opacity) + ')';
}
}
qq.extend(element.style, styles);
};
qq.hasClass = function(element, name){
var re = new RegExp('(^| )' + name + '( |$)');
return re.test(element.className);
};
qq.addClass = function(element, name){
if (!qq.hasClass(element, name)){
element.className += ' ' + name;
}
};
qq.removeClass = function(element, name){
var re = new RegExp('(^| )' + name + '( |$)');
element.className = element.className.replace(re, ' ').replace(/^\s+|\s+$/g, "");
};
qq.setText = function(element, text){
element.innerText = text;
element.textContent = text;
};
//
// Selecting elements
qq.children = function(element){
var children = [],
child = element.firstChild;
while (child){
if (child.nodeType == 1){
children.push(child);
}
child = child.nextSibling;
}
return children;
};
qq.getByClass = function(element, className){
if (element.querySelectorAll){
return element.querySelectorAll('.' + className);
}
var result = [];
var candidates = element.getElementsByTagName("*");
var len = candidates.length;
for (var i = 0; i < len; i++){
if (qq.hasClass(candidates[i], className)){
result.push(candidates[i]);
}
}
return result;
};
/**
* obj2url() takes a json-object as argument and generates
* a querystring. pretty much like jQuery.param()
*
* how to use:
*
* `qq.obj2url({a:'b',c:'d'},'http://any.url/upload?otherParam=value');`
*
* will result in:
*
* `http://any.url/upload?otherParam=value&a=b&c=d`
*
* @param Object JSON-Object
* @param String current querystring-part
* @return String encoded querystring
*/
qq.obj2url = function(obj, temp, prefixDone){
var uristrings = [],
prefix = '&',
add = function(nextObj, i){
var nextTemp = temp
? (/\[\]$/.test(temp)) // prevent double-encoding
? temp
: temp+'['+i+']'
: i;
if ((nextTemp != 'undefined') && (i != 'undefined')) {
uristrings.push(
(typeof nextObj === 'object')
? qq.obj2url(nextObj, nextTemp, true)
: (Object.prototype.toString.call(nextObj) === '[object Function]')
? encodeURIComponent(nextTemp) + '=' + encodeURIComponent(nextObj())
: encodeURIComponent(nextTemp) + '=' + encodeURIComponent(nextObj)
);
}
};
if (!prefixDone && temp) {
prefix = (/\?/.test(temp)) ? (/\?$/.test(temp)) ? '' : '&' : '?';
uristrings.push(temp);
uristrings.push(qq.obj2url(obj));
} else if ((Object.prototype.toString.call(obj) === '[object Array]') && (typeof obj != 'undefined') ) {
// we wont use a for-in-loop on an array (performance)
for (var i = 0, len = obj.length; i < len; ++i){
add(obj[i], i);
}
} else if ((typeof obj != 'undefined') && (obj !== null) && (typeof obj === "object")){
// for anything else but a scalar, we will use for-in-loop
for (var i in obj){
add(obj[i], i);
}
} else {
uristrings.push(encodeURIComponent(temp) + '=' + encodeURIComponent(obj));
}
return uristrings.join(prefix)
.replace(/^&/, '')
.replace(/%20/g, '+');
};
//
//
// Uploader Classes
//
//
var qq = qq || {};
/**
* Creates upload button, validates upload, but doesn't create file list or dd.
*/
qq.FileUploaderBasic = function(o){
this._options = {
// set to true to see the server response
debug: false,
action: '/server/upload',
params: {},
customHeaders: {},
button: null,
multiple: true,
maxConnections: 3,
// validation
allowedExtensions: [],
acceptFiles: null, // comma separated string of mime-types for browser to display in browse dialog
sizeLimit: 0,
minSizeLimit: 0,
abortOnFailure: true, // Fail all files if one doesn't meet the criteria
// events
// return false to cancel submit
onSubmit: function(id, fileName){},
onProgress: function(id, fileName, loaded, total){},
onComplete: function(id, fileName, responseJSON){},
onCancel: function(id, fileName){},
onUpload: function(id, fileName, xhr){},
onError: function(id, fileName, xhr) {},
// messages
messages: {
typeError: "Unfortunately the file(s) you selected weren't the type we were expecting. Only {extensions} files are allowed.",
sizeError: "{file} is too large, maximum file size is {sizeLimit}.",
minSizeError: "{file} is too small, minimum file size is {minSizeLimit}.",
emptyError: "{file} is empty, please select files again without it.",
onLeave: "The files are being uploaded, if you leave now the upload will be cancelled."
},
showMessage: function(message){
alert(message);
},
inputName: 'qqfile',
extraDropzones : []
};
qq.extend(this._options, o);
qq.extend(this, qq.DisposeSupport);
// number of files being uploaded
this._filesInProgress = 0;
this._handler = this._createUploadHandler();
if (this._options.button){
this._button = this._createUploadButton(this._options.button);
}
this._preventLeaveInProgress();
};
qq.FileUploaderBasic.prototype = {
setParams: function(params){
this._options.params = params;
},
getInProgress: function(){
return this._filesInProgress;
},
_createUploadButton: function(element){
var self = this;
var button = new qq.UploadButton({
element: element,
multiple: this._options.multiple && qq.UploadHandlerXhr.isSupported(),
acceptFiles: this._options.acceptFiles,
onChange: function(input){
self._onInputChange(input);
}
});
this.addDisposer(function() { button.dispose(); });
return button;
},
_createUploadHandler: function(){
var self = this,
handlerClass;
if(qq.UploadHandlerXhr.isSupported()){
handlerClass = 'UploadHandlerXhr';
} else {
handlerClass = 'UploadHandlerForm';
}
var handler = new qq[handlerClass]({
debug: this._options.debug,
action: this._options.action,
encoding: this._options.encoding,
maxConnections: this._options.maxConnections,
customHeaders: this._options.customHeaders,
inputName: this._options.inputName,
extraDropzones: this._options.extraDropzones,
onProgress: function(id, fileName, loaded, total){
self._onProgress(id, fileName, loaded, total);
self._options.onProgress(id, fileName, loaded, total);
},
onComplete: function(id, fileName, result){
self._onComplete(id, fileName, result);
self._options.onComplete(id, fileName, result);
},
onCancel: function(id, fileName){
self._onCancel(id, fileName);
self._options.onCancel(id, fileName);
},
onError: self._options.onError,
onUpload: function(id, fileName, xhr){
self._onUpload(id, fileName, xhr);
self._options.onUpload(id, fileName, xhr);
}
});
return handler;
},
_preventLeaveInProgress: function(){
var self = this;
this._attach(window, 'beforeunload', function(e){
if (!self._filesInProgress){return;}
var e = e || window.event;
// for ie, ff
e.returnValue = self._options.messages.onLeave;
// for webkit
return self._options.messages.onLeave;
});
},
_onSubmit: function(id, fileName){
this._filesInProgress++;
},
_onProgress: function(id, fileName, loaded, total){
},
_onComplete: function(id, fileName, result){
this._filesInProgress--;
if (result.error){
this._options.showMessage(result.error);
}
},
_onCancel: function(id, fileName){
this._filesInProgress--;
},
_onUpload: function(id, fileName, xhr){
},
_onInputChange: function(input){
if (this._handler instanceof qq.UploadHandlerXhr){
this._uploadFileList(input.files);
} else {
if (this._validateFile(input)){
this._uploadFile(input);
}
}
this._button.reset();
},
_uploadFileList: function(files){
var goodFiles = [];
for (var i=0; i<files.length; i++){
if (this._validateFile(files[i])){
goodFiles.push(files[i]);
} else {
if (this._options.abortOnFailure) return;
}
}
for (var i=0; i<goodFiles.length; i++){
this._uploadFile(goodFiles[i]);
}
},
_uploadFile: function(fileContainer){
var id = this._handler.add(fileContainer);
var fileName = this._handler.getName(id);
var submit
if (this._options.onSubmit(id, fileName) !== false){
this._onSubmit(id, fileName, this._options.params);
submitList = document.getElementsByClassName('qq-save-name');
submit = submitList[submitList.length-1];
// id = parent.getElementsByClassName('qq-id')[0].value;
params = this._find(this._element, 'image_params').value;
ObjParams = new Object();
ObjParams.authenticity_token = params;
this._handler.upload(id, ObjParams);
}
},
_validateFile: function(file){
var name, size;
if (file.value){
// it is a file input
// get input value and remove path to normalize
name = file.value.replace(/.*(\/|\\)/, "");
} else {
// fix missing properties in Safari 4 and firefox 11.0a2
name = (file.fileName !== null && file.fileName !== undefined) ? file.fileName : file.name;
size = (file.fileSize !== null && file.fileSize !== undefined) ? file.fileSize : file.size;
}
if (! this._isAllowedExtension(name)){
this._error('typeError', name);
return false;
} else if (size === 0){
this._error('emptyError', name);
return false;
} else if (size && this._options.sizeLimit && size > this._options.sizeLimit){
this._error('sizeError', name);
return false;
} else if (size && size < this._options.minSizeLimit){
this._error('minSizeError', name);
return false;
}
return true;
},
_error: function(code, fileName){
var message = this._options.messages[code];
function r(name, replacement){ message = message.replace(name, replacement); }
r('{file}', this._formatFileName(fileName));
r('{extensions}', this._options.allowedExtensions.join(', '));
r('{sizeLimit}', this._formatSize(this._options.sizeLimit));
r('{minSizeLimit}', this._formatSize(this._options.minSizeLimit));
this._options.showMessage(message);
},
_formatFileName: function(name){
if (name.length > 33){
name = name.slice(0, 19) + '...' + name.slice(-13);
}
return name;
},
_isAllowedExtension: function(fileName){
var ext = (-1 !== fileName.indexOf('.'))
? fileName.replace(/.*[.]/, '').toLowerCase()
: '';
var allowed = this._options.allowedExtensions;
if (!allowed.length){return true;}
for (var i=0; i<allowed.length; i++){
if (allowed[i].toLowerCase() == ext){ return true;}
}
return false;
},
_formatSize: function(bytes){
var i = -1;
do {
bytes = bytes / 1024;
i++;
} while (bytes > 99);
return Math.max(bytes, 0.1).toFixed(1) + ['kB', 'MB', 'GB', 'TB', 'PB', 'EB'][i];
}
};
/**
* Class that creates upload widget with drag-and-drop and file list
* @inherits qq.FileUploaderBasic
*/
qq.FileUploader = function(o){
// call parent constructor
qq.FileUploaderBasic.apply(this, arguments);
// additional options
qq.extend(this._options, {
element: null,
// if set, will be used instead of qq-upload-list in template
listElement: null,
dragText: 'Перетащите файы для загрузки сюда',
uploadButtonText: 'Загрузить изображение',
cancelButtonText: 'Отмена',
failUploadText: 'Что-то пошло не так...',
nameSubmit: 'Подтвердить загрузку изображения',
hideShowDropArea: true,
template: '<div class="qq-uploader">' +
'<div class="qq-upload-drop-area"><span>{dragText}</span></div>' +
'<div class="qq-upload-button">{uploadButtonText}</div>' +
'<ul class="qq-upload-list"></ul>' +
'</div>',
// template for one item in file list
fileTemplate: '<li>' +
'<span class="qq-progress-bar"></span>' +
'<span class="qq-upload-file"></span>' +
'<span class="qq-upload-spinner"></span>' +
'<span class="qq-upload-size"></span>' +
'<img class="qq-image-preview"></img>' +
'<div class="qq-new-image">'+
'</div>'+
'<a class="qq-upload-cancel" href="#">{cancelButtonText}</a>' +
'<span class="qq-upload-failed-text">{failUploadtext}</span>' +
'</li>',
classes: {
// used to get elements from templates
button: 'qq-upload-button',
drop: 'qq-upload-drop-area',
dropActive: 'qq-upload-drop-area-active',
dropDisabled: 'qq-upload-drop-area-disabled',
list: 'qq-upload-list',
progressBar: 'qq-progress-bar',
file: 'qq-upload-file',
spinner: 'qq-upload-spinner',
size: 'qq-upload-size',
cancel: 'qq-upload-cancel',
image_preview: 'qq-image-preview',
image_id: 'qq-id',
image_errors: 'error-message',
image_params: 'qq-params',
image_name: 'qq-image-name',
// added to list item <li> when upload completes
// used in css to hide progress spinner
success: 'qq-upload-success',
fail: 'qq-upload-fail'
}
});
// overwrite options with user supplied
qq.extend(this._options, o);
// overwrite the upload button text if any
// same for the Cancel button and Fail message text
this._options.template = this._options.template.replace(/\{dragText\}/g, this._options.dragText);
this._options.template = this._options.template.replace(/\{uploadButtonText\}/g, this._options.uploadButtonText);
this._options.fileTemplate = this._options.fileTemplate.replace(/\{cancelButtonText\}/g, this._options.cancelButtonText);
this._options.fileTemplate = this._options.fileTemplate.replace(/\{failUploadtext\}/g, this._options.failUploadText);
this._options.fileTemplate = this._options.fileTemplate.replace(/\{nameSubmit\}/g, this._options.nameSubmit);
this._element = this._options.element;
this._element.innerHTML = this._options.template;
this._listElement = this._options.listElement || this._find(this._element, 'list');
this._classes = this._options.classes;
this._button = this._createUploadButton(this._find(this._element, 'button'));
this._bindCancelEvent();
this._setupDragDrop();
};
// inherit from Basic Uploader
qq.extend(qq.FileUploader.prototype, qq.FileUploaderBasic.prototype);
qq.extend(qq.FileUploader.prototype, {
addExtraDropzone: function(element){
this._setupExtraDropzone(element);
},
removeExtraDropzone: function(element){
var dzs = this._options.extraDropzones;
for(var i in dzs) if (dzs[i] === element) return this._options.extraDropzones.splice(i,1);
},
_leaving_document_out: function(e){
return ((qq.chrome() || (qq.safari() && qq.windows())) && e.clientX == 0 && e.clientY == 0) // null coords for Chrome and Safari Windows
|| (qq.firefox() && !e.relatedTarget); // null e.relatedTarget for Firefox
},
/**
* Gets one of the elements listed in this._options.classes
**/
_find: function(parent, type){
var element = qq.getByClass(parent, this._options.classes[type])[0];
if (!element){
throw new Error('element not found ' + type);
}
return element;
},
_setupExtraDropzone: function(element){
this._options.extraDropzones.push(element);
this._setupDropzone(element);
},
_setupDropzone: function(dropArea){
var self = this;
var dz = new qq.UploadDropZone({
element: dropArea,
onEnter: function(e){
qq.addClass(dropArea, self._classes.dropActive);
e.stopPropagation();
},
onLeave: function(e){
//e.stopPropagation();
},
onLeaveNotDescendants: function(e){
qq.removeClass(dropArea, self._classes.dropActive);
},
onDrop: function(e){
if (self._options.hideShowDropArea) {
dropArea.style.display = 'none';
}
qq.removeClass(dropArea, self._classes.dropActive);
self._uploadFileList(e.dataTransfer.files);
}
});
this.addDisposer(function() { dz.dispose(); });
if (this._options.hideShowDropArea) {
dropArea.style.display = 'none';
}
},
_setupDragDrop: function(){
var dropArea = this._find(this._element, 'drop');
var self = this;
this._options.extraDropzones.push(dropArea);
var dropzones = this._options.extraDropzones;
var i;
for (i=0; i < dropzones.length; i++){
this._setupDropzone(dropzones[i]);
}
// IE <= 9 does not support the File API used for drag+drop uploads
// Any volunteers to enable & test this for IE10?
if (!qq.ie()) {
this._attach(document, 'dragenter', function(e){
// console.log();
//if (!self._isValidFileDrag(e)) return; // now causing error. Need it be here?
if (qq.hasClass(dropArea, self._classes.dropDisabled)) return;
dropArea.style.display = 'block';
for (i=0; i < dropzones.length; i++){ dropzones[i].style.display = 'block'; }
});
}
this._attach(document, 'dragleave', function(e){
var relatedTarget = document.elementFromPoint(e.clientX, e.clientY);
// only fire when leaving document out
if (self._options.hideShowDropArea &&
qq.FileUploader.prototype._leaving_document_out(e)) {
for (i=0; i < dropzones.length; i++){ dropzones[i].style.display = 'none'; }
}
});
qq.attach(document, 'drop', function(e){
if (self._options.hideShowDropArea) {
for (i=0; i < dropzones.length; i++){ dropzones[i].style.display = 'none'; }
}
e.preventDefault();
});
},
_onSubmit: function(id, fileName, params){
qq.FileUploaderBasic.prototype._onSubmit.apply(this, arguments);
this._addToList(id, fileName, params);
},
// Update the progress bar & percentage as the file is uploaded
_onProgress: function(id, fileName, loaded, total){
qq.FileUploaderBasic.prototype._onProgress.apply(this, arguments);
var item = this._getItemByFileId(id);
var size = this._find(item, 'size');
size.style.display = 'inline';
var text;
var percent = Math.round(loaded / total * 100);
if (loaded != total) {
// If still uploading, display percentage
text = percent + '% from ' + this._formatSize(total);
} else {
// If complete, just display final size
text = this._formatSize(total);
}
// Update progress bar <span> tag
this._find(item, 'progressBar').style.width = percent + '%';
qq.setText(size, text);
},
_onComplete: function(id, fileName, result){
qq.FileUploaderBasic.prototype._onComplete.apply(this, arguments);
// mark completed
var item = this._getItemByFileId(id);
qq.remove(this._find(item, 'cancel'));
qq.remove(this._find(item, 'spinner'));
if (result.success){
qq.addClass(item, this._classes.success);
this._find(item, 'image_preview').src = result.url;
this._find(item, 'image_id').value = result.id;
} else {
qq.addClass(item, this._classes.fail);
}
},
_addToList: function(id, fileName, params){
var item = qq.toElement(this._options.fileTemplate);
item.qqFileId = id;
inputId = document.createElement('input');
inputId.className = 'qq-id'
inputParams = document.createElement('input');
inputParams.className = 'qq-params'
item.appendChild(inputId);
item.appendChild(inputParams);
inputParams.value = String(params.authenticity_token);
inputId.value = String(id);
var fileElement = this._find(item, 'file');
qq.setText(fileElement, this._formatFileName(fileName));
this._find(item, 'size').style.display = 'none';
if (!this._options.multiple) this._clearList();
this._listElement.appendChild(item);
},
_clearList: function(){
this._listElement.innerHTML = '';
},
_getItemByFileId: function(id){
var item = this._listElement.firstChild;
// there can't be txt nodes in dynamically created list
// and we can use nextSibling
while (item){
if (item.qqFileId == id) return item;
item = item.nextSibling;
}
},
/**
* delegate click event for cancel link
**/
_bindCancelEvent: function(){
var self = this,
list = this._listElement;
this._attach(list, 'click', function(e){
e = e || window.event;
var target = e.target || e.srcElement;
if (qq.hasClass(target, self._classes.cancel)){
qq.preventDefault(e);
var item = target.parentNode;
self._handler.cancel(item.qqFileId);
qq.remove(item);
}
});
}
});
qq.UploadDropZone = function(o){
this._options = {
element: null,
onEnter: function(e){},
onLeave: function(e){},
// is not fired when leaving element by hovering descendants
onLeaveNotDescendants: function(e){},
onDrop: function(e){}
};
qq.extend(this._options, o);
qq.extend(this, qq.DisposeSupport);
this._element = this._options.element;
this._disableDropOutside();
this._attachEvents();
};
qq.UploadDropZone.prototype = {
_dragover_should_be_canceled: function(){
return qq.safari() || (qq.firefox() && qq.windows());
},
_disableDropOutside: function(e){
// run only once for all instances
if (!qq.UploadDropZone.dropOutsideDisabled ){
// for these cases we need to catch onDrop to reset dropArea
if (this._dragover_should_be_canceled){
qq.attach(document, 'dragover', function(e){
e.preventDefault();
});
} else {
qq.attach(document, 'dragover', function(e){
if (e.dataTransfer){
e.dataTransfer.dropEffect = 'none';
e.preventDefault();
}
});
}
qq.UploadDropZone.dropOutsideDisabled = true;
}
},
_attachEvents: function(){
var self = this;
self._attach(self._element, 'dragover', function(e){
if (!self._isValidFileDrag(e)) return;
var effect = qq.ie() ? null : e.dataTransfer.effectAllowed;
if (effect == 'move' || effect == 'linkMove'){
e.dataTransfer.dropEffect = 'move'; // for FF (only move allowed)
} else {
e.dataTransfer.dropEffect = 'copy'; // for Chrome
}
e.stopPropagation();
e.preventDefault();
});
self._attach(self._element, 'dragenter', function(e){
if (!self._isValidFileDrag(e)) return;
self._options.onEnter(e);
});
self._attach(self._element, 'dragleave', function(e){
if (!self._isValidFileDrag(e)) return;
self._options.onLeave(e);
var relatedTarget = document.elementFromPoint(e.clientX, e.clientY);
// do not fire when moving a mouse over a descendant
if (qq.contains(this, relatedTarget)) return;
self._options.onLeaveNotDescendants(e);
});
self._attach(self._element, 'drop', function(e){
if (!self._isValidFileDrag(e)) return;
e.preventDefault();
self._options.onDrop(e);
});
},
_isValidFileDrag: function(e){
// e.dataTransfer currently causing IE errors
// IE9 does NOT support file API, so drag-and-drop is not possible
// IE10 should work, but currently has not been tested - any volunteers?
if (qq.ie()) return false;
var dt = e.dataTransfer,
// do not check dt.types.contains in webkit, because it crashes safari 4
isSafari = qq.safari();
// dt.effectAllowed is none in Safari 5
// dt.types.contains check is for firefox
return dt && dt.effectAllowed != 'none' &&
(dt.files || (!isSafari && dt.types.contains && dt.types.contains('Files')));
}
};
qq.UploadButton = function(o){
this._options = {
element: null,
// if set to true adds multiple attribute to file input
multiple: false,
acceptFiles: null,
// name attribute of file input
name: 'file',
onChange: function(input){},
hoverClass: 'qq-upload-button-hover',
focusClass: 'qq-upload-button-focus'
};
qq.extend(this._options, o);
qq.extend(this, qq.DisposeSupport);
this._element = this._options.element;
// make button suitable container for input
qq.css(this._element, {
position: 'relative',
overflow: 'hidden',
// Make sure browse button is in the right side
// in Internet Explorer
direction: 'ltr'
});
this._input = this._createInput();
};
qq.UploadButton.prototype = {
/* returns file input element */
getInput: function(){
return this._input;
},
/* cleans/recreates the file input */
reset: function(){
if (this._input.parentNode){
qq.remove(this._input);
}
qq.removeClass(this._element, this._options.focusClass);
this._input = this._createInput();
},
_createInput: function(){
var input = document.createElement("input");
if (this._options.multiple){
input.setAttribute("multiple", "multiple");
}
if (this._options.acceptFiles) input.setAttribute("accept", this._options.acceptFiles);
input.setAttribute("type", "file");
input.setAttribute("name", this._options.name);
qq.css(input, {
position: 'absolute',
// in Opera only 'browse' button
// is clickable and it is located at
// the right side of the input
right: 0,
top: 0,
fontFamily: 'Arial',
// 4 persons reported this, the max values that worked for them were 243, 236, 236, 118
fontSize: '118px',
margin: 0,
padding: 0,
cursor: 'pointer',
opacity: 0
});
this._element.appendChild(input);
var self = this;
this._attach(input, 'change', function(){
self._options.onChange(input);
});
this._attach(input, 'mouseover', function(){
qq.addClass(self._element, self._options.hoverClass);
});
this._attach(input, 'mouseout', function(){
qq.removeClass(self._element, self._options.hoverClass);
});
this._attach(input, 'focus', function(){
qq.addClass(self._element, self._options.focusClass);
});
this._attach(input, 'blur', function(){
qq.removeClass(self._element, self._options.focusClass);
});
// IE and Opera, unfortunately have 2 tab stops on file input
// which is unacceptable in our case, disable keyboard access
if (window.attachEvent){
// it is IE or Opera
input.setAttribute('tabIndex', "-1");
}
return input;
}
};
/**
* Class for uploading files, uploading itself is handled by child classes
*/
qq.UploadHandlerAbstract = function(o){
// Default options, can be overridden by the user
this._options = {
debug: false,
action: '/upload.php',
// maximum number of concurrent uploads
maxConnections: 999,
onProgress: function(id, fileName, loaded, total){},
onComplete: function(id, fileName, response){},
onCancel: function(id, fileName){},
onUpload: function(id, fileName, xhr){}
};
qq.extend(this._options, o);
this._queue = [];
// params for files in queue
this._params = [];
};
qq.UploadHandlerAbstract.prototype = {
log: function(str){
if (this._options.debug && window.console) console.log('[uploader] ' + str);
},
/**
* Adds file or file input to the queue
* @returns id
**/
add: function(file){},
/**
* Sends the file identified by id and additional query params to the server
*/
upload: function(id, params){
var len = this._queue.push(id);
var copy = {};
qq.extend(copy, params);
this._params[id] = copy;
// if too many active uploads, wait...
if (len <= this._options.maxConnections){
this._upload(id, this._params[id]);
}
},
/**
* Cancels file upload by id
*/
cancel: function(id){
this._cancel(id);
this._dequeue(id);
},
/**
* Cancells all uploads
*/
cancelAll: function(){
for (var i=0; i<this._queue.length; i++){
this._cancel(this._queue[i]);
}
this._queue = [];
},
/**
* Returns name of the file identified by id
*/
getName: function(id){},
/**
* Returns size of the file identified by id
*/
getSize: function(id){},
/**
* Returns id of files being uploaded or
* waiting for their turn
*/
getQueue: function(){
return this._queue;
},
/**
* Actual upload method
*/
_upload: function(id){},
/**
* Actual cancel method
*/
_cancel: function(id){},
/**
* Removes element from queue, starts upload of next
*/
_dequeue: function(id){
var i = qq.indexOf(this._queue, id);
this._queue.splice(i, 1);
var max = this._options.maxConnections;
if (this._queue.length >= max && i < max){
var nextId = this._queue[max-1];
this._upload(nextId, this._params[nextId]);
}
}
};
/**
* Class for uploading files using form and iframe
* @inherits qq.UploadHandlerAbstract
*/
qq.UploadHandlerForm = function(o){
qq.UploadHandlerAbstract.apply(this, arguments);
this._inputs = {};
};
// @inherits qq.UploadHandlerAbstract
qq.extend(qq.UploadHandlerForm.prototype, qq.UploadHandlerAbstract.prototype);
qq.extend(qq.UploadHandlerForm.prototype, {
add: function(fileInput){
fileInput.setAttribute('name', this._options.inputName);
var id = 'qq-upload-handler-iframe' + qq.getUniqueId();
this._inputs[id] = fileInput;
// remove file input from DOM
if (fileInput.parentNode){
qq.remove(fileInput);
}
return id;
},
getName: function(id){
// get input value and remove path to normalize
return this._inputs[id].value.replace(/.*(\/|\\)/, "");
},
_cancel: function(id){
this._options.onCancel(id, this.getName(id));
delete this._inputs[id];
var iframe = document.getElementById(id);
if (iframe){
// to cancel request set src to something else
// we use src="javascript:false;" because it doesn't
// trigger ie6 prompt on https
iframe.setAttribute('src', 'javascript:false;');
qq.remove(iframe);
}
},
_upload: function(id, params){
this._options.onUpload(id, this.getName(id), false);
var input = this._inputs[id];
if (!input){
throw new Error('file with passed id was not added, or already uploaded or cancelled');
}
var fileName = this.getName(id);
var iframe = this._createIframe(id);
var form = this._createForm(iframe, params);
form.appendChild(input);
var self = this;
this._attachLoadEvent(iframe, function(){
self.log('iframe loaded');
var response = self._getIframeContentJSON(iframe);
self._options.onComplete(id, fileName, response);
self._dequeue(id);
delete self._inputs[id];
// timeout added to fix busy state in FF3.6
setTimeout(function(){
self._detach_event();
qq.remove(iframe);
}, 1);
});
form.submit();
qq.remove(form);
return id;
},
_attachLoadEvent: function(iframe, callback){
this._detach_event = qq.attach(iframe, 'load', function(){
// when we remove iframe from dom
// the request stops, but in IE load
// event fires
if (!iframe.parentNode){
return;
}
// fixing Opera 10.53
if (iframe.contentDocument &&
iframe.contentDocument.body &&
iframe.contentDocument.body.innerHTML == "false"){
// In Opera event is fired second time
// when body.innerHTML changed from false
// to server response approx. after 1 sec
// when we upload file with iframe
return;
}
callback();
});
},
/**
* Returns json object received by iframe from server.
*/
_getIframeContentJSON: function(iframe){
// iframe.contentWindow.document - for IE<7
var doc = iframe.contentDocument ? iframe.contentDocument: iframe.contentWindow.document,
response;
var innerHTML = doc.body.innerHTML;
this.log("converting iframe's innerHTML to JSON");
this.log("innerHTML = " + innerHTML);
//plain text response may be wrapped in <pre> tag
if (innerHTML.slice(0, 5).toLowerCase() == '<pre>' && innerHTML.slice(-6).toLowerCase() == '</pre>') {
innerHTML = doc.body.firstChild.firstChild.nodeValue;
}
try {
response = eval("(" + innerHTML + ")");
} catch(err){
response = {};
}
return response;
},
/**
* Creates iframe with unique name
*/
_createIframe: function(id){
// We can't use following code as the name attribute
// won't be properly registered in IE6, and new window
// on form submit will open
// var iframe = document.createElement('iframe');
// iframe.setAttribute('name', id);
var iframe = qq.toElement('<iframe src="javascript:false;" name="' + id + '" />');
// src="javascript:false;" removes ie6 prompt on https
iframe.setAttribute('id', id);
iframe.style.display = 'none';
document.body.appendChild(iframe);
return iframe;
},
/**
* Creates form, that will be submitted to iframe
*/
_createForm: function(iframe, params){
// We can't use the following code in IE6
// var form = document.createElement('form');
// form.setAttribute('method', 'post');
// form.setAttribute('enctype', 'multipart/form-data');
// Because in this case file won't be attached to request
var form = qq.toElement('<form method="post" enctype="multipart/form-data"></form>');
var queryString = qq.obj2url(params, this._options.action);
form.setAttribute('action', queryString);
form.setAttribute('target', iframe.name);
form.style.display = 'none';
document.body.appendChild(form);
return form;
}
});
/**
* Class for uploading files using xhr
* @inherits qq.UploadHandlerAbstract
*/
qq.UploadHandlerXhr = function(o){
qq.UploadHandlerAbstract.apply(this, arguments);
this._files = [];
this._xhrs = [];
// current loaded size in bytes for each file
this._loaded = [];
};
// static method
qq.UploadHandlerXhr.isSupported = function(){
var input = document.createElement('input');
input.type = 'file';
return (
'multiple' in input &&
typeof File != "undefined" &&
typeof FormData != "undefined" &&
typeof (new XMLHttpRequest()).upload != "undefined" );
};
// @inherits qq.UploadHandlerAbstract
qq.extend(qq.UploadHandlerXhr.prototype, qq.UploadHandlerAbstract.prototype);
qq.extend(qq.UploadHandlerXhr.prototype, {
/**
* Adds file to the queue
* Returns id to use with upload, cancel
**/
add: function(file){
if (!(file instanceof File)){
throw new Error('Passed obj in not a File (in qq.UploadHandlerXhr)');
}
return this._files.push(file) - 1;
},
getName: function(id){
var file = this._files[id];
// fix missing name in Safari 4
//NOTE: fixed missing name firefox 11.0a2 file.fileName is actually undefined
return (file.fileName !== null && file.fileName !== undefined) ? file.fileName : file.name;
},
getSize: function(id){
var file = this._files[id];
return file.fileSize != null ? file.fileSize : file.size;
},
/**
* Returns uploaded bytes for file identified by id
*/
getLoaded: function(id){
return this._loaded[id] || 0;
},
/**
* Sends the file identified by id and additional query params to the server
* @param {Object} params name-value string pairs
*/
_upload: function(id, params){
this._options.onUpload(id, this.getName(id), true);
var file = this._files[id],
name = this.getName(id),
size = this.getSize(id);
this._loaded[id] = 0;
var xhr = this._xhrs[id] = new XMLHttpRequest();
var self = this;
xhr.upload.onprogress = function(e){
if (e.lengthComputable){
self._loaded[id] = e.loaded;
self._options.onProgress(id, name, e.loaded, e.total);
}
};
xhr.onreadystatechange = function(){
if (xhr.readyState == 4){
self._onComplete(id, xhr);
}
};
// build query string
params = params || {};
params[this._options.inputName] = name;
var queryString = qq.obj2url(params, this._options.action);
xhr.open("POST", queryString, true);
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
xhr.setRequestHeader("X-File-Name", encodeURIComponent(name));
if (this._options.encoding == 'multipart') {
var formData = new FormData();
formData.append(name, file);
file = formData;
} else {
xhr.setRequestHeader("Content-Type", "application/octet-stream");
//NOTE: return mime type in xhr works on chrome 16.0.9 firefox 11.0a2
xhr.setRequestHeader("X-Mime-Type",file.type );
}
for (key in this._options.customHeaders){
xhr.setRequestHeader(key, this._options.customHeaders[key]);
};
xhr.send(file);
},
_onComplete: function(id, xhr){
// the request was aborted/cancelled
if (!this._files[id]) return;
var name = this.getName(id);
var size = this.getSize(id);
this._options.onProgress(id, name, size, size);
if (xhr.status == 200){
this.log("xhr - server response received");
this.log("responseText = " + xhr.responseText);
var response;
try {
response = eval("(" + xhr.responseText + ")");
} catch(err){
response = {};
}
this._options.onComplete(id, name, response);
} else {
this._options.onError(id, name, xhr);
this._options.onComplete(id, name, {});
}
this._files[id] = null;
this._xhrs[id] = null;
this._dequeue(id);
},
_cancel: function(id){
this._options.onCancel(id, this.getName(id));
this._files[id] = null;
if (this._xhrs[id]){
this._xhrs[id].abort();
this._xhrs[id] = null;
}
}
});
/**
* A generic module which supports object disposing in dispose() method.
* */
qq.DisposeSupport = {
_disposers: [],
/** Run all registered disposers */
dispose: function() {
var disposer;
while (disposer = this._disposers.shift()) {
disposer();
}
},
/** Add disposer to the collection */
addDisposer: function(disposeFunction) {
this._disposers.push(disposeFunction);
},
/** Attach event handler and register de-attacher as a disposer */
_attach: function() {
this.addDisposer(qq.attach.apply(this, arguments));
}
};
| {
"content_hash": "afbce8f40d417abc546fa75b13eb2229",
"timestamp": "",
"source": "github",
"line_count": 1462,
"max_line_length": 152,
"avg_line_length": 33.43365253077975,
"alnum_prop": 0.5358428805237316,
"repo_name": "KernelCorp/activeadmin_images",
"id": "77864c7c4d277ffbb4726dc0ab300acf16be34fa",
"size": "48981",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/assets/javascripts/fileuploader.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2739"
},
{
"name": "JavaScript",
"bytes": "49580"
},
{
"name": "Ruby",
"bytes": "20101"
}
],
"symlink_target": ""
} |
package com.github.tminglei.bind.spi;
public enum InputMode {
SINGLE, MULTIPLE, POLYMORPHIC
}
| {
"content_hash": "aadcfccc640268f8fade246b8c07a161",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 37,
"avg_line_length": 19.8,
"alnum_prop": 0.7575757575757576,
"repo_name": "tminglei/form-binder-java",
"id": "697853b09d18e4ec3d5cd139c3a0911d18b929b5",
"size": "99",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/github/tminglei/bind/spi/InputMode.java",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Java",
"bytes": "215755"
}
],
"symlink_target": ""
} |
package fixtures.bodyboolean;
import com.fasterxml.jackson.core.JsonParseException;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
public class BoolTests {
private static AutoRestBoolTestService client;
@BeforeClass
public static void setup() {
client = new AutoRestBoolTestServiceImpl("http://localhost:3000");
}
@Test
public void getNull() throws Exception {
Assert.assertNull(client.getBool().getNull().getBody());
}
@Test
public void getInvalid() throws Exception {
try {
client.getBool().getInvalid();
Assert.assertTrue(false);
} catch (Exception exception) {
// expected
Assert.assertEquals(JsonParseException.class, exception.getClass());
}
}
@Test
public void getTrue() throws Exception {
boolean result = client.getBool().getTrue().getBody();
Assert.assertTrue(result);
}
@Test
public void getFalse() throws Exception {
boolean result = client.getBool().getFalse().getBody();
Assert.assertFalse(result);
}
@Test
public void putTrue() throws Exception {
client.getBool().putTrue(true);
}
@Test
public void putFalse() throws Exception {
client.getBool().putFalse(false);
}
}
| {
"content_hash": "35d7a43270583a0e1e2fe98530909761",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 80,
"avg_line_length": 25.39622641509434,
"alnum_prop": 0.638187221396731,
"repo_name": "matt-gibbs/AutoRest",
"id": "cd86f8056a44e7087af8b0115c662a3b61d89d8a",
"size": "1346",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "AutoRest/Generators/Java/Java.Tests/src/test/java/fixtures/bodyboolean/BoolTests.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "819"
},
{
"name": "C#",
"bytes": "8136352"
},
{
"name": "CSS",
"bytes": "110"
},
{
"name": "HTML",
"bytes": "274"
},
{
"name": "Java",
"bytes": "3142156"
},
{
"name": "JavaScript",
"bytes": "3665342"
},
{
"name": "PowerShell",
"bytes": "5703"
},
{
"name": "Ruby",
"bytes": "217469"
},
{
"name": "TypeScript",
"bytes": "158338"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>so.blacklight</groupId>
<artifactId>vault</artifactId>
<version>1.0.0</version>
<modules>
<module>vault-api</module>
<module>vault-core</module>
<module>vault-cli</module>
</modules>
<packaging>pom</packaging>
<properties>
<commandline.version>1.7.0</commandline.version>
<functionaljava.version>4.4</functionaljava.version>
<junit.version>4.12</junit.version>
<scrypt.version>1.4.0</scrypt.version>
<yubikey-client.version>3.0.1</yubikey-client.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<profiles>
<profile>
<id>with-fx</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<modules>
<module>vault-api</module>
<module>vault-core</module>
<module>vault-cli</module>
<module>vault-fx</module>
</modules>
</profile>
</profiles>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>so.blacklight</groupId>
<artifactId>vault-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>so.blacklight</groupId>
<artifactId>vault-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.jankroken</groupId>
<artifactId>commandline</artifactId>
<version>${commandline.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.yubico</groupId>
<artifactId>yubico-validation-client2</artifactId>
<version>${yubikey-client.version}</version>
</dependency>
<dependency>
<groupId>com.lambdaworks</groupId>
<artifactId>scrypt</artifactId>
<version>${scrypt.version}</version>
</dependency>
<dependency>
<groupId>org.functionaljava</groupId>
<artifactId>functionaljava-java8</artifactId>
<version>${functionaljava.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "a690746c0f9b7c6c4da7cde63941b574",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 108,
"avg_line_length": 34.628865979381445,
"alnum_prop": 0.535278356653766,
"repo_name": "xea/vault",
"id": "06a318c0d6074181f0a9bef7eb25da22ffb54550",
"size": "3359",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "11"
},
{
"name": "Java",
"bytes": "142471"
}
],
"symlink_target": ""
} |
import {bootstrap} from "angular2/angular2";
//import {Injector} from "angular2/di";
//import {reflector} from 'angular2/src/reflection/reflection';
//import {ReflectionCapabilities} from 'angular2/src/reflection/reflection_capabilities';
import {TodoApp} from "./app";
//import {TodoStore, TodoFactory} from "./service/TodoStore";
//var injector = Injector.resolveAndCreate([TodoStore, TodoFactory, TodoApp]);
//
//var store = injector.get(TodoStore);
//console.log(store);
//reflector.reflectionCapabilities = new ReflectionCapabilities();
bootstrap(TodoApp);
| {
"content_hash": "c378d09a3fa6dca0d07533ced009789a",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 89,
"avg_line_length": 35.375,
"alnum_prop": 0.7614840989399293,
"repo_name": "hourliert/angular2-firetodo",
"id": "6ea62496437cfbe78d5fd803771cc30f57cc44fd",
"size": "603",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/app/main.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "7147"
},
{
"name": "HTML",
"bytes": "2539"
},
{
"name": "JavaScript",
"bytes": "1006790"
},
{
"name": "TypeScript",
"bytes": "34587"
}
],
"symlink_target": ""
} |
echo "*****************************"
echo "*** Installing Sass ***"
echo "*****************************"
apt-get -y install ruby-full
gem install sass
| {
"content_hash": "6ff2a69ca81e32ae549e0ffc2d500b5c",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 36,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.40789473684210525,
"repo_name": "Axelrod-Python/DjAxelrod",
"id": "341b6bd50b9ec0a320749af39af04d93781fe85a",
"size": "172",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "provision/sass/install_sass.sh",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "835"
},
{
"name": "HTML",
"bytes": "5875"
},
{
"name": "JavaScript",
"bytes": "16318"
},
{
"name": "Python",
"bytes": "20613"
},
{
"name": "Shell",
"bytes": "4668"
}
],
"symlink_target": ""
} |
#ifndef __COSA_SPI_HH__
#define __COSA_SPI_HH__
#include "Cosa/Types.h"
#include "Cosa/Bits.h"
#include "Cosa/Pins.hh"
#include "Cosa/Interrupt.hh"
#include "Cosa/Event.hh"
/**
* Serial Peripheral Interface (SPI) device class. A device driver should
* inherit from SPI::Driver and defined SPI commands and higher level
* functions. The SPI::Driver class supports multiple SPI devices with
* possible different configuration (clock, bit order, mode) and
* integrates with both device chip select and possible interrupt pins.
*/
class SPI {
public:
/** Clock selectors */
enum Clock {
DIV4_CLOCK = 0x00,
DIV16_CLOCK = 0x01,
DIV64_CLOCK = 0x02,
DIV128_CLOCK = 0x03,
DIV2_2X_CLOCK = 0x04,
DIV8_2X_CLOCK = 0x05,
DIV32_2X_CLOCK = 0x06,
DIV64_2X_CLOCK = 0x07,
DEFAULT_CLOCK = DIV4_CLOCK
} __attribute__((packed));
/** Bit order selectors */
enum Order {
MSB_ORDER = 0,
LSB_ORDER = 1,
DEFAULT_ORDER = MSB_ORDER
} __attribute__((packed));
/**
* SPI device driver abstract class. Holds SPI/USI hardware settings
* to allow handling of several SPI devices with different clock, mode
* and/or bit order. Handles device chip select and disables/enables
* interrupts during SPI transaction.
*/
class Driver {
friend class SPI;
protected:
/** List of drivers */
Driver* m_next;
/** Interrupt handler */
Interrupt::Handler* m_irq;
/** Device chip select pin */
OutputPin m_cs;
/** Chip select pulse width;
* 0 for active low logic during the transaction,
* 1 for active high logic,
* 2 pulse on end of transaction.
*/
uint8_t m_pulse;
#if defined(__ARDUINO_TINY__)
/** SPI mode for clock polatity (CPOL) setting */
const uint8_t m_cpol;
/** USI hardware control register setting */
uint8_t m_usicr;
#else
/** SPI hardware control register (SPCR) setting */
uint8_t m_spcr;
/** SPI hardware control bit in status register (SPSR) setting */
uint8_t m_spsr;
#endif
public:
/**
* Construct SPI Device driver with given chip select pin, pulse,
* clock, mode, and bit order. Zero(0) pulse will give active low
* chip select during transaction, One(1) acive high, otherwise
* pulse on end().
* @param[in] cs chip select pin.
* @param[in] pulse chip select pulse mode (default active low, 0).
* @param[in] clock SPI hardware setting (default DIV4_CLOCK).
* @param[in] mode SPI mode for phase and transition (0..3, default 0).
* @param[in] order bit order (default MSB_ORDER).
* @param[in] irq interrupt handler (default null).
*/
Driver(Board::DigitalPin cs,
uint8_t pulse = 0,
Clock rate = DEFAULT_CLOCK,
uint8_t mode = 0,
Order order = MSB_ORDER,
Interrupt::Handler* irq = NULL);
/**
* Set SPI master clock rate.
* @param[in] clock rate.
*/
void set_clock(Clock rate);
};
/**
* SPI slave device support. Allows Arduino/AVR to act as a hardware
* device on the SPI bus.
*/
class Slave : public Interrupt::Handler, public Event::Handler {
friend void SPI_STC_vect(void);
friend class SPI;
private:
static const uint8_t DATA_MAX = 32;
uint8_t m_data[DATA_MAX];
uint8_t m_cmd;
uint8_t* m_buffer;
uint8_t m_max;
uint8_t m_put;
static Slave* s_device;
public:
/**
* Construct serial peripheral interface for slave.
* @param[in] buffer with data to received data.
* @param[in] max size of buffer.
*/
Slave(void* buffer = NULL, uint8_t max = 0) :
m_cmd(0),
m_buffer((uint8_t*) buffer),
m_max(max),
m_put(0)
{
if (buffer == 0) {
m_buffer = m_data;
m_max = DATA_MAX;
}
s_device = this;
}
/**
* Set data receive buffer for package receive mode.
* @param[in] buffer pointer to buffer.
* @param[in] max max size of data package.
*/
void set_buf(void* buffer, uint8_t max)
{
if (buffer == 0) {
m_buffer = m_data;
m_max = DATA_MAX;
}
else {
m_buffer = (uint8_t*) buffer;
m_max = max;
}
}
/**
* Get data receive buffer for package receive mode.
* @return buffer pointer to buffer.
*/
void* get_buf()
{
return (m_buffer);
}
/**
* Get number of bytes available in receive buffer.
* @return number of bytes.
*/
uint8_t available()
{
return (m_put);
}
/**
* @override Interrupt::Handler
* Interrupt service on data receive in slave mode.
* @param[in] data received data.
*/
virtual void on_interrupt(uint16_t data);
};
private:
/** List of attached devices for interrupt disable/enable */
Driver* m_list;
/** Current device using the SPI hardware */
Driver* m_dev;
public:
/**
* Construct serial peripheral interface for master.
*/
SPI();
/**
* Construct serial peripheral interface for slave.
*/
SPI(uint8_t mode, Order order);
/**
* Attach given SPI device driver context.
* @param[in] dev device driver context.
* @return true(1) if successful otherwise false(0)
*/
bool attach(Driver* dev);
/**
* Start of SPI master interaction block. Initiate SPI hardware
* registers, disable SPI interrupt sources and assert chip select
* pin. Return true(1) if successful otherwise false(0) if the
* hardware was currently in used.
* @param[in] dev device driver context.
* @return true(1) if successful otherwise false(0)
*/
bool begin(Driver* dev);
/**
* End of SPI master interaction block. Deselect device and
* enable SPI interrupt sources.
* @return true(1) if successful otherwise false(0)
*/
bool end();
/**
* Exchange data with slave. Should only be used within a SPI
* transaction; begin()-end() block. Return received value.
* @param[in] data to send.
* @return value received.
*/
uint8_t transfer(uint8_t data)
{
#if defined(__ARDUINO_TINY__)
USIDR = data;
USISR = _BV(USIOIF);
register uint8_t cntl = m_dev->m_usicr;
do {
USICR = cntl;
} while ((USISR & _BV(USIOIF)) == 0);
return (USIDR);
#else
SPDR = data;
loop_until_bit_is_set(SPSR, SPIF);
return (SPDR);
#endif
}
/**
* Exchange package with slave. Received data from slave is stored
* in given buffer. Should only be used within a SPI transaction;
* begin()-end() block.
* @param[in] buffer with data to transfer (send/receive).
* @param[in] count size of buffer.
*/
void transfer(void* buffer, size_t count);
/**
* Exchange package with slave. Received data from slave is stored
* in given destination buffer. Should only be used within a SPI
* transaction; begin()-end() block.
* @param[in] dst destination buffer for received data.
* @param[in] src source buffer with data to send.
* @param[in] count size of buffers.
*/
void transfer(void* dst, const void* src, size_t count);
/**
* Read package from the device slave. Should only be used within a
* SPI transaction; begin()-end() block.
* @param[in] buf buffer for read data.
* @param[in] count number of bytes to read.
*/
void read(void* buf, size_t count);
/**
* Write package to the device slave. Should only be used within a
* SPI transaction; begin()-end() block.
* @param[in] buf buffer with data to write.
* @param[in] count number of bytes to write.
*/
void write(const void* buf, size_t count);
/**
* Write package to the device slave. Should only be used within a
* SPI transaction; begin()-end() block.
* @param[in] buf buffer with data to write.
* @param[in] count number of bytes to write.
*/
void write_P(const uint8_t* buf, size_t count);
};
/**
* Singleton instance of the hardware SPI module
*/
extern SPI spi;
#endif
| {
"content_hash": "904d3780b141f23cabbff1d8c33e4693",
"timestamp": "",
"source": "github",
"line_count": 292,
"max_line_length": 75,
"avg_line_length": 27.154109589041095,
"alnum_prop": 0.6241644595787615,
"repo_name": "UECIDE/UECIDE_data",
"id": "a325c88753e2ea17b2bba9ba6a2435327647b47f",
"size": "8838",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cores/Cosa/api/Cosa/SPI.hh",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Arduino",
"bytes": "3816646"
},
{
"name": "Assembly",
"bytes": "1421566"
},
{
"name": "C",
"bytes": "546627695"
},
{
"name": "C++",
"bytes": "113272035"
},
{
"name": "CSS",
"bytes": "64919"
},
{
"name": "Emacs Lisp",
"bytes": "237675"
},
{
"name": "Erlang",
"bytes": "5952"
},
{
"name": "Java",
"bytes": "3443"
},
{
"name": "JavaScript",
"bytes": "22190"
},
{
"name": "Max",
"bytes": "312593"
},
{
"name": "Objective-C",
"bytes": "98663423"
},
{
"name": "Perl",
"bytes": "563426"
},
{
"name": "Processing",
"bytes": "1052533"
},
{
"name": "Pure Data",
"bytes": "9910"
},
{
"name": "Python",
"bytes": "383681"
},
{
"name": "Shell",
"bytes": "800332"
},
{
"name": "Tcl",
"bytes": "1379995"
},
{
"name": "TeX",
"bytes": "510"
},
{
"name": "XC",
"bytes": "79648"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.