repo_name
stringlengths 4
116
| path
stringlengths 3
942
| size
stringlengths 1
7
| content
stringlengths 3
1.05M
| license
stringclasses 15
values |
---|---|---|---|---|
didimitrov/Shop | MyOnlineShop/MyOnlineShop.Models/ShopingCartModels/OrderDetail.cs | 505 | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MyOnlineShop.Models.ShopingCartModels
{
public class OrderDetail
{
public int OrderDetailId { get; set; }
public int OrderId { get; set; }
public int ProductId { get; set; }
public int Quantity { get; set; }
public decimal UnitPrice { get; set; }
public virtual Product Product { get; set; }
public virtual Order Order { get; set; }
}
}
| mit |
bburnichon/PHPExiftool | lib/PHPExiftool/Driver/Tag/Casio/SpecialEffectLevel.php | 851 | <?php
/*
* This file is part of the PHPExifTool package.
*
* (c) Alchemy <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPExiftool\Driver\Tag\Casio;
use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;
/**
* @ExclusionPolicy("all")
*/
class SpecialEffectLevel extends AbstractTag
{
protected $Id = 12336;
protected $Name = 'SpecialEffectLevel';
protected $FullName = 'Casio::Type2';
protected $GroupName = 'Casio';
protected $g0 = 'MakerNotes';
protected $g1 = 'Casio';
protected $g2 = 'Camera';
protected $Type = 'int16u';
protected $Writable = true;
protected $Description = 'Special Effect Level';
protected $flag_Permanent = true;
}
| mit |
selvasingh/azure-sdk-for-java | sdk/mediaservices/mgmt-v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EnabledProtocols.java | 2825 | /**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.mediaservices.v2018_07_01;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Class to specify which protocols are enabled.
*/
public class EnabledProtocols {
/**
* Enable Download protocol or not.
*/
@JsonProperty(value = "download", required = true)
private boolean download;
/**
* Enable DASH protocol or not.
*/
@JsonProperty(value = "dash", required = true)
private boolean dash;
/**
* Enable HLS protocol or not.
*/
@JsonProperty(value = "hls", required = true)
private boolean hls;
/**
* Enable SmoothStreaming protocol or not.
*/
@JsonProperty(value = "smoothStreaming", required = true)
private boolean smoothStreaming;
/**
* Get enable Download protocol or not.
*
* @return the download value
*/
public boolean download() {
return this.download;
}
/**
* Set enable Download protocol or not.
*
* @param download the download value to set
* @return the EnabledProtocols object itself.
*/
public EnabledProtocols withDownload(boolean download) {
this.download = download;
return this;
}
/**
* Get enable DASH protocol or not.
*
* @return the dash value
*/
public boolean dash() {
return this.dash;
}
/**
* Set enable DASH protocol or not.
*
* @param dash the dash value to set
* @return the EnabledProtocols object itself.
*/
public EnabledProtocols withDash(boolean dash) {
this.dash = dash;
return this;
}
/**
* Get enable HLS protocol or not.
*
* @return the hls value
*/
public boolean hls() {
return this.hls;
}
/**
* Set enable HLS protocol or not.
*
* @param hls the hls value to set
* @return the EnabledProtocols object itself.
*/
public EnabledProtocols withHls(boolean hls) {
this.hls = hls;
return this;
}
/**
* Get enable SmoothStreaming protocol or not.
*
* @return the smoothStreaming value
*/
public boolean smoothStreaming() {
return this.smoothStreaming;
}
/**
* Set enable SmoothStreaming protocol or not.
*
* @param smoothStreaming the smoothStreaming value to set
* @return the EnabledProtocols object itself.
*/
public EnabledProtocols withSmoothStreaming(boolean smoothStreaming) {
this.smoothStreaming = smoothStreaming;
return this;
}
}
| mit |
lucidphp/lucid | lucid/template/LICENSE.md | 1061 | Copyright (c) 2014-2016 Thomas Appel
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| mit |
ManiacalLabs/BiblioPixel | bibliopixel/project/types/spi_interface.py | 424 | import functools
from ...drivers.spi_interfaces import SPI_INTERFACES
USAGE = """
A spi_interface is represented by a string.
Possible values are """ + ', '.join(sorted(SPI_INTERFACES.__members__))
@functools.singledispatch
def make(c):
raise ValueError("Don't understand type %s" % type(c), USAGE)
@make.register(SPI_INTERFACES)
def _(c):
return c
@make.register(str)
def _(c):
return SPI_INTERFACES[c]
| mit |
karimnaaji/tangram-es | tests/unit/labelTests.cpp | 4905 | #define CATCH_CONFIG_MAIN
#include "catch/catch.hpp"
#include "tangram.h"
#include "tile/labels/label.h"
#include "glm/gtc/matrix_transform.hpp"
#define EPSILON 0.00001
glm::mat4 mvp;
glm::vec2 screen;
TEST_CASE( "Ensure the transition from wait -> sleep when occlusion happens", "[Core][Label]" ) {
Label l({}, "label", 0, Label::Type::LINE);
REQUIRE(l.getState() == Label::State::WAIT_OCC);
l.setOcclusion(true);
l.update(mvp, screen, 0);
REQUIRE(l.getState() != Label::State::SLEEP);
REQUIRE(l.getState() == Label::State::WAIT_OCC);
REQUIRE(l.canOcclude());
l.setOcclusion(true);
l.occlusionSolved();
l.update(mvp, screen, 0);
REQUIRE(l.getState() == Label::State::SLEEP);
REQUIRE(!l.canOcclude());
}
TEST_CASE( "Ensure the transition from wait -> visible when no occlusion happens", "[Core][Label]" ) {
Label l({}, "label", 0, Label::Type::LINE);
REQUIRE(l.getState() == Label::State::WAIT_OCC);
l.setOcclusion(false);
l.update(mvp, screen, 0);
REQUIRE(l.getState() != Label::State::SLEEP);
REQUIRE(l.getState() == Label::State::WAIT_OCC);
l.setOcclusion(false);
l.occlusionSolved();
l.update(mvp, screen, 0);
REQUIRE(l.getState() == Label::State::FADING_IN);
REQUIRE(l.canOcclude());
l.update(mvp, screen, 1.0);
REQUIRE(l.getState() == Label::State::VISIBLE);
REQUIRE(l.canOcclude());
}
TEST_CASE( "Ensure the end state after occlusion is leep state", "[Core][Label]" ) {
Label l({}, "label", 0, Label::Type::LINE);
l.setOcclusion(false);
l.occlusionSolved();
l.update(mvp, screen, 0);
REQUIRE(l.getState() == Label::State::FADING_IN);
REQUIRE(l.canOcclude());
l.setOcclusion(true);
l.occlusionSolved();
l.update(mvp, screen, 0);
REQUIRE(l.getState() == Label::State::SLEEP);
REQUIRE(!l.canOcclude());
}
TEST_CASE( "Ensure the out of screen state transition", "[Core][Label]" ) {
Label l({ glm::vec2(500.0) }, "label", 0, Label::Type::POINT);
REQUIRE(l.getState() == Label::State::WAIT_OCC);
double screenWidth = 250.0, screenHeight = 250.0;
glm::mat4 p = glm::ortho(0.0, screenWidth, screenHeight, 0.0, 0.0, 1000.0);
l.update(p, glm::vec2(screenWidth, screenHeight), 0);
REQUIRE(l.getState() == Label::State::OUT_OF_SCREEN);
REQUIRE(!l.canOcclude());
p = glm::ortho(0.0, screenWidth * 4.0, screenHeight * 4.0, 0.0, 0.0, 1000.0);
l.update(p, glm::vec2(screenWidth * 4.0, screenHeight * 4.0), 0);
REQUIRE(l.getState() == Label::State::WAIT_OCC);
REQUIRE(l.canOcclude());
l.setOcclusion(false);
l.occlusionSolved();
l.update(mvp, screen, 0);
REQUIRE(l.getState() == Label::State::FADING_IN);
REQUIRE(l.canOcclude());
l.update(mvp, screen, 1.0);
REQUIRE(l.getState() == Label::State::VISIBLE);
REQUIRE(l.canOcclude());
}
TEST_CASE( "Ensure debug labels are always visible and cannot occlude", "[Core][Label]" ) {
Label l({}, "label", 0, Label::Type::DEBUG);
REQUIRE(l.getState() == Label::State::VISIBLE);
REQUIRE(!l.canOcclude());
l.update(mvp, screen, 0);
REQUIRE(l.getState() == Label::State::VISIBLE);
REQUIRE(!l.canOcclude());
}
TEST_CASE( "Linear interpolation", "[Core][Label][Fade]" ) {
FadeEffect fadeOut(false, FadeEffect::Interpolation::LINEAR, 1.0);
REQUIRE(fadeOut.update(0.0) == 1.0);
REQUIRE(fadeOut.update(0.5) == 0.5);
REQUIRE(fadeOut.update(0.5) == 0.0);
fadeOut.update(0.01);
REQUIRE(fadeOut.isFinished());
FadeEffect fadeIn(true, FadeEffect::Interpolation::LINEAR, 1.0);
REQUIRE(fadeIn.update(0.0) == 0.0);
REQUIRE(fadeIn.update(0.5) == 0.5);
REQUIRE(fadeIn.update(0.5) == 1.0);
fadeIn.update(0.01);
REQUIRE(fadeIn.isFinished());
}
TEST_CASE( "Pow interpolation", "[Core][Label][Fade]" ) {
FadeEffect fadeOut(false, FadeEffect::Interpolation::POW, 1.0);
REQUIRE(fadeOut.update(0.0) == 1.0);
REQUIRE(fadeOut.update(0.5) == 0.75);
REQUIRE(fadeOut.update(0.5) == 0.0);
fadeOut.update(0.01);
REQUIRE(fadeOut.isFinished());
FadeEffect fadeIn(true, FadeEffect::Interpolation::POW, 1.0);
REQUIRE(fadeIn.update(0.0) == 0.0);
REQUIRE(fadeIn.update(0.5) == 0.25);
REQUIRE(fadeIn.update(0.5) == 1.0);
fadeIn.update(0.01);
REQUIRE(fadeIn.isFinished());
}
TEST_CASE( "Sine interpolation", "[Core][Label][Fade]" ) {
FadeEffect fadeOut(false, FadeEffect::Interpolation::SINE, 1.0);
REQUIRE(abs(fadeOut.update(0.0) - 1.0) < EPSILON);
REQUIRE(abs(fadeOut.update(1.0) - 0.0) < EPSILON);
fadeOut.update(0.01);
REQUIRE(fadeOut.isFinished());
FadeEffect fadeIn(true, FadeEffect::Interpolation::SINE, 1.0);
REQUIRE(abs(fadeIn.update(0.0) - 0.0) < EPSILON);
REQUIRE(abs(fadeIn.update(1.0) - 1.0) < EPSILON);
fadeIn.update(0.01);
REQUIRE(fadeIn.isFinished());
}
| mit |
cruzj6/orderUpCompiler | compiler_back/source/lexer/token.cpp | 1085 | #include "lexer/token.h"
#include <iostream>
Token::Token(int t)
{
tag = t;
}
//For unknown tokens
Token::Token(std::string t)
{
//Get ascii for each character
for(int i = 0; i < t.length(); i++)
{
//Give the tag some arbitrary value
tag = -1;
asciiValuesTag.push_back(t[i]);
}
unknownToken = t;
}
std::string Token::getString()
{
std::stringstream ss;
if(asciiValuesTag.size() > 0)
{
ss << "TOKEN: Tag is ";
std::list<int>::iterator it;
for(it = asciiValuesTag.begin(); it != asciiValuesTag.end(); it++)
{
ss << static_cast<char>(*it);
}
}
else ss << "TOKEN: Tag is " << static_cast<char>(tag);
return ss.str();
}
std::string Token::toString()
{
std::stringstream ss;
ss << (char)tag;
return ss.str();
}
std::string Token::getName()
{
std::stringstream ss;
if(asciiValuesTag.size() > 0)
{
std::list<int>::iterator it;
for(it = asciiValuesTag.begin(); it != asciiValuesTag.end(); it++)
{
ss << static_cast<char>(*it);
}
}
else ss << static_cast<char>(tag);
return ss.str();
}
| mit |
izzyalonso/tndata_backend | tndata_backend/userprofile/migrations/0011_create_places.py | 622 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
# Some initial, primary places.
PLACES = [
('Work', 'work'),
('Home', 'home'),
('School', 'school'),
]
def create_primary_place(apps, schema_editor=None):
Place = apps.get_model("userprofile", "Place")
for name, slug in PLACES:
Place.objects.create(name=name, slug=slug, primary=True)
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0010_auto_20150908_2010'),
]
operations = [
migrations.RunPython(create_primary_place),
]
| mit |
airgames/vuforia-gamekit-integration | Gamekit/compilation/Engine/CMakeFiles/OgreKitCore.dir/DependInfo.cmake | 5991 | # The set of languages for which implicit dependencies are needed:
SET(CMAKE_DEPENDS_LANGUAGES
"CXX"
)
# The set of files for implicit dependencies of each language:
SET(CMAKE_DEPENDS_CHECK_CXX
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/Engine/Script/Api/Generated/OgreKitLua.cpp" "/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Engine/CMakeFiles/OgreKitCore.dir/Script/Api/Generated/OgreKitLua.cpp.o"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/Engine/Thread/gkSyncObj.cpp" "/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Engine/CMakeFiles/OgreKitCore.dir/Thread/gkSyncObj.cpp.o"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/Ogre-1.8rc/Bin/OgreKitCore/compile_OgreKitCore_0.cpp" "/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Engine/CMakeFiles/OgreKitCore.dir/__/Ogre-1.8rc/Bin/OgreKitCore/compile_OgreKitCore_0.cpp.o"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/Ogre-1.8rc/Bin/OgreKitCore/compile_OgreKitCore_1.cpp" "/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Engine/CMakeFiles/OgreKitCore.dir/__/Ogre-1.8rc/Bin/OgreKitCore/compile_OgreKitCore_1.cpp.o"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/Ogre-1.8rc/Bin/OgreKitCore/compile_OgreKitCore_2.cpp" "/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Engine/CMakeFiles/OgreKitCore.dir/__/Ogre-1.8rc/Bin/OgreKitCore/compile_OgreKitCore_2.cpp.o"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/Ogre-1.8rc/Bin/OgreKitCore/compile_OgreKitCore_3.cpp" "/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Engine/CMakeFiles/OgreKitCore.dir/__/Ogre-1.8rc/Bin/OgreKitCore/compile_OgreKitCore_3.cpp.o"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/Engine/gkWindowSystem.cpp" "/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Engine/CMakeFiles/OgreKitCore.dir/gkWindowSystem.cpp.o"
)
SET(CMAKE_CXX_COMPILER_ID "GNU")
# Preprocessor definitions for this target.
SET(CMAKE_TARGET_DEFINITIONS
"ANDROID"
"__ARM_ARCH_5__"
"__ARM_ARCH_5T__"
"__ARM_ARCH_5E__"
"__ARM_ARCH_5TE__"
"UT_USE_ZLIB"
"STATIC_LINKED"
)
# Targets to which this target links.
SET(CMAKE_TARGET_LINKED_INFO_FILES
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Ogre-1.8rc/OgreMain/CMakeFiles/OgreMain.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Dependencies/Source/FreeImage/CMakeFiles/FreeImage.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Dependencies/Source/FreeType/CMakeFiles/freetype.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Dependencies/Source/GameKit/Utils/CMakeFiles/GameKitUtils.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Dependencies/Source/OIS/CMakeFiles/OIS.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Dependencies/Source/FreeImage/ZLib/CMakeFiles/ZLib.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Dependencies/Source/GameKit/AnimKit/CMakeFiles/AnimKit.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/FileTools/File/CMakeFiles/fbtFile.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/FileTools/FileFormats/Blend/CMakeFiles/bfBlend.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Ogre-1.8rc/Components/RTShaderSystem/CMakeFiles/OgreRTShaderSystem.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Dependencies/Source/Lua/lua/CMakeFiles/Lua.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Dependencies/Source/ZZipLib/CMakeFiles/ZZipLib.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/bullet/src/BulletDynamics/CMakeFiles/BulletDynamics.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/bullet/src/BulletCollision/CMakeFiles/BulletCollision.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/bullet/src/LinearMath/CMakeFiles/LinearMath.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Ogre-1.8rc/PlugIns/ParticleFX/CMakeFiles/Plugin_ParticleFX.dir/DependInfo.cmake"
"/Users/erikvillegas/Development/Android/vuforia-sdk-android-1-5-9/samples/airgames/tools/Gamekit/compilation/Ogre-1.8rc/RenderSystems/GLES2/CMakeFiles/RenderSystem_GLES2.dir/DependInfo.cmake"
)
| mit |
bgegham/davideluna | public/ckeditor/plugins/a11yhelp/dialogs/lang/sv.js | 4348 | /*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("a11yhelp","sv",{title:"Hjälpmedelsinstruktioner",contents:"Hjälpinnehåll. För att stänga denna dialogruta trycker du på ESC.",legend:[{name:"Allmänt",items:[{name:"Editor verktygsfält",legend:"Tryck på ${toolbarFocus} för att navigera till verktygsfältet. Flytta till nästa och föregående verktygsfältsgrupp med TAB och SHIFT+TAB. Flytta till nästa och föregående knapp i verktygsfältet med HÖGERPIL eller VÄNSTERPIL. Tryck SPACE eller ENTER för att aktivera knappen i verktygsfältet."},
{name:"Dialogeditor",legend:"Inuti en dialogruta, tryck TAB för att navigera till nästa fält i dialogrutan, tryck SKIFT+TAB för att flytta till föregående fält, tryck ENTER för att skicka. Du avbryter och stänger dialogen med ESC. För dialogrutor som har flera flikar, tryck ALT+F10 eller TAB för att navigera till fliklistan. med fliklistan vald flytta till nästa och föregående flik med HÖGER- eller VÄNSTERPIL."},{name:"Editor för innehållsmeny",legend:"Tryck på $ {contextMenu} eller PROGRAMTANGENTEN för att öppna snabbmenyn. Flytta sedan till nästa menyalternativ med TAB eller NEDPIL. Flytta till föregående alternativ med SHIFT + TABB eller UPPIL. Tryck Space eller ENTER för att välja menyalternativ. Öppna undermeny av nuvarande alternativ med SPACE eller ENTER eller HÖGERPIL. Gå tillbaka till överordnade menyalternativ med ESC eller VÄNSTERPIL. Stäng snabbmenyn med ESC."},
{name:"Editor för list-box",legend:"Inuti en list-box, gå till nästa listobjekt med TAB eller NEDPIL. Flytta till föregående listobjekt med SHIFT+TAB eller UPPIL. Tryck SPACE eller ENTER för att välja listan alternativet. Tryck ESC för att stänga list-boxen."},{name:"Editor för elementens sökväg",legend:"Tryck på ${elementsPathFocus} för att navigera till verktygsfältet för elementens sökvägar. Flytta till nästa elementknapp med TAB eller HÖGERPIL. Flytta till föregående knapp med SKIFT+TAB eller VÄNSTERPIL. Tryck SPACE eller ENTER för att välja element i redigeraren."}]},
{name:"Kommandon",items:[{name:"Ångra kommando",legend:"Tryck på ${undo}"},{name:"Gör om kommando",legend:"Tryck på ${redo}"},{name:"Kommandot fet stil",legend:"Tryck på ${bold}"},{name:"Kommandot kursiv",legend:"Tryck på ${italic}"},{name:"Kommandot understruken",legend:"Tryck på ${underline}"},{name:"Kommandot länk",legend:"Tryck på ${link}"},{name:"Verktygsfält Dölj kommandot",legend:"Tryck på ${toolbarCollapse}"},{name:"Gå till föregående fokus plats",legend:"Tryck på ${accessPreviousSpace} för att gå till närmast onåbara utrymme före markören, exempel: två intilliggande HR element. Repetera tangentkombinationen för att gå till nästa."},
{name:"Tillgå nästa fokuskommandots utrymme",legend:"Tryck ${accessNextSpace} på för att komma åt den närmaste onåbar fokus utrymme efter cirkumflex, till exempel: två intilliggande HR element. Upprepa tangentkombinationen för att nå avlägsna fokus utrymmen."},{name:"Hjälp om tillgänglighet",legend:"Tryck ${a11yHelp}"},{name:"Klistra in som vanlig text",legend:"Tryck ${pastetext}",legendEdge:"Tryck ${pastetext}, följt av ${paste}"}]}],tab:"Tab",pause:"Paus",capslock:"Caps lock",escape:"Escape",pageUp:"Sida Up",
pageDown:"Sida Ned",leftArrow:"Vänsterpil",upArrow:"Uppil",rightArrow:"Högerpil",downArrow:"Nedåtpil",insert:"Infoga",leftWindowKey:"Vänster Windowstangent",rightWindowKey:"Höger Windowstangent",selectKey:"Välj tangent",numpad0:"Nummer 0",numpad1:"Nummer 1",numpad2:"Nummer 2",numpad3:"Nummer 3",numpad4:"Nummer 4",numpad5:"Nummer 5",numpad6:"Nummer 6",numpad7:"Nummer 7",numpad8:"Nummer 8",numpad9:"Nummer 9",multiply:"Multiplicera",add:"Addera",subtract:"Minus",decimalPoint:"Decimalpunkt",divide:"Dividera",
f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",semiColon:"Semikolon",equalSign:"Lika med tecken",comma:"Komma",dash:"Minus",period:"Punkt",forwardSlash:"Snedstreck framåt",graveAccent:"Accent",openBracket:"Öppningsparentes",backSlash:"Snedstreck bakåt",closeBracket:"Slutparentes",singleQuote:"Enkelt Citattecken"}); | mit |
unboxed/unboxed.co | source/blog/2016-09-05-docker-re-bundling.html.markdown | 5789 | ---
authors:
- Charlie Egan
tags:
- Rails
- Innovation
main_image: "https://s3-eu-west-1.amazonaws.com/unboxed-web-images/3d394385496873a4c7111eb840bdde38.jpg"
date: "2016-09-05 12:00 +0000"
published: true
title: "Development Re-bundling in Dockerland"
has_syntax: true
---
# Development Re-bundling in Dockerland

When starting out development on a Dockerized application, adjusting Dockerfiles and rebuilding images is a common task. Bringing together two separate services, as well as applying some gem security patches, we found ourselves doing this a lot. The repeated bundle installations quickly became very painful. Multi-tasking and regularly switching development branches only increased the number of repeated builds required.
### Docker Build 101
For those not familiar with Docker's vocabulary here's a quick intro. Docker containers run your application, containers are based on an image. Images are a blueprint that can be reused to spawn instances of containers and contain the environment in which the application runs.
Images are built up in a series of 'layers'. Each layer represents a change to the previous layer. For example, this excerpt from a Dockerfile:
```dockerfile
...
COPY Gemfile /app/Gemfile
COPY Gemfile.lock /app/Gemfile.lock
RUN bundle install
...
```
The first image layer contains includes the Gemfile, the second additionally contains the Gemfile.lock. The third layer contains a completed bundle install. Building this layer requires network access and can take some time for larger Gemfiles. In development, as you edit the Gemfile and Dockerfiles you rebuild the image often. Generating this bundle install layer each time takes significant time.
[Docker Compose](https://docs.docker.com/compose/compose-file/), mentioned later, is a tool for building and running multiple services (app, database, redis).
### The Problem
Most Dockerfile layers can be built up without network access; however, installing & updating gems is slow during Docker builds as gems must be fetched from the source again. Network traffic is not cached when building images.
This isn't usually a problem but when working on a number of branches, all making changes to the Gem/Dockerfile, repeatedly installing the same dependencies gets tiresome in development when changes are frequent.
### Solutions?
There are [various](https://medium.com/@fbzga/how-to-cache-bundle-install-with-docker-7bed453a5800#.g4id0no96) [posts](http://bradgessler.com/articles/docker-bundler/) [advocating](https://cookieshq.co.uk/posts/common-problems-when-starting-with-docker-and-rails/) a 'bundler cache service' in docker-compose. This new service simply offers a place for the app to manage it's dependencies _when running_. The issue here is that rebuilding the application's image (which we were doing often as we made other edits to Dockerfiles) still requires all the gems to be fetched again as the connected service, is, quite sensibly, not connected during the build process.
This method only prevents repeated clean bundle installs if you're never rebuilding application images. Jumping between different branches (in the midst of updating gems and other edits to the Dockerfiles) these 'runtime bundle caches' were of little use.
There are other options out there; [cumulatively building up multiple Gemfiles](https://github.com/cpuguy83/docker-rails-dev-demo/blob/master/Dockerfile#L17) or routing Docker's connection through a local caching proxy for example. This would require regular Dockerfile edits (Gemfile.tip.tip?) or additional developer environment setup (proxy).
At this point you've already accepted that the dev Dockerfile has some adjustments to aid development work (the production container still does a full bundle install during builds). With that in mind we started looked for other options.
### 'Just-in-time re-bundling'
We came to the conclusion that it's not really possible to have a cache when building docker images - nor would we really want to (works on my machine...). Instead we opted to only install gems to the bundle cache service (as above) when the container _runs_.
First we created a bundle cache service in docker-compose, as outlined in the linked posts above:
```yml
bundle_cache:
image: busybox
volumes:
- /bundle
```
Next we created an entrypoint script for our container, this script runs bundle install before any command issued. Here the container command is run at `exec "$@"`, after checking and optionally installing the bundle.
```bash
#!/bin/bash
set -e
bundle check || bundle install
exec "$@"
```
This entry point is then added used in our service Dockerfile:
```dockerfile
FROM ruby
WORKDIR /app
COPY . /app
COPY ./entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ruby -e 'puts "Output of default command"'
```
Note that bundle install is not referenced in the Dockerfile, this means the container can be built quickly without network access. Only when the first container starts is the bundle installed to the cache, this is then used by future containers. Removing the volume for the bundle cache would give you a truly clean start - should you want one.
***
This was our development solution. It's not ideal; the initial container run is held up by the bundle install; it's not immediately clear where the bundle install happens and it's another difference added to the list of deviations from the production Dockerfile. That said, it does 'work' and speeds up the process of editing Gem & Dockerfiles.
There's an [example repo](https://github.com/charlieegan3/docker-bundler-caching) with the barebones config for those interested.
| mit |
emn178/js-sha1 | tests/node-test.js | 940 | // Node.js env
expect = require('expect.js');
sha1 = require('../src/sha1.js');
require('./test.js');
delete require.cache[require.resolve('../src/sha1.js')];
delete require.cache[require.resolve('./test.js')];
sha1 = null;
// Webpack browser env
JS_SHA1_NO_NODE_JS = true;
window = global;
sha1 = require('../src/sha1.js');
require('./test.js');
delete require.cache[require.resolve('../src/sha1.js')];
delete require.cache[require.resolve('./test.js')];
sha1 = null;
// browser env
JS_SHA1_NO_NODE_JS = true;
JS_SHA1_NO_COMMON_JS = true;
window = global;
require('../src/sha1.js');
require('./test.js');
delete require.cache[require.resolve('../src/sha1.js')];
delete require.cache[require.resolve('./test.js')];
sha1 = null;
// browser AMD
JS_SHA1_NO_NODE_JS = true;
JS_SHA1_NO_COMMON_JS = true;
window = global;
define = function (func) {
sha1 = func();
require('./test.js');
};
define.amd = true;
require('../src/sha1.js');
| mit |
DatenMetzgerX/parallel.es | src/common/parallel/slave/register-parallel-worker-functions.ts | 1346 | import {IFunctionLookupTable} from "../../function/function-lookup-table";
import {ParallelWorkerFunctionIds} from "./parallel-worker-functions";
import {identity} from "../../util/identity";
import {filterIterator} from "./filter-iterator";
import {mapIterator} from "./map-iterator";
import {parallelJobExecutor} from "./parallel-job-executor";
import {rangeIterator} from "./range-iterator";
import {reduceIterator} from "./reduce-iterator";
import {toIterator} from "../../util/arrays";
/**
* Registers the static parallel functions
* @param lookupTable the table into which the function should be registered
*/
export function registerStaticParallelFunctions(lookupTable: IFunctionLookupTable) {
lookupTable.registerStaticFunction(ParallelWorkerFunctionIds.IDENTITY, identity);
lookupTable.registerStaticFunction(ParallelWorkerFunctionIds.FILTER, filterIterator);
lookupTable.registerStaticFunction(ParallelWorkerFunctionIds.MAP, mapIterator);
lookupTable.registerStaticFunction(ParallelWorkerFunctionIds.PARALLEL_JOB_EXECUTOR, parallelJobExecutor);
lookupTable.registerStaticFunction(ParallelWorkerFunctionIds.RANGE, rangeIterator);
lookupTable.registerStaticFunction(ParallelWorkerFunctionIds.REDUCE, reduceIterator);
lookupTable.registerStaticFunction(ParallelWorkerFunctionIds.TO_ITERATOR, toIterator);
}
| mit |
funk-overload/funky_leds | color-picker-master/color-picker.state.html | 876 | <!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Color Picker</title>
<link href="color-picker.min.css" rel="stylesheet">
</head>
<body>
<p>Show and hide color picker with a button.</p>
<p><input type="text"> <button>Pick a Color</button></p>
<script src="color-picker.min.js"></script>
<script>
var picker = new CP(document.querySelector('input'), false),
button = document.querySelector('button'),
button_html = button.innerHTML;
picker.on("change", function(color) {
this.target.value = '#' + color;
});
button.addEventListener("click", function(e) {
picker[picker.visible ? 'exit' : 'enter']();
this.innerHTML = picker.visible ? '✔' : button_html;
}, false);
</script>
</body>
</html> | mit |
Grinch/SpongeCommon | src/main/java/org/spongepowered/common/SpongeBootstrap.java | 4287 | /*
* This file is part of Sponge, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.common;
import com.google.inject.Inject;
import net.minecraft.server.dedicated.DedicatedServer;
import org.spongepowered.api.Platform;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.command.CommandManager;
import org.spongepowered.api.service.ServiceManager;
import org.spongepowered.api.service.ban.BanService;
import org.spongepowered.api.service.pagination.PaginationService;
import org.spongepowered.api.service.permission.PermissionService;
import org.spongepowered.api.service.rcon.RconService;
import org.spongepowered.api.service.sql.SqlService;
import org.spongepowered.api.service.user.UserStorageService;
import org.spongepowered.api.service.whitelist.WhitelistService;
import org.spongepowered.api.util.annotation.NonnullByDefault;
import org.spongepowered.common.command.SpongeCommands;
import org.spongepowered.common.service.ban.SpongeBanService;
import org.spongepowered.common.service.pagination.SpongePaginationService;
import org.spongepowered.common.service.rcon.MinecraftRconService;
import org.spongepowered.common.service.sql.SqlServiceImpl;
import org.spongepowered.common.service.user.SpongeUserStorageService;
import org.spongepowered.common.service.whitelist.SpongeWhitelistService;
import org.spongepowered.common.text.action.SpongeCallbackHolder;
import org.spongepowered.common.util.SpongeUsernameCache;
/**
* Used to setup the ecosystem.
*/
@NonnullByDefault
public final class SpongeBootstrap {
@Inject private static ServiceManager serviceManager;
@Inject private static CommandManager commandManager;
public static void initializeServices() {
registerService(SqlService.class, new SqlServiceImpl());
registerService(PaginationService.class, new SpongePaginationService());
if (SpongeImpl.getGame().getPlatform().getType() == Platform.Type.SERVER) {
registerService(RconService.class, new MinecraftRconService((DedicatedServer) Sponge.getServer()));
}
registerService(UserStorageService.class, new SpongeUserStorageService());
registerService(BanService.class, new SpongeBanService());
registerService(WhitelistService.class, new SpongeWhitelistService());
SpongeInternalListeners.getInstance().registerServiceCallback(PermissionService.class, input -> SpongeImpl.getGame().getServer().getConsole().getContainingCollection());
SpongeUsernameCache.load();
}
public static void initializeCommands() {
commandManager.register(SpongeImpl.getPlugin(), SpongeCommands.createSpongeCommand(), "sponge", "sp");
commandManager.register(SpongeImpl.getPlugin(), SpongeCommands.createHelpCommand(), "help", "?");
commandManager.register(SpongeImpl.getPlugin(), SpongeCallbackHolder.getInstance().createCommand(), SpongeCallbackHolder.CALLBACK_COMMAND);
}
private static <T> void registerService(Class<T> serviceClass, T serviceImpl) {
serviceManager.setProvider(SpongeImpl.getPlugin(), serviceClass, serviceImpl);
}
}
| mit |
gabrielburnworth/Farmbot-Web-App | frontend/settings/transfer_ownership/transfer_ownership.ts | 737 | import { Farmbot } from "farmbot";
import { createTransferCert } from "./create_transfer_cert";
import { toPairs } from "../../util";
import { getDevice } from "../../device";
export interface TransferProps {
email: string;
password: string;
device: Farmbot;
}
/** Pass control of your device over to another user. */
export async function transferOwnership(input: TransferProps): Promise<void> {
const { email, device } = input;
try {
const secret = await createTransferCert(input);
const body = toPairs({ email, secret });
await device.send(getDevice().rpcShim([{
kind: "change_ownership", args: {}, body
}]));
return Promise.resolve();
} catch (error) {
return Promise.reject(error);
}
}
| mit |
zanemayo/ember-cli | tests/unit/commands/uninstall-npm-test.js | 2523 | 'use strict';
var expect = require('chai').expect;
var stub = require('../../helpers/stub').stub;
var commandOptions = require('../../factories/command-options');
var UninstallCommand = require('../../../lib/commands/uninstall-npm');
var Task = require('../../../lib/models/task');
describe('uninstall:npm command', function() {
var command, options, tasks, npmInstance;
beforeEach(function() {
tasks = {
NpmUninstall: Task.extend({
init: function() {
npmInstance = this;
}
})
};
options = commandOptions({
settings: {},
project: {
name: function() {
return 'some-random-name';
},
isEmberCLIProject: function() {
return true;
}
},
tasks: tasks
});
stub(tasks.NpmUninstall.prototype, 'run');
command = new UninstallCommand(options);
});
afterEach(function() {
tasks.NpmUninstall.prototype.run.restore();
});
it('initializes npm task with ui, project and analytics', function() {
return command.validateAndRun([]).then(function() {
expect(npmInstance.ui, 'ui was set');
expect(npmInstance.project, 'project was set');
expect(npmInstance.analytics, 'analytics was set');
});
});
describe('with no args', function() {
it('runs the npm uninstall task with no packages, save-dev true and save-exact true', function() {
return command.validateAndRun([]).then(function() {
var npmRun = tasks.NpmUninstall.prototype.run;
expect(npmRun.called).to.equal(1, 'expected npm uninstall run was called once');
expect(npmRun.calledWith[0][0]).to.deep.equal({
packages: [],
'save-dev': true,
'save-exact': true
}, 'expected npm uninstall called with no packages, save-dev true, and save-exact true');
});
});
});
describe('with args', function() {
it('runs the npm uninstall task with given packages', function() {
return command.validateAndRun(['moment', 'lodash']).then(function() {
var npmRun = tasks.NpmUninstall.prototype.run;
expect(npmRun.called).to.equal(1, 'expected npm uninstall run was called once');
expect(npmRun.calledWith[0][0]).to.deep.equal({
packages: ['moment', 'lodash'],
'save-dev': true,
'save-exact': true
}, 'expected npm uninstall called with given packages, save-dev true, and save-exact true');
});
});
});
});
| mit |
NetOfficeFw/NetOffice | Toolbox/Toolbox/Controls/Painter/OverlayPainter.cs | 4964 | using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace NetOffice.DeveloperToolbox.Controls.Painter
{
/// <summary>
/// Support Painter to create a paint event which is possible to use as overlayer
/// </summary>
public partial class OverlayPainter : Component
{
#region Fields
private Form _form;
#endregion
#region Ctor
/// <summary>
/// Creates an instance of the class
/// </summary>
public OverlayPainter()
{
InitializeComponent();
this.Disposed += new EventHandler(OverlayPainter_Disposed);
}
/// <summary>
/// Creates an instance of the class
/// </summary>
/// <param name="container">parent container</param>
public OverlayPainter(IContainer container)
{
container.Add(this);
InitializeComponent();
this.Disposed += new EventHandler(OverlayPainter_Disposed);
}
#endregion
#region Events
/// <summary>
/// Paint event to draw on top as overlayer
/// </summary>
public event EventHandler<PaintEventArgs> Paint;
#endregion
#region Properties
/// <summary>
/// Top level window
/// </summary>
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Form Owner
{
get { return _form; }
set
{
if (value == null)
throw new ArgumentNullException();
if (_form != null)
throw new InvalidOperationException();
_form = value;
_form.Resize += new EventHandler(Form_Resize);
ConnectPaintEventHandlers(_form);
}
}
#endregion
#region Methods
private void ConnectPaintEventHandlers(Control control)
{
control.Paint -= new PaintEventHandler(Control_Paint);
control.Paint += new PaintEventHandler(Control_Paint);
control.ControlAdded -= new ControlEventHandler(Control_ControlAdded);
control.ControlAdded += new ControlEventHandler(Control_ControlAdded);
foreach (Control child in control.Controls)
ConnectPaintEventHandlers(child);
}
private void DisconnectPaintEventHandlers(Control control)
{
control.Paint -= new PaintEventHandler(Control_Paint);
control.ControlAdded -= new ControlEventHandler(Control_ControlAdded);
foreach (Control child in control.Controls)
DisconnectPaintEventHandlers(child);
}
private void OnPaint(object sender, PaintEventArgs e)
{
if (Paint != null)
Paint(sender, e);
}
#endregion
#region Trigger
private void OverlayPainter_Disposed(object sender, EventArgs e)
{
if (null != _form)
DisconnectPaintEventHandlers(_form);
}
private void Form_Resize(object sender, EventArgs e)
{
if(null != _form)
_form.Invalidate(true);
}
private void Control_ControlAdded(object sender, ControlEventArgs e)
{
ConnectPaintEventHandlers(e.Control);
}
private void Control_Paint(object sender, PaintEventArgs e)
{
if (null == _form || _form.IsDisposed)
return;
Control control = sender as Control;
Point location;
if (control == _form)
location = control.Location;
else
{
location = _form.PointToClient(control.Parent.PointToScreen(control.Location));
location += new Size((control.Width - control.ClientSize.Width) / 2, (control.Height - control.ClientSize.Height) / 2);
}
if (control != _form)
e.Graphics.TranslateTransform(-location.X, -location.Y);
OnPaint(sender, e);
}
#endregion
}
}
namespace System.Windows.Forms
{
using System.Drawing;
public static class Extensions
{
/// <summary>
/// Coordinates from control on toplevel control or desktop
/// </summary>
/// <param name="control">target control</param>
/// <returns>coordinates</returns>
public static Rectangle Coordinates(this Control control)
{
Rectangle coordinates;
Form form = control.TopLevelControl as Form;
if (control == form)
coordinates = form.ClientRectangle;
else
coordinates = form.RectangleToClient(control.Parent.RectangleToScreen(control.Bounds));
return coordinates;
}
}
}
| mit |
corbinbs/CORBin | CORBin_System/tests/LONG/passlong-stubs.c | 3739 | /*
* This file was generated by orbit-idl - DO NOT EDIT!
*/
#include <string.h>
#include "passlong.h"
CORBA_long
passlong_foo(passlong _obj, const CORBA_long x, CORBA_Environment * ev)
{
register GIOP_unsigned_long _ORBIT_request_id,
_ORBIT_system_exception_minor;
register CORBA_completion_status _ORBIT_completion_status;
register GIOPSendBuffer *_ORBIT_send_buffer;
register GIOPRecvBuffer *_ORBIT_recv_buffer;
register GIOPConnection *_cnx;
CORBA_long _ORBIT_retval;
if (_obj->servant && _obj->vepv && passlong__classid) {
_ORBIT_retval =
((POA_passlong__epv *) _obj->vepv[passlong__classid])->foo(_obj->
servant,
x, ev);
return _ORBIT_retval;
}
if (0)
return *(&_ORBIT_retval);
_cnx = ORBit_object_get_connection(_obj);
_ORBIT_retry_request:
_ORBIT_send_buffer = NULL;
_ORBIT_recv_buffer = NULL;
_ORBIT_completion_status = CORBA_COMPLETED_NO;
_ORBIT_request_id = GPOINTER_TO_UINT(alloca(0));
{ /* marshalling */
static const struct
{
CORBA_unsigned_long len;
char opname[4];
}
_ORBIT_operation_name_data =
{
4, "foo"};
static const struct iovec _ORBIT_operation_vec =
{ (gpointer) & _ORBIT_operation_name_data, 8 };
_ORBIT_send_buffer =
giop_send_request_buffer_use(_cnx, NULL, _ORBIT_request_id,
CORBA_TRUE,
&(_obj->active_profile->object_key_vec),
&_ORBIT_operation_vec,
&ORBit_default_principal_iovec);
_ORBIT_system_exception_minor = ex_CORBA_COMM_FAILURE;
if (!_ORBIT_send_buffer)
goto _ORBIT_system_exception;
giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER
(_ORBIT_send_buffer), 4);
giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer),
&(x), sizeof(x));
giop_send_buffer_write(_ORBIT_send_buffer);
_ORBIT_completion_status = CORBA_COMPLETED_MAYBE;
giop_send_buffer_unuse(_ORBIT_send_buffer);
_ORBIT_send_buffer = NULL;
}
{ /* demarshalling */
register guchar *_ORBIT_curptr;
_ORBIT_recv_buffer =
giop_recv_reply_buffer_use_2(_cnx, _ORBIT_request_id, TRUE);
if (!_ORBIT_recv_buffer)
goto _ORBIT_system_exception;
_ORBIT_completion_status = CORBA_COMPLETED_YES;
if (_ORBIT_recv_buffer->message.u.reply.reply_status !=
GIOP_NO_EXCEPTION) goto _ORBIT_msg_exception;
_ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
_ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
(*((guint32 *) & (_ORBIT_retval))) =
GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));} else {
_ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
_ORBIT_retval = *((CORBA_long *) _ORBIT_curptr);
}
giop_recv_buffer_unuse(_ORBIT_recv_buffer);
return _ORBIT_retval;
_ORBIT_system_exception:
CORBA_exception_set_system(ev, _ORBIT_system_exception_minor,
_ORBIT_completion_status);
giop_recv_buffer_unuse(_ORBIT_recv_buffer);
giop_send_buffer_unuse(_ORBIT_send_buffer);
return _ORBIT_retval;
_ORBIT_msg_exception:
if (_ORBIT_recv_buffer->message.u.reply.reply_status ==
GIOP_LOCATION_FORWARD) {
if (_obj->forward_locations != NULL)
ORBit_delete_profiles(_obj->forward_locations);
_obj->forward_locations = ORBit_demarshal_IOR(_ORBIT_recv_buffer);
_cnx = ORBit_object_get_forwarded_connection(_obj);
giop_recv_buffer_unuse(_ORBIT_recv_buffer);
goto _ORBIT_retry_request;
} else {
ORBit_handle_exception(_ORBIT_recv_buffer, ev, NULL, _obj->orb);
giop_recv_buffer_unuse(_ORBIT_recv_buffer);
return _ORBIT_retval;
}
}
}
| mit |
DavidShoe/adafruitsample | Lesson_203V2/FullSolution/BME280.cs | 16192 | using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Windows.Devices.Enumeration;
using Windows.Devices.I2c;
namespace Lesson_203V2
{
public class BME280_CalibrationData
{
//BME280 Registers
public UInt16 dig_T1 { get; set; }
public Int16 dig_T2 { get; set; }
public Int16 dig_T3 { get; set; }
public UInt16 dig_P1 { get; set; }
public Int16 dig_P2 { get; set; }
public Int16 dig_P3 { get; set; }
public Int16 dig_P4 { get; set; }
public Int16 dig_P5 { get; set; }
public Int16 dig_P6 { get; set; }
public Int16 dig_P7 { get; set; }
public Int16 dig_P8 { get; set; }
public Int16 dig_P9 { get; set; }
public byte dig_H1 { get; set; }
public Int16 dig_H2 { get; set; }
public byte dig_H3 { get; set; }
public Int16 dig_H4 { get; set; }
public Int16 dig_H5 { get; set; }
public SByte dig_H6 { get; set; }
}
public class BME280Sensor
{
//The BME280 register addresses according the the datasheet: http://www.adafruit.com/datasheets/BST-BME280-DS001-11.pdf
const byte BME280_Address = 0x77;
const byte BME280_Signature = 0x60;
enum eRegisters : byte
{
BME280_REGISTER_DIG_T1 = 0x88,
BME280_REGISTER_DIG_T2 = 0x8A,
BME280_REGISTER_DIG_T3 = 0x8C,
BME280_REGISTER_DIG_P1 = 0x8E,
BME280_REGISTER_DIG_P2 = 0x90,
BME280_REGISTER_DIG_P3 = 0x92,
BME280_REGISTER_DIG_P4 = 0x94,
BME280_REGISTER_DIG_P5 = 0x96,
BME280_REGISTER_DIG_P6 = 0x98,
BME280_REGISTER_DIG_P7 = 0x9A,
BME280_REGISTER_DIG_P8 = 0x9C,
BME280_REGISTER_DIG_P9 = 0x9E,
BME280_REGISTER_DIG_H1 = 0xA1,
BME280_REGISTER_DIG_H2 = 0xE1,
BME280_REGISTER_DIG_H3 = 0xE3,
BME280_REGISTER_DIG_H4 = 0xE4,
BME280_REGISTER_DIG_H5 = 0xE5,
BME280_REGISTER_DIG_H6 = 0xE7,
BME280_REGISTER_CHIPID = 0xD0,
BME280_REGISTER_VERSION = 0xD1,
BME280_REGISTER_SOFTRESET = 0xE0,
BME280_REGISTER_CAL26 = 0xE1, // R calibration stored in 0xE1-0xF0
BME280_REGISTER_CONTROLHUMID = 0xF2,
BME280_REGISTER_CONTROL = 0xF4,
BME280_REGISTER_CONFIG = 0xF5,
BME280_REGISTER_PRESSUREDATA_MSB = 0xF7,
BME280_REGISTER_PRESSUREDATA_LSB = 0xF8,
BME280_REGISTER_PRESSUREDATA_XLSB = 0xF9, // bits <7:4>
BME280_REGISTER_TEMPDATA_MSB = 0xFA,
BME280_REGISTER_TEMPDATA_LSB = 0xFB,
BME280_REGISTER_TEMPDATA_XLSB = 0xFC, // bits <7:4>
BME280_REGISTER_HUMIDDATA_MSB = 0xFD,
BME280_REGISTER_HUMIDDATA_LSB = 0xFE,
};
//String for the friendly name of the I2C bus
const string I2CControllerName = "I2C1";
//Create an I2C device
private I2cDevice bme280 = null;
//Create new calibration data for the sensor
BME280_CalibrationData CalibrationData;
//Variable to check if device is initialized
bool init = false;
//Method to initialize the BME280 sensor
public async Task Initialize()
{
Debug.WriteLine("BME280::Initialize");
try
{
//Instantiate the I2CConnectionSettings using the device address of the BME280
I2cConnectionSettings settings = new I2cConnectionSettings(BME280_Address);
//Set the I2C bus speed of connection to fast mode
settings.BusSpeed = I2cBusSpeed.FastMode;
//Use the I2CBus device selector to create an advanced query syntax string
string aqs = I2cDevice.GetDeviceSelector(I2CControllerName);
//Use the Windows.Devices.Enumeration.DeviceInformation class to create a collection using the advanced query syntax string
DeviceInformationCollection dis = await DeviceInformation.FindAllAsync(aqs);
//Instantiate the the BME280 I2C device using the device id of the I2CBus and the I2CConnectionSettings
bme280 = await I2cDevice.FromIdAsync(dis[0].Id, settings);
//Check if device was found
if (bme280 == null)
{
Debug.WriteLine("Device not found");
}
}
catch (Exception e)
{
Debug.WriteLine("Exception: " + e.Message + "\n" + e.StackTrace);
throw;
}
}
private async Task Begin()
{
Debug.WriteLine("BME280::Begin");
byte[] WriteBuffer = new byte[] { (byte)eRegisters.BME280_REGISTER_CHIPID };
byte[] ReadBuffer = new byte[] { 0xFF };
//Read the device signature
bme280.WriteRead(WriteBuffer, ReadBuffer);
Debug.WriteLine("BME280 Signature: " + ReadBuffer[0].ToString());
//Verify the device signature
if (ReadBuffer[0] != BME280_Signature)
{
Debug.WriteLine("BME280::Begin Signature Mismatch.");
return;
}
//Set the initialize variable to true
init = true;
//Read the coefficients table
CalibrationData = await ReadCoefficeints();
//Write control register
await WriteControlRegister();
//Write humidity control register
await WriteControlRegisterHumidity();
}
//Method to write 0x03 to the humidity control register
private async Task WriteControlRegisterHumidity()
{
byte[] WriteBuffer = new byte[] { (byte)eRegisters.BME280_REGISTER_CONTROLHUMID, 0x03 };
bme280.Write(WriteBuffer);
await Task.Delay(1);
return;
}
//Method to write 0x3F to the control register
private async Task WriteControlRegister()
{
byte[] WriteBuffer = new byte[] { (byte)eRegisters.BME280_REGISTER_CONTROL, 0x3F };
bme280.Write(WriteBuffer);
await Task.Delay(1);
return;
}
//Method to read a 16-bit value from a register and return it in little endian format
private UInt16 ReadUInt16_LittleEndian(byte register)
{
UInt16 value = 0;
byte[] writeBuffer = new byte[] { 0x00 };
byte[] readBuffer = new byte[] { 0x00, 0x00 };
writeBuffer[0] = register;
bme280.WriteRead(writeBuffer, readBuffer);
int h = readBuffer[1] << 8;
int l = readBuffer[0];
value = (UInt16)(h + l);
return value;
}
//Method to read an 8-bit value from a register
private byte ReadByte(byte register)
{
byte value = 0;
byte[] writeBuffer = new byte[] { 0x00 };
byte[] readBuffer = new byte[] { 0x00 };
writeBuffer[0] = register;
bme280.WriteRead(writeBuffer, readBuffer);
value = readBuffer[0];
return value;
}
//Method to read the calibration data from the registers
private async Task<BME280_CalibrationData> ReadCoefficeints()
{
// 16 bit calibration data is stored as Little Endian, the helper method will do the byte swap.
CalibrationData = new BME280_CalibrationData();
// Read temperature calibration data
CalibrationData.dig_T1 = ReadUInt16_LittleEndian((byte)eRegisters.BME280_REGISTER_DIG_T1);
CalibrationData.dig_T2 = (Int16)ReadUInt16_LittleEndian((byte)eRegisters.BME280_REGISTER_DIG_T2);
CalibrationData.dig_T3 = (Int16)ReadUInt16_LittleEndian((byte)eRegisters.BME280_REGISTER_DIG_T3);
// Read presure calibration data
CalibrationData.dig_P1 = ReadUInt16_LittleEndian((byte)eRegisters.BME280_REGISTER_DIG_P1);
CalibrationData.dig_P2 = (Int16)ReadUInt16_LittleEndian((byte)eRegisters.BME280_REGISTER_DIG_P2);
CalibrationData.dig_P3 = (Int16)ReadUInt16_LittleEndian((byte)eRegisters.BME280_REGISTER_DIG_P3);
CalibrationData.dig_P4 = (Int16)ReadUInt16_LittleEndian((byte)eRegisters.BME280_REGISTER_DIG_P4);
CalibrationData.dig_P5 = (Int16)ReadUInt16_LittleEndian((byte)eRegisters.BME280_REGISTER_DIG_P5);
CalibrationData.dig_P6 = (Int16)ReadUInt16_LittleEndian((byte)eRegisters.BME280_REGISTER_DIG_P6);
CalibrationData.dig_P7 = (Int16)ReadUInt16_LittleEndian((byte)eRegisters.BME280_REGISTER_DIG_P7);
CalibrationData.dig_P8 = (Int16)ReadUInt16_LittleEndian((byte)eRegisters.BME280_REGISTER_DIG_P8);
CalibrationData.dig_P9 = (Int16)ReadUInt16_LittleEndian((byte)eRegisters.BME280_REGISTER_DIG_P9);
// Read humidity calibration data
CalibrationData.dig_H1 = ReadByte((byte)eRegisters.BME280_REGISTER_DIG_H1);
CalibrationData.dig_H2 = (Int16)ReadUInt16_LittleEndian((byte)eRegisters.BME280_REGISTER_DIG_H2);
CalibrationData.dig_H3 = ReadByte((byte)eRegisters.BME280_REGISTER_DIG_H3);
CalibrationData.dig_H4 = (Int16)((ReadByte((byte)eRegisters.BME280_REGISTER_DIG_H4) << 4) | (ReadByte((byte)eRegisters.BME280_REGISTER_DIG_H4 + 1) & 0xF));
CalibrationData.dig_H5 = (Int16)((ReadByte((byte)eRegisters.BME280_REGISTER_DIG_H5 + 1) << 4) | (ReadByte((byte)eRegisters.BME280_REGISTER_DIG_H5) >> 4));
CalibrationData.dig_H6 = (sbyte)ReadByte((byte)eRegisters.BME280_REGISTER_DIG_H6);
await Task.Delay(1);
return CalibrationData;
}
//t_fine carries fine temperature as global value
Int32 t_fine = Int32.MinValue;
//Method to return the temperature in DegC. Resolution is 0.01 DegC. Output value of “5123” equals 51.23 DegC.
private double BME280_compensate_T_double(Int32 adc_T)
{
double var1, var2, T;
//The temperature is calculated using the compensation formula in the BME280 datasheet
var1 = ((adc_T / 16384.0) - (CalibrationData.dig_T1 / 1024.0)) * CalibrationData.dig_T2;
var2 = ((adc_T / 131072.0) - (CalibrationData.dig_T1 / 8192.0)) * CalibrationData.dig_T3;
t_fine = (Int32)(var1 + var2);
T = (var1 + var2) / 5120.0;
return T;
}
//Method to returns the pressure in Pa, in Q24.8 format (24 integer bits and 8 fractional bits).
//Output value of “24674867” represents 24674867/256 = 96386.2 Pa = 963.862 hPa
private Int64 BME280_compensate_P_Int64(Int32 adc_P)
{
Int64 var1, var2, p;
//The pressure is calculated using the compensation formula in the BME280 datasheet
var1 = t_fine - 128000;
var2 = var1 * var1 * (Int64)CalibrationData.dig_P6;
var2 = var2 + ((var1 * (Int64)CalibrationData.dig_P5) << 17);
var2 = var2 + ((Int64)CalibrationData.dig_P4 << 35);
var1 = ((var1 * var1 * (Int64)CalibrationData.dig_P3) >> 8) + ((var1 * (Int64)CalibrationData.dig_P2) << 12);
var1 = (((((Int64)1 << 47) + var1)) * (Int64)CalibrationData.dig_P1) >> 33;
if (var1 == 0)
{
Debug.WriteLine("BME280_compensate_P_Int64 Jump out to avoid / 0");
return 0; //Avoid exception caused by division by zero
}
//Perform calibration operations as per datasheet: http://www.adafruit.com/datasheets/BST-BME280-DS001-11.pdf
p = 1048576 - adc_P;
p = (((p << 31) - var2) * 3125) / var1;
var1 = ((Int64)CalibrationData.dig_P9 * (p >> 13) * (p >> 13)) >> 25;
var2 = ((Int64)CalibrationData.dig_P8 * p) >> 19;
p = ((p + var1 + var2) >> 8) + ((Int64)CalibrationData.dig_P7 << 4);
return p;
}
// Returns humidity in %RH as unsigned 32 bit integer in Q22.10 format (22 integer and 10 fractional bits).
// Output value of “47445” represents 47445/1024 = 46.333 %RH
UInt32 bme280_compensate_H_int32(Int32 adc_H)
{
Int32 v_x1_u32r;
v_x1_u32r = (t_fine - ((Int32)76800));
v_x1_u32r = (((((adc_H << 14) - (((Int32)CalibrationData.dig_H4) << 20) - (((Int32)CalibrationData.dig_H5) * v_x1_u32r)) +
((Int32)16384)) >> 15) * (((((((v_x1_u32r * ((Int32)CalibrationData.dig_H6)) >> 10) * (((v_x1_u32r *
((Int32)CalibrationData.dig_H3)) >> 11) + ((Int32)32768))) >> 10) + ((Int32)2097152)) *
((Int32)CalibrationData.dig_H2) + 8192) >> 14));
v_x1_u32r = (v_x1_u32r - (((((v_x1_u32r >> 15) * (v_x1_u32r >> 15)) >> 7) * ((Int32)CalibrationData.dig_H1)) >> 4));
v_x1_u32r = (v_x1_u32r < 0 ? 0 : v_x1_u32r);
v_x1_u32r = (v_x1_u32r > 419430400 ? 419430400 : v_x1_u32r);
return (UInt32)(v_x1_u32r >> 12);
}
public async Task<float> ReadTemperature()
{
//Make sure the I2C device is initialized
if (!init) await Begin();
//Read the MSB, LSB and bits 7:4 (XLSB) of the temperature from the BME280 registers
byte tmsb = ReadByte((byte)eRegisters.BME280_REGISTER_TEMPDATA_MSB);
byte tlsb = ReadByte((byte)eRegisters.BME280_REGISTER_TEMPDATA_LSB);
byte txlsb = ReadByte((byte)eRegisters.BME280_REGISTER_TEMPDATA_XLSB); // bits 7:4
//Combine the values into a 32-bit integer
Int32 t = (tmsb << 12) + (tlsb << 4) + (txlsb >> 4);
//Convert the raw value to the temperature in degC
double temp = BME280_compensate_T_double(t);
//Return the temperature as a float value
return (float)temp;
}
public async Task<float> ReadPreasure()
{
//Make sure the I2C device is initialized
if (!init) await Begin();
//Read the temperature first to load the t_fine value for compensation
if (t_fine == Int32.MinValue)
{
await ReadTemperature();
}
//Read the MSB, LSB and bits 7:4 (XLSB) of the pressure from the BME280 registers
byte tmsb = ReadByte((byte)eRegisters.BME280_REGISTER_PRESSUREDATA_MSB);
byte tlsb = ReadByte((byte)eRegisters.BME280_REGISTER_PRESSUREDATA_LSB);
byte txlsb = ReadByte((byte)eRegisters.BME280_REGISTER_PRESSUREDATA_XLSB); // bits 7:4
//Combine the values into a 32-bit integer
Int32 t = (tmsb << 12) + (tlsb << 4) + (txlsb >> 4);
//Convert the raw value to the pressure in Pa
Int64 pres = BME280_compensate_P_Int64(t);
//Return the temperature as a float value
return ((float)pres) / 256;
}
public async Task<float> ReadHumidity()
{
if (!init) await Begin();
byte tmsb = ReadByte((byte)eRegisters.BME280_REGISTER_HUMIDDATA_MSB);
byte tlsb = ReadByte((byte)eRegisters.BME280_REGISTER_HUMIDDATA_LSB);
Int32 uncompensated = (tmsb << 8) + tlsb;
UInt32 humidity = bme280_compensate_H_int32(uncompensated);
return ((float)humidity) / 1000;
}
//Method to take the sea level pressure in Hectopascals(hPa) as a parameter and calculate the altitude using current pressure.
public async Task<float> ReadAltitude(float seaLevel)
{
//Make sure the I2C device is initialized
if (!init) await Begin();
//Read the pressure first
float pressure = await ReadPreasure();
//Convert the pressure to Hectopascals(hPa)
pressure /= 100;
//Calculate and return the altitude using the international barometric formula
return 44330.0f * (1.0f - (float)Math.Pow((pressure / seaLevel), 0.1903f));
}
}
}
| mit |
j-froehlich/magento2_wk | vendor/magento/module-braintree/Gateway/Response/PayPalDetailsHandler.php | 1434 | <?php
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Braintree\Gateway\Response;
use Magento\Payment\Gateway\Response\HandlerInterface;
use Magento\Braintree\Gateway\Helper\SubjectReader;
use Magento\Sales\Api\Data\OrderPaymentInterface;
/**
* Class PayPalDetailsHandler
*/
class PayPalDetailsHandler implements HandlerInterface
{
const PAYMENT_ID = 'paymentId';
const PAYER_EMAIL = 'payerEmail';
/**
* @var SubjectReader
*/
private $subjectReader;
/**
* Constructor
*
* @param SubjectReader $subjectReader
*/
public function __construct(SubjectReader $subjectReader)
{
$this->subjectReader = $subjectReader;
}
/**
* @inheritdoc
*/
public function handle(array $handlingSubject, array $response)
{
$paymentDO = $this->subjectReader->readPayment($handlingSubject);
/** @var \Braintree\Transaction $transaction */
$transaction = $this->subjectReader->readTransaction($response);
/** @var OrderPaymentInterface $payment */
$payment = $paymentDO->getPayment();
$payPal = $this->subjectReader->readPayPal($transaction);
$payment->setAdditionalInformation(self::PAYMENT_ID, $payPal[self::PAYMENT_ID]);
$payment->setAdditionalInformation(self::PAYER_EMAIL, $payPal[self::PAYER_EMAIL]);
}
}
| mit |
gilsondev/login-cidadao | src/PROCERGS/LoginCidadao/CoreBundle/Command/PopulateDatabaseCommand.php | 7080 | <?php
namespace PROCERGS\LoginCidadao\CoreBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\ORM\EntityManager;
use PROCERGS\LoginCidadao\NotificationBundle\Entity\Category;
use PROCERGS\OAuthBundle\Entity\Client;
use Symfony\Component\HttpFoundation\File\File;
class PopulateDatabaseCommand extends ContainerAwareCommand
{
protected function configure()
{
$this
->setName('login-cidadao:database:populate')
->setDescription('Populates the database.')
->addArgument('dump_folder', InputArgument::REQUIRED, 'Where are the dumps?');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$dir = realpath($input->getArgument('dump_folder'));
$this->loadDumpFiles($dir, $output);
$this->createDefaultOAuthClient($dir, $output);
$this->createCategories($output);
}
private function loadDumpFiles($dir, OutputInterface $output)
{
$em = $this->getManager();
$db = $em->getConnection();
$db->beginTransaction();
try {
$db->exec('DELETE FROM city;');
$db->exec('DELETE FROM state;');
$db->exec('DELETE FROM country;');
$countryInsert = 'INSERT INTO country (id, name, iso2, postal_format, postal_name, reviewed, iso3, iso_num) VALUES (:id, :name, :iso2, :postal_format, :postal_name, :reviewed, :iso3, :iso_num)';
$countryQuery = $db->prepare($countryInsert);
$countries = $this->loopInsert($dir, 'country_dump.csv', $countryQuery, array($this, 'prepareCountryData'));
$statesInsert = 'INSERT INTO state (id, name, acronym, country_id, iso6, fips, stat, class, reviewed) VALUES (:id, :name, :acronym, :country_id, :iso6, :fips, :stat, :class, :reviewed)';
$statesQuery = $db->prepare($statesInsert);
$states = $this->loopInsert($dir, 'state_dump.csv', $statesQuery, array($this, 'prepareStateData'));
$citiesInsert = 'INSERT INTO city (id, name, state_id, stat, reviewed) VALUES (:id, :name, :state_id, :stat, :reviewed)';
$citiesQuery = $db->prepare($citiesInsert);
$cities = $this->loopInsert($dir, 'city_dump.csv', $citiesQuery, array($this, 'prepareCityData'));
$db->commit();
} catch (Exception $e) {
$db->rollBack();
}
$output->writeln("Added $countries countries, $states states and $cities cities.");
}
/**
*
* @return EntityManager
*/
private function getManager()
{
return $this->getContainer()->get('doctrine')->getManager();
}
protected function prepareCountryData($row)
{
list($id, $name, $iso2, $postal_format, $postal_name, $reviewed, $iso3, $iso_num) = $row;
$vars = compact('id', 'name', 'iso2', 'postal_format', 'postal_name', 'reviewed', 'iso3', 'iso_num');
foreach ($vars as $k => $v) {
if ($v === "") {
$vars[$k] = null;
}
}
return $vars;
}
protected function prepareStateData($row)
{
list($id, $name, $acronym, $country_id, $iso6, $fips, $stat, $class, $reviewed) = $row;
return compact('id', 'name', 'acronym', 'country_id', 'iso6', 'fips', 'stat', 'class', 'reviewed');
}
protected function prepareCityData($row)
{
list($id, $name, $state_id, $stat, $reviewed) = $row;
return compact('id', 'name', 'state_id', 'stat', 'reviewed');
}
private function loopInsert($dir, $fileName, $query, $prepareFunction, $debug = false)
{
$entries = 0;
$file = $dir . DIRECTORY_SEPARATOR . $fileName;
if (($handle = fopen($file, 'r')) !== false) {
while (($row = fgetcsv($handle)) !== false) {
$data = $prepareFunction($row);
if ($debug) {
var_dump($data);
}
$query->execute($data);
$entries++;
}
fclose($handle);
}
return $entries;
}
protected function createDefaultOAuthClient($dir, OutputInterface $output)
{
if (!($this->getDefaultOAuthClient() instanceof Client)) {
$uid = $this->getContainer()->getParameter('oauth_default_client.uid');
$pictureName = 'meurs_logo.png';
$picture = new File($dir . DIRECTORY_SEPARATOR . $pictureName);
$domain = $this->getContainer()->getParameter('site_domain');
$url = "//$domain";
$grantTypes = array(
"authorization_code",
"token",
"password",
"client_credentials",
"refresh_token",
"extensions"
);
$clientManager = $this->getContainer()->get('fos_oauth_server.client_manager');
$client = $clientManager->createClient();
$client->setName('Login Cidadão');
$client->setDescription('Login Cidadão');
$client->setSiteUrl($url);
$client->setRedirectUris(array($url));
$client->setAllowedGrantTypes($grantTypes);
$client->setTermsOfUseUrl($url);
$client->setPublished(true);
$client->setVisible(false);
$client->setUid($uid);
$client->setPictureFile($picture);
$clientManager->updateClient($client);
$output->writeln('Default Client created.');
}
}
protected function createCategories(OutputInterface $output)
{
$em = $this->getManager();
$categories = $em->getRepository('PROCERGSLoginCidadaoNotificationBundle:Category');
$alertCategoryUid = $this->getContainer()->getParameter('notifications_categories_alert.uid');
$alertCategory = $categories->findOneByUid($alertCategoryUid);
if (!($alertCategory instanceof Category)) {
$alertCategory = new Category();
$alertCategory->setClient($this->getDefaultOAuthClient())
->setDefaultShortText('Alert')
->setDefaultTitle('Alert')
->setDefaultIcon('alert')
->setMarkdownTemplate('%shorttext%')
->setEmailable(false)
->setName('Alerts')
->setUid($alertCategoryUid);
$em->persist($alertCategory);
$em->flush();
$output->writeln('Alert category created.');
}
}
/**
* @return Client
*/
private function getDefaultOAuthClient()
{
$em = $this->getManager();
$uid = $this->getContainer()->getParameter('oauth_default_client.uid');
$client = $em->getRepository('PROCERGSOAuthBundle:Client')->findOneByUid($uid);
return $client;
}
}
| mit |
PoisonBOx/design-patterns | src/memento/perl/Memento.pm | 263 | package Memento;
use strict;
use warnings;
sub new {
my ($class, $state) = @_;
my $self = {
state => $state,
};
return bless $self, $class;
}
sub state {
my ($self, $state) = @_;
$self->{state} = $state if defined $state;
return $self->{state};
}
1;
| mit |
hands-agency/grandcentral | grandcentral/sirtrevor/template/field/js/link.js | 3216 | (function($)
{
// Some vars
var template = '/field/link';
// Tabs
$(document).on('click', '.adminContext .tabs li', function()
{
// Some vars
var $admincontext = $(this).parents('.adminContext');
var $tabs = $admincontext.find('.tabs');
var $panels = $admincontext.find('.panels');
var currentTab = $(this).data('tab');
// Close all tabs & panels
$tabs.find('>li').attr('class', 'off');
$panels.find('>div').attr('class', 'off');
// Open the right one
$tabs.find('>li[data-tab="'+currentTab+'"]').attr('class', 'on');
$panel = $panels.find('>div[data-panel="'+currentTab+'"]');
$panel.attr('class', 'on');
// Init the panel (cameltoe function initCurrenttab)
var function_name = 'init'+currentTab.charAt(0).toUpperCase() + currentTab.slice(1);
window[function_name]($panel);
});
// Init internal linking
initInternal = function(panel)
{
// restore selection when blur input
$('.adminContext').on('blur', 'input[type="search"]', function()
{
restoreSelection(selRange);
// selRange = false;
});
// Send Internal link
$(document).on('click', '.adminContext[data-template="/field/link"] [data-panel="internal"] [data-item] button', function(e)
{
if (selRange !== null)
{
restoreSelection(selRange);
var link = $(this).parent().data('item');
// console.log(link)
document.execCommand('CreateLink', false, link);
closeContext(template);
selRange = null;
};
});
// Refine item lists
$('.adminContext[data-template="/field/link"] [data-panel="internal"] input[type="search"]').each(function()
{
// Some vars
var $input = $(this);
var item = $input.data('item');
var $target = $(this).next('ul');
// Search as you type
$input.searchasyoutype(
{
app:'sirtrevor',
template:'/field/link.internal',
param:'{"item":"'+item+'"}',
target:$target,
})
// Start with something
.trigger('input');
});
}
// Init external linking
initExternal = function(panel)
{
// Send external link
$(document).on('click', '.adminContext[data-template="/field/link"] [data-panel="external"] button.done', function()
{
// Get the value from the iframe
var link = $(this).parent().find('iframe').contents().find('input').val();
// Good link
if(link && link.length > 0)
{
var link_regex = /(ftp|http|https):\/\/./;
if (!link_regex.test(link)) link = "http://" + link;
document.execCommand('CreateLink', false, link);
closeContext(template);
}
// Bad link
else console.log('That is not a valid URL, buddy');
});
}
// Init media linking
initMedia = function(panel)
{
panel.ajx(
{
app:'media',
template:'admin',
}, {
done:function()
{
// Override "Edit a media"...
$('#mediaLibrary').off('click', 'a.file');
// ...with "send the link"
$(document).on('click', '.adminContext[data-template="/field/link"] #mediaLibrary a.file', function()
{
url = $(this).parent().data('url');
// Send link
document.execCommand('CreateLink', false, url);
closeContext(template);
});
}
});
}
// Open one by default
$('.adminContext .tabs li[data-tab="internal"]').trigger('click');
})(jQuery); | mit |
BenMQ/coursemology2 | app/controllers/jobs_controller.rb | 688 | class JobsController < ApplicationController
before_action :load_job
def show
if @job.completed?
show_completed_job
elsif @job.errored?
show_errored_job
else
show_submitted_job
end
end
protected
def publicly_accessible?
true
end
private
def load_job
@job ||= TrackableJob::Job.find(params[:id])
end
def show_completed_job
redirect_to @job.redirect_to if @job.redirect_to.present?
end
def show_errored_job
if @job.redirect_to.present?
redirect_to @job.redirect_to
else
response.status = :internal_server_error
end
end
def show_submitted_job
response.status = :accepted
end
end
| mit |
reeganaga/SI-lelang | application/views/back/ornamen/custom_js.php | 3029 | <!-- DataTables -->
<script src="<?php echo base_url(); ?>assets/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="<?php echo base_url(); ?>assets/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script type="text/javascript">
$(function () {
$('#tableOrnamenAtas,#tableOrnamenKonten,#tableOrnamenBawah').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": false,
// "scrollX":"400px",
"scrollCollapse": true,
"info": false,
"autoWidth": false,
"pageLength":5
});
});
$('#editOrnamen').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var id = button.data('id') // Extract info from data-* attributes
var image = button.data('image') // Extract info from data-* attributes
var type = button.data('type') // Extract info from data-* attributes
var kode = button.data('kode') // Extract info from data-* attributes
var gambarTemp = button.data('gambartemp') // Extract info from data-* attributes
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
var modal = $(this)
// modal.find('.modal-title').text('New message to ' + recipient)
// modal.find('.modal-body input').val(recipient)
modal.find('#gambarTemp').attr('src',image)
modal.find('#idUpdate').attr('value',id)
modal.find('#typeUpdate').attr('value',type)
modal.find('#kodeUpdate').attr('value',kode)
modal.find('#gambarTempUpdate').attr('value',gambarTemp)
})
$('#deleteOrnamen').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var link = button.data('link') // Extract info from data-* attributes
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
var modal = $(this)
// modal.find('.modal-title').text('New message to ' + recipient)
// modal.find('.modal-body input').val(recipient)
modal.find('#linkDeleteOrnamen').attr('href',link)
})
$('#addOrnamen').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var type = button.data('type') // Extract info from data-* attributes
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
var modal = $(this)
// modal.find('.modal-title').text('New message to ' + recipient)
// modal.find('.modal-body input').val(recipient)
modal.find('#typeAdd').attr('value',type)
})
</script> | mit |
imcarolwang/wcf | src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocRelativePath/Reference.cs | 47607 | //------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace multiDocRelativePath_NS
{
using System.Runtime.Serialization;
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
[System.Runtime.Serialization.DataContractAttribute(Name="ComplexCompositeType", Namespace="http://schemas.datacontract.org/2004/07/WcfProjectNService")]
public partial class ComplexCompositeType : object
{
private bool BoolValueField;
private byte[] ByteArrayValueField;
private char[] CharArrayValueField;
private char CharValueField;
private System.DateTime DateTimeValueField;
private System.DayOfWeek DayOfWeekValueField;
private double DoubleValueField;
private float FloatValueField;
private System.Guid GuidValueField;
private int IntValueField;
private long LongValueField;
private string LongerStringValueField;
private sbyte SbyteValueField;
private short ShortValueField;
private string StringValueField;
private System.TimeSpan TimeSpanValueField;
private uint UintValueField;
private ulong UlongValueField;
private ushort UshortValueField;
[System.Runtime.Serialization.DataMemberAttribute()]
public bool BoolValue
{
get
{
return this.BoolValueField;
}
set
{
this.BoolValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public byte[] ByteArrayValue
{
get
{
return this.ByteArrayValueField;
}
set
{
this.ByteArrayValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public char[] CharArrayValue
{
get
{
return this.CharArrayValueField;
}
set
{
this.CharArrayValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public char CharValue
{
get
{
return this.CharValueField;
}
set
{
this.CharValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public System.DateTime DateTimeValue
{
get
{
return this.DateTimeValueField;
}
set
{
this.DateTimeValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public System.DayOfWeek DayOfWeekValue
{
get
{
return this.DayOfWeekValueField;
}
set
{
this.DayOfWeekValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public double DoubleValue
{
get
{
return this.DoubleValueField;
}
set
{
this.DoubleValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public float FloatValue
{
get
{
return this.FloatValueField;
}
set
{
this.FloatValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public System.Guid GuidValue
{
get
{
return this.GuidValueField;
}
set
{
this.GuidValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public int IntValue
{
get
{
return this.IntValueField;
}
set
{
this.IntValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public long LongValue
{
get
{
return this.LongValueField;
}
set
{
this.LongValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string LongerStringValue
{
get
{
return this.LongerStringValueField;
}
set
{
this.LongerStringValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public sbyte SbyteValue
{
get
{
return this.SbyteValueField;
}
set
{
this.SbyteValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public short ShortValue
{
get
{
return this.ShortValueField;
}
set
{
this.ShortValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string StringValue
{
get
{
return this.StringValueField;
}
set
{
this.StringValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public System.TimeSpan TimeSpanValue
{
get
{
return this.TimeSpanValueField;
}
set
{
this.TimeSpanValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public uint UintValue
{
get
{
return this.UintValueField;
}
set
{
this.UintValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public ulong UlongValue
{
get
{
return this.UlongValueField;
}
set
{
this.UlongValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public ushort UshortValue
{
get
{
return this.UshortValueField;
}
set
{
this.UshortValueField = value;
}
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
[System.Runtime.Serialization.DataContractAttribute(Name="FaultDetail", Namespace="http://schemas.wcf.projectn.com/wcfnamespace")]
public partial class FaultDetail : object
{
private string MessageField;
[System.Runtime.Serialization.DataMemberAttribute()]
public string Message
{
get
{
return this.MessageField;
}
set
{
this.MessageField = value;
}
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
[System.Runtime.Serialization.DataContractAttribute(Name="CompositeType", Namespace="http://schemas.datacontract.org/2004/07/WcfProjectNService")]
public partial class CompositeType : object
{
private bool BoolValueField;
private string StringValueField;
[System.Runtime.Serialization.DataMemberAttribute()]
public bool BoolValue
{
get
{
return this.BoolValueField;
}
set
{
this.BoolValueField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string StringValue
{
get
{
return this.StringValueField;
}
set
{
this.StringValueField = value;
}
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
[System.Runtime.Serialization.DataContractAttribute(Name="ResultOfstring", Namespace="http://schemas.wcf.projectn.com/wcfnamespace")]
public partial class ResultOfstring : object
{
private int ErrorCodeField;
private string ErrorMessageField;
private multiDocRelativePath_NS.HttpStatusCode HttpStatusCodeField;
private string ResultField;
[System.Runtime.Serialization.DataMemberAttribute()]
public int ErrorCode
{
get
{
return this.ErrorCodeField;
}
set
{
this.ErrorCodeField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string ErrorMessage
{
get
{
return this.ErrorMessageField;
}
set
{
this.ErrorMessageField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public multiDocRelativePath_NS.HttpStatusCode HttpStatusCode
{
get
{
return this.HttpStatusCodeField;
}
set
{
this.HttpStatusCodeField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string Result
{
get
{
return this.ResultField;
}
set
{
this.ResultField = value;
}
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
[System.Runtime.Serialization.DataContractAttribute(Name="HttpStatusCode", Namespace="http://schemas.datacontract.org/2004/07/System.Net")]
public enum HttpStatusCode : int
{
[System.Runtime.Serialization.EnumMemberAttribute()]
Continue = 100,
[System.Runtime.Serialization.EnumMemberAttribute()]
SwitchingProtocols = 101,
[System.Runtime.Serialization.EnumMemberAttribute()]
OK = 200,
[System.Runtime.Serialization.EnumMemberAttribute()]
Created = 201,
[System.Runtime.Serialization.EnumMemberAttribute()]
Accepted = 202,
[System.Runtime.Serialization.EnumMemberAttribute()]
NonAuthoritativeInformation = 203,
[System.Runtime.Serialization.EnumMemberAttribute()]
NoContent = 204,
[System.Runtime.Serialization.EnumMemberAttribute()]
ResetContent = 205,
[System.Runtime.Serialization.EnumMemberAttribute()]
PartialContent = 206,
[System.Runtime.Serialization.EnumMemberAttribute()]
MultipleChoices = 300,
[System.Runtime.Serialization.EnumMemberAttribute()]
Ambiguous = 300,
[System.Runtime.Serialization.EnumMemberAttribute()]
MovedPermanently = 301,
[System.Runtime.Serialization.EnumMemberAttribute()]
Moved = 301,
[System.Runtime.Serialization.EnumMemberAttribute()]
Found = 302,
[System.Runtime.Serialization.EnumMemberAttribute()]
Redirect = 302,
[System.Runtime.Serialization.EnumMemberAttribute()]
SeeOther = 303,
[System.Runtime.Serialization.EnumMemberAttribute()]
RedirectMethod = 303,
[System.Runtime.Serialization.EnumMemberAttribute()]
NotModified = 304,
[System.Runtime.Serialization.EnumMemberAttribute()]
UseProxy = 305,
[System.Runtime.Serialization.EnumMemberAttribute()]
Unused = 306,
[System.Runtime.Serialization.EnumMemberAttribute()]
TemporaryRedirect = 307,
[System.Runtime.Serialization.EnumMemberAttribute()]
RedirectKeepVerb = 307,
[System.Runtime.Serialization.EnumMemberAttribute()]
BadRequest = 400,
[System.Runtime.Serialization.EnumMemberAttribute()]
Unauthorized = 401,
[System.Runtime.Serialization.EnumMemberAttribute()]
PaymentRequired = 402,
[System.Runtime.Serialization.EnumMemberAttribute()]
Forbidden = 403,
[System.Runtime.Serialization.EnumMemberAttribute()]
NotFound = 404,
[System.Runtime.Serialization.EnumMemberAttribute()]
MethodNotAllowed = 405,
[System.Runtime.Serialization.EnumMemberAttribute()]
NotAcceptable = 406,
[System.Runtime.Serialization.EnumMemberAttribute()]
ProxyAuthenticationRequired = 407,
[System.Runtime.Serialization.EnumMemberAttribute()]
RequestTimeout = 408,
[System.Runtime.Serialization.EnumMemberAttribute()]
Conflict = 409,
[System.Runtime.Serialization.EnumMemberAttribute()]
Gone = 410,
[System.Runtime.Serialization.EnumMemberAttribute()]
LengthRequired = 411,
[System.Runtime.Serialization.EnumMemberAttribute()]
PreconditionFailed = 412,
[System.Runtime.Serialization.EnumMemberAttribute()]
RequestEntityTooLarge = 413,
[System.Runtime.Serialization.EnumMemberAttribute()]
RequestUriTooLong = 414,
[System.Runtime.Serialization.EnumMemberAttribute()]
UnsupportedMediaType = 415,
[System.Runtime.Serialization.EnumMemberAttribute()]
RequestedRangeNotSatisfiable = 416,
[System.Runtime.Serialization.EnumMemberAttribute()]
ExpectationFailed = 417,
[System.Runtime.Serialization.EnumMemberAttribute()]
UpgradeRequired = 426,
[System.Runtime.Serialization.EnumMemberAttribute()]
InternalServerError = 500,
[System.Runtime.Serialization.EnumMemberAttribute()]
NotImplemented = 501,
[System.Runtime.Serialization.EnumMemberAttribute()]
BadGateway = 502,
[System.Runtime.Serialization.EnumMemberAttribute()]
ServiceUnavailable = 503,
[System.Runtime.Serialization.EnumMemberAttribute()]
GatewayTimeout = 504,
[System.Runtime.Serialization.EnumMemberAttribute()]
HttpVersionNotSupported = 505,
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
[System.Runtime.Serialization.DataContractAttribute(Name="ResultOfArrayOfUserGamePlay", Namespace="http://schemas.wcf.projectn.com/wcfnamespace")]
public partial class ResultOfArrayOfUserGamePlay : object
{
private int ErrorCodeField;
private string ErrorMessageField;
private multiDocRelativePath_NS.HttpStatusCode HttpStatusCodeField;
private multiDocRelativePath_NS.UserGamePlay[] ResultField;
[System.Runtime.Serialization.DataMemberAttribute()]
public int ErrorCode
{
get
{
return this.ErrorCodeField;
}
set
{
this.ErrorCodeField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string ErrorMessage
{
get
{
return this.ErrorMessageField;
}
set
{
this.ErrorMessageField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public multiDocRelativePath_NS.HttpStatusCode HttpStatusCode
{
get
{
return this.HttpStatusCodeField;
}
set
{
this.HttpStatusCodeField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public multiDocRelativePath_NS.UserGamePlay[] Result
{
get
{
return this.ResultField;
}
set
{
this.ResultField = value;
}
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
[System.Runtime.Serialization.DataContractAttribute(Name="UserGamePlay", Namespace="http://schemas.datacontract.org/2004/07/WcfProjectNService")]
public partial class UserGamePlay : object
{
private string GameKeyField;
private string KeyField;
private string TimeStampField;
private string UserIdField;
private string ValueField;
[System.Runtime.Serialization.DataMemberAttribute()]
public string GameKey
{
get
{
return this.GameKeyField;
}
set
{
this.GameKeyField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string Key
{
get
{
return this.KeyField;
}
set
{
this.KeyField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string TimeStamp
{
get
{
return this.TimeStampField;
}
set
{
this.TimeStampField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string UserId
{
get
{
return this.UserIdField;
}
set
{
this.UserIdField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string Value
{
get
{
return this.ValueField;
}
set
{
this.ValueField = value;
}
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
[System.Runtime.Serialization.DataContractAttribute(Name="TestHttpRequestMessageProperty", Namespace="http://schemas.datacontract.org/2004/07/WcfProjectNService")]
public partial class TestHttpRequestMessageProperty : object
{
private System.Collections.Generic.Dictionary<string, string> HeadersField;
private string MethodField;
private string QueryStringField;
private bool SuppressEntityBodyField;
[System.Runtime.Serialization.DataMemberAttribute()]
public System.Collections.Generic.Dictionary<string, string> Headers
{
get
{
return this.HeadersField;
}
set
{
this.HeadersField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string Method
{
get
{
return this.MethodField;
}
set
{
this.MethodField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string QueryString
{
get
{
return this.QueryStringField;
}
set
{
this.QueryStringField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public bool SuppressEntityBody
{
get
{
return this.SuppressEntityBodyField;
}
set
{
this.SuppressEntityBodyField = value;
}
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="multiDocRelativePath_NS.IWcfProjectNService")]
public interface IWcfProjectNService
{
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfProjectNService/EchoWithTimeout", ReplyAction="http://tempuri.org/IWcfProjectNService/EchoWithTimeoutResponse")]
System.Threading.Tasks.Task<string> EchoWithTimeoutAsync(string message);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfProjectNService/MessageRequestReply", ReplyAction="http://tempuri.org/IWcfProjectNService/MessageRequestReplyResponse")]
System.Threading.Tasks.Task<System.ServiceModel.Channels.Message> MessageRequestReplyAsync(System.ServiceModel.Channels.Message request);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfProjectNService/Echo", ReplyAction="http://tempuri.org/IWcfProjectNService/EchoResponse")]
System.Threading.Tasks.Task<string> EchoAsync(string message);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfProjectNService/EchoComplex", ReplyAction="http://tempuri.org/IWcfProjectNService/EchoComplexResponse")]
System.Threading.Tasks.Task<multiDocRelativePath_NS.ComplexCompositeType> EchoComplexAsync(multiDocRelativePath_NS.ComplexCompositeType message);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfProjectNService/TestFault", ReplyAction="http://tempuri.org/IWcfProjectNService/TestFaultResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(multiDocRelativePath_NS.FaultDetail), Action="http://tempuri.org/IWcfProjectNService/TestFaultFaultDetailFault", Name="FaultDetail", Namespace="http://schemas.wcf.projectn.com/wcfnamespace")]
System.Threading.Tasks.Task TestFaultAsync(string faultMsg);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfProjectNService/ThrowInvalidOperationException", ReplyAction="http://tempuri.org/IWcfProjectNService/ThrowInvalidOperationExceptionResponse")]
System.Threading.Tasks.Task ThrowInvalidOperationExceptionAsync(string message);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfProjectNService/GetDataUsingDataContract", ReplyAction="http://tempuri.org/IWcfProjectNService/GetDataUsingDataContractResponse")]
System.Threading.Tasks.Task<multiDocRelativePath_NS.CompositeType> GetDataUsingDataContractAsync(multiDocRelativePath_NS.CompositeType composite);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfProjectNService/ValidateMessagePropertyHeaders", ReplyAction="http://tempuri.org/IWcfProjectNService/ValidateMessagePropertyHeadersResponse")]
System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<string, string>> ValidateMessagePropertyHeadersAsync();
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfProjectNService/UserGetAuthToken", ReplyAction="http://tempuri.org/IWcfProjectNService/UserGetAuthTokenResponse")]
System.Threading.Tasks.Task<multiDocRelativePath_NS.ResultOfstring> UserGetAuthTokenAsync(string liveId);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfProjectNService/UserGamePlayGetList", ReplyAction="http://tempuri.org/IWcfProjectNService/UserGamePlayGetListResponse")]
System.Threading.Tasks.Task<multiDocRelativePath_NS.ResultOfArrayOfUserGamePlay> UserGamePlayGetListAsync(string gameKey, string keys);
// CODEGEN: Generating message contract since the operation has multiple return values.
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfProjectNService/MessageContractRequestReply", ReplyAction="http://tempuri.org/IWcfProjectNService/MessageContractRequestReplyResponse")]
System.Threading.Tasks.Task<multiDocRelativePath_NS.ReplyBankingData> MessageContractRequestReplyAsync(multiDocRelativePath_NS.RequestBankingData request);
// CODEGEN: Generating message contract since the operation has multiple return values.
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfProjectNService/MessageContractRequestReplyNotWrapped", ReplyAction="http://tempuri.org/IWcfProjectNService/MessageContractRequestReplyNotWrappedRespo" +
"nse")]
System.Threading.Tasks.Task<multiDocRelativePath_NS.ReplyBankingDataNotWrapped> MessageContractRequestReplyNotWrappedAsync(multiDocRelativePath_NS.RequestBankingData request);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfProjectNService/EchoHttpMessageProperty", ReplyAction="http://tempuri.org/IWcfProjectNService/EchoHttpRequestMessagePropertyResponse")]
System.Threading.Tasks.Task<multiDocRelativePath_NS.TestHttpRequestMessageProperty> EchoHttpRequestMessagePropertyAsync();
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
[System.ServiceModel.MessageContractAttribute(WrapperName="CustomWrapperName", WrapperNamespace="http://mycustomwrappernamespace.com", IsWrapped=true)]
public partial class RequestBankingData
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=0)]
public System.DateTime Date_of_Request;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=1)]
public int Transaction_Amount;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="CustomNamespace", Order=2)]
public string Customer_Name;
public RequestBankingData()
{
}
public RequestBankingData(System.DateTime Date_of_Request, int Transaction_Amount, string Customer_Name)
{
this.Date_of_Request = Date_of_Request;
this.Transaction_Amount = Transaction_Amount;
this.Customer_Name = Customer_Name;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
[System.ServiceModel.MessageContractAttribute(WrapperName="CustomWrapperName", WrapperNamespace="http://mycustomwrappernamespace.com", IsWrapped=true)]
public partial class ReplyBankingData
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=0)]
public System.DateTime Date_of_Request;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=1)]
public int Transaction_Amount;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="CustomNamespace", Order=2)]
public string Customer_Name;
public ReplyBankingData()
{
}
public ReplyBankingData(System.DateTime Date_of_Request, int Transaction_Amount, string Customer_Name)
{
this.Date_of_Request = Date_of_Request;
this.Transaction_Amount = Transaction_Amount;
this.Customer_Name = Customer_Name;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
[System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
public partial class ReplyBankingDataNotWrapped
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=0)]
public System.DateTime Date_of_Request;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=1)]
public int Transaction_Amount;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://mycustomcustomernamespace.com", Order=2)]
public string Customer_Name;
public ReplyBankingDataNotWrapped()
{
}
public ReplyBankingDataNotWrapped(System.DateTime Date_of_Request, int Transaction_Amount, string Customer_Name)
{
this.Date_of_Request = Date_of_Request;
this.Transaction_Amount = Transaction_Amount;
this.Customer_Name = Customer_Name;
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
public interface IWcfProjectNServiceChannel : multiDocRelativePath_NS.IWcfProjectNService, System.ServiceModel.IClientChannel
{
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
public partial class WcfProjectNServiceClient : System.ServiceModel.ClientBase<multiDocRelativePath_NS.IWcfProjectNService>, multiDocRelativePath_NS.IWcfProjectNService
{
/// <summary>
/// Implement this partial method to configure the service endpoint.
/// </summary>
/// <param name="serviceEndpoint">The endpoint to configure</param>
/// <param name="clientCredentials">The client credentials</param>
static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials);
public WcfProjectNServiceClient(EndpointConfiguration endpointConfiguration) :
base(WcfProjectNServiceClient.GetBindingForEndpoint(endpointConfiguration), WcfProjectNServiceClient.GetEndpointAddress(endpointConfiguration))
{
this.Endpoint.Name = endpointConfiguration.ToString();
ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
}
public WcfProjectNServiceClient(EndpointConfiguration endpointConfiguration, string remoteAddress) :
base(WcfProjectNServiceClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress))
{
this.Endpoint.Name = endpointConfiguration.ToString();
ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
}
public WcfProjectNServiceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
base(WcfProjectNServiceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
{
this.Endpoint.Name = endpointConfiguration.ToString();
ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
}
public WcfProjectNServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
public System.Threading.Tasks.Task<string> EchoWithTimeoutAsync(string message)
{
return base.Channel.EchoWithTimeoutAsync(message);
}
public System.Threading.Tasks.Task<System.ServiceModel.Channels.Message> MessageRequestReplyAsync(System.ServiceModel.Channels.Message request)
{
return base.Channel.MessageRequestReplyAsync(request);
}
public System.Threading.Tasks.Task<string> EchoAsync(string message)
{
return base.Channel.EchoAsync(message);
}
public System.Threading.Tasks.Task<multiDocRelativePath_NS.ComplexCompositeType> EchoComplexAsync(multiDocRelativePath_NS.ComplexCompositeType message)
{
return base.Channel.EchoComplexAsync(message);
}
public System.Threading.Tasks.Task TestFaultAsync(string faultMsg)
{
return base.Channel.TestFaultAsync(faultMsg);
}
public System.Threading.Tasks.Task ThrowInvalidOperationExceptionAsync(string message)
{
return base.Channel.ThrowInvalidOperationExceptionAsync(message);
}
public System.Threading.Tasks.Task<multiDocRelativePath_NS.CompositeType> GetDataUsingDataContractAsync(multiDocRelativePath_NS.CompositeType composite)
{
return base.Channel.GetDataUsingDataContractAsync(composite);
}
public System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<string, string>> ValidateMessagePropertyHeadersAsync()
{
return base.Channel.ValidateMessagePropertyHeadersAsync();
}
public System.Threading.Tasks.Task<multiDocRelativePath_NS.ResultOfstring> UserGetAuthTokenAsync(string liveId)
{
return base.Channel.UserGetAuthTokenAsync(liveId);
}
public System.Threading.Tasks.Task<multiDocRelativePath_NS.ResultOfArrayOfUserGamePlay> UserGamePlayGetListAsync(string gameKey, string keys)
{
return base.Channel.UserGamePlayGetListAsync(gameKey, keys);
}
public System.Threading.Tasks.Task<multiDocRelativePath_NS.ReplyBankingData> MessageContractRequestReplyAsync(multiDocRelativePath_NS.RequestBankingData request)
{
return base.Channel.MessageContractRequestReplyAsync(request);
}
public System.Threading.Tasks.Task<multiDocRelativePath_NS.ReplyBankingDataNotWrapped> MessageContractRequestReplyNotWrappedAsync(multiDocRelativePath_NS.RequestBankingData request)
{
return base.Channel.MessageContractRequestReplyNotWrappedAsync(request);
}
public System.Threading.Tasks.Task<multiDocRelativePath_NS.TestHttpRequestMessageProperty> EchoHttpRequestMessagePropertyAsync()
{
return base.Channel.EchoHttpRequestMessagePropertyAsync();
}
public virtual System.Threading.Tasks.Task OpenAsync()
{
return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndOpen));
}
public virtual System.Threading.Tasks.Task CloseAsync()
{
return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndClose));
}
private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
{
if ((endpointConfiguration == EndpointConfiguration.defaultEndpoint))
{
System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding();
result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
result.MaxReceivedMessageSize = int.MaxValue;
result.AllowCookies = true;
result.Security.Mode = System.ServiceModel.SecurityMode.None;
return result;
}
if ((endpointConfiguration == EndpointConfiguration.defaultBasic))
{
System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
result.MaxBufferSize = int.MaxValue;
result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
result.MaxReceivedMessageSize = int.MaxValue;
result.AllowCookies = true;
return result;
}
if ((endpointConfiguration == EndpointConfiguration.basicHttpEndpoint))
{
System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
result.MaxBufferSize = int.MaxValue;
result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
result.MaxReceivedMessageSize = int.MaxValue;
result.AllowCookies = true;
return result;
}
if ((endpointConfiguration == EndpointConfiguration.basicHttpsEndpoint))
{
System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
result.MaxBufferSize = int.MaxValue;
result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
result.MaxReceivedMessageSize = int.MaxValue;
result.AllowCookies = true;
result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport;
return result;
}
if ((endpointConfiguration == EndpointConfiguration.httpsoap11Endpoint))
{
System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
result.MaxBufferSize = int.MaxValue;
result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
result.MaxReceivedMessageSize = int.MaxValue;
result.AllowCookies = true;
return result;
}
if ((endpointConfiguration == EndpointConfiguration.httpsoap12Endpoint))
{
System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding();
result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
result.MaxReceivedMessageSize = int.MaxValue;
result.AllowCookies = true;
result.Security.Mode = System.ServiceModel.SecurityMode.None;
return result;
}
if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint))
{
System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
result.Elements.Add(new System.ServiceModel.Channels.BinaryMessageEncodingBindingElement());
System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
httpBindingElement.AllowCookies = true;
httpBindingElement.MaxBufferSize = int.MaxValue;
httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
result.Elements.Add(httpBindingElement);
return result;
}
if ((endpointConfiguration == EndpointConfiguration.httpssoap11Endpoint))
{
System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
result.MaxBufferSize = int.MaxValue;
result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
result.MaxReceivedMessageSize = int.MaxValue;
result.AllowCookies = true;
result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport;
return result;
}
if ((endpointConfiguration == EndpointConfiguration.httpssoap12Endpoint))
{
System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding();
result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
result.MaxReceivedMessageSize = int.MaxValue;
result.AllowCookies = true;
result.Security.Mode = System.ServiceModel.SecurityMode.Transport;
result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None;
return result;
}
if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding))
{
System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding();
result.MaxBufferSize = int.MaxValue;
result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
result.MaxReceivedMessageSize = int.MaxValue;
return result;
}
if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding1))
{
System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding();
result.MaxBufferSize = int.MaxValue;
result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
result.MaxReceivedMessageSize = int.MaxValue;
result.Security.Mode = System.ServiceModel.SecurityMode.None;
return result;
}
throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
}
private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration)
{
if ((endpointConfiguration == EndpointConfiguration.defaultEndpoint))
{
return new System.ServiceModel.EndpointAddress("http://wcfprojectnserver.redmond.corp.microsoft.com/WcfProjectNService/WcfProject" +
"NService.svc");
}
if ((endpointConfiguration == EndpointConfiguration.defaultBasic))
{
return new System.ServiceModel.EndpointAddress("http://wcfprojectnserver.redmond.corp.microsoft.com/WcfProjectNService/WcfProject" +
"NService.svc/Basic");
}
if ((endpointConfiguration == EndpointConfiguration.basicHttpEndpoint))
{
return new System.ServiceModel.EndpointAddress("http://wcfprojectnserver.redmond.corp.microsoft.com/WcfProjectNService/WcfProject" +
"NService.svc/basicHttp");
}
if ((endpointConfiguration == EndpointConfiguration.basicHttpsEndpoint))
{
return new System.ServiceModel.EndpointAddress("https://wcfprojectnserver.redmond.corp.microsoft.com/WcfProjectNService/WcfProjec" +
"tNService.svc/basicHttps");
}
if ((endpointConfiguration == EndpointConfiguration.httpsoap11Endpoint))
{
return new System.ServiceModel.EndpointAddress("http://wcfprojectnserver.redmond.corp.microsoft.com/WcfProjectNService/WcfProject" +
"NService.svc/httpsoap11");
}
if ((endpointConfiguration == EndpointConfiguration.httpsoap12Endpoint))
{
return new System.ServiceModel.EndpointAddress("http://wcfprojectnserver.redmond.corp.microsoft.com/WcfProjectNService/WcfProject" +
"NService.svc/httpsoap12");
}
if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint))
{
return new System.ServiceModel.EndpointAddress("http://wcfprojectnserver.redmond.corp.microsoft.com/WcfProjectNService/WcfProject" +
"NService.svc/httpbinary");
}
if ((endpointConfiguration == EndpointConfiguration.httpssoap11Endpoint))
{
return new System.ServiceModel.EndpointAddress("https://wcfprojectnserver.redmond.corp.microsoft.com/WcfProjectNService/WcfProjec" +
"tNService.svc/httpssoap11");
}
if ((endpointConfiguration == EndpointConfiguration.httpssoap12Endpoint))
{
return new System.ServiceModel.EndpointAddress("https://wcfprojectnserver.redmond.corp.microsoft.com/WcfProjectNService/WcfProjec" +
"tNService.svc/httpssoap12");
}
if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding))
{
return new System.ServiceModel.EndpointAddress("net.tcp://wcfprojectnserver.redmond.corp.microsoft.com/WcfProjectNService/WcfProj" +
"ectNService.svc/tcpdefault");
}
if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding1))
{
return new System.ServiceModel.EndpointAddress("net.tcp://wcfprojectnserver.redmond.corp.microsoft.com/WcfProjectNService/WcfProj" +
"ectNService.svc/tcpnosecurity");
}
throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
}
public enum EndpointConfiguration
{
defaultEndpoint,
defaultBasic,
basicHttpEndpoint,
basicHttpsEndpoint,
httpsoap11Endpoint,
httpsoap12Endpoint,
httpbinaryEndpoint,
httpssoap11Endpoint,
httpssoap12Endpoint,
nettcpdefaultBinding,
nettcpdefaultBinding1,
}
}
} | mit |
tvcsantos/Flexget | flexget/plugins/filter/series.py | 70663 | from __future__ import unicode_literals, division, absolute_import
import argparse
import logging
import re
import time
from copy import copy
from datetime import datetime, timedelta
from sqlalchemy import (Column, Integer, String, Unicode, DateTime, Boolean,
desc, select, update, delete, ForeignKey, Index, func, and_, not_, UniqueConstraint)
from sqlalchemy.orm import relation, backref
from sqlalchemy.ext.hybrid import Comparator, hybrid_property
from sqlalchemy.exc import OperationalError, IntegrityError
from flexget import db_schema, options, plugin
from flexget.config_schema import one_or_more
from flexget.event import event
from flexget.manager import Session
from flexget.utils import qualities
from flexget.utils.log import log_once
from flexget.plugins.parsers import ParseWarning, SERIES_ID_TYPES
from flexget.plugin import get_plugin_by_name
from flexget.utils.sqlalchemy_utils import (table_columns, table_exists, drop_tables, table_schema, table_add_column,
create_index)
from flexget.utils.tools import merge_dict_from_to, parse_timedelta
from flexget.utils.database import quality_property
SCHEMA_VER = 12
log = logging.getLogger('series')
Base = db_schema.versioned_base('series', SCHEMA_VER)
@db_schema.upgrade('series')
def upgrade(ver, session):
if ver is None:
if table_exists('episode_qualities', session):
log.info('Series database format is too old to upgrade, dropping and recreating tables.')
# Drop the deprecated data
drop_tables(['series', 'series_episodes', 'episode_qualities'], session)
# Create new tables from the current models
Base.metadata.create_all(bind=session.bind)
# Upgrade episode_releases table to have a proper count and seed it with appropriate numbers
columns = table_columns('episode_releases', session)
if not 'proper_count' in columns:
log.info('Upgrading episode_releases table to have proper_count column')
table_add_column('episode_releases', 'proper_count', Integer, session)
release_table = table_schema('episode_releases', session)
for row in session.execute(select([release_table.c.id, release_table.c.title])):
# Recalculate the proper_count from title for old episodes
proper_count = get_plugin_by_name('parsing').parse_series(row['title']).proper_count
session.execute(update(release_table, release_table.c.id == row['id'], {'proper_count': proper_count}))
ver = 0
if ver == 0:
log.info('Migrating first_seen column from series_episodes to episode_releases table.')
# Create the column in episode_releases
table_add_column('episode_releases', 'first_seen', DateTime, session)
# Seed the first_seen value for all the past releases with the first_seen of their episode.
episode_table = table_schema('series_episodes', session)
release_table = table_schema('episode_releases', session)
for row in session.execute(select([episode_table.c.id, episode_table.c.first_seen])):
session.execute(update(release_table, release_table.c.episode_id == row['id'],
{'first_seen': row['first_seen']}))
ver = 1
if ver == 1:
log.info('Adding `identified_by` column to series table.')
table_add_column('series', 'identified_by', String, session)
ver = 2
if ver == 2:
log.info('Creating index on episode_releases table.')
create_index('episode_releases', session, 'episode_id')
ver = 3
if ver == 3:
# Remove index on Series.name
try:
Index('ix_series_name').drop(bind=session.bind)
except OperationalError:
log.debug('There was no ix_series_name index to remove.')
# Add Series.name_lower column
log.info('Adding `name_lower` column to series table.')
table_add_column('series', 'name_lower', Unicode, session)
series_table = table_schema('series', session)
create_index('series', session, 'name_lower')
# Fill in lower case name column
session.execute(update(series_table, values={'name_lower': func.lower(series_table.c.name)}))
ver = 4
if ver == 4:
log.info('Adding `identified_by` column to episodes table.')
table_add_column('series_episodes', 'identified_by', String, session)
series_table = table_schema('series', session)
# Clear out identified_by id series so that they can be auto detected again
session.execute(update(series_table, series_table.c.identified_by != 'ep', {'identified_by': None}))
# Warn users about a possible config change needed.
log.warning('If you are using `identified_by: id` option for the series plugin for date, '
'or abolute numbered series, you will need to update your config. Two new identified_by modes have '
'been added, `date` and `sequence`. In addition, if you are using auto identified_by, it will'
'be relearned based on upcoming episodes.')
ver = 5
if ver == 5:
# Episode advancement now relies on identified_by being filled for the episodes.
# This action retroactively marks 'ep' mode for all episodes where the series is already in 'ep' mode.
series_table = table_schema('series', session)
ep_table = table_schema('series_episodes', session)
ep_mode_series = select([series_table.c.id], series_table.c.identified_by == 'ep')
where_clause = and_(ep_table.c.series_id.in_(ep_mode_series),
ep_table.c.season != None, ep_table.c.number != None, ep_table.c.identified_by == None)
session.execute(update(ep_table, where_clause, {'identified_by': 'ep'}))
ver = 6
if ver == 6:
# Translate old qualities into new quality requirements
release_table = table_schema('episode_releases', session)
for row in session.execute(select([release_table.c.id, release_table.c.quality])):
# Webdl quality no longer has dash
new_qual = row['quality'].replace('web-dl', 'webdl')
if row['quality'] != new_qual:
session.execute(update(release_table, release_table.c.id == row['id'],
{'quality': new_qual}))
ver = 7
# Normalization rules changed for 7 and 8, but only run this once
if ver in [7, 8]:
# Merge series that qualify as duplicates with new normalization scheme
series_table = table_schema('series', session)
ep_table = table_schema('series_episodes', session)
all_series = session.execute(select([series_table.c.name, series_table.c.id]))
unique_series = {}
for row in all_series:
unique_series.setdefault(normalize_series_name(row['name']), []).append(row['id'])
for series, ids in unique_series.iteritems():
session.execute(update(ep_table, ep_table.c.series_id.in_(ids), {'series_id': ids[0]}))
if len(ids) > 1:
session.execute(delete(series_table, series_table.c.id.in_(ids[1:])))
session.execute(update(series_table, series_table.c.id == ids[0], {'name_lower': series}))
ver = 9
if ver == 9:
table_add_column('series', 'begin_episode_id', Integer, session)
ver = 10
if ver == 10:
# Due to bad db cleanups there may be invalid entries in series_tasks table
series_tasks = table_schema('series_tasks', session)
series_table = table_schema('series', session)
log.verbose('Repairing series_tasks table data')
session.execute(delete(series_tasks, ~series_tasks.c.series_id.in_(select([series_table.c.id]))))
ver = 11
if ver == 11:
# SeriesTasks was cleared out due to a bug, make sure they get recalculated next run #2772
from flexget.task import config_changed
config_changed()
ver = 12
return ver
@event('manager.db_cleanup')
def db_cleanup(session):
# Clean up old undownloaded releases
result = session.query(Release).\
filter(Release.downloaded == False).\
filter(Release.first_seen < datetime.now() - timedelta(days=120)).delete(False)
if result:
log.verbose('Removed %d undownloaded episode releases.', result)
# Clean up episodes without releases
result = session.query(Episode).filter(~Episode.releases.any()).filter(~Episode.begins_series.any()).delete(False)
if result:
log.verbose('Removed %d episodes without releases.', result)
# Clean up series without episodes that aren't in any tasks
result = session.query(Series).filter(~Series.episodes.any()).filter(~Series.in_tasks.any()).delete(False)
if result:
log.verbose('Removed %d series without episodes.', result)
@event('manager.lock_acquired')
def repair(manager):
# Perform database repairing and upgrading at startup.
if not manager.persist.get('series_repaired', False):
session = Session()
try:
# For some reason at least I have some releases in database which don't belong to any episode.
for release in session.query(Release).filter(Release.episode == None).all():
log.info('Purging orphan release %s from database', release.title)
session.delete(release)
session.commit()
finally:
session.close()
manager.persist['series_repaired'] = True
# Run clean_series the first time we get a database lock, since we won't have had one the first time the config
# got loaded.
clean_series(manager)
@event('manager.config_updated')
def clean_series(manager):
# Unmark series from tasks which have been deleted.
if not manager.has_lock:
return
with Session() as session:
removed_tasks = session.query(SeriesTask)
if manager.tasks:
removed_tasks = removed_tasks.filter(not_(SeriesTask.name.in_(manager.tasks)))
deleted = removed_tasks.delete(synchronize_session=False)
if deleted:
session.commit()
TRANSLATE_MAP = {ord(u'&'): u' and '}
for char in u'\'\\':
TRANSLATE_MAP[ord(char)] = u''
for char in u'_./-,[]():':
TRANSLATE_MAP[ord(char)] = u' '
def normalize_series_name(name):
"""Returns a normalized version of the series name."""
name = name.lower()
name = name.replace('&', ' and ')
name = name.translate(TRANSLATE_MAP) # Replaced some symbols with spaces
name = u' '.join(name.split())
return name
class NormalizedComparator(Comparator):
def operate(self, op, other):
return op(self.__clause_element__(), normalize_series_name(other))
class AlternateNames(Base):
""" Similar to Series. Name is handled case insensitively transparently.
"""
__tablename__ = 'series_alternate_names'
id = Column(Integer, primary_key=True)
_alt_name = Column('alt_name', Unicode)
_alt_name_normalized = Column('alt_name_normalized', Unicode, index=True, unique=True)
series_id = Column(Integer, ForeignKey('series.id'), nullable=False)
def name_setter(self, value):
self._alt_name = value
self._alt_name_normalized = normalize_series_name(value)
def name_getter(self):
return self._alt_name
def name_comparator(self):
return NormalizedComparator(self._alt_name_normalized)
alt_name = hybrid_property(name_getter, name_setter)
alt_name.comparator(name_comparator)
def __init__(self, name):
self.alt_name = name
def __unicode__(self):
return '<SeriesAlternateName(series_id=%s, alt_name=%s)>' % (self.series_id, self.alt_name)
def __repr__(self):
return unicode(self).encode('ascii', 'replace')
#Index('alternatenames_series_name', AlternateNames.alt_name, unique=True)
class Series(Base):
""" Name is handled case insensitively transparently
"""
__tablename__ = 'series'
id = Column(Integer, primary_key=True)
_name = Column('name', Unicode)
_name_normalized = Column('name_lower', Unicode, index=True, unique=True)
identified_by = Column(String)
begin_episode_id = Column(Integer, ForeignKey('series_episodes.id', name='begin_episode_id', use_alter=True))
begin = relation('Episode', uselist=False, primaryjoin="Series.begin_episode_id == Episode.id",
foreign_keys=[begin_episode_id], post_update=True, backref='begins_series')
episodes = relation('Episode', backref='series', cascade='all, delete, delete-orphan',
primaryjoin='Series.id == Episode.series_id')
in_tasks = relation('SeriesTask', backref=backref('series', uselist=False), cascade='all, delete, delete-orphan')
alternate_names = relation('AlternateNames', backref='series', primaryjoin='Series.id == AlternateNames.series_id',
cascade='all, delete, delete-orphan')
# Make a special property that does indexed case insensitive lookups on name, but stores/returns specified case
def name_getter(self):
return self._name
def name_setter(self, value):
self._name = value
self._name_normalized = normalize_series_name(value)
def name_comparator(self):
return NormalizedComparator(self._name_normalized)
name = hybrid_property(name_getter, name_setter)
name.comparator(name_comparator)
def __unicode__(self):
return '<Series(id=%s,name=%s)>' % (self.id, self.name)
def __repr__(self):
return unicode(self).encode('ascii', 'replace')
class Episode(Base):
__tablename__ = 'series_episodes'
id = Column(Integer, primary_key=True)
identifier = Column(String)
season = Column(Integer)
number = Column(Integer)
identified_by = Column(String)
series_id = Column(Integer, ForeignKey('series.id'), nullable=False)
releases = relation('Release', backref='episode', cascade='all, delete, delete-orphan')
@hybrid_property
def first_seen(self):
if not self.releases:
return None
return min(release.first_seen for release in self.releases)
@first_seen.expression
def first_seen(cls):
return select([func.min(Release.first_seen)]).where(Release.episode_id == cls.id).\
correlate(Episode.__table__).label('first_seen')
@property
def age(self):
"""
:return: Pretty string representing age of episode. eg "23d 12h" or "No releases seen"
"""
if not self.first_seen:
return 'No releases seen'
diff = datetime.now() - self.first_seen
age_days = diff.days
age_hours = diff.seconds // 60 // 60
age = ''
if age_days:
age += '%sd ' % age_days
age += '%sh' % age_hours
return age
@property
def is_premiere(self):
if self.season == 1 and self.number in (0, 1):
return 'Series Premiere'
elif self.number in (0, 1):
return 'Season Premiere'
return False
@property
def downloaded_releases(self):
return [release for release in self.releases if release.downloaded]
def __unicode__(self):
return '<Episode(id=%s,identifier=%s,season=%s,number=%s)>' % \
(self.id, self.identifier, self.season, self.number)
def __repr__(self):
return unicode(self).encode('ascii', 'replace')
def __eq__(self, other):
if not isinstance(other, Episode):
return NotImplemented
if self.identified_by != other.identified_by:
return NotImplemented
return self.identifier == other.identifier
def __lt__(self, other):
if not isinstance(other, Episode):
return NotImplemented
if self.identified_by != other.identified_by:
return NotImplemented
if self.identified_by in ['ep', 'sequence']:
return self.season < other.season or (self.season == other.season and self.number < other.number)
if self.identified_by == 'date':
return self.identifier < other.identifier
# Can't compare id type identifiers
return NotImplemented
Index('episode_series_identifier', Episode.series_id, Episode.identifier)
class Release(Base):
__tablename__ = 'episode_releases'
id = Column(Integer, primary_key=True)
episode_id = Column(Integer, ForeignKey('series_episodes.id'), nullable=False, index=True)
_quality = Column('quality', String)
quality = quality_property('_quality')
downloaded = Column(Boolean, default=False)
proper_count = Column(Integer, default=0)
title = Column(Unicode)
first_seen = Column(DateTime)
def __init__(self):
self.first_seen = datetime.now()
@property
def proper(self):
# TODO: TEMP
import warnings
warnings.warn("accessing deprecated release.proper, use release.proper_count instead")
return self.proper_count > 0
def __unicode__(self):
return '<Release(id=%s,quality=%s,downloaded=%s,proper_count=%s,title=%s)>' % \
(self.id, self.quality, self.downloaded, self.proper_count, self.title)
def __repr__(self):
return unicode(self).encode('ascii', 'replace')
class SeriesTask(Base):
__tablename__ = 'series_tasks'
id = Column(Integer, primary_key=True)
series_id = Column(Integer, ForeignKey('series.id'), nullable=False)
name = Column(Unicode, index=True)
def __init__(self, name):
self.name = name
def get_latest_episode(series):
"""Return latest known identifier in dict (season, episode, name) for series name"""
session = Session.object_session(series)
episode = session.query(Episode).join(Episode.series).\
filter(Series.id == series.id).\
filter(Episode.season != None).\
order_by(desc(Episode.season)).\
order_by(desc(Episode.number)).first()
if not episode:
# log.trace('get_latest_info: no info available for %s', name)
return False
# log.trace('get_latest_info, series: %s season: %s episode: %s' % \
# (name, episode.season, episode.number))
return episode
def auto_identified_by(series):
"""
Determine if series `name` should be considered identified by episode or id format
Returns 'ep', 'sequence', 'date' or 'id' if enough history is present to identify the series' id type.
Returns 'auto' if there is not enough history to determine the format yet
"""
session = Session.object_session(series)
type_totals = dict(session.query(Episode.identified_by, func.count(Episode.identified_by)).join(Episode.series).
filter(Series.id == series.id).group_by(Episode.identified_by).all())
# Remove None and specials from the dict,
# we are only considering episodes that we know the type of (parsed with new parser)
type_totals.pop(None, None)
type_totals.pop('special', None)
if not type_totals:
return 'auto'
log.debug('%s episode type totals: %r', series.name, type_totals)
# Find total number of parsed episodes
total = sum(type_totals.itervalues())
# See which type has the most
best = max(type_totals, key=lambda x: type_totals[x])
# Ep mode locks in faster than the rest. At 2 seen episodes.
if type_totals.get('ep', 0) >= 2 and type_totals['ep'] > total / 3:
log.info('identified_by has locked in to type `ep` for %s', series.name)
return 'ep'
# If we have over 3 episodes all of the same type, lock in
if len(type_totals) == 1 and total >= 3:
return best
# Otherwise wait until 5 episodes to lock in
if total >= 5:
log.info('identified_by has locked in to type `%s` for %s', best, series.name)
return best
log.verbose('identified by is currently on `auto` for %s. '
'Multiple id types may be accepted until it locks in on the appropriate type.', series.name)
return 'auto'
def get_latest_release(series, downloaded=True, season=None):
"""
:param Series series: SQLAlchemy session
:param Downloaded: find only downloaded releases
:param Season: season to find newest release for
:return: Instance of Episode or None if not found.
"""
session = Session.object_session(series)
releases = session.query(Episode).join(Episode.releases, Episode.series).filter(Series.id == series.id)
if downloaded:
releases = releases.filter(Release.downloaded == True)
if season is not None:
releases = releases.filter(Episode.season == season)
if series.identified_by and series.identified_by != 'auto':
releases = releases.filter(Episode.identified_by == series.identified_by)
if series.identified_by in ['ep', 'sequence']:
latest_release = releases.order_by(desc(Episode.season), desc(Episode.number)).first()
elif series.identified_by == 'date':
latest_release = releases.order_by(desc(Episode.identifier)).first()
else:
latest_release = releases.order_by(desc(Episode.first_seen)).first()
if not latest_release:
log.debug('get_latest_release returning None, no downloaded episodes found for: %s', series.name)
return
return latest_release
def new_eps_after(since_ep):
"""
:param since_ep: Episode instance
:return: Number of episodes since then
"""
session = Session.object_session(since_ep)
series = since_ep.series
series_eps = session.query(Episode).join(Episode.series).\
filter(Series.id == series.id)
if series.identified_by == 'ep':
if since_ep.season is None or since_ep.number is None:
log.debug('new_eps_after for %s falling back to timestamp because latest dl in non-ep format' %
series.name)
return series_eps.filter(Episode.first_seen > since_ep.first_seen).count()
return series_eps.filter((Episode.identified_by == 'ep') &
(((Episode.season == since_ep.season) & (Episode.number > since_ep.number)) |
(Episode.season > since_ep.season))).count()
elif series.identified_by == 'seq':
return series_eps.filter(Episode.number > since_ep.number).count()
elif series.identified_by == 'id':
return series_eps.filter(Episode.first_seen > since_ep.first_seen).count()
else:
log.debug('unsupported identified_by %s', series.identified_by)
return 0
def store_parser(session, parser, series=None):
"""
Push series information into database. Returns added/existing release.
:param session: Database session to use
:param parser: parser for release that should be added to database
:param series: Series in database to add release to. Will be looked up if not provided.
:return: List of Releases
"""
if not series:
# if series does not exist in database, add new
series = session.query(Series).\
filter(Series.name == parser.name).\
filter(Series.id != None).first()
if not series:
log.debug('adding series %s into db', parser.name)
series = Series()
series.name = parser.name
session.add(series)
log.debug('-> added %s' % series)
releases = []
for ix, identifier in enumerate(parser.identifiers):
# if episode does not exist in series, add new
episode = session.query(Episode).filter(Episode.series_id == series.id).\
filter(Episode.identifier == identifier).\
filter(Episode.series_id != None).first()
if not episode:
log.debug('adding episode %s into series %s', identifier, parser.name)
episode = Episode()
episode.identifier = identifier
episode.identified_by = parser.id_type
# if episodic format
if parser.id_type == 'ep':
episode.season = parser.season
episode.number = parser.episode + ix
elif parser.id_type == 'sequence':
episode.season = 0
episode.number = parser.id + ix
series.episodes.append(episode) # pylint:disable=E1103
log.debug('-> added %s' % episode)
# if release does not exists in episode, add new
#
# NOTE:
#
# filter(Release.episode_id != None) fixes weird bug where release had/has been added
# to database but doesn't have episode_id, this causes all kinds of havoc with the plugin.
# perhaps a bug in sqlalchemy?
release = session.query(Release).filter(Release.episode_id == episode.id).\
filter(Release.title == parser.data).\
filter(Release.quality == parser.quality).\
filter(Release.proper_count == parser.proper_count).\
filter(Release.episode_id != None).first()
if not release:
log.debug('adding release %s into episode', parser)
release = Release()
release.quality = parser.quality
release.proper_count = parser.proper_count
release.title = parser.data
episode.releases.append(release) # pylint:disable=E1103
log.debug('-> added %s' % release)
releases.append(release)
session.flush() # Make sure autonumber ids are populated
return releases
def set_series_begin(series, ep_id):
"""
Set beginning for series
:param Series series: Series instance
:param ep_id: Integer for sequence mode, SxxEyy for episodic and yyyy-mm-dd for date.
:raises ValueError: If malformed ep_id or series in different mode
"""
# If identified_by is not explicitly specified, auto-detect it based on begin identifier
# TODO: use some method of series parser to do the identifier parsing
session = Session.object_session(series)
if isinstance(ep_id, int):
identified_by = 'sequence'
elif re.match(r'(?i)^S\d{1,4}E\d{1,2}$', ep_id):
identified_by = 'ep'
ep_id = ep_id.upper()
elif re.match(r'\d{4}-\d{2}-\d{2}', ep_id):
identified_by = 'date'
else:
# Check if a sequence identifier was passed as a string
try:
ep_id = int(ep_id)
identified_by = 'sequence'
except ValueError:
raise ValueError('`%s` is not a valid episode identifier' % ep_id)
if series.identified_by not in ['auto', '', None]:
if identified_by != series.identified_by:
raise ValueError('`begin` value `%s` does not match identifier type for identified_by `%s`' %
(ep_id, series.identified_by))
series.identified_by = identified_by
episode = (session.query(Episode).filter(Episode.series_id == series.id).
filter(Episode.identified_by == series.identified_by).
filter(Episode.identifier == str(ep_id)).first())
if not episode:
# TODO: Don't duplicate code from self.store method
episode = Episode()
episode.identifier = ep_id
episode.identified_by = identified_by
if identified_by == 'ep':
match = re.match(r'S(\d+)E(\d+)', ep_id)
episode.season = int(match.group(1))
episode.number = int(match.group(2))
elif identified_by == 'sequence':
episode.season = 0
episode.number = ep_id
series.episodes.append(episode)
# Need to flush to get an id on new Episode before assigning it as series begin
session.flush()
series.begin = episode
def forget_series(name):
"""Remove a whole series `name` from database."""
session = Session()
try:
series = session.query(Series).filter(Series.name == name).all()
if series:
for s in series:
session.delete(s)
session.commit()
log.debug('Removed series %s from database.', name)
else:
raise ValueError('Unknown series %s' % name)
finally:
session.close()
def forget_series_episode(name, identifier):
"""Remove all episodes by `identifier` from series `name` from database."""
session = Session()
try:
series = session.query(Series).filter(Series.name == name).first()
if series:
episode = session.query(Episode).filter(Episode.identifier == identifier).\
filter(Episode.series_id == series.id).first()
if episode:
series.identified_by = '' # reset identified_by flag so that it will be recalculated
session.delete(episode)
session.commit()
log.debug('Episode %s from series %s removed from database.', identifier, name)
else:
raise ValueError('Unknown identifier %s for series %s' % (identifier, name.capitalize()))
else:
raise ValueError('Unknown series %s' % name)
finally:
session.close()
def populate_entry_fields(entry, parser):
entry['series_parser'] = copy(parser)
# add series, season and episode to entry
entry['series_name'] = parser.name
if 'quality' in entry and entry['quality'] != parser.quality:
log.verbose('Found different quality for %s. Was %s, overriding with %s.' %
(entry['title'], entry['quality'], parser.quality))
entry['quality'] = parser.quality
entry['proper'] = parser.proper
entry['proper_count'] = parser.proper_count
if parser.id_type == 'ep':
entry['series_season'] = parser.season
entry['series_episode'] = parser.episode
elif parser.id_type == 'date':
entry['series_date'] = parser.id
entry['series_season'] = parser.id.year
else:
entry['series_season'] = time.gmtime().tm_year
entry['series_episodes'] = parser.episodes
entry['series_id'] = parser.pack_identifier
entry['series_id_type'] = parser.id_type
class FilterSeriesBase(object):
"""
Class that contains helper methods for both filter.series as well as plugins that configure it,
such as all_series, series_premiere and configure_series.
"""
@property
def settings_schema(self):
return {
'title': 'series options',
'type': 'object',
'properties': {
'path': {'type': 'string'},
'set': {'type': 'object'},
'alternate_name': one_or_more({'type': 'string'}),
# Custom regexp options
'name_regexp': one_or_more({'type': 'string', 'format': 'regex'}),
'ep_regexp': one_or_more({'type': 'string', 'format': 'regex'}),
'date_regexp': one_or_more({'type': 'string', 'format': 'regex'}),
'sequence_regexp': one_or_more({'type': 'string', 'format': 'regex'}),
'id_regexp': one_or_more({'type': 'string', 'format': 'regex'}),
# Date parsing options
'date_yearfirst': {'type': 'boolean'},
'date_dayfirst': {'type': 'boolean'},
# Quality options
'quality': {'type': 'string', 'format': 'quality_requirements'},
'qualities': {'type': 'array', 'items': {'type': 'string', 'format': 'quality_requirements'}},
'timeframe': {'type': 'string', 'format': 'interval'},
'upgrade': {'type': 'boolean'},
'target': {'type': 'string', 'format': 'quality_requirements'},
# Specials
'specials': {'type': 'boolean'},
# Propers (can be boolean, or an interval string)
'propers': {'type': ['boolean', 'string'], 'format': 'interval'},
# Identified by
'identified_by': {
'type': 'string', 'enum': ['ep', 'date', 'sequence', 'id', 'auto']
},
# Strict naming
'exact': {'type': 'boolean'},
# Begin takes an ep, sequence or date identifier
'begin': {
'oneOf': [
{'name': 'ep identifier', 'type': 'string', 'pattern': r'(?i)^S\d{2,4}E\d{2,3}$',
'error_pattern': 'episode identifiers should be in the form `SxxEyy`'},
{'name': 'date identifier', 'type': 'string', 'pattern': r'^\d{4}-\d{2}-\d{2}$',
'error_pattern': 'date identifiers must be in the form `YYYY-MM-DD`'},
{'name': 'sequence identifier', 'type': 'integer', 'minimum': 0}
]
},
'from_group': one_or_more({'type': 'string'}),
'parse_only': {'type': 'boolean'},
'special_ids': one_or_more({'type': 'string'}),
'prefer_specials': {'type': 'boolean'},
'assume_special': {'type': 'boolean'},
'tracking': {'type': ['boolean', 'string'], 'enum': [True, False, 'backfill']}
},
'additionalProperties': False
}
def make_grouped_config(self, config):
"""Turns a simple series list into grouped format with a empty settings dict"""
if not isinstance(config, dict):
# convert simplest configuration internally grouped format
config = {'simple': config, 'settings': {}}
else:
# already in grouped format, just make sure there's settings
config.setdefault('settings', {})
return config
def apply_group_options(self, config):
"""Applies group settings to each item in series group and removes settings dict."""
# Make sure config is in grouped format first
config = self.make_grouped_config(config)
for group_name in config:
if group_name == 'settings':
continue
group_series = []
if isinstance(group_name, basestring):
# if group name is known quality, convenience create settings with that quality
try:
qualities.Requirements(group_name)
config['settings'].setdefault(group_name, {}).setdefault('target', group_name)
except ValueError:
# If group name is not a valid quality requirement string, do nothing.
pass
for series in config[group_name]:
# convert into dict-form if necessary
series_settings = {}
group_settings = config['settings'].get(group_name, {})
if isinstance(series, dict):
series, series_settings = series.items()[0]
if series_settings is None:
raise Exception('Series %s has unexpected \':\'' % series)
# Make sure this isn't a series with no name
if not series:
log.warning('Series config contains a series with no name!')
continue
# make sure series name is a string to accommodate for "24"
if not isinstance(series, basestring):
series = unicode(series)
# if series have given path instead of dict, convert it into a dict
if isinstance(series_settings, basestring):
series_settings = {'path': series_settings}
# merge group settings into this series settings
merge_dict_from_to(group_settings, series_settings)
# Convert to dict if watched is in SXXEXX format
if isinstance(series_settings.get('watched'), basestring):
season, episode = series_settings['watched'].upper().split('E')
season = season.lstrip('S')
series_settings['watched'] = {'season': int(season), 'episode': int(episode)}
# Convert enough to target for backwards compatibility
if 'enough' in series_settings:
log.warning('Series setting `enough` has been renamed to `target` please update your config.')
series_settings.setdefault('target', series_settings['enough'])
# Add quality: 720p if timeframe is specified with no target
if 'timeframe' in series_settings and 'qualities' not in series_settings:
series_settings.setdefault('target', '720p hdtv+')
group_series.append({series: series_settings})
config[group_name] = group_series
del config['settings']
return config
def prepare_config(self, config):
"""Generate a list of unique series from configuration.
This way we don't need to handle two different configuration formats in the logic.
Applies group settings with advanced form."""
config = self.apply_group_options(config)
return self.combine_series_lists(*config.values())
def combine_series_lists(self, *series_lists, **kwargs):
"""Combines the series from multiple lists, making sure there are no doubles.
If keyword argument log_once is set to True, an error message will be printed if a series
is listed more than once, otherwise log_once will be used."""
unique_series = {}
for series_list in series_lists:
for series in series_list:
series, series_settings = series.items()[0]
if series not in unique_series:
unique_series[series] = series_settings
else:
if kwargs.get('log_once'):
log_once('Series %s is already configured in series plugin' % series, log)
else:
log.warning('Series %s is configured multiple times in series plugin.', series)
# Combine the config dicts for both instances of the show
unique_series[series].update(series_settings)
# Turn our all_series dict back into a list
# sort by reverse alpha, so that in the event of 2 series with common prefix, more specific is parsed first
return [{series: unique_series[series]} for series in sorted(unique_series, reverse=True)]
def merge_config(self, task, config):
"""Merges another series config dict in with the current one."""
# Make sure we start with both configs as a list of complex series
native_series = self.prepare_config(task.config.get('series', {}))
merging_series = self.prepare_config(config)
task.config['series'] = self.combine_series_lists(merging_series, native_series, log_once=True)
return task.config['series']
class FilterSeries(FilterSeriesBase):
"""
Intelligent filter for tv-series.
http://flexget.com/wiki/Plugins/series
"""
@property
def schema(self):
return {
'type': ['array', 'object'],
# simple format:
# - series
# - another series
'items': {
'type': ['string', 'number', 'object'],
'additionalProperties': self.settings_schema
},
# advanced format:
# settings:
# group: {...}
# group:
# {...}
'properties': {
'settings': {
'type': 'object',
'additionalProperties': self.settings_schema
}
},
'additionalProperties': {
'type': 'array',
'items': {
'type': ['string', 'number', 'object'],
'additionalProperties': self.settings_schema
}
}
}
def __init__(self):
try:
self.backlog = plugin.get_plugin_by_name('backlog')
except plugin.DependencyError:
log.warning('Unable utilize backlog plugin, episodes may slip trough timeframe')
def auto_exact(self, config):
"""Automatically enable exact naming option for series that look like a problem"""
# generate list of all series in one dict
all_series = {}
for series_item in config:
series_name, series_config = series_item.items()[0]
all_series[series_name] = series_config
# scan for problematic names, enable exact mode for them
for series_name, series_config in all_series.iteritems():
for name in all_series.keys():
if (name.lower().startswith(series_name.lower())) and \
(name.lower() != series_name.lower()):
if not 'exact' in series_config:
log.verbose('Auto enabling exact matching for series %s (reason %s)', series_name, name)
series_config['exact'] = True
# Run after metainfo_quality and before metainfo_series
@plugin.priority(125)
def on_task_metainfo(self, task, config):
config = self.prepare_config(config)
self.auto_exact(config)
for series_item in config:
series_name, series_config = series_item.items()[0]
log.trace('series_name: %s series_config: %s', series_name, series_config)
start_time = time.clock()
self.parse_series(task.entries, series_name, series_config)
took = time.clock() - start_time
log.trace('parsing %s took %s', series_name, took)
def on_task_filter(self, task, config):
"""Filter series"""
# Parsing was done in metainfo phase, create the dicts to pass to process_series from the task entries
# key: series episode identifier ie. S01E02
# value: seriesparser
config = self.prepare_config(config)
found_series = {}
for entry in task.entries:
if entry.get('series_name') and entry.get('series_id') is not None and entry.get('series_parser'):
found_series.setdefault(entry['series_name'], []).append(entry)
for series_item in config:
with Session() as session:
series_name, series_config = series_item.items()[0]
if series_config.get('parse_only'):
log.debug('Skipping filtering of series %s because of parse_only', series_name)
continue
# Make sure number shows (e.g. 24) are turned into strings
series_name = unicode(series_name)
db_series = session.query(Series).filter(Series.name == series_name).first()
if not db_series:
log.debug('adding series %s into db', series_name)
db_series = Series()
db_series.name = series_name
db_series.identified_by = series_config.get('identified_by', 'auto')
session.add(db_series)
log.debug('-> added %s' % db_series)
session.flush() # Flush to get an id on series before adding alternate names.
alts = series_config.get('alternate_name', [])
if not isinstance(alts, list):
alts = [alts]
for alt in alts:
_add_alt_name(alt, db_series, series_name, session)
if not series_name in found_series:
continue
series_entries = {}
for entry in found_series[series_name]:
# store found episodes into database and save reference for later use
releases = store_parser(session, entry['series_parser'], series=db_series)
entry['series_releases'] = [r.id for r in releases]
series_entries.setdefault(releases[0].episode, []).append(entry)
# TODO: Unfortunately we are setting these again, even though they were set in metanifo. This is
# for the benefit of all_series and series_premiere. Figure a better way.
# set custom download path
if 'path' in series_config:
log.debug('setting %s custom path to %s', entry['title'], series_config.get('path'))
# Just add this to the 'set' dictionary, so that string replacement is done cleanly
series_config.setdefault('set', {}).update(path=series_config['path'])
# accept info from set: and place into the entry
if 'set' in series_config:
set = plugin.get_plugin_by_name('set')
# TODO: Could cause lazy lookups. We don't really want to have a transaction open during this.
set.instance.modify(entry, series_config.get('set'))
# If we didn't find any episodes for this series, continue
if not series_entries:
log.trace('No entries found for %s this run.', series_name)
continue
# configuration always overrides everything
if series_config.get('identified_by', 'auto') != 'auto':
db_series.identified_by = series_config['identified_by']
# if series doesn't have identified_by flag already set, calculate one now that new eps are added to db
if not db_series.identified_by or db_series.identified_by == 'auto':
db_series.identified_by = auto_identified_by(db_series)
log.debug('identified_by set to \'%s\' based on series history', db_series.identified_by)
log.trace('series_name: %s series_config: %s', series_name, series_config)
import time
start_time = time.clock()
self.process_series(task, series_entries, series_config)
took = time.clock() - start_time
log.trace('processing %s took %s', series_name, took)
def parse_series(self, entries, series_name, config):
"""
Search for `series_name` and populate all `series_*` fields in entries when successfully parsed
:param session: SQLAlchemy session
:param entries: List of entries to process
:param series_name: Series name which is being processed
:param config: Series config being processed
"""
def get_as_array(config, key):
"""Return configuration key as array, even if given as a single string"""
v = config.get(key, [])
if isinstance(v, basestring):
return [v]
return v
# set parser flags flags based on config / database
identified_by = config.get('identified_by', 'auto')
if identified_by == 'auto':
with Session() as session:
series = session.query(Series).filter(Series.name == series_name).first()
if series:
# set flag from database
identified_by = series.identified_by or 'auto'
params = dict(identified_by=identified_by,
alternate_names=get_as_array(config, 'alternate_name'),
name_regexps=get_as_array(config, 'name_regexp'),
strict_name=config.get('exact', False),
allow_groups=get_as_array(config, 'from_group'),
date_yearfirst=config.get('date_yearfirst'),
date_dayfirst=config.get('date_dayfirst'),
special_ids=get_as_array(config, 'special_ids'),
prefer_specials=config.get('prefer_specials'),
assume_special=config.get('assume_special'))
for id_type in SERIES_ID_TYPES:
params[id_type + '_regexps'] = get_as_array(config, id_type + '_regexp')
for entry in entries:
# skip processed entries
if (entry.get('series_parser') and entry['series_parser'].valid and
entry['series_parser'].name.lower() != series_name.lower()):
continue
# Quality field may have been manipulated by e.g. assume_quality. Use quality field from entry if available.
parsed = get_plugin_by_name('parsing').instance.parse_series(entry['title'], name=series_name, **params)
if not parsed.valid:
continue
parsed.field = 'title'
log.debug('%s detected as %s, field: %s', entry['title'], parsed, parsed.field)
populate_entry_fields(entry, parsed)
# set custom download path
if 'path' in config:
log.debug('setting %s custom path to %s', entry['title'], config.get('path'))
# Just add this to the 'set' dictionary, so that string replacement is done cleanly
config.setdefault('set', {}).update(path=config['path'])
# accept info from set: and place into the entry
if 'set' in config:
set = plugin.get_plugin_by_name('set')
set.instance.modify(entry, config.get('set'))
def process_series(self, task, series_entries, config):
"""
Accept or Reject episode from available releases, or postpone choosing.
:param task: Current Task
:param series_entries: dict mapping Episodes to entries for that episode
:param config: Series configuration
"""
for ep, entries in series_entries.iteritems():
if not entries:
continue
reason = None
# sort episodes in order of quality
entries.sort(key=lambda e: e['series_parser'], reverse=True)
log.debug('start with episodes: %s', [e['title'] for e in entries])
# reject episodes that have been marked as watched in config file
if ep.series.begin:
if ep < ep.series.begin:
for entry in entries:
entry.reject('Episode `%s` is before begin value of `%s`' %
(ep.identifier, ep.series.begin.identifier))
continue
# skip special episodes if special handling has been turned off
if not config.get('specials', True) and ep.identified_by == 'special':
log.debug('Skipping special episode as support is turned off.')
continue
log.debug('current episodes: %s', [e['title'] for e in entries])
# quality filtering
if 'quality' in config:
entries = self.process_quality(config, entries)
if not entries:
continue
reason = 'matches quality'
# Many of the following functions need to know this info. Only look it up once.
downloaded = ep.downloaded_releases
downloaded_qualities = [rls.quality for rls in downloaded]
# proper handling
log.debug('-' * 20 + ' process_propers -->')
entries = self.process_propers(config, ep, entries)
if not entries:
continue
# Remove any eps we already have from the list
for entry in reversed(entries): # Iterate in reverse so we can safely remove from the list while iterating
if entry['series_parser'].quality in downloaded_qualities:
entry.reject('quality already downloaded')
entries.remove(entry)
if not entries:
continue
# Figure out if we need an additional quality for this ep
if downloaded:
if config.get('upgrade'):
# Remove all the qualities lower than what we have
for entry in reversed(entries):
if entry['series_parser'].quality < max(downloaded_qualities):
entry.reject('worse quality than already downloaded.')
entries.remove(entry)
if not entries:
continue
if 'target' in config and config.get('upgrade'):
# If we haven't grabbed the target yet, allow upgrade to it
self.process_timeframe_target(config, entries, downloaded)
continue
if 'qualities' in config:
# Grab any additional wanted qualities
log.debug('-' * 20 + ' process_qualities -->')
self.process_qualities(config, entries, downloaded)
continue
elif config.get('upgrade'):
entries[0].accept('is an upgrade to existing quality')
continue
# Reject eps because we have them
for entry in entries:
entry.reject('episode has already been downloaded')
continue
best = entries[0]
log.debug('continuing w. episodes: %s', [e['title'] for e in entries])
log.debug('best episode is: %s', best['title'])
# episode tracking. used only with season and sequence based series
if ep.identified_by in ['ep', 'sequence']:
if task.options.disable_tracking or not config.get('tracking', True):
log.debug('episode tracking disabled')
else:
log.debug('-' * 20 + ' episode tracking -->')
# Grace is number of distinct eps in the task for this series + 2
backfill = config.get('tracking') == 'backfill'
if self.process_episode_tracking(ep, entries, grace=len(series_entries)+2, backfill=backfill):
continue
# quality
if 'target' in config or 'qualities' in config:
if 'target' in config:
if self.process_timeframe_target(config, entries, downloaded):
continue
elif 'qualities' in config:
if self.process_qualities(config, entries, downloaded):
continue
# We didn't make a quality target match, check timeframe to see
# if we should get something anyway
if 'timeframe' in config:
if self.process_timeframe(task, config, ep, entries):
continue
reason = 'Timeframe expired, choosing best available'
else:
# If target or qualities is configured without timeframe, don't accept anything now
continue
# Just pick the best ep if we get here
reason = reason or 'choosing best available quality'
best.accept(reason)
def process_propers(self, config, episode, entries):
"""
Accepts needed propers. Nukes episodes from which there exists proper.
:returns: A list of episodes to continue processing.
"""
pass_filter = []
best_propers = []
# Since eps is sorted by quality then proper_count we always see the highest proper for a quality first.
(last_qual, best_proper) = (None, 0)
for entry in entries:
if entry['series_parser'].quality != last_qual:
last_qual, best_proper = entry['series_parser'].quality, entry['series_parser'].proper_count
best_propers.append(entry)
if entry['series_parser'].proper_count < best_proper:
# nuke qualities which there is a better proper available
entry.reject('nuked')
else:
pass_filter.append(entry)
# If propers support is turned off, or proper timeframe has expired just return the filtered eps list
if isinstance(config.get('propers', True), bool):
if not config.get('propers', True):
return pass_filter
else:
# propers with timeframe
log.debug('proper timeframe: %s', config['propers'])
timeframe = parse_timedelta(config['propers'])
first_seen = episode.first_seen
expires = first_seen + timeframe
log.debug('propers timeframe: %s', timeframe)
log.debug('first_seen: %s', first_seen)
log.debug('propers ignore after: %s', expires)
if datetime.now() > expires:
log.debug('propers timeframe expired')
return pass_filter
downloaded_qualities = dict((d.quality, d.proper_count) for d in episode.downloaded_releases)
log.debug('propers - downloaded qualities: %s' % downloaded_qualities)
# Accept propers we actually need, and remove them from the list of entries to continue processing
for entry in best_propers:
if (entry['series_parser'].quality in downloaded_qualities and
entry['series_parser'].proper_count > downloaded_qualities[entry['series_parser'].quality]):
entry.accept('proper')
pass_filter.remove(entry)
return pass_filter
def process_timeframe_target(self, config, entries, downloaded=None):
"""
Accepts first episode matching the quality configured for the series.
:return: True if accepted something
"""
req = qualities.Requirements(config['target'])
if downloaded:
if any(req.allows(release.quality) for release in downloaded):
log.debug('Target quality already achieved.')
return True
# scan for quality
for entry in entries:
if req.allows(entry['series_parser'].quality):
log.debug('Series accepting. %s meets quality %s', entry['title'], req)
entry.accept('target quality')
return True
def process_quality(self, config, entries):
"""
Filters eps that do not fall between within our defined quality standards.
:returns: A list of eps that are in the acceptable range
"""
reqs = qualities.Requirements(config['quality'])
log.debug('quality req: %s', reqs)
result = []
# see if any of the eps match accepted qualities
for entry in entries:
if reqs.allows(entry['quality']):
result.append(entry)
else:
log.verbose('Ignored `%s`. Does not meet quality requirement `%s`.', entry['title'], reqs)
if not result:
log.debug('no quality meets requirements')
return result
def process_episode_tracking(self, episode, entries, grace, backfill=False):
"""
Rejects all episodes that are too old or new, return True when this happens.
:param episode: Episode model
:param list entries: List of entries for given episode.
:param int grace: Number of episodes before or after latest download that are allowed.
:param bool backfill: If this is True, previous episodes will be allowed,
but forward advancement will still be restricted.
"""
latest = get_latest_release(episode.series)
if episode.series.begin and episode.series.begin > latest:
latest = episode.series.begin
log.debug('latest download: %s' % latest)
log.debug('current: %s' % episode)
if latest and latest.identified_by == episode.identified_by:
# Allow any previous episodes this season, or previous episodes within grace if sequence mode
if (not backfill and (episode.season < latest.season or
(episode.identified_by == 'sequence' and episode.number < (latest.number - grace)))):
log.debug('too old! rejecting all occurrences')
for entry in entries:
entry.reject('Too much in the past from latest downloaded episode %s' % latest.identifier)
return True
# Allow future episodes within grace, or first episode of next season
if (episode.season > latest.season + 1 or (episode.season > latest.season and episode.number > 1) or
(episode.season == latest.season and episode.number > (latest.number + grace))):
log.debug('too new! rejecting all occurrences')
for entry in entries:
entry.reject('Too much in the future from latest downloaded episode %s. '
'See `--disable-tracking` if this should be downloaded.' % latest.identifier)
return True
def process_timeframe(self, task, config, episode, entries):
"""
Runs the timeframe logic to determine if we should wait for a better quality.
Saves current best to backlog if timeframe has not expired.
:returns: True - if we should keep the quality (or qualities) restriction
False - if the quality restriction should be released, due to timeframe expiring
"""
if 'timeframe' not in config:
return True
best = entries[0]
# parse options
log.debug('timeframe: %s', config['timeframe'])
timeframe = parse_timedelta(config['timeframe'])
if config.get('quality'):
req = qualities.Requirements(config['quality'])
seen_times = [rls.first_seen for rls in episode.releases if req.allows(rls.quality)]
else:
seen_times = [rls.first_seen for rls in episode.releases]
# Somehow we can get here without having qualifying releases (#2779) make sure min doesn't crash
first_seen = min(seen_times) if seen_times else datetime.now()
expires = first_seen + timeframe
log.debug('timeframe: %s, first_seen: %s, expires: %s', timeframe, first_seen, expires)
stop = normalize_series_name(task.options.stop_waiting) == episode.series._name_normalized
if expires <= datetime.now() or stop:
# Expire timeframe, accept anything
log.info('Timeframe expired, releasing quality restriction.')
return False
else:
# verbose waiting, add to backlog
diff = expires - datetime.now()
hours, remainder = divmod(diff.seconds, 3600)
hours += diff.days * 24
minutes, seconds = divmod(remainder, 60)
log.info('Timeframe waiting %s for %sh:%smin, currently best is %s' %
(episode.series.name, hours, minutes, best['title']))
# add best entry to backlog (backlog is able to handle duplicate adds)
if self.backlog:
self.backlog.instance.add_backlog(task, best)
return True
def process_qualities(self, config, entries, downloaded):
"""
Handles all modes that can accept more than one quality per episode. (qualities, upgrade)
:returns: True - if at least one wanted quality has been downloaded or accepted.
False - if no wanted qualities have been accepted
"""
# Get list of already downloaded qualities
downloaded_qualities = [r.quality for r in downloaded]
log.debug('downloaded_qualities: %s', downloaded_qualities)
# If qualities key is configured, we only want qualities defined in it.
wanted_qualities = set([qualities.Requirements(name) for name in config.get('qualities', [])])
# Compute the requirements from our set that have not yet been fulfilled
still_needed = [req for req in wanted_qualities if not any(req.allows(qual) for qual in downloaded_qualities)]
log.debug('Wanted qualities: %s', wanted_qualities)
def wanted(quality):
"""Returns True if we want this quality based on the config options."""
wanted = not wanted_qualities or any(req.allows(quality) for req in wanted_qualities)
if config.get('upgrade'):
wanted = wanted and quality > max(downloaded_qualities or [qualities.Quality()])
return wanted
for entry in entries:
quality = entry['series_parser'].quality
log.debug('ep: %s quality: %s', entry['title'], quality)
if not wanted(quality):
log.debug('%s is unwanted quality', quality)
continue
if any(req.allows(quality) for req in still_needed):
# Don't get worse qualities in upgrade mode
if config.get('upgrade'):
if downloaded_qualities and quality < max(downloaded_qualities):
continue
entry.accept('quality wanted')
downloaded_qualities.append(quality)
downloaded.append(entry)
# Re-calculate what is still needed
still_needed = [req for req in still_needed if not req.allows(quality)]
return bool(downloaded_qualities)
def on_task_learn(self, task, config):
"""Learn succeeded episodes"""
log.debug('on_task_learn')
for entry in task.accepted:
if 'series_releases' in entry:
with Session() as session:
num = (session.query(Release).filter(Release.id.in_(entry['series_releases'])).
update({'downloaded': True}, synchronize_session=False))
log.debug('marking %s releases as downloaded for %s', num, entry)
else:
log.debug('%s is not a series', entry['title'])
class SeriesDBManager(FilterSeriesBase):
"""Update in the database with series info from the config"""
@plugin.priority(0)
def on_task_start(self, task, config):
if not task.config_modified:
return
# Clear all series from this task
with Session() as session:
session.query(SeriesTask).filter(SeriesTask.name == task.name).delete()
if not task.config.get('series'):
return
config = self.prepare_config(task.config['series'])
for series_item in config:
series_name, series_config = series_item.items()[0]
# Make sure number shows (e.g. 24) are turned into strings
series_name = unicode(series_name)
db_series = session.query(Series).filter(Series.name == series_name).first()
if db_series:
# Update database with capitalization from config
db_series.name = series_name
alts = series_config.get('alternate_name', [])
if not isinstance(alts, list):
alts = [alts]
# Remove the alternate names not present in current config
db_series.alternate_names = [alt for alt in db_series.alternate_names if alt.alt_name in alts]
# Add/update the possibly new alternate names
for alt in alts:
_add_alt_name(alt, db_series, series_name, session)
else:
log.debug('adding series %s into db', series_name)
db_series = Series()
db_series.name = series_name
session.add(db_series)
session.flush() # flush to get id on series before creating alternate names
log.debug('-> added %s' % db_series)
alts = series_config.get('alternate_name', [])
if not isinstance(alts, list):
alts = [alts]
for alt in alts:
_add_alt_name(alt, db_series, series_name, session)
db_series.in_tasks.append(SeriesTask(task.name))
if series_config.get('identified_by', 'auto') != 'auto':
db_series.identified_by = series_config['identified_by']
# Set the begin episode
if series_config.get('begin'):
try:
set_series_begin(db_series, series_config['begin'])
except ValueError as e:
raise plugin.PluginError(e)
def _add_alt_name(alt, db_series, series_name, session):
alt = unicode(alt)
db_series_alt = session.query(AlternateNames).join(Series).filter(AlternateNames.alt_name == alt).first()
if db_series_alt and db_series_alt.series_id == db_series.id:
# Already exists, no need to create it then
# TODO is checking the list for duplicates faster/better than querying the DB?
db_series_alt.alt_name = alt
elif db_series_alt:
# Alternate name already exists for another series. Not good.
raise plugin.PluginError('Error adding alternate name for %s. %s is already associated with %s. '
'Check your config.' % (series_name, alt, db_series_alt.series.name) )
else:
log.debug('adding alternate name %s for %s into db' % (alt, series_name))
db_series_alt = AlternateNames(alt)
db_series.alternate_names.append(db_series_alt)
log.debug('-> added %s' % db_series_alt)
@event('plugin.register')
def register_plugin():
plugin.register(FilterSeries, 'series', api_ver=2)
# This is a builtin so that it can update the database for tasks that may have had series plugin removed
plugin.register(SeriesDBManager, 'series_db', builtin=True, api_ver=2)
@event('options.register')
def register_parser_arguments():
exec_parser = options.get_parser('execute')
exec_parser.add_argument('--stop-waiting', action='store', dest='stop_waiting', default='',
metavar='NAME', help='stop timeframe for a given series')
exec_parser.add_argument('--disable-tracking', action='store_true', default=False,
help='disable episode advancement for this run')
# Backwards compatibility
exec_parser.add_argument('--disable-advancement', action='store_true', dest='disable_tracking',
help=argparse.SUPPRESS)
| mit |
dimzak/dimzak.github.io | docs/_posts/2017-08-08-additional-styles.md | 3656 | ---
title: TeXt - Additional Styles
key: 20170808
tags:
- TeXt
- English
toc: true
category: post
---
Success!
{:.success}
`success`{:.success} `info`{:.info} `warning`{:.warning} `error`{:.error}
<div class="grid-container">
<div class="grid grid--p-3">
<div class="cell cell--4 cell--md-5 cell--sm-12" markdown="1">
{:.rounded}
</div>
<div class="cell cell--4 cell--md-5 cell--sm-12" markdown="1">
{:.circle.shadow}
</div>
</div>
</div>
<div class="grid-container">
<div class="grid grid--p-1">
<div class="cell cell--2 cell--md-4 cell--sm-6">
<div class="button button--success button--pill my-2"><i class="fas fa-space-shuttle"></i> CLICK ME</div>
</div>
<div class="cell cell--2 cell--md-4 cell--sm-6">
<div class="button button--outline-info button--pill my-2"><i class="fas fa-space-shuttle"></i> CLICK ME</div>
</div>
<div class="cell cell--2 cell--md-4 cell--sm-6">
<div class="button button--warning button--rounded my-2"><i class="fas fa-user-astronaut"></i> CLICK ME</div>
</div>
<div class="cell cell--2 cell--md-4 cell--sm-6">
<div class="button button--outline-error button--rounded my-2"><i class="fas fa-user-astronaut"></i> CLICK ME</div>
</div>
</div>
</div>
<!--more-->
## Alert
Success Text.
{:.success}
Info Text.
{:.info}
Warning Text.
{:.warning}
Error Text.
{:.error}
## Tag
`success`{:.success}
`info`{:.info}
`warning`{:.warning}
`error`{:.error}
## Image
| `Border` | `Shadow` |
| ---- | ---- |
| {:.border} | {:.shadow} |
| `Rounded` | `Circle` |
| ---- | ---- |
| {:.rounded} | {:.circle} |
### Mixture
| `Border+Rounded` | `Circle+Shadow` |
| ---- | ---- |
| {:.border.rounded} | {:.circle.shadow} |
| `Rounded+Shadow` | `Circle+Border+Shadow` |
| ---- | ---- |
| {:.circle.rounded.shadow} | {:.circle.border.shadow}
## Extra
| Name | Description |
| ---- | ---- |
| Spacing | [Doc](https://tianqi.name/jekyll-TeXt-theme/docs/en/spacing) |
| Grid | [Doc](https://tianqi.name/jekyll-TeXt-theme/docs/en/grid) |
| Icons | [Doc](https://tianqi.name/jekyll-TeXt-theme/docs/en/icons) |
| Image | [Doc](https://tianqi.name/jekyll-TeXt-theme/docs/en/image) |
| Button | [Doc](https://tianqi.name/jekyll-TeXt-theme/docs/en/button) |
| Item | [Doc](https://tianqi.name/jekyll-TeXt-theme/docs/en/item) |
| Card | [Doc](https://tianqi.name/jekyll-TeXt-theme/docs/en/card) |
| Hero | [Doc](https://tianqi.name/jekyll-TeXt-theme/docs/en/hero) | | mit |
CosmicSubspace/NerdyAudio | app/src/main/java/com/meapsoft/FFT.java | 4463 | package com.meapsoft;
/*
* Copyright 2006-2007 Columbia University.
*
* This file is part of MEAPsoft.
*
* MEAPsoft is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* MEAPsoft is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MEAPsoft; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
* See the file "COPYING" for the text of the license.
*/
import com.cosmicsubspace.nerdyaudio.exceptions.FFTException;
public class FFT {
int n, m;
// Lookup tables. Only need to recompute when size of FFT changes.
double[] cos;
double[] sin;
double[] window;
public FFT(int n) {
this.n = n;
this.m = (int)(Math.log(n) / Math.log(2));
// Make sure n is a power of 2
if(n != (1<<m))
throw new RuntimeException("FFT length must be power of 2");
// precompute tables
cos = new double[n/2];
sin = new double[n/2];
// for(int i=0; i<n/4; i++) {
// cos[i] = Math.cos(-2*Math.PI*i/n);
// sin[n/4-i] = cos[i];
// cos[n/2-i] = -cos[i];
// sin[n/4+i] = cos[i];
// cos[n/2+i] = -cos[i];
// sin[n*3/4-i] = -cos[i];
// cos[n-i] = cos[i];
// sin[n*3/4+i] = -cos[i];
// }
for(int i=0; i<n/2; i++) {
cos[i] = Math.cos(-2*Math.PI*i/n);
sin[i] = Math.sin(-2*Math.PI*i/n);
}
makeWindow();
}
public int getFftSize(){return n;}
protected void makeWindow() {
// Make a blackman window:
// w(n)=0.42-0.5cos{(2*PI*n)/(N-1)}+0.08cos{(4*PI*n)/(N-1)};
window = new double[n];
for(int i = 0; i < window.length; i++)
window[i] = 0.42 - 0.5 * Math.cos(2*Math.PI*i/(n-1))
+ 0.08 * Math.cos(4*Math.PI*i/(n-1));
}
public double[] getWindow() {
return window;
}
/***************************************************************
* fft.c
* Douglas L. Jones
* University of Illinois at Urbana-Champaign
* January 19, 1992
* http://cnx.rice.edu/content/m12016/latest/
*
* fft: in-place radix-2 DIT DFT of a complex input
*
* input:
* n: length of FFT: must be a power of two
* m: n = 2**m
* input/output
* x: double array of length n with real part of data
* y: double array of length n with imag part of data
*
* Permission to copy and use this program is granted
* as long as this header is included.
****************************************************************/
public void fft(double[] x, double[] y) throws FFTException //TODO Maybe I can do with single precision.
{
if (!(x.length==y.length && x.length==n)) throw new FFTException("FFT Size Mismatch!");
int i,j,k,n1,n2,a;
double c,s,e,t1,t2;
// Bit-reverse
j = 0;
n2 = n/2;
for (i=1; i < n - 1; i++) {
n1 = n2;
while ( j >= n1 ) {
j = j - n1;
n1 = n1/2;
}
j = j + n1;
if (i < j) {
t1 = x[i];
x[i] = x[j];
x[j] = t1;
t1 = y[i];
y[i] = y[j];
y[j] = t1;
}
}
// FFT
n1 = 0;
n2 = 1;
for (i=0; i < m; i++) {
n1 = n2;
n2 = n2 + n2;
a = 0;
for (j=0; j < n1; j++) {
c = cos[a];
s = sin[a];
a += 1 << (m-i-1);
for (k=j; k < n; k=k+n2) {
t1 = c*x[k+n1] - s*y[k+n1];
t2 = s*x[k+n1] + c*y[k+n1];
x[k+n1] = x[k] - t1;
y[k+n1] = y[k] - t2;
x[k] = x[k] + t1;
y[k] = y[k] + t2;
}
}
}
}
} | mit |
RazorX11/PSL1GHT | common/libsimdmath/common/isinff4.c | 1808 | /* isinff4 - for each element of vector x, return a mask of ones if x' is INF, zero otherwise
Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Sony Computer Entertainment Inc nor the names
of its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#include <simdmath/_isinff4.h>
vector unsigned int
isinff4 (vector float x)
{
return _isinff4(x);
}
| mit |
togusafish/shirasagi-_-shirasagi | app/models/concerns/ss/model/file.rb | 6055 | module SS::Model::File
extend ActiveSupport::Concern
extend SS::Translation
include SS::Document
include SS::Reference::User
attr_accessor :in_file, :in_files, :resizing
included do
store_in collection: "ss_files"
seqid :id
field :model, type: String
field :state, type: String, default: "closed"
field :name, type: String
field :filename, type: String
field :size, type: Integer
field :content_type, type: String
belongs_to :site, class_name: "SS::Site"
permit_params :state, :name, :filename
permit_params :in_file, :in_files, in_files: []
permit_params :resizing
before_validation :set_filename, if: ->{ in_file.present? }
before_validation :validate_filename, if: ->{ filename.present? }
validates :model, presence: true
validates :state, presence: true
validates :filename, presence: true, if: ->{ in_file.blank? && in_files.blank? }
validate :validate_size
before_save :rename_file, if: ->{ @db_changes.present? }
before_save :save_file
before_destroy :remove_file
end
module ClassMethods
def root
"#{Rails.root}/private/files"
end
def resizing_options
[
[I18n.t('views.options.resizing.320×240'), "320,240"],
[I18n.t('views.options.resizing.240x320'), "240,320"],
[I18n.t('views.options.resizing.640x480'), "640,480"],
[I18n.t('views.options.resizing.480x640'), "480,640"],
[I18n.t('views.options.resizing.800x600'), "800,600"],
[I18n.t('views.options.resizing.600x800'), "600,800"],
[I18n.t('views.options.resizing.1024×768'), "1024,768"],
[I18n.t('views.options.resizing.768x1024'), "768,1024"],
[I18n.t('views.options.resizing.1280x720'), "1280,720"],
[I18n.t('views.options.resizing.720x1280'), "720,1280"],
]
end
public
def search(params)
criteria = self.where({})
return criteria if params.blank?
if params[:name].present?
criteria = criteria.search_text params[:name]
end
if params[:keyword].present?
criteria = criteria.keyword_in params[:keyword], :name, :filename
end
criteria
end
end
public
def path
"#{self.class.root}/ss_files/" + id.to_s.split(//).join("/") + "/_/#{id}"
end
def public_path
"#{site.path}/fs/" + id.to_s.split(//).join("/") + "/_/#{filename}"
end
def url
"/fs/" + id.to_s.split(//).join("/") + "/_/#{filename}"
end
def thumb_url
"/fs/" + id.to_s.split(//).join("/") + "/_/thumb/#{filename}"
end
def state_options
[[I18n.t('views.options.state.public'), 'public']]
end
def name
self[:name].presence || basename
end
def basename
filename.to_s.sub(/.*\//, "")
end
def extname
filename.to_s.sub(/.*\W/, "")
end
def image?
filename =~ /\.(bmp|gif|jpe?g|png)$/i
end
def resizing
(@resizing && @resizing.size == 2) ? @resizing.map(&:to_i) : nil
end
def resizing=(s)
@resizing = (s.class == String) ? s.split(",") : s
end
def read
Fs.exists?(path) ? Fs.binread(path) : nil
end
def save_files
return false unless valid?
in_files.each do |file|
item = self.class.new(attributes)
item.in_file = file
item.resizing = resizing
next if item.save
item.errors.full_messages.each { |m| errors.add :base, m }
return false
end
true
end
def uploaded_file
file = Fs::UploadedFile.new("ss_file")
file.binmode
file.write(read)
file.rewind
file.original_filename = basename
file.content_type = content_type
file
end
def generate_public_file
if site && basename.ascii_only?
file = public_path
data = self.read
return if Fs.exists?(file) && data == Fs.read(file)
Fs.binwrite file, data
end
end
def remove_public_file
Fs.rm_rf(public_path) if site
end
private
def set_filename
self.filename = in_file.original_filename if filename.blank?
self.size = in_file.size
self.content_type = ::SS::MimeType.find(in_file.original_filename, in_file.content_type)
end
def validate_filename
self.filename = filename.gsub(/[^\w\-\.]/, "_")
end
def save_file
errors.add :in_file, :blank if new_record? && in_file.blank?
return false if errors.present?
return if in_file.blank?
if image? && resizing
width, height = resizing
image = Magick::Image.from_blob(in_file.read).shift
image = image.resize_to_fit width, height if image.columns > width || image.rows > height
binary = image.to_blob
else
binary = in_file.read
end
dir = ::File.dirname(path)
Fs.mkdir_p(dir) unless Fs.exists?(dir)
Fs.binwrite(path, binary)
end
def remove_file
Fs.rm_rf(path)
remove_public_file
end
def rename_file
return unless @db_changes["filename"]
return unless @db_changes["filename"][0]
remove_public_file if site
end
def validate_size
validate_limit = lambda do |file|
filename = file.original_filename
base_limit = SS.config.env.max_filesize
ext_limit = SS.config.env.max_filesize_ext[filename.sub(/.*\./, "").downcase]
[ ext_limit, base_limit ].each do |limit|
if limit.present? && file.size > limit
errors.add :base, :too_large_file, filename: filename,
size: number_to_human_size(file.size),
limit: number_to_human_size(limit)
end
end
end
if in_file.present?
validate_limit.call(in_file)
elsif in_files.present?
in_files.each { |file| validate_limit.call(file) }
end
end
def number_to_human_size(size)
ApplicationController.helpers.number_to_human_size(size)
end
end
| mit |
mosinve/bootstrap-vue | docs/components/jumbotron/README.md | 374 | # Jumbotron
> A lightweight, flexible component that can optionally extend the entire viewport to
showcase key marketing messages on your site.
```html
<b-jumbotron header="BootstrapVue" lead="Bootstrap 4 Components for Vue.js 2" >
<p>For more information visit website</p>
<b-btn variant="primary" href="#">Docs</b-btn>
</b-jumbotron>
<!-- jumbotron.vue -->
```
| mit |
mika-f/Orion | Source/Orion.Scripting/Ast/AstGreaterThanOrEqualOperator.cs | 428 | using System.Linq.Expressions;
namespace Orion.Scripting.Ast
{
internal class AstGreaterThanOrEqualOperator : AstOperator
{
public AstGreaterThanOrEqualOperator(string value) : base(value) { }
protected override Expression CreateExpression<T>(ParameterExpression parameter, Expression left, Expression right)
{
return Expression.GreaterThanOrEqual(left, right);
}
}
} | mit |
parameshbabu/bsp | drivers/uart/bcm2836/miniUart/qsfile.c | 4379 | // Copyright (c) Microsoft Corporation. All rights reserved.
//
// Module Name:
//
// qsfile.c
//
// Abstract:
//
// This module contains the code that is very specific to query/set file
// operations in the serial driver.
//
#include "precomp.h"
#include "qsfile.tmh"
#ifdef ALLOC_PRAGMA
#pragma alloc_text(PAGESRP0,SerialQueryInformationFile)
#pragma alloc_text(PAGESRP0,SerialSetInformationFile)
#endif
/*++
Routine Description:
This routine is used to query the end of file information on
the opened serial port. Any other file information request
is retured with an invalid parameter.
This routine always returns an end of file of 0.
Arguments:
DeviceObject - Pointer to the device object for this device
Irp - Pointer to the IRP for the current request
Return Value:
The function value is the final status of the call
--*/
_Use_decl_annotations_
NTSTATUS
SerialQueryInformationFile(
WDFDEVICE Device,
PIRP Irp
)
{
NTSTATUS status;
PIO_STACK_LOCATION IrpSp;
TraceEvents(TRACE_LEVEL_INFORMATION, DBG_PNP,
"++SerialQueryInformationFile(%p, %p)\r\n",
Device,
Irp);
PAGED_CODE();
IrpSp = IoGetCurrentIrpStackLocation(Irp);
Irp->IoStatus.Information = 0L;
status = STATUS_SUCCESS;
if (IrpSp->Parameters.QueryFile.FileInformationClass ==
FileStandardInformation) {
if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength <
sizeof(FILE_STANDARD_INFORMATION))
{
status = STATUS_BUFFER_TOO_SMALL;
} else {
PFILE_STANDARD_INFORMATION buf = Irp->AssociatedIrp.SystemBuffer;
buf->AllocationSize.QuadPart = 0;
buf->EndOfFile = buf->AllocationSize;
buf->NumberOfLinks = 0;
buf->DeletePending = FALSE;
buf->Directory = FALSE;
Irp->IoStatus.Information = sizeof(FILE_STANDARD_INFORMATION);
}
} else if (IrpSp->Parameters.QueryFile.FileInformationClass ==
FilePositionInformation) {
if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength <
sizeof(FILE_POSITION_INFORMATION)) {
status = STATUS_BUFFER_TOO_SMALL;
} else {
((PFILE_POSITION_INFORMATION)Irp->AssociatedIrp.SystemBuffer)->
CurrentByteOffset.QuadPart = 0;
Irp->IoStatus.Information = sizeof(FILE_POSITION_INFORMATION);
}
} else {
status = STATUS_INVALID_PARAMETER;
}
Irp->IoStatus.Status = status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
TraceEvents(TRACE_LEVEL_INFORMATION, DBG_PNP,
"--SerialQueryInformationFile(%p, %p)=%Xh\r\n",
Device,
Irp,
status);
return status;
}
/*++
Routine Description:
This routine is used to set the end of file information on
the opened parallel port. Any other file information request
is retured with an invalid parameter.
This routine always ignores the actual end of file since
the query information code always returns an end of file of 0.
Arguments:
DeviceObject - Pointer to the device object for this device
Irp - Pointer to the IRP for the current request
Return Value:
The function value is the final status of the call
--*/
_Use_decl_annotations_
NTSTATUS
SerialSetInformationFile(
WDFDEVICE Device,
PIRP Irp
)
{
NTSTATUS status;
PAGED_CODE();
TraceEvents(TRACE_LEVEL_INFORMATION, DBG_PNP,
"++SerialSetInformationFile(%p, %p)\r\n",
Device,
Irp);
Irp->IoStatus.Information = 0L;
if ((IoGetCurrentIrpStackLocation(Irp)->
Parameters.SetFile.FileInformationClass ==
FileEndOfFileInformation) ||
(IoGetCurrentIrpStackLocation(Irp)->
Parameters.SetFile.FileInformationClass ==
FileAllocationInformation)) {
status = STATUS_SUCCESS;
} else {
status = STATUS_INVALID_PARAMETER;
}
Irp->IoStatus.Status = status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
TraceEvents(TRACE_LEVEL_INFORMATION, DBG_PNP,
"--SerialSetInformationFile(%p, %p)=%Xh\r\n",
Device,
Irp,
status);
return status;
}
| mit |
indro/t2c | apps/external_apps/swaps/management.py | 1734 | from django.dispatch import dispatcher
from django.db.models import signals
from django.utils.translation import ugettext_noop as _
try:
from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.create_notice_type("swaps_proposal", _("New Swap Proposal"), _("someone has proposed a swap for one of your offers"), default=2)
notification.create_notice_type("swaps_acceptance", _("Swap Acceptance"), _("someone has accepted a swap that you proposed"), default=2)
notification.create_notice_type("swaps_rejection", _("Swap Rejection"), _("someone has rejected a swap that you proposed"), default=2)
notification.create_notice_type("swaps_cancellation", _("Swap Cancellation"), _("someone has canceled a proposed swap for one of your offers"), default=2)
notification.create_notice_type("swaps_proposing_offer_changed", _("Swap Proposing Offer Changed"), _("someone has changed their proposing offer in a swap for one of your offers"), default=2)
notification.create_notice_type("swaps_responding_offer_changed", _("Swap Responding Offer Changed"), _("someone has changed their responding offer in a swap that you proposed"), default=2)
notification.create_notice_type("swaps_comment", _("Swap Comment"), _("someone has commented on a swap in which your offer is involved"), default=2)
notification.create_notice_type("swaps_conflict", _("Swap Conflict"), _("your swap has lost a conflict to another swap"), default=2)
signals.post_syncdb.connect(create_notice_types, sender=notification)
except ImportError:
print "Skipping creation of NoticeTypes as notification app not found" | mit |
17up/rails_admin | lib/rails_admin/config/fields/types/code_mirror.rb | 1419 | require 'rails_admin/config/fields/base'
module RailsAdmin
module Config
module Fields
module Types
class CodeMirror < RailsAdmin::Config::Fields::Types::Text
# Register field type for the type loader
RailsAdmin::Config::Fields::Types::register(self)
#Pass the theme and mode for Codemirror
register_instance_option :config do
{
:mode => 'css',
:theme => 'night'
}
end
#Pass the location of the theme and mode for Codemirror
register_instance_option :assets do
{
:mode => '/assets/codemirror/modes/css.js',
:theme => '/assets/codemirror/themes/night.css'
}
end
#Use this if you want to point to a cloud instances of CodeMirror
register_instance_option :js_location do
'/assets/codemirror.js'
end
#Use this if you want to point to a cloud instances of CodeMirror
register_instance_option :css_location do
'/assets/codemirror.css'
end
register_instance_option :partial do
:form_code_mirror
end
[:assets, :config, :css_location, :js_location].each do |key|
register_deprecated_instance_option :"codemirror_#{key}", key
end
end
end
end
end
end
| mit |
heshamnaim/rollbar-gem | spec/rollbar_spec.rb | 56294 | # encoding: utf-8
require 'logger'
require 'socket'
require 'spec_helper'
require 'girl_friday'
require 'redis'
require 'active_support/core_ext/object'
require 'active_support/json/encoding'
begin
require 'sucker_punch'
require 'sucker_punch/testing/inline'
rescue LoadError
end
describe Rollbar do
let(:notifier) { Rollbar.notifier }
before do
Rollbar.unconfigure
configure
end
context 'when notifier has been used before configure it' do
before do
Rollbar.unconfigure
Rollbar.reset_notifier!
end
it 'is finally reset' do
Rollbar.log_debug('Testing notifier')
expect(Rollbar.error('error message')).to be_eql('disabled')
reconfigure_notifier
expect(Rollbar.error('error message')).not_to be_eql('disabled')
end
end
context 'Notifier' do
context 'log' do
let(:exception) do
begin
foo = bar
rescue => e
e
end
end
let(:configuration) { Rollbar.configuration }
context 'executing a Thread before Rollbar is configured', :skip_dummy_rollbar => true do
before do
Rollbar.reset_notifier!
Rollbar.unconfigure
Thread.new {}
Rollbar.configure do |config|
config.access_token = 'my-access-token'
end
end
it 'sets correct configuration for Rollbar.notifier' do
expect(Rollbar.notifier.configuration.enabled).to be_truthy
end
end
it 'should report a simple message' do
expect(notifier).to receive(:report).with('error', 'test message', nil, nil)
notifier.log('error', 'test message')
end
it 'should report a simple message with extra data' do
extra_data = {:key => 'value', :hash => {:inner_key => 'inner_value'}}
expect(notifier).to receive(:report).with('error', 'test message', nil, extra_data)
notifier.log('error', 'test message', extra_data)
end
it 'should report an exception' do
expect(notifier).to receive(:report).with('error', nil, exception, nil)
notifier.log('error', exception)
end
it 'should report an exception with extra data' do
extra_data = {:key => 'value', :hash => {:inner_key => 'inner_value'}}
expect(notifier).to receive(:report).with('error', nil, exception, extra_data)
notifier.log('error', exception, extra_data)
end
it 'should report an exception with a description' do
expect(notifier).to receive(:report).with('error', 'exception description', exception, nil)
notifier.log('error', exception, 'exception description')
end
it 'should report an exception with a description and extra data' do
extra_data = {:key => 'value', :hash => {:inner_key => 'inner_value'}}
expect(notifier).to receive(:report).with('error', 'exception description', exception, extra_data)
notifier.log('error', exception, extra_data, 'exception description')
end
end
context 'debug/info/warning/error/critical' do
let(:exception) do
begin
foo = bar
rescue => e
e
end
end
let(:extra_data) { {:key => 'value', :hash => {:inner_key => 'inner_value'}} }
it 'should report with a debug level' do
expect(notifier).to receive(:report).with('debug', nil, exception, nil)
notifier.debug(exception)
expect(notifier).to receive(:report).with('debug', 'description', exception, nil)
notifier.debug(exception, 'description')
expect(notifier).to receive(:report).with('debug', 'description', exception, extra_data)
notifier.debug(exception, 'description', extra_data)
end
it 'should report with an info level' do
expect(notifier).to receive(:report).with('info', nil, exception, nil)
notifier.info(exception)
expect(notifier).to receive(:report).with('info', 'description', exception, nil)
notifier.info(exception, 'description')
expect(notifier).to receive(:report).with('info', 'description', exception, extra_data)
notifier.info(exception, 'description', extra_data)
end
it 'should report with a warning level' do
expect(notifier).to receive(:report).with('warning', nil, exception, nil)
notifier.warning(exception)
expect(notifier).to receive(:report).with('warning', 'description', exception, nil)
notifier.warning(exception, 'description')
expect(notifier).to receive(:report).with('warning', 'description', exception, extra_data)
notifier.warning(exception, 'description', extra_data)
end
it 'should report with an error level' do
expect(notifier).to receive(:report).with('error', nil, exception, nil)
notifier.error(exception)
expect(notifier).to receive(:report).with('error', 'description', exception, nil)
notifier.error(exception, 'description')
expect(notifier).to receive(:report).with('error', 'description', exception, extra_data)
notifier.error(exception, 'description', extra_data)
end
it 'should report with a critical level' do
expect(notifier).to receive(:report).with('critical', nil, exception, nil)
notifier.critical(exception)
expect(notifier).to receive(:report).with('critical', 'description', exception, nil)
notifier.critical(exception, 'description')
expect(notifier).to receive(:report).with('critical', 'description', exception, extra_data)
notifier.critical(exception, 'description', extra_data)
end
end
context 'scope' do
it 'should create a new notifier object' do
notifier2 = notifier.scope
notifier2.should_not eq(notifier)
notifier2.should be_instance_of(Rollbar::Notifier)
end
it 'should create a copy of the parent notifier\'s configuration' do
notifier.configure do |config|
config.code_version = '123'
config.payload_options = {
:a => 'a',
:b => {:c => 'c'}
}
end
notifier2 = notifier.scope
notifier2.configuration.code_version.should == '123'
notifier2.configuration.should_not equal(notifier.configuration)
notifier2.configuration.payload_options.should_not equal(notifier.configuration.payload_options)
notifier2.configuration.payload_options.should == notifier.configuration.payload_options
notifier2.configuration.payload_options.should == {
:a => 'a',
:b => {:c => 'c'}
}
end
it 'should not modify any parent notifier configuration' do
configure
Rollbar.configuration.code_version.should be_nil
Rollbar.configuration.payload_options.should be_empty
notifier.configure do |config|
config.code_version = '123'
config.payload_options = {
:a => 'a',
:b => {:c => 'c'}
}
end
notifier2 = notifier.scope
notifier2.configure do |config|
config.payload_options[:c] = 'c'
end
notifier.configuration.payload_options[:c].should be_nil
notifier3 = notifier2.scope({
:b => {:c => 3, :d => 'd'}
})
notifier3.configure do |config|
config.code_version = '456'
end
notifier.configuration.code_version.should == '123'
notifier.configuration.payload_options.should == {
:a => 'a',
:b => {:c => 'c'}
}
notifier2.configuration.code_version.should == '123'
notifier2.configuration.payload_options.should == {
:a => 'a',
:b => {:c => 'c'},
:c => 'c'
}
notifier3.configuration.code_version.should == '456'
notifier3.configuration.payload_options.should == {
:a => 'a',
:b => {:c => 3, :d => 'd'},
:c => 'c'
}
Rollbar.configuration.code_version.should be_nil
Rollbar.configuration.payload_options.should be_empty
end
end
context 'report' do
let(:logger_mock) { double("Rails.logger").as_null_object }
before(:each) do
configure
Rollbar.configure do |config|
config.logger = logger_mock
end
end
after(:each) do
Rollbar.unconfigure
configure
end
it 'should reject input that doesn\'t contain an exception, message or extra data' do
expect(logger_mock).to receive(:error).with('[Rollbar] Tried to send a report with no message, exception or extra data.')
expect(notifier).not_to receive(:schedule_payload)
result = notifier.send(:report, 'info', nil, nil, nil)
result.should == 'error'
end
it 'should be ignored if the person is ignored' do
person_data = {
:id => 1,
:username => "test",
:email => "[email protected]"
}
notifier.configure do |config|
config.ignored_person_ids += [1]
config.payload_options = { :person => person_data }
end
expect(notifier).not_to receive(:schedule_payload)
result = notifier.send(:report, 'info', 'message', nil, nil)
result.should == 'ignored'
end
end
context 'build_payload' do
context 'a basic payload' do
let(:extra_data) { {:key => 'value', :hash => {:inner_key => 'inner_value'}} }
let(:payload) { notifier.send(:build_payload, 'info', 'message', nil, extra_data) }
it 'should have the correct root-level keys' do
payload.keys.should match_array(['access_token', 'data'])
end
it 'should have the correct data keys' do
payload['data'].keys.should include(:timestamp, :environment, :level, :language, :framework, :server,
:notifier, :body)
end
it 'should have the correct notifier name and version' do
payload['data'][:notifier][:name].should == 'rollbar-gem'
payload['data'][:notifier][:version].should == Rollbar::VERSION
end
it 'should have the correct language and framework' do
payload['data'][:language].should == 'ruby'
payload['data'][:framework].should == Rollbar.configuration.framework
payload['data'][:framework].should match(/^Rails/)
end
it 'should have the correct server keys' do
payload['data'][:server].keys.should match_array([:host, :root, :pid])
end
it 'should have the correct level and message body' do
payload['data'][:level].should == 'info'
payload['data'][:body][:message][:body].should == 'message'
end
end
it 'should merge in a new key from payload_options' do
notifier.configure do |config|
config.payload_options = { :some_new_key => 'some new value' }
end
payload = notifier.send(:build_payload, 'info', 'message', nil, nil)
payload['data'][:some_new_key].should == 'some new value'
end
it 'should overwrite existing keys from payload_options' do
reconfigure_notifier
payload_options = {
:notifier => 'bad notifier',
:server => { :host => 'new host', :new_server_key => 'value' }
}
notifier.configure do |config|
config.payload_options = payload_options
end
payload = notifier.send(:build_payload, 'info', 'message', nil, nil)
payload['data'][:notifier].should == 'bad notifier'
payload['data'][:server][:host].should == 'new host'
payload['data'][:server][:root].should_not be_nil
payload['data'][:server][:new_server_key].should == 'value'
end
it 'should have default environment "unspecified"' do
Rollbar.unconfigure
payload = notifier.send(:build_payload, 'info', 'message', nil, nil)
payload['data'][:environment].should == 'unspecified'
end
it 'should have an overridden environment' do
Rollbar.configure do |config|
config.environment = 'overridden'
end
payload = notifier.send(:build_payload, 'info', 'message', nil, nil)
payload['data'][:environment].should == 'overridden'
end
it 'should not have custom data under default configuration' do
payload = notifier.send(:build_payload, 'info', 'message', nil, nil)
payload['data'][:body][:message][:extra].should be_nil
end
it 'should have custom message data when custom_data_method is configured' do
Rollbar.configure do |config|
config.custom_data_method = lambda { {:a => 1, :b => [2, 3, 4]} }
end
payload = notifier.send(:build_payload, 'info', 'message', nil, nil)
payload['data'][:body][:message][:extra].should_not be_nil
payload['data'][:body][:message][:extra][:a].should == 1
payload['data'][:body][:message][:extra][:b][2].should == 4
end
it 'should merge extra data into custom message data' do
custom_method = lambda do
{ :a => 1,
:b => [2, 3, 4],
:c => { :d => 'd', :e => 'e' },
:f => ['1', '2']
}
end
Rollbar.configure do |config|
config.custom_data_method = custom_method
end
payload = notifier.send(:build_payload, 'info', 'message', nil, {:c => {:e => 'g'}, :f => 'f'})
payload['data'][:body][:message][:extra].should_not be_nil
payload['data'][:body][:message][:extra][:a].should == 1
payload['data'][:body][:message][:extra][:b][2].should == 4
payload['data'][:body][:message][:extra][:c][:d].should == 'd'
payload['data'][:body][:message][:extra][:c][:e].should == 'g'
payload['data'][:body][:message][:extra][:f].should == 'f'
end
context 'with custom_data_method crashing' do
next unless defined?(SecureRandom) and SecureRandom.respond_to?(:uuid)
let(:crashing_exception) { StandardError.new }
let(:custom_method) { proc { raise crashing_exception } }
let(:extra) { { :foo => :bar } }
let(:custom_data_report) do
{ :_error_in_custom_data_method => SecureRandom.uuid }
end
let(:expected_extra) { extra.merge(custom_data_report) }
before do
notifier.configure do |config|
config.custom_data_method = custom_method
end
expect(notifier).to receive(:report_custom_data_error).once.and_return(custom_data_report)
end
it 'doesnt crash the report' do
payload = notifier.send(:build_payload, 'info', 'message', nil, extra)
expect(payload['data'][:body][:message][:extra]).to be_eql(expected_extra)
end
end
it 'should include project_gem_paths' do
notifier.configure do |config|
config.project_gems = ['rails', 'rspec']
end
payload = notifier.send(:build_payload, 'info', 'message', nil, nil)
expect(payload['data'][:project_package_paths].count).to eq 2
end
it 'should include a code_version' do
notifier.configure do |config|
config.code_version = 'abcdef'
end
payload = notifier.send(:build_payload, 'info', 'message', nil, nil)
payload['data'][:code_version].should == 'abcdef'
end
it 'should have the right hostname' do
payload = notifier.send(:build_payload, 'info', 'message', nil, nil)
payload['data'][:server][:host].should == Socket.gethostname
end
it 'should have root and branch set when configured' do
configure
Rollbar.configure do |config|
config.root = '/path/to/root'
config.branch = 'master'
end
payload = notifier.send(:build_payload, 'info', 'message', nil, nil)
payload['data'][:server][:root].should == '/path/to/root'
payload['data'][:server][:branch].should == 'master'
end
context "with Redis instance in payload and ActiveSupport is enabled" do
let(:redis) { ::Redis.new }
let(:payload) do
{
:key => {
:value => redis
}
}
end
it 'dumps to JSON correctly' do
redis.set('foo', 'bar')
json = notifier.send(:dump_payload, payload)
expect(json).to be_kind_of(String)
end
end
end
context 'build_payload_body' do
let(:exception) do
begin
foo = bar
rescue => e
e
end
end
it 'should build a message body when no exception is passed in' do
body = notifier.send(:build_payload_body, 'message', nil, nil)
body[:message][:body].should == 'message'
body[:message][:extra].should be_nil
body[:trace].should be_nil
end
it 'should build a message body when no exception and extra data is passed in' do
body = notifier.send(:build_payload_body, 'message', nil, {:a => 'b'})
body[:message][:body].should == 'message'
body[:message][:extra].should == {:a => 'b'}
body[:trace].should be_nil
end
it 'should build an exception body when one is passed in' do
body = notifier.send(:build_payload_body, 'message', exception, nil)
body[:message].should be_nil
trace = body[:trace]
trace.should_not be_nil
trace[:extra].should be_nil
trace[:exception][:class].should_not be_nil
trace[:exception][:message].should_not be_nil
end
it 'should build an exception body when one is passed in along with extra data' do
body = notifier.send(:build_payload_body, 'message', exception, {:a => 'b'})
body[:message].should be_nil
trace = body[:trace]
trace.should_not be_nil
trace[:exception][:class].should_not be_nil
trace[:exception][:message].should_not be_nil
trace[:extra].should == {:a => 'b'}
end
end
context 'build_payload_body_exception' do
let(:exception) do
begin
foo = bar
rescue => e
e
end
end
after(:each) do
Rollbar.unconfigure
configure
end
it 'should build valid exception data' do
body = notifier.send(:build_payload_body_exception, nil, exception, nil)
body[:message].should be_nil
trace = body[:trace]
frames = trace[:frames]
frames.should be_a_kind_of(Array)
frames.each do |frame|
frame[:filename].should be_a_kind_of(String)
frame[:lineno].should be_a_kind_of(Fixnum)
if frame[:method]
frame[:method].should be_a_kind_of(String)
end
end
# should be NameError, but can be NoMethodError sometimes on rubinius 1.8
# http://yehudakatz.com/2010/01/02/the-craziest-fing-bug-ive-ever-seen/
trace[:exception][:class].should match(/^(NameError|NoMethodError)$/)
trace[:exception][:message].should match(/^(undefined local variable or method `bar'|undefined method `bar' on an instance of)/)
end
it 'should build exception data with a description' do
body = notifier.send(:build_payload_body_exception, 'exception description', exception, nil)
trace = body[:trace]
trace[:exception][:message].should match(/^(undefined local variable or method `bar'|undefined method `bar' on an instance of)/)
trace[:exception][:description].should == 'exception description'
end
it 'should build exception data with a description and extra data' do
extra_data = {:key => 'value', :hash => {:inner_key => 'inner_value'}}
body = notifier.send(:build_payload_body_exception, 'exception description', exception, extra_data)
trace = body[:trace]
trace[:exception][:message].should match(/^(undefined local variable or method `bar'|undefined method `bar' on an instance of)/)
trace[:exception][:description].should == 'exception description'
trace[:extra][:key].should == 'value'
trace[:extra][:hash].should == {:inner_key => 'inner_value'}
end
it 'should build exception data with a extra data' do
extra_data = {:key => 'value', :hash => {:inner_key => 'inner_value'}}
body = notifier.send(:build_payload_body_exception, nil, exception, extra_data)
trace = body[:trace]
trace[:exception][:message].should match(/^(undefined local variable or method `bar'|undefined method `bar' on an instance of)/)
trace[:extra][:key].should == 'value'
trace[:extra][:hash].should == {:inner_key => 'inner_value'}
end
context 'with nested exceptions' do
let(:crashing_code) do
proc do
begin
begin
fail CauseException.new('the cause')
rescue
fail StandardError.new('the error')
end
rescue => e
e
end
end
end
let(:rescued_exception) { crashing_code.call }
let(:message) { 'message' }
let(:extra) { {} }
context 'using ruby >= 2.1' do
next unless Exception.instance_methods.include?(:cause)
it 'sends the two exceptions in the trace_chain attribute' do
body = notifier.send(:build_payload_body_exception, message, rescued_exception, extra)
body[:trace].should be_nil
body[:trace_chain].should be_kind_of(Array)
chain = body[:trace_chain]
chain[0][:exception][:class].should match(/StandardError/)
chain[0][:exception][:message].should match(/the error/)
chain[1][:exception][:class].should match(/CauseException/)
chain[1][:exception][:message].should match(/the cause/)
end
context 'with cyclic nested exceptions' do
let(:exception1) { Exception.new('exception1') }
let(:exception2) { Exception.new('exception2') }
before do
allow(exception1).to receive(:cause).and_return(exception2)
allow(exception2).to receive(:cause).and_return(exception1)
end
it 'doesnt loop for ever' do
body = notifier.send(:build_payload_body_exception, message, exception1, extra)
chain = body[:trace_chain]
expect(chain[0][:exception][:message]).to be_eql('exception1')
expect(chain[1][:exception][:message]).to be_eql('exception2')
end
end
end
context 'using ruby <= 2.1' do
next if Exception.instance_methods.include?(:cause)
it 'sends only the last exception in the trace attribute' do
body = notifier.send(:build_payload_body_exception, message, rescued_exception, extra)
body[:trace].should be_kind_of(Hash)
body[:trace_chain].should be_nil
body[:trace][:exception][:class].should match(/StandardError/)
body[:trace][:exception][:message].should match(/the error/)
end
end
end
end
context 'build_payload_body_message' do
it 'should build a message' do
body = notifier.send(:build_payload_body_message, 'message', nil)
body[:message][:body].should == 'message'
body[:trace].should be_nil
end
it 'should build a message with extra data' do
extra_data = {:key => 'value', :hash => {:inner_key => 'inner_value'}}
body = notifier.send(:build_payload_body_message, 'message', extra_data)
body[:message][:body].should == 'message'
body[:message][:extra][:key].should == 'value'
body[:message][:extra][:hash].should == {:inner_key => 'inner_value'}
end
it 'should build an empty message with extra data' do
extra_data = {:key => 'value', :hash => {:inner_key => 'inner_value'}}
body = notifier.send(:build_payload_body_message, nil, extra_data)
body[:message][:body].should == 'Empty message'
body[:message][:extra][:key].should == 'value'
body[:message][:extra][:hash].should == {:inner_key => 'inner_value'}
end
end
end
context 'reporting' do
let(:exception) do
begin
foo = bar
rescue => e
e
end
end
let(:logger_mock) { double("Rails.logger").as_null_object }
let(:user) { User.create(:email => '[email protected]', :encrypted_password => '', :created_at => Time.now, :updated_at => Time.now) }
before(:each) do
configure
Rollbar.configure do |config|
config.logger = logger_mock
end
end
after(:each) do
Rollbar.unconfigure
configure
end
it 'should report exceptions without person or request data' do
logger_mock.should_receive(:info).with('[Rollbar] Success')
Rollbar.error(exception)
end
it 'should not report anything when disabled' do
logger_mock.should_not_receive(:info).with('[Rollbar] Success')
Rollbar.configure do |config|
config.enabled = false
end
Rollbar.error(exception).should == 'disabled'
end
it 'should report exceptions without person or request data' do
logger_mock.should_receive(:info).with('[Rollbar] Success')
Rollbar.error(exception)
end
it 'should be enabled when freshly configured' do
Rollbar.configuration.enabled.should == true
end
it 'should not be enabled when not configured' do
Rollbar.unconfigure
Rollbar.configuration.enabled.should be_nil
Rollbar.error(exception).should == 'disabled'
end
it 'should stay disabled if configure is called again' do
Rollbar.unconfigure
# configure once, setting enabled to false.
Rollbar.configure do |config|
config.enabled = false
end
# now configure again (perhaps to change some other values)
Rollbar.configure do |config| end
Rollbar.configuration.enabled.should == false
Rollbar.error(exception).should == 'disabled'
end
context 'using :use_exception_level_filters option as true' do
it 'sends the correct filtered level' do
Rollbar.configure do |config|
config.exception_level_filters = { 'NameError' => 'warning' }
end
Rollbar.error(exception, :use_exception_level_filters => true)
expect(Rollbar.last_report[:level]).to be_eql('warning')
end
it 'ignore ignored exception classes' do
Rollbar.configure do |config|
config.exception_level_filters = { 'NameError' => 'ignore' }
end
logger_mock.should_not_receive(:info)
logger_mock.should_not_receive(:warn)
logger_mock.should_not_receive(:error)
Rollbar.error(exception, :use_exception_level_filters => true)
end
end
context 'if not using :use_exception_level_filters option' do
it 'sends the level defined by the used method' do
Rollbar.configure do |config|
config.exception_level_filters = { 'NameError' => 'warning' }
end
Rollbar.error(exception)
expect(Rollbar.last_report[:level]).to be_eql('error')
end
it 'ignore ignored exception classes' do
Rollbar.configure do |config|
config.exception_level_filters = { 'NameError' => 'ignore' }
end
Rollbar.error(exception)
expect(Rollbar.last_report[:level]).to be_eql('error')
end
end
# Skip jruby 1.9+ (https://github.com/jruby/jruby/issues/2373)
if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby' && (not RUBY_VERSION =~ /^1\.9/)
it "should work with an IO object as rack.errors" do
logger_mock.should_receive(:info).with('[Rollbar] Success')
Rollbar.error(exception, :env => { :"rack.errors" => IO.new(2, File::WRONLY) })
end
end
it 'should ignore ignored persons' do
person_data = {
:id => 1,
:username => "test",
:email => "[email protected]"
}
Rollbar.configure do |config|
config.payload_options = {:person => person_data}
config.ignored_person_ids += [1]
end
logger_mock.should_not_receive(:info)
logger_mock.should_not_receive(:warn)
logger_mock.should_not_receive(:error)
Rollbar.error(exception)
end
it 'should not ignore non-ignored persons' do
person_data = {
:id => 1,
:username => "test",
:email => "[email protected]"
}
Rollbar.configure do |config|
config.payload_options = { :person => person_data }
config.ignored_person_ids += [1]
end
Rollbar.last_report = nil
Rollbar.error(exception)
Rollbar.last_report.should be_nil
person_data = {
:id => 2,
:username => "test2",
:email => "[email protected]"
}
new_options = {
:person => person_data
}
Rollbar.scoped(new_options) do
Rollbar.error(exception)
end
Rollbar.last_report.should_not be_nil
end
it 'should allow callables to set exception filtered level' do
callable_mock = double
saved_filters = Rollbar.configuration.exception_level_filters
Rollbar.configure do |config|
config.exception_level_filters = { 'NameError' => callable_mock }
end
callable_mock.should_receive(:call).with(exception).at_least(:once).and_return("info")
logger_mock.should_receive(:info)
logger_mock.should_not_receive(:warn)
logger_mock.should_not_receive(:error)
Rollbar.error(exception, :use_exception_level_filters => true)
end
it 'should not report exceptions when silenced' do
expect_any_instance_of(Rollbar::Notifier).to_not receive(:schedule_payload)
begin
test_var = 1
Rollbar.silenced do
test_var = 2
raise
end
rescue => e
Rollbar.error(e)
end
test_var.should == 2
end
it 'should report exception objects with no backtrace' do
payload = nil
notifier.stub(:schedule_payload) do |*args|
payload = args[0]
end
Rollbar.error(StandardError.new("oops"))
payload["data"][:body][:trace][:frames].should == []
payload["data"][:body][:trace][:exception][:class].should == "StandardError"
payload["data"][:body][:trace][:exception][:message].should == "oops"
end
it 'gets the backtrace from the caller' do
Rollbar.configure do |config|
config.populate_empty_backtraces = true
end
exception = Exception.new
Rollbar.error(exception)
gem_dir = Gem::Specification.find_by_name('rollbar').gem_dir
gem_lib_dir = gem_dir + '/lib'
last_report = Rollbar.last_report
filepaths = last_report[:body][:trace][:frames].map {|frame| frame[:filename] }.reverse
expect(filepaths[0]).not_to include(gem_lib_dir)
expect(filepaths.any? {|filepath| filepath.include?(gem_dir) }).to eq true
end
it 'should return the exception data with a uuid, on platforms with SecureRandom' do
if defined?(SecureRandom) and SecureRandom.respond_to?(:uuid)
exception_data = Rollbar.error(StandardError.new("oops"))
exception_data[:uuid].should_not be_nil
end
end
it 'should report exception objects with nonstandard backtraces' do
payload = nil
notifier.stub(:schedule_payload) do |*args|
payload = args[0]
end
class CustomException < StandardError
def backtrace
["custom backtrace line"]
end
end
exception = CustomException.new("oops")
notifier.error(exception)
payload["data"][:body][:trace][:frames][0][:method].should == "custom backtrace line"
end
it 'should report exceptions with a custom level' do
payload = nil
notifier.stub(:schedule_payload) do |*args|
payload = args[0]
end
Rollbar.error(exception)
payload['data'][:level].should == 'error'
Rollbar.log('debug', exception)
payload['data'][:level].should == 'debug'
end
context 'with invalid utf8 encoding' do
let(:extra) do
{ :extra => force_to_ascii("bad value 1\255") }
end
it 'removes te invalid characteres' do
Rollbar.info('removing invalid chars', extra)
extra_value = Rollbar.last_report[:body][:message][:extra][:extra]
expect(extra_value).to be_eql('bad value 1')
end
end
end
# Backwards
context 'report_message' do
before(:each) do
configure
Rollbar.configure do |config|
config.logger = logger_mock
end
end
let(:logger_mock) { double("Rails.logger").as_null_object }
let(:user) { User.create(:email => '[email protected]', :encrypted_password => '', :created_at => Time.now, :updated_at => Time.now) }
it 'should report simple messages' do
logger_mock.should_receive(:info).with('[Rollbar] Scheduling payload')
logger_mock.should_receive(:info).with('[Rollbar] Success')
Rollbar.error('Test message')
end
it 'should not report anything when disabled' do
logger_mock.should_not_receive(:info).with('[Rollbar] Success')
Rollbar.configure do |config|
config.enabled = false
end
Rollbar.error('Test message that should be ignored')
Rollbar.configure do |config|
config.enabled = true
end
end
it 'should report messages with extra data' do
logger_mock.should_receive(:info).with('[Rollbar] Success')
Rollbar.debug('Test message with extra data', 'debug', :foo => "bar",
:hash => { :a => 123, :b => "xyz" })
end
# END Backwards
it 'should not crash with circular extra_data' do
a = { :foo => "bar" }
b = { :a => a }
c = { :b => b }
a[:c] = c
logger_mock.should_receive(:error).with(/\[Rollbar\] Reporting internal error encountered while sending data to Rollbar./)
Rollbar.error("Test message with circular extra data", a)
end
it 'should be able to report form validation errors when they are present' do
logger_mock.should_receive(:info).with('[Rollbar] Success')
user.errors.add(:example, "error")
user.report_validation_errors_to_rollbar
end
it 'should not report form validation errors when they are not present' do
logger_mock.should_not_receive(:info).with('[Rollbar] Success')
user.errors.clear
user.report_validation_errors_to_rollbar
end
it 'should report messages with extra data' do
logger_mock.should_receive(:info).with('[Rollbar] Success')
Rollbar.info("Test message with extra data", :foo => "bar",
:hash => { :a => 123, :b => "xyz" })
end
it 'should report messages with request, person data and extra data' do
logger_mock.should_receive(:info).with('[Rollbar] Scheduling payload')
logger_mock.should_receive(:info).with('[Rollbar] Success')
request_data = {
:params => {:foo => 'bar'}
}
person_data = {
:id => 123,
:username => 'username'
}
extra_data = {
:extra_foo => 'extra_bar'
}
Rollbar.configure do |config|
config.payload_options = {
:request => request_data,
:person => person_data
}
end
Rollbar.info("Test message", extra_data)
Rollbar.last_report[:request].should == request_data
Rollbar.last_report[:person].should == person_data
Rollbar.last_report[:body][:message][:extra][:extra_foo].should == 'extra_bar'
end
end
context 'payload_destination' do
before(:each) do
configure
Rollbar.configure do |config|
config.logger = logger_mock
config.filepath = 'test.rollbar'
end
end
after(:each) do
Rollbar.unconfigure
configure
end
let(:exception) do
begin
foo = bar
rescue => e
e
end
end
let(:logger_mock) { double("Rails.logger").as_null_object }
it 'should send the payload over the network by default' do
logger_mock.should_not_receive(:info).with('[Rollbar] Writing payload to file')
logger_mock.should_receive(:info).with('[Rollbar] Sending payload').once
logger_mock.should_receive(:info).with('[Rollbar] Success').once
Rollbar.error(exception)
end
it 'should save the payload to a file if set' do
logger_mock.should_not_receive(:info).with('[Rollbar] Sending payload')
logger_mock.should_receive(:info).with('[Rollbar] Writing payload to file').once
logger_mock.should_receive(:info).with('[Rollbar] Success').once
filepath = ''
Rollbar.configure do |config|
config.write_to_file = true
filepath = config.filepath
end
Rollbar.error(exception)
File.exist?(filepath).should == true
File.read(filepath).should include test_access_token
File.delete(filepath)
Rollbar.configure do |config|
config.write_to_file = false
end
end
end
context 'asynchronous_handling' do
before(:each) do
configure
Rollbar.configure do |config|
config.logger = logger_mock
end
end
after(:each) do
Rollbar.unconfigure
configure
end
let(:exception) do
begin
foo = bar
rescue => e
e
end
end
let(:logger_mock) { double("Rails.logger").as_null_object }
it 'should send the payload using the default asynchronous handler girl_friday' do
logger_mock.should_receive(:info).with('[Rollbar] Scheduling payload')
logger_mock.should_receive(:info).with('[Rollbar] Sending payload')
logger_mock.should_receive(:info).with('[Rollbar] Success')
Rollbar.configure do |config|
config.use_async = true
GirlFriday::WorkQueue.immediate!
end
Rollbar.error(exception)
Rollbar.configure do |config|
config.use_async = false
GirlFriday::WorkQueue.queue!
end
end
it 'should send the payload using a user-supplied asynchronous handler' do
logger_mock.should_receive(:info).with('Custom async handler called')
logger_mock.should_receive(:info).with('[Rollbar] Sending payload')
logger_mock.should_receive(:info).with('[Rollbar] Success')
Rollbar.configure do |config|
config.use_async = true
config.async_handler = Proc.new { |payload|
logger_mock.info 'Custom async handler called'
Rollbar.process_payload(payload)
}
end
Rollbar.error(exception)
end
# We should be able to send String payloads, generated
# by a previous version of the gem. This can happend just
# after a deploy with an gem upgrade.
context 'with a payload generated as String' do
let(:async_handler) do
proc do |payload|
# simulate previous gem version
string_payload = Rollbar::JSON.dump(payload)
Rollbar.process_payload(string_payload)
end
end
before do
Rollbar.configuration.stub(:use_async).and_return(true)
Rollbar.configuration.stub(:async_handler).and_return(async_handler)
end
it 'sends a payload generated as String, not as a Hash' do
logger_mock.should_receive(:info).with('[Rollbar] Success')
Rollbar.error(exception)
end
context 'with async failover handlers' do
before do
Rollbar.reconfigure do |config|
config.use_async = true
config.async_handler = async_handler
config.failover_handlers = handlers
config.logger = logger_mock
end
end
let(:exception) { StandardError.new('the error') }
context 'if the async handler doesnt fail' do
let(:async_handler) { proc { |_| 'success' } }
let(:handler) { proc { |_| 'success' } }
let(:handlers) { [handler] }
it 'doesnt call any failover handler' do
expect(handler).not_to receive(:call)
Rollbar.error(exception)
end
end
context 'if the async handler fails' do
let(:async_handler) { proc { |_| fail 'this handler will crash' } }
context 'if any failover handlers is configured' do
let(:handlers) { [] }
let(:log_message) do
'[Rollbar] Async handler failed, and there are no failover handlers configured. See the docs for "failover_handlers"'
end
it 'logs the error but doesnt try to report an internal error' do
expect(logger_mock).to receive(:error).with(log_message)
Rollbar.error(exception)
end
end
context 'if the first failover handler success' do
let(:handler) { proc { |_| 'success' } }
let(:handlers) { [handler] }
it 'calls the failover handler and doesnt report internal error' do
expect(Rollbar).not_to receive(:report_internal_error)
expect(handler).to receive(:call)
Rollbar.error(exception)
end
end
context 'with two handlers, the first failing' do
let(:handler1) { proc { |_| fail 'this handler fails' } }
let(:handler2) { proc { |_| 'success' } }
let(:handlers) { [handler1, handler2] }
it 'calls the second handler and doesnt report internal error' do
expect(handler2).to receive(:call)
Rollbar.error(exception)
end
end
context 'with two handlers, both failing' do
let(:handler1) { proc { |_| fail 'this handler fails' } }
let(:handler2) { proc { |_| fail 'this will also fail' } }
let(:handlers) { [handler1, handler2] }
it 'reports internal error' do
expect(logger_mock).to receive(:error)
Rollbar.error(exception)
end
end
end
end
end
describe "#use_sucker_punch", :if => defined?(SuckerPunch) do
it "should send the payload to sucker_punch delayer" do
logger_mock.should_receive(:info).with('[Rollbar] Scheduling payload')
logger_mock.should_receive(:info).with('[Rollbar] Sending payload')
logger_mock.should_receive(:info).with('[Rollbar] Success')
Rollbar.configure do |config|
config.use_sucker_punch
end
Rollbar.error(exception)
end
end
describe "#use_sidekiq", :if => defined?(Sidekiq) do
it "should instanciate sidekiq delayer with custom values" do
Rollbar::Delay::Sidekiq.should_receive(:new).with('queue' => 'test_queue')
config = Rollbar::Configuration.new
config.use_sidekiq 'queue' => 'test_queue'
end
it "should send the payload to sidekiq delayer" do
handler = double('sidekiq_handler_mock')
handler.should_receive(:call)
Rollbar.configure do |config|
config.use_sidekiq
config.async_handler = handler
end
Rollbar.error(exception)
end
end
end
context 'logger' do
before(:each) do
reset_configuration
end
it 'should have use the Rails logger when configured to do so' do
configure
expect(Rollbar.send(:logger)).to be_kind_of(Rollbar::LoggerProxy)
expect(Rollbar.send(:logger).object).to eq ::Rails.logger
end
it 'should use the default_logger when no logger is set' do
logger = Logger.new(STDERR)
Rollbar.configure do |config|
config.default_logger = lambda { logger }
end
Rollbar.send(:logger).object.should == logger
end
it 'should have a default default_logger' do
Rollbar.send(:logger).should_not be_nil
end
after(:each) do
reset_configuration
end
end
context 'enforce_valid_utf8' do
# TODO(jon): all these tests should be removed since they are in
# in spec/rollbar/encoding/encoder.rb.
#
# This should just check that in payload with simple values and
# nested values are each one passed through Rollbar::Encoding.encode
context 'with utf8 string and ruby > 1.8' do
next unless String.instance_methods.include?(:force_encoding)
let(:payload) { { :foo => 'Изменение' } }
it 'just returns the same string' do
payload_copy = payload.clone
notifier.send(:enforce_valid_utf8, payload_copy)
expect(payload_copy[:foo]).to be_eql('Изменение')
end
end
it 'should replace invalid utf8 values' do
bad_key = force_to_ascii("inner \x92bad key")
payload = {
:bad_value => force_to_ascii("bad value 1\255"),
:bad_value_2 => force_to_ascii("bad\255 value 2"),
force_to_ascii("bad\255 key") => "good value",
:hash => {
:inner_bad_value => force_to_ascii("\255\255bad value 3"),
bad_key.to_sym => 'inner good value',
force_to_ascii("bad array key\255") => [
'good array value 1',
force_to_ascii("bad\255 array value 1\255"),
{
:inner_inner_bad => force_to_ascii("bad inner \255inner value")
}
]
}
}
payload_copy = payload.clone
notifier.send(:enforce_valid_utf8, payload_copy)
payload_copy[:bad_value].should == "bad value 1"
payload_copy[:bad_value_2].should == "bad value 2"
payload_copy["bad key"].should == "good value"
payload_copy.keys.should_not include("bad\456 key")
payload_copy[:hash][:inner_bad_value].should == "bad value 3"
payload_copy[:hash][:"inner bad key"].should == 'inner good value'
payload_copy[:hash]["bad array key"].should == [
'good array value 1',
'bad array value 1',
{
:inner_inner_bad => 'bad inner inner value'
}
]
end
end
context 'truncate_payload' do
it 'should truncate all nested strings in the payload' do
payload = {
:truncated => '1234567',
:not_truncated => '123456',
:hash => {
:inner_truncated => '123456789',
:inner_not_truncated => '567',
:array => ['12345678', '12', {:inner_inner => '123456789'}]
}
}
payload_copy = payload.clone
notifier.send(:truncate_payload, payload_copy, 6)
payload_copy[:truncated].should == '123...'
payload_copy[:not_truncated].should == '123456'
payload_copy[:hash][:inner_truncated].should == '123...'
payload_copy[:hash][:inner_not_truncated].should == '567'
payload_copy[:hash][:array].should == ['123...', '12', {:inner_inner => '123...'}]
end
it 'should truncate utf8 strings properly' do
payload = {
:truncated => 'Ŝǻмρļẻ śţяịņģ',
:not_truncated => '123456',
}
payload_copy = payload.clone
notifier.send(:truncate_payload, payload_copy, 6)
payload_copy[:truncated].should == "Ŝǻм..."
payload_copy[:not_truncated].should == '123456'
end
end
context 'server_data' do
it 'should have the right hostname' do
notifier.send(:server_data)[:host] == Socket.gethostname
end
it 'should have root and branch set when configured' do
configure
Rollbar.configure do |config|
config.root = '/path/to/root'
config.branch = 'master'
end
data = notifier.send(:server_data)
data[:root].should == '/path/to/root'
data[:branch].should == 'master'
end
end
context "project_gems" do
it "should include gem paths for specified project gems in the payload" do
gems = ['rack', 'rspec-rails']
gem_paths = []
Rollbar.configure do |config|
config.project_gems = gems
end
gems.each {|gem|
gem_paths.push(Gem::Specification.find_by_name(gem).gem_dir)
}
data = notifier.send(:build_payload, 'info', 'test', nil, {})['data']
data[:project_package_paths].kind_of?(Array).should == true
data[:project_package_paths].length.should == gem_paths.length
data[:project_package_paths].each_with_index{|path, index|
path.should == gem_paths[index]
}
end
it "should handle regex gem patterns" do
gems = ["rack", /rspec/, /roll/]
gem_paths = []
Rollbar.configure do |config|
config.project_gems = gems
end
gem_paths = gems.map{|gem| Gem::Specification.find_all_by_name(gem).map(&:gem_dir) }.flatten.compact.uniq
gem_paths.length.should > 1
gem_paths.any?{|path| path.include? 'rollbar-gem'}.should == true
gem_paths.any?{|path| path.include? 'rspec-rails'}.should == true
data = notifier.send(:build_payload, 'info', 'test', nil, {})['data']
data[:project_package_paths].kind_of?(Array).should == true
data[:project_package_paths].length.should == gem_paths.length
(data[:project_package_paths] - gem_paths).length.should == 0
end
it "should not break on non-existent gems" do
gems = ["this_gem_does_not_exist", "rack"]
Rollbar.configure do |config|
config.project_gems = gems
end
data = notifier.send(:build_payload, 'info', 'test', nil, {})['data']
data[:project_package_paths].kind_of?(Array).should == true
data[:project_package_paths].length.should == 1
end
end
context 'report_internal_error', :reconfigure_notifier => true do
it "should not crash when given an exception object" do
begin
1 / 0
rescue => e
notifier.send(:report_internal_error, e)
end
end
end
context "send_failsafe" do
let(:exception) { StandardError.new }
it "should not crash when given a message and exception" do
sent_payload = notifier.send(:send_failsafe, "test failsafe", exception)
expected_message = 'Failsafe from rollbar-gem: StandardError: test failsafe'
expect(sent_payload['data'][:body][:message][:body]).to be_eql(expected_message)
end
it "should not crash when given all nils" do
notifier.send(:send_failsafe, nil, nil)
end
context 'without exception object' do
it 'just sends the given message' do
sent_payload = notifier.send(:send_failsafe, "test failsafe", nil)
expected_message = 'Failsafe from rollbar-gem: test failsafe'
expect(sent_payload['data'][:body][:message][:body]).to be_eql(expected_message)
end
end
end
context 'when reporting internal error with nil context' do
let(:context_proc) { proc {} }
let(:scoped_notifier) { notifier.scope(:context => context_proc) }
let(:exception) { Exception.new }
let(:logger_mock) { double("Rails.logger").as_null_object }
it 'reports successfully' do
configure
Rollbar.configure do |config|
config.logger = logger_mock
end
logger_mock.should_receive(:info).with('[Rollbar] Sending payload').once
logger_mock.should_receive(:info).with('[Rollbar] Success').once
scoped_notifier.send(:report_internal_error, exception)
end
end
context "request_data_extractor" do
before(:each) do
class DummyClass
end
@dummy_class = DummyClass.new
@dummy_class.extend(Rollbar::RequestDataExtractor)
end
context "rollbar_headers" do
it "should not include cookies" do
env = {"HTTP_USER_AGENT" => "test", "HTTP_COOKIE" => "cookie"}
headers = @dummy_class.send(:rollbar_headers, env)
headers.should have_key "User-Agent"
headers.should_not have_key "Cookie"
end
end
end
describe '.scoped' do
let(:scope_options) do
{ :foo => 'bar' }
end
it 'changes payload options inside the block' do
Rollbar.reset_notifier!
configure
current_notifier_id = Rollbar.notifier.object_id
Rollbar.scoped(scope_options) do
configuration = Rollbar.notifier.configuration
expect(Rollbar.notifier.object_id).not_to be_eql(current_notifier_id)
expect(configuration.payload_options).to be_eql(scope_options)
end
expect(Rollbar.notifier.object_id).to be_eql(current_notifier_id)
end
context 'if the block fails' do
let(:crashing_block) { proc { fail } }
it 'restores the old notifier' do
notifier = Rollbar.notifier
expect { Rollbar.scoped(&crashing_block) }.to raise_error
expect(notifier).to be_eql(Rollbar.notifier)
end
end
context 'if the block creates a new thread' do
let(:block) do
proc do
Thread.new do
scope = Rollbar.notifier.configuration.payload_options
Thread.main[:inner_scope] = scope
end.join
end
end
let(:scope) do
{ :foo => 'bar' }
end
it 'maintains the parent thread notifier scope' do
Rollbar.scoped(scope, &block)
expect(Thread.main[:inner_scope]).to be_eql(scope)
end
end
end
describe '.scope!' do
let(:new_scope) do
{ :person => { :id => 1 } }
end
before { reconfigure_notifier }
it 'adds the new scope to the payload options' do
configuration = Rollbar.notifier.configuration
Rollbar.scope!(new_scope)
expect(configuration.payload_options).to be_eql(new_scope)
end
end
describe '.reset_notifier' do
it 'resets the notifier' do
notifier1_id = Rollbar.notifier.object_id
Rollbar.reset_notifier!
expect(Rollbar.notifier.object_id).not_to be_eql(notifier1_id)
end
end
describe '.process_payload' do
context 'if there is an exception sending the payload' do
let(:exception) { StandardError.new('error message') }
let(:payload) { { :foo => :bar } }
it 'logs the error and the payload' do
allow(Rollbar.notifier).to receive(:send_payload).and_raise(exception)
expect(Rollbar.notifier).to receive(:log_error)
expect { Rollbar.notifier.process_payload(payload) }.to raise_error(exception)
end
end
end
describe '.process_from_async_handler' do
context 'with errors' do
let(:exception) { StandardError.new('the error') }
it 'raises anything and sends internal error' do
allow(Rollbar.notifier).to receive(:process_payload).and_raise(exception)
expect(Rollbar.notifier).to receive(:report_internal_error).with(exception)
expect do
Rollbar.notifier.process_from_async_handler({})
end.to raise_error(exception)
rollbar_do_not_report = exception.instance_variable_get(:@_rollbar_do_not_report)
expect(rollbar_do_not_report).to be_eql(true)
end
end
end
describe '#custom_data' do
before do
Rollbar.configure do |config|
config.custom_data_method = proc { raise 'this-will-raise' }
end
expect_any_instance_of(Rollbar::Notifier).to receive(:error).and_return(report_data)
end
context 'with uuid in reported data' do
next unless defined?(SecureRandom) and SecureRandom.respond_to?(:uuid)
let(:report_data) { { :uuid => SecureRandom.uuid } }
let(:expected_url) { "https://rollbar.com/instance/uuid?uuid=#{report_data[:uuid]}" }
it 'returns the uuid in :_error_in_custom_data_method' do
expect(notifier.custom_data).to be_eql(:_error_in_custom_data_method => expected_url)
end
end
context 'without uuid in reported data' do
let(:report_data) { { :some => 'other-data' } }
it 'returns the uuid in :_error_in_custom_data_method' do
expect(notifier.custom_data).to be_eql({})
end
end
end
# configure with some basic params
def configure
reconfigure_notifier
end
end
| mit |
MichaelHuyp/YPMTHD | YPMTHD/YPMTHD/Classes/Category/UIViewController+YPInit.h | 249 | //
// UIViewController+YPInit.h
// YPExtension
//
// Created by 胡云鹏 on 15/8/21.
// Copyright (c) 2015年 MichaelPPP. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIViewController (YPInit)
+ (instancetype)controller;
@end
| mit |
blacider/bookSystem | views/foot.html | 169 | <footer>
<div class="content">
<p>Copyright © 20016–2016 Blacider.</p>
</div>
</footer>
<% include login.html%>
</body>
</html> | mit |
amarzavery/azure-rest-api-specs | specification/peering/resource-manager/readme.go.md | 706 | ## Go
These settings apply only when `--go` is specified on the command line.
``` yaml $(go)
go:
license-header: MICROSOFT_APACHE_NO_VERSION
namespace: peering
clear-output-folder: true
```
### Go multi-api
``` yaml $(go) && $(multiapi)
batch:
- tag: package-2019-03-01-preview
```
### Tag: package-2019-03-01-preview and go
These settings apply only when `--tag=package-2019-03-01-preview --go` is specified on the command line.
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.
``` yaml $(tag) == 'package-2019-03-01-preview' && $(go)
output-folder: $(go-sdk-folder)/services/preview/$(namespace)/mgmt/2019-03-01-preview/$(namespace)
```
| mit |
tsunammis/software-craftsmanship | development/golang/golangbyexample/43-collection-functions/collection-functions.go | 2608 | package main
/*
We often need our programs to perform operations on collections of data, like
selecting all items that satisfy a given predicate or mapping all items to a
new collection with a custom function.
In some languages it’s idiomatic to use generic data structures and algorithms.
Go does not support generics; in Go it’s common to provide collection functions
if and when they are specifically needed for your program and data types.
Here are some example collection functions for slices of strings. You can use
these examples to build your own functions. Note that in some cases it may be
clearest to just inline the collection-manipulating code directly, instead of
creating and calling a helper function.
*/
import "strings"
import "fmt"
// Returns the first index of the target string t, or -1 if no match is found.
func Index(vs []string, t string) int {
for i, v := range vs {
if v == t {
return i
}
}
return -1
}
// Returns true if the target string t is in the slice.
func Include(vs []string, t string) bool {
return Index(vs, t) >= 0
}
// Returns true if one of the strings in the slice satisfies the predicate f.
func Any(vs []string, f func(string) bool) bool {
for _, v := range vs {
if f(v) {
return true
}
}
return false
}
// Returns true if all of the strings in the slice satisfy the predicate f.
func All(vs []string, f func(string) bool) bool {
for _, v := range vs {
if !f(v) {
return false
}
}
return true
}
// Returns a new slice containing all strings in the slice that satisfy the
// predicate f.
func Filter(vs []string, f func(string) bool) []string {
vsf := make([]string, 0)
for _, v := range vs {
if f(v) {
vsf = append(vsf, v)
}
}
return vsf
}
// Returns a new slice containing the results of applying the function f to
// each string in the original slice.
func Map(vs []string, f func(string) string) []string {
vsm := make([]string, len(vs))
for i, v := range vs {
vsm[i] = f(v)
}
return vsm
}
func main() {
// Here we try out our various collection functions.
var strs = []string{"peach", "apple", "pear", "plum"}
fmt.Println(Index(strs, "pear"))
fmt.Println(Include(strs, "grape"))
fmt.Println(Any(strs, func(v string) bool {
return strings.HasPrefix(v, "p")
}))
fmt.Println(All(strs, func(v string) bool {
return strings.HasPrefix(v, "p")
}))
fmt.Println(Filter(strs, func(v string) bool {
return strings.Contains(v, "e")
}))
// The above examples all used anonymous functions, but you can also use
// named functions of the correct type.
fmt.Println(Map(strs, strings.ToUpper))
}
| mit |
JB1040/fade2karma | src/app/articles/article.ts | 608 | import { Author } from './article/author/author';
import { Extend } from '../core/globals';
import { Deck } from '../decks/deck';
export class Article {
id: number;
author: Author;
title: string;
imageURL: string;
content: string;
game: 'HS' | 'GWENT';
type: 'METAREPORTS' | 'ANNOUNCMENTS' | 'PODCASTS' | 'HIGHLIGHTS' | 'VIEWPOINTS' | 'TEAMS' | 'CARD_REVEALS';
published: boolean;
rating: number;
date: number;
editDate: number;
recommended: Array<Article>;
similar?: Array<Deck>;
constructor(jsonData: any) {
Extend(this, jsonData);
}
}
| mit |
sygool/ledisdb | cmd/ledis-cli/complietion.go | 473 | package main
// CompletionHandler provides possible completions for given input
type CompletionHandler func(input string) []string
// DefaultCompletionHandler simply returns an empty slice.
var DefaultCompletionHandler = func(input string) []string {
return make([]string, 0)
}
var complHandler = DefaultCompletionHandler
// SetCompletionHandler sets the CompletionHandler to be used for completion
func SetCompletionHandler(c CompletionHandler) {
complHandler = c
}
| mit |
demisto/content | Packs/PrismaAccess/ReleaseNotes/1_0_7.md | 115 | #### Integrations
##### Prisma Access Egress IP feed
- Updated the Docker image to: *demisto/python3:3.9.7.24076*.
| mit |
yogeshsaroya/new-cdnjs | ajax/libs/yui/3.14.1/cssgrids-base/cssgrids-base-min.css | 128 | version https://git-lfs.github.com/spec/v1
oid sha256:225b642d98868ef3bd3bb3e9d96c9b7daf718038559743bc3423f6fc1c7b1698
size 694
| mit |
kellyselden/ember.js | node-tests/blueprints/mixin-test.js | 11394 | 'use strict';
const blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers');
const setupTestHooks = blueprintHelpers.setupTestHooks;
const emberNew = blueprintHelpers.emberNew;
const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
const setupPodConfig = blueprintHelpers.setupPodConfig;
const expectError = require('../helpers/expect-error');
const EOL = require('os').EOL;
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
const setupTestEnvironment = require('../helpers/setup-test-environment');
const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
describe('Blueprint: mixin', function() {
setupTestHooks(this);
describe('in app', function() {
beforeEach(function() {
return emberNew();
});
it('mixin foo', function() {
return emberGenerateDestroy(['mixin', 'foo'], _file => {
expect(_file('app/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('tests/unit/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-app/mixins/foo';"
);
});
});
it('mixin foo/bar', function() {
return emberGenerateDestroy(['mixin', 'foo/bar'], _file => {
expect(_file('app/mixins/foo/bar.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('tests/unit/mixins/foo/bar-test.js')).to.contain(
"import FooBarMixin from 'my-app/mixins/foo/bar';"
);
});
});
it('mixin foo/bar/baz', function() {
return emberGenerateDestroy(['mixin', 'foo/bar/baz'], _file => {
expect(_file('tests/unit/mixins/foo/bar/baz-test.js')).to.contain(
"import FooBarBazMixin from 'my-app/mixins/foo/bar/baz';"
);
});
});
it('mixin foo --pod', function() {
return emberGenerateDestroy(['mixin', 'foo', '--pod'], _file => {
expect(_file('app/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('tests/unit/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-app/mixins/foo';"
);
});
});
it('mixin foo/bar --pod', function() {
return emberGenerateDestroy(['mixin', 'foo/bar', '--pod'], _file => {
expect(_file('app/mixins/foo/bar.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('tests/unit/mixins/foo/bar-test.js')).to.contain(
"import FooBarMixin from 'my-app/mixins/foo/bar';"
);
});
});
it('mixin foo/bar/baz --pod', function() {
return emberGenerateDestroy(['mixin', 'foo/bar/baz', '--pod'], _file => {
expect(_file('tests/unit/mixins/foo/bar/baz-test.js')).to.contain(
"import FooBarBazMixin from 'my-app/mixins/foo/bar/baz';"
);
});
});
describe('with podModulePrefix', function() {
beforeEach(function() {
setupPodConfig({ podModulePrefix: true });
});
it('mixin foo --pod', function() {
return emberGenerateDestroy(['mixin', 'foo', '--pod'], _file => {
expect(_file('app/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('tests/unit/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-app/mixins/foo';"
);
});
});
it('mixin foo/bar --pod', function() {
return emberGenerateDestroy(['mixin', 'foo/bar', '--pod'], _file => {
expect(_file('app/mixins/foo/bar.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('tests/unit/mixins/foo/bar-test.js')).to.contain(
"import FooBarMixin from 'my-app/mixins/foo/bar';"
);
});
});
});
});
describe('in app - module unification', function() {
enableModuleUnification();
beforeEach(function() {
return emberNew();
});
it('mixin foo', function() {
return emberGenerateDestroy(['mixin', 'foo'], _file => {
expect(_file('src/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('src/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-app/mixins/foo';"
);
});
});
it('mixin foo/bar', function() {
return emberGenerateDestroy(['mixin', 'foo/bar'], _file => {
expect(_file('src/mixins/foo/bar.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('src/mixins/foo/bar-test.js')).to.contain(
"import FooBarMixin from 'my-app/mixins/foo/bar';"
);
});
});
it('mixin foo/bar/baz', function() {
return emberGenerateDestroy(['mixin', 'foo/bar/baz'], _file => {
expect(_file('src/mixins/foo/bar/baz.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('src/mixins/foo/bar/baz-test.js')).to.contain(
"import FooBarBazMixin from 'my-app/mixins/foo/bar/baz';"
);
});
});
it('mixin foo --pod', function() {
return expectError(
emberGenerateDestroy(['service', 'foo', '--pod']),
"Pods aren't supported within a module unification app"
);
});
});
describe('in addon', function() {
beforeEach(function() {
return emberNew({ target: 'addon' });
});
it('mixin foo', function() {
return emberGenerateDestroy(['mixin', 'foo'], _file => {
expect(_file('addon/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('tests/unit/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-addon/mixins/foo';"
);
expect(_file('app/mixins/foo.js')).to.not.exist;
});
});
it('mixin foo/bar', function() {
return emberGenerateDestroy(['mixin', 'foo/bar'], _file => {
expect(_file('addon/mixins/foo/bar.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('tests/unit/mixins/foo/bar-test.js')).to.contain(
"import FooBarMixin from 'my-addon/mixins/foo/bar';"
);
expect(_file('app/mixins/foo/bar.js')).to.not.exist;
});
});
it('mixin foo/bar/baz', function() {
return emberGenerateDestroy(['mixin', 'foo/bar/baz'], _file => {
expect(_file('addon/mixins/foo/bar/baz.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('tests/unit/mixins/foo/bar/baz-test.js')).to.contain(
"import FooBarBazMixin from 'my-addon/mixins/foo/bar/baz';"
);
expect(_file('app/mixins/foo/bar/baz.js')).to.not.exist;
});
});
it('mixin foo/bar/baz --dummy', function() {
return emberGenerateDestroy(['mixin', 'foo/bar/baz', '--dummy'], _file => {
expect(_file('tests/dummy/app/mixins/foo/bar/baz.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('addon/mixins/foo/bar/baz.js')).to.not.exist;
});
});
});
describe('in addon - module unification', function() {
enableModuleUnification();
beforeEach(function() {
return emberNew({ target: 'addon' });
});
it('mixin foo', function() {
return emberGenerateDestroy(['mixin', 'foo'], _file => {
expect(_file('src/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('src/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-addon/mixins/foo';"
);
});
});
it('mixin foo/bar', function() {
return emberGenerateDestroy(['mixin', 'foo/bar'], _file => {
expect(_file('src/mixins/foo/bar.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('src/mixins/foo/bar-test.js')).to.contain(
"import FooBarMixin from 'my-addon/mixins/foo/bar';"
);
});
});
it('mixin foo/bar/baz', function() {
return emberGenerateDestroy(['mixin', 'foo/bar/baz'], _file => {
expect(_file('src/mixins/foo/bar/baz.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('src/mixins/foo/bar/baz-test.js')).to.contain(
"import FooBarBazMixin from 'my-addon/mixins/foo/bar/baz';"
);
});
});
it('mixin foo/bar/baz --dummy', function() {
return emberGenerateDestroy(['mixin', 'foo/bar/baz', '--dummy'], _file => {
expect(_file('tests/dummy/src/mixins/foo/bar/baz.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('src/mixins/foo/bar/baz.js')).to.not.exist;
});
});
});
describe('in in-repo-addon', function() {
beforeEach(function() {
return emberNew({ target: 'in-repo-addon' });
});
it('mixin foo --in-repo-addon=my-addon', function() {
return emberGenerateDestroy(['mixin', 'foo', '--in-repo-addon=my-addon'], _file => {
expect(_file('lib/my-addon/addon/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('tests/unit/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-addon/mixins/foo';"
);
});
});
it('mixin foo/bar --in-repo-addon=my-addon', function() {
return emberGenerateDestroy(['mixin', 'foo/bar', '--in-repo-addon=my-addon'], _file => {
expect(_file('lib/my-addon/addon/mixins/foo/bar.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
.to.contain(`export default Mixin.create({${EOL}});`);
expect(_file('tests/unit/mixins/foo/bar-test.js')).to.contain(
"import FooBarMixin from 'my-addon/mixins/foo/bar';"
);
});
});
it('mixin foo/bar/baz --in-repo-addon=my-addon', function() {
return emberGenerateDestroy(['mixin', 'foo/bar/baz', '--in-repo-addon=my-addon'], _file => {
expect(_file('tests/unit/mixins/foo/bar/baz-test.js')).to.contain(
"import FooBarBazMixin from 'my-addon/mixins/foo/bar/baz';"
);
});
});
});
});
| mit |
BranchMetrics/react-native-branch | examples/androidx-deps/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.java | 2135 | package com.swmansion.gesturehandler.react;
import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
import com.facebook.react.uimanager.PointerEvents;
import com.facebook.react.uimanager.ReactPointerEventsView;
import com.facebook.react.views.view.ReactViewGroup;
import com.swmansion.gesturehandler.PointerEventsConfig;
import com.swmansion.gesturehandler.ViewConfigurationHelper;
public class RNViewConfigurationHelper implements ViewConfigurationHelper {
@Override
public PointerEventsConfig getPointerEventsConfigForView(View view) {
PointerEvents pointerEvents;
pointerEvents = view instanceof ReactPointerEventsView ?
((ReactPointerEventsView) view).getPointerEvents() :
PointerEvents.AUTO;
// Views that are disabled should never be the target of pointer events. However, their children
// can be because some views (SwipeRefreshLayout) use enabled but still have children that can
// be valid targets.
if (!view.isEnabled()) {
if (pointerEvents == PointerEvents.AUTO) {
return PointerEventsConfig.BOX_NONE;
} else if (pointerEvents == PointerEvents.BOX_ONLY) {
return PointerEventsConfig.NONE;
}
}
switch (pointerEvents) {
case BOX_ONLY: return PointerEventsConfig.BOX_ONLY;
case BOX_NONE: return PointerEventsConfig.BOX_NONE;
case NONE: return PointerEventsConfig.NONE;
}
return PointerEventsConfig.AUTO;
}
@Override
public View getChildInDrawingOrderAtIndex(ViewGroup parent, int index) {
if (parent instanceof ReactViewGroup) {
return parent.getChildAt(((ReactViewGroup) parent).getZIndexMappedChildIndex(index));
}
return parent.getChildAt(index);
}
@Override
public boolean isViewClippingChildren(ViewGroup view) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 && !view.getClipChildren()) {
if (view instanceof ReactViewGroup) {
String overflow = ((ReactViewGroup) view).getOverflow();
return "hidden".equals(overflow);
}
return false;
}
return true;
}
}
| mit |
feliciousx-open-source/cyclejs | docs/getting-started.html | 10809 | <!doctype html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<title>Cycle.js - Getting started</title>
<!-- Flatdoc -->
<script src='support/vendor/jquery.js'></script>
<script src='support/vendor/highlight.pack.js'></script>
<script src='legacy.js'></script>
<script src='flatdoc.js'></script>
<!-- Algolia's DocSearch main theme -->
<link href='//cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css' rel='stylesheet' />
<!-- Others -->
<script async src="//static.jsbin.com/js/embed.js"></script>
<!-- Flatdoc theme -->
<link href='theme/style.css' rel='stylesheet'>
<script src='theme/script.js'></script>
<link href='support/vendor/highlight-github-gist.css' rel='stylesheet'>
<!-- Meta -->
<meta content="Cycle.js - Getting started" property="og:title">
<meta content="A functional and reactive JavaScript framework for predictable code" name="description">
<!-- Content -->
<script id="markdown" type="text/markdown" src="index.html">
# Getting started
## Consider create-cycle-app
The quickest way to create a new project with Cycle.js is by using [create-cycle-app](https://github.com/cyclejs-community/create-cycle-app), giving you the choice between ES6 or TypeScript, Browserify or Webpack.
> [create-cycle-app >](https://github.com/cyclejs-community/create-cycle-app)
First install Create Cycle App globally in your system.
```bash
npm install --global create-cycle-app
```
Then, this command will create a project called *my-awesome-app* (or another name of your choice) with Cycle *Run* and Cycle *DOM*.
```
create-cycle-app my-awesome-app
```
If you want to use typescript use the `one-fits-all` flavor.
```
create-cycle-app my-awesome-app --flavor cycle-scripts-one-fits-all
```
## Install from npm
If you want to have more control over your project, the recommended channel for downloading Cycle.js as a package is through [npm](http://npmjs.org/).
Create a new directory and run this npm command inside that directory. This installs [xstream](http://staltz.com/xstream), Cycle *Run*, and Cycle *DOM*.
```
npm install xstream @cycle/run @cycle/dom
```
Packages *xstream* and *Run* are the minimum required API to work with Cycle.js. The *Run* package includes a single function `run()`, and Cycle *DOM* is the standard DOM Driver providing a way to interface with the DOM. You can also use Cycle.js with other stream libraries like RxJS or Most.js.
> We recommend xstream if you don't know what to choose.
```
npm install xstream @cycle/run
```
> [RxJS](http://reactivex.io/rxjs)
```
npm install rxjs @cycle/rxjs-run
```
> [Most.js](https://github.com/cujojs/most)
```
npm install most @cycle/most-run
```
Note: packages of the type `@org/package` are [npm scoped packages](https://docs.npmjs.com/getting-started/scoped-packages), supported if your npm installation is version 2.11 or higher. Check your npm version with `npm --version` and upgrade in order to install Cycle.js.
In case you are not dealing with a DOM-interfacing web application, you can omit `@cycle/dom` when installing.
## Coding
We recommend the use of a bundling tool such as [browserify](http://browserify.org/) or [webpack](http://webpack.github.io/), in combination with ES6 (a.k.a. ES2015) through a transpiler (e.g. [Babel](http://babeljs.io/) or [TypeScript](http://typescriptlang.org/)). Most of the code examples in this documentation assume some basic familiarity with ES6.
### Import libraries
Once your build system is set up, start writing your main JavaScript source file like this, to import the libraries. The second line imports the function `run(main, drivers)`, where `main` is the entry point for our whole application, and `drivers` is a record of driver functions labeled by some name.
```js
import xs from 'xstream';
import {run} from '@cycle/run';
import {makeDOMDriver} from '@cycle/dom';
// ...
```
### Create `main` and `drivers`
Then, write a `main` function, for now with empty contents. `makeDOMDriver(container)` from Cycle *DOM* returns a driver function to interact with the DOM. This function is registered under the key `DOM` in the `drivers` object.
```js
function main() {
// ...
}
const drivers = {
DOM: makeDOMDriver('#app')
};
```
Then, call `run()` to connect the main function with the drivers.
```js
run(main, drivers);
```
### Send messages from `main`
We have filled the `main()` function with some code: returns an object `sinks` which has an `xstream` stream defined under the name `DOM`. This indicates `main()` is sending the stream as messages to the DOM driver. Sinks are outgoing messages. The stream emits Virtual DOM `<h1>` elements displaying `${i} seconds elapsed` changing over time every second, where `${i}` is replaced by `0`, `1`, `2`, etc.
```js
function main() {
const sinks = {
DOM: xs.periodic(1000).map(i =>
h1('' + i + ' seconds elapsed')
)
};
return sinks;
}
```
Also, remember to import `h1` from Cycle DOM.
> In the beginning of the file:
```js
import {makeDOMDriver, h1} from '@cycle/dom';
```
### Catch messages into `main`
Function `main()` now takes `sources` as input. Just like the output `sinks`, the input `sources` follow the same structure: an object containing `DOM` as a property. Sources are incoming messages. `sources.DOM` is an object with a queryable API to get streams. Use `sources.DOM.select(selector).events(eventType)` to get a stream of `eventType` DOM events happening on the element(s) specified by `selector`. This `main()` function takes the stream of `click` events happening on `input` elements, and maps those toggling events to Virtual DOM elements displaying a togglable checkbox.
```js
function main(sources) {
const sinks = {
DOM: sources.DOM.select('input').events('click')
.map(ev => ev.target.checked)
.startWith(false)
.map(toggled =>
div([
input({attrs: {type: 'checkbox'}}), 'Toggle me',
p(toggled ? 'ON' : 'off')
])
)
};
return sinks;
}
```
Remember to import new element types from Cycle DOM.
> In the beginning of the file:
```js
import {makeDOMDriver, div, input, p} from '@cycle/dom';
```
### Consider JSX
We used the `div()`, `input()`, `p()` helper functions to create virtual DOM elements for the respective `<div>`, `<input>`, `<p>` DOM elements, but you can also use JSX with Babel. The following only works if you are building with Babel:
(1) Install the npm packages [babel-plugin-transform-react-jsx](http://babeljs.io/docs/plugins/transform-react-jsx/) and [snabbdom-jsx](https://www.npmjs.com/package/snabbdom-jsx).
```
npm install --save babel-plugin-transform-react-jsx snabbdom-jsx
```
(2) Specify a pragma for JSX in the `.babelrc` file.
> .babelrc
```json
{
"presets": [
"es2015"
],
"plugins": [
"syntax-jsx",
["transform-react-jsx", {"pragma": "html"}]
]
}
```
(3) Import Snabbdom JSX.
> main.js
```js
import xs from 'xstream';
import {run} from '@cycle/xstream-run';
import {makeDOMDriver} from '@cycle/dom';
import {html} from 'snabbdom-jsx';
```
(4) Use JSX as return values.
This example portrays the most common problem-solving pattern in Cycle.js: formulate the computer's behavior as a function of streams: continuously listen to source messages from drivers and continuously provide sinks messages (in our case, Virtual DOM elements) to the drivers. Read the next chapter to get familiar with this pattern.
```jsx
function main(sources) {
const sinks = {
DOM: sources.DOM.select('input').events('click')
.map(ev => ev.target.checked)
.startWith(false)
.map(toggled =>
<div>
<input type="checkbox" /> Toggle me
<p>{toggled ? 'ON' : 'off'}</p>
</div>
)
};
return sinks;
}
```
## Install without npm
In the rare occasion you need Cycle.js scripts as standalone JavaScript files, you can download them from [unpkg](https://unpkg.com) directly into your HTML file:
- Latest Cycle.js [run](https://unpkg.com/@cycle/run/dist/cycle-run.js)
- Latest Cycle.js [most.js run](https://unpkg.com/@cycle/most-run/dist/cycle-most-run.js)
- Latest Cycle.js [RxJS run](https://unpkg.com/@cycle/rxjs-run/dist/cycle.js)
- Latest Cycle.js [DOM](https://unpkg.com/@cycle/dom/dist/cycle-dom.js)
- Latest Cycle.js [HTTP](https://unpkg.com/@cycle/http/dist/cycle-http-driver.js)
- Latest Cycle.js [Isolate](https://unpkg.com/@cycle/isolate/dist/cycle-isolate.js)
</script>
<!-- Initializer -->
<script>
Flatdoc.run({
fetcher: function(callback) {
callback(null, document.getElementById('markdown').innerHTML);
},
highlight: function (code, value) {
return hljs.highlight(value, code).value;
},
});
</script>
</head>
<body role='flatdoc' class="no-literate">
<div class='header'>
<div class='left'>
<h1><a href="/"><img class="logo" src="img/cyclejs_logo.svg" >Cycle.js</a></h1>
<ul>
<li><a href='getting-started.html'>Documentation</a></li>
<li><a href='api/index.html'>API reference</a></li>
<li><a href='releases.html'>Releases</a></li>
<li><a href='https://github.com/cyclejs/cyclejs'>GitHub</a></li>
</ul>
<input id="docsearch" />
</div>
<div class='right'>
<!-- GitHub buttons: see https://ghbtns.com -->
<iframe src="https://ghbtns.com/github-btn.html?user=cyclejs&repo=cyclejs&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</div>
</div>
<div class='content-root'>
<div class='menubar'>
<div class='menu section'>
<div role='flatdoc-menu'></div>
<ul>
<li><a href="dialogue.html" class="level-1 out-link">Dialogue abstraction</a></li>
<li><a href="streams.html" class="level-1 out-link">Streams</a></li>
<li><a href="basic-examples.html" class="level-1 out-link">Basic examples</a></li>
<li><a href="model-view-intent.html" class="level-1 out-link">Model-View-Intent</a></li>
<li><a href="components.html" class="level-1 out-link">Components</a></li>
<li><a href="drivers.html" class="level-1 out-link">Drivers</a></li>
</ul>
</div>
</div>
<div role='flatdoc-content' class='content'></div>
</div>
<script>
((window.gitter = {}).chat = {}).options = {
room: 'cyclejs/cyclejs'
};
</script>
<script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script>
<script src='//cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js'></script>
<script src='docsearch.js'></script>
</body>
</html>
| mit |
extr0py/extropy | src/js/common/Entity/State/State.ts | 790 | module Extropy.Entity {
// State encapsulates the state of a set of entities for a particular frame
export class State {
public id: number;
public tick: number;
private _idToEntity: HashTable<EntityState> = Object.create(null);
private _entities: EntityState[] = [];
public get entities(): EntityState[] {
return this._entities;
}
public containsEntity(id: string): boolean {
return !!this._idToEntity[id];
}
public pushEntityData(state: EntityState) {
var id = state.id;
if (this._idToEntity[id])
throw "This case isn't handled yet.";
this._idToEntity[id] = state;
this._entities.push(state);
}
}
}
| mit |
nhamcrest/NHamcrest | src/NHamcrest.Tests/TestClasses/ClassWithArrayOfClasses.cs | 208 | using System;
namespace NHamcrest.Tests.TestClasses
{
public class ClassWithArrayOfClasses
{
public Guid Id { get; set; }
public SimpleFlatClass[] OtherThings { get; set; }
}
} | mit |
borisbrodski/jmockit | samples/powermock/test/powermock/examples/simple/Logger_JMockit_Test.java | 1473 | /*
* Copyright (c) 2006-2012 Rogério Liesenfeld
* This file is subject to the terms of the MIT license (see LICENSE.txt).
*/
package powermock.examples.simple;
import java.io.*;
import org.junit.*;
import mockit.*;
/**
* <a href="http://code.google.com/p/powermock/source/browse/trunk/examples/simple/src/test/java/demo/org/powermock/examples/simple/LoggerTest.java">PowerMock version</a>
*/
public final class Logger_JMockit_Test
{
@Test(expected = IllegalStateException.class)
public void testException() throws Exception
{
new NonStrictExpectations() {
final FileWriter fileWriter;
{
fileWriter = new FileWriter("target/logger.log"); result = new IOException();
}
};
new Logger();
}
@Test
public void testLogger() throws Exception
{
new NonStrictExpectations() {
FileWriter fileWriter; // can also be final with value "new FileWriter(withAny(""))"
PrintWriter printWriter; // can also be final with value "new PrintWriter(fileWriter)"
{
printWriter.println("qwe");
}
};
Logger logger = new Logger();
logger.log("qwe");
}
@Test
public void testLogger2(final Logger logger)
{
new Expectations(logger) {
PrintWriter printWriter;
{
setField(logger, printWriter);
printWriter.println("qwe");
}
};
logger.log("qwe");
}
}
| mit |
Vmlweb/MEAN-AngularJS-1 | client/controller.js | 218 | //Controller
app.controller('NavbarController', function($scope, $location) {
//Set active navigation bar tab
$scope.isActive = function (viewLocation) {
return viewLocation === $location.path();
};
}); | mit |
bower/components | packages/editor.js | 78 | {
"name": "editor.js",
"url": "https://github.com/ktkaushik/editor.git"
}
| mit |
hetmeter/awmm | fender-sb-bdd/src/ags/graph/CycleDetector.java | 6919 | /* ==========================================
* JGraphT : a free Java graph-theory library
* ==========================================
*
* Project Info: http://jgrapht.sourceforge.net/
* Project Creator: Barak Naveh (http://sourceforge.net/users/barak_naveh)
*
* (C) Copyright 2003-2008, by Barak Naveh and Contributors.
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation,
* Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*/
/* ------------------
* CycleDetector.java
* ------------------
* (C) Copyright 2004-2008, by John V. Sichi and Contributors.
*
* Original Author: John V. Sichi
* Contributor(s): Christian Hammer
*
* $Id: CycleDetector.java,v 1.1 2010/07/14 14:09:02 mkuper Exp $
*
* Changes
* -------
* 16-Sept-2004 : Initial revision (JVS);
* 07-Jun-2005 : Made generic (CH);
*
*/
package ags.graph;
import java.util.*;
import org.jgrapht.*;
import org.jgrapht.traverse.*;
/**
* Performs cycle detection on a graph. The <i>inspected graph</i> is specified
* at construction time and cannot be modified. Currently, the detector supports
* only directed graphs.
*
* @author John V. Sichi
* @since Sept 16, 2004
*/
public class CycleDetector<V, E>
{
//~ Instance fields --------------------------------------------------------
/**
* Graph on which cycle detection is being performed.
*/
private DirectedGraph<V, E> graph;
//~ Constructors -----------------------------------------------------------
/**
* Creates a cycle detector for the specified graph. Currently only directed
* graphs are supported.
*
* @param graph the DirectedGraph in which to detect cycles
*/
public CycleDetector(DirectedGraph<V, E> graph)
{
this.graph = graph;
}
//~ Methods ----------------------------------------------------------------
/**
* Performs yes/no cycle detection on the entire graph.
*
* @return true iff the graph contains at least one cycle
*/
@SuppressWarnings({ "unchecked", "static-access" })
public List<V> detectCycles()
{
try {
execute(null, null);
} catch (CycleDetectedException ex) {
return ex.path;
}
return null;
}
/**
* Performs yes/no cycle detection on an individual vertex.
*
* @param v the vertex to test
*
* @return true if v is on at least one cycle
*/
public boolean detectCyclesContainingVertex(V v)
{
try {
execute(null, v);
} catch (CycleDetectedException ex) {
return true;
}
return false;
}
/**
* Finds the vertex set for the subgraph of all cycles which contain a
* particular vertex.
*
* <p>REVIEW jvs 25-Aug-2006: This implementation is not guaranteed to cover
* all cases. If you want to be absolutely certain that you report vertices
* from all cycles containing v, it's safer (but less efficient) to use
* StrongConnectivityInspector instead and return the strongly connected
* component containing v.
*
* @param v the vertex to test
*
* @return set of all vertices reachable from v via at least one cycle
*/
public Set<V> findCyclesContainingVertex(V v)
{
Set<V> set = new HashSet<V>();
execute(set, v);
return set;
}
private void execute(Set<V> s, V v)
{
ProbeIterator iter = new ProbeIterator(s, v);
while (iter.hasNext()) {
iter.next();
}
}
//~ Inner Classes ----------------------------------------------------------
/**
* Exception thrown internally when a cycle is detected during a yes/no
* cycle test. Must be caught by top-level detection method.
*/
private static class CycleDetectedException
extends RuntimeException
{
@SuppressWarnings({ "unchecked", "static-access" })
public CycleDetectedException(List path)
{
this.path = path;
}
private static final long serialVersionUID = 3834305137802950712L;
@SuppressWarnings("unchecked")
protected static List path;
}
/**
* Version of DFS which maintains a backtracking path used to probe for
* cycles.
*/
private class ProbeIterator
extends DepthFirstIterator<V, E>
{
private List<V> path;
private Set<V> cycleSet;
private V root;
ProbeIterator(Set<V> cycleSet, V startVertex)
{
super(graph, startVertex);
root = startVertex;
this.cycleSet = cycleSet;
path = new ArrayList<V>();
}
/**
* {@inheritDoc}
*/
protected void encounterVertexAgain(V vertex, E edge)
{
super.encounterVertexAgain(vertex, edge);
int i;
if (root != null) {
// For rooted detection, the path must either
// double back to the root, or to a node of a cycle
// which has already been detected.
if (vertex == root) {
i = 0;
} else if ((cycleSet != null) && cycleSet.contains(vertex)) {
i = 0;
} else {
return;
}
} else {
i = path.indexOf(vertex);
}
if (i > -1) {
if (cycleSet == null) {
// we're doing yes/no cycle detection
path.add(vertex);
throw new CycleDetectedException(path);
} else {
for (; i < path.size(); ++i) {
cycleSet.add(path.get(i));
}
}
}
}
/**
* {@inheritDoc}
*/
protected V provideNextVertex()
{
V v = super.provideNextVertex();
// backtrack
for (int i = path.size() - 1; i >= 0; --i) {
if (graph.containsEdge(path.get(i), v)) {
break;
}
path.remove(i);
}
path.add(v);
return v;
}
}
}
// End CycleDetector.java
| mit |
vineetreddyrajula/pharo | src/FileSystem-Memory.package/MemoryFileSystemEntry.class/README.md | 122 | I am an abstract file system entry for a memory file system.
My subclasses should specialize on the kind of file they are. | mit |
you-n-g/multiverso | binding/python/multiverso/tables.py | 7029 | #!/usr/bin/env python
# coding:utf8
import ctypes
from utils import Loader
from utils import convert_data
import numpy as np
import api
mv_lib = Loader.get_lib()
class TableHandler(object):
'''`TableHandler` is an interface to sync different kinds of values.
If you are not writing python code based on theano or lasagne, you are
supposed to sync models (for initialization) and gradients (during
training) so as to let multiverso help you manage the models in distributed
environments.
Otherwise, you'd better use the classes in `multiverso.theano_ext` or
`multiverso.theano_ext.lasagne_ext`
'''
def __init__(self, size, init_value=None):
raise NotImplementedError("You must implement the __init__ method.")
def get(self, size):
raise NotImplementedError("You must implement the get method.")
def add(self, data, sync=False):
raise NotImplementedError("You must implement the add method.")
# types
C_FLOAT_P = ctypes.POINTER(ctypes.c_float)
class ArrayTableHandler(TableHandler):
'''`ArrayTableHandler` is used to sync array-like (one-dimensional) value.'''
def __init__(self, size, init_value=None):
'''Constructor for syncing array-like (one-dimensional) value.
The `size` should be a int equal to the size of value we want to sync.
If init_value is None, zeros will be used to initialize the table,
otherwise the table will be initialized as the init_value.
*Notice*: Only the init_value from the master will be used!
'''
self._handler = ctypes.c_void_p()
self._size = size
mv_lib.MV_NewArrayTable(size, ctypes.byref(self._handler))
if init_value is not None:
init_value = convert_data(init_value)
# sync add is used because we want to make sure that the initial
# value has taken effect when the call returns. No matter whether
# it is master worker, we should call add to make sure it works in
# sync mode
self.add(init_value if api.is_master_worker() else np.zeros(init_value.shape), sync=True)
def get(self):
'''get the latest value from multiverso ArrayTable
Data type of return value is numpy.ndarray with one-dimensional
'''
data = np.zeros((self._size, ), dtype=np.dtype("float32"))
mv_lib.MV_GetArrayTable(self._handler, data.ctypes.data_as(C_FLOAT_P), self._size)
return data
def add(self, data, sync=False):
'''add the data to the multiverso ArrayTable
Data type of `data` is numpy.ndarray with one-dimensional
If sync is True, this call will blocked by IO until the call finish.
Otherwise it will return immediately
'''
data = convert_data(data)
assert(data.size == self._size)
if sync:
mv_lib.MV_AddArrayTable(self._handler, data.ctypes.data_as(C_FLOAT_P), self._size)
else:
mv_lib.MV_AddAsyncArrayTable(self._handler, data.ctypes.data_as(C_FLOAT_P), self._size)
class MatrixTableHandler(TableHandler):
def __init__(self, num_row, num_col, init_value=None):
'''Constructor for syncing matrix-like (two-dimensional) value.
The `num_row` should be the number of rows and the `num_col` should be
the number of columns.
If init_value is None, zeros will be used to initialize the table,
otherwise the table will be initialized as the init_value.
*Notice*: Only the init_value from the master will be used!
'''
self._handler = ctypes.c_void_p()
self._num_row = num_row
self._num_col = num_col
self._size = num_col * num_row
mv_lib.MV_NewMatrixTable(num_row, num_col, ctypes.byref(self._handler))
if init_value is not None:
init_value = convert_data(init_value)
# sync add is used because we want to make sure that the initial
# value has taken effect when the call returns. No matter whether
# it is master worker, we should call add to make sure it works in
# sync mode
self.add(init_value if api.is_master_worker() else np.zeros(init_value.shape), sync=True)
def get(self, row_ids=None):
'''get the latest value from multiverso MatrixTable
If row_ids is None, we will return all rows as numpy.narray , e.g.
array([[1, 3], [3, 4]]).
Otherwise we will return the data according to the row_ids(e.g. you can
pass [1] to row_ids to get only the first row, it will return a
two-dimensional numpy.ndarray with one row)
Data type of return value is numpy.ndarray with two-dimensional
'''
if row_ids is None:
data = np.zeros((self._num_row, self._num_col), dtype=np.dtype("float32"))
mv_lib.MV_GetMatrixTableAll(self._handler, data.ctypes.data_as(C_FLOAT_P), self._size)
return data
else:
row_ids_n = len(row_ids)
int_array_type = ctypes.c_int * row_ids_n
data = np.zeros((row_ids_n, self._num_col), dtype=np.dtype("float32"))
mv_lib.MV_GetMatrixTableByRows(self._handler, data.ctypes.data_as(C_FLOAT_P),
row_ids_n * self._num_col,
int_array_type(*row_ids), row_ids_n)
return data
def add(self, data=None, row_ids=None, sync=False):
'''add the data to the multiverso MatrixTable
If row_ids is None, we will add all data, and the data
should be a list, e.g. [1, 2, 3, ...]
Otherwise we will add the data according to the row_ids
Data type of `data` is numpy.ndarray with two-dimensional
If sync is True, this call will blocked by IO until the call finish.
Otherwise it will return immediately
'''
assert(data is not None)
data = convert_data(data)
if row_ids is None:
assert(data.size == self._size)
if sync:
mv_lib.MV_AddMatrixTableAll(self._handler, data.ctypes.data_as(C_FLOAT_P), self._size)
else:
mv_lib.MV_AddAsyncMatrixTableAll(self._handler, data.ctypes.data_as(C_FLOAT_P), self._size)
else:
row_ids_n = len(row_ids)
assert(data.size == row_ids_n * self._num_col)
int_array_type = ctypes.c_int * row_ids_n
if sync:
mv_lib.MV_AddMatrixTableByRows(self._handler, data.ctypes.data_as(C_FLOAT_P),
row_ids_n * self._num_col,
int_array_type(*row_ids), row_ids_n)
else:
mv_lib.MV_AddAsyncMatrixTableByRows(self._handler, data.ctypes.data_as(C_FLOAT_P),
row_ids_n * self._num_col,
int_array_type(*row_ids), row_ids_n)
| mit |
plivo/plivo-php | src/Plivo/Exceptions/PlivoXMLException.php | 156 | <?php
namespace Plivo\Exceptions;
/**
* Class PlivoXMLException
* @package Plivo\Exceptions
*/
class PlivoXMLException extends PlivoRestException
{
} | mit |
dkulp23/ways2goAPI | server.js | 1137 | 'use strict';
const dotenv = require('dotenv');
dotenv.load();
const express = require('express');
const debug = require('debug')('ways2go:server');
const morgan = require('morgan');
const cors = require('cors');
const mongoose = require('mongoose');
const Promise = require('bluebird');
const apiRouter = require('./route/api-router.js');
const wayRouter = require('./route/way-router.js');
const userRouter = require('./route/user-router.js');
const profileRouter = require('./route/profile-router.js');
const messageRouter = require('./route/message-router.js');
const reviewRouter = require('./route/review-router.js');
const errors = require('./lib/error-middleware.js');
const PORT = process.env.PORT || 3000;
const app = express();
mongoose.Promise = Promise;
mongoose.connect(process.env.MONGODB_URI);
app.use(cors());
app.use(morgan('dev'));
app.use(userRouter);
app.use(apiRouter);
app.use(wayRouter);
app.use(profileRouter);
app.use(reviewRouter);
app.use(messageRouter);
app.use(errors);
const server = module.exports = app.listen(PORT, () => {
debug(`Server's up on PORT: ${PORT}`);
});
server.isRunning = true;
| mit |
serafin/fine | src/lib/f/di/shared.php | 295 | <?php
abstract class f_di_shared extends f_di
{
protected static $_shared = array();
public function __get($name)
{
if (isset(self::$_shared[$name])) {
return $this->{$name} = self::$_shared[$name];
}
return parent::__get($name);
}
} | mit |
sinkingshriek/kaha | routes/utils.js | 7537 | var conf = require('../config/');
var sha = require('object-hash');
var uuid = require('node-uuid');
var _ = require('underscore');
_.mixin(require('underscore.deep'));
var url = require('url');
var db;
var env = exports.env = conf.name;
var similarFilter = ['type', 'location', 'description.contactnumber'];
var readonly = exports.readonly = Number(process.env.KAHA_READONLY) || 0;
exports.init = function(dbObj){
db = dbObj;
};
/**
* Description: mixin for increment
* and decrement counter
*
* @method flagcounter
* @param dbQry{Function} query to be performed
* @return Function
*/
var flagcounter = exports.flagcounter = function(dbQry) {
return function(req, res, next) {
if (enforceReadonly(res)) {
return;
}
var obj = {
"uuid": req.params.id,
"flag": req.query.flag
};
dbQry(req, res, obj);
};
};
/**
* Description: When the server
* needs to enable read-only
* mode to stop writing on db
*
* @method enforceReadonly
* @param res{Object}
* @return Boolean
*/
var enforceReadonly = exports.enforceReadonly = function(res) {
if (readonly) {
res.status(503).send('Service Unavailable');
return true;
}
return false;
};
/**
* Description: Standard Callback
* To stop duplication across
* all page
*
* @method stdCb
* @param err{Boolean}, reply{Array}
* @return [Boolean]
*/
var stdCb = exports.stdCb = function(err, reply) {
if (err) {
return err;
}
};
/**
* Description: Get Everything
*
* @method getAllFromDb
* @param Function
* @return N/A
*/
exports.getEverything = function(cb) {
var results = [];
var multi = db.multi();
db.keys('*', function(err, reply) {
if (err) {
return err;
}
reply.forEach(function(key) {
multi.get(key, stdCb);
});
multi.exec(function(err, replies) {
if (err) {
return err;
}
var result = _.map(replies, function(rep) {
return JSON.parse(rep);
});
var keyVals = _.object(reply, result);
cb(null, keyVals);
});
});
};
/**
* Description: DRYing
*
* @method getAllFromDb
* @param cb{Function}
* @return n/a
*/
var getAllFromDb = exports.getAllFromDb = function(cb) {
var results = [];
var multi = db.multi();
db.keys('*', function(err, reply) {
if (err) {
return err;
}
db.keys('*:*', function(err, reply2) {
if (err) {
return err;
}
_.each(_.difference(reply, reply2), function(key) {
multi.get(key, stdCb);
});
multi.exec(function(err, replies) {
if (err) {
return err;
}
var result = _.map(replies, function(rep) {
return JSON.parse(rep);
});
cb(null, result);
});
});
});
};
/**
* Description: Only for individual
* Object
*
* @method getSha
* @param obj{Object}, shaFilters{Array}
* @return String
*/
var getSha = exports.getSha = function(obj, shaFilters) {
var key, extract = {};
if (Array.isArray(shaFilters)) {
shaFilters.forEach(function(filter) {
var selectedObj = _.deepPick(obj, [filter]);
_.extend(extract, selectedObj);
});
}
return sha(extract);
};
/**
* Description: Similar to getSha
* but for array of Objects
*
* @method getShaAllWithObjs
* @param objs{Object}
* @return Array
*/
var getShaAllWithObjs = exports.getShaAllWithObjs = function(objs) {
var hashes = [];
objs.forEach(function(result) {
var tmpObj = {};
tmpObj[getSha(result, similarFilter)] = result;
hashes.push(tmpObj);
});
return hashes;
};
/**
* Description: No filter
*
* @method methodName
* @param type
* @return type
*/
var getShaAll = exports.getShaAll = function(objs, similarFilter) {
var hashes = [];
objs.forEach(function(result) {
hashes.push(getSha(result, similarFilter));
});
return hashes;
};
/**
* Description:
*
* @method methodName
* @param type
* @return type
*/
var getSimilarItems = exports.getSimilarItems = function(arrayObj, shaKey) {
return _.map(_.filter(getShaAllWithObjs(arrayObj), function(obj) {
return _.keys(obj)[0] === shaKey;
}), function(obj) {
return _.values(obj)[0];
});
};
var getUniqueUserID = exports.getUniqueUserID = function(req) {
var proxies = req.headers['x-forwarded-for'] || '';
var ip = _.last(proxies.split(',')) ||
req.connection.remoteAddress ||
req.socket.remoteAddress ||
req.connection.socket.remoteAddress;
return ip;
};
/**
* Description: Does single or bulk post
*
* @method rootPost
* @param req(Object), res(Object), next(Function)
* @return n/a
*/
var rootPost = exports.rootPost = function(req, res, next) {
/* give each entry a unique id
*/
function entry(obj) {
var data_uuid = uuid.v4();
obj.uuid = data_uuid;
obj = dateEntry(obj);
if (typeof obj.verified === 'undefined') {
obj.verified = false;
}
multi.set(data_uuid, JSON.stringify(obj), function(err, reply) {
if (err) {
return err;
}
return reply;
});
}
function dateEntry(obj) {
var today = new Date();
if (!(obj.date && obj.date.created)) {
obj.date = {
'created': today.toUTCString(),
'modified': today.toUTCString()
};
}
return obj;
}
function insertToDb(res) {
multi.exec(function(err, replies) {
if (err) {
console.log(err);
res.status(500).send(err);
return;
}
//console.log(JSON.stringify(replies));
if (replies) {
res.send(replies);
}
});
}
if (enforceReadonly(res)) {
return;
}
var ref = (req.headers && req.headers.referer) || false;
//No POST request allowed from other sources
//TODO probably need to fix this for prod docker
if (ref) {
var u = url.parse(ref);
var hostname = u && u.hostname;
var environment = env.toLowerCase();
if (hasPostAccess(hostname, environment)) {
var okResult = [];
var multi = db.multi();
var data = req.body;
if (Array.isArray(data)) {
data.forEach(function(item, index) {
entry(item);
insertToDb(res);
});
} else {
getAllFromDb(function(err, results) {
var similarItems = getSimilarItems(results, getSha(data, similarFilter));
var query = req.query.confirm || "no";
if (similarItems.length > 0 && (query.toLowerCase() === "no")) {
res.send(similarItems);
} else {
entry(data);
insertToDb(res);
}
});
}
} else {
res.status(403).send('Invalid Origin');
}
} else {
res.status(403).send('Invalid Origin');
}
};
function hasPostAccess(currDomain, currEnv){
var allowedDomains= ["kaha.co", "demokaha.herokuapp.com"];
var allowedEnvs = ["dev", "stage"];
return checkDomain(allowedDomains, currDomain) || checkEnvs(allowedEnvs, currEnv);
}
/**
* Description: Checks if it's the right domains
*
* @method checkDomain
* @param {Array}, {String}
* @return {Boolean}
*/
function checkDomain(allowedDomains, currDomain){
//check sub-domains and prefixes like `www` too
return allowedDomains.some(function(domain){
return ~currDomain.indexOf(domain);
});
}
/**
* Description: Checks the right environment
* for right access
* @method checkEnvs
* @param {Array}, {String}
* @return {Boolean}
*/
function checkEnvs(allowedEnvs, currEnv){
return ~allowedEnvs.indexOf(currEnv);
}
| mit |
t1732/kamome | lib/kamome/railtie.rb | 459 | module Kamome
class Railtie < Rails::Railtie
initializer "kamome.on_load_active_record" do
ActiveSupport.on_load(:active_record) do
include Kamome::Model
end
end
initializer "kamome.configure" do
Kamome.configure do |config|
config.config_path = Rails.root.join("config/kamome.yml")
end
end
rake_tasks do
Dir[File.join(__dir__, "../tasks/**/*.rake")].each { |f| load f }
end
end
end
| mit |
mgr32/PsISEProjectExplorer | PsISEProjectExplorer/Commands/OpenItemCommand.cs | 3259 | using PsISEProjectExplorer.Enums;
using PsISEProjectExplorer.Model;
using PsISEProjectExplorer.Model.DocHierarchy.Nodes;
using PsISEProjectExplorer.Services;
using PsISEProjectExplorer.UI.IseIntegration;
using PsISEProjectExplorer.UI.ViewModel;
using System;
namespace PsISEProjectExplorer.Commands
{
[Component]
public class OpenItemCommand : Command
{
private readonly TreeViewModel treeViewModel;
private readonly MainViewModel mainViewModel;
private readonly IseIntegrator iseIntegrator;
private readonly TokenLocator tokenLocator;
public OpenItemCommand(TreeViewModel treeViewModel, MainViewModel mainViewModel, IseIntegrator iseIntegrator, TokenLocator tokenLocator)
{
this.treeViewModel = treeViewModel;
this.mainViewModel = mainViewModel;
this.iseIntegrator = iseIntegrator;
this.tokenLocator = tokenLocator;
}
public void Execute()
{
var item = this.treeViewModel.SelectedItem;
var searchOptions = this.mainViewModel.SearchOptions;
if (item == null)
{
return;
}
if (item.Node.NodeType == NodeType.File)
{
bool wasOpen = (this.iseIntegrator.SelectedFilePath == item.Node.Path);
if (!wasOpen)
{
this.iseIntegrator.GoToFile(item.Node.Path);
}
else
{
this.iseIntegrator.SetFocusOnCurrentTab();
}
if (searchOptions.SearchText != null && searchOptions.SearchText.Length > 2)
{
EditorInfo editorInfo = (wasOpen ? this.iseIntegrator.GetCurrentLineWithColumnIndex() : null);
TokenPosition tokenPos = this.tokenLocator.LocateNextToken(item.Node.Path, searchOptions, editorInfo);
if (tokenPos.MatchLength > 2)
{
this.iseIntegrator.SelectText(tokenPos.Line, tokenPos.Column, tokenPos.MatchLength);
}
else if (string.IsNullOrEmpty(this.iseIntegrator.SelectedText))
{
tokenPos = this.tokenLocator.LocateSubtoken(item.Node.Path, searchOptions);
if (tokenPos.MatchLength > 2)
{
this.iseIntegrator.SelectText(tokenPos.Line, tokenPos.Column, tokenPos.MatchLength);
}
}
}
}
else if (item.Node.NodeType == NodeType.Directory)
{
item.IsExpanded = !item.IsExpanded;
}
else if (item.Node.NodeType != NodeType.Intermediate)
{
var node = ((PowershellItemNode)item.Node);
this.iseIntegrator.GoToFile(node.FilePath);
this.iseIntegrator.SelectText(node.PowershellItem.StartLine, node.PowershellItem.StartColumn, node.PowershellItem.EndColumn - node.PowershellItem.StartColumn);
}
}
}
}
| mit |
ch3nkula/IMS_Soft400 | app/models/RegisterUser.php | 739 | <?php
/*==========================================================*/
//This is a model to finally register a user into the database
//by creating he or she account on the platform
use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
class RegisterUser extends Eloquent {
protected $guarded = array();
protected $table = 'created_users'; // table name
public $timestamps = 'true' ; // to disable default timestamp fields
// model function to store form data to database
public static function saveUserData($data)
{
DB::table('created_users')->insert($data);
}
} | mit |
jeffreylees/docs | articles/protocols/saml/idp-initiated-sso.md | 6249 | ---
title: IdP-Initiated Single Sign-On
description: How to setup SAML Identity Provider-initiated Single Sign-on (SSO).
topics:
- saml
- sso
contentType:
- how-to
- concept
useCase:
- add-idp
---
# IdP-Initiated Single Sign-On
Many instructions for setting up a <dfn data-key="security-assertion-markup-language">SAML</dfn> federation begin with <dfn data-key="single-sign-on">Single Sign-on (SSO)</dfn> initiated by the service provider. The service provider redirects the user to the identity provider for the purposes of authentication. This process is commonly used for consumer-facing scenarios.
However, in enterprise scenarios, it is sometimes common to begin with the identity provider initiating SSO, not the service provider. For example, an enterprise company might set up a portal to ensure that users navigate to the correct application after they sign on to the portal.
## Risks of using an IdP-Initiated SSO flow
::: warning
IdP-Initiated flows carry a security risk and are therefore <strong>NOT</strong> recommended. Make sure you understand the risks before enabling IdP-Initiated SSO.
:::
In an IdP-initiated flow neither Auth0 (which receives the unsolicited response from the Identity Provider) nor the application (that receives the unsolicited response generated by Auth0) can verify that the user actually started the flow. Because of this, enabling this flow opens the possibility of an [Login CSRF attack](https://support.detectify.com/support/solutions/articles/48001048951-login-csrf), where an attacker can trick a legitimate user into unknowingly logging into the application with the identity of the attacker.
The recommendation is to use SP-Initiated flows whenever possible.
### On IdP-Initiated flows and OpenID Connect
<dfn data-key="openid">OpenID Connect (OIDC)</dfn> does not support the concept of an IdP-Initiated flow. So while Auth0 offers the possibility of translating a SAML IdP-Initiated flow (from a SAML connection) into an OIDC response for an application, any application that properly implements the OIDC/OAuth2 protocol will reject an unrequested response.
When using OIDC applications, the best option is to have the users start the login flow **at the application** or configure the portals to send the user to the application's login initiation endpoint (without an IdP-Initiated SAML response) so that, again, the application starts the authentication flow.
## How to set up IDP-initiated SSO
<iframe width="560" height="315" src="https://www.youtube.com/embed/hZGYWeBvZQ8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
To setup IdP-Initiated SSO, go to the [Enterprise Connections](${manage_url}/#/connections/enterprise) section of the dashboard and choose **SAMLP Identity Provider**. Under the **Settings** section you can see the configuration for IdP-Initiated SSO.

**Default Application:** When the IdP initiated login succeeds this is the application where users are routed. This setting shows available applications enabled for this connection. Select the application from the dropdown that you want the users to login with IdP initiated. Only one application can be selected for an IdP-initiated login per SAML connection.
**Response Protocol:** This is the protocol used to connect your selected **Default Application**. Most commonly applications are configured with the OpenID Connect protocol (read [here](#on-idp-initiated-flows-and-OIDC) for possible pitfalls). However if you have configured a SAML2 Web App addon for your application and want to route the SAML assertion you will need to select SAML.
**Query String:** Query string options help to customise the behavior when the OpenID Connect protocol is used. You can set multiple options similar to setting parameters with a [query string](https://en.wikipedia.org/wiki/Query_string). You can set:
* `redirect_uri`: When the IdP-initiated login has completed the request is then redirected to the first URL listed in the **Allowed <dfn data-key="callback">Callback URLs</dfn>** for the application. However if you set a `redirect_uri` the IdP will redirect to this URL. This brings flexibility for cases like when you have set subdomain scheme with a wildcard and you only want to redirect to one specific subdomain.
* `scope`: You could define <dfn data-key="scope">scopes</dfn> for the ID Token sent. Note that it is possible to set multiple scopes.
* `response_type`: This field is used to set the token for Implicit Grant Flow for SPA applications. You could set code for Authorization Code Grant Flow for regular web applications.
Example Query String:
`redirect_uri=https://jwt.io&scope=openid email&response_type=token`
## Post-back URL
When using **IdP-Initiated SSO**, please make sure to include the `connection` parameter in the post-back URL: `https://${account.namespace}/login/callback?connection=YOUR_CONNECTION_NAME`
## Lock/Auth0.js
If your application is a Single-Page Application that uses <dfn data-key="lock">Lock</dfn> or Auth0.js to process the authentication results, you will have to explicitly indicate that you want to allow IdP-Initiated flows (and thus [open the application to possible Login CSRF attacks](#risks-of-using-an-idp-Initiated-SSO-flow)).
If you are using [Auth0.js](/libraries/auth0js), you have to update the **webAuth.parseHash** of the [library](/libraries/auth0js/v9#extract-the-authresult-and-get-user-info) and set the flag **__enableIdPInitiatedLogin** to `true`.
```javascript
var data = webAuth.parseHash(
{
...
__enableIdPInitiatedLogin: true
...
}
```
If you're using [Lock](/lock), you can include the flag using the options parameter sent to the constructor.
```javascript
const lock = new Auth0Lock(clientID, domain, options)
```
Here's the flag itself:
```javascript
var options = {
_enableIdPInitiatedLogin: true
};
```
Note that the **enableIdPInitiatedLogin** flag is preceded by **one** underscore when used with Lock and **two** underscores when used with the auth0.js library.
| mit |
dank-meme-dealership/foosey | frontend/www/js/keylistener/keylistener.directive.js | 1086 | (function () {
angular
.module('keylistener')
.directive('keylistener', keylistener);
function keylistener($document, $rootScope, $ionicPopup) {
var directive = {
restrict: 'A',
link: link
};
return directive;
function link() {
var captured = [];
$document.bind('keydown', function (e) {
$rootScope.$broadcast('keydown', e);
$rootScope.$broadcast('keydown:' + e.which, e);
// check nerd
captured.push(e.which)
if (arrayEndsWith(captured, [38, 38, 40, 40, 37, 39, 37, 39, 66, 65])) nerd();
});
}
function arrayEndsWith(a, b) {
a = a.slice(a.length - b.length, a.length);
if (a.length !== b.length) return;
for (var i = 0; i < a.length; ++i) {
if (a[i] !== b[i]) return false;
}
return true;
}
function nerd() {
captured = [];
document.getElementsByTagName('body')[0].className += ' nerd';
$ionicPopup.alert({title: 'You\'re a nerd 🤓', buttons: [{text: 'I know', type: 'button-positive'}]});
}
}
})();
| mit |
asi1024/ContestLibrary | cpp/tests/aoj-DSL_2_B.cpp | 295 | #include "../include/structure/fenwick_tree.cpp"
int main() {
int n, q, com, x, y;
scanf("%d%d", &n, &q);
FenwickTree<int> bit(n + 1);
while (q--) {
scanf("%d%d%d", &com, &x, &y);
if (com)
printf("%d\n", bit.sum(x, y + 1));
else
bit.add(x, y);
}
return 0;
}
| mit |
swastik/en-select | tests/unit/helpers/highlight-test.js | 1823 | import { highlight } from "../../../helpers/highlight"
import { module, test } from "qunit"
module("Unit | Helper | highlight")
test("it works", function(assert) {
let result
result = highlight([], {
phrase: "Something",
part: "Some"
})
assert.equal(
result,
'<mark class="en-select-option-highlight">Some</mark>thing'
)
result = highlight([], {
phrase: "No match",
part: "Some"
})
assert.equal(result, "No match")
result = highlight([], {
phrase: "John Doe",
part: "John D"
})
assert.equal(
result,
'<mark class="en-select-option-highlight">John</mark> <mark class="en-select-option-highlight">D</mark>oe'
)
result = highlight([], {
phrase: "John Doe",
part: "John Doe"
})
assert.equal(
result,
'<mark class="en-select-option-highlight">John</mark> <mark class="en-select-option-highlight">Doe</mark>'
)
result = highlight([], {
phrase: "John Doe",
part: "John Doe"
})
assert.equal(
result,
'<mark class="en-select-option-highlight">John</mark> <mark class="en-select-option-highlight">Doe</mark>'
)
result = highlight([], {
phrase: "John Doe",
part: "John Doe"
})
assert.equal(
result,
'<mark class="en-select-option-highlight">John</mark> <mark class="en-select-option-highlight">Doe</mark>'
)
result = highlight([], {
phrase: "In a world far away",
part: "a"
})
assert.equal(
result,
'In <mark class="en-select-option-highlight">a</mark> world f<mark class="en-select-option-highlight">a</mark>r <mark class="en-select-option-highlight">a</mark>w<mark class="en-select-option-highlight">a</mark>y'
)
result = highlight([], {
phrase: "In a world far away",
part: ""
})
assert.equal(
result,
'In a world far away'
)
})
| mit |
louismerlin/trackodoro | populate.rb | 594 | u1 = User.new(:email => '[email protected]', :first_name => 'Louis', :last_name => 'Merlin')
u1.password = "louis"
u1.password_confirmation = "louis"
u1.save
u2 = User.new(:email => '[email protected]', :first_name => 'Patrick', :last_name => 'Aebischer')
u2.password = "patrick"
u2.password_confirmation = "patrick"
u2.save
p1 = Pomodoro.new(:h => Time.now())
p1.save
u1.add_pomodoro(p1)
t1 = Tag.new(:title => "Code")
t2 = Tag.new(title: "Analyse")
t1.save
t2.save
u1.add_tag(t1)
u1.add_tag(t2)
p1.add_tag(t1)
#puts User[:id => 1].email
#puts p1.user
#p1.user = User[:id => 1]
| mit |
juniwang/open-hackathon | open-hackathon-server/src/tests/conftest.py | 1534 | import pytest
from hackathon.constants import VE_PROVIDER, TEMPLATE_STATUS
from hackathon.hmongo.models import User, Template, UserHackathon
from hackathon.hmongo.database import add_super_user
@pytest.fixture(scope="class")
def user1():
# return new user named one
one = User(
name="test_one",
nickname="test_one",
avatar_url="/static/pic/monkey-32-32px.png",
is_super=False)
one.set_password("test_password")
one.save()
return one
@pytest.fixture(scope="class")
def user2():
# return new user named two
two = User(
name="test_two",
nickname="test_two",
avatar_url="/static/pic/monkey-32-32px.png",
is_super=False)
two.set_password("test_password")
two.save()
return two
@pytest.fixture(scope="class")
def admin1():
# return new admin named one
admin_one = User(
name="admin_one",
nickname="admin_one",
avatar_url="/static/pic/monkey-32-32px.png",
is_super=True)
admin_one.set_password("test_password")
admin_one.save()
return admin_one
@pytest.fixture(scope="class")
def default_template(user1):
tmpl = Template(
name="test_default_template",
provider=VE_PROVIDER.DOCKER,
status=TEMPLATE_STATUS.UNCHECKED,
description="old_desc",
content="",
template_args={},
docker_image="ubuntu",
network_configs=[],
virtual_environment_count=0,
creator=user1,
)
tmpl.save()
return tmpl | mit |
tullyhansen/botwiki.org | content/bots/twitterbots/minetweeter_.md | 623 | /*
Title: @minetweeter_
Description: Play MineSweeper on Twitter.
Author: Stefan Bohacek
Date: August 4, 2015
Tags: twitter,twitterbot,active,game,opensource,open source,node.js,nodejs,node,louroboros
Nav: hidden
Robots: index,follow
*/
[](https://twitter.com/minetweeter_)
[@minetweeter_](https://twitter.com/minetweeter_) is an implementation of the [Minesweeper](https://en.wikipedia.org/wiki/Minesweeper_(video_game)) game. It was created by [Lou Acresti](https://twitter.com/louroboros) and the source code is on [GitHub](https://github.com/namuol/minetweeter). | mit |
cosnicsTHLU/cosnics | src/Chamilo/Application/Weblcms/Tool/Action/Component/IntroductionPublisherComponent.php | 3460 | <?php
namespace Chamilo\Application\Weblcms\Tool\Action\Component;
use Chamilo\Application\Weblcms\Rights\WeblcmsRights;
use Chamilo\Application\Weblcms\Storage\DataClass\ContentObjectPublication;
use Chamilo\Application\Weblcms\Tool\Action\Manager;
use Chamilo\Core\Repository\ContentObject\Introduction\Storage\DataClass\Introduction;
use Chamilo\Libraries\Architecture\Application\ApplicationConfiguration;
use Chamilo\Libraries\Architecture\Application\ApplicationFactory;
use Chamilo\Libraries\Architecture\Exceptions\NotAllowedException;
use Chamilo\Libraries\Architecture\Interfaces\DelegateComponent;
use Chamilo\Libraries\Platform\Session\Session;
use Chamilo\Libraries\Platform\Translation;
use Chamilo\Libraries\Utilities\Utilities;
/**
* $Id: introduction_publisher.class.php 216 2009-11-13 14:08:06Z kariboe $
*
* @package application.lib.weblcms.tool.component
*/
class IntroductionPublisherComponent extends Manager implements \Chamilo\Core\Repository\Viewer\ViewerInterface,
DelegateComponent
{
public function run()
{
if (! $this->is_allowed(WeblcmsRights::ADD_RIGHT))
{
throw new NotAllowedException();
}
if (! \Chamilo\Core\Repository\Viewer\Manager::is_ready_to_be_published())
{
$applicationConfiguration = new ApplicationConfiguration($this->getRequest(), $this->get_user(), $this);
$applicationConfiguration->set(\Chamilo\Core\Repository\Viewer\Manager::SETTING_TABS_DISABLED, true);
$factory = new ApplicationFactory(
\Chamilo\Core\Repository\Viewer\Manager::context(),
$applicationConfiguration);
$component = $factory->getComponent();
$component->set_maximum_select(\Chamilo\Core\Repository\Viewer\Manager::SELECT_SINGLE);
$component->set_parameter(
\Chamilo\Application\Weblcms\Tool\Manager::PARAM_ACTION,
\Chamilo\Application\Weblcms\Tool\Manager::ACTION_PUBLISH_INTRODUCTION);
return $component->run();
}
else
{
$pub = new ContentObjectPublication();
$pub->set_content_object_id(\Chamilo\Core\Repository\Viewer\Manager::get_selected_objects());
$pub->set_course_id($this->get_course_id());
$pub->set_tool($this->get_tool_id());
$pub->set_category_id(0);
$pub->set_from_date(0);
$pub->set_to_date(0);
$pub->set_publisher_id(Session::get_user_id());
$pub->set_publication_date(time());
$pub->set_modified_date(time());
$pub->set_hidden(0);
$pub->set_email_sent(0);
$pub->set_show_on_homepage(0);
$pub->set_allow_collaboration(1);
$pub->ignore_display_order();
$pub->create();
$parameters = $this->get_parameters();
$parameters['tool_action'] = null;
$this->redirect(
Translation::get(
'ObjectPublished',
array('OBJECT' => Translation::get('Introduction')),
Utilities::COMMON_LIBRARIES),
(false),
$parameters);
}
}
public function get_allowed_content_object_types()
{
return array(Introduction::class_name());
}
}
| mit |
selvasingh/azure-sdk-for-java | sdk/logic/mgmt-v2018_07_01_preview/src/main/java/com/microsoft/azure/management/logic/v2018_07_01_preview/WorkflowState.java | 1797 | /**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.logic.v2018_07_01_preview;
import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;
/**
* Defines values for WorkflowState.
*/
public final class WorkflowState extends ExpandableStringEnum<WorkflowState> {
/** Static value NotSpecified for WorkflowState. */
public static final WorkflowState NOT_SPECIFIED = fromString("NotSpecified");
/** Static value Completed for WorkflowState. */
public static final WorkflowState COMPLETED = fromString("Completed");
/** Static value Enabled for WorkflowState. */
public static final WorkflowState ENABLED = fromString("Enabled");
/** Static value Disabled for WorkflowState. */
public static final WorkflowState DISABLED = fromString("Disabled");
/** Static value Deleted for WorkflowState. */
public static final WorkflowState DELETED = fromString("Deleted");
/** Static value Suspended for WorkflowState. */
public static final WorkflowState SUSPENDED = fromString("Suspended");
/**
* Creates or finds a WorkflowState from its string representation.
* @param name a name to look for
* @return the corresponding WorkflowState
*/
@JsonCreator
public static WorkflowState fromString(String name) {
return fromString(name, WorkflowState.class);
}
/**
* @return known WorkflowState values
*/
public static Collection<WorkflowState> values() {
return values(WorkflowState.class);
}
}
| mit |
SkillsFundingAgency/das-alpha-ui | public/javascripts/custom.js | 7807 | var EventUtil = {
addHandler: function(element, type, handler){
if (element.addEventListener){
element.addEventListener(type, handler, false);
} else if (element.attachEvent){
element.attachEvent("on" + type, handler);
} else {
element["on" + type] = handler;
}
},
getButton: function(event){
if (document.implementation.hasFeature("MouseEvents", "2.0")){
return event.button;
} else {
switch(event.button){
case 0:
case 1:
case 3:
case 5:
case 7:
return 0;
case 2:
case 6:
return 2;
case 4: return 1;
}
}
},
getCharCode: function(event){
if (typeof event.charCode == "number"){
return event.charCode;
} else {
return event.keyCode;
}
},
getClipboardText: function(event){
var clipboardData = (event.clipboardData || window.clipboardData);
return clipboardData.getData("text");
},
getEvent: function(event){
return event ? event : window.event;
},
getRelatedTarget: function(event){
if (event.relatedTarget){
return event.relatedTarget;
} else if (event.toElement){
return event.toElement;
} else if (event.fromElement){
return event.fromElement;
} else {
return null;
}
},
getTarget: function(event){
if (event.target){
return event.target;
} else {
return event.srcElement;
}
},
getWheelDelta: function(event){
if (event.wheelDelta){
return (client.opera && client.opera < 9.5 ? -event.wheelDelta : event.wheelDelta);
} else {
return -event.detail * 40;
}
},
preventDefault: function(event){
if (event.preventDefault){
event.preventDefault();
} else {
event.returnValue = false;
}
},
removeHandler: function(element, type, handler){
if (element.removeEventListener){
element.removeEventListener(type, handler, false);
} else if (element.detachEvent){
element.detachEvent("on" + type, handler);
} else {
element["on" + type] = null;
}
},
setClipboardText: function(event, value){
if (event.clipboardData){
event.clipboardData.setData("text/plain", value);
} else if (window.clipboardData){
window.clipboardData.setData("text", value);
}
},
stopPropagation: function(event){
if (event.stopPropagation){
event.stopPropagation();
} else {
event.cancelBubble = true;
}
}
};
//back button
function goBack() {
window.history.back();
}
// yes, this does what you think it does!
$( document ).ready(function() {
window.setInterval(function(){
$('.blink').toggle();
}, 550);
});
// this sets the default sprint number if its not changed on the admin page.
var defaultSprint = function() {
var sprintNow = JSON.parse(localStorage.getItem('sprint-number'));
console.log(sprintNow);
if (sprintNow == null) {
sprintNow = "programmeTen";
localStorage.setItem("sprint-number", JSON.stringify(sprintNow));
} else {
}
};
defaultSprint();
// This removes the breadcrumbs from sprint 10 (the navigation version). The breadcrumb on earlier versions is broken
var breadyCrumb = function() {
var whatSprint = JSON.parse(localStorage.getItem('sprint-number'));
console.log('what sprint is ' + whatSprint);
if (whatSprint == "sprint10") {
$('<style>.breadcrumbs ol li a { display:none;}</style>').appendTo('head');
} else {}
};
breadyCrumb();
// This sets a default company name if its not been set on the proto admin page
var CompanyName = function() {
var compName = JSON.parse(localStorage.getItem('company-name-header'));
console.log(compName);
if (compName == null) {
compName = "Acme Ltd";
localStorage.setItem("company-name-header", JSON.stringify(compName));
} else {
}
};
CompanyName();
/* To determine if the to do list has been done - only dates works for now - this breaks because of the URl change below if it is in the page...it should live in /sprint11/contracts/new-contract/provider-interface/add-apprenticeship */
//$( document ).ready(function() {
//var addedOrNor = function() {
// var hasDatesAdded = JSON.parse(localStorage.getItem('apprenticeship-dates-added'));
// console.log(hasDatesAdded)
// if (hasDatesAdded == "yes") {
// $( ".datesComplete" ).removeClass( "rj-dont-display" );
// $( ".datesToDo" ).addClass( "rj-dont-display" );
// var hasDatesAdded = 'no';
// localStorage.setItem("apprenticeship-dates-added", JSON.stringify(hasDatesAdded));
// } else {
// $( ".datesComplete" ).addClass( "rj-dont-display" );
// }
//};
//addedOrNor();
//});
/* To determine if an apprenticeship has been added to the contract - this breaks because of the URl change below if it is in the page...it should live in /sprint11/contracts/new-contract/provider-interface/individual-contract */
// This has moved to javascripts/das/commitment-1.0.js
// $( document ).ready(function() {
// var whereNow = function() {
// var hasAppAdded = JSON.parse(localStorage.getItem('apprenticeship-added'));
//
// if (hasAppAdded == "yes") {
// $( "#no-apprenticeships" ).addClass( "rj-dont-display" );
// var isAddedApp = 'no';
// localStorage.setItem("apprenticeship-added", JSON.stringify(isAddedApp));
//
//
// } else {
// $( "#apprenticeships" ).addClass( "rj-dont-display" );
//
// }
// };
// whereNow();
//
// });
//
// $( document ).ready(function() {
// var bulkUpload = function() {
// var hasBulkUpload = JSON.parse(localStorage.getItem('apprenticeship-added.bulk-upload'));
// if (hasBulkUpload == "yes") {
// $( "#no-apprenticeships" ).addClass( "rj-dont-display" );
// $( "#no-apprenticeships" ).addClass( "rj-dont-display" );
// $( "#apprenticeships-bulk" ).removeClass( "rj-dont-display" );
// var hasBulkUpload = 'no';
// localStorage.setItem("apprenticeship-added.bulk-upload", JSON.stringify(hasBulkUpload));
// } else {
// $( "#apprenticeships-bulk" ).addClass( "rj-dont-display" );
//
// }
// };
// bulkUpload();
//
// });
/* To determine whether the commitments in progress page should show the confirmation or not (i.e. have you just completed something) - this breaks because of the URl change below if it is in the page...it should live in /contracts/provider-in-progress? */
$( document ).ready(function() {
var showDoneAlert = function() {
var isAlertShowing = JSON.parse(localStorage.getItem('commitments.providerAlert'));
if (isAlertShowing == "yes") {
$( "#showDoneAlert" ).removeClass( "rj-dont-display" );
var isAlertShowing = 'no';
localStorage.setItem("commitments.providerAlert", JSON.stringify(isAlertShowing));
} else {
// $( "#showDoneAlert" ).addClass( "rj-dont-display" );
}
};
showDoneAlert();
});
//This swaps out the URL to the sprint chosen in the admin tool. The phrase it is searching for and replacing is in includes/sprint-link.html
// Want this to run last as it was breaking other things...
$(document).ready(function() {
var urlToBeChanged = JSON.parse(localStorage.getItem('sprint-number'));
$("body").html($("body").html().replace(/change-me-url/g, urlToBeChanged));
});
| mit |
AlexanderStanev/SoftUni | TechModule/DataTypesVariablesExercises/07. Exchange Variable Values/Program.cs | 501 | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _7.Exchange_Variable_Values
{
class Program
{
static void Main(string[] args)
{
int a = 5;
int b = 10;
Console.WriteLine("Before:\na = " + a + "\nb = " + b);
int c = a;
a = b;
b = c;
Console.WriteLine("After:\na = " + a + "\nb = " + b);
}
}
}
| mit |
tedyhy/SCI | kissy-1.4.9/docs/source/insertion.html | 12233 | <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
<style type="text/css">
.highlight { display: block; background-color: #ddd; }
</style>
<script type="text/javascript">
function highlight() {
document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
}
</script>
</head>
<body onload="prettyPrint(); highlight();">
<pre class="prettyprint lang-js"><span id='global-property-'>/**
</span> * @ignore
* dom-insertion
* @author [email protected], [email protected]
*/
KISSY.add('dom/base/insertion', function (S, Dom) {
var PARENT_NODE = 'parentNode',
NodeType = Dom.NodeType,
RE_FORM_EL = /^(?:button|input|object|select|textarea)$/i,
getNodeName = Dom.nodeName,
makeArray = S.makeArray,
splice = [].splice,
NEXT_SIBLING = 'nextSibling',
R_SCRIPT_TYPE = /\/(java|ecma)script/i;
function isJs(el) {
return !el.type || R_SCRIPT_TYPE.test(el.type);
}
// extract script nodes and execute alone later
function filterScripts(nodes, scripts) {
var ret = [], i, el, nodeName;
for (i = 0; nodes[i]; i++) {
el = nodes[i];
nodeName = getNodeName(el);
if (el.nodeType == NodeType.DOCUMENT_FRAGMENT_NODE) {
ret.push.apply(ret, filterScripts(makeArray(el.childNodes), scripts));
} else if (nodeName === 'script' && isJs(el)) {
// remove script to make sure ie9 does not invoke when append
if (el.parentNode) {
el.parentNode.removeChild(el)
}
if (scripts) {
scripts.push(el);
}
} else {
if (el.nodeType == NodeType.ELEMENT_NODE &&
// ie checkbox getElementsByTagName 后造成 checked 丢失
!RE_FORM_EL.test(nodeName)) {
var tmp = [],
s,
j,
ss = el.getElementsByTagName('script');
for (j = 0; j < ss.length; j++) {
s = ss[j];
if (isJs(s)) {
tmp.push(s);
}
}
splice.apply(nodes, [i + 1, 0].concat(tmp));
}
ret.push(el);
}
}
return ret;
}
// execute script
function evalScript(el) {
if (el.src) {
S.getScript(el.src);
} else {
var code = S.trim(el.text || el.textContent || el.innerHTML || '');
if (code) {
S.globalEval(code);
}
}
}
// fragment is easier than nodelist
function insertion(newNodes, refNodes, fn, scripts) {
newNodes = Dom.query(newNodes);
if (scripts) {
scripts = [];
}
// filter script nodes ,process script separately if needed
newNodes = filterScripts(newNodes, scripts);
// Resets defaultChecked for any radios and checkboxes
// about to be appended to the Dom in IE 6/7
if (Dom._fixInsertionChecked) {
Dom._fixInsertionChecked(newNodes);
}
refNodes = Dom.query(refNodes);
var newNodesLength = newNodes.length,
newNode,
i,
refNode,
node,
clonedNode,
refNodesLength = refNodes.length;
if ((!newNodesLength && (!scripts || !scripts.length)) || !refNodesLength) {
return;
}
// fragment 插入速度快点
// 而且能够一个操作达到批量插入
// refer: http://www.w3.org/TR/REC-Dom-Level-1/level-one-core.html#ID-B63ED1A3
newNode = Dom._nodeListToFragment(newNodes);
//fragment 一旦插入里面就空了,先复制下
if (refNodesLength > 1) {
clonedNode = Dom.clone(newNode, true);
refNodes = S.makeArray(refNodes)
}
for (i = 0; i < refNodesLength; i++) {
refNode = refNodes[i];
if (newNode) {
//refNodes 超过一个,clone
node = i > 0 ? Dom.clone(clonedNode, true) : newNode;
fn(node, refNode);
}
if (scripts && scripts.length) {
S.each(scripts, evalScript);
}
}
}
// loadScripts default to false to prevent xss
S.mix(Dom,
<span id=''> /**
</span> * @override KISSY.DOM
* @class
* @singleton
*/
{
<span id='KISSY-DOM-property-_fixInsertionChecked'> _fixInsertionChecked: null,
</span>
<span id='KISSY-DOM-method-insertBefore'> /**
</span> * Insert every element in the set of newNodes before every element in the set of refNodes.
* @param {HTMLElement|HTMLElement[]} newNodes Nodes to be inserted
* @param {HTMLElement|HTMLElement[]|String} refNodes Nodes to be referred
* @param {Boolean} [loadScripts] whether execute script node
*/
insertBefore: function (newNodes, refNodes, loadScripts) {
insertion(newNodes, refNodes, function (newNode, refNode) {
if (refNode[PARENT_NODE]) {
refNode[PARENT_NODE].insertBefore(newNode, refNode);
}
}, loadScripts);
},
<span id='KISSY-DOM-method-insertAfter'> /**
</span> * Insert every element in the set of newNodes after every element in the set of refNodes.
* @param {HTMLElement|HTMLElement[]} newNodes Nodes to be inserted
* @param {HTMLElement|HTMLElement[]|String} refNodes Nodes to be referred
* @param {Boolean} [loadScripts] whether execute script node
*/
insertAfter: function (newNodes, refNodes, loadScripts) {
insertion(newNodes, refNodes, function (newNode, refNode) {
if (refNode[PARENT_NODE]) {
refNode[PARENT_NODE].insertBefore(newNode, refNode[NEXT_SIBLING]);
}
}, loadScripts);
},
<span id='KISSY-DOM-method-appendTo'> /**
</span> * Insert every element in the set of newNodes to the end of every element in the set of parents.
* @param {HTMLElement|HTMLElement[]} newNodes Nodes to be inserted
* @param {HTMLElement|HTMLElement[]|String} parents Nodes to be referred as parentNode
* @param {Boolean} [loadScripts] whether execute script node
*/
appendTo: function (newNodes, parents, loadScripts) {
insertion(newNodes, parents, function (newNode, parent) {
parent.appendChild(newNode);
}, loadScripts);
},
<span id='KISSY-DOM-method-prependTo'> /**
</span> * Insert every element in the set of newNodes to the beginning of every element in the set of parents.
* @param {HTMLElement|HTMLElement[]} newNodes Nodes to be inserted
* @param {HTMLElement|HTMLElement[]|String} parents Nodes to be referred as parentNode
* @param {Boolean} [loadScripts] whether execute script node
*/
prependTo: function (newNodes, parents, loadScripts) {
insertion(newNodes, parents, function (newNode, parent) {
parent.insertBefore(newNode, parent.firstChild);
}, loadScripts);
},
<span id='KISSY-DOM-method-wrapAll'> /**
</span> * Wrap a node around all elements in the set of matched elements
* @param {HTMLElement|HTMLElement[]|String} wrappedNodes set of matched elements
* @param {HTMLElement|String} wrapperNode html node or selector to get the node wrapper
*/
wrapAll: function (wrappedNodes, wrapperNode) {
// deep clone
wrapperNode = Dom.clone(Dom.get(wrapperNode), true);
wrappedNodes = Dom.query(wrappedNodes);
if (wrappedNodes[0].parentNode) {
Dom.insertBefore(wrapperNode, wrappedNodes[0]);
}
var c;
while ((c = wrapperNode.firstChild) && c.nodeType == 1) {
wrapperNode = c;
}
Dom.appendTo(wrappedNodes, wrapperNode);
},
<span id='KISSY-DOM-method-wrap'> /**
</span> * Wrap a node around each element in the set of matched elements
* @param {HTMLElement|HTMLElement[]|String} wrappedNodes set of matched elements
* @param {HTMLElement|String} wrapperNode html node or selector to get the node wrapper
*/
wrap: function (wrappedNodes, wrapperNode) {
wrappedNodes = Dom.query(wrappedNodes);
wrapperNode = Dom.get(wrapperNode);
S.each(wrappedNodes, function (w) {
Dom.wrapAll(w, wrapperNode);
});
},
<span id='KISSY-DOM-method-wrapInner'> /**
</span> * Wrap a node around the childNodes of each element in the set of matched elements.
* @param {HTMLElement|HTMLElement[]|String} wrappedNodes set of matched elements
* @param {HTMLElement|String} wrapperNode html node or selector to get the node wrapper
*/
wrapInner: function (wrappedNodes, wrapperNode) {
wrappedNodes = Dom.query(wrappedNodes);
wrapperNode = Dom.get(wrapperNode);
S.each(wrappedNodes, function (w) {
var contents = w.childNodes;
if (contents.length) {
Dom.wrapAll(contents, wrapperNode);
} else {
w.appendChild(wrapperNode);
}
});
},
<span id='KISSY-DOM-method-unwrap'> /**
</span> * Remove the parents of the set of matched elements from the Dom,
* leaving the matched elements in their place.
* @param {HTMLElement|HTMLElement[]|String} wrappedNodes set of matched elements
*/
unwrap: function (wrappedNodes) {
wrappedNodes = Dom.query(wrappedNodes);
S.each(wrappedNodes, function (w) {
var p = w.parentNode;
Dom.replaceWith(p, p.childNodes);
});
},
<span id='KISSY-DOM-method-replaceWith'> /**
</span> * Replace each element in the set of matched elements with the provided newNodes.
* @param {HTMLElement|HTMLElement[]|String} selector set of matched elements
* @param {HTMLElement|HTMLElement[]|String} newNodes new nodes to replace the matched elements
*/
replaceWith: function (selector, newNodes) {
var nodes = Dom.query(selector);
newNodes = Dom.query(newNodes);
Dom.remove(newNodes, true);
Dom.insertBefore(newNodes, nodes);
Dom.remove(nodes);
}
});
S.each({
'prepend': 'prependTo',
'append': 'appendTo',
'before': 'insertBefore',
'after': 'insertAfter'
}, function (value, key) {
Dom[key] = Dom[value];
});
return Dom;
}, {
requires: ['./api']
});
/*
2012-04-05 [email protected]
- 增加 replaceWith/wrap/wrapAll/wrapInner/unwrap
2011-05-25
- [email protected]:参考 jquery 处理多对多的情形 :http://api.jquery.com/append/
Dom.append('.multi1','.multi2');
*/
</pre>
</body>
</html>
| mit |
scottbuettner/PactMsg | src/tests/greatest.h | 34622 | /*
* Copyright (c) 2011-2014 Scott Vokes <[email protected]>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef GREATEST_H
#define GREATEST_H
#define GREATEST_VERSION_MAJOR 0
#define GREATEST_VERSION_MINOR 10
#define GREATEST_VERSION_PATCH 1
/* A unit testing system for C, contained in 1 file.
* It doesn't use dynamic allocation or depend on anything
* beyond ANSI C89. */
/*********************************************************************
* Minimal test runner template
*********************************************************************/
#if 0
#include "greatest.h"
TEST foo_should_foo() {
PASS();
}
static void setup_cb(void *data) {
printf("setup callback for each test case\n");
}
static void teardown_cb(void *data) {
printf("teardown callback for each test case\n");
}
SUITE(suite) {
/* Optional setup/teardown callbacks which will be run before/after
* every test case in the suite.
* Cleared when the suite finishes. */
SET_SETUP(setup_cb, voidp_to_callback_data);
SET_TEARDOWN(teardown_cb, voidp_to_callback_data);
RUN_TEST(foo_should_foo);
}
/* Add all the definitions that need to be in the test runner's main file. */
GREATEST_MAIN_DEFS();
int main(int argc, char **argv) {
GREATEST_MAIN_BEGIN(); /* command-line arguments, initialization. */
RUN_SUITE(suite);
GREATEST_MAIN_END(); /* display results */
}
#endif
/*********************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
/***********
* Options *
***********/
/* Default column width for non-verbose output. */
#ifndef GREATEST_DEFAULT_WIDTH
#define GREATEST_DEFAULT_WIDTH 72
#endif
/* FILE *, for test logging. */
#ifndef GREATEST_STDOUT
#define GREATEST_STDOUT stdout
#endif
/* Remove GREATEST_ prefix from most commonly used symbols? */
#ifndef GREATEST_USE_ABBREVS
#define GREATEST_USE_ABBREVS 1
#endif
/*********
* Types *
*********/
/* Info for the current running suite. */
typedef struct greatest_suite_info {
unsigned int tests_run;
unsigned int passed;
unsigned int failed;
unsigned int skipped;
/* timers, pre/post running suite and individual tests */
clock_t pre_suite;
clock_t post_suite;
clock_t pre_test;
clock_t post_test;
} greatest_suite_info;
/* Type for a suite function. */
typedef void (greatest_suite_cb)(void);
/* Types for setup/teardown callbacks. If non-NULL, these will be run
* and passed the pointer to their additional data. */
typedef void (greatest_setup_cb)(void *udata);
typedef void (greatest_teardown_cb)(void *udata);
/* Type for an equality comparison between two pointers of the same type.
* Should return non-0 if equal, otherwise 0.
* UDATA is a closure value, passed through from ASSERT_EQUAL_T[m]. */
typedef int greatest_equal_cb(const void *exp, const void *got, void *udata);
/* Type for a callback that prints a value pointed to by T.
* Return value has the same meaning as printf's.
* UDATA is a closure value, passed through from ASSERT_EQUAL_T[m]. */
typedef int greatest_printf_cb(const void *t, void *udata);
/* Callbacks for an arbitrary type; needed for type-specific
* comparisons via GREATEST_ASSERT_EQUAL_T[m].*/
typedef struct greatest_type_info {
greatest_equal_cb *equal;
greatest_printf_cb *print;
} greatest_type_info;
/* Callbacks for string type. */
extern greatest_type_info greatest_type_info_string;
typedef enum {
GREATEST_FLAG_VERBOSE = 0x01,
GREATEST_FLAG_FIRST_FAIL = 0x02,
GREATEST_FLAG_LIST_ONLY = 0x04
} GREATEST_FLAG;
/* Struct containing all test runner state. */
typedef struct greatest_run_info {
unsigned int flags;
unsigned int tests_run; /* total test count */
/* overall pass/fail/skip counts */
unsigned int passed;
unsigned int failed;
unsigned int skipped;
unsigned int assertions;
/* currently running test suite */
greatest_suite_info suite;
/* info to print about the most recent failure */
const char *fail_file;
unsigned int fail_line;
const char *msg;
/* current setup/teardown hooks and userdata */
greatest_setup_cb *setup;
void *setup_udata;
greatest_teardown_cb *teardown;
void *teardown_udata;
/* formatting info for ".....s...F"-style output */
unsigned int col;
unsigned int width;
/* only run a specific suite or test */
char *suite_filter;
char *test_filter;
/* overall timers */
clock_t begin;
clock_t end;
} greatest_run_info;
/* Global var for the current testing context.
* Initialized by GREATEST_MAIN_DEFS(). */
extern greatest_run_info greatest_info;
/**********************
* Exported functions *
**********************/
/* These are used internally by greatest. */
void greatest_do_pass(const char *name);
void greatest_do_fail(const char *name);
void greatest_do_skip(const char *name);
int greatest_pre_test(const char *name);
void greatest_post_test(const char *name, int res);
void greatest_usage(const char *name);
int greatest_do_assert_equal_t(const void *exp, const void *got,
greatest_type_info *type_info, void *udata);
/* These are part of the public greatest API. */
void GREATEST_SET_SETUP_CB(greatest_setup_cb *cb, void *udata);
void GREATEST_SET_TEARDOWN_CB(greatest_teardown_cb *cb, void *udata);
/**********
* Macros *
**********/
/* Define a suite. */
#define GREATEST_SUITE(NAME) void NAME(void)
/* Start defining a test function.
* The arguments are not included, to allow parametric testing. */
#define GREATEST_TEST static int
/* Run a suite. */
#define GREATEST_RUN_SUITE(S_NAME) greatest_run_suite(S_NAME, #S_NAME)
/* Run a test in the current suite. */
#define GREATEST_RUN_TEST(TEST) \
do { \
if (greatest_pre_test(#TEST) == 1) { \
int res = TEST(); \
greatest_post_test(#TEST, res); \
} else if (GREATEST_LIST_ONLY()) { \
fprintf(GREATEST_STDOUT, " %s\n", #TEST); \
} \
} while (0)
/* Run a test in the current suite with one void* argument,
* which can be a pointer to a struct with multiple arguments. */
#define GREATEST_RUN_TEST1(TEST, ENV) \
do { \
if (greatest_pre_test(#TEST) == 1) { \
int res = TEST(ENV); \
greatest_post_test(#TEST, res); \
} else if (GREATEST_LIST_ONLY()) { \
fprintf(GREATEST_STDOUT, " %s\n", #TEST); \
} \
} while (0)
/* If __VA_ARGS__ (C99) is supported, allow parametric testing
* without needing to manually manage the argument struct. */
#if __STDC_VERSION__ >= 19901L
#define GREATEST_RUN_TESTp(TEST, ...) \
do { \
if (greatest_pre_test(#TEST) == 1) { \
int res = TEST(__VA_ARGS__); \
greatest_post_test(#TEST, res); \
} else if (GREATEST_LIST_ONLY()) { \
fprintf(GREATEST_STDOUT, " %s\n", #TEST); \
} \
} while (0)
#endif
/* Check if the test runner is in verbose mode. */
#define GREATEST_IS_VERBOSE() (greatest_info.flags & GREATEST_FLAG_VERBOSE)
#define GREATEST_LIST_ONLY() (greatest_info.flags & GREATEST_FLAG_LIST_ONLY)
#define GREATEST_FIRST_FAIL() (greatest_info.flags & GREATEST_FLAG_FIRST_FAIL)
#define GREATEST_FAILURE_ABORT() (greatest_info.suite.failed > 0 && GREATEST_FIRST_FAIL())
/* Message-less forms of tests defined below. */
#define GREATEST_PASS() GREATEST_PASSm(NULL)
#define GREATEST_FAIL() GREATEST_FAILm(NULL)
#define GREATEST_SKIP() GREATEST_SKIPm(NULL)
#define GREATEST_ASSERT(COND) GREATEST_ASSERTm(#COND, COND)
#define GREATEST_ASSERT_FALSE(COND) GREATEST_ASSERT_FALSEm(#COND, COND)
#define GREATEST_ASSERT_EQ(EXP, GOT) GREATEST_ASSERT_EQm(#EXP " != " #GOT, EXP, GOT)
#define GREATEST_ASSERT_EQUAL_T(EXP, GOT, TYPE_INFO, UDATA) \
GREATEST_ASSERT_EQUAL_Tm(#EXP " != " #GOT, EXP, GOT, TYPE_INFO, UDATA)
#define GREATEST_ASSERT_STR_EQ(EXP, GOT) GREATEST_ASSERT_STR_EQm(#EXP " != " #GOT, EXP, GOT)
/* The following forms take an additional message argument first,
* to be displayed by the test runner. */
/* Fail if a condition is not true, with message. */
#define GREATEST_ASSERTm(MSG, COND) \
do { \
greatest_info.assertions++; \
if (!(COND)) { FAILm(MSG); } \
} while (0)
/* Fail if a condition is not false, with message. */
#define GREATEST_ASSERT_FALSEm(MSG, COND) \
do { \
greatest_info.assertions++; \
if ((COND)) { FAILm(MSG); } \
} while (0)
/* Fail if EXP != GOT (equality comparison by ==). */
#define GREATEST_ASSERT_EQm(MSG, EXP, GOT) \
do { \
greatest_info.assertions++; \
if ((EXP) != (GOT)) { FAILm(MSG); } \
} while (0)
/* Fail if EXP is not equal to GOT, according to strcmp. */
#define GREATEST_ASSERT_STR_EQm(MSG, EXP, GOT) \
do { \
GREATEST_ASSERT_EQUAL_Tm(MSG, EXP, GOT, \
&greatest_type_info_string, NULL); \
} while (0) \
/* Fail if EXP is not equal to GOT, according to a comparison
* callback in TYPE_INFO. If they are not equal, optionally use a
* print callback in TYPE_INFO to print them. */
#define GREATEST_ASSERT_EQUAL_Tm(MSG, EXP, GOT, TYPE_INFO, UDATA) \
do { \
greatest_type_info *type_info = (TYPE_INFO); \
greatest_info.assertions++; \
if (!greatest_do_assert_equal_t(EXP, GOT, \
type_info, UDATA)) { \
if (type_info == NULL || type_info->equal == NULL) { \
FAILm("type_info->equal callback missing!"); \
} else { \
FAILm(MSG); \
} \
} \
} while (0) \
/* Pass. */
#define GREATEST_PASSm(MSG) \
do { \
greatest_info.msg = MSG; \
return 0; \
} while (0)
/* Fail. */
#define GREATEST_FAILm(MSG) \
do { \
greatest_info.fail_file = __FILE__; \
greatest_info.fail_line = __LINE__; \
greatest_info.msg = MSG; \
return -1; \
} while (0)
/* Skip the current test. */
#define GREATEST_SKIPm(MSG) \
do { \
greatest_info.msg = MSG; \
return 1; \
} while (0)
#define GREATEST_SET_TIME(NAME) \
NAME = clock(); \
if (NAME == (clock_t) -1) { \
fprintf(GREATEST_STDOUT, \
"clock error: %s\n", #NAME); \
exit(EXIT_FAILURE); \
}
#define GREATEST_CLOCK_DIFF(C1, C2) \
fprintf(GREATEST_STDOUT, " (%lu ticks, %.3f sec)", \
(long unsigned int) (C2) - (long unsigned int)(C1), \
(double)((C2) - (C1)) / (1.0 * (double)CLOCKS_PER_SEC)) \
/* Include several function definitions in the main test file. */
#define GREATEST_MAIN_DEFS() \
\
/* Is FILTER a subset of NAME? */ \
static int greatest_name_match(const char *name, \
const char *filter) { \
size_t offset = 0; \
size_t filter_len = strlen(filter); \
while (name[offset] != '\0') { \
if (name[offset] == filter[0]) { \
if (0 == strncmp(&name[offset], filter, filter_len)) { \
return 1; \
} \
} \
offset++; \
} \
\
return 0; \
} \
\
int greatest_pre_test(const char *name) { \
if (!GREATEST_LIST_ONLY() \
&& (!GREATEST_FIRST_FAIL() || greatest_info.suite.failed == 0) \
&& (greatest_info.test_filter == NULL || \
greatest_name_match(name, greatest_info.test_filter))) { \
GREATEST_SET_TIME(greatest_info.suite.pre_test); \
if (greatest_info.setup) { \
greatest_info.setup(greatest_info.setup_udata); \
} \
return 1; /* test should be run */ \
} else { \
return 0; /* skipped */ \
} \
} \
\
void greatest_post_test(const char *name, int res) { \
GREATEST_SET_TIME(greatest_info.suite.post_test); \
if (greatest_info.teardown) { \
void *udata = greatest_info.teardown_udata; \
greatest_info.teardown(udata); \
} \
\
if (res < 0) { \
greatest_do_fail(name); \
} else if (res > 0) { \
greatest_do_skip(name); \
} else if (res == 0) { \
greatest_do_pass(name); \
} \
greatest_info.suite.tests_run++; \
greatest_info.col++; \
if (GREATEST_IS_VERBOSE()) { \
GREATEST_CLOCK_DIFF(greatest_info.suite.pre_test, \
greatest_info.suite.post_test); \
fprintf(GREATEST_STDOUT, "\n"); \
} else if (greatest_info.col % greatest_info.width == 0) { \
fprintf(GREATEST_STDOUT, "\n"); \
greatest_info.col = 0; \
} \
if (GREATEST_STDOUT == stdout) fflush(stdout); \
} \
\
static void greatest_run_suite(greatest_suite_cb *suite_cb, \
const char *suite_name) { \
if (greatest_info.suite_filter && \
!greatest_name_match(suite_name, greatest_info.suite_filter)) { \
return; \
} \
if (GREATEST_FIRST_FAIL() && greatest_info.failed > 0) { return; } \
memset(&greatest_info.suite, 0, sizeof(greatest_info.suite)); \
greatest_info.col = 0; \
fprintf(GREATEST_STDOUT, "\n* Suite %s:\n", suite_name); \
GREATEST_SET_TIME(greatest_info.suite.pre_suite); \
suite_cb(); \
GREATEST_SET_TIME(greatest_info.suite.post_suite); \
if (greatest_info.suite.tests_run > 0) { \
fprintf(GREATEST_STDOUT, \
"\n%u tests - %u pass, %u fail, %u skipped", \
greatest_info.suite.tests_run, \
greatest_info.suite.passed, \
greatest_info.suite.failed, \
greatest_info.suite.skipped); \
GREATEST_CLOCK_DIFF(greatest_info.suite.pre_suite, \
greatest_info.suite.post_suite); \
fprintf(GREATEST_STDOUT, "\n"); \
} \
greatest_info.setup = NULL; \
greatest_info.setup_udata = NULL; \
greatest_info.teardown = NULL; \
greatest_info.teardown_udata = NULL; \
greatest_info.passed += greatest_info.suite.passed; \
greatest_info.failed += greatest_info.suite.failed; \
greatest_info.skipped += greatest_info.suite.skipped; \
greatest_info.tests_run += greatest_info.suite.tests_run; \
} \
\
void greatest_do_pass(const char *name) { \
if (GREATEST_IS_VERBOSE()) { \
fprintf(GREATEST_STDOUT, "PASS %s: %s", \
name, greatest_info.msg ? greatest_info.msg : ""); \
} else { \
fprintf(GREATEST_STDOUT, "."); \
} \
greatest_info.suite.passed++; \
} \
\
void greatest_do_fail(const char *name) { \
if (GREATEST_IS_VERBOSE()) { \
fprintf(GREATEST_STDOUT, \
"FAIL %s: %s (%s:%u)", \
name, greatest_info.msg ? greatest_info.msg : "", \
greatest_info.fail_file, greatest_info.fail_line); \
} else { \
fprintf(GREATEST_STDOUT, "F"); \
greatest_info.col++; \
/* add linebreak if in line of '.'s */ \
if (greatest_info.col != 0) { \
fprintf(GREATEST_STDOUT, "\n"); \
greatest_info.col = 0; \
} \
fprintf(GREATEST_STDOUT, "FAIL %s: %s (%s:%u)\n", \
name, \
greatest_info.msg ? greatest_info.msg : "", \
greatest_info.fail_file, greatest_info.fail_line); \
} \
greatest_info.suite.failed++; \
} \
\
void greatest_do_skip(const char *name) { \
if (GREATEST_IS_VERBOSE()) { \
fprintf(GREATEST_STDOUT, "SKIP %s: %s", \
name, \
greatest_info.msg ? \
greatest_info.msg : "" ); \
} else { \
fprintf(GREATEST_STDOUT, "s"); \
} \
greatest_info.suite.skipped++; \
} \
\
int greatest_do_assert_equal_t(const void *exp, const void *got, \
greatest_type_info *type_info, void *udata) { \
if (type_info == NULL || type_info->equal == NULL) { \
return 0; \
} \
int eq = type_info->equal(exp, got, udata); \
if (!eq) { \
if (type_info->print != NULL) { \
fprintf(GREATEST_STDOUT, "Expected: "); \
(void)type_info->print(exp, udata); \
fprintf(GREATEST_STDOUT, "\nGot: "); \
(void)type_info->print(got, udata); \
fprintf(GREATEST_STDOUT, "\n"); \
} else { \
fprintf(GREATEST_STDOUT, \
"GREATEST_ASSERT_EQUAL_T failure at %s:%dn", \
greatest_info.fail_file, \
greatest_info.fail_line); \
} \
} \
return eq; \
} \
\
void greatest_usage(const char *name) { \
fprintf(GREATEST_STDOUT, \
"Usage: %s [-hlfv] [-s SUITE] [-t TEST]\n" \
" -h print this Help\n" \
" -l List suites and their tests, then exit\n" \
" -f Stop runner after first failure\n" \
" -v Verbose output\n" \
" -s SUITE only run suite named SUITE\n" \
" -t TEST only run test named TEST\n", \
name); \
} \
\
void GREATEST_SET_SETUP_CB(greatest_setup_cb *cb, void *udata) { \
greatest_info.setup = cb; \
greatest_info.setup_udata = udata; \
} \
\
void GREATEST_SET_TEARDOWN_CB(greatest_teardown_cb *cb, \
void *udata) { \
greatest_info.teardown = cb; \
greatest_info.teardown_udata = udata; \
} \
\
static int greatest_string_equal_cb(const void *exp, const void *got, \
void *udata) { \
(void)udata; \
return (0 == strcmp((const char *)exp, (const char *)got)); \
} \
\
static int greatest_string_printf_cb(const void *t, void *udata) { \
(void)udata; \
return fprintf(GREATEST_STDOUT, "%s", (const char *)t); \
} \
\
greatest_type_info greatest_type_info_string = { \
greatest_string_equal_cb, \
greatest_string_printf_cb, \
}; \
\
greatest_run_info greatest_info
/* Handle command-line arguments, etc. */
#define GREATEST_MAIN_BEGIN() \
do { \
int i = 0; \
memset(&greatest_info, 0, sizeof(greatest_info)); \
greatest_info.width = GREATEST_DEFAULT_WIDTH; \
for (i = 1; i < argc; i++) { \
if (0 == strcmp("-t", argv[i])) { \
if (argc <= i + 1) { \
greatest_usage(argv[0]); \
exit(EXIT_FAILURE); \
} \
greatest_info.test_filter = argv[i+1]; \
i++; \
} else if (0 == strcmp("-s", argv[i])) { \
if (argc <= i + 1) { \
greatest_usage(argv[0]); \
exit(EXIT_FAILURE); \
} \
greatest_info.suite_filter = argv[i+1]; \
i++; \
} else if (0 == strcmp("-f", argv[i])) { \
greatest_info.flags |= GREATEST_FLAG_FIRST_FAIL; \
} else if (0 == strcmp("-v", argv[i])) { \
greatest_info.flags |= GREATEST_FLAG_VERBOSE; \
} else if (0 == strcmp("-l", argv[i])) { \
greatest_info.flags |= GREATEST_FLAG_LIST_ONLY; \
} else if (0 == strcmp("-h", argv[i])) { \
greatest_usage(argv[0]); \
exit(EXIT_SUCCESS); \
} else { \
fprintf(GREATEST_STDOUT, \
"Unknown argument '%s'\n", argv[i]); \
greatest_usage(argv[0]); \
exit(EXIT_FAILURE); \
} \
} \
} while (0); \
GREATEST_SET_TIME(greatest_info.begin)
/* Report passes, failures, skipped tests, the number of
* assertions, and the overall run time. */
#define GREATEST_MAIN_END() \
do { \
if (!GREATEST_LIST_ONLY()) { \
GREATEST_SET_TIME(greatest_info.end); \
fprintf(GREATEST_STDOUT, \
"\nTotal: %u tests", greatest_info.tests_run); \
GREATEST_CLOCK_DIFF(greatest_info.begin, \
greatest_info.end); \
fprintf(GREATEST_STDOUT, ", %u assertions\n", \
greatest_info.assertions); \
fprintf(GREATEST_STDOUT, \
"Pass: %u, fail: %u, skip: %u.\n", \
greatest_info.passed, \
greatest_info.failed, greatest_info.skipped); \
} \
return (greatest_info.failed > 0 \
? EXIT_FAILURE : EXIT_SUCCESS); \
} while (0)
/* Make abbreviations without the GREATEST_ prefix for the
* most commonly used symbols. */
#if GREATEST_USE_ABBREVS
#define TEST GREATEST_TEST
#define SUITE GREATEST_SUITE
#define RUN_TEST GREATEST_RUN_TEST
#define RUN_TEST1 GREATEST_RUN_TEST1
#define RUN_SUITE GREATEST_RUN_SUITE
#define ASSERT GREATEST_ASSERT
#define ASSERTm GREATEST_ASSERTm
#define ASSERT_FALSE GREATEST_ASSERT_FALSE
#define ASSERT_EQ GREATEST_ASSERT_EQ
#define ASSERT_EQUAL_T GREATEST_ASSERT_EQUAL_T
#define ASSERT_STR_EQ GREATEST_ASSERT_STR_EQ
#define ASSERT_FALSEm GREATEST_ASSERT_FALSEm
#define ASSERT_EQm GREATEST_ASSERT_EQm
#define ASSERT_EQUAL_Tm GREATEST_ASSERT_EQUAL_Tm
#define ASSERT_STR_EQm GREATEST_ASSERT_STR_EQm
#define PASS GREATEST_PASS
#define FAIL GREATEST_FAIL
#define SKIP GREATEST_SKIP
#define PASSm GREATEST_PASSm
#define FAILm GREATEST_FAILm
#define SKIPm GREATEST_SKIPm
#define SET_SETUP GREATEST_SET_SETUP_CB
#define SET_TEARDOWN GREATEST_SET_TEARDOWN_CB
#if __STDC_VERSION__ >= 19901L
#endif /* C99 */
#define RUN_TESTp GREATEST_RUN_TESTp
#endif /* USE_ABBREVS */
#endif
| mit |
patorjk/figlet.js | importable-fonts/Sub-Zero.js | 6438 | export default `flf2a$ 6 5 17 -1 16
"Sub-Zero" font by Sub-Zero
==============================
-> Conversion to FigLet font by MEPH. (Part of ASCII Editor Service Pack I)
(http://studenten.freepage.de/meph/ascii/ascii/editor/_index.htm)
-> Defined: ASCII code alphabet
-> Uppercase characters only.
ScarecrowsASCIIArtArchive1.0.txt
From: "Sub-Zero" <[email protected]>
"Here's a font I've been working on lately. Can someone make the V, Q, and X
look better? Also, the B, P, and R could use an improvement too.
Oh, here it is."
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
______ @
/\\ __ \\ @
\\ \\ __ \\ @
\\ \\_\\ \\_\\ @
\\/_/\\/_/ @
@@
______ @
/\\ == \\ @
\\ \\ __< @
\\ \\_____\\ @
\\/_____/ @
@@
______ @
/\\ ___\\ @
\\ \\ \\____ @
\\ \\_____\\ @
\\/_____/ @
@@
_____ @
/\\ __-. @
\\ \\ \\/\\ \\ @
\\ \\____- @
\\/____/ @
@@
______ @
/\\ ___\\ @
\\ \\ __\\ @
\\ \\_____\\ @
\\/_____/ @
@@
______ @
/\\ ___\\ @
\\ \\ __\\ @
\\ \\_\\ @
\\/_/ @
@@
______ @
/\\ ___\\ @
\\ \\ \\__ \\ @
\\ \\_____\\ @
\\/_____/ @
@@
__ __ @
/\\ \\_\\ \\ @
\\ \\ __ \\ @
\\ \\_\\ \\_\\ @
\\/_/\\/_/ @
@@
__ @
/\\ \\ @
\\ \\ \\ @
\\ \\_\\ @
\\/_/ @
@@
__ @
/\\ \\ @
_\\_\\ \\ @
/\\_____\\ @
\\/_____/ @
@@
__ __ @
/\\ \\/ / @
\\ \\ _"-. @
\\ \\_\\ \\_\\ @
\\/_/\\/_/ @
@@
__ @
/\\ \\ @
\\ \\ \\____ @
\\ \\_____\\ @
\\/_____/ @
@@
__ __ @
/\\ "-./ \\ @
\\ \\ \\-./\\ \\ @
\\ \\_\\ \\ \\_\\ @
\\/_/ \\/_/ @
@@
__ __ @
/\\ "-.\\ \\ @
\\ \\ \\-. \\ @
\\ \\_\\\\"\\_\\ @
\\/_/ \\/_/ @
@@
______ @
/\\ __ \\ @
\\ \\ \\/\\ \\ @
\\ \\_____\\ @
\\/_____/ @
@@
______ @
/\\ == \\ @
\\ \\ _-/ @
\\ \\_\\ @
\\/_/ @
@@
______ @
/\\ __ \\ @
\\ \\ \\/\\_\\ @
\\ \\___\\_\\ @
\\/___/_/ @
@@
______ @
/\\ == \\ @
\\ \\ __< @
\\ \\_\\ \\_\\ @
\\/_/ /_/ @
@@
______ @
/\\ ___\\ @
\\ \\___ \\ @
\\/\\_____\\ @
\\/_____/ @
@@
______ @
/\\__ _\\ @
\\/_/\\ \\/ @
\\ \\_\\ @
\\/_/ @
@@
__ __ @
/\\ \\/\\ \\ @
\\ \\ \\_\\ \\ @
\\ \\_____\\ @
\\/_____/ @
@@
__ __ @
/\\ \\ / / @
\\ \\ \\'/ @
\\ \\__| @
\\/_/ @
@@
__ __ @
/\\ \\ _ \\ \\ @
\\ \\ \\/ ".\\ \\ @
\\ \\__/".~\\_\\ @
\\/_/ \\/_/ @
@@
__ __ @
/\\_\\_\\_\\ @
\\/_/\\_\\/_ @
/\\_\\/\\_\\ @
\\/_/\\/_/ @
@@
__ __ @
/\\ \\_\\ \\ @
\\ \\____ \\ @
\\/\\_____\\ @
\\/_____/ @
@@
______ @
/\\___ \\ @
\\/_/ /__ @
/\\_____\\ @
\\/_____/ @
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
______ @
/\\ __ \\ @
\\ \\ __ \\ @
\\ \\_\\ \\_\\ @
\\/_/\\/_/ @
@@
______ @
/\\ == \\ @
\\ \\ __< @
\\ \\_____\\ @
\\/_____/ @
@@
______ @
/\\ ___\\ @
\\ \\ \\____ @
\\ \\_____\\ @
\\/_____/ @
@@
_____ @
/\\ __-. @
\\ \\ \\/\\ \\ @
\\ \\____- @
\\/____/ @
@@
______ @
/\\ ___\\ @
\\ \\ __\\ @
\\ \\_____\\ @
\\/_____/ @
@@
______ @
/\\ ___\\ @
\\ \\ __\\ @
\\ \\_\\ @
\\/_/ @
@@
______ @
/\\ ___\\ @
\\ \\ \\__ \\ @
\\ \\_____\\ @
\\/_____/ @
@@
__ __ @
/\\ \\_\\ \\ @
\\ \\ __ \\ @
\\ \\_\\ \\_\\ @
\\/_/\\/_/ @
@@
__ @
/\\ \\ @
\\ \\ \\ @
\\ \\_\\ @
\\/_/ @
@@
__ @
/\\ \\ @
_\\_\\ \\ @
/\\_____\\ @
\\/_____/ @
@@
__ __ @
/\\ \\/ / @
\\ \\ _"-. @
\\ \\_\\ \\_\\ @
\\/_/\\/_/ @
@@
__ @
/\\ \\ @
\\ \\ \\____ @
\\ \\_____\\ @
\\/_____/ @
@@
__ __ @
/\\ "-./ \\ @
\\ \\ \\-./\\ \\ @
\\ \\_\\ \\ \\_\\ @
\\/_/ \\/_/ @
@@
__ __ @
/\\ "-.\\ \\ @
\\ \\ \\-. \\ @
\\ \\_\\\\"\\_\\ @
\\/_/ \\/_/ @
@@
______ @
/\\ __ \\ @
\\ \\ \\/\\ \\ @
\\ \\_____\\ @
\\/_____/ @
@@
______ @
/\\ == \\ @
\\ \\ _-/ @
\\ \\_\\ @
\\/_/ @
@@
______ @
/\\ __ \\ @
\\ \\ \\/\\_\\ @
\\ \\___\\_\\ @
\\/___/_/ @
@@
______ @
/\\ == \\ @
\\ \\ __< @
\\ \\_\\ \\_\\ @
\\/_/ /_/ @
@@
______ @
/\\ ___\\ @
\\ \\___ \\ @
\\/\\_____\\ @
\\/_____/ @
@@
______ @
/\\__ _\\ @
\\/_/\\ \\/ @
\\ \\_\\ @
\\/_/ @
@@
__ __ @
/\\ \\/\\ \\ @
\\ \\ \\_\\ \\ @
\\ \\_____\\ @
\\/_____/ @
@@
__ __ @
/\\ \\ / / @
\\ \\ \\'/ @
\\ \\__| @
\\/_/ @
@@
__ __ @
/\\ \\ _ \\ \\ @
\\ \\ \\/ ".\\ \\ @
\\ \\__/".~\\_\\ @
\\/_/ \\/_/ @
@@
__ __ @
/\\_\\_\\_\\ @
\\/_/\\_\\/_ @
/\\_\\/\\_\\ @
\\/_/\\/_/ @
@@
__ __ @
/\\ \\_\\ \\ @
\\ \\____ \\ @
\\/\\_____\\ @
\\/_____/ @
@@
______ @
/\\___ \\ @
\\/_/ /__ @
/\\_____\\ @
\\/_____/ @
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
` | mit |
yizhi401/NoahsArk | CubeWorldUnity/Assets/SourceCode/CubeWorld/Configuration/Config.cs | 639 | using CubeWorld.World.Generator;
using CubeWorld.Tiles;
using CubeWorld.World.Lights;
using CubeWorld.Configuration;
using CubeWorld.Items;
using CubeWorld.Avatars;
using CubeWorld.Gameplay;
namespace CubeWorld.Configuration
{
public class Config
{
public ConfigWorldSize worldSize;
public ConfigDayInfo dayInfo;
public ConfigWorldGenerator worldGenerator;
public TileDefinition[] tileDefinitions;
public ItemDefinition[] itemDefinitions;
public AvatarDefinition[] avatarDefinitions;
public ConfigExtraMaterials extraMaterials;
public GameplayDefinition gameplay;
}
}
| mit |
LivePersonInc/dev-hub | content6/consumer-experience-server-chat-retrieve-chat-resources.html | 135511 | <!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="keywords" content=" ">
<title>Retrieve Chat Resources, Events and Information | LivePerson Technical Documentation</title>
<link rel="stylesheet" href="css/syntax.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome-4.7.0/css/font-awesome.min.css">
<!--<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">-->
<link rel="stylesheet" href="css/modern-business.css">
<link rel="stylesheet" href="css/lavish-bootstrap.css">
<link rel="stylesheet" href="css/customstyles.css">
<link rel="stylesheet" href="css/theme-blue.css">
<!-- <script src="assets/js/jsoneditor.js"></script> -->
<script src="assets/js/jquery-3.1.0.min.js"></script>
<!-- <link rel='stylesheet' id='theme_stylesheet' href='//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css'> -->
<!-- <link rel='stylesheet' id='theme_stylesheet' href='//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css'>
-->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> -->
<script src="assets/js/jquery.cookie-1.4.1.min.js"></script>
<script src="js/jquery.navgoco.min.js"></script>
<script src="assets/js/bootstrap-3.3.4.min.js"></script>
<script src="assets/js/anchor-2.0.0.min.js"></script>
<script src="js/toc.js"></script>
<script src="js/customscripts.js"></script>
<link rel="shortcut icon" href="images/favicon.ico">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<link rel="alternate" type="application/rss+xml" title="" href="http://0.0.0.0:4005feed.xml">
<script>
$(document).ready(function() {
// Initialize navgoco with default options
$("#mysidebar").navgoco({
caretHtml: '',
accordion: true,
openClass: 'active', // open
save: false, // leave false or nav highlighting doesn't work right
cookie: {
name: 'navgoco',
expires: false,
path: '/'
},
slide: {
duration: 400,
easing: 'swing'
}
});
$("#collapseAll").click(function(e) {
e.preventDefault();
$("#mysidebar").navgoco('toggle', false);
});
$("#expandAll").click(function(e) {
e.preventDefault();
$("#mysidebar").navgoco('toggle', true);
});
});
</script>
<script>
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
</script>
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container topnavlinks">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="fa fa-home fa-lg navbar-brand" href="index.html"> <span class="projectTitle"> LivePerson Technical Documentation</span></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<!-- entries without drop-downs appear here -->
<!-- entries with drop-downs appear here -->
<!-- conditional logic to control which topnav appears for the audience defined in the configuration file.-->
<li><a class="email" title="Submit feedback" href="https://github.com/LivePersonInc/dev-hub/issues" ><i class="fa fa-github"></i> Issues</a><li>
<!--comment out this block if you want to hide search-->
<li>
<!--start search-->
<div id="search-demo-container">
<input type="text" id="search-input" placeholder="search...">
<ul id="results-container"></ul>
</div>
<script src="js/jekyll-search.js" type="text/javascript"></script>
<script type="text/javascript">
SimpleJekyllSearch.init({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('results-container'),
dataSource: 'search.json',
searchResultTemplate: '<li><a href="{url}" title="Retrieve Chat Resources, Events and Information">{title}</a></li>',
noResultsText: 'No results found.',
limit: 10,
fuzzy: true,
})
</script>
<!--end search-->
</li>
</ul>
</div>
</div>
<!-- /.container -->
</nav>
<!-- Page Content -->
<div class="container">
<div class="col-lg-12"> </div>
<!-- Content Row -->
<div class="row">
<!-- Sidebar Column -->
<div class="col-md-3">
<ul id="mysidebar" class="nav">
<li class="sidebarTitle"> </li>
<li>
<a href="#">Common Guidelines</a>
<ul>
<li class="subfolders">
<a href="#">Introduction</a>
<ul>
<li class="thirdlevel"><a href="index.html">Home</a></li>
</ul>
</li>
</ul>
<li>
<a href="#">Account Configuration</a>
<ul>
<li class="subfolders">
<a href="#">Predefined Content API</a>
<ul>
<li class="thirdlevel"><a href="account-configuration-predefined-content-overview.html">Overview</a></li>
<li class="thirdlevel"><a href="account-configuration-predefined-content-methods.html">Methods</a></li>
<li class="thirdlevel"><a href="account-configuration-predefined-content-get-items.html">Get Predefined Content Items</a></li>
<li class="thirdlevel"><a href="account-configuration-predefined-content-get-by-id.html">Get Predefined Content by ID</a></li>
<li class="thirdlevel"><a href="account-configuration-predefined-content-query-delta.html">Predefined Content Query Delta</a></li>
<li class="thirdlevel"><a href="account-configuration-predefined-content-create-content.html">Create Predefined Content</a></li>
<li class="thirdlevel"><a href="account-configuration-predefined-content-update-content.html">Update Predefined Content</a></li>
<li class="thirdlevel"><a href="account-configuration-predefined-content-update-content-items.html">Update Predefined Content Items</a></li>
<li class="thirdlevel"><a href="account-configuration-predefined-content-delete-content.html">Delete Predefined Content</a></li>
<li class="thirdlevel"><a href="account-configuration-predefined-content-delete-content-items.html">Delete Predefined Content Items</a></li>
<li class="thirdlevel"><a href="account-configuration-predefined-content-get-default-items.html">Get Default Predefined Content Items</a></li>
<li class="thirdlevel"><a href="account-configuration-predefined-content-get-default-items-by-id.html">Get Default Predefined Content by ID</a></li>
<li class="thirdlevel"><a href="account-configuration-predefined-content-appendix.html">Appendix</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Automatic Messages API</a>
<ul>
<li class="thirdlevel"><a href="account-configuration-automatic-messages-overview.html">Overview</a></li>
<li class="thirdlevel"><a href="account-configuration-automatic-messages-methods.html">Methods</a></li>
<li class="thirdlevel"><a href="account-configuration-automatic-messages-get-automatic-messages.html">Get Automatic Messages</a></li>
<li class="thirdlevel"><a href="account-configuration-automatic-messages-get-automatic-message-by-id.html">Get Automatic Message by ID</a></li>
<li class="thirdlevel"><a href="account-configuration-automatic-messages-update-an-automatic-message.html">Update an Automatic Message</a></li>
<li class="thirdlevel"><a href="account-configuration-automatic-messages-appendix.html">Appendix</a></li>
</ul>
</li>
</ul>
<li>
<a href="#">Administration</a>
<ul>
<li class="subfolders">
<a href="#">Users API</a>
<ul>
<li class="thirdlevel"><a href="administration-users-overview.html">Overview</a></li>
<li class="thirdlevel"><a href="administration-users-methods.html">Methods</a></li>
<li class="thirdlevel"><a href="administration-get-all-users.html">Get all users</a></li>
<li class="thirdlevel"><a href="administration-get-user-by-id.html">Get user by ID</a></li>
<li class="thirdlevel"><a href="administration-create-users.html">Create users</a></li>
<li class="thirdlevel"><a href="administration-update-users.html">Update users</a></li>
<li class="thirdlevel"><a href="administration-update-user.html">Update user</a></li>
<li class="thirdlevel"><a href="administration-delete-users.html">Delete users</a></li>
<li class="thirdlevel"><a href="administration-delete-user.html">Delete user</a></li>
<li class="thirdlevel"><a href="administration-change-users-password.html">Change user's password</a></li>
<li class="thirdlevel"><a href="administration-reset-users-password.html">Reset user's password</a></li>
<li class="thirdlevel"><a href="administration-user-query-delta.html">User query delta</a></li>
<li class="thirdlevel"><a href="administration-users-appendix.html">Appendix</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Skills API</a>
<ul>
<li class="thirdlevel"><a href="administration-skills-overview.html">Overview</a></li>
<li class="thirdlevel"><a href="administration-skills-methods.html">Methods</a></li>
<li class="thirdlevel"><a href="administration-get-all-skills.html">Get all skills</a></li>
<li class="thirdlevel"><a href="administration-get-skill-by-id.html">Get skill by ID</a></li>
<li class="thirdlevel"><a href="administration-create-skills.html">Create skills</a></li>
<li class="thirdlevel"><a href="administration.update-skills.html">Update skills</a></li>
<li class="thirdlevel"><a href="administration-update-skill.html">Update skill</a></li>
<li class="thirdlevel"><a href="administration-delete-skills.html">Delete skills</a></li>
<li class="thirdlevel"><a href="administration-delete-skill.html">Delete skill</a></li>
<li class="thirdlevel"><a href="administration-skills-query-delta.html">Skills Query Delta</a></li>
<li class="thirdlevel"><a href="administration-skills-appendix.html">Appendix</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Agent Groups API</a>
<ul>
<li class="thirdlevel"><a href="administration-agent-groups-overview.html">Overview</a></li>
<li class="thirdlevel"><a href="administration-agent-groups-methods.html">Methods</a></li>
<li class="thirdlevel"><a href="administration-get-all-agent-groups.html">Get all agent groups</a></li>
<li class="thirdlevel"><a href="administration-get-agent-groups-by-id.html">Get agent group by ID</a></li>
<li class="thirdlevel"><a href="administration-create-agent-groups.html">Create agent groups</a></li>
<li class="thirdlevel"><a href="administration-update-agent-groups.html">Update agent groups</a></li>
<li class="thirdlevel"><a href="administration-update-agent-group.html">Update agent group</a></li>
<li class="thirdlevel"><a href="administration-delete-agent-groups.html">Delete agent groups</a></li>
<li class="thirdlevel"><a href="administration-delete-agent-group.html">Delete agent group</a></li>
<li class="thirdlevel"><a href="administration-get-subgroups-and-members.html">Get subgroups and members of an agent group</a></li>
<li class="thirdlevel"><a href="administration-agent-groups-query-delta.html">Agent Groups Query Delta</a></li>
</ul>
</li>
</ul>
<li>
<a href="#">Consumer Experience</a>
<ul>
<li class="subfolders">
<a href="#">JavaScript Chat API</a>
<ul>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-getting-started.html">Getting Started</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-chat-states.html">Chat States</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-surveys.html">Surveys</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-creating-an-instance.html">Creating an Instance</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-methods.html">Methods</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-getestimatedwaittime.html">getEstimatedWaitTime</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-getprechatsurvey.html">getPreChatSurvey</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-getengagement.html">getEngagement</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-requestchat.html">requestChat</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-addline.html">addLine</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-setvisitortyping.html">setVisitorTyping</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-setvisitorname.html">setVisitorName</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-endchat.html">endChat</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-requesttranscript.html">requestTranscript</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-getexitsurvey.html">getExitSurvey</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-submitexitsurvey.html">submitExitSurvey</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-getofflinesurvey.html">getOfflineSurvey</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-submitofflinesurvey.html">submitOfflineSurvey</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-getstate.html">getState</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-getagentloginname.html">getAgentLoginName</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-getvisitorname.html">getVisitorName</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-getagentid.html">getAgentId</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-getrtsessionid.html">getRtSessionId</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-getsessionkey.html">getSessionKey</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-getagenttyping.html">getAgentTyping</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-events.html">Events</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-onload.html">onLoad</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-oninit.html">onInit</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-onestimatedwaittime.html">onEstimatedWaitTime</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-onengagement.html">onEngagement</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-onprechatsurvey.html">onPreChatSurvey</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-onstart.html">onStart</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-onstop.html">onStop</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-onrequestchat.html">onRequestChat</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-ontranscript.html">onTranscript</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-online.html">onLine</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-onstate.html">onState</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-oninfo.html">onInfo</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-onagenttyping.html">onAgentTyping</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-onexitsurvey.html">onExitSurvey</a></li>
<li class="thirdlevel"><a href="consumer-experience-javascript-chat-onaccounttoaccounttransfer.html">onAccountToAccountTransfer</a></li>
<li class="thirdlevel"><a href="rt-interactions-example.html">Engagement Attributes Body Example</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Server Chat API</a>
<ul>
<li class="thirdlevel"><a href="consumer-experience-server-chat-getting-started.html">Getting Started</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-methods.html">Methods</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-availability.html">Retrieve Availability</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-available-slots.html">Retrieve Available Slots</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-estimated-wait-time.html">Retrieve Estimated Wait Time</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-offline-survey.html">Retrieve an Offline Survey</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-start-chat.html">Start a Chat</a></li>
<li class="active thirdlevel"><a href="consumer-experience-server-chat-retrieve-chat-resources.html">Retrieve Chat Resources, Events and Information</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-chat-events.html">Retrieve Chat Events</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-add-lines.html">Add Lines / End Chat</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-chat-information.html">Retrieve Chat Information</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-visitor-name.html">Retrieve the Visitor's Name</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-set-visitor-name.html">Set the Visitor's Name</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-agent-typing-status.html">Retrieve the Agent's Typing Status</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-visitor-typing-status.html">Retrieve the Visitor's Typing Status</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-set-visitor-typing-status.html">Set the Visitor's Typing Status</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-exit-survey-structure.html">Retrieve Exit Survey Structure</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-submit-survey-data.html">Submit Survey Data</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-send-transcript.html">Send a Transcript</a></li>
<li class="thirdlevel"><a href="consumer-experience-server-chat-sample.html">Sample Postman Collection</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">In-App Messaging SDK iOS (2.0)</a>
<ul>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-quick-start.html">Quick Start</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-advanced-configurations.html">Advanced Configurations</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-methods.html">Methods</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-initialize.html">initialize</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-showconversation.html">showConversation</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-removeconversation.html">removeConversation</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-reconnect.html">reconnect</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-togglechatactions.html">toggleChatActions</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-checkactiveconversation.html">checkActiveConversation</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-markasurgent.html">markAsUrgent</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-isurgent.html">isUrgent</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-dismissurgent.html">dismissUrgent</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-resolveconversation.html">resolveConversation</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-clearhistory.html">clearHistory</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-logout.html">logout</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-destruct.html">destruct</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-handlepush.html">handlePush</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-registerpushnotifications.html">registerPushNotifications</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-setuserprofile.html">setUserProfile</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-getassignedagent.html">getAssignedAgent</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-subscribelogevents.html">subscribeLogEvents</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-getsdkversion.html">getSDKVersion</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-printalllocalizedkeys.html">printAllLocalizedKeys</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-printsupportedlanguages.html">printSupportedLanguages</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-getallsupportedlanguages.html">getAllSupportedLanguages</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-interfacedefinitions.html">Interface and Class Definitions</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-callbacks-index.html">Callbacks index</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-configuring-the-sdk.html">Configuring the SDK</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-attributes.html">Attributes</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-deprecated-attributes.html">Deprecated Attributes</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-stringlocalization.html">String localization in SDK</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-localizationkeys.html">Localization Keys</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-timestamps.html">Timestamps Formatting</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-createcertificate.html">OS Certificate Creation</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-advanced-csat.html">CSAT UI Content</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-photosharing.html">Photo Sharing (Beta)</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-pushnotifications.html">Configuring Push Notifications</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-opensource.html">Open Source List</a></li>
<li class="thirdlevel"><a href="consumer-experience-ios-sdk-security.html">Security</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">In-App Messaging SDK Android (2.0)</a>
<ul>
<li class="thirdlevel"><a href="consumer-experience-android-sdk.html">Version 2.0</a></li>
</ul>
</li>
</ul>
<li>
<a href="#">Real-time Interactions</a>
<ul>
<li class="subfolders">
<a href="#">Visit Information API</a>
<ul>
<li class="thirdlevel"><a href="rt-interactions-visit-information-overview.html">Overview</a></li>
<li class="thirdlevel"><a href="rt-interactions-visit-information-visit-information.html">Visit Information</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">App Engagement API</a>
<ul>
<li class="thirdlevel"><a href="rt-interactions-app-engagement-overview.html">Overview</a></li>
<li class="thirdlevel"><a href="rt-interactions-app-engagement-methods.html">Methods</a></li>
<li class="thirdlevel"><a href="rt-interactions-create-session.html">Create Session</a></li>
<li class="thirdlevel"><a href="rt-interactions-update-session.html">Update Session</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Engagement Attributes</a>
<ul>
<li class="thirdlevel"><a href="rt-interactions-engagement-attributes-overview.html">Overview</a></li>
<li class="thirdlevel"><a href="rt-interactions-engagement-attributes-engagement-attributes.html">Engagement Attributes</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">IVR Engagement API</a>
<ul>
<li class="thirdlevel"><a href="rt-interactions-ivr-engagement-overview.html">Overview</a></li>
<li class="thirdlevel"><a href="rt-interactions-ivr-engagement-methods.html">Methods</a></li>
<li class="thirdlevel"><a href="rt-interactions-ivr-engagement-external engagement.html">External Engagement</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Validate Engagement</a>
<ul>
<li class="thirdlevel"><a href="rt-interactions-validate-engagement-overview.html">Overview</a></li>
<li class="thirdlevel"><a href="rt-interactions-validate-engagement-validate-engagement.html">Validate Engagement API</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Engagement Window Widget SDK</a>
<ul>
<li class="thirdlevel"><a href="rt-interactions-window-sdk-overview.html">Overview</a></li>
<li class="thirdlevel"><a href="rt-interactions-window-sdk-getting-started.html">Getting Started</a></li>
<li class="thirdlevel"><a href="rt-interactions-window-sdk-limitations.html">Limitations</a></li>
<li class="thirdlevel"><a href="rt-interactions-window-sdk-configuration.html">Configuration</a></li>
<li class="thirdlevel"><a href="rt-interactions-window-sdk-how-to-use.html">How to use the SDK</a></li>
<li class="thirdlevel"><a href="rt-interactions-window-sdk-code-examples.html">Code Examples</a></li>
<li class="thirdlevel"><a href="rt-interactions-window-sdk-event-structure.html">Event Structure</a></li>
</ul>
</li>
</ul>
<li>
<a href="#">Agent</a>
<ul>
<li class="subfolders">
<a href="#">Agent Workspace Widget SDK</a>
<ul>
<li class="thirdlevel"><a href="agent-workspace-sdk-overview.html">Overview</a></li>
<li class="thirdlevel"><a href="agent-workspace-sdk-getting-started.html">Getting Started</a></li>
<li class="thirdlevel"><a href="agent-workspace-sdk-limitations.html">Limitations</a></li>
<li class="thirdlevel"><a href="agent-workspace-sdk-how-to-use.html">How to use the SDK</a></li>
<li class="thirdlevel"><a href="agent-workspace-sdk-methods.html">Methods</a></li>
<li class="thirdlevel"><a href="agent-workspace-sdk-public-model.html">Public Model Structure</a></li>
<li class="thirdlevel"><a href="agent-workspace-sdk-public-properties.html">Public Properties</a></li>
<li class="thirdlevel"><a href="agent-workspace-sdk-code-examples.html">Code Examples</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">LivePerson Domain API</a>
<ul>
<li class="thirdlevel"><a href="agent-domain-domain-api.html">Domain API</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Login Service API</a>
<ul>
<li class="thirdlevel"><a href="login-getting-started.html">Getting Started</a></li>
<li class="thirdlevel"><a href="agent-login-methods.html">Methods</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Chat Agent API</a>
<ul>
<li class="thirdlevel"><a href="chat-agent-getting-started.html">Getting Started</a></li>
<li class="thirdlevel"><a href="agent-chat-agent-methods.html">Methods</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Messaging Agent SDK</a>
<ul>
<li class="thirdlevel"><a href="messaging-agent-sdk-overview.html">Overview</a></li>
</ul>
</li>
</ul>
<li>
<a href="#">Data</a>
<ul>
<li class="subfolders">
<a href="#">Data Access API</a>
<ul>
<li class="thirdlevel"><a href="data-data-access.html">Data Access API</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Messaging Operations API</a>
<ul>
<li class="thirdlevel"><a href="data-messaging-operations.html">Messaging Operations API</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Messaging Interactions API</a>
<ul>
<li class="thirdlevel"><a href="data-messaging-interactions.html">Messaging Interactions API (Beta)</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Engagement History API</a>
<ul>
<li class="thirdlevel"><a href="data-engagement-history.html">Engagement History API</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Operational Real-time API</a>
<ul>
<li class="thirdlevel"><a href="data-operational-realtime.html">Operational Real-time API</a></li>
</ul>
</li>
</ul>
<li>
<a href="#">LiveEngage Tag</a>
<ul>
<li class="subfolders">
<a href="#">LE Tag Events</a>
<ul>
<li class="thirdlevel"><a href="lp-tag-tag-events.html">LE Tag Events</a></li>
</ul>
</li>
</ul>
<li>
<a href="#">Messaging Window API</a>
<ul>
<li class="subfolders">
<a href="#">Introduction</a>
<ul>
<li class="thirdlevel"><a href="consumer-interation-index.html">Home</a></li>
<li class="thirdlevel"><a href="consumer-int-protocol-overview.html">Protocol Overview</a></li>
<li class="thirdlevel"><a href="consumer-int-getting-started.html">Getting Started</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Tutorials</a>
<ul>
<li class="thirdlevel"><a href="consumer-int-get-msg.html">Get Messages</a></li>
<li class="thirdlevel"><a href="consumer-int-conversation-md.html">Conversation Metadata</a></li>
<li class="thirdlevel"><a href="consumer-int-readaccept-events.html">Read/Accept events</a></li>
<li class="thirdlevel"><a href="consumer-int-authentication.html">Authentication</a></li>
<li class="thirdlevel"><a href="consumer-int-agent-profile.html">Agent Profile</a></li>
<li class="thirdlevel"><a href="consumer-int-post-survey.html">Post Conversation Survey</a></li>
<li class="thirdlevel"><a href="consumer-int-client-props.html">Client Properties</a></li>
<li class="thirdlevel"><a href="consumer-int-no-headers.html">Avoid Webqasocket Headers</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Samples</a>
<ul>
<li class="thirdlevel"><a href="consumer-int-js-sample.html">JavaScript Messenger</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">API Reference</a>
<ul>
<li class="thirdlevel"><a href="consumer-int-api-reference.html">Overview</a></li>
<li class="thirdlevel"><a href="consumer-int-msg-reqs.html">Request Builder</a></li>
<li class="thirdlevel"><a href="consumer-int-msg-resps.html">Response Builder</a></li>
<li class="thirdlevel"><a href="consumer-int-msg-notifications.html">Notification Builder</a></li>
<li class="thirdlevel"><a href="consumer-int-msg-req-conv.html">New Conversation</a></li>
<li class="thirdlevel"><a href="consumer-int-msg-close-conv.html">Close Conversation</a></li>
<li class="thirdlevel"><a href="consumer-int-msg-csat-conv.html">Update CSAT</a></li>
<li class="thirdlevel"><a href="consumer-int-msg-sub-conv.html">Subscribe Conversations Metadata</a></li>
<li class="thirdlevel"><a href="consumer-int-msg-unsub-conv.html">Unsubscribe Conversations Metadata</a></li>
<li class="thirdlevel"><a href="consumer-int-msg-text-cont.html">Publish Content</a></li>
<li class="thirdlevel"><a href="consumer-int-msg-sub-events.html">Subscribe Conversation Content</a></li>
<li class="thirdlevel"><a href="consumer-int-msg-init-con.html">Browser Init Connection</a></li>
</ul>
</li>
</ul>
<!-- if you aren't using the accordion, uncomment this block:
<p class="external">
<a href="#" id="collapseAll">Collapse All</a> | <a href="#" id="expandAll">Expand All</a>
</p>
-->
</li>
</ul>
</div>
<!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above. Otherwise, if placed inside customscripts.js, the script runs before the sidebar code runs and the class never gets inserted.-->
<script>$("li.active").parents('li').toggleClass("active");</script>
<!-- Content Column -->
<div class="col-md-9">
<div class="post-header">
<h1 class="post-title-main">Retrieve Chat Resources, Events and Information</h1>
</div>
<div class="post-content">
<p>Retrieves all information available for this chat, including both Events and Information sections of the chat.</p>
<h2 id="request">Request</h2>
<table>
<thead>
<tr>
<th style="text-align: left">Method</th>
<th style="text-align: left">URI</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left">GET</td>
<td style="text-align: left">Accessed from a link in the Location header from the response to the <a href="consumer-experience-server-chat-start-chat.html">Start Chat</a> POST request.</td>
</tr>
</tbody>
</table>
<p><strong>Formats</strong></p>
<ul>
<li>XML</li>
<li>JSON</li>
</ul>
<p><strong>Request Headers</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left">Header</th>
<th style="text-align: left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left">Authorization</td>
<td style="text-align: left">LivePerson appKey=721c180b09eb463d9f3191c41762bb68</td>
</tr>
<tr>
<td style="text-align: left">Content-Type</td>
<td style="text-align: left">application/json</td>
</tr>
<tr>
<td style="text-align: left">Accept</td>
<td style="text-align: left">application/json</td>
</tr>
</tbody>
</table>
<p><strong>Parameters</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left">Name</th>
<th style="text-align: left">Description</th>
<th style="text-align: left">Type/Value</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left">from</td>
<td style="text-align: left">The ID of the first event that is shown in the response.</td>
<td style="text-align: left">numeric</td>
</tr>
</tbody>
</table>
<h2 id="response">Response</h2>
<p><strong>Response Codes</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left">Code</th>
<th style="text-align: left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left">200</td>
<td style="text-align: left">Successful</td>
</tr>
</tbody>
</table>
<p>JSON Example:</p>
<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
</span><span class="nt">"chat"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nt">"link"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@href"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://{domain}/api/account/{accountId}/chat/{chatId}"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@rel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"self"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@href"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://{domain}/api/account/{accountId}/chat/{chatId}/events"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@rel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"events"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@href"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://{domain}/api/account/{accountId}/chat/{chatId}/info"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@rel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"info"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@href"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://{domain}/api/account/{accountId}/chat/{chatId}?from=4"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@rel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"next"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@href"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://{domain}/api/account/{accountId}/chat/{chatId}/transcriptRequest"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@rel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"transcript-request"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@href"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://{domain}/api/account/{accountId}/chat/{chatId}/transcriptWithSubjectRequest"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@rel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"transcript-with-subject-request"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@href"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://{domain}/api/account/{accountId}/chat/{chatId}/exitSurvey"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@rel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"exit-survey"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="err">//</span><span class="w"> </span><span class="err">not</span><span class="w"> </span><span class="err">supported</span><span class="w"> </span><span class="err">(deprecated)</span><span class="w">
</span><span class="nt">"@href"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://{domain}/api/account/{accountId}/chat/{chatId}/customVariables"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@rel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"custom-variables"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">],</span><span class="w">
</span><span class="nt">"events"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nt">"link"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@href"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://{domain}/api/account/{accountId}/chat/{chatId}/events"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@rel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"self"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@href"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://{domain}/api/account/{accountId}/chat/{chatId}/events?from=4"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@rel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"next"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">],</span><span class="w">
</span><span class="nt">"event"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"state"</span><span class="p">,</span><span class="w">
</span><span class="nt">"time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2017-02-27T06:24:15.424-05:00"</span><span class="p">,</span><span class="w">
</span><span class="nt">"state"</span><span class="p">:</span><span class="w"> </span><span class="s2">"waiting"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"line"</span><span class="p">,</span><span class="w">
</span><span class="nt">"time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2017-02-27T06:24:15.425-05:00"</span><span class="p">,</span><span class="w">
</span><span class="nt">"textType"</span><span class="p">:</span><span class="w"> </span><span class="s2">"plain"</span><span class="p">,</span><span class="w">
</span><span class="nt">"text"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Thank you for choosing to chat with us."</span><span class="p">,</span><span class="w">
</span><span class="nt">"by"</span><span class="p">:</span><span class="w"> </span><span class="s2">"info"</span><span class="p">,</span><span class="w">
</span><span class="nt">"source"</span><span class="p">:</span><span class="w"> </span><span class="s2">"system"</span><span class="p">,</span><span class="w">
</span><span class="nt">"systemMessageId"</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span><span class="w">
</span><span class="nt">"subType"</span><span class="p">:</span><span class="w"> </span><span class="s2">"REGULAR"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"state"</span><span class="p">,</span><span class="w">
</span><span class="nt">"time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2017-02-27T06:24:21.930-05:00"</span><span class="p">,</span><span class="w">
</span><span class="nt">"state"</span><span class="p">:</span><span class="w"> </span><span class="s2">"chatting"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"3"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"line"</span><span class="p">,</span><span class="w">
</span><span class="nt">"time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2017-02-27T06:24:21.930-05:00"</span><span class="p">,</span><span class="w">
</span><span class="nt">"textType"</span><span class="p">:</span><span class="w"> </span><span class="s2">"plain"</span><span class="p">,</span><span class="w">
</span><span class="nt">"text"</span><span class="p">:</span><span class="w"> </span><span class="s2">"You are now chatting with Natalie."</span><span class="p">,</span><span class="w">
</span><span class="nt">"by"</span><span class="p">:</span><span class="w"> </span><span class="s2">"info"</span><span class="p">,</span><span class="w">
</span><span class="nt">"source"</span><span class="p">:</span><span class="w"> </span><span class="s2">"system"</span><span class="p">,</span><span class="w">
</span><span class="nt">"systemMessageId"</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w">
</span><span class="nt">"subType"</span><span class="p">:</span><span class="w"> </span><span class="s2">"REGULAR"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">]</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nt">"info"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nt">"link"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@href"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://{domain}/api/account/{accountId}/chat/{chatId}/info"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@rel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"self"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@href"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https:/{domain}/api/account/{accountId}/chat/{chatId}/info/visitorName"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@rel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"visitor-name"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@href"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://{domain}/api/account/{accountId}/chat/{chatId}/info/visitorTyping"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@rel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"visitor-typing"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"@href"</span><span class="p">:</span><span class="w"> </span><span class="s2">"{domain}/api/account/{accountId}/chat/{chatId}/info/agentTyping"</span><span class="p">,</span><span class="w">
</span><span class="nt">"@rel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"agent-typing"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">],</span><span class="w">
</span><span class="nt">"state"</span><span class="p">:</span><span class="w"> </span><span class="s2">"chatting"</span><span class="p">,</span><span class="w">
</span><span class="nt">"chatSessionKey"</span><span class="p">:</span><span class="w"> </span><span class="s2">"H3079121553394024223-70f331aba40b4ae58fe9e1af832e31b9K8388834"</span><span class="p">,</span><span class="w">
</span><span class="nt">"skillName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Sales"</span><span class="p">,</span><span class="w">
</span><span class="nt">"skillId"</span><span class="p">:</span><span class="w"> </span><span class="mi">25975313</span><span class="p">,</span><span class="w">
</span><span class="nt">"agentName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Natalie"</span><span class="p">,</span><span class="w">
</span><span class="nt">"agentId"</span><span class="p">:</span><span class="w"> </span><span class="mi">25025413</span><span class="p">,</span><span class="w">
</span><span class="nt">"startTime"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2017-02-27T06:24:15.425-05:00"</span><span class="p">,</span><span class="w">
</span><span class="nt">"duration"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
</span><span class="nt">"lastUpdate"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2017-02-27T06:24:31.188-05:00"</span><span class="p">,</span><span class="w">
</span><span class="nt">"chatTimeout"</span><span class="p">:</span><span class="w"> </span><span class="mi">40</span><span class="p">,</span><span class="w">
</span><span class="nt">"visitorId"</span><span class="p">:</span><span class="w"> </span><span class="mi">1214701440733986</span><span class="p">,</span><span class="w">
</span><span class="nt">"agentTyping"</span><span class="p">:</span><span class="w"> </span><span class="s2">"not-typing"</span><span class="p">,</span><span class="w">
</span><span class="nt">"visitorTyping"</span><span class="p">:</span><span class="w"> </span><span class="s2">"not-typing"</span><span class="p">,</span><span class="w">
</span><span class="nt">"visitorName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"You"</span><span class="p">,</span><span class="w">
</span><span class="nt">"rtSessionId"</span><span class="p">:</span><span class="w"> </span><span class="mi">4294967522</span><span class="p">,</span><span class="w">
</span><span class="nt">"sharkVisitorId"</span><span class="p">:</span><span class="w"> </span><span class="s2">"rloXnVgEQ-iQuoOytvKNqA"</span><span class="p">,</span><span class="w">
</span><span class="nt">"sharkSessionId"</span><span class="p">:</span><span class="w"> </span><span class="s2">"rN82d4rATN6EuiA4cJwaPg"</span><span class="p">,</span><span class="w">
</span><span class="nt">"sharkContextId"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
</span><span class="nt">"engagementId"</span><span class="p">:</span><span class="w"> </span><span class="mi">27469613</span><span class="p">,</span><span class="w">
</span><span class="nt">"campaignId"</span><span class="p">:</span><span class="w"> </span><span class="mi">26948813</span><span class="p">,</span><span class="w">
</span><span class="nt">"language"</span><span class="p">:</span><span class="w"> </span><span class="s2">"en-US"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
</div>
<p><strong>Elements in the Response</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left">Name</th>
<th style="text-align: left">Description</th>
<th style="text-align: left">Type</th>
<th style="text-align: left">Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left">events</td>
<td style="text-align: left">URI to retrieve the chat events, add a line or end a chat.</td>
<td style="text-align: left">link relationship</td>
<td style="text-align: left">See <a href="consumer-experience-server-chat-retrieve-chat-events.html">Retrieve Chat Events</a></td>
</tr>
<tr>
<td style="text-align: left">info</td>
<td style="text-align: left">URI to retrieve information regarding the current status of the chat.</td>
<td style="text-align: left">link relationship</td>
<td style="text-align: left">See <a href="consumer-experience-server-chat-retrieve-chat-information.html">Retrieve Chat Information</a>.</td>
</tr>
<tr>
<td style="text-align: left">transcript-request</td>
<td style="text-align: left">URI to send a transcript of the chat.</td>
<td style="text-align: left">link relationship</td>
<td style="text-align: left"> </td>
</tr>
<tr>
<td style="text-align: left">exit-survey</td>
<td style="text-align: left">URI to retrieve the Exit survey structure or to submit the survey data.</td>
<td style="text-align: left">link relationship</td>
<td style="text-align: left"> </td>
</tr>
<tr>
<td style="text-align: left">visitor-name</td>
<td style="text-align: left">URI to return the visitor’s name or set the visitor’s name.</td>
<td style="text-align: left">link relationship</td>
<td style="text-align: left"> </td>
</tr>
<tr>
<td style="text-align: left">visitor-typing</td>
<td style="text-align: left">URI to return visitor’s typing status or sets the visitor’s typing status.</td>
<td style="text-align: left">link relationship</td>
<td style="text-align: left"> </td>
</tr>
<tr>
<td style="text-align: left">agent-typing</td>
<td style="text-align: left">URI to return the agent’s typing status.</td>
<td style="text-align: left">link relationship</td>
<td style="text-align: left"> </td>
</tr>
<tr>
<td style="text-align: left">visit-session</td>
<td style="text-align: left">URI to get the visit session associated with this chat session.</td>
<td style="text-align: left">link relationship</td>
<td style="text-align: left">Included in the response only if the application key has Visit API privilege.</td>
</tr>
</tbody>
</table>
<div class="tags">
</div>
</div>
<hr class="shaded"/>
<footer>
<div class="row">
<div class="col-lg-12 footer">
©2017 LivePerson. All rights reserved.<br />This documentation is subject to change without notice.<br />
Site last generated: Mar 2, 2017 <br />
<p><img src="img/company_logo.png" alt="Company logo"/></p>
</div>
</div>
</footer>
</div>
<!-- /.row -->
</div>
<!-- /.container -->
</div>
</body>
</html> | mit |
Cryptcollector/ARG2.0 | src/qt/locale/bitcoin_fa.ts | 135299 | <TS language="fa" version="2.0">
<context>
<name>AboutDialog</name>
<message>
<source>About Argentum Core</source>
<translation type="unfinished"/>
</message>
<message>
<source><b>Argentum Core</b> version</source>
<translation type="unfinished"/>
</message>
<message>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source>
<translation>⏎ ⏎ این یک نرمافزار آزمایشی است⏎ ⏎ نرم افزار تحت مجوز MIT/X11 منتشر شده است. پروندهٔ COPYING یا نشانی http://www.opensource.org/licenses/mit-license.php. را ببینید⏎ ⏎ این محصول شامل نرمافزار توسعه دادهشده در پروژهٔ OpenSSL است. در این نرمافزار از OpenSSL Toolkit (http://www.openssl.org/) و نرمافزار رمزنگاری نوشته شده توسط اریک یانگ ([email protected]) و UPnP توسط توماس برنارد استفاده شده است.</translation>
</message>
<message>
<source>Copyright</source>
<translation>حق تألیف</translation>
</message>
<message>
<source>The Argentum Core developers</source>
<translation type="unfinished"/>
</message>
<message>
<source>(%1-bit)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<source>Double-click to edit address or label</source>
<translation>برای ویرایش نشانی یا برچسب دوبار کلیک کنید</translation>
</message>
<message>
<source>Create a new address</source>
<translation>ایجاد نشانی جدید</translation>
</message>
<message>
<source>&New</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy the currently selected address to the system clipboard</source>
<translation>کپی نشانی انتخاب شده به حافظهٔ سیستم</translation>
</message>
<message>
<source>&Copy</source>
<translation>&رونوشت</translation>
</message>
<message>
<source>C&lose</source>
<translation>&بستن</translation>
</message>
<message>
<source>&Copy Address</source>
<translation>&کپی نشانی</translation>
</message>
<message>
<source>Delete the currently selected address from the list</source>
<translation>حذف نشانی انتخابشده از لیست</translation>
</message>
<message>
<source>Export the data in the current tab to a file</source>
<translation>خروجی گرفتن دادههای برگهٔ فعلی به یک پرونده</translation>
</message>
<message>
<source>&Export</source>
<translation>&صدور</translation>
</message>
<message>
<source>&Delete</source>
<translation>&حذف</translation>
</message>
<message>
<source>Choose the address to send coins to</source>
<translation type="unfinished"/>
</message>
<message>
<source>Choose the address to receive coins with</source>
<translation type="unfinished"/>
</message>
<message>
<source>C&hoose</source>
<translation type="unfinished"/>
</message>
<message>
<source>Sending addresses</source>
<translation type="unfinished"/>
</message>
<message>
<source>Receiving addresses</source>
<translation type="unfinished"/>
</message>
<message>
<source>These are your Argentum addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation>اینها نشانیهای بیتکوین شما برای ارسال وجود هستند. همیشه قبل از ارسال سکهها، نشانی دریافتکننده و مقدار ارسالی را بررسی کنید.</translation>
</message>
<message>
<source>These are your Argentum addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy &Label</source>
<translation>کپی و برچسب&گذاری</translation>
</message>
<message>
<source>&Edit</source>
<translation>&ویرایش</translation>
</message>
<message>
<source>Export Address List</source>
<translation>استخراج لیست آدرس</translation>
</message>
<message>
<source>Comma separated file (*.csv)</source>
<translation>پروندهٔ نوع CSV جداشونده با کاما (*.csv)</translation>
</message>
<message>
<source>Exporting Failed</source>
<translation type="unfinished"/>
</message>
<message>
<source>There was an error trying to save the address list to %1.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<source>Label</source>
<translation>برچسب</translation>
</message>
<message>
<source>Address</source>
<translation>آدرس</translation>
</message>
<message>
<source>(no label)</source>
<translation>(بدون برچسب)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<source>Passphrase Dialog</source>
<translation>پنجرهٔ گذرواژه</translation>
</message>
<message>
<source>Enter passphrase</source>
<translation>گذرواژه را وارد کنید</translation>
</message>
<message>
<source>New passphrase</source>
<translation>گذرواژهٔ جدید</translation>
</message>
<message>
<source>Repeat new passphrase</source>
<translation>تکرار گذرواژهٔ جدید</translation>
</message>
<message>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>گذرواژهٔ جدید کیف پول خود را وارد کنید.<br/>لطفاً از گذرواژهای با <b>حداقل ۱۰ حرف تصادفی</b>، یا <b>حداقل هشت کلمه</b> انتخاب کنید.</translation>
</message>
<message>
<source>Encrypt wallet</source>
<translation>رمزنگاری کیف پول</translation>
</message>
<message>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>انجام این عملیات نیازمند گذرواژهٔ کیف پول شما برای باز کردن قفل آن است.</translation>
</message>
<message>
<source>Unlock wallet</source>
<translation>باز کردن قفل کیف پول</translation>
</message>
<message>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>انجام این عملیات نیازمند گذرواژهٔ کیف پول شما برای رمزگشایی کردن آن است.</translation>
</message>
<message>
<source>Decrypt wallet</source>
<translation>رمزگشایی کیف پول</translation>
</message>
<message>
<source>Change passphrase</source>
<translation>تغییر گذرواژه</translation>
</message>
<message>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>گذرواژهٔ قدیمی و جدید کیف پول را وارد کنید.</translation>
</message>
<message>
<source>Confirm wallet encryption</source>
<translation>تأیید رمزنگاری کیف پول</translation>
</message>
<message>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR ARGENTUMS</b>!</source>
<translation>هشدار: اگر کیف پول خود را رمزنگاری کنید و گذرواژه را فراموش کنید، <b>تمام دارایی بیتکوین خود را از دست خواهید داد</b>!</translation>
</message>
<message>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>آیا مطمئن هستید که میخواهید کیف پول خود را رمزنگاری کنید؟</translation>
</message>
<message>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation>مهم: هر نسخهٔ پشتیبانی که تا کنون از کیف پول خود تهیه کردهاید، باید با کیف پول رمزنگاری شدهٔ جدید جایگزین شود. به دلایل امنیتی، پروندهٔ قدیمی کیف پول بدون رمزنگاری، تا زمانی که از کیف پول رمزنگاریشدهٔ جدید استفاده نکنید، غیرقابل استفاده خواهد بود.</translation>
</message>
<message>
<source>Warning: The Caps Lock key is on!</source>
<translation>هشدار: کلید Caps Lock روشن است!</translation>
</message>
<message>
<source>Wallet encrypted</source>
<translation>کیف پول رمزنگاری شد</translation>
</message>
<message>
<source>Argentum will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your argentums from being stolen by malware infecting your computer.</source>
<translation>بیتکوین هم اکنون بسته میشود تا فرایند رمزگذاری را تمام کند. به خاطر داشته باشید که رمزگذاری کردن کیف پولتان نمیتواند به طور کامل بیتکوینهای شما را در برابر دزدیده شدن توسط بدافزارهایی که احتمالاً رایانهٔ شما را آلوده میکنند، محافظت نماید.</translation>
</message>
<message>
<source>Wallet encryption failed</source>
<translation>رمزنگاری کیف پول با شکست مواجه شد</translation>
</message>
<message>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>رمزنگاری کیف پول بنا به یک خطای داخلی با شکست مواجه شد. کیف پول شما رمزنگاری نشد.</translation>
</message>
<message>
<source>The supplied passphrases do not match.</source>
<translation>گذرواژههای داده شده با هم تطابق ندارند.</translation>
</message>
<message>
<source>Wallet unlock failed</source>
<translation>بازگشایی قفل کیفپول با شکست مواجه شد</translation>
</message>
<message>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>گذرواژهٔ وارد شده برای رمزگشایی کیف پول نادرست بود.</translation>
</message>
<message>
<source>Wallet decryption failed</source>
<translation>رمزگشایی ناموفق کیف پول</translation>
</message>
<message>
<source>Wallet passphrase was successfully changed.</source>
<translation>گذرواژهٔ کیف پول با موفقیت عوض شد.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<source>Sign &message...</source>
<translation>&امضای پیام...</translation>
</message>
<message>
<source>Synchronizing with network...</source>
<translation>همگامسازی با شبکه...</translation>
</message>
<message>
<source>&Overview</source>
<translation>&بررسی اجمالی</translation>
</message>
<message>
<source>Node</source>
<translation type="unfinished"/>
</message>
<message>
<source>Show general overview of wallet</source>
<translation>نمایش بررسی اجمالی کیف پول</translation>
</message>
<message>
<source>&Transactions</source>
<translation>&تراکنشها</translation>
</message>
<message>
<source>Browse transaction history</source>
<translation>مرور تاریخچهٔ تراکنشها</translation>
</message>
<message>
<source>E&xit</source>
<translation>&خروج</translation>
</message>
<message>
<source>Quit application</source>
<translation>خروج از برنامه</translation>
</message>
<message>
<source>Show information about Argentum</source>
<translation>نمایش اطلاعات در مورد بیتکوین</translation>
</message>
<message>
<source>About &Qt</source>
<translation>دربارهٔ &کیوت</translation>
</message>
<message>
<source>Show information about Qt</source>
<translation>نمایش اطلاعات دربارهٔ کیوت</translation>
</message>
<message>
<source>&Options...</source>
<translation>&تنظیمات...</translation>
</message>
<message>
<source>&Encrypt Wallet...</source>
<translation>&رمزنگاری کیف پول...</translation>
</message>
<message>
<source>&Backup Wallet...</source>
<translation>&پیشتیبانگیری از کیف پول...</translation>
</message>
<message>
<source>&Change Passphrase...</source>
<translation>&تغییر گذرواژه...</translation>
</message>
<message>
<source>Very &sending addresses...</source>
<translation type="unfinished"/>
</message>
<message>
<source>Receiving addresses...</source>
<translation type="unfinished"/>
</message>
<message>
<source>Open &URI...</source>
<translation type="unfinished"/>
</message>
<message>
<source>Importing blocks from disk...</source>
<translation>دریافت بلوکها از دیسک...</translation>
</message>
<message>
<source>Reindexing blocks on disk...</source>
<translation>بازنشانی بلوکها روی دیسک...</translation>
</message>
<message>
<source>Send coins to a Argentum address</source>
<translation>ارسال وجه به نشانی بیتکوین</translation>
</message>
<message>
<source>Modify configuration options for Argentum Core</source>
<translation>تغییر و اصلاح تنظیمات پیکربندی بیتکوین</translation>
</message>
<message>
<source>Backup wallet to another location</source>
<translation>تهیهٔ پشتیبان از کیف پول در یک مکان دیگر</translation>
</message>
<message>
<source>Change the passphrase used for wallet encryption</source>
<translation>تغییر گذرواژهٔ مورد استفاده در رمزنگاری کیف پول</translation>
</message>
<message>
<source>&Debug window</source>
<translation>پنجرهٔ ا&شکالزدایی</translation>
</message>
<message>
<source>Open debugging and diagnostic console</source>
<translation>باز کردن کنسول خطایابی و اشکالزدایی</translation>
</message>
<message>
<source>&Verify message...</source>
<translation>با&زبینی پیام...</translation>
</message>
<message>
<source>Argentum</source>
<translation>بیتکوین</translation>
</message>
<message>
<source>Wallet</source>
<translation>کیف پول</translation>
</message>
<message>
<source>&Send</source>
<translation>&ارسال</translation>
</message>
<message>
<source>&Receive</source>
<translation>&دریافت</translation>
</message>
<message>
<source>&Show / Hide</source>
<translation>&نمایش/ عدم نمایش</translation>
</message>
<message>
<source>Show or hide the main Window</source>
<translation>نمایش یا مخفیکردن پنجرهٔ اصلی</translation>
</message>
<message>
<source>Encrypt the private keys that belong to your wallet</source>
<translation>رمزنگاری کلیدهای خصوصی متعلق به کیف پول شما</translation>
</message>
<message>
<source>Sign messages with your Argentum addresses to prove you own them</source>
<translation>برای اثبات اینکه پیامها به شما تعلق دارند، آنها را با نشانی بیتکوین خود امضا کنید</translation>
</message>
<message>
<source>Verify messages to ensure they were signed with specified Argentum addresses</source>
<translation>برای حصول اطمینان از اینکه پیام با نشانی بیتکوین مشخص شده امضا است یا خیر، پیام را شناسایی کنید</translation>
</message>
<message>
<source>&File</source>
<translation>&فایل</translation>
</message>
<message>
<source>&Settings</source>
<translation>&تنظیمات</translation>
</message>
<message>
<source>&Help</source>
<translation>&کمکرسانی</translation>
</message>
<message>
<source>Tabs toolbar</source>
<translation>نوارابزار برگهها</translation>
</message>
<message>
<source>[testnet]</source>
<translation>[شبکهٔ آزمایش]</translation>
</message>
<message>
<source>Argentum Core</source>
<translation> هسته Argentum </translation>
</message>
<message>
<source>Request payments (generates QR codes and argentum: URIs)</source>
<translation type="unfinished"/>
</message>
<message>
<source>&About Argentum Core</source>
<translation type="unfinished"/>
</message>
<message>
<source>Show the list of used sending addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<source>Show the list of used receiving addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<source>Open a argentum: URI or payment request</source>
<translation type="unfinished"/>
</message>
<message>
<source>&Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<source>Show the Argentum Core help message to get a list with possible command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<source>Argentum client</source>
<translation>کلاینت بیتکوین</translation>
</message>
<message numerus="yes">
<source>%n active connection(s) to Argentum network</source>
<translation><numerusform>%n ارتباط فعال با شبکهٔ بیتکوین</numerusform></translation>
</message>
<message>
<source>No block source available...</source>
<translation>منبعی برای دریافت بلاک در دسترس نیست...</translation>
</message>
<message>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation>%1 بلاک از مجموع %2 بلاک (تخمینی) تاریخچهٔ تراکنشها پردازش شده است.</translation>
</message>
<message>
<source>Processed %1 blocks of transaction history.</source>
<translation>%1 بلاک از تاریخچهٔ تراکنشها پردازش شده است.</translation>
</message>
<message numerus="yes">
<source>%n hour(s)</source>
<translation><numerusform>%n ساعت</numerusform></translation>
</message>
<message numerus="yes">
<source>%n day(s)</source>
<translation><numerusform>%n روز</numerusform></translation>
</message>
<message numerus="yes">
<source>%n week(s)</source>
<translation><numerusform>%n هفته</numerusform></translation>
</message>
<message>
<source>%1 and %2</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<source>%n year(s)</source>
<translation type="unfinished"><numerusform/></translation>
</message>
<message>
<source>%1 behind</source>
<translation>%1 عقبتر</translation>
</message>
<message>
<source>Last received block was generated %1 ago.</source>
<translation>آخرین بلاک دریافتی %1 پیش ایجاد شده است.</translation>
</message>
<message>
<source>Transactions after this will not yet be visible.</source>
<translation>تراکنشهای بعد از این هنوز قابل مشاهده نیستند.</translation>
</message>
<message>
<source>Error</source>
<translation>خطا</translation>
</message>
<message>
<source>Warning</source>
<translation>هشدار</translation>
</message>
<message>
<source>Information</source>
<translation>اطلاعات</translation>
</message>
<message>
<source>Up to date</source>
<translation>وضعیت بهروز</translation>
</message>
<message>
<source>Catching up...</source>
<translation>بهروز رسانی...</translation>
</message>
<message>
<source>Sent transaction</source>
<translation>تراکنش ارسال شد</translation>
</message>
<message>
<source>Incoming transaction</source>
<translation>تراکنش دریافت شد</translation>
</message>
<message>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>تاریخ: %1
مبلغ: %2
نوع: %3
نشانی: %4
</translation>
</message>
<message>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>کیف پول <b>رمزنگاری شده</b> است و هماکنون <b>باز</b> است</translation>
</message>
<message>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>کیف پول <b>رمزنگاری شده</b> است و هماکنون <b>قفل</b> است</translation>
</message>
<message>
<source>A fatal error occurred. Argentum can no longer continue safely and will quit.</source>
<translation>یک خطای مهلک اتفاق افتاده است. بیتکوین نمیتواند بدون مشکل به کار خود ادامه دهد و بسته خواهد شد.</translation>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<source>Network Alert</source>
<translation>پیام شبکه</translation>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<source>Coin Control Address Selection</source>
<translation type="unfinished"/>
</message>
<message>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Amount:</source>
<translation>مبلغ:</translation>
</message>
<message>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Change:</source>
<translation type="unfinished"/>
</message>
<message>
<source>(un)select all</source>
<translation type="unfinished"/>
</message>
<message>
<source>Tree mode</source>
<translation type="unfinished"/>
</message>
<message>
<source>List mode</source>
<translation type="unfinished"/>
</message>
<message>
<source>Amount</source>
<translation>مبلغ</translation>
</message>
<message>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<source>Address</source>
<translation>نشانی</translation>
</message>
<message>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<source>Confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<source>Confirmed</source>
<translation>تأیید شده</translation>
</message>
<message>
<source>Priority</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy address</source>
<translation>کپی نشانی</translation>
</message>
<message>
<source>Copy label</source>
<translation>کپی برچسب</translation>
</message>
<message>
<source>Copy amount</source>
<translation>کپی مقدار</translation>
</message>
<message>
<source>Copy transaction ID</source>
<translation>کپی شناسهٔ تراکنش</translation>
</message>
<message>
<source>Lock unspent</source>
<translation type="unfinished"/>
</message>
<message>
<source>Unlock unspent</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<source>highest</source>
<translation type="unfinished"/>
</message>
<message>
<source>higher</source>
<translation type="unfinished"/>
</message>
<message>
<source>high</source>
<translation type="unfinished"/>
</message>
<message>
<source>medium-high</source>
<translation type="unfinished"/>
</message>
<message>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<source>low-medium</source>
<translation type="unfinished"/>
</message>
<message>
<source>low</source>
<translation type="unfinished"/>
</message>
<message>
<source>lower</source>
<translation type="unfinished"/>
</message>
<message>
<source>lowest</source>
<translation type="unfinished"/>
</message>
<message>
<source>(%1 locked)</source>
<translation type="unfinished"/>
</message>
<message>
<source>none</source>
<translation type="unfinished"/>
</message>
<message>
<source>Dust</source>
<translation type="unfinished"/>
</message>
<message>
<source>yes</source>
<translation>بله</translation>
</message>
<message>
<source>no</source>
<translation>خیر</translation>
</message>
<message>
<source>This label turns red, if the transaction size is greater than 1000 bytes.</source>
<translation type="unfinished"/>
</message>
<message>
<source>This means a fee of at least %1 per kB is required.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Can vary +/- 1 byte per input.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Transactions with higher priority are more likely to get included into a block.</source>
<translation type="unfinished"/>
</message>
<message>
<source>This label turns red, if the priority is smaller than "medium".</source>
<translation type="unfinished"/>
</message>
<message>
<source>This label turns red, if any recipient receives an amount smaller than %1.</source>
<translation type="unfinished"/>
</message>
<message>
<source>This means a fee of at least %1 is required.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Amounts below 0.546 times the minimum relay fee are shown as dust.</source>
<translation type="unfinished"/>
</message>
<message>
<source>This label turns red, if the change is smaller than %1.</source>
<translation type="unfinished"/>
</message>
<message>
<source>(no label)</source>
<translation>(بدون برچسب)</translation>
</message>
<message>
<source>change from %1 (%2)</source>
<translation type="unfinished"/>
</message>
<message>
<source>(change)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<source>Edit Address</source>
<translation>ویرایش نشانی</translation>
</message>
<message>
<source>&Label</source>
<translation>&برچسب</translation>
</message>
<message>
<source>The label associated with this address list entry</source>
<translation type="unfinished"/>
</message>
<message>
<source>The address associated with this address list entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"/>
</message>
<message>
<source>&Address</source>
<translation>&نشانی</translation>
</message>
<message>
<source>New receiving address</source>
<translation>نشانی دریافتی جدید</translation>
</message>
<message>
<source>New sending address</source>
<translation>نشانی ارسالی جدید</translation>
</message>
<message>
<source>Edit receiving address</source>
<translation>ویرایش نشانی دریافتی</translation>
</message>
<message>
<source>Edit sending address</source>
<translation>ویرایش نشانی ارسالی</translation>
</message>
<message>
<source>The entered address "%1" is already in the address book.</source>
<translation>نشانی وارد شده «%1» در حال حاضر در دفترچه وجود دارد.</translation>
</message>
<message>
<source>The entered address "%1" is not a valid Argentum address.</source>
<translation>نشانی وارد شده «%1» یک نشانی معتبر بیتکوین نیست.</translation>
</message>
<message>
<source>Could not unlock wallet.</source>
<translation>نمیتوان کیف پول را رمزگشایی کرد.</translation>
</message>
<message>
<source>New key generation failed.</source>
<translation>ایجاد کلید جدید با شکست مواجه شد.</translation>
</message>
</context>
<context>
<name>FreespaceChecker</name>
<message>
<source>A new data directory will be created.</source>
<translation>یک مسیر دادهٔ جدید ایجاد خواهد شد.</translation>
</message>
<message>
<source>name</source>
<translation>نام</translation>
</message>
<message>
<source>Directory already exists. Add %1 if you intend to create a new directory here.</source>
<translation>این پوشه در حال حاضر وجود دارد. اگر میخواهید یک دایرکتوری جدید در اینجا ایجاد کنید، %1 را اضافه کنید.</translation>
</message>
<message>
<source>Path already exists, and is not a directory.</source>
<translation>مسیر داده شده موجود است و به یک پوشه اشاره نمیکند.</translation>
</message>
<message>
<source>Cannot create data directory here.</source>
<translation>نمیتوان پوشهٔ داده در اینجا ایجاد کرد.</translation>
</message>
</context>
<context>
<name>HelpMessageDialog</name>
<message>
<source>Argentum Core - Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<source>Argentum Core</source>
<translation> هسته Argentum </translation>
</message>
<message>
<source>version</source>
<translation>نسخه</translation>
</message>
<message>
<source>Usage:</source>
<translation>استفاده:</translation>
</message>
<message>
<source>command-line options</source>
<translation>گزینههای خط فرمان</translation>
</message>
<message>
<source>UI options</source>
<translation>گزینههای رابط کاربری</translation>
</message>
<message>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>زبان را تنظیم کنید؛ برای مثال «de_DE» (زبان پیشفرض محلی)</translation>
</message>
<message>
<source>Start minimized</source>
<translation>اجرای برنامه به صورت کوچکشده</translation>
</message>
<message>
<source>Set SSL root certificates for payment request (default: -system-)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Show splash screen on startup (default: 1)</source>
<translation>نمایش پنجرهٔ خوشامدگویی در ابتدای اجرای برنامه (پیشفرض: 1)</translation>
</message>
<message>
<source>Choose data directory on startup (default: 0)</source>
<translation>انتخاب مسیر دادهها در ابتدای اجرای برنامه (پیشفرض: 0)</translation>
</message>
</context>
<context>
<name>Intro</name>
<message>
<source>Welcome</source>
<translation>خوشآمدید</translation>
</message>
<message>
<source>Welcome to Argentum Core.</source>
<translation type="unfinished"/>
</message>
<message>
<source>As this is the first time the program is launched, you can choose where Argentum Core will store its data.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Argentum Core will download and store a copy of the Argentum block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Use the default data directory</source>
<translation>استفاده از مسیر پیشفرض</translation>
</message>
<message>
<source>Use a custom data directory:</source>
<translation>استفاده از یک مسیر سفارشی:</translation>
</message>
<message>
<source>Argentum</source>
<translation>بیتکوین</translation>
</message>
<message>
<source>Error: Specified data directory "%1" can not be created.</source>
<translation>خطا: نمیتوان پوشهای برای دادهها در «%1» ایجاد کرد.</translation>
</message>
<message>
<source>Error</source>
<translation>خطا</translation>
</message>
<message>
<source>GB of free space available</source>
<translation>گیگابات فضا موجود است</translation>
</message>
<message>
<source>(of %1GB needed)</source>
<translation>(از %1 گیگابایت فضای مورد نیاز)</translation>
</message>
</context>
<context>
<name>OpenURIDialog</name>
<message>
<source>Open URI</source>
<translation type="unfinished"/>
</message>
<message>
<source>Open payment request from URI or file</source>
<translation type="unfinished"/>
</message>
<message>
<source>URI:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Select payment request file</source>
<translation type="unfinished"/>
</message>
<message>
<source>Select payment request file to open</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<source>Options</source>
<translation>گزینهها</translation>
</message>
<message>
<source>&Main</source>
<translation>&عمومی</translation>
</message>
<message>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source>
<translation>کارمزد اختیاریِ هر کیلوبایت برای انتقال سریعتر تراکنش. اکثر تراکنشها ۱ کیلوبایتی هستند.</translation>
</message>
<message>
<source>Pay transaction &fee</source>
<translation>پرداخت &کارمزد تراکنش</translation>
</message>
<message>
<source>Automatically start Argentum Core after logging in to the system.</source>
<translation>اجرای خودکار بیتکوین در زمان ورود به سیستم.</translation>
</message>
<message>
<source>&Start Argentum Core on system login</source>
<translation>&اجرای بیتکوین با ورود به سیستم</translation>
</message>
<message>
<source>Size of &database cache</source>
<translation type="unfinished"/>
</message>
<message>
<source>MB</source>
<translation type="unfinished"/>
</message>
<message>
<source>Number of script &verification threads</source>
<translation type="unfinished"/>
</message>
<message>
<source>Connect to the Argentum network through a SOCKS proxy.</source>
<translation type="unfinished"/>
</message>
<message>
<source>&Connect through SOCKS proxy (default proxy):</source>
<translation type="unfinished"/>
</message>
<message>
<source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Active command-line options that override above options:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Reset all client options to default.</source>
<translation>بازنشانی تمام تنظیمات به پیشفرض.</translation>
</message>
<message>
<source>&Reset Options</source>
<translation>&بازنشانی تنظیمات</translation>
</message>
<message>
<source>&Network</source>
<translation>&شبکه</translation>
</message>
<message>
<source>(0 = auto, <0 = leave that many cores free)</source>
<translation type="unfinished"/>
</message>
<message>
<source>W&allet</source>
<translation type="unfinished"/>
</message>
<message>
<source>Expert</source>
<translation>استخراج</translation>
</message>
<message>
<source>Enable coin &control features</source>
<translation type="unfinished"/>
</message>
<message>
<source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>
<translation type="unfinished"/>
</message>
<message>
<source>&Spend unconfirmed change</source>
<translation type="unfinished"/>
</message>
<message>
<source>Automatically open the Argentum client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>باز کردن خودکار درگاه شبکهٔ بیتکوین روی روترها. تنها زمانی کار میکند که روتر از پروتکل UPnP پشتیبانی کند و این پروتکل فعال باشد.</translation>
</message>
<message>
<source>Map port using &UPnP</source>
<translation>نگاشت درگاه شبکه با استفاده از پروتکل &UPnP</translation>
</message>
<message>
<source>Proxy &IP:</source>
<translation>آ&یپی پراکسی:</translation>
</message>
<message>
<source>&Port:</source>
<translation>&درگاه:</translation>
</message>
<message>
<source>Port of the proxy (e.g. 9050)</source>
<translation>درگاه پراکسی (مثال 9050)</translation>
</message>
<message>
<source>SOCKS &Version:</source>
<translation>&نسخهٔ SOCKS:</translation>
</message>
<message>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>نسخهٔ پراکسی SOCKS (مثلاً 5)</translation>
</message>
<message>
<source>&Window</source>
<translation>&پنجره</translation>
</message>
<message>
<source>Show only a tray icon after minimizing the window.</source>
<translation>تنها بعد از کوچک کردن پنجره، tray icon را نشان بده.</translation>
</message>
<message>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&کوچک کردن به سینی بهجای نوار وظیفه</translation>
</message>
<message>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>مخفی کردن در نوار کناری بهجای خروج هنگام بستن پنجره. زمانی که این گزینه فعال است، برنامه فقط با استفاده از گزینهٔ خروج در منو قابل بسته شدن است.</translation>
</message>
<message>
<source>M&inimize on close</source>
<translation>کوچک کردن &در زمان بسته شدن</translation>
</message>
<message>
<source>&Display</source>
<translation>&نمایش</translation>
</message>
<message>
<source>User Interface &language:</source>
<translation>زبان &رابط کاربری:</translation>
</message>
<message>
<source>The user interface language can be set here. This setting will take effect after restarting Argentum Core.</source>
<translation>زبان رابط کاربر میتواند در اینجا تنظیم شود. تنظیمات بعد از ظروع مجدد بیتکوین اعمال خواهد شد.</translation>
</message>
<message>
<source>&Unit to show amounts in:</source>
<translation>&واحد نمایش مبالغ:</translation>
</message>
<message>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>انتخاب واحد پول مورد استفاده برای نمایش در پنجرهها و برای ارسال سکه.</translation>
</message>
<message>
<source>Whether to show Argentum addresses in the transaction list or not.</source>
<translation>نمایش یا عدم نمایش نشانیهای بیتکوین در لیست تراکنشها.</translation>
</message>
<message>
<source>&Display addresses in transaction list</source>
<translation>نمایش ن&شانیها در فهرست تراکنشها</translation>
</message>
<message>
<source>Whether to show coin control features or not.</source>
<translation type="unfinished"/>
</message>
<message>
<source>&OK</source>
<translation>&تأیید</translation>
</message>
<message>
<source>&Cancel</source>
<translation>&لغو</translation>
</message>
<message>
<source>default</source>
<translation>پیشفرض</translation>
</message>
<message>
<source>none</source>
<translation type="unfinished"/>
</message>
<message>
<source>Confirm options reset</source>
<translation>تأییدِ بازنشانی گزینهها</translation>
</message>
<message>
<source>Client restart required to activate changes.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Client will be shutdown, do you want to proceed?</source>
<translation type="unfinished"/>
</message>
<message>
<source>This change would require a client restart.</source>
<translation>برای این تغییرات بازنشانی مشتری ضروری است</translation>
</message>
<message>
<source>The supplied proxy address is invalid.</source>
<translation>آدرس پراکسی داده شده صحیح نیست.</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<source>Form</source>
<translation>فرم</translation>
</message>
<message>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Argentum network after a connection is established, but this process has not completed yet.</source>
<translation>اطلاعات نمایشداده شده ممکن است قدیمی باشند. بعد از این که یک اتصال با شبکه برقرار شد، کیف پول شما بهصورت خودکار با شبکهٔ بیتکوین همگامسازی میشود. اما این روند هنوز کامل نشده است.</translation>
</message>
<message>
<source>Wallet</source>
<translation>کیف پول</translation>
</message>
<message>
<source>Available:</source>
<translation>در دسترس:</translation>
</message>
<message>
<source>Your current spendable balance</source>
<translation>تراز علیالحساب شما</translation>
</message>
<message>
<source>Pending:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>
<translation>مجموع تراکنشهایی که هنوز تأیید نشدهاند؛ و هنوز روی تراز علیالحساب اعمال نشدهاند</translation>
</message>
<message>
<source>Immature:</source>
<translation>نارسیده:</translation>
</message>
<message>
<source>Mined balance that has not yet matured</source>
<translation>تراز استخراج شده از معدن که هنوز بالغ نشده است</translation>
</message>
<message>
<source>Total:</source>
<translation>جمع کل:</translation>
</message>
<message>
<source>Your current total balance</source>
<translation>تراز کل فعلی شما</translation>
</message>
<message>
<source><b>Recent transactions</b></source>
<translation><b>تراکنشهای اخیر</b></translation>
</message>
<message>
<source>out of sync</source>
<translation>ناهمگام</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<source>URI handling</source>
<translation>مدیریت URI</translation>
</message>
<message>
<source>URI can not be parsed! This can be caused by an invalid Argentum address or malformed URI parameters.</source>
<translation>نشانی اینترنتی قابل تجزیه و تحلیل نیست! دلیل این وضعیت ممکن است یک نشانی نامعتبر بیتکوین و یا پارامترهای ناهنجار در URI بوده باشد.</translation>
</message>
<message>
<source>Requested payment amount of %1 is too small (considered dust).</source>
<translation type="unfinished"/>
</message>
<message>
<source>Payment request error</source>
<translation type="unfinished"/>
</message>
<message>
<source>Cannot start argentum: click-to-pay handler</source>
<translation>نمیتوان بیتکوین را اجرا کرد: کنترلکنندهٔ کلیک-و-پرداخت</translation>
</message>
<message>
<source>Net manager warning</source>
<translation type="unfinished"/>
</message>
<message>
<source>Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Payment request fetch URL is invalid: %1</source>
<translation type="unfinished"/>
</message>
<message>
<source>Payment request file handling</source>
<translation type="unfinished"/>
</message>
<message>
<source>Payment request file can not be read or processed! This can be caused by an invalid payment request file.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Unverified payment requests to custom payment scripts are unsupported.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Refund from %1</source>
<translation type="unfinished"/>
</message>
<message>
<source>Error communicating with %1: %2</source>
<translation type="unfinished"/>
</message>
<message>
<source>Payment request can not be parsed or processed!</source>
<translation type="unfinished"/>
</message>
<message>
<source>Bad response from server %1</source>
<translation type="unfinished"/>
</message>
<message>
<source>Payment acknowledged</source>
<translation type="unfinished"/>
</message>
<message>
<source>Network request error</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>QObject</name>
<message>
<source>Argentum</source>
<translation>بیتکوین</translation>
</message>
<message>
<source>Error: Specified data directory "%1" does not exist.</source>
<translation>خطا: پوشهٔ مشخص شده برای دادهها در «%1» وجود ندارد.</translation>
</message>
<message>
<source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Error: Invalid combination of -regtest and -testnet.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Argentum Core did't yet exit safely...</source>
<translation type="unfinished"/>
</message>
<message>
<source>Enter a Argentum address (e.g. AWRLWS0d6eEuu0qwsNBxkGxB4RV6FMo90X)</source>
<translation>یک آدرس بیتکوین وارد کنید (مثلاً AWRLWS0d6eEuu0qwsNBxkGxB4RV6FMo90X)</translation>
</message>
</context>
<context>
<name>QRImageWidget</name>
<message>
<source>&Save Image...</source>
<translation type="unfinished"/>
</message>
<message>
<source>&Copy Image</source>
<translation type="unfinished"/>
</message>
<message>
<source>Save QR Code</source>
<translation>ذخیرهٔ کد QR</translation>
</message>
<message>
<source>PNG Image (*.png)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<source>Client name</source>
<translation>نام کلاینت</translation>
</message>
<message>
<source>N/A</source>
<translation>ناموجود</translation>
</message>
<message>
<source>Client version</source>
<translation>نسخهٔ کلاینت</translation>
</message>
<message>
<source>&Information</source>
<translation>&اطلاعات</translation>
</message>
<message>
<source>Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<source>General</source>
<translation type="unfinished"/>
</message>
<message>
<source>Using OpenSSL version</source>
<translation>نسخهٔ OpenSSL استفاده شده</translation>
</message>
<message>
<source>Startup time</source>
<translation>زمان آغاز به کار</translation>
</message>
<message>
<source>Network</source>
<translation>شبکه</translation>
</message>
<message>
<source>Name</source>
<translation>اسم</translation>
</message>
<message>
<source>Number of connections</source>
<translation>تعداد ارتباطات</translation>
</message>
<message>
<source>Block chain</source>
<translation>زنجیرهٔ بلوکها</translation>
</message>
<message>
<source>Current number of blocks</source>
<translation>تعداد فعلی بلوکها</translation>
</message>
<message>
<source>Estimated total blocks</source>
<translation>تعداد تخمینی بلوکها</translation>
</message>
<message>
<source>Last block time</source>
<translation>زمان آخرین بلوک</translation>
</message>
<message>
<source>&Open</source>
<translation>با&ز کردن</translation>
</message>
<message>
<source>&Console</source>
<translation>&کنسول</translation>
</message>
<message>
<source>&Network Traffic</source>
<translation type="unfinished"/>
</message>
<message>
<source>&Clear</source>
<translation type="unfinished"/>
</message>
<message>
<source>Totals</source>
<translation>جمع کل:</translation>
</message>
<message>
<source>In:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Out:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Build date</source>
<translation>ساخت تاریخ</translation>
</message>
<message>
<source>Debug log file</source>
<translation>فایلِ لاگِ اشکال زدایی</translation>
</message>
<message>
<source>Open the Argentum debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation>فایلِ لاگِ اشکال زدایی Argentum را از دایرکتوری جاری داده ها باز کنید. این عملیات ممکن است برای فایلهای لاگِ حجیم طولانی شود.</translation>
</message>
<message>
<source>Clear console</source>
<translation>پاکسازی کنسول</translation>
</message>
<message>
<source>Welcome to the Argentum RPC console.</source>
<translation>به کنسور RPC بیتکوین خوش آمدید.</translation>
</message>
<message>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>دکمههای بالا و پایین برای پیمایش تاریخچه و <b>Ctrl-L</b> برای پاک کردن صفحه.</translation>
</message>
<message>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>برای نمایش یک مرور کلی از دستورات ممکن، عبارت <b>help</b> را بنویسید.</translation>
</message>
<message>
<source>%1 B</source>
<translation type="unfinished"/>
</message>
<message>
<source>%1 KB</source>
<translation type="unfinished"/>
</message>
<message>
<source>%1 MB</source>
<translation type="unfinished"/>
</message>
<message>
<source>%1 GB</source>
<translation type="unfinished"/>
</message>
<message>
<source>%1 m</source>
<translation type="unfinished"/>
</message>
<message>
<source>%1 h</source>
<translation type="unfinished"/>
</message>
<message>
<source>%1 h %2 m</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ReceiveCoinsDialog</name>
<message>
<source>&Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<source>&Label:</source>
<translation>&برچسب:</translation>
</message>
<message>
<source>&Message:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before.</source>
<translation type="unfinished"/>
</message>
<message>
<source>R&euse an existing receiving address (not recommended)</source>
<translation type="unfinished"/>
</message>
<message>
<source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Argentum network.</source>
<translation type="unfinished"/>
</message>
<message>
<source>An optional label to associate with the new receiving address.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Use this form to request payments. All fields are <b>optional</b>.</source>
<translation type="unfinished"/>
</message>
<message>
<source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Clear all fields of the form.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Clear</source>
<translation type="unfinished"/>
</message>
<message>
<source>Requested payments history</source>
<translation type="unfinished"/>
</message>
<message>
<source>&Request payment</source>
<translation type="unfinished"/>
</message>
<message>
<source>Show the selected request (does the same as double clicking an entry)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Show</source>
<translation type="unfinished"/>
</message>
<message>
<source>Remove the selected entries from the list</source>
<translation type="unfinished"/>
</message>
<message>
<source>Remove</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy label</source>
<translation>کپی برچسب</translation>
</message>
<message>
<source>Copy message</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy amount</source>
<translation>کپی مقدار</translation>
</message>
</context>
<context>
<name>ReceiveRequestDialog</name>
<message>
<source>QR Code</source>
<translation>کد QR</translation>
</message>
<message>
<source>Copy &URI</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy &Address</source>
<translation type="unfinished"/>
</message>
<message>
<source>&Save Image...</source>
<translation type="unfinished"/>
</message>
<message>
<source>Request payment to %1</source>
<translation type="unfinished"/>
</message>
<message>
<source>Payment information</source>
<translation type="unfinished"/>
</message>
<message>
<source>URI</source>
<translation type="unfinished"/>
</message>
<message>
<source>Address</source>
<translation>نشانی</translation>
</message>
<message>
<source>Amount</source>
<translation>مبلغ</translation>
</message>
<message>
<source>Label</source>
<translation>برچسب</translation>
</message>
<message>
<source>Message</source>
<translation>پیام</translation>
</message>
<message>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>URL ایجاد شده خیلی طولانی است. سعی کنید طول برچسب و یا پیام را کمتر کنید.</translation>
</message>
<message>
<source>Error encoding URI into QR Code.</source>
<translation>خطا در تبدیل نشانی اینترنتی به صورت کد QR.</translation>
</message>
</context>
<context>
<name>RecentRequestsTableModel</name>
<message>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<source>Label</source>
<translation>برچسب</translation>
</message>
<message>
<source>Message</source>
<translation>پیام</translation>
</message>
<message>
<source>Amount</source>
<translation>مبلغ</translation>
</message>
<message>
<source>(no label)</source>
<translation>(بدون برچسب)</translation>
</message>
<message>
<source>(no message)</source>
<translation type="unfinished"/>
</message>
<message>
<source>(no amount)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<source>Send Coins</source>
<translation>ارسال سکه</translation>
</message>
<message>
<source>Coin Control Features</source>
<translation type="unfinished"/>
</message>
<message>
<source>Inputs...</source>
<translation type="unfinished"/>
</message>
<message>
<source>automatically selected</source>
<translation type="unfinished"/>
</message>
<message>
<source>Insufficient funds!</source>
<translation type="unfinished"/>
</message>
<message>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Amount:</source>
<translation>مبلغ:</translation>
</message>
<message>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Change:</source>
<translation type="unfinished"/>
</message>
<message>
<source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Custom change address</source>
<translation type="unfinished"/>
</message>
<message>
<source>Send to multiple recipients at once</source>
<translation>ارسال به چند دریافتکنندهٔ بهطور همزمان</translation>
</message>
<message>
<source>Add &Recipient</source>
<translation>&دریافتکنندهٔ جدید</translation>
</message>
<message>
<source>Clear all fields of the form.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Clear &All</source>
<translation>پاکسازی &همه</translation>
</message>
<message>
<source>Balance:</source>
<translation>تزار:</translation>
</message>
<message>
<source>Confirm the send action</source>
<translation>عملیات ارسال را تأیید کنید</translation>
</message>
<message>
<source>S&end</source>
<translation>&ارسال</translation>
</message>
<message>
<source>Confirm send coins</source>
<translation>ارسال سکه را تأیید کنید</translation>
</message>
<message>
<source>%1 to %2</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy amount</source>
<translation>کپی مقدار</translation>
</message>
<message>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<source>Total Amount %1 (= %2)</source>
<translation type="unfinished"/>
</message>
<message>
<source>or</source>
<translation>یا</translation>
</message>
<message>
<source>The recipient address is not valid, please recheck.</source>
<translation>نشانی گیرنده معتبر نیست؛ لطفا دوباره بررسی کنید.</translation>
</message>
<message>
<source>The amount to pay must be larger than 0.</source>
<translation>مبلغ پرداخت باید بیشتر از ۰ باشد.</translation>
</message>
<message>
<source>The amount exceeds your balance.</source>
<translation>میزان پرداخت از تراز شما بیشتر است.</translation>
</message>
<message>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>با احتساب هزینهٔ %1 برای هر تراکنش، مجموع میزان پرداختی از مبلغ تراز شما بیشتر میشود.</translation>
</message>
<message>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>یک نشانی تکراری پیدا شد. در هر عملیات ارسال، به هر نشانی فقط مبلغ میتوان ارسال کرد.</translation>
</message>
<message>
<source>Transaction creation failed!</source>
<translation type="unfinished"/>
</message>
<message>
<source>The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Warning: Invalid Argentum address</source>
<translation type="unfinished"/>
</message>
<message>
<source>(no label)</source>
<translation>(بدون برچسب)</translation>
</message>
<message>
<source>Warning: Unknown change address</source>
<translation type="unfinished"/>
</message>
<message>
<source>Are you sure you want to send?</source>
<translation type="unfinished"/>
</message>
<message>
<source>added as transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<source>Payment request expired</source>
<translation type="unfinished"/>
</message>
<message>
<source>Invalid payment address %1</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<source>A&mount:</source>
<translation>A&مبلغ :</translation>
</message>
<message>
<source>Pay &To:</source>
<translation>پرداخ&ت به:</translation>
</message>
<message>
<source>The address to send the payment to (e.g. AWRLWS0d6eEuu0qwsNBxkGxB4RV6FMo90X)</source>
<translation>نشانی مقصد برای پرداخت (مثلاً AWRLWS0d6eEuu0qwsNBxkGxB4RV6FMo90X)</translation>
</message>
<message>
<source>Enter a label for this address to add it to your address book</source>
<translation>برای این نشانی یک برچسب وارد کنید تا در دفترچهٔ آدرس ذخیره شود</translation>
</message>
<message>
<source>&Label:</source>
<translation>&برچسب:</translation>
</message>
<message>
<source>Choose previously used address</source>
<translation type="unfinished"/>
</message>
<message>
<source>This is a normal payment.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<source>Paste address from clipboard</source>
<translation>چسباندن نشانی از حافظهٔ سیستم</translation>
</message>
<message>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<source>Remove this entry</source>
<translation type="unfinished"/>
</message>
<message>
<source>Message:</source>
<translation>پیام:</translation>
</message>
<message>
<source>This is a verified payment request.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Enter a label for this address to add it to the list of used addresses</source>
<translation type="unfinished"/>
</message>
<message>
<source>A message that was attached to the argentum: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Argentum network.</source>
<translation type="unfinished"/>
</message>
<message>
<source>This is an unverified payment request.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Pay To:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Memo:</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ShutdownWindow</name>
<message>
<source>Argentum Core is shutting down...</source>
<translation type="unfinished"/>
</message>
<message>
<source>Do not shut down the computer until this window disappears.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<source>Signatures - Sign / Verify a Message</source>
<translation>امضاها - امضا / تأیید یک پیام</translation>
</message>
<message>
<source>&Sign Message</source>
<translation>ا&مضای پیام</translation>
</message>
<message>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation>برای احراز اینکه پیامها از جانب شما هستند، میتوانید آنها را با نشانی خودتان امضا کنید. مراقب باشید چیزی که بدان اطمینان ندارید را امضا نکنید زیرا حملات فیشینگ ممکن است بخواهند از.پیامی با امضای شما سوءاستفاده کنند. تنها مواردی را که حاوی اطلاعات دقیق و قابل قبول برای شما هستند امضا کنید.</translation>
</message>
<message>
<source>The address to sign the message with (e.g. AWRLWS0d6eEuu0qwsNBxkGxB4RV6FMo90X)</source>
<translation>نشانی مورد استفاده برای امضا کردن پیام (برای مثال AWRLWS0d6eEuu0qwsNBxkGxB4RV6FMo90X)</translation>
</message>
<message>
<source>Choose previously used address</source>
<translation type="unfinished"/>
</message>
<message>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<source>Paste address from clipboard</source>
<translation>چسباندن نشانی از حافظهٔ سیستم</translation>
</message>
<message>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<source>Enter the message you want to sign here</source>
<translation>پیامی را که میخواهید امضا کنید در اینجا وارد کنید</translation>
</message>
<message>
<source>Signature</source>
<translation>امضا</translation>
</message>
<message>
<source>Copy the current signature to the system clipboard</source>
<translation>امضای فعلی را به حافظهٔ سیستم کپی کن</translation>
</message>
<message>
<source>Sign the message to prove you own this Argentum address</source>
<translation>برای اثبات تعلق این نشانی به شما، پیام را امضا کنید</translation>
</message>
<message>
<source>Sign &Message</source>
<translation>ا&مضای پیام</translation>
</message>
<message>
<source>Reset all sign message fields</source>
<translation>بازنشانی تمام فیلدهای پیام</translation>
</message>
<message>
<source>Clear &All</source>
<translation>پاک &کردن همه</translation>
</message>
<message>
<source>&Verify Message</source>
<translation>&شناسایی پیام</translation>
</message>
<message>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation>برای شناسایی پیام، نشانیِ امضا کننده و متن پیام را وارد کنید. (مطمئن شوید که فاصلهها، تبها و خطوط را عیناً کپی میکنید.) مراقب باشید در امضا چیزی بیشتر از آنچه در پیام میبینید وجود نداشته باشد تا فریب دزدان اینترنتی و حملات از نوع MITM را نخورید.</translation>
</message>
<message>
<source>The address the message was signed with (e.g. AWRLWS0d6eEuu0qwsNBxkGxB4RV6FMo90X)</source>
<translation>نشانی مورد استفاده برای امضا کردن پیام (برای مثال AWRLWS0d6eEuu0qwsNBxkGxB4RV6FMo90X)</translation>
</message>
<message>
<source>Verify the message to ensure it was signed with the specified Argentum address</source>
<translation>برای حصول اطمینان از اینکه پیام با نشانی بیتکوین مشخص شده امضا است یا خیر، پیام را شناسایی کنید</translation>
</message>
<message>
<source>Verify &Message</source>
<translation>&شناسایی پیام</translation>
</message>
<message>
<source>Reset all verify message fields</source>
<translation>بازنشانی تمام فیلدهای پیام</translation>
</message>
<message>
<source>Enter a Argentum address (e.g. AWRLWS0d6eEuu0qwsNBxkGxB4RV6FMo90X)</source>
<translation>یک نشانی بیتکوین وارد کنید (مثلاً AWRLWS0d6eEuu0qwsNBxkGxB4RV6FMo90X)</translation>
</message>
<message>
<source>Click "Sign Message" to generate signature</source>
<translation>برای ایجاد یک امضای جدید روی «امضای پیام» کلیک کنید</translation>
</message>
<message>
<source>The entered address is invalid.</source>
<translation>نشانی وارد شده نامعتبر است.</translation>
</message>
<message>
<source>Please check the address and try again.</source>
<translation>لطفاً نشانی را بررسی کنید و دوباره تلاش کنید.</translation>
</message>
<message>
<source>The entered address does not refer to a key.</source>
<translation>نشانی وارد شده به هیچ کلیدی اشاره نمیکند.</translation>
</message>
<message>
<source>Wallet unlock was cancelled.</source>
<translation>عملیات باز کرن قفل کیف پول لغو شد.</translation>
</message>
<message>
<source>Private key for the entered address is not available.</source>
<translation>کلید خصوصی برای نشانی وارد شده در دسترس نیست.</translation>
</message>
<message>
<source>Message signing failed.</source>
<translation>امضای پیام با شکست مواجه شد.</translation>
</message>
<message>
<source>Message signed.</source>
<translation>پیام امضا شد.</translation>
</message>
<message>
<source>The signature could not be decoded.</source>
<translation>امضا نمیتواند کدگشایی شود.</translation>
</message>
<message>
<source>Please check the signature and try again.</source>
<translation>لطفاً امضا را بررسی نموده و دوباره تلاش کنید.</translation>
</message>
<message>
<source>The signature did not match the message digest.</source>
<translation>امضا با خلاصهٔ پیام مطابقت ندارد.</translation>
</message>
<message>
<source>Message verification failed.</source>
<translation>شناسایی پیام با شکست مواجه شد.</translation>
</message>
<message>
<source>Message verified.</source>
<translation>پیام شناسایی شد.</translation>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<source>Argentum Core</source>
<translation> هسته Argentum </translation>
</message>
<message>
<source>The Argentum Core developers</source>
<translation type="unfinished"/>
</message>
<message>
<source>[testnet]</source>
<translation>آزمایش شبکه</translation>
</message>
</context>
<context>
<name>TrafficGraphWidget</name>
<message>
<source>KB/s</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<source>Open until %1</source>
<translation>باز تا %1</translation>
</message>
<message>
<source>conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<source>%1/offline</source>
<translation>%1/آفلاین</translation>
</message>
<message>
<source>%1/unconfirmed</source>
<translation>%1/تأیید نشده</translation>
</message>
<message>
<source>%1 confirmations</source>
<translation>%1 تأییدیه</translation>
</message>
<message>
<source>Status</source>
<translation>وضعیت</translation>
</message>
<message numerus="yes">
<source>, broadcast through %n node(s)</source>
<translation><numerusform>، پخش از طریق %n گره</numerusform></translation>
</message>
<message>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<source>Source</source>
<translation>منبع</translation>
</message>
<message>
<source>Generated</source>
<translation>تولید شده</translation>
</message>
<message>
<source>From</source>
<translation>فرستنده</translation>
</message>
<message>
<source>To</source>
<translation>گیرنده</translation>
</message>
<message>
<source>own address</source>
<translation>آدرس شما</translation>
</message>
<message>
<source>label</source>
<translation>برچسب</translation>
</message>
<message>
<source>Credit</source>
<translation>بدهی</translation>
</message>
<message numerus="yes">
<source>matures in %n more block(s)</source>
<translation><numerusform>بلوغ در %n بلوک دیگر</numerusform></translation>
</message>
<message>
<source>not accepted</source>
<translation>پذیرفته نشد</translation>
</message>
<message>
<source>Debit</source>
<translation>اعتبار</translation>
</message>
<message>
<source>Transaction fee</source>
<translation>هزینهٔ تراکنش</translation>
</message>
<message>
<source>Net amount</source>
<translation>مبلغ خالص</translation>
</message>
<message>
<source>Message</source>
<translation>پیام</translation>
</message>
<message>
<source>Comment</source>
<translation>نظر</translation>
</message>
<message>
<source>Transaction ID</source>
<translation>شناسهٔ تراکنش</translation>
</message>
<message>
<source>Merchant</source>
<translation type="unfinished"/>
</message>
<message>
<source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Debug information</source>
<translation>اطلاعات اشکالزدایی</translation>
</message>
<message>
<source>Transaction</source>
<translation>تراکنش</translation>
</message>
<message>
<source>Inputs</source>
<translation>ورودیها</translation>
</message>
<message>
<source>Amount</source>
<translation>مبلغ</translation>
</message>
<message>
<source>true</source>
<translation>درست</translation>
</message>
<message>
<source>false</source>
<translation>نادرست</translation>
</message>
<message>
<source>, has not been successfully broadcast yet</source>
<translation>، هنوز با موفقیت ارسال نشده</translation>
</message>
<message numerus="yes">
<source>Open for %n more block(s)</source>
<translation><numerusform>باز برای %n بلوک دیگر</numerusform></translation>
</message>
<message>
<source>unknown</source>
<translation>ناشناس</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<source>Transaction details</source>
<translation>جزئیات تراکنش</translation>
</message>
<message>
<source>This pane shows a detailed description of the transaction</source>
<translation>این پانل شامل توصیف کاملی از جزئیات تراکنش است</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<source>Type</source>
<translation>نوع</translation>
</message>
<message>
<source>Address</source>
<translation>نشانی</translation>
</message>
<message>
<source>Amount</source>
<translation>مبلغ</translation>
</message>
<message>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<source>Open for %n more block(s)</source>
<translation><numerusform>باز برای %n بلوک دیگر</numerusform></translation>
</message>
<message>
<source>Open until %1</source>
<translation>باز شده تا %1</translation>
</message>
<message>
<source>Confirmed (%1 confirmations)</source>
<translation>تأیید شده (%1 تأییدیه)</translation>
</message>
<message>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>این بلوک از هیچ همتای دیگری دریافت نشده است و احتمال میرود پذیرفته نشود!</translation>
</message>
<message>
<source>Generated but not accepted</source>
<translation>تولید شده ولی قبول نشده</translation>
</message>
<message>
<source>Offline</source>
<translation type="unfinished"/>
</message>
<message>
<source>Unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<source>Received with</source>
<translation>دریافتشده با</translation>
</message>
<message>
<source>Received from</source>
<translation>دریافتشده از</translation>
</message>
<message>
<source>Sent to</source>
<translation>ارسالشده به</translation>
</message>
<message>
<source>Payment to yourself</source>
<translation>پر داخت به خودتان</translation>
</message>
<message>
<source>Mined</source>
<translation>استخراجشده</translation>
</message>
<message>
<source>(n/a)</source>
<translation>(ناموجود)</translation>
</message>
<message>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>وضعیت تراکنش. نشانگر را روی این فیلد نگه دارید تا تعداد تأییدیهها نشان داده شود.</translation>
</message>
<message>
<source>Date and time that the transaction was received.</source>
<translation>تاریخ و ساعت دریافت تراکنش.</translation>
</message>
<message>
<source>Type of transaction.</source>
<translation>نوع تراکنش.</translation>
</message>
<message>
<source>Destination address of transaction.</source>
<translation>نشانی مقصد تراکنش.</translation>
</message>
<message>
<source>Amount removed from or added to balance.</source>
<translation>مبلغ کسر شده و یا اضافه شده به تراز.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<source>All</source>
<translation>همه</translation>
</message>
<message>
<source>Today</source>
<translation>امروز</translation>
</message>
<message>
<source>This week</source>
<translation>این هفته</translation>
</message>
<message>
<source>This month</source>
<translation>این ماه</translation>
</message>
<message>
<source>Last month</source>
<translation>ماه گذشته</translation>
</message>
<message>
<source>This year</source>
<translation>امسال</translation>
</message>
<message>
<source>Range...</source>
<translation>محدوده...</translation>
</message>
<message>
<source>Received with</source>
<translation>دریافتشده با </translation>
</message>
<message>
<source>Sent to</source>
<translation>ارسال به</translation>
</message>
<message>
<source>To yourself</source>
<translation>به خودتان</translation>
</message>
<message>
<source>Mined</source>
<translation>استخراجشده</translation>
</message>
<message>
<source>Other</source>
<translation>دیگر</translation>
</message>
<message>
<source>Enter address or label to search</source>
<translation>برای جستوجو نشانی یا برچسب را وارد کنید</translation>
</message>
<message>
<source>Min amount</source>
<translation>مبلغ حداقل</translation>
</message>
<message>
<source>Copy address</source>
<translation>کپی نشانی</translation>
</message>
<message>
<source>Copy label</source>
<translation>کپی برچسب</translation>
</message>
<message>
<source>Copy amount</source>
<translation>کپی مقدار</translation>
</message>
<message>
<source>Copy transaction ID</source>
<translation>کپی شناسهٔ تراکنش</translation>
</message>
<message>
<source>Edit label</source>
<translation>ویرایش برچسب</translation>
</message>
<message>
<source>Show transaction details</source>
<translation>نمایش جزئیات تراکنش</translation>
</message>
<message>
<source>Export Transaction History</source>
<translation type="unfinished"/>
</message>
<message>
<source>Exporting Failed</source>
<translation type="unfinished"/>
</message>
<message>
<source>There was an error trying to save the transaction history to %1.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Exporting Successful</source>
<translation type="unfinished"/>
</message>
<message>
<source>The transaction history was successfully saved to %1.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Comma separated file (*.csv)</source>
<translation>پروندهٔ نوع CSV جداشونده با کاما (*.csv)</translation>
</message>
<message>
<source>Confirmed</source>
<translation>تأیید شده</translation>
</message>
<message>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<source>Type</source>
<translation>نوع</translation>
</message>
<message>
<source>Label</source>
<translation>برچسب</translation>
</message>
<message>
<source>Address</source>
<translation>نشانی</translation>
</message>
<message>
<source>Amount</source>
<translation>مبلغ</translation>
</message>
<message>
<source>ID</source>
<translation>شناسه</translation>
</message>
<message>
<source>Range:</source>
<translation>محدوده:</translation>
</message>
<message>
<source>to</source>
<translation>به</translation>
</message>
</context>
<context>
<name>WalletFrame</name>
<message>
<source>No wallet has been loaded.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<source>Send Coins</source>
<translation>ارسال وجه</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<source>&Export</source>
<translation>&صدور</translation>
</message>
<message>
<source>Export the data in the current tab to a file</source>
<translation>داده ها نوارِ جاری را به فایل انتقال دهید</translation>
</message>
<message>
<source>Backup Wallet</source>
<translation>نسخهٔ پشتیبان کیف پول</translation>
</message>
<message>
<source>Wallet Data (*.dat)</source>
<translation>دادهٔ کیف پول (*.dat)</translation>
</message>
<message>
<source>Backup Failed</source>
<translation>خطا در پشتیبانگیری</translation>
</message>
<message>
<source>There was an error trying to save the wallet data to %1.</source>
<translation type="unfinished"/>
</message>
<message>
<source>The wallet data was successfully saved to %1.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Backup Successful</source>
<translation>پشتیبانگیری موفق</translation>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<source>Usage:</source>
<translation>استفاده:</translation>
</message>
<message>
<source>List commands</source>
<translation>نمایش لیست فرمانها</translation>
</message>
<message>
<source>Get help for a command</source>
<translation>راهنمایی در مورد یک دستور</translation>
</message>
<message>
<source>Options:</source>
<translation>گزینهها:</translation>
</message>
<message>
<source>Specify configuration file (default: argentum.conf)</source>
<translation>مشخص کردن فایل پیکربندی (پیشفرض: argentum.conf)</translation>
</message>
<message>
<source>Specify pid file (default: bitcoind.pid)</source>
<translation>مشخص کردن فایل شناسهٔ پردازش - pid - (پیشفرض: argentumd.pid)</translation>
</message>
<message>
<source>Specify data directory</source>
<translation>مشخص کردن دایرکتوری دادهها</translation>
</message>
<message>
<source>Listen for connections on <port> (default: 8333 or testnet: 18333)</source>
<translation>پذیرش اتصالات روی پورت <port> (پیشفرض: 8833 یا شبکهٔ آزمایشی: 18333)</translation>
</message>
<message>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>حداکثر <n> اتصال با همتایان برقرار شود (پیشفرض: ۱۲۵)</translation>
</message>
<message>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>اتصال به یک گره برای دریافت آدرسهای همتا و قطع اتصال پس از اتمام عملیات</translation>
</message>
<message>
<source>Specify your own public address</source>
<translation>آدرس عمومی خود را مشخص کنید</translation>
</message>
<message>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>حد آستانه برای قطع ارتباط با همتایان بدرفتار (پیشفرض: ۱۰۰)</translation>
</message>
<message>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>مدت زمان جلوگیری از اتصال مجدد همتایان بدرفتار، به ثانیه (پیشفرض: ۸۴۶۰۰)</translation>
</message>
<message>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation>هنگام تنظیم پورت RPC %u برای گوش دادن روی IPv4 خطایی رخ داده است: %s</translation>
</message>
<message>
<source>Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)</source>
<translation>پورت مورد شنود برای اتصالات JSON-RPC (پیشفرض: 8332 برای شبکهٔ تست 18332)</translation>
</message>
<message>
<source>Accept command line and JSON-RPC commands</source>
<translation>پذیرش دستورات خط فرمان و دستورات JSON-RPC</translation>
</message>
<message>
<source>Argentum Core RPC client version</source>
<translation type="unfinished"/>
</message>
<message>
<source>Run in the background as a daemon and accept commands</source>
<translation>اجرا در پشت زمینه بهصورت یک سرویس و پذیرش دستورات</translation>
</message>
<message>
<source>Use the test network</source>
<translation>استفاده از شبکهٔ آزمایش</translation>
</message>
<message>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>پذیرش اتصالات از بیرون (پیش فرض:1 بدون پراکسی یا اتصال)</translation>
</message>
<message>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=bitcoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "Argentum Alert" [email protected]
</source>
<translation type="unfinished"/>
</message>
<message>
<source>Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation>مقید به نشانی داده شده باشید و همیشه از آن پیروی کنید. از نشانه گذاری استاندار IPv6 به صورت Host]:Port] استفاده کنید.</translation>
</message>
<message>
<source>Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Error: Listening for incoming connections failed (listen returned error %d)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>تراکنش پذیرفته نیست! این خطا ممکن است در حالتی رخ داده باشد که مقداری از سکه های شما در کیف پولتان از جایی دیگر، همانند یک کپی از کیف پول اصلی اتان، خرج شده باشد اما در کیف پول اصلی اتان به عنوان مبلغ خرج شده، نشانه گذاری نشده باشد.</translation>
</message>
<message>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source>
<translation>خطا: این تراکنش به علت میزان وجه، دشواری، و یا استفاده از وجوه دریافتی اخیر نیازمند کارمزد به مبلغ حداقل %s است.</translation>
</message>
<message>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation>هنگامی که یک تراکنش در کیف پولی رخ می دهد، دستور را اجرا کن(%s در دستورات بوسیله ی TxID جایگزین می شود)</translation>
</message>
<message>
<source>Fees smaller than this are considered zero fee (for transaction creation) (default:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Flush database activity from memory pool to disk log every <n> megabytes (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<source>How thorough the block verification of -checkblocks is (0-4, default: 3)</source>
<translation type="unfinished"/>
</message>
<message>
<source>In this mode -genproclimit controls how many blocks are generated immediately.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Set the processor limit for when generation is on (-1 = unlimited, default: -1)</source>
<translation type="unfinished"/>
</message>
<message>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation>این یک نسخه ی آزمایشی است - با مسئولیت خودتان از آن استفاده کنید - آن را در معدن و بازرگانی بکار نگیرید.</translation>
</message>
<message>
<source>Unable to bind to %s on this computer. Argentum Core is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>هشدار: مبلغ paytxfee بسیار بالایی تنظیم شده است! این مبلغ هزینهای است که شما برای تراکنشها پرداخت میکنید.</translation>
</message>
<message>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Argentum will not work properly.</source>
<translation>هشدار: لطفا زمان و تاریخ رایانه خود را تصحیح نمایید! اگر ساعت رایانه شما اشتباه باشد bitcoin ممکن است صحیح کار نکند</translation>
</message>
<message>
<source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"/>
</message>
<message>
<source>(default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<source>(default: wallet.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<source><category> can be:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<source>Argentum Core Daemon</source>
<translation type="unfinished"/>
</message>
<message>
<source>Block creation options:</source>
<translation>بستن گزینه ایجاد</translation>
</message>
<message>
<source>Clear list of wallet transactions (diagnostic tool; implies -rescan)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Connect only to the specified node(s)</source>
<translation>تنها در گره (های) مشخص شده متصل شوید</translation>
</message>
<message>
<source>Connect through SOCKS proxy</source>
<translation type="unfinished"/>
</message>
<message>
<source>Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Connection options:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Corrupted block database detected</source>
<translation>یک پایگاه داده ی بلوک خراب یافت شد</translation>
</message>
<message>
<source>Debugging/Testing options:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Disable safemode, override a real safe mode event (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>آدرس آی.پی. خود را شناسایی کنید (پیش فرض:1 در زمان when listening وno -externalip)</translation>
</message>
<message>
<source>Do not load the wallet and disable wallet RPC calls</source>
<translation type="unfinished"/>
</message>
<message>
<source>Do you want to rebuild the block database now?</source>
<translation>آیا مایلید که اکنون پایگاه داده ی بلوک را بازسازی کنید؟</translation>
</message>
<message>
<source>Error initializing block database</source>
<translation>خطا در آماده سازی پایگاه داده ی بلوک</translation>
</message>
<message>
<source>Error initializing wallet database environment %s!</source>
<translation type="unfinished"/>
</message>
<message>
<source>Error loading block database</source>
<translation>خطا در بارگذاری پایگاه داده ها</translation>
</message>
<message>
<source>Error opening block database</source>
<translation>خطا در بازگشایی پایگاه داده ی بلوک</translation>
</message>
<message>
<source>Error: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation type="unfinished"/>
</message>
<message>
<source>Error: system error: </source>
<translation>خطا: خطای سامانه:</translation>
</message>
<message>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>شنیدن هر گونه درگاه انجام پذیر نیست. ازlisten=0 برای اینکار استفاده کیند.</translation>
</message>
<message>
<source>Failed to read block info</source>
<translation>خواندن اطلاعات بلوک با شکست مواجه شد</translation>
</message>
<message>
<source>Failed to read block</source>
<translation>خواندن بلوک با شکست مواجه شد</translation>
</message>
<message>
<source>Failed to sync block index</source>
<translation>همگام سازی فهرست بلوک با شکست مواجه شد</translation>
</message>
<message>
<source>Failed to write block index</source>
<translation>نوشتن فهرست بلوک با شکست مواجه شد</translation>
</message>
<message>
<source>Failed to write block info</source>
<translation>نوشتن اطلاعات بلوک با شکست مواجه شد</translation>
</message>
<message>
<source>Failed to write block</source>
<translation>نوشتن بلوک با شکست مواجه شد</translation>
</message>
<message>
<source>Failed to write file info</source>
<translation>نوشتن اطلاعات پرونده با شکست مواجه شد</translation>
</message>
<message>
<source>Failed to write to coin database</source>
<translation>نوشتن اطلاعات در پایگاه داده ی سکه ها با شکست مواجه شد</translation>
</message>
<message>
<source>Failed to write transaction index</source>
<translation>نوشتن فهرست تراکنش ها با شکست مواجه شد</translation>
</message>
<message>
<source>Failed to write undo data</source>
<translation>عملیات بازگشت دادن اطلاعات با شکست مواجه شدن</translation>
</message>
<message>
<source>Fee per kB to add to transactions you send</source>
<translation>نرخ هر کیلوبایت برای اضافه کردن به تراکنشهایی که میفرستید</translation>
</message>
<message>
<source>Fees smaller than this are considered zero fee (for relaying) (default:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation>قرینه ها را برای جستجوی DNS بیاب (پیش فرض: 1 مگر در زمان اتصال)</translation>
</message>
<message>
<source>Force safe mode (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Generate coins (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation>چند بلوک نیاز است که در ابتدای راه اندازی بررسی شوند(پیش فرض:288 ،0=همه)</translation>
</message>
<message>
<source>If <category> is not supplied, output all debugging information.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Importing...</source>
<translation type="unfinished"/>
</message>
<message>
<source>Incorrect or no genesis block found. Wrong datadir for network?</source>
<translation type="unfinished"/>
</message>
<message>
<source>Invalid -onion address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<source>Not enough file descriptors available.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Prepend debug output with timestamp (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<source>RPC client options:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation type="unfinished"/>
</message>
<message>
<source>Select SOCKS version for -proxy (4 or 5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Set database cache size in megabytes (%d to %d, default: %d)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Set maximum block size in bytes (default: %d)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Specify wallet file (within data directory)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Spend unconfirmed change when sending transactions (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<source>This is intended for regression testing tools and app development.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Usage (deprecated, use argentum-cli):</source>
<translation type="unfinished"/>
</message>
<message>
<source>Verifying blocks...</source>
<translation>در حال بازبینی بلوک ها...</translation>
</message>
<message>
<source>Verifying wallet...</source>
<translation>در حال بازبینی کیف پول...</translation>
</message>
<message>
<source>Wait for RPC server to start</source>
<translation type="unfinished"/>
</message>
<message>
<source>Wallet %s resides outside data directory %s</source>
<translation type="unfinished"/>
</message>
<message>
<source>Wallet options:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Warning: Deprecated argument -debugnet ignored, use -debug=net</source>
<translation type="unfinished"/>
</message>
<message>
<source>You need to rebuild the database using -reindex to change -txindex</source>
<translation type="unfinished"/>
</message>
<message>
<source>Imports blocks from external blk000??.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<source>Cannot obtain a lock on data directory %s. Argentum Core is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Output debugging information (default: 0, supplying <category> is optional)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: %d)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Information</source>
<translation>اطلاعات</translation>
</message>
<message>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<source>Limit size of signature cache to <n> entries (default: 50000)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Log transaction priority and fee per kB when mining blocks (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Maintain a full transaction index (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation>حداکثر بافر دریافت شده بر اساس اتصال <n>* 1000 بایت (پیش فرض:5000)</translation>
</message>
<message>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>حداکثر بافر دریافت شده بر اساس اتصال <n>* 1000 بایت (پیش فرض:1000)</translation>
</message>
<message>
<source>Only accept block chain matching built-in checkpoints (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation>تنها =به گره ها در شبکه متصا شوید <net> (IPv4, IPv6 or Tor)</translation>
</message>
<message>
<source>Print block on startup, if found in block index</source>
<translation type="unfinished"/>
</message>
<message>
<source>Print block tree on startup (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<source>RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"/>
</message>
<message>
<source>RPC server options:</source>
<translation type="unfinished"/>
</message>
<message>
<source>Randomly drop 1 of every <n> network messages</source>
<translation type="unfinished"/>
</message>
<message>
<source>Randomly fuzz 1 of every <n> network messages</source>
<translation type="unfinished"/>
</message>
<message>
<source>Run a thread to flush wallet periodically (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation>گزینه ssl (به ویکیbitcoin برای راهنمای راه اندازی ssl مراجعه شود)</translation>
</message>
<message>
<source>Send command to Argentum Core</source>
<translation type="unfinished"/>
</message>
<message>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>اطلاعات ردگیری/اشکالزدایی را به جای فایل لاگ اشکالزدایی به کنسول بفرستید</translation>
</message>
<message>
<source>Set minimum block size in bytes (default: 0)</source>
<translation>حداقل سایز بلاک بر اساس بایت تنظیم شود (پیش فرض: 0)</translation>
</message>
<message>
<source>Sets the DB_PRIVATE flag in the wallet db environment (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Show all debugging options (usage: --help -help-debug)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Show benchmark information (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>فایل debug.log را در startup مشتری کوچک کن (پیش فرض:1 اگر اشکال زدایی روی نداد)</translation>
</message>
<message>
<source>Signing transaction failed</source>
<translation type="unfinished"/>
</message>
<message>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>(میلی ثانیه )فاصله ارتباط خاص</translation>
</message>
<message>
<source>Start Argentum Core Daemon</source>
<translation type="unfinished"/>
</message>
<message>
<source>System error: </source>
<translation>خطای سامانه</translation>
</message>
<message>
<source>Transaction amount too small</source>
<translation type="unfinished"/>
</message>
<message>
<source>Transaction amounts must be positive</source>
<translation type="unfinished"/>
</message>
<message>
<source>Transaction too large</source>
<translation type="unfinished"/>
</message>
<message>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>از UPnP برای شناسایی درگاه شنیداری استفاده کنید (پیش فرض:0)</translation>
</message>
<message>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>از UPnP برای شناسایی درگاه شنیداری استفاده کنید (پیش فرض:1 در زمان شنیدن)</translation>
</message>
<message>
<source>Username for JSON-RPC connections</source>
<translation>JSON-RPC شناسه برای ارتباطات</translation>
</message>
<message>
<source>Warning</source>
<translation>هشدار</translation>
</message>
<message>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation>هشدار: این نسخه قدیمی است، روزآمدسازی مورد نیاز است</translation>
</message>
<message>
<source>Zapping all transactions from wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<source>on startup</source>
<translation type="unfinished"/>
</message>
<message>
<source>version</source>
<translation>نسخه</translation>
</message>
<message>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<source>Password for JSON-RPC connections</source>
<translation>JSON-RPC عبارت عبور برای ارتباطات</translation>
</message>
<message>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>از آدرس آی پی خاص JSON-RPC قبول ارتباطات</translation>
</message>
<message>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>(127.0.0.1پیش فرض: ) &lt;ip&gt; دادن فرمانها برای استفاده گره ها روی</translation>
</message>
<message>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>زمانی که بهترین بلاک تغییر کرد، دستور را اجرا کن (%s در cmd با block hash جایگزین شده است)</translation>
</message>
<message>
<source>Upgrade wallet to latest format</source>
<translation>wallet را به جدیدترین فرمت روزآمد کنید</translation>
</message>
<message>
<source>Set key pool size to <n> (default: 100)</source>
<translation> (100پیش فرض:)&lt;n&gt; گذاشتن اندازه کلید روی </translation>
</message>
<message>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>اسکان مجدد زنجیر بلوکها برای گم والت معامله</translation>
</message>
<message>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>JSON-RPCبرای ارتباطات استفاده کنید OpenSSL (https)</translation>
</message>
<message>
<source>Server certificate file (default: server.cert)</source>
<translation> (server.certپیش فرض: )گواهی نامه سرور</translation>
</message>
<message>
<source>Server private key (default: server.pem)</source>
<translation>(server.pemپیش فرض: ) کلید خصوصی سرور</translation>
</message>
<message>
<source>This help message</source>
<translation>پیام کمکی</translation>
</message>
<message>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>امکان اتصال به %s از این رایانه وجود ندارد ( bind returned error %d, %s)</translation>
</message>
<message>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>به DNS اجازه بده تا برای addnode ، seednode و اتصال جستجو کند</translation>
</message>
<message>
<source>Loading addresses...</source>
<translation>بار گیری آدرس ها</translation>
</message>
<message>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>خطا در بارگیری wallet.dat: کیف پول خراب شده است</translation>
</message>
<message>
<source>Error loading wallet.dat: Wallet requires newer version of Argentum</source>
<translation>خطا در بارگیری wallet.dat: کیف پول به ویرایش جدیدتری از Biticon نیاز دارد</translation>
</message>
<message>
<source>Wallet needed to be rewritten: restart Argentum to complete</source>
<translation>سلام</translation>
</message>
<message>
<source>Error loading wallet.dat</source>
<translation>خطا در بارگیری wallet.dat</translation>
</message>
<message>
<source>Invalid -proxy address: '%s'</source>
<translation>آدرس پراکسی اشتباه %s</translation>
</message>
<message>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>شبکه مشخص شده غیرقابل شناسایی در onlynet: '%s'</translation>
</message>
<message>
<source>Unknown -socks proxy version requested: %i</source>
<translation>نسخه پراکسی ساکس غیرقابل شناسایی درخواست شده است: %i</translation>
</message>
<message>
<source>Cannot resolve -bind address: '%s'</source>
<translation>آدرس قابل اتصال- شناسایی نیست %s</translation>
</message>
<message>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>آدرس خارجی قابل اتصال- شناسایی نیست %s</translation>
</message>
<message>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>میزان وجه اشتباه برای paytxfee=<میزان وجه>: %s</translation>
</message>
<message>
<source>Invalid amount</source>
<translation>میزان وجه اشتباه</translation>
</message>
<message>
<source>Insufficient funds</source>
<translation>بود جه نا کافی </translation>
</message>
<message>
<source>Loading block index...</source>
<translation>بار گیری شاخص بلوک</translation>
</message>
<message>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>به اتصال یک گره اضافه کنید و اتصال را باز نگاه دارید</translation>
</message>
<message>
<source>Loading wallet...</source>
<translation>بار گیری والت</translation>
</message>
<message>
<source>Cannot downgrade wallet</source>
<translation>امکان تنزل نسخه در wallet وجود ندارد</translation>
</message>
<message>
<source>Cannot write default address</source>
<translation>آدرس پیش فرض قابل ذخیره نیست</translation>
</message>
<message>
<source>Rescanning...</source>
<translation>اسکان مجدد</translation>
</message>
<message>
<source>Done loading</source>
<translation>بار گیری انجام شده است</translation>
</message>
<message>
<source>To use the %s option</source>
<translation>برای استفاده از %s از انتخابات</translation>
</message>
<message>
<source>Error</source>
<translation>خطا</translation>
</message>
<message>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation>، شما باید یک rpcpassword را در فایل پیکربندی تنظیم کنید :⏎%s⏎ اگر فایل ایجاد نشد، یک فایل فقط متنی ایجاد کنید.
</translation>
</message>
</context>
</TS> | mit |
github/codeql | javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath-es6.js | 332 | import { readFileSync } from 'fs';
import { createServer } from 'http';
import { parse } from 'url';
import { join } from 'path';
var server = createServer(function(req, res) {
let path = parse(req.url, true).query.path;
// BAD: This could read any file on the file system
res.write(readFileSync(join("public", path)));
});
| mit |
imasaru/sabbath-school-lessons | src/fj/2020-04/10/07.md | 2975 | ---
title: Kuri Ni Vakasama
date: 04/12/2020
---
E rua na vakasama vakavuku e basika ka vakavuna na kena laki yaco me kina me dina e vuqa na ka, ka yaco me cala na ka dina; Matai, ko ira na vuku era vulica na vuravura, ena dodonu me rai ga ki na vuravura me sauma vei ira na vakatataro; karua, era nanuma na vuku ni lawa ni veika bula ena dodonu me tudei tu ga. Ia koi rau ruarua oqo erau cala ni biu vata kei na ka dina.
Taura mada na kenai matai, o koya na kena yaco e dua na ka e vu mai na veika sa tu me laki yaco me basika kina e dua tale na ka. Oya e vinaka ena kena vakamuri na cagi kaukauwa, ia e ca sara vakalevu mai na tawa yaga ni ka dina e tekivu “Enai vakatekivu sa bulia na lomalagi kei na vuravura na Kalou” (Vakatekivu 1:1). Na cava era na vakatavulica veikeda ko ira na vuku, ena vuku ni nodra sega ni duavata kei nai tekitekivu ni dua na kaukauwa e duatani vakaoti, ena vuku ni nodra a sega ni duavata kei na kaukauwa vuni oya ni ka dina?
Kei na tu dei ni veika bula? E rairai vakaibalebale na ka oqo, vakavo ena Roma 5: 12— “Ia mevaka sa curu ki vuravura nai valavala ca ena vuku ni tamata e le dua, kei na mate ena vuku ni valavala ca, a sa yaco vaka-kina na mate ki na tamata kecega ni sa cala na tamata kecega”—taura mada na yalayala ni ituvaki ni vanua, kei na duidui ni kenai vakatagedegede, mai na veika kece era sega ni duavata kina na vuku. Na vuravura e sega ni basika kina na mate ena duidui vakaoti mai na veika eda na rawa ni vulica ena gauna oqo, ia na kena nanumi ni vaka era tautauvata, ia era sega, era veivakacalai talega.
Ena vuku ni ka oya, e laki cala kina na nodra nanuma na vuku me baleta nai tekitekivu, baleta ni ra cakitaka e rua na ka bibi ni veibuli: na kaukauwa vuni ka tiko mai dakuna kei na bibi ni kena sa vakavotukana na cacavukavuka e tiko ena maliwa ni veibuli taumada kei na veika sa tu e matada ena gauna oqo.
**Taro ni Veiwasei**
`1.Veivosakitaka na vosa oqo, na totoka. Na cava na totoka? Eda na vakamacalataka rawa vakacava? Ena vakamacalataka ka kila vakacava e dua na tamata lotu na totoka mai vei ira na sega ni lotu?`
`2. Ena rawa vei Karisito me lako mai ki vuravura mevaka e dua na dauvakadidike, ka sau levu duadua ena vuku ni Nona vakadidike. Ena rawa Vua me vakumuna vata mai na rogo mevakataki ira na dau lagasere. Ia, e lako mai ka vakatavulici me dua na matai yalomalumalumu. E a tiko ena gauna ni veibuli, ia e vakatavulici me daukaulotu ka rawata vakavinaka na Nonai tavi. Na veivakayaloqaqataki cava ena rawa ni kauta mai ki veikeda, se na vanua cava ga eda tu kina ena noda lakolako ni vuli ka?`
`3. E dina ga ni so vei ira na tawa lotu Vakarisito era kacivi mera qasenivuli ena veikoronivuli, na Lotu Vakarisito ena rawa ni ra veivakatavulici vei ira na tani ena vosa kei na cakacaka, era nakita se sega ni kila vakadua. Ena vuku ni ka oqo, nai tovo cava ena dodonu mera bucina cake na Lotu Vakarisito, mevaka e dua na gonevuli nei Karisito kei na dua na qasenivuli e vuravura?` | mit |
davidressman/gpfs-utils | file2nsd.pl | 9422 | #!/usr/bin/env perl
# The MIT License (MIT)
#
# Copyright (c) 2014 David Ressman, [email protected]
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
use vars;
use strict;
use Getopt::Long;
use Data::Dumper;
use POSIX qw/floor/;
use Expect;
#use Pod::Usage;
use autouse 'Pod::Usage' => qw(pod2usage);
### Begin Config ######################################################
my $mmfs_path = '/usr/lpp/mmfs/bin';
# debugging stuff:
my $DEBUG = 0;
$Expect::Debug = 0;
$Expect::Log_Stdout = 0;
### End Config ########################################################
my %options_hash;
my $rc = GetOptions ( \%options_hash, 'file|f=s', 'filesystem|s=s',
'help|h', 'man');
pod2usage(1) if $options_hash{'help'};
pod2usage(-noperldoc => 0, -exitstatus => 0, -verbose => 2) if $options_hash{'man'};
if ((! $options_hash{'file'}) || (! -f $options_hash{'file'})) {
pod2usage("-f FILE is mandatory and FILE must be a regular file");
}
# Initialize the vars for the report
my ($f_inode, $f_filename, $f_size, $f_begin, $f_end, $f_nsd);
my $nsd_idhash = get_nsd_idhash($options_hash{'filesystem'});
# Locate the file's inode
#
my @stat_arr = stat($options_hash{'file'}) or die "$!: $options_hash{'file'}";
my $file_inode = $stat_arr[1];
my $file_size = $stat_arr[7];
if ($DEBUG == 1) { print "inode: $file_inode\n";}
if ($DEBUG == 1) { print "size: $file_size\n";}
# Get the filesystem's block size, so we know how many blocks this file is
# spread over.
#
my $fsblocksize = get_fsblocksize($options_hash{'filesystem'});
if (! $fsblocksize) {
print STDERR
"Couldn't retrieve GPFS block size for $options_hash{'filesystem'}\n";
exit(1);
}
# We just need to know how many blocks in the file so we know how
# many times to iterate in tsdbfs.
#
my $div_result = $file_size / $fsblocksize;
my $num_iterations;
if (isint($div_result)) {
$num_iterations = $div_result - 1;
} else {
$num_iterations = floor($div_result);
}
my $inode_devarr = get_blocklist_from_inode( $options_hash{'filesystem'},
$file_inode, $num_iterations);
$f_filename = $options_hash{'file'};
$f_size = sprintf("%#x", $file_size) . " B";
$f_inode = $file_inode;
$~ = 'REPORT';
$^ = 'REPORT_TOP';
$| = 1;
$= = 0x99999999;
my $start_block = 0;
foreach my $dev_string (@$inode_devarr) {
my ($device, $sector) = split(/:/, $dev_string, 2);
$f_nsd = "$nsd_idhash->{$device}:$sector";
$f_begin = sprintf("%#x", $start_block);
$f_end = sprintf("%#x", $start_block + $fsblocksize - 1);
write;
$start_block += $fsblocksize;
}
#################################################################
sub get_nsd_idhash {
my $fs = shift;
my $nsd_idhash;
open(MMLSDISK, '-|', "${mmfs_path}/mmlsdisk", $fs, '-i') or die $!;
my $i = 0;
while (<MMLSDISK>) {
++$i;
next if $i < 4;
my @split_arr = split(/\s+/, $_);
$nsd_idhash->{$split_arr[8]} = $split_arr[0];
}
close MMLSDISK or die $!;
return($nsd_idhash);
}
sub get_blocklist_from_inode {
my $fs = shift;
my $inode = shift;
my $num_blocks = shift;
# A reference to an array of the devices containing the blocks of
# this file
my $dev_list;
my $expect_return;
my $tsdbfs = new Expect();
$tsdbfs->raw_pty(1);
$tsdbfs->spawn("${mmfs_path}/tsdbfs", $fs);
# Look for the initial strings so we know we opened the right program
@{$expect_return} = $tsdbfs->expect(2, 'Type ? for help.');
if ($expect_return->[1]) {
print STERR "Did not get initial string from tsdbfs\n";
return(undef);
}
# Ok, here goes!
$tsdbfs->send("blockaddr $inode 0\n");
@{$expect_return} = $tsdbfs->expect(5, '-re',
'Inode [\d]+ snap [\d]+ offset 0 N=[\d]+ [\d]+:[\d]+');
if ($expect_return->[1]) {
print STERR "Did not get string back tsdbfs\n";
return(undef);
}
# We have the string corresponding to the first block
my $out_string = $expect_return->[2];
if ($out_string =~ m/.* ([\d]+:[\d]+)$/) {
push(@$dev_list, $1);
}
# Make sure we're accepting input again.
@{$expect_return} = $tsdbfs->expect(30, '-re', 'Type \? for help.\n');
if ($expect_return->[1]) {
print STERR "Did not get initial string from tsdbfs\n";
return(undef);
}
if ($num_blocks > 0) {
$tsdbfs->send("iterate $num_blocks\n");
# Make sure we're accepting input again.
@{$expect_return} = $tsdbfs->expect(180, 'Enter command or null');
if ($expect_return->[1]) {
print STERR "Did not get initial string from tsdbfs\n";
return(undef);
}
my $iterate_data_str = $expect_return->[3];
chomp $iterate_data_str;
my @iterate_data_arr = split(/\n/, $iterate_data_str);
foreach my $block_data (@iterate_data_arr) {
if ($block_data =~ /^Inode [\d]+.*[\s]+([\d]+:[\d]+)$/) {
push(@$dev_list, $1);
}
}
}
$tsdbfs->send("quit\n");
$tsdbfs->soft_close();
return($dev_list);
}
sub get_fsblocksize {
my $fs = shift();
if (! open(MMLSFS, "-|", "${mmfs_path}/mmlsfs", ${fs}, '-B')) {
print STDERR $!, "\n";
return(undef);
}
while (<MMLSFS>) {
chomp;
# Look for the line containing the actual data
#if ($_ =~ m/^[\s]*-B/) {
# $_ =~ s/^[\s]+//;
# my ($flag, $block_size, $cruft) = split(/[\s]+/);
# next if ($_ =~ m/system/);
#
# # check to make sure the block size is actually a number
# if ($block_size =~ m/^[0-9]+$/) {
# close(MMLSFS) or die $!;
# return($block_size);
# }
#}
next if ($_ =~ m/system/);
next if ($_ =~ m/^__+/);
next if ($_ =~ m/^flag/);
my ($flag, $block_size, $cruft) = split(/[\s]+/);
# check to make sure the block size is actually a number
if ($block_size =~ m/^[0-9]+$/) {
close(MMLSFS) or die $!;
return($block_size);
}
}
# We shouldn't be here. We should have returned with the block size
# by now. Throw an error.
close(MMLSFS) or die $!;
return(undef);
}
sub get_blocklist {
my $inode = shift();
my $fs = shift();
}
sub isint {
my $num = shift;
return ($num =~ m/^[\d]+$/);
}
format REPORT_TOP =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$f_filename
FS Block Size: @<<<<<<<<<<<<<<< Inode: @<<<<<<<<<<<< Size: @<<<<<<<<<<<<<<<
$fsblocksize $f_inode $f_size
start offset - end offset NSD:sector
(in bytes) (in bytes)
--------------------------------------------------------------------------------
.
format REPORT =
@>>>>>>>>>>>>>>> - @<<<<<<<<<<<<<<< -------------- @<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$f_begin $f_end $f_nsd
.
__END__
=head1 NAME
gpfs_file2nsd - Given a filename, produce the list of NSDs on which
that file's data resides.
=head1 SYNOPSIS
gpfs_file2nsd [options] [-f <filename>] [-s <filesystem>]
Options:
-h, --help brief help message
--man display full documentation
-f FILE full pathname of file to analyze
REQUIRED
-s FILESYSTEM gpfs filesystem name
REQUIRED
=head1 OPTIONS
=over 8
=item B<-h>, B<--help>
Print a brief help message and exit.
=item B<--man>
Print the full man page and exit.
=item B<-f FILE>
The full path of the file to be analyzed
=item B<-s FILESYSTEM>
The name of the GPFS filesystem on which the file resides. NOTE: This is the filesystem name as gpfs knows it, so it's not a pathname.
=back
=cut
| mit |
ThomasBarnekow/Open-XML-SDK | src/DocumentFormat.OpenXml/GeneratedCode/schemas_microsoft_com_office_drawing_2012_chart.g.cs | 211463 | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#nullable enable
#pragma warning disable CS0618 // Type or member is obsolete
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Drawing;
using DocumentFormat.OpenXml.Drawing.Charts;
using DocumentFormat.OpenXml.Framework;
using DocumentFormat.OpenXml.Framework.Metadata;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Validation.Schema;
using System;
using System.Collections.Generic;
using System.IO.Packaging;
namespace DocumentFormat.OpenXml.Office2013.Drawing.Chart
{
/// <summary>
/// <para>Defines the PivotSource Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:pivotSource.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ExtensionList" /> <c><c:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.FormatId" /> <c><c:fmtId></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.PivotTableName" /> <c><c:name></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:pivotSource")]
public partial class PivotSource : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the PivotSource class.
/// </summary>
public PivotSource() : base()
{
}
/// <summary>
/// Initializes a new instance of the PivotSource class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public PivotSource(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the PivotSource class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public PivotSource(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the PivotSource class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public PivotSource(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:pivotSource");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ExtensionList>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.FormatId>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.PivotTableName>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.PivotTableName), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.FormatId), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ExtensionList), 0, 1)
};
}
/// <summary>
/// <para>Pivot Name.</para>
/// <para>Represents the following element tag in the schema: c:name.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.PivotTableName? PivotTableName
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.PivotTableName>();
set => SetElement(value);
}
/// <summary>
/// <para>Format ID.</para>
/// <para>Represents the following element tag in the schema: c:fmtId.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.FormatId? FormatId
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.FormatId>();
set => SetElement(value);
}
/// <summary>
/// <para>Chart Extensibility.</para>
/// <para>Represents the following element tag in the schema: c:extLst.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.ExtensionList? ExtensionList
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.ExtensionList>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<PivotSource>(deep);
}
/// <summary>
/// <para>Defines the NumberingFormat Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:numFmt.</para>
/// </summary>
[SchemaAttr("c15:numFmt")]
public partial class NumberingFormat : OpenXmlLeafElement
{
/// <summary>
/// Initializes a new instance of the NumberingFormat class.
/// </summary>
public NumberingFormat() : base()
{
}
/// <summary>
/// <para>Number Format Code</para>
/// <para>Represents the following attribute in the schema: formatCode</para>
/// </summary>
[SchemaAttr("formatCode")]
public StringValue? FormatCode
{
get => GetAttribute<StringValue>();
set => SetAttribute(value);
}
/// <summary>
/// <para>Linked to Source</para>
/// <para>Represents the following attribute in the schema: sourceLinked</para>
/// </summary>
[SchemaAttr("sourceLinked")]
public BooleanValue? SourceLinked
{
get => GetAttribute<BooleanValue>();
set => SetAttribute(value);
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:numFmt");
builder.Availability = FileFormatVersions.Office2013;
builder.AddElement<NumberingFormat>()
.AddAttribute("formatCode", a => a.FormatCode, aBuilder =>
{
aBuilder.AddValidator(RequiredValidator.Instance);
})
.AddAttribute("sourceLinked", a => a.SourceLinked);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<NumberingFormat>(deep);
}
/// <summary>
/// <para>Defines the ShapeProperties Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:spPr.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.BlipFill" /> <c><a:blipFill></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.CustomGeometry" /> <c><a:custGeom></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.EffectDag" /> <c><a:effectDag></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.EffectList" /> <c><a:effectLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.GradientFill" /> <c><a:gradFill></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.GroupFill" /> <c><a:grpFill></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Outline" /> <c><a:ln></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.NoFill" /> <c><a:noFill></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.PatternFill" /> <c><a:pattFill></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.PresetGeometry" /> <c><a:prstGeom></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Scene3DType" /> <c><a:scene3d></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Shape3DType" /> <c><a:sp3d></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.ShapePropertiesExtensionList" /> <c><a:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.SolidFill" /> <c><a:solidFill></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Transform2D" /> <c><a:xfrm></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:spPr")]
public partial class ShapeProperties : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the ShapeProperties class.
/// </summary>
public ShapeProperties() : base()
{
}
/// <summary>
/// Initializes a new instance of the ShapeProperties class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public ShapeProperties(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the ShapeProperties class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public ShapeProperties(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the ShapeProperties class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public ShapeProperties(string outerXml) : base(outerXml)
{
}
/// <summary>
/// <para>Black and White Mode</para>
/// <para>Represents the following attribute in the schema: bwMode</para>
/// </summary>
[SchemaAttr("bwMode")]
public EnumValue<DocumentFormat.OpenXml.Drawing.BlackWhiteModeValues>? BlackWhiteMode
{
get => GetAttribute<EnumValue<DocumentFormat.OpenXml.Drawing.BlackWhiteModeValues>>();
set => SetAttribute(value);
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:spPr");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.BlipFill>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.CustomGeometry>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.EffectDag>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.EffectList>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.GradientFill>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.GroupFill>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Outline>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.NoFill>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.PatternFill>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.PresetGeometry>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Scene3DType>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Shape3DType>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.ShapePropertiesExtensionList>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.SolidFill>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Transform2D>();
builder.AddElement<ShapeProperties>()
.AddAttribute("bwMode", a => a.BlackWhiteMode, aBuilder =>
{
aBuilder.AddValidator(new StringValidator() { IsToken = (true) });
});
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Transform2D), 0, 1),
new CompositeParticle.Builder(ParticleType.Group, 0, 1)
{
new CompositeParticle.Builder(ParticleType.Choice, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.CustomGeometry), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.PresetGeometry), 1, 1)
}
},
new CompositeParticle.Builder(ParticleType.Group, 0, 1)
{
new CompositeParticle.Builder(ParticleType.Choice, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.NoFill), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.SolidFill), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.GradientFill), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.BlipFill), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.PatternFill), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.GroupFill), 1, 1)
}
},
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Outline), 0, 1),
new CompositeParticle.Builder(ParticleType.Group, 0, 1)
{
new CompositeParticle.Builder(ParticleType.Choice, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.EffectList), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.EffectDag), 1, 1)
}
},
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Scene3DType), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Shape3DType), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.ShapePropertiesExtensionList), 0, 1)
};
}
/// <summary>
/// <para>2D Transform for Individual Objects.</para>
/// <para>Represents the following element tag in the schema: a:xfrm.</para>
/// </summary>
/// <remark>
/// xmlns:a = http://schemas.openxmlformats.org/drawingml/2006/main
/// </remark>
public DocumentFormat.OpenXml.Drawing.Transform2D? Transform2D
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Transform2D>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<ShapeProperties>(deep);
}
/// <summary>
/// <para>Defines the Layout Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:layout.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ExtensionList" /> <c><c:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ManualLayout" /> <c><c:manualLayout></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:layout")]
public partial class Layout : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the Layout class.
/// </summary>
public Layout() : base()
{
}
/// <summary>
/// Initializes a new instance of the Layout class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public Layout(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the Layout class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public Layout(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the Layout class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public Layout(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:layout");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ExtensionList>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ManualLayout>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ManualLayout), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ExtensionList), 0, 1)
};
}
/// <summary>
/// <para>Manual Layout.</para>
/// <para>Represents the following element tag in the schema: c:manualLayout.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.ManualLayout? ManualLayout
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.ManualLayout>();
set => SetElement(value);
}
/// <summary>
/// <para>Chart Extensibility.</para>
/// <para>Represents the following element tag in the schema: c:extLst.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.ExtensionList? ExtensionList
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.ExtensionList>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<Layout>(deep);
}
/// <summary>
/// <para>Defines the FullReference Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:fullRef.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences" /> <c><c15:sqref></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:fullRef")]
public partial class FullReference : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the FullReference class.
/// </summary>
public FullReference() : base()
{
}
/// <summary>
/// Initializes a new instance of the FullReference class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FullReference(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FullReference class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FullReference(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FullReference class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public FullReference(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:fullRef");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences), 1, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>SequenceOfReferences.</para>
/// <para>Represents the following element tag in the schema: c15:sqref.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences? SequenceOfReferences
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<FullReference>(deep);
}
/// <summary>
/// <para>Defines the LevelReference Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:levelRef.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences" /> <c><c15:sqref></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:levelRef")]
public partial class LevelReference : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the LevelReference class.
/// </summary>
public LevelReference() : base()
{
}
/// <summary>
/// Initializes a new instance of the LevelReference class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public LevelReference(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the LevelReference class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public LevelReference(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the LevelReference class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public LevelReference(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:levelRef");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences), 1, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>SequenceOfReferences.</para>
/// <para>Represents the following element tag in the schema: c15:sqref.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences? SequenceOfReferences
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<LevelReference>(deep);
}
/// <summary>
/// <para>Defines the FormulaReference Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:formulaRef.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences" /> <c><c15:sqref></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:formulaRef")]
public partial class FormulaReference : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the FormulaReference class.
/// </summary>
public FormulaReference() : base()
{
}
/// <summary>
/// Initializes a new instance of the FormulaReference class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FormulaReference(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FormulaReference class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FormulaReference(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FormulaReference class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public FormulaReference(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:formulaRef");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences), 1, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>SequenceOfReferences.</para>
/// <para>Represents the following element tag in the schema: c15:sqref.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences? SequenceOfReferences
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<FormulaReference>(deep);
}
/// <summary>
/// <para>Defines the FilteredSeriesTitle Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:filteredSeriesTitle.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.ChartText" /> <c><c15:tx></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:filteredSeriesTitle")]
public partial class FilteredSeriesTitle : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the FilteredSeriesTitle class.
/// </summary>
public FilteredSeriesTitle() : base()
{
}
/// <summary>
/// Initializes a new instance of the FilteredSeriesTitle class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredSeriesTitle(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredSeriesTitle class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredSeriesTitle(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredSeriesTitle class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public FilteredSeriesTitle(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:filteredSeriesTitle");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.ChartText>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.ChartText), 1, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>ChartText.</para>
/// <para>Represents the following element tag in the schema: c15:tx.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.ChartText? ChartText
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.ChartText>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<FilteredSeriesTitle>(deep);
}
/// <summary>
/// <para>Defines the FilteredCategoryTitle Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:filteredCategoryTitle.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.AxisDataSourceType" /> <c><c15:cat></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:filteredCategoryTitle")]
public partial class FilteredCategoryTitle : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the FilteredCategoryTitle class.
/// </summary>
public FilteredCategoryTitle() : base()
{
}
/// <summary>
/// Initializes a new instance of the FilteredCategoryTitle class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredCategoryTitle(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredCategoryTitle class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredCategoryTitle(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredCategoryTitle class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public FilteredCategoryTitle(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:filteredCategoryTitle");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.AxisDataSourceType>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.AxisDataSourceType), 1, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>AxisDataSourceType.</para>
/// <para>Represents the following element tag in the schema: c15:cat.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.AxisDataSourceType? AxisDataSourceType
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.AxisDataSourceType>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<FilteredCategoryTitle>(deep);
}
/// <summary>
/// <para>Defines the FilteredAreaSeries Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:filteredAreaSeries.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.AreaChartSeries" /> <c><c15:ser></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:filteredAreaSeries")]
public partial class FilteredAreaSeries : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the FilteredAreaSeries class.
/// </summary>
public FilteredAreaSeries() : base()
{
}
/// <summary>
/// Initializes a new instance of the FilteredAreaSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredAreaSeries(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredAreaSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredAreaSeries(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredAreaSeries class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public FilteredAreaSeries(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:filteredAreaSeries");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.AreaChartSeries>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.AreaChartSeries), 1, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>AreaChartSeries.</para>
/// <para>Represents the following element tag in the schema: c15:ser.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.AreaChartSeries? AreaChartSeries
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.AreaChartSeries>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<FilteredAreaSeries>(deep);
}
/// <summary>
/// <para>Defines the FilteredBarSeries Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:filteredBarSeries.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.BarChartSeries" /> <c><c15:ser></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:filteredBarSeries")]
public partial class FilteredBarSeries : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the FilteredBarSeries class.
/// </summary>
public FilteredBarSeries() : base()
{
}
/// <summary>
/// Initializes a new instance of the FilteredBarSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredBarSeries(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredBarSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredBarSeries(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredBarSeries class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public FilteredBarSeries(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:filteredBarSeries");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.BarChartSeries>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.BarChartSeries), 1, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>BarChartSeries.</para>
/// <para>Represents the following element tag in the schema: c15:ser.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.BarChartSeries? BarChartSeries
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.BarChartSeries>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<FilteredBarSeries>(deep);
}
/// <summary>
/// <para>Defines the FilteredBubbleSeries Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:filteredBubbleSeries.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.BubbleChartSeries" /> <c><c15:ser></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:filteredBubbleSeries")]
public partial class FilteredBubbleSeries : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the FilteredBubbleSeries class.
/// </summary>
public FilteredBubbleSeries() : base()
{
}
/// <summary>
/// Initializes a new instance of the FilteredBubbleSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredBubbleSeries(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredBubbleSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredBubbleSeries(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredBubbleSeries class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public FilteredBubbleSeries(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:filteredBubbleSeries");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.BubbleChartSeries>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.BubbleChartSeries), 1, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>BubbleChartSeries.</para>
/// <para>Represents the following element tag in the schema: c15:ser.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.BubbleChartSeries? BubbleChartSeries
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.BubbleChartSeries>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<FilteredBubbleSeries>(deep);
}
/// <summary>
/// <para>Defines the FilteredLineSeriesExtension Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:filteredLineSeries.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.LineChartSeries" /> <c><c15:ser></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:filteredLineSeries")]
public partial class FilteredLineSeriesExtension : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the FilteredLineSeriesExtension class.
/// </summary>
public FilteredLineSeriesExtension() : base()
{
}
/// <summary>
/// Initializes a new instance of the FilteredLineSeriesExtension class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredLineSeriesExtension(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredLineSeriesExtension class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredLineSeriesExtension(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredLineSeriesExtension class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public FilteredLineSeriesExtension(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:filteredLineSeries");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.LineChartSeries>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.LineChartSeries), 1, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>LineChartSeries.</para>
/// <para>Represents the following element tag in the schema: c15:ser.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.LineChartSeries? LineChartSeries
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.LineChartSeries>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<FilteredLineSeriesExtension>(deep);
}
/// <summary>
/// <para>Defines the FilteredPieSeries Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:filteredPieSeries.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.PieChartSeries" /> <c><c15:ser></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:filteredPieSeries")]
public partial class FilteredPieSeries : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the FilteredPieSeries class.
/// </summary>
public FilteredPieSeries() : base()
{
}
/// <summary>
/// Initializes a new instance of the FilteredPieSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredPieSeries(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredPieSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredPieSeries(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredPieSeries class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public FilteredPieSeries(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:filteredPieSeries");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.PieChartSeries>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.PieChartSeries), 1, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>PieChartSeries.</para>
/// <para>Represents the following element tag in the schema: c15:ser.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.PieChartSeries? PieChartSeries
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.PieChartSeries>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<FilteredPieSeries>(deep);
}
/// <summary>
/// <para>Defines the FilteredRadarSeries Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:filteredRadarSeries.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.RadarChartSeries" /> <c><c15:ser></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:filteredRadarSeries")]
public partial class FilteredRadarSeries : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the FilteredRadarSeries class.
/// </summary>
public FilteredRadarSeries() : base()
{
}
/// <summary>
/// Initializes a new instance of the FilteredRadarSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredRadarSeries(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredRadarSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredRadarSeries(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredRadarSeries class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public FilteredRadarSeries(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:filteredRadarSeries");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.RadarChartSeries>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.RadarChartSeries), 1, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>RadarChartSeries.</para>
/// <para>Represents the following element tag in the schema: c15:ser.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.RadarChartSeries? RadarChartSeries
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.RadarChartSeries>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<FilteredRadarSeries>(deep);
}
/// <summary>
/// <para>Defines the FilteredScatterSeries Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:filteredScatterSeries.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.ScatterChartSeries" /> <c><c15:ser></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:filteredScatterSeries")]
public partial class FilteredScatterSeries : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the FilteredScatterSeries class.
/// </summary>
public FilteredScatterSeries() : base()
{
}
/// <summary>
/// Initializes a new instance of the FilteredScatterSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredScatterSeries(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredScatterSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredScatterSeries(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredScatterSeries class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public FilteredScatterSeries(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:filteredScatterSeries");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.ScatterChartSeries>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.ScatterChartSeries), 1, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>ScatterChartSeries.</para>
/// <para>Represents the following element tag in the schema: c15:ser.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.ScatterChartSeries? ScatterChartSeries
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.ScatterChartSeries>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<FilteredScatterSeries>(deep);
}
/// <summary>
/// <para>Defines the FilteredSurfaceSeries Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:filteredSurfaceSeries.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.SurfaceChartSeries" /> <c><c15:ser></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:filteredSurfaceSeries")]
public partial class FilteredSurfaceSeries : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the FilteredSurfaceSeries class.
/// </summary>
public FilteredSurfaceSeries() : base()
{
}
/// <summary>
/// Initializes a new instance of the FilteredSurfaceSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredSurfaceSeries(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredSurfaceSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public FilteredSurfaceSeries(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the FilteredSurfaceSeries class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public FilteredSurfaceSeries(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:filteredSurfaceSeries");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.SurfaceChartSeries>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.SurfaceChartSeries), 1, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>SurfaceChartSeries.</para>
/// <para>Represents the following element tag in the schema: c15:ser.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.SurfaceChartSeries? SurfaceChartSeries
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.SurfaceChartSeries>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<FilteredSurfaceSeries>(deep);
}
/// <summary>
/// <para>Defines the DataLabelsRange Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:datalabelsRange.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabelsRangeChache" /> <c><c15:dlblRangeCache></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.Formula" /> <c><c15:f></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:datalabelsRange")]
public partial class DataLabelsRange : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the DataLabelsRange class.
/// </summary>
public DataLabelsRange() : base()
{
}
/// <summary>
/// Initializes a new instance of the DataLabelsRange class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public DataLabelsRange(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the DataLabelsRange class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public DataLabelsRange(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the DataLabelsRange class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public DataLabelsRange(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:datalabelsRange");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabelsRangeChache>();
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.Formula>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.Formula), 1, 1, version: FileFormatVersions.Office2013),
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabelsRangeChache), 0, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>Formula.</para>
/// <para>Represents the following element tag in the schema: c15:f.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.Formula? Formula
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.Formula>();
set => SetElement(value);
}
/// <summary>
/// <para>DataLabelsRangeChache.</para>
/// <para>Represents the following element tag in the schema: c15:dlblRangeCache.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabelsRangeChache? DataLabelsRangeChache
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabelsRangeChache>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<DataLabelsRange>(deep);
}
/// <summary>
/// <para>Defines the CategoryFilterExceptions Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:categoryFilterExceptions.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.CategoryFilterException" /> <c><c15:categoryFilterException></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:categoryFilterExceptions")]
public partial class CategoryFilterExceptions : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the CategoryFilterExceptions class.
/// </summary>
public CategoryFilterExceptions() : base()
{
}
/// <summary>
/// Initializes a new instance of the CategoryFilterExceptions class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public CategoryFilterExceptions(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the CategoryFilterExceptions class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public CategoryFilterExceptions(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the CategoryFilterExceptions class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public CategoryFilterExceptions(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:categoryFilterExceptions");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.CategoryFilterException>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.CategoryFilterException), 1, 0, version: FileFormatVersions.Office2013)
};
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<CategoryFilterExceptions>(deep);
}
/// <summary>
/// <para>Defines the DataLabelFieldTable Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:dlblFieldTable.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabelFieldTableEntry" /> <c><c15:dlblFTEntry></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:dlblFieldTable")]
public partial class DataLabelFieldTable : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the DataLabelFieldTable class.
/// </summary>
public DataLabelFieldTable() : base()
{
}
/// <summary>
/// Initializes a new instance of the DataLabelFieldTable class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public DataLabelFieldTable(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the DataLabelFieldTable class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public DataLabelFieldTable(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the DataLabelFieldTable class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public DataLabelFieldTable(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:dlblFieldTable");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabelFieldTableEntry>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabelFieldTableEntry), 0, 0, version: FileFormatVersions.Office2013)
};
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<DataLabelFieldTable>(deep);
}
/// <summary>
/// <para>Defines the ExceptionForSave Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:xForSave.</para>
/// </summary>
[SchemaAttr("c15:xForSave")]
public partial class ExceptionForSave : BooleanType
{
/// <summary>
/// Initializes a new instance of the ExceptionForSave class.
/// </summary>
public ExceptionForSave() : base()
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:xForSave");
builder.Availability = FileFormatVersions.Office2013;
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<ExceptionForSave>(deep);
}
/// <summary>
/// <para>Defines the ShowDataLabelsRange Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:showDataLabelsRange.</para>
/// </summary>
[SchemaAttr("c15:showDataLabelsRange")]
public partial class ShowDataLabelsRange : BooleanType
{
/// <summary>
/// Initializes a new instance of the ShowDataLabelsRange class.
/// </summary>
public ShowDataLabelsRange() : base()
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:showDataLabelsRange");
builder.Availability = FileFormatVersions.Office2013;
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<ShowDataLabelsRange>(deep);
}
/// <summary>
/// <para>Defines the ShowLeaderLines Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:showLeaderLines.</para>
/// </summary>
[SchemaAttr("c15:showLeaderLines")]
public partial class ShowLeaderLines : BooleanType
{
/// <summary>
/// Initializes a new instance of the ShowLeaderLines class.
/// </summary>
public ShowLeaderLines() : base()
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:showLeaderLines");
builder.Availability = FileFormatVersions.Office2013;
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<ShowLeaderLines>(deep);
}
/// <summary>
/// <para>Defines the AutoGeneneratedCategories Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:autoCat.</para>
/// </summary>
[SchemaAttr("c15:autoCat")]
public partial class AutoGeneneratedCategories : BooleanType
{
/// <summary>
/// Initializes a new instance of the AutoGeneneratedCategories class.
/// </summary>
public AutoGeneneratedCategories() : base()
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:autoCat");
builder.Availability = FileFormatVersions.Office2013;
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<AutoGeneneratedCategories>(deep);
}
/// <summary>
/// <para>Defines the InvertIfNegativeBoolean Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:invertIfNegative.</para>
/// </summary>
[SchemaAttr("c15:invertIfNegative")]
public partial class InvertIfNegativeBoolean : BooleanType
{
/// <summary>
/// Initializes a new instance of the InvertIfNegativeBoolean class.
/// </summary>
public InvertIfNegativeBoolean() : base()
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:invertIfNegative");
builder.Availability = FileFormatVersions.Office2013;
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<InvertIfNegativeBoolean>(deep);
}
/// <summary>
/// <para>Defines the Bubble3D Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:bubble3D.</para>
/// </summary>
[SchemaAttr("c15:bubble3D")]
public partial class Bubble3D : BooleanType
{
/// <summary>
/// Initializes a new instance of the Bubble3D class.
/// </summary>
public Bubble3D() : base()
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:bubble3D");
builder.Availability = FileFormatVersions.Office2013;
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<Bubble3D>(deep);
}
/// <summary>
/// <para>Defines the BooleanType Class.</para>
/// <para>This class is available in Office 2007 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is :.</para>
/// </summary>
public abstract partial class BooleanType : OpenXmlLeafElement
{
/// <summary>
/// Initializes a new instance of the BooleanType class.
/// </summary>
protected BooleanType() : base()
{
}
/// <summary>
/// <para>Boolean Value</para>
/// <para>Represents the following attribute in the schema: val</para>
/// </summary>
[SchemaAttr("val")]
public BooleanValue? Val
{
get => GetAttribute<BooleanValue>();
set => SetAttribute(value);
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.AddElement<BooleanType>()
.AddAttribute("val", a => a.Val);
}
}
/// <summary>
/// <para>Defines the ChartText Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:tx.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.RichText" /> <c><c:rich></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.StringLiteral" /> <c><c:strLit></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.StringReference" /> <c><c:strRef></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:tx")]
public partial class ChartText : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the ChartText class.
/// </summary>
public ChartText() : base()
{
}
/// <summary>
/// Initializes a new instance of the ChartText class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public ChartText(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the ChartText class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public ChartText(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the ChartText class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public ChartText(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:tx");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.RichText>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.StringLiteral>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.StringReference>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Choice, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.StringReference), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.RichText), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.StringLiteral), 1, 1)
}
};
}
/// <summary>
/// <para>String Reference.</para>
/// <para>Represents the following element tag in the schema: c:strRef.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.StringReference? StringReference
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.StringReference>();
set => SetElement(value);
}
/// <summary>
/// <para>Rich Text.</para>
/// <para>Represents the following element tag in the schema: c:rich.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.RichText? RichText
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.RichText>();
set => SetElement(value);
}
/// <summary>
/// <para>String Literal.</para>
/// <para>Represents the following element tag in the schema: c:strLit.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.StringLiteral? StringLiteral
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.StringLiteral>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<ChartText>(deep);
}
/// <summary>
/// <para>Defines the LeaderLines Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:leaderLines.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties" /> <c><c:spPr></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:leaderLines")]
public partial class LeaderLines : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the LeaderLines class.
/// </summary>
public LeaderLines() : base()
{
}
/// <summary>
/// Initializes a new instance of the LeaderLines class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public LeaderLines(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the LeaderLines class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public LeaderLines(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the LeaderLines class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public LeaderLines(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:leaderLines");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties), 0, 1)
};
}
/// <summary>
/// <para>ChartShapeProperties.</para>
/// <para>Represents the following element tag in the schema: c:spPr.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties? ChartShapeProperties
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<LeaderLines>(deep);
}
/// <summary>
/// <para>Defines the SequenceOfReferences Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:sqref.</para>
/// </summary>
[SchemaAttr("c15:sqref")]
public partial class SequenceOfReferences : OpenXmlLeafTextElement
{
/// <summary>
/// Initializes a new instance of the SequenceOfReferences class.
/// </summary>
public SequenceOfReferences() : base()
{
}
/// <summary>
/// Initializes a new instance of the SequenceOfReferences class with the specified text content.
/// </summary>
/// <param name="text">Specifies the text content of the element.</param>
public SequenceOfReferences(string text) : base(text)
{
}
internal override OpenXmlSimpleType InnerTextToValue(string text)
{
return new StringValue { InnerText = text };
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:sqref");
builder.Availability = FileFormatVersions.Office2013;
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<SequenceOfReferences>(deep);
}
/// <summary>
/// <para>Defines the Formula Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:f.</para>
/// </summary>
[SchemaAttr("c15:f")]
public partial class Formula : OpenXmlLeafTextElement
{
/// <summary>
/// Initializes a new instance of the Formula class.
/// </summary>
public Formula() : base()
{
}
/// <summary>
/// Initializes a new instance of the Formula class with the specified text content.
/// </summary>
/// <param name="text">Specifies the text content of the element.</param>
public Formula(string text) : base(text)
{
}
internal override OpenXmlSimpleType InnerTextToValue(string text)
{
return new StringValue { InnerText = text };
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:f");
builder.Availability = FileFormatVersions.Office2013;
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<Formula>(deep);
}
/// <summary>
/// <para>Defines the TextFieldGuid Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:txfldGUID.</para>
/// </summary>
[SchemaAttr("c15:txfldGUID")]
public partial class TextFieldGuid : OpenXmlLeafTextElement
{
/// <summary>
/// Initializes a new instance of the TextFieldGuid class.
/// </summary>
public TextFieldGuid() : base()
{
}
/// <summary>
/// Initializes a new instance of the TextFieldGuid class with the specified text content.
/// </summary>
/// <param name="text">Specifies the text content of the element.</param>
public TextFieldGuid(string text) : base(text)
{
}
internal override OpenXmlSimpleType InnerTextToValue(string text)
{
return new StringValue { InnerText = text };
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:txfldGUID");
builder.Availability = FileFormatVersions.Office2013;
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<TextFieldGuid>(deep);
}
/// <summary>
/// <para>Defines the AxisDataSourceType Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:cat.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.MultiLevelStringReference" /> <c><c:multiLvlStrRef></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.NumberLiteral" /> <c><c:numLit></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.NumberReference" /> <c><c:numRef></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.StringLiteral" /> <c><c:strLit></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.StringReference" /> <c><c:strRef></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:cat")]
public partial class AxisDataSourceType : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the AxisDataSourceType class.
/// </summary>
public AxisDataSourceType() : base()
{
}
/// <summary>
/// Initializes a new instance of the AxisDataSourceType class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public AxisDataSourceType(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the AxisDataSourceType class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public AxisDataSourceType(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the AxisDataSourceType class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public AxisDataSourceType(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:cat");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.MultiLevelStringReference>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.NumberLiteral>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.NumberReference>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.StringLiteral>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.StringReference>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Choice, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.MultiLevelStringReference), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.NumberReference), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.NumberLiteral), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.StringReference), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.StringLiteral), 1, 1)
}
};
}
/// <summary>
/// <para>Multi Level String Reference.</para>
/// <para>Represents the following element tag in the schema: c:multiLvlStrRef.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.MultiLevelStringReference? MultiLevelStringReference
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.MultiLevelStringReference>();
set => SetElement(value);
}
/// <summary>
/// <para>Number Reference.</para>
/// <para>Represents the following element tag in the schema: c:numRef.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.NumberReference? NumberReference
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.NumberReference>();
set => SetElement(value);
}
/// <summary>
/// <para>Number Literal.</para>
/// <para>Represents the following element tag in the schema: c:numLit.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.NumberLiteral? NumberLiteral
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.NumberLiteral>();
set => SetElement(value);
}
/// <summary>
/// <para>StringReference.</para>
/// <para>Represents the following element tag in the schema: c:strRef.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.StringReference? StringReference
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.StringReference>();
set => SetElement(value);
}
/// <summary>
/// <para>String Literal.</para>
/// <para>Represents the following element tag in the schema: c:strLit.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.StringLiteral? StringLiteral
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.StringLiteral>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<AxisDataSourceType>(deep);
}
/// <summary>
/// <para>Defines the BarChartSeries Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:ser.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties" /> <c><c:spPr></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData" /> <c><c:cat></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.BarSerExtensionList" /> <c><c:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.InvertIfNegative" /> <c><c:invertIfNegative></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DataLabels" /> <c><c:dLbls></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DataPoint" /> <c><c:dPt></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ErrorBars" /> <c><c:errBars></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Values" /> <c><c:val></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.PictureOptions" /> <c><c:pictureOptions></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.SeriesText" /> <c><c:tx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Shape" /> <c><c:shape></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Trendline" /> <c><c:trendline></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Index" /> <c><c:idx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Order" /> <c><c:order></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:ser")]
public partial class BarChartSeries : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the BarChartSeries class.
/// </summary>
public BarChartSeries() : base()
{
}
/// <summary>
/// Initializes a new instance of the BarChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public BarChartSeries(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the BarChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public BarChartSeries(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the BarChartSeries class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public BarChartSeries(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:ser");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.BarSerExtensionList>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.InvertIfNegative>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DataLabels>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DataPoint>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ErrorBars>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Values>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.PictureOptions>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Shape>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Trendline>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Index>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Order>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Group, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Index), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Order), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.SeriesText), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties), 0, 1)
}
},
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.InvertIfNegative), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.PictureOptions), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DataPoint), 0, 0),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DataLabels), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Trendline), 0, 0),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ErrorBars), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Values), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Shape), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.BarSerExtensionList), 0, 1)
};
}
/// <summary>
/// <para>Index.</para>
/// <para>Represents the following element tag in the schema: c:idx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Index? Index
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Index>();
set => SetElement(value);
}
/// <summary>
/// <para>Order.</para>
/// <para>Represents the following element tag in the schema: c:order.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Order? Order
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Order>();
set => SetElement(value);
}
/// <summary>
/// <para>Series Text.</para>
/// <para>Represents the following element tag in the schema: c:tx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.SeriesText? SeriesText
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
set => SetElement(value);
}
/// <summary>
/// <para>ChartShapeProperties.</para>
/// <para>Represents the following element tag in the schema: c:spPr.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties? ChartShapeProperties
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
set => SetElement(value);
}
/// <summary>
/// <para>InvertIfNegative.</para>
/// <para>Represents the following element tag in the schema: c:invertIfNegative.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.InvertIfNegative? InvertIfNegative
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.InvertIfNegative>();
set => SetElement(value);
}
/// <summary>
/// <para>PictureOptions.</para>
/// <para>Represents the following element tag in the schema: c:pictureOptions.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.PictureOptions? PictureOptions
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.PictureOptions>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<BarChartSeries>(deep);
}
/// <summary>
/// <para>Defines the LineChartSeries Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:ser.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties" /> <c><c:spPr></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData" /> <c><c:cat></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Smooth" /> <c><c:smooth></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DataLabels" /> <c><c:dLbls></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DataPoint" /> <c><c:dPt></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ErrorBars" /> <c><c:errBars></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.LineSerExtensionList" /> <c><c:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Marker" /> <c><c:marker></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Values" /> <c><c:val></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.PictureOptions" /> <c><c:pictureOptions></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.SeriesText" /> <c><c:tx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Trendline" /> <c><c:trendline></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Index" /> <c><c:idx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Order" /> <c><c:order></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:ser")]
public partial class LineChartSeries : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the LineChartSeries class.
/// </summary>
public LineChartSeries() : base()
{
}
/// <summary>
/// Initializes a new instance of the LineChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public LineChartSeries(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the LineChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public LineChartSeries(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the LineChartSeries class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public LineChartSeries(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:ser");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Smooth>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DataLabels>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DataPoint>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ErrorBars>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.LineSerExtensionList>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Marker>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Values>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.PictureOptions>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Trendline>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Index>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Order>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Group, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Index), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Order), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.SeriesText), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties), 0, 1)
}
},
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Marker), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.PictureOptions), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DataPoint), 0, 0),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DataLabels), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Trendline), 0, 0),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ErrorBars), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Values), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Smooth), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.LineSerExtensionList), 0, 1)
};
}
/// <summary>
/// <para>Index.</para>
/// <para>Represents the following element tag in the schema: c:idx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Index? Index
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Index>();
set => SetElement(value);
}
/// <summary>
/// <para>Order.</para>
/// <para>Represents the following element tag in the schema: c:order.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Order? Order
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Order>();
set => SetElement(value);
}
/// <summary>
/// <para>Series Text.</para>
/// <para>Represents the following element tag in the schema: c:tx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.SeriesText? SeriesText
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
set => SetElement(value);
}
/// <summary>
/// <para>ChartShapeProperties.</para>
/// <para>Represents the following element tag in the schema: c:spPr.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties? ChartShapeProperties
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
set => SetElement(value);
}
/// <summary>
/// <para>Marker.</para>
/// <para>Represents the following element tag in the schema: c:marker.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Marker? Marker
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Marker>();
set => SetElement(value);
}
/// <summary>
/// <para>PictureOptions.</para>
/// <para>Represents the following element tag in the schema: c:pictureOptions.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.PictureOptions? PictureOptions
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.PictureOptions>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<LineChartSeries>(deep);
}
/// <summary>
/// <para>Defines the ScatterChartSeries Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:ser.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties" /> <c><c:spPr></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.XValues" /> <c><c:xVal></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Smooth" /> <c><c:smooth></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DataLabels" /> <c><c:dLbls></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DataPoint" /> <c><c:dPt></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ErrorBars" /> <c><c:errBars></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Marker" /> <c><c:marker></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.YValues" /> <c><c:yVal></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ScatterSerExtensionList" /> <c><c:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.SeriesText" /> <c><c:tx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Trendline" /> <c><c:trendline></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Index" /> <c><c:idx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Order" /> <c><c:order></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:ser")]
public partial class ScatterChartSeries : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the ScatterChartSeries class.
/// </summary>
public ScatterChartSeries() : base()
{
}
/// <summary>
/// Initializes a new instance of the ScatterChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public ScatterChartSeries(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the ScatterChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public ScatterChartSeries(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the ScatterChartSeries class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public ScatterChartSeries(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:ser");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.XValues>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Smooth>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DataLabels>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DataPoint>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ErrorBars>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Marker>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.YValues>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ScatterSerExtensionList>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Trendline>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Index>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Order>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Group, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Index), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Order), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.SeriesText), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties), 0, 1)
}
},
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Marker), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DataPoint), 0, 0),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DataLabels), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Trendline), 0, 0),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ErrorBars), 0, 2),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.XValues), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.YValues), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Smooth), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ScatterSerExtensionList), 0, 1)
};
}
/// <summary>
/// <para>Index.</para>
/// <para>Represents the following element tag in the schema: c:idx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Index? Index
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Index>();
set => SetElement(value);
}
/// <summary>
/// <para>Order.</para>
/// <para>Represents the following element tag in the schema: c:order.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Order? Order
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Order>();
set => SetElement(value);
}
/// <summary>
/// <para>Series Text.</para>
/// <para>Represents the following element tag in the schema: c:tx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.SeriesText? SeriesText
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
set => SetElement(value);
}
/// <summary>
/// <para>ChartShapeProperties.</para>
/// <para>Represents the following element tag in the schema: c:spPr.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties? ChartShapeProperties
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
set => SetElement(value);
}
/// <summary>
/// <para>Marker.</para>
/// <para>Represents the following element tag in the schema: c:marker.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Marker? Marker
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Marker>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<ScatterChartSeries>(deep);
}
/// <summary>
/// <para>Defines the AreaChartSeries Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:ser.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties" /> <c><c:spPr></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.AreaSerExtensionList" /> <c><c:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData" /> <c><c:cat></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DataLabels" /> <c><c:dLbls></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DataPoint" /> <c><c:dPt></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ErrorBars" /> <c><c:errBars></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Values" /> <c><c:val></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.PictureOptions" /> <c><c:pictureOptions></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.SeriesText" /> <c><c:tx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Trendline" /> <c><c:trendline></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Index" /> <c><c:idx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Order" /> <c><c:order></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:ser")]
public partial class AreaChartSeries : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the AreaChartSeries class.
/// </summary>
public AreaChartSeries() : base()
{
}
/// <summary>
/// Initializes a new instance of the AreaChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public AreaChartSeries(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the AreaChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public AreaChartSeries(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the AreaChartSeries class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public AreaChartSeries(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:ser");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.AreaSerExtensionList>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DataLabels>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DataPoint>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ErrorBars>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Values>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.PictureOptions>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Trendline>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Index>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Order>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Group, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Index), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Order), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.SeriesText), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties), 0, 1)
}
},
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.PictureOptions), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DataPoint), 0, 0),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DataLabels), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Trendline), 0, 0),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ErrorBars), 0, 2),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Values), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.AreaSerExtensionList), 0, 1)
};
}
/// <summary>
/// <para>Index.</para>
/// <para>Represents the following element tag in the schema: c:idx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Index? Index
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Index>();
set => SetElement(value);
}
/// <summary>
/// <para>Order.</para>
/// <para>Represents the following element tag in the schema: c:order.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Order? Order
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Order>();
set => SetElement(value);
}
/// <summary>
/// <para>Series Text.</para>
/// <para>Represents the following element tag in the schema: c:tx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.SeriesText? SeriesText
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
set => SetElement(value);
}
/// <summary>
/// <para>ChartShapeProperties.</para>
/// <para>Represents the following element tag in the schema: c:spPr.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties? ChartShapeProperties
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
set => SetElement(value);
}
/// <summary>
/// <para>PictureOptions.</para>
/// <para>Represents the following element tag in the schema: c:pictureOptions.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.PictureOptions? PictureOptions
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.PictureOptions>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<AreaChartSeries>(deep);
}
/// <summary>
/// <para>Defines the PieChartSeries Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:ser.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties" /> <c><c:spPr></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData" /> <c><c:cat></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DataLabels" /> <c><c:dLbls></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DataPoint" /> <c><c:dPt></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Values" /> <c><c:val></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.PictureOptions" /> <c><c:pictureOptions></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.PieSerExtensionList" /> <c><c:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.SeriesText" /> <c><c:tx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Index" /> <c><c:idx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Order" /> <c><c:order></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Explosion" /> <c><c:explosion></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:ser")]
public partial class PieChartSeries : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the PieChartSeries class.
/// </summary>
public PieChartSeries() : base()
{
}
/// <summary>
/// Initializes a new instance of the PieChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public PieChartSeries(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the PieChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public PieChartSeries(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the PieChartSeries class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public PieChartSeries(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:ser");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DataLabels>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DataPoint>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Values>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.PictureOptions>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.PieSerExtensionList>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Index>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Order>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Explosion>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Group, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Index), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Order), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.SeriesText), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties), 0, 1)
}
},
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.PictureOptions), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Explosion), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DataPoint), 0, 0),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DataLabels), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Values), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.PieSerExtensionList), 0, 1)
};
}
/// <summary>
/// <para>Index.</para>
/// <para>Represents the following element tag in the schema: c:idx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Index? Index
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Index>();
set => SetElement(value);
}
/// <summary>
/// <para>Order.</para>
/// <para>Represents the following element tag in the schema: c:order.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Order? Order
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Order>();
set => SetElement(value);
}
/// <summary>
/// <para>Series Text.</para>
/// <para>Represents the following element tag in the schema: c:tx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.SeriesText? SeriesText
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
set => SetElement(value);
}
/// <summary>
/// <para>ChartShapeProperties.</para>
/// <para>Represents the following element tag in the schema: c:spPr.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties? ChartShapeProperties
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
set => SetElement(value);
}
/// <summary>
/// <para>PictureOptions.</para>
/// <para>Represents the following element tag in the schema: c:pictureOptions.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.PictureOptions? PictureOptions
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.PictureOptions>();
set => SetElement(value);
}
/// <summary>
/// <para>Explosion.</para>
/// <para>Represents the following element tag in the schema: c:explosion.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Explosion? Explosion
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Explosion>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<PieChartSeries>(deep);
}
/// <summary>
/// <para>Defines the BubbleChartSeries Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:ser.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties" /> <c><c:spPr></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.XValues" /> <c><c:xVal></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.InvertIfNegative" /> <c><c:invertIfNegative></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Bubble3D" /> <c><c:bubble3D></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.BubbleSerExtensionList" /> <c><c:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DataLabels" /> <c><c:dLbls></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DataPoint" /> <c><c:dPt></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ErrorBars" /> <c><c:errBars></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.YValues" /> <c><c:yVal></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.BubbleSize" /> <c><c:bubbleSize></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.PictureOptions" /> <c><c:pictureOptions></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.SeriesText" /> <c><c:tx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Trendline" /> <c><c:trendline></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Index" /> <c><c:idx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Order" /> <c><c:order></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:ser")]
public partial class BubbleChartSeries : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the BubbleChartSeries class.
/// </summary>
public BubbleChartSeries() : base()
{
}
/// <summary>
/// Initializes a new instance of the BubbleChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public BubbleChartSeries(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the BubbleChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public BubbleChartSeries(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the BubbleChartSeries class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public BubbleChartSeries(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:ser");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.XValues>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.InvertIfNegative>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Bubble3D>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.BubbleSerExtensionList>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DataLabels>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DataPoint>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ErrorBars>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.YValues>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.BubbleSize>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.PictureOptions>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Trendline>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Index>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Order>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Group, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Index), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Order), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.SeriesText), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties), 0, 1)
}
},
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.PictureOptions), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.InvertIfNegative), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DataPoint), 0, 0),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DataLabels), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Trendline), 0, 0),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ErrorBars), 0, 2),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.XValues), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.YValues), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.BubbleSize), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Bubble3D), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.BubbleSerExtensionList), 0, 1)
};
}
/// <summary>
/// <para>Index.</para>
/// <para>Represents the following element tag in the schema: c:idx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Index? Index
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Index>();
set => SetElement(value);
}
/// <summary>
/// <para>Order.</para>
/// <para>Represents the following element tag in the schema: c:order.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Order? Order
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Order>();
set => SetElement(value);
}
/// <summary>
/// <para>Series Text.</para>
/// <para>Represents the following element tag in the schema: c:tx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.SeriesText? SeriesText
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
set => SetElement(value);
}
/// <summary>
/// <para>ChartShapeProperties.</para>
/// <para>Represents the following element tag in the schema: c:spPr.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties? ChartShapeProperties
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
set => SetElement(value);
}
/// <summary>
/// <para>PictureOptions.</para>
/// <para>Represents the following element tag in the schema: c:pictureOptions.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.PictureOptions? PictureOptions
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.PictureOptions>();
set => SetElement(value);
}
/// <summary>
/// <para>InvertIfNegative.</para>
/// <para>Represents the following element tag in the schema: c:invertIfNegative.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.InvertIfNegative? InvertIfNegative
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.InvertIfNegative>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<BubbleChartSeries>(deep);
}
/// <summary>
/// <para>Defines the RadarChartSeries Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:ser.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties" /> <c><c:spPr></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData" /> <c><c:cat></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DataLabels" /> <c><c:dLbls></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DataPoint" /> <c><c:dPt></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Marker" /> <c><c:marker></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Values" /> <c><c:val></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.PictureOptions" /> <c><c:pictureOptions></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.RadarSerExtensionList" /> <c><c:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.SeriesText" /> <c><c:tx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Index" /> <c><c:idx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Order" /> <c><c:order></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:ser")]
public partial class RadarChartSeries : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the RadarChartSeries class.
/// </summary>
public RadarChartSeries() : base()
{
}
/// <summary>
/// Initializes a new instance of the RadarChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public RadarChartSeries(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the RadarChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public RadarChartSeries(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the RadarChartSeries class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public RadarChartSeries(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:ser");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DataLabels>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DataPoint>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Marker>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Values>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.PictureOptions>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.RadarSerExtensionList>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Index>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Order>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Group, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Index), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Order), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.SeriesText), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties), 0, 1)
}
},
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.PictureOptions), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Marker), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DataPoint), 0, 0),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DataLabels), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Values), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.RadarSerExtensionList), 0, 1)
};
}
/// <summary>
/// <para>Index.</para>
/// <para>Represents the following element tag in the schema: c:idx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Index? Index
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Index>();
set => SetElement(value);
}
/// <summary>
/// <para>Order.</para>
/// <para>Represents the following element tag in the schema: c:order.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Order? Order
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Order>();
set => SetElement(value);
}
/// <summary>
/// <para>Series Text.</para>
/// <para>Represents the following element tag in the schema: c:tx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.SeriesText? SeriesText
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
set => SetElement(value);
}
/// <summary>
/// <para>ChartShapeProperties.</para>
/// <para>Represents the following element tag in the schema: c:spPr.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties? ChartShapeProperties
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
set => SetElement(value);
}
/// <summary>
/// <para>PictureOptions.</para>
/// <para>Represents the following element tag in the schema: c:pictureOptions.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.PictureOptions? PictureOptions
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.PictureOptions>();
set => SetElement(value);
}
/// <summary>
/// <para>Marker.</para>
/// <para>Represents the following element tag in the schema: c:marker.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Marker? Marker
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Marker>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<RadarChartSeries>(deep);
}
/// <summary>
/// <para>Defines the SurfaceChartSeries Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:ser.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties" /> <c><c:spPr></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData" /> <c><c:cat></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Bubble3D" /> <c><c:bubble3D></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Values" /> <c><c:val></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.PictureOptions" /> <c><c:pictureOptions></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.SeriesText" /> <c><c:tx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.SurfaceSerExtensionList" /> <c><c:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Index" /> <c><c:idx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Order" /> <c><c:order></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:ser")]
public partial class SurfaceChartSeries : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the SurfaceChartSeries class.
/// </summary>
public SurfaceChartSeries() : base()
{
}
/// <summary>
/// Initializes a new instance of the SurfaceChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public SurfaceChartSeries(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the SurfaceChartSeries class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public SurfaceChartSeries(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the SurfaceChartSeries class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public SurfaceChartSeries(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:ser");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Bubble3D>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Values>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.PictureOptions>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.SurfaceSerExtensionList>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Index>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Order>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Group, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Index), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Order), 1, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.SeriesText), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties), 0, 1)
}
},
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.PictureOptions), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Values), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Bubble3D), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.SurfaceSerExtensionList), 0, 1)
};
}
/// <summary>
/// <para>Index.</para>
/// <para>Represents the following element tag in the schema: c:idx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Index? Index
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Index>();
set => SetElement(value);
}
/// <summary>
/// <para>Order.</para>
/// <para>Represents the following element tag in the schema: c:order.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Order? Order
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Order>();
set => SetElement(value);
}
/// <summary>
/// <para>Series Text.</para>
/// <para>Represents the following element tag in the schema: c:tx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.SeriesText? SeriesText
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.SeriesText>();
set => SetElement(value);
}
/// <summary>
/// <para>ChartShapeProperties.</para>
/// <para>Represents the following element tag in the schema: c:spPr.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties? ChartShapeProperties
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
set => SetElement(value);
}
/// <summary>
/// <para>PictureOptions.</para>
/// <para>Represents the following element tag in the schema: c:pictureOptions.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.PictureOptions? PictureOptions
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.PictureOptions>();
set => SetElement(value);
}
/// <summary>
/// <para>CategoryAxisData.</para>
/// <para>Represents the following element tag in the schema: c:cat.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData? CategoryAxisData
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.CategoryAxisData>();
set => SetElement(value);
}
/// <summary>
/// <para>Values.</para>
/// <para>Represents the following element tag in the schema: c:val.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Values? Values
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Values>();
set => SetElement(value);
}
/// <summary>
/// <para>Bubble3D.</para>
/// <para>Represents the following element tag in the schema: c:bubble3D.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Bubble3D? Bubble3D
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Bubble3D>();
set => SetElement(value);
}
/// <summary>
/// <para>SurfaceSerExtensionList.</para>
/// <para>Represents the following element tag in the schema: c:extLst.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.SurfaceSerExtensionList? SurfaceSerExtensionList
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.SurfaceSerExtensionList>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<SurfaceChartSeries>(deep);
}
/// <summary>
/// <para>Defines the DataLabelsRangeChache Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:dlblRangeCache.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.StrDataExtensionList" /> <c><c:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.StringPoint" /> <c><c:pt></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.PointCount" /> <c><c:ptCount></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:dlblRangeCache")]
public partial class DataLabelsRangeChache : StringDataType
{
/// <summary>
/// Initializes a new instance of the DataLabelsRangeChache class.
/// </summary>
public DataLabelsRangeChache() : base()
{
}
/// <summary>
/// Initializes a new instance of the DataLabelsRangeChache class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public DataLabelsRangeChache(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the DataLabelsRangeChache class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public DataLabelsRangeChache(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the DataLabelsRangeChache class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public DataLabelsRangeChache(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:dlblRangeCache");
builder.Availability = FileFormatVersions.Office2013;
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.PointCount), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.StringPoint), 0, 0),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.StrDataExtensionList), 0, 1)
};
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<DataLabelsRangeChache>(deep);
}
/// <summary>
/// <para>Defines the DataLabelFieldTableCache Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:dlblFieldTableCache.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.StrDataExtensionList" /> <c><c:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.StringPoint" /> <c><c:pt></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.PointCount" /> <c><c:ptCount></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:dlblFieldTableCache")]
public partial class DataLabelFieldTableCache : StringDataType
{
/// <summary>
/// Initializes a new instance of the DataLabelFieldTableCache class.
/// </summary>
public DataLabelFieldTableCache() : base()
{
}
/// <summary>
/// Initializes a new instance of the DataLabelFieldTableCache class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public DataLabelFieldTableCache(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the DataLabelFieldTableCache class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public DataLabelFieldTableCache(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the DataLabelFieldTableCache class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public DataLabelFieldTableCache(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:dlblFieldTableCache");
builder.Availability = FileFormatVersions.Office2013;
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.PointCount), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.StringPoint), 0, 0),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.StrDataExtensionList), 0, 1)
};
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<DataLabelFieldTableCache>(deep);
}
/// <summary>
/// <para>Defines the StringDataType Class.</para>
/// <para>This class is available in Office 2007 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is :.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.StrDataExtensionList" /> <c><c:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.StringPoint" /> <c><c:pt></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.PointCount" /> <c><c:ptCount></c></description></item>
/// </list>
/// </remark>
public abstract partial class StringDataType : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the StringDataType class.
/// </summary>
protected StringDataType() : base()
{
}
/// <summary>
/// Initializes a new instance of the StringDataType class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
protected StringDataType(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the StringDataType class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
protected StringDataType(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the StringDataType class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
protected StringDataType(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.StrDataExtensionList>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.StringPoint>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.PointCount>();
}
/// <summary>
/// <para>PointCount.</para>
/// <para>Represents the following element tag in the schema: c:ptCount.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.PointCount? PointCount
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.PointCount>();
set => SetElement(value);
}
}
/// <summary>
/// <para>Defines the Explosion Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:explosion.</para>
/// </summary>
[SchemaAttr("c15:explosion")]
public partial class Explosion : OpenXmlLeafElement
{
/// <summary>
/// Initializes a new instance of the Explosion class.
/// </summary>
public Explosion() : base()
{
}
/// <summary>
/// <para>Integer Value</para>
/// <para>Represents the following attribute in the schema: val</para>
/// </summary>
[SchemaAttr("val")]
public UInt32Value? Val
{
get => GetAttribute<UInt32Value>();
set => SetAttribute(value);
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:explosion");
builder.Availability = FileFormatVersions.Office2013;
builder.AddElement<Explosion>()
.AddAttribute("val", a => a.Val, aBuilder =>
{
aBuilder.AddValidator(RequiredValidator.Instance);
});
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<Explosion>(deep);
}
/// <summary>
/// <para>Defines the Marker Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:marker.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties" /> <c><c:spPr></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ExtensionList" /> <c><c:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Size" /> <c><c:size></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Symbol" /> <c><c:symbol></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:marker")]
public partial class Marker : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the Marker class.
/// </summary>
public Marker() : base()
{
}
/// <summary>
/// Initializes a new instance of the Marker class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public Marker(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the Marker class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public Marker(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the Marker class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public Marker(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:marker");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ExtensionList>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Size>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Symbol>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Symbol), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Size), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ExtensionList), 0, 1)
};
}
/// <summary>
/// <para>Symbol.</para>
/// <para>Represents the following element tag in the schema: c:symbol.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Symbol? Symbol
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Symbol>();
set => SetElement(value);
}
/// <summary>
/// <para>Size.</para>
/// <para>Represents the following element tag in the schema: c:size.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Size? Size
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Size>();
set => SetElement(value);
}
/// <summary>
/// <para>ChartShapeProperties.</para>
/// <para>Represents the following element tag in the schema: c:spPr.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties? ChartShapeProperties
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
set => SetElement(value);
}
/// <summary>
/// <para>Chart Extensibility.</para>
/// <para>Represents the following element tag in the schema: c:extLst.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.ExtensionList? ExtensionList
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.ExtensionList>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<Marker>(deep);
}
/// <summary>
/// <para>Defines the DataLabel Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:dLbl.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties" /> <c><c:spPr></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.TextProperties" /> <c><c:txPr></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Delete" /> <c><c:delete></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ShowLegendKey" /> <c><c:showLegendKey></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ShowValue" /> <c><c:showVal></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ShowCategoryName" /> <c><c:showCatName></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ShowSeriesName" /> <c><c:showSerName></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ShowPercent" /> <c><c:showPercent></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ShowBubbleSize" /> <c><c:showBubbleSize></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DLblExtensionList" /> <c><c:extLst></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.DataLabelPosition" /> <c><c:dLblPos></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Layout" /> <c><c:layout></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.NumberingFormat" /> <c><c:numFmt></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.ChartText" /> <c><c:tx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Index" /> <c><c:idx></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Drawing.Charts.Separator" /> <c><c:separator></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:dLbl")]
public partial class DataLabel : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the DataLabel class.
/// </summary>
public DataLabel() : base()
{
}
/// <summary>
/// Initializes a new instance of the DataLabel class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public DataLabel(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the DataLabel class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public DataLabel(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the DataLabel class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public DataLabel(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:dLbl");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.TextProperties>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Delete>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ShowLegendKey>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ShowValue>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ShowCategoryName>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ShowSeriesName>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ShowPercent>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ShowBubbleSize>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DLblExtensionList>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.DataLabelPosition>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Layout>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.NumberingFormat>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.ChartText>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Index>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Charts.Separator>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Index), 1, 1),
new CompositeParticle.Builder(ParticleType.Choice, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Delete), 1, 1),
new CompositeParticle.Builder(ParticleType.Group, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Layout), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ChartText), 0, 1),
new CompositeParticle.Builder(ParticleType.Group, 1, 1)
{
new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.NumberingFormat), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.TextProperties), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DataLabelPosition), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ShowLegendKey), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ShowValue), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ShowCategoryName), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ShowSeriesName), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ShowPercent), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.ShowBubbleSize), 0, 1),
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.Separator), 0, 1)
}
}
}
}
},
new ElementParticle(typeof(DocumentFormat.OpenXml.Drawing.Charts.DLblExtensionList), 0, 1)
};
}
/// <summary>
/// <para>Index.</para>
/// <para>Represents the following element tag in the schema: c:idx.</para>
/// </summary>
/// <remark>
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
/// </remark>
public DocumentFormat.OpenXml.Drawing.Charts.Index? Index
{
get => GetElement<DocumentFormat.OpenXml.Drawing.Charts.Index>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<DataLabel>(deep);
}
/// <summary>
/// <para>Defines the CategoryFilterException Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:categoryFilterException.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.ShapeProperties" /> <c><c15:spPr></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.InvertIfNegativeBoolean" /> <c><c15:invertIfNegative></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.Bubble3D" /> <c><c15:bubble3D></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabel" /> <c><c15:dLbl></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.Marker" /> <c><c15:marker></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.Explosion" /> <c><c15:explosion></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences" /> <c><c15:sqref></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:categoryFilterException")]
public partial class CategoryFilterException : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the CategoryFilterException class.
/// </summary>
public CategoryFilterException() : base()
{
}
/// <summary>
/// Initializes a new instance of the CategoryFilterException class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public CategoryFilterException(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the CategoryFilterException class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public CategoryFilterException(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the CategoryFilterException class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public CategoryFilterException(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:categoryFilterException");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.ShapeProperties>();
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.InvertIfNegativeBoolean>();
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.Bubble3D>();
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabel>();
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.Marker>();
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.Explosion>();
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences), 1, 1, version: FileFormatVersions.Office2013),
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.ShapeProperties), 0, 1, version: FileFormatVersions.Office2013),
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.Explosion), 0, 1, version: FileFormatVersions.Office2013),
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.InvertIfNegativeBoolean), 0, 1, version: FileFormatVersions.Office2013),
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.Bubble3D), 0, 1, version: FileFormatVersions.Office2013),
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.Marker), 0, 1, version: FileFormatVersions.Office2013),
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabel), 0, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>SequenceOfReferences.</para>
/// <para>Represents the following element tag in the schema: c15:sqref.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences? SequenceOfReferences
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.SequenceOfReferences>();
set => SetElement(value);
}
/// <summary>
/// <para>ShapeProperties.</para>
/// <para>Represents the following element tag in the schema: c15:spPr.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.ShapeProperties? ShapeProperties
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.ShapeProperties>();
set => SetElement(value);
}
/// <summary>
/// <para>Explosion.</para>
/// <para>Represents the following element tag in the schema: c15:explosion.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.Explosion? Explosion
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.Explosion>();
set => SetElement(value);
}
/// <summary>
/// <para>InvertIfNegativeBoolean.</para>
/// <para>Represents the following element tag in the schema: c15:invertIfNegative.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.InvertIfNegativeBoolean? InvertIfNegativeBoolean
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.InvertIfNegativeBoolean>();
set => SetElement(value);
}
/// <summary>
/// <para>Bubble3D.</para>
/// <para>Represents the following element tag in the schema: c15:bubble3D.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.Bubble3D? Bubble3D
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.Bubble3D>();
set => SetElement(value);
}
/// <summary>
/// <para>Marker.</para>
/// <para>Represents the following element tag in the schema: c15:marker.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.Marker? Marker
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.Marker>();
set => SetElement(value);
}
/// <summary>
/// <para>DataLabel.</para>
/// <para>Represents the following element tag in the schema: c15:dLbl.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabel? DataLabel
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabel>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<CategoryFilterException>(deep);
}
/// <summary>
/// <para>Defines the DataLabelFieldTableEntry Class.</para>
/// <para>This class is available in Office 2013 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is c15:dlblFTEntry.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabelFieldTableCache" /> <c><c15:dlblFieldTableCache></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.TextFieldGuid" /> <c><c15:txfldGUID></c></description></item>
/// <item><description><see cref="DocumentFormat.OpenXml.Office2013.Drawing.Chart.Formula" /> <c><c15:f></c></description></item>
/// </list>
/// </remark>
[SchemaAttr("c15:dlblFTEntry")]
public partial class DataLabelFieldTableEntry : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the DataLabelFieldTableEntry class.
/// </summary>
public DataLabelFieldTableEntry() : base()
{
}
/// <summary>
/// Initializes a new instance of the DataLabelFieldTableEntry class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public DataLabelFieldTableEntry(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the DataLabelFieldTableEntry class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public DataLabelFieldTableEntry(params OpenXmlElement[] childElements) : base(childElements)
{
}
/// <summary>
/// Initializes a new instance of the DataLabelFieldTableEntry class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public DataLabelFieldTableEntry(string outerXml) : base(outerXml)
{
}
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema("c15:dlblFTEntry");
builder.Availability = FileFormatVersions.Office2013;
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabelFieldTableCache>();
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.TextFieldGuid>();
builder.AddChild<DocumentFormat.OpenXml.Office2013.Drawing.Chart.Formula>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.TextFieldGuid), 1, 1, version: FileFormatVersions.Office2013),
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.Formula), 1, 1, version: FileFormatVersions.Office2013),
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabelFieldTableCache), 0, 1, version: FileFormatVersions.Office2013)
};
}
/// <summary>
/// <para>TextFieldGuid.</para>
/// <para>Represents the following element tag in the schema: c15:txfldGUID.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.TextFieldGuid? TextFieldGuid
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.TextFieldGuid>();
set => SetElement(value);
}
/// <summary>
/// <para>Formula.</para>
/// <para>Represents the following element tag in the schema: c15:f.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.Formula? Formula
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.Formula>();
set => SetElement(value);
}
/// <summary>
/// <para>DataLabelFieldTableCache.</para>
/// <para>Represents the following element tag in the schema: c15:dlblFieldTableCache.</para>
/// </summary>
/// <remark>
/// xmlns:c15 = http://schemas.microsoft.com/office/drawing/2012/chart
/// </remark>
public DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabelFieldTableCache? DataLabelFieldTableCache
{
get => GetElement<DocumentFormat.OpenXml.Office2013.Drawing.Chart.DataLabelFieldTableCache>();
set => SetElement(value);
}
/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<DataLabelFieldTableEntry>(deep);
}
} | mit |
vincium/rebond-framework | src/Rebond/Enums/Core/ResponseFormat.php | 357 | <?php
/**
* (c) Vincent Patry
* This file is part of the Rebond package
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/
namespace Rebond\Enums\Core;
use Rebond\Enums\AbstractEnum;
class ResponseFormat extends AbstractEnum
{
const HTML = 0;
const JSON = 1;
}
| mit |
CaptainJackJJ/SmpUpdater | src/settings.h | 7927 | /*
* This file is part of WinSparkle (http://winsparkle.org)
*
* Copyright (C) 2009-2014 Vaclav Slavik
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#ifndef _settings_h_
#define _settings_h_
#include "threads.h"
#include "utils.h"
#include <string>
#include <sstream>
namespace winsparkle
{
/**
Holds all of WinSparkle configuration.
It is used both for storing explicitly set configuration values (e.g.
using win_sparkle_set_appcast_url()) and for retrieving them from default
locations (e.g. from resources or registry).
Note that it is only allowed to modify the settings before the first
call to win_sparkle_init().
*/
class Settings
{
public:
/**
Getting app metadata.
*/
//@{
/// Get location of the appcast
static std::string GetAppcastURL()
{
CriticalSectionLocker lock(ms_csVars);
if ( ms_appcastURL.empty() )
ms_appcastURL = GetCustomResource("FeedURL", "APPCAST");
return ms_appcastURL;
}
/// Return application name
static std::wstring GetAppName()
{
CriticalSectionLocker lock(ms_csVars);
if ( ms_appName.empty() )
ms_appName = GetVerInfoField(L"ProductName");
return ms_appName;
}
/// Return (human-readable) application version
static std::wstring GetAppVersion()
{
CriticalSectionLocker lock(ms_csVars);
if ( ms_appVersion.empty() )
ms_appVersion = GetVerInfoField(L"ProductVersion");
return ms_appVersion;
}
/// Return (internal) application build version
static std::wstring GetAppBuildVersion()
{
{
CriticalSectionLocker lock(ms_csVars);
if ( !ms_appBuildVersion.empty() )
return ms_appBuildVersion;
}
// fallback if build number wasn't set:
return GetAppVersion();
}
/// Return name of the vendor
static std::wstring GetCompanyName()
{
CriticalSectionLocker lock(ms_csVars);
if ( ms_companyName.empty() )
ms_companyName = GetVerInfoField(L"CompanyName");
return ms_companyName;
}
/// Return the registry path to store settings in
static std::string GetRegistryPath()
{
CriticalSectionLocker lock(ms_csVars);
if ( ms_registryPath.empty() )
ms_registryPath = GetDefaultRegistryPath();
return ms_registryPath;
}
//@}
/**
Overwriting app metadata.
Normally, they would be retrieved from resources, but it's sometimes
necessary to set them manually.
*/
//@{
/// Set appcast location
static void SetAppcastURL(const char *url)
{
CriticalSectionLocker lock(ms_csVars);
ms_appcastURL = url;
}
/// Set application name
static void SetAppName(const wchar_t *name)
{
CriticalSectionLocker lock(ms_csVars);
ms_appName = name;
}
/// Set application version
static void SetAppVersion(const wchar_t *version)
{
CriticalSectionLocker lock(ms_csVars);
ms_appVersion = version;
}
/// Set application's build version number
static void SetAppBuildVersion(const wchar_t *version)
{
CriticalSectionLocker lock(ms_csVars);
ms_appBuildVersion = version;
}
/// Set company name
static void SetCompanyName(const wchar_t *name)
{
CriticalSectionLocker lock(ms_csVars);
ms_companyName = name;
}
/// Set Windows registry path to store settings in (relative to HKCU/KHLM).
static void SetRegistryPath(const char *path)
{
CriticalSectionLocker lock(ms_csVars);
ms_registryPath = path;
}
//@}
/**
Access to runtime configuration.
This is stored in registry, under HKCU\Software\...\...\WinSparkle,
where the vendor and app names are determined from resources.
*/
//@{
// Writes given value to registry under this name.
template<typename T>
static void WriteConfigValue(const char *name, const T& value)
{
std::wostringstream s;
s << value;
DoWriteConfigValue(name, s.str().c_str());
}
static void WriteConfigValue(const char *name, const std::string& value)
{
DoWriteConfigValue(name, AnsiToWide(value).c_str());
}
static void WriteConfigValue(const char *name, const std::wstring& value)
{
DoWriteConfigValue(name, value.c_str());
}
// Reads a value from registry. Returns true if it was present,
// false otherwise.
template<typename T>
static bool ReadConfigValue(const char *name, T& value)
{
const std::wstring v = DoReadConfigValue(name);
if ( v.empty() )
return false;
std::wistringstream s(v);
s >> value;
return !s.fail();
}
static bool ReadConfigValue(const char *name, std::string& value)
{
const std::wstring v = DoReadConfigValue(name);
if (v.empty())
return false;
value = WideToAnsi(v);
return true;
}
static bool ReadConfigValue(const char *name, std::wstring& value)
{
value = DoReadConfigValue(name);
return !value.empty();
}
// Reads a value from registry, substituting default value if not present.
template<typename T>
static bool ReadConfigValue(const char *name, T& value, const T& defval)
{
bool rv = ReadConfigValue(name, value);
if ( !rv )
value = defval;
return rv;
}
// Deletes value from registry.
static void DeleteConfigValue(const char *name);
//@}
private:
Settings(); // cannot be instantiated
// Get given field from the VERSIONINFO/StringFileInfo resource,
// throw on failure
static std::wstring GetVerInfoField(const wchar_t *field)
{ return DoGetVerInfoField(field, true); }
// Same, but don't throw if a field is not set
static std::wstring TryGetVerInfoField(const wchar_t *field)
{ return DoGetVerInfoField(field, false); }
static std::wstring DoGetVerInfoField(const wchar_t *field, bool fatal);
// Gets custom win32 resource data
static std::string GetCustomResource(const char *name, const char *type);
static std::string GetDefaultRegistryPath();
static void DoWriteConfigValue(const char *name, const wchar_t *value);
static std::wstring DoReadConfigValue(const char *name);
private:
// guards the variables below:
static CriticalSection ms_csVars;
static std::string ms_appcastURL;
static std::string ms_registryPath;
static std::wstring ms_companyName;
static std::wstring ms_appName;
static std::wstring ms_appVersion;
static std::wstring ms_appBuildVersion;
};
} // namespace winsparkle
#endif // _settings_h_
| mit |
gshopov/competitive-programming-archive | codeforces/round-293/div-2/tanya_and_postcard.cpp | 1111 | #include <cctype>
#include <iostream>
#include <map>
#include <string>
using namespace std;
constexpr char found_symbol {'#'};
inline
void use_io_optimizations()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
}
inline char opposite(char symbol)
{
return islower(symbol) ? toupper(symbol) : tolower(symbol);
}
int main()
{
use_io_optimizations();
string message;
string newspaper;
cin >> message >> newspaper;
map<char, unsigned int> frequencies;
for (auto symbol : newspaper)
{
++frequencies[symbol];
}
unsigned int yay_count {0};
unsigned int woops_count {0};
for (auto& symbol : message)
{
if (frequencies[symbol])
{
++yay_count;
--frequencies[symbol];
symbol = found_symbol;
}
}
for (auto symbol : message)
{
if (symbol != found_symbol && frequencies[opposite(symbol)])
{
++woops_count;
--frequencies[opposite(symbol)];
}
}
cout << yay_count << ' ' << woops_count << '\n';
return 0;
}
| mit |
magnusjt/folderselect | src/folderselect.css | 4711 | /*
Wrapper for the whole plugin
Reset some styles.
*/
.fs-wrapper{
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 12px;
line-height: 1.428571429;
color: #333333;
background-color: #ffffff;
}
.fs-wrapper:after{
display: table;
content: " ";
clear: both;
}
.fs-wrapper *,
.fs-wrapper *:before,
.fs-wrapper *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.fs-wrapper table{
margin: 0;
padding: 0;
border: 0;
}
.fs-wrapper td{
margin: 0;
padding: 0;
border: 0;
vertical-align: middle;
white-space: nowrap;
}
/*
Wrapper for selector table (left side)
*/
.fs-selector-wrapper{
width: 50%;
float: left;
border: 1px #aaa solid;
background-color: #fff;
}
/*
Wrapper for selected tables / divs (right side)
*/
.fs-selected-wrapper{
width: 50%;
border: 1px #aaa solid;
border-left: 0;
padding: 0;
margin: 0;
float: left;
background-color: #fff;
}
/*
Styles for the beardcrumbs on top of the tables
*/
.fs-breadcrumbs-wrapper{
width: 100%;
height: 21px;
border: 1px #aaa solid;
border-bottom: 0;
vertical-align: middle;
overflow-x: hidden;
}
/*
Wrapper around both selector/selected, to make them scroll vertically
*/
.fs-scroll-wrapper{
height: 300px;
overflow-y: scroll;
}
/*
Breadcrumbs table
*/
.fs-table-breadcrumbs{
height: 20px;
border-collapse: collapse;
}
.fs-table-breadcrumbs td{
cursor: pointer;
border-left: 1px #eee solid;
padding: 1px 7px 0;
}
.fs-table-breadcrumbs td:first-child{
/* Home icon cell */
padding-left: 2px;
padding-right: 2px;
}
.fs-table-breadcrumbs td:hover{
border-left: 1px lightskyblue double;
border-right: 1px lightskyblue double;
background: -ms-linear-gradient(top, #f4ffff 50%, #e5ffff 100%);
background: -moz-linear-gradient(top, #f4ffff 50%, #e5ffff 100%);
background: -o-linear-gradient(top, #f4ffff 50%, #e5ffff 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0.5, #f4ffff), color-stop(1, #e5ffff));
background: -webkit-linear-gradient(top, #f4ffff 50%, #e5ffff 100%);
background: linear-gradient(to bottom, #f4ffff 50%, #e5ffff 100%);
}
.fs-table-breadcrumbs td:first-child:hover{
/* Home icon hover */
border-left: 1px transparent double;
}
/*
Styles for the scrollable tables
*/
.fs-table{
width: 100%;
text-align: left;
border-collapse: separate;
border-spacing: 0;
}
.fs-table td,
.fs-table th{
padding: 0;
padding-top: 2px;
padding-right: 3px;
padding-left: 2px;
border-bottom: 1px solid transparent;
border-top: 1px solid transparent;
}
.fs-table td:first-child{
/* Icon cell */
padding-top: 0;
padding-bottom: 2px;
width: 20px;
}
.fs-table thead tr{
border-bottom: 1px #eee solid;
}
.fs-table thead th{
border-right: 1px #eee solid;
border-bottom: 1px #eee solid;
font-size: 12px;
font-weight: normal;
font-style: italic;
}
.fs-table thead th:last-child{
border-right: 0;
}
/*
Different styles for selectable / openable rows
*/
.fs-tr-folder-selectable{
cursor: pointer;
}
.fs-tr-folder-not-selectable{
color: #999;
}
.fs-tr-item-selectable{
cursor: pointer;
}
.fs-tr-item-not-selectable{
color: #999;
}
.fs-tr-item-selected{
display: none;
}
.fs-tr-item-removable{
cursor: pointer;
}
.fs-div-folder-removable{
width: 100%;
cursor: pointer;
border-bottom: 1px #ccc solid;
border-top: 1px #ccc solid;
vertical-align: middle;
padding-top: 1px;
}
.fs-div-folder-removable-text{
height: 18px;
line-height: 18px;
padding-left: 5px;
padding-right: 5px;
overflow-x: hidden;
white-space: nowrap;
text-overflow: ellipsis;
text-align: left;
}
.fs-tr-item-selectable:hover,
.fs-tr-item-removable:hover,
.fs-tr-folder-selectable:hover,
.fs-div-folder-removable:hover{
background-color: #f4ffff;
background: -ms-linear-gradient(top, #f4ffff 50%, #e5ffff 100%);
background: -moz-linear-gradient(top, #f4ffff 50%, #e5ffff 100%);
background: -o-linear-gradient(top, #f4ffff 50%, #e5ffff 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0.5, #f4ffff), color-stop(1, #e5ffff));
background: -webkit-linear-gradient(top, #f4ffff 50%, #e5ffff 100%);
background: linear-gradient(to bottom, #f4ffff 50%, #e5ffff 100%);
}
.fs-tr-item-selectable:hover td,
.fs-tr-item-removable:hover td,
.fs-tr-folder-selectable:hover td,
.fs-div-folder-removable:hover{
border-bottom: 1px lightskyblue solid;
border-top: 1px lightskyblue solid;
} | mit |
afriestad/interlecture | interlecture/interauth/views.py | 4933 | from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponseRedirect
from django.contrib import messages
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.template.loader import render_to_string
from django.core.mail import send_mail
from django.shortcuts import render, reverse
from interlecture.local_settings import HOSTNAME,EMAIL_FROM
import datetime
import hashlib
import random
import dateutil.tz
from interauth.forms import UserForm
from interauth.models import UserActivation
def login_view(request):
context = {'app_name': 'login'}
if request.user.is_authenticated():
return HttpResponseRedirect(reverse('select-course'))
elif request.method == 'POST':
user = authenticate(username=request.POST['uname'], password=request.POST['passwd'])
if user is not None:
login(request, user)
if request.user.is_authenticated():
messages.info(request, "True")
return HttpResponseRedirect(reverse('select-course'))
else:
context['args'] = '{failedLogin:true,}'
return render(request, 'base.html', context=context)
else:
context['args'] = '{failedLogin:false,}'
return render(request, 'base.html', context=context)
@login_required
def logout_view(request):
logout(request)
return HttpResponseRedirect(reverse('login'))
def register(request):
if request.user.is_authenticated():
return HttpResponseRedirect(reverse('select-course'))
context = {}
if request.method == 'POST':
form = UserForm(request.POST)
if form.is_valid():
new_user = User.objects.create_user(
username=request.POST['username'],
email=request.POST['email'],
password=request.POST['password'],
first_name=request.POST['first_name'],
last_name=request.POST['last_name'],
is_active=False
)
# TODO: Email activation of user
init_activation(new_user)
context['args'] = '{}'
context['app_name'] = 'login'
return render(request, 'base.html', context=context)
else:
context['args'] = '{' + form.d2r_friendly_errors() + form.safe_data() + '}'
context['app_name'] = 'register'
return render(request, 'base.html', context=context)
else:
context['app_name'] = 'register'
context['args'] = '{}'
return render(request, 'base.html', context=context)
def activate(request, key):
try:
activation = UserActivation.objects.get(activation_key=key)
except ObjectDoesNotExist:
return HttpResponseRedirect(reverse('register'))
if not activation.user.is_active:
if datetime.datetime.now(tz=dateutil.tz.tzlocal()) > activation.key_expires:
return HttpResponseRedirect(reverse('resend-activation'))
else:
activation.user.is_active = True
activation.user.save()
return HttpResponseRedirect(reverse('select-course'))
def resend_activation_link(request):
if request.user.is_authenticated:
return HttpResponseRedirect(reverse('select-course'))
if request.method == 'POST':
try:
user = User.objects.get(email=request.POST['email'])
if user.is_active:
return HttpResponseRedirect(reverse('login'))
activation = UserActivation.objects.get(user=user)
activation.key_expires = datetime.datetime.now(dateutil.tz.tzlocal()) + datetime.timedelta(days=2)
send_activation_mail(activation)
return HttpResponseRedirect('login')
except ObjectDoesNotExist:
return HttpResponseRedirect(reverse('resend-activation'))
context = {
'app_name': 'resend_activation',
'args': '{}'
}
return render(request, 'base.html', context=context)
def init_activation(user):
salt = hashlib.sha1(str(random.random()).encode('utf8')).hexdigest()[:8]
usernamesalt = user.username
activation = UserActivation()
activation.user = user
activation.activation_key = hashlib.sha3_512(str(salt + usernamesalt).encode('utf8')).hexdigest()
activation.key_expires = datetime.datetime.now(dateutil.tz.tzlocal()) + datetime.timedelta(days=2)
activation.save()
send_activation_mail(activation)
def send_activation_mail(activation):
mail_body = render_to_string('activation_mail.html', context={'activation': activation,'HOSTNAME':HOSTNAME})
_ = send_mail(
subject='Interlecture Account Activation',
message='',
from_email=EMAIL_FROM,
recipient_list=[activation.user.email],
html_message=mail_body
)
| mit |
spinesheath/HanaMahjong | Spines.Mahjong/Spines.Tenhou.Client/DiscardInformation.cs | 1186 | // This file is licensed to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Linq;
using System.Xml.Linq;
using Spines.Utility;
namespace Spines.Tenhou.Client
{
/// <summary>
/// Data provided by the server when a player discards a tile.
/// </summary>
public class DiscardInformation
{
/// <summary>
/// 0, 1, 2, 3 for T, U, V, W.
/// </summary>
public int PlayerIndex { get; private set; }
/// <summary>
/// Id of the discarded tile.
/// </summary>
public Tile Tile { get; private set; }
/// <summary>
/// True if the discarded tile is the last tile drawn.
/// </summary>
public bool Tsumokiri { get; }
/// <summary>
/// True if the discarded tile can be called.
/// </summary>
public bool Callable { get; private set; }
internal DiscardInformation(XElement message)
{
Callable = message.Attributes("t").Any();
var name = message.Name.LocalName;
Tsumokiri = "defg".Contains(name[0]);
PlayerIndex = name[0] - (Tsumokiri ? 'd' : 'D');
Tile = new Tile(InvariantConvert.ToInt32(name.Substring(1)));
}
}
} | mit |
Coregraph/Ayllu | JigSaw - AYPUY - CS/AES_MATEO/src/besa_adaptado/adaptador/Consulta.java | 217 | package besa_adaptado.adaptador;
import adaptation.common.query.AdaptationQueryAES;
public class Consulta extends AdaptationQueryAES {
public Consulta(String query) {
setQuery(query);
}
}
| mit |
mychips/eatnsplit | node_modules/@ava/write-file-atomic/README.md | 2026 | write-file-atomic
-----------------
**Forked from https://github.com/npm/write-file-atomic to include https://github.com/npm/write-file-atomic/pull/25, for
use with [AVA](https://github.com/avajs/ava/).**
---
This is an extension for node's `fs.writeFile` that makes its operation
atomic and allows you set ownership (uid/gid of the file).
### var writeFileAtomic = require('write-file-atomic')<br>writeFileAtomic(filename, data, [options], callback)
* filename **String**
* data **String** | **Buffer**
* options **Object**
* chown **Object**
* uid **Number**
* gid **Number**
* encoding **String** | **Null** default = 'utf8'
* fsync **Boolean** default = true
* mode **Number** default = 438 (aka 0666 in Octal)
callback **Function**
Atomically and asynchronously writes data to a file, replacing the file if it already
exists. data can be a string or a buffer.
The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`.
If writeFile completes successfully then, if passed the **chown** option it will change
the ownership of the file. Finally it renames the file back to the filename you specified. If
it encounters errors at any of these steps it will attempt to unlink the temporary file and then
pass the error back to the caller.
If provided, the **chown** option requires both **uid** and **gid** properties or else
you'll get an error.
The **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'.
If the **fsync** option is **false**, writeFile will skip the final fsync call.
The callback is always invoked with the initial (temporary) filename.
Example:
```javascript
writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) {
if (err) throw err;
console.log('It\'s saved!');
});
```
### var writeFileAtomicSync = require('write-file-atomic').sync<br>writeFileAtomicSync(filename, data, [options])
The synchronous version of **writeFileAtomic**. Returns the initial (temporary) filename.
| mit |
untidy-hair/rails | railties/CHANGELOG.md | 2084 | * Don't generate unused files in `app:update` task
Skip the assets' initializer when sprockets isn't loaded.
Skip `config/spring.rb` when spring isn't loaded.
Skip yarn's contents when yarn integration isn't used.
*Tsukuru Tanimichi*
* Make the master.key file read-only for the owner upon generation on
POSIX-compliant systems.
Previously:
$ ls -l config/master.key
-rw-r--r-- 1 owner group 32 Jan 1 00:00 master.key
Now:
$ ls -l config/master.key
-rw------- 1 owner group 32 Jan 1 00:00 master.key
Fixes #32604.
*Jose Luis Duran*
* Deprecate support for using the `HOST` environment to specify the server IP.
The `BINDING` environment should be used instead.
Fixes #29516.
*Yuji Yaginuma*
* Deprecate passing Rack server name as a regular argument to `rails server`.
Previously:
$ bin/rails server thin
There wasn't an explicit option for the Rack server to use, now we have the
`--using` option with the `-u` short switch.
Now:
$ bin/rails server -u thin
This change also improves the error message if a missing or mistyped rack
server is given.
*Genadi Samokovarov*
* Add "rails routes --expanded" option to output routes in expanded mode like
"psql --expanded". Result looks like:
```
$ rails routes --expanded
--[ Route 1 ]------------------------------------------------------------
Prefix | high_scores
Verb | GET
URI | /high_scores(.:format)
Controller#Action | high_scores#index
--[ Route 2 ]------------------------------------------------------------
Prefix | new_high_score
Verb | GET
URI | /high_scores/new(.:format)
Controller#Action | high_scores#new
```
*Benoit Tigeot*
* Rails 6 requires Ruby 2.4.1 or newer.
*Jeremy Daer*
Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/railties/CHANGELOG.md) for previous changes.
| mit |
BellGeorge/BGLibrary | Pods/Documentation/TouchDB/html/Classes/TDRemoteJSONRequest.html | 6046 | <!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
<title>TDRemoteJSONRequest Class Reference</title>
<meta id="xcode-display" name="xcode-display" content="render"/>
<meta name="viewport" content="width=550" />
<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.1 (build 840)" />
</head>
<body>
<header id="top_header">
<div id="library" class="hideInXcode">
<h1><a id="libraryTitle" href="../index.html">TouchDB 1.0 </a></h1>
<a id="developerHome" href="../index.html">Jens Alfke</a>
</div>
<div id="title" role="banner">
<h1 class="hideInXcode">TDRemoteJSONRequest 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="overview">Overview</option>
</select>
</li>
</ul>
</header>
<nav id="tocContainer" class="isShowingTOC">
<ul id="toc" role="tree">
<li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li>
</ul>
</nav>
<article>
<div id="contents" class="isShowingTOC" role="main">
<a title="TDRemoteJSONRequest 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">TDRemoteJSONRequest 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"><a href="../Classes/TDRemoteRequest.html">TDRemoteRequest</a> : NSObject</td>
</tr><tr>
<td class="specification-title">Declared in</td>
<td class="specification-value">TDRemoteRequest.h</td>
</tr>
</tbody></table></div>
<div class="section section-overview">
<a title="Overview" name="overview"></a>
<h2 class="subtitle subtitle-overview">Overview</h2>
<p>A request that parses its response body as JSON.</p>
<pre><code>The parsed object will be returned as the first parameter of the completion block.
</code></pre>
</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">© 2012 Jens Alfke. All rights reserved. (Last updated: 2012-11-19)</span><br />
<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.1 (build 840)</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> | mit |
ojengwa/node-oauth20-provider | test/server/model/memory/oauth2/client.js | 470 | var clients = require('./../../data.js').clients;
module.exports.getId = function(client) {
return client.id;
};
module.exports.getRedirectUri = function(client) {
return client.redirectUri;
};
module.exports.fetchById = function(clientId, cb) {
for (var i in clients) {
if (clientId == clients[i].id) return cb(null, clients[i]);
}
cb();
};
module.exports.checkSecret = function(client, secret) {
return (client.secret == secret);
}; | mit |
cronvel/logger-kit | sample/net-server-test.js | 2053 | #!/usr/bin/env node
/*
Logfella
Copyright (c) 2015 - 2019 Cédric Ronvel
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
"use strict" ;
var Logfella = require( '../lib/Logfella.js' ) ;
/* Tests */
describe( "NetServer Transport" , function() {
it( "simple test" , function( done ) {
this.timeout( 10000 ) ;
var logger = Logfella.create() ;
var count = 0 ;
logger.setGlobalConfig( {
minLevel: 'trace' ,
defaultDomain: 'default-domain'
} ) ;
logger.addTransport( 'console' , { minLevel: 'trace' , output: process.stderr } ) ;
logger.addTransport( 'netServer' , { minLevel: 'trace' , listen: 1234 } ) ;
logger.logTransports[ 1 ].server.on( 'connection' , function() {
count ++ ;
if ( count >= 2 )
{
logger.warning( 'storage' , 'gloups' , 'We are running out of storage! Only %iMB left' , 139 ) ;
logger.info( 'idle' , { some: 'meta' , few: 'data' , somethingElse: 4 } , 'Youpla boum!' ) ;
setTimeout( done , 30 ) ;
}
} ) ;
} ) ;
} ) ;
| mit |
Laaia/RT-xv6 | usertests.c | 2062 | #include "param.h"
#include "types.h"
#include "stat.h"
#include "user.h"
#include "fs.h"
#include "fcntl.h"
#include "syscall.h"
#include "traps.h"
#include "memlayout.h"
#ifdef RT
unsigned long long J() {
unsigned long long t;
__asm__ __volatile__ ("rdtsc " : "=A"(t));
return t >> 21;
}
typedef struct procs {
int c, d, t, p, o;
}procs;
int index = 0;
#if RT
void insert(procs p[], int c, int d, int t){
#else
void insert(procs p[], int c, int d, int t, int pr, int o){
#endif
p[index].c = c; p[index].d = d; p[index].t = t;
#if !RT
p[index].p = pr; p[index].o = o;
#endif
index++;
}
void work(int t, int c){
int i, j;
#if !RT
sleep(t + 2*(J()%4+1));
#endif
for(j = 0; j < 50; j++){
for (i = 0; i < 2*200000*c; i++);
print(2);
sleep(t + 2*(J()%4+1)); // J is a random jitter
}
exit();
}
#endif
int
main(int argc, char *argv[])
{
#ifdef RT
print(0); // Zera
#if !RT
freeze(1); // Sinaliza a criação dos processos em lote
int processos = 3;
struct procs p[processos];
// c d t p o
insert(p, 2, 15, 15, 5, 5);
insert(p, 3, 20, 25, 4, 4);
//insert(p, 5, 25, 45, 3, 3);
insert(p, 4, 22, 30, 2, 3);
// insert(p, 1, 20, 37, 1, 3);
int i;
for(i = 0; i < processos; i++){
if(fork(p[i].d, p[i].c, p[i].p, p[i].o) == 0){
work(p[i].t, p[i].c);
}
}
#endif
#if RT
int i, processos = 5;
struct procs p[processos];
insert(p, 2, 15, 15, 5, 5);
insert(p, 3, 20, 25, 4, 4);
insert(p, 5, 25, 45, 3, 3);
insert(p, 4, 22, 30, 2, 3);
insert(p, 1, 20, 37, 1, 3);
/*// 3
insert(p, 4, 16, 14);
insert(p, 4, 11, 16);
insert(p, 7, 20, 40);
*/
for(i = 0; i < processos; i++){
if(fork(p[i].d, p[i].c) == 0){
work(p[i].t, p[i].c);
}
}
#endif
#if !RT
freeze(0); // Sinaliza o fim da criação de um lote, colocando-os em execução
#endif
#else
if(fork()==0){
printf(1, "Convencional mode!\n");
exit();
}
#endif
while(wait() != -1);
#ifdef RT
print(1); //Mostra
#endif
exit();
}
| mit |
tsiry95/openshift-strongloop-cartridge | strongloop/node_modules/strong-arc/devtools/frontend/common/Settings.js | 27489 | /*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @constructor
*/
WebInspector.Settings = function()
{
this._eventSupport = new WebInspector.Object();
this._registry = /** @type {!Object.<string, !WebInspector.Setting>} */ ({});
this.colorFormat = this.createSetting("colorFormat", "original");
this.consoleHistory = this.createSetting("consoleHistory", []);
this.domWordWrap = this.createSetting("domWordWrap", true);
this.eventListenersFilter = this.createSetting("eventListenersFilter", "all");
this.lastViewedScriptFile = this.createSetting("lastViewedScriptFile", "application");
this.monitoringXHREnabled = this.createSetting("monitoringXHREnabled", false);
this.preserveConsoleLog = this.createSetting("preserveConsoleLog", false);
this.consoleTimestampsEnabled = this.createSetting("consoleTimestampsEnabled", false);
this.resourcesLargeRows = this.createSetting("resourcesLargeRows", true);
this.resourcesSortOptions = this.createSetting("resourcesSortOptions", {timeOption: "responseTime", sizeOption: "transferSize"});
this.resourceViewTab = this.createSetting("resourceViewTab", "preview");
this.showInheritedComputedStyleProperties = this.createSetting("showInheritedComputedStyleProperties", false);
this.showUserAgentStyles = this.createSetting("showUserAgentStyles", true);
this.watchExpressions = this.createSetting("watchExpressions", []);
this.breakpoints = this.createSetting("breakpoints", []);
this.eventListenerBreakpoints = this.createSetting("eventListenerBreakpoints", []);
this.domBreakpoints = this.createSetting("domBreakpoints", []);
this.xhrBreakpoints = this.createSetting("xhrBreakpoints", []);
this.jsSourceMapsEnabled = this.createSetting("sourceMapsEnabled", true);
this.cssSourceMapsEnabled = this.createSetting("cssSourceMapsEnabled", true);
this.cacheDisabled = this.createSetting("cacheDisabled", false);
this.showUAShadowDOM = this.createSetting("showUAShadowDOM", false);
this.savedURLs = this.createSetting("savedURLs", {});
this.javaScriptDisabled = this.createSetting("javaScriptDisabled", false);
this.showAdvancedHeapSnapshotProperties = this.createSetting("showAdvancedHeapSnapshotProperties", false);
this.recordAllocationStacks = this.createSetting("recordAllocationStacks", false);
this.highResolutionCpuProfiling = this.createSetting("highResolutionCpuProfiling", false);
this.searchInContentScripts = this.createSetting("searchInContentScripts", false);
this.textEditorIndent = this.createSetting("textEditorIndent", " ");
this.textEditorAutoDetectIndent = this.createSetting("textEditorAutoIndentIndent", true);
this.textEditorAutocompletion = this.createSetting("textEditorAutocompletion", true);
this.textEditorBracketMatching = this.createSetting("textEditorBracketMatching", true);
this.cssReloadEnabled = this.createSetting("cssReloadEnabled", false);
this.timelineLiveUpdate = this.createSetting("timelineLiveUpdate", true);
this.showMetricsRulers = this.createSetting("showMetricsRulers", false);
this.workerInspectorWidth = this.createSetting("workerInspectorWidth", 600);
this.workerInspectorHeight = this.createSetting("workerInspectorHeight", 600);
this.messageURLFilters = this.createSetting("messageURLFilters", {});
this.networkHideDataURL = this.createSetting("networkHideDataURL", false);
this.networkResourceTypeFilters = this.createSetting("networkResourceTypeFilters", {});
this.messageLevelFilters = this.createSetting("messageLevelFilters", {});
this.splitVerticallyWhenDockedToRight = this.createSetting("splitVerticallyWhenDockedToRight", true);
this.visiblePanels = this.createSetting("visiblePanels", {});
this.shortcutPanelSwitch = this.createSetting("shortcutPanelSwitch", false);
this.showWhitespacesInEditor = this.createSetting("showWhitespacesInEditor", false);
this.skipStackFramesPattern = this.createRegExpSetting("skipStackFramesPattern", "");
this.pauseOnExceptionEnabled = this.createSetting("pauseOnExceptionEnabled", false);
this.pauseOnCaughtException = this.createSetting("pauseOnCaughtException", false);
this.enableAsyncStackTraces = this.createSetting("enableAsyncStackTraces", false);
this.showMediaQueryInspector = this.createSetting("showMediaQueryInspector", false);
this.disableOverridesWarning = this.createSetting("disableOverridesWarning", false);
// Rendering options
this.showPaintRects = this.createSetting("showPaintRects", false);
this.showDebugBorders = this.createSetting("showDebugBorders", false);
this.showFPSCounter = this.createSetting("showFPSCounter", false);
this.continuousPainting = this.createSetting("continuousPainting", false);
this.showScrollBottleneckRects = this.createSetting("showScrollBottleneckRects", false);
}
WebInspector.Settings.prototype = {
/**
* @param {string} key
* @param {*} defaultValue
* @return {!WebInspector.Setting}
*/
createSetting: function(key, defaultValue)
{
if (!this._registry[key])
this._registry[key] = new WebInspector.Setting(key, defaultValue, this._eventSupport, window.localStorage);
return this._registry[key];
},
/**
* @param {string} key
* @param {string} defaultValue
* @param {string=} regexFlags
* @return {!WebInspector.Setting}
*/
createRegExpSetting: function(key, defaultValue, regexFlags)
{
if (!this._registry[key])
this._registry[key] = new WebInspector.RegExpSetting(key, defaultValue, this._eventSupport, window.localStorage, regexFlags);
return this._registry[key];
}
}
/**
* @constructor
* @param {string} name
* @param {V} defaultValue
* @param {!WebInspector.Object} eventSupport
* @param {?Storage} storage
* @template V
*/
WebInspector.Setting = function(name, defaultValue, eventSupport, storage)
{
this._name = name;
this._defaultValue = defaultValue;
this._eventSupport = eventSupport;
this._storage = storage;
}
WebInspector.Setting.prototype = {
/**
* @param {function(!WebInspector.Event)} listener
* @param {!Object=} thisObject
*/
addChangeListener: function(listener, thisObject)
{
this._eventSupport.addEventListener(this._name, listener, thisObject);
},
/**
* @param {function(!WebInspector.Event)} listener
* @param {!Object=} thisObject
*/
removeChangeListener: function(listener, thisObject)
{
this._eventSupport.removeEventListener(this._name, listener, thisObject);
},
get name()
{
return this._name;
},
/**
* @return {V}
*/
get: function()
{
if (typeof this._value !== "undefined")
return this._value;
this._value = this._defaultValue;
if (this._storage && this._name in this._storage) {
try {
this._value = JSON.parse(this._storage[this._name]);
} catch(e) {
delete this._storage[this._name];
}
}
return this._value;
},
/**
* @param {V} value
*/
set: function(value)
{
this._value = value;
if (this._storage) {
try {
this._storage[this._name] = JSON.stringify(value);
} catch(e) {
console.error("Error saving setting with name:" + this._name);
}
}
this._eventSupport.dispatchEventToListeners(this._name, value);
}
}
/**
* @constructor
* @extends {WebInspector.Setting}
* @param {string} name
* @param {string} defaultValue
* @param {!WebInspector.Object} eventSupport
* @param {?Storage} storage
* @param {string=} regexFlags
*/
WebInspector.RegExpSetting = function(name, defaultValue, eventSupport, storage, regexFlags)
{
WebInspector.Setting.call(this, name, defaultValue ? [{ pattern: defaultValue }] : [], eventSupport, storage);
this._regexFlags = regexFlags;
}
WebInspector.RegExpSetting.prototype = {
/**
* @override
* @return {string}
*/
get: function()
{
var result = [];
var items = this.getAsArray();
for (var i = 0; i < items.length; ++i) {
var item = items[i];
if (item.pattern && !item.disabled)
result.push(item.pattern);
}
return result.join("|");
},
/**
* @return {!Array.<{pattern: string, disabled: (boolean|undefined)}>}
*/
getAsArray: function()
{
return WebInspector.Setting.prototype.get.call(this);
},
/**
* @override
* @param {string} value
*/
set: function(value)
{
this.setAsArray([{ pattern: value }]);
},
/**
* @param {!Array.<{pattern: string, disabled: (boolean|undefined)}>} value
*/
setAsArray: function(value)
{
delete this._regex;
WebInspector.Setting.prototype.set.call(this, value);
},
/**
* @return {?RegExp}
*/
asRegExp: function()
{
if (typeof this._regex !== "undefined")
return this._regex;
this._regex = null;
try {
var pattern = this.get();
if (pattern)
this._regex = new RegExp(pattern, this._regexFlags || "");
} catch (e) {
}
return this._regex;
},
__proto__: WebInspector.Setting.prototype
}
/**
* @constructor
* @param {boolean} experimentsEnabled
*/
WebInspector.ExperimentsSettings = function(experimentsEnabled)
{
this._experimentsEnabled = experimentsEnabled;
this._setting = WebInspector.settings.createSetting("experiments", {});
this._experiments = [];
this._enabledForTest = {};
// Add currently running experiments here.
this.applyCustomStylesheet = this._createExperiment("applyCustomStylesheet", "Allow custom UI themes");
this.canvasInspection = this._createExperiment("canvasInspection ", "Canvas inspection");
this.devicesPanel = this._createExperiment("devicesPanel", "Devices panel");
this.disableAgentsWhenProfile = this._createExperiment("disableAgentsWhenProfile", "Disable other agents and UI when profiler is active", true);
this.dockToLeft = this._createExperiment("dockToLeft", "Dock to left", true);
this.documentation = this._createExperiment("documentation", "Documentation for JS and CSS", true);
this.fileSystemInspection = this._createExperiment("fileSystemInspection", "FileSystem inspection");
this.gpuTimeline = this._createExperiment("gpuTimeline", "GPU data on timeline", true);
this.layersPanel = this._createExperiment("layersPanel", "Layers panel");
this.paintProfiler = this._createExperiment("paintProfiler", "Paint profiler");
this.timelineOnTraceEvents = this._createExperiment("timelineOnTraceEvents", "Timeline on trace events");
this.timelinePowerProfiler = this._createExperiment("timelinePowerProfiler", "Timeline power profiler");
this.timelineJSCPUProfile = this._createExperiment("timelineJSCPUProfile", "Timeline with JS sampling");
this._cleanUpSetting();
}
WebInspector.ExperimentsSettings.prototype = {
/**
* @return {!Array.<!WebInspector.Experiment>}
*/
get experiments()
{
return this._experiments.slice();
},
/**
* @return {boolean}
*/
get experimentsEnabled()
{
return this._experimentsEnabled;
},
/**
* @param {string} experimentName
* @param {string} experimentTitle
* @param {boolean=} hidden
* @return {!WebInspector.Experiment}
*/
_createExperiment: function(experimentName, experimentTitle, hidden)
{
var experiment = new WebInspector.Experiment(this, experimentName, experimentTitle, !!hidden);
this._experiments.push(experiment);
return experiment;
},
/**
* @param {string} experimentName
* @return {boolean}
*/
isEnabled: function(experimentName)
{
if (this._enabledForTest[experimentName])
return true;
if (!this.experimentsEnabled)
return false;
var experimentsSetting = this._setting.get();
return experimentsSetting[experimentName];
},
/**
* @param {string} experimentName
* @param {boolean} enabled
*/
setEnabled: function(experimentName, enabled)
{
var experimentsSetting = this._setting.get();
experimentsSetting[experimentName] = enabled;
this._setting.set(experimentsSetting);
},
/**
* @param {string} experimentName
*/
_enableForTest: function(experimentName)
{
this._enabledForTest[experimentName] = true;
},
_cleanUpSetting: function()
{
var experimentsSetting = this._setting.get();
var cleanedUpExperimentSetting = {};
for (var i = 0; i < this._experiments.length; ++i) {
var experimentName = this._experiments[i].name;
if (experimentsSetting[experimentName])
cleanedUpExperimentSetting[experimentName] = true;
}
this._setting.set(cleanedUpExperimentSetting);
}
}
/**
* @constructor
* @param {!WebInspector.ExperimentsSettings} experimentsSettings
* @param {string} name
* @param {string} title
* @param {boolean} hidden
*/
WebInspector.Experiment = function(experimentsSettings, name, title, hidden)
{
this._name = name;
this._title = title;
this._hidden = hidden;
this._experimentsSettings = experimentsSettings;
}
WebInspector.Experiment.prototype = {
/**
* @return {string}
*/
get name()
{
return this._name;
},
/**
* @return {string}
*/
get title()
{
return this._title;
},
/**
* @return {boolean}
*/
get hidden()
{
return this._hidden;
},
/**
* @return {boolean}
*/
isEnabled: function()
{
return this._experimentsSettings.isEnabled(this._name);
},
/**
* @param {boolean} enabled
*/
setEnabled: function(enabled)
{
this._experimentsSettings.setEnabled(this._name, enabled);
},
enableForTest: function()
{
this._experimentsSettings._enableForTest(this._name);
}
}
/**
* @constructor
*/
WebInspector.VersionController = function()
{
}
WebInspector.VersionController.currentVersion = 9;
WebInspector.VersionController.prototype = {
updateVersion: function()
{
var versionSetting = WebInspector.settings.createSetting("inspectorVersion", 0);
var currentVersion = WebInspector.VersionController.currentVersion;
var oldVersion = versionSetting.get();
var methodsToRun = this._methodsToRunToUpdateVersion(oldVersion, currentVersion);
for (var i = 0; i < methodsToRun.length; ++i)
this[methodsToRun[i]].call(this);
versionSetting.set(currentVersion);
},
/**
* @param {number} oldVersion
* @param {number} currentVersion
*/
_methodsToRunToUpdateVersion: function(oldVersion, currentVersion)
{
var result = [];
for (var i = oldVersion; i < currentVersion; ++i)
result.push("_updateVersionFrom" + i + "To" + (i + 1));
return result;
},
_updateVersionFrom0To1: function()
{
this._clearBreakpointsWhenTooMany(WebInspector.settings.breakpoints, 500000);
},
_updateVersionFrom1To2: function()
{
var versionSetting = WebInspector.settings.createSetting("previouslyViewedFiles", []);
versionSetting.set([]);
},
_updateVersionFrom2To3: function()
{
var fileSystemMappingSetting = WebInspector.settings.createSetting("fileSystemMapping", {});
fileSystemMappingSetting.set({});
if (window.localStorage)
delete window.localStorage["fileMappingEntries"];
},
_updateVersionFrom3To4: function()
{
var advancedMode = WebInspector.settings.createSetting("showHeaSnapshotObjectsHiddenProperties", false).get();
WebInspector.settings.showAdvancedHeapSnapshotProperties.set(advancedMode);
},
_updateVersionFrom4To5: function()
{
if (!window.localStorage)
return;
var settingNames = {
"FileSystemViewSidebarWidth": "fileSystemViewSplitViewState",
"canvasProfileViewReplaySplitLocation": "canvasProfileViewReplaySplitViewState",
"canvasProfileViewSplitLocation": "canvasProfileViewSplitViewState",
"elementsSidebarWidth": "elementsPanelSplitViewState",
"StylesPaneSplitRatio": "stylesPaneSplitViewState",
"heapSnapshotRetainersViewSize": "heapSnapshotSplitViewState",
"InspectorView.splitView": "InspectorView.splitViewState",
"InspectorView.screencastSplitView": "InspectorView.screencastSplitViewState",
"Inspector.drawerSplitView": "Inspector.drawerSplitViewState",
"layerDetailsSplitView": "layerDetailsSplitViewState",
"networkSidebarWidth": "networkPanelSplitViewState",
"sourcesSidebarWidth": "sourcesPanelSplitViewState",
"scriptsPanelNavigatorSidebarWidth": "sourcesPanelNavigatorSplitViewState",
"sourcesPanelSplitSidebarRatio": "sourcesPanelDebuggerSidebarSplitViewState",
"timeline-details": "timelinePanelDetailsSplitViewState",
"timeline-split": "timelinePanelRecorsSplitViewState",
"timeline-view": "timelinePanelTimelineStackSplitViewState",
"auditsSidebarWidth": "auditsPanelSplitViewState",
"layersSidebarWidth": "layersPanelSplitViewState",
"profilesSidebarWidth": "profilesPanelSplitViewState",
"resourcesSidebarWidth": "resourcesPanelSplitViewState"
};
for (var oldName in settingNames) {
var newName = settingNames[oldName];
var oldNameH = oldName + "H";
var newValue = null;
var oldSetting = WebInspector.settings.createSetting(oldName, undefined).get();
if (oldSetting) {
newValue = newValue || {};
newValue.vertical = {};
newValue.vertical.size = oldSetting;
delete window.localStorage[oldName];
}
var oldSettingH = WebInspector.settings.createSetting(oldNameH, undefined).get();
if (oldSettingH) {
newValue = newValue || {};
newValue.horizontal = {};
newValue.horizontal.size = oldSettingH;
delete window.localStorage[oldNameH];
}
var newSetting = WebInspector.settings.createSetting(newName, {});
if (newValue)
newSetting.set(newValue);
}
},
_updateVersionFrom5To6: function()
{
if (!window.localStorage)
return;
var settingNames = {
"debuggerSidebarHidden": "sourcesPanelSplitViewState",
"navigatorHidden": "sourcesPanelNavigatorSplitViewState",
"WebInspector.Drawer.showOnLoad": "Inspector.drawerSplitViewState"
};
for (var oldName in settingNames) {
var newName = settingNames[oldName];
var oldSetting = WebInspector.settings.createSetting(oldName, undefined).get();
var invert = "WebInspector.Drawer.showOnLoad" === oldName;
var hidden = !!oldSetting !== invert;
delete window.localStorage[oldName];
var showMode = hidden ? "OnlyMain" : "Both";
var newSetting = WebInspector.settings.createSetting(newName, null);
var newValue = newSetting.get() || {};
newValue.vertical = newValue.vertical || {};
newValue.vertical.showMode = showMode;
newValue.horizontal = newValue.horizontal || {};
newValue.horizontal.showMode = showMode;
newSetting.set(newValue);
}
},
_updateVersionFrom6To7: function()
{
if (!window.localStorage)
return;
var settingNames = {
"sourcesPanelNavigatorSplitViewState": "sourcesPanelNavigatorSplitViewState",
"elementsPanelSplitViewState": "elementsPanelSplitViewState",
"canvasProfileViewReplaySplitViewState": "canvasProfileViewReplaySplitViewState",
"stylesPaneSplitViewState": "stylesPaneSplitViewState",
"sourcesPanelDebuggerSidebarSplitViewState": "sourcesPanelDebuggerSidebarSplitViewState"
};
for (var name in settingNames) {
if (!(name in window.localStorage))
continue;
var setting = WebInspector.settings.createSetting(name, undefined);
var value = setting.get();
if (!value)
continue;
// Zero out saved percentage sizes, and they will be restored to defaults.
if (value.vertical && value.vertical.size && value.vertical.size < 1)
value.vertical.size = 0;
if (value.horizontal && value.horizontal.size && value.horizontal.size < 1)
value.horizontal.size = 0;
setting.set(value);
}
},
_updateVersionFrom7To8: function()
{
var settingName = "deviceMetrics";
if (!window.localStorage || !(settingName in window.localStorage))
return;
var setting = WebInspector.settings.createSetting(settingName, undefined);
var value = setting.get();
if (!value)
return;
var components = value.split("x");
if (components.length >= 3) {
var width = parseInt(components[0], 10);
var height = parseInt(components[1], 10);
var deviceScaleFactor = parseFloat(components[2]);
if (deviceScaleFactor) {
components[0] = "" + Math.round(width / deviceScaleFactor);
components[1] = "" + Math.round(height / deviceScaleFactor);
}
}
value = components.join("x");
setting.set(value);
},
_updateVersionFrom8To9: function()
{
if (!window.localStorage)
return;
var settingNames = [
"skipStackFramesPattern",
"workspaceFolderExcludePattern"
];
for (var i = 0; i < settingNames.length; ++i) {
var settingName = settingNames[i];
if (!(settingName in window.localStorage))
continue;
try {
var value = JSON.parse(window.localStorage[settingName]);
if (!value)
continue;
if (typeof value === "string")
value = [value];
for (var j = 0; j < value.length; ++j) {
if (typeof value[j] === "string")
value[j] = { pattern: value[j] };
}
window.localStorage[settingName] = JSON.stringify(value);
} catch(e) {
}
}
},
/**
* @param {!WebInspector.Setting} breakpointsSetting
* @param {number} maxBreakpointsCount
*/
_clearBreakpointsWhenTooMany: function(breakpointsSetting, maxBreakpointsCount)
{
// If there are too many breakpoints in a storage, it is likely due to a recent bug that caused
// periodical breakpoints duplication leading to inspector slowness.
if (breakpointsSetting.get().length > maxBreakpointsCount)
breakpointsSetting.set([]);
}
}
/**
* @type {!WebInspector.Settings}
*/
WebInspector.settings;
/**
* @type {!WebInspector.ExperimentsSettings}
*/
WebInspector.experimentsSettings;
// These methods are added for backwards compatibility with Devtools CodeSchool extension.
// DO NOT REMOVE
/**
* @constructor
*/
WebInspector.PauseOnExceptionStateSetting = function()
{
WebInspector.settings.pauseOnExceptionEnabled.addChangeListener(this._enabledChanged, this);
WebInspector.settings.pauseOnCaughtException.addChangeListener(this._pauseOnCaughtChanged, this);
this._name = "pauseOnExceptionStateString";
this._eventSupport = new WebInspector.Object();
this._value = this._calculateValue();
}
WebInspector.PauseOnExceptionStateSetting.prototype = {
/**
* @param {function(!WebInspector.Event)} listener
* @param {!Object=} thisObject
*/
addChangeListener: function(listener, thisObject)
{
this._eventSupport.addEventListener(this._name, listener, thisObject);
},
/**
* @param {function(!WebInspector.Event)} listener
* @param {!Object=} thisObject
*/
removeChangeListener: function(listener, thisObject)
{
this._eventSupport.removeEventListener(this._name, listener, thisObject);
},
/**
* @return {string}
*/
get: function()
{
return this._value;
},
/**
* @return {string}
*/
_calculateValue: function()
{
if (!WebInspector.settings.pauseOnExceptionEnabled.get())
return "none";
// The correct code here would be
// return WebInspector.settings.pauseOnCaughtException.get() ? "all" : "uncaught";
// But the CodeSchool DevTools relies on the fact that we used to enable pausing on ALL extensions by default, so we trick it here.
return "all";
},
_enabledChanged: function(event)
{
this._fireChangedIfNeeded();
},
_pauseOnCaughtChanged: function(event)
{
this._fireChangedIfNeeded();
},
_fireChangedIfNeeded: function()
{
var newValue = this._calculateValue();
if (newValue === this._value)
return;
this._value = newValue;
this._eventSupport.dispatchEventToListeners(this._name, this._value);
}
}
| mit |
Ensequence/express-restify-mongoose | test/integration/middleware.js | 36848 | var assert = require('assert')
var mongoose = require('mongoose')
var request = require('request')
var sinon = require('sinon')
var util = require('util')
module.exports = function (createFn, setup, dismantle) {
var erm = require('../../lib/express-restify-mongoose')
var db = require('./setup')()
var testPort = 30023
var testUrl = 'http://localhost:' + testPort
var invalidId = 'invalid-id'
var randomId = mongoose.Types.ObjectId().toHexString()
describe('preMiddleware/Create/Read/Update/Delete - null', function () {
var app = createFn()
var server
var customer
beforeEach(function (done) {
setup(function (err) {
if (err) {
return done(err)
}
erm.serve(app, db.models.Customer, {
preMiddleware: null,
preCreate: null,
preRead: null,
preUpdate: null,
preDelete: null,
restify: app.isRestify
})
db.models.Customer.create({
name: 'Bob'
}).then(function (createdCustomer) {
customer = createdCustomer
server = app.listen(testPort, done)
}, function (err) {
done(err)
})
})
})
afterEach(function (done) {
dismantle(app, server, done)
})
it('POST /Customers 201', function (done) {
request.post({
url: util.format('%s/api/v1/Customers', testUrl),
json: {
name: 'John'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 201)
done()
})
})
it('GET /Customers 200', function (done) {
request.get({
url: util.format('%s/api/v1/Customers', testUrl),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
done()
})
})
it('POST /Customers/:id 200', function (done) {
request.post({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: {
name: 'Bobby'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
done()
})
})
it('PUT /Customers/:id 200', function (done) {
request.put({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: {
name: 'Bobby'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
done()
})
})
it('DELETE /Customers/:id 204', function (done) {
request.del({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 204)
done()
})
})
})
describe('preMiddleware', function () {
var app = createFn()
var server
var customer
var options = {
preMiddleware: sinon.spy(function (req, res, next) {
next()
}),
restify: app.isRestify
}
beforeEach(function (done) {
setup(function (err) {
if (err) {
return done(err)
}
erm.serve(app, db.models.Customer, options)
db.models.Customer.create({
name: 'Bob'
}).then(function (createdCustomer) {
customer = createdCustomer
server = app.listen(testPort, done)
}, function (err) {
done(err)
})
})
})
afterEach(function (done) {
options.preMiddleware.reset()
dismantle(app, server, done)
})
it('GET /Customers 200', function (done) {
request.get({
url: util.format('%s/api/v1/Customers', testUrl),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.preMiddleware)
var args = options.preMiddleware.args[0]
assert.equal(args.length, 3)
assert.equal(typeof args[2], 'function')
done()
})
})
it('GET /Customers/:id 200', function (done) {
request.get({
url: util.format('%s/api/v1/Customers', testUrl),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.preMiddleware)
var args = options.preMiddleware.args[0]
assert.equal(args.length, 3)
assert.equal(typeof args[2], 'function')
done()
})
})
it('POST /Customers 201', function (done) {
request.post({
url: util.format('%s/api/v1/Customers', testUrl),
json: {
name: 'Pre'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 201)
sinon.assert.calledOnce(options.preMiddleware)
var args = options.preMiddleware.args[0]
assert.equal(args.length, 3)
assert.equal(typeof args[2], 'function')
done()
})
})
it('POST /Customers 400 - not called (missing content type)', function (done) {
request.post({
url: util.format('%s/api/v1/Customers', testUrl)
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.preMiddleware)
done()
})
})
it('POST /Customers 400 - not called (invalid content type)', function (done) {
request.post({
url: util.format('%s/api/v1/Customers', testUrl),
formData: {}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.preMiddleware)
done()
})
})
it('POST /Customers/:id 200', function (done) {
request.post({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: {}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.preMiddleware)
var args = options.preMiddleware.args[0]
assert.equal(args.length, 3)
assert.equal(typeof args[2], 'function')
done()
})
})
it('POST /Customers/:id 400 - not called (missing content type)', function (done) {
request.post({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id)
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.preMiddleware)
done()
})
})
it('POST /Customers/:id 400 - not called (invalid content type)', function (done) {
request.post({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
formData: {}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.preMiddleware)
done()
})
})
it('PUT /Customers/:id 200', function (done) {
request.put({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: {}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.preMiddleware)
var args = options.preMiddleware.args[0]
assert.equal(args.length, 3)
assert.equal(typeof args[2], 'function')
done()
})
})
it('PUT /Customers/:id 400 - not called (missing content type)', function (done) {
request.put({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id)
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.preMiddleware)
done()
})
})
it('PUT /Customers/:id 400 - not called (invalid content type)', function (done) {
request.put({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
formData: {}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.preMiddleware)
done()
})
})
it('DELETE /Customers 204', function (done) {
request.del({
url: util.format('%s/api/v1/Customers', testUrl),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 204)
sinon.assert.calledOnce(options.preMiddleware)
var args = options.preMiddleware.args[0]
assert.equal(args.length, 3)
assert.equal(typeof args[2], 'function')
done()
})
})
it('DELETE /Customers/:id 204', function (done) {
request.del({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 204)
sinon.assert.calledOnce(options.preMiddleware)
var args = options.preMiddleware.args[0]
assert.equal(args.length, 3)
assert.equal(typeof args[2], 'function')
done()
})
})
})
describe('preCreate', function () {
var app = createFn()
var server
var options = {
preCreate: sinon.spy(function (req, res, next) {
next()
}),
restify: app.isRestify
}
beforeEach(function (done) {
setup(function (err) {
if (err) {
return done(err)
}
erm.serve(app, db.models.Customer, options)
server = app.listen(testPort, done)
})
})
afterEach(function (done) {
options.preCreate.reset()
dismantle(app, server, done)
})
it('POST /Customers 201', function (done) {
request.post({
url: util.format('%s/api/v1/Customers', testUrl),
json: {
name: 'Bob'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 201)
sinon.assert.calledOnce(options.preCreate)
var args = options.preCreate.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result.name, 'Bob')
assert.equal(args[0].erm.statusCode, 201)
assert.equal(typeof args[2], 'function')
done()
})
})
})
describe('preRead', function () {
var app = createFn()
var server
var customer
var options = {
preRead: sinon.spy(function (req, res, next) {
next()
}),
restify: app.isRestify
}
beforeEach(function (done) {
setup(function (err) {
if (err) {
return done(err)
}
erm.serve(app, db.models.Customer, options)
db.models.Customer.create({
name: 'Bob'
}).then(function (createdCustomer) {
customer = createdCustomer
server = app.listen(testPort, done)
}, function (err) {
done(err)
})
})
})
afterEach(function (done) {
options.preRead.reset()
dismantle(app, server, done)
})
it('GET /Customers 200', function (done) {
request.get({
url: util.format('%s/api/v1/Customers', testUrl),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.preRead)
var args = options.preRead.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result[0].name, 'Bob')
assert.equal(args[0].erm.statusCode, 200)
assert.equal(typeof args[2], 'function')
done()
})
})
it('GET /Customers/count 200', function (done) {
request.get({
url: util.format('%s/api/v1/Customers/count', testUrl),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.preRead)
var args = options.preRead.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result.count, 1)
assert.equal(args[0].erm.statusCode, 200)
assert.equal(typeof args[2], 'function')
done()
})
})
it('GET /Customers/:id 200', function (done) {
request.get({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.preRead)
var args = options.preRead.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result.name, 'Bob')
assert.equal(args[0].erm.statusCode, 200)
assert.equal(typeof args[2], 'function')
done()
})
})
it('GET /Customers/:id/shallow 200', function (done) {
request.get({
url: util.format('%s/api/v1/Customers/%s/shallow', testUrl, customer._id),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.preRead)
var args = options.preRead.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result.name, 'Bob')
assert.equal(args[0].erm.statusCode, 200)
assert.equal(typeof args[2], 'function')
done()
})
})
})
describe('preUpdate', function () {
var app = createFn()
var server
var customer
var options = {
preUpdate: sinon.spy(function (req, res, next) {
next()
}),
restify: app.isRestify
}
beforeEach(function (done) {
setup(function (err) {
if (err) {
return done(err)
}
erm.serve(app, db.models.Customer, options)
db.models.Customer.create({
name: 'Bob'
}).then(function (createdCustomer) {
customer = createdCustomer
server = app.listen(testPort, done)
}, function (err) {
done(err)
})
})
})
afterEach(function (done) {
options.preUpdate.reset()
dismantle(app, server, done)
})
it('POST /Customers/:id 200', function (done) {
request.post({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: {
name: 'Bobby'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.preUpdate)
var args = options.preUpdate.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result.name, 'Bobby')
assert.equal(args[0].erm.statusCode, 200)
assert.equal(typeof args[2], 'function')
done()
})
})
it('POST /Customers/:id 400 - not called (missing content type)', function (done) {
request.post({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id)
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.preUpdate)
done()
})
})
it('POST /Customers/:id 400 - not called (invalid content type)', function (done) {
request.post({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
formData: {}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.preUpdate)
done()
})
})
it('PUT /Customers/:id 200', function (done) {
request.put({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: {
name: 'Bobby'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.preUpdate)
var args = options.preUpdate.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result.name, 'Bobby')
assert.equal(args[0].erm.statusCode, 200)
assert.equal(typeof args[2], 'function')
done()
})
})
it('PUT /Customers/:id 400 - not called (missing content type)', function (done) {
request.put({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id)
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.preUpdate)
done()
})
})
it('PUT /Customers/:id 400 - not called (invalid content type)', function (done) {
request.put({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
formData: {}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.preUpdate)
done()
})
})
})
describe('preDelete', function () {
var app = createFn()
var server
var customer
var options = {
preDelete: sinon.spy(function (req, res, next) {
next()
}),
restify: app.isRestify
}
beforeEach(function (done) {
setup(function (err) {
if (err) {
return done(err)
}
erm.serve(app, db.models.Customer, options)
db.models.Customer.create({
name: 'Bob'
}).then(function (createdCustomer) {
customer = createdCustomer
server = app.listen(testPort, done)
}, function (err) {
done(err)
})
})
})
afterEach(function (done) {
options.preDelete.reset()
dismantle(app, server, done)
})
it('DELETE /Customers 204', function (done) {
request.del({
url: util.format('%s/api/v1/Customers', testUrl),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 204)
sinon.assert.calledOnce(options.preDelete)
var args = options.preDelete.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result, undefined)
assert.equal(args[0].erm.statusCode, 204)
assert.equal(typeof args[2], 'function')
done()
})
})
it('DELETE /Customers/:id 204', function (done) {
request.del({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 204)
sinon.assert.calledOnce(options.preDelete)
var args = options.preDelete.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result, undefined)
assert.equal(args[0].erm.statusCode, 204)
assert.equal(typeof args[2], 'function')
done()
})
})
})
describe('postCreate/Read/Update/Delete - null', function () {
var app = createFn()
var server
var customer
beforeEach(function (done) {
setup(function (err) {
if (err) {
return done(err)
}
erm.serve(app, db.models.Customer, {
postCreate: null,
postRead: null,
postUpdate: null,
postDelete: null,
restify: app.isRestify
})
db.models.Customer.create({
name: 'Bob'
}).then(function (createdCustomer) {
customer = createdCustomer
server = app.listen(testPort, done)
}, function (err) {
done(err)
})
})
})
afterEach(function (done) {
dismantle(app, server, done)
})
it('POST /Customers 201', function (done) {
request.post({
url: util.format('%s/api/v1/Customers', testUrl),
json: {
name: 'John'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 201)
done()
})
})
it('GET /Customers 200', function (done) {
request.get({
url: util.format('%s/api/v1/Customers', testUrl),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
done()
})
})
it('POST /Customers/:id 200', function (done) {
request.post({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: {
name: 'Bobby'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
done()
})
})
it('PUT /Customers/:id 200', function (done) {
request.put({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: {
name: 'Bobby'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
done()
})
})
it('DELETE /Customers/:id 204', function (done) {
request.del({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 204)
done()
})
})
})
describe('postCreate', function () {
var app = createFn()
var server
var options = {
postCreate: sinon.spy(function (req, res, next) {
next()
}),
restify: app.isRestify
}
beforeEach(function (done) {
setup(function (err) {
if (err) {
return done(err)
}
erm.serve(app, db.models.Customer, options)
server = app.listen(testPort, done)
})
})
afterEach(function (done) {
options.postCreate.reset()
dismantle(app, server, done)
})
it('POST /Customers 201', function (done) {
request.post({
url: util.format('%s/api/v1/Customers', testUrl),
json: {
name: 'Bob'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 201)
sinon.assert.calledOnce(options.postCreate)
var args = options.postCreate.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result.name, 'Bob')
assert.equal(args[0].erm.statusCode, 201)
assert.equal(typeof args[2], 'function')
done()
})
})
it('POST /Customers 400 - missing required field', function (done) {
request.post({
url: util.format('%s/api/v1/Customers', testUrl),
json: {
comment: 'Bar'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.postCreate)
done()
})
})
})
describe('postRead', function () {
var app = createFn()
var server
var customer
var options = {
postRead: sinon.spy(function (req, res, next) {
next()
}),
restify: app.isRestify
}
beforeEach(function (done) {
setup(function (err) {
if (err) {
return done(err)
}
erm.serve(app, db.models.Customer, options)
db.models.Customer.create({
name: 'Bob'
}).then(function (createdCustomer) {
customer = createdCustomer
server = app.listen(testPort, done)
}, function (err) {
done(err)
})
})
})
afterEach(function (done) {
options.postRead.reset()
dismantle(app, server, done)
})
it('GET /Customers 200', function (done) {
request.get({
url: util.format('%s/api/v1/Customers', testUrl),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.postRead)
var args = options.postRead.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result[0].name, 'Bob')
assert.equal(args[0].erm.statusCode, 200)
assert.equal(typeof args[2], 'function')
done()
})
})
it('GET /Customers/count 200', function (done) {
request.get({
url: util.format('%s/api/v1/Customers/count', testUrl),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.postRead)
var args = options.postRead.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result.count, 1)
assert.equal(args[0].erm.statusCode, 200)
assert.equal(typeof args[2], 'function')
done()
})
})
it('GET /Customers/:id 200', function (done) {
request.get({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.postRead)
var args = options.postRead.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result.name, 'Bob')
assert.equal(args[0].erm.statusCode, 200)
assert.equal(typeof args[2], 'function')
done()
})
})
it('GET /Customers/:id 404', function (done) {
request.get({
url: util.format('%s/api/v1/Customers/%s', testUrl, randomId),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 404)
sinon.assert.notCalled(options.postRead)
done()
})
})
it('GET /Customers/:id 400', function (done) {
request.get({
url: util.format('%s/api/v1/Customers/%s', testUrl, invalidId),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.postRead)
done()
})
})
it('GET /Customers/:id/shallow 200', function (done) {
request.get({
url: util.format('%s/api/v1/Customers/%s/shallow', testUrl, customer._id),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.postRead)
var args = options.postRead.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result.name, 'Bob')
assert.equal(args[0].erm.statusCode, 200)
assert.equal(typeof args[2], 'function')
done()
})
})
})
describe('postUpdate', function () {
var app = createFn()
var server
var customer
var options = {
postUpdate: sinon.spy(function (req, res, next) {
next()
}),
restify: app.isRestify
}
beforeEach(function (done) {
setup(function (err) {
if (err) {
return done(err)
}
erm.serve(app, db.models.Customer, options)
db.models.Customer.create({
name: 'Bob'
}).then(function (createdCustomer) {
customer = createdCustomer
server = app.listen(testPort, done)
}, function (err) {
done(err)
})
})
})
afterEach(function (done) {
options.postUpdate.reset()
dismantle(app, server, done)
})
it('POST /Customers/:id 200', function (done) {
request.post({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: {
name: 'Bobby'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.postUpdate)
var args = options.postUpdate.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result.name, 'Bobby')
assert.equal(args[0].erm.statusCode, 200)
assert.equal(typeof args[2], 'function')
done()
})
})
it('POST /Customers/:id 404 - random id', function (done) {
request.post({
url: util.format('%s/api/v1/Customers/%s', testUrl, randomId),
json: {
name: 'Bobby'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 404)
sinon.assert.notCalled(options.postUpdate)
done()
})
})
it('POST /Customers/:id 400 - invalid id', function (done) {
request.post({
url: util.format('%s/api/v1/Customers/%s', testUrl, invalidId),
json: {
name: 'Bobby'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.postUpdate)
done()
})
})
it('POST /Customers/:id 400 - not called (missing content type)', function (done) {
request.post({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id)
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.postUpdate)
done()
})
})
it('POST /Customers/:id 400 - not called (invalid content type)', function (done) {
request.post({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
formData: {}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.postUpdate)
done()
})
})
it('PUT /Customers/:id 200', function (done) {
request.put({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: {
name: 'Bobby'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.postUpdate)
var args = options.postUpdate.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result.name, 'Bobby')
assert.equal(args[0].erm.statusCode, 200)
assert.equal(typeof args[2], 'function')
done()
})
})
it('PUT /Customers/:id 404 - random id', function (done) {
request.put({
url: util.format('%s/api/v1/Customers/%s', testUrl, randomId),
json: {
name: 'Bobby'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 404)
sinon.assert.notCalled(options.postUpdate)
done()
})
})
it('PUT /Customers/:id 400 - invalid id', function (done) {
request.put({
url: util.format('%s/api/v1/Customers/%s', testUrl, invalidId),
json: {
name: 'Bobby'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.postUpdate)
done()
})
})
it('PUT /Customers/:id 400 - not called (missing content type)', function (done) {
request.put({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id)
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.postUpdate)
done()
})
})
it('PUT /Customers/:id 400 - not called (invalid content type)', function (done) {
request.put({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
formData: {}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.postUpdate)
done()
})
})
})
describe('postDelete', function () {
var app = createFn()
var server
var customer
var options = {
postDelete: sinon.spy(function (req, res, next) {
next()
}),
restify: app.isRestify
}
beforeEach(function (done) {
setup(function (err) {
if (err) {
return done(err)
}
erm.serve(app, db.models.Customer, options)
db.models.Customer.create({
name: 'Bob'
}).then(function (createdCustomer) {
customer = createdCustomer
server = app.listen(testPort, done)
}, function (err) {
done(err)
})
})
})
afterEach(function (done) {
options.postDelete.reset()
dismantle(app, server, done)
})
it('DELETE /Customers 204', function (done) {
request.del({
url: util.format('%s/api/v1/Customers', testUrl),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 204)
sinon.assert.calledOnce(options.postDelete)
var args = options.postDelete.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result, undefined)
assert.equal(args[0].erm.statusCode, 204)
assert.equal(typeof args[2], 'function')
done()
})
})
it('DELETE /Customers/:id 204', function (done) {
request.del({
url: util.format('%s/api/v1/Customers/%s', testUrl, customer._id),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 204)
sinon.assert.calledOnce(options.postDelete)
var args = options.postDelete.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result, undefined)
assert.equal(args[0].erm.statusCode, 204)
assert.equal(typeof args[2], 'function')
done()
})
})
it('DELETE /Customers/:id 404', function (done) {
request.del({
url: util.format('%s/api/v1/Customers/%s', testUrl, randomId),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 404)
sinon.assert.notCalled(options.postDelete)
done()
})
})
it('DELETE /Customers/:id 400', function (done) {
request.del({
url: util.format('%s/api/v1/Customers/%s', testUrl, invalidId),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.notCalled(options.postDelete)
done()
})
})
})
describe('postCreate yields an error', function () {
var app = createFn()
var server
var options = {
postCreate: sinon.spy(function (req, res, next) {
var err = new Error('Something went wrong')
err.statusCode = 400
next(err)
}),
postProcess: sinon.spy(),
restify: app.isRestify
}
beforeEach(function (done) {
setup(function (err) {
if (err) {
return done(err)
}
erm.serve(app, db.models.Customer, options)
server = app.listen(testPort, done)
})
})
afterEach(function (done) {
options.postCreate.reset()
dismantle(app, server, done)
})
it('POST /Customers 201', function (done) {
request.post({
url: util.format('%s/api/v1/Customers', testUrl),
json: {
name: 'Bob'
}
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 400)
sinon.assert.calledOnce(options.postCreate)
var args = options.postCreate.args[0]
assert.equal(args.length, 3)
assert.equal(args[0].erm.result.name, 'Bob')
assert.equal(args[0].erm.statusCode, 201)
assert.equal(typeof args[2], 'function')
sinon.assert.notCalled(options.postProcess)
done()
})
})
})
describe('postProcess', function () {
var app = createFn()
var server
var options = {
postProcess: sinon.spy(function (req, res, next) {
next()
}),
restify: app.isRestify
}
beforeEach(function (done) {
setup(function (err) {
if (err) {
return done(err)
}
erm.serve(app, db.models.Customer, options)
server = app.listen(testPort, done)
})
})
afterEach(function (done) {
options.postProcess.reset()
dismantle(app, server, done)
})
it('GET /Customers 200', function (done) {
request.get({
url: util.format('%s/api/v1/Customers', testUrl),
json: true
}, function (err, res, body) {
assert.ok(!err)
assert.equal(res.statusCode, 200)
sinon.assert.calledOnce(options.postProcess)
var args = options.postProcess.args[0]
assert.equal(args.length, 3)
assert.deepEqual(args[0].erm.result, [])
assert.equal(args[0].erm.statusCode, 200)
assert.equal(typeof args[2], 'function')
done()
})
})
})
}
| mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.