text stringlengths 2 1.04M | meta dict |
|---|---|
class AddOwnerToApplication < ActiveRecord::Migration[6.0]
def change
add_column :oauth_applications, :owner_id, :integer, null: true
add_column :oauth_applications, :owner_type, :string, null: true
add_index :oauth_applications, %i[owner_id owner_type]
end
end
| {
"content_hash": "deaa0d86cbdb33be8ef48aa564d0b250",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 68,
"avg_line_length": 39.714285714285715,
"alnum_prop": 0.7302158273381295,
"repo_name": "michelson/chaskiq",
"id": "5aaa42deaf6645584428f5f47ea960a41a6057a5",
"size": "278",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "db/migrate/20200525033626_add_owner_to_application.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "37399"
},
{
"name": "CoffeeScript",
"bytes": "42669"
},
{
"name": "HTML",
"bytes": "80253"
},
{
"name": "JavaScript",
"bytes": "5018"
},
{
"name": "Ruby",
"bytes": "119062"
}
],
"symlink_target": ""
} |
// Copyright (c) 2012 Ecma International. All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms"). Any redistribution of this code must retain the above
// copyright and this notice and otherwise comply with the Use Terms.
/*---
es5id: 15.10.2.15-6-1
description: >
Pattern - SyntaxError was thrown when one character in CharSet 'A'
greater than one character in CharSet 'B' (15.10.2.15
CharacterRange step 6)
includes: [runTestCase.js]
---*/
function testcase() {
try {
var regExp = new RegExp("^[z-a]$");
return false;
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);
| {
"content_hash": "04e29e58a4ddccaae7b820ba17689b59",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 82,
"avg_line_length": 32.72,
"alnum_prop": 0.6638141809290954,
"repo_name": "PiotrDabkowski/Js2Py",
"id": "f39db7b77038a30e5329aa96298bcf3bce0e585b",
"size": "818",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/test_cases/built-ins/RegExp/15.10.2.15-6-1.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "289"
},
{
"name": "JavaScript",
"bytes": "8556970"
},
{
"name": "Python",
"bytes": "4583980"
},
{
"name": "Shell",
"bytes": "457"
}
],
"symlink_target": ""
} |
using NBi.GenbiL;
using NBi.GenbiL.Action.Suite;
using NBi.GenbiL.Stateful;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NBi.Testing.GenbiL.Action.Suite
{
public class GenerateTestSuiteActionTest
{
protected GenerationState BuildInitialState(object obj)
{
var state = new GenerationState();
state.CaseCollection.CurrentScope.Content.Columns.Add("one");
state.CaseCollection.CurrentScope.Content.Columns.Add("two", typeof(object));
var firstRow = state.CaseCollection.CurrentScope.Content.NewRow();
firstRow[0] = "a";
firstRow[1] = obj;
state.CaseCollection.CurrentScope.Content.Rows.Add(firstRow);
state.Templates.Add("<test name='$one$ + $two$'/>");
return state;
}
[Test]
public void Execute_SimpleDataTable_Rendered()
{
var state = BuildInitialState("b");
var action = new GenerateTestSuiteAction(false);
action.Execute(state);
Assert.That(state.Suite.Children, Has.Count.EqualTo(1));
var test = state.Suite.Children[0];
Assert.That(test.Name, Is.EqualTo("a + b"));
}
[Test]
public void Execute_SimpleDataTable2_Rendered()
{
var state = BuildInitialState("foo");
var action = new GenerateTestSuiteAction(false);
action.Execute(state);
Assert.That(state.Suite.Children, Has.Count.EqualTo(1));
var test = state.Suite.Children[0];
Assert.That(test.Name, Is.EqualTo("a + foo"));
}
[Test]
public void Execute_ComplexDataTable_Rendered()
{
var state = BuildInitialState(new [] {"b", "c"});
var action = new GenerateTestSuiteAction(false);
action.Execute(state);
Assert.That(state.Suite.Children, Has.Count.EqualTo(1));
var test = state.Suite.Children[0];
Assert.That(test.Name, Is.EqualTo("a + bc"));
}
[Test]
public void Execute_EmptyDataTable_Rendered()
{
var state = BuildInitialState("b");
state.CaseCollection.CurrentScope.Content.Rows.Clear();
var action = new GenerateTestSuiteAction(false);
action.Execute(state);
Assert.That(state.Suite.Children, Has.Count.EqualTo(0));
}
}
}
| {
"content_hash": "72f27cd346d229c2d32ca35178db33c3",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 89,
"avg_line_length": 33.53947368421053,
"alnum_prop": 0.596704590035308,
"repo_name": "Seddryck/NBi",
"id": "437d41fc43486f0172503bed35344b3aa1cbdeb8",
"size": "2551",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "NBi.Testing.GenbiL/Action/Suite/GenerateTestSuiteActionTest.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "197"
},
{
"name": "C#",
"bytes": "4397422"
},
{
"name": "HTML",
"bytes": "28966"
},
{
"name": "PowerShell",
"bytes": "7401"
}
],
"symlink_target": ""
} |
layout: page
title: Richardson - Mendez Wedding
date: 2016-05-24
author: Sarah Brooks
tags: weekly links, java
status: published
summary: Etiam iaculis porta ante, vitae pharetra.
banner: images/banner/leisure-02.jpg
booking:
startDate: 12/27/2018
endDate: 12/30/2018
ctyhocn: PIEHSHX
groupCode: RMW
published: true
---
Ut tempor vitae arcu vel commodo. Aenean lorem libero, ornare quis sem vel, auctor accumsan metus. In nec felis lacus. Nulla facilisi. Nunc vulputate bibendum tortor porta blandit. Praesent lobortis sapien massa, eu facilisis risus euismod sed. Ut non ex vitae nulla blandit feugiat. Mauris vehicula ultrices turpis, ac tristique eros vehicula semper. Vivamus iaculis eleifend sapien non fermentum. Donec id finibus dui. Nam congue scelerisque nisl in vulputate. Sed scelerisque malesuada urna ac viverra. Integer nisl dui, convallis in nisi id, dapibus interdum lectus. Aliquam sollicitudin, neque vel rutrum consequat, sapien leo dapibus lacus, in aliquam dui ante eu erat. Etiam ligula enim, convallis ac pulvinar a, mattis efficitur turpis.
Nulla non auctor lacus. Sed auctor quis arcu et eleifend. Donec at eros et lorem porta euismod ut sed sem. Nulla suscipit quis nisl quis congue. Donec vitae consectetur arcu, vel pharetra sapien. Sed cursus ipsum risus, congue sodales ex tempor sit amet. Mauris quis purus faucibus lacus feugiat laoreet ut eu leo. Integer tincidunt in nunc nec pharetra. Pellentesque nisi libero, molestie vestibulum risus gravida, aliquet venenatis ex.
* Sed sit amet turpis id turpis laoreet tincidunt interdum nec velit
* Suspendisse at est nec risus dictum viverra
* In non elit eget leo posuere dictum
* Sed nec mauris dignissim, aliquam enim nec, ultrices sem.
Integer nec erat vulputate, ullamcorper nibh non, convallis metus. In sed aliquam neque. Cras vel scelerisque nulla, sit amet elementum sem. Nulla urna dui, imperdiet sodales nisi et, blandit tincidunt libero. Nullam eget arcu nibh. Duis vitae lacus libero. Cras suscipit ornare mi, ut viverra enim iaculis in. Mauris eget dui at ex cursus consectetur.
Duis hendrerit ac ipsum nec eleifend. Nunc eu nulla quam. Integer placerat lectus justo, nec suscipit mauris porttitor vitae. Aenean mattis sem fringilla arcu euismod tincidunt. Etiam ut arcu vitae est vulputate viverra ut tempus sapien. Vivamus tempus porta odio sit amet dignissim. Donec ornare nunc id placerat pulvinar.
| {
"content_hash": "d90c83ea04bba075cc2afa41a5d136ba",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 744,
"avg_line_length": 96.12,
"alnum_prop": 0.8044111527257595,
"repo_name": "KlishGroup/prose-pogs",
"id": "22d691feb321a19e0d23120dd7c92dab7b61a206",
"size": "2407",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "pogs/P/PIEHSHX/RMW/index.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package org.apache.wicket.ajax.form;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.util.value.ValueMap;
/**
* @author marrink
*/
public class AjaxFormSubmitTestPage extends WebPage
{
private static final long serialVersionUID = 1L;
/**
* Indicates form handled submit.
*/
public static final int FORM = 2;
/**
* Indicates button handled submit.
*/
public static final int BUTTON = 4;
private int formSubmitted;
/**
* Returns the component(s) that handled the form submit.
*
* @return flag indicating the component(s)
*/
public final int getFormSubmitted()
{
return formSubmitted;
}
/**
* Construct.
*/
public AjaxFormSubmitTestPage()
{
super(new CompoundPropertyModel<ValueMap>(new ValueMap("txt1=foo,txt2=bar")));
Form<?> form = new Form<Void>("form")
{
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit()
{
formSubmitted = formSubmitted | FORM;
}
};
add(form);
form.add(new TextField<String>("txt1"));
form.add(new TextField<String>("txt2"));
form.add(new AjaxFallbackButton("submit", form)
{
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form)
{
formSubmitted = formSubmitted | BUTTON;
}
@Override
protected void onError(AjaxRequestTarget target, Form<?> form)
{
}
}.setDefaultFormProcessing(false));
}
}
| {
"content_hash": "cafec7b7dc24fd06372fb5fa9f33398b",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 80,
"avg_line_length": 22.17948717948718,
"alnum_prop": 0.7132947976878613,
"repo_name": "afiantara/apache-wicket-1.5.7",
"id": "b57f2dae9e5442b342c2501683d8d070fc855e10",
"size": "2532",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/wicket-core/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitTestPage.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "17122"
},
{
"name": "Java",
"bytes": "10812577"
},
{
"name": "JavaScript",
"bytes": "232484"
}
],
"symlink_target": ""
} |
package ReactorIO;
import ReactorIO.EventLoop.EventLoop;
import com.google.gson.Gson;
import java.nio.ByteBuffer;
import java.nio.channels.AsynchronousSocketChannel;
import static com.ea.async.Async.await;
/**
* Created by faraonul on 5/26/17.
*/
public class Reactor {
AsynchronousSocketChannel channel;
public Reactor(AsynchronousSocketChannel channel) {
this.channel = channel;
}
public void emit(String event, String message) {
EmitModel model = new EmitModel(event, message);
Gson gson = new Gson();
ByteBuffer bytes = ByteBuffer.wrap(gson.toJson(model).getBytes());
await(EventLoop.makeCompletable(channel.write(bytes)));
}
}
| {
"content_hash": "3d3c624f8ea271bdc98632b39c7a79f4",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 74,
"avg_line_length": 26.884615384615383,
"alnum_prop": 0.7138769670958512,
"repo_name": "alexandruionascu/pariaza-la-noroc",
"id": "76c526472e20e24080f7f5e87542099992db7fa1",
"size": "699",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/ReactorIO/Reactor.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "78044"
}
],
"symlink_target": ""
} |
Public Class Form3
Private Sub Form3_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' Ideiglenes
End Sub
End Class | {
"content_hash": "cd54b0a20b35be3ba70067c4cb7f4ecb",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 80,
"avg_line_length": 29.4,
"alnum_prop": 0.6938775510204082,
"repo_name": "SolZe/SolZeWeb",
"id": "855d8f390d9ee2ab5dba77108368a757fc88357a",
"size": "149",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Form3.vb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Visual Basic",
"bytes": "30639"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="ISO-8859-1"?>
<Mpeg7
xmlns="urn:mpeg:mpeg7:schema:2004"
xmlns:mpeg7="urn:mpeg:mpeg7:schema:2004"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:mpeg:mpeg7:schema:2004 mpeg7-2004.xsd">
<Description xsi:type="ContentEntityType">
<MultimediaContent xsi:type="ImageType">
<Image id="airways_fighter">
<MediaInformation>
<MediaProfile>
<MediaFormat>
<Title type="main" xml:lang="en-US">Airways</Title>
<Content href="MPEG7ContentCS">
<Name>image</Name>
</Content>
<FileFormat href="urn:mpeg:mepg7:cs:VisualCodingFormatCS:2001:1">
<Name>jpeg</Name>
</FileFormat>
<VisualCoding>
<Frame height="300" width="200"/>
</VisualCoding>
</MediaFormat>
<MediaInstance>
<InstanceIdentifier>airways_fighter</InstanceIdentifier>
<MediaLocator>
<MediaUri>Images/airways_fighter.jpg</MediaUri>
</MediaLocator>
<Abstract>
<FreeTextAnnotation> Planes used in Military Combat
<Concept>Fighter_Plane</Concept>
</FreeTextAnnotation>
</Abstract>
<StructuredAnnotation>
<WhatObject href="http://www.semanticweb.org/Vivek_Gupta/ontologies/Automobile#Fighter_Plane">
<Name>Fighter_Plane</Name>
</WhatObject>
</StructuredAnnotation>
</MediaInstance>
</MediaProfile>
</MediaInformation>
</Image>
</MultimediaContent>
</Description>
</Mpeg7>
| {
"content_hash": "0679b50b5cc5c5b965482f13b39851a8",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 100,
"avg_line_length": 30.361702127659573,
"alnum_prop": 0.6874562018220042,
"repo_name": "DataEngg/Semantic_Automobile",
"id": "1811e71f0c14da86f517ef82dc7fa2738c61f42e",
"size": "1427",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "pages/data1/airways_fighter.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "83722"
},
{
"name": "JavaScript",
"bytes": "2293780"
},
{
"name": "Shell",
"bytes": "91"
},
{
"name": "XSLT",
"bytes": "14647"
}
],
"symlink_target": ""
} |
/*
* This source code is provided to illustrate the usage of a given feature
* or technique and has been deliberately simplified. Additional steps
* required for a production-quality application, such as security checks,
* input validation and proper error handling, might not be present in
* this sample code.
*/
/*
* This function uses new Swing Desktop API in JDK 6.
* To use this with scriptpad, open this in scriptpad
* and use "Tools->Run Script" menu.
*/
function mail() {
var desktop = null;
// Before more Desktop API is used, first check
// whether the API is supported by this particular
// virtual machine (VM) on this particular host.
if (java.awt.Desktop.isDesktopSupported()) {
desktop = java.awt.Desktop.getDesktop();
} else {
alert("no desktop support");
return;
}
if (desktop.isSupported(java.awt.Desktop.Action.MAIL)) {
var mailTo = prompt("Mail To:");
if (mailTo != null) {
desktop.mail(new java.net.URI("mailto", mailTo, null));
}
}
}
if (this.application != undefined) {
// add "Mail" menu item under "Tools" menu
this.application.addTool("Mail", mail);
}
| {
"content_hash": "54b1ab7eafb483361fa1fb8eed708cdf",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 74,
"avg_line_length": 30.692307692307693,
"alnum_prop": 0.658312447786132,
"repo_name": "starlight95/jdk8samples",
"id": "cabe5c47541c3663ae15eeec3c1f2d601b5008c5",
"size": "2797",
"binary": false,
"copies": "38",
"ref": "refs/heads/master",
"path": "scripting/scriptpad/src/scripts/mail.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "D",
"bytes": "68318"
},
{
"name": "Java",
"bytes": "676058"
},
{
"name": "JavaScript",
"bytes": "72323"
},
{
"name": "Shell",
"bytes": "3526"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<ldml xmlns:sil="urn://www.sil.org/ldml/0.1">
<identity>
<version number="0.0.1"/>
<generation date="2018-11-20 22:24:04"/>
<language type="nvm"/>
<special>
<sil:identity defaultRegion="PG" script="Latn" draft="generated"/>
</special>
</identity>
<localeDisplayNames>
<languages>
<language type="nvm">Namiaiko</language>
</languages>
<special>
<sil:names>
<sil:name xml:lang="en">Namiae</sil:name>
</sil:names>
</special>
</localeDisplayNames>
<layout>
<orientation>
<characterOrder>left-to-right</characterOrder>
</orientation>
</layout>
<characters>
<exemplarCharacters>[a b d e f g i j k m n o r s t u v z]</exemplarCharacters>
<exemplarCharacters alt="proposed-dbl" draft="suspect">[A-Za-z]</exemplarCharacters>
<exemplarCharacters type="punctuation">[! ( ) , \- . / \: ?]</exemplarCharacters>
<exemplarCharacters type="punctuation" alt="proposed-dbl" draft="suspect">[!(-*,-/\:;?\[\]\u00A9\u200C\u200D\u2014\u2019\u2022]</exemplarCharacters>
<exemplarCharacters type="index">[A B D E F G I J K M N O R S T U V Z]</exemplarCharacters>
</characters>
<delimiters>
<quotationStart>“</quotationStart>
<quotationEnd>”</quotationEnd>
<alternateQuotationStart>‘</alternateQuotationStart>
<alternateQuotationEnd>’</alternateQuotationEnd>
<special>
<sil:matched-pairs>
<sil:matched-pair open="(" close=")" paraClose="false"/>
<sil:matched-pair open="[" close="]" paraClose="false"/>
<sil:matched-pair open="{" close="}" paraClose="false"/>
</sil:matched-pairs>
<sil:punctuation-patterns>
<sil:punctuation-pattern pattern="!_" context="final"/>
<sil:punctuation-pattern pattern=")" context="medial"/>
<sil:punctuation-pattern pattern=")_" context="final"/>
<sil:punctuation-pattern pattern="*_" context="final"/>
<sil:punctuation-pattern pattern=",_" context="final"/>
<sil:punctuation-pattern pattern="-" context="medial"/>
<sil:punctuation-pattern pattern="." context="medial"/>
<sil:punctuation-pattern pattern="._" context="final"/>
<sil:punctuation-pattern pattern="/" context="medial"/>
<sil:punctuation-pattern pattern=":" context="medial"/>
<sil:punctuation-pattern pattern=":_" context="final"/>
<sil:punctuation-pattern pattern=";_" context="final"/>
<sil:punctuation-pattern pattern="?_" context="final"/>
<sil:punctuation-pattern pattern="]_" context="final"/>
<sil:punctuation-pattern pattern="_(" context="init"/>
<sil:punctuation-pattern pattern="_*" context="init"/>
<sil:punctuation-pattern pattern="_-_" context="isolate"/>
<sil:punctuation-pattern pattern="_/_" context="isolate"/>
<sil:punctuation-pattern pattern="_[" context="init"/>
<sil:punctuation-pattern pattern="_©_" context="isolate"/>
<sil:punctuation-pattern pattern="_—_" context="isolate"/>
<sil:punctuation-pattern pattern="_•_" context="isolate"/>
<sil:punctuation-pattern pattern="" context="medial"/>
<sil:punctuation-pattern pattern="" context="medial"/>
<sil:punctuation-pattern pattern="’" context="medial"/>
</sil:punctuation-patterns>
<sil:quotation-marks paraContinueType="all">
<sil:quotationContinue>“</sil:quotationContinue>
<sil:alternateQuotationContinue>‘</sil:alternateQuotationContinue>
<sil:quotation open="“" close="”" continue="“" level="3"/>
</sil:quotation-marks>
</special>
</delimiters>
<special>
<sil:external-resources>
<sil:font name="Charis SIL" types="default">
<sil:url>https://wirl.api.sil.org/CharisSILReg&type=ttf</sil:url>
</sil:font>
<sil:font name="Noto Sans"><!--types="ui"-->
<sil:url>https://github.com/googlefonts/noto-fonts/raw/main/hinted/ttf/NotoSans/NotoSans-Regular.ttf</sil:url>
</sil:font>
<sil:font name="Noto Serif">
<sil:url>https://github.com/googlefonts/noto-fonts/raw/main/hinted/ttf/NotoSerif/NotoSerif-Regular.ttf</sil:url>
</sil:font>
</sil:external-resources>
</special>
</ldml>
| {
"content_hash": "8d75074a47e31335828f6ce41ee25a36",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 150,
"avg_line_length": 44.065934065934066,
"alnum_prop": 0.6778054862842893,
"repo_name": "silnrsi/sldr",
"id": "b0bd3ccc95e43f89a528a25961c71c82d0fa2a2e",
"size": "4039",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sldr/n/nvm.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "100863"
},
{
"name": "JavaScript",
"bytes": "99270"
},
{
"name": "Less",
"bytes": "486"
},
{
"name": "Makefile",
"bytes": "224"
},
{
"name": "Python",
"bytes": "28201"
},
{
"name": "Shell",
"bytes": "80"
}
],
"symlink_target": ""
} |
<?php
use app\modules\auth\models\Users;
use budyaga\cropper\Widget;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model app\modules\auth\models\Users */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="users-form">
<?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>
<?= $form->field($model, 'username')->textInput(['maxlength' => true, 'disabled' => true]) ?>
<?= $form->field($model, 'first_name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'last_name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'department')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'start_working_date')->textInput(['disabled' => true]) ?>
<?php echo $form->field($model, 'imagePath')->widget(Widget::className(), [
'uploadUrl' => '/users/uploadImage',
'width' => 250,
'height' => 250
]) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
| {
"content_hash": "e2ab449a0fdb220053eb5d76c439380b",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 150,
"avg_line_length": 31.317073170731707,
"alnum_prop": 0.5817757009345794,
"repo_name": "artempetrovjava/portfolio",
"id": "e351db57bc0bd3883ffb125f1c0098e8e1e8c91d",
"size": "1284",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/auth/views/users/_form.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "113"
},
{
"name": "Batchfile",
"bytes": "1030"
},
{
"name": "CSS",
"bytes": "12609"
},
{
"name": "JavaScript",
"bytes": "23400"
},
{
"name": "PHP",
"bytes": "521343"
},
{
"name": "Shell",
"bytes": "4747"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_20) on Wed Sep 15 06:19:18 BST 2010 -->
<TITLE>
O-Index
</TITLE>
<META NAME="date" CONTENT="2010-09-15">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="O-Index";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index-13.html"><B>PREV LETTER</B></A>
<A HREF="index-15.html"><B>NEXT LETTER</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html?index-filesindex-14.html" target="_top"><B>FRAMES</B></A>
<A HREF="index-14.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<A HREF="index-1.html">A</A> <A HREF="index-2.html">B</A> <A HREF="index-3.html">C</A> <A HREF="index-4.html">D</A> <A HREF="index-5.html">E</A> <A HREF="index-6.html">F</A> <A HREF="index-7.html">G</A> <A HREF="index-8.html">H</A> <A HREF="index-9.html">I</A> <A HREF="index-10.html">J</A> <A HREF="index-11.html">L</A> <A HREF="index-12.html">M</A> <A HREF="index-13.html">N</A> <A HREF="index-14.html">O</A> <A HREF="index-15.html">P</A> <A HREF="index-16.html">R</A> <A HREF="index-17.html">S</A> <A HREF="index-18.html">T</A> <A HREF="index-19.html">U</A> <A HREF="index-20.html">V</A> <A HREF="index-21.html">W</A> <A HREF="index-22.html">Y</A> <HR>
<A NAME="_O_"><!-- --></A><H2>
<B>O</B></H2>
<DL>
<DT><A HREF="../pt/com/gmv/lab/implant/rendering/marker/wavefront/ObjLoader.html" title="class in pt.com.gmv.lab.implant.rendering.marker.wavefront"><B>ObjLoader</B></A> - Class in <A HREF="../pt/com/gmv/lab/implant/rendering/marker/wavefront/package-summary.html">pt.com.gmv.lab.implant.rendering.marker.wavefront</A><DD>A loader for Wavefront OBJ models.<DT><A HREF="../pt/com/gmv/lab/implant/rendering/marker/wavefront/ObjLoader.html#ObjLoader()"><B>ObjLoader()</B></A> -
Constructor for class pt.com.gmv.lab.implant.rendering.marker.wavefront.<A HREF="../pt/com/gmv/lab/implant/rendering/marker/wavefront/ObjLoader.html" title="class in pt.com.gmv.lab.implant.rendering.marker.wavefront">ObjLoader</A>
<DD>
<DT><A HREF="../pt/com/gmv/lab/implant/rendering/marker/wavefront/ObjModel.html" title="class in pt.com.gmv.lab.implant.rendering.marker.wavefront"><B>ObjModel</B></A> - Class in <A HREF="../pt/com/gmv/lab/implant/rendering/marker/wavefront/package-summary.html">pt.com.gmv.lab.implant.rendering.marker.wavefront</A><DD>A model representation loaded from a Wavefront OBJ file.<DT><A HREF="../pt/com/gmv/lab/implant/rendering/marker/wavefront/ObjModel.html#ObjModel()"><B>ObjModel()</B></A> -
Constructor for class pt.com.gmv.lab.implant.rendering.marker.wavefront.<A HREF="../pt/com/gmv/lab/implant/rendering/marker/wavefront/ObjModel.html" title="class in pt.com.gmv.lab.implant.rendering.marker.wavefront">ObjModel</A>
<DD>Creates a new model based on a wavefront obj representation.
<DT><A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.OrientationService.html#onAccuracyChanged(Sensor, int)"><B>onAccuracyChanged(Sensor, int)</B></A> -
Method in class pt.com.gmv.lab.implant.ar.poi.<A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.OrientationService.html" title="class in pt.com.gmv.lab.implant.ar.poi">POIActivity.OrientationService</A>
<DD>
<DT><A HREF="../pt/com/gmv/lab/implant/interfaces/rendering/poi/POIModel.html#onClick(Context, MotionEvent)"><B>onClick(Context, MotionEvent)</B></A> -
Method in interface pt.com.gmv.lab.implant.interfaces.rendering.poi.<A HREF="../pt/com/gmv/lab/implant/interfaces/rendering/poi/POIModel.html" title="interface in pt.com.gmv.lab.implant.interfaces.rendering.poi">POIModel</A>
<DD>What should happen when a click on a POIModel on the screen.
<DT><A HREF="../pt/com/gmv/lab/implant/rendering/poi/SimplePOI.html#onClick(Context, MotionEvent)"><B>onClick(Context, MotionEvent)</B></A> -
Method in class pt.com.gmv.lab.implant.rendering.poi.<A HREF="../pt/com/gmv/lab/implant/rendering/poi/SimplePOI.html" title="class in pt.com.gmv.lab.implant.rendering.poi">SimplePOI</A>
<DD>Stale implementation that always returns <code>true</code> *
<DT><A HREF="../pt/com/gmv/lab/implant/rendering/surfaces/POIView.html#onClick(View)"><B>onClick(View)</B></A> -
Method in class pt.com.gmv.lab.implant.rendering.surfaces.<A HREF="../pt/com/gmv/lab/implant/rendering/surfaces/POIView.html" title="class in pt.com.gmv.lab.implant.rendering.surfaces">POIView</A>
<DD>Does nothing
<DT><A HREF="../pt/com/gmv/lab/implant/ar/ImplantActivity.html#onCreate(Bundle)"><B>onCreate(Bundle)</B></A> -
Method in class pt.com.gmv.lab.implant.ar.<A HREF="../pt/com/gmv/lab/implant/ar/ImplantActivity.html" title="class in pt.com.gmv.lab.implant.ar">ImplantActivity</A>
<DD>Sets the rendering view, the camera preview surface and handler and the device WakeLock.
<DT><A HREF="../pt/com/gmv/lab/implant/ar/marker/MarkerDetectionActivity.html#onCreate(Bundle)"><B>onCreate(Bundle)</B></A> -
Method in class pt.com.gmv.lab.implant.ar.marker.<A HREF="../pt/com/gmv/lab/implant/ar/marker/MarkerDetectionActivity.html" title="class in pt.com.gmv.lab.implant.ar.marker">MarkerDetectionActivity</A>
<DD>Registers the model loaders and adds models to the application.
<DT><A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.html#onCreate(Bundle)"><B>onCreate(Bundle)</B></A> -
Method in class pt.com.gmv.lab.implant.ar.poi.<A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.html" title="class in pt.com.gmv.lab.implant.ar.poi">POIActivity</A>
<DD>Sets the rendering surface for the application
<DT><A HREF="../pt/com/gmv/lab/implant/ar/ImplantActivity.html#onDestroy()"><B>onDestroy()</B></A> -
Method in class pt.com.gmv.lab.implant.ar.<A HREF="../pt/com/gmv/lab/implant/ar/ImplantActivity.html" title="class in pt.com.gmv.lab.implant.ar">ImplantActivity</A>
<DD>
<DT><A HREF="../pt/com/gmv/lab/implant/rendering/surfaces/POIView.html#onDraw(Canvas)"><B>onDraw(Canvas)</B></A> -
Method in class pt.com.gmv.lab.implant.rendering.surfaces.<A HREF="../pt/com/gmv/lab/implant/rendering/surfaces/POIView.html" title="class in pt.com.gmv.lab.implant.rendering.surfaces">POIView</A>
<DD>Draws all POIs that are deemed visible on screen and are within range.
<DT><A HREF="../pt/com/gmv/lab/implant/rendering/surfaces/MarkerSurface.ModelRenderer.html#onDrawFrame(GL10)"><B>onDrawFrame(GL10)</B></A> -
Method in class pt.com.gmv.lab.implant.rendering.surfaces.<A HREF="../pt/com/gmv/lab/implant/rendering/surfaces/MarkerSurface.ModelRenderer.html" title="class in pt.com.gmv.lab.implant.rendering.surfaces">MarkerSurface.ModelRenderer</A>
<DD>
<DT><A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.LocationService.html#onLocationChanged(Location)"><B>onLocationChanged(Location)</B></A> -
Method in class pt.com.gmv.lab.implant.ar.poi.<A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.LocationService.html" title="class in pt.com.gmv.lab.implant.ar.poi">POIActivity.LocationService</A>
<DD>When the location of the device has changed, the Georeference object is used to update the location
<DT><A HREF="../pt/com/gmv/lab/implant/ar/ImplantActivity.html#onPause()"><B>onPause()</B></A> -
Method in class pt.com.gmv.lab.implant.ar.<A HREF="../pt/com/gmv/lab/implant/ar/ImplantActivity.html" title="class in pt.com.gmv.lab.implant.ar">ImplantActivity</A>
<DD>When an application is going to be paused and put in hold.
<DT><A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.html#onPause()"><B>onPause()</B></A> -
Method in class pt.com.gmv.lab.implant.ar.poi.<A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.html" title="class in pt.com.gmv.lab.implant.ar.poi">POIActivity</A>
<DD>Removes the updates from the various sensors
<DT><A HREF="../pt/com/gmv/lab/implant/ar/marker/MarkerCameraPreview.html#onPreviewFrame(byte[], Camera)"><B>onPreviewFrame(byte[], Camera)</B></A> -
Method in class pt.com.gmv.lab.implant.ar.marker.<A HREF="../pt/com/gmv/lab/implant/ar/marker/MarkerCameraPreview.html" title="class in pt.com.gmv.lab.implant.ar.marker">MarkerCameraPreview</A>
<DD>Receives a frame from the device Camera and delivers it to the CaptureAnalyzer object.
<DT><A HREF="../pt/com/gmv/lab/implant/interfaces/camera/CameraPreviewHandler.html#onPreviewFrame(byte[], Camera)"><B>onPreviewFrame(byte[], Camera)</B></A> -
Method in interface pt.com.gmv.lab.implant.interfaces.camera.<A HREF="../pt/com/gmv/lab/implant/interfaces/camera/CameraPreviewHandler.html" title="interface in pt.com.gmv.lab.implant.interfaces.camera">CameraPreviewHandler</A>
<DD>
<DT><A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.LocationService.html#onProviderDisabled(java.lang.String)"><B>onProviderDisabled(String)</B></A> -
Method in class pt.com.gmv.lab.implant.ar.poi.<A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.LocationService.html" title="class in pt.com.gmv.lab.implant.ar.poi">POIActivity.LocationService</A>
<DD>When a provider is disabled an attempt is made to request location updates from a new provider
<DT><A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.LocationService.html#onProviderEnabled(java.lang.String)"><B>onProviderEnabled(String)</B></A> -
Method in class pt.com.gmv.lab.implant.ar.poi.<A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.LocationService.html" title="class in pt.com.gmv.lab.implant.ar.poi">POIActivity.LocationService</A>
<DD>When a new provider is enabled it is compared to the current one and enabled if better.
<DT><A HREF="../pt/com/gmv/lab/implant/ar/ImplantActivity.html#onResume()"><B>onResume()</B></A> -
Method in class pt.com.gmv.lab.implant.ar.<A HREF="../pt/com/gmv/lab/implant/ar/ImplantActivity.html" title="class in pt.com.gmv.lab.implant.ar">ImplantActivity</A>
<DD>Called when an application resumes its activity.
<DT><A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.html#onResume()"><B>onResume()</B></A> -
Method in class pt.com.gmv.lab.implant.ar.poi.<A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.html" title="class in pt.com.gmv.lab.implant.ar.poi">POIActivity</A>
<DD>Sets the location and orientation services and clears the digital noise filter array.
<DT><A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.OrientationService.html#onSensorChanged(SensorEvent)"><B>onSensorChanged(SensorEvent)</B></A> -
Method in class pt.com.gmv.lab.implant.ar.poi.<A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.OrientationService.html" title="class in pt.com.gmv.lab.implant.ar.poi">POIActivity.OrientationService</A>
<DD>According to the type of the Sensor that fired the update, the values are copied to the
given array and a calculation that produces the rotation matrix, is done, from where the
application can extract the azimuth and pitch of the device.
<DT><A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.LocationService.html#onStatusChanged(java.lang.String, int, Bundle)"><B>onStatusChanged(String, int, Bundle)</B></A> -
Method in class pt.com.gmv.lab.implant.ar.poi.<A HREF="../pt/com/gmv/lab/implant/ar/poi/POIActivity.LocationService.html" title="class in pt.com.gmv.lab.implant.ar.poi">POIActivity.LocationService</A>
<DD>
<DT><A HREF="../pt/com/gmv/lab/implant/ar/ImplantActivity.html#onStop()"><B>onStop()</B></A> -
Method in class pt.com.gmv.lab.implant.ar.<A HREF="../pt/com/gmv/lab/implant/ar/ImplantActivity.html" title="class in pt.com.gmv.lab.implant.ar">ImplantActivity</A>
<DD>
<DT><A HREF="../pt/com/gmv/lab/implant/rendering/surfaces/MarkerSurface.ModelRenderer.html#onSurfaceChanged(GL10, int, int)"><B>onSurfaceChanged(GL10, int, int)</B></A> -
Method in class pt.com.gmv.lab.implant.rendering.surfaces.<A HREF="../pt/com/gmv/lab/implant/rendering/surfaces/MarkerSurface.ModelRenderer.html" title="class in pt.com.gmv.lab.implant.rendering.surfaces">MarkerSurface.ModelRenderer</A>
<DD>
<DT><A HREF="../pt/com/gmv/lab/implant/rendering/surfaces/MarkerSurface.ModelRenderer.html#onSurfaceCreated(GL10, EGLConfig)"><B>onSurfaceCreated(GL10, EGLConfig)</B></A> -
Method in class pt.com.gmv.lab.implant.rendering.surfaces.<A HREF="../pt/com/gmv/lab/implant/rendering/surfaces/MarkerSurface.ModelRenderer.html" title="class in pt.com.gmv.lab.implant.rendering.surfaces">MarkerSurface.ModelRenderer</A>
<DD>
<DT><A HREF="../pt/com/gmv/lab/implant/ar/marker/toolkit/ARConstants.PoseEstimator.html#ORIGINAL"><B>ORIGINAL</B></A> -
Static variable in class pt.com.gmv.lab.implant.ar.marker.toolkit.<A HREF="../pt/com/gmv/lab/implant/ar/marker/toolkit/ARConstants.PoseEstimator.html" title="class in pt.com.gmv.lab.implant.ar.marker.toolkit">ARConstants.PoseEstimator</A>
<DD>
<DT><A HREF="../pt/com/gmv/lab/implant/ar/marker/toolkit/ARConstants.PoseEstimator.html#ORIGINAL_CONT"><B>ORIGINAL_CONT</B></A> -
Static variable in class pt.com.gmv.lab.implant.ar.marker.toolkit.<A HREF="../pt/com/gmv/lab/implant/ar/marker/toolkit/ARConstants.PoseEstimator.html" title="class in pt.com.gmv.lab.implant.ar.marker.toolkit">ARConstants.PoseEstimator</A>
<DD>
</DL>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index-13.html"><B>PREV LETTER</B></A>
<A HREF="index-15.html"><B>NEXT LETTER</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html?index-filesindex-14.html" target="_top"><B>FRAMES</B></A>
<A HREF="index-14.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<A HREF="index-1.html">A</A> <A HREF="index-2.html">B</A> <A HREF="index-3.html">C</A> <A HREF="index-4.html">D</A> <A HREF="index-5.html">E</A> <A HREF="index-6.html">F</A> <A HREF="index-7.html">G</A> <A HREF="index-8.html">H</A> <A HREF="index-9.html">I</A> <A HREF="index-10.html">J</A> <A HREF="index-11.html">L</A> <A HREF="index-12.html">M</A> <A HREF="index-13.html">N</A> <A HREF="index-14.html">O</A> <A HREF="index-15.html">P</A> <A HREF="index-16.html">R</A> <A HREF="index-17.html">S</A> <A HREF="index-18.html">T</A> <A HREF="index-19.html">U</A> <A HREF="index-20.html">V</A> <A HREF="index-21.html">W</A> <A HREF="index-22.html">Y</A> <HR>
</BODY>
</HTML>
| {
"content_hash": "747cb7f31214682934cb27fbd4a7c240",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 655,
"avg_line_length": 79.4780701754386,
"alnum_prop": 0.706583521880691,
"repo_name": "foliveira/implant",
"id": "f78c6e205a4deec76c15330e74cc1b44a45236a0",
"size": "18121",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/index-files/index-14.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "24955"
},
{
"name": "C++",
"bytes": "366505"
},
{
"name": "Java",
"bytes": "234252"
},
{
"name": "Objective-C",
"bytes": "7618"
}
],
"symlink_target": ""
} |
New and improved version of [HTTP Archive](https://httparchive.org). This replaces the [legacy version](https://legacy.httparchive.org), the source code for which is still available at [HTTPArchive/legacy.httparchive.org](https://github.com/HTTPArchive/legacy.httparchive.org).
## Run Locally
[Source](https://cloud.google.com/appengine/docs/flexible/python/quickstart)
1. If you don't have virtualenv, install it using pip.
```
sudo pip install virtualenv
```
2. Create an isolated Python environment, and install dependencies:
```
virtualenv --python python3.8 .venv
source .venv/bin/activate
pip install -r requirements.txt
```
3. Install the NPM dependencies:
```
npm install
```
4. Initialize the Google Cloud CLI (this is necessary because the App Engine server uses Google Cloud APIs):
```
gcloud init
```
5. Run the application:
```
npm run start
```
Note: Windows users may need to run `npm run watch` and `python main.py` separately.
6. In your web browser, enter the following address: http://127.0.0.1:8080
## Staging
To test changes on a GCP App Engine server without deploying to the production instance, use the staging app at https://httparchive-staging.appspot.com.
```
npm run stage
```
## Deploy
To push changes live to the production instance, use the deployment script. Changes will be available on https://httparchive.org.
```
npm run deploy
```
| {
"content_hash": "7a8064f1be5b01dd8ddf638183771e57",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 277,
"avg_line_length": 24.350877192982455,
"alnum_prop": 0.7456772334293948,
"repo_name": "HTTPArchive/beta.httparchive.org",
"id": "c65dac57be2a756a31acc3bc7a597ac89573dacb",
"size": "1431",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "8260"
},
{
"name": "HTML",
"bytes": "24138"
},
{
"name": "JavaScript",
"bytes": "32694"
},
{
"name": "Python",
"bytes": "9776"
}
],
"symlink_target": ""
} |
using System.Collections.Generic;
using NDatabase.Api;
using NDatabase.Btree;
using NDatabase.Core.BTree;
namespace NDatabase.Core.Query.List
{
/// <summary>
/// A collection using a BTtree as a back-end component.
/// </summary>
/// <remarks>
/// A collection using a BTtree as a back-end component. Lazy because it only keeps the oids of the objects. When asked for an object, loads it on demand and returns it
/// </remarks>
internal sealed class LazyBTreeCollection<T> : AbstractBTreeCollection<T>
{
private readonly bool _returnObjects;
private readonly IStorageEngine _storageEngine;
public LazyBTreeCollection(IStorageEngine engine, bool returnObjects) : base(OrderByConstants.OrderByAsc)
{
_storageEngine = engine;
_returnObjects = returnObjects;
}
protected override IBTree BuildTree(int degree)
{
return new InMemoryBTreeMultipleValuesPerKey(degree);
}
protected override IEnumerator<T> Iterator(OrderByConstants orderByType)
{
return new LazyOdbBtreeIteratorMultiple<T>(GetTree(), orderByType, _storageEngine, _returnObjects);
}
}
}
| {
"content_hash": "f02b3c54cea9b5a83b01a3f11a177758",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 174,
"avg_line_length": 34.97142857142857,
"alnum_prop": 0.6764705882352942,
"repo_name": "WaltChen/NDatabase",
"id": "a2231e21d8cc09061ea7af20850a5078d592a9d3",
"size": "1224",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Core/Query/List/LazyBTreeCollection.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "87"
},
{
"name": "C#",
"bytes": "2256210"
},
{
"name": "CSS",
"bytes": "859"
},
{
"name": "F#",
"bytes": "709"
},
{
"name": "HTML",
"bytes": "8756"
}
],
"symlink_target": ""
} |
// Created by Ron 'Maxwolf' McDowell (ron.mcdowell@gmail.com)
// Timestamp 12/31/2015@4:49 AM
using System;
using System.Collections.Generic;
using WolfCurses.Window.Form;
namespace WolfCurses.Window
{
/// <summary>
/// Underlying game Windows interface, used by base simulation to keep track of what data should currently have control
/// over the simulation details. Only top most game Windows will ever be ticked.
/// </summary>
public interface IWindow :
IComparer<IWindow>,
IComparable<IWindow>,
ITick
{
/// <summary>
/// Determines if the game Windows should not be ticked if it is active but instead removed. The Windows when set to
/// being
/// removed will not actually be removed until the simulation attempts to tick it and realizes that this is set to true
/// and then it will be removed.
/// </summary>
bool ShouldRemoveMode { get; }
/// <summary>
/// Determines if user input is currently allowed to be typed and filled into the input buffer.
/// </summary>
/// <remarks>Default is FALSE. Setting to TRUE allows characters and input buffer to be read when submitted.</remarks>
bool AcceptsInput { get; }
/// <summary>
/// Holds the current state which this Windows is in, a Windows will cycle through available states until it is
/// finished and
/// then detach.
/// </summary>
IForm CurrentForm { get; }
/// <summary>
/// Intended to be overridden in abstract class by generics to provide method to return object that contains all the
/// data for parent game Windows.
/// </summary>
WindowData UserData { get; }
/// <summary>
/// Determines what is asked at the bottom of a windows menu system. By default this is "What is your choice?" and can
/// be changed per window, and by any active forms.
/// </summary>
string PromptText { get; set; }
/// <summary>Creates and adds the specified type of state to currently active game Windows.</summary>
/// <param name="stateType">The state Type.</param>
void SetForm(Type stateType);
/// <summary>
/// Removes the current state from the active game Windows.
/// </summary>
void ClearForm();
/// <summary>
/// Sets the flag for this game Windows to be removed the next time it is ticked by the simulation.
/// </summary>
void RemoveWindowNextTick();
/// <summary>
/// Grabs the text user interface string that will be used for debugging on console application.
/// </summary>
/// <returns>
/// The <see cref="string" />.
/// </returns>
string OnRenderWindow();
/// <summary>
/// Intended to be used by base simulation to pass along the input buffer after the user has typed several characters
/// into the input buffer. This is used when allowing the user to input custom strings like names for their party
/// members.
/// </summary>
/// <param name="input">The input.</param>
void SendCommand(string input);
/// <summary>
/// Called after the Windows has been added to list of modes and made active.
/// </summary>
void OnWindowPostCreate();
/// <summary>
/// Called when the Windows manager in simulation makes this Windows the currently active game Windows. Depending on
/// order of
/// modes this might not get called until the Windows is actually ticked by the simulation.
/// </summary>
void OnWindowActivate();
/// <summary>
/// Fired when the simulation adds a game Windows that is not this Windows. Used to execute code in other modes that
/// are not
/// the active Windows anymore one last time.
/// </summary>
void OnWindowAdded();
}
} | {
"content_hash": "6862386f3381af6af5a1267cea4fc08e",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 131,
"avg_line_length": 41.01980198019802,
"alnum_prop": 0.6002896451846488,
"repo_name": "Maxwolf/WolfCurses",
"id": "040c9eb66083522b34647f0e67971062039ba44e",
"size": "4145",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Window/IWindow.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "131329"
}
],
"symlink_target": ""
} |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class DeleteNotification(Choreography):
def __init__(self, temboo_session):
"""
Create a new instance of the DeleteNotification Choreo. A TembooSession object, containing a valid
set of Temboo credentials, must be supplied.
"""
Choreography.__init__(self, temboo_session, '/Library/Twilio/Notifications/DeleteNotification')
def new_input_set(self):
return DeleteNotificationInputSet()
def _make_result_set(self, result, path):
return DeleteNotificationResultSet(result, path)
def _make_execution(self, session, exec_id, path):
return DeleteNotificationChoreographyExecution(session, exec_id, path)
class DeleteNotificationInputSet(InputSet):
"""
An InputSet with methods appropriate for specifying the inputs to the DeleteNotification
Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
"""
def set_AccountSID(self, value):
"""
Set the value of the AccountSID input for this Choreo. ((required, string) The AccountSID provided when you signed up for a Twilio account.)
"""
InputSet._set_input(self, 'AccountSID', value)
def set_AuthToken(self, value):
"""
Set the value of the AuthToken input for this Choreo. ((required, string) The authorization token provided when you signed up for a Twilio account.)
"""
InputSet._set_input(self, 'AuthToken', value)
def set_NotificationSID(self, value):
"""
Set the value of the NotificationSID input for this Choreo. ((required, string) Enter the SID of the notification resource to be deleted.)
"""
InputSet._set_input(self, 'NotificationSID', value)
def set_ResponseFormat(self, value):
"""
Set the value of the ResponseFormat input for this Choreo. ((optional, string) The format that the response should be in. Valid values are: json (the default) and xml.)
"""
InputSet._set_input(self, 'ResponseFormat', value)
def set_SubAccountSID(self, value):
"""
Set the value of the SubAccountSID input for this Choreo. ((optional, string) The SID of the subaccount to delete the notification from. If not specified, the main AccountSID used to authenticate is used in the request.)
"""
InputSet._set_input(self, 'SubAccountSID', value)
class DeleteNotificationResultSet(ResultSet):
"""
A ResultSet with methods tailored to the values returned by the DeleteNotification Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution.
"""
def getJSONFromString(self, str):
return json.loads(str)
def get_Response(self):
"""
Retrieve the value for the "Response" output from this Choreo execution. (The response from Twilio.)
"""
return self._output.get('Response', None)
class DeleteNotificationChoreographyExecution(ChoreographyExecution):
def _make_result_set(self, response, path):
return DeleteNotificationResultSet(response, path)
| {
"content_hash": "0c59d4c55794d25c6930af65cd9f8ee6",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 228,
"avg_line_length": 43.723684210526315,
"alnum_prop": 0.698164309359013,
"repo_name": "egetzel/wecrow",
"id": "f0427d48f62e2ff3b47ada8a78f2f0b709116f4c",
"size": "3603",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "truehand2014/temboo/Library/Twilio/Notifications/DeleteNotification.py",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "11736"
},
{
"name": "Python",
"bytes": "474202"
}
],
"symlink_target": ""
} |
import React, { Component, PropTypes } from 'react';
import classnames from 'classnames';
import CSSClassnames from '../../../utils/CSSClassnames';
import Intl from '../../../utils/Intl';
const CLASS_ROOT = CSSClassnames.CONTROL_ICON;
const COLOR_INDEX = CSSClassnames.COLOR_INDEX;
export default class Icon extends Component {
render () {
const { className, colorIndex } = this.props;
let { a11yTitle, size, responsive } = this.props;
let { intl } = this.context;
const classes = classnames(
CLASS_ROOT,
`${CLASS_ROOT}-down`,
className,
{
[`${CLASS_ROOT}--${size}`]: size,
[`${CLASS_ROOT}--responsive`]: responsive,
[`${COLOR_INDEX}-${colorIndex}`]: colorIndex
}
);
a11yTitle = a11yTitle || Intl.getMessage(intl, 'down');
return <svg version="1.1" viewBox="0 0 24 24" width="24px" height="24px" role="img" className={classes} aria-label={a11yTitle}><polyline fill="none" stroke="#000000" strokeWidth="2" points="7.086 3.174 17.086 13.174 7.086 23.174" transform="scale(1 -1) rotate(-89 -1.32 0)"/></svg>;
}
};
Icon.contextTypes = {
intl: PropTypes.object
};
Icon.defaultProps = {
responsive: true
};
Icon.displayName = 'Down';
Icon.icon = true;
Icon.propTypes = {
a11yTitle: PropTypes.string,
colorIndex: PropTypes.string,
size: PropTypes.oneOf(['small', 'medium', 'large', 'xlarge', 'huge']),
responsive: PropTypes.bool
};
| {
"content_hash": "4158762361554b61d76edee3d2f82b91",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 286,
"avg_line_length": 28.68,
"alnum_prop": 0.6464435146443515,
"repo_name": "codeswan/grommet",
"id": "8ed82a57182ce0e1c45ca6a8a82de07fa2377792",
"size": "1504",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/js/components/icons/base/Down.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "259577"
},
{
"name": "HTML",
"bytes": "4207"
},
{
"name": "JavaScript",
"bytes": "1453337"
}
],
"symlink_target": ""
} |
// Generated from /POI/java/org/apache/poi/sl/draw/geom/QuadToCommand.java
#pragma once
#include <java/awt/geom/fwd-POI.hpp>
#include <java/lang/fwd-POI.hpp>
#include <org/apache/poi/sl/draw/binding/fwd-POI.hpp>
#include <org/apache/poi/sl/draw/geom/fwd-POI.hpp>
#include <java/lang/Object.hpp>
#include <org/apache/poi/sl/draw/geom/PathCommand.hpp>
struct default_init_tag;
class poi::sl::draw::geom::QuadToCommand
: public virtual ::java::lang::Object
, public virtual PathCommand
{
public:
typedef ::java::lang::Object super;
private:
::java::lang::String* arg1 { };
::java::lang::String* arg2 { };
::java::lang::String* arg3 { };
::java::lang::String* arg4 { };
protected:
void ctor(::poi::sl::draw::binding::CTAdjPoint2D* pt1, ::poi::sl::draw::binding::CTAdjPoint2D* pt2);
public:
void execute(::java::awt::geom::Path2D_Double* path, Context* ctx) override;
// Generated
public: /* package */
QuadToCommand(::poi::sl::draw::binding::CTAdjPoint2D* pt1, ::poi::sl::draw::binding::CTAdjPoint2D* pt2);
protected:
QuadToCommand(const ::default_init_tag&);
public:
static ::java::lang::Class *class_();
private:
virtual ::java::lang::Class* getClass0();
};
| {
"content_hash": "7c5f10ec4927b8a6685b9689bd32293b",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 108,
"avg_line_length": 26.695652173913043,
"alnum_prop": 0.6710097719869706,
"repo_name": "pebble2015/cpoi",
"id": "4b837e28ff3675c36c4b41255f62063b9ca6b552",
"size": "1228",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/org/apache/poi/sl/draw/geom/QuadToCommand.hpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "15964112"
},
{
"name": "Makefile",
"bytes": "138107"
}
],
"symlink_target": ""
} |
"""A common location for all perfkitbenchmarker-defined exceptions."""
import pprint
class Error(Exception):
pass
class Setup(object):
"""Errors raised in setting up PKB."""
class MissingExecutableError(Error):
"""Error raised when we cannot find an executable we need."""
pass
class NoRunURIError(Error):
"""Error raised when we were not given a run_uri and cannot infer it."""
pass
class BadRunURIError(Error):
"""Error raised when the given run_uri is invalid."""
pass
class VirtualMachine(object):
"""Errors raised by virtual_machine.py."""
class RemoteCommandError(Error):
"""Error raised when a Remote Command or Remote Copy fails."""
pass
class RemoteExceptionError(Error):
pass
class VirtualMachineError(Error):
"""An error raised when VM is having an issue."""
@classmethod
def FromDebugInfo(cls, info, error_message):
"""Create VirtualMachineError class from debug information.
Args:
info: A dictionary containing debug information (such as traceroute
info).
error_message: the error message from the originating code.
Returns:
a cls exception class
Raises:
TypeError: if info is not an instance of dictionary.
"""
if isinstance(info, dict):
info = VirtualMachine.VirtualMachineError.FormatDebugInfo(
info, error_message)
return cls(info)
raise TypeError('The argument of FromDebugInfo should be an instance '
'of dictionary.')
@staticmethod
def FormatDebugInfo(info, error_message):
"""A function to return a string in human readable format.
Args:
info: A dictionary containing debug information (such as traceroute
info).
error_message: the error message from the originating code.
Returns:
A human readable string of debug information.
"""
sep = '\n%s\n' % ('-' * 65)
def AddHeader(error, header, message):
error += '{sep}{header}\n{message}\n'.format(
sep=sep, header=header, message=message)
return error
def AddKeyIfExists(result, header, key):
if key in info:
result = AddHeader(result, header, info[key])
del info[key]
return result
result = AddHeader('', 'error_message:',
error_message) if error_message else ''
result = AddKeyIfExists(result, 'traceroute:', 'traceroute')
return AddHeader(result, 'Debug Info:', pprint.pformat(info))
class VmStateError(VirtualMachineError):
pass
class VmUtil(object):
"""Errors raised by vm_utils.py."""
class RestConnectionError(Error):
pass
class IpParsingError(Error):
pass
class UserSetupError(Error):
pass
class ThreadException(Error):
pass
class CalledProcessException(Error):
pass
class Benchmarks(object):
"""Errors raised by individual benchmark."""
class PrepareException(Error):
pass
class MissingObjectCredentialException(Error):
pass
class RunError(Error):
pass
class Resource(object):
"""Errors related to resource creation and deletion."""
class RetryableCreationError(Error):
pass
class RetryableDeletionError(Error):
pass
class Config(object):
"""Errors related to configs."""
class InvalidValue(Error):
"""User provided an invalid value for a config option."""
pass
class MissingOption(Error):
"""User did not provide a value for a required config option."""
pass
class ParseError(Error):
"""Error raised when a config can't be loaded properly."""
pass
class UnrecognizedOption(Error):
"""User provided a value for an unrecognized config option."""
pass
| {
"content_hash": "050d404d0e139547a96a822cc3e40667",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 76,
"avg_line_length": 24.558441558441558,
"alnum_prop": 0.6602326811210999,
"repo_name": "akshara775/PerfKitBenchmarker-master-2",
"id": "dad08f1cb5856cb120c7e1481cdc46b12a5e18c5",
"size": "4393",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "perfkitbenchmarker/errors.py",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "138540"
},
{
"name": "CSS",
"bytes": "19643"
},
{
"name": "HTML",
"bytes": "432440"
},
{
"name": "JavaScript",
"bytes": "29141"
},
{
"name": "Lua",
"bytes": "1547"
},
{
"name": "Makefile",
"bytes": "18817"
},
{
"name": "Python",
"bytes": "1240773"
},
{
"name": "Shell",
"bytes": "25650"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Keyboard Input for chat-bubble</title>
<!-- for mobile screens -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- stylesheets are conveniently separated into components -->
<link rel="stylesheet" media="all" href="../component/styles/setup.css">
<link rel="stylesheet" media="all" href="../component/styles/says.css">
<link rel="stylesheet" media="all" href="../component/styles/reply.css">
<link rel="stylesheet" media="all" href="../component/styles/typing.css">
<link rel="stylesheet" media="all" href="../component/styles/input.css">
<style>
body {
background: #dcdde0;
}
.bubble-container {
height: 100vh;
}
.bubble-container .input-wrap textarea {
margin: 0;
width: calc(100% - 30px);
}
</style>
</head>
<body>
<!-- container element for chat window -->
<div id="chat"></div>
<!-- import the JavaScript file -->
<script src="../component/Bubbles.js"></script>
<script>
// initialize by constructing a named function...
// ...and add text processing plugin:
var chatWindow = new Bubbles(document.getElementById("chat"), "chatWindow", {
// the one that we care about is inputCallbackFn()
// this function returns an object with some data that we can process from user input
// and understand the context of it
// this is an example function that matches the text user typed to one of the answer bubbles
// this function does no natural language processing
// this is where you may want to connect this script to NLC backend.
inputCallbackFn: function(o) {
// add error conversation block & recall it if no answer matched
var miss = function() {
chatWindow.talk(
{
"i-dont-get-it": {
says: [
"Sorry, I don't get it 😕. Pls repeat? Or you can just click below 👇"
],
reply: o.convo[o.standingAnswer].reply
}
},
"i-dont-get-it"
)
}
// do this if answer found
var match = function(key) {
setTimeout(function() {
chatWindow.talk(convo, key) // restart current convo from point found in the answer
}, 600)
}
// sanitize text for search function
var strip = function(text) {
return text.toLowerCase().replace(/[\s.,\/#!$%\^&\*;:{}=\-_'"`~()]/g, "")
}
// search function
var found = false
o.convo[o.standingAnswer].reply.forEach(function(e, i) {
strip(e.question).includes(strip(o.input)) && o.input.length > 0
? (found = e.answer)
: found ? null : (found = false)
})
found ? match(found) : miss()
}
}) // done setting up chat-bubble
// conversation object defined separately, but just the same as in the
// "Basic chat-bubble Example" (1-basics.html)
var convo = {
ice: {
says: ["Hi", "Would you like banana or ice cream?"],
reply: [
{
question: "Banana",
answer: "banana"
},
{
question: "Ice Cream",
answer: "ice-cream"
}
]
},
banana: {
says: ["🍌"],
reply: [
{
question: "Start Over",
answer: "ice"
}
]
},
"ice-cream": {
says: ["🍦"],
reply: [
{
question: "Start Over",
answer: "ice"
}
]
}
}
// pass JSON to your function and you're done!
chatWindow.talk(convo)
</script>
</body>
| {
"content_hash": "1f9a3bacb0f2b34a10ca3462e95e3ccc",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 94,
"avg_line_length": 27.168,
"alnum_prop": 0.600412249705536,
"repo_name": "dmitrizzle/chat-bubble",
"id": "f742a64e4a2e54fd2c3cb38ad476ee8df31a6063",
"size": "3408",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/3-keyboard-input.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6095"
},
{
"name": "JavaScript",
"bytes": "12294"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{ site.title }}</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- GOOGLE WEB FONTS -->
<link href='http://fonts.googleapis.com/css?family=Ubuntu+Mono' rel='stylesheet' type='text/css'>
<!-- APP-SPECIFIC CSS -->
<link rel="stylesheet" href="{{ site.baseurl }}/css/app.css">
<script src="{{ site.baseurl }}/js/lib/modernizr-2.6.2.min.js"></script>
</head>
<body>
<div class="support">If you can read this, it means you're browser isn't supported. For best results use a recent version of Firefox or Chrome.</div>
<!-- TEMPLATES -->
<script type="text/template" id="game-ui-template">
<header>
<h1>{{ site.title }}</h1>
<span class="music">pause music</span>
</header>
<div class="about">
<div class="about-inner">
<p>Explore the keyboard.</p>
<p>Explore the game.</p>
<p> </p>
<p><a href="http://sethvincent.com/tagged/jumpbud" target="_blank">→ Read about <em>jump, bud.</em></a></p>
<p><a href="http://github.com/sethvincent/jump-bud" target="_blank">→ Fork the code on GitHub.</a></p>
<span class="close">close</span>
</div>
</div>
<div class="tomato-plant"></div>
<footer>
<a href="http://github.com/sethvincent/jump-bud" target="_blank">fork on github</a>
<span class="about-jump-buds">about the game</span>
</footer>
</script>
<!-- JAVASCRIPT -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="{{ site.baseurl }}/js/lib/underscore-min.js"></script>
<script src="{{ site.baseurl }}/js/lib/backbone-min.js"></script>
<script src="{{ site.baseurl }}/js/lib/plugins.js"></script>
<script src="{{ site.baseurl }}/js/lib/buzz.js"></script>
<script src="{{ site.baseurl }}/js/app.js"></script>
</body>
</html> | {
"content_hash": "80936a5c08156090b7ef36b1b6b963e4",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 151,
"avg_line_length": 40.327586206896555,
"alnum_prop": 0.5929884566053869,
"repo_name": "sethvincent/jump-bud",
"id": "fc3e27e1c72c738ee0674a133a679dba48338b70",
"size": "2348",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "32816"
}
],
"symlink_target": ""
} |
package org.apache.aries.blueprint.plugin.test;
import org.apache.aries.blueprint.plugin.test.interfaces.ServiceA;
import org.apache.aries.blueprint.plugin.test.interfaces.ServiceB;
import org.ops4j.pax.cdi.api.OsgiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
@Singleton
@Lazy(false)
public class BeanWithSetters {
@Inject
@Named("my1")
public void setServiceA1(ServiceA serviceA1) {
}
@Inject
@Qualifier("my2")
public void setServiceA2(ServiceA serviceA2) {
}
@Autowired
public void setServiceB(ServiceB serviceB) {
}
@Inject
@Named("serviceB2Id")
public void setServiceB2(ServiceB serviceB2) {
}
public void setUseless(MyProduced myProduced) {
}
@Inject
public void setIOnlyHaveSetPrefix() {
}
@Inject
public void setIhaveMoreThenOneParameter(String a, String b) {
}
@Value("test")
public void setIOnlyHaveSetPrefixValue() {
}
@Value("test")
public void setIhaveMoreThenOneParameterValue(String a, String b) {
}
@Value("test")
public void setMyValue(String v) {
}
@Inject
public void setServiceBRef(@OsgiService(filter = "(type=B1Ref)") ServiceB serviceBRef) {
}
@Inject
@Named("serviceB2IdRef")
@OsgiService(filter = "(type=B2Ref)")
public void setServiceB2Ref(ServiceB serviceB2Ref) {
}
@Inject
@OsgiService(filter = "B3Ref")
public void setServiceB3Ref(ServiceB serviceB3Ref) {
}
}
| {
"content_hash": "37a24647ac925d86806a49883eda5aed",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 92,
"avg_line_length": 23.25,
"alnum_prop": 0.7085455574419921,
"repo_name": "apache/aries",
"id": "27e4280aca587f1cbbd2422b53d9d62a57cc1378",
"size": "2583",
"binary": false,
"copies": "5",
"ref": "refs/heads/trunk",
"path": "blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/BeanWithSetters.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "488"
},
{
"name": "CSS",
"bytes": "32833"
},
{
"name": "Groovy",
"bytes": "13115"
},
{
"name": "HTML",
"bytes": "83923"
},
{
"name": "Java",
"bytes": "9220649"
},
{
"name": "JavaScript",
"bytes": "189672"
},
{
"name": "Roff",
"bytes": "2344"
},
{
"name": "Shell",
"bytes": "7323"
}
],
"symlink_target": ""
} |
/*
* File: Set.cpp
* Author: matt
*
* Created on December 9, 2013, 3:04 PM
*/
#include "Set.h"
#include "Deck.h"
const std::vector<Set::SetType> Set::settypes() { return std::vector<Set::SetType>{Set::SetType::NORMAL, Set::SetType::ALL, Set::SetType::KANJI, Set::SetType::KANA}; }
std::unordered_map<Set::SetType, std::unordered_map<Set::DispType, std::unordered_set<std::vector<Card::Field>, Set::vfhash>, Set::dthash>, Set::sthash> Set::defdisp()
{
return std::unordered_map<Set::SetType, std::unordered_map<Set::DispType, std::unordered_set<std::vector<Card::Field>, Set::vfhash>, Set::dthash>, Set::sthash> { // Your worst nightmare
{Set::SetType::NORMAL,
{{Set::DispType::FRONT, {{Card::Field::MEANING}, {Card::Field::FURIGANA}}},
{Set::DispType::BACK, {{Card::Field::FURIGANA, Card::Field::MEANING}}},
{Set::DispType::HINT, {{Card::Field::HIRAGANA}}}}},
{Set::SetType::ALL,
{{Set::DispType::FRONT, {{Card::Field::MEANING}, {Card::Field::FURIGANA}}},
{Set::DispType::BACK, {{Card::Field::FURIGANA, Card::Field::MEANING}}},
{Set::DispType::HINT, {{Card::Field::HIRAGANA}}}}},
{Set::SetType::KANJI,
{{Set::DispType::FRONT, {{Card::Field::MEANING}}},
{Set::DispType::BACK, {{Card::Field::FURIGANA, Card::Field::MEANING}}},
{Set::DispType::HINT, {{Card::Field::HIRAGANA}}}}},
{Set::SetType::KANA,
{{Set::DispType::FRONT, {{Card::Field::MEANING}, {Card::Field::FURIGANA}}},
{Set::DispType::BACK, {{Card::Field::FURIGANA, Card::Field::MEANING}}},
{Set::DispType::HINT, {{Card::Field::HIRAGANA}}}}}
};
}
Set::Set(Deck *deck, SetType type) : items_{}, repeats_{}, type_{type}, top_{nullptr}, deck_{deck}, displays_{deck->disp(type)}, curdisp_{} { deck_->build(); shuffle(); }
std::string Set::canonical() const
{
return deck_->canonical() + ":" + st2str(type_);
}
void Set::clear()
{
if (! top_) return;
for (Deck *d = top_->deck(); d != &Deck::root; d = d->parent()) d->set(type_).top_ = nullptr; // TODO Check
top_ = nullptr;
}
Card &Set::top()
{
if (top_) return *top_;
std::vector<Set *> viable{};
if (items_.size() > 0) viable.push_back(this);
for (Deck *d : deck_->children()) if (d->set(type_).size(false) > 0) viable.push_back(&d->set(type_));
if (viable.size() == 0)
{
if (repeats_.size() > 0) viable.push_back(this);
for (Deck *d : deck_->children()) if (d->set(type_).size(true) > 0) viable.push_back(&d->set(type_));
}
Set *src = viable[rand() % viable.size()];
if (src == this)
{
if (src->items_.size() > 0) { top_ = src->items_.front(); src->items_.pop_front(); }
else if (src->repeats_.size() > 0) { top_ = src->repeats_.front(); src->repeats_.pop_front(); }
else throw std::runtime_error{"Tried to get card out of empty deck"};
}
else top_ = &src->top();
for (std::pair<DispType, std::unordered_set<std::vector<Card::Field>, vfhash>> pair : displays_)
{
std::unordered_set<std::vector<Card::Field>, vfhash>::iterator iter = pair.second.begin();
std::advance(iter, rand() % pair.second.size());
curdisp_[pair.first] = *iter;
}
return *top_;
}
std::string Set::disptop(DispType type)
{
Card &c_top = top();
return c_top.display(curdisp_.at(type));
}
void Set::shuffle()
{
clear();
std::list<Card *> temp{};
while (items_.size())
{
temp.push_back(items_.front());
items_.pop_front();
}
while(temp.size())
{
std::list<Card *>::iterator iter = std::next(temp.begin(), rand() % temp.size());
items_.push_back(*iter);
temp.erase(iter);
}
}
int Set::size(bool repeats) const
{
int ret = items_.size();
if (repeats) ret += repeats_.size();
if (top_ != nullptr && top_->deck() == deck_) ret++;
for (Deck *d : deck_->children()) ret += d->set(type_).size(repeats);
//std::cout << "Set " << canonical() << " size " << ret << " top " << (top_ ? util::t2s(top_->id()) : "nil") << "\n\tItems:\n";
//for (Card *c : items_) std::cout << "\t\t" << c->id() << "\n";
//std::cout << "\tRepeats:\n";
//for (Card *c : repeats_) std::cout << "\t\t" << c->id() << "\n";
return ret;
}
void Set::remove(Card *card)
{
std::deque<Card *>::iterator iter;
iter = std::find(items_.begin(), items_.end(), card);
if (iter != items_.end())
{
items_.erase(iter);
return;
}
iter = std::find(repeats_.begin(), repeats_.end(), card);
if (iter != repeats_.end()) repeats_.erase(iter);
}
void Set::update(Card::UpdateType ut)
{
if (top_ == nullptr) throw std::runtime_error{"Tried to update inactive set"};
top_->update(ut);
if (type_ == SetType::KANJI) top_->deck()->bank().update(top_, ut);
if (ut == Card::UpdateType::BURY || top_->due(0)) top_->deck()->set(type_).repeats_.push_back(top_);
else for (std::unordered_map<Set::SetType, Set>::iterator iter = top_->deck()->sets().begin(); iter != top_->deck()->sets().end(); iter++) iter->second.remove(top_);
clear();
}
| {
"content_hash": "172aa0022e1086beb4fc5da156752341",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 186,
"avg_line_length": 35.909774436090224,
"alnum_prop": 0.6063651591289783,
"repo_name": "showermat/tango",
"id": "3dd39965a8c31f152ffe99d51b6bc601295f4533",
"size": "4776",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Set.cpp",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "115861"
},
{
"name": "CMake",
"bytes": "577"
}
],
"symlink_target": ""
} |
<ns0:DryadDataFile xmlns:ns0="http://purl.org/dryad/schema/terms/v3.1" xmlns:ns2="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://purl.org/dryad/schema/terms/v3.1 http://datadryad.org/profile/v3.1/dryad.xsd">
<ns2:type>file</ns2:type>
<ns2:creator>Vézilier, Julien</ns2:creator>
<ns2:creator>Nicot, Antoine</ns2:creator>
<ns2:creator>De Lorgeril, Julien</ns2:creator>
<ns2:creator>Gandon, Sylvain</ns2:creator>
<ns2:creator>Rivero, Ana</ns2:creator>
<ns2:title>Dataset Vézilier et al 2012 Isogenic</ns2:title>
<ns2:identifier>http://dx.doi.org/10.5061/dryad.1pp2c/2</ns2:identifier>
<ns2:rights>http://creativecommons.org/publicdomain/zero/1.0/</ns2:rights>
<ns2:description>qPCR data for the isogenic mosquitoes experiment described in Vézilier et al. 2012, "The impact of insecticide resistance on Culex pipiens immunity"</ns2:description>
<ns2:subject>Disease Biology</ns2:subject>
<ns2:subject>Host Parasite Interactions</ns2:subject>
<ns2:subject>Life History Evolution</ns2:subject>
<ns2:subject>Molecular Evolution</ns2:subject>
<ns2:dateSubmitted>2012-11-09T15:35:39Z</ns2:dateSubmitted>
<ns2:available>2012-12-14T18:08:10Z</ns2:available>
<ns2:provenance>Made available in DSpace on 2012-11-09T15:35:39Z (GMT). No. of bitstreams: 1
Dataset Vézilier et al 2012 Isogenic.xlsx: 73185 bytes, checksum: e7106f89e6ba7cbfc889db76f4878fc1 (MD5)</ns2:provenance>
<ns2:isPartOf>http://dx.doi.org/10.5061/dryad.1pp2c</ns2:isPartOf>
</ns0:DryadDataFile> | {
"content_hash": "37398cc398f3a45e38118e1ffdf622bb",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 268,
"avg_line_length": 74.66666666666667,
"alnum_prop": 0.7563775510204082,
"repo_name": "NCEAS/metadig",
"id": "7ffdc2a60dae274a8e82d5e41bcb445f8455d6d8",
"size": "1568",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "results/DRYAD/Dryad_Metadata_Application_Profile_Version_3.1/xml/00940-metadata.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "2361"
},
{
"name": "Python",
"bytes": "42696"
},
{
"name": "Shell",
"bytes": "5798"
},
{
"name": "XSLT",
"bytes": "207495"
}
],
"symlink_target": ""
} |
import { createSelectorTree, createLeaf } from "reselect-tree";
const PAST_END_OF_TRACE = {
depth: -1, //this is the part that matters!
//the rest of this is just to look like a trace step
error: "",
gas: 0,
memory: [],
stack: [],
storage: {},
gasCost: 0,
op: "STOP",
pc: -1 //this is not at all valid but that's fine
};
let trace = createSelectorTree({
/**
* trace.index
*
* current step index
*/
index: state => state.trace.proc.index,
/*
* trace.loaded
* is a trace loaded?
*/
loaded: createLeaf(["/steps"], steps => steps !== null),
/**
* trace.finished
* is the trace finished?
*/
finished: state => state.trace.proc.finished,
/**
* trace.finishedOrUnloaded
*
* is the trace finished, including if it's unloaded?
*/
finishedOrUnloaded: createLeaf(
["/finished", "/loaded"],
(finished, loaded) => finished || !loaded
),
/**
* trace.steps
*
* all trace steps
*/
steps: state => state.trace.transaction.steps,
/**
* trace.stepsRemaining
*
* number of steps remaining in trace
*/
stepsRemaining: createLeaf(
["./steps", "./index"],
(steps, index) => steps.length - index
),
/**
* trace.step
*
* current trace step
* HACK: if no steps,
* we will return a spoofed "past end" step
*/
step: createLeaf(
["./steps", "./index"],
(steps, index) =>
steps ? (steps.length > 0 ? steps[index] : PAST_END_OF_TRACE) : null //null if no tx loaded
),
/**
* trace.next
*
* next trace step
* HACK: if at the end,
* we will return a spoofed "past end" step
*/
next: createLeaf(["./steps", "./index"], (steps, index) =>
index < steps.length - 1 ? steps[index + 1] : PAST_END_OF_TRACE
),
/*
* trace.nextOfSameDepth
* next trace step that's at the same depth as this one
* NOTE: if there is none, will return undefined
* (should not be used in such cases)
* NOTE: for additional correctness, will stop searching once
* it hits something of *lower* depth (yes that makes the name
* a little misleading, but the idea is to find the return step
* for a given call step)
*/
nextOfSameDepth: createLeaf(["./steps", "./index"], (steps, index) => {
let depth = steps[index].depth;
for (let step of steps.slice(index + 1)) {
//start searching after current step
//using a manual for loop here instead of .find in order to
//cut off the search early if needed
if (step.depth === depth) {
return step;
}
if (step.depth < depth) {
return undefined;
}
}
return undefined;
}),
/**
* trace.application
*/
application: {
/**
* trace.application.submoduleCount
*/
submoduleCount: state => state.trace.application.submoduleCount
}
});
export default trace;
| {
"content_hash": "191a524f9621cc401828a8bf0d0ebf82",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 97,
"avg_line_length": 23.10483870967742,
"alnum_prop": 0.5968586387434555,
"repo_name": "ConsenSys/truffle",
"id": "008b3c52de8fef98ec871bef3ec374beaf1dd319",
"size": "2865",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/debugger/lib/trace/selectors/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "125921"
}
],
"symlink_target": ""
} |
package ist.meic.pa.tests;
import ist.meic.pa.GenericFunctions.*;
class Shape {}
class Line extends Shape {}
class Circle extends Shape {}
class Device {}
class Screen extends Device {}
class Printer extends Device {}
public class TestC {
public static void main(String[] args) {
final GenericFunction draw = new GenericFunction("draw");
draw.addMethod(new GFMethod() {
Object call(Device d, Shape s) {
System.err.println("draw what where?");
return "";
}});
draw.addMethod(new GFMethod() {
Object call(Device d, Line l) {
System.err.println("draw a line where?");
return "";
}});
draw.addMethod(new GFMethod() {
Object call(Device d, Circle c) {
System.err.println("draw a circle where?");
return "";
}});
draw.addMethod(new GFMethod() {
Object call(Screen d, Shape s) {
System.err.println("draw what on screen?");
return "";
}});
draw.addMethod(new GFMethod() {
Object call(Screen d, Line l) {
System.err.println("drawing a line on screen!");
return "";
}});
draw.addMethod(new GFMethod() {
Object call(Screen d, Circle c) {
System.err.println("drawing a circle on screen!");
return "";
}});
draw.addMethod(new GFMethod() {
Object call(Printer d, Shape s) {
System.err.println("draw what on printer?");
return "";
}});
draw.addMethod(new GFMethod() {
Object call(Printer d, Line l) {
System.err.println("drawing a line on printer!");
return "";
}});
draw.addMethod(new GFMethod() {
Object call(Printer d, Circle c) {
System.err.println("drawing a circle on printer!");
return "";
}});
Device[] devices = new Device[] { new Screen(), new Printer() };
Shape[] shapes = new Shape[] { new Line(), new Circle() };
for (Device device : devices) {
for (Shape shape : shapes) {
draw.call(device, shape);
}
}
}
}
| {
"content_hash": "ea71257653f8377b5aa6929fa57d9a15",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 66,
"avg_line_length": 22.267441860465116,
"alnum_prop": 0.6161879895561357,
"repo_name": "diogoleitao/pava-reprise",
"id": "5ed024eb45c29a2c8c1fffdba60079399f6e31ed",
"size": "1915",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "GenericFunctions/src/ist/meic/pa/tests/TestC.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "8832"
}
],
"symlink_target": ""
} |
<walkthrough-tutorial-duration duration="5"></walkthrough-tutorial-duration>
## Presentazione
Questo tutorial illustra le funzionalità principali di Cloud Console che ti permettono di iniziare a creare e gestire le tue applicazioni su Google Cloud Platform.
Potrai apprendere i seguenti concetti:
* Risorse e progetti GCP
* Panoramica generale delle risorse e log delle attività
* Navigazione e ricerca nella console
* Gestione utenti e autorizzazioni
* Assistenza tecnica
* Riga di comando basata su browser di GCP
Iniziamo.
## Utilizzo delle risorse GCP
Le risorse GCP sono le componenti fondamentali che formano tutti i servizi Google Cloud. Le risorse sono organizzate in modo gerarchico e permettono di organizzare il lavoro su GCP.
I progetti sono il primo livello della gerarchia di risorse e contengono altre risorse di basso livello come i bucket di Cloud Storage e le istanze di Compute Engine.
[Ulteriori informazioni sulle risorse GCP][gcp-resources]
### Navigazione tra i progetti
Puoi navigare facilmente tra i progetti GCP utilizzando il [selettore dell'ambito][spotlight-project-select] in Cloud Console. Lo spostamento tra i progetti consente di adattare la visualizzazione a quella del progetto e di tutte le sue risorse figlio.
<walkthrough-project-setup></walkthrough-project-setup>
## Navigazione tra i servizi Google Cloud
### Navigazione tra i servizi
Puoi accedere ai servizi Google Cloud nel [menu di navigazione di sinistra][spotlight-console-menu] organizzato per area di prodotti come Big Data, Compute, Networking, ecc.
### Blocco delle sezioni
Se visiti con regolarità determinati servizi, puoi fissare la sezione corrispondente nella parte superiore del menu di navigazione passando con il puntatore del mouse sopra la voce della sezione e facendo clic sulla relativa icona.
Apri il menu di navigazione e seleziona **Home** per continuare.
<walkthrough-menu-navigation sectionid="HOME_SECTION"></walkthrough-menu-navigation>
## Guardare una panoramica generale di un progetto
### Dashboard della home page
La dashboard della home page fornisce una panoramica generale del progetto GCP selezionato ed evidenzia metriche chiave, dati di fatturazione e altre informazioni utili.
### Personalizzazione
Puoi personalizzare la tua dashboard facendo clic su [Personalizza][spotlight-customize-dashboard].
Puoi nascondere, mostrare e riordinare tutte le schede nella pagina. Inoltre, ogni scheda contiene opzioni personalizzate alle quali puoi accedere dal menu extra quando passi il mouse sopra una scheda.
## Visualizzazione delle attività nelle risorse GCP
Nella sezione [Flusso di attività][spotlight-activity-stream] puoi interpretare centralmente tutte le attività eseguite nelle varie risorse GCP.
Scopri gli elementi che i colleghi del tuo team stanno aggiornando in qualsiasi progetto per rilevare i problemi e controllare l'accesso. Puoi filtrare facilmente il feed per trovare esattamente ciò che cerchi.
## Ricerca in Cloud Console
La [barra di ricerca][spotlight-search-bar] consente di accedere rapidamente ai prodotti Google Cloud e a qualsiasi risorsa all'interno di GCP.
Prova a cercare **App Engine** o il nome di uno dei tuoi progetti.
## Assistenza continua
Se hai dei problemi o ti serve aiuto per qualsiasi aspetto di GCP, contatta il nostro team di assistenza.
[Ulteriori informazioni sull'assistenza](http://cloud.google.com/support)
Accedi all'assistenza dal menu di navigazione.
<walkthrough-menu-navigation sectionid="SUPPORT_SECTION"></walkthrough-menu-navigation>
## Gestione di utenti e autorizzazioni
Google Cloud Identity and Access Management (Cloud IAM) consente di gestire e creare le autorizzazioni per le risorse GCP.
[Ulteriori informazioni su IAM](https://cloud.google.com/iam/docs/)
Man mano che il tuo team cresce, puoi concedere l'accesso ai vari membri utilizzando Cloud IAM nella sezione "IAM e amministrazione".
Aggiungi utenti, gruppi o account di servizio e assegna loro tutti i ruoli necessari per concedere le autorizzazioni di cui hanno bisogno.
<walkthrough-menu-navigation sectionid="IAM_ADMIN_SECTION"></walkthrough-menu-navigation>
## Accesso alla riga di comando dal browser
Google Cloud Shell fornisce l'accesso a riga di comando alle risorse cloud direttamente dal tuo browser. Puoi gestire facilmente progetti e risorse senza dover installare l'SDK di Google Cloud o altri strumenti nel tuo sistema.
Con <walkthrough-cloud-shell-icon></walkthrough-cloud-shell-icon>[Cloud Shell][spotlight-open-devshell], lo strumento a riga di comando gcloud di Cloud SDK e altre utilità necessarie sono sempre disponibili, aggiornati e completamente autenticati quando ne hai bisogno.
[Ulteriori informazioni su Cloud Shell](https://cloud.google.com/shell/)
## Continua a scoprire GCP
<walkthrough-conclusion-trophy></walkthrough-conclusion-trophy>
Adesso dovresti avere delle conoscenze di base solide per utilizzare Cloud Console ed esplorare nuovi servizi e prodotti.
La nostra [documentazione dettagliata](https://cloud.google.com/docs/) fornisce inoltre moltissime informazioni, dalle panoramiche dei prodotti alle guide di avvio rapido, fino ai riferimenti per le API.
Torna alla pagina Per iniziare per guardare altri tutorial.
<walkthrough-menu-navigation sectionid="ONBOARDING_SECTION"></walkthrough-menu-navigation>
[gcp-resources]: https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy
[spotlight-activity-stream]: walkthrough://spotlight-pointer?cssSelector=.mat-tab-link:nth-of-type(2)
[spotlight-console-menu]: walkthrough://spotlight-pointer?spotlightId=console-nav-menu
[spotlight-customize-dashboard]: walkthrough://spotlight-pointer?cssSelector=.cfc-customize-button
[spotlight-open-devshell]: walkthrough://spotlight-pointer?spotlightId=devshell-activate-button
[spotlight-project-select]: walkthrough://spotlight-pointer?spotlightId=purview-switcher
[spotlight-search-bar]: walkthrough://spotlight-pointer?cssSelector=.p6n-search-bar,.pcc-platform-bar-search-bar
| {
"content_hash": "90df7ae0063c0586425581105f126643",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 269,
"avg_line_length": 52.11206896551724,
"alnum_prop": 0.8092638544251447,
"repo_name": "GoogleCloudPlatform/cloud-shell-tutorials",
"id": "15a21eaac55c3f9253588181d8a6d61c2a1650ec",
"size": "6078",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cloud-console-tutorials/console_tour_nav/console_tour_nav-it.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "197"
},
{
"name": "Python",
"bytes": "5997"
}
],
"symlink_target": ""
} |
import * as React from 'react'
import styled from 'styled-components'
import type { User, Profile } from 'types/user'
import Avater from 'components/Avater'
import TextAutoLink from 'components/TextAutoLink'
import Navigation from './Navigation'
const Header = ({ user, profile }: { user: User, profile: Profile }) => (
<Wrap>
<Navigation user={user} profile={profile} />
<ImageWrap>
<Avater src={user.profileImageUrls.medium} size={140} />
</ImageWrap>
<Info>
<h1>{user.name}</h1>
</Info>
<Caption>{user.comment && <TextAutoLink text={user.comment} />}</Caption>
</Wrap>
)
const Wrap = styled.div`
background-color: #eee;
padding-bottom: 30px;
`
const ImageWrap = styled.div`
position: relative;
width: 100%;
height: 100%;
margin: 20px auto;
text-align: center;
`
const Info = styled.div`
text-align: center;
`
const Caption = styled.div`
background-color: #fff;
border-radius: 2px;
margin: 10px 20px;
padding: 10px 20px;
line-height: 21px;
font-size: 14px;
`
export default Header
| {
"content_hash": "18e8c546450aa1428adcd9dbe27c1f67",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 77,
"avg_line_length": 22.48936170212766,
"alnum_prop": 0.6707663197729423,
"repo_name": "akameco/PixivDeck",
"id": "2c67d9ef29979fa6d80caac29217e679ec6c27ea",
"size": "1066",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/components/UserDrawer/DrawerHeader.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "714"
},
{
"name": "JavaScript",
"bytes": "330164"
}
],
"symlink_target": ""
} |
@interface UsersCreationViewController()
{
CoreDataHelper *dataHelper;
CurrentUser *currentUser;
//This variable is to manage different size of screens
CGFloat screenFactor;
Utility *utility;
NSArray *fetchedUsers;
//if it is the view to change user or to add user,
//we will show the plus user button and other titles
BOOL isChangingUserView;
}
@property (nonatomic,weak)IBOutlet UILabel *plusUserNote;
@end
@implementation UsersCreationViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// show the naviagtion bar
self.navigationController.navigationBarHidden = NO;
self.view.backgroundColor = BACKGROUND_COLOR;
if (self.navTitle == nil) {
self.navTitle = @"用户";
}
[self.navigationItem setTitle: self.navTitle];
self.navigationItem.titleView.hidden = NO;
if (![self.navigationItem.title isEqualToString:@"家人健康信息"]) {
isChangingUserView = YES;
}
else
{
isChangingUserView = NO;
[_plusUserNote setHidden:YES];
}
//set title color
[self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
// [self.view bringSubviewToFront:self.plusUser];
//set images
if (IS_IPHONE_PLUS) {
screenFactor = 1.1;
}
else if (!IS_IPHONE_6)
{
screenFactor = 0.83;
}
else
screenFactor = 1;
utility = [[Utility alloc]init];
// UIImage *image = [UIImage imageNamed: @"background_small_white_circle"];
// UIImageView *aView = [[UIImageView alloc]initWithImage:image];
//
// CGFloat widthScale = (90 * screenFactor)/image.size.width;
// CGFloat heightScale = (90 * screenFactor)/image.size.height;
// aView.transform = CGAffineTransformMakeScale(widthScale, heightScale);
// UILabel *aLabel = [[UILabel alloc]init];
// Establish Core Data
dataHelper = [[CoreDataHelper alloc] init];
dataHelper.entityName = @"User";
dataHelper.defaultSortAttribute = @"userName";
[dataHelper setupCoreData];
NSInteger numberofEntities = [dataHelper numberOfEntities];
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSError *error;
NSEntityDescription *entity = [NSEntityDescription entityForName:@"User"
inManagedObjectContext:dataHelper.context];
[fetchRequest setEntity:entity];
fetchedUsers = [dataHelper.context executeFetchRequest:fetchRequest error:&error];
// aTap.delegate = self;
if (numberofEntities == 0) {
//add icon for adding user
//on the top
[self setAddUserButtonforPlace:-120 and:-120];
}
if (numberofEntities >= 1)
{
//on the left top
[self setUserImageViewforPlace:-120 and:-120 andForUser:1];
[self setUserNameLabelViewforPlace:-120 and:-65 andForUser:1];
if (numberofEntities == 1) {
//add icon for adding user
//on the top
[self setAddUserButtonforPlace:0 and:-120];
}
}
if (numberofEntities >= 2) {
//on the top
[self setUserImageViewforPlace:0 and:-120 andForUser:2];
[self setUserNameLabelViewforPlace:0 and:-65 andForUser:2];
if (numberofEntities == 2) {
//add icon for adding user
//on the top right
[self setAddUserButtonforPlace:120 and:-120];
}
}
if (numberofEntities >= 3) {
//on the top right
[self setUserImageViewforPlace:120 and:-120 andForUser:3];
[self setUserNameLabelViewforPlace:120 and:-65 andForUser:3];
if (numberofEntities == 3) {
//add icon for adding user
//on the left
[self setAddUserButtonforPlace:-120 and:20];
}
}
if (numberofEntities >= 4) {
//on the left
[self setUserImageViewforPlace:-120 and:20 andForUser:4];
[self setUserNameLabelViewforPlace:-120 and:78 andForUser:4];
if (numberofEntities == 4) {
//add icon for adding user
//on the center
[self setAddUserButtonforPlace:0 and:20];
}
}
if (numberofEntities >= 5) {
//on the center
[self setUserImageViewforPlace:0 and:20 andForUser:5];
[self setUserNameLabelViewforPlace:0 and:78 andForUser:5];
if (numberofEntities == 5) {
//add icon for adding user
//on the right
[self setAddUserButtonforPlace:120 and:20];
}
}
if (numberofEntities >= 6) {
//on the right
[self setUserImageViewforPlace:120 and:20 andForUser:6];
[self setUserNameLabelViewforPlace:120 and:78 andForUser:6];
if (numberofEntities == 6) {
//add icon for adding user
//on the bottom left
[self setAddUserButtonforPlace:-120 and:160];
}
}
if (numberofEntities >= 7) {
//on the bottom left
[self setUserImageViewforPlace:-120 and:160 andForUser:7];
[self setUserNameLabelViewforPlace:-120 and:215 andForUser:7];
if (numberofEntities == 7) {
//add icon for adding user
//on the bottom
[self setAddUserButtonforPlace:0 and:160];
}
}
if (numberofEntities >= 8) {
//beneath the centre
[self setUserImageViewforPlace:0 and:160 andForUser:8];
[self setUserNameLabelViewforPlace:0 and:215 andForUser:8];
if (numberofEntities == 8) {
//add icon for adding user
//on the bottom right
[self setAddUserButtonforPlace:120 and:160];
}
}
if (numberofEntities >= 9) {
//on the bottom right
[self setUserImageViewforPlace:120 and:160 andForUser:9];
[self setUserNameLabelViewforPlace:120 and:215 andForUser:9];
}
}
-(UIImageView *)setUserImageViewforPlace:(int)HCoord and:(int)VCoord andForUser:(int) userOrder{
UIImageView *aView = [[UIImageView alloc]init];
User *fetchedUser;
UIImage *anImage;
switch (userOrder) {
case 0:
//We will tag the view to distinguish the tap
aView.tag = 200;
break;
case 1:
fetchedUser = [fetchedUsers firstObject];
//We will tag the view to distinguish the tap
aView.tag = 201;
break;
case 2:
fetchedUser = [fetchedUsers objectAtIndex:1];
aView.tag = 202;
break;
case 3:
fetchedUser = [fetchedUsers objectAtIndex:2];
aView.tag = 203;
break;
case 4:
fetchedUser = [fetchedUsers objectAtIndex:3];
aView.tag = 204;
break;
case 5:
fetchedUser = [fetchedUsers objectAtIndex:4];
aView.tag = 205;
break;
case 6:
fetchedUser = [fetchedUsers objectAtIndex:5];
aView.tag = 206;
break;
case 7:
fetchedUser = [fetchedUsers objectAtIndex:6];
aView.tag = 207;
break;
case 8:
fetchedUser = [fetchedUsers objectAtIndex:7];
aView.tag = 208;
break;
case 9:
fetchedUser = [fetchedUsers objectAtIndex:8];
aView.tag = 209;
break;
default:
break;
}
// if(aView.tag != 200)
// {
anImage = [utility loadPhotoForUser:fetchedUser.userName];
aView.image = anImage;
CGFloat widthScale = (90 * screenFactor)/anImage.size.width;
CGFloat heightScale = (90 * screenFactor)/anImage.size.height;
aView.transform = CGAffineTransformMakeScale(widthScale, heightScale);
//set image to a circle
aView.layer.cornerRadius = aView.image.size.width/2;
aView.layer.masksToBounds = YES;
aView.layer.borderWidth = 3.0f;
aView.layer.borderColor = [UIColor whiteColor].CGColor;
[self.view addSubview:aView];
PREPCONSTRAINTS(aView);
CENTER_VIEW_H_CONSTANT(self.view, aView, HCoord * screenFactor);
CENTER_VIEW_V_CONSTANT(self.view, aView, VCoord * screenFactor);
//add tap gesture recognizer to each image view
UITapGestureRecognizer *aTap = [[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(handleTap:)];
[aView addGestureRecognizer:aTap];
aView.userInteractionEnabled = YES;
[aView setExclusiveTouch:YES];
return aView;
}
-(UILabel *)setUserNameLabelViewforPlace:(int)HCoord and:(int)VCoord andForUser:(int)userOrder{
UILabel *aLabel = [[UILabel alloc]init];
UIImageView *aView = [[UIImageView alloc]init];
User *fetchedUser;
switch (userOrder) {
case 1:
fetchedUser = [fetchedUsers firstObject];
aLabel.tag = 301;
aView = (UIImageView *)[self.view viewWithTag:201];
break;
case 2:
fetchedUser = [fetchedUsers objectAtIndex:1];
aLabel.tag = 302;
aView = (UIImageView *)[self.view viewWithTag:202];
break;
case 3:
fetchedUser = [fetchedUsers objectAtIndex:2];
aLabel.tag = 303;
aView = (UIImageView *)[self.view viewWithTag:203];
break;
case 4:
fetchedUser = [fetchedUsers objectAtIndex:3];
aLabel.tag = 304;
aView = (UIImageView *)[self.view viewWithTag:204];
break;
case 5:
fetchedUser = [fetchedUsers objectAtIndex:4];
aLabel.tag = 305;
aView = (UIImageView *)[self.view viewWithTag:205];
break;
case 6:
fetchedUser = [fetchedUsers objectAtIndex:5];
aLabel.tag = 306;
aView = (UIImageView *)[self.view viewWithTag:206];
break;
case 7:
fetchedUser = [fetchedUsers objectAtIndex:6];
aLabel.tag = 307;
aView = (UIImageView *)[self.view viewWithTag:207];
break;
case 8:
fetchedUser = [fetchedUsers objectAtIndex:7];
aLabel.tag = 308;
aView = (UIImageView *)[self.view viewWithTag:208];
break;
case 9:
fetchedUser = [fetchedUsers objectAtIndex:8];
aLabel.tag = 309;
aView = (UIImageView *)[self.view viewWithTag:209];
break;
default:
break;
}
[self.view addSubview:aLabel];
PREPCONSTRAINTS(aLabel);
CENTER_VIEW_H_CONSTANT(self.view, aLabel, HCoord * screenFactor);
// CENTER_VIEW_V_CONSTANT(self.view, aLabel, VCoord * screenFactor);
int constant = 0;
//for photo user saved in the phone
if (aView.image.size.height == 750) {
constant = -325;// 750/2 - 90/2
}
//for the default saved photo (200x200)
else if(aView.image.size.height == 200){
constant = -50;// 200/2 - 90/2
}
ALIGN_VIEW1_TOP_TO_VIEW2_BOTTOM_CONSTANT(self.view, aLabel, aView, constant);
aLabel.text = fetchedUser.userName;
return aLabel;
}
-(UIButton *)setAddUserButtonforPlace:(int)HCoord and:(int)VCoord{
UIButton *addUserBtn = [[UIButton alloc] init];
UIImage *anImage;
//We will tag the view to distinguish the tap
addUserBtn.tag = 200;
if (isChangingUserView) {
[self.view addSubview:addUserBtn];
PREPCONSTRAINTS(addUserBtn);
CENTER_VIEW_H_CONSTANT(self.view, addUserBtn, HCoord * screenFactor);
CENTER_VIEW_V_CONSTANT(self.view, addUserBtn, VCoord * screenFactor);
anImage = [UIImage imageNamed: @"button_add_user"];
[addUserBtn setImage:anImage forState:UIControlStateNormal];
CGFloat widthScale = (90 * screenFactor)/anImage.size.width;
CGFloat heightScale = (90 * screenFactor)/anImage.size.height;
addUserBtn.transform = CGAffineTransformMakeScale(widthScale, heightScale);
//set image to a circle
addUserBtn.layer.cornerRadius = addUserBtn.imageView.image.size.width/2;
addUserBtn.layer.masksToBounds = YES;
// addUserBtn.layer.borderWidth = 3.0f;
addUserBtn.layer.borderColor = [UIColor whiteColor].CGColor;
//add tap gesture recognizer to each image view
UITapGestureRecognizer *aTap = [[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(handleTap:)];
[addUserBtn addGestureRecognizer:aTap];
addUserBtn.userInteractionEnabled = YES;
[addUserBtn setExclusiveTouch:YES];
}
return addUserBtn;
}
//The event handling method
- (void)handleTap:(UITapGestureRecognizer *)recognizer {
UIView *view = recognizer.view;
UILabel *aLabel = [[UILabel alloc]init];
switch (view.tag) {
case 201:
aLabel = (UILabel *)[self.view viewWithTag:301];
break;
case 202:
aLabel = (UILabel *)[self.view viewWithTag:302];
break;
case 203:
aLabel = (UILabel *)[self.view viewWithTag:303];
break;
case 204:
aLabel = (UILabel *)[self.view viewWithTag:304];
break;
case 205:
aLabel = (UILabel *)[self.view viewWithTag:305];
break;
case 206:
aLabel = (UILabel *)[self.view viewWithTag:306];
break;
case 207:
aLabel = (UILabel *)[self.view viewWithTag:307];
break;
case 208:
aLabel = (UILabel *)[self.view viewWithTag:308];
break;
case 209:
aLabel = (UILabel *)[self.view viewWithTag:309];
break;
default:
break;
}
if (view.tag == 200) {
//add user
UserInfoRegisterViewController *addUserVC = [self.storyboard instantiateViewControllerWithIdentifier:@"UserInfoRegisterViewController"];
[self.navigationController pushViewController:addUserVC animated:YES];
}
else
{
//if isChangingUser == YES;
//change current user to a normal user
if (isChangingUserView) {
[dataHelper fetchItemsMatching:@"1" forAttribute:@"isCurrentUser" sortingBy:nil];
if (dataHelper.fetchedResultsController.fetchedObjects.count > 1)
{
[NSException raise:@"系统错误" format:@"Too many current user : %lu", dataHelper.fetchedResultsController.fetchedObjects.count];
}
User *oldUser = dataHelper.fetchedResultsController.fetchedObjects.firstObject;
oldUser.isCurrentUser = [NSNumber numberWithInteger:0];
currentUser = [CurrentUser staticCurrentUser];
// we fetch the tapped user and set to current user
[dataHelper fetchItemsMatching:aLabel.text forAttribute:@"userName" sortingBy:nil];
User *userWantChangeTo = dataHelper.fetchedResultsController.fetchedObjects.firstObject;
[currentUser setCurrentUser:userWantChangeTo];
userWantChangeTo.isCurrentUser = [NSNumber numberWithInteger:1];
[dataHelper save];
NavigationViewController *navigationVC = [self.storyboard instantiateViewControllerWithIdentifier:@"NavigationViewController"];
[self.navigationController pushViewController:navigationVC animated:YES];
}
else
{
//HealthConditionTrendencyView
//
HealthConditionTrendencyViewController *healthConditionTrendencyVC = [[HealthConditionTrendencyViewController alloc]init];
[self.navigationController pushViewController:healthConditionTrendencyVC animated:YES];
}
}
}
@end
| {
"content_hash": "50d296d10d1f59b821319bf36db366a3",
"timestamp": "",
"source": "github",
"line_count": 451,
"max_line_length": 144,
"avg_line_length": 35.671840354767184,
"alnum_prop": 0.5977125808055693,
"repo_name": "zzmax/Gujia-Sofa",
"id": "792a9309883c849fb7d463230359c19fcf1c6eb6",
"size": "16625",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "iSmartHome/ViewControllers/UsersCreationViewController.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "255"
},
{
"name": "Objective-C",
"bytes": "1050639"
},
{
"name": "Objective-C++",
"bytes": "5532"
},
{
"name": "Ruby",
"bytes": "24"
}
],
"symlink_target": ""
} |
__author__ = 'andrei.muresan'
from behave import when, then
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
| {
"content_hash": "859d69f9df4534672425e9c111915aba",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 47,
"avg_line_length": 34.75,
"alnum_prop": 0.7985611510791367,
"repo_name": "raulpush/monitorizare-site",
"id": "dc044746e749da92735db16e004cbd8edd6f2f35",
"size": "139",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "features/steps/step_verificare_ue.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "733"
},
{
"name": "Cucumber",
"bytes": "9757"
},
{
"name": "Python",
"bytes": "46053"
},
{
"name": "Shell",
"bytes": "2011"
}
],
"symlink_target": ""
} |
""" A telnet server which negotiates"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import argparse
import os
import sys
import logging
try: # Python 2
import SocketServer as socketserver
except ImportError: # Python 3
import socketserver
log = logging.getLogger(__name__)
HOST = "localhost"
IDENT = "NTEL"
# The strings that indicate the test framework is checking our aliveness
VERIFIED_REQ = "verifiedserver"
VERIFIED_RSP = "WE ROOLZ: {pid}"
def telnetserver(options):
"""
Starts up a TCP server with a telnet handler and serves DICT requests
forever.
"""
if options.pidfile:
pid = os.getpid()
with open(options.pidfile, "w") as f:
f.write(str(pid))
local_bind = (HOST, options.port)
log.info("Listening on %s", local_bind)
# Need to set the allow_reuse on the class, not on the instance.
socketserver.TCPServer.allow_reuse_address = True
server = socketserver.TCPServer(local_bind, NegotiatingTelnetHandler)
server.serve_forever()
return ScriptRC.SUCCESS
class NegotiatingTelnetHandler(socketserver.BaseRequestHandler):
"""Handler class for Telnet connections.
"""
def handle(self):
"""
Negotiates options before reading data.
"""
neg = Negotiator(self.request)
try:
# Send some initial negotiations.
neg.send_do("NEW_ENVIRON")
neg.send_will("NEW_ENVIRON")
neg.send_dont("NAWS")
neg.send_wont("NAWS")
# Get the data passed through the negotiator
data = neg.recv(1024)
log.debug("Incoming data: %r", data)
if VERIFIED_REQ.encode('ascii') in data:
log.debug("Received verification request from test framework")
response = VERIFIED_RSP.format(pid=os.getpid())
response_data = response.encode('ascii')
else:
log.debug("Received normal request - echoing back")
response_data = data.strip()
if response_data:
log.debug("Sending %r", response_data)
self.request.sendall(response_data)
except IOError:
log.exception("IOError hit during request")
class Negotiator(object):
NO_NEG = 0
START_NEG = 1
WILL = 2
WONT = 3
DO = 4
DONT = 5
def __init__(self, tcp):
self.tcp = tcp
self.state = self.NO_NEG
def recv(self, bytes):
"""
Read bytes from TCP, handling negotiation sequences
:param bytes: Number of bytes to read
:return: a buffer of bytes
"""
buffer = bytearray()
# If we keep receiving negotiation sequences, we won't fill the buffer.
# Keep looping while we can, and until we have something to give back
# to the caller.
while len(buffer) == 0:
data = self.tcp.recv(bytes)
if not data:
# TCP failed to give us any data. Break out.
break
for byte_int in bytearray(data):
if self.state == self.NO_NEG:
self.no_neg(byte_int, buffer)
elif self.state == self.START_NEG:
self.start_neg(byte_int)
elif self.state in [self.WILL, self.WONT, self.DO, self.DONT]:
self.handle_option(byte_int)
else:
# Received an unexpected byte. Stop negotiations
log.error("Unexpected byte %s in state %s",
byte_int,
self.state)
self.state = self.NO_NEG
return buffer
def no_neg(self, byte_int, buffer):
# Not negotiating anything thus far. Check to see if we
# should.
if byte_int == NegTokens.IAC:
# Start negotiation
log.debug("Starting negotiation (IAC)")
self.state = self.START_NEG
else:
# Just append the incoming byte to the buffer
buffer.append(byte_int)
def start_neg(self, byte_int):
# In a negotiation.
log.debug("In negotiation (%s)",
NegTokens.from_val(byte_int))
if byte_int == NegTokens.WILL:
# Client is confirming they are willing to do an option
log.debug("Client is willing")
self.state = self.WILL
elif byte_int == NegTokens.WONT:
# Client is confirming they are unwilling to do an
# option
log.debug("Client is unwilling")
self.state = self.WONT
elif byte_int == NegTokens.DO:
# Client is indicating they can do an option
log.debug("Client can do")
self.state = self.DO
elif byte_int == NegTokens.DONT:
# Client is indicating they can't do an option
log.debug("Client can't do")
self.state = self.DONT
else:
# Received an unexpected byte. Stop negotiations
log.error("Unexpected byte %s in state %s",
byte_int,
self.state)
self.state = self.NO_NEG
def handle_option(self, byte_int):
if byte_int in [NegOptions.BINARY,
NegOptions.CHARSET,
NegOptions.SUPPRESS_GO_AHEAD,
NegOptions.NAWS,
NegOptions.NEW_ENVIRON]:
log.debug("Option: %s", NegOptions.from_val(byte_int))
# No further negotiation of this option needed. Reset the state.
self.state = self.NO_NEG
else:
# Received an unexpected byte. Stop negotiations
log.error("Unexpected byte %s in state %s",
byte_int,
self.state)
self.state = self.NO_NEG
def send_message(self, message_ints):
self.tcp.sendall(bytearray(message_ints))
def send_iac(self, arr):
message = [NegTokens.IAC]
message.extend(arr)
self.send_message(message)
def send_do(self, option_str):
log.debug("Sending DO %s", option_str)
self.send_iac([NegTokens.DO, NegOptions.to_val(option_str)])
def send_dont(self, option_str):
log.debug("Sending DONT %s", option_str)
self.send_iac([NegTokens.DONT, NegOptions.to_val(option_str)])
def send_will(self, option_str):
log.debug("Sending WILL %s", option_str)
self.send_iac([NegTokens.WILL, NegOptions.to_val(option_str)])
def send_wont(self, option_str):
log.debug("Sending WONT %s", option_str)
self.send_iac([NegTokens.WONT, NegOptions.to_val(option_str)])
class NegBase(object):
@classmethod
def to_val(cls, name):
return getattr(cls, name)
@classmethod
def from_val(cls, val):
for k in cls.__dict__.keys():
if getattr(cls, k) == val:
return k
return "<unknown>"
class NegTokens(NegBase):
# The start of a negotiation sequence
IAC = 255
# Confirm willingness to negotiate
WILL = 251
# Confirm unwillingness to negotiate
WONT = 252
# Indicate willingness to negotiate
DO = 253
# Indicate unwillingness to negotiate
DONT = 254
# The start of sub-negotiation options.
SB = 250
# The end of sub-negotiation options.
SE = 240
class NegOptions(NegBase):
# Binary Transmission
BINARY = 0
# Suppress Go Ahead
SUPPRESS_GO_AHEAD = 3
# NAWS - width and height of client
NAWS = 31
# NEW-ENVIRON - environment variables on client
NEW_ENVIRON = 39
# Charset option
CHARSET = 42
def get_options():
parser = argparse.ArgumentParser()
parser.add_argument("--port", action="store", default=9019,
type=int, help="port to listen on")
parser.add_argument("--verbose", action="store", type=int, default=0,
help="verbose output")
parser.add_argument("--pidfile", action="store",
help="file name for the PID")
parser.add_argument("--logfile", action="store",
help="file name for the log")
parser.add_argument("--srcdir", action="store", help="test directory")
parser.add_argument("--id", action="store", help="server ID")
parser.add_argument("--ipv4", action="store_true", default=0,
help="IPv4 flag")
return parser.parse_args()
def setup_logging(options):
"""
Set up logging from the command line options
"""
root_logger = logging.getLogger()
add_stdout = False
formatter = logging.Formatter("%(asctime)s %(levelname)-5.5s "
"[{ident}] %(message)s"
.format(ident=IDENT))
# Write out to a logfile
if options.logfile:
handler = logging.FileHandler(options.logfile, mode="w")
handler.setFormatter(formatter)
handler.setLevel(logging.DEBUG)
root_logger.addHandler(handler)
else:
# The logfile wasn't specified. Add a stdout logger.
add_stdout = True
if options.verbose:
# Add a stdout logger as well in verbose mode
root_logger.setLevel(logging.DEBUG)
add_stdout = True
else:
root_logger.setLevel(logging.INFO)
if add_stdout:
stdout_handler = logging.StreamHandler(sys.stdout)
stdout_handler.setFormatter(formatter)
stdout_handler.setLevel(logging.DEBUG)
root_logger.addHandler(stdout_handler)
class ScriptRC(object):
"""Enum for script return codes"""
SUCCESS = 0
FAILURE = 1
EXCEPTION = 2
class ScriptException(Exception):
pass
if __name__ == '__main__':
# Get the options from the user.
options = get_options()
# Setup logging using the user options
setup_logging(options)
# Run main script.
try:
rc = telnetserver(options)
except Exception as e:
log.exception(e)
rc = ScriptRC.EXCEPTION
log.info("Returning %d", rc)
sys.exit(rc)
| {
"content_hash": "6048ab4de98b3843377321fd7b2f9a97",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 79,
"avg_line_length": 30.376854599406528,
"alnum_prop": 0.5767314642961805,
"repo_name": "LiberatorUSA/GUCEF",
"id": "f2f2ab5006783799120a2fed9f7006f9eed5d341",
"size": "10285",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "dependencies/curl/tests/negtelnetserver.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "68139"
},
{
"name": "C",
"bytes": "2158073"
},
{
"name": "C++",
"bytes": "14978976"
},
{
"name": "CMake",
"bytes": "7671056"
},
{
"name": "Cuda",
"bytes": "297"
},
{
"name": "Dockerfile",
"bytes": "349"
},
{
"name": "Emacs Lisp",
"bytes": "29494"
},
{
"name": "Fortran",
"bytes": "4029"
},
{
"name": "Java",
"bytes": "1389"
},
{
"name": "Lua",
"bytes": "750004"
},
{
"name": "M4",
"bytes": "1460"
},
{
"name": "Makefile",
"bytes": "295122"
},
{
"name": "NSIS",
"bytes": "35409"
},
{
"name": "Shell",
"bytes": "181211"
},
{
"name": "Tcl",
"bytes": "6493"
},
{
"name": "Vim Script",
"bytes": "121243"
}
],
"symlink_target": ""
} |
#ifndef _STDINT_H
#define _STDINT_H
/*
* ISO C 99 <stdint.h> for platforms that lack it.
* <http://www.opengroup.org/onlinepubs/007904975/basedefs/stdint.h.html>
*/
/* Get wchar_t, WCHAR_MIN, WCHAR_MAX. */
#include <stddef.h>
/* Get CHAR_BIT, LONG_MIN, LONG_MAX, ULONG_MAX. */
#include <limits.h>
/* Get those types that are already defined in other system include files. */
#if defined(__FreeBSD__)
# include <sys/inttypes.h>
#endif
#if defined(__sun) && HAVE_SYS_INTTYPES_H
# include <sys/inttypes.h>
/* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX.
But note that <sys/int_types.h> contains only the type definitions! */
# define _STDINT_H_HAVE_SYSTEM_INTTYPES
#endif
#if (defined(__hpux) || defined(_AIX)) && HAVE_INTTYPES_H
# include <inttypes.h>
/* HP-UX 10 <inttypes.h> has nearly everything, except UINT_LEAST8_MAX,
UINT_FAST8_MAX, PTRDIFF_MIN, PTRDIFF_MAX. */
/* AIX 4 <inttypes.h> has nearly everything, except INTPTR_MIN, INTPTR_MAX,
UINTPTR_MAX, PTRDIFF_MIN, PTRDIFF_MAX. */
# define _STDINT_H_HAVE_SYSTEM_INTTYPES
#endif
#if !(defined(UNIX_CYGWIN32) && defined(__BIT_TYPES_DEFINED__))
# define _STDINT_H_NEED_SIGNED_INT_TYPES
#endif
#if !defined(_STDINT_H_HAVE_SYSTEM_INTTYPES)
/* 7.18.1.1. Exact-width integer types */
#if !defined(__FreeBSD__)
#ifdef _STDINT_H_NEED_SIGNED_INT_TYPES
typedef signed char int8_t;
#endif
typedef unsigned char uint8_t;
#ifdef _STDINT_H_NEED_SIGNED_INT_TYPES
typedef short int16_t;
#endif
typedef unsigned short uint16_t;
#ifdef _STDINT_H_NEED_SIGNED_INT_TYPES
typedef int int32_t;
#endif
typedef unsigned int uint32_t;
#if @HAVE_LONG_64BIT@
#ifdef _STDINT_H_NEED_SIGNED_INT_TYPES
typedef long int64_t;
#endif
typedef unsigned long uint64_t;
#define _STDINT_H_HAVE_INT64
#elif @HAVE_LONG_LONG_64BIT@
#ifdef _STDINT_H_NEED_SIGNED_INT_TYPES
typedef long long int64_t;
#endif
typedef unsigned long long uint64_t;
#define _STDINT_H_HAVE_INT64
#elif defined(_MSC_VER)
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#define _STDINT_H_HAVE_INT64
#endif
#endif /* !FreeBSD */
/* 7.18.1.2. Minimum-width integer types */
typedef int8_t int_least8_t;
typedef uint8_t uint_least8_t;
typedef int16_t int_least16_t;
typedef uint16_t uint_least16_t;
typedef int32_t int_least32_t;
typedef uint32_t uint_least32_t;
#ifdef _STDINT_H_HAVE_INT64
typedef int64_t int_least64_t;
typedef uint64_t uint_least64_t;
#endif
/* 7.18.1.3. Fastest minimum-width integer types */
typedef int32_t int_fast8_t;
typedef uint32_t uint_fast8_t;
typedef int32_t int_fast16_t;
typedef uint32_t uint_fast16_t;
typedef int32_t int_fast32_t;
typedef uint32_t uint_fast32_t;
#ifdef _STDINT_H_HAVE_INT64
typedef int64_t int_fast64_t;
typedef uint64_t uint_fast64_t;
#endif
/* 7.18.1.4. Integer types capable of holding object pointers */
#if !defined(__FreeBSD__)
/* On some platforms (like IRIX6 MIPS with -n32) sizeof(void*) < sizeof(long),
but this doesn't matter here. */
typedef long intptr_t;
typedef unsigned long uintptr_t;
#endif /* !FreeBSD */
/* 7.18.1.5. Greatest-width integer types */
#ifdef _STDINT_H_HAVE_INT64
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;
#else
typedef int32_t intmax_t;
typedef uint32_t uintmax_t;
#endif
/* 7.18.2. Limits of specified-width integer types */
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
/* 7.18.2.1. Limits of exact-width integer types */
#define INT8_MIN -128
#define INT8_MAX 127
#define UINT8_MAX 255U
#define INT16_MIN -32768
#define INT16_MAX 32767
#define UINT16_MAX 65535U
#define INT32_MIN (~INT32_MAX)
#define INT32_MAX 2147483647
#define UINT32_MAX 4294967295U
#ifdef _STDINT_H_HAVE_INT64
#define INT64_MIN (~INT64_MAX)
#if @HAVE_LONG_64BIT@
#define INT64_MAX 9223372036854775807L
#define UINT64_MAX 18446744073709551615UL
#elif @HAVE_LONG_LONG_64BIT@
#define INT64_MAX 9223372036854775807LL
#define UINT64_MAX 18446744073709551615ULL
#elif defined(_MSC_VER)
#define INT64_MAX 9223372036854775807i64
#define UINT64_MAX 18446744073709551615ui64
#endif
#endif
/* 7.18.2.2. Limits of minimum-width integer types */
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST8_MAX INT8_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST16_MAX INT16_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST32_MAX INT32_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#ifdef _STDINT_H_HAVE_INT64
#define INT_LEAST64_MIN INT64_MIN
#define INT_LEAST64_MAX INT64_MAX
#define UINT_LEAST64_MAX UINT64_MAX
#endif
/* 7.18.2.3. Limits of fastest minimum-width integer types */
#define INT_FAST8_MIN INT32_MIN
#define INT_FAST8_MAX INT32_MAX
#define UINT_FAST8_MAX UINT32_MAX
#define INT_FAST16_MIN INT32_MIN
#define INT_FAST16_MAX INT32_MAX
#define UINT_FAST16_MAX UINT32_MAX
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST32_MAX INT32_MAX
#define UINT_FAST32_MAX UINT32_MAX
#ifdef _STDINT_H_HAVE_INT64
#define INT_FAST64_MIN INT64_MIN
#define INT_FAST64_MAX INT64_MAX
#define UINT_FAST64_MAX UINT64_MAX
#endif
/* 7.18.2.4. Limits of integer types capable of holding object pointers */
#define INTPTR_MIN LONG_MIN
#define INTPTR_MAX LONG_MAX
#define UINTPTR_MAX ULONG_MAX
/* 7.18.2.5. Limits of greatest-width integer types */
#ifdef _STDINT_H_HAVE_INT64
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
#else
#define INTMAX_MIN INT32_MIN
#define INTMAX_MAX INT32_MAX
#define UINTMAX_MAX UINT32_MAX
#endif
/* 7.18.3. Limits of other integer types */
#define PTRDIFF_MIN (~(ptrdiff_t)0 << (sizeof(ptrdiff_t)*CHAR_BIT-1))
#define PTRDIFF_MAX (~PTRDIFF_MIN)
/* This may be wrong... */
#define SIG_ATOMIC_MIN 0
#define SIG_ATOMIC_MAX 127
#define SIZE_MAX (~(size_t)0)
/* wchar_t limits already defined in <stddef.h>. */
/* wint_t limits already defined in <wchar.h>. */
#endif
/* 7.18.4. Macros for integer constants */
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
/* 7.18.4.1. Macros for minimum-width integer constants */
#define INT8_C(x) x
#define UINT8_C(x) x##U
#define INT16_C(x) x
#define UINT16_C(x) x##U
#define INT32_C(x) x
#define UINT32_C(x) x##U
#if @HAVE_LONG_64BIT@
#define INT64_C(x) x##L
#define UINT64_C(x) x##UL
#elif @HAVE_LONG_LONG_64BIT@
#define INT64_C(x) x##LL
#define UINT64_C(x) x##ULL
#elif defined(_MSC_VER)
#define INT64_C(x) x##i64
#define UINT64_C(x) x##ui64
#endif
/* 7.18.4.2. Macros for greatest-width integer constants */
#if @HAVE_LONG_64BIT@
#define INTMAX_C(x) x##L
#define UINTMAX_C(x) x##UL
#elif @HAVE_LONG_LONG_64BIT@
#define INTMAX_C(x) x##LL
#define UINTMAX_C(x) x##ULL
#elif defined(_MSC_VER)
#define INTMAX_C(x) x##i64
#define UINTMAX_C(x) x##ui64
#else
#define INTMAX_C(x) x
#define UINTMAX_C(x) x##U
#endif
#endif
#endif /* !_STDINT_H_HAVE_SYSTEM_INTTYPES */
#endif /* _STDINT_H */
| {
"content_hash": "6b7883ed86accd2cb04e281217783439",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 78,
"avg_line_length": 26.265917602996254,
"alnum_prop": 0.7151005275916156,
"repo_name": "execunix/vinos",
"id": "ea3619d81c4495f75ddb29f80f796ab25f995c4a",
"size": "7875",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "external/gpl2/xcvs/dist/lib/stdint_.h",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
#include "stdafx.h"
#include "DuiDesigner.h"
#include "MainFrm.h"
#include "ResourceView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CResourceViewBar
CResourceViewBar::CResourceViewBar()
{
g_pResourceView = this;
}
CResourceViewBar::~CResourceViewBar()
{
m_mapTree.RemoveAll();
POSITION pos;
CString strKey;
CStringArray* pstrArray;
for(pos=m_mapImageArray.GetStartPosition(); pos != NULL; )
{
m_mapImageArray.GetNextAssoc(pos, strKey, (void*&)pstrArray);
delete pstrArray;
}
m_mapImageArray.RemoveAll();
}
BEGIN_MESSAGE_MAP(CResourceViewBar, CDockablePane)
ON_WM_CREATE()
ON_WM_SIZE()
ON_WM_CONTEXTMENU()
ON_COMMAND(ID_EDIT_CUT, OnEditCut)
ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
ON_COMMAND(ID_EDIT_CLEAR, OnEditClear)
ON_WM_PAINT()
ON_WM_SETFOCUS()
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CResourceViewBar message handlers
int CResourceViewBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDockablePane::OnCreate(lpCreateStruct) == -1)
return -1;
CRect rectDummy;
rectDummy.SetRectEmpty();
// Create view:
const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;
if (!m_wndResourceView.Create(dwViewStyle, rectDummy, this, 3))
{
TRACE0("Failed to create workspace view\n");
return -1; // fail to create
}
// Load view images:
m_ResourceViewImages.Create(IDB_RESOURCE_VIEW, 16, 0, RGB(255, 0, 255));
m_wndResourceView.SetImageList(&m_ResourceViewImages, TVSIL_NORMAL);
// Fill view context(dummy code, don't seek here something magic :-)):
InitResourceView();
OnChangeVisualStyle();
return 0;
}
void CResourceViewBar::OnSize(UINT nType, int cx, int cy)
{
CDockablePane::OnSize(nType, cx, cy);
//if (CanAdjustLayout())
{
m_wndResourceView.SetWindowPos(NULL, 1, 1, cx - 2, cy - 2, SWP_NOACTIVATE | SWP_NOZORDER);
}
}
void CResourceViewBar::InitResourceView()
{
}
void CResourceViewBar::OnContextMenu(CWnd* pWnd, CPoint point)
{
CTreeCtrl* pWndTree = (CTreeCtrl*) &m_wndResourceView;
ASSERT_VALID(pWndTree);
if (pWnd != pWndTree)
{
CDockablePane::OnContextMenu(pWnd, point);
return;
}
if (point != CPoint(-1, -1))
{
// Select clicked item:
CPoint ptTree = point;
pWndTree->ScreenToClient(&ptTree);
UINT flags = 0;
HTREEITEM hTreeItem = pWndTree->HitTest(ptTree, &flags);
if (hTreeItem != NULL)
{
pWndTree->SelectItem(hTreeItem);
}
}
pWndTree->SetFocus();
theApp.GetContextMenuManager()->ShowPopupMenu(IDR_POPUP_RESOURCE, point.x, point.y, this, TRUE);
}
void CResourceViewBar::OnEditCut()
{
// TODO: Add your command handler code here
}
void CResourceViewBar::OnEditCopy()
{
// TODO: Add your command handler code here
}
void CResourceViewBar::OnEditPaste()
{
// TODO: Add your command handler code here
}
void CResourceViewBar::OnEditClear()
{
// TODO: Add your command handler code here
}
void CResourceViewBar::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rectTree;
m_wndResourceView.GetWindowRect(rectTree);
ScreenToClient(rectTree);
rectTree.InflateRect(1, 1);
dc.Draw3dRect(rectTree, ::GetSysColor(COLOR_3DSHADOW), ::GetSysColor(COLOR_3DSHADOW));
}
void CResourceViewBar::OnSetFocus(CWnd* pOldWnd)
{
CDockablePane::OnSetFocus(pOldWnd);
m_wndResourceView.SetFocus();
}
void CResourceViewBar::OnChangeVisualStyle()
{
m_ResourceViewImages.DeleteImageList();
UINT uiBmpId = theApp.m_bHiColorIcons ? IDB_RESOURCE_VIEW24 : IDB_RESOURCE_VIEW;
CBitmap bmp;
if (!bmp.LoadBitmap(uiBmpId))
{
TRACE(_T("Can't load bitmap: %x\n"), uiBmpId);
ASSERT(FALSE);
return;
}
BITMAP bmpObj;
bmp.GetBitmap(&bmpObj);
UINT nFlags = ILC_MASK;
nFlags |= (theApp.m_bHiColorIcons) ? ILC_COLOR24 : ILC_COLOR4;
m_ResourceViewImages.Create(16, bmpObj.bmHeight, nFlags, 0, 0);
m_ResourceViewImages.Add(&bmp, RGB(255, 0, 255));
m_wndResourceView.SetImageList(&m_ResourceViewImages, TVSIL_NORMAL);
}
void CResourceViewBar::InsertImageTree(CString strTitle, CString strPath)
{
HTREEITEM hRoot = m_wndResourceView.InsertItem(strTitle, 0, 0, TVI_ROOT);
m_wndResourceView.SetItemState(hRoot, TVIS_BOLD, TVIS_BOLD);
m_mapTree.SetAt(strTitle, (void*)hRoot);
CStringArray* pstrArray = new CStringArray;
m_mapImageArray.SetAt(strTitle, (void*)pstrArray);
if(strPath.IsEmpty())
return;
int nPos = strPath.ReverseFind('\\');
if(nPos == -1)
return;
CString strDir = strPath.Left(nPos + 1);
WIN32_FIND_DATA FindFileData = {0};
CString strFind = strDir + _T("*.*");
HANDLE hFind = ::FindFirstFile(strFind, &FindFileData);
if(hFind == INVALID_HANDLE_VALUE)
return;
do
{
CString strExt = _tcsrchr(FindFileData.cFileName, _T('.')) + 1;
if(strExt.IsEmpty())
continue;
int nType = 0;
if(strExt == _T("bmp"))
nType = 1;
else if(strExt == _T("jpg"))
nType = 2;
else if(strExt == _T("png"))
nType = 3;
if(nType > 0)
{
pstrArray->Add(strDir + FindFileData.cFileName);
HTREEITEM hItem = m_wndResourceView.InsertItem(FindFileData.cFileName, nType, nType, hRoot);
}
}while(::FindNextFile(hFind, &FindFileData));
::FindClose(hFind);
m_wndResourceView.Expand(hRoot, TVE_EXPAND);
}
void CResourceViewBar::RemoveImageTree(CString strTree)
{
HTREEITEM hTree;
if(!m_mapTree.Lookup(strTree, (void*&)hTree))
return;
m_wndResourceView.DeleteItem(hTree);
m_mapTree.RemoveKey(strTree);
CStringArray* pstrArray = NULL;
if(!m_mapImageArray.Lookup(strTree, (void*&)pstrArray))
return;
m_mapImageArray.RemoveKey(strTree);
delete pstrArray;
}
void CResourceViewBar::RenameImageTree(LPCTSTR pstrTree, LPCTSTR pstrNewName)
{
HTREEITEM hTree;
if(!m_mapTree.Lookup(pstrTree, (void*&)hTree))
return;
m_wndResourceView.SetItemText(hTree, pstrNewName);
m_mapTree.RemoveKey(pstrTree);
m_mapTree.SetAt(pstrNewName, (void*)hTree);
CStringArray* pstrArray = NULL;
if(!m_mapImageArray.Lookup(pstrTree, (void*&)pstrArray))
return;
m_mapImageArray.RemoveKey(pstrTree);
m_mapImageArray.SetAt(pstrNewName, (void*)pstrArray);
}
void CResourceViewBar::InsertImage(CString strImage, CString strTree)
{
if(strImage.IsEmpty())
return;
HTREEITEM hTree;
if(!m_mapTree.Lookup(strTree, (void*&)hTree))
return;
CStringArray* pstrArray = NULL;
if(!m_mapImageArray.Lookup(strTree, (void*&)pstrArray))
return;
for(int i=0; i<pstrArray->GetSize(); i++)
{
if((*pstrArray)[i] == strImage)
return;
}
int nPos = strImage.ReverseFind('\\');
if(nPos == -1)
return;
CString strName = strImage.Right(strImage.GetLength() - nPos - 1);
nPos = strName.ReverseFind('.');
if(nPos == -1)
return;
CString strExt = strName.Right(strName.GetLength() - nPos - 1);
int nType = 0;
if(strExt == _T("bmp"))
nType = 1;
else if(strExt == _T("jpg"))
nType = 2;
else if(strExt == _T("png"))
nType = 3;
m_wndResourceView.InsertItem(strName, nType, nType, hTree);
pstrArray->Add(strImage);
}
const CStringArray* CResourceViewBar::GetImageTree(CString strTree) const
{
CStringArray* pstrArray = NULL;
m_mapImageArray.Lookup(strTree, (void*&)pstrArray);
return pstrArray;
}
void CResourceViewBar::CopyImageToSkinDir(LPCTSTR pstrSkinDir, LPCTSTR pstrTree)
{
CStringArray* pstrArray = NULL;
if(!m_mapImageArray.Lookup(pstrTree, (void*&)pstrArray))
return;
for(int i=0; i<pstrArray->GetSize(); i++)
{
CString strPath = (*pstrArray)[i];
int nPos = strPath.ReverseFind('\\');
if(nPos == -1)
continue;
CString strDir = strPath.Left(nPos + 1);
if(strDir != pstrSkinDir)
{
CString strName = strPath.Right(strPath.GetLength() - nPos - 1);
CopyFile(strPath, pstrSkinDir + strName, TRUE);
}
}
} | {
"content_hash": "ed7922e3fe34dd3043e9457860516854",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 117,
"avg_line_length": 24.44144144144144,
"alnum_prop": 0.6680181840520949,
"repo_name": "jeppeter/duilib",
"id": "715254bc3f2e8ee51afaa9b1a424d7866d09bb49",
"size": "8549",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "DuiDesigner/ResourceView.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "273432"
},
{
"name": "C++",
"bytes": "1900634"
},
{
"name": "CMake",
"bytes": "7070"
}
],
"symlink_target": ""
} |
typedef struct Vector{
int x;
int y;
} Vector;
typedef struct Sprite{
double frame;
double angle;
double temp_angle;
int scale;
SDL_Texture *image;
SDL_Rect *rect;
double w, h;
void (*destroy)(void *self);
} Sprite;
typedef struct Player{
Sprite *sprite;
SDL_Rect *temp;
bool run;
void (*move)(Direction player);
} Player;
typedef struct View{
int x, y;
} View;
typedef struct Object{
Sprite *sprite;
bool solid;
int id;
Vector vel;
} Object;
#endif
| {
"content_hash": "e49439f15ddcc9f760c1827a18f551a9",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 39,
"avg_line_length": 14.951219512195122,
"alnum_prop": 0.5301794453507341,
"repo_name": "maxweis/game",
"id": "4e414a3a2f80002df707de974f827f718c7dbac5",
"size": "670",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "editor/src/structs.h",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "45039"
},
{
"name": "C++",
"bytes": "2731"
},
{
"name": "Makefile",
"bytes": "548"
},
{
"name": "Objective-C",
"bytes": "217"
},
{
"name": "Shell",
"bytes": "60"
},
{
"name": "Vim script",
"bytes": "17370"
}
],
"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_112) on Fri Jun 16 09:55:15 MST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class org.wildfly.swarm.config.undertow.servlet_container.MimeMapping (Public javadocs 2017.6.1 API)</title>
<meta name="date" content="2017-06-16">
<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 Class org.wildfly.swarm.config.undertow.servlet_container.MimeMapping (Public javadocs 2017.6.1 API)";
}
}
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><a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 2017.6.1</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/wildfly/swarm/config/undertow/servlet_container/class-use/MimeMapping.html" target="_top">Frames</a></li>
<li><a href="MimeMapping.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.wildfly.swarm.config.undertow.servlet_container.MimeMapping" class="title">Uses of Class<br>org.wildfly.swarm.config.undertow.servlet_container.MimeMapping</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config.undertow">org.wildfly.swarm.config.undertow</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config.undertow.servlet_container">org.wildfly.swarm.config.undertow.servlet_container</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.wildfly.swarm.config.undertow">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a> in <a href="../../../../../../../org/wildfly/swarm/config/undertow/package-summary.html">org.wildfly.swarm.config.undertow</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/undertow/package-summary.html">org.wildfly.swarm.config.undertow</a> that return <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a></code></td>
<td class="colLast"><span class="typeNameLabel">ServletContainer.ServletContainerResources.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/undertow/ServletContainer.ServletContainerResources.html#mimeMapping-java.lang.String-">mimeMapping</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> key)</code> </td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/undertow/package-summary.html">org.wildfly.swarm.config.undertow</a> that return types with arguments of type <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a>></code></td>
<td class="colLast"><span class="typeNameLabel">ServletContainer.ServletContainerResources.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/undertow/ServletContainer.ServletContainerResources.html#mimeMappings--">mimeMappings</a></span>()</code>
<div class="block">Get the list of MimeMapping resources</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/undertow/package-summary.html">org.wildfly.swarm.config.undertow</a> with parameters of type <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/undertow/ServletContainer.html" title="type parameter in ServletContainer">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">ServletContainer.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/undertow/ServletContainer.html#mimeMapping-org.wildfly.swarm.config.undertow.servlet_container.MimeMapping-">mimeMapping</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a> value)</code>
<div class="block">Add the MimeMapping object to the list of subresources</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Method parameters in <a href="../../../../../../../org/wildfly/swarm/config/undertow/package-summary.html">org.wildfly.swarm.config.undertow</a> with type arguments of type <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/undertow/ServletContainer.html" title="type parameter in ServletContainer">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">ServletContainer.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/undertow/ServletContainer.html#mimeMappings-java.util.List-">mimeMappings</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a>> value)</code>
<div class="block">Add all MimeMapping objects to this subresource</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.wildfly.swarm.config.undertow.servlet_container">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a> in <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/package-summary.html">org.wildfly.swarm.config.undertow.servlet_container</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/package-summary.html">org.wildfly.swarm.config.undertow.servlet_container</a> with type parameters of type <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a><T extends <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a><T>></span></code>
<div class="block">The servlet container mime mapping config</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>interface </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMappingConsumer.html" title="interface in org.wildfly.swarm.config.undertow.servlet_container">MimeMappingConsumer</a><T extends <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a><T>></span></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>interface </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMappingSupplier.html" title="interface in org.wildfly.swarm.config.undertow.servlet_container">MimeMappingSupplier</a><T extends <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a>></span></code> </td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/package-summary.html">org.wildfly.swarm.config.undertow.servlet_container</a> that return <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">MimeMapping</a></code></td>
<td class="colLast"><span class="typeNameLabel">MimeMappingSupplier.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMappingSupplier.html#get--">get</a></span>()</code>
<div class="block">Constructed instance of MimeMapping resource</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</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><a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/MimeMapping.html" title="class in org.wildfly.swarm.config.undertow.servlet_container">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 2017.6.1</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/wildfly/swarm/config/undertow/servlet_container/class-use/MimeMapping.html" target="_top">Frames</a></li>
<li><a href="MimeMapping.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2017 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "8cfea49951c9ae7b4f941c93ae79933d",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 594,
"avg_line_length": 64.30384615384615,
"alnum_prop": 0.6822776481847,
"repo_name": "wildfly-swarm/wildfly-swarm-javadocs",
"id": "f201a7b143543304c5f22c53e62216ece516c406",
"size": "16719",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "2017.6.1/apidocs/org/wildfly/swarm/config/undertow/servlet_container/class-use/MimeMapping.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
Add New Employees
--------
We have some new employees who will be starting at our company. We would like to see them added to our systems as soon as possible.
-On the Dev Environment, the employees should be able to ssh onto the server and access data related to the projects they are assigned to.
Employees should be able to store files, run programs, and compile Java, C, C++, Python, and PHP code.
-On the Employee Task Management System, employees should be able to view projects and issues that are assigned to them.
-On the RDP server, employees should be able to access the project folders of projects they are assigned to. Along with project folders, all employees should be able to access the employee folder shared to all employees.
-On the OwnCloud server, employees should be able to upload files and be able to view and download previously uploaded files.
Here is a list of users and they projects they are assigned to.(4 pts per employee successfully added)
Username Password Projects
Jack123 Jill123 2
Osterman DrM@nh@tt@n 2,4
EveyH Vendett@ 3
WalterK Rorsch@ch 2,3
DanielD NightOwl2 4
| {
"content_hash": "fad64e71b4fe7a653e3d309ae25f08c3",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 220,
"avg_line_length": 42.96153846153846,
"alnum_prop": 0.7797672336615935,
"repo_name": "ISEAGE-ISU/itocdc-2014-anomalies",
"id": "1d61ef496cad29ea050212ea023fd03ae4384519",
"size": "1117",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "AddNewEmployees/description.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package org.jenkinsci.plugins.tcl.util;
import java.io.IOException;
import java.io.OutputStream;
/**
* Implements OutputStream with internal buffering and per-string output.
* This class is being used as an IO wrapper in jTclTty
* @see jTclTTY
*/
public abstract class StringOutputStream extends OutputStream {
String buffer;
public StringOutputStream() {
buffer = "";
}
@Override
public void write(int i) throws IOException {
char val = (char) i;
switch (val) {
case '\r':
break;
case '\n':
DoWrite();
break;
default:
buffer += val;
break;
}
}
private void DoWrite() throws IOException {
WriteLine(buffer);
buffer = "";
}
/**
* Writes string to the stream.
* @param str
* @throws IOException
*/
public abstract void WriteLine(String str) throws IOException;
}
| {
"content_hash": "d4f54e3f9442cc16a952bdf0b6c0622f",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 73,
"avg_line_length": 21.67391304347826,
"alnum_prop": 0.5626880641925778,
"repo_name": "oleg-nenashev/jenkins-tcl-plugin",
"id": "d4712c5238aa0aea35c5428784e0a9de07f49ba0",
"size": "2157",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/jenkinsci/plugins/tcl/util/StringOutputStream.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "44889"
},
{
"name": "Shell",
"bytes": "101"
}
],
"symlink_target": ""
} |
layout: default
---
<div class="post">
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>
</header>
<article class="post-content">
{{ content }}
</article>
</div>
| {
"content_hash": "a39ccf073f28235a299a9762fd4513a8",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 48,
"avg_line_length": 15.923076923076923,
"alnum_prop": 0.5748792270531401,
"repo_name": "STFFE/stffe.github.com",
"id": "7edee0f2e524d7157dea5ceb4ba8227af35a20dd",
"size": "211",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_layouts/page.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "15521"
},
{
"name": "HTML",
"bytes": "5956"
},
{
"name": "JavaScript",
"bytes": "402"
}
],
"symlink_target": ""
} |
[](https://travis-ci.org/shopwareLabs/sw-cli-tools)
[](https://scrutinizer-ci.com/g/shopwareLabs/sw-cli-tools)
[](LICENSE)
The shopware CLI tools are your console helpers for all kind of Shopware tasks. They will allow you to:
* setup Shopware from VCS
* setup Shopware from a release tag
* create Shopware plugins
* define a bunch of plugin repositories you use
* install plugins from the repositories and activate them in shopware
* zip plugins in the way the Shopware store or the Shopware plugin manager expect it to be
The shopware CLI tools come with a slim extension interface, so you can extend it for your needs.
This is an **early development preview** - so don't expect it to be stable. Please wait for a 1.0.0 stable release before using this tools for production deployments
Pull requests are very welcome as well as ideas for possible extensions.
# Support
Use at your own risk, there is no support for this tools.
# Install
Generally we recommend to use the sw.phar release files, you can download them to e.g. ~/bin/sw and add this directory to the $PATH of your local user (download current build from http://shopwarelabs.github.io/sw-cli-tools/).
If you want to use the development version of sw-cli-tools, you should checkout the repository and run `composer install` to download all dependencies
## Requirements ###
On your system at least the following packages needs to be available.
* openjdk-7-jre-headless
* ant
* git
* curl
* php5-curl
* If you want to use coloring you should enable php.posix in your php.ini
## Available commands
* sw cache:clear
* sw install:vcs
* sw install:release
* sw plugin:install
* sw plugin:zip:dir
* sw plugin:zip:vcs
* sw plugin:create
* sw generate
## Using the Commands
### sw plugin:install
Will install a plugin from one of the configured repos
Valid options/arguments are:
--useHttp: use HTTP for checkout if possible (e.g. for VPN, SSH seems to be slow here sometimes)
--small: Show 3 columns of plugins in a short form
--shopware-root Shopware root directory
--branch branch to checkout out
names1…nameN - names of plugins to install
This command will automatically create a VCS mapping for phpstorm if `.idea/vcs.xml` can be found. You will need
to refresh you config with File->Sychronize (Control+Alt+Y)
### sw plugin:zip:vcs
Will checkout a plugin from VCS and zip it properly for the store
Valid options/arguments are:
--useHttp: use HTTP for checkout if possible (e.g. for VPN, SSH seems to be slow here sometimes)
--small: Show 3 columns of plugins in a short form
--branch branch to checkout out
names1…nameN - names of plugins to zip
### sw plugin:zip:dir
Will zip the given plugin directory. DIRECTORY must point to the directory where the plugin bootstrap can be found.
### sw install:vcs
Checkout the latest shopware version from vcs (for development)
Valid options/arguments are:
--branch: The branch to checkout
--databaseName: Name of the database to use
--installDir: Where to install shopware
--user: Github user name. If provided, the checkout will be done via HTTP
The options will be read interactively, if not provided
The database credentials are configured in ~/.config/sw-cli-tools/config.yaml
### sw install:release
--release: Release to install. Default: "latest". Possible are all shopware release versions like "4.2.0"
--databaseName: Name of the database to use
--basePath: Base path of the installation
--username: backend user name for login
--password: backend password for login
--name: backend username
--mail: Mail of the backend user
--language: backend language (e.g. de_DE or en_GB)
### sw plugin:create
Will create a Shopware plugin with all the boilerplate code.
Valid options / arguments are:
--namespace[="..."]: Namespace of the plugin, default: Frontend
--haveBackend: Generate a backend Controller + a simple ExtJS module
--backendModel[="..."]: The name of the model for your backend application
--haveFilter: Generate Condition/Facet/CriteriaRequestHandler in order to add a new filter in the frontend
--haveFrontend: Generate a frontend controller
--haveModels: Generate a simple doctrine model
--haveCommands: Generate a console command
--haveWidget: Generate a backend widget
--haveApi: Generate an API resource + REST controller
--licenseHeader[="..."]: Include a license header at the beginning of any file name: Name of your plugin. Must at least have a dev prefix + plugin name, e.g. "SwagBundle", "PrefixPluginName"; "SwagBrowserLanguageDetection"
The options will be read interactively, if not provided.
The database credentials are configured in ~/.config/sw-cli-tools/config.yaml
### sw generate
Will generate data which can be used to fill the shop for e.g. load tests.
!Warning! this command ist destructive
Valid options / arguments are:
-a, --articles[=ARTICLES] Number of articles to create
--articleFilterGroups[=ARTICLEFILTERGROUPS] Number article filter option groups to create
--articleFilterOptions[=ARTICLEFILTEROPTIONS] Number article filter options to create
--articleFilterValues[=ARTICLEFILTERVALUES] Number article filter values to create per each filter option
-o, --orders[=ORDERS] Number of orders to create
-c, --categories[=CATEGORIES] Number of categories to create
--categoriesPerArticle[=CATEGORIESPERARTICLE] Number of categories to assign to each article
-e, --newsletter[=NEWSLETTER] Number of newsletter to create
-u, --customers[=CUSTOMERS] Number of customers to create
--vouchers[=VOUCHERS] Number of vouchers to create
--chunk-size[=CHUNK-SIZE] Chung size
-s, --seed[=SEED] Random seed
--installDir[=INSTALLDIR] Your Shopware installation path. If provided, data will be automatically injected into the configured database. [default: ""]
-n, --no-interaction Do not ask any interactive question
If executed from a Shopware installation, or if 'installDir' is provided, the data will
be automatically written into your Shopware database.
Otherwise, data will be exported to individual files in the '<current dir>\output' folder
You need to import the .sql files in the order in which they are generated (see the command output)
Requires 'local-infile=1' in your MySQL installation.
# Extending the cli tools
## New Extensions
Extensions are created in the `/home/USER/.config/sw-cli-tools/extensions` folder and consist of a vendor folder, the extension folder (with the extension's name) and a `Bootstrap.php` inside the extension folder. Additionally you can provide an own `config.yaml` inside the extension folder which will extend the default `config.yaml`.
The namespace of your extension bootstrap should be `VENDOR_FOLDER\EXTENSION_FOLDER\Bootstrap`.
### Bootstrap
The bootstrap is the main entry point of your extension. If it implements `ContainerAwareExtension`, it will get the container builder
of the application injected via setContainer. This way the container can be extended by your extension.
Additionally the Bootstrap can implement `ConsoleAwareExtension`. If this is the case, the method "getConsoleCommands" will be
called after creation - please return an array of console command instances here.
Finally the extension will call the `getRepositories` method of extensions implementing `RepositoryAwareInterface`.
### Changing existing components
As you Bootstrap.php is instantiated after the container, you can replace any service of the container
# Paths
The SW cli tools make use of the XDG directory standard. Following directories are used:
~/.config/sw-cli-tools: Here the main configuration as well as the extensions are stored
~/.cache/sw-cli-tools: Here caches (like repo content) as well as release downloads are cached
~/.local/share/sw-cli-tools: Assets the demo data package are stored here
If you changed some of these directories via `XDG` environment variables, those directories are used instead
# Configuration
The configuration of the script is done in `~/.config/sw-cli-tools/config.yaml`. If the file does not exist on your system, it is created after the first usage of the script.
# Building sw.phar
For building the release package (`sw.phar`) [box](http://box-project.github.io/box2/) is used.
A new release is build autmatically for every push on the master branch by Travis CI (See `bin/deploy.sh`).
# Coding standard
Coding standard for the project is [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md).
Coding standard violations may be detected using php-cs-fixer:
./vendor/bin/php-cs-fixer fix -v --level=psr2 ./src
./vendor/bin/php-cs-fixer fix -v --level=psr2 ./tests
# General hints
## Timeouts
If you are having a slow internet connection and e.g. git checkouts or tasks related to the `ProcessExecutor` fail
with a timeout, you can increase the timeout by setting the environment variable `SW_TIMEOUT`:
SW_TIMEOUT=500 sw install:vcs
| {
"content_hash": "f719e4dda3534bb18e21446c10a1d514",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 336,
"avg_line_length": 49.015228426395936,
"alnum_prop": 0.7368475559237779,
"repo_name": "janbuecker/sw-cli-tools",
"id": "9617c5ac5f0a8c1e710bc2cefecd03d00b904f62",
"size": "9682",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "330797"
},
{
"name": "Shell",
"bytes": "1222"
},
{
"name": "Smarty",
"bytes": "39808"
}
],
"symlink_target": ""
} |
A partial ETL of SEER Medicare data into OMOP CDMv4
### Original Purpose
Outcomes Insights ETLed a subset of SEER Medicare data in preparation for a demonstration of [Jigsaw](http://jigsawanalytics.com/) to [NCI](http://www.cancer.gov/) in November, 2014. As members of the [CMS ETL Working Group](http://www.ohdsi.org/web/wiki/doku.php?id=projects:workgroups:etl-wg), we believed it might be helpful if we provided the OHDSI community with the SAS code we used to perform this incomplete ETL of SEER Medicare into OMOP CDMv4.
Please note the SAS code is for reference only and not intended to be reusable. It is also not intended to serve as a basis for implementation of future ETLs.
### Scope of ETL
The ETL only generates CDMv4-compatible CSV files for the following tables:
- Person
- Condition Occurrence
- Procedure Occurence
- Visit Occurence
- Payer Plan Period
- Observation Period
- Death
### Further Information
Outcomes Insights created a [partial ETL specification](https://github.com/outcomesinsights/seer_to_omop_cdmv4/blob/master/ETL%20for%20SEER%20Medicare%20data%20v0.1.doc?raw=true) which contains additional information about this ETL implementation.
| {
"content_hash": "7ad18af90bb9114a477cce2f4b3813c4",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 454,
"avg_line_length": 53.68181818181818,
"alnum_prop": 0.7883149872988993,
"repo_name": "outcomesinsights/seer_to_omop_cdmv4",
"id": "99222e7d1a0a7e1aafa5ac990e6aa39dd85a16bc",
"size": "1215",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "SAS",
"bytes": "91405"
}
],
"symlink_target": ""
} |
'use strict';
/**
* The response of a list operation.
*/
class ResponseWithContinuationLab extends Array {
/**
* Create a ResponseWithContinuationLab.
* @property {string} [nextLink] Link for next set of results.
*/
constructor() {
super();
}
/**
* Defines the metadata of ResponseWithContinuationLab
*
* @returns {object} metadata of ResponseWithContinuationLab
*
*/
mapper() {
return {
required: false,
serializedName: 'ResponseWithContinuation_Lab_',
type: {
name: 'Composite',
className: 'ResponseWithContinuationLab',
modelProperties: {
value: {
required: false,
serializedName: '',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'LabElementType',
type: {
name: 'Composite',
className: 'Lab'
}
}
}
},
nextLink: {
required: false,
serializedName: 'nextLink',
type: {
name: 'String'
}
}
}
}
};
}
}
module.exports = ResponseWithContinuationLab;
| {
"content_hash": "b593426cca660ee879c8ba264a82afa8",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 64,
"avg_line_length": 21.779661016949152,
"alnum_prop": 0.488715953307393,
"repo_name": "Azure/azure-sdk-for-node",
"id": "9e6521bf828e5d0cff9644f82b81496ad95fb2b8",
"size": "1602",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/services/labservicesManagement/lib/models/responseWithContinuationLab.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "661"
},
{
"name": "JavaScript",
"bytes": "123558116"
},
{
"name": "Shell",
"bytes": "437"
},
{
"name": "TypeScript",
"bytes": "2558"
}
],
"symlink_target": ""
} |
from . import simplify
from .core import symbolic as _sym
# comparison operations
Equal = _sym('==')
LessThan = _sym('<')
GreaterThan = _sym('>')
LessThanEq = _sym('<=')
GreaterThanEq = _sym('>=')
Add = _sym('+', identity=_sym(0), numeric='__add__', commutative=True, associative=True)
Sub = _sym('-', ridentity=_sym(0), numeric='__sub__')
Div = _sym('/', ridentity=_sym(1), numeric='__div__')
Mul = _sym('*', zero=_sym(0), identity=_sym(1), numeric='__mul__', commutative=True, associative=True)
Pow = _sym('**', ridentity=_sym(1), numeric='__pow__')
RShift = _sym('>>', cast=int, ridentity=_sym(0), numeric='__rshift__')
LShift = _sym('<<', cast=int, ridentity=_sym(0), numeric='__lshift__')
BitAnd = _sym('&', cast=int, zero=_sym(0), numeric='__and__', commutative=True, associative=True)
BitOr = _sym('|', cast=int, identity=_sym(0), numeric='__or__', commutative=True, associative=True)
BitXor = _sym('^', cast=int, identity=_sym(0), numeric='__xor__', commutative=True, associative=False)
#LogicalAnd = _sym('&&', cast=bool, zero=_sym(False), numeric='__and__', commutative=True, associative=True)
#LogicalOr = _sym('||', cast=bool, zero=_sym(True), numeric='__or__', commutative=True, associative=True)
#LogicalXor = _sym('^^', cast=bool, numeric='__xor__', commutative=True, associative=False)
# Sum(variable, min, max, expression)
Sum = _sym('Sum')
| {
"content_hash": "40f01f491baf8d7ab2f92b48a1d550b8",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 108,
"avg_line_length": 52.34615384615385,
"alnum_prop": 0.633357825128582,
"repo_name": "AaronKel/uMath",
"id": "17afcb158cc6e21360499e794a66fcac19e72bfd",
"size": "1361",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "umath/stdops.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "55584"
}
],
"symlink_target": ""
} |
author: Elliot Forbes
date: 2017-08-08T18:55:48+01:00
desc:
In this tutorial we learn what Python Decorators are and how we can create our
own within our Python applications
series: python
image: python.svg
tags:
- beginner
title: Python Decorators Tutorial
twitter: https://twitter.com/Elliot_F
authorImage: https://images.tutorialedge.net/authors/profile.jpeg
weight: 11
---
> This Tutorial was written using Python 3.6
In this tutorial, I am going to be demonstrating the wonderful concept that is
Python decorators. We'll look at the various attributes of Python that make
writing your own decorators fairly simple and then we'll cover some cool
examples as to how you can use decorators to improve the performance of some
types of applications.
# Video Tutorial
If you prefer, feel free to check out the video version of this course, like and
subscribe to my channel for more Python related video content!
<div style="position:relative;height:0;padding-bottom:56.3%"><iframe src="https://www.youtube.com/watch?v=Npko82jkPKg" style="position:absolute;width:100%;height:100%;left:0" width="639" height="360" frameborder="0" gesture="media" allowfullscreen></iframe></div>
# Getting Started
Decorators are a pretty cool concept that allow you to decorate functions and
classes with a decorator and a new, transformed function or class will be
returned. If you are coming from a Java background then you may have used
decorators a lot in frameworks such as Spring and Jersey.
If you come from a pure Python background then you may have seen decorators
feature in frameworks such as flask. In flask, you would typically define a
function and then decorate it with things such as `@app.route("/my-endpoint")`
in order to specify that this is the function that will be executed whenever the
`/my-endpoint` is called from your app.
Let's take a look at a real life example. In the below code we define a very
simple Flask based program. This program features only one function
`def hello():`, right above this function declaration you should see
`@app.route("/")` which is an example of an `decorator`.
```python
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
```
If we were to run this program then you would see a very simple service start up
at `http://localhost:5000` and whenever you navigated to that page in the
browser you would would see that our `hello()` function is called and
`Hello World!` is printed in our browser.
# First Class Citizens
So how do we write our own decorators? We'll it turns out it's surprisingly
simple. In Python functions and classes are considered first class citizens.
This essentially means that they can be treated much the same as you would treat
variables or objects within your python applications. We can do cool things like
pass one function as an argument into another function like so:
```python
def myFunction():
print("Hello")
def anotherFunction(function):
print(function)
anotherFunction(myFunction)
```
When you run this python program you should see the following output:
```bash
$ python3.6 decorators.py
<function myFunction at 0x100562e18>
```
Instead of printing out hello, it prints out that the `myFunction()` that we
passed into `anotherFunction()` is of type `function` as well as it's name and
it's address in memory.
# Nested Functions
With functions being classed as objects within Python, we can start to do cool
things such as nested functions.
Imagine you had an application that parsed a message that was either in a `JSON`
format or an `XML` format, you could define a `parse(type, message)` function
that featured 2 nested functions, it would then execute and return the results
from the appropriate function depending on the format.
```py
def parse(type, message):
def xml(message):
print("Parsing XML")
def json(message):
print("Parsing JSON")
if type == 'json':
return json(message)
else:
return xml(message)
```
When you run this and pass in `type='json'` and your message, it should return
the following:
```py
>>> parse(type='json', message='my message')
json
```
# A Simple Decorator
Due to the fact functions are a first class citizen in python, we can also
manipulate them in much the same way that we would manipulate variables. Let's
define a very simple decorator that will return a new function and wrap it in
two print statements. This decorator will be called `mutate()`.
```python
def mutate(method):
def newmethod(*args, **kwargs):
print("Executing Method")
method(*args, **kwargs)
print("Finished Executing Method")
return newmethod
@mutate
def myFunction():
print("Hello")
myFunction()
```
> You'll notice that in the above code we have been able to define the
> `newmethod()` function within the body of the `mutate()` function. This is one
> of the benefits of functions being a first class citizen.
You should see that when we execute the above code you should see the following
output:
```bash
$ python3.6 decorators.py
Executing Method
Hello
Finished Executing Method
```
Our call to `myFunction()` has successfully triggered our mutate decorator,
which has modified our original function and returned a new function which
contains our desired print statements.
# Taking it further
This is just a simple example of how you can write your own python decorators,
but there are hundreds of other uses for decorators within your Python
applications.
For a pretty cool list of all the various different things you can do with
decorators I suggest you check out the
[Python Decorator Library](https://wiki.python.org/moin/PythonDecoratorLibrary).
If you have seen my post on
[memoization](https://tutorialedge.net/compsci/memoization-for-beginners/) which
is a cool performance optimization technique used in recursive programs then you
might like their decorator example which automatically memoizes the results of
said function for you:
[Python Decorator Memoization](https://wiki.python.org/moin/PythonDecoratorLibrary#Memoize)
# Losing Traceability
When we utilize decorators in the above fashion you may notice an unintended
side-affect where the function has been renamed to that of the decorator.
```py
>>> repr(myFunction)
'<function mutate.<locals>.newmethod at 0x1022b8e18>'
```
If we decorate hundreds of functions with this `@mutate` decorator then you may
find that your programs become slightly harder to debug as tools that are
specifically designed for introspection will throw back incorrect function names
like the above example.
## The Solution
In order to fix this particular side-effect, we can look to the `functools`
module which is built-in to Python. We add `from functools import *` to the top
of our file and within our decorator, we add a second `@wraps()` decorator which
takes in the original function as it's parameter. If we update our example code
above to include this fix, it should then look like this:
```py
from functools import *
def mutate(method):
@wraps(method)
def newmethod(*args, **kwargs):
print("Executing Method")
method(*args, **kwargs)
print("Finished Executing Method")
return newmethod
@mutate
def myFunction():
print("Hello")
myFunction()
```
And when we again call `repr` on our function you'll see it outputs the correct
name:
```py
>>> from main import *
Executing Method
Hello
Finished Executing Method
>>> repr(myFunction)
'<function myFunction at 0x1022d3e18>'
```
# Conclusion
In this tutorial, we managed to cover a number of key things you'll need to know
when working with decorators in Python. We covered the fact that in Python,
functions are considered first class citizens, we also looked at how you could
nest functions within other functions before finally looking at how you could
create your own very simple decorators.
Hopefully, you found this tutorial on Python decorators useful! If you require
further assistance then please feel free to let me know in the comments section
below or by tweeting me: [@Elliot_F](https://twitter.com/elliot_f).
| {
"content_hash": "b64a81f6787e95c51ca874fd4e5c5b8a",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 263,
"avg_line_length": 33.28163265306122,
"alnum_prop": 0.7615894039735099,
"repo_name": "elliotforbes/tutorialedge-v2",
"id": "2e4f23f038d94f8e11764fd756448070f9f5d0af",
"size": "8158",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "content/python/python-decorators-tutorial.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "106171"
},
{
"name": "HTML",
"bytes": "49260"
},
{
"name": "JavaScript",
"bytes": "10921"
}
],
"symlink_target": ""
} |
//
// YDNetworkSpeed.h
// NetworkFlow
//
// Created by xuning on 2018/2/7.
// Copyright © 2018年 Adways. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
* @{@"received":@"100kB/s"}
*/
FOUNDATION_EXTERN NSString *const kNetworkReceivedSpeedNotification;
/**
* @{@"send":@"100kB/s"}
*/
FOUNDATION_EXTERN NSString *const kNetworkSendSpeedNotification;
@interface YDNetworkSpeed : NSObject
@property (nonatomic, copy, readonly) NSString * receivedNetworkSpeed;
@property (nonatomic, copy, readonly) NSString * sendNetworkSpeed;
+ (instancetype)shareNetworkSpeed;
- (void)startMonitoringNetworkSpeed;
- (void)stopMonitoringNetworkSpeed;
@end
| {
"content_hash": "6d44bbc5132ad2690dcff5cb93a4c113",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 70,
"avg_line_length": 22.133333333333333,
"alnum_prop": 0.7394578313253012,
"repo_name": "TsuiOS/XNCodeLibrary",
"id": "57b33cc040206eed48708535ff6a7b0c5d5405df",
"size": "667",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "YDNetworkSpeed/YDNetworkSpeed.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "6805"
},
{
"name": "Objective-C",
"bytes": "129824"
}
],
"symlink_target": ""
} |
description: Learn how to troubleshoot your Docker Universal Control Plane cluster.
keywords: docker, ucp, troubleshoot
title: Troubleshoot your cluster
---
If you detect problems in your UCP cluster, you can start your troubleshooting
session by checking the logs of the
[individual UCP components](../../architecture.md). Only administrator users can
see information about UCP system containers.
## Check the logs from the UI
To see the logs of the UCP system containers, navigate to the **Containers**
page of UCP. By default the UCP system containers are hidden. Click the
**Show all containers** option for the UCP system containers to be listed as
well.
{: .with-border}
You can click on a container to see more details like its configurations and
logs.
## Check the logs from the CLI
You can also check the logs of UCP system containers from the CLI. This is
specially useful if the UCP web application is not working.
1. Get a client certificate bundle.
When using the Docker CLI client you need to authenticate using client
certificates.
[Learn how to use client certificates](../../user/access-ucp/cli-based-access.md).
If your client certificate bundle is for a non-admin user, you won't have
permissions to see the UCP system containers.
2. Check the logs of UCP system containers.
```bash
# By default system containers are not displayed. Use the -a flag to display them
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
922503c2102a docker/ucp-controller:1.1.0-rc2 "/bin/controller serv" 4 hours ago Up 30 minutes 192.168.10.100:444->8080/tcp ucp/ucp-controller
1b6d429f1bd5 docker/ucp-swarm:1.1.0-rc2 "/swarm join --discov" 4 hours ago Up 4 hours 2375/tcp ucp/ucp-swarm-join
# See the logs of the ucp/ucp-controller container
$ docker logs ucp/ucp-controller
{"level":"info","license_key":"PUagrRqOXhMH02UgxWYiKtg0kErLY8oLZf1GO4Pw8M6B","msg":"/v1.22/containers/ucp/ucp-controller/json","remote_addr":"192.168.10.1:59546","tags":["api","v1.22","get"],"time":"2016-04-25T23:49:27Z","type":"api","username":"dave.lauper"}
{"level":"info","license_key":"PUagrRqOXhMH02UgxWYiKtg0kErLY8oLZf1GO4Pw8M6B","msg":"/v1.22/containers/ucp/ucp-controller/logs","remote_addr":"192.168.10.1:59546","tags":["api","v1.22","get"],"time":"2016-04-25T23:49:27Z","type":"api","username":"dave.lauper"}
```
## Where to go next
* [Troubleshoot configurations](troubleshoot-configurations.md)
| {
"content_hash": "24c46a568928a91b1c69cf8c192809c3",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 263,
"avg_line_length": 47.03508771929825,
"alnum_prop": 0.6948899664304364,
"repo_name": "LuisBosquez/docker.github.io",
"id": "d12f3507fff59a14a5ea545d2642945d839e1a0c",
"size": "2685",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "datacenter/ucp/2.1/guides/admin/monitor-and-troubleshoot/troubleshoot-with-logs.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1507965"
},
{
"name": "Go",
"bytes": "8433"
},
{
"name": "HTML",
"bytes": "1338751"
},
{
"name": "JavaScript",
"bytes": "5317825"
},
{
"name": "Makefile",
"bytes": "6684"
},
{
"name": "Ruby",
"bytes": "4864"
},
{
"name": "Shell",
"bytes": "6530"
}
],
"symlink_target": ""
} |
/**
* Reflection utilities for criteria
*/
package org.immutables.criteria.reflect; | {
"content_hash": "49e054e968974d70091996cebf2caee5",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 40,
"avg_line_length": 14.5,
"alnum_prop": 0.7471264367816092,
"repo_name": "immutables/immutables",
"id": "cdaf4c6d81b2267d3667c4c506e0b3fb74cd3709",
"size": "702",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "criteria/common/src/org/immutables/criteria/reflect/package-info.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "3646217"
}
],
"symlink_target": ""
} |
/**
Solid CSS Framework. (Flat UI Design)
jQuery PlugIn Helper Javascript Function
Supprot List -
** sameHeight(element, options)
// Adjust element base on max height
** navHiddder (element, options)
// For Mobile drop down navigation
**/
(function($) {
$.fn.sameHeight = function ( options) {
var screenSize = $(window).width(),
limitSize = ((typeof options == 'undefined') ? 0 : options);
if (screenSize < limitSize) {
return true;
}
return this.each(function() {
var childElements = $(this).children();
max = 0;
childElements.each(function() {
var element = $(this),
h = $(element).height();
max = (h > max ? h : max );
});
$(childElements).css({height: max})
.addClass('sd-height-adjust');
});
};
$.fn.navHidder = function (ele, options) {
if ($(ele).hasClass('sd-show')) {
$(ele).hide().removeClass('sd-show');
} else {
$(ele).show().addClass('sd-show');
}
};
$.fn.slideSearch = function (options) {
var btn = $(this),
direction = 'left',
speed = 900,
effect = "linear",
par = $(this).parent().parent('.search-box'),
search = par.find('input[type=text], input[type=search]'),
s_width = $(search).width();
if (typeof $(btn).data('dir') != 'undefined') {
direction = $(btn).data('dir');
}
if (typeof $(btn).data('speed') != 'undefined') {
speed = $(btn).data('speed');
}
if (typeof $(btn).data('effect') != 'undefined') {
effect = $(btn).data('effect');
}
$(search).animate({
width: ['toggle'],
left: "-="+s_width,
}, speed, effect);
};
window.Solid = {
sameHeight : function () {
var ele = $('.same-height');
$(ele).each(function(){
options = $(this).data('screen');
$(this).sameHeight(options);
});
}
}
$(document).on('click', '.nav-hidder-btn', function(e) {
var btn = $(this),
target = $(btn).data('targets');
if (typeof target == 'undefined') {
var par = $(this).parent('.nav-hidder'),
target = $(par).find('.nav-hidder-body');
}
$(btn).navHidder(target);
});
// Bind the SameHeight
$(document).on('load', window.Solid.sameHeight());
$(document).on('click', '[data-search=slide]', function(e) {
var btn = $(this),
direction = 'left',
speed = 900,
effect = "linear";
$(btn).slideSearch(direction);
/*if (typeof target == 'undefined') {
var par = $(this).parent('.nav-hidder'),
target = $(par).find('.nav-hidder-body');
}
$(btn).navHidder(target);*/
});
})(window.jQuery);
//jQuery(window).on('load', window.Solid.sameHeight());
$('.badge').click(function() {
alert($(this).data('sd-org-height'));
})
// Prettify PlugIn
$('pre, table code').addClass('prettyprint');
prettyPrint();
| {
"content_hash": "6b88f09c4fb887fbd3ef83ead555010a",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 63,
"avg_line_length": 22.076923076923077,
"alnum_prop": 0.5473867595818815,
"repo_name": "reborncms/reborn",
"id": "e9611ee00d5d5d553ab08ada49f21e372c18f45a",
"size": "2870",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "heart/themes/default/assets/js/solid/solid.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3369"
},
{
"name": "CSS",
"bytes": "412261"
},
{
"name": "Groovy",
"bytes": "16011"
},
{
"name": "HTML",
"bytes": "259447"
},
{
"name": "JavaScript",
"bytes": "1203073"
},
{
"name": "PHP",
"bytes": "1540511"
},
{
"name": "Shell",
"bytes": "2132"
}
],
"symlink_target": ""
} |
import os
import sys
target_version = "3.0.0"
def build_version():
distance ="0"
try:
from subprocess import Popen, PIPE
prev_tag,distance,revision = Popen(["git", "describe", "--match", "[0-9]*", "--long"],
cwd=os.path.dirname(__file__),
stdout=PIPE
).communicate()[0].strip().split("-")
if distance == "0":
return prev_tag
elif prev_tag == target_version:
return "%s.post%s"%(target_version, distance)
except Exception as e:
print e
return "%s.dev%s"%(target_version, distance)
try:
from .version import __version__
except ImportError:
__version__=build_version()
| {
"content_hash": "4ddd4b731e2713a5332850e5a9fdaee1",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 94,
"avg_line_length": 27.24137931034483,
"alnum_prop": 0.49493670886075947,
"repo_name": "zepheira/freemix",
"id": "128de7730299aa886ae4ce0ad788290ad2f4a57e",
"size": "790",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "freemix/__init__.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "473957"
},
{
"name": "Python",
"bytes": "184518"
}
],
"symlink_target": ""
} |
def example_sender(options = {})
example_contact options
end
def example_recipient(options = {})
example_contact options
end
def example_contact(options = {})
{
Id: SecureRandom.uuid,
Address: example_address,
FirstName: "Werner",
Surname: "Heisenberg",
PhoneNumber: "12323-121211",
MobileNumber: "12323-23232",
Email: "ww@a1a.com"
}.merge! options
end
def example_address(options = {})
{
Id: SecureRandom.uuid,
Company: "A1A",
Department: "Distributing",
Floor: "Basement",
StreetNumber: "1",
Country: "GB",
CountryIso: 826,
City: 'Albuquerque',
PostalArea: 'SA1 1DP'
}.merge! options
end
| {
"content_hash": "51299f07116b5b4d18ef396726dd6c76",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 35,
"avg_line_length": 20.272727272727273,
"alnum_prop": 0.6457399103139013,
"repo_name": "veeqo/sendvia",
"id": "d7cd150ee81c668347e5413f74c84a62f620da5f",
"size": "669",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/fixtures/contact.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "36110"
}
],
"symlink_target": ""
} |
package de.fxnn.geld.io.mt940;
import lombok.EqualsAndHashCode;
import lombok.Value;
@Value
@EqualsAndHashCode(callSuper = true)
public class Mt940AccountField extends SimpleMt940Field {
/**
* Interpretation of this field is specific to the bank.
*
* <p>Examples:
*
* <ul>
* <li>IBAN
* <li>BIC and account number
* </ul>
*/
String accountNumber;
public Mt940AccountField(String tag, String accountNumber) {
super(tag);
this.accountNumber = accountNumber;
}
public static Mt940Field of(Mt940RawField rawField) {
return new Mt940AccountField(rawField.getTag(), rawField.getRawContent());
}
}
| {
"content_hash": "3bea7c2d8349e416fbe1e7a6fc280d24",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 78,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.6984615384615385,
"repo_name": "fxnn/geld",
"id": "5f7ca65ff85156e35ff751c3e704fd5e688f95ac",
"size": "650",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/de/fxnn/geld/io/mt940/Mt940AccountField.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "35408"
},
{
"name": "JavaScript",
"bytes": "9603"
}
],
"symlink_target": ""
} |
'use strict';
const msRest = require('ms-rest');
const msRestAzure = require('ms-rest-azure');
const WebResource = msRest.WebResource;
/**
* Lists a collection of the APIs associated with a product.
*
* @param {string} resourceGroupName The name of the resource group.
*
* @param {string} serviceName The name of the API Management service.
*
* @param {string} productId Product identifier. Must be unique in the current
* API Management service instance.
*
* @param {object} [options] Optional Parameters.
*
* @param {string} [options.filter] | Field | Supported operators |
* Supported functions |
* |-------------|------------------------|---------------------------------------------|
* | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
* endswith |
* | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
* endswith |
* | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
* endswith |
* | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
* endswith |
* | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
* endswith |
*
*
* @param {number} [options.top] Number of records to return.
*
* @param {number} [options.skip] Number of records to skip.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} callback - The callback.
*
* @returns {function} callback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link ApiCollection} for more information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
function _listByProduct(resourceGroupName, serviceName, productId, options, callback) {
/* jshint validthis: true */
let client = this.client;
if(!callback && typeof options === 'function') {
callback = options;
options = null;
}
if (!callback) {
throw new Error('callback cannot be null.');
}
let filter = (options && options.filter !== undefined) ? options.filter : undefined;
let top = (options && options.top !== undefined) ? options.top : undefined;
let skip = (options && options.skip !== undefined) ? options.skip : undefined;
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
}
if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') {
throw new Error('serviceName cannot be null or undefined and it must be of type string.');
}
if (serviceName !== null && serviceName !== undefined) {
if (serviceName.length > 50)
{
throw new Error('"serviceName" should satisfy the constraint - "MaxLength": 50');
}
if (serviceName.length < 1)
{
throw new Error('"serviceName" should satisfy the constraint - "MinLength": 1');
}
if (serviceName.match(/^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/) === null)
{
throw new Error('"serviceName" should satisfy the constraint - "Pattern": /^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/');
}
}
if (productId === null || productId === undefined || typeof productId.valueOf() !== 'string') {
throw new Error('productId cannot be null or undefined and it must be of type string.');
}
if (productId !== null && productId !== undefined) {
if (productId.length > 256)
{
throw new Error('"productId" should satisfy the constraint - "MaxLength": 256');
}
if (productId.length < 1)
{
throw new Error('"productId" should satisfy the constraint - "MinLength": 1');
}
if (productId.match(/^[^*#&+:<>?]+$/) === null)
{
throw new Error('"productId" should satisfy the constraint - "Pattern": /^[^*#&+:<>?]+$/');
}
}
if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
throw new Error('filter must be of type string.');
}
if (top !== null && top !== undefined && typeof top !== 'number') {
throw new Error('top must be of type number.');
}
if (top !== null && top !== undefined) {
if (top < 1)
{
throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
}
}
if (skip !== null && skip !== undefined && typeof skip !== 'number') {
throw new Error('skip must be of type number.');
}
if (skip !== null && skip !== undefined) {
if (skip < 0)
{
throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 0');
}
}
if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
}
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
}
if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
throw new Error('this.client.acceptLanguage must be of type string.');
}
} catch (error) {
return callback(error);
}
// Construct URL
let baseUrl = this.client.baseUri;
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis';
requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName));
requestUrl = requestUrl.replace('{productId}', encodeURIComponent(productId));
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
let queryParameters = [];
if (filter !== null && filter !== undefined) {
queryParameters.push('$filter=' + encodeURIComponent(filter));
}
if (top !== null && top !== undefined) {
queryParameters.push('$top=' + encodeURIComponent(top.toString()));
}
if (skip !== null && skip !== undefined) {
queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
}
queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
if (queryParameters.length > 0) {
requestUrl += '?' + queryParameters.join('&');
}
// Create HTTP transport objects
let httpRequest = new WebResource();
httpRequest.method = 'GET';
httpRequest.url = requestUrl;
httpRequest.headers = {};
// Set Headers
httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
if (this.client.generateClientRequestId) {
httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
}
if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
httpRequest.headers['accept-language'] = this.client.acceptLanguage;
}
if(options) {
for(let headerName in options['customHeaders']) {
if (options['customHeaders'].hasOwnProperty(headerName)) {
httpRequest.headers[headerName] = options['customHeaders'][headerName];
}
}
}
httpRequest.body = null;
// Send Request
return client.pipeline(httpRequest, (err, response, responseBody) => {
if (err) {
return callback(err);
}
let statusCode = response.statusCode;
if (statusCode !== 200) {
let error = new Error(responseBody);
error.statusCode = response.statusCode;
error.request = msRest.stripRequest(httpRequest);
error.response = msRest.stripResponse(response);
if (responseBody === '') responseBody = null;
let parsedErrorResponse;
try {
parsedErrorResponse = JSON.parse(responseBody);
if (parsedErrorResponse) {
let internalError = null;
if (parsedErrorResponse.error) internalError = parsedErrorResponse.error;
error.code = internalError ? internalError.code : parsedErrorResponse.code;
error.message = internalError ? internalError.message : parsedErrorResponse.message;
}
if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
let resultMapper = new client.models['ErrorResponse']().mapper();
error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
}
} catch (defaultError) {
error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
`- "${responseBody}" for the default response.`;
return callback(error);
}
return callback(error);
}
// Create Result
let result = null;
if (responseBody === '') responseBody = null;
// Deserialize Response
if (statusCode === 200) {
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['ApiCollection']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
deserializationError.request = msRest.stripRequest(httpRequest);
deserializationError.response = msRest.stripResponse(response);
return callback(deserializationError);
}
}
return callback(null, result, httpRequest, response);
});
}
/**
* Adds an API to the specified product.
*
* @param {string} resourceGroupName The name of the resource group.
*
* @param {string} serviceName The name of the API Management service.
*
* @param {string} productId Product identifier. Must be unique in the current
* API Management service instance.
*
* @param {string} apiId API identifier. Must be unique in the current API
* Management service instance.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} callback - The callback.
*
* @returns {function} callback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link ApiContract} for more information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
function _createOrUpdate(resourceGroupName, serviceName, productId, apiId, options, callback) {
/* jshint validthis: true */
let client = this.client;
if(!callback && typeof options === 'function') {
callback = options;
options = null;
}
if (!callback) {
throw new Error('callback cannot be null.');
}
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
}
if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') {
throw new Error('serviceName cannot be null or undefined and it must be of type string.');
}
if (serviceName !== null && serviceName !== undefined) {
if (serviceName.length > 50)
{
throw new Error('"serviceName" should satisfy the constraint - "MaxLength": 50');
}
if (serviceName.length < 1)
{
throw new Error('"serviceName" should satisfy the constraint - "MinLength": 1');
}
if (serviceName.match(/^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/) === null)
{
throw new Error('"serviceName" should satisfy the constraint - "Pattern": /^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/');
}
}
if (productId === null || productId === undefined || typeof productId.valueOf() !== 'string') {
throw new Error('productId cannot be null or undefined and it must be of type string.');
}
if (productId !== null && productId !== undefined) {
if (productId.length > 256)
{
throw new Error('"productId" should satisfy the constraint - "MaxLength": 256');
}
if (productId.length < 1)
{
throw new Error('"productId" should satisfy the constraint - "MinLength": 1');
}
if (productId.match(/^[^*#&+:<>?]+$/) === null)
{
throw new Error('"productId" should satisfy the constraint - "Pattern": /^[^*#&+:<>?]+$/');
}
}
if (apiId === null || apiId === undefined || typeof apiId.valueOf() !== 'string') {
throw new Error('apiId cannot be null or undefined and it must be of type string.');
}
if (apiId !== null && apiId !== undefined) {
if (apiId.length > 256)
{
throw new Error('"apiId" should satisfy the constraint - "MaxLength": 256');
}
if (apiId.length < 1)
{
throw new Error('"apiId" should satisfy the constraint - "MinLength": 1');
}
if (apiId.match(/^[^*#&+:<>?]+$/) === null)
{
throw new Error('"apiId" should satisfy the constraint - "Pattern": /^[^*#&+:<>?]+$/');
}
}
if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
}
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
}
if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
throw new Error('this.client.acceptLanguage must be of type string.');
}
} catch (error) {
return callback(error);
}
// Construct URL
let baseUrl = this.client.baseUri;
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}';
requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName));
requestUrl = requestUrl.replace('{productId}', encodeURIComponent(productId));
requestUrl = requestUrl.replace('{apiId}', encodeURIComponent(apiId));
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
let queryParameters = [];
queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
if (queryParameters.length > 0) {
requestUrl += '?' + queryParameters.join('&');
}
// Create HTTP transport objects
let httpRequest = new WebResource();
httpRequest.method = 'PUT';
httpRequest.url = requestUrl;
httpRequest.headers = {};
// Set Headers
httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
if (this.client.generateClientRequestId) {
httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
}
if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
httpRequest.headers['accept-language'] = this.client.acceptLanguage;
}
if(options) {
for(let headerName in options['customHeaders']) {
if (options['customHeaders'].hasOwnProperty(headerName)) {
httpRequest.headers[headerName] = options['customHeaders'][headerName];
}
}
}
httpRequest.body = null;
// Send Request
return client.pipeline(httpRequest, (err, response, responseBody) => {
if (err) {
return callback(err);
}
let statusCode = response.statusCode;
if (statusCode !== 201 && statusCode !== 200) {
let error = new Error(responseBody);
error.statusCode = response.statusCode;
error.request = msRest.stripRequest(httpRequest);
error.response = msRest.stripResponse(response);
if (responseBody === '') responseBody = null;
let parsedErrorResponse;
try {
parsedErrorResponse = JSON.parse(responseBody);
if (parsedErrorResponse) {
let internalError = null;
if (parsedErrorResponse.error) internalError = parsedErrorResponse.error;
error.code = internalError ? internalError.code : parsedErrorResponse.code;
error.message = internalError ? internalError.message : parsedErrorResponse.message;
}
if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
let resultMapper = new client.models['ErrorResponse']().mapper();
error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
}
} catch (defaultError) {
error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
`- "${responseBody}" for the default response.`;
return callback(error);
}
return callback(error);
}
// Create Result
let result = null;
if (responseBody === '') responseBody = null;
// Deserialize Response
if (statusCode === 201) {
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['ApiContract']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
deserializationError.request = msRest.stripRequest(httpRequest);
deserializationError.response = msRest.stripResponse(response);
return callback(deserializationError);
}
}
// Deserialize Response
if (statusCode === 200) {
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['ApiContract']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
deserializationError1.request = msRest.stripRequest(httpRequest);
deserializationError1.response = msRest.stripResponse(response);
return callback(deserializationError1);
}
}
return callback(null, result, httpRequest, response);
});
}
/**
* Deletes the specified API from the specified product.
*
* @param {string} resourceGroupName The name of the resource group.
*
* @param {string} serviceName The name of the API Management service.
*
* @param {string} productId Product identifier. Must be unique in the current
* API Management service instance.
*
* @param {string} apiId API identifier. Must be unique in the current API
* Management service instance.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} callback - The callback.
*
* @returns {function} callback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
function _deleteMethod(resourceGroupName, serviceName, productId, apiId, options, callback) {
/* jshint validthis: true */
let client = this.client;
if(!callback && typeof options === 'function') {
callback = options;
options = null;
}
if (!callback) {
throw new Error('callback cannot be null.');
}
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
}
if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') {
throw new Error('serviceName cannot be null or undefined and it must be of type string.');
}
if (serviceName !== null && serviceName !== undefined) {
if (serviceName.length > 50)
{
throw new Error('"serviceName" should satisfy the constraint - "MaxLength": 50');
}
if (serviceName.length < 1)
{
throw new Error('"serviceName" should satisfy the constraint - "MinLength": 1');
}
if (serviceName.match(/^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/) === null)
{
throw new Error('"serviceName" should satisfy the constraint - "Pattern": /^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/');
}
}
if (productId === null || productId === undefined || typeof productId.valueOf() !== 'string') {
throw new Error('productId cannot be null or undefined and it must be of type string.');
}
if (productId !== null && productId !== undefined) {
if (productId.length > 256)
{
throw new Error('"productId" should satisfy the constraint - "MaxLength": 256');
}
if (productId.length < 1)
{
throw new Error('"productId" should satisfy the constraint - "MinLength": 1');
}
if (productId.match(/^[^*#&+:<>?]+$/) === null)
{
throw new Error('"productId" should satisfy the constraint - "Pattern": /^[^*#&+:<>?]+$/');
}
}
if (apiId === null || apiId === undefined || typeof apiId.valueOf() !== 'string') {
throw new Error('apiId cannot be null or undefined and it must be of type string.');
}
if (apiId !== null && apiId !== undefined) {
if (apiId.length > 256)
{
throw new Error('"apiId" should satisfy the constraint - "MaxLength": 256');
}
if (apiId.length < 1)
{
throw new Error('"apiId" should satisfy the constraint - "MinLength": 1');
}
if (apiId.match(/^[^*#&+:<>?]+$/) === null)
{
throw new Error('"apiId" should satisfy the constraint - "Pattern": /^[^*#&+:<>?]+$/');
}
}
if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
}
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
}
if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
throw new Error('this.client.acceptLanguage must be of type string.');
}
} catch (error) {
return callback(error);
}
// Construct URL
let baseUrl = this.client.baseUri;
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}';
requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName));
requestUrl = requestUrl.replace('{productId}', encodeURIComponent(productId));
requestUrl = requestUrl.replace('{apiId}', encodeURIComponent(apiId));
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
let queryParameters = [];
queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
if (queryParameters.length > 0) {
requestUrl += '?' + queryParameters.join('&');
}
// Create HTTP transport objects
let httpRequest = new WebResource();
httpRequest.method = 'DELETE';
httpRequest.url = requestUrl;
httpRequest.headers = {};
// Set Headers
httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
if (this.client.generateClientRequestId) {
httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
}
if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
httpRequest.headers['accept-language'] = this.client.acceptLanguage;
}
if(options) {
for(let headerName in options['customHeaders']) {
if (options['customHeaders'].hasOwnProperty(headerName)) {
httpRequest.headers[headerName] = options['customHeaders'][headerName];
}
}
}
httpRequest.body = null;
// Send Request
return client.pipeline(httpRequest, (err, response, responseBody) => {
if (err) {
return callback(err);
}
let statusCode = response.statusCode;
if (statusCode !== 204) {
let error = new Error(responseBody);
error.statusCode = response.statusCode;
error.request = msRest.stripRequest(httpRequest);
error.response = msRest.stripResponse(response);
if (responseBody === '') responseBody = null;
let parsedErrorResponse;
try {
parsedErrorResponse = JSON.parse(responseBody);
if (parsedErrorResponse) {
let internalError = null;
if (parsedErrorResponse.error) internalError = parsedErrorResponse.error;
error.code = internalError ? internalError.code : parsedErrorResponse.code;
error.message = internalError ? internalError.message : parsedErrorResponse.message;
}
if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
let resultMapper = new client.models['ErrorResponse']().mapper();
error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
}
} catch (defaultError) {
error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
`- "${responseBody}" for the default response.`;
return callback(error);
}
return callback(error);
}
// Create Result
let result = null;
if (responseBody === '') responseBody = null;
return callback(null, result, httpRequest, response);
});
}
/**
* Lists a collection of the APIs associated with a product.
*
* @param {string} nextPageLink The NextLink from the previous successful call
* to List operation.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} callback - The callback.
*
* @returns {function} callback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link ApiCollection} for more information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
function _listByProductNext(nextPageLink, options, callback) {
/* jshint validthis: true */
let client = this.client;
if(!callback && typeof options === 'function') {
callback = options;
options = null;
}
if (!callback) {
throw new Error('callback cannot be null.');
}
// Validate
try {
if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
}
if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
throw new Error('this.client.acceptLanguage must be of type string.');
}
} catch (error) {
return callback(error);
}
// Construct URL
let requestUrl = '{nextLink}';
requestUrl = requestUrl.replace('{nextLink}', nextPageLink);
// Create HTTP transport objects
let httpRequest = new WebResource();
httpRequest.method = 'GET';
httpRequest.url = requestUrl;
httpRequest.headers = {};
// Set Headers
httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
if (this.client.generateClientRequestId) {
httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
}
if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
httpRequest.headers['accept-language'] = this.client.acceptLanguage;
}
if(options) {
for(let headerName in options['customHeaders']) {
if (options['customHeaders'].hasOwnProperty(headerName)) {
httpRequest.headers[headerName] = options['customHeaders'][headerName];
}
}
}
httpRequest.body = null;
// Send Request
return client.pipeline(httpRequest, (err, response, responseBody) => {
if (err) {
return callback(err);
}
let statusCode = response.statusCode;
if (statusCode !== 200) {
let error = new Error(responseBody);
error.statusCode = response.statusCode;
error.request = msRest.stripRequest(httpRequest);
error.response = msRest.stripResponse(response);
if (responseBody === '') responseBody = null;
let parsedErrorResponse;
try {
parsedErrorResponse = JSON.parse(responseBody);
if (parsedErrorResponse) {
let internalError = null;
if (parsedErrorResponse.error) internalError = parsedErrorResponse.error;
error.code = internalError ? internalError.code : parsedErrorResponse.code;
error.message = internalError ? internalError.message : parsedErrorResponse.message;
}
if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
let resultMapper = new client.models['ErrorResponse']().mapper();
error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
}
} catch (defaultError) {
error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
`- "${responseBody}" for the default response.`;
return callback(error);
}
return callback(error);
}
// Create Result
let result = null;
if (responseBody === '') responseBody = null;
// Deserialize Response
if (statusCode === 200) {
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['ApiCollection']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
deserializationError.request = msRest.stripRequest(httpRequest);
deserializationError.response = msRest.stripResponse(response);
return callback(deserializationError);
}
}
return callback(null, result, httpRequest, response);
});
}
/** Class representing a ProductApi. */
class ProductApi {
/**
* Create a ProductApi.
* @param {ApiManagementClient} client Reference to the service client.
*/
constructor(client) {
this.client = client;
this._listByProduct = _listByProduct;
this._createOrUpdate = _createOrUpdate;
this._deleteMethod = _deleteMethod;
this._listByProductNext = _listByProductNext;
}
/**
* Lists a collection of the APIs associated with a product.
*
* @param {string} resourceGroupName The name of the resource group.
*
* @param {string} serviceName The name of the API Management service.
*
* @param {string} productId Product identifier. Must be unique in the current
* API Management service instance.
*
* @param {object} [options] Optional Parameters.
*
* @param {string} [options.filter] | Field | Supported operators |
* Supported functions |
* |-------------|------------------------|---------------------------------------------|
* | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
* endswith |
* | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
* endswith |
* | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
* endswith |
* | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
* endswith |
* | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
* endswith |
*
*
* @param {number} [options.top] Number of records to return.
*
* @param {number} [options.skip] Number of records to skip.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @returns {Promise} A promise is returned
*
* @resolve {HttpOperationResponse<ApiCollection>} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
listByProductWithHttpOperationResponse(resourceGroupName, serviceName, productId, options) {
let client = this.client;
let self = this;
return new Promise((resolve, reject) => {
self._listByProduct(resourceGroupName, serviceName, productId, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
return;
});
});
}
/**
* Lists a collection of the APIs associated with a product.
*
* @param {string} resourceGroupName The name of the resource group.
*
* @param {string} serviceName The name of the API Management service.
*
* @param {string} productId Product identifier. Must be unique in the current
* API Management service instance.
*
* @param {object} [options] Optional Parameters.
*
* @param {string} [options.filter] | Field | Supported operators |
* Supported functions |
* |-------------|------------------------|---------------------------------------------|
* | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
* endswith |
* | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
* endswith |
* | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
* endswith |
* | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
* endswith |
* | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
* endswith |
*
*
* @param {number} [options.top] Number of records to return.
*
* @param {number} [options.skip] Number of records to skip.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} [optionalCallback] - The optional callback.
*
* @returns {function|Promise} If a callback was passed as the last parameter
* then it returns the callback else returns a Promise.
*
* {Promise} A promise is returned
*
* @resolve {ApiCollection} - The deserialized result object.
*
* @reject {Error} - The error object.
*
* {function} optionalCallback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link ApiCollection} for more information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
listByProduct(resourceGroupName, serviceName, productId, options, optionalCallback) {
let client = this.client;
let self = this;
if (!optionalCallback && typeof options === 'function') {
optionalCallback = options;
options = null;
}
if (!optionalCallback) {
return new Promise((resolve, reject) => {
self._listByProduct(resourceGroupName, serviceName, productId, options, (err, result, request, response) => {
if (err) { reject(err); }
else { resolve(result); }
return;
});
});
} else {
return self._listByProduct(resourceGroupName, serviceName, productId, options, optionalCallback);
}
}
/**
* Adds an API to the specified product.
*
* @param {string} resourceGroupName The name of the resource group.
*
* @param {string} serviceName The name of the API Management service.
*
* @param {string} productId Product identifier. Must be unique in the current
* API Management service instance.
*
* @param {string} apiId API identifier. Must be unique in the current API
* Management service instance.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @returns {Promise} A promise is returned
*
* @resolve {HttpOperationResponse<ApiContract>} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
createOrUpdateWithHttpOperationResponse(resourceGroupName, serviceName, productId, apiId, options) {
let client = this.client;
let self = this;
return new Promise((resolve, reject) => {
self._createOrUpdate(resourceGroupName, serviceName, productId, apiId, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
return;
});
});
}
/**
* Adds an API to the specified product.
*
* @param {string} resourceGroupName The name of the resource group.
*
* @param {string} serviceName The name of the API Management service.
*
* @param {string} productId Product identifier. Must be unique in the current
* API Management service instance.
*
* @param {string} apiId API identifier. Must be unique in the current API
* Management service instance.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} [optionalCallback] - The optional callback.
*
* @returns {function|Promise} If a callback was passed as the last parameter
* then it returns the callback else returns a Promise.
*
* {Promise} A promise is returned
*
* @resolve {ApiContract} - The deserialized result object.
*
* @reject {Error} - The error object.
*
* {function} optionalCallback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link ApiContract} for more information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
createOrUpdate(resourceGroupName, serviceName, productId, apiId, options, optionalCallback) {
let client = this.client;
let self = this;
if (!optionalCallback && typeof options === 'function') {
optionalCallback = options;
options = null;
}
if (!optionalCallback) {
return new Promise((resolve, reject) => {
self._createOrUpdate(resourceGroupName, serviceName, productId, apiId, options, (err, result, request, response) => {
if (err) { reject(err); }
else { resolve(result); }
return;
});
});
} else {
return self._createOrUpdate(resourceGroupName, serviceName, productId, apiId, options, optionalCallback);
}
}
/**
* Deletes the specified API from the specified product.
*
* @param {string} resourceGroupName The name of the resource group.
*
* @param {string} serviceName The name of the API Management service.
*
* @param {string} productId Product identifier. Must be unique in the current
* API Management service instance.
*
* @param {string} apiId API identifier. Must be unique in the current API
* Management service instance.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @returns {Promise} A promise is returned
*
* @resolve {HttpOperationResponse<null>} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
deleteMethodWithHttpOperationResponse(resourceGroupName, serviceName, productId, apiId, options) {
let client = this.client;
let self = this;
return new Promise((resolve, reject) => {
self._deleteMethod(resourceGroupName, serviceName, productId, apiId, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
return;
});
});
}
/**
* Deletes the specified API from the specified product.
*
* @param {string} resourceGroupName The name of the resource group.
*
* @param {string} serviceName The name of the API Management service.
*
* @param {string} productId Product identifier. Must be unique in the current
* API Management service instance.
*
* @param {string} apiId API identifier. Must be unique in the current API
* Management service instance.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} [optionalCallback] - The optional callback.
*
* @returns {function|Promise} If a callback was passed as the last parameter
* then it returns the callback else returns a Promise.
*
* {Promise} A promise is returned
*
* @resolve {null} - The deserialized result object.
*
* @reject {Error} - The error object.
*
* {function} optionalCallback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
deleteMethod(resourceGroupName, serviceName, productId, apiId, options, optionalCallback) {
let client = this.client;
let self = this;
if (!optionalCallback && typeof options === 'function') {
optionalCallback = options;
options = null;
}
if (!optionalCallback) {
return new Promise((resolve, reject) => {
self._deleteMethod(resourceGroupName, serviceName, productId, apiId, options, (err, result, request, response) => {
if (err) { reject(err); }
else { resolve(result); }
return;
});
});
} else {
return self._deleteMethod(resourceGroupName, serviceName, productId, apiId, options, optionalCallback);
}
}
/**
* Lists a collection of the APIs associated with a product.
*
* @param {string} nextPageLink The NextLink from the previous successful call
* to List operation.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @returns {Promise} A promise is returned
*
* @resolve {HttpOperationResponse<ApiCollection>} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
listByProductNextWithHttpOperationResponse(nextPageLink, options) {
let client = this.client;
let self = this;
return new Promise((resolve, reject) => {
self._listByProductNext(nextPageLink, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
return;
});
});
}
/**
* Lists a collection of the APIs associated with a product.
*
* @param {string} nextPageLink The NextLink from the previous successful call
* to List operation.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} [optionalCallback] - The optional callback.
*
* @returns {function|Promise} If a callback was passed as the last parameter
* then it returns the callback else returns a Promise.
*
* {Promise} A promise is returned
*
* @resolve {ApiCollection} - The deserialized result object.
*
* @reject {Error} - The error object.
*
* {function} optionalCallback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link ApiCollection} for more information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
listByProductNext(nextPageLink, options, optionalCallback) {
let client = this.client;
let self = this;
if (!optionalCallback && typeof options === 'function') {
optionalCallback = options;
options = null;
}
if (!optionalCallback) {
return new Promise((resolve, reject) => {
self._listByProductNext(nextPageLink, options, (err, result, request, response) => {
if (err) { reject(err); }
else { resolve(result); }
return;
});
});
} else {
return self._listByProductNext(nextPageLink, options, optionalCallback);
}
}
}
module.exports = ProductApi;
| {
"content_hash": "c2112fcce266fb4d5395de03704ac197",
"timestamp": "",
"source": "github",
"line_count": 1198,
"max_line_length": 224,
"avg_line_length": 40.84974958263773,
"alnum_prop": 0.6321876660264008,
"repo_name": "AutorestCI/azure-sdk-for-node",
"id": "827449eb00c18e84769b352ec3c17c60da86ef46",
"size": "49255",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/services/apimanagement/lib/operations/productApi.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "661"
},
{
"name": "JavaScript",
"bytes": "75414812"
},
{
"name": "Shell",
"bytes": "437"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<head>
<title>JiraAlerts</title>
</head>
<body>
<wicket:panel>
<p><wicket:message key="card.body.status.text" />
<span class="badge badge-danger"><wicket:message key="card.body.status.badge" /></span>
</p>
<p>
<wicket:message key="jira.instance.text" />
</p>
<div wicket:id="globalFeedback"></div>
<form wicket:id="setupForm">
<div wicket:id="urlInputPanel"></div>
<div wicket:id="usernameInputPanel"></div>
<div wicket:id="passwordInputPanel"></div>
<button class="btn btn-outline-primary" wicket:id="submitButton">
<wicket:message key="setup.submitbutton.text"/>
</button>
</form>
</wicket:panel>
</body>
</html> | {
"content_hash": "789ddcfd510125cc105b6ac4e8445aa7",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 95,
"avg_line_length": 26.84375,
"alnum_prop": 0.6158323632130385,
"repo_name": "pDiller/JiraAlerts",
"id": "b4d7159a87b8c56984a4383f25d5e2add3cfe589",
"size": "859",
"binary": false,
"copies": "1",
"ref": "refs/heads/development",
"path": "src/main/resources/io/reflectoring/jiraalerts/dashboard/applicationstate/SetupApplicationPanel.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "708"
},
{
"name": "HTML",
"bytes": "17775"
},
{
"name": "Java",
"bytes": "250224"
},
{
"name": "JavaScript",
"bytes": "103"
}
],
"symlink_target": ""
} |
'use strict';
module.exports = function(ss, emitter) {
var mid,
active,
config = {};
return {
get http() {
return active? active.http: null;
},
get ws() {
return active? active.ws: null;
},
use: function(nameOrModule, cfg) {
mid = nameOrModule;
config = cfg || config;
// log warning
// if (ss.require.resolve(nameOrModule, 'websocket/transports') == null) {
// throw new Error('Unable to find the \'' + nameOrModule + '\' websocket transport internally');
// }
},
load: function() {
//TODO error handle missing require from within the sockjs/engineio module
var transport = ss.require(mid, 'websocket/transports', 'engineio');
if (typeof transport !== 'function') {
ss.log.error('Transport for "'+mid+'" must be a function(ss, emitter, config) default:', transport);
} else {
return (active = transport(ss, emitter, config));
}
}
};
};
| {
"content_hash": "cfda07dd090121a70b0618e83dce0408",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 108,
"avg_line_length": 29,
"alnum_prop": 0.5811359026369168,
"repo_name": "socketstream/socketstream",
"id": "462ceea90a96644dfcb1546d8f4e6b4efa30567d",
"size": "1156",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "lib/websocket/transport.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "10350"
},
{
"name": "CoffeeScript",
"bytes": "2671"
},
{
"name": "HTML",
"bytes": "1875"
},
{
"name": "JavaScript",
"bytes": "382409"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<!--
Copyright (c) 2014 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.
-->
<link rel="import" href="/tracing/base/base.html">
<link rel="import" href="/tracing/base/unittest.html">
<link rel="import" href="/tracing/base/unittest/suite_loader.html">
<link rel="import" href="/tracing/base/unittest/test_runner.html">
<link rel="import" href="/tracing/base/unittest/html_test_results.html">
<link rel="import" href="/tracing/ui/base/utils.html">
<style>
x-base-interactive-test-runner {
display: -webkit-flex;
-webkit-flex-direction: column;
}
x-base-interactive-test-runner > * {
-webkit-flex: 0 0 auto;
}
x-base-interactive-test-runner > #title {
font-size: 16pt;
}
x-base-interactive-test-runner {
font-family: sans-serif;
}
x-base-interactive-test-runner > h1 {
margin: 5px 0px 10px 0px;
}
x-base-interactive-test-runner > #stats {
}
x-base-interactive-test-runner > #controls {
display: block;
margin-bottom: 5px;
}
x-base-interactive-test-runner > #controls > ul {
list-style-type: none;
padding: 0;
margin: 0;
}
x-base-interactive-test-runner > #controls > ul > li {
float: left;
margin-right: 10px;
padding-top: 5px;
padding-bottom: 5px;
}
x-base-interactive-test-runner > #shortform-results {
color: green;
height; 40px;
word-wrap: break-word;
}
x-base-interactive-test-runner > #shortform-results > .fail {
color: darkred;
font-weight: bold;
}
x-base-interactive-test-runner > #results-container {
-webkit-flex: 1 1 auto;
min-height: 0;
overflow: auto;
padding: 0 4px 0 4px;
}
.unittest-pending {
color: orange;
}
.unittest-running {
color: orange;
font-weight: bold;
}
.unittest-passed {
color: darkgreen;
}
.unittest-failed {
color: darkred;
font-weight: bold;
}
.unittest-exception {
color: red;
font-weight: bold;
}
.unittest-failure {
border: 1px solid grey;
border-radius: 5px;
padding: 5px;
}
</style>
<template id="x-base-interactive-test-runner-template">
<h1 id="title">Tests</h1>
<div id="stats"></div>
<div id="controls">
<ul id="links">
</ul>
<div style="clear: both;"></div>
<div>
<span>
<input type="radio" name="test-type-to-run" value="unit" />
Run unit tests
</span>
<span>
<input type="radio" name="test-type-to-run" value="perf" />
Run perf tests
</span>
<span>
<input type="radio" name="test-type-to-run" value="all" />
Run all tests
</span>
</div>
<span>
<input type="checkbox" id="short-format" /> Short format
</span>
</div>
<div id="shortform-results">
</div>
<div id="results-container">
</div>
</template>
<script>
'use strict';
tr.exportTo('tr.b.unittest', function() {
var THIS_DOC = document.currentScript.ownerDocument;
var ALL_TEST_TYPES = 'all';
/**
* @constructor
*/
var InteractiveTestRunner = tr.ui.b.define('x-base-interactive-test-runner');
InteractiveTestRunner.prototype = {
__proto__: HTMLUnknownElement.prototype,
decorate: function() {
this.allTests_ = undefined;
this.suppressStateChange_ = false;
this.testFilterString_ = '';
this.testTypeToRun_ = tr.b.unittest.TestTypes.UNITTEST;
this.shortFormat_ = false;
this.testSuiteName_ = '';
this.rerunPending_ = false;
this.runner_ = undefined;
this.results_ = undefined;
this.headless_ = false;
this.onResultsStatsChanged_ = this.onResultsStatsChanged_.bind(this);
this.onTestFailed_ = this.onTestFailed_.bind(this);
this.onTestPassed_ = this.onTestPassed_.bind(this);
this.appendChild(tr.ui.b.instantiateTemplate(
'#x-base-interactive-test-runner-template', THIS_DOC));
this.querySelector(
'input[name=test-type-to-run][value=unit]').checked = true;
var testTypeToRunEls = tr.b.asArray(this.querySelectorAll(
'input[name=test-type-to-run]'));
testTypeToRunEls.forEach(
function(inputEl) {
inputEl.addEventListener(
'click', this.onTestTypeToRunClick_.bind(this));
}, this);
var shortFormatEl = this.querySelector('#short-format');
shortFormatEl.checked = this.shortFormat_;
shortFormatEl.addEventListener(
'click', this.onShortFormatClick_.bind(this));
this.updateShortFormResultsDisplay_();
// Oh, DOM, how I love you. Title is such a convenient property name and I
// refuse to change my worldview because of tooltips.
this.__defineSetter__(
'title',
function(title) {
this.querySelector('#title').textContent = title;
});
},
get allTests() {
return this.allTests_;
},
set allTests(allTests) {
this.allTests_ = allTests;
this.scheduleRerun_();
},
get testLinks() {
return this.testLinks_;
},
set testLinks(testLinks) {
this.testLinks_ = testLinks;
var linksEl = this.querySelector('#links');
linksEl.textContent = '';
this.testLinks_.forEach(function(l) {
var link = document.createElement('a');
link.href = l.linkPath;
link.textContent = l.title;
var li = document.createElement('li');
li.appendChild(link);
linksEl.appendChild(li);
}, this);
},
get testFilterString() {
return this.testFilterString_;
},
set testFilterString(testFilterString) {
this.testFilterString_ = testFilterString;
this.scheduleRerun_();
if (!this.suppressStateChange_)
tr.b.dispatchSimpleEvent(this, 'statechange');
},
get shortFormat() {
return this.shortFormat_;
},
set shortFormat(shortFormat) {
this.shortFormat_ = shortFormat;
this.querySelector('#short-format').checked = shortFormat;
if (this.results_)
this.results_.shortFormat = shortFormat;
if (!this.suppressStateChange_)
tr.b.dispatchSimpleEvent(this, 'statechange');
},
onShortFormatClick_: function(e) {
this.shortFormat_ = this.querySelector('#short-format').checked;
this.updateShortFormResultsDisplay_();
this.updateResultsGivenShortFormat_();
if (!this.suppressStateChange_)
tr.b.dispatchSimpleEvent(this, 'statechange');
},
updateShortFormResultsDisplay_: function() {
var display = this.shortFormat_ ? '' : 'none';
this.querySelector('#shortform-results').style.display = display;
},
updateResultsGivenShortFormat_: function() {
if (!this.results_)
return;
if (this.testFilterString_.length || this.testSuiteName_.length)
this.results_.showHTMLOutput = true;
else
this.results_.showHTMLOutput = false;
this.results_.showPendingAndPassedTests = this.shortFormat_;
},
get testTypeToRun() {
return this.testTypeToRun_;
},
set testTypeToRun(testTypeToRun) {
this.testTypeToRun_ = testTypeToRun;
var sel;
switch (testTypeToRun) {
case tr.b.unittest.TestTypes.UNITTEST:
sel = 'input[name=test-type-to-run][value=unit]';
break;
case tr.b.unittest.TestTypes.PERFTEST:
sel = 'input[name=test-type-to-run][value=perf]';
break;
case ALL_TEST_TYPES:
sel = 'input[name=test-type-to-run][value=all]';
break;
default:
throw new Error('Invalid test type to run: ' + testTypeToRun);
}
this.querySelector(sel).checked = true;
this.scheduleRerun_();
if (!this.suppressStateChange_)
tr.b.dispatchSimpleEvent(this, 'statechange');
},
onTestTypeToRunClick_: function(e) {
switch (e.target.value) {
case 'unit':
this.testTypeToRun_ = tr.b.unittest.TestTypes.UNITTEST;
break;
case 'perf':
this.testTypeToRun_ = tr.b.unittest.TestTypes.PERFTEST;
break;
case 'all':
this.testTypeToRun_ = ALL_TEST_TYPES;
break;
default:
throw new Error('Inalid test type: ' + e.target.value);
}
this.scheduleRerun_();
if (!this.suppressStateChange_)
tr.b.dispatchSimpleEvent(this, 'statechange');
},
onTestPassed_: function() {
this.querySelector('#shortform-results').
appendChild(document.createTextNode('.'));
},
onTestFailed_: function() {
var span = document.createElement('span');
span.classList.add('fail');
span.appendChild(document.createTextNode('F'));
this.querySelector('#shortform-results').appendChild(span);
},
onResultsStatsChanged_: function() {
var statsEl = this.querySelector('#stats');
var stats = this.results_.getStats();
var numTestsOverall = this.runner_.testCases.length;
var numTestsThatRan = stats.numTestsThatPassed + stats.numTestsThatFailed;
statsEl.innerHTML =
'<span>' + numTestsThatRan + '/' + numTestsOverall +
'</span> tests run, ' +
'<span class="unittest-failed">' + stats.numTestsThatFailed +
'</span> failures, ' +
' in ' + stats.totalRunTime.toFixed(2) + 'ms.';
},
scheduleRerun_: function() {
if (this.rerunPending_)
return;
if (this.runner_) {
this.rerunPending_ = true;
this.runner_.beginToStopRunning();
var doRerun = function() {
this.rerunPending_ = false;
this.scheduleRerun_();
}.bind(this);
this.runner_.runCompletedPromise.then(
doRerun, doRerun);
return;
}
this.beginRunning_();
},
beginRunning_: function() {
var resultsContainer = this.querySelector('#results-container');
if (this.results_) {
this.results_.removeEventListener('testpassed',
this.onTestPassed_);
this.results_.removeEventListener('testfailed',
this.onTestFailed_);
this.results_.removeEventListener('statschange',
this.onResultsStatsChanged_);
delete this.results_.getHRefForTestCase;
resultsContainer.removeChild(this.results_);
}
this.results_ = new tr.b.unittest.HTMLTestResults();
this.results_.headless = this.headless_;
this.results_.getHRefForTestCase = this.getHRefForTestCase.bind(this);
this.updateResultsGivenShortFormat_();
this.results_.shortFormat = this.shortFormat_;
this.results_.addEventListener('testpassed',
this.onTestPassed_);
this.results_.addEventListener('testfailed',
this.onTestFailed_);
this.results_.addEventListener('statschange',
this.onResultsStatsChanged_);
resultsContainer.appendChild(this.results_);
var tests = this.allTests_.filter(function(test) {
var i = test.fullyQualifiedName.indexOf(this.testFilterString_);
if (i == -1)
return false;
if (this.testTypeToRun_ !== ALL_TEST_TYPES &&
test.testType !== this.testTypeToRun_)
return false;
return true;
}, this);
this.runner_ = new tr.b.unittest.TestRunner(this.results_, tests);
this.runner_.beginRunning();
this.runner_.runCompletedPromise.then(
this.runCompleted_.bind(this),
this.runCompleted_.bind(this));
},
setState: function(state, opt_suppressStateChange) {
this.suppressStateChange_ = true;
if (state.testFilterString !== undefined)
this.testFilterString = state.testFilterString;
else
this.testFilterString = '';
if (state.shortFormat === undefined)
this.shortFormat = false;
else
this.shortFormat = state.shortFormat;
if (state.testTypeToRun === undefined)
this.testTypeToRun = tr.b.unittest.TestTypes.UNITTEST;
else
this.testTypeToRun = state.testTypeToRun;
this.testSuiteName_ = state.testSuiteName || '';
this.headless_ = state.headless || false;
if (!opt_suppressStateChange)
this.suppressStateChange_ = false;
this.onShortFormatClick_();
this.scheduleRerun_();
this.suppressStateChange_ = false;
},
getDefaultState: function() {
return {
testFilterString: '',
testSuiteName: '',
shortFormat: false,
testTypeToRun: tr.b.unittest.TestTypes.UNITTEST
};
},
getState: function() {
return {
testFilterString: this.testFilterString_,
testSuiteName: this.testSuiteName_,
shortFormat: this.shortFormat_,
testTypeToRun: this.testTypeToRun_
};
},
getHRefForTestCase: function(testCases) {
return undefined;
},
runCompleted_: function() {
this.runner_ = undefined;
}
};
function loadAndRunTests(runnerConfig) {
// The test runner no-ops pushState so keep it around.
var realWindowHistoryPushState = window.history.pushState.bind(
window.history);
function stateToSearchString(defaultState, state) {
var parts = [];
for (var k in state) {
if (state[k] === defaultState[k])
continue;
var v = state[k];
var kv;
if (v === true) {
kv = k;
} else if (v === false) {
kv = k + '=false';
} else if (v === '') {
continue;
} else {
kv = k + '=' + v;
}
parts.push(kv);
}
return parts.join('&');
}
function stateFromSearchString(string) {
var state = {};
string.split('&').forEach(function(part) {
if (part == '')
return;
var kv = part.split('=');
var k, v;
if (kv.length == 1) {
k = kv[0];
v = true;
} else {
k = kv[0];
if (kv[1] == 'false')
v = false;
else
v = kv[1];
}
state[k] = v;
});
return state;
}
function getSuiteRelpathsToLoad(state) {
if (state.testSuiteName) {
return new Promise(function(resolve) {
var parts = state.testSuiteName.split('.');
var testSuiteRelPath = '/' + parts.join('/') + '.html';
var suiteRelpathsToLoad = [testSuiteRelPath];
resolve(suiteRelpathsToLoad);
});
}
return runnerConfig.getAllSuiteRelPathsAsync();
}
function loadAndRunTestsImpl() {
var state = stateFromSearchString(
window.location.search.substring(1));
updateTitle(state);
showLoadingOverlay();
var loader;
var p = getSuiteRelpathsToLoad(state);
p = p.then(
function(suiteRelpathsToLoad) {
loader = new tr.b.unittest.SuiteLoader(suiteRelpathsToLoad);
return loader.allSuitesLoadedPromise;
},
function(e) {
hideLoadingOverlay();
throw e;
});
p = p.then(
function() {
hideLoadingOverlay();
Polymer.whenReady(function() {
runTests(loader, state);
});
},
function(err) {
hideLoadingOverlay();
tr.showPanic('Module loading failure', err);
throw err;
});
return p;
}
function showLoadingOverlay() {
var overlay = document.createElement('div');
overlay.id = 'tests-loading-overlay';
overlay.style.backgroundColor = 'white';
overlay.style.boxSizing = 'border-box';
overlay.style.color = 'black';
overlay.style.display = '-webkit-flex';
overlay.style.height = '100%';
overlay.style.left = 0;
overlay.style.padding = '8px';
overlay.style.position = 'fixed';
overlay.style.top = 0;
overlay.style.webkitFlexDirection = 'column';
overlay.style.width = '100%';
var element = document.createElement('div');
element.style.webkitFlex = '1 1 auto';
element.style.overflow = 'auto';
overlay.appendChild(element);
element.textContent = 'Loading tests...';
document.body.appendChild(overlay);
}
function hideLoadingOverlay() {
var overlay = document.body.querySelector('#tests-loading-overlay');
document.body.removeChild(overlay);
}
function updateTitle(state) {
var testFilterString = state.testFilterString || '';
var testSuiteName = state.testSuiteName || '';
var title;
if (testSuiteName && testFilterString.length) {
title = testFilterString + ' in ' + testSuiteName;
} else if (testSuiteName) {
title = testSuiteName;
} else if (testFilterString) {
title = testFilterString + ' in all tests';
} else {
title = runnerConfig.title;
}
if (state.shortFormat)
title += '(s)';
document.title = title;
var runner = document.querySelector('x-base-interactive-test-runner');
if (runner)
runner.title = title;
}
function runTests(loader, state) {
var runner = new tr.b.unittest.InteractiveTestRunner();
runner.style.width = '100%';
runner.style.height = '100%';
runner.testLinks = runnerConfig.testLinks;
runner.allTests = loader.getAllTests();
document.body.appendChild(runner);
runner.setState(state);
updateTitle(state);
runner.addEventListener('statechange', function() {
var state = runner.getState();
var stateString = stateToSearchString(runner.getDefaultState(),
state);
if (window.location.search.substring(1) == stateString)
return;
updateTitle(state);
var stateURL;
if (stateString.length > 0)
stateURL = window.location.pathname + '?' + stateString;
else
stateURL = window.location.pathname;
realWindowHistoryPushState(state, document.title, stateURL);
});
window.addEventListener('popstate', function(state) {
runner.setState(state, true);
});
runner.getHRefForTestCase = function(testCase) {
var state = runner.getState();
if (state.testFilterString === '' &&
state.testSuiteName === '') {
state.testSuiteName = testCase.suite.name;
state.testFilterString = '';
state.shortFormat = false;
} else {
state.testSuiteName = testCase.suite.name;
state.testFilterString = testCase.name;
state.shortFormat = false;
}
var stateString = stateToSearchString(runner.getDefaultState(),
state);
if (stateString.length > 0)
return window.location.pathname + '?' + stateString;
else
return window.location.pathname;
}
}
loadAndRunTestsImpl();
}
return {
InteractiveTestRunner: InteractiveTestRunner,
loadAndRunTests: loadAndRunTests
};
});
</script>
| {
"content_hash": "dc8c8cc56a6e69777852b4502fb32584",
"timestamp": "",
"source": "github",
"line_count": 671,
"max_line_length": 80,
"avg_line_length": 28.849478390461996,
"alnum_prop": 0.5945345593553053,
"repo_name": "modulexcite/catapult",
"id": "a1e38282dec79f2aecbb375ad9c670b3d42e56e7",
"size": "19358",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "tracing/tracing/base/unittest/interactive_test_runner.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "19263"
},
{
"name": "HTML",
"bytes": "23156852"
},
{
"name": "JavaScript",
"bytes": "35437"
},
{
"name": "Python",
"bytes": "1231653"
}
],
"symlink_target": ""
} |
package loggers
import (
"testing"
"github.com/hyperledger/burrow/logging/structure"
"github.com/stretchr/testify/assert"
)
func TestVectorValuedLogger(t *testing.T) {
logger := newTestLogger()
vvl := VectorValuedLogger(logger)
vvl.Log("foo", "bar", "seen", 1, "seen", 3, "seen", 2)
lls, err := logger.logLines(1)
assert.NoError(t, err)
assert.Equal(t, []interface{}{"foo", "bar", "seen", structure.Vector{1, 3, 2}},
lls[0])
}
| {
"content_hash": "b4184f76a10c7850836c8348ee3c5f29",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 80,
"avg_line_length": 24.5,
"alnum_prop": 0.6757369614512472,
"repo_name": "eris-ltd/eris-db",
"id": "22221a2c4d3b32699acd019f89a34c9b7ff60b9f",
"size": "519",
"binary": false,
"copies": "1",
"ref": "refs/heads/dependabot/npm_and_yarn/vent/test/eth/object-path-0.11.8",
"path": "logging/loggers/vector_valued_logger_test.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "927037"
},
{
"name": "Makefile",
"bytes": "5091"
},
{
"name": "Shell",
"bytes": "16115"
}
],
"symlink_target": ""
} |
module Brevity
class FileNode < Treetop::Runtime::SyntaxNode
def command_nodes
nodes.elements.select {|el| el.node.is_a? CommandNode }.map {|el| el.node }
end
end
end
| {
"content_hash": "cd8d7a5515adc750ea5e1fb21a0aa58d",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 81,
"avg_line_length": 26.428571428571427,
"alnum_prop": 0.6810810810810811,
"repo_name": "jamestunnell/brevity",
"id": "040158cb3a2655911dabcea320ce3127a3d96709",
"size": "185",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/brevity/parsing/file/file_node.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "114142"
},
{
"name": "TeX",
"bytes": "13439"
}
],
"symlink_target": ""
} |
namespace cr_fuchsia {
class AgentManager;
}
FORWARD_DECLARE_TEST(HeadlessCastRunnerIntegrationTest, Headless);
// A specialization of WebComponent which adds Cast-specific services.
class CastComponent final : public WebComponent,
public base::MessagePumpFuchsia::ZxHandleWatcher {
public:
struct Params {
Params();
Params(Params&&);
~Params();
// Returns true if all parameters required for component launch have
// been initialized.
bool AreComplete() const;
// Parameters populated directly from the StartComponent() arguments.
std::unique_ptr<base::StartupContext> startup_context;
fidl::InterfaceRequest<fuchsia::sys::ComponentController>
controller_request;
// Parameters initialized synchronously.
std::unique_ptr<cr_fuchsia::AgentManager> agent_manager;
chromium::cast::UrlRequestRewriteRulesProviderPtr
url_rewrite_rules_provider;
// Parameters asynchronously initialized by PendingCastComponent.
std::unique_ptr<ApiBindingsClient> api_bindings_client;
chromium::cast::ApplicationConfig application_config;
fidl::InterfaceHandle<chromium::cast::ApplicationContext>
application_context;
absl::optional<std::vector<fuchsia::web::UrlRequestRewriteRule>>
initial_url_rewrite_rules;
absl::optional<uint64_t> media_session_id;
};
// See WebComponent documentation for details of |debug_name| and |runner|.
// |params| provides the Cast application configuration to use.
// |is_headless| must match the headless setting of the specfied |runner|, to
// have CreateView() operations trigger enabling & disabling of off-screen
// rendering.
CastComponent(base::StringPiece debug_name,
WebContentRunner* runner,
Params params,
bool is_headless);
CastComponent(const CastComponent&) = delete;
CastComponent& operator=(const CastComponent&) = delete;
~CastComponent() override;
void SetOnDestroyedCallback(base::OnceClosure on_destroyed);
void ConnectMetricsRecorder(
fidl::InterfaceRequest<fuchsia::legacymetrics::MetricsRecorder> request);
void ConnectAudio(fidl::InterfaceRequest<fuchsia::media::Audio> request);
void ConnectDeviceWatcher(
fidl::InterfaceRequest<fuchsia::camera3::DeviceWatcher> request);
bool HasWebPermission(fuchsia::web::PermissionType permission_type) const;
const std::string& agent_url() const {
return application_config_.agent_url();
}
// WebComponent overrides.
void StartComponent() override;
void DestroyComponent(int64_t termination_exit_code,
fuchsia::sys::TerminationReason reason) override;
private:
void OnRewriteRulesReceived(
std::vector<fuchsia::web::UrlRequestRewriteRule> url_rewrite_rules);
// fuchsia::web::NavigationEventListener implementation.
// Triggers the injection of API channels into the page content.
void OnNavigationStateChanged(
fuchsia::web::NavigationState change,
OnNavigationStateChangedCallback callback) override;
// fuchsia::ui::app::ViewProvider implementation.
void CreateView(
zx::eventpair view_token,
fidl::InterfaceRequest<fuchsia::sys::ServiceProvider> incoming_services,
fidl::InterfaceHandle<fuchsia::sys::ServiceProvider> outgoing_services)
override;
void CreateViewWithViewRef(zx::eventpair view_token,
fuchsia::ui::views::ViewRefControl control_ref,
fuchsia::ui::views::ViewRef view_ref) override;
void CreateView2(fuchsia::ui::app::CreateView2Args view_args) override;
// base::MessagePumpFuchsia::ZxHandleWatcher implementation.
// Called when the headless "view" token is disconnected.
void OnZxHandleSignalled(zx_handle_t handle, zx_signals_t signals) override;
const bool is_headless_;
base::OnceClosure on_destroyed_;
std::unique_ptr<cr_fuchsia::AgentManager> agent_manager_;
chromium::cast::ApplicationConfig application_config_;
chromium::cast::UrlRequestRewriteRulesProviderPtr url_rewrite_rules_provider_;
std::vector<fuchsia::web::UrlRequestRewriteRule> initial_url_rewrite_rules_;
bool constructor_active_ = false;
std::unique_ptr<NamedMessagePortConnectorFuchsia> connector_;
std::unique_ptr<ApiBindingsClient> api_bindings_client_;
std::unique_ptr<ApplicationControllerImpl> application_controller_;
chromium::cast::ApplicationContextPtr application_context_;
uint64_t media_session_id_ = 0;
zx::eventpair headless_view_token_;
base::MessagePumpForIO::ZxHandleWatchController headless_disconnect_watch_;
};
#endif // FUCHSIA_RUNNERS_CAST_CAST_COMPONENT_H_
| {
"content_hash": "c6f6f577c7e2ae3d86cd26330445d849",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 80,
"avg_line_length": 40.042735042735046,
"alnum_prop": 0.7346851654215582,
"repo_name": "scheib/chromium",
"id": "d1ed3b0ec4e1d9f621334420748404f719b11e9c",
"size": "5747",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "fuchsia/runners/cast/cast_component.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
<?php
namespace Dami\Cli;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Yaml\Yaml;
use Dami\DependencyInjection\DamiExtension;
use Rentgen\DependencyInjection\RentgenExtension;
use Rentgen\DependencyInjection\Compiler\ListenerPass;
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
class Dami
{
private $container;
public function __construct()
{
$container = new ContainerBuilder();
$extensions = array(
new RentgenExtension(),
new DamiExtension(),
);
foreach ($extensions as $extension) {
$container->registerExtension($extension);
$container->loadFromExtension($extension->getAlias());
}
$container->addCompilerPass(new RegisterListenersPass());
$container->compile();
$this->container = $container;
}
public function get($service)
{
return $this->container->get($service);
}
public function getContainer()
{
return $this->container;
}
}
| {
"content_hash": "fd827099c19e480d56264e2199811af4",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 80,
"avg_line_length": 26.42222222222222,
"alnum_prop": 0.6854499579478553,
"repo_name": "czogori/Dami",
"id": "e1cf9791766a83b481f77dfcd78b8c2faf398408",
"size": "1189",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Dami/Cli/Dami.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Gherkin",
"bytes": "774"
},
{
"name": "PHP",
"bytes": "60565"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (c) 2010-2012 International Business Machines Corporation and others. All rights reserved.
-->
<!DOCTYPE ldml SYSTEM "http://www.unicode.org/repos/cldr/trunk/common/dtd/ldml.dtd"
[
<!ENTITY % icu SYSTEM "http://www.unicode.org/repos/cldr/trunk/common/dtd/ldmlICU.dtd">
%icu;
]
>
<ldml>
<identity>
<version number="$Revision: 1.30 $"/>
<generation date="$Date: 2008/05/25 01:05:56 $"/>
<language type="root"/>
</identity>
<characters>
<special xmlns:icu="http://www.icu-project.org/">
<icu:scripts>
<icu:script type="1">Zyyy</icu:script>
</icu:scripts>
</special>
</characters>
<dates>
<timeZoneNames>
<zone type="">
<long>
<standard/>
<daylight/>
</long>
<short>
<standard/>
<daylight/>
</short>
<exemplarCity/>
</zone>
</timeZoneNames>
</dates>
</ldml>
| {
"content_hash": "a810d9f4ec72b614b38f75eb83bc355e",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 101,
"avg_line_length": 25.45,
"alnum_prop": 0.5451866404715128,
"repo_name": "indashnet/InDashNet.Open.UN2000",
"id": "162281fe4c1b851f03fda31abea836607f2ed144",
"size": "1018",
"binary": false,
"copies": "11",
"ref": "refs/heads/master",
"path": "android/external/icu4c/data/xml/main/root.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package org.wso2.charon.core.exceptions;
import org.wso2.charon.core.protocol.ResponseCodeConstants;
/**
* If the requested resource is not found, this exception is thrown.
* HTTP error code is: 404 NOT FOUND
*/
public class NotFoundException extends AbstractCharonException {
public NotFoundException() {
code = ResponseCodeConstants.CODE_RESOURCE_NOT_FOUND;
description = ResponseCodeConstants.DESC_RESOURCE_NOT_FOUND;
}
}
| {
"content_hash": "1a04d1581f0539b3150f6dfed0de79ba",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 68,
"avg_line_length": 26.88235294117647,
"alnum_prop": 0.75054704595186,
"repo_name": "maheshika/charon",
"id": "3f6559dd9300d21d20816c1f7ddda55fc74706af",
"size": "1124",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/charon-core/src/main/java/org/wso2/charon/core/exceptions/NotFoundException.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "149"
},
{
"name": "Java",
"bytes": "769217"
}
],
"symlink_target": ""
} |
#ifndef _WX_GTK_BMPCBOX_H_
#define _WX_GTK_BMPCBOX_H_
#include "wx/combobox.h"
// ----------------------------------------------------------------------------
// wxBitmapComboBox: a wxComboBox that allows images to be shown
// in front of string items.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxBitmapComboBox : public wxComboBox,
public wxBitmapComboBoxBase
{
public:
// ctors and such
wxBitmapComboBox() : wxComboBox(), wxBitmapComboBoxBase()
{
Init();
}
wxBitmapComboBox(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0,
const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr)
: wxComboBox(),
wxBitmapComboBoxBase()
{
Init();
(void)Create(parent, id, value, pos, size, n,
choices, style, validator, name);
}
wxBitmapComboBox(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
int n,
const wxString choices[],
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr);
virtual ~wxBitmapComboBox();
// Sets the image for the given item.
virtual void SetItemBitmap(unsigned int n, const wxBitmap& bitmap);
// Returns the image of the item with the given index.
virtual wxBitmap GetItemBitmap(unsigned int n) const;
// Returns size of the image used in list
virtual wxSize GetBitmapSize() const
{
return m_bitmapSize;
}
// Adds item with image to the end of the combo box.
int Append(const wxString& item, const wxBitmap& bitmap = wxNullBitmap);
int Append(const wxString& item, const wxBitmap& bitmap, void *clientData);
int Append(const wxString& item, const wxBitmap& bitmap, wxClientData *clientData);
// Inserts item with image into the list before pos. Not valid for wxCB_SORT
// styles, use Append instead.
int Insert(const wxString& item, const wxBitmap& bitmap, unsigned int pos);
int Insert(const wxString& item, const wxBitmap& bitmap,
unsigned int pos, void *clientData);
int Insert(const wxString& item, const wxBitmap& bitmap,
unsigned int pos, wxClientData *clientData);
// Override some wxTextEntry interface.
virtual void WriteText(const wxString& value);
virtual wxString GetValue() const;
virtual void Remove(long from, long to);
virtual void SetInsertionPoint(long pos);
virtual long GetInsertionPoint() const;
virtual long GetLastPosition() const;
virtual void SetSelection(long from, long to);
virtual void GetSelection(long *from, long *to) const;
virtual void SetSelection(int n) { wxComboBox::SetSelection(n); }
virtual int GetSelection() const { return wxComboBox::GetSelection(); }
virtual bool IsEditable() const;
virtual void SetEditable(bool editable);
virtual GtkWidget* GetConnectWidget();
protected:
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
virtual void GTKCreateComboBoxWidget();
virtual void GTKInsertComboBoxTextItem( unsigned int n, const wxString& text );
virtual wxSize DoGetBestSize() const;
wxSize m_bitmapSize;
int m_bitmapCellIndex;
private:
void Init();
DECLARE_DYNAMIC_CLASS(wxBitmapComboBox)
};
#endif // _WX_GTK_BMPCBOX_H_
| {
"content_hash": "8b77e118a379a80ab05d317a06ea8dc0",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 87,
"avg_line_length": 35.8768115942029,
"alnum_prop": 0.5703898202383357,
"repo_name": "geovens/TransWinove",
"id": "71d9aa99b76bcd993fe4f640404a1d73ab386d61",
"size": "5309",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "include/wx/gtk/bmpcbox.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "417356"
},
{
"name": "C++",
"bytes": "9214450"
},
{
"name": "Objective-C",
"bytes": "620646"
}
],
"symlink_target": ""
} |
<?php
namespace HWI\Bundle\OAuthBundle\Twig\Extension;
use HWI\Bundle\OAuthBundle\Templating\Helper\OAuthHelper;
/**
* OAuthExtension.
*
* @author Joseph Bielawski <stloyd@gmail.com>
*/
class OAuthExtension extends \Twig_Extension
{
/**
* @var OAuthHelper
*/
protected $helper;
/**
* @param OAuthHelper $helper
*/
public function __construct(OAuthHelper $helper)
{
$this->helper = $helper;
}
/**
* @return array
*/
public function getFunctions()
{
return array(
new \Twig_SimpleFunction('hwi_oauth_authorization_url', array($this, 'getAuthorizationUrl')),
new \Twig_SimpleFunction('hwi_oauth_login_url', array($this, 'getLoginUrl')),
new \Twig_SimpleFunction('hwi_oauth_resource_owners', array($this, 'getResourceOwners')),
);
}
/**
* @return array
*/
public function getResourceOwners()
{
return $this->helper->getResourceOwners();
}
/**
* @param string $name
*
* @return string
*/
public function getLoginUrl($name)
{
return $this->helper->getLoginUrl($name);
}
/**
* @param string $name
* @param string $redirectUrl Optional
* @param array $extraParameters Optional
*
* @return string
*/
public function getAuthorizationUrl($name, $redirectUrl = null, array $extraParameters = array())
{
return $this->helper->getAuthorizationUrl($name, $redirectUrl, $extraParameters);
}
/**
* Returns the name of the extension.
*
* @return string The extension name
*/
public function getName()
{
return 'hwi_oauth';
}
}
| {
"content_hash": "ae539ac3855d6f3ac7ae9932af25ebea",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 105,
"avg_line_length": 21.6875,
"alnum_prop": 0.5890489913544669,
"repo_name": "dmatora/HWIOAuthBundle",
"id": "58357cbaf0fe421afb54b1751fbaf2db6edc97de",
"size": "1974",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Twig/Extension/OAuthExtension.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "3367"
},
{
"name": "Makefile",
"bytes": "104"
},
{
"name": "PHP",
"bytes": "534673"
}
],
"symlink_target": ""
} |
var NAVTREE =
[
[ "Flurry Android 5.5.0", "index.html", [
[ "Deprecated List", "deprecated.html", null ],
[ "Classes", null, [
[ "Class List", "annotated.html", "annotated" ],
[ "Class Members", "functions.html", [
[ "All", "functions.html", null ],
[ "Functions", "functions_func.html", null ],
[ "Variables", "functions_vars.html", null ]
] ]
] ]
] ]
];
var NAVTREEINDEX =
[
".html"
];
var SYNCONMSG = 'click to disable panel synchronisation';
var SYNCOFFMSG = 'click to enable panel synchronisation';
var SYNCONMSG = 'click to disable panel synchronisation';
var SYNCOFFMSG = 'click to enable panel synchronisation';
var navTreeSubIndices = new Array();
function getData(varName)
{
var i = varName.lastIndexOf('/');
var n = i>=0 ? varName.substring(i+1) : varName;
return eval(n.replace(/\-/g,'_'));
}
function stripPath(uri)
{
return uri.substring(uri.lastIndexOf('/')+1);
}
function stripPath2(uri)
{
var i = uri.lastIndexOf('/');
var s = uri.substring(i+1);
var m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/);
return m ? uri.substring(i-6) : s;
}
function localStorageSupported()
{
try {
return 'localStorage' in window && window['localStorage'] !== null && window.localStorage.getItem;
}
catch(e) {
return false;
}
}
function storeLink(link)
{
if (!$("#nav-sync").hasClass('sync') && localStorageSupported()) {
window.localStorage.setItem('navpath',link);
}
}
function deleteLink()
{
if (localStorageSupported()) {
window.localStorage.setItem('navpath','');
}
}
function cachedLink()
{
if (localStorageSupported()) {
return window.localStorage.getItem('navpath');
} else {
return '';
}
}
function getScript(scriptName,func,show)
{
var head = document.getElementsByTagName("head")[0];
var script = document.createElement('script');
script.id = scriptName;
script.type = 'text/javascript';
script.onload = func;
script.src = scriptName+'.js';
if ($.browser.msie && $.browser.version<=8) {
// script.onload does not work with older versions of IE
script.onreadystatechange = function() {
if (script.readyState=='complete' || script.readyState=='loaded') {
func(); if (show) showRoot();
}
}
}
head.appendChild(script);
}
function createIndent(o,domNode,node,level)
{
var level=-1;
var n = node;
while (n.parentNode) { level++; n=n.parentNode; }
if (node.childrenData) {
var imgNode = document.createElement("img");
imgNode.style.paddingLeft=(16*level).toString()+'px';
imgNode.width = 16;
imgNode.height = 22;
imgNode.border = 0;
node.plus_img = imgNode;
node.expandToggle = document.createElement("a");
node.expandToggle.href = "javascript:void(0)";
node.expandToggle.onclick = function() {
if (node.expanded) {
$(node.getChildrenUL()).slideUp("fast");
node.plus_img.src = node.relpath+"ftv2pnode.png";
node.expanded = false;
} else {
expandNode(o, node, false, false);
}
}
node.expandToggle.appendChild(imgNode);
domNode.appendChild(node.expandToggle);
imgNode.src = node.relpath+"ftv2pnode.png";
} else {
var span = document.createElement("span");
span.style.display = 'inline-block';
span.style.width = 16*(level+1)+'px';
span.style.height = '22px';
span.innerHTML = ' ';
domNode.appendChild(span);
}
}
var animationInProgress = false;
function gotoAnchor(anchor,aname,updateLocation)
{
var pos, docContent = $('#doc-content');
if (anchor.parent().attr('class')=='memItemLeft' ||
anchor.parent().attr('class')=='fieldtype' ||
anchor.parent().is(':header'))
{
pos = anchor.parent().position().top;
} else if (anchor.position()) {
pos = anchor.position().top;
}
if (pos) {
var dist = Math.abs(Math.min(
pos-docContent.offset().top,
docContent[0].scrollHeight-
docContent.height()-docContent.scrollTop()));
animationInProgress=true;
docContent.animate({
scrollTop: pos + docContent.scrollTop() - docContent.offset().top
},Math.max(50,Math.min(500,dist)),function(){
if (updateLocation) window.location.href=aname;
animationInProgress=false;
});
}
}
function newNode(o, po, text, link, childrenData, lastNode)
{
var node = new Object();
node.children = Array();
node.childrenData = childrenData;
node.depth = po.depth + 1;
node.relpath = po.relpath;
node.isLast = lastNode;
node.li = document.createElement("li");
po.getChildrenUL().appendChild(node.li);
node.parentNode = po;
node.itemDiv = document.createElement("div");
node.itemDiv.className = "item";
node.labelSpan = document.createElement("span");
node.labelSpan.className = "label";
createIndent(o,node.itemDiv,node,0);
node.itemDiv.appendChild(node.labelSpan);
node.li.appendChild(node.itemDiv);
var a = document.createElement("a");
node.labelSpan.appendChild(a);
node.label = document.createTextNode(text);
node.expanded = false;
a.appendChild(node.label);
if (link) {
var url;
if (link.substring(0,1)=='^') {
url = link.substring(1);
link = url;
} else {
url = node.relpath+link;
}
a.className = stripPath(link.replace('#',':'));
if (link.indexOf('#')!=-1) {
var aname = '#'+link.split('#')[1];
var srcPage = stripPath($(location).attr('pathname'));
var targetPage = stripPath(link.split('#')[0]);
a.href = srcPage!=targetPage ? url : "javascript:void(0)";
a.onclick = function(){
storeLink(link);
if (!$(a).parent().parent().hasClass('selected'))
{
$('.item').removeClass('selected');
$('.item').removeAttr('id');
$(a).parent().parent().addClass('selected');
$(a).parent().parent().attr('id','selected');
}
var anchor = $(aname);
gotoAnchor(anchor,aname,true);
};
} else {
a.href = url;
a.onclick = function() { storeLink(link); }
}
} else {
if (childrenData != null)
{
a.className = "nolink";
a.href = "javascript:void(0)";
a.onclick = node.expandToggle.onclick;
}
}
node.childrenUL = null;
node.getChildrenUL = function() {
if (!node.childrenUL) {
node.childrenUL = document.createElement("ul");
node.childrenUL.className = "children_ul";
node.childrenUL.style.display = "none";
node.li.appendChild(node.childrenUL);
}
return node.childrenUL;
};
return node;
}
function showRoot()
{
var headerHeight = $("#top").height();
var footerHeight = $("#nav-path").height();
var windowHeight = $(window).height() - headerHeight - footerHeight;
(function (){ // retry until we can scroll to the selected item
try {
var navtree=$('#nav-tree');
navtree.scrollTo('#selected',0,{offset:-windowHeight/2});
} catch (err) {
setTimeout(arguments.callee, 0);
}
})();
}
function expandNode(o, node, imm, showRoot)
{
if (node.childrenData && !node.expanded) {
if (typeof(node.childrenData)==='string') {
var varName = node.childrenData;
getScript(node.relpath+varName,function(){
node.childrenData = getData(varName);
expandNode(o, node, imm, showRoot);
}, showRoot);
} else {
if (!node.childrenVisited) {
getNode(o, node);
} if (imm || ($.browser.msie && $.browser.version>8)) {
// somehow slideDown jumps to the start of tree for IE9 :-(
$(node.getChildrenUL()).show();
} else {
$(node.getChildrenUL()).slideDown("fast");
}
if (node.isLast) {
node.plus_img.src = node.relpath+"ftv2mlastnode.png";
} else {
node.plus_img.src = node.relpath+"ftv2mnode.png";
}
node.expanded = true;
}
}
}
function glowEffect(n,duration)
{
n.addClass('glow').delay(duration).queue(function(next){
$(this).removeClass('glow');next();
});
}
function highlightAnchor()
{
var aname = $(location).attr('hash');
var anchor = $(aname);
if (anchor.parent().attr('class')=='memItemLeft'){
var rows = $('.memberdecls tr[class$="'+
window.location.hash.substring(1)+'"]');
glowEffect(rows.children(),300); // member without details
} else if (anchor.parents().slice(2).prop('tagName')=='TR') {
glowEffect(anchor.parents('div.memitem'),1000); // enum value
} else if (anchor.parent().attr('class')=='fieldtype'){
glowEffect(anchor.parent().parent(),1000); // struct field
} else if (anchor.parent().is(":header")) {
glowEffect(anchor.parent(),1000); // section header
} else {
glowEffect(anchor.next(),1000); // normal member
}
gotoAnchor(anchor,aname,false);
}
function selectAndHighlight(hash,n)
{
var a;
if (hash) {
var link=stripPath($(location).attr('pathname'))+':'+hash.substring(1);
a=$('.item a[class$="'+link+'"]');
}
if (a && a.length) {
a.parent().parent().addClass('selected');
a.parent().parent().attr('id','selected');
highlightAnchor();
} else if (n) {
$(n.itemDiv).addClass('selected');
$(n.itemDiv).attr('id','selected');
}
if ($('#nav-tree-contents .item:first').hasClass('selected')) {
$('#nav-sync').css('top','30px');
} else {
$('#nav-sync').css('top','5px');
}
showRoot();
}
function showNode(o, node, index, hash)
{
if (node && node.childrenData) {
if (typeof(node.childrenData)==='string') {
var varName = node.childrenData;
getScript(node.relpath+varName,function(){
node.childrenData = getData(varName);
showNode(o,node,index,hash);
},true);
} else {
if (!node.childrenVisited) {
getNode(o, node);
}
$(node.getChildrenUL()).css({'display':'block'});
if (node.isLast) {
node.plus_img.src = node.relpath+"ftv2mlastnode.png";
} else {
node.plus_img.src = node.relpath+"ftv2mnode.png";
}
node.expanded = true;
var n = node.children[o.breadcrumbs[index]];
if (index+1<o.breadcrumbs.length) {
showNode(o,n,index+1,hash);
} else {
if (typeof(n.childrenData)==='string') {
var varName = n.childrenData;
getScript(n.relpath+varName,function(){
n.childrenData = getData(varName);
node.expanded=false;
showNode(o,node,index,hash); // retry with child node expanded
},true);
} else {
var rootBase = stripPath(o.toroot.replace(/\..+$/, ''));
if (rootBase=="index" || rootBase=="pages" || rootBase=="search") {
expandNode(o, n, true, true);
}
selectAndHighlight(hash,n);
}
}
}
} else {
selectAndHighlight(hash);
}
}
function removeToInsertLater(element) {
var parentNode = element.parentNode;
var nextSibling = element.nextSibling;
parentNode.removeChild(element);
return function() {
if (nextSibling) {
parentNode.insertBefore(element, nextSibling);
} else {
parentNode.appendChild(element);
}
};
}
function getNode(o, po)
{
var insertFunction = removeToInsertLater(po.li);
po.childrenVisited = true;
var l = po.childrenData.length-1;
for (var i in po.childrenData) {
var nodeData = po.childrenData[i];
po.children[i] = newNode(o, po, nodeData[0], nodeData[1], nodeData[2],
i==l);
}
insertFunction();
}
function gotoNode(o,subIndex,root,hash,relpath)
{
var nti = navTreeSubIndices[subIndex][root+hash];
o.breadcrumbs = $.extend(true, [], nti ? nti : navTreeSubIndices[subIndex][root]);
if (!o.breadcrumbs && root!=NAVTREE[0][1]) { // fallback: show index
navTo(o,NAVTREE[0][1],"",relpath);
$('.item').removeClass('selected');
$('.item').removeAttr('id');
}
if (o.breadcrumbs) {
o.breadcrumbs.unshift(0); // add 0 for root node
showNode(o, o.node, 0, hash);
}
}
function navTo(o,root,hash,relpath)
{
var link = cachedLink();
if (link) {
var parts = link.split('#');
root = parts[0];
if (parts.length>1) hash = '#'+parts[1];
else hash='';
}
if (hash.match(/^#l\d+$/)) {
var anchor=$('a[name='+hash.substring(1)+']');
glowEffect(anchor.parent(),1000); // line number
hash=''; // strip line number anchors
//root=root.replace(/_source\./,'.'); // source link to doc link
}
var url=root+hash;
var i=-1;
while (NAVTREEINDEX[i+1]<=url) i++;
if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index
if (navTreeSubIndices[i]) {
gotoNode(o,i,root,hash,relpath)
} else {
getScript(relpath+'navtreeindex'+i,function(){
navTreeSubIndices[i] = eval('NAVTREEINDEX'+i);
if (navTreeSubIndices[i]) {
gotoNode(o,i,root,hash,relpath);
}
},true);
}
}
function showSyncOff(n,relpath)
{
n.html('<img src="'+relpath+'sync_off.png" title="'+SYNCOFFMSG+'"/>');
}
function showSyncOn(n,relpath)
{
n.html('<img src="'+relpath+'sync_on.png" title="'+SYNCONMSG+'"/>');
}
function toggleSyncButton(relpath)
{
var navSync = $('#nav-sync');
if (navSync.hasClass('sync')) {
navSync.removeClass('sync');
showSyncOff(navSync,relpath);
storeLink(stripPath2($(location).attr('pathname'))+$(location).attr('hash'));
} else {
navSync.addClass('sync');
showSyncOn(navSync,relpath);
deleteLink();
}
}
function initNavTree(toroot,relpath)
{
var o = new Object();
o.toroot = toroot;
o.node = new Object();
o.node.li = document.getElementById("nav-tree-contents");
o.node.childrenData = NAVTREE;
o.node.children = new Array();
o.node.childrenUL = document.createElement("ul");
o.node.getChildrenUL = function() { return o.node.childrenUL; };
o.node.li.appendChild(o.node.childrenUL);
o.node.depth = 0;
o.node.relpath = relpath;
o.node.expanded = false;
o.node.isLast = true;
o.node.plus_img = document.createElement("img");
o.node.plus_img.src = relpath+"ftv2pnode.png";
o.node.plus_img.width = 16;
o.node.plus_img.height = 22;
if (localStorageSupported()) {
var navSync = $('#nav-sync');
if (cachedLink()) {
showSyncOff(navSync,relpath);
navSync.removeClass('sync');
} else {
showSyncOn(navSync,relpath);
}
navSync.click(function(){ toggleSyncButton(relpath); });
}
$(window).load(function(){
navTo(o,toroot,window.location.hash,relpath);
showRoot();
});
$(window).bind('hashchange', function(){
if (window.location.hash && window.location.hash.length>1){
var a;
if ($(location).attr('hash')){
var clslink=stripPath($(location).attr('pathname'))+':'+
$(location).attr('hash').substring(1);
a=$('.item a[class$="'+clslink+'"]');
}
if (a==null || !$(a).parent().parent().hasClass('selected')){
$('.item').removeClass('selected');
$('.item').removeAttr('id');
}
var link=stripPath2($(location).attr('pathname'));
navTo(o,link,$(location).attr('hash'),relpath);
} else if (!animationInProgress) {
$('#doc-content').scrollTop(0);
$('.item').removeClass('selected');
$('.item').removeAttr('id');
navTo(o,toroot,window.location.hash,relpath);
}
})
}
| {
"content_hash": "77782f01e097deeec2924d5737b6f3e4",
"timestamp": "",
"source": "github",
"line_count": 537,
"max_line_length": 102,
"avg_line_length": 28.532588454376164,
"alnum_prop": 0.6057955880433363,
"repo_name": "barakyoresh/AlzheimerTest",
"id": "a9efcc9c273f4d5e037077b49d112d21c6bce29e",
"size": "15322",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app/libs/Android 5.5.0/Flurry Android API Documentation/navtree.js",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "32905"
},
{
"name": "Emacs Lisp",
"bytes": "1299"
},
{
"name": "HTML",
"bytes": "2542487"
},
{
"name": "Java",
"bytes": "2812077"
},
{
"name": "JavaScript",
"bytes": "70430"
},
{
"name": "Lex",
"bytes": "9080"
}
],
"symlink_target": ""
} |
using OAuthWPDemo.Resources;
namespace OAuthWPDemo
{
/// <summary>
/// Provides access to string resources.
/// </summary>
public class LocalizedStrings
{
private static AppResources _localizedResources = new AppResources();
public AppResources LocalizedResources { get { return _localizedResources; } }
}
} | {
"content_hash": "8b3b500af03220a0ede90bea5b9dd229",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 86,
"avg_line_length": 25,
"alnum_prop": 0.68,
"repo_name": "yammer/windows-phone-oauth-sdk-demo",
"id": "303b59572dcb220f4bc0df2657f7fef618ce57cd",
"size": "352",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "OAuthWPDemo/LocalizedStrings.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "45760"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="P2" default="default" basedir=".">
<description>Builds, tests, and runs the project P2.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar: JAR building
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="P2-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>
| {
"content_hash": "0485ef5e584770075a66185c9e518fb7",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 86,
"avg_line_length": 48.19178082191781,
"alnum_prop": 0.6517907902217169,
"repo_name": "magikid/java2",
"id": "bad18270e421e746f8ba75f5a9ded112607eda52",
"size": "3518",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "P2/build.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "45513"
},
{
"name": "Shell",
"bytes": "1707"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
Index Fungorum
#### Published in
Bidr. Känn. Finl. Nat. Folk 19: 103 (1871)
#### Original name
Peziza aeruginascens Nyl.
### Remarks
null | {
"content_hash": "17790b4843350383b2f983c9dccf7975",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 42,
"avg_line_length": 12.846153846153847,
"alnum_prop": 0.688622754491018,
"repo_name": "mdoering/backbone",
"id": "38afdf4afac66b691a9091986fbca8b489b0862b",
"size": "237",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Leotiomycetes/Helotiales/Helotiaceae/Chlorociboria/Chlorociboria aeruginascens/ Syn. Chlorosplenium aeruginascens/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.airavata.cloud.aurora.client.sdk;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
/**
* Contains a set of restrictions on matching tasks where all restrictions must be met
* (terms are AND'ed together).
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-21")
public class TaskQuery implements org.apache.thrift.TBase<TaskQuery, TaskQuery._Fields>, java.io.Serializable, Cloneable, Comparable<TaskQuery> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TaskQuery");
private static final org.apache.thrift.protocol.TField ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.STRING, (short)14);
private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)9);
private static final org.apache.thrift.protocol.TField JOB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("jobName", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField TASK_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("taskIds", org.apache.thrift.protocol.TType.SET, (short)4);
private static final org.apache.thrift.protocol.TField STATUSES_FIELD_DESC = new org.apache.thrift.protocol.TField("statuses", org.apache.thrift.protocol.TType.SET, (short)5);
private static final org.apache.thrift.protocol.TField INSTANCE_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("instanceIds", org.apache.thrift.protocol.TType.SET, (short)7);
private static final org.apache.thrift.protocol.TField SLAVE_HOSTS_FIELD_DESC = new org.apache.thrift.protocol.TField("slaveHosts", org.apache.thrift.protocol.TType.SET, (short)10);
private static final org.apache.thrift.protocol.TField JOB_KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("jobKeys", org.apache.thrift.protocol.TType.SET, (short)11);
private static final org.apache.thrift.protocol.TField OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("offset", org.apache.thrift.protocol.TType.I32, (short)12);
private static final org.apache.thrift.protocol.TField LIMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("limit", org.apache.thrift.protocol.TType.I32, (short)13);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new TaskQueryStandardSchemeFactory());
schemes.put(TupleScheme.class, new TaskQueryTupleSchemeFactory());
}
public String role; // required
public String environment; // required
public String jobName; // required
public Set<String> taskIds; // required
public Set<ScheduleStatus> statuses; // required
public Set<Integer> instanceIds; // required
public Set<String> slaveHosts; // required
public Set<JobKey> jobKeys; // required
public int offset; // required
public int limit; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ROLE((short)14, "role"),
ENVIRONMENT((short)9, "environment"),
JOB_NAME((short)2, "jobName"),
TASK_IDS((short)4, "taskIds"),
STATUSES((short)5, "statuses"),
INSTANCE_IDS((short)7, "instanceIds"),
SLAVE_HOSTS((short)10, "slaveHosts"),
JOB_KEYS((short)11, "jobKeys"),
OFFSET((short)12, "offset"),
LIMIT((short)13, "limit");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 14: // ROLE
return ROLE;
case 9: // ENVIRONMENT
return ENVIRONMENT;
case 2: // JOB_NAME
return JOB_NAME;
case 4: // TASK_IDS
return TASK_IDS;
case 5: // STATUSES
return STATUSES;
case 7: // INSTANCE_IDS
return INSTANCE_IDS;
case 10: // SLAVE_HOSTS
return SLAVE_HOSTS;
case 11: // JOB_KEYS
return JOB_KEYS;
case 12: // OFFSET
return OFFSET;
case 13: // LIMIT
return LIMIT;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __OFFSET_ISSET_ID = 0;
private static final int __LIMIT_ISSET_ID = 1;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.JOB_NAME, new org.apache.thrift.meta_data.FieldMetaData("jobName", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.TASK_IDS, new org.apache.thrift.meta_data.FieldMetaData("taskIds", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
tmpMap.put(_Fields.STATUSES, new org.apache.thrift.meta_data.FieldMetaData("statuses", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScheduleStatus.class))));
tmpMap.put(_Fields.INSTANCE_IDS, new org.apache.thrift.meta_data.FieldMetaData("instanceIds", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
tmpMap.put(_Fields.SLAVE_HOSTS, new org.apache.thrift.meta_data.FieldMetaData("slaveHosts", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
tmpMap.put(_Fields.JOB_KEYS, new org.apache.thrift.meta_data.FieldMetaData("jobKeys", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JobKey.class))));
tmpMap.put(_Fields.OFFSET, new org.apache.thrift.meta_data.FieldMetaData("offset", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.LIMIT, new org.apache.thrift.meta_data.FieldMetaData("limit", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TaskQuery.class, metaDataMap);
}
public TaskQuery() {
}
public TaskQuery(
String role,
String environment,
String jobName,
Set<String> taskIds,
Set<ScheduleStatus> statuses,
Set<Integer> instanceIds,
Set<String> slaveHosts,
Set<JobKey> jobKeys,
int offset,
int limit)
{
this();
this.role = role;
this.environment = environment;
this.jobName = jobName;
this.taskIds = taskIds;
this.statuses = statuses;
this.instanceIds = instanceIds;
this.slaveHosts = slaveHosts;
this.jobKeys = jobKeys;
this.offset = offset;
setOffsetIsSet(true);
this.limit = limit;
setLimitIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public TaskQuery(TaskQuery other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetRole()) {
this.role = other.role;
}
if (other.isSetEnvironment()) {
this.environment = other.environment;
}
if (other.isSetJobName()) {
this.jobName = other.jobName;
}
if (other.isSetTaskIds()) {
Set<String> __this__taskIds = new HashSet<String>(other.taskIds);
this.taskIds = __this__taskIds;
}
if (other.isSetStatuses()) {
Set<ScheduleStatus> __this__statuses = new HashSet<ScheduleStatus>(other.statuses.size());
for (ScheduleStatus other_element : other.statuses) {
__this__statuses.add(other_element);
}
this.statuses = __this__statuses;
}
if (other.isSetInstanceIds()) {
Set<Integer> __this__instanceIds = new HashSet<Integer>(other.instanceIds);
this.instanceIds = __this__instanceIds;
}
if (other.isSetSlaveHosts()) {
Set<String> __this__slaveHosts = new HashSet<String>(other.slaveHosts);
this.slaveHosts = __this__slaveHosts;
}
if (other.isSetJobKeys()) {
Set<JobKey> __this__jobKeys = new HashSet<JobKey>(other.jobKeys.size());
for (JobKey other_element : other.jobKeys) {
__this__jobKeys.add(new JobKey(other_element));
}
this.jobKeys = __this__jobKeys;
}
this.offset = other.offset;
this.limit = other.limit;
}
public TaskQuery deepCopy() {
return new TaskQuery(this);
}
@Override
public void clear() {
this.role = null;
this.environment = null;
this.jobName = null;
this.taskIds = null;
this.statuses = null;
this.instanceIds = null;
this.slaveHosts = null;
this.jobKeys = null;
setOffsetIsSet(false);
this.offset = 0;
setLimitIsSet(false);
this.limit = 0;
}
public String getRole() {
return this.role;
}
public TaskQuery setRole(String role) {
this.role = role;
return this;
}
public void unsetRole() {
this.role = null;
}
/** Returns true if field role is set (has been assigned a value) and false otherwise */
public boolean isSetRole() {
return this.role != null;
}
public void setRoleIsSet(boolean value) {
if (!value) {
this.role = null;
}
}
public String getEnvironment() {
return this.environment;
}
public TaskQuery setEnvironment(String environment) {
this.environment = environment;
return this;
}
public void unsetEnvironment() {
this.environment = null;
}
/** Returns true if field environment is set (has been assigned a value) and false otherwise */
public boolean isSetEnvironment() {
return this.environment != null;
}
public void setEnvironmentIsSet(boolean value) {
if (!value) {
this.environment = null;
}
}
public String getJobName() {
return this.jobName;
}
public TaskQuery setJobName(String jobName) {
this.jobName = jobName;
return this;
}
public void unsetJobName() {
this.jobName = null;
}
/** Returns true if field jobName is set (has been assigned a value) and false otherwise */
public boolean isSetJobName() {
return this.jobName != null;
}
public void setJobNameIsSet(boolean value) {
if (!value) {
this.jobName = null;
}
}
public int getTaskIdsSize() {
return (this.taskIds == null) ? 0 : this.taskIds.size();
}
public java.util.Iterator<String> getTaskIdsIterator() {
return (this.taskIds == null) ? null : this.taskIds.iterator();
}
public void addToTaskIds(String elem) {
if (this.taskIds == null) {
this.taskIds = new HashSet<String>();
}
this.taskIds.add(elem);
}
public Set<String> getTaskIds() {
return this.taskIds;
}
public TaskQuery setTaskIds(Set<String> taskIds) {
this.taskIds = taskIds;
return this;
}
public void unsetTaskIds() {
this.taskIds = null;
}
/** Returns true if field taskIds is set (has been assigned a value) and false otherwise */
public boolean isSetTaskIds() {
return this.taskIds != null;
}
public void setTaskIdsIsSet(boolean value) {
if (!value) {
this.taskIds = null;
}
}
public int getStatusesSize() {
return (this.statuses == null) ? 0 : this.statuses.size();
}
public java.util.Iterator<ScheduleStatus> getStatusesIterator() {
return (this.statuses == null) ? null : this.statuses.iterator();
}
public void addToStatuses(ScheduleStatus elem) {
if (this.statuses == null) {
this.statuses = new HashSet<ScheduleStatus>();
}
this.statuses.add(elem);
}
public Set<ScheduleStatus> getStatuses() {
return this.statuses;
}
public TaskQuery setStatuses(Set<ScheduleStatus> statuses) {
this.statuses = statuses;
return this;
}
public void unsetStatuses() {
this.statuses = null;
}
/** Returns true if field statuses is set (has been assigned a value) and false otherwise */
public boolean isSetStatuses() {
return this.statuses != null;
}
public void setStatusesIsSet(boolean value) {
if (!value) {
this.statuses = null;
}
}
public int getInstanceIdsSize() {
return (this.instanceIds == null) ? 0 : this.instanceIds.size();
}
public java.util.Iterator<Integer> getInstanceIdsIterator() {
return (this.instanceIds == null) ? null : this.instanceIds.iterator();
}
public void addToInstanceIds(int elem) {
if (this.instanceIds == null) {
this.instanceIds = new HashSet<Integer>();
}
this.instanceIds.add(elem);
}
public Set<Integer> getInstanceIds() {
return this.instanceIds;
}
public TaskQuery setInstanceIds(Set<Integer> instanceIds) {
this.instanceIds = instanceIds;
return this;
}
public void unsetInstanceIds() {
this.instanceIds = null;
}
/** Returns true if field instanceIds is set (has been assigned a value) and false otherwise */
public boolean isSetInstanceIds() {
return this.instanceIds != null;
}
public void setInstanceIdsIsSet(boolean value) {
if (!value) {
this.instanceIds = null;
}
}
public int getSlaveHostsSize() {
return (this.slaveHosts == null) ? 0 : this.slaveHosts.size();
}
public java.util.Iterator<String> getSlaveHostsIterator() {
return (this.slaveHosts == null) ? null : this.slaveHosts.iterator();
}
public void addToSlaveHosts(String elem) {
if (this.slaveHosts == null) {
this.slaveHosts = new HashSet<String>();
}
this.slaveHosts.add(elem);
}
public Set<String> getSlaveHosts() {
return this.slaveHosts;
}
public TaskQuery setSlaveHosts(Set<String> slaveHosts) {
this.slaveHosts = slaveHosts;
return this;
}
public void unsetSlaveHosts() {
this.slaveHosts = null;
}
/** Returns true if field slaveHosts is set (has been assigned a value) and false otherwise */
public boolean isSetSlaveHosts() {
return this.slaveHosts != null;
}
public void setSlaveHostsIsSet(boolean value) {
if (!value) {
this.slaveHosts = null;
}
}
public int getJobKeysSize() {
return (this.jobKeys == null) ? 0 : this.jobKeys.size();
}
public java.util.Iterator<JobKey> getJobKeysIterator() {
return (this.jobKeys == null) ? null : this.jobKeys.iterator();
}
public void addToJobKeys(JobKey elem) {
if (this.jobKeys == null) {
this.jobKeys = new HashSet<JobKey>();
}
this.jobKeys.add(elem);
}
public Set<JobKey> getJobKeys() {
return this.jobKeys;
}
public TaskQuery setJobKeys(Set<JobKey> jobKeys) {
this.jobKeys = jobKeys;
return this;
}
public void unsetJobKeys() {
this.jobKeys = null;
}
/** Returns true if field jobKeys is set (has been assigned a value) and false otherwise */
public boolean isSetJobKeys() {
return this.jobKeys != null;
}
public void setJobKeysIsSet(boolean value) {
if (!value) {
this.jobKeys = null;
}
}
public int getOffset() {
return this.offset;
}
public TaskQuery setOffset(int offset) {
this.offset = offset;
setOffsetIsSet(true);
return this;
}
public void unsetOffset() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OFFSET_ISSET_ID);
}
/** Returns true if field offset is set (has been assigned a value) and false otherwise */
public boolean isSetOffset() {
return EncodingUtils.testBit(__isset_bitfield, __OFFSET_ISSET_ID);
}
public void setOffsetIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OFFSET_ISSET_ID, value);
}
public int getLimit() {
return this.limit;
}
public TaskQuery setLimit(int limit) {
this.limit = limit;
setLimitIsSet(true);
return this;
}
public void unsetLimit() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LIMIT_ISSET_ID);
}
/** Returns true if field limit is set (has been assigned a value) and false otherwise */
public boolean isSetLimit() {
return EncodingUtils.testBit(__isset_bitfield, __LIMIT_ISSET_ID);
}
public void setLimitIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LIMIT_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ROLE:
if (value == null) {
unsetRole();
} else {
setRole((String)value);
}
break;
case ENVIRONMENT:
if (value == null) {
unsetEnvironment();
} else {
setEnvironment((String)value);
}
break;
case JOB_NAME:
if (value == null) {
unsetJobName();
} else {
setJobName((String)value);
}
break;
case TASK_IDS:
if (value == null) {
unsetTaskIds();
} else {
setTaskIds((Set<String>)value);
}
break;
case STATUSES:
if (value == null) {
unsetStatuses();
} else {
setStatuses((Set<ScheduleStatus>)value);
}
break;
case INSTANCE_IDS:
if (value == null) {
unsetInstanceIds();
} else {
setInstanceIds((Set<Integer>)value);
}
break;
case SLAVE_HOSTS:
if (value == null) {
unsetSlaveHosts();
} else {
setSlaveHosts((Set<String>)value);
}
break;
case JOB_KEYS:
if (value == null) {
unsetJobKeys();
} else {
setJobKeys((Set<JobKey>)value);
}
break;
case OFFSET:
if (value == null) {
unsetOffset();
} else {
setOffset((Integer)value);
}
break;
case LIMIT:
if (value == null) {
unsetLimit();
} else {
setLimit((Integer)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ROLE:
return getRole();
case ENVIRONMENT:
return getEnvironment();
case JOB_NAME:
return getJobName();
case TASK_IDS:
return getTaskIds();
case STATUSES:
return getStatuses();
case INSTANCE_IDS:
return getInstanceIds();
case SLAVE_HOSTS:
return getSlaveHosts();
case JOB_KEYS:
return getJobKeys();
case OFFSET:
return getOffset();
case LIMIT:
return getLimit();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case ROLE:
return isSetRole();
case ENVIRONMENT:
return isSetEnvironment();
case JOB_NAME:
return isSetJobName();
case TASK_IDS:
return isSetTaskIds();
case STATUSES:
return isSetStatuses();
case INSTANCE_IDS:
return isSetInstanceIds();
case SLAVE_HOSTS:
return isSetSlaveHosts();
case JOB_KEYS:
return isSetJobKeys();
case OFFSET:
return isSetOffset();
case LIMIT:
return isSetLimit();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof TaskQuery)
return this.equals((TaskQuery)that);
return false;
}
public boolean equals(TaskQuery that) {
if (that == null)
return false;
boolean this_present_role = true && this.isSetRole();
boolean that_present_role = true && that.isSetRole();
if (this_present_role || that_present_role) {
if (!(this_present_role && that_present_role))
return false;
if (!this.role.equals(that.role))
return false;
}
boolean this_present_environment = true && this.isSetEnvironment();
boolean that_present_environment = true && that.isSetEnvironment();
if (this_present_environment || that_present_environment) {
if (!(this_present_environment && that_present_environment))
return false;
if (!this.environment.equals(that.environment))
return false;
}
boolean this_present_jobName = true && this.isSetJobName();
boolean that_present_jobName = true && that.isSetJobName();
if (this_present_jobName || that_present_jobName) {
if (!(this_present_jobName && that_present_jobName))
return false;
if (!this.jobName.equals(that.jobName))
return false;
}
boolean this_present_taskIds = true && this.isSetTaskIds();
boolean that_present_taskIds = true && that.isSetTaskIds();
if (this_present_taskIds || that_present_taskIds) {
if (!(this_present_taskIds && that_present_taskIds))
return false;
if (!this.taskIds.equals(that.taskIds))
return false;
}
boolean this_present_statuses = true && this.isSetStatuses();
boolean that_present_statuses = true && that.isSetStatuses();
if (this_present_statuses || that_present_statuses) {
if (!(this_present_statuses && that_present_statuses))
return false;
if (!this.statuses.equals(that.statuses))
return false;
}
boolean this_present_instanceIds = true && this.isSetInstanceIds();
boolean that_present_instanceIds = true && that.isSetInstanceIds();
if (this_present_instanceIds || that_present_instanceIds) {
if (!(this_present_instanceIds && that_present_instanceIds))
return false;
if (!this.instanceIds.equals(that.instanceIds))
return false;
}
boolean this_present_slaveHosts = true && this.isSetSlaveHosts();
boolean that_present_slaveHosts = true && that.isSetSlaveHosts();
if (this_present_slaveHosts || that_present_slaveHosts) {
if (!(this_present_slaveHosts && that_present_slaveHosts))
return false;
if (!this.slaveHosts.equals(that.slaveHosts))
return false;
}
boolean this_present_jobKeys = true && this.isSetJobKeys();
boolean that_present_jobKeys = true && that.isSetJobKeys();
if (this_present_jobKeys || that_present_jobKeys) {
if (!(this_present_jobKeys && that_present_jobKeys))
return false;
if (!this.jobKeys.equals(that.jobKeys))
return false;
}
boolean this_present_offset = true;
boolean that_present_offset = true;
if (this_present_offset || that_present_offset) {
if (!(this_present_offset && that_present_offset))
return false;
if (this.offset != that.offset)
return false;
}
boolean this_present_limit = true;
boolean that_present_limit = true;
if (this_present_limit || that_present_limit) {
if (!(this_present_limit && that_present_limit))
return false;
if (this.limit != that.limit)
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_role = true && (isSetRole());
list.add(present_role);
if (present_role)
list.add(role);
boolean present_environment = true && (isSetEnvironment());
list.add(present_environment);
if (present_environment)
list.add(environment);
boolean present_jobName = true && (isSetJobName());
list.add(present_jobName);
if (present_jobName)
list.add(jobName);
boolean present_taskIds = true && (isSetTaskIds());
list.add(present_taskIds);
if (present_taskIds)
list.add(taskIds);
boolean present_statuses = true && (isSetStatuses());
list.add(present_statuses);
if (present_statuses)
list.add(statuses);
boolean present_instanceIds = true && (isSetInstanceIds());
list.add(present_instanceIds);
if (present_instanceIds)
list.add(instanceIds);
boolean present_slaveHosts = true && (isSetSlaveHosts());
list.add(present_slaveHosts);
if (present_slaveHosts)
list.add(slaveHosts);
boolean present_jobKeys = true && (isSetJobKeys());
list.add(present_jobKeys);
if (present_jobKeys)
list.add(jobKeys);
boolean present_offset = true;
list.add(present_offset);
if (present_offset)
list.add(offset);
boolean present_limit = true;
list.add(present_limit);
if (present_limit)
list.add(limit);
return list.hashCode();
}
@Override
public int compareTo(TaskQuery other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetRole()).compareTo(other.isSetRole());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRole()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, other.role);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetEnvironment()).compareTo(other.isSetEnvironment());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEnvironment()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.environment, other.environment);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetJobName()).compareTo(other.isSetJobName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetJobName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jobName, other.jobName);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetTaskIds()).compareTo(other.isSetTaskIds());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTaskIds()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskIds, other.taskIds);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetStatuses()).compareTo(other.isSetStatuses());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetStatuses()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statuses, other.statuses);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetInstanceIds()).compareTo(other.isSetInstanceIds());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetInstanceIds()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.instanceIds, other.instanceIds);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetSlaveHosts()).compareTo(other.isSetSlaveHosts());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSlaveHosts()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.slaveHosts, other.slaveHosts);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetJobKeys()).compareTo(other.isSetJobKeys());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetJobKeys()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jobKeys, other.jobKeys);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOffset()).compareTo(other.isSetOffset());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOffset()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offset, other.offset);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetLimit()).compareTo(other.isSetLimit());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetLimit()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limit, other.limit);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("TaskQuery(");
boolean first = true;
sb.append("role:");
if (this.role == null) {
sb.append("null");
} else {
sb.append(this.role);
}
first = false;
if (!first) sb.append(", ");
sb.append("environment:");
if (this.environment == null) {
sb.append("null");
} else {
sb.append(this.environment);
}
first = false;
if (!first) sb.append(", ");
sb.append("jobName:");
if (this.jobName == null) {
sb.append("null");
} else {
sb.append(this.jobName);
}
first = false;
if (!first) sb.append(", ");
sb.append("taskIds:");
if (this.taskIds == null) {
sb.append("null");
} else {
sb.append(this.taskIds);
}
first = false;
if (!first) sb.append(", ");
sb.append("statuses:");
if (this.statuses == null) {
sb.append("null");
} else {
sb.append(this.statuses);
}
first = false;
if (!first) sb.append(", ");
sb.append("instanceIds:");
if (this.instanceIds == null) {
sb.append("null");
} else {
sb.append(this.instanceIds);
}
first = false;
if (!first) sb.append(", ");
sb.append("slaveHosts:");
if (this.slaveHosts == null) {
sb.append("null");
} else {
sb.append(this.slaveHosts);
}
first = false;
if (!first) sb.append(", ");
sb.append("jobKeys:");
if (this.jobKeys == null) {
sb.append("null");
} else {
sb.append(this.jobKeys);
}
first = false;
if (!first) sb.append(", ");
sb.append("offset:");
sb.append(this.offset);
first = false;
if (!first) sb.append(", ");
sb.append("limit:");
sb.append(this.limit);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class TaskQueryStandardSchemeFactory implements SchemeFactory {
public TaskQueryStandardScheme getScheme() {
return new TaskQueryStandardScheme();
}
}
private static class TaskQueryStandardScheme extends StandardScheme<TaskQuery> {
public void read(org.apache.thrift.protocol.TProtocol iprot, TaskQuery struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 14: // ROLE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.role = iprot.readString();
struct.setRoleIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 9: // ENVIRONMENT
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.environment = iprot.readString();
struct.setEnvironmentIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // JOB_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.jobName = iprot.readString();
struct.setJobNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // TASK_IDS
if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
{
org.apache.thrift.protocol.TSet _set142 = iprot.readSetBegin();
struct.taskIds = new HashSet<String>(2*_set142.size);
String _elem143;
for (int _i144 = 0; _i144 < _set142.size; ++_i144)
{
_elem143 = iprot.readString();
struct.taskIds.add(_elem143);
}
iprot.readSetEnd();
}
struct.setTaskIdsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // STATUSES
if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
{
org.apache.thrift.protocol.TSet _set145 = iprot.readSetBegin();
struct.statuses = new HashSet<ScheduleStatus>(2*_set145.size);
ScheduleStatus _elem146;
for (int _i147 = 0; _i147 < _set145.size; ++_i147)
{
_elem146 = org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.findByValue(iprot.readI32());
struct.statuses.add(_elem146);
}
iprot.readSetEnd();
}
struct.setStatusesIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 7: // INSTANCE_IDS
if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
{
org.apache.thrift.protocol.TSet _set148 = iprot.readSetBegin();
struct.instanceIds = new HashSet<Integer>(2*_set148.size);
int _elem149;
for (int _i150 = 0; _i150 < _set148.size; ++_i150)
{
_elem149 = iprot.readI32();
struct.instanceIds.add(_elem149);
}
iprot.readSetEnd();
}
struct.setInstanceIdsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 10: // SLAVE_HOSTS
if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
{
org.apache.thrift.protocol.TSet _set151 = iprot.readSetBegin();
struct.slaveHosts = new HashSet<String>(2*_set151.size);
String _elem152;
for (int _i153 = 0; _i153 < _set151.size; ++_i153)
{
_elem152 = iprot.readString();
struct.slaveHosts.add(_elem152);
}
iprot.readSetEnd();
}
struct.setSlaveHostsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 11: // JOB_KEYS
if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
{
org.apache.thrift.protocol.TSet _set154 = iprot.readSetBegin();
struct.jobKeys = new HashSet<JobKey>(2*_set154.size);
JobKey _elem155;
for (int _i156 = 0; _i156 < _set154.size; ++_i156)
{
_elem155 = new JobKey();
_elem155.read(iprot);
struct.jobKeys.add(_elem155);
}
iprot.readSetEnd();
}
struct.setJobKeysIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 12: // OFFSET
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.offset = iprot.readI32();
struct.setOffsetIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 13: // LIMIT
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.limit = iprot.readI32();
struct.setLimitIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, TaskQuery struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.jobName != null) {
oprot.writeFieldBegin(JOB_NAME_FIELD_DESC);
oprot.writeString(struct.jobName);
oprot.writeFieldEnd();
}
if (struct.taskIds != null) {
oprot.writeFieldBegin(TASK_IDS_FIELD_DESC);
{
oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.taskIds.size()));
for (String _iter157 : struct.taskIds)
{
oprot.writeString(_iter157);
}
oprot.writeSetEnd();
}
oprot.writeFieldEnd();
}
if (struct.statuses != null) {
oprot.writeFieldBegin(STATUSES_FIELD_DESC);
{
oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.statuses.size()));
for (ScheduleStatus _iter158 : struct.statuses)
{
oprot.writeI32(_iter158.getValue());
}
oprot.writeSetEnd();
}
oprot.writeFieldEnd();
}
if (struct.instanceIds != null) {
oprot.writeFieldBegin(INSTANCE_IDS_FIELD_DESC);
{
oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.instanceIds.size()));
for (int _iter159 : struct.instanceIds)
{
oprot.writeI32(_iter159);
}
oprot.writeSetEnd();
}
oprot.writeFieldEnd();
}
if (struct.environment != null) {
oprot.writeFieldBegin(ENVIRONMENT_FIELD_DESC);
oprot.writeString(struct.environment);
oprot.writeFieldEnd();
}
if (struct.slaveHosts != null) {
oprot.writeFieldBegin(SLAVE_HOSTS_FIELD_DESC);
{
oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.slaveHosts.size()));
for (String _iter160 : struct.slaveHosts)
{
oprot.writeString(_iter160);
}
oprot.writeSetEnd();
}
oprot.writeFieldEnd();
}
if (struct.jobKeys != null) {
oprot.writeFieldBegin(JOB_KEYS_FIELD_DESC);
{
oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, struct.jobKeys.size()));
for (JobKey _iter161 : struct.jobKeys)
{
_iter161.write(oprot);
}
oprot.writeSetEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(OFFSET_FIELD_DESC);
oprot.writeI32(struct.offset);
oprot.writeFieldEnd();
oprot.writeFieldBegin(LIMIT_FIELD_DESC);
oprot.writeI32(struct.limit);
oprot.writeFieldEnd();
if (struct.role != null) {
oprot.writeFieldBegin(ROLE_FIELD_DESC);
oprot.writeString(struct.role);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TaskQueryTupleSchemeFactory implements SchemeFactory {
public TaskQueryTupleScheme getScheme() {
return new TaskQueryTupleScheme();
}
}
private static class TaskQueryTupleScheme extends TupleScheme<TaskQuery> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TaskQuery struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetRole()) {
optionals.set(0);
}
if (struct.isSetEnvironment()) {
optionals.set(1);
}
if (struct.isSetJobName()) {
optionals.set(2);
}
if (struct.isSetTaskIds()) {
optionals.set(3);
}
if (struct.isSetStatuses()) {
optionals.set(4);
}
if (struct.isSetInstanceIds()) {
optionals.set(5);
}
if (struct.isSetSlaveHosts()) {
optionals.set(6);
}
if (struct.isSetJobKeys()) {
optionals.set(7);
}
if (struct.isSetOffset()) {
optionals.set(8);
}
if (struct.isSetLimit()) {
optionals.set(9);
}
oprot.writeBitSet(optionals, 10);
if (struct.isSetRole()) {
oprot.writeString(struct.role);
}
if (struct.isSetEnvironment()) {
oprot.writeString(struct.environment);
}
if (struct.isSetJobName()) {
oprot.writeString(struct.jobName);
}
if (struct.isSetTaskIds()) {
{
oprot.writeI32(struct.taskIds.size());
for (String _iter162 : struct.taskIds)
{
oprot.writeString(_iter162);
}
}
}
if (struct.isSetStatuses()) {
{
oprot.writeI32(struct.statuses.size());
for (ScheduleStatus _iter163 : struct.statuses)
{
oprot.writeI32(_iter163.getValue());
}
}
}
if (struct.isSetInstanceIds()) {
{
oprot.writeI32(struct.instanceIds.size());
for (int _iter164 : struct.instanceIds)
{
oprot.writeI32(_iter164);
}
}
}
if (struct.isSetSlaveHosts()) {
{
oprot.writeI32(struct.slaveHosts.size());
for (String _iter165 : struct.slaveHosts)
{
oprot.writeString(_iter165);
}
}
}
if (struct.isSetJobKeys()) {
{
oprot.writeI32(struct.jobKeys.size());
for (JobKey _iter166 : struct.jobKeys)
{
_iter166.write(oprot);
}
}
}
if (struct.isSetOffset()) {
oprot.writeI32(struct.offset);
}
if (struct.isSetLimit()) {
oprot.writeI32(struct.limit);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TaskQuery struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(10);
if (incoming.get(0)) {
struct.role = iprot.readString();
struct.setRoleIsSet(true);
}
if (incoming.get(1)) {
struct.environment = iprot.readString();
struct.setEnvironmentIsSet(true);
}
if (incoming.get(2)) {
struct.jobName = iprot.readString();
struct.setJobNameIsSet(true);
}
if (incoming.get(3)) {
{
org.apache.thrift.protocol.TSet _set167 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.taskIds = new HashSet<String>(2*_set167.size);
String _elem168;
for (int _i169 = 0; _i169 < _set167.size; ++_i169)
{
_elem168 = iprot.readString();
struct.taskIds.add(_elem168);
}
}
struct.setTaskIdsIsSet(true);
}
if (incoming.get(4)) {
{
org.apache.thrift.protocol.TSet _set170 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32());
struct.statuses = new HashSet<ScheduleStatus>(2*_set170.size);
ScheduleStatus _elem171;
for (int _i172 = 0; _i172 < _set170.size; ++_i172)
{
_elem171 = org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.findByValue(iprot.readI32());
struct.statuses.add(_elem171);
}
}
struct.setStatusesIsSet(true);
}
if (incoming.get(5)) {
{
org.apache.thrift.protocol.TSet _set173 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32());
struct.instanceIds = new HashSet<Integer>(2*_set173.size);
int _elem174;
for (int _i175 = 0; _i175 < _set173.size; ++_i175)
{
_elem174 = iprot.readI32();
struct.instanceIds.add(_elem174);
}
}
struct.setInstanceIdsIsSet(true);
}
if (incoming.get(6)) {
{
org.apache.thrift.protocol.TSet _set176 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.slaveHosts = new HashSet<String>(2*_set176.size);
String _elem177;
for (int _i178 = 0; _i178 < _set176.size; ++_i178)
{
_elem177 = iprot.readString();
struct.slaveHosts.add(_elem177);
}
}
struct.setSlaveHostsIsSet(true);
}
if (incoming.get(7)) {
{
org.apache.thrift.protocol.TSet _set179 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.jobKeys = new HashSet<JobKey>(2*_set179.size);
JobKey _elem180;
for (int _i181 = 0; _i181 < _set179.size; ++_i181)
{
_elem180 = new JobKey();
_elem180.read(iprot);
struct.jobKeys.add(_elem180);
}
}
struct.setJobKeysIsSet(true);
}
if (incoming.get(8)) {
struct.offset = iprot.readI32();
struct.setOffsetIsSet(true);
}
if (incoming.get(9)) {
struct.limit = iprot.readI32();
struct.setLimitIsSet(true);
}
}
}
}
| {
"content_hash": "19c250bcc215dc5541afc09f4c88c0a1",
"timestamp": "",
"source": "github",
"line_count": 1593,
"max_line_length": 186,
"avg_line_length": 32.04645323289391,
"alnum_prop": 0.6238589618021547,
"repo_name": "gouravshenoy/airavata",
"id": "f739bf54721b0bb6fc3447cdfe9c3c673af1275d",
"size": "51861",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/TaskQuery.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": ""
} |
namespace {
const int kCookieInfoViewBorderSize = 1;
const int kCookieInfoViewInsetSize = 3;
} // namespace
///////////////////////////////////////////////////////////////////////////////
// CookieInfoView, public:
CookieInfoView::CookieInfoView(bool editable_expiration_date)
: name_label_(NULL),
name_value_field_(NULL),
content_label_(NULL),
content_value_field_(NULL),
domain_label_(NULL),
domain_value_field_(NULL),
path_label_(NULL),
path_value_field_(NULL),
send_for_label_(NULL),
send_for_value_field_(NULL),
created_label_(NULL),
created_value_field_(NULL),
expires_label_(NULL),
expires_value_field_(NULL),
expires_value_combobox_(NULL),
expire_view_(NULL),
editable_expiration_date_(editable_expiration_date),
delegate_(NULL) {
}
CookieInfoView::~CookieInfoView() {
}
void CookieInfoView::SetCookie(const std::string& domain,
const net::CanonicalCookie& cookie) {
name_value_field_->SetText(UTF8ToUTF16(cookie.Name()));
content_value_field_->SetText(UTF8ToUTF16(cookie.Value()));
domain_value_field_->SetText(UTF8ToUTF16(domain));
path_value_field_->SetText(UTF8ToUTF16(cookie.Path()));
created_value_field_->SetText(
base::TimeFormatFriendlyDateAndTime(cookie.CreationDate()));
string16 expire_text = cookie.IsPersistent() ?
base::TimeFormatFriendlyDateAndTime(cookie.ExpiryDate()) :
l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_EXPIRES_SESSION);
if (editable_expiration_date_) {
expire_combo_values_.clear();
if (cookie.IsPersistent())
expire_combo_values_.push_back(expire_text);
expire_combo_values_.push_back(
l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_EXPIRES_SESSION));
expires_value_combobox_->ModelChanged();
expires_value_combobox_->SetSelectedIndex(0);
expires_value_combobox_->SetEnabled(true);
expires_value_combobox_->set_listener(this);
} else {
expires_value_field_->SetText(expire_text);
}
send_for_value_field_->SetText(cookie.IsSecure() ?
l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_SENDFOR_SECURE) :
l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_SENDFOR_ANY));
EnableCookieDisplay(true);
Layout();
}
void CookieInfoView::SetCookieString(const GURL& url,
const std::string& cookie_line) {
net::ParsedCookie pc(cookie_line);
net::CanonicalCookie cookie(url, pc);
SetCookie(pc.HasDomain() ? pc.Domain() : url.host(), cookie);
}
void CookieInfoView::ClearCookieDisplay() {
string16 no_cookie_string =
l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_NONESELECTED);
name_value_field_->SetText(no_cookie_string);
content_value_field_->SetText(no_cookie_string);
domain_value_field_->SetText(no_cookie_string);
path_value_field_->SetText(no_cookie_string);
send_for_value_field_->SetText(no_cookie_string);
created_value_field_->SetText(no_cookie_string);
if (expires_value_field_)
expires_value_field_->SetText(no_cookie_string);
EnableCookieDisplay(false);
}
void CookieInfoView::EnableCookieDisplay(bool enabled) {
name_value_field_->SetEnabled(enabled);
content_value_field_->SetEnabled(enabled);
domain_value_field_->SetEnabled(enabled);
path_value_field_->SetEnabled(enabled);
send_for_value_field_->SetEnabled(enabled);
created_value_field_->SetEnabled(enabled);
if (expires_value_field_)
expires_value_field_->SetEnabled(enabled);
}
///////////////////////////////////////////////////////////////////////////////
// CookieInfoView, views::View overrides.
void CookieInfoView::ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) {
if (details.is_add && details.child == this)
Init();
}
///////////////////////////////////////////////////////////////////////////////
// CookieInfoView, views::ComboboxListener overrides.
void CookieInfoView::OnSelectedIndexChanged(views::Combobox* combobox) {
DCHECK_EQ(combobox, expires_value_combobox_);
if (delegate_)
delegate_->ModifyExpireDate(combobox->selected_index() != 0);
}
///////////////////////////////////////////////////////////////////////////////
// CookieInfoView, ui::ComboboxModel overrides.
int CookieInfoView::GetItemCount() const {
return static_cast<int>(expire_combo_values_.size());
}
string16 CookieInfoView::GetItemAt(int index) {
return expire_combo_values_[index];
}
void CookieInfoView::AddLabelRow(int layout_id, views::GridLayout* layout,
views::View* label, views::View* value) {
layout->StartRow(0, layout_id);
layout->AddView(label);
layout->AddView(value, 2, 1, views::GridLayout::FILL,
views::GridLayout::CENTER);
layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
}
void CookieInfoView::AddControlRow(int layout_id, views::GridLayout* layout,
views::View* label, views::View* control) {
layout->StartRow(0, layout_id);
layout->AddView(label);
layout->AddView(control, 1, 1);
layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
}
///////////////////////////////////////////////////////////////////////////////
// CookieInfoView, private:
void CookieInfoView::Init() {
// Ensure we don't run this more than once and leak memory.
DCHECK(!name_label_);
#if defined(USE_AURA) || !defined(OS_WIN)
SkColor border_color = SK_ColorGRAY;
#else
SkColor border_color = color_utils::GetSysSkColor(COLOR_3DSHADOW);
#endif
views::Border* border = views::Border::CreateSolidBorder(
kCookieInfoViewBorderSize, border_color);
set_border(border);
name_label_ = new views::Label(
l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_NAME_LABEL));
name_value_field_ = new views::Textfield;
content_label_ = new views::Label(
l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_CONTENT_LABEL));
content_value_field_ = new views::Textfield;
domain_label_ = new views::Label(
l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_DOMAIN_LABEL));
domain_value_field_ = new views::Textfield;
path_label_ = new views::Label(
l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_PATH_LABEL));
path_value_field_ = new views::Textfield;
send_for_label_ = new views::Label(
l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_SENDFOR_LABEL));
send_for_value_field_ = new views::Textfield;
created_label_ = new views::Label(
l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_CREATED_LABEL));
created_value_field_ = new views::Textfield;
expires_label_ = new views::Label(
l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_EXPIRES_LABEL));
if (editable_expiration_date_)
expires_value_combobox_ = new views::Combobox(this);
else
expires_value_field_ = new views::Textfield;
using views::GridLayout;
using views::ColumnSet;
GridLayout* layout = new GridLayout(this);
layout->SetInsets(kCookieInfoViewInsetSize,
kCookieInfoViewInsetSize,
kCookieInfoViewInsetSize,
kCookieInfoViewInsetSize);
SetLayoutManager(layout);
int three_column_layout_id = 0;
ColumnSet* column_set = layout->AddColumnSet(three_column_layout_id);
column_set->AddColumn(GridLayout::TRAILING, GridLayout::CENTER, 0,
GridLayout::USE_PREF, 0, 0);
column_set->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing);
column_set->AddColumn(GridLayout::TRAILING, GridLayout::CENTER, 0,
GridLayout::USE_PREF, 0, 0);
column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1,
GridLayout::USE_PREF, 0, 0);
AddLabelRow(three_column_layout_id, layout, name_label_, name_value_field_);
AddLabelRow(three_column_layout_id, layout, content_label_,
content_value_field_);
AddLabelRow(three_column_layout_id, layout, domain_label_,
domain_value_field_);
AddLabelRow(three_column_layout_id, layout, path_label_, path_value_field_);
AddLabelRow(three_column_layout_id, layout, send_for_label_,
send_for_value_field_);
AddLabelRow(three_column_layout_id, layout, created_label_,
created_value_field_);
if (editable_expiration_date_) {
AddControlRow(three_column_layout_id, layout, expires_label_,
expires_value_combobox_);
} else {
AddLabelRow(three_column_layout_id, layout, expires_label_,
expires_value_field_);
}
// Color these borderless text areas the same as the containing dialog.
#if defined(USE_AURA) || !defined(OS_WIN)
SkColor text_area_background = SK_ColorWHITE;
#else
SkColor text_area_background = color_utils::GetSysSkColor(COLOR_3DFACE);
#endif
// Now that the Textfields are in the view hierarchy, we can initialize them.
name_value_field_->SetReadOnly(true);
name_value_field_->RemoveBorder();
name_value_field_->SetBackgroundColor(text_area_background);
content_value_field_->SetReadOnly(true);
content_value_field_->RemoveBorder();
content_value_field_->SetBackgroundColor(text_area_background);
domain_value_field_->SetReadOnly(true);
domain_value_field_->RemoveBorder();
domain_value_field_->SetBackgroundColor(text_area_background);
path_value_field_->SetReadOnly(true);
path_value_field_->RemoveBorder();
path_value_field_->SetBackgroundColor(text_area_background);
send_for_value_field_->SetReadOnly(true);
send_for_value_field_->RemoveBorder();
send_for_value_field_->SetBackgroundColor(text_area_background);
created_value_field_->SetReadOnly(true);
created_value_field_->RemoveBorder();
created_value_field_->SetBackgroundColor(text_area_background);
if (expires_value_field_) {
expires_value_field_->SetReadOnly(true);
expires_value_field_->RemoveBorder();
expires_value_field_->SetBackgroundColor(text_area_background);
}
}
| {
"content_hash": "49733c85d2b9c9e479e6d04448fb7071",
"timestamp": "",
"source": "github",
"line_count": 257,
"max_line_length": 79,
"avg_line_length": 38.49805447470817,
"alnum_prop": 0.6705073782090155,
"repo_name": "loopCM/chromium",
"id": "b9e73d3920e243b0443f78c09fb3cc170532b4f8",
"size": "10872",
"binary": false,
"copies": "1",
"ref": "refs/heads/trunk",
"path": "chrome/browser/ui/views/cookie_info_view.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<BuildConfig>
<DefaultLanguage>
ru
</DefaultLanguage>
<PackageType>
in_app_test|release
</PackageType>
</BuildConfig> | {
"content_hash": "68bafe81ae4813a9f60eac75ca4a9c35",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 38,
"avg_line_length": 20.88888888888889,
"alnum_prop": 0.6170212765957447,
"repo_name": "Vigelforts/TestProject",
"id": "e87a1927868a761f9a5aea10f635c2363a79d398",
"size": "188",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "BuildSystem/program/data/875/build_config.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "972828"
},
{
"name": "HTML",
"bytes": "309007"
},
{
"name": "PowerShell",
"bytes": "589470"
}
],
"symlink_target": ""
} |
<?php
if (!class_exists('DOPBSPViewsBackEndSettingsUsers')){
class DOPBSPViewsBackEndSettingsUsers extends DOPBSPViewsBackEndSettings{
/*
* Constructor
*/
function __construct(){
}
/*
* Returns users settings template.
*
* @param args (array): function arguments
*
* @return users settings HTML
*/
function template($args = array()){
/*
* Users roles for booking system permissions.
*/
$this->templateDefault();
/*
* Users roles for custom posts permissions.
*/
$this->templateCustomPosts();
/*
* Users
*/
$this->templateUsers();
}
/*
* Display users roles for booking system permissions.
*
* @return user roles HTML
*/
function templateDefault(){
global $wp_roles;
global $DOPBSP;
$roles = $wp_roles->get_names();
?>
<div class="dopbsp-inputs-header dopbsp-display">
<h3><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS'); ?></h3>
<a href="javascript:DOPBSPBackEnd.toggleInputs('users-permissions')" id="DOPBSP-inputs-button-users-permissions" class="dopbsp-button"></a>
</div>
<div id="DOPBSP-inputs-users-permissions" class="dopbsp-inputs-wrapper dopbsp-hidden">
<?php
while ($data = current($roles)){
?>
<div class="dopbsp-input-wrapper">
<input type="checkbox" name="DOPBSP-settings-users-permissions-<?php echo key($roles); ?>" id="DOPBSP-settings-users-permissions-<?php echo key($roles); ?>" onclick="DOPBSPBackEndSettingsUsers.set(0, '<?php echo key($roles); ?>')" <?php echo get_option('DOPBSP_users_permissions_'.key($roles)) > 0 ? ' checked=checked':''; ?> />
<label class="dopbsp-for-checkbox" for="DOPBSP-settings-users-permissions-<?php echo key($roles); ?>"><?php printf(key($roles) == 'administrator' ? $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_ADMINISTRATORS_LABEL'):$DOPBSP->text('SETTINGS_USERS_PERMISSIONS_LABEL'), '<strong>'.__(strtolower($data)).'</strong>'); ?></label>
</div>
<?php
next($roles);
}
?>
</div>
<?php
}
/*
* Display users roles for custom posts permissions.
*
* @return user roles HTML
*/
function templateCustomPosts(){
global $wp_roles;
global $DOPBSP;
$roles = $wp_roles->get_names();
?>
<div class="dopbsp-inputs-header dopbsp-display">
<h3><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_CUSTOM_POSTS'); ?></h3>
<a href="javascript:DOPBSPBackEnd.toggleInputs('users-permissions-custom-posts')" id="DOPBSP-inputs-button-users-permissions-custom-posts" class="dopbsp-button"></a>
</div>
<div id="DOPBSP-inputs-users-permissions-custom-posts" class="dopbsp-inputs-wrapper dopbsp-hidden">
<?php
while ($data = current($roles)){
?>
<div class="dopbsp-input-wrapper">
<input type="checkbox" name="DOPBSP-settings-users-permissions-custom_posts_<?php echo key($roles); ?>" id="DOPBSP-settings-users-permissions-custom_posts_<?php echo key($roles); ?>" onclick="DOPBSPBackEndSettingsUsers.set(0, 'custom_posts_<?php echo key($roles); ?>')" <?php echo get_option('DOPBSP_users_permissions_custom_posts_'.key($roles)) > 0 ? ' checked=checked':''; ?> />
<label class="dopbsp-for-checkbox" for="DOPBSP-settings-users-permissions-custom_posts_<?php echo key($roles); ?>"><?php printf($DOPBSP->text('SETTINGS_USERS_PERMISSIONS_CUSTOM_POSTS_LABEL'), '<strong>'.__(strtolower($data)).'</strong>'); ?></label>
</div>
<?php
next($roles);
}
?>
</div>
<?php
}
/*
* Display users template.
*
* @param calendar_id (integer): calendar ID
*
* @param user area HTML
*/
function templateUsers($calendar_id = 0){
global $wp_roles;
global $DOPBSP;
$roles = $wp_roles->get_names();
if ($calendar_id == 0){
?>
<div class="dopbsp-inputs-header dopbsp-last dopbsp-display">
<h3><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_INDIVIDUAL'); ?></h3>
<a href="javascript:DOPBSPBackEnd.toggleInputs('users')" id="DOPBSP-inputs-button-users" class="dopbsp-button"></a>
</div>
<div id="DOPBSP-inputs-users" class="dopbsp-inputs-wrapper dopbsp-last dopbsp-hidden">
<?php
}
else{
?>
<div class="dopbsp-inputs-wrapper dopbsp-last">
<?php
}
?>
<!--
Search by role.
-->
<div class="dopbsp-input-wrapper dopbsp-left">
<label for="DOPBSP-settings-users-permissions-filters-role"><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_FILTERS_ROLE'); ?></label>
<select name="DOPBSP-settings-users-permissions-filters-role" id="DOPBSP-settings-users-permissions-filters-role" onchange="DOPBSPBackEndSettingsUsers.get(<?php echo $calendar_id; ?>)">
<option value=""><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_FILTERS_ROLE_ALL'); ?></option>
<?php
while ($data = current($roles)){
if ($calendar_id === 0){
echo '<option value="'.key($roles).'">'.$data.'</option>';
}
else{
if (key($roles) !== 'administrator'){
echo '<option value="'.key($roles).'">'.$data.'</option>';
}
}
next($roles);
}
?>
</select>
<script type="text/JavaScript">jQuery('#DOPBSP-settings-users-permissions-filters-role').DOPSelect();</script>
</div>
<!--
Order by.
-->
<div class="dopbsp-input-wrapper dopbsp-left">
<label for="DOPBSP-settings-users-permissions-filters-order-by"><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_FILTERS_ORDER_BY'); ?></label>
<select name="DOPBSP-settings-users-permissions-filters-order-by" id="DOPBSP-settings-users-permissions-filters-order-by" onchange="DOPBSPBackEndSettingsUsers.get(<?php echo $calendar_id; ?>)">
<option value="email"><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_FILTERS_ORDER_BY_EMAIL'); ?></option>
<option value="ID"><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_FILTERS_ORDER_BY_ID'); ?></option>
<option value="login" selected="selected"><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_FILTERS_ORDER_BY_USERNAME'); ?></option>
</select>
<script type="text/JavaScript">jQuery('#DOPBSP-settings-users-permissions-filters-order-by').DOPSelect();</script>
</div>
<!--
Order
-->
<div class="dopbsp-input-wrapper dopbsp-left">
<label for="DOPBSP-settings-users-permissions-filters-order"><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_FILTERS_ORDER'); ?></label>
<select name="DOPBSP-settings-users-permissions-filters-order" id="DOPBSP-settings-users-permissions-filters-order" onchange="DOPBSPBackEndSettingsUsers.get(<?php echo $calendar_id; ?>)">
<option value="ASC"><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_FILTERS_ORDER_ASCENDING'); ?></option>
<option value="DESC"><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_FILTERS_ORDER_DESCENDING'); ?></option>
</select>
<script type="text/JavaScript">jQuery('#DOPBSP-settings-users-permissions-filters-order').DOPSelect();</script>
</div>
<!--
Search by text.
-->
<div class="dopbsp-input-wrapper dopbsp-left">
<label for="DOPBSP-settings-users-permissions-filters-search"><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_FILTERS_SEARCH'); ?></label>
<input type="text" name="DOPBSP-settings-users-permissions-filters-search" id="DOPBSP-settings-users-permissions-filters-search" value="" onkeyup="if ((event.keyCode||event.which) !== 9){DOPBSPBackEndSettingsUsers.get(<?php echo $calendar_id; ?>);}" onpaste="if ((event.keyCode||event.which) != 9){DOPBSPBackEndSettings.getUsers(<?php echo $calendar_id; ?>);}" />
</div>
<!--
Users list.
-->
<table class="dopbsp-users-table">
<colgroup>
<!--<col class="column1" />-->
<col class="dopbsp-column2" />
<col class="dopbsp-column3" />
<col class="dopbsp-column4" />
<col class="dopbsp-column5" />
<col class="dopbsp-column6" />
<?php
if ($calendar_id == 0){
?>
<col class="dopbsp-column7" />
<col class="dopbsp-column8" />
<?php
}
?>
</colgroup>
<thead>
<tr>
<!--<th></th>-->
<th><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_LIST_ID'); ?></th>
<th><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_USERNAME'); ?></th>
<th><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_EMAIL'); ?></th>
<th><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_ROLE'); ?></th>
<?php
if ($calendar_id == 0){
?>
<th><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_VIEW'); ?></th>
<th><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_USE'); ?></th>
<th><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_USE_CUSTOM_POSTS'); ?></th>
<?php
}
else{
?>
<th><?php echo $DOPBSP->text('SETTINGS_USERS_PERMISSIONS_USE_CALENDAR'); ?></th>
<?php
}
?>
</tr>
</thead>
<tbody id="DOPBSP-users-list"></tbody>
</table>
</div>
<?php
}
}
} | {
"content_hash": "754a9c5dcc602df5261cf3c8d43cc729",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 404,
"avg_line_length": 51.90677966101695,
"alnum_prop": 0.4676734693877551,
"repo_name": "keynetic/kpress",
"id": "55e5229e167edf23903529151162dcba7cebace3",
"size": "12727",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "content/plugins/dopbsp/views/settings/views-backend-settings-users.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2375494"
},
{
"name": "HTML",
"bytes": "12275"
},
{
"name": "JavaScript",
"bytes": "5303340"
},
{
"name": "Modelica",
"bytes": "879"
},
{
"name": "PHP",
"bytes": "20662503"
},
{
"name": "Ruby",
"bytes": "6055"
},
{
"name": "Shell",
"bytes": "185"
},
{
"name": "Smarty",
"bytes": "67"
}
],
"symlink_target": ""
} |
/**
*
*/
package com.velocity.model.captureAll.response;
/**
* @author ranjitk
*
*/
public class ArrayOfResponse {
private String status;
private String statusCode;
private String statusMessage;
private String transactionId;
private String originatorTransactionId;
private String serviceTransactionId;
private String serviceTransactionDateTime;
private String addendum;
private String captureState;
private String transactionState;
private boolean isAcknowledged;
private String reference;
private String batchId;
private String industryType;
private String PrepaidCard;
private CashBackTotals cashBackTotals;
private NetTotals netTotals;
private PINDebitReturnTotals pINDebitReturnTotals;
private PINDebitSaleTotals pINDebitSaleTotals;
private ReturnTotals returnTotals;
private SaleTotals saleTotals;
private VoidTotals voidTotals;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatusCode() {
return statusCode;
}
public void setStatusCode(String statusCode) {
this.statusCode = statusCode;
}
public String getStatusMessage() {
return statusMessage;
}
public void setStatusMessage(String statusMessage) {
this.statusMessage = statusMessage;
}
public String getTransactionId() {
return transactionId;
}
public void setTransactionId(String transactionId) {
this.transactionId = transactionId;
}
public String getOriginatorTransactionId() {
return originatorTransactionId;
}
public void setOriginatorTransactionId(String originatorTransactionId) {
this.originatorTransactionId = originatorTransactionId;
}
public String getServiceTransactionId() {
return serviceTransactionId;
}
public void setServiceTransactionId(String serviceTransactionId) {
this.serviceTransactionId = serviceTransactionId;
}
public String getServiceTransactionDateTime() {
return serviceTransactionDateTime;
}
public void setServiceTransactionDateTime(String serviceTransactionDateTime) {
this.serviceTransactionDateTime = serviceTransactionDateTime;
}
public String getAddendum() {
return addendum;
}
public void setAddendum(String addendum) {
this.addendum = addendum;
}
public String getCaptureState() {
return captureState;
}
public void setCaptureState(String captureState) {
this.captureState = captureState;
}
public String getTransactionState() {
return transactionState;
}
public void setTransactionState(String transactionState) {
this.transactionState = transactionState;
}
public boolean isAcknowledged() {
return isAcknowledged;
}
public void setAcknowledged(boolean isAcknowledged) {
this.isAcknowledged = isAcknowledged;
}
public String getBatchId() {
return batchId;
}
public void setBatchId(String batchId) {
this.batchId = batchId;
}
public String getIndustryType() {
return industryType;
}
public void setIndustryType(String industryType) {
this.industryType = industryType;
}
public String getPrepaidCard() {
return PrepaidCard;
}
public void setPrepaidCard(String prepaidCard) {
PrepaidCard = prepaidCard;
}
public CashBackTotals getCashBackTotals() {
if(cashBackTotals == null){
cashBackTotals = new CashBackTotals();
}
return cashBackTotals;
}
public void setCashBackTotals(CashBackTotals cashBackTotals) {
this.cashBackTotals = cashBackTotals;
}
public NetTotals getNetTotals() {
if(netTotals == null){
netTotals = new NetTotals();
}
return netTotals;
}
public void setNetTotals(NetTotals netTotals) {
this.netTotals = netTotals;
}
public PINDebitReturnTotals getpINDebitReturnTotals() {
if(pINDebitReturnTotals == null){
pINDebitReturnTotals = new PINDebitReturnTotals();
}
return pINDebitReturnTotals;
}
public void setpINDebitReturnTotals(PINDebitReturnTotals pINDebitReturnTotals) {
this.pINDebitReturnTotals = pINDebitReturnTotals;
}
public PINDebitSaleTotals getpINDebitSaleTotals() {
if(pINDebitSaleTotals == null){
pINDebitSaleTotals = new PINDebitSaleTotals();
}
return pINDebitSaleTotals;
}
public void setpINDebitSaleTotals(PINDebitSaleTotals pINDebitSaleTotals) {
this.pINDebitSaleTotals = pINDebitSaleTotals;
}
public ReturnTotals getReturnTotals() {
if(returnTotals == null){
returnTotals = new ReturnTotals();
}
return returnTotals;
}
public void setReturnTotals(ReturnTotals returnTotals) {
this.returnTotals = returnTotals;
}
public SaleTotals getSaleTotals() {
if(saleTotals == null){
saleTotals = new SaleTotals();
}
return saleTotals;
}
public void setSaleTotals(SaleTotals saleTotals) {
this.saleTotals = saleTotals;
}
public VoidTotals getVoidTotals() {
if(voidTotals == null){
voidTotals = new VoidTotals();
}
return voidTotals;
}
public void setVoidTotals(VoidTotals voidTotals) {
this.voidTotals = voidTotals;
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
}
| {
"content_hash": "8fcbae6e8491ddebda9e9d8c5dba2619",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 81,
"avg_line_length": 20.05185185185185,
"alnum_prop": 0.7155522718876985,
"repo_name": "nab-velocity/android-sdk",
"id": "bbd4a17643d5a6b12aa24a516e32cea2be842b4c",
"size": "5414",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "VelocityLibrary/src/com/velocity/model/captureAll/response/ArrayOfResponse.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "888677"
}
],
"symlink_target": ""
} |
// Copyright 2013-2022, University of Colorado Boulder
/**
* OF2 Molecule
*
* @author Chris Malley (PixelZoom, Inc.)
*/
import { combineOptions, EmptySelfOptions } from '../../../phet-core/js/optionize.js';
import Element from '../Element.js';
import nitroglycerin from '../nitroglycerin.js';
import AtomNode, { AtomNodeOptions } from './AtomNode.js';
import MoleculeNode, { MoleculeNodeOptions } from './MoleculeNode.js';
type SelfOptions = EmptySelfOptions;
export type OF2NodeOptions = SelfOptions & MoleculeNodeOptions;
export default class OF2Node extends MoleculeNode {
public constructor( providedOptions?: OF2NodeOptions ) {
const atomNodeOptions = providedOptions?.atomNodeOptions;
// atoms
const centerNode = new AtomNode( Element.O, atomNodeOptions );
const leftNode = new AtomNode( Element.F, combineOptions<AtomNodeOptions>( {
centerX: centerNode.left,
centerY: centerNode.centerY + ( 0.25 * centerNode.height )
}, atomNodeOptions ) );
const rightNode = new AtomNode( Element.F, combineOptions<AtomNodeOptions>( {
centerX: centerNode.right,
centerY: centerNode.centerY + ( 0.25 * centerNode.height )
}, atomNodeOptions ) );
const atomNodes = [ leftNode, centerNode, rightNode ];
super( atomNodes, providedOptions );
}
}
nitroglycerin.register( 'OF2Node', OF2Node ); | {
"content_hash": "0d7e8c22d239660c3b3f5544cf17eeb8",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 86,
"avg_line_length": 33.073170731707314,
"alnum_prop": 0.717551622418879,
"repo_name": "phetsims/nitroglycerin",
"id": "c8fcf68a6b81d0af5f566957958ae4784f341124",
"size": "1356",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "js/nodes/OF2Node.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "4296"
},
{
"name": "JavaScript",
"bytes": "165"
},
{
"name": "TypeScript",
"bytes": "67646"
}
],
"symlink_target": ""
} |
package com.regeneration.springboot.servicewebapp.services;
import com.regeneration.springboot.servicewebapp.exceptions.InvalidCredentialsException;
import com.regeneration.springboot.servicewebapp.model.Repair;
import com.regeneration.springboot.servicewebapp.model.User;
import com.regeneration.springboot.servicewebapp.repositories.RepairRepository;
import com.regeneration.springboot.servicewebapp.repositories.UserRepository;
import com.sun.org.apache.regexp.internal.RE;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.AuthenticationException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@Service
@Transactional
public class UserServiceImpl implements UserService {
private final static org.slf4j.Logger LOG = LoggerFactory.getLogger(UserServiceImpl.class);
private Set<String> loggedInUsers = new HashSet<>();
@Autowired
private UserRepository userRepository;
@Override
public User login(String email, String password) throws AuthenticationException {
User retrievedUser = userRepository.findByEmailAndPassword(email, password);
if (retrievedUser == null) {
throw new InvalidCredentialsException("User not found!");
}
loggedInUsers.add(email);
return retrievedUser;
}
@Override
public void logout(String email) {
loggedInUsers.remove(email);
}
@Override
public void register(User user) throws Exception {
userRepository.save(user);
LOG.debug("User has been registered!");
}
@Override
public void update(User user) throws Exception {
userRepository.save(user);
}
@Override
public User findByEmailOrAfm(String input) {
return userRepository.findByEmailOrAfm(input, input);
}
@Override
public List<User> searchAll() {
List<User> users = new ArrayList();
userRepository.findAll().forEach(users::add);
return users;
}
@Override
public void deleteUser(Long id) {
userRepository.delete(id);
}
}
| {
"content_hash": "5e2ee80fac78b9fd83bb1d80bc94e322",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 95,
"avg_line_length": 27.357142857142858,
"alnum_prop": 0.7371627502175805,
"repo_name": "Regeneration-Team-2/webappservice",
"id": "aa5016f3b29af47505c4dd11af2b63feb835151a",
"size": "2298",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "service-web-app/src/main/java/com/regeneration/springboot/servicewebapp/services/UserServiceImpl.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "4994"
},
{
"name": "CSS",
"bytes": "1805"
},
{
"name": "FreeMarker",
"bytes": "43673"
},
{
"name": "Java",
"bytes": "48267"
},
{
"name": "Shell",
"bytes": "6468"
}
],
"symlink_target": ""
} |
"""This file contains some utilities used for processing tweet data and writing
data to BigQuery
"""
import collections
import datetime
import time
from apiclient import discovery
import dateutil.parser
import httplib2
from oauth2client.client import GoogleCredentials
SCOPES = ['https://www.googleapis.com/auth/pubsub']
def get_credentials():
"""Get the Google credentials needed to access our services."""
credentials = GoogleCredentials.get_application_default()
if credentials.create_scoped_required():
credentials = credentials.create_scoped(SCOPES)
return credentials
def create_pubsub_client(credentials):
"""Build the pubsub client."""
http = httplib2.Http()
credentials.authorize(http)
return discovery.build('pubsub', 'v1beta2', http=http)
def flatten(lst):
"""Helper function used to massage the raw tweet data."""
for el in lst:
if (isinstance(el, collections.Iterable) and
not isinstance(el, basestring)):
for sub in flatten(el):
yield sub
else:
yield el
| {
"content_hash": "f61055b7b3a89c7be783b89ce6d0fcb4",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 79,
"avg_line_length": 28.92105263157895,
"alnum_prop": 0.6942675159235668,
"repo_name": "LorenzoRidiNoovle/gcp-black-friday-analytics",
"id": "19f5d67666f3ab097e4ba147dc2b36632b566b62",
"size": "1719",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "k8s-twitter-to-pubsub/utils.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "57951"
},
{
"name": "Python",
"bytes": "5091"
},
{
"name": "Shell",
"bytes": "1286"
}
],
"symlink_target": ""
} |
<?php
namespace Crossknowledge\OrderManagementBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
class DetailCommandeType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder
// ->add('type', 'choice', array('label' => 'Type', 'read_only' => true,
// 'choices' => array( 'DA' => 'Demande d\'achat',
// 'OA' => 'Ordre d\'achat'
// )))
->add('BU','choice', array('label' => 'detailcommande.service','empty_value' => 'Sélectionnez votre service',
'choices' => array( 'BU FR 1' => 'BU FR 1',
'BU FR 2' => 'BU FR 2',
'BU ESMB' => 'BU ESMB',
'Admin' => 'Administration',
'Marketing' => 'Marketing',
'Solutions' => 'Solutions',
'Opérations France' => 'Opérations France'
)))
->add('designation', 'text', array('label' => 'detailcommande.designation'))
->add('lettrage', 'checkbox',array('label' => 'detailcommande.lettering', 'required' => false))
->add('quantite','integer', array('label' => 'detailcommande.quantite'))
->add('dateLivraison', 'date',array('label' => 'detailcommande.datelivraison',
'widget' => 'single_text',
'input' => 'datetime',
'format' => 'dd/MM/yyyy',
'attr' => array('class' => 'date')))
->add('remarque', 'textarea', array('label' => 'detailcommande.remarque', 'required' => false))
->add('accordBUM', 'checkbox', array('label' => 'detailcommande.accord', 'required' => false))
->add('prixHT', 'number', array('label' => 'detailcommande.prixht', 'required' => false))
->add('tva', 'number', array('label' => 'detailcommande.tva', 'precision' => '1'))
->add('prixTTC', 'hidden', array('label' => 'detailcommande.prixttc'))
->add('article', 'entity', array('class' => 'CrossknowledgeOrderManagementBundle:Article', 'label' => 'detailcommande.article','empty_value' => 'Sélectionnez un article', 'empty_data' => null, 'property' => 'typeArticle'))
->add('assignedTo', 'entity', array('class' => 'CrossknowledgeUserBundle:Utilisateur', 'label' => 'detailcommande.assignedto', 'empty_value' => 'Sélectionnez votre manager'))
->add('client', 'text', array('label' => 'detailcommande.client'))
;
}
public function getName()
{
return 'crossknowledge_ordermanagementbundle_detailcommandetype';
}
public function getDefaultOptions(array $options)
{
return array(
'data_class' => 'Crossknowledge\OrderManagementBundle\Entity\DetailCommande',
);
}
}
| {
"content_hash": "874522978de3b1716f56808108852f9e",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 235,
"avg_line_length": 56.767857142857146,
"alnum_prop": 0.5033029254482542,
"repo_name": "alexandrechouraqui/Achats",
"id": "1cb4ecd949a2d03e36c4d115dfc79e66adb40642",
"size": "3184",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Crossknowledge/OrderManagementBundle/Form/DetailCommandeType.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "293015"
},
{
"name": "PHP",
"bytes": "120935"
}
],
"symlink_target": ""
} |
namespace Server.Engines.Reports
{
using System;
using System.Collections;
/// <summary>
/// Strongly typed collection of Server.Engines.Reports.PersistableObject.
/// </summary>
public class ObjectCollection : System.Collections.CollectionBase
{
/// <summary>
/// Default constructor.
/// </summary>
public ObjectCollection() :
base()
{
}
/// <summary>
/// Gets or sets the value of the Server.Engines.Reports.PersistableObject at a specific position in the ObjectCollection.
/// </summary>
public Server.Engines.Reports.PersistableObject this[int index]
{
get
{
return ((Server.Engines.Reports.PersistableObject)(this.List[index]));
}
set
{
this.List[index] = value;
}
}
/// <summary>
/// Append a Server.Engines.Reports.PersistableObject entry to this collection.
/// </summary>
/// <param name="value">Server.Engines.Reports.PersistableObject instance.</param>
/// <returns>The position into which the new element was inserted.</returns>
public int Add(Server.Engines.Reports.PersistableObject value)
{
return this.List.Add(value);
}
public void AddRange( PersistableObject[] col )
{
this.InnerList.AddRange( col );
}
/// <summary>
/// Determines whether a specified Server.Engines.Reports.PersistableObject instance is in this collection.
/// </summary>
/// <param name="value">Server.Engines.Reports.PersistableObject instance to search for.</param>
/// <returns>True if the Server.Engines.Reports.PersistableObject instance is in the collection; otherwise false.</returns>
public bool Contains(Server.Engines.Reports.PersistableObject value)
{
return this.List.Contains(value);
}
/// <summary>
/// Retrieve the index a specified Server.Engines.Reports.PersistableObject instance is in this collection.
/// </summary>
/// <param name="value">Server.Engines.Reports.PersistableObject instance to find.</param>
/// <returns>The zero-based index of the specified Server.Engines.Reports.PersistableObject instance. If the object is not found, the return value is -1.</returns>
public int IndexOf(Server.Engines.Reports.PersistableObject value)
{
return this.List.IndexOf(value);
}
/// <summary>
/// Removes a specified Server.Engines.Reports.PersistableObject instance from this collection.
/// </summary>
/// <param name="value">The Server.Engines.Reports.PersistableObject instance to remove.</param>
public void Remove(Server.Engines.Reports.PersistableObject value)
{
this.List.Remove(value);
}
/// <summary>
/// Returns an enumerator that can iterate through the Server.Engines.Reports.PersistableObject instance.
/// </summary>
/// <returns>An Server.Engines.Reports.PersistableObject's enumerator.</returns>
public new ObjectCollectionEnumerator GetEnumerator()
{
return new ObjectCollectionEnumerator(this);
}
/// <summary>
/// Insert a Server.Engines.Reports.PersistableObject instance into this collection at a specified index.
/// </summary>
/// <param name="index">Zero-based index.</param>
/// <param name="value">The Server.Engines.Reports.PersistableObject instance to insert.</param>
public void Insert(int index, Server.Engines.Reports.PersistableObject value)
{
this.List.Insert(index, value);
}
/// <summary>
/// Strongly typed enumerator of Server.Engines.Reports.PersistableObject.
/// </summary>
public class ObjectCollectionEnumerator : System.Collections.IEnumerator
{
/// <summary>
/// Current index
/// </summary>
private int _index;
/// <summary>
/// Current element pointed to.
/// </summary>
private Server.Engines.Reports.PersistableObject _currentElement;
/// <summary>
/// Collection to enumerate.
/// </summary>
private ObjectCollection _collection;
/// <summary>
/// Default constructor for enumerator.
/// </summary>
/// <param name="collection">Instance of the collection to enumerate.</param>
internal ObjectCollectionEnumerator(ObjectCollection collection)
{
_index = -1;
_collection = collection;
}
/// <summary>
/// Gets the Server.Engines.Reports.PersistableObject object in the enumerated ObjectCollection currently indexed by this instance.
/// </summary>
public Server.Engines.Reports.PersistableObject Current
{
get
{
if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
else
{
return _currentElement;
}
}
}
/// <summary>
/// Gets the current element in the collection.
/// </summary>
object IEnumerator.Current
{
get
{
if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
else
{
return _currentElement;
}
}
}
/// <summary>
/// Reset the cursor, so it points to the beginning of the enumerator.
/// </summary>
public void Reset()
{
_index = -1;
_currentElement = null;
}
/// <summary>
/// Advances the enumerator to the next queue of the enumeration, if one is currently available.
/// </summary>
/// <returns>true, if the enumerator was succesfully advanced to the next queue; false, if the enumerator has reached the end of the enumeration.</returns>
public bool MoveNext()
{
if ((_index
< (_collection.Count - 1)))
{
_index = (_index + 1);
_currentElement = this._collection[_index];
return true;
}
_index = _collection.Count;
return false;
}
}
}
}
| {
"content_hash": "f4183f8a6f3dcab2b6761ec7e4681bdd",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 171,
"avg_line_length": 37.702564102564104,
"alnum_prop": 0.5225788900979326,
"repo_name": "ggobbe/vivre-uo",
"id": "8dfed35ac0d9b0bf4befce7647e1e33e3fc1a7f8",
"size": "7746",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "Scripts/Engines/Reports/Persistance/PersistableObjectCollection.cs",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C#",
"bytes": "19852349"
},
{
"name": "CSS",
"bytes": "699"
},
{
"name": "HTML",
"bytes": "3008"
}
],
"symlink_target": ""
} |
ActiveRecord::Schema.define(:version => 20150220170740) do
create_table "conversations", :force => true do |t|
t.string "state_machine"
t.string "subject"
t.boolean "closed"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "people", :force => true do |t|
t.string "name"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
end
| {
"content_hash": "f165b14b45020fa819c6974d732809cc",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 58,
"avg_line_length": 27.235294117647058,
"alnum_prop": 0.6198704103671706,
"repo_name": "chrisortman/acts_as_state_machine",
"id": "bc2420edc937c5e1aeb23495eec311338a37a859",
"size": "1198",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/dummy/db/schema.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "546"
},
{
"name": "HTML",
"bytes": "2314"
},
{
"name": "JavaScript",
"bytes": "641"
},
{
"name": "Ruby",
"bytes": "37607"
}
],
"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 Thu Jun 08 16:50:42 EEST 2017 -->
<title>Uses of Interface com.teamdev.jxbrowser.chromium.DownloadHandler (JxBrowser 6.14.1 API)</title>
<meta name="date" content="2017-06-08">
<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 Interface com.teamdev.jxbrowser.chromium.DownloadHandler (JxBrowser 6.14.1 API)";
}
}
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><a href="../../../../../com/teamdev/jxbrowser/chromium/DownloadHandler.html" title="interface in com.teamdev.jxbrowser.chromium">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../overview-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>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/teamdev/jxbrowser/chromium/class-use/DownloadHandler.html" target="_top">Frames</a></li>
<li><a href="DownloadHandler.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Interface com.teamdev.jxbrowser.chromium.DownloadHandler" class="title">Uses of Interface<br>com.teamdev.jxbrowser.chromium.DownloadHandler</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../com/teamdev/jxbrowser/chromium/DownloadHandler.html" title="interface in com.teamdev.jxbrowser.chromium">DownloadHandler</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#com.teamdev.jxbrowser.chromium">com.teamdev.jxbrowser.chromium</a></td>
<td class="colLast">
<div class="block">Contains the basic classes and interfaces.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#com.teamdev.jxbrowser.chromium.javafx">com.teamdev.jxbrowser.chromium.javafx</a></td>
<td class="colLast">
<div class="block">Contains the classes and interfaces for embedding Browser instance into JavaFX application.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="com.teamdev.jxbrowser.chromium">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../com/teamdev/jxbrowser/chromium/DownloadHandler.html" title="interface in com.teamdev.jxbrowser.chromium">DownloadHandler</a> in <a href="../../../../../com/teamdev/jxbrowser/chromium/package-summary.html">com.teamdev.jxbrowser.chromium</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../com/teamdev/jxbrowser/chromium/package-summary.html">com.teamdev.jxbrowser.chromium</a> that return <a href="../../../../../com/teamdev/jxbrowser/chromium/DownloadHandler.html" title="interface in com.teamdev.jxbrowser.chromium">DownloadHandler</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/teamdev/jxbrowser/chromium/DownloadHandler.html" title="interface in com.teamdev.jxbrowser.chromium">DownloadHandler</a></code></td>
<td class="colLast"><span class="typeNameLabel">Browser.</span><code><span class="memberNameLink"><a href="../../../../../com/teamdev/jxbrowser/chromium/Browser.html#getDownloadHandler--">getDownloadHandler</a></span>()</code>
<div class="block">Returns registered file download handler or <code>null</code> if no
file download handler is currently registered.</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../com/teamdev/jxbrowser/chromium/package-summary.html">com.teamdev.jxbrowser.chromium</a> with parameters of type <a href="../../../../../com/teamdev/jxbrowser/chromium/DownloadHandler.html" title="interface in com.teamdev.jxbrowser.chromium">DownloadHandler</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="typeNameLabel">Browser.</span><code><span class="memberNameLink"><a href="../../../../../com/teamdev/jxbrowser/chromium/Browser.html#setDownloadHandler-com.teamdev.jxbrowser.chromium.DownloadHandler-">setDownloadHandler</a></span>(<a href="../../../../../com/teamdev/jxbrowser/chromium/DownloadHandler.html" title="interface in com.teamdev.jxbrowser.chromium">DownloadHandler</a> handler)</code>
<div class="block">Sets the file download handler that will be invoked every time the Browser
downloads a file.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="com.teamdev.jxbrowser.chromium.javafx">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../com/teamdev/jxbrowser/chromium/DownloadHandler.html" title="interface in com.teamdev.jxbrowser.chromium">DownloadHandler</a> in <a href="../../../../../com/teamdev/jxbrowser/chromium/javafx/package-summary.html">com.teamdev.jxbrowser.chromium.javafx</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../com/teamdev/jxbrowser/chromium/javafx/package-summary.html">com.teamdev.jxbrowser.chromium.javafx</a> that implement <a href="../../../../../com/teamdev/jxbrowser/chromium/DownloadHandler.html" title="interface in com.teamdev.jxbrowser.chromium">DownloadHandler</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/teamdev/jxbrowser/chromium/javafx/DefaultDownloadHandler.html" title="class in com.teamdev.jxbrowser.chromium.javafx">DefaultDownloadHandler</a></span></code>
<div class="block">Represents default implementation of the
<a href="../../../../../com/teamdev/jxbrowser/chromium/DownloadHandler.html" title="interface in com.teamdev.jxbrowser.chromium"><code>DownloadHandler</code></a> that will
display file save dialog where user can select the destination file.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</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><a href="../../../../../com/teamdev/jxbrowser/chromium/DownloadHandler.html" title="interface in com.teamdev.jxbrowser.chromium">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../overview-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>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/teamdev/jxbrowser/chromium/class-use/DownloadHandler.html" target="_top">Frames</a></li>
<li><a href="DownloadHandler.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": "54e41414a6625b577d7df2d952fdbfd9",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 433,
"avg_line_length": 48.70422535211268,
"alnum_prop": 0.6585695006747638,
"repo_name": "andrasigneczi/TravelOptimizer",
"id": "e17a7256b6ecdcf2d1de88a9a7b05d2ee4817366",
"size": "10374",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/jxbrowser/javadoc/com/teamdev/jxbrowser/chromium/class-use/DownloadHandler.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "3443874"
},
{
"name": "C++",
"bytes": "33624518"
},
{
"name": "CSS",
"bytes": "1225"
},
{
"name": "HTML",
"bytes": "13117"
},
{
"name": "IDL",
"bytes": "1110940"
},
{
"name": "Java",
"bytes": "562163"
},
{
"name": "JavaScript",
"bytes": "1480"
},
{
"name": "Makefile",
"bytes": "360"
},
{
"name": "Objective-C",
"bytes": "3166"
},
{
"name": "Python",
"bytes": "322743"
},
{
"name": "Shell",
"bytes": "2539"
}
],
"symlink_target": ""
} |
#include "stdlib/math/base/special/sqrt.h"
#include <math.h>
/**
* Computes the principal square root of a double-precision floating-point number.
*
* @param x number
* @return principal square root
*
* @example
* double y = stdlib_base_sqrt( 9.0 );
* // returns 3.0
*/
double stdlib_base_sqrt( const double x ) {
return sqrt( x );
}
| {
"content_hash": "201c357a14a80d32fb7337f25fc4fe34",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 81,
"avg_line_length": 19.5,
"alnum_prop": 0.6581196581196581,
"repo_name": "stdlib-js/stdlib",
"id": "9a3a365b893ecbfdfc96b0d82a3ca6e746a3f038",
"size": "967",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "lib/node_modules/@stdlib/math/base/special/sqrt/src/sqrt.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "21739"
},
{
"name": "C",
"bytes": "15336495"
},
{
"name": "C++",
"bytes": "1349482"
},
{
"name": "CSS",
"bytes": "58039"
},
{
"name": "Fortran",
"bytes": "198059"
},
{
"name": "HTML",
"bytes": "56181"
},
{
"name": "Handlebars",
"bytes": "16114"
},
{
"name": "JavaScript",
"bytes": "85975525"
},
{
"name": "Julia",
"bytes": "1508654"
},
{
"name": "Makefile",
"bytes": "4806816"
},
{
"name": "Python",
"bytes": "3343697"
},
{
"name": "R",
"bytes": "576612"
},
{
"name": "Shell",
"bytes": "559315"
},
{
"name": "TypeScript",
"bytes": "19309407"
},
{
"name": "WebAssembly",
"bytes": "5980"
}
],
"symlink_target": ""
} |
(async function() {
TestRunner.addResult(`Tests that the content of resources with JSON MIME types can be accessed.`);
TestRunner.addResult('When loaded by asynchronous XHR requests (Bug 80684) or within iframes/documents.\n');
await TestRunner.loadTestModule('network_test_runner');
await TestRunner.loadLegacyModule('console'); await TestRunner.loadTestModule('console_test_runner');
await TestRunner.showPanel('network');
NetworkTestRunner.recordNetwork();
function lastRequest() {
return NetworkTestRunner.networkRequests().pop();
}
function reportRequest(request) {
TestRunner.addResult('request.url: ' + request.url());
TestRunner.addResult('request.type: ' + request.resourceType());
TestRunner.addResult('request.mimeType: ' + request.mimeType);
}
function testType(contentType, callback) {
var encodedContentType = encodeURIComponent(contentType);
function step2() {
var request = lastRequest();
reportRequest(request);
request.requestContent().then(step3);
}
function step3({ content, error, isEncoded }) {
TestRunner.addResult('request.content: ' + content);
TestRunner.addIframe('resources/json.php?type=' + encodedContentType).then(step4);
}
function step4() {
var request = lastRequest();
reportRequest(request);
request.requestContent().then(step5);
}
function step5({ content, error, isEncoded }) {
TestRunner.addResult('request.content: ' + content);
callback();
}
NetworkTestRunner.makeSimpleXHR('GET', 'resources/json.php?type=' + encodedContentType, true, step2);
}
TestRunner.runTestSuite([
function test1(next) {
testType('application/json', next);
},
function test2(next) {
testType('application/vnd.document+json', next);
}
]);
})();
| {
"content_hash": "da7b112d5c36b56014f93af2f8caa313",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 110,
"avg_line_length": 32.29824561403509,
"alnum_prop": 0.690385659967409,
"repo_name": "chromium/chromium",
"id": "3d7a42a68fa623a50bc0c5e255d1ba35a2dc9870",
"size": "1985",
"binary": false,
"copies": "6",
"ref": "refs/heads/main",
"path": "third_party/blink/web_tests/http/tests/devtools/network/async-xhr-json-mime-type.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
package org.geogit.api;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.geogit.api.RevObject.TYPE;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import com.google.common.base.Optional;
public class NodeTest {
@Rule
public ExpectedException exception = ExpectedException.none();
@Test
public void testNodeAccessorsAndConstructors() {
ObjectId oid = ObjectId.forString("Points stuff");
Node node = Node.create("Points", oid, ObjectId.NULL, TYPE.TREE);
assertEquals(node.getMetadataId(), Optional.absent());
assertEquals(node.getName(), "Points");
assertEquals(node.getObjectId(), oid);
assertEquals(node.getType(), TYPE.TREE);
}
@Test
public void testIsEqual() {
Node node = Node.create("Points.1", ObjectId.forString("Points stuff"), ObjectId.NULL,
TYPE.FEATURE);
Node node2 = Node.create("Lines.1", ObjectId.forString("Lines stuff"), ObjectId.NULL,
TYPE.FEATURE);
Node node3 = Node.create("Lines.1", ObjectId.forString("Lines stuff"),
ObjectId.forString("Lines Stuff"), TYPE.TREE);
assertFalse(node.equals("NotANode"));
assertFalse(node.equals(node2));
assertFalse(node2.equals(node3));
assertTrue(node.equals(node));
}
@Test
public void testToString() {
Node node = Node.create("Points.1", ObjectId.forString("Points stuff"), ObjectId.NULL,
TYPE.FEATURE);
String readableNode = node.toString();
String expected = "FeatureNode[Points.1 -> " + node.getObjectId() + "]";
assertEquals(expected, readableNode.toString());
}
@Test
public void testCompareTo() {
Node node = Node.create("Points.1", ObjectId.forString("Points stuff"), ObjectId.NULL,
TYPE.FEATURE);
Node node2 = Node.create("Lines.1", ObjectId.forString("Lines stuff"), ObjectId.NULL,
TYPE.FEATURE);
assertTrue(node.compareTo(node2) > 0);
assertTrue(node2.compareTo(node) < 0);
assertTrue(node.compareTo(node) == 0);
}
}
| {
"content_hash": "88655437f85eac9508b729acdffde2a7",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 94,
"avg_line_length": 34.723076923076924,
"alnum_prop": 0.6464333185644661,
"repo_name": "state-hiu/GeoGit",
"id": "1ff14317acb5f9693f6563af449aef780bcaefe1",
"size": "2414",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/core/src/test/java/org/geogit/api/NodeTest.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
require 'tiny_tds'
require 'date'
#Connect to your database.
#Replace server name, username, and password with your credentials
client = TinyTds::Client.new username: 'username@servername', password: 'password',
host: 'servername.database.windows.net', port: 1433,
database: 'AdventureWorks', azure:true
#SELECT
#Execute a simple select statement.
results = client.execute("SELECT TOP 10 Title, FirstName, LastName from SalesLT.Customer")
#Print results of select.
results.each do |row|
puts row
end
#INSERT
#Make sure you have followed the recommended settings for using TinyTDS with Azure
results = client.execute("SET ANSI_NULLS ON")
results = client.execute("SET CURSOR_CLOSE_ON_COMMIT OFF")
results = client.execute("SET ANSI_NULL_DFLT_ON ON")
results = client.execute("SET IMPLICIT_TRANSACTIONS OFF")
results = client.execute("SET ANSI_PADDING ON")
results = client.execute("SET QUOTED_IDENTIFIER ON")
results = client.execute("SET ANSI_WARNINGS ON")
results = client.execute("SET CONCAT_NULL_YIELDS_NULL ON")
#Configure date format to align with SQL Server datetime format
t = Time.now
curr_date = t.strftime("%Y-%m-%d %H:%M:%S.%L")
#Execute an insert statement
results = client.execute("INSERT SalesLT.Product (Name, ProductNumber, StandardCost, ListPrice, SellStartDate)
OUTPUT INSERTED.ProductID VALUES ('SQL Server Express New', 'SQLEXPRESS New', 0, 0, '#{curr_date}' )")
#Print the ID of the inserted row.
results.each do |row|
puts row
end
| {
"content_hash": "410ae4b49a31fc4d91eb8b7217599400",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 110,
"avg_line_length": 35.829268292682926,
"alnum_prop": 0.7556160653505786,
"repo_name": "Azure/azure-sql-database-samples",
"id": "d2d806d049964204af3e80f001f4c7660fcce7e0",
"size": "1495",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "ruby/windows/sample_ruby_win.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "2204"
},
{
"name": "CSS",
"bytes": "9583"
},
{
"name": "CoffeeScript",
"bytes": "422"
},
{
"name": "HTML",
"bytes": "33011"
},
{
"name": "Java",
"bytes": "2481"
},
{
"name": "JavaScript",
"bytes": "38911"
},
{
"name": "PHP",
"bytes": "6466"
},
{
"name": "PLSQL",
"bytes": "19065"
},
{
"name": "Python",
"bytes": "155766"
},
{
"name": "Ruby",
"bytes": "55411"
}
],
"symlink_target": ""
} |
vtk_module(vtkFiltersCosmo
DEPENDS
vtkCommonExecutionModel
vtkParallelCore
vtkCosmo
)
| {
"content_hash": "6adcd75cde7fa2c138aea48dfe9e57f1",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 27,
"avg_line_length": 17,
"alnum_prop": 0.7549019607843137,
"repo_name": "aashish24/VTK-old",
"id": "426d619c933132ae3342fb3b06e4ac451727555e",
"size": "102",
"binary": false,
"copies": "2",
"ref": "refs/heads/cvshead",
"path": "Filters/Cosmo/module.cmake",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "37780"
},
{
"name": "C",
"bytes": "29104777"
},
{
"name": "C++",
"bytes": "44530249"
},
{
"name": "Java",
"bytes": "89326"
},
{
"name": "Objective-C",
"bytes": "907576"
},
{
"name": "Perl",
"bytes": "175758"
},
{
"name": "Prolog",
"bytes": "340"
},
{
"name": "Python",
"bytes": "923074"
},
{
"name": "Shell",
"bytes": "3723"
},
{
"name": "Tcl",
"bytes": "1875947"
}
],
"symlink_target": ""
} |
import Component from '@ember/component';
import { computed } from '@ember/object';
import FormMixin from 'open-event-frontend/mixins/form';
import { sumBy } from 'lodash';
export default Component.extend(FormMixin, {
tickets: computed('data.tickets', function() {
return this.get('data.tickets').sortBy('position');
}),
total: computed('data.tickets', 'data.tickets.@each.attendees', function() {
return sumBy(this.get('data.tickets').toArray(),
ticket => (ticket.getWithDefault('price', 0) - ticket.getWithDefault('discount', 0)) * ticket.getWithDefault('attendees.length', 0)
);
}),
async didInsertElement() {
let discountCode = await this.get('data.discountCode');
let tickets = await this.get('data.tickets');
tickets.forEach(ticket => {
ticket.set('discount', 0);
});
if (discountCode) {
let discountCodeTickets = await discountCode.get('tickets');
let discountType = discountCode.get('type');
let discountValue = discountCode.get('value');
tickets.forEach(ticket => {
if (discountCodeTickets.includes(ticket)) {
let ticketPrice = ticket.get('price');
if (discountType === 'amount') {
ticket.set('discount', Math.min(ticketPrice, discountValue));
} else {
ticket.set('discount', ticketPrice * (discountValue / 100));
}
}
});
}
}
});
| {
"content_hash": "2ef9035339afcafe946e5ae71083a943",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 137,
"avg_line_length": 36.205128205128204,
"alnum_prop": 0.6331444759206799,
"repo_name": "ritikamotwani/open-event-frontend",
"id": "09bf4f7478fdb599005771d2ddd07c1253ab383a",
"size": "1412",
"binary": false,
"copies": "1",
"ref": "refs/heads/development",
"path": "app/components/orders/order-summary.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "35008"
},
{
"name": "Dockerfile",
"bytes": "643"
},
{
"name": "HTML",
"bytes": "392265"
},
{
"name": "JavaScript",
"bytes": "727448"
},
{
"name": "Shell",
"bytes": "3008"
}
],
"symlink_target": ""
} |
/* CFLocale.h
Copyright (c) 2002-2014, Apple Inc. All rights reserved.
*/
#if !defined(__COREFOUNDATION_CFLOCALE__)
#define __COREFOUNDATION_CFLOCALE__ 1
#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFArray.h>
#include <CoreFoundation/CFDictionary.h>
CF_IMPLICIT_BRIDGING_ENABLED
CF_EXTERN_C_BEGIN
typedef const struct CF_BRIDGED_TYPE(NSLocale) __CFLocale *CFLocaleRef;
CF_EXPORT
CFTypeID CFLocaleGetTypeID(void);
CF_EXPORT
CFLocaleRef CFLocaleGetSystem(void);
// Returns the "root", canonical locale. Contains fixed "backstop" settings.
CF_EXPORT
CFLocaleRef CFLocaleCopyCurrent(void);
// Returns the logical "user" locale for the current user.
// [This is Copy in the sense that you get a retain you have to release,
// but we may return the same cached object over and over.] Settings
// you get from this locale do not change under you as CFPreferences
// are changed (for safety and correctness). Generally you would not
// grab this and hold onto it forever, but use it to do the operations
// you need to do at the moment, then throw it away. (The non-changing
// ensures that all the results of your operations are consistent.)
CF_EXPORT
CFArrayRef CFLocaleCopyAvailableLocaleIdentifiers(void);
// Returns an array of CFStrings that represents all locales for
// which locale data is available.
CF_EXPORT
CFArrayRef CFLocaleCopyISOLanguageCodes(void);
// Returns an array of CFStrings that represents all known legal ISO
// language codes. Note: many of these will not have any supporting
// locale data in Mac OS X.
CF_EXPORT
CFArrayRef CFLocaleCopyISOCountryCodes(void);
// Returns an array of CFStrings that represents all known legal ISO
// country codes. Note: many of these will not have any supporting
// locale data in Mac OS X.
CF_EXPORT
CFArrayRef CFLocaleCopyISOCurrencyCodes(void);
// Returns an array of CFStrings that represents all known legal ISO
// currency codes. Note: some of these currencies may be obsolete, or
// represent other financial instruments.
CF_EXPORT
CFArrayRef CFLocaleCopyCommonISOCurrencyCodes(void) CF_AVAILABLE(10_5, 2_0);
// Returns an array of CFStrings that represents ISO currency codes for
// currencies in common use.
CF_EXPORT
CFArrayRef CFLocaleCopyPreferredLanguages(void) CF_AVAILABLE(10_5, 2_0);
// Returns the array of canonicalized CFString locale IDs that the user prefers.
CF_EXPORT
CFStringRef CFLocaleCreateCanonicalLanguageIdentifierFromString(CFAllocatorRef allocator, CFStringRef localeIdentifier);
// Map an arbitrary language identification string (something close at
// least) to a canonical language identifier.
CF_EXPORT
CFStringRef CFLocaleCreateCanonicalLocaleIdentifierFromString(CFAllocatorRef allocator, CFStringRef localeIdentifier);
// Map an arbitrary locale identification string (something close at
// least) to the canonical identifier.
CF_EXPORT
CFStringRef CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(CFAllocatorRef allocator, LangCode lcode, RegionCode rcode);
// Map a Mac OS LangCode and RegionCode to the canonical locale identifier.
CF_EXPORT
CFStringRef CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(CFAllocatorRef allocator, uint32_t lcid) CF_AVAILABLE(10_6, 4_0);
// Map a Windows LCID to the canonical locale identifier.
CF_EXPORT
uint32_t CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(CFStringRef localeIdentifier) CF_AVAILABLE(10_6, 4_0);
// Map a locale identifier to a Windows LCID.
typedef CF_ENUM(CFIndex, CFLocaleLanguageDirection) {
kCFLocaleLanguageDirectionUnknown = 0,
kCFLocaleLanguageDirectionLeftToRight = 1,
kCFLocaleLanguageDirectionRightToLeft = 2,
kCFLocaleLanguageDirectionTopToBottom = 3,
kCFLocaleLanguageDirectionBottomToTop = 4
};
CF_EXPORT
CFLocaleLanguageDirection CFLocaleGetLanguageCharacterDirection(CFStringRef isoLangCode) CF_AVAILABLE(10_6, 4_0);
CF_EXPORT
CFLocaleLanguageDirection CFLocaleGetLanguageLineDirection(CFStringRef isoLangCode) CF_AVAILABLE(10_6, 4_0);
CF_EXPORT
CFDictionaryRef CFLocaleCreateComponentsFromLocaleIdentifier(CFAllocatorRef allocator, CFStringRef localeID);
// Parses a locale ID consisting of language, script, country, variant,
// and keyword/value pairs into a dictionary. The keys are the constant
// CFStrings corresponding to the locale ID components, and the values
// will correspond to constants where available.
// Example: "en_US@calendar=japanese" yields a dictionary with three
// entries: kCFLocaleLanguageCode=en, kCFLocaleCountryCode=US, and
// kCFLocaleCalendarIdentifier=kCFJapaneseCalendar.
CF_EXPORT
CFStringRef CFLocaleCreateLocaleIdentifierFromComponents(CFAllocatorRef allocator, CFDictionaryRef dictionary);
// Reverses the actions of CFLocaleCreateDictionaryFromLocaleIdentifier,
// creating a single string from the data in the dictionary. The
// dictionary {kCFLocaleLanguageCode=en, kCFLocaleCountryCode=US,
// kCFLocaleCalendarIdentifier=kCFJapaneseCalendar} becomes
// "en_US@calendar=japanese".
CF_EXPORT
CFLocaleRef CFLocaleCreate(CFAllocatorRef allocator, CFStringRef localeIdentifier);
// Returns a CFLocaleRef for the locale named by the "arbitrary" locale identifier.
CF_EXPORT
CFLocaleRef CFLocaleCreateCopy(CFAllocatorRef allocator, CFLocaleRef locale);
// Having gotten a CFLocale from somebody, code should make a copy
// if it is going to use it for several operations
// or hold onto it. In the future, there may be mutable locales.
CF_EXPORT
CFStringRef CFLocaleGetIdentifier(CFLocaleRef locale);
// Returns the locale's identifier. This may not be the same string
// that the locale was created with (CFLocale may canonicalize it).
CF_EXPORT
CFTypeRef CFLocaleGetValue(CFLocaleRef locale, CFStringRef key);
// Returns the value for the given key. This is how settings and state
// are accessed via a CFLocale. Values might be of any CF type.
CF_EXPORT
CFStringRef CFLocaleCopyDisplayNameForPropertyValue(CFLocaleRef displayLocale, CFStringRef key, CFStringRef value);
// Returns the display name for the given value. The key tells what
// the value is, and is one of the usual locale property keys, though
// not all locale property keys have values with display name values.
CF_EXPORT const CFStringRef kCFLocaleCurrentLocaleDidChangeNotification CF_AVAILABLE(10_5, 2_0);
// Locale Keys
CF_EXPORT const CFStringRef kCFLocaleIdentifier;
CF_EXPORT const CFStringRef kCFLocaleLanguageCode;
CF_EXPORT const CFStringRef kCFLocaleCountryCode;
CF_EXPORT const CFStringRef kCFLocaleScriptCode;
CF_EXPORT const CFStringRef kCFLocaleVariantCode;
CF_EXPORT const CFStringRef kCFLocaleExemplarCharacterSet;
CF_EXPORT const CFStringRef kCFLocaleCalendarIdentifier;
CF_EXPORT const CFStringRef kCFLocaleCalendar;
CF_EXPORT const CFStringRef kCFLocaleCollationIdentifier;
CF_EXPORT const CFStringRef kCFLocaleUsesMetricSystem;
CF_EXPORT const CFStringRef kCFLocaleMeasurementSystem; // "Metric" or "U.S."
CF_EXPORT const CFStringRef kCFLocaleDecimalSeparator;
CF_EXPORT const CFStringRef kCFLocaleGroupingSeparator;
CF_EXPORT const CFStringRef kCFLocaleCurrencySymbol;
CF_EXPORT const CFStringRef kCFLocaleCurrencyCode; // ISO 3-letter currency code
CF_EXPORT const CFStringRef kCFLocaleCollatorIdentifier CF_AVAILABLE(10_6, 4_0);
CF_EXPORT const CFStringRef kCFLocaleQuotationBeginDelimiterKey CF_AVAILABLE(10_6, 4_0);
CF_EXPORT const CFStringRef kCFLocaleQuotationEndDelimiterKey CF_AVAILABLE(10_6, 4_0);
CF_EXPORT const CFStringRef kCFLocaleAlternateQuotationBeginDelimiterKey CF_AVAILABLE(10_6, 4_0);
CF_EXPORT const CFStringRef kCFLocaleAlternateQuotationEndDelimiterKey CF_AVAILABLE(10_6, 4_0);
// Values for kCFLocaleCalendarIdentifier
CF_EXPORT const CFStringRef kCFGregorianCalendar;
CF_EXPORT const CFStringRef kCFBuddhistCalendar;
CF_EXPORT const CFStringRef kCFChineseCalendar;
CF_EXPORT const CFStringRef kCFHebrewCalendar;
CF_EXPORT const CFStringRef kCFIslamicCalendar;
CF_EXPORT const CFStringRef kCFIslamicCivilCalendar;
CF_EXPORT const CFStringRef kCFJapaneseCalendar;
CF_EXPORT const CFStringRef kCFRepublicOfChinaCalendar CF_AVAILABLE(10_6, 4_0);
CF_EXPORT const CFStringRef kCFPersianCalendar CF_AVAILABLE(10_6, 4_0);
CF_EXPORT const CFStringRef kCFIndianCalendar CF_AVAILABLE(10_6, 4_0);
CF_EXPORT const CFStringRef kCFISO8601Calendar CF_AVAILABLE(10_6, 4_0);
CF_EXPORT const CFStringRef kCFIslamicTabularCalendar CF_AVAILABLE(10_10, 8_0);
CF_EXPORT const CFStringRef kCFIslamicUmmAlQuraCalendar CF_AVAILABLE(10_10, 8_0);
CF_EXTERN_C_END
CF_IMPLICIT_BRIDGING_DISABLED
#endif /* ! __COREFOUNDATION_CFLOCALE__ */
| {
"content_hash": "38a0bc003ac81903f3da9ff6525b20f0",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 134,
"avg_line_length": 44.01538461538462,
"alnum_prop": 0.8128859373179541,
"repo_name": "WymanLyu/WYDemo",
"id": "21edcc2ab09034ec45bc7cf2fa256a3b5277d9f8",
"size": "9548",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Animation/11-16Animation/11-16Animation/CF-1151.16/CFLocale.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "22469"
},
{
"name": "C",
"bytes": "9341283"
},
{
"name": "C++",
"bytes": "25210057"
},
{
"name": "HTML",
"bytes": "33634"
},
{
"name": "Java",
"bytes": "330631"
},
{
"name": "JavaScript",
"bytes": "128054"
},
{
"name": "Makefile",
"bytes": "45840"
},
{
"name": "Matlab",
"bytes": "42078"
},
{
"name": "Objective-C",
"bytes": "4817874"
},
{
"name": "Objective-C++",
"bytes": "539172"
},
{
"name": "Python",
"bytes": "642022"
},
{
"name": "Ruby",
"bytes": "11503"
},
{
"name": "Shell",
"bytes": "321885"
},
{
"name": "Swift",
"bytes": "4973"
}
],
"symlink_target": ""
} |
#include <nanokernel.h>
#include "board.h"
#include <uart.h>
#include <device.h>
#include <init.h>
#if defined(CONFIG_NETWORKING_WITH_15_4_TI_CC2520)
#include <gpio.h>
static struct device *cc2520_gpio_config[CC2520_GPIO_IDX_LAST_ENTRY];
struct device **cc2520_configure_gpios(void)
{
struct device *gpio;
const int flags_noint_out = GPIO_DIR_OUT;
const int flags_noint_in = GPIO_DIR_IN;
const int flags_int_in = (GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE |
GPIO_INT_ACTIVE_HIGH | GPIO_INT_DEBOUNCE);
gpio = device_get_binding(CONFIG_TI_CC2520_GPIO_AON_NAME);
gpio_pin_configure(gpio, CONFIG_CC2520_GPIO_VREG_EN, flags_noint_out);
gpio_pin_configure(gpio, CONFIG_CC2520_GPIO_RESET, flags_noint_out);
cc2520_gpio_config[CC2520_GPIO_IDX_VREG_EN] = gpio;
cc2520_gpio_config[CC2520_GPIO_IDX_RESET] = gpio;
gpio = device_get_binding(CONFIG_TI_CC2520_GPIO_NAME);
gpio_pin_configure(gpio, CONFIG_CC2520_GPIO_SFD, flags_int_in);
gpio_pin_configure(gpio, CONFIG_CC2520_GPIO_FIFOP, flags_int_in);
gpio_pin_configure(gpio, CONFIG_CC2520_GPIO_FIFO, flags_noint_in);
gpio_pin_configure(gpio, CONFIG_CC2520_GPIO_CCA, flags_noint_in);
cc2520_gpio_config[CC2520_GPIO_IDX_FIFOP] = gpio;
cc2520_gpio_config[CC2520_GPIO_IDX_FIFO] = gpio;
cc2520_gpio_config[CC2520_GPIO_IDX_SFD] = gpio;
cc2520_gpio_config[CC2520_GPIO_IDX_CCA] = gpio;
return cc2520_gpio_config;
}
#endif /* CONFIG_NETWORKING_WITH_15_4_TI_CC2520 */
| {
"content_hash": "6020436287fa8bfc1b695a38faca1b75",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 71,
"avg_line_length": 31.77777777777778,
"alnum_prop": 0.7321678321678322,
"repo_name": "32bitmicro/zephyr",
"id": "3b3e38dc81234c6a7820a7ff66a3ae6e9d77d089",
"size": "2034",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "boards/quark_se_devboard/board.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "160164"
},
{
"name": "Batchfile",
"bytes": "28019"
},
{
"name": "C",
"bytes": "6173727"
},
{
"name": "C++",
"bytes": "222025"
},
{
"name": "Lex",
"bytes": "11196"
},
{
"name": "Makefile",
"bytes": "132295"
},
{
"name": "Objective-C",
"bytes": "1912"
},
{
"name": "Perl",
"bytes": "213268"
},
{
"name": "Python",
"bytes": "109645"
},
{
"name": "Shell",
"bytes": "44817"
},
{
"name": "Yacc",
"bytes": "15396"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "acda26916e4751dadcb35bbb69b019e7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "7b59df38e0ba5f81987b8e4114b5636c54bf01fa",
"size": "190",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Glomera/Glomera macdonaldii/ Syn. Glossorhyncha macdonaldii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "683a7fd25132bb5dd35d7e689160536f",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "41da29bfdaf0890cce1c1dadcaa42c76db152a99",
"size": "189",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Nyctaginaceae/Mirabilis/Mirabilis albida/ Syn. Oxybaphus comatus/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
(function() {
function vendorModule() {
'use strict';
return {
'default': self['moment'],
__esModule: true,
};
}
define('moment', [], vendorModule);
})();
| {
"content_hash": "313ba71e6165effd3de6f8e3a0d02be8",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 37,
"avg_line_length": 15.583333333333334,
"alnum_prop": 0.5133689839572193,
"repo_name": "IoraHealth/ember-icis-model",
"id": "2c0e681b40e421476a049853d97f8e96d94d92f5",
"size": "187",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vendor/shims/moment.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "31"
},
{
"name": "HTML",
"bytes": "1845"
},
{
"name": "JavaScript",
"bytes": "32535"
}
],
"symlink_target": ""
} |
NSString *const MPHDockIconBouncesKey = @"dock-bounces";
NSString *const MPHDockIconBouncesRepeatedlyKey = @"dock-bounces-repeatedly";
NSString *const MPHDockIconBadgesKey = @"dock-badge";
NSString *const MPHDockIconBadgeLineKey = @"dock-badge-shows-line";
NSString *const MPHDockIconBadgeServiceKey = @"dock-badge-shows-service";
NSString *const MPHDockIconBadgeETAKey = @"dock-badge-shows-eta";
@implementation MPHDockIconAlertViewController {
NSDictionary *_dictionary;
}
- (id) init {
return (self = [super initWithNibName:@"MPHDockIconAlertView" bundle:nil]);
}
#pragma mark -
- (void) awakeFromNib {
[super awakeFromNib];
_bouncesCheckbox.state = [_dictionary[MPHDockIconBouncesKey] intValue];
_repeatedlyCheckbox.state = [_dictionary[MPHDockIconBouncesRepeatedlyKey] intValue];
_badgeCheckbox.state = [_dictionary[MPHDockIconBadgesKey] intValue];
_badgeLineCheckbox.state = [_dictionary[MPHDockIconBadgeLineKey] intValue];
_badgeServiceCheckbox.state = [_dictionary[MPHDockIconBadgeServiceKey] intValue];
_badgeETACheckbox.state = [_dictionary[MPHDockIconBadgeETAKey] intValue];
}
#pragma mark -
- (void) setValuesWithDictionary:(NSDictionary *) dictionary {
_dictionary = dictionary;
}
- (NSDictionary *) dictionaryValue {
return @{
MPHDockIconBouncesKey: @(_bouncesCheckbox.state),
MPHDockIconBouncesRepeatedlyKey: @(_repeatedlyCheckbox.state),
MPHDockIconBadgesKey: @(_badgeCheckbox.state),
MPHDockIconBadgeLineKey: @(_badgeLineCheckbox.state),
MPHDockIconBadgeServiceKey: @(_badgeServiceCheckbox.state),
MPHDockIconBadgeETAKey: @(_badgeETACheckbox.state),
MPHAlertTypeKey: MPHDockAlertTypeKey
};
}
#pragma mark -
- (IBAction) toggleBounce:(id) sender {
BOOL enabled = (_badgeCheckbox.state == NSOnState);
[_repeatedlyCheckbox setEnabled:enabled];
}
- (IBAction) toggleBadge:(id) sender {
BOOL enabled = (_badgeCheckbox.state == NSOnState);
[_badgeETACheckbox setEnabled:enabled];
[_badgeLineCheckbox setEnabled:enabled];
[_badgeServiceCheckbox setEnabled:enabled];
}
@end
| {
"content_hash": "801896223ee8af7adade3d041d1defdf",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 85,
"avg_line_length": 33.96666666666667,
"alnum_prop": 0.7718351324828263,
"repo_name": "zadr/8mph",
"id": "467d5c536f051b35d39ae68401cddeadd270dc8d",
"size": "2082",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "Code/Controllers/MPHDockIconAlertViewController.m",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Objective-C",
"bytes": "390931"
}
],
"symlink_target": ""
} |
<section class="chat-app">
<div class="main">
<div class="page-container">
<div class="row">
<div class="col-sm-12">
<form class="form" name="form" ng-submit="login(form)" novalidate>
<div class="form-group">
<label>Email</label>
<input type="text" name="email" class="form-control" ng-model="user.email" autofocus>
</div>
<div class="form-group">
<label>Password</label>
<input type="password" name="password" class="form-control" ng-model="user.password">
</div>
<div class="form-group has-error">
<p class="help-block"
ng-show="form.email.$error.required && form.password.$error.required && submitted">
Please enter your email and password.
</p>
<p class="help-block">{{ errors.other }}</p>
</div>
<button type="submit" class="btn btn-lg btn-primary"> Login</button>
<a href="/signup" class="btn btn-lg btn-default"> Sign up </a>
<a href="/" class="btn btn-lg btn-default"> Cancel </a>
</form>
</div>
</div>
</div>
</div>
</section> | {
"content_hash": "ec3192632b5e556d3c92d0a93407b08a",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 114,
"avg_line_length": 42.666666666666664,
"alnum_prop": 0.416015625,
"repo_name": "dmmat/chat",
"id": "0743024ca5b68042383879f18aa6f37e26354ab8",
"size": "1536",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/views/partials/login.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6074"
},
{
"name": "HTML",
"bytes": "17811"
},
{
"name": "JavaScript",
"bytes": "45145"
}
],
"symlink_target": ""
} |
package com.teamwizardry.refraction.common.tile;
import com.teamwizardry.librarianlib.features.autoregister.TileRegister;
import com.teamwizardry.librarianlib.features.network.PacketHandler;
import com.teamwizardry.librarianlib.features.utilities.DimWithPos;
import com.teamwizardry.refraction.api.MultipleBeamTile;
import com.teamwizardry.refraction.api.Utils;
import com.teamwizardry.refraction.common.block.BlockWormHole;
import com.teamwizardry.refraction.common.network.PacketWormholeParticles;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import java.awt.*;
import java.util.List;
/**
* Created by Demoniaque.
*/
@TileRegister("wormhole")
public class TileWormhole extends MultipleBeamTile {
@Override
public void update() {
super.update();
if (outputBeam == null) {
Color finalColor = null;
DimWithPos finalDimWithPos = null;
for (Color color : BlockWormHole.wormholes.keySet()) {
for (DimWithPos dimWithPos : BlockWormHole.wormholes.get(color)) {
if (dimWithPos.getDim() == world.provider.getDimension()
&& dimWithPos.getPos().toLong() == pos.toLong()) {
finalColor = color;
finalDimWithPos = dimWithPos;
break;
}
}
}
if (finalColor == null) return;
BlockWormHole.wormholes.remove(finalColor, finalDimWithPos);
return;
}
boolean add = true;
for (Color color : BlockWormHole.wormholes.keySet()) {
for (DimWithPos dimWithPos : BlockWormHole.wormholes.get(color)) {
if (dimWithPos.getDim() == world.provider.getDimension()
&& dimWithPos.getPos().toLong() == pos.toLong()) {
if (Utils.doColorsMatch(color, outputBeam.getColor())) {
add = false;
}
}
}
}
if (add) BlockWormHole.wormholes.put(outputBeam.getColor(), new DimWithPos(world, pos));
IBlockState state = world.getBlockState(pos);
EnumFacing facing = state.getValue(BlockWormHole.FACING);
boolean anyMatch = false;
DimWithPos closest = null;
for (Color color : BlockWormHole.wormholes.keySet()) {
if (Utils.doColorsMatch(color, outputBeam.getColor())) {
anyMatch = true;
for (DimWithPos dimWithPos : BlockWormHole.wormholes.get(color)) {
if (dimWithPos.getPos().toLong() == pos.toLong() && dimWithPos.getDim() == world.provider.getDimension())
continue;
if (closest == null) closest = dimWithPos;
else if (dimWithPos.getPos().distanceSq(pos) < closest.getPos().distanceSq(pos))
closest = dimWithPos;
}
break;
}
}
if (!anyMatch) return;
if (closest == null) return;
List<Entity> entityList = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.offset(facing)).expand(0, 2, 0));
if (!entityList.isEmpty()) {
for (Entity entity : entityList) {
if (entity.getEntityData().hasKey("wormhole_cooldown")) {
int cooldown = entity.getEntityData().getInteger("wormhole_cooldown");
if (cooldown > 0)
entity.getEntityData().setInteger("wormhole_cooldown", cooldown - 1);
else entity.getEntityData().removeTag("wormhole_cooldown");
} else {
if (entity.dimension != closest.getDim())
entity.changeDimension(closest.getDim());
Vec3d pos = new Vec3d(closest.getPos()).add(0.5, 0.5, 0.5).add(entity.getLook(0));
entity.setPosition(pos.x, pos.y, pos.z);
entity.getEntityData().setInteger("wormhole_cooldown", 10);
}
}
}
PacketHandler.NETWORK.sendToAllAround(new PacketWormholeParticles(pos, facing), new NetworkRegistry.TargetPoint(world.provider.getDimension(), pos.getX(), pos.getY(), pos.getZ(), 50));
}
}
| {
"content_hash": "5b58496803d5efb94cd9ca22b1307ba9",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 186,
"avg_line_length": 36.08653846153846,
"alnum_prop": 0.7138289368505196,
"repo_name": "TeamWizardry/TMT-Refraction",
"id": "8d6498d721c481be819755ec26ef13e62cdac512",
"size": "3753",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/teamwizardry/refraction/common/tile/TileWormhole.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "579302"
}
],
"symlink_target": ""
} |
module TreeHelper
FILE_LIMIT = 1_000
# Sorts a repository's tree so that folders are before files and renders
# their corresponding partials
#
# tree - A `Tree` object for the current tree
# rubocop: disable CodeReuse/ActiveRecord
def render_tree(tree)
# Sort submodules and folders together by name ahead of files
folders, files, submodules = tree.trees, tree.blobs, tree.submodules
tree = []
items = (folders + submodules).sort_by(&:name) + files
if items.size > FILE_LIMIT
tree << render(partial: 'projects/tree/truncated_notice_tree_row',
locals: { limit: FILE_LIMIT, total: items.size })
items = items.take(FILE_LIMIT)
end
tree << render(partial: 'projects/tree/tree_row', collection: items) if items.present?
tree.join.html_safe
end
# rubocop: enable CodeReuse/ActiveRecord
# Return an image icon depending on the file type and mode
#
# type - String type of the tree item; either 'folder' or 'file'
# mode - File unix mode
# name - File name
def tree_icon(type, mode, name)
icon([file_type_icon_class(type, mode, name), 'fw'])
end
# Using Rails `*_path` methods can be slow, especially when generating
# many paths, as with a repository tree that has thousands of items.
def fast_project_blob_path(project, blob_path)
ActionDispatch::Journey::Router::Utils.escape_path(
File.join(relative_url_root, project.path_with_namespace, 'blob', blob_path)
)
end
def fast_project_tree_path(project, tree_path)
ActionDispatch::Journey::Router::Utils.escape_path(
File.join(relative_url_root, project.path_with_namespace, 'tree', tree_path)
)
end
# Simple shortcut to File.join
def tree_join(*args)
File.join(*args)
end
def on_top_of_branch?(project = @project, ref = @ref)
project.repository.branch_exists?(ref)
end
def can_edit_tree?(project = nil, ref = nil)
project ||= @project
ref ||= @ref
return false unless on_top_of_branch?(project, ref)
can_collaborate_with_project?(project, ref: ref)
end
def tree_edit_branch(project = @project, ref = @ref)
return unless can_edit_tree?(project, ref)
if user_access(project).can_push_to_branch?(ref)
ref
else
project = tree_edit_project(project)
project.repository.next_branch('patch')
end
end
def tree_edit_project(project = @project)
if can?(current_user, :push_code, project)
project
elsif current_user && current_user.already_forked?(project)
current_user.fork_of(project)
end
end
def edit_in_new_fork_notice_now
_("You're not allowed to make changes to this project directly. "\
"A fork of this project is being created that you can make changes in, so you can submit a merge request.")
end
def edit_in_new_fork_notice
_("You're not allowed to make changes to this project directly. "\
"A fork of this project has been created that you can make changes in, so you can submit a merge request.")
end
def edit_in_new_fork_notice_action(action)
edit_in_new_fork_notice + _(" Try to %{action} this file again.") % { action: action }
end
def commit_in_fork_help
_("A new branch will be created in your fork and a new merge request will be started.")
end
def commit_in_single_accessible_branch
branch_name = ERB::Util.html_escape(selected_branch)
message = _("Your changes can be committed to %{branch_name} because a merge "\
"request is open.") % { branch_name: "<strong>#{branch_name}</strong>" }
message.html_safe
end
def path_breadcrumbs(max_links = 6)
if @path.present?
part_path = ""
parts = @path.split('/')
yield('..', File.join(*parts.first(parts.count - 2))) if parts.count > max_links
parts.each do |part|
part_path = File.join(part_path, part) unless part_path.empty?
part_path = part if part_path.empty?
next if parts.count > max_links && !parts.last(2).include?(part)
yield(part, part_path)
end
end
end
def up_dir_path
file = File.join(@path, "..")
tree_join(@ref, file)
end
# returns the relative path of the first subdir that doesn't have only one directory descendant
def flatten_tree(root_path, tree)
tree.flat_path.sub(%r{\A#{Regexp.escape(root_path)}/}, '')
end
def selected_branch
@branch_name || tree_edit_branch
end
def relative_url_root
Gitlab.config.gitlab.relative_url_root.presence || '/'
end
# project and path are used on the EE version
def tree_content_data(logs_path, project, path)
{
"logs-path" => logs_path
}
end
def breadcrumb_data_attributes
attrs = {
can_collaborate: can_collaborate_with_project?(@project).to_s,
new_blob_path: project_new_blob_path(@project, @id),
new_branch_path: new_project_branch_path(@project),
new_tag_path: new_project_tag_path(@project),
can_edit_tree: can_edit_tree?.to_s
}
if can?(current_user, :fork_project, @project) && can?(current_user, :create_merge_request_in, @project)
continue_param = {
to: project_new_blob_path(@project, @id),
notice: edit_in_new_fork_notice,
notice_now: edit_in_new_fork_notice_now
}
attrs.merge!(
fork_new_blob_path: project_forks_path(@project, namespace_key: current_user.namespace.id, continue: continue_param),
fork_new_directory_path: project_forks_path(@project, namespace_key: current_user.namespace.id, continue: continue_param.merge({
to: request.fullpath,
notice: _("%{edit_in_new_fork_notice} Try to create a new directory again.") % { edit_in_new_fork_notice: edit_in_new_fork_notice }
})),
fork_upload_blob_path: project_forks_path(@project, namespace_key: current_user.namespace.id, continue: continue_param.merge({
to: request.fullpath,
notice: _("%{edit_in_new_fork_notice} Try to upload a file again.") % { edit_in_new_fork_notice: edit_in_new_fork_notice }
}))
)
end
attrs
end
end
TreeHelper.prepend_if_ee('::EE::TreeHelper')
| {
"content_hash": "9040efa2f1dc552c76afcf5f0f26431d",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 141,
"avg_line_length": 32.55026455026455,
"alnum_prop": 0.6583224967490247,
"repo_name": "stoplightio/gitlabhq",
"id": "afa057421e03733e57ec1c570ac0dec878b22e90",
"size": "6183",
"binary": false,
"copies": "1",
"ref": "refs/heads/stoplight/develop",
"path": "app/helpers/tree_helper.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "632980"
},
{
"name": "Clojure",
"bytes": "79"
},
{
"name": "Dockerfile",
"bytes": "1676"
},
{
"name": "HTML",
"bytes": "1264236"
},
{
"name": "JavaScript",
"bytes": "3425347"
},
{
"name": "Ruby",
"bytes": "16497064"
},
{
"name": "Shell",
"bytes": "34509"
},
{
"name": "Vue",
"bytes": "752795"
}
],
"symlink_target": ""
} |
"""A simple script to run peanuts."""
from peanuts import create_app
app = create_app('config/main.py')
if __name__ == '__main__':
app.run()
| {
"content_hash": "3dee806516da102c57c8c7818b0add97",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 37,
"avg_line_length": 16.555555555555557,
"alnum_prop": 0.610738255033557,
"repo_name": "astex/peanuts",
"id": "2bd1aba33ff58a1d3c9b6671d14fa10aa000c5d4",
"size": "149",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "run.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "48645"
}
],
"symlink_target": ""
} |
namespace ray {
namespace rpc {
#define JOB_INFO_SERVICE_RPC_HANDLER(HANDLER) \
RPC_SERVICE_HANDLER(JobInfoGcsService, HANDLER)
#define ACTOR_INFO_SERVICE_RPC_HANDLER(HANDLER) \
RPC_SERVICE_HANDLER(ActorInfoGcsService, HANDLER)
#define NODE_INFO_SERVICE_RPC_HANDLER(HANDLER) \
RPC_SERVICE_HANDLER(NodeInfoGcsService, HANDLER)
#define OBJECT_INFO_SERVICE_RPC_HANDLER(HANDLER) \
RPC_SERVICE_HANDLER(ObjectInfoGcsService, HANDLER)
#define TASK_INFO_SERVICE_RPC_HANDLER(HANDLER) \
RPC_SERVICE_HANDLER(TaskInfoGcsService, HANDLER)
#define STATS_SERVICE_RPC_HANDLER(HANDLER) RPC_SERVICE_HANDLER(StatsGcsService, HANDLER)
#define WORKER_INFO_SERVICE_RPC_HANDLER(HANDLER) \
RPC_SERVICE_HANDLER(WorkerInfoGcsService, HANDLER)
#define PLACEMENT_GROUP_INFO_SERVICE_RPC_HANDLER(HANDLER) \
RPC_SERVICE_HANDLER(PlacementGroupInfoGcsService, HANDLER)
#define GCS_RPC_SEND_REPLY(send_reply_callback, reply, status) \
reply->mutable_status()->set_code((int)status.code()); \
reply->mutable_status()->set_message(status.message()); \
send_reply_callback(ray::Status::OK(), nullptr, nullptr)
class JobInfoGcsServiceHandler {
public:
virtual ~JobInfoGcsServiceHandler() = default;
virtual void HandleAddJob(const AddJobRequest &request, AddJobReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleMarkJobFinished(const MarkJobFinishedRequest &request,
MarkJobFinishedReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetAllJobInfo(const GetAllJobInfoRequest &request,
GetAllJobInfoReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void AddJobFinishedListener(
std::function<void(std::shared_ptr<JobID>)> listener) = 0;
};
/// The `GrpcService` for `JobInfoGcsService`.
class JobInfoGrpcService : public GrpcService {
public:
/// Constructor.
///
/// \param[in] handler The service handler that actually handle the requests.
explicit JobInfoGrpcService(boost::asio::io_service &io_service,
JobInfoGcsServiceHandler &handler)
: GrpcService(io_service), service_handler_(handler){};
protected:
grpc::Service &GetGrpcService() override { return service_; }
void InitServerCallFactories(
const std::unique_ptr<grpc::ServerCompletionQueue> &cq,
std::vector<std::unique_ptr<ServerCallFactory>> *server_call_factories) override {
JOB_INFO_SERVICE_RPC_HANDLER(AddJob);
JOB_INFO_SERVICE_RPC_HANDLER(MarkJobFinished);
JOB_INFO_SERVICE_RPC_HANDLER(GetAllJobInfo);
}
private:
/// The grpc async service object.
JobInfoGcsService::AsyncService service_;
/// The service handler that actually handle the requests.
JobInfoGcsServiceHandler &service_handler_;
};
class ActorInfoGcsServiceHandler {
public:
virtual ~ActorInfoGcsServiceHandler() = default;
virtual void HandleRegisterActor(const RegisterActorRequest &request,
RegisterActorReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleCreateActor(const CreateActorRequest &request,
CreateActorReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetActorInfo(const GetActorInfoRequest &request,
GetActorInfoReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetNamedActorInfo(const GetNamedActorInfoRequest &request,
GetNamedActorInfoReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetAllActorInfo(const GetAllActorInfoRequest &request,
GetAllActorInfoReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleRegisterActorInfo(const RegisterActorInfoRequest &request,
RegisterActorInfoReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleUpdateActorInfo(const UpdateActorInfoRequest &request,
UpdateActorInfoReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleAddActorCheckpoint(const AddActorCheckpointRequest &request,
AddActorCheckpointReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetActorCheckpoint(const GetActorCheckpointRequest &request,
GetActorCheckpointReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetActorCheckpointID(const GetActorCheckpointIDRequest &request,
GetActorCheckpointIDReply *reply,
SendReplyCallback send_reply_callback) = 0;
};
/// The `GrpcService` for `ActorInfoGcsService`.
class ActorInfoGrpcService : public GrpcService {
public:
/// Constructor.
///
/// \param[in] handler The service handler that actually handle the requests.
explicit ActorInfoGrpcService(boost::asio::io_service &io_service,
ActorInfoGcsServiceHandler &handler)
: GrpcService(io_service), service_handler_(handler){};
protected:
grpc::Service &GetGrpcService() override { return service_; }
void InitServerCallFactories(
const std::unique_ptr<grpc::ServerCompletionQueue> &cq,
std::vector<std::unique_ptr<ServerCallFactory>> *server_call_factories) override {
ACTOR_INFO_SERVICE_RPC_HANDLER(RegisterActor);
ACTOR_INFO_SERVICE_RPC_HANDLER(CreateActor);
ACTOR_INFO_SERVICE_RPC_HANDLER(GetActorInfo);
ACTOR_INFO_SERVICE_RPC_HANDLER(GetNamedActorInfo);
ACTOR_INFO_SERVICE_RPC_HANDLER(GetAllActorInfo);
ACTOR_INFO_SERVICE_RPC_HANDLER(RegisterActorInfo);
ACTOR_INFO_SERVICE_RPC_HANDLER(UpdateActorInfo);
ACTOR_INFO_SERVICE_RPC_HANDLER(AddActorCheckpoint);
ACTOR_INFO_SERVICE_RPC_HANDLER(GetActorCheckpoint);
ACTOR_INFO_SERVICE_RPC_HANDLER(GetActorCheckpointID);
}
private:
/// The grpc async service object.
ActorInfoGcsService::AsyncService service_;
/// The service handler that actually handle the requests.
ActorInfoGcsServiceHandler &service_handler_;
};
class NodeInfoGcsServiceHandler {
public:
virtual ~NodeInfoGcsServiceHandler() = default;
virtual void HandleRegisterNode(const RegisterNodeRequest &request,
RegisterNodeReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleUnregisterNode(const UnregisterNodeRequest &request,
UnregisterNodeReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetAllNodeInfo(const GetAllNodeInfoRequest &request,
GetAllNodeInfoReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleReportHeartbeat(const ReportHeartbeatRequest &request,
ReportHeartbeatReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetResources(const GetResourcesRequest &request,
GetResourcesReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleUpdateResources(const UpdateResourcesRequest &request,
UpdateResourcesReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleDeleteResources(const DeleteResourcesRequest &request,
DeleteResourcesReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleSetInternalConfig(const SetInternalConfigRequest &request,
SetInternalConfigReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetInternalConfig(const GetInternalConfigRequest &request,
GetInternalConfigReply *reply,
SendReplyCallback send_reply_callback) = 0;
};
/// The `GrpcService` for `NodeInfoGcsService`.
class NodeInfoGrpcService : public GrpcService {
public:
/// Constructor.
///
/// \param[in] handler The service handler that actually handle the requests.
explicit NodeInfoGrpcService(boost::asio::io_service &io_service,
NodeInfoGcsServiceHandler &handler)
: GrpcService(io_service), service_handler_(handler){};
protected:
grpc::Service &GetGrpcService() override { return service_; }
void InitServerCallFactories(
const std::unique_ptr<grpc::ServerCompletionQueue> &cq,
std::vector<std::unique_ptr<ServerCallFactory>> *server_call_factories) override {
NODE_INFO_SERVICE_RPC_HANDLER(RegisterNode);
NODE_INFO_SERVICE_RPC_HANDLER(UnregisterNode);
NODE_INFO_SERVICE_RPC_HANDLER(GetAllNodeInfo);
NODE_INFO_SERVICE_RPC_HANDLER(ReportHeartbeat);
NODE_INFO_SERVICE_RPC_HANDLER(GetResources);
NODE_INFO_SERVICE_RPC_HANDLER(UpdateResources);
NODE_INFO_SERVICE_RPC_HANDLER(DeleteResources);
NODE_INFO_SERVICE_RPC_HANDLER(SetInternalConfig);
NODE_INFO_SERVICE_RPC_HANDLER(GetInternalConfig);
}
private:
/// The grpc async service object.
NodeInfoGcsService::AsyncService service_;
/// The service handler that actually handle the requests.
NodeInfoGcsServiceHandler &service_handler_;
};
class ObjectInfoGcsServiceHandler {
public:
virtual ~ObjectInfoGcsServiceHandler() = default;
virtual void HandleGetObjectLocations(const GetObjectLocationsRequest &request,
GetObjectLocationsReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetAllObjectLocations(const GetAllObjectLocationsRequest &request,
GetAllObjectLocationsReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleAddObjectLocation(const AddObjectLocationRequest &request,
AddObjectLocationReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleRemoveObjectLocation(const RemoveObjectLocationRequest &request,
RemoveObjectLocationReply *reply,
SendReplyCallback send_reply_callback) = 0;
};
/// The `GrpcService` for `ObjectInfoGcsServiceHandler`.
class ObjectInfoGrpcService : public GrpcService {
public:
/// Constructor.
///
/// \param[in] handler The service handler that actually handle the requests.
explicit ObjectInfoGrpcService(boost::asio::io_service &io_service,
ObjectInfoGcsServiceHandler &handler)
: GrpcService(io_service), service_handler_(handler){};
protected:
grpc::Service &GetGrpcService() override { return service_; }
void InitServerCallFactories(
const std::unique_ptr<grpc::ServerCompletionQueue> &cq,
std::vector<std::unique_ptr<ServerCallFactory>> *server_call_factories) override {
OBJECT_INFO_SERVICE_RPC_HANDLER(GetObjectLocations);
OBJECT_INFO_SERVICE_RPC_HANDLER(GetAllObjectLocations);
OBJECT_INFO_SERVICE_RPC_HANDLER(AddObjectLocation);
OBJECT_INFO_SERVICE_RPC_HANDLER(RemoveObjectLocation);
}
private:
/// The grpc async service object.
ObjectInfoGcsService::AsyncService service_;
/// The service handler that actually handle the requests.
ObjectInfoGcsServiceHandler &service_handler_;
};
class TaskInfoGcsServiceHandler {
public:
virtual ~TaskInfoGcsServiceHandler() = default;
virtual void HandleAddTask(const AddTaskRequest &request, AddTaskReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetTask(const GetTaskRequest &request, GetTaskReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleDeleteTasks(const DeleteTasksRequest &request,
DeleteTasksReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleAddTaskLease(const AddTaskLeaseRequest &request,
AddTaskLeaseReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetTaskLease(const GetTaskLeaseRequest &request,
GetTaskLeaseReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleAttemptTaskReconstruction(
const AttemptTaskReconstructionRequest &request,
AttemptTaskReconstructionReply *reply, SendReplyCallback send_reply_callback) = 0;
};
/// The `GrpcService` for `TaskInfoGcsService`.
class TaskInfoGrpcService : public GrpcService {
public:
/// Constructor.
///
/// \param[in] handler The service handler that actually handle the requests.
explicit TaskInfoGrpcService(boost::asio::io_service &io_service,
TaskInfoGcsServiceHandler &handler)
: GrpcService(io_service), service_handler_(handler){};
protected:
grpc::Service &GetGrpcService() override { return service_; }
void InitServerCallFactories(
const std::unique_ptr<grpc::ServerCompletionQueue> &cq,
std::vector<std::unique_ptr<ServerCallFactory>> *server_call_factories) override {
TASK_INFO_SERVICE_RPC_HANDLER(AddTask);
TASK_INFO_SERVICE_RPC_HANDLER(GetTask);
TASK_INFO_SERVICE_RPC_HANDLER(DeleteTasks);
TASK_INFO_SERVICE_RPC_HANDLER(AddTaskLease);
TASK_INFO_SERVICE_RPC_HANDLER(GetTaskLease);
TASK_INFO_SERVICE_RPC_HANDLER(AttemptTaskReconstruction);
}
private:
/// The grpc async service object.
TaskInfoGcsService::AsyncService service_;
/// The service handler that actually handle the requests.
TaskInfoGcsServiceHandler &service_handler_;
};
class StatsGcsServiceHandler {
public:
virtual ~StatsGcsServiceHandler() = default;
virtual void HandleAddProfileData(const AddProfileDataRequest &request,
AddProfileDataReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetAllProfileInfo(const GetAllProfileInfoRequest &request,
GetAllProfileInfoReply *reply,
SendReplyCallback send_reply_callback) = 0;
};
/// The `GrpcService` for `StatsGcsService`.
class StatsGrpcService : public GrpcService {
public:
/// Constructor.
///
/// \param[in] handler The service handler that actually handle the requests.
explicit StatsGrpcService(boost::asio::io_service &io_service,
StatsGcsServiceHandler &handler)
: GrpcService(io_service), service_handler_(handler){};
protected:
grpc::Service &GetGrpcService() override { return service_; }
void InitServerCallFactories(
const std::unique_ptr<grpc::ServerCompletionQueue> &cq,
std::vector<std::unique_ptr<ServerCallFactory>> *server_call_factories) override {
STATS_SERVICE_RPC_HANDLER(AddProfileData);
STATS_SERVICE_RPC_HANDLER(GetAllProfileInfo);
}
private:
/// The grpc async service object.
StatsGcsService::AsyncService service_;
/// The service handler that actually handle the requests.
StatsGcsServiceHandler &service_handler_;
};
class WorkerInfoGcsServiceHandler {
public:
virtual ~WorkerInfoGcsServiceHandler() = default;
virtual void HandleReportWorkerFailure(const ReportWorkerFailureRequest &request,
ReportWorkerFailureReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetWorkerInfo(const GetWorkerInfoRequest &request,
GetWorkerInfoReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetAllWorkerInfo(const GetAllWorkerInfoRequest &request,
GetAllWorkerInfoReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleAddWorkerInfo(const AddWorkerInfoRequest &request,
AddWorkerInfoReply *reply,
SendReplyCallback send_reply_callback) = 0;
};
/// The `GrpcService` for `WorkerInfoGcsService`.
class WorkerInfoGrpcService : public GrpcService {
public:
/// Constructor.
///
/// \param[in] handler The service handler that actually handle the requests.
explicit WorkerInfoGrpcService(boost::asio::io_service &io_service,
WorkerInfoGcsServiceHandler &handler)
: GrpcService(io_service), service_handler_(handler){};
protected:
grpc::Service &GetGrpcService() override { return service_; }
void InitServerCallFactories(
const std::unique_ptr<grpc::ServerCompletionQueue> &cq,
std::vector<std::unique_ptr<ServerCallFactory>> *server_call_factories) override {
WORKER_INFO_SERVICE_RPC_HANDLER(ReportWorkerFailure);
WORKER_INFO_SERVICE_RPC_HANDLER(GetWorkerInfo);
WORKER_INFO_SERVICE_RPC_HANDLER(GetAllWorkerInfo);
WORKER_INFO_SERVICE_RPC_HANDLER(AddWorkerInfo);
}
private:
/// The grpc async service object.
WorkerInfoGcsService::AsyncService service_;
/// The service handler that actually handle the requests.
WorkerInfoGcsServiceHandler &service_handler_;
};
class PlacementGroupInfoGcsServiceHandler {
public:
virtual ~PlacementGroupInfoGcsServiceHandler() = default;
virtual void HandleCreatePlacementGroup(const CreatePlacementGroupRequest &request,
CreatePlacementGroupReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleRemovePlacementGroup(const RemovePlacementGroupRequest &request,
RemovePlacementGroupReply *reply,
SendReplyCallback send_reply_callback) = 0;
virtual void HandleGetPlacementGroup(const GetPlacementGroupRequest &request,
GetPlacementGroupReply *reply,
SendReplyCallback send_reply_callback) = 0;
};
/// The `GrpcService` for `PlacementGroupInfoGcsService`.
class PlacementGroupInfoGrpcService : public GrpcService {
public:
/// Constructor.
///
/// \param[in] handler The service handler that actually handle the requests.
explicit PlacementGroupInfoGrpcService(boost::asio::io_service &io_service,
PlacementGroupInfoGcsServiceHandler &handler)
: GrpcService(io_service), service_handler_(handler){};
protected:
grpc::Service &GetGrpcService() override { return service_; }
void InitServerCallFactories(
const std::unique_ptr<grpc::ServerCompletionQueue> &cq,
std::vector<std::unique_ptr<ServerCallFactory>> *server_call_factories) override {
PLACEMENT_GROUP_INFO_SERVICE_RPC_HANDLER(CreatePlacementGroup);
PLACEMENT_GROUP_INFO_SERVICE_RPC_HANDLER(RemovePlacementGroup);
PLACEMENT_GROUP_INFO_SERVICE_RPC_HANDLER(GetPlacementGroup);
}
private:
/// The grpc async service object.
PlacementGroupInfoGcsService::AsyncService service_;
/// The service handler that actually handle the requests.
PlacementGroupInfoGcsServiceHandler &service_handler_;
};
using JobInfoHandler = JobInfoGcsServiceHandler;
using ActorInfoHandler = ActorInfoGcsServiceHandler;
using NodeInfoHandler = NodeInfoGcsServiceHandler;
using ObjectInfoHandler = ObjectInfoGcsServiceHandler;
using TaskInfoHandler = TaskInfoGcsServiceHandler;
using StatsHandler = StatsGcsServiceHandler;
using WorkerInfoHandler = WorkerInfoGcsServiceHandler;
using PlacementGroupInfoHandler = PlacementGroupInfoGcsServiceHandler;
} // namespace rpc
} // namespace ray
| {
"content_hash": "d59ce253ef65eba97380affbc696a1b3",
"timestamp": "",
"source": "github",
"line_count": 487,
"max_line_length": 88,
"avg_line_length": 42.75770020533881,
"alnum_prop": 0.6677231907025885,
"repo_name": "robertnishihara/ray",
"id": "dc15a35c2b2365da514e1e70ed609df599c345bb",
"size": "21545",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/ray/rpc/gcs_server/gcs_rpc_server.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "82909"
},
{
"name": "C++",
"bytes": "3971373"
},
{
"name": "CSS",
"bytes": "8025"
},
{
"name": "Cython",
"bytes": "179979"
},
{
"name": "Dockerfile",
"bytes": "6468"
},
{
"name": "Go",
"bytes": "23139"
},
{
"name": "HTML",
"bytes": "30414"
},
{
"name": "Java",
"bytes": "1248954"
},
{
"name": "JavaScript",
"bytes": "444"
},
{
"name": "Jupyter Notebook",
"bytes": "1615"
},
{
"name": "Makefile",
"bytes": "2205"
},
{
"name": "Python",
"bytes": "6567694"
},
{
"name": "Shell",
"bytes": "102477"
},
{
"name": "Starlark",
"bytes": "231513"
},
{
"name": "TypeScript",
"bytes": "147793"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
<title>RNFPlistConfigurationLoader Class Reference</title>
<meta id="xcode-display" name="xcode-display" content="render"/>
<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
<meta name="generator" content="appledoc 2.2 (build 963)" />
</head>
<body>
<header id="top_header">
<div id="library" class="hideInXcode">
<h1><a id="libraryTitle" href="../index.html">RuntimeNetworkFoundation </a></h1>
<a id="developerHome" href="../index.html">Vittorio Monaco</a>
</div>
<div id="title" role="banner">
<h1 class="hideInXcode">RNFPlistConfigurationLoader Class Reference</h1>
</div>
<ul id="headerButtons" role="toolbar">
<li id="toc_button">
<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
</li>
<li id="jumpto_button" role="navigation">
<select id="jumpTo">
<option value="top">Jump To…</option>
<option value="tasks">Tasks</option>
<option value="instance_methods">Instance Methods</option>
<option value="//api/name/initWithPlistName:"> - initWithPlistName:</option>
</select>
</li>
</ul>
</header>
<nav id="tocContainer" class="isShowingTOC">
<ul id="toc" role="tree">
<li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
</ul></li>
<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/initWithPlistName:">initWithPlistName:</a></span></li>
</ul></li>
</ul>
</nav>
<article>
<div id="contents" class="isShowingTOC" role="main">
<a title="RNFPlistConfigurationLoader Class Reference" name="top"></a>
<div class="main-navigation navigation-top">
<ul>
<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
</div>
<div id="header">
<div class="section-header">
<h1 class="title title-header">RNFPlistConfigurationLoader Class Reference</h1>
</div>
</div>
<div id="container">
<div class="section section-specification"><table cellspacing="0"><tbody>
<tr>
<td class="specification-title">Inherits from</td>
<td class="specification-value">NSObject</td>
</tr><tr>
<td class="specification-title">Conforms to</td>
<td class="specification-value"><a href="../Protocols/RNFConfigurationLoader.html">RNFConfigurationLoader</a></td>
</tr><tr>
<td class="specification-title">Declared in</td>
<td class="specification-value">RNFPlistConfigurationLoader.h</td>
</tr>
</tbody></table></div>
<div class="section section-tasks">
<a title="Tasks" name="tasks"></a>
<h2 class="subtitle subtitle-tasks">Tasks</h2>
<ul class="task-list">
<li>
<span class="tooltip">
<code><a href="#//api/name/initWithPlistName:">– initWithPlistName:</a></code>
</span>
</li>
</ul>
</div>
<div class="section section-methods">
<a title="Instance Methods" name="instance_methods"></a>
<h2 class="subtitle subtitle-methods">Instance Methods</h2>
<div class="section-method">
<a name="//api/name/initWithPlistName:" title="initWithPlistName:"></a>
<h3 class="subsubtitle method-title">initWithPlistName:</h3>
<div class="method-subsection brief-description">
<p>Initializes a new instance of RNFPlistConfigurationLoader with a given plist</p>
</div>
<div class="method-subsection method-declaration"><code>- (instancetype)initWithPlistName:(NSString *)<em>plistName</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<dl class="argument-def parameter-def">
<dt><em>plistName</em></dt>
<dd><p>the name of the plist file to load from the main bundle</p></dd>
</dl>
</div>
<div class="method-subsection return">
<h4 class="method-subtitle parameter-title">Return Value</h4>
<p>a configured instance of <a href="../Protocols/RNFConfigurationLoader.html">RNFConfigurationLoader</a></p>
<p>@throws <a href="../Classes/RNFConfigurationNotFound.html">RNFConfigurationNotFound</a> if the plist can’t be found</p>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Initializes a new instance of RNFPlistConfigurationLoader with a given plist</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">RNFPlistConfigurationLoader.h</code><br />
</div>
</div>
</div>
</div>
<div class="main-navigation navigation-bottom">
<ul>
<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
</div>
<div id="footer">
<hr />
<div class="footer-copyright">
<p><span class="copyright">© 2014 Vittorio Monaco. All rights reserved. (Last updated: 2014-03-26)</span><br />
<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
</div>
</div>
</div>
</article>
<script type="text/javascript">
function jumpToChange()
{
window.location.hash = this.options[this.selectedIndex].value;
}
function toggleTOC()
{
var contents = document.getElementById('contents');
var tocContainer = document.getElementById('tocContainer');
if (this.getAttribute('class') == 'open')
{
this.setAttribute('class', '');
contents.setAttribute('class', '');
tocContainer.setAttribute('class', '');
window.name = "hideTOC";
}
else
{
this.setAttribute('class', 'open');
contents.setAttribute('class', 'isShowingTOC');
tocContainer.setAttribute('class', 'isShowingTOC');
window.name = "";
}
return false;
}
function toggleTOCEntryChildren(e)
{
e.stopPropagation();
var currentClass = this.getAttribute('class');
if (currentClass == 'children') {
this.setAttribute('class', 'children open');
}
else if (currentClass == 'children open') {
this.setAttribute('class', 'children');
}
return false;
}
function tocEntryClick(e)
{
e.stopPropagation();
return true;
}
function init()
{
var selectElement = document.getElementById('jumpTo');
selectElement.addEventListener('change', jumpToChange, false);
var tocButton = document.getElementById('table_of_contents');
tocButton.addEventListener('click', toggleTOC, false);
var taskTreeItem = document.getElementById('task_treeitem');
if (taskTreeItem.getElementsByTagName('li').length > 0)
{
taskTreeItem.setAttribute('class', 'children');
taskTreeItem.firstChild.setAttribute('class', 'disclosure');
}
var tocList = document.getElementById('toc');
var tocEntries = tocList.getElementsByTagName('li');
for (var i = 0; i < tocEntries.length; i++) {
tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false);
}
var tocLinks = tocList.getElementsByTagName('a');
for (var i = 0; i < tocLinks.length; i++) {
tocLinks[i].addEventListener('click', tocEntryClick, false);
}
if (window.name == "hideTOC") {
toggleTOC.call(tocButton);
}
}
window.onload = init;
// If showing in Xcode, hide the TOC and Header
if (navigator.userAgent.match(/xcode/i)) {
document.getElementById("contents").className = "hideInXcode"
document.getElementById("tocContainer").className = "hideInXcode"
document.getElementById("top_header").className = "hideInXcode"
}
</script>
</body>
</html> | {
"content_hash": "2426c691ce6aea443cf5a64c0e8a2aca",
"timestamp": "",
"source": "github",
"line_count": 318,
"max_line_length": 159,
"avg_line_length": 26.78930817610063,
"alnum_prop": 0.6317642915835192,
"repo_name": "vittoriom/RNFPlaceholder",
"id": "ff98496ad56335070499df92125a605f4b85714f",
"size": "8519",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "AppleDoc/it.vittoriomonaco.RuntimeNetworkFoundation.docset/Contents/Resources/Documents/Classes/RNFPlistConfigurationLoader.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9480"
},
{
"name": "Objective-C",
"bytes": "286362"
},
{
"name": "Ruby",
"bytes": "480"
}
],
"symlink_target": ""
} |
using System.Web.Mvc;
using System.Web.Routing;
namespace Tellurium.Sample.Website
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}
| {
"content_hash": "786740c67ed91f87a59c58f08191bacc",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 99,
"avg_line_length": 26.68421052631579,
"alnum_prop": 0.5562130177514792,
"repo_name": "cezarypiatek/Tellurium",
"id": "8f824664875968c9414869a05cf32f0675d92d55",
"size": "509",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Src/Sample.Website/App_Start/RouteConfig.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP.NET",
"bytes": "115"
},
{
"name": "Batchfile",
"bytes": "563"
},
{
"name": "C#",
"bytes": "407280"
},
{
"name": "CSS",
"bytes": "4147"
},
{
"name": "Dockerfile",
"bytes": "299"
},
{
"name": "HTML",
"bytes": "70796"
},
{
"name": "JavaScript",
"bytes": "27516"
},
{
"name": "PowerShell",
"bytes": "25129"
}
],
"symlink_target": ""
} |
package org.apache.oro.text.awk;
import java.util.*;
/**
* @version @version@
* @since 1.0
*/
class StarNode extends SyntaxNode {
SyntaxNode _left;
StarNode(SyntaxNode child){
_left = child;
}
boolean _nullable() { return true; }
BitSet _firstPosition() { return _left._firstPosition(); }
BitSet _lastPosition() { return _left._lastPosition(); }
void _followPosition(BitSet[] follow, SyntaxNode[] nodes) {
BitSet last, first;
int size;
_left._followPosition(follow, nodes);
last = _lastPosition();
first = _firstPosition();
size = last.size();
while(0 < size--)
if(last.get(size))
follow[size].or(first);
}
SyntaxNode _clone(int pos[]) {
return new StarNode(_left._clone(pos));
}
}
| {
"content_hash": "5848a2c297eff17083d9d72462134ad0",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 61,
"avg_line_length": 17.88372093023256,
"alnum_prop": 0.6189856957087126,
"repo_name": "anylineorg/anyline",
"id": "eedf3b35bb843f5fcd0007ff87cb03e330ffb9ac",
"size": "3517",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "anyline-oro/src/main/java/org/apache/oro/text/awk/StarNode.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "6607"
},
{
"name": "Java",
"bytes": "4432124"
}
],
"symlink_target": ""
} |
/*
* See: https://developer.mozilla.org/fr/docs/Web/JavaScript/Guide/Boucles_et_it%C3%A9ration
*/
// This script requires ECMAScript 6 or above.
var tab = ["one", "two", "three"];
for(var i of tab) {
print(i);
}
| {
"content_hash": "f8d2fd4fc30595e13e3277ceefc9b379",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 92,
"avg_line_length": 18.5,
"alnum_prop": 0.6441441441441441,
"repo_name": "jeremiedecock/snippets",
"id": "9f997e2285f960d3fe0d4174132810769c051903",
"size": "222",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "javascript/ecmascript/for_of.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "AMPL",
"bytes": "4294"
},
{
"name": "Batchfile",
"bytes": "6779"
},
{
"name": "C",
"bytes": "102107"
},
{
"name": "C++",
"bytes": "320943"
},
{
"name": "CMake",
"bytes": "11424"
},
{
"name": "CSS",
"bytes": "21121"
},
{
"name": "Cython",
"bytes": "21"
},
{
"name": "Dockerfile",
"bytes": "1818"
},
{
"name": "Fortran",
"bytes": "633"
},
{
"name": "Gnuplot",
"bytes": "39999"
},
{
"name": "Go",
"bytes": "3166"
},
{
"name": "Groovy",
"bytes": "3009"
},
{
"name": "HTML",
"bytes": "138995"
},
{
"name": "IDL",
"bytes": "43"
},
{
"name": "Java",
"bytes": "120221"
},
{
"name": "JavaScript",
"bytes": "32342"
},
{
"name": "Jinja",
"bytes": "206"
},
{
"name": "Jupyter Notebook",
"bytes": "95991"
},
{
"name": "Lua",
"bytes": "200"
},
{
"name": "M4",
"bytes": "111"
},
{
"name": "MATLAB",
"bytes": "31972"
},
{
"name": "Makefile",
"bytes": "81307"
},
{
"name": "OpenSCAD",
"bytes": "14995"
},
{
"name": "PHP",
"bytes": "94"
},
{
"name": "Perl",
"bytes": "46"
},
{
"name": "Processing",
"bytes": "208"
},
{
"name": "Prolog",
"bytes": "454"
},
{
"name": "Python",
"bytes": "1685966"
},
{
"name": "R",
"bytes": "76"
},
{
"name": "Raku",
"bytes": "43"
},
{
"name": "Ruby",
"bytes": "42"
},
{
"name": "Scheme",
"bytes": "649"
},
{
"name": "Shell",
"bytes": "52865"
},
{
"name": "Smalltalk",
"bytes": "55"
},
{
"name": "TeX",
"bytes": "1189"
},
{
"name": "Vue",
"bytes": "49445"
},
{
"name": "XSLT",
"bytes": "1816"
}
],
"symlink_target": ""
} |
from datetime import datetime, timedelta
import functools
import numpy as np
import pandas as pd
from .options import OPTIONS
from .pycompat import (OrderedDict, iteritems, itervalues, unicode_type,
bytes_type, dask_array_type)
def pretty_print(x, numchars):
"""Given an object `x`, call `str(x)` and format the returned string so
that it is numchars long, padding with trailing spaces or truncating with
ellipses as necessary
"""
s = str(x)
if len(s) > numchars:
return s[:(numchars - 3)] + '...'
else:
return s + ' ' * (numchars - len(s))
def wrap_indent(text, start='', length=None):
if length is None:
length = len(start)
indent = '\n' + ' ' * length
return start + indent.join(x for x in text.splitlines())
def _get_indexer_at_least_n_items(shape, n_desired):
assert 0 < n_desired <= np.prod(shape)
cum_items = np.cumprod(shape[::-1])
n_steps = np.argmax(cum_items >= n_desired)
stop = int(np.ceil(float(n_desired) / np.r_[1, cum_items][n_steps]))
indexer = ((0,) * (len(shape) - 1 - n_steps) + (slice(stop),)
+ (slice(None),) * n_steps)
return indexer
def first_n_items(x, n_desired):
"""Returns the first n_desired items of an array"""
# Unfortunately, we can't just do x.flat[:n_desired] here because x might
# not be a numpy.ndarray. Moreover, access to elements of x could be very
# expensive (e.g. if it's only available over DAP), so go out of our way to
# get them in a single call to __getitem__ using only slices.
if n_desired < 1:
raise ValueError('must request at least one item')
if x.size == 0:
# work around for https://github.com/numpy/numpy/issues/5195
return []
if n_desired < x.size:
indexer = _get_indexer_at_least_n_items(x.shape, n_desired)
x = x[indexer]
return np.asarray(x).flat[:n_desired]
def format_timestamp(t):
"""Cast given object to a Timestamp and return a nicely formatted string"""
datetime_str = str(pd.Timestamp(t))
try:
date_str, time_str = datetime_str.split()
except ValueError:
# catch NaT and others that don't split nicely
return datetime_str
else:
if time_str == '00:00:00':
return date_str
else:
return '%sT%s' % (date_str, time_str)
def format_timedelta(t, timedelta_format=None):
"""Cast given object to a Timestamp and return a nicely formatted string"""
timedelta_str = str(pd.Timedelta(t))
try:
days_str, time_str = timedelta_str.split(' days ')
except ValueError:
# catch NaT and others that don't split nicely
return timedelta_str
else:
if timedelta_format == 'date':
return days_str + ' days'
elif timedelta_format == 'time':
return time_str
else:
return timedelta_str
def format_item(x, timedelta_format=None, quote_strings=True):
"""Returns a succinct summary of an object as a string"""
if isinstance(x, (np.datetime64, datetime)):
return format_timestamp(x)
if isinstance(x, (np.timedelta64, timedelta)):
return format_timedelta(x, timedelta_format=timedelta_format)
elif isinstance(x, (unicode_type, bytes_type)):
return repr(x) if quote_strings else x
elif isinstance(x, (float, np.float)):
return '{0:.4}'.format(x)
else:
return str(x)
def format_items(x):
"""Returns a succinct summaries of all items in a sequence as strings"""
x = np.asarray(x)
timedelta_format = 'datetime'
if np.issubdtype(x.dtype, np.timedelta64):
x = np.asarray(x, dtype='timedelta64[ns]')
day_part = (x[~pd.isnull(x)]
.astype('timedelta64[D]')
.astype('timedelta64[ns]'))
time_needed = x != day_part
day_needed = day_part != np.timedelta64(0, 'ns')
if np.logical_not(day_needed).all():
timedelta_format = 'time'
elif np.logical_not(time_needed).all():
timedelta_format = 'date'
formatted = [format_item(xi, timedelta_format) for xi in x]
return formatted
def format_array_flat(items_ndarray, max_width):
"""Return a formatted string for as many items in the flattened version of
items_ndarray that will fit within max_width characters
"""
# every item will take up at least two characters, but we always want to
# print at least one item
max_possibly_relevant = max(int(np.ceil(max_width / 2.0)), 1)
relevant_items = first_n_items(items_ndarray, max_possibly_relevant)
pprint_items = format_items(relevant_items)
cum_len = np.cumsum([len(s) + 1 for s in pprint_items]) - 1
if (max_possibly_relevant < items_ndarray.size
or (cum_len > max_width).any()):
end_padding = ' ...'
count = max(np.argmax((cum_len + len(end_padding)) > max_width), 1)
pprint_items = pprint_items[:count]
else:
end_padding = ''
pprint_str = ' '.join(pprint_items) + end_padding
return pprint_str
def _summarize_var_or_coord(name, var, col_width, show_values=True,
marker=' ', max_width=None):
if max_width is None:
max_width = OPTIONS['display_width']
first_col = pretty_print(' %s %s ' % (marker, name), col_width)
dims_str = '(%s) ' % ', '.join(map(str, var.dims)) if var.dims else ''
front_str = first_col + dims_str + ('%s ' % var.dtype)
if show_values:
values_str = format_array_flat(var, max_width - len(front_str))
else:
values_str = '...'
return front_str + values_str
def _not_remote(var):
"""Helper function to identify if array is positively identifiable as
coming from a remote source.
"""
source = var.encoding.get('source')
if source and source.startswith('http') and not var._in_memory:
return False
return True
def summarize_var(name, var, col_width):
show_values = _not_remote(var)
return _summarize_var_or_coord(name, var, col_width, show_values)
def summarize_coord(name, var, col_width):
is_index = name in var.dims
show_values = is_index or _not_remote(var)
marker = '*' if is_index else ' '
return _summarize_var_or_coord(name, var, col_width, show_values, marker)
def _maybe_truncate(obj, maxlen=500):
s = str(obj)
if len(s) > maxlen:
s = s[:(maxlen - 3)] + '...'
return s
def summarize_attr(key, value, col_width=None):
# ignore col_width for now to more clearly distinguish attributes
return ' %s: %s' % (key, _maybe_truncate(value))
EMPTY_REPR = ' *empty*'
def _calculate_col_width(mapping):
max_name_length = max(len(str(k)) for k in mapping) if mapping else 0
col_width = max(max_name_length, 7) + 6
return col_width
def _mapping_repr(mapping, title, summarizer, col_width=None):
if col_width is None:
col_width = _calculate_col_width(mapping)
summary = ['%s:' % title]
if mapping:
summary += [summarizer(k, v, col_width) for k, v in mapping.items()]
else:
summary += [EMPTY_REPR]
return '\n'.join(summary)
coords_repr = functools.partial(_mapping_repr, title='Coordinates',
summarizer=summarize_coord)
vars_repr = functools.partial(_mapping_repr, title='Data variables',
summarizer=summarize_var)
attrs_repr = functools.partial(_mapping_repr, title='Attributes',
summarizer=summarize_attr)
def indexes_repr(indexes):
summary = []
for k, v in indexes.items():
summary.append(wrap_indent(repr(v), '%s: ' % k))
return '\n'.join(summary)
def array_repr(arr):
# used for DataArray, Variable and Coordinate
if hasattr(arr, 'name') and arr.name is not None:
name_str = '%r ' % arr.name
else:
name_str = ''
dim_summary = ', '.join('%s: %s' % (k, v) for k, v
in zip(arr.dims, arr.shape))
summary = ['<xray.%s %s(%s)>'% (type(arr).__name__, name_str, dim_summary)]
if isinstance(getattr(arr, 'variable', arr)._data, dask_array_type):
summary.append(repr(arr.data))
elif arr._in_memory or arr.size < 1e5:
summary.append(repr(arr.values))
else:
summary.append('[%s values with dtype=%s]' % (arr.size, arr.dtype))
if hasattr(arr, 'coords'):
if arr.coords:
summary.append(repr(arr.coords))
if arr.attrs:
summary.append(attrs_repr(arr.attrs))
return '\n'.join(summary)
def dataset_repr(ds):
summary = ['<xray.%s>' % type(ds).__name__]
col_width = _calculate_col_width(ds)
dims_start = pretty_print('Dimensions:', col_width)
all_dim_strings = ['%s: %s' % (k, v) for k, v in iteritems(ds.dims)]
summary.append('%s(%s)' % (dims_start, ', '.join(all_dim_strings)))
summary.append(coords_repr(ds.coords, col_width=col_width))
summary.append(vars_repr(ds.data_vars, col_width=col_width))
if ds.attrs:
summary.append(attrs_repr(ds.attrs))
return '\n'.join(summary)
| {
"content_hash": "4b724401f41551cca461116eb8ae2078",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 79,
"avg_line_length": 32.94604316546763,
"alnum_prop": 0.6103286384976526,
"repo_name": "cpaulik/xray",
"id": "c2de46fa1be315b7b40059d00c37880d0541096d",
"size": "9159",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "xray/core/formatting.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "PowerShell",
"bytes": "2986"
},
{
"name": "Python",
"bytes": "755103"
},
{
"name": "Shell",
"bytes": "161"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.