answer
stringlengths
15
1.25M
#pragma once #include <aws/lookoutequipment/<API key>.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace LookoutEquipment { namespace Model { class <API key> <API key> { public: <API key>(); <API key>(Aws::Utils::Json::JsonView jsonValue); <API key>& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>The bucket containing the input dataset for the inference. </p> */ inline const Aws::String& GetBucket() const{ return m_bucket; } /** * <p>The bucket containing the input dataset for the inference. </p> */ inline bool BucketHasBeenSet() const { return m_bucketHasBeenSet; } /** * <p>The bucket containing the input dataset for the inference. </p> */ inline void SetBucket(const Aws::String& value) { m_bucketHasBeenSet = true; m_bucket = value; } /** * <p>The bucket containing the input dataset for the inference. </p> */ inline void SetBucket(Aws::String&& value) { m_bucketHasBeenSet = true; m_bucket = std::move(value); } /** * <p>The bucket containing the input dataset for the inference. </p> */ inline void SetBucket(const char* value) { m_bucketHasBeenSet = true; m_bucket.assign(value); } /** * <p>The bucket containing the input dataset for the inference. </p> */ inline <API key>& WithBucket(const Aws::String& value) { SetBucket(value); return *this;} /** * <p>The bucket containing the input dataset for the inference. </p> */ inline <API key>& WithBucket(Aws::String&& value) { SetBucket(std::move(value)); return *this;} /** * <p>The bucket containing the input dataset for the inference. </p> */ inline <API key>& WithBucket(const char* value) { SetBucket(value); return *this;} /** * <p>The prefix for the S3 bucket used for the input data for the inference. </p> */ inline const Aws::String& GetPrefix() const{ return m_prefix; } /** * <p>The prefix for the S3 bucket used for the input data for the inference. </p> */ inline bool PrefixHasBeenSet() const { return m_prefixHasBeenSet; } /** * <p>The prefix for the S3 bucket used for the input data for the inference. </p> */ inline void SetPrefix(const Aws::String& value) { m_prefixHasBeenSet = true; m_prefix = value; } /** * <p>The prefix for the S3 bucket used for the input data for the inference. </p> */ inline void SetPrefix(Aws::String&& value) { m_prefixHasBeenSet = true; m_prefix = std::move(value); } /** * <p>The prefix for the S3 bucket used for the input data for the inference. </p> */ inline void SetPrefix(const char* value) { m_prefixHasBeenSet = true; m_prefix.assign(value); } /** * <p>The prefix for the S3 bucket used for the input data for the inference. </p> */ inline <API key>& WithPrefix(const Aws::String& value) { SetPrefix(value); return *this;} /** * <p>The prefix for the S3 bucket used for the input data for the inference. </p> */ inline <API key>& WithPrefix(Aws::String&& value) { SetPrefix(std::move(value)); return *this;} /** * <p>The prefix for the S3 bucket used for the input data for the inference. </p> */ inline <API key>& WithPrefix(const char* value) { SetPrefix(value); return *this;} private: Aws::String m_bucket; bool m_bucketHasBeenSet; Aws::String m_prefix; bool m_prefixHasBeenSet; }; } // namespace Model } // namespace LookoutEquipment } // namespace Aws
package org.andidev.applicationname.format.custom; import java.util.Locale; import org.andidev.applicationname.format.annotation.CustomFormat; import org.apache.commons.lang3.StringUtils; import org.springframework.expression.EvaluationContext; import org.springframework.expression.ExpressionParser; import org.springframework.expression.spel.SpelParseException; import org.springframework.expression.spel.standard.<API key>; import org.springframework.format.Printer; public class CustomPrinter implements Printer<Object> { private final String spelExpression; private final EvaluationContext evaluationContext; public CustomPrinter(String spelExpression, EvaluationContext evaluationContext) { this.spelExpression = StringUtils.defaultIfBlank(spelExpression, null); this.evaluationContext = evaluationContext; } @Override public String print(Object object, Locale locale) { if (spelExpression == null) { return null; } ExpressionParser parser = new <API key>(); try { Object result = parser.parseExpression(spelExpression).getValue(evaluationContext, object); return result.toString(); } catch (SpelParseException e) { throw new <API key>("Could not parse spel expression = \"" + spelExpression + "\" in " + CustomFormat.class.getSimpleName() + " annotation: " + e.getMessage()); } } }
package com.capitalone.dashboard.model; import com.capitalone.dashboard.util.<API key>; import org.springframework.stereotype.Component; /** * Collector implementation for Feature that stores system configuration * settings required for source system data connection (e.g., API tokens, etc.) */ @Component public class TestResultCollector extends Collector { /** * Creates a static prototype of the Feature Collector, which includes any * specific settings or configuration required for the use of this * collector, including settings for connecting to any source systems. * * @return A configured TestResult Collector prototype */ public static TestResultCollector prototype() { TestResultCollector protoType = new TestResultCollector(); protoType.setName(<API key>.JIRA_XRAY); protoType.setOnline(true); protoType.setEnabled(true); protoType.setCollectorType(CollectorType.Test); protoType.setLastExecuted(System.currentTimeMillis()); return protoType; } }
// Provides control sap.m.<API key>. sap.ui.define(['sap/ui/core/Element', './library'], function(Element, library) { "use strict"; /** * Constructor for a new <code>sap.m.<API key></code> element. * * @param {string} [sId] Id for the new element, generated automatically if no id is given * @param {object} [mSettings] Initial settings for the new element * * @class * Settings for accessible landmarks which can be applied to the container elements of a <code>sap.m.Page</code> control. * These landmarks are e.g. used by assistive technologies (like screenreaders) to provide a meaningful page overview. * @extends sap.ui.core.Element * * @author SAP SE * @version 1.42.8 * * @constructor * @public * @alias sap.m.<API key> * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel */ var <API key> = Element.extend("sap.m.<API key>", /** @lends sap.m.<API key>.prototype */ { metadata : { library : "sap.m", properties : { /** * Landmark role of the root container of the corresponding <code>sap.m.Page</code> control. * * If set to <code>sap.ui.core.<API key>.None</code>, no landmark will be added to the container. */ rootRole : {type : "sap.ui.core.<API key>", defaultValue : "Region"}, /** * Texts which describes the landmark of the root container of the corresponding <code>sap.m.Page</code> control. * * If not set (and a landmark different than <code>sap.ui.core.<API key>.None</code> is defined), a predefined text * is used. */ rootLabel : {type : "string", defaultValue : null}, /** * Landmark role of the content container of the corresponding <code>sap.m.Page</code> control. * * If set to <code>sap.ui.core.<API key>.None</code>, no landmark will be added to the container. */ contentRole : {type : "sap.ui.core.<API key>", defaultValue : "Main"}, /** * Texts which describes the landmark of the content container of the corresponding <code>sap.m.Page</code> control. * * If not set (and a landmark different than <code>sap.ui.core.<API key>.None</code> is defined), a predefined text * is used. */ contentLabel : {type : "string", defaultValue : null}, /** * Landmark role of the header container of the corresponding <code>sap.m.Page</code> control. * * If set to <code>sap.ui.core.<API key>.None</code>, no landmark will be added to the container. */ headerRole : {type : "sap.ui.core.<API key>", defaultValue : "Region"}, /** * Texts which describes the landmark of the header container of the corresponding <code>sap.m.Page</code> control. * * If not set (and a landmark different than <code>sap.ui.core.<API key>.None</code> is defined), a predefined text * is used. */ headerLabel : {type : "string", defaultValue : null}, /** * Landmark role of the subheader container of the corresponding <code>sap.m.Page</code> control. * * If set to <code>sap.ui.core.<API key>.None</code>, no landmark will be added to the container. */ subHeaderRole : {type : "sap.ui.core.<API key>", defaultValue : null}, /** * Texts which describes the landmark of the subheader container of the corresponding <code>sap.m.Page</code> control. * * If not set (and a landmark different than <code>sap.ui.core.<API key>.None</code> is defined), a predefined text * is used. */ subHeaderLabel : {type : "string", defaultValue : null}, /** * Landmark role of the footer container of the corresponding <code>sap.m.Page</code> control. * * If set to <code>sap.ui.core.<API key>.None</code>, no landmark will be added to the container. */ footerRole : {type : "sap.ui.core.<API key>", defaultValue : "Region"}, /** * Texts which describes the landmark of the header container of the corresponding <code>sap.m.Page</code> control. * * If not set (and a landmark different than <code>sap.ui.core.<API key>.None</code> is defined), a predefined text * is used. */ footerLabel : {type : "string", defaultValue : null} } }}); /** * Returns the landmark information of the given <code>sap.m.<API key></code> instance * of the given area (e.g. <code>"root"</code>). * * Must only be used with the <code>sap.m.Page</code> control! * * @private */ <API key>._getLandmarkInfo = function(oInstance, sArea) { if (!oInstance) { return null; } var sRole = null; var sText = null; var oPropertyInfo = oInstance.getMetadata().getProperty(sArea + "Role"); if (oPropertyInfo) { sRole = oInstance[oPropertyInfo._sGetter](); } if (!sRole) { return null; } oPropertyInfo = oInstance.getMetadata().getProperty(sArea + "Label"); if (oPropertyInfo) { sText = oInstance[oPropertyInfo._sGetter](); } return [sRole.toLowerCase(), sText]; }; /** * Writes the landmark information of the given page and area (e.g. <code>"root"</code>). * * Must only be used with the <code>sap.m.Page</code> control! * * @private */ <API key>._writeLandmarkInfo = function(oRm, oPage, sArea) { if (!sap.ui.getCore().getConfiguration().getAccessibility()) { return; } var oInfo = <API key>._getLandmarkInfo(oPage.getLandmarkInfo(), sArea); if (!oInfo) { return; } var oLandMarks = { role: oInfo[0] }; if (oInfo[1]) { oLandMarks["label"] = oInfo[1]; } oRm.<API key>(oPage, oLandMarks); }; return <API key>; });
Ext.define('xdfn.project.ProjOpen', { extend: 'xdfn.project.ui.ProjOpen', grid: null, initComponent: function() { var me = this; me.openStore = Ext.create('xdfn.project.store.ProjOpenJsonStore'); me.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { errorSummary: false }); me.callParent(arguments); me.down('button[text=""]').on('click', me.<API key>, me); me.down('button[text=""]').on('click', me.<API key>, me); me.down('button[text=""]').on('click', me.<API key>, me); me.rowEditing.on('edit', me.OnGridEdit, me); me.rowEditing.on('beforeedit', me.OnGridBeforeEdit, me); }, OnGridBeforeEdit: function(editor, e, epts) { xdfn.user.Rights.noRights('XMGL-XMZL-31', function() { editor.cancelEdit(); }); }, OnGridEdit: function(editor, e) { var me = this; if (!e.record.dirty) return; var url = './proExec.do?method=modifyKbjl'; if (Ext.isEmpty(e.record.get('ID_VIEW'))) { var rows = me.grid.getSelectionModel().getSelection(); e.record.set('ID_VIEW', rows[0].get('ID_VIEW')); url = './proExec.do?method=addProKbjl'; } e.record.commit(); Ext.Ajax.request({ url: url, method: 'post', params: { ID: e.record.get('ID_VIEW'), V_MANU: e.record.get('V_MANU_VIEW'), V_MACHINE: e.record.get('V_MACHINE_VIEW'), N_CAP: e.record.get('N_CAP_VIEW'), N_SUM_NUM: e.record.get('N_SUM_NUM_VIEW'), N_SUM_MONEY: e.record.get('N_SUM_MONEY_VIEW'), V_MEMO: e.record.get('V_MEMO_VIEW') }, success: function(response, opts) { var result = Ext.JSON.decode(response.responseText); e.record.set(result.data); e.record.commit(); }, failure: function(response, opts) { Ext.Msg.alert('',''); } }); }, <API key>: function(self, e, options) { var me = this, sm = me.grid.getSelectionModel(), rows = sm.getSelection(); xdfn.user.Rights.hasRights('XMGL-XMZL-30', function() { if (rows.length > 0) { me.rowEditing.cancelEdit(); me.openStore.insert(0, {}); me.rowEditing.startEdit(0, 0); } else { Ext.Msg.alert('',''); } }); }, <API key>: function(self, e, options) { var me = this, grid = self.up('gridpanel'), store = grid.getStore(), sm = grid.getSelectionModel(), rows = sm.getSelection(); xdfn.user.Rights.hasRights('XMGL-XMZL-32', function() { if (rows.length > 0) { if (Ext.isEmpty(rows[0].get('ID_VIEW'))) { me.rowEditing.cancelEdit(); var i = store.indexOf(rows[0]); store.remove(rows); var count = store.getCount(); if (count > 0) { sm.select((i == count)? --i : i); } return; } Ext.MessageBox.confirm('', '', function(id) { if (id == 'yes') { //TODO Ext.Ajax.request({ url: './proExec.do?method=deleteKbjl', //url method: 'get', params: { ID: rows[0].get('ID_VIEW') }, success: function(response, opts) { me.rowEditing.cancelEdit(); var i = store.indexOf(rows[0]); store.remove(rows); var count = store.getCount(); if (count > 0) { sm.select((i == count)? --i : i); } }, failure: function(response, opts) { Ext.Msg.alert('',''); } }); } }); } else { Ext.Msg.alert('',''); } }); }, <API key>: function(self, e, options) { var me = this; //excel xdfn.user.Rights.hasRights('XMGL-XMZL-33', function() { me.openStore.load({ limit: me.openStore.getTotalCount(), scope: this, callback: function(records, operation, success) { var excelXml = Ext.ux.exporter.Exporter.exportGrid(self.up('gridpanel'), 'excel', {title: ''}); document.location = 'data:application/vnd.ms-excel;base64,' + Ext.ux.exporter.Base64.encode(excelXml); } }); }); } });
{% extends "partials/layout.html" %} {% block body %} <div class="ui container"> <div class="ui padded segment raised"> <h1>About Me</h1> <p>I am a software developer with an interest in artificial intelligence and machine learning.</p> <p>I try to write some interesting things, be it software or articles. One day I hope to manage it.</p> </div> </div> {% endblock %}
// jQueryTemplate.cs // Script#/Libraries/jQuery/Templating using System; using System.Collections; using System.Html; using System.Net; using System.Runtime.CompilerServices; using jQueryApi; namespace jQueryApi.Templating { <summary> Represents a jQuery template that has been parsed and can be used to generate HTML. </summary> [<API key>] [ScriptImport] public sealed class jQueryTemplate { private jQueryTemplate() { } } }
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* * Content policy implementation that prevents all loads of images, * subframes, etc from protocols that don't return data but rather open * applications (such as mailto). */ #include "<API key>.h" #include "nsIDOMWindow.h" #include "nsString.h" #include "nsIProtocolHandler.h" #include "nsIIOService.h" #include "<API key>.h" #include "nsNetUtil.h" NS_IMPL_ISUPPORTS1(<API key>, nsIContentPolicy) NS_IMETHODIMP <API key>::ShouldLoad(uint32_t aContentType, nsIURI *aContentLocation, nsIURI *aRequestingLocation, nsISupports *aRequestingContext, const nsACString &aMimeGuess, nsISupports *aExtra, nsIPrincipal *aRequestPrincipal, int16_t *aDecision) { *aDecision = nsIContentPolicy::ACCEPT; // Don't block for TYPE_OBJECT since such URIs are sometimes loaded by the // plugin, so they don't necessarily open external apps // TYPE_WEBSOCKET loads can only go to ws:// or wss://, so we don't need to // concern ourselves with them. if (aContentType != TYPE_DOCUMENT && aContentType != TYPE_SUBDOCUMENT && aContentType != TYPE_OBJECT && aContentType != TYPE_WEBSOCKET) { // The following are just quick-escapes for the most common cases // where we would allow the content to be loaded anyway. nsAutoCString scheme; aContentLocation->GetScheme(scheme); if (scheme.EqualsLiteral("http") || scheme.EqualsLiteral("https") || scheme.EqualsLiteral("ftp") || scheme.EqualsLiteral("file") || scheme.EqualsLiteral("chrome")) { return NS_OK; } bool shouldBlock; nsresult rv = NS_URIChainHasFlags(aContentLocation, nsIProtocolHandler::<API key>, &shouldBlock); if (NS_SUCCEEDED(rv) && shouldBlock) { *aDecision = nsIContentPolicy::REJECT_REQUEST; } } return NS_OK; } NS_IMETHODIMP <API key>::ShouldProcess(uint32_t aContentType, nsIURI *aContentLocation, nsIURI *aRequestingLocation, nsISupports *aRequestingContext, const nsACString &aMimeGuess, nsISupports *aExtra, nsIPrincipal *aRequestPrincipal, int16_t *aDecision) { return ShouldLoad(aContentType, aContentLocation, aRequestingLocation, aRequestingContext, aMimeGuess, aExtra, aRequestPrincipal, aDecision); }
# Release History ## 3.0.0 (2016-08-19) - update `fkooman/rest` and `fkooman/http` dependencies ## 2.0.0 (2015-11-19) - major API update for new `fkooman/<API key>` ## 1.0.1 (2015-09-07) - remove `fkooman/cert-parser` dependency ## 1.0.0 - update `fkooman/rest` and use `fkooman/<API key>` ## 0.1.2 - update `fkooman/cert-parser` ## 0.1.1 - also support `<API key>` header ## 0.1.0 - initial release
/* This program reads an ELF file and computes information about * redundancies. */ #include <algorithm> #include <fstream> #include <string> #include <vector> #include <map> #include <elf.h> #include <sys/mman.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> #include <getopt.h> char* opt_type = "func"; char* opt_section = ".text"; static void hexdump(ostream& out, const char* bytes, size_t count) { hex(out); size_t off = 0; while (off < count) { out.form("%08lx: ", off); const char* p = bytes + off; int j = 0; while (j < 16) { out.form("%02x", p[j++] & 0xff); if (j + off >= count) break; out.form("%02x ", p[j++] & 0xff); if (j + off >= count) break; } // Pad for (; j < 16; ++j) out << ((j%2) ? " " : " "); for (j = 0; j < 16; ++j) { if (j + off < count) out.put(isprint(p[j]) ? p[j] : '.'); } out << endl; off += 16; } } int verify_elf_header(const Elf32_Ehdr* hdr) { if (hdr->e_ident[EI_MAG0] != ELFMAG0 || hdr->e_ident[EI_MAG1] != ELFMAG1 || hdr->e_ident[EI_MAG2] != ELFMAG2 || hdr->e_ident[EI_MAG3] != ELFMAG3) { cerr << "not an elf file" << endl; return -1; } if (hdr->e_ident[EI_CLASS] != ELFCLASS32) { cerr << "not a 32-bit elf file" << endl; return -1; } if (hdr->e_ident[EI_DATA] != ELFDATA2LSB) { cerr << "not a little endian elf file" << endl; return -1; } if (hdr->e_ident[EI_VERSION] != EV_CURRENT) { cerr << "incompatible version" << endl; return -1; } return 0; } class elf_symbol : public Elf32_Sym { public: elf_symbol(const Elf32_Sym& sym) { ::memcpy(static_cast<Elf32_Sym*>(this), &sym, sizeof(Elf32_Sym)); } friend bool operator==(const elf_symbol& lhs, const elf_symbol& rhs) { return 0 == ::memcmp(static_cast<const Elf32_Sym*>(&lhs), static_cast<const Elf32_Sym*>(&rhs), sizeof(Elf32_Sym)); } }; static const char* st_bind(unsigned char info) { switch (ELF32_ST_BIND(info)) { case STB_LOCAL: return "local"; case STB_GLOBAL: return "global"; case STB_WEAK: return "weak"; default: return "unknown"; } } static const char* st_type(unsigned char info) { switch (ELF32_ST_TYPE(info)) { case STT_NOTYPE: return "none"; case STT_OBJECT: return "object"; case STT_FUNC: return "func"; case STT_SECTION: return "section"; case STT_FILE: return "file"; default: return "unknown"; } } static unsigned char st_type(const char* type) { if (strcmp(type, "none") == 0) { return STT_NOTYPE; } else if (strcmp(type, "object") == 0) { return STT_OBJECT; } else if (strcmp(type, "func") == 0) { return STT_FUNC; } else { return 0; } } typedef vector<elf_symbol> elf_symbol_table; typedef map< basic_string<char>, elf_symbol_table > elf_text_map; void process_mapping(char* mapping, size_t size) { const Elf32_Ehdr* ehdr = reinterpret_cast<Elf32_Ehdr*>(mapping); if (verify_elf_header(ehdr) < 0) return; // find the section headers const Elf32_Shdr* shdrs = reinterpret_cast<Elf32_Shdr*>(mapping + ehdr->e_shoff); // find the section header string table, .shstrtab const Elf32_Shdr* shstrtabsh = shdrs + ehdr->e_shstrndx; const char* shstrtab = mapping + shstrtabsh->sh_offset; // find the sections we care about const Elf32_Shdr *symtabsh, *strtabsh, *textsh; int textndx; for (int i = 0; i < ehdr->e_shnum; ++i) { basic_string<char> name(shstrtab + shdrs[i].sh_name); if (name == opt_section) { textsh = shdrs + i; textndx = i; } else if (name == ".symtab") { symtabsh = shdrs + i; } else if (name == ".strtab") { strtabsh = shdrs + i; } } // find the .strtab char* strtab = mapping + strtabsh->sh_offset; // find the .text char* text = mapping + textsh->sh_offset; int textaddr = textsh->sh_addr; // find the symbol table int nentries = symtabsh->sh_size / sizeof(Elf32_Sym); Elf32_Sym* symtab = reinterpret_cast<Elf32_Sym*>(mapping + symtabsh->sh_offset); // look for symbols in the .text section elf_text_map textmap; for (int i = 0; i < nentries; ++i) { const Elf32_Sym* sym = symtab + i; if (sym->st_shndx == textndx && ELF32_ST_TYPE(sym->st_info) == st_type(opt_type) && sym->st_size) { basic_string<char> functext(text + sym->st_value - textaddr, sym->st_size); elf_symbol_table& syms = textmap[functext]; if (syms.end() == find(syms.begin(), syms.end(), elf_symbol(*sym))) syms.insert(syms.end(), *sym); } } int uniquebytes = 0, totalbytes = 0; int uniquecount = 0, totalcount = 0; for (elf_text_map::const_iterator entry = textmap.begin(); entry != textmap.end(); ++entry) { const elf_symbol_table& syms = entry->second; if (syms.size() <= 1) continue; int sz = syms.begin()->st_size; uniquebytes += sz; totalbytes += sz * syms.size(); uniquecount += 1; totalcount += syms.size(); for (elf_symbol_table::const_iterator sym = syms.begin(); sym != syms.end(); ++sym) cout << strtab + sym->st_name << endl; dec(cout); cout << syms.size() << " copies of " << sz << " bytes"; cout << " (" << ((syms.size() - 1) * sz) << " redundant bytes)" << endl; hexdump(cout, entry->first.data(), entry->first.size()); cout << endl; } dec(cout); cout << "bytes unique=" << uniquebytes << ", total=" << totalbytes << endl; cout << "entries unique=" << uniquecount << ", total=" << totalcount << endl; } void process_file(const char* name) { int fd = open(name, O_RDWR); if (fd >= 0) { struct stat statbuf; if (fstat(fd, &statbuf) >= 0) { size_t size = statbuf.st_size; void* mapping = mmap(0, size, PROT_READ, MAP_SHARED, fd, 0); if (mapping != MAP_FAILED) { process_mapping(static_cast<char*>(mapping), size); munmap(mapping, size); } } close(fd); } } static void usage() { cerr << "foldelf [--section=<section>] [--type=<type>] [file ...]\n\ --section, -s the section of the ELF file to scan; defaults\n\ to ``.text''. Valid values include any section\n\ of the ELF file.\n\ --type, -t the type of object to examine in the section;\n\ defaults to ``func''. Valid values include\n\ ``none'', ``func'', or ``object''.\n"; } static struct option opts[] = { { "type", required_argument, 0, 't' }, { "section", required_argument, 0, 's' }, { "help", no_argument, 0, '?' }, { 0, 0, 0, 0 } }; int main(int argc, char* argv[]) { while (1) { int option_index = 0; int c = getopt_long(argc, argv, "t:s:", opts, &option_index); if (c < 0) break; switch (c) { case 't': opt_type = optarg; break; case 's': opt_section = optarg; break; case '?': usage(); break; } } for (int i = optind; i < argc; ++i) process_file(argv[i]); return 0; }
<html> <head> </head> <body> <div class="vevent"> <h5 class="summary">Annual Employee Review</h5> <div>posted on <abbr class="dtstamp" title="19970901T1300Z">September 1, 1997</abbr></div> <div>UID: <span class="uid"><API key>@host.com</span></div> <div>Dates: <abbr class="dtstart" title="19970903T163000Z">Septempter 3, 1997, 16:30</abbr> - <abbr class="dtend" title="19970903T190000Z">19:00 UTC</abbr></div> <div>This meeting is <strong class="class">private</strong>.</div> <div>Filed under:</div> <ul> <li class="category">Business</li> <li class="category">Human Resources</li> </ul> </div> </body> </html>
using UnityEngine; using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine.Serialization; namespace Valve.VR { public class SteamVR_Settings : ScriptableObject { private static SteamVR_Settings _instance; public static SteamVR_Settings instance { get { LoadInstance(); return _instance; } } public bool <API key> = true; public bool <API key> = true; public <API key> trackingSpace { get { return trackingSpaceOrigin; } set { trackingSpaceOrigin = value; if (SteamVR_Behaviour.isPlaying) SteamVR_Action_Pose.<API key>(trackingSpaceOrigin); } } [SerializeField] [<API key>("trackingSpace")] private <API key> trackingSpaceOrigin = <API key>.<API key>; [Tooltip("Filename local to the project root (or executable, in a build)")] public string actionsFilePath = "actions.json"; [Tooltip("Path local to the Assets folder")] public string steamVRInputPath = "SteamVR_Input"; public SteamVR_UpdateModes inputUpdateMode = SteamVR_UpdateModes.OnUpdate; public SteamVR_UpdateModes poseUpdateMode = SteamVR_UpdateModes.OnPreCull; public bool <API key> = true; [Tooltip("This is the app key the unity editor will use to identify your application. (can be \"steam.app.[appid]\" to persist bindings between editor steam)")] public string editorAppKey; [Tooltip("The SteamVR Plugin can automatically make sure VR is enabled in your player settings and if not, enable it.")] public bool autoEnableVR = true; [Space()] [Tooltip("This determines if we use legacy mixed reality mode (3rd controller/tracker device connected) or the new input system mode (pose / input source)")] public bool <API key> = true; [Tooltip("[NON-LEGACY] This is the pose action that will be used for positioning a mixed reality camera if connected")] public SteamVR_Action_Pose <API key> = SteamVR_Input.GetPoseAction("ExternalCamera"); [Tooltip("[NON-LEGACY] This is the input source to check on the pose for the mixed reality camera")] public <API key> <API key> = <API key>.Camera; [Tooltip("[NON-LEGACY] Auto enable mixed reality action set if file exists")] public bool <API key> = true; public bool IsInputUpdateMode(SteamVR_UpdateModes tocheck) { return (inputUpdateMode & tocheck) == tocheck; } public bool IsPoseUpdateMode(SteamVR_UpdateModes tocheck) { return (poseUpdateMode & tocheck) == tocheck; } public static void <API key>() { LoadInstance(); } private static void LoadInstance() { if (_instance == null) { _instance = Resources.Load<SteamVR_Settings>("SteamVR_Settings"); if (_instance == null) { _instance = SteamVR_Settings.CreateInstance<SteamVR_Settings>(); #if UNITY_EDITOR string folderPath = SteamVR.<API key>(true); string assetPath = System.IO.Path.Combine(folderPath, "SteamVR_Settings.asset"); UnityEditor.AssetDatabase.CreateAsset(_instance, assetPath); UnityEditor.AssetDatabase.SaveAssets(); #endif } if (string.IsNullOrEmpty(_instance.editorAppKey)) { _instance.editorAppKey = SteamVR.GenerateAppKey(); Debug.Log("<b>[SteamVR Setup]</b> Generated you an editor app key of: " + _instance.editorAppKey + ". This lets the editor tell SteamVR what project this is. Has no effect on builds. This can be changed in Assets/SteamVR/Resources/SteamVR_Settings"); #if UNITY_EDITOR UnityEditor.EditorUtility.SetDirty(_instance); UnityEditor.AssetDatabase.SaveAssets(); #endif } } } } }
#ifndef <API key> #define <API key> #include <grpc/impl/codegen/byte_buffer.h> #include <grpc/impl/codegen/status.h> #include <stddef.h> #ifdef __cplusplus extern "C" { #endif /** Completion Queues enable notification of the completion of asynchronous actions. */ typedef struct <API key> <API key>; /** An alarm associated with a completion queue. */ typedef struct grpc_alarm grpc_alarm; /** The Channel interface allows creation of Call objects. */ typedef struct grpc_channel grpc_channel; /** A server listens to some port and responds to request calls */ typedef struct grpc_server grpc_server; /** A Call represents an RPC. When created, it is in a configuration state allowing properties to be set until it is invoked. After invoke, the Call can have messages written to it and read from it. */ typedef struct grpc_call grpc_call; /** Type specifier for grpc_arg */ typedef enum { GRPC_ARG_STRING, GRPC_ARG_INTEGER, GRPC_ARG_POINTER } grpc_arg_type; typedef struct <API key> { void *(*copy)(void *p); void (*destroy)(void *p); int (*cmp)(void *p, void *q); } <API key>; /** A single argument... each argument has a key and a value A note on naming keys: Keys are namespaced into groups, usually grouped by library, and are keys for module XYZ are named XYZ.key1, XYZ.key2, etc. Module names must be restricted to the regex [A-Za-z][_A-Za-z0-9]{,15}. Key names must be restricted to the regex [A-Za-z][_A-Za-z0-9]{,47}. GRPC core library keys are prefixed by grpc. Library authors are strongly encouraged to \#define symbolic constants for their keys so that it's possible to change them in the future. */ typedef struct { grpc_arg_type type; char *key; union { char *string; int integer; struct { void *p; const <API key> *vtable; } pointer; } value; } grpc_arg; /** An array of arguments that can be passed around. Used to set optional channel-level configuration. These configuration options are modelled as key-value pairs as defined by grpc_arg; keys are strings to allow easy <API key> extension by arbitrary parties. All evaluation is performed at channel creation time (i.e. the values in this structure need only live through the creation invocation). */ typedef struct { size_t num_args; grpc_arg *args; } grpc_channel_args; /* Channel argument keys: */ /** Enable census for tracing and stats collection */ #define <API key> "grpc.census" /** Maximum number of concurrent incoming streams to allow on a http2 connection */ #define <API key> "grpc.<API key>" /** Maximum message length that the channel can receive */ #define <API key> "grpc.max_message_length" /** Initial sequence number for http2 transports */ #define <API key> \ "grpc.http2.<API key>" /** Amount to read ahead on individual streams. Defaults to 64kb, larger values can help throughput on high-latency connections. NOTE: at some point we'd like to auto-tune this, and this parameter will become a no-op. */ #define <API key> "grpc.http2.lookahead_bytes" /** How much memory to use for hpack decoding */ #define <API key> \ "grpc.http2.hpack_table_size.decoder" /** How much memory to use for hpack encoding */ #define <API key> \ "grpc.http2.hpack_table_size.encoder" /** Default authority to pass if none specified on call construction */ #define <API key> "grpc.default_authority" /** Primary user agent: goes at the start of the user-agent metadata sent on each request */ #define <API key> "grpc.primary_user_agent" /** Secondary user agent: goes at the end of the user-agent metadata sent on each request */ #define <API key> "grpc.<API key>" /** The maximum time between subsequent connection attempts, in ms */ #define <API key> "grpc.<API key>" /* The caller of the <API key> functions may override the target name used for SSL host name checking using this channel argument which is of type GRPC_ARG_STRING. This *should* be used for testing only. If this argument is not specified, the name used for SSL host name checking will be the target parameter (assuming that the secure channel is an SSL channel). If this parameter is specified and the underlying is not an SSL channel, it will just be ignored. */ #define <API key> "grpc.<API key>" /* Maximum metadata size */ #define <API key> "grpc.max_metadata_size" /** Result of a grpc call. If the caller satisfies the prerequisites of a particular operation, the grpc_call_error returned will be GRPC_CALL_OK. Receiving any other value listed here is an indication of a bug in the caller. */ typedef enum grpc_call_error { /** everything went ok */ GRPC_CALL_OK = 0, /** something failed, we don't know what */ GRPC_CALL_ERROR, /** this method is not available on the server */ <API key>, /** this method is not available on the client */ <API key>, /** this method must be called before server_accept */ <API key>, /** this method must be called before invoke */ <API key>, /** this method must be called after invoke */ <API key>, /** this call is already finished (writes_done or write_status has already been called) */ <API key>, /** there is already an outstanding read/write operation on the call */ <API key>, <API key>, /** invalid metadata was passed to this call */ <API key>, /** invalid message was passed to this call */ <API key>, /** completion queue for notification has not been registered with the server */ <API key>, /** this batch of operations leads to more operations than allowed */ <API key>, /** payload type requested is not the type registered */ <API key> } grpc_call_error; /* Write Flags: */ /** Hint that the write may be buffered and need not go out on the wire immediately. GRPC is free to buffer the message until the next non-buffered write, or until writes_done, but it need not buffer completely or at all. */ #define <API key> (0x00000001u) #define <API key> (0x00000002u) /** Mask of all valid flags. */ #define <API key> (<API key> | <API key>) /* Initial metadata flags */ /** Signal that the call is idempotent */ #define <API key> (0x00000010u) /** Signal that the call should not return UNAVAILABLE before it has started */ #define <API key> (0x00000020u) /** Mask of all valid flags */ #define <API key> \ (<API key> | \ <API key>) /** A single metadata element */ typedef struct grpc_metadata { const char *key; const char *value; size_t value_length; uint32_t flags; /** The following fields are reserved for grpc internal use. There is no need to initialize them, and they will be set to garbage during calls to grpc. */ struct { void *obfuscated[4]; } internal_data; } grpc_metadata; /** The type of completion (for grpc_event) */ typedef enum <API key> { /** Shutting down */ GRPC_QUEUE_SHUTDOWN, /** No event before timeout */ GRPC_QUEUE_TIMEOUT, /** Operation completion */ GRPC_OP_COMPLETE } <API key>; /** The result of an operation. Returned by a completion queue when the operation started with tag. */ typedef struct grpc_event { /** The type of the completion. */ <API key> type; /** non-zero if the operation was successful, 0 upon failure. Only GRPC_OP_COMPLETE can succeed or fail. */ int success; /** The tag passed to <API key> etc to start this operation. Only GRPC_OP_COMPLETE has a tag. */ void *tag; } grpc_event; typedef struct { size_t count; size_t capacity; grpc_metadata *metadata; } grpc_metadata_array; typedef struct { char *method; size_t method_capacity; char *host; size_t host_capacity; gpr_timespec deadline; uint32_t flags; void *reserved; } grpc_call_details; typedef enum { /** Send initial metadata: one and only one instance MUST be sent for each call, unless the call was cancelled - in which case this can be skipped. This op completes after all bytes of metadata have been accepted by outgoing flow control. */ <API key> = 0, /** Send a message: 0 or more of these operations can occur for each call. This op completes after all bytes for the message have been accepted by outgoing flow control. */ <API key>, /** Send a close from the client: one and only one instance MUST be sent from the client, unless the call was cancelled - in which case this can be skipped. This op completes after all bytes for the call (including the close) have passed outgoing flow control. */ <API key>, /** Send status from the server: one and only one instance MUST be sent from the server unless the call was cancelled - in which case this can be skipped. This op completes after all bytes for the call (including the status) have passed outgoing flow control. */ <API key>, /** Receive initial metadata: one and only one MUST be made on the client, must not be made on the server. This op completes after all initial metadata has been read from the peer. */ <API key>, /** Receive a message: 0 or more of these operations can occur for each call. This op completes after all bytes of the received message have been read, or after a half-close has been received on this call. */ <API key>, /** Receive status on the client: one and only one must be made on the client. This operation always succeeds, meaning ops paired with this operation will also appear to succeed, even though they may not have. In that case the status will indicate some failure. This op completes after all activity on the call has completed. */ <API key>, /** Receive close on the server: one and only one must be made on the server. This op completes after the close has been received by the server. This operation always succeeds, meaning ops paired with this operation will also appear to succeed, even though they may not have. */ <API key> } grpc_op_type; /** Operation data: one field for each op type (except <API key> which has no arguments) */ typedef struct grpc_op { /** Operation type, as defined by grpc_op_type */ grpc_op_type op; /** Write flags bitset for grpc_begin_messages */ uint32_t flags; /** Reserved for future usage */ void *reserved; union { /** Reserved for future usage */ struct { void *reserved[8]; } reserved; struct { size_t count; grpc_metadata *metadata; } <API key>; grpc_byte_buffer *send_message; struct { size_t <API key>; grpc_metadata *trailing_metadata; grpc_status_code status; const char *status_details; } <API key>; /** ownership of the array is with the caller, but ownership of the elements stays with the call object (ie key, value members are owned by the call object, <API key>->array is owned by the caller). After the operation completes, call <API key> on this value, or reuse it in a future op. */ grpc_metadata_array *<API key>; /** ownership of the byte buffer is moved to the caller; the caller must call <API key> on this value, or reuse it in a future op. */ grpc_byte_buffer **recv_message; struct { /** ownership of the array is with the caller, but ownership of the elements stays with the call object (ie key, value members are owned by the call object, trailing_metadata->array is owned by the caller). After the operation completes, call <API key> on this value, or reuse it in a future op. */ grpc_metadata_array *trailing_metadata; grpc_status_code *status; /** status_details is a buffer owned by the application before the op completes and after the op has completed. During the operation status_details may be reallocated to a size larger than *<API key>, in which case *<API key> will be updated with the new array capacity. Pre-allocating space: size_t my_capacity = 8; char *my_details = gpr_malloc(my_capacity); x.status_details = &my_details; x.<API key> = &my_capacity; Not pre-allocating space: size_t my_capacity = 0; char *my_details = NULL; x.status_details = &my_details; x.<API key> = &my_capacity; After the call: gpr_free(my_details); */ char **status_details; size_t *<API key>; } <API key>; struct { /** out argument, set to 1 if the call failed in any way (seen as a cancellation on the server), or 0 if the call succeeded */ int *cancelled; } <API key>; } data; } grpc_op; #ifdef __cplusplus } #endif #endif /* <API key> */
using System.Collections.Generic; namespace DocGenerator.Documentation.Blocks { <summary> Used to keep a line of code (could be multiple e.g fluent syntax) and its annotations in one logical unit. So they do not suffer from reordering based on line number when writing out the documentation </summary> public class CombinedBlock : IDocumentationBlock { public string Value { get; } public IEnumerable<IDocumentationBlock> Blocks { get; } public int LineNumber { get; } public CombinedBlock(IEnumerable<IDocumentationBlock> blocks, int lineNumber) { Blocks = blocks; LineNumber = lineNumber; Value = null; } } }
# Code Size ## Too Many Parameters <dl> <dt></dt> <dd>too_many_parameters</dd> <dt></dt> <dd><API key>.swift</dd> <dt></dt> <dd>Minor</dd> <dt></dt> <dd>Code Size</dd> </dl> Methods with too many parameters are hard to understand and maintain, and are thirsty for refactorings, like [Replace Parameter With Method](http: [Introduce Parameter Object](http: or [Preserve Whole Object](http: ## Thresholds: <dl> <dt><API key></dt> <dd>The reporting threshold for too many parameters, default value is 10.</dd> </dl> ## Examples: ### Example 1 func example( a: Int, b: Int, c: Int, z: Int ) {} ## References: Fowler, Martin (1999). *Refactoring: Improving the design of existing code.* Addison Wesley. ## Long Line <dl> <dt></dt> <dd>long_line</dd> <dt></dt> <dd>LongLineRule.swift</dd> <dt></dt> <dd>Minor</dd> <dt></dt> <dd>Code Size</dd> </dl> When a line of code is very long, it largely harms the readability. Break long lines of code into multiple lines. ## Thresholds: <dl> <dt>LONG_LINE</dt> <dd>The long line reporting threshold, default value is 100.</dd> </dl> ## Examples: ### Example 1 let <API key>...<API key>
package com.code.constant; public class StringEvent { public static String NET_STATE_CHANGE = "net_state_change"; }
using Akka.Actor; using Akka.Actor.Internals; using Akka.TestKit; using Xunit; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Akka.Tests.Actor { public class <API key> : AkkaSpec { [Fact] public void CanResolveActorRef() { var path = TestActor.Path.ToString(); var resolved = ((ActorSystemImpl)Sys).Provider.ResolveActorRef(path); Assert.Same(TestActor, resolved); } } }
import numpy as np from math import sin, pi, cos from banti.glyph import Glyph halfsize = 40 size = 2*halfsize + 1 picture = np.zeros((size, size)) for t in range(-135, 135): x = round(halfsize + halfsize * cos(pi * t / 180)) y = round(halfsize + halfsize * sin(pi * t / 180)) picture[x][y] = 1 zoomsz = 1 * halfsize b = Glyph(['O', 0, 0, size, size, 0, 0, 0, 0, None]) b.set_pix(picture) c = Glyph() for t in range(0, 360, 15): x = round(zoomsz + zoomsz * cos(pi * t / 180)) y = round(zoomsz + zoomsz * sin(pi * t / 180)) b.set_xy_wh((x, y, size, size)) c = c + b print(b) print(c)
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="content" content ="text/html; charset=utf-8" /> <title> </title> <meta http-equiv="MSThemeCompatible" content = "Yes" /> <script src="__JS__/common.js" type="text/javascript"></script> <script src="__STATIC__/jquery-1.11.1.min.js" type="text/javascript"></script> <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak={gr-:$apikey}"></script> <script src="__STATIC__/artDialog/jquery.artDialog.js?skin=default"></script> <script src="__STATIC__/artDialog/plugins/iframeTools.js"></script> <style type="text/css"> body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;} #allmap {width: 100%;height: 100%;overflow: hidden;margin:0;} #l-map{height:100%;width:78%;float: left;border-right:2px solid #bcbcbc;} #r-result{height:100%;width:20%;float:left;} .search{ padding: 6px; font-size: 14px; margin: 5px; color: #993300; } .search a{ background-color: #5d5d5d; color: #fff; margin-left: 5px; border-radius: 3px; padding: 5px; } .searchkeyword{ border: #606060 2px solid; padding: 5px; } </style> </head> <body id="nv_member"> <input type="hidden" id="longitude" value="0" /> <input type="hidden" id="latitude" value="0" /> <div class="search" style="margin:0"><input type="text" id="keyword" class="searchkeyword" /><a href=" <div id="l-map"></div> <div id="r-result"></div> <script type="text/javascript"> function G(id) { return document.getElementById(id); } if (art.dialog.data('longitude')) { G('longitude').value = art.dialog.data('longitude'); G('latitude').value = art.dialog.data('latitude'); }; document.getElementById('ok').onclick = function () { var origin = artDialog.open.origin; var longitudeinput = origin.document.getElementById('longitude'); var latitudeinput = origin.document.getElementById('latitude'); longitudeinput.value = $('#longitude').attr('value'); latitudeinput.value = $('#latitude').attr('value'); art.dialog.close(); }; var map = new BMap.Map("l-map"); var myCity = new BMap.LocalCity(); myCity.get(createAniMarker); var point = new BMap.Point($('#longitude').val(),$('#latitude').val()); map.centerAndZoom(point,12); map.<API key>(); var menu = new BMap.ContextMenu(); var txtMenuItem = [ { text:'', callback:function(){ map.setMapType(BMAP_HYBRID_MAP);} } ]; for(var i=0; i < txtMenuItem.length; i++){ menu.addItem(new BMap.MenuItem(txtMenuItem[i].text,txtMenuItem[i].callback,100)); } map.addContextMenu(menu); var local = new BMap.LocalSearch("", { renderOptions: { map: map, panel : "r-result", autoViewport: true, selectFirstResult: false }, onSearchComplete:searchComplete }); function searchLoc(keyword){ $key = (arguments[0] ) || G("keyword").value; local.search($key); } function searchComplete(){ var result = local.getResults(); if(result && result.getPoi(0) ){ var pp = local.getResults().getPoi(0).point; // console.log(pp); map.centerAndZoom(pp, 18); map.clearOverlays(); marker = new BMap.Marker(pp); map.addOverlay(marker); marker.setAnimation(<API key>); $('#longitude').attr('value',pp.lng); $('#latitude').attr('value',pp.lat); } } var marker = {}; function createAniMarker(result){ // map.clearOverlays(); if(result){ var cityName = result.name; } if($('#longitude').val()==0||$('#longitude').val()==''){ if(cityName){ map.setCenter(cityName); } p = new BMap.Point(result.center.lng,result.center.lat); }else{ p = new BMap.Point($('#longitude').val(),$('#latitude').val()); } marker = new BMap.Marker(p); marker.enableDragging(); map.addOverlay(marker); marker.setAnimation(<API key>); marker.addEventListener("dragend", function(e){ $('#longitude').attr('value',e.point.lng) $('#latitude').attr('value',e.point.lat) }) } map.addEventListener("click",function(e){ map.removeOverlay(marker); $("#longitude").attr("value",e.point.lng); $("#latitude").attr("value",e.point.lat); createAniMarker(); // alert(e.point.lng + "," + e.point.lat); }); var ac = new BMap.Autocomplete( {"input" : "keyword" ,"location" : map }); ac.addEventListener("onhighlight", function(e) { var str = ""; var _value = e.fromitem.value; var value = ""; if (e.fromitem.index > -1) { value = _value.province + _value.city + _value.district + _value.street + _value.business; } str = "FromItem<br />index = " + e.fromitem.index + "<br />value = " + value; value = ""; if (e.toitem.index > -1) { _value = e.toitem.value; value = _value.province + _value.city + _value.district + _value.street + _value.business; } str += "<br />ToItem<br />index = " + e.toitem.index + "<br />value = " + value; // G("searchResultPanel").innerHTML = str; }); var myValue; ac.addEventListener("onconfirm", function(e) { var _value = e.item.value; myValue = _value.province + _value.city + _value.district + _value.street + _value.business; // G("searchResultPanel").innerHTML ="onconfirm<br />index = " + e.item.index + "<br />myValue = " + myValue; setPlace(); }); function setPlace(){ map.clearOverlays(); // function myFun(){ // var pp = local.getResults().getPoi(0).point; // // map.centerAndZoom(pp, 18); // marker = new BMap.Marker(pp); // map.addOverlay(marker); // // marker.setAnimation(<API key>); searchLoc(myValue); } //console.log(marker); </script> </body> </html>
function __processArg(obj, key) { var arg = null; if (obj) { arg = obj[key] || null; delete obj[key]; } return arg; } function Controller() { function goSlide(event) { var index = event.source.mod; var arrViews = $.scrollableView.getViews(); switch (index) { case "0": $.lbl1.backgroundColor = "#453363"; $.lbl1.color = "#AA9DB6"; $.lbl2.backgroundColor = "#E6E7E9"; $.lbl2.color = "#4CC4D2"; $.lbl3.backgroundColor = "#E6E7E9"; $.lbl3.color = "#4CC4D2"; break; case "1": $.lbl1.backgroundColor = "#E6E7E9"; $.lbl1.color = "#4CC4D2"; $.lbl2.backgroundColor = "#453363"; $.lbl2.color = "#AA9DB6"; $.lbl3.backgroundColor = "#E6E7E9"; $.lbl3.color = "#4CC4D2"; break; case "2": $.lbl1.backgroundColor = "#E6E7E9"; $.lbl1.color = "#4CC4D2"; $.lbl2.backgroundColor = "#E6E7E9"; $.lbl2.color = "#4CC4D2"; $.lbl3.backgroundColor = "#453363"; $.lbl3.color = "#AA9DB6"; } $.scrollableView.scrollToView(arrViews[index]); } require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments)); this.__controllerPath = "contact"; if (arguments[0]) { var __parentSymbol = __processArg(arguments[0], "__parentSymbol"); { __processArg(arguments[0], "$model"); } { __processArg(arguments[0], "__itemTemplate"); } } var $ = this; var exports = {}; var __defers = {}; $.__views.win = Ti.UI.createView({ layout: "vertical", id: "win", backgroundColor: "white" }); $.__views.win && $.addTopLevelView($.__views.win); $.__views.__alloyId87 = Alloy.createController("_header", { id: "__alloyId87", __parentSymbol: $.__views.win }); $.__views.__alloyId87.setParent($.__views.win); $.__views.__alloyId88 = Ti.UI.createView({ height: "20%", backgroundColor: "#836EAF", id: "__alloyId88" }); $.__views.win.add($.__views.__alloyId88); $.__views.__alloyId89 = Ti.UI.createLabel({ text: "Contact us", left: "10", top: "10", color: "white", id: "__alloyId89" }); $.__views.__alloyId88.add($.__views.__alloyId89); $.__views.menu = Ti.UI.createView({ id: "menu", layout: "horizontal", height: "50", width: "100%" }); $.__views.win.add($.__views.menu); $.__views.lbl1 = Ti.UI.createLabel({ text: "Our Offices", id: "lbl1", mod: "0", height: "100%", width: "33%", textAlign: "center", backgroundColor: "#453363", color: "#AA9DB6" }); $.__views.menu.add($.__views.lbl1); goSlide ? $.__views.lbl1.addEventListener("touchend", goSlide) : __defers["$.__views.lbl1!touchend!goSlide"] = true; $.__views.__alloyId90 = Ti.UI.createView({ backgroundColor: "#4CC4D2", height: "100%", width: "0.45%", id: "__alloyId90" }); $.__views.menu.add($.__views.__alloyId90); $.__views.lbl2 = Ti.UI.createLabel({ text: "Care Center", id: "lbl2", mod: "1", height: "100%", width: "33%", textAlign: "center", backgroundColor: "#E6E7E9", color: "#4CC4D2" }); $.__views.menu.add($.__views.lbl2); goSlide ? $.__views.lbl2.addEventListener("touchend", goSlide) : __defers["$.__views.lbl2!touchend!goSlide"] = true; $.__views.__alloyId91 = Ti.UI.createView({ backgroundColor: "#4CC4D2", height: "100%", width: "0.45%", id: "__alloyId91" }); $.__views.menu.add($.__views.__alloyId91); $.__views.lbl3 = Ti.UI.createLabel({ text: "XOX Dealers", id: "lbl3", mod: "2", height: "100%", width: "33%", textAlign: "center", backgroundColor: "#E6E7E9", color: "#4CC4D2" }); $.__views.menu.add($.__views.lbl3); goSlide ? $.__views.lbl3.addEventListener("touchend", goSlide) : __defers["$.__views.lbl3!touchend!goSlide"] = true; var __alloyId92 = []; $.__views.__alloyId93 = Alloy.createController("contact1", { id: "__alloyId93", __parentSymbol: __parentSymbol }); __alloyId92.push($.__views.__alloyId93.getViewEx({ recurse: true })); $.__views.__alloyId94 = Alloy.createController("contact2", { id: "__alloyId94", __parentSymbol: __parentSymbol }); __alloyId92.push($.__views.__alloyId94.getViewEx({ recurse: true })); $.__views.__alloyId95 = Alloy.createController("contact3", { id: "__alloyId95", __parentSymbol: __parentSymbol }); __alloyId92.push($.__views.__alloyId95.getViewEx({ recurse: true })); $.__views.scrollableView = Ti.UI.<API key>({ views: __alloyId92, id: "scrollableView", showPagingControl: "false", scrollingEnabled: "false" }); $.__views.win.add($.__views.scrollableView); exports.destroy = function() {}; _.extend($, $.__views); var storeModel = Alloy.createCollection("storeLocator"); var details = storeModel.getStoreList(); console.log(details); __defers["$.__views.lbl1!touchend!goSlide"] && $.__views.lbl1.addEventListener("touchend", goSlide); __defers["$.__views.lbl2!touchend!goSlide"] && $.__views.lbl2.addEventListener("touchend", goSlide); __defers["$.__views.lbl3!touchend!goSlide"] && $.__views.lbl3.addEventListener("touchend", goSlide); _.extend($, exports); } var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._; module.exports = Controller;
extern alias SSmDsClient; using System; using System.Collections.Generic; using System.Linq; using OpenRiaServices.DomainServices.Client; using Cities; using Microsoft.Silverlight.Testing; using Microsoft.VisualStudio.TestTools.UnitTesting; using DataTests.Northwind.LTS; using System.ComponentModel.DataAnnotations; using OpenRiaServices.Silverlight.Testing; namespace OpenRiaServices.DomainServices.Client.Test { using Resource = SSmDsClient::OpenRiaServices.DomainServices.Client.Resource; using Resources = SSmDsClient::OpenRiaServices.DomainServices.Client.Resources; #region Test Classes public class TestOperation : OperationBase { private Action<TestOperation> _completeAction; public TestOperation(Action<TestOperation> completeAction, object userState) : base(userState) { this._completeAction = completeAction; } protected override bool <API key> { get { return true; } } protected override void CancelCore() { base.CancelCore(); } public new void Complete(Exception error) { base.Complete(error); } public new void Complete(object result) { base.Complete(result); } public new void Cancel() { base.Cancel(); } <summary> Invoke the completion callback. </summary> protected override void <API key>() { if (this._completeAction != null) { this._completeAction(this); } } } #endregion <summary> Targeted tests for OperationBase and derived classes </summary> [TestClass] public class OperationTests : UnitTestBase { public void <API key>() { TestDataContext ctxt = new TestDataContext(new Uri(TestURIs.RootURI, "<API key>.svc")); var query = ctxt.CreateQuery<Product>("<API key>", null, false, true); LoadOperation lo = new LoadOperation<Product>(query, LoadBehavior.KeepCurrent, null, null, null); EventHandler action = (o, e) => { LoadOperation loadOperation = (LoadOperation)o; if (loadOperation.HasError) { loadOperation.MarkErrorAsHandled(); } }; lo.Completed += action; <API key> ex = new <API key>("Operation Failed!", <API key>.ServerError, 42, "StackTrace"); lo.Complete(ex); // verify that calling MarkAsHandled again is a noop lo.MarkErrorAsHandled(); lo.MarkErrorAsHandled(); // verify that calling MarkAsHandled on an operation not in error // results in an exception lo = new LoadOperation<Product>(query, LoadBehavior.KeepCurrent, null, null, null); Assert.IsFalse(lo.HasError); Assert.IsTrue(lo.IsErrorHandled); ExceptionHelper.<API key>(delegate { lo.MarkErrorAsHandled(); }, Resource.<API key>); } <summary> Verify that Load operations that don't specify a callback to handle errors and don't specify throwOnError = false result in an exception. </summary> [TestMethod] public void <API key>() { TestDataContext ctxt = new TestDataContext(new Uri(TestURIs.RootURI, "<API key>.svc")); var query = ctxt.CreateQuery<Product>("<API key>", null, false, true); LoadOperation lo = new LoadOperation<Product>(query, LoadBehavior.KeepCurrent, null, null, null); <API key> expectedException = null; <API key> ex = new <API key>("Operation Failed!", <API key>.ServerError, 42, "StackTrace"); try { lo.Complete(ex); } catch (<API key> e) { expectedException = e; } // verify the exception properties Assert.IsNotNull(expectedException); Assert.AreEqual(string.Format(Resource.<API key>, "<API key>", ex.Message), expectedException.Message); Assert.AreEqual(ex.StackTrace, expectedException.StackTrace); Assert.AreEqual(ex.Status, expectedException.Status); Assert.AreEqual(ex.ErrorCode, expectedException.ErrorCode); Assert.AreEqual(false, lo.IsErrorHandled); // now test again with validation errors expectedException = null; ValidationResult[] validationErrors = new ValidationResult[] { new ValidationResult("Foo", new string[] { "Bar" }) }; lo = new LoadOperation<Product>(query, LoadBehavior.KeepCurrent, null, null, null); try { lo.Complete(validationErrors); } catch (<API key> e) { expectedException = e; } // verify the exception properties Assert.IsNotNull(expectedException); Assert.AreEqual(string.Format(Resource.<API key>, "<API key>"), expectedException.Message); } <summary> Verify that Load operations that don't specify a callback to handle errors and don't specify throwOnError = false result in an exception. </summary> [TestMethod] public void <API key>() { CityDomainContext cities = new CityDomainContext(TestURIs.Cities); InvokeOperation invoke = new InvokeOperation("Echo", null, null, null, null); <API key> expectedException = null; <API key> ex = new <API key>("Operation Failed!", <API key>.ServerError, 42, "StackTrace"); try { invoke.Complete(ex); } catch (<API key> e) { expectedException = e; } // verify the exception properties Assert.IsNotNull(expectedException); Assert.AreEqual(string.Format(Resource.<API key>, "Echo", ex.Message), expectedException.Message); Assert.AreEqual(ex.StackTrace, expectedException.StackTrace); Assert.AreEqual(ex.Status, expectedException.Status); Assert.AreEqual(ex.ErrorCode, expectedException.ErrorCode); Assert.AreEqual(false, invoke.IsErrorHandled); // now test again with validation errors expectedException = null; ValidationResult[] validationErrors = new ValidationResult[] { new ValidationResult("Foo", new string[] { "Bar" }) }; invoke = new InvokeOperation("Echo", null, null, null, null); try { invoke.Complete(validationErrors); } catch (<API key> e) { expectedException = e; } // verify the exception properties Assert.IsNotNull(expectedException); Assert.AreEqual(string.Format(Resource.<API key>, "Echo"), expectedException.Message); } <summary> Verify that Load operations that don't specify a callback to handle errors and don't specify throwOnError = false result in an exception. </summary> [TestMethod] public void <API key>() { CityDomainContext cities = new CityDomainContext(TestURIs.Cities); CityData data = new CityData(); cities.Cities.LoadEntities(data.Cities.ToArray()); City city = cities.Cities.First(); city.ZoneID = 1; Assert.IsTrue(cities.EntityContainer.HasChanges); SubmitOperation submit = new SubmitOperation(cities.EntityContainer.GetChanges(), null, null, null); <API key> expectedException = null; <API key> ex = new <API key>("Submit Failed!", <API key>.ServerError, 42, "StackTrace"); try { submit.Complete(ex); } catch (<API key> e) { expectedException = e; } // verify the exception properties Assert.IsNotNull(expectedException); Assert.AreEqual(string.Format(Resource.<API key>, ex.Message), expectedException.Message); Assert.AreEqual(ex.StackTrace, expectedException.StackTrace); Assert.AreEqual(ex.Status, expectedException.Status); Assert.AreEqual(ex.ErrorCode, expectedException.ErrorCode); Assert.AreEqual(false, submit.IsErrorHandled); // now test again with conflicts expectedException = null; IEnumerable<ChangeSetEntry> entries = ChangeSetBuilder.Build(cities.EntityContainer.GetChanges()); ChangeSetEntry entry = entries.First(); entry.ValidationErrors = new <API key>[] { new <API key>("Foo", new string[] { "Bar" }) }; submit = new SubmitOperation(cities.EntityContainer.GetChanges(), null, null, null); try { submit.Complete(<API key>.Conflicts); } catch (<API key> e) { expectedException = e; } // verify the exception properties Assert.IsNotNull(expectedException); Assert.AreEqual(string.Format(Resource.<API key>), expectedException.Message); // now test again with validation errors expectedException = null; entries = ChangeSetBuilder.Build(cities.EntityContainer.GetChanges()); entry = entries.First(); entry.ConflictMembers = new string[] { "ZoneID" }; submit = new SubmitOperation(cities.EntityContainer.GetChanges(), null, null, null); try { submit.Complete(<API key>.ValidationFailed); } catch (<API key> e) { expectedException = e; } // verify the exception properties Assert.IsNotNull(expectedException); Assert.AreEqual(string.Format(Resource.<API key>, ex.Message), expectedException.Message); } [TestMethod] [Asynchronous] [Description("Verifies that cached LoadOperation Entity results are valid when accessed from the complete callback.")] public void <API key>() { Cities.CityDomainContext cities = new CityDomainContext(TestURIs.Cities); bool callbackCalled = false; Exception callbackException = null; Action<LoadOperation<City>> callback = (op) => { if (op.HasError) { op.MarkErrorAsHandled(); } try { Assert.AreEqual(11, op.AllEntities.Count()); Assert.AreEqual(11, op.Entities.Count()); } catch (Exception e) { callbackException = e; } finally { callbackCalled = true; } }; var q = cities.GetCitiesQuery(); LoadOperation<City> lo = cities.Load(q, callback, null); // KEY to bug : access Entity collections to force them to cache IEnumerable<City> entities = lo.Entities; IEnumerable<Entity> allEntities = lo.AllEntities; EnqueueConditional(() => lo.IsComplete && callbackCalled); EnqueueCallback(delegate { Assert.IsNull(callbackException); Assert.IsNull(lo.Error); Assert.AreEqual(11, lo.AllEntities.Count()); Assert.AreEqual(11, lo.Entities.Count()); }); EnqueueTestComplete(); } [TestMethod] [Description("Verifies that exceptions are thrown and callstacks are preserved.")] public void Exceptions() { Cities.CityDomainContext cities = new CityDomainContext(TestURIs.Cities); Action<LoadOperation<City>> loCallback = (op) => { if (op.HasError) { op.MarkErrorAsHandled(); } throw new <API key>("Fnord!"); }; Action<SubmitOperation> soCallback = (op) => { if (op.HasError) { op.MarkErrorAsHandled(); } throw new <API key>("Fnord!"); }; Action<InvokeOperation> ioCallback = (op) => { if (op.HasError) { op.MarkErrorAsHandled(); } throw new <API key>("Fnord!"); }; LoadOperation lo = new LoadOperation<City>(cities.GetCitiesQuery(), LoadBehavior.MergeIntoCurrent, loCallback, null, loCallback); // verify completion callbacks that throw ExceptionHelper.<API key>(delegate { try { lo.Complete(DomainClientResult.CreateQueryResult(new Entity[0], new Entity[0], 0, new ValidationResult[0])); } catch (Exception ex) { Assert.IsTrue(ex.StackTrace.Contains("at OpenRiaServices.DomainServices.Client.Test.OperationTests"), "Stacktrace not preserved."); throw; } }, "Fnord!"); // verify cancellation callbacks for all fx operation types lo = new LoadOperation<City>(cities.GetCitiesQuery(), LoadBehavior.MergeIntoCurrent, null, null, loCallback); ExceptionHelper.<API key>(delegate { lo.Cancel(); }, "Fnord!"); SubmitOperation so = new SubmitOperation(cities.EntityContainer.GetChanges(), soCallback, null, soCallback); ExceptionHelper.<API key>(delegate { so.Cancel(); }, "Fnord!"); InvokeOperation io = new InvokeOperation("Fnord", null, null, null, ioCallback); ExceptionHelper.<API key>(delegate { io.Cancel(); }, "Fnord!"); } <summary> Attempt to call cancel from the completion callback. Expect an exception since the operation is already complete. </summary> [TestMethod] [Asynchronous] public void <API key>() { Cities.CityDomainContext cities = new CityDomainContext(TestURIs.Cities); bool callbackCalled = false; <API key> expectedException = null; Action<LoadOperation<City>> callback = (op) => { if (op.HasError) { op.MarkErrorAsHandled(); } // verify that CanCancel is false even though we'll // ignore this and try below Assert.IsFalse(op.CanCancel); try { op.Cancel(); } catch (<API key> io) { expectedException = io; } callbackCalled = true; }; var q = cities.GetCitiesQuery().Take(1); LoadOperation lo = cities.Load(q, callback, null); EnqueueConditional(() => lo.IsComplete && callbackCalled); EnqueueCallback(delegate { Assert.IsFalse(lo.IsCanceled); Assert.AreEqual(Resources.<API key>, expectedException.Message); }); EnqueueTestComplete(); } } }
require 'spec_helper' describe 'source install' do let(:chef_run) do runner = ChefSpec::Runner.new(platform: 'ubuntu', version: '12.04') runner.node.set['nrpe']['install_method'] = 'source' runner.converge 'nrpe::default' end it 'includes the nrpe source recipes' do expect(chef_run).to include_recipe('nrpe::_source_install') expect(chef_run).to include_recipe('nrpe::_source_nrpe') expect(chef_run).to include_recipe('nrpe::_source_plugins') end it 'includes the build-essential recipe' do expect(chef_run).to include_recipe('build-essential') end it 'installs the correct packages' do expect(chef_run).to install_package('libssl-dev') expect(chef_run).to install_package('make') expect(chef_run).to install_package('tar') end it 'creates the nrpe user' do expect(chef_run).to create_user(chef_run.node['nrpe']['user']) end it 'creates the nrpe group' do expect(chef_run).to create_group(chef_run.node['nrpe']['group']) end it 'creates config dir' do expect(chef_run).to create_directory(chef_run.node['nrpe']['conf_dir']) end it 'templates init script' do expect(chef_run).to render_file("/etc/init.d/#{chef_run.node['nrpe']['service_name']}").with_content('processname: nrpe') end it 'starts service called nrpe not nagios-nrpe-server' do expect(chef_run).to start_service('nrpe') end end
<?php namespace Fungku\NetSuite\Classes; class BudgetCategory extends Record { public $name; public $budgetType; public $isInactive; public $internalId; static $paramtypesmap = array( "name" => "string", "budgetType" => "boolean", "isInactive" => "boolean", "internalId" => "string", ); }
# The following comment should be removed at some point in the future. # mypy: <API key>=False from __future__ import absolute_import import logging import os.path import re from pip._vendor.packaging.version import parse as parse_version from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor.six.moves.urllib import request as urllib_request from pip._internal.exceptions import BadCommand, InstallationError from pip._internal.utils.misc import display_path, hide_url from pip._internal.utils.subprocess import make_command from pip._internal.utils.temp_dir import TempDirectory from pip._internal.utils.typing import MYPY_CHECK_RUNNING from pip._internal.vcs.versioncontrol import ( RemoteNotFoundError, VersionControl, <API key>, vcs, ) if MYPY_CHECK_RUNNING: from typing import Optional, Tuple from pip._internal.utils.misc import HiddenText from pip._internal.vcs.versioncontrol import AuthInfo, RevOptions urlsplit = urllib_parse.urlsplit urlunsplit = urllib_parse.urlunsplit logger = logging.getLogger(__name__) HASH_REGEX = re.compile('^[a-fA-F0-9]{40}$') def looks_like_hash(sha): return bool(HASH_REGEX.match(sha)) class Git(VersionControl): name = 'git' dirname = '.git' repo_name = 'clone' schemes = ( 'git', 'git+http', 'git+https', 'git+ssh', 'git+git', 'git+file', ) # Prevent the user's environment variables from interfering with pip: unset_environ = ('GIT_DIR', 'GIT_WORK_TREE') default_arg_rev = 'HEAD' @staticmethod def get_base_rev_args(rev): return [rev] def <API key>(self, url, dest): # type: (str, str) -> bool _, rev_options = self.get_url_rev_options(hide_url(url)) if not rev_options.rev: return False if not self.is_commit_id_equal(dest, rev_options.rev): # the current commit is different from rev, # which means rev was something else than a commit hash return False # return False in the rare case rev is both a commit hash # and a tag or a branch; we don't want to cache in that case # because that branch/tag could point to something else in the future is_tag_or_branch = bool( self.get_revision_sha(dest, rev_options.rev)[0] ) return not is_tag_or_branch def get_git_version(self): VERSION_PFX = 'git version ' version = self.run_command( ['version'], show_stdout=False, stdout_only=True ) if version.startswith(VERSION_PFX): version = version[len(VERSION_PFX):].split()[0] else: version = '' # get first 3 positions of the git version because # on windows it is x.y.z.windows.t, and this parses as # LegacyVersion which always smaller than a Version. version = '.'.join(version.split('.')[:3]) return parse_version(version) @classmethod def get_current_branch(cls, location): """ Return the current branch, or None if HEAD isn't at a branch (e.g. detached HEAD). """ # git-symbolic-ref exits with empty stdout if "HEAD" is a detached # HEAD rather than a symbolic ref. In addition, the -q causes the # command to exit with status code 1 instead of 128 in this case # and to suppress the message to stderr. args = ['symbolic-ref', '-q', 'HEAD'] output = cls.run_command( args, <API key>=(1, ), show_stdout=False, stdout_only=True, cwd=location, ) ref = output.strip() if ref.startswith('refs/heads/'): return ref[len('refs/heads/'):] return None def export(self, location, url): # type: (str, HiddenText) -> None """Export the Git repository at the url to the destination location""" if not location.endswith('/'): location = location + '/' with TempDirectory(kind="export") as temp_dir: self.unpack(temp_dir.path, url=url) self.run_command( ['checkout-index', '-a', '-f', '--prefix', location], show_stdout=False, cwd=temp_dir.path ) @classmethod def get_revision_sha(cls, dest, rev): """ Return (sha_or_none, is_branch), where sha_or_none is a commit hash if the revision names a remote branch or tag, otherwise None. Args: dest: the repository directory. rev: the revision name. """ # Pass rev to pre-filter the list. output = cls.run_command( ['show-ref', rev], cwd=dest, show_stdout=False, stdout_only=True, on_returncode='ignore', ) refs = {} for line in output.strip().splitlines(): try: sha, ref = line.split() except ValueError: # Include the offending line to simplify troubleshooting if # this error ever occurs. raise ValueError('unexpected show-ref line: {!r}'.format(line)) refs[ref] = sha branch_ref = 'refs/remotes/origin/{}'.format(rev) tag_ref = 'refs/tags/{}'.format(rev) sha = refs.get(branch_ref) if sha is not None: return (sha, True) sha = refs.get(tag_ref) return (sha, False) @classmethod def _should_fetch(cls, dest, rev): """ Return true if rev is a ref or is a commit that we don't have locally. Branches and tags are not considered in this method because they are assumed to be always available locally (which is a normal outcome of ``git clone`` and ``git fetch --tags``). """ if rev.startswith("refs/"): # Always fetch remote refs. return True if not looks_like_hash(rev): # Git fetch would fail with abbreviated commits. return False if cls.has_commit(dest, rev): # Don't fetch if we have the commit locally. return False return True @classmethod def resolve_revision(cls, dest, url, rev_options): # type: (str, HiddenText, RevOptions) -> RevOptions """ Resolve a revision to a new RevOptions object with the SHA1 of the branch, tag, or ref if found. Args: rev_options: a RevOptions object. """ rev = rev_options.arg_rev # The arg_rev property's implementation for Git ensures that the # rev return value is always non-None. assert rev is not None sha, is_branch = cls.get_revision_sha(dest, rev) if sha is not None: rev_options = rev_options.make_new(sha) rev_options.branch_name = rev if is_branch else None return rev_options # Do not show a warning for the common case of something that has # the form of a Git commit hash. if not looks_like_hash(rev): logger.warning( "Did not find branch or tag '%s', assuming revision or ref.", rev, ) if not cls._should_fetch(dest, rev): return rev_options # fetch the requested revision cls.run_command( make_command('fetch', '-q', url, rev_options.to_args()), cwd=dest, ) # Change the revision to the SHA of the ref we fetched sha = cls.get_revision(dest, rev='FETCH_HEAD') rev_options = rev_options.make_new(sha) return rev_options @classmethod def is_commit_id_equal(cls, dest, name): """ Return whether the current commit hash equals the given name. Args: dest: the repository directory. name: a string name. """ if not name: # Then avoid an unnecessary subprocess call. return False return cls.get_revision(dest) == name def fetch_new(self, dest, url, rev_options): # type: (str, HiddenText, RevOptions) -> None rev_display = rev_options.to_display() logger.info('Cloning %s%s to %s', url, rev_display, display_path(dest)) self.run_command(make_command('clone', '-q', url, dest)) if rev_options.rev: # Then a specific revision was requested. rev_options = self.resolve_revision(dest, url, rev_options) branch_name = getattr(rev_options, 'branch_name', None) if branch_name is None: # Only do a checkout if the current commit id doesn't match # the requested revision. if not self.is_commit_id_equal(dest, rev_options.rev): cmd_args = make_command( 'checkout', '-q', rev_options.to_args(), ) self.run_command(cmd_args, cwd=dest) elif self.get_current_branch(dest) != branch_name: # Then a specific branch was requested, and that branch # is not yet checked out. track_branch = 'origin/{}'.format(branch_name) cmd_args = [ 'checkout', '-b', branch_name, '--track', track_branch, ] self.run_command(cmd_args, cwd=dest) #: repo may contain submodules self.update_submodules(dest) def switch(self, dest, url, rev_options): # type: (str, HiddenText, RevOptions) -> None self.run_command( make_command('config', 'remote.origin.url', url), cwd=dest, ) cmd_args = make_command('checkout', '-q', rev_options.to_args()) self.run_command(cmd_args, cwd=dest) self.update_submodules(dest) def update(self, dest, url, rev_options): # type: (str, HiddenText, RevOptions) -> None # First fetch changes from the default remote if self.get_git_version() >= parse_version('1.9.0'): # fetch tags in addition to everything else self.run_command(['fetch', '-q', '--tags'], cwd=dest) else: self.run_command(['fetch', '-q'], cwd=dest) # Then reset to wanted revision (maybe even origin/master) rev_options = self.resolve_revision(dest, url, rev_options) cmd_args = make_command('reset', '--hard', '-q', rev_options.to_args()) self.run_command(cmd_args, cwd=dest) #: update submodules self.update_submodules(dest) @classmethod def get_remote_url(cls, location): """ Return URL of the first remote encountered. Raises RemoteNotFoundError if the repository does not have a remote url configured. """ # We need to pass 1 for <API key> since the command # exits with return code 1 if there are no matching lines. stdout = cls.run_command( ['config', '--get-regexp', r'remote\..*\.url'], <API key>=(1, ), show_stdout=False, stdout_only=True, cwd=location, ) remotes = stdout.splitlines() try: found_remote = remotes[0] except IndexError: raise RemoteNotFoundError for remote in remotes: if remote.startswith('remote.origin.url '): found_remote = remote break url = found_remote.split(' ')[1] return url.strip() @classmethod def has_commit(cls, location, rev): """ Check if rev is a commit that is available in the local repository. """ try: cls.run_command( ['rev-parse', '-q', '--verify', "sha^" + rev], cwd=location, log_failed_cmd=False, ) except InstallationError: return False else: return True @classmethod def get_revision(cls, location, rev=None): if rev is None: rev = 'HEAD' current_rev = cls.run_command( ['rev-parse', rev], show_stdout=False, stdout_only=True, cwd=location, ) return current_rev.strip() @classmethod def get_subdirectory(cls, location): """ Return the path to setup.py, relative to the repo root. Return None if setup.py is in the repo root. """ # find the repo root git_dir = cls.run_command( ['rev-parse', '--git-dir'], show_stdout=False, stdout_only=True, cwd=location, ).strip() if not os.path.isabs(git_dir): git_dir = os.path.join(location, git_dir) repo_root = os.path.abspath(os.path.join(git_dir, '..')) return <API key>(location, repo_root) @classmethod def <API key>(cls, url): # type: (str) -> Tuple[str, Optional[str], AuthInfo] """ Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'. That's required because although they use SSH they sometimes don't work with a ssh:// scheme (e.g. GitHub). But we need a scheme for parsing. Hence we remove it again afterwards and return it as a stub. """ # Works around an apparent Git bug scheme, netloc, path, query, fragment = urlsplit(url) if scheme.endswith('file'): initial_slashes = path[:-len(path.lstrip('/'))] newpath = ( initial_slashes + urllib_request.url2pathname(path) .replace('\\', '/').lstrip('/') ) after_plus = scheme.find('+') + 1 url = scheme[:after_plus] + urlunsplit( (scheme[after_plus:], netloc, newpath, query, fragment), ) if '://' not in url: assert 'file:' not in url url = url.replace('git+', 'git+ssh: url, rev, user_pass = super(Git, cls).<API key>(url) url = url.replace('ssh: else: url, rev, user_pass = super(Git, cls).<API key>(url) return url, rev, user_pass @classmethod def update_submodules(cls, location): if not os.path.exists(os.path.join(location, '.gitmodules')): return cls.run_command( ['submodule', 'update', '--init', '--recursive', '-q'], cwd=location, ) @classmethod def get_repository_root(cls, location): loc = super(Git, cls).get_repository_root(location) if loc: return loc try: r = cls.run_command( ['rev-parse', '--show-toplevel'], cwd=location, show_stdout=False, stdout_only=True, on_returncode='raise', log_failed_cmd=False, ) except BadCommand: logger.debug("could not determine if %s is under git control " "because git is not available", location) return None except InstallationError: return None return os.path.normpath(r.rstrip('\r\n')) vcs.register(Git)
package org.ovirt.engine.core.itests; import org.junit.Ignore; import org.junit.Test; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertNotNull; import org.ovirt.engine.core.common.queries.*; import org.ovirt.engine.core.common.action.LoginUserParameters; import org.ovirt.engine.core.common.action.VdcReturnValueBase; import org.ovirt.engine.core.common.action.VdcActionType; import org.ovirt.engine.core.common.action.RunVmParams; import org.ovirt.engine.core.compat.Guid; @Ignore public class <API key> extends AbstractBackendTest { @Test public void getDomainList() { VdcQueryReturnValue value = backend.RunPublicQuery(VdcQueryType.GetDomainList, new <API key>()); assertTrue(value.getSucceeded()); assertNotNull(value.getReturnValue()); System.out.println(value.getReturnValue()); } @Test public void getVersion() { VdcQueryReturnValue value = backend.RunPublicQuery(VdcQueryType.<API key>, new <API key>(ConfigurationValues.VdcVersion)); assertNotNull(value); assertNotNull(value.getReturnValue()); System.out.println("Version: " + value.getReturnValue()); } @Test public void loginAdmin() { VdcReturnValueBase value = backend.Login(new LoginUserParameters("admin", "admin", "domain", "os", "browser", "client_type")); assertTrue(value.getSucceeded()); assertNotNull(value.<API key>()); } @Test public void testRunVm() { RunVmParams params = new RunVmParams(Guid.NewGuid()); VdcReturnValueBase result = backend.runInternalAction(VdcActionType.RunVm, params); } }
#!/bin/bash # This script will build the project. if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]" ./gradlew build --stacktrace --info elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']' ./gradlew -Prelease.travisci=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build snapshot elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']' case "$TRAVIS_TAG" in *-rc\.*) ./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" candidate ;; *) ./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" final ;; esac else echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']' ./gradlew build fi
#define <API key> #include <autoboost/regex/config.hpp> // regex configuration information: this prints out the settings used // when the library was built - include in debugging builds only: #ifdef <API key> #define print_macro <API key> #define print_expression <API key> #define print_byte_order <API key> #define print_sign <API key> #define <API key> <API key> #define print_stdlib_macros <API key> #define <API key> <API key> #define <API key> <API key> #define print_separator <API key> #define OLD_MAIN regex_lib_main #define NEW_MAIN regex_lib_main2 #define NO_RECURSE #include <libs/regex/test/config_info/regex_config_info.cpp> <API key> void <API key> <API key>() { std::cout << "\n\n"; print_separator(); std::cout << "Regex library build configuration:\n\n"; regex_lib_main2(); } #endif
package org.cloudfoundry.autoscaler.data.couchdb.dao.impl; import java.util.ArrayList; import java.util.List; import org.apache.log4j.Logger; import org.cloudfoundry.autoscaler.data.couchdb.dao.<API key>; import org.cloudfoundry.autoscaler.data.couchdb.dao.base.<API key>; import org.cloudfoundry.autoscaler.data.couchdb.document.AppInstanceMetrics; import org.ektorp.ComplexKey; import org.ektorp.CouchDbConnector; import org.ektorp.ViewQuery; import org.ektorp.support.View; public class <API key> extends CommonDAOImpl implements <API key> { @View(name = "byAll", map = "function(doc) { if (doc.type == 'AppInstanceMetrics' ) emit([doc.appId, doc.appType, doc.timestamp], doc._id)}") private static class <API key> extends <API key><AppInstanceMetrics> { public <API key>(CouchDbConnector db) { super(AppInstanceMetrics.class, db, "<API key>"); } public List<AppInstanceMetrics> getAllRecords() { return queryView("byAll"); } } @View(name = "by_appId", map = "function(doc) { if (doc.type=='AppInstanceMetrics' && doc.appId) { emit([doc.appId], doc._id) } }") private static class <API key> extends <API key><AppInstanceMetrics> { public <API key>(CouchDbConnector db) { super(AppInstanceMetrics.class, db, "<API key>"); } public List<AppInstanceMetrics> findByAppId(String appId) { ComplexKey key = ComplexKey.of(appId); return queryView("by_appId", key); } } @View(name = "by_appId_between", map = "function(doc) { if (doc.type=='AppInstanceMetrics' && doc.appId && doc.timestamp) { emit([doc.appId, doc.timestamp], doc._id) } }") private static class <API key> extends <API key><AppInstanceMetrics> { public <API key>(CouchDbConnector db) { super(AppInstanceMetrics.class, db, "<API key>"); } public List<AppInstanceMetrics> findByAppIdBetween(String appId, long startTimestamp, long endTimestamp) throws Exception { ComplexKey startKey = ComplexKey.of(appId, startTimestamp); ComplexKey endKey = ComplexKey.of(appId, endTimestamp); ViewQuery q = createQuery("by_appId_between").includeDocs(true).startKey(startKey).endKey(endKey); List<AppInstanceMetrics> returnvalue = null; String[] input = beforeConnection("QUERY", new String[] { "by_appId_between", appId, String.valueOf(startTimestamp), String.valueOf(endTimestamp) }); try { returnvalue = db.queryView(q, AppInstanceMetrics.class); } catch (Exception e) { e.printStackTrace(); } afterConnection(input); return returnvalue; } } @View(name = "by_serviceId_before", map = "function(doc) { if (doc.type=='AppInstanceMetrics' && doc.serviceId && doc.timestamp) { emit([ doc.serviceId, doc.timestamp], doc._id) } }") private static class <API key> extends <API key><AppInstanceMetrics> { public <API key>(CouchDbConnector db) { super(AppInstanceMetrics.class, db, "<API key>"); } public List<AppInstanceMetrics> <API key>(String serviceId, long olderThan) throws Exception { ComplexKey startKey = ComplexKey.of(serviceId, 0); ComplexKey endKey = ComplexKey.of(serviceId, olderThan); ViewQuery q = createQuery("by_serviceId_before").includeDocs(true).startKey(startKey).endKey(endKey); List<AppInstanceMetrics> returnvalue = null; String[] input = beforeConnection("QUERY", new String[] { "by_serviceId_before", serviceId, String.valueOf(0), String.valueOf(olderThan) }); try { returnvalue = db.queryView(q, AppInstanceMetrics.class); } catch (Exception e) { e.printStackTrace(); } afterConnection(input); return returnvalue; } } private static final Logger logger = Logger.getLogger(<API key>.class); private <API key> metricsRepoAll; private <API key> metricsRepoByAppId; private <API key> <API key>; private <API key> <API key>; public <API key>(CouchDbConnector db) { metricsRepoAll = new <API key>(db); metricsRepoByAppId = new <API key>(db); <API key> = new <API key>(db); <API key> = new <API key>(db); } public <API key>(CouchDbConnector db, boolean initDesignDocument) { this(db); if (initDesignDocument) { try { initAllRepos(); } catch (Exception e) { logger.error(e.getMessage(), e); } } } @Override public List<AppInstanceMetrics> findAll() { // TODO Auto-generated method stub return this.metricsRepoAll.getAllRecords(); } @Override public List<AppInstanceMetrics> findByAppId(String appId) { // TODO Auto-generated method stub return this.metricsRepoByAppId.findByAppId(appId); } @Override public List<AppInstanceMetrics> findByAppIdBetween(String appId, long startTimestamp, long endTimestamp) throws Exception { // TODO Auto-generated method stub return this.<API key>.findByAppIdBetween(appId, startTimestamp, endTimestamp); } @Override public List<AppInstanceMetrics> <API key>(String serviceId, long olderThan) throws Exception { // TODO Auto-generated method stub return this.<API key>.<API key>(serviceId, olderThan); } @Override public List<AppInstanceMetrics> findByAppIdAfter(String appId, long timestamp) throws Exception { try { return findByAppIdBetween(appId, timestamp, System.currentTimeMillis()); } catch (Exception e) { logger.error(e.getMessage(), e); } return null; } @SuppressWarnings("unchecked") @Override public <T> <API key><T> getDefaultRepo() { // TODO Auto-generated method stub return (<API key><T>) this.metricsRepoAll; } @SuppressWarnings("unchecked") @Override public <T> List<<API key><T>> getAllRepos() { // TODO Auto-generated method stub List<<API key><T>> repoList = new ArrayList<<API key><T>>(); repoList.add((<API key><T>) this.metricsRepoAll); repoList.add((<API key><T>) this.metricsRepoByAppId); repoList.add((<API key><T>) this.<API key>); repoList.add((<API key><T>) this.<API key>); return repoList; } }
package jef.common.wrapper; import java.io.Serializable; public interface IHolder<T> extends Serializable{ T get(); void set(T obj); }
title: Cordova 3.1.0 Now on PhoneGap Build date: 2013-10-24 11:00:05 Z categories: - build tags: - PhoneGap Build author: Ryan Willoughby [PhoneGap Build](http://build.phonegap.com) is happy to announce that we now support Cordova 3.1.0. For more info on what's included in this update, check out the [Cordova 3.1.0 release blog post](http://cordova.apache.org/blog/releases/2013/10/02/cordova-31.html). You may have noticed that lately we've been deprecating older versions of Cordova with many of our releases. Thats not happening on this particular release, but we want to remind you to update your app to the latest version of Cordova as often as possible. Be aware that letting an app lie dormant on PhoneGap Build for too long will likely see its Cordova version become deprecated. The mobile development world evolves rapidly, and PhoneGap Build, and the applications created on it, need to evolve with it. As always, if you have problems uprgrading, or any other questions, [just ask](http://community.phonegap.com/nitobi).
# USE COLUMN TYPE FOR COLUMN "DATA" FOR THE RELEVANT DATABASE #Mysql LONGTEXT #SQLServer TEXT #Postgres TEXT #Oracle CLOB #H2 CLOB #Derby CLOB #HSQL LONGVARCHAR #Hibernate MYSQL Script ALTER TABLE STORE_PROCESS_PROP ADD COLUMN DATA LONGTEXT; CREATE TABLE <API key> SELECT * FROM STORE_PROCESS_PROP; UPDATE STORE_PROCESS_PROP A SET A.DATA=(SELECT VALUE FROM <API key> WHERE PROPID=A.PROPID AND NAME=A.NAME); DROP TABLE <API key>; ALTER TABLE STORE_PROCESS_PROP DROP COLUMN VALUE; #OpenJPA MYSQL Script ALTER TABLE STORE_PROCESS_PROP ADD COLUMN DATA LONGTEXT; CREATE TABLE <API key> SELECT * FROM STORE_PROCESS_PROP; UPDATE STORE_PROCESS_PROP A SET A.DATA=(SELECT PROP_VAL FROM <API key> WHERE ID=A.ID); DROP TABLE <API key>; ALTER TABLE STORE_PROCESS_PROP DROP COLUMN PROP_VAL;
package org.eclipse.jetty.server.handler; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.BufferedReader; import java.io.EOFException; import java.io.IOException; import java.net.Socket; import java.util.LinkedHashMap; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.nio.<API key>; import org.junit.AfterClass; /** * @version $Revision$ $Date$ */ public abstract class <API key> { protected static Server server; protected static Connector serverConnector; protected static Server proxy; protected static Connector proxyConnector; protected static void startServer(Connector connector, Handler handler) throws Exception { server = new Server(); serverConnector = connector; server.addConnector(serverConnector); server.setHandler(handler); server.start(); } protected static void startProxy() throws Exception { proxy = new Server(); proxyConnector = new <API key>(); proxy.addConnector(proxyConnector); proxy.setHandler(new ConnectHandler()); proxy.start(); } @AfterClass public static void stop() throws Exception { stopProxy(); stopServer(); } protected static void stopServer() throws Exception { server.stop(); server.join(); } protected static void stopProxy() throws Exception { proxy.stop(); proxy.join(); } protected Response readResponse(BufferedReader reader) throws IOException { // Simplified parser for HTTP responses String line = reader.readLine(); if (line == null) throw new EOFException(); Matcher responseLine = Pattern.compile("HTTP/1\\.1\\s+(\\d+)").matcher(line); assertTrue(responseLine.lookingAt()); String code = responseLine.group(1); Map<String, String> headers = new LinkedHashMap<String, String>(); while ((line = reader.readLine()) != null) { if (line.trim().length() == 0) break; Matcher header = Pattern.compile("([^:]+):\\s*(.*)").matcher(line); assertTrue(header.lookingAt()); String headerName = header.group(1); String headerValue = header.group(2); headers.put(headerName.toLowerCase(), headerValue.toLowerCase()); } StringBuilder body = new StringBuilder(); if (headers.containsKey("content-length")) { int length = Integer.parseInt(headers.get("content-length")); for (int i = 0; i < length; ++i) { char c = (char)reader.read(); body.append(c); } } else if ("chunked".equals(headers.get("transfer-encoding"))) { while ((line = reader.readLine()) != null) { if ("0".equals(line)) { line = reader.readLine(); assertEquals("", line); break; } int length = Integer.parseInt(line, 16); for (int i = 0; i < length; ++i) { char c = (char)reader.read(); body.append(c); } line = reader.readLine(); assertEquals("", line); } } return new Response(code, headers, body.toString().trim()); } protected Socket newSocket() throws IOException { Socket socket = new Socket("localhost", proxyConnector.getLocalPort()); socket.setSoTimeout(5000); return socket; } protected class Response { private final String code; private final Map<String, String> headers; private final String body; private Response(String code, Map<String, String> headers, String body) { this.code = code; this.headers = headers; this.body = body; } public String getCode() { return code; } public Map<String, String> getHeaders() { return headers; } public String getBody() { return body; } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append(code).append("\r\n"); for (Map.Entry<String, String> entry : headers.entrySet()) builder.append(entry.getKey()).append(": ").append(entry.getValue()).append("\r\n"); builder.append("\r\n"); builder.append(body); return builder.toString(); } } }
package org.apereo.cas.memcached.kryo; import org.apereo.cas.authentication.AcceptUsers<API key>; import org.apereo.cas.authentication.<API key>; import org.apereo.cas.authentication.<API key>; import org.apereo.cas.authentication.Default<API key>; import org.apereo.cas.authentication.Default<API key>; import org.apereo.cas.authentication.<API key>; import org.apereo.cas.authentication.principal.<API key>; import org.apereo.cas.mock.MockServiceTicket; import org.apereo.cas.mock.<API key>; import org.apereo.cas.services.<API key>; import org.apereo.cas.ticket.<API key>; import org.apereo.cas.ticket.<API key>; import org.apereo.cas.ticket.support.<API key>; import org.apereo.cas.ticket.support.<API key>; import com.esotericsoftware.kryo.KryoException; import lombok.extern.slf4j.Slf4j; import lombok.val; import org.junit.Test; import javax.security.auth.login.<API key>; import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Map; import static org.junit.Assert.*; /** * Unit test for {@link CasKryoTranscoder} class. * * @author Marvin S. Addison * @since 3.0.0 */ @Slf4j public class <API key> { private static final String ST_ID = "<API key>"; private static final String TGT_ID = "<API key>"; private static final String USERNAME = "handymanbob"; private static final String PASSWORD = "foo"; private static final String NICKNAME_KEY = "nickname"; private static final String NICKNAME_VALUE = "bob"; private final CasKryoTranscoder transcoder; private final Map<String, Object> principalAttributes; public <API key>() { val classesToRegister = new ArrayList<Class>(); classesToRegister.add(MockServiceTicket.class); classesToRegister.add(<API key>.class); this.transcoder = new CasKryoTranscoder(new CasKryoPool(classesToRegister)); this.principalAttributes = new HashMap<>(); this.principalAttributes.put(NICKNAME_KEY, NICKNAME_VALUE); } @Test public void <API key>() { val userPassCredential = new <API key>(USERNAME, PASSWORD); final <API key> bldr = new Default<API key>(new <API key>() .createPrincipal("user", new HashMap<>(this.principalAttributes))); bldr.setAttributes(new HashMap<>(this.principalAttributes)); bldr.<API key>(ZonedDateTime.now()); bldr.addCredential(new <API key>(userPassCredential)); bldr.addFailure("error", new <API key>()); bldr.addSuccess("authn", new Default<API key>( new AcceptUsers<API key>(""), new <API key>(userPassCredential))); final <API key> expectedTGT = new <API key>(TGT_ID, <API key>.getService(), null, bldr.build(), new <API key>()); val ticket = expectedTGT.grantServiceTicket(ST_ID, <API key>.getService(), new <API key>(), false, true); val result1 = transcoder.encode(expectedTGT); val resultTicket = transcoder.decode(result1); assertEquals(expectedTGT, resultTicket); val result2 = transcoder.encode(ticket); val resultStTicket1 = transcoder.decode(result2); assertEquals(ticket, resultStTicket1); val resultStTicket2 = transcoder.decode(result2); assertEquals(ticket, resultStTicket2); } @Test public void verifyEncodeDecode() { val tgt = new <API key>(USERNAME); val expectedST = new MockServiceTicket(ST_ID, <API key>.getService(), tgt); assertEquals(expectedST, transcoder.decode(transcoder.encode(expectedST))); val expectedTGT = new <API key>(USERNAME); expectedTGT.grantServiceTicket(ST_ID, null, null, false, true); val result = transcoder.encode(expectedTGT); assertEquals(expectedTGT, transcoder.decode(result)); assertEquals(expectedTGT, transcoder.decode(result)); internalProxyTest(); } private void internalProxyTest() { val expectedTGT = new <API key>(USERNAME); expectedTGT.grantServiceTicket(ST_ID, null, null, false, true); val result = transcoder.encode(expectedTGT); assertEquals(expectedTGT, transcoder.decode(result)); assertEquals(expectedTGT, transcoder.decode(result)); } @Test public void <API key>() { val userPassCredential = new <API key>(USERNAME, PASSWORD); final <API key> expectedTGT = new <API key>(TGT_ID, userPassCredential, new HashMap<>(this.principalAttributes)); expectedTGT.grantServiceTicket(ST_ID, null, null, false, true); val result = transcoder.encode(expectedTGT); assertEquals(expectedTGT, transcoder.decode(result)); assertEquals(expectedTGT, transcoder.decode(result)); } @Test public void <API key>() { val userPassCredential = new <API key>(USERNAME, PASSWORD); val values = new ArrayList<String>(); values.add(NICKNAME_VALUE); val newAttributes = new HashMap<String, Object>(); newAttributes.put(NICKNAME_KEY, new ArrayList<>(values)); val expectedTGT = new <API key>(TGT_ID, userPassCredential, newAttributes); expectedTGT.grantServiceTicket(ST_ID, null, null, false, true); val result = transcoder.encode(expectedTGT); assertEquals(expectedTGT, transcoder.decode(result)); assertEquals(expectedTGT, transcoder.decode(result)); } @Test public void <API key>() { val userPassCredential = new <API key>(USERNAME, PASSWORD); final <API key> expectedTGT = new <API key>(TGT_ID, userPassCredential, new LinkedHashMap<>(this.principalAttributes)); expectedTGT.grantServiceTicket(ST_ID, null, null, false, true); val result = transcoder.encode(expectedTGT); assertEquals(expectedTGT, transcoder.decode(result)); assertEquals(expectedTGT, transcoder.decode(result)); } @Test public void <API key>() { val userPassCredential = new <API key>(USERNAME, PASSWORD); final <API key> expectedTGT = new <API key>(TGT_ID, userPassCredential, this.principalAttributes); expectedTGT.grantServiceTicket(ST_ID, null, null, false, true); val result = transcoder.encode(expectedTGT); assertEquals(expectedTGT, transcoder.decode(result)); assertEquals(expectedTGT, transcoder.decode(result)); } @Test public void <API key>() { val newAttributes = new HashMap<String, Object>(); val values = new HashSet<String>(); values.add(NICKNAME_VALUE); //CHECKSTYLE:OFF newAttributes.put(NICKNAME_KEY, Collections.unmodifiableSet(values)); //CHECKSTYLE:ON val userPassCredential = new <API key>(USERNAME, PASSWORD); val expectedTGT = new <API key>(TGT_ID, userPassCredential, newAttributes); expectedTGT.grantServiceTicket(ST_ID, null, null, false, true); val result = transcoder.encode(expectedTGT); assertEquals(expectedTGT, transcoder.decode(result)); assertEquals(expectedTGT, transcoder.decode(result)); } @Test public void <API key>() { val newAttributes = new HashMap<String, Object>(); newAttributes.put(NICKNAME_KEY, Collections.singleton(NICKNAME_VALUE)); val userPassCredential = new <API key>(USERNAME, PASSWORD); val expectedTGT = new <API key>(TGT_ID, userPassCredential, newAttributes); expectedTGT.grantServiceTicket(ST_ID, null, null, false, true); val result = transcoder.encode(expectedTGT); assertEquals(expectedTGT, transcoder.decode(result)); assertEquals(expectedTGT, transcoder.decode(result)); } @Test public void <API key>() { val newAttributes = Collections.<String, Object>singletonMap(NICKNAME_KEY, NICKNAME_VALUE); val userPassCredential = new <API key>(USERNAME, PASSWORD); val expectedTGT = new <API key>(TGT_ID, userPassCredential, newAttributes); expectedTGT.grantServiceTicket(ST_ID, null, null, false, true); val result = transcoder.encode(expectedTGT); assertEquals(expectedTGT, transcoder.decode(result)); assertEquals(expectedTGT, transcoder.decode(result)); } @Test public void <API key>() { val service = <API key>.<API key>("helloworld"); val result = transcoder.encode(service); assertEquals(service, transcoder.decode(result)); assertEquals(service, transcoder.decode(result)); } @Test public void <API key>() { // <API key> is not registered with Kryo... transcoder.getKryo().getClassResolver().reset(); val tgt = new <API key>(USERNAME); val expectedST = new MockServiceTicket(ST_ID, <API key>.getService(), tgt); val step = new <API key>.<API key>(1, 600); expectedST.setExpiration(step); val result = transcoder.encode(expectedST); assertEquals(expectedST, transcoder.decode(result)); // Test it a second time - Ensure there's no problem with subsequent de-serializations. assertEquals(expectedST, transcoder.decode(result)); } @Test public void <API key>() { val tgt = new <API key>(USERNAME); val expectedST = new MockServiceTicket(ST_ID, <API key>.getService(), tgt); // This class is not registered with Kryo val step = new <API key>(1, 600); expectedST.setExpiration(step); try { transcoder.encode(expectedST); throw new AssertionError("Unregistered class is not allowed by Kryo"); } catch (final KryoException e) { LOGGER.trace(e.getMessage(), e); } catch (final Exception e) { throw new AssertionError("Unexpected exception due to not resetting Kryo between de-serializations with unregistered class."); } } /** * Class for testing Kryo unregistered class handling. */ private static class <API key> extends <API key> { private static final long serialVersionUID = -<API key>; /** * Instantiates a new Service ticket expiration policy. * * @param numberOfUses the number of uses * @param timeToKillInSeconds the time to kill in seconds */ <API key>(final int numberOfUses, final long timeToKillInSeconds) { super(numberOfUses, timeToKillInSeconds); } } }
package javolution.xml; import java.io.Serializable; /** * <p> This interface identifies classes supporting XML serialization * (XML serialization is still possible for classes not implementing this * interface through dynamic {@link XMLBinding} though).</p> * * <p> Typically, classes implementing this interface have a protected static * {@link XMLFormat} holding their default XML representation. * For example:[code] * public final class Complex implements XMLSerializable { * * // Use the cartesien form for the default XML representation. * protected static final XMLFormat<Complex> XML = new XMLFormat<Complex>(Complex.class) { * public Complex newInstance(Class<Complex> cls, InputElement xml) throws XMLStreamException { * return Complex.valueOf(xml.getAttribute("real", 0.0), * xml.getAttribute("imaginary", 0.0)); * } * public void write(Complex complex, OutputElement xml) throws XMLStreamException { * xml.setAttribute("real", complex.getReal()); * xml.setAttribute("imaginary", complex.getImaginary()); * } * public void read(InputElement xml, Complex complex) { * // Immutable, deserialization occurs at creation, ref. newIntance(...) * } * }; * ... * }[/code]</p> * * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a> * @version 4.2, April 15, 2007 */ public interface XMLSerializable extends Serializable { // No method. Tagging interface. }
#include <aws/location/model/SearchForTextResult.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace LocationService { namespace Model { SearchForTextResult::SearchForTextResult() : m_placeHasBeenSet(false) { } SearchForTextResult::SearchForTextResult(JsonView jsonValue) : m_placeHasBeenSet(false) { *this = jsonValue; } SearchForTextResult& SearchForTextResult::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Place")) { m_place = jsonValue.GetObject("Place"); m_placeHasBeenSet = true; } return *this; } JsonValue SearchForTextResult::Jsonize() const { JsonValue payload; if(m_placeHasBeenSet) { payload.WithObject("Place", m_place.Jsonize()); } return payload; } } // namespace Model } // namespace LocationService } // namespace Aws
/* * took from Ruby. Thank you, Ruby! */ int endian() { static int init = 0; static int endian = 0; char *p; if (init) return endian; init = 1; p = &init; return endian = p[0]?1:0; }
package com.siyeh.ig.assignment; import com.<API key>; public class <API key> extends <API key> { public void test() throws Exception { final <API key> inspection = new <API key>(); inspection.<API key> = true; doTest("com/siyeh/igtest/assignment/method_parameter", inspection); } }
"""This component provides support to the Ring Door Bell camera.""" import asyncio from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.camera import PLATFORM_SCHEMA, Camera from homeassistant.components.ffmpeg import DATA_FFMPEG from homeassistant.const import ATTR_ATTRIBUTION, CONF_SCAN_INTERVAL from homeassistant.helpers import config_validation as cv from homeassistant.helpers.aiohttp_client import <API key> from homeassistant.util import dt as dt_util from . import ATTRIBUTION, DATA_RING, NOTIFICATION_ID <API key> = 'ffmpeg_arguments' <API key> = timedelta(minutes=45) _LOGGER = logging.getLogger(__name__) NOTIFICATION_TITLE = 'Ring Camera Setup' SCAN_INTERVAL = timedelta(seconds=90) PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Optional(<API key>): cv.string, vol.Optional(CONF_SCAN_INTERVAL, default=SCAN_INTERVAL): cv.time_period, }) def setup_platform(hass, config, add_entities, discovery_info=None): """Set up a Ring Door Bell and StickUp Camera.""" ring = hass.data[DATA_RING] cams = [] cams_no_plan = [] for camera in ring.doorbells: if camera.has_subscription: cams.append(RingCam(hass, camera, config)) else: cams_no_plan.append(camera) for camera in ring.stickup_cams: if camera.has_subscription: cams.append(RingCam(hass, camera, config)) else: cams_no_plan.append(camera) # show notification for all cameras without an active subscription if cams_no_plan: cameras = str(', '.join([camera.name for camera in cams_no_plan])) err_msg = '''A Ring Protect Plan is required for the''' \ ''' following cameras: {}.'''.format(cameras) _LOGGER.error(err_msg) hass.components.<API key>.create( 'Error: {}<br />' 'You will need to restart hass after fixing.' ''.format(err_msg), title=NOTIFICATION_TITLE, notification_id=NOTIFICATION_ID) add_entities(cams, True) return True class RingCam(Camera): """An implementation of a Ring Door Bell camera.""" def __init__(self, hass, camera, device_info): """Initialize a Ring Door Bell camera.""" super(RingCam, self).__init__() self._camera = camera self._hass = hass self._name = self._camera.name self._ffmpeg = hass.data[DATA_FFMPEG] self._ffmpeg_arguments = device_info.get(<API key>) self._last_video_id = self._camera.last_recording_id self._video_url = self._camera.recording_url(self._last_video_id) self._utcnow = dt_util.utcnow() self._expires_at = <API key> + self._utcnow @property def name(self): """Return the name of this camera.""" return self._name @property def unique_id(self): """Return a unique ID.""" return self._camera.id @property def <API key>(self): """Return the state attributes.""" return { ATTR_ATTRIBUTION: ATTRIBUTION, 'device_id': self._camera.id, 'firmware': self._camera.firmware, 'kind': self._camera.kind, 'timezone': self._camera.timezone, 'type': self._camera.family, 'video_url': self._video_url, } async def async_camera_image(self): """Return a still image response from the camera.""" from haffmpeg.tools import ImageFrame, IMAGE_JPEG ffmpeg = ImageFrame(self._ffmpeg.binary, loop=self.hass.loop) if self._video_url is None: return image = await asyncio.shield(ffmpeg.get_image( self._video_url, output_format=IMAGE_JPEG, extra_cmd=self._ffmpeg_arguments)) return image async def <API key>(self, request): """Generate an HTTP MJPEG stream from the camera.""" from haffmpeg.camera import CameraMjpeg if self._video_url is None: return stream = CameraMjpeg(self._ffmpeg.binary, loop=self.hass.loop) await stream.open_camera( self._video_url, extra_cmd=self._ffmpeg_arguments) try: stream_reader = await stream.get_reader() return await <API key>( self.hass, request, stream_reader, self._ffmpeg.<API key>) finally: await stream.close() @property def should_poll(self): """Update the image periodically.""" return True def update(self): """Update camera entity and refresh attributes.""" _LOGGER.debug("Checking if Ring DoorBell needs to refresh video_url") self._camera.update() self._utcnow = dt_util.utcnow() try: last_event = self._camera.history(limit=1)[0] except (IndexError, TypeError): return last_recording_id = last_event['id'] video_status = last_event['recording']['status'] if video_status == 'ready' and \ (self._last_video_id != last_recording_id or self._utcnow >= self._expires_at): video_url = self._camera.recording_url(last_recording_id) if video_url: _LOGGER.info("Ring DoorBell properties refreshed") # update attributes if new video or if URL has expired self._last_video_id = last_recording_id self._video_url = video_url self._expires_at = <API key> + self._utcnow
/*Stats*/ .bar-chart-grids { margin:150px auto; max-width:640px;} .fabo-chart { border-right: 1px; margin: 2em 0 0 0; } .fabo-chart::after { content: " "; display: table; clear: both; } .fabo-chart .fabo-point { height: 400px; display: inline-block; float: left; box-sizing: border-box; padding-left: 0px; ovefabolow: hidden; } .fabo-chart .fabo-point .fabo-point-inner { height: 100%; position: relative; ovefabolow: hidden; background: #f4f6f7; } .fabo-chart .fabo-point .fabo-value-text { width: 100%; text-align: center; z-index: 100; color: #ffffff; font-size: 18px; font-weight: 600; position: absolute; left: 0; right: 0; bottom: 18px; } .fabo-chart .fabo-point .fabo-value-label { width: 100%; text-align: center; z-index: 100; color: #95a5b3; font-size: 12px; font-weight: 700; position: absolute; left: 0; right: 0; top: 18px; } .fabo-chart .fabo-point .fabo-value { box-sizing: content-box; width: 0; height: 100px; border-top: 0 solid transparent; border-right: 0 solid #7b82ff; border-bottom: 0 solid transparent; border-left: 0px solid #7b82ff; transition: height 200ms; position: absolute; bottom: 0; -webkit-animation: chart-height 200ms; animation: chart-height 200ms; } .fabo-chart .fabo-point .fabo-value.hide { display: none; height: 0 !important; } .fabo-chart .fabo-point .fabo-value.hide-border { border-top-width: 0 !important; } @-webkit-keyframes chart-height { 0% { height: 0; } } @keyframes chart-height { 0% { height: 0; } } /*# sourceMappingURL=chart.css.map */
#include "extensions/common/tap/tap_config_base.h" #include "envoy/config/tap/v3/common.pb.h" #include "envoy/data/tap/v3/common.pb.h" #include "envoy/data/tap/v3/wrapper.pb.h" #include "common/common/assert.h" #include "common/common/fmt.h" #include "common/config/version_converter.h" #include "common/protobuf/utility.h" #include "extensions/common/matcher/matcher.h" #include "absl/container/fixed_array.h" namespace Envoy { namespace Extensions { namespace Common { namespace Tap { using namespace Matcher; bool Utility::<API key>(envoy::data::tap::v3::Body& output_body, uint32_t max_buffered_bytes, const Buffer::Instance& data, uint32_t buffer_start_offset, uint32_t <API key>) { // TODO(mattklein123): Figure out if we can use the buffer API here directly in some way. This is // is not trivial if we want to avoid extra copies since we end up appending to the existing // protobuf string. // Note that max_buffered_bytes is assumed to include any data already contained in output_bytes. // This is to account for callers that may be tracking this over multiple body objects. ASSERT(buffer_start_offset + <API key> <= data.length()); const uint32_t final_bytes_to_copy = std::min(max_buffered_bytes, <API key>); Buffer::RawSliceVector slices = data.getRawSlices(); trimSlices(slices, buffer_start_offset, final_bytes_to_copy); for (const Buffer::RawSlice& slice : slices) { output_body.mutable_as_bytes()->append(static_cast<const char*>(slice.mem_), slice.len_); } if (final_bytes_to_copy < <API key>) { output_body.set_truncated(true); return true; } else { return false; } } TapConfigBaseImpl::TapConfigBaseImpl(envoy::config::tap::v3::TapConfig&& proto_config, Common::Tap::Sink* admin_streamer) : <API key>(<API key>( proto_config.output_config(), <API key>, <API key>)), <API key>(<API key>( proto_config.output_config(), <API key>, <API key>)), streaming_(proto_config.output_config().streaming()) { ASSERT(proto_config.output_config().sinks().size() == 1); // TODO(mattklein123): Add per-sink checks to make sure format makes sense. I.e., when using // streaming, we should require the length delimited version of binary proto, etc. sink_format_ = proto_config.output_config().sinks()[0].format(); switch (proto_config.output_config().sinks()[0].<API key>()) { case envoy::config::tap::v3::OutputSink::OutputSinkTypeCase::kStreamingAdmin: ASSERT(admin_streamer != nullptr, "admin output must be configured via admin"); // TODO(mattklein123): Graceful failure, error message, and test if someone specifies an // admin stream output with the wrong format. RELEASE_ASSERT(sink_format_ == envoy::config::tap::v3::OutputSink::JSON_BODY_AS_BYTES || sink_format_ == envoy::config::tap::v3::OutputSink::JSON_BODY_AS_STRING, "admin output only supports JSON formats"); sink_to_use_ = admin_streamer; break; case envoy::config::tap::v3::OutputSink::OutputSinkTypeCase::kFilePerTap: sink_ = std::make_unique<FilePerTapSink>(proto_config.output_config().sinks()[0].file_per_tap()); sink_to_use_ = sink_.get(); break; default: <API key>; } envoy::config::common::matcher::v3::MatchPredicate match; if (proto_config.has_match()) { // Use the match field whenever it is set. match = proto_config.match(); } else if (proto_config.has_match_config()) { // Fallback to use the deprecated match_config field and upgrade (wire cast) it to the new // MatchPredicate which is backward compatible with the old MatchPredicate originally // introduced in the Tap filter. Config::VersionConverter::upgrade(proto_config.match_config(), match); } else { throw EnvoyException(fmt::format("Neither match nor match_config is set in TapConfig: {}", proto_config.DebugString())); } buildMatcher(match, matchers_); } const Matcher& TapConfigBaseImpl::rootMatcher() const { ASSERT(!matchers_.empty()); return *matchers_[0]; } namespace { void swapBytesToString(envoy::data::tap::v3::Body& body) { body.<API key>(body.release_as_bytes()); } } // namespace void Utility::bodyBytesToString(envoy::data::tap::v3::TraceWrapper& trace, envoy::config::tap::v3::OutputSink::Format sink_format) { // Swap the "bytes" string into the "string" string. This is done purely so that JSON // serialization will serialize as a string vs. doing base64 encoding. if (sink_format != envoy::config::tap::v3::OutputSink::JSON_BODY_AS_STRING) { return; } switch (trace.trace_case()) { case envoy::data::tap::v3::TraceWrapper::TraceCase::kHttpBufferedTrace: { auto* http_trace = trace.<API key>(); if (http_trace->has_request() && http_trace->request().has_body()) { swapBytesToString(*http_trace->mutable_request()->mutable_body()); } if (http_trace->has_response() && http_trace->response().has_body()) { swapBytesToString(*http_trace->mutable_response()->mutable_body()); } break; } case envoy::data::tap::v3::TraceWrapper::TraceCase::<API key>: { auto* http_trace = trace.<API key>(); if (http_trace-><API key>()) { swapBytesToString(*http_trace-><API key>()); } if (http_trace-><API key>()) { swapBytesToString(*http_trace-><API key>()); } break; } case envoy::data::tap::v3::TraceWrapper::TraceCase::<API key>: { auto* socket_trace = trace.<API key>(); for (auto& event : *socket_trace->mutable_events()) { if (event.has_read()) { swapBytesToString(*event.mutable_read()->mutable_data()); } else { ASSERT(event.has_write()); swapBytesToString(*event.mutable_write()->mutable_data()); } } break; } case envoy::data::tap::v3::TraceWrapper::TraceCase::<API key>: { auto& event = *trace.<API key>()->mutable_event(); if (event.has_read()) { swapBytesToString(*event.mutable_read()->mutable_data()); } else if (event.has_write()) { swapBytesToString(*event.mutable_write()->mutable_data()); } break; } case envoy::data::tap::v3::TraceWrapper::TraceCase::TRACE_NOT_SET: <API key>; } } void TapConfigBaseImpl::<API key>::submitTrace(TraceWrapperPtr&& trace) { Utility::bodyBytesToString(*trace, parent_.sink_format_); handle_->submitTrace(std::move(trace), parent_.sink_format_); } void FilePerTapSink::<API key>::submitTrace( TraceWrapperPtr&& trace, envoy::config::tap::v3::OutputSink::Format format) { if (!output_file_.is_open()) { std::string path = fmt::format("{}_{}", parent_.config_.path_prefix(), trace_id_); switch (format) { case envoy::config::tap::v3::OutputSink::PROTO_BINARY: path += MessageUtil::FileExtensions::get().ProtoBinary; break; case envoy::config::tap::v3::OutputSink::<API key>: path += MessageUtil::FileExtensions::get().<API key>; break; case envoy::config::tap::v3::OutputSink::PROTO_TEXT: path += MessageUtil::FileExtensions::get().ProtoText; break; case envoy::config::tap::v3::OutputSink::JSON_BODY_AS_BYTES: case envoy::config::tap::v3::OutputSink::JSON_BODY_AS_STRING: path += MessageUtil::FileExtensions::get().Json; break; default: <API key>; } ENVOY_LOG_MISC(debug, "Opening tap file for [id={}] to {}", trace_id_, path); // When reading and writing binary files, we need to be sure std::ios_base::binary // is set, otherwise we will not get the expected results on Windows output_file_.open(path, std::ios_base::binary); } ENVOY_LOG_MISC(trace, "Tap for [id={}]: {}", trace_id_, trace->DebugString()); switch (format) { case envoy::config::tap::v3::OutputSink::PROTO_BINARY: trace->SerializeToOstream(&output_file_); break; case envoy::config::tap::v3::OutputSink::<API key>: { Protobuf::io::OstreamOutputStream stream(&output_file_); Protobuf::io::CodedOutputStream coded_stream(&stream); coded_stream.WriteVarint32(trace->ByteSize()); trace-><API key>(&coded_stream); break; } case envoy::config::tap::v3::OutputSink::PROTO_TEXT: output_file_ << trace->DebugString(); break; case envoy::config::tap::v3::OutputSink::JSON_BODY_AS_BYTES: case envoy::config::tap::v3::OutputSink::JSON_BODY_AS_STRING: output_file_ << MessageUtil::<API key>(*trace, true, true); break; default: <API key>; } } } // namespace Tap } // namespace Common } // namespace Extensions } // namespace Envoy
#pragma once #include <string> #include "envoy/server/filter_config.h" #include "common/protobuf/protobuf.h" namespace Envoy { namespace Extensions { namespace HttpFilters { namespace Common { /** * Config registration for http filters that have empty configuration blocks. * The boiler plate instantiation functions (createFilterFactory, <API key>, * and <API key>) are implemented here. Users of this class have to implement * the createFilter function that instantiates the actual filter. */ class <API key> : public Server::Configuration::<API key> { public: virtual Http::FilterFactoryCb createFilter(const std::string& stat_prefix, Server::Configuration::FactoryContext& context) PURE; Http::FilterFactoryCb <API key>(const Protobuf::Message&, const std::string& stat_prefix, Server::Configuration::FactoryContext& context) override { return createFilter(stat_prefix, context); } ProtobufTypes::MessagePtr <API key>() override { // Using Struct instead of a custom filter config proto. This is only allowed in tests. return ProtobufTypes::MessagePtr{new Envoy::ProtobufWkt::Struct()}; } std::string configType() override { // Prevent registration of filters by type. This is only allowed in tests. return ""; } std::string name() const override { return name_; } protected: <API key>(const std::string& name) : name_(name) {} private: const std::string name_; }; } // namespace Common } // namespace HttpFilters } // namespace Extensions } // namespace Envoy
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.5.0_09) on Wed Aug 01 14:02:17 EEST 2007 --> <TITLE> datechooser.beans.editor.border.types (DateChooser javadoc) </TITLE> <META NAME="keywords" CONTENT="datechooser.beans.editor.border.types package"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> </HEAD> <BODY BGCOLOR="white"> <FONT size="+1" CLASS="FrameTitleFont"> <A HREF="../../../../../datechooser/beans/editor/border/types/package-summary.html" target="classFrame">datechooser.beans.editor.border.types</A></FONT> <TABLE BORDER="0" WIDTH="100%" SUMMARY=""> <TR> <TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> Classes</FONT>&nbsp; <FONT CLASS="FrameItemFont"> <BR> <A HREF="<API key>.html" title="class in datechooser.beans.editor.border.types" target="classFrame"><API key></A> <BR> <A HREF="<API key>.html" title="class in datechooser.beans.editor.border.types" target="classFrame"><API key></A> <BR> <A HREF="BevelBorderEditor.html" title="class in datechooser.beans.editor.border.types" target="classFrame">BevelBorderEditor</A> <BR> <A HREF="<API key>.html" title="class in datechooser.beans.editor.border.types" target="classFrame"><API key></A> <BR> <A HREF="DefaultBorderEditor.html" title="class in datechooser.beans.editor.border.types" target="classFrame">DefaultBorderEditor</A> <BR> <A HREF="EmptyBorderEditor.html" title="class in datechooser.beans.editor.border.types" target="classFrame">EmptyBorderEditor</A> <BR> <A HREF="EtchedBorderEditor.html" title="class in datechooser.beans.editor.border.types" target="classFrame">EtchedBorderEditor</A> <BR> <A HREF="LineBorderEditor.html" title="class in datechooser.beans.editor.border.types" target="classFrame">LineBorderEditor</A> <BR> <A HREF="MatteBorderEditor.html" title="class in datechooser.beans.editor.border.types" target="classFrame">MatteBorderEditor</A> <BR> <A HREF="NoBorderEditor.html" title="class in datechooser.beans.editor.border.types" target="classFrame">NoBorderEditor</A> <BR> <A HREF="<API key>.html" title="class in datechooser.beans.editor.border.types" target="classFrame"><API key></A> <BR> <A HREF="TitledBorderEditor.html" title="class in datechooser.beans.editor.border.types" target="classFrame">TitledBorderEditor</A></FONT></TD> </TR> </TABLE> </BODY> </HTML>
package com.kit.imagelib.imagelooker; public interface <API key> { public void onPageSelected(); }
package matchers import ( "fmt" "github.com/onsi/gomega/format" "math" ) type <API key> struct { Comparator string CompareTo []interface{} } func (matcher *<API key>) Match(actual interface{}) (success bool, message string, err error) { if len(matcher.CompareTo) == 0 || len(matcher.CompareTo) > 2 { return false, "", fmt.Errorf("BeNumerically requires 1 or 2 CompareTo arguments. Got:\n%s", format.Object(matcher.CompareTo, 1)) } if !isNumber(actual) { return false, "", fmt.Errorf("Expected a number. Got:\n%s", format.Object(actual, 1)) } if !isNumber(matcher.CompareTo[0]) { return false, "", fmt.Errorf("Expected a number. Got:\n%s", format.Object(matcher.CompareTo[0], 1)) } if len(matcher.CompareTo) == 2 && !isNumber(matcher.CompareTo[1]) { return false, "", fmt.Errorf("Expected a number. Got:\n%s", format.Object(matcher.CompareTo[0], 1)) } switch matcher.Comparator { case "==", "~", ">", ">=", "<", "<=": default: return false, "", fmt.Errorf("Unknown comparator: %s", matcher.Comparator) } if isFloat(actual) || isFloat(matcher.CompareTo[0]) { var secondOperand float64 = 1e-8 if len(matcher.CompareTo) == 2 { secondOperand = toFloat(matcher.CompareTo[1]) } success = matcher.matchFloats(toFloat(actual), toFloat(matcher.CompareTo[0]), secondOperand) } else if isInteger(actual) { var secondOperand int64 = 0 if len(matcher.CompareTo) == 2 { secondOperand = toInteger(matcher.CompareTo[1]) } success = matcher.matchIntegers(toInteger(actual), toInteger(matcher.CompareTo[0]), secondOperand) } else if isUnsignedInteger(actual) { var secondOperand uint64 = 0 if len(matcher.CompareTo) == 2 { secondOperand = toUnsignedInteger(matcher.CompareTo[1]) } success = matcher.<API key>(toUnsignedInteger(actual), toUnsignedInteger(matcher.CompareTo[0]), secondOperand) } else { return false, "", fmt.Errorf("Failed to compare:\n%s\n%s:\n%s", format.Object(actual, 1), matcher.Comparator, format.Object(matcher.CompareTo[0], 1)) } if success { return true, format.Message(actual, fmt.Sprintf("not to be %s", matcher.Comparator), matcher.CompareTo[0]), nil } else { return false, format.Message(actual, fmt.Sprintf("to be %s", matcher.Comparator), matcher.CompareTo[0]), nil } } func (matcher *<API key>) matchIntegers(actual, compareTo, threshold int64) (success bool) { switch matcher.Comparator { case "==", "~": diff := actual - compareTo return -threshold <= diff && diff <= threshold case ">": return (actual > compareTo) case ">=": return (actual >= compareTo) case "<": return (actual < compareTo) case "<=": return (actual <= compareTo) } return false } func (matcher *<API key>) <API key>(actual, compareTo, threshold uint64) (success bool) { switch matcher.Comparator { case "==", "~": if actual < compareTo { actual, compareTo = compareTo, actual } return actual-compareTo <= threshold case ">": return (actual > compareTo) case ">=": return (actual >= compareTo) case "<": return (actual < compareTo) case "<=": return (actual <= compareTo) } return false } func (matcher *<API key>) matchFloats(actual, compareTo, threshold float64) (success bool) { switch matcher.Comparator { case "~": return math.Abs(actual-compareTo) <= threshold case "==": return (actual == compareTo) case ">": return (actual > compareTo) case ">=": return (actual >= compareTo) case "<": return (actual < compareTo) case "<=": return (actual <= compareTo) } return false }
#define DT_DRV_COMPAT plantower_pms7003 #include <errno.h> #include <arch/cpu.h> #include <init.h> #include <kernel.h> #include <drivers/sensor.h> #include <stdlib.h> #include <string.h> #include <drivers/uart.h> #include <logging/log.h> LOG_MODULE_REGISTER(PMS7003, <API key>); /* wait serial output with 1000ms timeout */ #define <API key> 1000 struct pms7003_data { const struct device *uart_dev; uint16_t pm_1_0; uint16_t pm_2_5; uint16_t pm_10; }; /** * @brief wait for an array data from uart device with a timeout * * @param dev the uart device * @param data the data array to be matched * @param len the data array len * @param timeout the timeout in milliseconds * @return 0 if success; -ETIME if timeout */ static int uart_wait_for(const struct device *dev, uint8_t *data, int len, int timeout) { int matched_size = 0; int64_t timeout_time = k_uptime_get() + K_MSEC(timeout); while (1) { uint8_t c; if (k_uptime_get() > timeout_time) { return -ETIME; } if (uart_poll_in(dev, &c) == 0) { if (c == data[matched_size]) { matched_size++; if (matched_size == len) { break; } } else if (c == data[0]) { matched_size = 1; } else { matched_size = 0; } } } return 0; } /** * @brief read bytes from uart * * @param data the data buffer * @param len the data len * @param timeout the timeout in milliseconds * @return 0 if success; -ETIME if timeout */ static int uart_read_bytes(const struct device *dev, uint8_t *data, int len, int timeout) { int read_size = 0; int64_t timeout_time = k_uptime_get() + K_MSEC(timeout); while (1) { uint8_t c; if (k_uptime_get() > timeout_time) { return -ETIME; } if (uart_poll_in(dev, &c) == 0) { data[read_size++] = c; if (read_size == len) { break; } } } return 0; } static int <API key>(const struct device *dev, enum sensor_channel chan) { struct pms7003_data *drv_data = dev->data; /* sample output */ /* 42 4D 00 1C 00 01 00 01 00 01 00 01 00 01 00 01 01 92 * 00 4E 00 03 00 00 00 00 00 00 71 00 02 06 */ uint8_t pms7003_start_bytes[] = {0x42, 0x4d}; uint8_t <API key>[30]; if (uart_wait_for(drv_data->uart_dev, pms7003_start_bytes, sizeof(pms7003_start_bytes), <API key>) < 0) { LOG_WRN("waiting for start bytes is timeout"); return -ETIME; } if (uart_read_bytes(drv_data->uart_dev, <API key>, 30, <API key>) < 0) { return -ETIME; } drv_data->pm_1_0 = (<API key>[8] << 8) + <API key>[9]; drv_data->pm_2_5 = (<API key>[10] << 8) + <API key>[11]; drv_data->pm_10 = (<API key>[12] << 8) + <API key>[13]; LOG_DBG("pm1.0 = %d", drv_data->pm_1_0); LOG_DBG("pm2.5 = %d", drv_data->pm_2_5); LOG_DBG("pm10 = %d", drv_data->pm_10); return 0; } static int pms7003_channel_get(const struct device *dev, enum sensor_channel chan, struct sensor_value *val) { struct pms7003_data *drv_data = dev->data; if (chan == SENSOR_CHAN_PM_1_0) { val->val1 = drv_data->pm_1_0; val->val2 = 0; } else if (chan == SENSOR_CHAN_PM_2_5) { val->val1 = drv_data->pm_2_5; val->val2 = 0; } else if (chan == SENSOR_CHAN_PM_10) { val->val1 = drv_data->pm_10; val->val2 = 0; } else { return -EINVAL; } return 0; } static const struct sensor_driver_api pms7003_api = { .sample_fetch = &<API key>, .channel_get = &pms7003_channel_get, }; static int pms7003_init(const struct device *dev) { struct pms7003_data *drv_data = dev->data; drv_data->uart_dev = device_get_binding(DT_INST_BUS_LABEL(0)); if (!drv_data->uart_dev) { LOG_DBG("uart device is not found: %s", DT_INST_BUS_LABEL(0)); return -EINVAL; } return 0; } static struct pms7003_data pms7003_data; <API key>(0, &pms7003_init, <API key>, &pms7003_data, NULL, POST_KERNEL, <API key>, &pms7003_api);
var spawn = require('child_process').spawn var port = exports.port = 1337 exports.registry = "http://localhost:" + port exports.run = run function run (cmd, t, opts, cb) { if (!opts) opts = {} if (!Array.isArray(cmd)) throw new Error("cmd must be an Array") if (!t || !t.end) throw new Error("node-tap instance is missing") var stdout = "" , stderr = "" , node = process.execPath , child = spawn(node, cmd, opts) child.stderr.on("data", function (chunk) { stderr += chunk }) child.stdout.on("data", function (chunk) { stdout += chunk }) child.on("close", function (code) { if (cb) cb(t, stdout, stderr, code, { cmd: cmd, opts: opts }) else t.end() }) }
#include <aws/securityhub/model/<API key>.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace SecurityHub { namespace Model { <API key>::<API key>() : <API key>(false), <API key>(false) { } <API key>::<API key>(JsonView jsonValue) : <API key>(false), <API key>(false) { *this = jsonValue; } <API key>& <API key>::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("<API key>")) { <API key> = jsonValue.GetString("<API key>"); <API key> = true; } if(jsonValue.ValueExists("LogFilePrefix")) { m_logFilePrefix = jsonValue.GetString("LogFilePrefix"); <API key> = true; } return *this; } JsonValue <API key>::Jsonize() const { JsonValue payload; if(<API key>) { payload.WithString("<API key>", <API key>); } if(<API key>) { payload.WithString("LogFilePrefix", m_logFilePrefix); } return payload; } } // namespace Model } // namespace SecurityHub } // namespace Aws
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Runtime.Remoting; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Remote; using Microsoft.VisualStudio.LanguageServices.Remote; using Nerdbank; using Roslyn.Utilities; using StreamJsonRpc; namespace Roslyn.Test.Utilities.Remote { internal sealed class <API key> : RemoteHostClient { private readonly <API key> _inprocServices; private readonly <API key><<API key>> _remotableDataRpc; private readonly JsonRpc _rpc; public static async Task<RemoteHostClient> CreateAsync(Workspace workspace, bool runCacheCleanup) { var inprocServices = new <API key>(runCacheCleanup); // Create the <API key> before we create the remote host: this call implicitly sets up the remote <API key> so that will be available for later calls var remotableDataRpc = new <API key>(workspace, inprocServices.Logger, await inprocServices.RequestServiceAsync(<API key>.SnapshotService).ConfigureAwait(false)); var remoteHostStream = await inprocServices.RequestServiceAsync(<API key>.RemoteHostService).ConfigureAwait(false); var current = CreateClientId(Process.GetCurrentProcess().Id.ToString()); var instance = new <API key>(current, workspace, inprocServices, new <API key><<API key>>(remotableDataRpc), remoteHostStream); // make sure connection is done right var telemetrySession = default(string); var uiCultureLCIDE = 0; var cultureLCID = 0; var host = await instance._rpc.InvokeAsync<string>(nameof(IRemoteHostService.Connect), current, uiCultureLCIDE, cultureLCID, telemetrySession).ConfigureAwait(false); // TODO: change this to non fatal watson and make VS to use inproc implementation Contract.ThrowIfFalse(host == current.ToString()); instance.Started(); // return instance return instance; } private <API key>( string clientId, Workspace workspace, <API key> inprocServices, <API key><<API key>> remotableDataRpc, Stream stream) : base(workspace) { Contract.ThrowIfNull(remotableDataRpc); ClientId = clientId; _inprocServices = inprocServices; _remotableDataRpc = remotableDataRpc; _rpc = stream.CreateStreamJsonRpc(target: this, inprocServices.Logger); // handle disconnected situation _rpc.Disconnected += OnRpcDisconnected; _rpc.StartListening(); } public AssetStorage AssetStorage => _inprocServices.AssetStorage; public void RegisterService(string name, Func<Stream, IServiceProvider, <API key>> serviceCreator) { _inprocServices.RegisterService(name, serviceCreator); } public override string ClientId { get; } public override async Task<Connection> <API key>( string serviceName, object callbackTarget, Cancellation<API key>) { // get stream from service hub to communicate service specific information // this is what consumer actually use to communicate information var serviceStream = await _inprocServices.RequestServiceAsync(serviceName).ConfigureAwait(false); return new JsonRpcConnection(_inprocServices.Logger, callbackTarget, serviceStream, _remotableDataRpc.TryAddReference()); } protected override void OnStarted() { } protected override void OnStopped() { // we are asked to disconnect. unsubscribe and dispose to disconnect _rpc.Disconnected -= OnRpcDisconnected; _rpc.Dispose(); _remotableDataRpc.Dispose(); } private void OnRpcDisconnected(object sender, <API key> e) { Stopped(); } public class ServiceProvider : IServiceProvider { private static readonly TraceSource s_traceSource = new TraceSource("inprocRemoteClient"); private readonly AssetStorage _storage; public ServiceProvider(bool runCacheCleanup) { _storage = runCacheCleanup ? new AssetStorage(cleanupInterval: TimeSpan.FromSeconds(30), purgeAfter: TimeSpan.FromMinutes(1), gcAfter: TimeSpan.FromMinutes(5)) : new AssetStorage(); } public AssetStorage AssetStorage => _storage; public object GetService(Type serviceType) { if (typeof(TraceSource) == serviceType) { return s_traceSource; } if (typeof(AssetStorage) == serviceType) { return _storage; } throw ExceptionUtilities.UnexpectedValue(serviceType); } } private class <API key> { private readonly ServiceProvider _serviceProvider; private readonly Dictionary<string, Func<Stream, IServiceProvider, <API key>>> _creatorMap; public <API key>(bool runCacheCleanup) { _serviceProvider = new ServiceProvider(runCacheCleanup); _creatorMap = new Dictionary<string, Func<Stream, IServiceProvider, <API key>>>(); RegisterService(<API key>.RemoteHostService, (s, p) => new RemoteHostService(s, p)); RegisterService(<API key>.CodeAnalysisService, (s, p) => new CodeAnalysisService(s, p)); RegisterService(<API key>.SnapshotService, (s, p) => new SnapshotService(s, p)); RegisterService(<API key>.<API key>, (s, p) => new <API key>(s, p)); } public AssetStorage AssetStorage => _serviceProvider.AssetStorage; public TraceSource Logger { get; } = new TraceSource("Default"); public void RegisterService(string name, Func<Stream, IServiceProvider, <API key>> serviceCreator) { _creatorMap.Add(name, serviceCreator); } public Task<Stream> RequestServiceAsync(string serviceName) { if (_creatorMap.TryGetValue(serviceName, out var creator)) { var tuple = FullDuplexStream.CreateStreams(); return Task.FromResult<Stream>(new WrappedStream(creator(tuple.Item1, _serviceProvider), tuple.Item2)); } throw ExceptionUtilities.UnexpectedValue(serviceName); } private class WrappedStream : Stream { private readonly IDisposable _service; private readonly Stream _stream; public WrappedStream(IDisposable service, Stream stream) { // tie service's lifetime with that of stream _service = service; _stream = stream; } public override long Position { get { return _stream.Position; } set { _stream.Position = value; } } public override int ReadTimeout { get { return _stream.ReadTimeout; } set { _stream.ReadTimeout = value; } } public override int WriteTimeout { get { return _stream.WriteTimeout; } set { _stream.WriteTimeout = value; } } public override bool CanRead => _stream.CanRead; public override bool CanSeek => _stream.CanSeek; public override bool CanWrite => _stream.CanWrite; public override long Length => _stream.Length; public override bool CanTimeout => _stream.CanTimeout; public override void Flush() => _stream.Flush(); public override Task FlushAsync(Cancellation<API key>) => _stream.FlushAsync(cancellationToken); public override long Seek(long offset, SeekOrigin origin) => _stream.Seek(offset, origin); public override void SetLength(long value) => _stream.SetLength(value); public override int ReadByte() => _stream.ReadByte(); public override void WriteByte(byte value) => _stream.WriteByte(value); public override int Read(byte[] buffer, int offset, int count) => _stream.Read(buffer, offset, count); public override void Write(byte[] buffer, int offset, int count) => _stream.Write(buffer, offset, count); public override Task<int> ReadAsync(byte[] buffer, int offset, int count, Cancellation<API key>) => _stream.ReadAsync(buffer, offset, count, cancellationToken); public override Task WriteAsync(byte[] buffer, int offset, int count, Cancellation<API key>) => _stream.WriteAsync(buffer, offset, count, cancellationToken); public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) => _stream.BeginRead(buffer, offset, count, callback, state); public override int EndRead(IAsyncResult asyncResult) => _stream.EndRead(asyncResult); public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) => _stream.BeginWrite(buffer, offset, count, callback, state); public override void EndWrite(IAsyncResult asyncResult) => _stream.EndWrite(asyncResult); public override Task CopyToAsync(Stream destination, int bufferSize, Cancellation<API key>) => _stream.CopyToAsync(destination, bufferSize, cancellationToken); public override object <API key>() { throw new <API key>(); } public override ObjRef CreateObjRef(Type requestedType) { throw new <API key>(); } public override void Close() { _service.Dispose(); _stream.Close(); } protected override void Dispose(bool disposing) { base.Dispose(disposing); _service.Dispose(); _stream.Dispose(); } } } } }
package org.goodsManagement.service.impl.PoiUtils; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.goodsManagement.po.GetGoodsDto; import org.goodsManagement.vo.GetGoodsVO; import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; @Component public class GetGoodsToExcel { /*public static void main(String[] args){ List<GetGoodsVO> list = new ArrayList<GetGoodsVO>(); GetGoodsVO a1 = new GetGoodsVO(); a1.setStaffname(""); a1.setGoodname(""); a1.setGetnumber(2); a1.setGoodtype(""); list.add(a1); GetGoodsVO a2 = new GetGoodsVO(); a2.setStaffname(""); a2.setGoodname(""); a2.setGetnumber(2); a2.setGoodtype(""); list.add(a2); String path = "C:\\Users\\lifei\\Desktop\\getgood.xls"; GetGoodsToExcel.toExcel(list,path); System.out.println(""); }*/ /** * * @param list * * @param path * */ public void addtoExcel(List<GetGoodsVO> list,String path){ HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("Outgoods"); String[] n = { "", "", "", "" }; Object[][] value = new Object[list.size() + 1][4]; for (int m = 0; m < n.length; m++) { value[0][m] = n[m]; } for (int i = 0; i < list.size(); i++) { GetGoodsVO getGoodsVOg= (GetGoodsVO) list.get(i); value[i + 1][0] = getGoodsVOg.getStaffname(); value[i + 1][1] = getGoodsVOg.getGoodname(); value[i + 1][2] = getGoodsVOg.getGoodtype(); value[i + 1][3] = getGoodsVOg.getGetnumber(); } ExcelUtils.writeArrayToExcel(wb, sheet, list.size() + 1, 4, value); ExcelUtils.writeWorkbook(wb, path); } }
#ifndef _DICTIONARY_H_ #define _DICTIONARY_H_ #include <string> #include <unordered_map> #include <cinttypes> // This class represents a dictionary that maps integer values to strings. class Dictionary { public: typedef int32_t DiffType; // return value of compare function typedef uint32_t IntType; // int is enough, no need for int64 typedef std::string StringType; typedef std::unordered_map<IntType, IntType> TranslationTable; private: typedef std::unordered_map<IntType, StringType> IndexMap; typedef std::unordered_map<StringType, IntType> ReverseMap; public: typedef IndexMap::const_iterator const_iterator; private: // Mapping from ID to String IndexMap indexMap; // Mapping from String to ID ReverseMap reverseMap; // Mapping from ID to index in sorted order TranslationTable orderMap; // Next ID to be given IntType nextID; // Whether or not the dictionary has been modified since loading. bool modified; // Whether or not orderMap is valid bool orderValid; public: // Constructor Dictionary( void ); // Construct from dictionary name Dictionary( const std::string name ); // Destructor ~Dictionary( void ); // Look up an ID and get the String const char * Dereference( const IntType id ) const; // Look up a String and get the ID // Return invalid if not found IntType Lookup( const char * str, const IntType invalid ) const; // Insert a value into the Dictionary and return the ID. // Throw an error if the new ID is larger than maxID IntType Insert( const char * str, const IntType maxID ); // Integrate another dictionary into this one, and produce a translation // table for any values whose ID has changed. void Integrate( Dictionary& other, TranslationTable& trans ); // load/save dictionary from SQL // name specifies which dictionary to load/save void Load(const char* name); void Save(const char* name); // Compare two factors lexicographically. // The return value will be as follows: // first > second : retVal > 0 // first = second : retVal = 0 // first < second : retVal < 0 DiffType Compare( IntType firstID, IntType secondID ) const; const_iterator begin( void) const; const_iterator cbegin( void ) const; const_iterator end( void ) const; const_iterator cend( void ) const; private: // Helper method for reverse lookups IntType Lookup( const StringType& str, const IntType invalid ) const; // Helper method for inserting strings IntType Insert( StringType& str ); // Helper method to compute the sorted order. void ComputeOrder( void ); private: typedef std::unordered_map<std::string, Dictionary> DictionaryMap; // Storage for global dictionaries static DictionaryMap dicts; public: static Dictionary & GetDictionary( const std::string name ); }; #endif //_DICTIONARY_H_
// <API key>: Apache-2.0 WITH LLVM-exception #include "WriterUtils.h" #include "lld/Common/ErrorHandler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/EndianStream.h" #include "llvm/Support/LEB128.h" #define DEBUG_TYPE "lld" using namespace llvm; using namespace llvm::wasm; namespace lld { std::string toString(ValType type) { switch (type) { case ValType::I32: return "i32"; case ValType::I64: return "i64"; case ValType::F32: return "f32"; case ValType::F64: return "f64"; case ValType::V128: return "v128"; case ValType::EXNREF: return "exnref"; case ValType::EXTERNREF: return "externref"; } llvm_unreachable("Invalid wasm::ValType"); } std::string toString(const WasmSignature &sig) { SmallString<128> s("("); for (ValType type : sig.Params) { if (s.size() != 1) s += ", "; s += toString(type); } s += ") -> "; if (sig.Returns.empty()) s += "void"; else s += toString(sig.Returns[0]); return std::string(s.str()); } std::string toString(const WasmGlobalType &type) { return (type.Mutable ? "var " : "const ") + toString(static_cast<ValType>(type.Type)); } std::string toString(const WasmEventType &type) { if (type.Attribute == <API key>) return "exception"; return "unknown"; } namespace wasm { void debugWrite(uint64_t offset, const Twine &msg) { LLVM_DEBUG(dbgs() << format(" | %08lld: ", offset) << msg << "\n"); } void writeUleb128(raw_ostream &os, uint64_t number, const Twine &msg) { debugWrite(os.tell(), msg + "[" + utohexstr(number) + "]"); encodeULEB128(number, os); } void writeSleb128(raw_ostream &os, int64_t number, const Twine &msg) { debugWrite(os.tell(), msg + "[" + utohexstr(number) + "]"); encodeSLEB128(number, os); } void writeBytes(raw_ostream &os, const char *bytes, size_t count, const Twine &msg) { debugWrite(os.tell(), msg + " [data[" + Twine(count) + "]]"); os.write(bytes, count); } void writeStr(raw_ostream &os, StringRef string, const Twine &msg) { debugWrite(os.tell(), msg + " [str[" + Twine(string.size()) + "]: " + string + "]"); encodeULEB128(string.size(), os); os.write(string.data(), string.size()); } void writeU8(raw_ostream &os, uint8_t byte, const Twine &msg) { debugWrite(os.tell(), msg + " [0x" + utohexstr(byte) + "]"); os << byte; } void writeU32(raw_ostream &os, uint32_t number, const Twine &msg) { debugWrite(os.tell(), msg + "[0x" + utohexstr(number) + "]"); support::endian::write(os, number, support::little); } void writeU64(raw_ostream &os, uint64_t number, const Twine &msg) { debugWrite(os.tell(), msg + "[0x" + utohexstr(number) + "]"); support::endian::write(os, number, support::little); } void writeValueType(raw_ostream &os, ValType type, const Twine &msg) { writeU8(os, static_cast<uint8_t>(type), msg + "[type: " + toString(type) + "]"); } void writeSig(raw_ostream &os, const WasmSignature &sig) { writeU8(os, WASM_TYPE_FUNC, "signature type"); writeUleb128(os, sig.Params.size(), "param Count"); for (ValType paramType : sig.Params) { writeValueType(os, paramType, "param type"); } writeUleb128(os, sig.Returns.size(), "result Count"); for (ValType returnType : sig.Returns) { writeValueType(os, returnType, "result type"); } } void writeI32Const(raw_ostream &os, int32_t number, const Twine &msg) { writeU8(os, <API key>, "i32.const"); writeSleb128(os, number, msg); } void writeI64Const(raw_ostream &os, int64_t number, const Twine &msg) { writeU8(os, <API key>, "i64.const"); writeSleb128(os, number, msg); } void writeMemArg(raw_ostream &os, uint32_t alignment, uint64_t offset) { writeUleb128(os, alignment, "alignment"); writeUleb128(os, offset, "offset"); } void writeInitExpr(raw_ostream &os, const WasmInitExpr &initExpr) { writeU8(os, initExpr.Opcode, "opcode"); switch (initExpr.Opcode) { case <API key>: writeSleb128(os, initExpr.Value.Int32, "literal (i32)"); break; case <API key>: writeSleb128(os, initExpr.Value.Int64, "literal (i64)"); break; case <API key>: writeU32(os, initExpr.Value.Float32, "literal (f32)"); break; case <API key>: writeU64(os, initExpr.Value.Float64, "literal (f64)"); break; case <API key>: writeUleb128(os, initExpr.Value.Global, "literal (global index)"); break; case <API key>: writeValueType(os, ValType::EXTERNREF, "literal (externref type)"); break; default: fatal("unknown opcode in init expr: " + Twine(initExpr.Opcode)); } writeU8(os, WASM_OPCODE_END, "opcode:end"); } void writeLimits(raw_ostream &os, const WasmLimits &limits) { writeU8(os, limits.Flags, "limits flags"); writeUleb128(os, limits.Initial, "limits initial"); if (limits.Flags & <API key>) writeUleb128(os, limits.Maximum, "limits max"); } void writeGlobalType(raw_ostream &os, const WasmGlobalType &type) { // TODO: Update WasmGlobalType to use ValType and remove this cast. writeValueType(os, ValType(type.Type), "global type"); writeU8(os, type.Mutable, "global mutable"); } void writeGlobal(raw_ostream &os, const WasmGlobal &global) { writeGlobalType(os, global.Type); writeInitExpr(os, global.InitExpr); } void writeEventType(raw_ostream &os, const WasmEventType &type) { writeUleb128(os, type.Attribute, "event attribute"); writeUleb128(os, type.SigIndex, "sig index"); } void writeEvent(raw_ostream &os, const WasmEvent &event) { writeEventType(os, event.Type); } void writeTableType(raw_ostream &os, const llvm::wasm::WasmTable &type) { writeU8(os, WASM_TYPE_FUNCREF, "table type"); writeLimits(os, type.Limits); } void writeImport(raw_ostream &os, const WasmImport &import) { writeStr(os, import.Module, "import module name"); writeStr(os, import.Field, "import field name"); writeU8(os, import.Kind, "import kind"); switch (import.Kind) { case <API key>: writeUleb128(os, import.SigIndex, "import sig index"); break; case <API key>: writeGlobalType(os, import.Global); break; case WASM_EXTERNAL_EVENT: writeEventType(os, import.Event); break; case <API key>: writeLimits(os, import.Memory); break; case WASM_EXTERNAL_TABLE: writeTableType(os, import.Table); break; default: fatal("unsupported import type: " + Twine(import.Kind)); } } void writeExport(raw_ostream &os, const WasmExport &export_) { writeStr(os, export_.Name, "export name"); writeU8(os, export_.Kind, "export kind"); switch (export_.Kind) { case <API key>: writeUleb128(os, export_.Index, "function index"); break; case <API key>: writeUleb128(os, export_.Index, "global index"); break; case WASM_EXTERNAL_EVENT: writeUleb128(os, export_.Index, "event index"); break; case <API key>: writeUleb128(os, export_.Index, "memory index"); break; case WASM_EXTERNAL_TABLE: writeUleb128(os, export_.Index, "table index"); break; default: fatal("unsupported export type: " + Twine(export_.Kind)); } } } // namespace wasm } // namespace lld
package build import sbt._ import Keys._ import Def.SettingsDefinition final class MultiScalaProject private (private val projects: Map[String, Project]) extends CompositeProject { import MultiScalaProject._ val v2_11: Project = projects("2.11") val v2_12: Project = projects("2.12") val v2_13: Project = projects("2.13") def settings(ss: SettingsDefinition*): MultiScalaProject = transform(_.settings(ss: _*)) def enablePlugins(ns: Plugins*): MultiScalaProject = transform(_.enablePlugins(ns: _*)) def dependsOn(deps: <API key>*): MultiScalaProject = { def classpathDependency(d: <API key>) = strictMapValues(d.project.projects)(ClasspathDependency(_, d.configuration)) val depsByVersion: Map[String, Seq[ClasspathDependency]] = strictMapValues(deps.flatMap(classpathDependency).groupBy(_._1))(_.map(_._2)) zipped(depsByVersion)(_.dependsOn(_: _*)) } def configs(cs: Configuration*): MultiScalaProject = transform(_.configs(cs: _*)) def zippedSettings(that: MultiScalaProject)(ss: Project => SettingsDefinition): MultiScalaProject = zipped(that.projects)((p, sp) => p.settings(ss(sp))) def zippedSettings(project: String)(ss: LocalProject => SettingsDefinition): MultiScalaProject = zippedSettings(Seq(project))(ps => ss(ps(0))) /** Set settings on this MultiScalaProject depending on other MultiScalaProjects by name. * * For every Scala version of this MultiScalaProject, `ss` is invoked onced * with a LocalProjects corresponding to the names in projectNames with a * suffix for that version. */ def zippedSettings(projectNames: Seq[String])( ss: Seq[LocalProject] => SettingsDefinition): MultiScalaProject = { val ps = for { (v, p) <- projects } yield { val lps = projectNames.map(pn => LocalProject(projectID(pn, v))) v -> p.settings(ss(lps)) } new MultiScalaProject(ps) } def %(configuration: String) = new <API key>(this, Some(configuration)) override def componentProjects: Seq[Project] = projects.valuesIterator.toSeq private def zipped[T](that: Map[String, T])(f: (Project, T) => Project): MultiScalaProject = { val ps = for ((v, p) <- projects) yield v -> f(p, that(v)) new MultiScalaProject(ps) } private def transform(f: Project => Project): MultiScalaProject = new MultiScalaProject(strictMapValues(projects)(f)) } final class <API key>(val project: MultiScalaProject, val configuration: Option[String]) object <API key> { implicit def <API key>(mp: MultiScalaProject): <API key> = new <API key>(mp, None) } object MultiScalaProject { private def strictMapValues[K, U, V](v: Map[K, U])(f: U => V): Map[K, V] = v.map(v => (v._1, f(v._2))) private final val versions = Map[String, Seq[String]]( "2.11" -> Seq("2.11.12"), "2.12" -> Seq("2.12.1", "2.12.2", "2.12.3", "2.12.4", "2.12.5", "2.12.6", "2.12.7", "2.12.8", "2.12.9", "2.12.10", "2.12.11", "2.12.12", "2.12.13", "2.12.14", "2.12.15"), "2.13" -> Seq("2.13.0", "2.13.1", "2.13.2", "2.13.3", "2.13.4", "2.13.5", "2.13.6", "2.13.7", "2.13.8"), ) val <API key> = versions("2.11").last val <API key> = versions("2.12").last val <API key> = versions("2.13").last /** The default Scala version is the default 2.12 Scala version, because it * must work for sbt plugins. */ val DefaultScalaVersion = <API key> private final val ideVersion = "2.12" private def projectID(id: String, major: String) = id + major.replace('.', '_') def apply(id: String, base: File): MultiScalaProject = { val projects = for { (major, minors) <- versions } yield { val noIDEExportSettings = if (major == ideVersion) Nil else NoIDEExport.noIDEExportSettings major -> Project(id = projectID(id, major), base = new File(base, "." + major)).settings( scalaVersion := minors.last, crossScalaVersions := minors, noIDEExportSettings, ) } new MultiScalaProject(projects).settings( sourceDirectory := baseDirectory.value.getParentFile / "src", ) } }
package com.ibm.streamsx.topology.internal.logging; import java.util.logging.Level; import java.util.logging.Logger; public interface Logging { /** * Set the root logging levels from Python logging integer level. * @param levelS */ public static void setRootLevels(String levelS) { int loggingLevel = Integer.valueOf(levelS); Level level; if (loggingLevel >= 40) { level = Level.SEVERE; } else if (loggingLevel >= 30) { level = Level.WARNING; } else if (loggingLevel >= 20) { level = Level.CONFIG; } else { level = Level.FINE; } Logger.getLogger("").setLevel(level); } }
package wikokit.base.wikt.db; import android.util.Log; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; public class Decompressor { private String _zipFile; private String _location; public Decompressor(String zipFile, String location) { _zipFile = zipFile; _location = location; _dirChecker(""); } public void unzip() { try { FileInputStream fin = new FileInputStream(_zipFile); ZipInputStream zin = new ZipInputStream(fin); ZipEntry ze = null; while ((ze = zin.getNextEntry()) != null) { Log.v("Decompress", "Unzipping " + ze.getName()); if(ze.isDirectory()) { _dirChecker(ze.getName()); } else { FileOutputStream fout = new FileOutputStream(_location + ze.getName()); for (int c = zin.read(); c != -1; c = zin.read()) { fout.write(c); } zin.closeEntry(); fout.close(); } } zin.close(); } catch(Exception e) { Log.e("Decompress", "unzip", e); } } private void _dirChecker(String dir) { File f = new File(_location + dir); if(!f.isDirectory()) { f.mkdirs(); } } }
// <summary> // The chat room controller. // </summary> namespace WebStreams.Sample { using System; using System.Collections.Concurrent; using System.Reactive.Linq; using System.Reactive.Subjects; using Dapr.WebStreams.Server; <summary> The chat room controller. </summary> [RoutePrefix("/chat")] public class ChatRoomController { <summary> The chat rooms. </summary> private readonly <API key><string, ISubject<ChatEvent>> rooms = new <API key><string, ISubject<ChatEvent>>(); <summary> The stream of room updates. </summary> private readonly ISubject<string> roomUpdates = new Subject<string>(); <summary> Joins the calling user to a chat room. </summary> <param name="room"> The room name. </param> <param name="user"> The joining user's name. </param> <param name="messages"> The stream of chat messages from the user. </param> <returns> The stream of chat events. </returns> [Route("join")] public IObservable<ChatEvent> JoinRoom(string room, string user, IObservable<string> messages) { // Get or create the room being requested. var roomStream = this.GetOrAddRoom(room); // Send a happy little join message. roomStream.OnNext(new ChatEvent { User = user, Message = "Joined!", Time = DateTime.UtcNow, Type = "presence" }); // Turn incoming messages into chat events and pipe them into the room. messages.Select(message => new ChatEvent { User = user, Message = message, Time = DateTime.UtcNow }) .Subscribe( roomStream.OnNext, () => roomStream.OnNext(new ChatEvent { User = user, Message = "Left.", Time = DateTime.UtcNow, Type = "presence" })); return roomStream; } <summary> Returns the stream of chat rooms. </summary> <returns>The stream of chat rooms.</returns> [Route("rooms")] public IObservable<string> GetRooms() { var result = new ReplaySubject<string>(); this.roomUpdates.Subscribe(result); foreach (var channel in this.rooms.Keys) { result.OnNext(channel); } return result; } <summary> Returns the chat room with the provided <paramref name="name"/>. </summary> <param name="name"> The room name. </param> <returns> The chat room with the provided <paramref name="name"/>. </returns> private ISubject<ChatEvent> GetOrAddRoom(string name) { var added = default(ISubject<ChatEvent>); var result = this.rooms.GetOrAdd( name, _ => added = new ReplaySubject<ChatEvent>(100)); // If a new room was actually added, fire an update. if (result.Equals(added)) { this.roomUpdates.OnNext(name); } return result; } } }
(function() { var head = document.head || document.<API key>('head')[0]; var style = null; var mobileScreenWidth = 768; // Make sure this value is equal to the width of .wy-nav-content in overrides.css. var initialContentWidth = 960; // Make sure this value is equal to the width of .wy-nav-side in theme.css. var sideWidth = 300; // Keeps the current width of .wy-nav-content. var contentWidth = initialContentWidth; // Centers the page content dynamically. function centerPage() { if (style) { head.removeChild(style); style = null; } var windowWidth = window.innerWidth; if (windowWidth <= mobileScreenWidth) { return; } var leftMargin = Math.max(0, (windowWidth - sideWidth - contentWidth) / 2); var scrollbarWidth = document.body ? windowWidth - document.body.clientWidth : 0; var css = ''; css += '.wy-nav-side { left: ' + leftMargin + 'px; }'; css += "\n"; css += '.wy-nav-content-wrap { margin-left: ' + (sideWidth + leftMargin) + 'px; }'; css += "\n"; css += '.github-fork-ribbon { margin-right: ' + (leftMargin - scrollbarWidth) + 'px; }'; css += "\n"; var newStyle = document.createElement('style'); newStyle.type = 'text/css'; if (newStyle.styleSheet) { newStyle.styleSheet.cssText = css; } else { newStyle.appendChild(document.createTextNode(css)); } head.appendChild(newStyle); style = newStyle; } centerPage(); window.addEventListener('resize', centerPage); // Adjust the position of the 'fork me at GitHub' ribbon after document.body is available, // so that we can calculate the width of the scroll bar correctly. window.addEventListener('DOMContentLoaded', centerPage); // Allow a user to drag the left or right edge of the content to resize the content. if (interact) { interact('.wy-nav-content').resizable({ edges: {left: true, right: true, bottom: false, top: false}, modifiers: [ interact.modifiers.restrictEdges({ outer: 'parent', endOnly: true }), interact.modifiers.restrictSize({ min: { width: initialContentWidth, height: 0 } }) ] }).on('resizemove', function (event) { var style = event.target.style; // Double the amount of change because the page is centered. contentWidth += event.deltaRect.width * 2; style.maxWidth = contentWidth + 'px'; centerPage(); }); } })();
/** * Specifies a U-Prove token. */ public class UProveToken { private byte[] issuerParametersUID; private byte[] publicKey; private byte[] tokenInformation; private byte[] proverInformation; private byte[] sigmaZ; private byte[] sigmaC; private byte[] sigmaR; private boolean isDeviceProtected = false; /** * Constructs a new U-Prove token. */ public UProveToken() { super(); } /** * Constructs a new U-Prove token. * @param issuerParametersUID an issuer parameters UID. * @param publicKey a public key. * @param tokenInformation a token information value. * @param proverInformation a prover information value. * @param sigmaZ a sigmaZ value. * @param sigmaC a sigmaC value. * @param sigmaR a sigmaR value. * @param isDeviceProtected indicates if the token is Device-protected. */ public UProveToken(byte[] issuerParametersUID, byte[] publicKey, byte[] tokenInformation, byte[] proverInformation, byte[] sigmaZ, byte[] sigmaC, byte[] sigmaR, boolean isDeviceProtected) { super(); this.issuerParametersUID = issuerParametersUID; this.publicKey = publicKey; this.tokenInformation = tokenInformation; this.proverInformation = proverInformation; this.sigmaZ = sigmaZ; this.sigmaC = sigmaC; this.sigmaR = sigmaR; this.isDeviceProtected = isDeviceProtected; } /** * Gets the issuer parameters UID value. * @return the issuerParameters UID value. */ public byte[] <API key>() { return issuerParametersUID; } /** * Sets the issuer parameters UID value. * @param issuerParametersUID the issuerParameters UID value to set. */ public void <API key>(byte[] issuerParametersUID) { this.issuerParametersUID = issuerParametersUID; } /** * Gets the public key value. * @return the publicKey value. */ public byte[] getPublicKey() { return publicKey; } /** * Sets the public key value. * @param publicKey the public key value to set. */ public void setPublicKey(byte[] publicKey) { this.publicKey = publicKey; } /** * Gets the token information value. * @return the token information value. */ public byte[] getTokenInformation() { return tokenInformation; } /** * Sets the token information value. * @param tokenInformation the token information value to set. */ public void setTokenInformation(byte[] tokenInformation) { this.tokenInformation = tokenInformation; } /** * Gets the prover information value. * @return the prover information value. */ public byte[] <API key>() { return proverInformation; } /** * Sets the prover information value. * @param proverInformation the prover information value to set. */ public void <API key>(byte[] proverInformation) { this.proverInformation = proverInformation; } /** * Gets the sigmaZ value. * @return the sigmaZ value. */ public byte[] getSigmaZ() { return sigmaZ; } /** * Sets the sigmaZ value. * @param sigmaZ the sigmaZ value to set. */ public void setSigmaZ(byte[] sigmaZ) { this.sigmaZ = sigmaZ; } /** * Gets the sigmaC value. * @return the sigmaC value. */ public byte[] getSigmaC() { return sigmaC; } /** * Sets the sigmaC value. * @param sigmaC the sigmaC value to set. */ public void setSigmaC(byte[] sigmaC) { this.sigmaC = sigmaC; } /** * Gets the sigmaR value. * @return the sigmaR value. */ public byte[] getSigmaR() { return sigmaR; } /** * Sets the sigmaR value. * @param sigmaR the sigmaR value to set. */ public void setSigmaR(byte[] sigmaR) { this.sigmaR = sigmaR; } /** * Returns true if the token is Device-protected, false otherwise. * @return the Device-protected boolean. */ boolean isDeviceProtected() { return isDeviceProtected; } /** * Sets the boolean indicating if the token is Device-protected. * @param isDeviceProtected true if the token is Device-protected. */ void <API key>(boolean isDeviceProtected) { this.isDeviceProtected = isDeviceProtected; } /** * Indicates whether some other object is "equal to" this one. * @param o the reference object with which to compare. * @return <code>true</code> if this object is the same as the * <code>o</code> argument; <code>false</code> otherwise. */ public boolean equals(final Object o) { if (o == this) { return true; } if (!(o instanceof UProveToken)) { return false; } UProveToken upt = (UProveToken) o; return Arrays.equals(this.issuerParametersUID, upt.issuerParametersUID) && Arrays.equals(this.publicKey, upt.publicKey) && Arrays.equals(this.tokenInformation, upt.tokenInformation) && Arrays.equals(this.proverInformation, upt.proverInformation) && Arrays.equals(this.sigmaZ, upt.sigmaZ) && Arrays.equals(this.sigmaC, upt.sigmaC) && Arrays.equals(this.sigmaR, upt.sigmaR) && this.isDeviceProtected == upt.isDeviceProtected; } /** * Returns a hash code value for the object. * @return a hash code value for the object. */ public int hashCode() { int result = 237; result = 201 * result + Arrays.hashCode(this.issuerParametersUID); result = 201 * result + Arrays.hashCode(this.publicKey); result = 201 * result + Arrays.hashCode(this.tokenInformation); result = 201 * result + Arrays.hashCode(this.proverInformation); result = 201 * result + Arrays.hashCode(this.sigmaZ); result = 201 * result + Arrays.hashCode(this.sigmaC); result = 201 * result + Arrays.hashCode(this.sigmaR); result = result + (this.isDeviceProtected ? 201 : 0); return result; } }
/* Performs initialization of Direction Finding in Host */ int le_df_init(void); void <API key>(struct net_buf *buf, struct <API key> *report, struct bt_le_per_adv_sync **<API key>);
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Thu Nov 13 21:22:01 UTC 2014 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Class org.apache.hadoop.yarn.applications.distributedshell.ApplicationMaster (Apache Hadoop Main 2.6.0 API) </TITLE> <META NAME="date" CONTENT="2014-11-13"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.hadoop.yarn.applications.distributedshell.ApplicationMaster (Apache Hadoop Main 2.6.0 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <A NAME="navbar_top"></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.html" title="class in org.apache.hadoop.yarn.applications.distributedshell"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../index.html?org/apache/hadoop/yarn/applications/distributedshell//<API key>.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ApplicationMaster.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <HR> <CENTER> <H2> <B>Uses of Class<br>org.apache.hadoop.yarn.applications.distributedshell.ApplicationMaster</B></H2> </CENTER> No usage of org.apache.hadoop.yarn.applications.distributedshell.ApplicationMaster <P> <HR> <A NAME="navbar_bottom"></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="<API key>"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.html" title="class in org.apache.hadoop.yarn.applications.distributedshell"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../index.html?org/apache/hadoop/yarn/applications/distributedshell//<API key>.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ApplicationMaster.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <HR> Copyright & </BODY> </HTML>
package examples.model; import java.util.ArrayList; import java.util.Collection; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.OneToMany; @Entity public class Department { @Id private int id; private String name; @OneToMany(mappedBy="department") private Collection<Employee> employees; public Department() { employees = new ArrayList<Employee>(); } public int getId() { return id; } public String getName() { return name; } public Collection<Employee> getEmployees() { return employees; } public String toString() { return "Department no: " + getId() + ", name: " + getName(); } }
# The LLVM Compiler Infrastructure # This file is distributed under the University of Illinois Open Source LEVEL = ../../.. LIBRARYNAME = LLVMNaClTransforms BUILD_ARCHIVE = 1 include $(LEVEL)/Makefile.common
/** * @file * CSS for Cesium Cartesian3. */ div.form-item table .form-type-textfield, div.form-item table .form-type-textfield * { display: inline-block; }
export const FILLPATTERN = { none: '', crossHatched: 'Crosshatched', hatched: 'Hatched', solid: 'Solid' }; export const STROKEPATTERN = { none: '', dashed: 'Dashed', dotted: 'Dotted', solid: 'Solid' }; export const ALTITUDEMODE = { NONE: '', ABSOLUTE: 'Absolute', RELATIVE_TO_GROUND: 'Relative to ground', CLAMP_TO_GROUND: 'Clamp to ground' }; export const ICONSIZE = { none: '', verySmall: 'Very Small', small: 'Small', medium: 'Medium', large: 'Large', extraLarge: 'Extra Large' }; export const ACMATTRIBUTES = { innerRadius: 'Inner Radius', leftAzimuth: 'Left Azimuth', rightAzimuth: 'Right Azimuth', minAlt: 'Minimum Altitude', maxAlt: 'Maximum Altitude', leftWidth: 'Left Width', rightWidth: 'Right Width', radius: 'Radius', turn: 'Turn', width: 'Width' }; export const WMSVERSION = { WMS: 'none', WMS1_1: '1.0', WMS1_1_1: '1.1.1', WMS1_3_0: '1.3.0' }; export const WMTSVERSION = { WMTS: 'none', WMTS1_0_0: '1.0.0' };
using System; using System.IO; namespace Microsoft.WindowsAzure.MobileServices { <summary> Provides access to platform specific functionality for the current client platform. </summary> public class CurrentPlatform : IPlatform { <summary> You must call this method from your application in order to ensure that this platform specific assembly is included in your app. </summary> public static void Init() { } <summary> Returns a platform-specific implemention of application storage. </summary> IApplicationStorage IPlatform.ApplicationStorage { get { return ApplicationStorage.Instance; } } <summary> Returns a platform-specific implemention of platform information. </summary> <API key> IPlatform.PlatformInformation { get { return PlatformInformation.Instance; } } <summary> Returns a platform-specific implementation of a utility class that provides functionality for manipulating <see cref="System.Linq.Expressions.Expression"/> instances. </summary> IExpressionUtility IPlatform.ExpressionUtility { get { return ExpressionUtility.Instance; } } <summary> Returns a platform-specific implementation of a utility class that provides functionality for platform-specifc push capabilities. </summary> IPushUtility IPlatform.PushUtility { get { return Microsoft.WindowsAzure.MobileServices.PushUtility.Instance; } } <summary> Returns a platform-specific path for storing offline databases that are not fully-qualified. </summary> string IPlatform.DefaultDatabasePath { get { return Environment.GetFolderPath(Environment.SpecialFolder.Personal); } } <summary> Retrieves an ApplicationStorage where all items stored are segmented from other stored items </summary> <param name="name">The name of the segemented area in application storage</param> <returns>The specific instance of that segment</returns> IApplicationStorage IPlatform.<API key>(string name) { return new ApplicationStorage(name); } <summary> Ensures that a file exists, creating it if necessary </summary> <param name="path">The fully-qualified pathname to check</param> public void EnsureFileExists(string path) { if (!File.Exists(path)) { File.Create(path); } } } }
#dcwp-avatar {float: left; display: block; width: 32px; height: 32px; background: url(images/dc_icon32.png) no-repeat 0 0; margin: 0 5px 0 0;} .dcwp-box.postbox {margin-bottom: 10px;} .dcwp-box .hndle {margin-bottom: 10px;} .dcwp-box p, .dcwp-box ul, .widget .widget-inside p.dcwp-box {padding: 0 10px; margin: 0 0 3px 0; line-height: 1.5em;} .dcwp-box ul.bullet, ul.dcwp-rss {list-style: square; margin-left: 15px;} .dcwp-form {padding: 0 10px;} .dcwp-intro {padding: 10px;} .dcwp-form li {display: block; width: 100%; overflow: hidden; margin: 0 0 5px 0; padding: 5px 0; clear: both; } .dcwp-form li h4 {margin: 15px 0 0 0;} .dcwp-form li label {float: left; width: 25%; display: block; padding: 5px 0 0 0;} span.dcwp-note {display: block; padding: 5px 0 0 25%; font-size: 11px;} label span.dcwp-note {padding: 2px 0 0 0; font-size: 11px;} .dcwp-checkbox {} .dcwp-rss-item {} .dcwp-icon-rss {} .dcwp-icon-twitter {} .dcwp-input-l {width: 70%;} .dcwp-input-m {width: 50%;} .dcwp-input-s {width: 30%;} .dcwp-textarea {width: 70%;} #<API key>.dcwp-box {border: 1px solid #016f02; background: #fff;} #<API key>.dcwp-box h3 {color: #016f02; padding: 7px 15px;} #<API key>.dcwp-box p {padding: 0 7px;} #form-dcwp-donate {text-align: center; padding-bottom: 10px;} /* Widgets */ .dcwp-widget-text {width: 98%; height: 65px;} .dcwp-widget-input {width: 100%;} .dcwp-widget-label {display: block;} p.dcwp-row {margin-bottom: 3px; width: 100%; overflow: hidden;} p.dcwp-row.half {width: 50%; float: left;} p.dcwp-row label {float: left; width: 70px; padding-top: 3px; display: block;} .dcsmt-ul li {width: 100%; overflow: hidden;} .dcsmt-ul .dcwp-widget-input, .dcsmt-ul h4.left {float: left; width: 60%;} .dcsmt-ul select, .dcsmt-ul h4.right {float: right; width: 35%;} .dcsmt-ul h4 {margin: 0;} .dcsmt-ul label {display: none;} .dcsmt-ul select, .dcsmt-ul .dcwp-widget-input {font-size: 11px;} /* Share */ .dcwp-box ul#dc-share {width: 100%; overflow: hidden; margin: 0; padding: 0; line-height: 1em;} .dcwp-box ul#dc-share li {float: left; padding: 0 3px; margin: 0; height: 75px;} /* Plugin Specific */ #dcsmt_redirect {width: 140px;} .dcwp-form li.dcsmt-icon {position: relative; width: 48%; float: left; height: 26px; clear: none; margin-right: 2%;} .dcwp-form li.dcsmt-icon label {text-transform: capitalize;} .dcsmt-icon img {position: absolute; top: 0; right: 0;}
package water.jdbc; import org.junit.Test; import org.junit.runner.RunWith; import water.Key; import water.Keyed; import water.fvec.Frame; import water.runner.CloudSize; import water.runner.H2ORunner; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.IntStream; import static org.junit.Assert.*; @RunWith(H2ORunner.class) @CloudSize(1) public class <API key> { @Test public void <API key>() { final String prefix = "foo"; final String postfix = "bar"; final Key<Frame> key = SQLManager.nextTableKey(prefix, postfix); assertTrue(key.toString().startsWith(prefix)); assertTrue(key.toString().endsWith(postfix)); } @Test public void <API key>() { final Key<Frame> key = SQLManager.nextTableKey("f o o ", "b a r"); assertFalse(key.toString().contains("\\W")); } @Test public void <API key>() { final int count = 1000; final long actualCount = IntStream.range(0, count) .boxed() .parallel() .map(i -> SQLManager.nextTableKey("foo", "bar")) .map(Key::toString) .count(); assertEquals(count, actualCount); } }
<?php namespace EventEspresso\core\services\commands\registration; use EventEspresso\core\services\commands\Command; if ( ! defined( '<API key>' ) ) { exit( 'No direct script access allowed' ); } /** * Class <API key> * DTO for passing data a single EE_Registration object to a CommandHandler * * @package Event Espresso * @author Brent Christensen * @since 4.9.0 */ abstract class <API key> extends Command { /** * @var \EE_Registration $registration */ private $registration; /** * <API key> constructor. * * @param \EE_Registration $registration */ public function __construct( \EE_Registration $registration ) { $this->registration = $registration; } /** * @return \EE_Registration */ public function registration() { return $this->registration; } } // End of file <API key>.php // Location: /<API key>.php
package com.intellij.execution.impl.statistics; import com.intellij.execution.Executor; import com.intellij.execution.configurations.<API key>; import com.intellij.execution.configurations.ConfigurationType; import com.intellij.execution.configurations.RunConfiguration; import com.intellij.execution.executors.ExecutorGroup; import com.intellij.execution.target.<API key>; import com.intellij.execution.target.<API key>; import com.intellij.execution.target.<API key>; import com.intellij.execution.target.<API key>; import com.intellij.internal.statistic.<API key>; import com.intellij.internal.statistic.<API key>; import com.intellij.internal.statistic.eventLog.EventLogGroup; import com.intellij.internal.statistic.eventLog.events.*; import com.intellij.internal.statistic.eventLog.validator.<API key>; import com.intellij.internal.statistic.eventLog.validator.rules.EventContext; import com.intellij.internal.statistic.eventLog.validator.rules.impl.<API key>; import com.intellij.internal.statistic.service.fus.collectors.<API key>; import com.intellij.internal.statistic.utils.PluginInfo; import com.intellij.internal.statistic.utils.<API key>; import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.concurrency.NonUrgentExecutor; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Collections; import java.util.List; import static com.intellij.execution.impl.statistics.<API key>.<API key>; public final class <API key> extends <API key> { public static final String GROUP_NAME = "run.configuration.exec"; private static final EventLogGroup GROUP = new EventLogGroup(GROUP_NAME, 62); private static final ObjectEventField ADDITIONAL_FIELD = EventFields.<API key>(GROUP_NAME, "started"); private static final StringEventField EXECUTOR = EventFields.<API key>("executor", "run_config_executor"); private static final StringEventField TARGET = EventFields.<API key>("target", <API key>.RunTargetValidator.RULE_ID); private static final EnumEventField<<API key>> FINISH_TYPE = EventFields.Enum("finish_type", <API key>.class); private static final <API key> ACTIVITY_GROUP = GROUP.registerIdeActivity(null, new EventField<?>[]{ADDITIONAL_FIELD, EXECUTOR, TARGET, <API key>.FACTORY_FIELD, <API key>.ID_FIELD, EventFields.PluginInfo}, new EventField<?>[]{FINISH_TYPE}); public static final VarargEventId UI_SHOWN_STAGE = ACTIVITY_GROUP.registerStage("ui.shown"); @Override public EventLogGroup getGroup() { return GROUP; } @NotNull public static <API key> trigger(@NotNull Project project, @NotNull <API key> factory, @NotNull Executor executor, @Nullable RunConfiguration runConfiguration) { return ACTIVITY_GROUP .startedAsync(project, () -> ReadAction.nonBlocking(() -> buildContext(project, factory, executor, runConfiguration)) .expireWith(project) .submit(NonUrgentExecutor.getInstance())); } private static @NotNull List<EventPair<?>> buildContext(@NotNull Project project, @NotNull <API key> factory, @NotNull Executor executor, @Nullable RunConfiguration runConfiguration) { final ConfigurationType configurationType = factory.getType(); List<EventPair<?>> eventPairs = <API key>(configurationType, factory); ExecutorGroup<?> group = ExecutorGroup.getGroupIfProxy(executor); eventPairs.add(EXECUTOR.with(group != null ? group.getId() : executor.getId())); if (runConfiguration instanceof <API key>) { List<EventPair<?>> additionalData = ((<API key>)runConfiguration).<API key>(); ObjectEventData objectEventData = new ObjectEventData(additionalData); eventPairs.add(ADDITIONAL_FIELD.with(objectEventData)); } if (runConfiguration instanceof <API key>) { String defaultTargetName = ((<API key>)runConfiguration).<API key>(); if (defaultTargetName != null) { <API key> target = <API key>.getInstance(project).getTargets().findByName(defaultTargetName); if (target != null) { eventPairs.add(TARGET.with(target.getTypeId())); } } } return eventPairs; } public static void logProcessFinished(@Nullable <API key> activity, <API key> finishType) { if (activity != null) { activity.finished(() -> Collections.singletonList(FINISH_TYPE.with(finishType))); } } public static class <API key> extends <API key> { @Override public boolean acceptRuleId(@Nullable String ruleId) { return "run_config_executor".equals(ruleId); } @NotNull @Override protected <API key> doValidate(@NotNull String data, @NotNull EventContext context) { for (Executor executor : Executor.<API key>.getExtensions()) { if (StringUtil.equals(executor.getId(), data)) { final PluginInfo info = <API key>.getPluginInfo(executor.getClass()); return info.isSafeToReport() ? <API key>.ACCEPTED : <API key>.THIRD_PARTY; } } return <API key>.REJECTED; } } public static class RunTargetValidator extends <API key> { public static final String RULE_ID = "run_target"; @Override public boolean acceptRuleId(@Nullable String ruleId) { return RULE_ID.equals(ruleId); } @NotNull @Override protected <API key> doValidate(@NotNull String data, @NotNull EventContext context) { for (<API key><?> type : <API key>.EXTENSION_NAME.getExtensions()) { if (StringUtil.equals(type.getId(), data)) { final PluginInfo info = <API key>.getPluginInfo(type.getClass()); return info.isSafeToReport() ? <API key>.ACCEPTED : <API key>.THIRD_PARTY; } } return <API key>.REJECTED; } } public enum <API key> {FAILED_TO_START, UNKNOWN} }
package net.stickycode.deploy.sample.helloworld; public class HelloWorld implements Runnable { public void hello() { System.out.println("Hello World!"); } @Override public void run() { System.out.println("Hello Embedded World!"); try { Thread.sleep(5000); } catch (<API key> e) { throw new RuntimeException(e); } } }
<include file='public:header'/> <div class="mainBt"> <ul> <li class="li1"></li> <li class="li2"></li> <li class="li2 li3"></li> </ul> </div> <div class="main-jsgl"> <p class="attention"><span></span></p> <div class="jsglNr"> <div class="selectNr"> <div class="left"> <a href="<{:U('database/index')}>"></a> </div> <div class="right"> </div> </div> <form id="export-form" target="baocms_frm" method="post" action="<{:U('export')}>"> <div class="tableBox"> <table bordercolor="#e1e6eb" cellspacing="0" width="100%" border="1px" style=" border-collapse: collapse; margin:0px; vertical-align:middle; background-color:#FFF;" > <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></th> <td></td> </tr> <volist name="list" id="data"> <tr> <td><{$data.time|date='Ymd-His', <td><{$data.part}></td> <td><{$data.compress}></td> <td><{$data.size|format_bytes}></td> <td><{$key}></td> <td>-</td> <td class="action"> <a class="db-import" href="<{:U('import?time='.$data['time'])}>"></a>&nbsp; <a class="ajax-get confirm" href="<{:U('del?time='.$data['time'])}>"></a> </td> </tr> </volist> </table> <{$page}> </div> </form> </div> </div> <script type="text/javascript"> $(".db-import").click(function(){ var self = this, status = "."; $.get(self.href, success, "json"); window.onbeforeunload = function(){ return "" } return false; function success(data){ if(data.status){ if(data.gz){ data.info += status; if(status.length === 5){ status = "."; } else { status += "."; } } $(self).parent().prev().text(data.info); if(data.part){ $.get(self.href, {"part" : data.part, "start" : data.start}, success, "json" ); } else { window.onbeforeunload = function(){ return null; } } } else { alert(data.info); } } }); </script>
package org.locationtech.geomesa.core.process.proximity import com.typesafe.scalalogging.slf4j.Logging import com.vividsolutions.jts.geom.GeometryFactory import org.geotools.data.Query import org.geotools.data.simple.{<API key>, SimpleFeatureSource} import org.geotools.data.store.<API key> import org.geotools.factory.CommonFactoryFinder import org.geotools.feature.<API key> import org.geotools.feature.visitor.{AbstractCalcResult, CalcResult, FeatureCalc} import org.geotools.process.factory.{DescribeParameter, DescribeProcess, DescribeResult} import org.geotools.util.<API key> import org.locationtech.geomesa.core.data.<API key> import org.locationtech.geomesa.utils.geotools.Conversions._ import org.opengis.feature.Feature import org.opengis.feature.simple.SimpleFeature import org.opengis.filter.Filter @DescribeProcess( title = "Geomesa-enabled Proximity Search", description = "Performs a proximity search on a Geomesa feature collection using another feature collection as input" ) class <API key> extends Logging { @DescribeResult(description = "Output feature collection") def execute( @DescribeParameter( name = "inputFeatures", description = "Input feature collection that defines the proximity search") inputFeatures: <API key>, @DescribeParameter( name = "dataFeatures", description = "The data set to query for matching features") dataFeatures: <API key>, @DescribeParameter( name = "bufferDistance", description = "Buffer size in meters") bufferDistance: java.lang.Double ): <API key> = { logger.info("Attempting Geomesa Proximity Search on collection type " + dataFeatures.getClass.getName) if(!dataFeatures.isInstanceOf[<API key>]) { logger.warn("The provided data feature collection type may not support geomesa proximity search: "+dataFeatures.getClass.getName) } if(dataFeatures.isInstanceOf[<API key>]) { logger.warn("WARNING: layer name in geoserver must match feature type name in geomesa") } val visitor = new ProximityVisitor(inputFeatures, dataFeatures, bufferDistance) dataFeatures.accepts(visitor, new <API key>) visitor.getResult.asInstanceOf[ProximityResult].results } } class ProximityVisitor(inputFeatures: <API key>, dataFeatures: <API key>, bufferDistance: java.lang.Double) extends FeatureCalc with Logging { val geoFac = new GeometryFactory val ff = CommonFactoryFinder.getFilterFactory2 var manualFilter: Filter = _ val manualVisitResults = new <API key>(null, dataFeatures.getSchema) // Called for non <API key> - here we use degrees for our filters // since we are manually evaluating them. def visit(feature: Feature): Unit = { manualFilter = Option(manualFilter).getOrElse(dwithinFilters("degrees")) val sf = feature.asInstanceOf[SimpleFeature] if(manualFilter.evaluate(sf)) { manualVisitResults.add(sf) } } var resultCalc: ProximityResult = new ProximityResult(manualVisitResults) override def getResult: CalcResult = resultCalc def setValue(r: <API key>) = resultCalc = ProximityResult(r) def proximitySearch(source: SimpleFeatureSource, query: Query) = { logger.info("Running Geomesa Proximity Search on source type "+source.getClass.getName) val combinedFilter = ff.and(query.getFilter, dwithinFilters("meters")) source.getFeatures(combinedFilter) } def dwithinFilters(requestedUnit: String) = { import org.locationtech.geomesa.utils.geotools.Conversions.RichGeometry import scala.collection.JavaConversions._ val geomProperty = ff.property(dataFeatures.getSchema.<API key>.getName) val geomFilters = inputFeatures.features().map { sf => val dist: Double = requestedUnit match { case "degrees" => sf.geometry.distanceDegrees(bufferDistance) case _ => bufferDistance } ff.dwithin(geomProperty, ff.literal(sf.geometry), dist, "meters") } ff.or(geomFilters.toSeq) } } case class ProximityResult(results: <API key>) extends AbstractCalcResult
<!doctype html><html lang=en><head><title>Redirecting&hellip;</title><link rel=canonical href=/v1.2/docs/tasks/traffic-management/egress/egress-control/><meta name=robots content=noindex><meta charset=utf-8><meta http-equiv=refresh content="0; url=/v1.2/docs/tasks/traffic-management/egress/egress-control/"></head><body><h1>Redirecting&hellip;</h1><a href=/v1.2/docs/tasks/traffic-management/egress/egress-control/>Click here if you are not redirected.</a></body></html>
package gov.va.medora.mdws.emrsvc; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "fromDate", "toDate", "nNotes" }) @XmlRootElement(name = "<API key>") public class <API key> { protected String fromDate; protected String toDate; protected int nNotes; /** * Gets the value of the fromDate property. * * @return * possible object is * {@link String } * */ public String getFromDate() { return fromDate; } /** * Sets the value of the fromDate property. * * @param value * allowed object is * {@link String } * */ public void setFromDate(String value) { this.fromDate = value; } /** * Gets the value of the toDate property. * * @return * possible object is * {@link String } * */ public String getToDate() { return toDate; } /** * Sets the value of the toDate property. * * @param value * allowed object is * {@link String } * */ public void setToDate(String value) { this.toDate = value; } /** * Gets the value of the nNotes property. * */ public int getNNotes() { return nNotes; } /** * Sets the value of the nNotes property. * */ public void setNNotes(int value) { this.nNotes = value; } }
# Systemd Unit If you are using distribution packages or the copr repository, you don't need to deal with these files! The unit file in this directory is to be put into `/etc/systemd/system`. It needs a user named `node_exporter`, whose shell should be `/sbin/nologin` and should not have any special privileges. It needs a sysconfig file in `/etc/sysconfig/node_exporter`. It needs a directory named `/var/lib/node_exporter/textfile_collector`, whose owner should be `node_exporter`:`node_exporter`. A sample file can be found in `sysconfig.node_exporter`.
FROM balenalib/amd64-alpine:3.6 RUN apk add --update \ openrc \
import os import sys import argparse from pandaharvester.harvesterconfig import harvester_config from pandaharvester.harvestermisc.selfcheck import <API key> def main(): oparser = argparse.ArgumentParser(prog='prescript', add_help=True) oparser.add_argument('-f', '--local_info_file', action='store', dest='local_info_file', help='path of harvester local info file') if len(sys.argv) == 1: print('No argument or flag specified. Did nothing') sys.exit(0) args = oparser.parse_args(sys.argv[1:]) local_info_file = os.path.normpath(args.local_info_file) hpi = <API key>(local_info_file=local_info_file) if hpi.package_changed: print('Harvester package changed') #TODO pass hpi.renew_local_info() else: print('Harvester package unchanged. Skipped') if __name__ == '__main__': main()
using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Roslyn.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.CSharp.UnitTests.CodeGen { public class StringConcatTests : CSharpTestBase { [Fact] public void ConcatConsts() { var source = @" using System; public class Test { static void Main() { Console.WriteLine(""A"" + ""B""); Console.WriteLine(""A"" + (string)null); Console.WriteLine(""A"" + (object)null); Console.WriteLine(""A"" + (object)null + ""A"" + (object)null); Console.WriteLine((string)null + ""B""); Console.WriteLine((object)null + ""B""); Console.WriteLine((string)null + (object)null); Console.WriteLine("" Console.WriteLine((object)null + (string)null); Console.WriteLine("" } } "; var comp = CompileAndVerify(source, expectedOutput: @"AB A A AA B B comp.VerifyDiagnostics(); comp.VerifyIL("Test.Main", @" { // Code size 101 (0x65) .maxstack 1 IL_0000: ldstr ""AB"" IL_0005: call ""void System.Console.WriteLine(string)"" IL_000a: ldstr ""A"" IL_000f: call ""void System.Console.WriteLine(string)"" IL_0014: ldstr ""A"" IL_0019: call ""void System.Console.WriteLine(string)"" IL_001e: ldstr ""AA"" IL_0023: call ""void System.Console.WriteLine(string)"" IL_0028: ldstr ""B"" IL_002d: call ""void System.Console.WriteLine(string)"" IL_0032: ldstr ""B"" IL_0037: call ""void System.Console.WriteLine(string)"" IL_003c: ldstr """" IL_0041: call ""void System.Console.WriteLine(string)"" IL_0046: ldstr ""#"" IL_004b: call ""void System.Console.WriteLine(string)"" IL_0050: ldstr """" IL_0055: call ""void System.Console.WriteLine(string)"" IL_005a: ldstr "" IL_005f: call ""void System.Console.WriteLine(string)"" IL_0064: ret } "); } [Fact] public void ConcatDefaults() { var source = @" using System; public class Test { static void Main() { Console.WriteLine(""A"" + ""B""); Console.WriteLine(""A"" + default(string)); Console.WriteLine(""A"" + default(object)); Console.WriteLine(""A"" + default(object) + ""A"" + default(object)); Console.WriteLine(default(string) + ""B""); Console.WriteLine(default(object) + ""B""); Console.WriteLine(default(string) + default(object)); Console.WriteLine("" Console.WriteLine(default(object) + default(string)); Console.WriteLine("" } } "; var comp = CompileAndVerify(source, expectedOutput: @"AB A A AA B B comp.VerifyDiagnostics(); comp.VerifyIL("Test.Main", @" { // Code size 101 (0x65) .maxstack 1 IL_0000: ldstr ""AB"" IL_0005: call ""void System.Console.WriteLine(string)"" IL_000a: ldstr ""A"" IL_000f: call ""void System.Console.WriteLine(string)"" IL_0014: ldstr ""A"" IL_0019: call ""void System.Console.WriteLine(string)"" IL_001e: ldstr ""AA"" IL_0023: call ""void System.Console.WriteLine(string)"" IL_0028: ldstr ""B"" IL_002d: call ""void System.Console.WriteLine(string)"" IL_0032: ldstr ""B"" IL_0037: call ""void System.Console.WriteLine(string)"" IL_003c: ldstr """" IL_0041: call ""void System.Console.WriteLine(string)"" IL_0046: ldstr ""#"" IL_004b: call ""void System.Console.WriteLine(string)"" IL_0050: ldstr """" IL_0055: call ""void System.Console.WriteLine(string)"" IL_005a: ldstr "" IL_005f: call ""void System.Console.WriteLine(string)"" IL_0064: ret } "); } [Fact] public void ConcatFour() { var source = @" using System; public class Test { static void Main() { var s = ""qq""; var ss = s + s + s + s; Console.WriteLine(ss); } } "; var comp = CompileAndVerify(source, expectedOutput: @"qqqqqqqq" ); comp.VerifyDiagnostics(); comp.VerifyIL("Test.Main", @" { // Code size 19 (0x13) .maxstack 4 IL_0000: ldstr ""qq"" IL_0005: dup IL_0006: dup IL_0007: dup IL_0008: call ""string string.Concat(string, string, string, string)"" IL_000d: call ""void System.Console.WriteLine(string)"" IL_0012: ret } "); } [Fact] public void ConcatMerge() { var source = @" using System; public class Test { private static string S = ""F""; private static object O = ""O""; static void Main() { Console.WriteLine( (S + ""A"") + (""B"" + S)); Console.WriteLine( (O + ""A"") + (""B"" + O)); Console.WriteLine( ((S + ""A"") + (""B"" + S)) + ((O + ""A"") + (""B"" + O))); Console.WriteLine( ((O + ""A"") + (S + ""A"")) + ((""B"" + O) + (S + ""A""))); } } "; var comp = CompileAndVerify(source, expectedOutput: @"FABF OABO FABFOABO OAFABOFA"); comp.VerifyDiagnostics(); comp.VerifyIL("Test.Main", @" { // Code size 259 (0x103) .maxstack 5 IL_0000: ldsfld ""string Test.S"" IL_0005: ldstr ""AB"" IL_000a: ldsfld ""string Test.S"" IL_000f: call ""string string.Concat(string, string, string)"" IL_0014: call ""void System.Console.WriteLine(string)"" IL_0019: ldsfld ""object Test.O"" IL_001e: dup IL_001f: brtrue.s IL_0025 IL_0021: pop IL_0022: ldnull IL_0023: br.s IL_002a IL_0025: callvirt ""string object.ToString()"" IL_002a: ldstr ""AB"" IL_002f: ldsfld ""object Test.O"" IL_0034: dup IL_0035: brtrue.s IL_003b IL_0037: pop IL_0038: ldnull IL_0039: br.s IL_0040 IL_003b: callvirt ""string object.ToString()"" IL_0040: call ""string string.Concat(string, string, string)"" IL_0045: call ""void System.Console.WriteLine(string)"" IL_004a: ldc.i4.6 IL_004b: newarr ""string"" IL_0050: dup IL_0051: ldc.i4.0 IL_0052: ldsfld ""string Test.S"" IL_0057: stelem.ref IL_0058: dup IL_0059: ldc.i4.1 IL_005a: ldstr ""AB"" IL_005f: stelem.ref IL_0060: dup IL_0061: ldc.i4.2 IL_0062: ldsfld ""string Test.S"" IL_0067: stelem.ref IL_0068: dup IL_0069: ldc.i4.3 IL_006a: ldsfld ""object Test.O"" IL_006f: dup IL_0070: brtrue.s IL_0076 IL_0072: pop IL_0073: ldnull IL_0074: br.s IL_007b IL_0076: callvirt ""string object.ToString()"" IL_007b: stelem.ref IL_007c: dup IL_007d: ldc.i4.4 IL_007e: ldstr ""AB"" IL_0083: stelem.ref IL_0084: dup IL_0085: ldc.i4.5 IL_0086: ldsfld ""object Test.O"" IL_008b: dup IL_008c: brtrue.s IL_0092 IL_008e: pop IL_008f: ldnull IL_0090: br.s IL_0097 IL_0092: callvirt ""string object.ToString()"" IL_0097: stelem.ref IL_0098: call ""string string.Concat(params string[])"" IL_009d: call ""void System.Console.WriteLine(string)"" IL_00a2: ldc.i4.7 IL_00a3: newarr ""string"" IL_00a8: dup IL_00a9: ldc.i4.0 IL_00aa: ldsfld ""object Test.O"" IL_00af: dup IL_00b0: brtrue.s IL_00b6 IL_00b2: pop IL_00b3: ldnull IL_00b4: br.s IL_00bb IL_00b6: callvirt ""string object.ToString()"" IL_00bb: stelem.ref IL_00bc: dup IL_00bd: ldc.i4.1 IL_00be: ldstr ""A"" IL_00c3: stelem.ref IL_00c4: dup IL_00c5: ldc.i4.2 IL_00c6: ldsfld ""string Test.S"" IL_00cb: stelem.ref IL_00cc: dup IL_00cd: ldc.i4.3 IL_00ce: ldstr ""AB"" IL_00d3: stelem.ref IL_00d4: dup IL_00d5: ldc.i4.4 IL_00d6: ldsfld ""object Test.O"" IL_00db: dup IL_00dc: brtrue.s IL_00e2 IL_00de: pop IL_00df: ldnull IL_00e0: br.s IL_00e7 IL_00e2: callvirt ""string object.ToString()"" IL_00e7: stelem.ref IL_00e8: dup IL_00e9: ldc.i4.5 IL_00ea: ldsfld ""string Test.S"" IL_00ef: stelem.ref IL_00f0: dup IL_00f1: ldc.i4.6 IL_00f2: ldstr ""A"" IL_00f7: stelem.ref IL_00f8: call ""string string.Concat(params string[])"" IL_00fd: call ""void System.Console.WriteLine(string)"" IL_0102: ret } "); } [Fact] public void ConcatMergeFromOne() { var source = @" using System; public class Test { private static string S = ""F""; static void Main() { Console.WriteLine( (S + null) + (S + ""A"") + (""B"" + S) + (S + null)); } } "; var comp = CompileAndVerify(source, expectedOutput: @"FFABFF"); comp.VerifyDiagnostics(); comp.VerifyIL("Test.Main", @" { // Code size 57 (0x39) .maxstack 4 IL_0000: ldc.i4.5 IL_0001: newarr ""string"" IL_0006: dup IL_0007: ldc.i4.0 IL_0008: ldsfld ""string Test.S"" IL_000d: stelem.ref IL_000e: dup IL_000f: ldc.i4.1 IL_0010: ldsfld ""string Test.S"" IL_0015: stelem.ref IL_0016: dup IL_0017: ldc.i4.2 IL_0018: ldstr ""AB"" IL_001d: stelem.ref IL_001e: dup IL_001f: ldc.i4.3 IL_0020: ldsfld ""string Test.S"" IL_0025: stelem.ref IL_0026: dup IL_0027: ldc.i4.4 IL_0028: ldsfld ""string Test.S"" IL_002d: stelem.ref IL_002e: call ""string string.Concat(params string[])"" IL_0033: call ""void System.Console.WriteLine(string)"" IL_0038: ret } "); } [Fact] public void ConcatOneArg() { var source = @" using System; public class Test { private static string S = ""F""; private static object O = ""O""; static void Main() { Console.WriteLine(O + null); Console.WriteLine(S + null); Console.WriteLine(O?.ToString() + null); } } "; var comp = CompileAndVerify(source, expectedOutput: @"O F O"); comp.VerifyDiagnostics(); comp.VerifyIL("Test.Main", @" { // Code size 82 (0x52) .maxstack 2 IL_0000: ldsfld ""object Test.O"" IL_0005: dup IL_0006: brtrue.s IL_000c IL_0008: pop IL_0009: ldnull IL_000a: br.s IL_0011 IL_000c: callvirt ""string object.ToString()"" IL_0011: dup IL_0012: brtrue.s IL_001a IL_0014: pop IL_0015: ldstr """" IL_001a: call ""void System.Console.WriteLine(string)"" IL_001f: ldsfld ""string Test.S"" IL_0024: dup IL_0025: brtrue.s IL_002d IL_0027: pop IL_0028: ldstr """" IL_002d: call ""void System.Console.WriteLine(string)"" IL_0032: ldsfld ""object Test.O"" IL_0037: dup IL_0038: brtrue.s IL_003e IL_003a: pop IL_003b: ldnull IL_003c: br.s IL_0043 IL_003e: callvirt ""string object.ToString()"" IL_0043: dup IL_0044: brtrue.s IL_004c IL_0046: pop IL_0047: ldstr """" IL_004c: call ""void System.Console.WriteLine(string)"" IL_0051: ret } "); } [Fact] public void <API key>() { var source = @" using System; public class Test { private static object C = new C(); static void Main() { Console.WriteLine((C + null) == """" ? ""Y"" : ""N""); Console.WriteLine((C + null + null) == """" ? ""Y"" : ""N""); } } public class C { public override string ToString() => null; } "; var comp = CompileAndVerify(source, expectedOutput: @"Y Y"); comp.VerifyDiagnostics(); comp.VerifyIL("Test.Main", @" { // Code size 111 (0x6f) .maxstack 2 IL_0000: ldsfld ""object Test.C"" IL_0005: dup IL_0006: brtrue.s IL_000c IL_0008: pop IL_0009: ldnull IL_000a: br.s IL_0011 IL_000c: callvirt ""string object.ToString()"" IL_0011: dup IL_0012: brtrue.s IL_001a IL_0014: pop IL_0015: ldstr """" IL_001a: ldstr """" IL_001f: call ""bool string.op_Equality(string, string)"" IL_0024: brtrue.s IL_002d IL_0026: ldstr ""N"" IL_002b: br.s IL_0032 IL_002d: ldstr ""Y"" IL_0032: call ""void System.Console.WriteLine(string)"" IL_0037: ldsfld ""object Test.C"" IL_003c: dup IL_003d: brtrue.s IL_0043 IL_003f: pop IL_0040: ldnull IL_0041: br.s IL_0048 IL_0043: callvirt ""string object.ToString()"" IL_0048: dup IL_0049: brtrue.s IL_0051 IL_004b: pop IL_004c: ldstr """" IL_0051: ldstr """" IL_0056: call ""bool string.op_Equality(string, string)"" IL_005b: brtrue.s IL_0064 IL_005d: ldstr ""N"" IL_0062: br.s IL_0069 IL_0064: ldstr ""Y"" IL_0069: call ""void System.Console.WriteLine(string)"" IL_006e: ret } "); } [Fact] public void <API key>() { var source = @" using System; public class Test { private static object O = ""O""; static void Main() { Console.WriteLine(string.Concat(O) + null); Console.WriteLine(string.Concat(O) + null + null); } } "; var comp = CompileAndVerify(source, expectedOutput: @"O O"); comp.VerifyDiagnostics(); comp.VerifyIL("Test.Main", @" { // Code size 49 (0x31) .maxstack 2 IL_0000: ldsfld ""object Test.O"" IL_0005: call ""string string.Concat(object)"" IL_000a: dup IL_000b: brtrue.s IL_0013 IL_000d: pop IL_000e: ldstr """" IL_0013: call ""void System.Console.WriteLine(string)"" IL_0018: ldsfld ""object Test.O"" IL_001d: call ""string string.Concat(object)"" IL_0022: dup IL_0023: brtrue.s IL_002b IL_0025: pop IL_0026: ldstr """" IL_002b: call ""void System.Console.WriteLine(string)"" IL_0030: ret } "); } [Fact] public void ConcatEmptyString() { var source = @" using System; public class Test { private static string S = ""F""; private static object O = ""O""; static void Main() { Console.WriteLine(O + """"); Console.WriteLine(S + """"); } } "; var comp = CompileAndVerify(source, expectedOutput: @"O F"); comp.VerifyDiagnostics(); comp.VerifyIL("Test.Main", @" { // Code size 51 (0x33) .maxstack 2 IL_0000: ldsfld ""object Test.O"" IL_0005: dup IL_0006: brtrue.s IL_000c IL_0008: pop IL_0009: ldnull IL_000a: br.s IL_0011 IL_000c: callvirt ""string object.ToString()"" IL_0011: dup IL_0012: brtrue.s IL_001a IL_0014: pop IL_0015: ldstr """" IL_001a: call ""void System.Console.WriteLine(string)"" IL_001f: ldsfld ""string Test.S"" IL_0024: dup IL_0025: brtrue.s IL_002d IL_0027: pop IL_001f: call ""void System.Console.WriteLine(string)"" IL_0024: ldstr ""A"" IL_0029: call ""void System.Console.WriteLine(string)"" IL_002e: ldstr ""B"" IL_0033: call ""void System.Console.WriteLine(string)"" IL_0038: ldstr ""End"" IL_003d: call ""void System.Console.WriteLine(string)"" IL_0042: ret } "); } [WorkItem(529064, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529064")] [Fact] public void <API key>() { var source = @" public class Test { static string field01 = ""A""; static string field02 = ""B""; static void Main() { field01 += field02 + ""C"" + ""D""; } } "; var comp = CompileAndVerify(source); comp.VerifyDiagnostics(); comp.VerifyIL("Test.Main", @" { // Code size 26 (0x1a) .maxstack 3 IL_0000: ldsfld ""string Test.field01"" IL_0005: ldsfld ""string Test.field02"" IL_000a: ldstr ""CD"" IL_000f: call ""string string.Concat(string, string, string)"" IL_0014: stsfld ""string Test.field01"" IL_0019: ret } "); } [Fact] public void ConcatGeneric() { var source = @" using System; public class Test { static void Main() { TestMethod<int>(); } private static void TestMethod<T>() { Console.WriteLine(""A"" + default(T)); Console.WriteLine(""A"" + default(T) + ""A"" + default(T)); Console.WriteLine(default(T) + ""B""); Console.WriteLine(default(string) + default(T)); Console.WriteLine("" Console.WriteLine(default(T) + default(string)); Console.WriteLine("" } } "; var comp = CompileAndVerify(source, expectedOutput: @"A0 A0A0 0B 0 0 comp.VerifyDiagnostics(); comp.VerifyIL("Test.TestMethod<T>()", @" { // Code size 291 (0x123) .maxstack 4 .locals init (T V_0) IL_0000: ldstr ""A"" IL_0005: ldloca.s V_0 IL_0007: initobj ""T"" IL_000d: ldloc.0 IL_000e: box ""T"" IL_0013: brtrue.s IL_0018 IL_0015: ldnull IL_0016: br.s IL_0025 IL_0018: ldloca.s V_0 IL_001a: constrained. ""T"" IL_0020: callvirt ""string object.ToString()"" IL_0025: call ""string string.Concat(string, string)"" IL_002a: call ""void System.Console.WriteLine(string)"" IL_002f: ldstr ""A"" IL_0034: ldloca.s V_0 IL_0036: initobj ""T"" IL_003c: ldloc.0 IL_003d: box ""T"" IL_0042: brtrue.s IL_0047 IL_0044: ldnull IL_0045: br.s IL_0054 IL_0047: ldloca.s V_0 IL_0049: constrained. ""T"" IL_004f: callvirt ""string object.ToString()"" IL_0054: ldstr ""A"" IL_0059: ldloca.s V_0 IL_005b: initobj ""T"" IL_0061: ldloc.0 IL_0062: box ""T"" IL_0067: brtrue.s IL_006c IL_0069: ldnull IL_006a: br.s IL_0079 IL_006c: ldloca.s V_0 IL_006e: constrained. ""T"" IL_0074: callvirt ""string object.ToString()"" IL_0079: call ""string string.Concat(string, string, string, string)"" IL_007e: call ""void System.Console.WriteLine(string)"" IL_0083: ldloca.s V_0 IL_0085: initobj ""T"" IL_008b: ldloc.0 IL_008c: box ""T"" IL_0091: brtrue.s IL_0096 IL_0093: ldnull IL_0094: br.s IL_00a3 IL_0096: ldloca.s V_0 IL_0098: constrained. ""T"" IL_009e: callvirt ""string object.ToString()"" IL_00a3: ldstr ""B"" IL_00a8: call ""string string.Concat(string, string)"" IL_00ad: call ""void System.Console.WriteLine(string)"" IL_00b2: ldloca.s V_0 IL_00b4: initobj ""T"" IL_00ba: ldloc.0 IL_00bb: box ""T"" IL_00c0: brtrue.s IL_00c5 IL_00c2: ldnull IL_00c3: br.s IL_00d2 IL_00c5: ldloca.s V_0 IL_00c7: constrained. ""T"" IL_00cd: callvirt ""string object.ToString()"" IL_00d2: dup IL_00d3: brtrue.s IL_00db IL_00d5: pop IL_00d6: ldstr """" IL_00db: call ""void System.Console.WriteLine(string)"" IL_00e0: ldstr ""#"" IL_00e5: call ""void System.Console.WriteLine(string)"" IL_00ea: ldloca.s V_0 IL_00ec: initobj ""T"" IL_00f2: ldloc.0 IL_00f3: box ""T"" IL_00f8: brtrue.s IL_00fd IL_00fa: ldnull IL_00fb: br.s IL_010a IL_00fd: ldloca.s V_0 IL_00ff: constrained. ""T"" IL_0105: callvirt ""string object.ToString()"" IL_010a: dup IL_010b: brtrue.s IL_0113 IL_010d: pop IL_010e: ldstr """" IL_0113: call ""void System.Console.WriteLine(string)"" IL_0118: ldstr "" IL_011d: call ""void System.Console.WriteLine(string)"" IL_0122: ret } "); } [Fact] public void <API key>() { var source = @" using System; public class Test { static void Main() { TestMethod<Exception, Exception>(); } private static void TestMethod<T, U>() where T:class where U: class { Console.WriteLine(""A"" + default(T)); Console.WriteLine(""A"" + default(T) + ""A"" + default(T)); Console.WriteLine(default(T) + ""B""); Console.WriteLine(default(string) + default(T)); Console.WriteLine("" Console.WriteLine(default(T) + default(string)); Console.WriteLine("" Console.WriteLine(""A"" + (U)null); Console.WriteLine(""A"" + (U)null + ""A"" + (U)null); Console.WriteLine((U)null + ""B""); Console.WriteLine(default(string) + (U)null); Console.WriteLine("" Console.WriteLine((U)null + default(string)); Console.WriteLine("" } } "; var comp = CompileAndVerify(source, expectedOutput: @"A AA B A AA B comp.VerifyDiagnostics(); comp.VerifyIL("Test.TestMethod<T, U>()", @" { // Code size 141 (0x8d) .maxstack 1 IL_0000: ldstr ""A"" IL_0005: call ""void System.Console.WriteLine(string)"" IL_000a: ldstr ""AA"" IL_000f: call ""void System.Console.WriteLine(string)"" IL_0014: ldstr ""B"" IL_0019: call ""void System.Console.WriteLine(string)"" IL_001e: ldstr """" IL_0023: call ""void System.Console.WriteLine(string)"" IL_0028: ldstr ""#"" IL_002d: call ""void System.Console.WriteLine(string)"" IL_0032: ldstr """" IL_0037: call ""void System.Console.WriteLine(string)"" IL_003c: ldstr "" IL_0041: call ""void System.Console.WriteLine(string)"" IL_0046: ldstr ""A"" IL_004b: call ""void System.Console.WriteLine(string)"" IL_0050: ldstr ""AA"" IL_0055: call ""void System.Console.WriteLine(string)"" IL_005a: ldstr ""B"" IL_005f: call ""void System.Console.WriteLine(string)"" IL_0064: ldstr """" IL_0069: call ""void System.Console.WriteLine(string)"" IL_006e: ldstr ""#"" IL_0073: call ""void System.Console.WriteLine(string)"" IL_0078: ldstr """" IL_007d: call ""void System.Console.WriteLine(string)"" IL_0082: ldstr "" IL_0087: call ""void System.Console.WriteLine(string)"" IL_008c: ret } "); } [Fact] public void <API key>() { var source = @" using System; class Test { static void Main() { var p1 = new Printer<string>(""F""); p1.Print(""P""); p1.Print(null); var p2 = new Printer<string>(null); p2.Print(""P""); p2.Print(null); var p3 = new Printer<MutableStruct>(new MutableStruct()); MutableStruct m = new MutableStruct(); p3.Print(m); p3.Print(m); } } class Printer<T> { private T field; public Printer(T field) => this.field = field; public void Print(T p) { Console.WriteLine("""" + p + p + field + field); } } struct MutableStruct { private int i; public override string ToString() => (++i).ToString(); } "; var comp = CompileAndVerify(source, expectedOutput: @"PPFF FF PP 1111 1111"); comp.VerifyDiagnostics(); comp.VerifyIL("Printer<T>.Print", @" { // Code size 125 (0x7d) .maxstack 4 .locals init (T V_0) IL_0000: ldarg.1 IL_0001: stloc.0 IL_0002: ldloc.0 IL_0003: box ""T"" IL_0008: brtrue.s IL_000d IL_000a: ldnull IL_000b: br.s IL_001a IL_000d: ldloca.s V_0 IL_000f: constrained. ""T"" IL_0015: callvirt ""string object.ToString()"" IL_001a: ldarg.1 IL_001b: stloc.0 IL_001c: ldloc.0 IL_001d: box ""T"" IL_0022: brtrue.s IL_0027 IL_0024: ldnull IL_0025: br.s IL_0034 IL_0027: ldloca.s V_0 IL_0029: constrained. ""T"" IL_002f: callvirt ""string object.ToString()"" IL_0034: ldarg.0 IL_0035: ldfld ""T Printer<T>.field"" IL_003a: stloc.0 IL_003b: ldloc.0 IL_003c: box ""T"" IL_0041: brtrue.s IL_0046 IL_0043: ldnull IL_0044: br.s IL_0053 IL_0046: ldloca.s V_0 IL_0048: constrained. ""T"" IL_004e: callvirt ""string object.ToString()"" IL_0053: ldarg.0 IL_0054: ldfld ""T Printer<T>.field"" IL_0059: stloc.0 IL_005a: ldloc.0 IL_005b: box ""T"" IL_0060: brtrue.s IL_0065 IL_0062: ldnull IL_0063: br.s IL_0072 IL_0065: ldloca.s V_0 IL_0067: constrained. ""T"" IL_006d: callvirt ""string object.ToString()"" IL_0072: call ""string string.Concat(string, string, string, string)"" IL_0077: call ""void System.Console.WriteLine(string)"" IL_007c: ret } "); } [Fact] public void <API key>() { var source = @" using System; class Test { static void Main() { var p1 = new Printer<string>(""F""); p1.Print(""P""); p1.Print(null); var p2 = new Printer<string>(null); p2.Print(""P""); p2.Print(null); } } class Printer<T> where T : class { private T field; public Printer(T field) => this.field = field; public void Print(T p) { Console.WriteLine("""" + p + p + field + field); } }"; var comp = CompileAndVerify(source, expectedOutput: @"PPFF FF PP "); comp.VerifyDiagnostics(); comp.VerifyIL("Printer<T>.Print", @" { // Code size 93 (0x5d) .maxstack 5 IL_0000: ldarg.1 IL_0001: box ""T"" IL_0006: dup IL_0007: brtrue.s IL_000d IL_0009: pop IL_000a: ldnull IL_000b: br.s IL_0012 IL_000d: callvirt ""string object.ToString()"" IL_0012: ldarg.1 IL_0013: box ""T"" IL_0018: dup IL_0019: brtrue.s IL_001f IL_001b: pop IL_001c: ldnull IL_001d: br.s IL_0024 IL_001f: callvirt ""string object.ToString()"" IL_0024: ldarg.0 IL_0025: ldfld ""T Printer<T>.field"" IL_002a: box ""T"" IL_002f: dup IL_0030: brtrue.s IL_0036 IL_0032: pop IL_0033: ldnull IL_0034: br.s IL_003b IL_0036: callvirt ""string object.ToString()"" IL_003b: ldarg.0 IL_003c: ldfld ""T Printer<T>.field"" IL_0041: box ""T"" IL_0046: dup IL_0047: brtrue.s IL_004d IL_0049: pop IL_004a: ldnull IL_004b: br.s IL_0052 IL_004d: callvirt ""string object.ToString()"" IL_0052: call ""string string.Concat(string, string, string, string)"" IL_0057: call ""void System.Console.WriteLine(string)"" IL_005c: ret } "); } [Fact] public void <API key>() { var source = @" using System; class Test { static void Main() { MutableStruct m = new MutableStruct(); var p1 = new Printer<MutableStruct>(new MutableStruct()); p1.Print(m); p1.Print(m); } } class Printer<T> where T : struct { private T field; public Printer(T field) => this.field = field; public void Print(T p) { x += s ?? null; return x; } static void Main() { System.Console.Write(""\""{0}\"""", Bug(null)); } }"; var comp = CompileAndVerify(source, expectedOutput: "\"\""); comp.VerifyDiagnostics(); comp.VerifyIL("Repro.Bug", @" { // Code size 17 (0x11) .maxstack 3 IL_0000: ldstr """" IL_0005: ldarg.0 IL_0006: dup IL_0007: brtrue.s IL_000b IL_0009: pop IL_000a: ldnull IL_000b: call ""string string.Concat(string, string)"" IL_0010: ret } "); } [Fact, WorkItem(1092853, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1092853")] public void <API key>() { const string source = @" class Repro { static string Bug(string s) { string x = """"; x += s ?? ((string)null ?? null); return x; } static void Main() { System.Console.Write(""\""{0}\"""", Bug(null)); } }"; var comp = CompileAndVerify(source, expectedOutput: "\"\""); comp.VerifyIL("Repro.Bug", @" { // Code size 17 (0x11) .maxstack 3 IL_0000: ldstr """" IL_0005: ldarg.0 IL_0006: dup IL_0007: brtrue.s IL_000b IL_0009: pop IL_000a: ldnull IL_000b: call ""string string.Concat(string, string)"" IL_0010: ret } "); } [Fact] public void ConcatMutableStruct() { var source = @" using System; class Test { static MutableStruct f = new MutableStruct(); static void Main() { MutableStruct l = new MutableStruct(); Console.WriteLine("""" + l + l + f + f); } } struct MutableStruct { private int i; public override string ToString() => (++i).ToString(); } "; var comp = CompileAndVerify(source, expectedOutput: @"1111"); comp.VerifyDiagnostics(); comp.VerifyIL("Test.Main", @" { // Code size 87 (0x57) .maxstack 4 .locals init (MutableStruct V_0, MutableStruct V_1) IL_0000: ldloca.s V_0 IL_0002: initobj ""MutableStruct"" IL_0008: ldloc.0 IL_0009: stloc.1 IL_000a: ldloca.s V_1 IL_000c: constrained. ""MutableStruct"" IL_0012: callvirt ""string object.ToString()"" IL_0017: ldloc.0 IL_0018: stloc.1 IL_0019: ldloca.s V_1 IL_001b: constrained. ""MutableStruct"" IL_0021: callvirt ""string object.ToString()"" IL_0026: ldsfld ""MutableStruct Test.f"" IL_002b: stloc.1 IL_002c: ldloca.s V_1 IL_002e: constrained. ""MutableStruct"" IL_0034: callvirt ""string object.ToString()"" IL_0039: ldsfld ""MutableStruct Test.f"" IL_003e: stloc.1 IL_003f: ldloca.s V_1 IL_0041: constrained. ""MutableStruct"" IL_0047: callvirt ""string object.ToString()"" IL_004c: call ""string string.Concat(string, string, string, string)"" IL_0051: call ""void System.Console.WriteLine(string)"" IL_0056: ret }"); } [Fact] public void <API key>() { const string source = @" using System; using static System.Console; struct Mutable { int x; public override string ToString() => (x++).ToString(); } class Test { static Mutable m = new Mutable(); static void Main() { Write(""("" + m + "")""); Write(""("" + m + "")""); Write(""("" + m.ToString() + "")""); Write(""("" + m.ToString() + "")""); Write(""("" + m.ToString() + "")""); Nullable<Mutable> n = new Mutable(); Write(""("" + n + "")""); Write(""("" + n + "")""); Write(""("" + n.ToString() + "")""); Write(""("" + n.ToString() + "")""); Write(""("" + n.ToString() + "")""); } }"; CompileAndVerify(source, expectedOutput: "(0)(0)(0)(1)(2)(0)(0)(0)(1)(2)"); } [Fact] public void <API key>() { var source = @" using System; class Test { static ReadonlyStruct f = new ReadonlyStruct(); static void Main() { ReadonlyStruct l = new ReadonlyStruct(); Console.WriteLine("""" + l + l + f + f); } } readonly struct ReadonlyStruct { public override string ToString() => ""R""; } "; var comp = CompileAndVerify(source, expectedOutput: @"RRRR"); comp.VerifyDiagnostics(); comp.VerifyIL("Test.Main", @" { // Code size 77 (0x4d) .maxstack 4 .locals init (ReadonlyStruct V_0) //l IL_0000: ldloca.s V_0 IL_0002: initobj ""ReadonlyStruct"" IL_0008: ldloca.s V_0 IL_000a: constrained. ""ReadonlyStruct"" IL_0010: callvirt ""string object.ToString()"" IL_0015: ldloca.s V_0 IL_0017: constrained. ""ReadonlyStruct"" IL_001d: callvirt ""string object.ToString()"" IL_0022: ldsflda ""ReadonlyStruct Test.f"" IL_0027: constrained. ""ReadonlyStruct"" IL_002d: callvirt ""string object.ToString()"" IL_0032: ldsflda ""ReadonlyStruct Test.f"" IL_0037: constrained. ""ReadonlyStruct"" IL_003d: callvirt ""string object.ToString()"" IL_0042: call ""string string.Concat(string, string, string, string)"" IL_0047: call ""void System.Console.WriteLine(string)"" IL_004c: ret } "); } [Fact] public void <API key>() { var source = @" using System; class Test { static <API key> f = new <API key>(); static void Main() { <API key> l = new <API key>(); Console.WriteLine("""" + l + l + f + f); } } struct <API key> { public readonly override string ToString() => ""R""; } "; var comp = CompileAndVerify(source, expectedOutput: @"RRRR"); comp.VerifyDiagnostics(); comp.VerifyIL("Test.Main", @" { // Code size 77 (0x4d) .maxstack 4 .locals init (<API key> V_0) IL_0000: ldloca.s V_0 IL_0002: initobj ""<API key>"" IL_0008: ldloca.s V_0 IL_000a: constrained. ""<API key>"" IL_0010: callvirt ""string object.ToString()"" IL_0015: ldloca.s V_0 IL_0017: constrained. ""<API key>"" IL_001d: callvirt ""string object.ToString()"" IL_0022: ldsflda ""<API key> Test.f"" IL_0027: constrained. ""<API key>"" IL_002d: callvirt ""string object.ToString()"" IL_0032: ldsflda ""<API key> Test.f"" IL_0037: constrained. ""<API key>"" IL_003d: callvirt ""string object.ToString()"" IL_0042: call ""string string.Concat(string, string, string, string)"" IL_0047: call ""void System.Console.WriteLine(string)"" IL_004c: ret } "); } [Fact] public void <API key>() { var source = @" using System; class Test { static S f = new S(); static void Main() { S l = new S();
#!/usr/bin/env bash # start ssh to be tested "running" by netstat service ssh start # run the tests - every test should result in "passed" cd /app && \ java -jar /app/<API key>.jar -v /app/certificate-file.edn && \ echo " java -jar /app/<API key>.jar -v /app/command.edn && \ echo " java -jar /app/<API key>.jar -v /app/file.edn && \ echo " java -jar /app/<API key>.jar -v /app/package.edn && \ echo " java -jar /app/<API key>.jar --<API key> /app/http-cert.edn && \ java -jar /app/<API key>.jar -v /app/http-cert.edn && \ echo " java -jar /app/<API key>.jar --<API key> /app/netstat.edn && \ java -jar /app/<API key>.jar -v /app/netstat.edn && \ echo " java -jar /app/<API key>.jar --<API key> /app/netcat.edn && \ java -jar /app/<API key>.jar -v /app/netcat.edn && \ echo " java -jar /app/<API key>.jar --<API key> /app/iproute.edn && \ java -jar /app/<API key>.jar -v /app/iproute.edn -v
package org.devspark.aws.tools; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.<API key>; import org.apache.maven.plugin.<API key>; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.devspark.aws.lambdasupport.endpoint.annotations.apigateway.ApiGateway; import org.devspark.aws.lambdasupport.endpoint.annotations.apigateway.Resource; import org.devspark.aws.lambdasupport.endpoint.annotations.apigateway.ResourceMethod; import org.devspark.aws.tools.model.resources.EndpointResource; import org.devspark.aws.tools.model.resources.<API key>; import org.devspark.aws.tools.model.resources.<API key>; import org.devspark.aws.tools.model.resources.EndpointResponse; import org.devspark.aws.tools.model.resources.<API key>; import org.devspark.aws.tools.model.resources.<API key>; import org.devspark.aws.tools.swagger.SwaggerFileWriter; import org.devspark.aws.tools.swagger.<API key>; import org.reflections.ReflectionUtils; import org.reflections.Reflections; import org.reflections.scanners.SubTypesScanner; import org.reflections.scanners.<API key>; import org.reflections.util.ClasspathHelper; import org.reflections.util.<API key>; @Mojo(name = "apigateway-deployer") public class <API key> extends AbstractMojo { @Parameter(property = "base-package") private String basePackage; private SwaggerFileWriter fileWriter = new <API key>(); @Override public void execute() throws <API key>, <API key> { Reflections reflections = new Reflections(new <API key>() .setUrls(ClasspathHelper.forPackage(basePackage)).setScanners( new SubTypesScanner(), new <API key>())); Set<Class<?>> resources = reflections .<API key>(Resource.class); Set<Class<?>> apis = reflections .<API key>(ApiGateway.class); Map<String, EndpointResource> endpointResources = <API key>(resources); String apiName = getApiName(apis); fileWriter.createSwaggerFile(new ArrayList<EndpointResource>(endpointResources.values()), apiName); } private String getApiName(Set<Class<?>> apis) { if (apis.size() != 1) { getLog().warn("Invalid number of @ApiGateway found."); } return apis.iterator().next().<API key>(ApiGateway.class)[0].name(); } @SuppressWarnings("unchecked") private Map<String, EndpointResource> <API key>(Set<Class<?>> resources) { Map<String, EndpointResource> endpointResources = new HashMap<String, EndpointResource>(); for (Class<?> type : resources) { Set<Method> resourceMethods = ReflectionUtils.getAllMethods(type, ReflectionUtils.withAnnotation(ResourceMethod.class)); if (resourceMethods.isEmpty()) { getLog().warn( "No methods annotated with @Resource found in type: " + type.getName()); continue; } for (Method method : resourceMethods) { Resource methodResource = method.getAnnotation(Resource.class); String resourceName = type.<API key>(Resource.class)[0].name(); if(methodResource != null) { resourceName = resourceName + "/" + methodResource.name(); } <API key> endpointMethod = <API key>(method, resourceName); EndpointResource endpointResource = endpointResources.get(resourceName); if (endpointResource == null) { endpointResource = new EndpointResource(); endpointResource.setName(resourceName); endpointResource.setMethods(new ArrayList<<API key>>()); endpointResources.put(resourceName, endpointResource); } endpointResource.getMethods().add(endpointMethod); } } return endpointResources; } private <API key> <API key>(Method method, String resourceName) { <API key> endpointMethod = new <API key>(); ResourceMethod resourceMethod = method.getAnnotation(ResourceMethod.class); endpointMethod.setVerb(resourceMethod.httpMethod().name()); endpointMethod.setParameters(getParameters(resourceName)); endpointMethod.setProduces(Arrays.asList("application/json")); endpointMethod.setResponses(getMethodResponses()); return endpointMethod; } //TODO: Replace mocked list with the generation of the responses of the method. private List<EndpointResponse> getMethodResponses() { List<EndpointResponse> responses = new ArrayList<EndpointResponse>(); EndpointResponse sucessfulResponse = new EndpointResponse(); sucessfulResponse.setHttpStatus("200"); sucessfulResponse.setDescription("200 response"); sucessfulResponse.setHeaders(new <API key>()); <API key> schema = new <API key>(); schema.setRef("#/definitions/Empty"); sucessfulResponse.setSchema(schema); return responses; } private List<<API key>> getParameters(String resourceName) { String pattern = "\\{[a-zA-A]*\\}"; Pattern r = Pattern.compile(pattern); List<<API key>> parameters = new ArrayList<<API key>>(); Matcher m = r.matcher(resourceName); while(m.find()){ <API key> parameter = new <API key>(); parameter.setName(m.group(0).replaceAll("\\{*\\}*", "")); //TODO: Review how to populate the parameter metadata. parameter.setRequired(true); parameter.setType("string"); parameter.setIn("path"); parameters.add(parameter); } return parameters; } }
<?php //db_mysqli, db_pdo $var->db_driver = 'db_mysqli'; //$var->db_driver = 'db_pdo'; //for pdo: mysql, sqlite, ... //$var->db_engine = 'mysql'; $var->db_host = 'localhost'; $var->db_database = 'ada'; $var->db_user = 'ad'; $var->db_pass = 'dddd'; //$var->db_database = 'kargosha'; //$var->db_user = 'root'; //$var->db_pass = ''; $var->db_perfix = 'x_'; $var->db_set_utf8 = true; $var->session_unique = 'kargosha'; $var->auto_lang = false; $var->multi_domain = false; $var->use_mailer_lite_api = true; $var->mailer_lite_api_key = ''; $var-><API key> = ''; $var->cache_page = false; $var->cache_image = false; $var->cache_page_time = 1*24*60*60; // 1 day = 1 days * 24 hours * 60 mins * 60 secs $var->cache_image_time = 1*24*60*60; // 1 day = 1 days * 24 hours * 60 mins * 60 secs $var->cookie_expire_time = 30*24*60*60; // 30 day = 30 days * 24 hours * 60 mins * 60 secs $var->hit_counter = true; $var->hit_online = true; $var->hit_referers = false; $var->hit_requests = false; $var-><API key> = 0; $var->bank_mellat_user = ''; $var->bank_mellat_pass = ''; $var->callBackUrl = "http://site.com/?a=transaction.callBack"; $var->bank_startpayUrl = "https://bpm.shaparak.ir/pgwchannel/startpay.mellat"; $var->bank_nusoap_client = "https://bpm.shaparak.ir/pgwchannel/services/pgw?wsdl"; $var->bank_namespace = "http://interfaces.core.sw.bps.com/"; $var-><API key> = "AAAA-BBBB-CCCC-DDDD"; $var-><API key> = "http://site.com/?a=<API key>.callBack"; ?>
package com.zswxsqxt.wf.dao; import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Repository; import cn.org.rapid_framework.page.Page; import com.opendata.common.base.BaseHibernateDao; import com.zswxsqxt.wf.model.WfActivity; import com.zswxsqxt.wf.model.WfProject; import com.zswxsqxt.wf.query.WfActivityQuery; /** describe:Dao */ @Repository public class WfActivityDao extends BaseHibernateDao<WfActivity,String> { public Class getEntityClass() { return WfActivity.class; } /** WfActivityQuery */ public Page findPage(WfActivityQuery query,int pageSize,int pageNum) { StringBuilder hql=new StringBuilder(); hql.append(" from WfActivity ett where 1=1"); List param=new ArrayList(); if(query!=null) { if(!StringUtils.isEmpty(query.getId())) { hql.append(" and ett.id=?"); param.add(query.getId()); } if(!StringUtils.isEmpty(query.getName())) { hql.append(" and ett.name like ?"); param.add("%"+query.getName()+"%"); } if(query.getOrderNum()!=null) { hql.append(" and ett.orderNum=?"); param.add(query.getOrderNum()); } if(query.getActType()!=null) { hql.append(" and ett.actType=?"); param.add(query.getActType()); } if(query.getActFlag()!=null) { hql.append(" and ett.actFlag=?"); param.add(query.getActFlag()); } if(!StringUtils.isEmpty(query.getDescription())) { hql.append(" and ett.description=?"); param.add(query.getDescription()); } if(!StringUtils.isEmpty(query.getUrl())) { hql.append(" and ett.url=?"); param.add(query.getUrl()); } if(!StringUtils.isEmpty(query.getGroupFlag())) { hql.append(" and ett.groupFlag=?"); param.add(query.getGroupFlag()); } if(!StringUtils.isEmpty(query.getExtFiled3())) { hql.append(" and ett.extFiled3=?"); param.add(query.getExtFiled3()); } if(query.getTs()!=null) { hql.append(" and ett.ts=?"); param.add(query.getTs()); } if(query.getWfProject()!=null) { hql.append(" and ett.wfProject.id=?"); param.add(query.getWfProject().getId()); } if(query.getWfInstance()!=null) { hql.append(" and ett.wfInstance=?"); param.add(query.getWfInstance()); } } if(!StringUtils.isEmpty(query.getSortColumns())){ if(!query.getSortColumns().equals("ts")){ hql.append(" order by ett."+query.getSortColumns()+" , ett.ts desc "); }else{ hql.append(" order by ett.orderNum asc "); } }else{ hql.append(" order by ett.orderNum asc "); } return super.findByHql(hql.toString(), pageSize, pageNum, param.toArray()); } /** * id * @param proId * @return */ public List<WfActivity> getWfActivity(String proId){ String hql = "from WfActivity where wfProject.id = ? order by orderNum asc"; List<WfActivity> list = super.findFastByHql(hql, proId); if(list.size()>0){ return list; }else{ return null; } } }
from O365 import attachment import unittest import json import base64 from random import randint att_rep = open('attachment.json','r').read() att_j = json.loads(att_rep) class TestAttachment (unittest.TestCase): def setUp(self): self.att = attachment.Attachment(att_j['value'][0]) def test_isType(self): self.assertTrue(self.att.isType('txt')) def test_getType(self): self.assertEqual(self.att.getType(),'.txt') def test_save(self): name = self.att.json['Name'] name1 = self.newFileName(name) self.att.json['Name'] = name1 self.assertTrue(self.att.save('/tmp')) with open('/tmp/'+name1,'r') as ins: f = ins.read() self.assertEqual('testing w00t!',f) name2 = self.newFileName(name) self.att.json['Name'] = name2 self.assertTrue(self.att.save('/tmp/')) with open('/tmp/'+name2,'r') as ins: f = ins.read() self.assertEqual('testing w00t!',f) def newFileName(self,val): for i in range(4): val = str(randint(0,9)) + val return val def test_getByteString(self): self.assertEqual(self.att.getByteString(),b'testing w00t!') def test_getBase64(self): self.assertEqual(self.att.getBase64(),'dGVzdGluZyB3MDB0IQ==\n') def test_setByteString(self): test_string = b'testing testie test' self.att.setByteString(test_string) enc = base64.encodebytes(test_string) self.assertEqual(self.att.json['ContentBytes'],enc) def setBase64(self): wrong_test_string = 'I am sooooo not base64 encoded.' right_test_string = 'Base64 <3 all around!' enc = base64.encodestring(right_test_string) self.assertRaises(self.att.setBase64(wrong_test_string)) self.assertEqual(self.att.json['ContentBytes'],'dGVzdGluZyB3MDB0IQ==\n') self.att.setBase64(enc) self.assertEqual(self.att.json['ContentBytes'],enc) if __name__ == '__main__': unittest.main()
# Change Log All releases of the BOSH CPI for Google Cloud Platform will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). ## [30.0.0] - 2019-01-04 Added - MULTI_IP_SUBNET support in GCE Changed - Go 1.12 - BOSH API v2 ## [29.0.0] - 2019-01-04 Fixed - VM IP address is cleared when dynamic network is used Added - Logs are returned in response to BOSH, making them viewable in task log - If a disk is already attached to a VM, it will only be attached via the BOSH agent ## [28.0.1] - 2018-10-02 Fixed - Avoid keeping old golang installation files in GOROOT ## [28.0.0] - 2018-09-18 Added - Support for scheme agnostic backend services. - Made it possible to inject a Google client when testing. - Implement a Find Service for accelerator types. - Implements creation of VM with accelerator. - Support for Accelerator in Cloud Properties. - Support for CPI Config. Changed - Use Debian 9 in test infrastructure. - Avoid Sandy Bridge CPUs. - Use Go 1.9. - Update types to pointer where is needed. Fixed - Fixes for integration tests modifying the CPI request to include context necessary for the 'cpi-config'-enabled CPI. - Fixes for unit tests. ## [25.10.0] - 2017-08-17 Added - Google Cloud Storage is a supported blobstore backend Changed - Improved documentation to include the new BOSH CLI ## [25.9.0] - 2017-05-23 Fixed - Address inconsistent stream error: stream ID 1; PROTOCOL_ERROR errors in CPI calls by updating to Go 1.8.1 CI: Changed - Tests use proper custom backend - Add publish light-stemcell 3421 jobs ## [25.8.0] - 2017-05-16 Changed - Tags no longer become labels on GCP - Support XPN VPC Networks via the `xpn_host_project_id` cloud property - Support for customizing user agent strings - Publish CentOS Lite 3363.x, 3312.x, Ubuntu Alpha Lite stemcells - Docs: update ubuntu image for bosh-bastion - Docs: simplify grabbing project ID - Docs: add backend_service docs for internal load balancers ## [25.7.1] - 2017-03-07 Fixed - Previously, requests to Google APIs that returned 5xx response codes were retried. This change adds retry support to transport errors (net.Error) that are known to be temporary. ## [25.7.0] - 2017-03-03 Fixed - Various docs changes Changed - Labels may be specified in cloud properties - CF docs include TCP router - Use lateset Docker image in CIA - Support internal load balancer ## [25.6.2] - 2016-12-19 Fixed - Improve tests - Corrects MTU on garden job Changed - Support `ImageURL` for specifying stemcellA - Concourse docs incude SSL support - Docs require setting a password instead of using default ## [25.6.1] - 2016-11-02 Fixed - Handles large disk sizes Changed - CF docs run under free-tier quota - Integration tests can use local stemcell ## [25.6.0] - 2016-10-27 Changed - Supports `has_disk` method - Improvements to stemcell pipelines ## [25.5.0] - 2016-10-17 Changed - Release uses Go 1.7.1 Fixed - A backend service previously could not have multiple instance groups with the same name. This release fixes that, and you may have instance groups with the same name associated to a backend service. ## [25.4.1] - 2016-09-14 Fixed - Tags that are applied by the director on VM create will be truncated to ensure they do not violate the 63-char max limit imposed by GCE. ## [25.4.0] - 2016-09-14 Changed - When using a custom service account, a default `cloud-platform` scope is used if no custom scopes are specified. ## [25.3.0] - 2016-09-02 Added - S3 is now a supported blobstore type. ## [25.2.1] - 2016-08-18 Fixed - Underscores are replaced with hyphens in metadata that is applied as labels to a VM. Added - Complete Concourse installation instructions, including cloud config and Terraform. ## [25.2.0] - 2016-08-18 Changed - Any metadata provided by bosh in the `set_vm_metadata` action will also be propagated to the VM as [labels](https://cloud.google.com/compute/docs/<API key>), allowing sorting and filter in the web console based on job, deployment, etc. ## [25.1.0] - 2016-08-18 Added - The `service_account` cloud-config property may now use the e-mail address of a custom service account. ## [25.0.0] - 2016-07-25 Changed - The `default_zone` config property (in the `google` section of a manifest) is no longer supported. The `zone` property must be explicitly set in the `cloud_properties` section of `resource_pools` (or `azs` for a cloud-config director.) ## [24.4.0] - 2016-07-25 Fixed - An explicit region is used to locate a subnet, allowing subnets with the same name to be differentiated. ## [24.3.0] - 2016-07-25 Added - A `resource_pool`'s manifest can now specify `<API key>` and `ip_forwarding` properties, overriding those same properties in a manifest's `networks` section. ## [24.2.0] - 2016-07-25 Added - This changelog Changed - 3262.4 stemcell Fixed - All tests now use light stemcells ## [24.1.0] - 2016-07-25 Changed - Instance tags can be specified in any `cloud_properties` section of a BOSH manifest Removed - The dummy BOSH release is no longer part of the CI pipeline Fixed - Integration tests will use the CI pipeline stemcell rather than requiring an existing stemcell in a project [30.0.0]: https://github.com/<API key>/<API key>/compare/v29.0.1...v30.0.0 [29.0.0]: https://github.com/<API key>/<API key>/compare/v28.0.1...v29.0.0 [28.0.1]: https://github.com/<API key>/<API key>/compare/v28.0.0...v28.0.1 [25.10.0]: https://github.com/<API key>/<API key>/compare/v25.9.0...v25.10.0 [25.9.0]: https://github.com/<API key>/<API key>/compare/v25.8.0...v25.9.0 [25.8.0]: https://github.com/<API key>/<API key>/compare/v25.7.1...v25.8.0 [25.7.1]: https://github.com/<API key>/<API key>/compare/v25.7.0...v25.7.1 [25.7.0]: https://github.com/<API key>/<API key>/compare/v25.6.2...v25.7.0 [25.6.2]: https://github.com/<API key>/<API key>/compare/v25.6.1...v25.6.2 [25.6.1]: https://github.com/<API key>/<API key>/compare/v25.6.0...v25.6.1 [25.6.0]: https://github.com/<API key>/<API key>/compare/v25.5.0...v25.6.0 [25.5.0]: https://github.com/<API key>/<API key>/compare/v25.4.1...v25.5.0 [25.4.1]: https://github.com/<API key>/<API key>/compare/v25.4.0...v25.4.1 [25.4.0]: https://github.com/<API key>/<API key>/compare/v25.3.0...v25.4.0 [25.3.0]: https://github.com/<API key>/<API key>/compare/v25.2.1...v25.3.0 [25.2.1]: https://github.com/<API key>/<API key>/compare/v25.2.0...v25.2.1 [25.2.0]: https://github.com/<API key>/<API key>/compare/v25.1.0...v25.2.0 [25.1.0]: https://github.com/<API key>/<API key>/compare/v25.0.0...v25.1.0 [25.0.0]: https://github.com/<API key>/<API key>/compare/v24.4.0...v25.0.0 [24.4.0]: https://github.com/<API key>/<API key>/compare/v24.3.0...v24.4.0 [24.3.0]: https://github.com/<API key>/<API key>/compare/v24.2.0...v24.3.0 [24.2.0]: https://github.com/<API key>/<API key>/compare/v24.1.0...v24.2.0 [24.1.0]: https://github.com/<API key>/<API key>/compare/v24...v24.1.0
using TestMonkeys.EntityTest.Framework; namespace UsageExample.<API key>.TestObjects { public class <API key> { [<API key>(0)] public object GreaterThanValue { get; set; } } }
using System.Linq; using System.Threading; using System.Threading.Tasks; using Roslyn.Test.Utilities; using Xunit; using LSP = Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.LanguageServer.UnitTests.Definitions { public class GoToDefinitionTests : <API key> { [Fact] public async Task <API key>() { var markup = @"class A { string {|definition:aString|} = 'hello'; void M() { var len = {|caret:|}aString.Length; } }"; var (solution, locations) = CreateTestSolution(markup); var results = await <API key>(solution, locations["caret"].Single()); <API key>(locations["definition"], results); } [Fact] public async Task <API key>() { var markups = new string[] { @"namespace One { class A { public static int {|definition:aInt|} = 1; } }", @"namespace One { class B { int bInt = One.A.{|caret:|}aInt; } }" }; var (solution, locations) = CreateTestSolution(markups); var results = await <API key>(solution, locations["caret"].Single()); <API key>(locations["definition"], results); } [Fact] public async Task <API key>() { var markup = @"class A { void M() {{|caret:|} var len = aString.Length; } }"; var (solution, locations) = CreateTestSolution(markup); var results = await <API key>(solution, locations["caret"].Single()); Assert.Empty(results); } private static async Task<LSP.Location[]> <API key>(Solution solution, LSP.Location caret) => (LSP.Location[])await GetLanguageServer(solution).GoToDefinitionAsync(solution, <API key>(caret), new LSP.ClientCapabilities(), CancellationToken.None); } }
package org.mskcc.shenkers.data.interval; import htsjdk.tribble.Feature; import htsjdk.tribble.annotation.Strand; import htsjdk.tribble.bed.FullBEDFeature; import java.awt.Color; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; /** * * @author sol */ public interface IntervalFeature<T> extends Feature { Strand getStrand(); T getValue(); }
/* fixed page header & footer configuration */ .ui-header-fixed, .ui-footer-fixed { left: 0; right: 0; width: 100%; position: fixed; z-index: 1000; } .ui-header-fixed { top: -1px; padding-top: 1px; } .ui-header-fixed.ui-fixed-hidden { top: 0; padding-top: 0; } .ui-header-fixed .ui-btn-left, .ui-header-fixed .ui-btn-right { margin-top: 1px; } .ui-header-fixed.ui-fixed-hidden .ui-btn-left, .ui-header-fixed.ui-fixed-hidden .ui-btn-right { margin-top: 0; } .ui-footer-fixed { bottom: -1px; padding-bottom: 1px; } .ui-footer-fixed.ui-fixed-hidden { bottom: 0; padding-bottom: 0; } .<API key>, .<API key> { filter: Alpha(Opacity=90); opacity: .9; } /* updatePagePadding() will update the padding to actual height of header and footer. */ .<API key> { padding-top: 2.8125em; } .<API key> { padding-bottom: 2.8125em; } .<API key> > .ui-content, .<API key> > .ui-content { padding: 0; } .ui-fixed-hidden { position: absolute; } .<API key> .ui-fixed-hidden, .<API key> .ui-fixed-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); } .ui-header-fixed .ui-btn, .ui-footer-fixed .ui-btn { z-index: 10; } /* workarounds for other widgets */ .ui-android-2x-fixed .ui-li-has-thumb { -webkit-transform: translate3d(0,0,0); }
goog.provide('shaka.ui.FastForwardButton'); goog.require('shaka.ui.Controls'); goog.require('shaka.ui.Element'); goog.require('shaka.ui.Enums'); goog.require('shaka.ui.Locales'); goog.require('shaka.ui.Localization'); goog.require('shaka.util.Dom'); /** * @extends {shaka.ui.Element} * @final * @export */ shaka.ui.FastForwardButton = class extends shaka.ui.Element { /** * @param {!HTMLElement} parent * @param {!shaka.ui.Controls} controls */ constructor(parent, controls) { super(parent, controls); /** @private {!HTMLButtonElement} */ this.button_ = shaka.util.Dom.createButton(); this.button_.classList.add('<API key>'); this.button_.classList.add('<API key>'); this.button_.classList.add('<API key>'); this.button_.setAttribute('shaka-status', '1x'); this.button_.textContent = shaka.ui.Enums.MaterialDesignIcons.FAST_FORWARD; this.parent.appendChild(this.button_); this.updateAriaLabel_(); /** @private {!Array.<number>} */ this.fastForwardRates_ = this.controls.getConfig().fastForwardRates; this.eventManager.listen( this.localization, shaka.ui.Localization.LOCALE_UPDATED, () => { this.updateAriaLabel_(); }); this.eventManager.listen( this.localization, shaka.ui.Localization.LOCALE_CHANGED, () => { this.updateAriaLabel_(); }); this.eventManager.listen(this.button_, 'click', () => { this.fastForward_(); }); } /** * @private */ updateAriaLabel_() { this.button_.ariaLabel = this.localization.resolve(shaka.ui.Locales.Ids.FAST_FORWARD); } /** * Cycles trick play rate between the selected fast forward rates. * @private */ fastForward_() { if (!this.video.duration) { return; } const trickPlayRate = this.player.getPlaybackRate(); const newRateIndex = this.fastForwardRates_.indexOf(trickPlayRate) + 1; // When the button is clicked, the next rate in this.fastForwardRates_ is // selected. If no more rates are available, the first one is set. const newRate = (newRateIndex != this.fastForwardRates_.length) ? this.fastForwardRates_[newRateIndex] : this.fastForwardRates_[0]; this.player.trickPlay(newRate); this.button_.setAttribute('shaka-status', newRate + 'x'); } }; /** * @implements {shaka.extern.IUIElement.Factory} * @final */ shaka.ui.FastForwardButton.Factory = class { /** @override */ create(rootElement, controls) { return new shaka.ui.FastForwardButton(rootElement, controls); } }; shaka.ui.Controls.registerElement( 'fast_forward', new shaka.ui.FastForwardButton.Factory());
# General Information for Windows This file describes how to install, or build, and use Julia on Windows. For more general information about Julia, please see the [main README](https: # Unicode font support The built-in Windows fonts have rather poor coverage of the Unicode character space. The free [`DejaVu Sans Mono`](http://dejavu-fonts.org/) font can be used as a replacement font in the Windows console. Since Windows 2000, simply downloading the font and installing it is insufficient, since Windows keeps a list of approved fonts in the registry. Instructions for adding fonts to the terminal are available at: [http: Additionally, rather than sticking with the default command prompt, you may want to use a different terminal emulator program, such as [`Conemu`](https: (note that running Julia on Mintty needs a copy of `stty.exe` in your `%PATH%` to work properly). Alternatively, you may prefer the features of a more full-function IDE, such as [`LightTable`](https: # Binary distribution Julia runs on Windows XP-SP2 and later (including Windows Vista, Windows 7, and Windows 8). Both the 32-bit and 64-bit versions are supported. The 32-bit (i686) binary will run on either a 32-bit and 64-bit operating system. The 64-bit (x86_64) binary will only run on 64-bit Windows and will otherwise refuse to launch. 1. Download and install [7-Zip](http: 2. [Download](http://julialang.org/downloads) the latest version of Julia. Extract the binary to a reasonable destination folder, e.g. `C:\julia`. 3. Double-click the file `julia.bat` to launch Julia. # Line endings Julia uses binary-mode files exclusively. Unlike many other Window's programs, if you write '\n' to a file, you get a '\n' in the file, not some other bit pattern. This matches the behavior exhibited by other operating systems. If you have installed msysGit, it is suggested, but not required, that you configure your system msysGit to use the same convention: git config --global core.eol = lf git config --global core.autocrlf = input or edit `%USERPROFILE%\.gitconfig` and add/edit the lines: [core] eol = lf autocrlf = input # Source distribution ## Supported build platforms - Windows 8: supported (32 and 64 bits) - Windows 7: supported (32 and 64 bits) - Windows Vista: unknown - Windows XP: not supported (however, there have been some reports of success following the msys2 steps) ## Compiling with MinGW/MSYS2 MSYS2 provides a robust MSYS experience. The instructions in this section were tested with the latest versions of all packages specified as of 2014-02-28. 1. Install [7-Zip](http: 2. Install [Python 2.x](http: 3. Install [MinGW-builds](http://sourceforge.net/projects/mingwbuilds/), a Windows port of GCC, as follows. Do **not** use the regular MinGW distribution. 1. Download the [MinGW-builds installer](http://downloads.sourceforge.net/project/mingwbuilds/<API key>/<API key>.exe). 2. Run the installer. When prompted, choose: - Version: the most recent version (these instructions were tested with 4.8.1) - Architecture: `x32` or `x64` as appropriate and desired. - Threads: `win32` (not posix) - Exception: `sjlj` (for x32) or `seh` (for x64). Do not choose dwarf2. - Build revision: most recent available (tested with 5) 3. Do **not** install to a directory with spaces in the name. You will have to change the default installation path, for example, - `C:\mingw-builds\x64-4.8.1-win32-seh-rev5` for 64 bits - `C:\mingw-builds\x32-4.8.1-win32-sjlj-rev5` for 32 bits 4. Install and configure [MSYS2](http://sourceforge.net/projects/msys2), a minimal POSIX-like environment for Windows. 1. Download the latest base [32-bit](http: 2. Using [7-Zip](http: - *N.B.* Some versions of this archive contain zero-byte files that clash with existing files. If prompted, choose **not** to overwrite existing files. - You may need to extract the tarball in a separate step. This will create an `msys32` or `msys64` directory, according to the architecture you chose. - Move the `msys32` or `msys64` directory into your MinGW-builds directory, which is `C:\mingw-builds` if you followed the suggestions in step 3. We will omit the "32" or "64" in the steps below and refer to this as "the msys directory". 3. Double-click `msys2_shell.bat` in the msys directory. This will initialize MSYS2. The shell will tell you to `exit` and restart the shell. For now, ignore it. 4. Update MSYS2 and install packages required to build julia, using the `pacman` package manager included in MSYS2: pacman-key --init #Download keys pacman -Syu #Update package database and full system upgrade Now `exit` the MSYS2 shell and restart it, *even if you already restarted it above*. This is necessary in case the system upgrade updated the main MSYS2 libs. Reopen the MSYS2 shell and continue with: pacman -S diffutils git m4 make patch tar msys/openssh 5. Configure your MSYS2 shell for convenience: echo "mount C:/Python27 /python" >> ~/.bashrc # uncomment ONE of the following two lines #echo "mount C:/mingw-builds/x64-4.8.1-win32-seh-rev5/mingw64 /mingw" >> ~/.bashrc #echo "mount C:/mingw-builds/x32-4.8.1-win32-sjlj-rev5/mingw32 /mingw" >> ~/.bashrc echo "export PATH=/usr/local/bin:/usr/bin:/opt/bin:/mingw/bin:/python" >> ~/.bashrc *N.B.* The `export` clobbers whatever `$PATH` is already defined. This is suggested to avoid path-masking. If you use MSYS2 for purposes other than building Julia, you may prefer to append rather than clobber. *N.B.* All of the path-separators in the mount commands are unix-style. 6. Configuration of the toolchain is complete. Now `exit` the MSYS2 shell. 5. Build Julia and its dependencies from source. 1. Relaunch the MSYS2 shell and type . ~/.bashrc # Some versions of MSYS2 do not run this automatically Ignore any warnings you see from `mount` about `/mingw` and `/python` not existing. 2. Get the Julia sources and start the build: git clone https://github.com/JuliaLang/julia.git cd julia make -j 4 # Adjust the number of cores (4) to match your build environment. 3. The Julia build can (as of 2014-02-28) fail after building OpenBLAS. This appears (?) to be a result of the OpenBLAS build trying to run the Microsoft Visual C++ `lib.exe` tool -- which we don't need to do -- without checking for its existence. This uncaught error kills the Julia build. If this happens, follow the instructions in the helpful error message and continue the build, *viz.* cd deps/openblas-v0.2.9.rc1 # This path will depend on the version of OpenBLAS. make install cd ../.. make -j 4 # Adjust the number of cores (4) to match your build environment. 4. Some versions of PCRE (*e.g.* 8.31) will compile correctly but fail a test. This will cause the Julia build to fail. To circumvent testing for PCRE and allow the rest of the build to continue, touch deps/pcre-8.31/checked # This path will depend on the version of PCRE. make -j 4 # Adjust the number of cores (4) to match your build environment. 6. Setup Package Development Environment 1. The `Pkg` module in Base provides many convenient tools for [developing and publishing packages](http://docs.julialang.org/en/latest/manual/packages/). One of the packages added through pacman above was `openssh`, which will allow secure access to GitHub APIs. Follow GitHub's [guide](https://help.github.com/articles/generating-ssh-keys) to setting up SSH keys to ensure your local machine can communicate with GitHub effectively. 5. In case of the issues with building packages (i.e. ICU fails to build with the following error message ```error compiling xp_parse: error compiling xp_make_parser: could not load module libexpat-1: %```) run ```make win-extras``` and then copy everything from the ```dist-extras``` folder into ```usr/bin```. ## Building on Windows with MinGW-builds/MSYS The MSYS build of `make` is fragile and may not reliably support parallel builds. Use MSYS2 as described above, if you can. If you must use MSYS, take care to notice the special comments in this section. 1. Install [7-Zip](http: 2. Install [Python 2.x](http: 3. Install [MinGW-builds](http://sourceforge.net/projects/mingwbuilds/), a Windows port of GCC. as follows. Do **not** use the regular MinGW distribution. 1. Download the [MinGW-builds installer](http://downloads.sourceforge.net/project/mingwbuilds/<API key>/<API key>.exe). 2. Run the installer. When prompted, choose: - Version: the most recent version (these instructions were tested with 4.8.1) - Architecture: x32 or x64 as appropriate and desired. - Threads: win32 (not posix) - Exception: sjlj (for x32) or seh (for x64). Do not choose dwarf2. - Build revision: most recent available (tested with 5) 3. Do **not** install to a directory with spaces in the name. You will have to change the default installation path. The following instructions will assume `C:\mingw-builds\x64-4.8.1-win32-seh-rev5\mingw64`. 4. Download and extract the [MSYS distribution for MinGW-builds](http://sourceforge.net/projects/mingwbuilds/files/<API key>/) (e.g. msys+7za+wget+svn+git+mercurial+cvs-rev13.7z) to a directory *without* spaces in the name, e.g. `C:/mingw-builds/msys`. 5. Download the [MSYS distribution of make](http://sourceforge.net/projects/mingw/files/MSYS/Base/make) and use this `make.exe` to replace the one in the `mingw64\bin` subdirectory of the MinGW-builds installation. 6. Run the `msys.bat` installed in Step 4. Set up MSYS by running at the MSYS prompt: mount C:/mingw-builds/x64-4.8.1-win32-seh-rev5/mingw64 /mingw mount C:/Python27 /python export PATH=$PATH:/mingw/bin:/python Replace the directories as appropriate. 7. Download the Julia source repository and build it git clone https://github.com/JuliaLang/julia.git cd julia make *Tips:* - The MSYS build of `make` is fragile and will occasionally corrupt the build process. You can minimize the changes of this occurring by only running `make` in serial, i.e. avoid the `-j` argument. - When the build process fails for no apparent reason, try running `make` again. - Sometimes, `make` will appear to hang, consuming 100% cpu but without apparent progress. If this happens, kill `make` from the Task Manager and try again. - Expect this to take a very long time (dozens of hours is not uncommon). - If `make` fails complaining that `./flisp/flisp` is not found, force `make` to build FemtoLisp before Julia by running `make -C src/flisp && make`. 8. Run Julia with _either_ of: - Using `make` make run-julia (the full syntax is `make run-julia[-release|-debug]`) - Using the Julia executables directly usr/bin/julia ## Cross-compiling If you prefer to cross-compile, the following steps should get you started. Ubuntu and Mac Dependencies (these steps will work for almost any linux platform) First, you will need to ensure your system has the required dependencies. We need wine (>=1.7.5), a system compiler, and some downloaders. On Ubuntu: apt-add-repository ppa:ubuntu-wine/ppa apt-get upate apt-get install wine1.7 subversion cvs gcc wget p7zip-full On Mac: Install XCode, XCode command line tools, X11 (now [XQuartz](http://xquartz.macosforge.org/)), and [MacPorts](http: Then run ```port install wine wget``` or ```brew install wine wget```, as appropriate. On Both: Unfortunately, the version of gcc installed by Ubuntu is currently 4.6, which does not compile OpenBLAS correctly. On Mac, the situation is the same: the version in MacPorts is very old and Homebrew does not have it. So first we need to get a cross-compile version of gcc. Most binary packages appear to not include gfortran, so we will need to compile it from source (or ask @vtjnash to send you a tgz of his build). This is typically quite a bit of work, so we will use [this script](https://code.google.com/p/mingw-w64-dgn/) to make it easy. 1. `svn checkout http://mingw-w64-dgn.googlecode.com/svn/trunk/ mingw-w64-dgn` 2. `cd mingw-w64-dgn` 3. edit `rebuild_cross.sh` and make the following two changes: a. uncomment `export MAKE_OPT="-j 2"`, if appropriate for your machine b. add `fortran` to the end of `--enable-languages=c,c++,objc,obj-c++` 5. `bash update_source.sh` 4. `bash rebuild_cross.sh` 5. `mv cross ~/cross-w64` 6. `export PATH=$HOME/cross-w64/bin:$PATH` # NOTE: it is important that you remember to always do this before using make in the following steps!, you can put this line in your .profile to make it easy Then we can essentially just repeat these steps for the 32-bit compiler, reusing some of the work: 7. `cd ..` 8. `cp -a mingw-w64-dgn mingw-w32-dgn` 9. `cd mingw-w32-dgn` 10. `rm -r cross build` 11. `bash rebuild_cross.sh 32r` 12. `mv cross ~/cross-w32` 13. `export PATH=$HOME/cross-w32/bin:$PATH` # NOTE: it is important that you remember to always do this before using make in the following steps!, you can put this line in your .profile to make it easy Note: for systems that support rpm-based package managers, the OpenSUSE build service appears to contain a fully up-to-date versions of the necessary dependencies. Arch Linux Dependencies 1. Install the following packages from the official Arch repository: `sudo pacman -S cloog gcc-ada libmpc p7zip ppl subversion zlib` 2. The rest of the prerequisites consist of the mingw-w64 packages, which are available in the AUR Arch repository. They must be installed exactly in the order they are given or else their installation will fail. The `yaourt` package manager is used for illustration purposes; you may instead follow the [Arch instructions for installing packages from AUR](https://wiki.archlinux.org/index.php/<API key>#Installing_packages) or may use your preferred package manager. To start with, install `mingw-w64-binutils` via the command `yaourt -S mingw-w64-binutils` 3. `yaourt -S <API key>` 4. `yaourt -S <API key>` 5. `yaourt -S mingw-w64-gcc-base` 6. `yaourt -S mingw-w64-crt-svn` 7. Remove `<API key>` without removing its dependent mingw-w64 installed packages by using the command `yaourt -Rdd <API key>` 8. `yaourt -S <API key>` 9. Remove `mingw-w64-gcc-base` without removing its installed mingw-w64 dependencies: `yaourt -Rdd mingw-w64-gcc-base` 10. Complete the installation of the required `mingw-w64` packages: `yaourt -S mingw-w64-gcc` Cross-building Julia Finally, the build and install process for Julia: 1. `git clone https://github.com/JuliaLang/julia.git julia-win32` 2. `echo override XC_HOST = i686-w64-mingw32 >> Make.user` 3. `make` 4. `make win-extras` (Necessary before running `make dist`p) 5. `make dist` 6. move the julia-* directory / zip file to the target machine If you are building for 64-bit windows, the steps are essentially the same. Just replace i686 in XC_HOST with x86_64. (note: on Mac, wine only runs in 32-bit mode) ## Windows Build Debugging Build process is slow/eats memory/hangs my computer - Disable the Windows [Superfetch](http://en.wikipedia.org/wiki/Windows_Vista_I/O_technologies#SuperFetch) and [Program Compatibility Assistant](http://blogs.msdn.com/b/cjacks/archive/2011/11/22/<API key>.aspx) services, as they are known to have [spurious interactions]((https://cygwin.com/ml/cygwin/2011-12/msg00058.html)) with MinGW/Cygwin. As mentioned in the link above: excessive memory use by `svchost` specifically may be investigated in the Task Manager by clicking on the high-memory `svchost.exe` process and selecting `Go to Services`. Disable child services one-by-one until a culprit is found. - Beware of [BLODA](https://cygwin.com/faq/faq.html#faq.using.bloda) The [vmmap](http://technet.microsoft.com/en-us/sysinternals/dd535533.aspx) tool is indispensable for identifying such software conflicts. Use vmmap to inspect the list of loaded DLLs for bash, mintty, or another persistent process used to drive the build. Essentially *any* DLL outside of the Windows System directory is potential BLODA.
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_191) on Fri Dec 21 13:21:36 PST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Constant Field Values (guacamole-ext 1.0.0 API)</title> <meta name="date" content="2018-12-21"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script type="text/javascript" src="script.js"></script> </head> <body> <script type="text/javascript"><! try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Constant Field Values (guacamole-ext 1.0.0 API)"; } } catch(err) { } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li>Use</li> <li><a href="overview-tree.html">Tree</a></li> <li><a href="deprecated-list.html">Deprecated</a></li> <li><a href="index-all.html">Index</a></li> <li><a href="help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?constant-values.html" target="_top">Frames</a></li> <li><a href="constant-values.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <h1 title="Constant Field Values" class="title">Constant Field Values</h1> <h2 title="Contents">Contents</h2> <ul> <li><a href="#org.apache">org.apache.*</a></li> </ul> </div> <div class="<API key>"><a name="org.apache"> </a> <h2 title="org.apache">org.apache.*</h2> <ul class="blockList"> <li class="blockList"> <table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values"> <caption><span>org.apache.guacamole.form.<a href="org/apache/guacamole/form/DateField.html" title="class in org.apache.guacamole.form">DateField</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th scope="col">Constant Field</th> <th class="colLast" scope="col">Value</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a name="org.apache.guacamole.form.DateField.FORMAT"> </a><code>public&nbsp;static&nbsp;final&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td><code><a href="org/apache/guacamole/form/DateField.html#FORMAT">FORMAT</a></code></td> <td class="colLast"><code>"yyyy-MM-dd"</code></td> </tr> </tbody> </table> </li> <li class="blockList"> <table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values"> <caption><span>org.apache.guacamole.form.<a href="org/apache/guacamole/form/TimeField.html" title="class in org.apache.guacamole.form">TimeField</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th scope="col">Constant Field</th> <th class="colLast" scope="col">Value</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a name="org.apache.guacamole.form.TimeField.FORMAT"> </a><code>public&nbsp;static&nbsp;final&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td><code><a href="org/apache/guacamole/form/TimeField.html#FORMAT">FORMAT</a></code></td> <td class="colLast"><code>"HH:mm:ss"</code></td> </tr> </tbody> </table> </li> </ul> <ul class="blockList"> <li class="blockList"> <table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values"> <caption><span>org.apache.guacamole.net.auth.<a href="org/apache/guacamole/net/auth/AbstractUserContext.html" title="class in org.apache.guacamole.net.auth">AbstractUserContext</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th scope="col">Constant Field</th> <th class="colLast" scope="col">Value</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a name="org.apache.guacamole.net.auth.AbstractUserContext.<API key>"> </a><code>protected&nbsp;static&nbsp;final&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td><code><a href="org/apache/guacamole/net/auth/AbstractUserContext.html#<API key>"><API key></a></code></td> <td class="colLast"><code>"ROOT"</code></td> </tr> </tbody> </table> </li> <li class="blockList"> <table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values"> <caption><span>org.apache.guacamole.net.auth.<a href="org/apache/guacamole/net/auth/AuthenticatedUser.html" title="interface in org.apache.guacamole.net.auth">AuthenticatedUser</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th scope="col">Constant Field</th> <th class="colLast" scope="col">Value</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a name="org.apache.guacamole.net.auth.AuthenticatedUser.<API key>"> </a><code>public&nbsp;static&nbsp;final&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td><code><a href="org/apache/guacamole/net/auth/AuthenticatedUser.html#<API key>"><API key></a></code></td> <td class="colLast"><code>""</code></td> </tr> </tbody> </table> </li> </ul> <ul class="blockList"> <li class="blockList"> <table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values"> <caption><span>org.apache.guacamole.token.<a href="org/apache/guacamole/token/StandardTokens.html" title="class in org.apache.guacamole.token">StandardTokens</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th scope="col">Constant Field</th> <th class="colLast" scope="col">Value</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a name="org.apache.guacamole.token.StandardTokens.<API key>"> </a><code>public&nbsp;static&nbsp;final&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td><code><a href="org/apache/guacamole/token/StandardTokens.html#<API key>"><API key></a></code></td> <td class="colLast"><code>"GUAC_CLIENT_ADDRESS"</code></td> </tr> <tr class="rowColor"> <td class="colFirst"><a name="org.apache.guacamole.token.StandardTokens.<API key>"> </a><code>public&nbsp;static&nbsp;final&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td><code><a href="org/apache/guacamole/token/StandardTokens.html#<API key>"><API key></a></code></td> <td class="colLast"><code>"<API key>"</code></td> </tr> <tr class="altColor"> <td class="colFirst"><a name="org.apache.guacamole.token.StandardTokens.DATE_TOKEN"> </a><code>public&nbsp;static&nbsp;final&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td><code><a href="org/apache/guacamole/token/StandardTokens.html#DATE_TOKEN">DATE_TOKEN</a></code></td> <td class="colLast"><code>"GUAC_DATE"</code></td> </tr> <tr class="rowColor"> <td class="colFirst"><a name="org.apache.guacamole.token.StandardTokens.PASSWORD_TOKEN"> </a><code>public&nbsp;static&nbsp;final&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td><code><a href="org/apache/guacamole/token/StandardTokens.html#PASSWORD_TOKEN">PASSWORD_TOKEN</a></code></td> <td class="colLast"><code>"GUAC_PASSWORD"</code></td> </tr> <tr class="altColor"> <td class="colFirst"><a name="org.apache.guacamole.token.StandardTokens.TIME_TOKEN"> </a><code>public&nbsp;static&nbsp;final&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td><code><a href="org/apache/guacamole/token/StandardTokens.html#TIME_TOKEN">TIME_TOKEN</a></code></td> <td class="colLast"><code>"GUAC_TIME"</code></td> </tr> <tr class="rowColor"> <td class="colFirst"><a name="org.apache.guacamole.token.StandardTokens.USERNAME_TOKEN"> </a><code>public&nbsp;static&nbsp;final&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td><code><a href="org/apache/guacamole/token/StandardTokens.html#USERNAME_TOKEN">USERNAME_TOKEN</a></code></td> <td class="colLast"><code>"GUAC_USERNAME"</code></td> </tr> </tbody> </table> </li> </ul> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li>Use</li> <li><a href="overview-tree.html">Tree</a></li> <li><a href="deprecated-list.html">Deprecated</a></li> <li><a href="index-all.html">Index</a></li> <li><a href="help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?constant-values.html" target="_top">Frames</a></li> <li><a href="constant-values.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.bottom"> </a></div> <p class="legalCopy"><small>Copyright & <!-- Google Analytics --> <script type="text/javascript"> (function(i,s,o,g,r,a,m){i['<API key>']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.<API key>(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script',' ga('create', 'UA-75289145-1', 'auto'); ga('send', 'pageview'); </script> </body> </html>
package cmdserver_test import ( "testing" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) func TestCmdServer(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "CmdServer Suite") }
package com.eas.widgets.containers; import com.eas.core.XElement; import com.google.gwt.dom.client.Style; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.RequiresResize; import com.google.gwt.user.client.ui.Widget; /** * * @author mg */ public class FlowGapPanel extends FlowPanel implements RequiresResize { protected int hgap; protected int vgap; public FlowGapPanel() { super(); getElement().<XElement>cast().<API key>(this); getElement().getStyle().setLineHeight(0, Style.Unit.PX); } public int getHgap() { return hgap; } public void setHgap(int aValue) { hgap = aValue; for (int i = 0; i < getWidgetCount(); i++) { Widget w = getWidget(i); w.getElement().getStyle().setMarginLeft(hgap, Style.Unit.PX); } } public int getVgap() { return vgap; } public void setVgap(int aValue) { vgap = aValue; for (int i = 0; i < getWidgetCount(); i++) { Widget w = getWidget(i); w.getElement().getStyle().setMarginTop(vgap, Style.Unit.PX); } } @Override public void add(Widget w) { w.getElement().getStyle().setMarginLeft(hgap, Style.Unit.PX); w.getElement().getStyle().setMarginTop(vgap, Style.Unit.PX); w.getElement().getStyle().setDisplay(Style.Display.INLINE_BLOCK); w.getElement().getStyle().setVerticalAlign(Style.VerticalAlign.BOTTOM); super.add(w); } @Override public void onResize() { // reserved for future use. } }
package org.cohorte.herald.core.utils; import java.util.Iterator; import org.cohorte.herald.Message; import org.cohorte.herald.MessageReceived; import org.jabsorb.ng.JSONSerializer; import org.jabsorb.ng.serializer.MarshallException; import org.jabsorb.ng.serializer.UnmarshallException; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; public class MessageUtils { /** The Jabsorb serializer */ private static JSONSerializer pSerializer = new JSONSerializer(); static { try { pSerializer.<API key>(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static String toJSON(Message aMsg) throws MarshallException { JSONObject json = new JSONObject(); try { // headers JSONObject headers = new JSONObject(); for (String key : aMsg.getHeaders().keySet()) { headers.put(key, aMsg.getHeaders().get(key)); } json.put(Message.MESSAGE_HEADERS, headers); // subject json.put(Message.MESSAGE_SUBJECT, aMsg.getSubject()); // content if (aMsg.getContent() != null) { if (aMsg.getContent() instanceof String) { json.put(Message.MESSAGE_CONTENT, aMsg.getContent()); } else { JSONObject content = new JSONObject(pSerializer.toJSON(aMsg.getContent())); json.put(Message.MESSAGE_CONTENT, content); } } // metadata JSONObject metadata = new JSONObject(); for (String key : aMsg.getMetadata().keySet()) { metadata.put(key, aMsg.getMetadata().get(key)); } json.put(Message.MESSAGE_METADATA, metadata); } catch (JSONException e) { e.printStackTrace(); return null; } return json.toString(); } @SuppressWarnings("unchecked") public static MessageReceived fromJSON(String json) throws UnmarshallException { try { JSONObject wParsedMsg = new JSONObject(json); { try { // check if valid herald message (respects herald specification version) int heraldVersion = -1; JSONObject jHeader = wParsedMsg.getJSONObject(Message.MESSAGE_HEADERS); if (jHeader != null) { if (jHeader.has(Message.<API key>)) { heraldVersion = jHeader.getInt(Message.<API key>); } } if (heraldVersion != Message.<API key>) { throw new JSONException("Herald specification of the received message is not supported!"); } MessageReceived wMsg = new MessageReceived( wParsedMsg.getJSONObject(Message.MESSAGE_HEADERS).getString(Message.MESSAGE_HEADER_UID), wParsedMsg.getString(Message.MESSAGE_SUBJECT), null, null, null, null, null, null); // content Object cont = wParsedMsg.opt(Message.MESSAGE_CONTENT); if (cont != null) { if (cont instanceof JSONObject || cont instanceof JSONArray) { wMsg.setContent(pSerializer.fromJSON(cont.toString())); } else wMsg.setContent(cont); } else { wMsg.setContent(null); } // headers Iterator<String> wKeys; if (wParsedMsg.getJSONObject(Message.MESSAGE_HEADERS) != null) { wKeys = wParsedMsg.getJSONObject(Message.MESSAGE_HEADERS).keys(); while(wKeys.hasNext()) { String key = wKeys.next(); wMsg.addHeader(key, wParsedMsg.getJSONObject(Message.MESSAGE_HEADERS).get(key)); } } // metadata Iterator<String> wKeys2; if (wParsedMsg.getJSONObject(Message.MESSAGE_METADATA) != null) { wKeys2 = wParsedMsg.getJSONObject(Message.MESSAGE_METADATA).keys(); while(wKeys2.hasNext()) { String key = wKeys2.next(); wMsg.addMetadata(key, wParsedMsg.getJSONObject(Message.MESSAGE_METADATA).get(key)); } } return wMsg; } catch (JSONException e) { e.printStackTrace(); return null; } } } catch (Exception e) { e.printStackTrace(); return null; } } }
package org.apache.cocoon.transformation; import java.io.<API key>; import java.io.File; import java.io.FileOutputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.OutputStream; import java.util.Map; import java.util.zip.ZipInputStream; import java.util.zip.ZipEntry; import org.apache.avalon.framework.parameters.Parameters; import org.apache.cocoon.ProcessingException; import org.apache.cocoon.environment.SourceResolver; import org.apache.commons.httpclient.HostConfiguration; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpMethod; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.IOUtils; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; public class DownloadTransformer extends <API key> { public static final String DOWNLOAD_NS = "http://apache.org/cocoon/download/1.0"; public static final String DOWNLOAD_ELEMENT = "download"; private static final String DOWNLOAD_PREFIX = "download"; public static final String RESULT_ELEMENT = "result"; public static final String ERROR_ELEMENT = "error"; public static final String SRC_ATTRIBUTE = "src"; public static final String TARGET_ATTRIBUTE = "target"; public static final String TARGETDIR_ATTRIBUTE = "target-dir"; public static final String UNZIP_ATTRIBUTE = "unzip"; public static final String <API key> = "recursive-unzip"; public static final String UNZIPPED_ATTRIBUTE = "unzipped"; public DownloadTransformer() { this.defaultNamespaceURI = DOWNLOAD_NS; } @Override public void setup(SourceResolver resolver, Map objectModel, String src, Parameters params) throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, params); } @Override public void <API key>(String uri, String localName, String qName, Attributes attributes) throws SAXException, ProcessingException, IOException { if (DOWNLOAD_NS.equals(uri) && DOWNLOAD_ELEMENT.equals(localName)) { try { File[] downloadResult = download( attributes.getValue(SRC_ATTRIBUTE), attributes.getValue(TARGETDIR_ATTRIBUTE), attributes.getValue(TARGET_ATTRIBUTE), attributes.getValue(UNZIP_ATTRIBUTE), attributes.getValue(<API key>) ); File downloadedFile = downloadResult[0]; File unzipDir = downloadResult[1]; String absPath = downloadedFile.getCanonicalPath(); AttributesImpl attrsImpl = new AttributesImpl(); if (unzipDir != null) { attrsImpl.addAttribute("", UNZIPPED_ATTRIBUTE, UNZIPPED_ATTRIBUTE, "CDATA", unzipDir.getAbsolutePath()); } xmlConsumer.startElement(uri, RESULT_ELEMENT, String.format("%s:%s", DOWNLOAD_PREFIX, RESULT_ELEMENT), attrsImpl); xmlConsumer.characters(absPath.toCharArray(), 0, absPath.length()); xmlConsumer.endElement(uri, RESULT_ELEMENT, String.format("%s:%s", DOWNLOAD_PREFIX, RESULT_ELEMENT)); } catch (Exception e) { // throw new SAXException("Error downloading file", e); xmlConsumer.startElement(uri, ERROR_ELEMENT, qName, attributes); String message = e.getMessage(); xmlConsumer.characters(message.toCharArray(), 0, message.length()); xmlConsumer.endElement(uri, ERROR_ELEMENT, qName); } } else { super.<API key>(uri, localName, qName, attributes); } } @Override public void <API key>(String uri, String localName, String qName) throws SAXException, ProcessingException, IOException { if (DOWNLOAD_NS.equals(namespaceURI) && DOWNLOAD_ELEMENT.equals(localName)) { return; } super.<API key>(uri, localName, qName); } private File[] download(String sourceUri, String targetDir, String target, String unzip, String recursiveUnzip) throws ProcessingException, IOException, SAXException { File targetFile; File unZipped = null; if (null != target && !target.equals("")) { targetFile = new File(target); } else if (null != targetDir && !targetDir.equals("")) { targetFile = new File(targetDir); } else { String baseName = FilenameUtils.getBaseName(sourceUri); String extension = FilenameUtils.getExtension(sourceUri); targetFile = File.createTempFile(baseName, "." + extension); } if (!targetFile.getParentFile().exists()) { targetFile.getParentFile().mkdirs(); } boolean unzipFile = (null != unzip && unzip.equals("true")) || (null != recursiveUnzip && recursiveUnzip.equals("true")); String absPath = targetFile.getAbsolutePath(); String unzipDir = unzipFile ? FilenameUtils.removeExtension(absPath) : ""; HttpClient httpClient = new HttpClient(); httpClient.<API key>(60000); httpClient.setTimeout(60000); if (System.getProperty("http.proxyHost") != null) { // getLogger().warn("PROXY: "+System.getProperty("http.proxyHost")); String nonProxyHostsRE = System.getProperty("http.nonProxyHosts", ""); if (nonProxyHostsRE.length() > 0) { String[] pHosts = nonProxyHostsRE.replaceAll("\\.", "\\\\.").replaceAll("\\*", ".*").split("\\|"); nonProxyHostsRE = ""; for (String pHost : pHosts) { nonProxyHostsRE += "|(^https?://" + pHost + ".*$)"; } nonProxyHostsRE = nonProxyHostsRE.substring(1); } if (nonProxyHostsRE.length() == 0 || !sourceUri.matches(nonProxyHostsRE)) { try { HostConfiguration hostConfiguration = httpClient.<API key>(); hostConfiguration.setProxy(System.getProperty("http.proxyHost"), Integer.parseInt(System.getProperty("http.proxyPort", "80"))); httpClient.<API key>(hostConfiguration); } catch (Exception e) { throw new ProcessingException("Cannot set proxy!", e); } } } HttpMethod httpMethod = new GetMethod(sourceUri); try { int responseCode = httpClient.executeMethod(httpMethod); if (responseCode < 200 || responseCode >= 300) { throw new ProcessingException(String.format("Received HTTP status code %d (%s)", responseCode, httpMethod.getStatusText())); } OutputStream os = new <API key>(new FileOutputStream(targetFile)); try { IOUtils.copyLarge(httpMethod.<API key>(), os); } finally { os.close(); } } finally { httpMethod.releaseConnection(); } if (!"".equals(unzipDir)) { unZipped = unZipIt(targetFile, unzipDir, recursiveUnzip); } return new File[] {targetFile, unZipped}; } /** * Unzip it * @param zipFile input zip file * @param outputFolder zip file output folder */ private File unZipIt(File zipFile, String outputFolder, String recursiveUnzip){ byte[] buffer = new byte[4096]; File folder = null; try{ //create output directory is not exists folder = new File(outputFolder); if (!folder.exists()){ folder.mkdir(); } //get the zipped file list entry try ( //get the zip file content ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFile))) { //get the zipped file list entry ZipEntry ze = zis.getNextEntry(); while(ze != null){ String fileName = ze.getName(); File newFile = new File(outputFolder + File.separator + fileName); // System.out.println("file unzip : "+ newFile.getAbsoluteFile()); // create all non existing folders // else you will hit <API key> for compressed folder new File(newFile.getParent()).mkdirs(); try (FileOutputStream fos = new FileOutputStream(newFile)) { int len; while ((len = zis.read(buffer)) > 0) { fos.write(buffer, 0, len); } } if ((null != recursiveUnzip && "true".equals(recursiveUnzip)) && FilenameUtils.getExtension(fileName).equals("zip")) { unZipIt(newFile, FilenameUtils.concat(outputFolder, FilenameUtils.getBaseName(fileName)), recursiveUnzip); } ze = zis.getNextEntry(); } zis.closeEntry(); } // System.out.println("Done unzipping."); } catch(IOException ex){ ex.printStackTrace(); } return folder; } }
package droidkit.app; import android.content.Intent; import android.net.Uri; import android.support.annotation.NonNull; import java.util.Locale; /** * @author Daniel Serdyukov */ public final class MapsIntent { private static final String MAPS_URL = "https://maps.google.com/maps"; private MapsIntent() { } @NonNull public static Intent openMaps() { return new Intent(Intent.ACTION_VIEW, Uri.parse(MAPS_URL)); } @NonNull public static Intent openMaps(double lat, double lng) { return new Intent(Intent.ACTION_VIEW, Uri.parse(String.format(Locale.US, MAPS_URL + "?q=%f,%f", lat, lng))); } @NonNull public static Intent route(double lat, double lng) { return new Intent(Intent.ACTION_VIEW, Uri.parse(String.format(Locale.US, MAPS_URL + "?daddr=%f,%f", lat, lng))); } @NonNull public static Intent route(double fromLat, double fromLng, double toLat, double toLng) { return new Intent(Intent.ACTION_VIEW, Uri.parse(String.format(Locale.US, MAPS_URL + "?saddr=%f,%f&daddr=%f,%f", fromLat, fromLng, toLat, toLng))); } @NonNull public static Intent search(@NonNull String query) { return new Intent(Intent.ACTION_VIEW, Uri.parse(MAPS_URL + "?q=" + query)); } }
'use strict'; var nconf = require('nconf'); var path = require('path'); /** * Handle the configuration management. * * @constructor */ function Config() { nconf.argv().env("_"); var environment = nconf.get("NODE:ENV") || "development"; nconf.file(environment, {file: path.resolve(__dirname, '../config/' + environment + '.json')}); nconf.file('default', {file: path.resolve(__dirname, '../config/default.json')}); } /** * Return the value of the provided key from the configuration object. * * @param {string} key - Key from the configuration object. */ Config.prototype.get = function (key) { return nconf.get(key); }; module.exports = new Config();
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */ #include <gecode/int/element.hh> namespace Gecode { using namespace Int; void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntConLevel) { if (c.size() == 0) throw TooFewArguments("Int::element"); if (home.failed()) return; for (int i = c.size(); i Limits::check(c[i],"Int::element"); GECODE_ES_FAIL((Element::post_int<IntView,IntView>(home,c,x0,x1))); } void element(Home home, IntSharedArray c, IntVar x0, BoolVar x1, IntConLevel) { if (c.size() == 0) throw TooFewArguments("Int::element"); if (home.failed()) return; for (int i = c.size(); i Limits::check(c[i],"Int::element"); GECODE_ES_FAIL((Element::post_int<IntView,BoolView>(home,c,x0,x1))); } void element(Home home, IntSharedArray c, IntVar x0, int x1, IntConLevel) { if (c.size() == 0) throw TooFewArguments("Int::element"); Limits::check(x1,"Int::element"); if (home.failed()) return; for (int i = c.size(); i Limits::check(c[i],"Int::element"); ConstIntView cx1(x1); GECODE_ES_FAIL( (Element::post_int<IntView,ConstIntView>(home,c,x0,cx1))); } void element(Home home, const IntVarArgs& c, IntVar x0, IntVar x1, IntConLevel icl) { if (c.size() == 0) throw TooFewArguments("Int::element"); if (home.failed()) return; Element::IdxViewArray<IntView> iv(home,c); if ((icl == ICL_DOM) || (icl == ICL_DEF)) { GECODE_ES_FAIL((Element::ViewDom<IntView,IntView,IntView> ::post(home,iv,x0,x1))); } else { GECODE_ES_FAIL((Element::ViewBnd<IntView,IntView,IntView> ::post(home,iv,x0,x1))); } } void element(Home home, const IntVarArgs& c, IntVar x0, int x1, IntConLevel icl) { if (c.size() == 0) throw TooFewArguments("Int::element"); Limits::check(x1,"Int::element"); if (home.failed()) return; Element::IdxViewArray<IntView> iv(home,c); ConstIntView v1(x1); if ((icl == ICL_DOM) || (icl == ICL_DEF)) { GECODE_ES_FAIL((Element::ViewDom<IntView,IntView,ConstIntView> ::post(home,iv,x0,v1))); } else { GECODE_ES_FAIL((Element::ViewBnd<IntView,IntView,ConstIntView> ::post(home,iv,x0,v1))); } } void element(Home home, const BoolVarArgs& c, IntVar x0, BoolVar x1, IntConLevel) { if (c.size() == 0) throw TooFewArguments("Int::element"); if (home.failed()) return; Element::IdxViewArray<BoolView> iv(home,c); GECODE_ES_FAIL((Element::ViewBnd<BoolView,IntView,BoolView> ::post(home,iv,x0,x1))); } void element(Home home, const BoolVarArgs& c, IntVar x0, int x1, IntConLevel) { if (c.size() == 0) throw TooFewArguments("Int::element"); Limits::check(x1,"Int::element"); if (home.failed()) return; Element::IdxViewArray<BoolView> iv(home,c); ConstIntView v1(x1); GECODE_ES_FAIL((Element::ViewBnd<BoolView,IntView,ConstIntView> ::post(home,iv,x0,v1))); } namespace { IntVar pair(Home home, IntVar x, int w, IntVar y, int h) { IntVar xy(home,0,w*h-1); if (Element::Pair::post(home,x,y,xy,w,h) != ES_OK) home.fail(); return xy; } } void element(Home home, IntSharedArray a, IntVar x, int w, IntVar y, int h, IntVar z, IntConLevel icl) { if (a.size() != w*h) throw Int::<API key>("Int::element"); if (home.failed()) return; element(home, a, pair(home,x,w,y,h), z, icl); } void element(Home home, IntSharedArray a, IntVar x, int w, IntVar y, int h, BoolVar z, IntConLevel icl) { if (a.size() != w*h) throw Int::<API key>("Int::element"); if (home.failed()) return; element(home, a, pair(home,x,w,y,h), z, icl); } void element(Home home, const IntVarArgs& a, IntVar x, int w, IntVar y, int h, IntVar z, IntConLevel icl) { if (a.size() != w*h) throw Int::<API key>("Int::element"); if (home.failed()) return; element(home, a, pair(home,x,w,y,h), z, icl); } void element(Home home, const BoolVarArgs& a, IntVar x, int w, IntVar y, int h, BoolVar z, IntConLevel icl) { if (a.size() != w*h) throw Int::<API key>("Int::element"); if (home.failed()) return; element(home, a, pair(home,x,w,y,h), z, icl); } } // STATISTICS: int-post
let hookTypes; const callStyles = { sync: 'applyPlugins', syncWaterfall: '<API key>', syncBail: '<API key>', sync_map: 'applyPlugins', asyncWaterfall: '<API key>', asyncParallel: '<API key>', asyncSerial: 'applyPluginsAsync', }; const camelToDash = camel => camel.replace(/_/g, '--').replace(/[A-Z]/g, c => `-${c.toLowerCase()}`); const <API key> = { Compilation: { needAdditionalPass: ['sync', []], succeedModule: ['sync', ['module']], buildModule: ['sync', ['module']], seal: ['sync', []], }, Compiler: { afterCompile: ['asyncSerial', ['compilation']], afterEnvironment: ['sync', []], afterPlugins: ['sync', []], afterResolvers: ['sync', []], compilation: ['sync', ['compilation', 'params']], emit: ['asyncSerial', ['compilation']], make: ['asyncParallel', ['compilation']], watchRun: ['asyncSerial', ['watcher']], run: ['asyncSerial', ['compiler']], }, NormalModuleFactory: { createModule: ['syncBail', ['data']], parser: ['sync_map', ['parser', 'parserOptions']], resolver: ['syncWaterfall', ['nextResolver']], }, <API key>: { afterResolve: ['asyncWaterfall', ['data']], }, }; exports.register = (tapable, name, style, args) => { if (tapable.hooks) { if (!hookTypes) { const Tapable = require('tapable'); hookTypes = { sync: Tapable.SyncHook, syncWaterfall: Tapable.SyncWaterfallHook, syncBail: Tapable.SyncBailHook, asyncWaterfall: Tapable.AsyncWaterfallHook, asyncParallel: Tapable.AsyncParallelHook, asyncSerial: Tapable.AsyncSeriesHook, asyncSeries: Tapable.AsyncSeriesHook, }; } if (!tapable.hooks[name]) { tapable.hooks[name] = new hookTypes[style](args); } } else { if (!tapable.__hardSource_hooks) { tapable.__hardSource_hooks = {}; } if (!tapable.__hardSource_hooks[name]) { tapable.__hardSource_hooks[name] = { name, dashName: camelToDash(name), style, args, async: style.startsWith('async'), map: style.endsWith('_map'), }; } if (!tapable.__hardSource_proxy) { tapable.__hardSource_proxy = {}; } if (!tapable.__hardSource_proxy[name]) { if (tapable.__hardSource_hooks[name].map) { const _forCache = {}; tapable.__hardSource_proxy[name] = { _forCache, for: key => { let hook = _forCache[key]; if (hook) { return hook; } _forCache[key] = { tap: (...args) => exports.tapFor(tapable, name, key, ...args), tapPromise: (...args) => exports.tapPromiseFor(tapable, name, key, ...args), call: (...args) => exports.callFor(tapable, name, key, ...args), promise: (...args) => exports.promiseFor(tapable, name, key, ...args), }; return _forCache[key]; }, tap: (...args) => exports.tapFor(tapable, name, ...args), tapPromise: (...args) => exports.tapPromiseFor(tapable, name, ...args), call: (...args) => exports.callFor(tapable, name, ...args), promise: (...args) => exports.promiseFor(tapable, name, ...args), }; } else { tapable.__hardSource_proxy[name] = { tap: (...args) => exports.tap(tapable, name, ...args), tapPromise: (...args) => exports.tapPromise(tapable, name, ...args), call: (...args) => exports.call(tapable, name, args), promise: (...args) => exports.promise(tapable, name, args), }; } } } }; exports.tap = (tapable, name, reason, callback) => { if (tapable.hooks) { tapable.hooks[name].tap(reason, callback); } else { if (!tapable.__hardSource_hooks || !tapable.__hardSource_hooks[name]) { const registration = <API key>[tapable.constructor.name][name]; exports.register(tapable, name, registration[0], registration[1]); } const dashName = tapable.__hardSource_hooks[name].dashName; if (tapable.__hardSource_hooks[name].async) { tapable.plugin(dashName, (...args) => { const cb = args.pop(); cb(null, callback(...args)); }); } else { tapable.plugin(dashName, callback); } } }; exports.tapPromise = (tapable, name, reason, callback) => { if (tapable.hooks) { tapable.hooks[name].tapPromise(reason, callback); } else { if (!tapable.__hardSource_hooks || !tapable.__hardSource_hooks[name]) { const registration = <API key>[tapable.constructor.name][name]; exports.register(tapable, name, registration[0], registration[1]); } const dashName = tapable.__hardSource_hooks[name].dashName; tapable.plugin(dashName, (...args) => { const cb = args.pop(); return callback(...args).then(value => cb(null, value), cb); }); } }; exports.tapAsync = (tapable, name, reason, callback) => { if (tapable.hooks) { tapable.hooks[name].tapAsync(reason, callback); } else { if (!tapable.__hardSource_hooks || !tapable.__hardSource_hooks[name]) { const registration = <API key>[tapable.constructor.name][name]; exports.register(tapable, name, registration[0], registration[1]); } const dashName = tapable.__hardSource_hooks[name].dashName; tapable.plugin(dashName, callback); } }; exports.call = (tapable, name, args) => { if (tapable.hooks) { const hook = tapable.hooks[name]; return hook.call(...args); } else { const dashName = tapable.__hardSource_hooks[name].dashName; const style = tapable.__hardSource_hooks[name].style; return tapable[callStyles[style]](...[dashName].concat(args)); } }; exports.promise = (tapable, name, args) => { if (tapable.hooks) { const hook = tapable.hooks[name]; return hook.promise(...args); } else { const dashName = tapable.__hardSource_hooks[name].dashName; const style = tapable.__hardSource_hooks[name].style; return new Promise((resolve, reject) => { tapable[callStyles[style]]( [dashName].concat(args, (err, value) => { if (err) { reject(err); } else { resolve(value); } }), ); }); } }; exports.tapFor = (tapable, name, key, reason, callback) => { if (tapable.hooks) { tapable.hooks[name].for(key).tap(reason, callback); } else { exports.tap(tapable, name, reason, callback); } }; exports.tapPromiseFor = (tapable, name, key, reason, callback) => { if (tapable.hooks) { tapable.hooks[name].for(key).tapPromise(reason, callback); } else { exports.tapPromise(tapable, name, reason, callback); } }; exports.callFor = (tapable, name, key, args) => { if (tapable.hooks) { tapable.hooks[name].for(key).call(...args); } else { exports.call(tapable, name, args); } }; exports.promiseFor = (tapable, name, key, args) => { if (tapable.hooks) { tapable.hooks[name].for(key).promise(...args); } else { exports.promise(tapable, name, args); } }; exports.hooks = tapable => { if (tapable.hooks) { return tapable.hooks; } if (!tapable.__hardSource_proxy) { tapable.__hardSource_proxy = {}; } const registrations = <API key>[tapable.constructor.name]; if (registrations) { for (const name in registrations) { const registration = registrations[name]; exports.register(tapable, name, registration[0], registration[1]); } } return tapable.__hardSource_proxy; };
/* socket.c Created: Feb 2001 by Philip Homburg <philip@f-mnx.phicoh.com> Open a TCP connection */ #define _POSIX_C_SOURCE 2 #include <errno.h> #include <fcntl.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <signal.h> #include <string.h> #include <unistd.h> #include <sys/ioctl.h> #include <sys/wait.h> #include <net/hton.h> #include <net/netlib.h> #include <net/gen/in.h> #include <net/gen/inet.h> #include <netdb.h> #include <net/gen/socket.h> #include <net/gen/tcp.h> #include <net/gen/tcp_io.h> #define BUF_SIZE 10240 char *progname; int tcpfd= -1; char buf[BUF_SIZE]; static int bulk= 0; static int push= 0; static int stdout_issocket= 0; static int timeout; static void do_conn(char *hostname, char *portname); static void alrm_conn(int sig); static void alrm_io(int sig); static void fullduplex(void); static void fatal(char *msg, ...); static void usage(void); int main(int argc, char *argv[]) { int c; char *hostname; char *portname; char *check; int B_flag, P_flag, s_flag; char *t_arg; (progname=strrchr(argv[0],'/')) ? progname++ : (progname=argv[0]); B_flag= 0; P_flag= 0; s_flag= 0; t_arg= NULL; while (c= getopt(argc, argv, "BPst:?"), c != -1) { switch(c) { case 'B': B_flag= 1; break; case 'P': P_flag= 1; break; case 's': s_flag= 1; break; case 't': t_arg= optarg; break; case '?': usage(); default: fatal("getopt failed: '%c'", c); } } if (t_arg) { timeout= strtol(t_arg, &check, 0); if (check[0] != '\0') fatal("unable to parse timeout '%s'\n", t_arg); if (timeout <= 0) fatal("bad timeout '%d'\n", timeout); } else timeout= 0; if (optind+2 != argc) usage(); hostname= argv[optind++]; portname= argv[optind++]; bulk= B_flag; push= P_flag; stdout_issocket= s_flag; do_conn(hostname, portname); /* XXX */ if (timeout) { signal(SIGALRM, alrm_io); alarm(timeout); } fullduplex(); exit(0); } static void do_conn(char *hostname, char *portname) { ipaddr_t addr; tcpport_t port; struct hostent *he; struct servent *se; char *tcp_device, *check; nwio_tcpconf_t tcpconf; nwio_tcpcl_t tcpcl; nwio_tcpopt_t tcpopt; if (!inet_aton(hostname, &addr)) { he= gethostbyname(hostname); if (he == NULL) fatal("unknown hostname '%s'", hostname); if (he->h_addrtype != AF_INET || he->h_length != sizeof(addr)) fatal("bad address for '%s'", hostname); memcpy(&addr, he->h_addr, sizeof(addr)); } port= strtol(portname, &check, 0); if (check[0] != 0) { se= getservbyname(portname, "tcp"); if (se == NULL) fatal("unkown port '%s'", portname); port= ntohs(se->s_port); } tcp_device= getenv("TCP_DEVICE"); if (tcp_device == NULL) tcp_device= TCP_DEVICE; tcpfd= open(tcp_device, O_RDWR); if (tcpfd == -1) fatal("unable to open '%s': %s", tcp_device, strerror(errno)); tcpconf.nwtc_flags= NWTC_EXCL | NWTC_LP_SEL | NWTC_SET_RA | NWTC_SET_RP; tcpconf.nwtc_remaddr= addr; tcpconf.nwtc_remport= htons(port);; if (ioctl(tcpfd, NWIOSTCPCONF, &tcpconf) == -1) fatal("NWIOSTCPCONF failed: %s", strerror(errno)); if (timeout) { signal(SIGALRM, alrm_conn); alarm(timeout); } tcpcl.nwtcl_flags= 0; if (ioctl(tcpfd, NWIOTCPCONN, &tcpcl) == -1) { fatal("unable to connect to %s:%u: %s", inet_ntoa(addr), ntohs(tcpconf.nwtc_remport), strerror(errno)); } alarm(0); if (bulk) { tcpopt.nwto_flags= NWTO_BULK; if (ioctl(tcpfd, NWIOSTCPOPT, &tcpopt) == -1) fatal("NWIOSTCPOPT failed: %s", strerror(errno)); } } static void alrm_conn(int sig) { fatal("timeout during connect"); } static void alrm_io(int sig) { fatal("timeout during io"); } static void fullduplex(void) { pid_t cpid; int o, r, s, s_errno, loc; cpid= fork(); switch(cpid) { case -1: fatal("fork failed: %s", strerror(errno)); case 0: /* Read from TCP, write to stdout. */ for (;;) { r= read(tcpfd, buf, BUF_SIZE); if (r == 0) break; if (r == -1) { r= errno; if (stdout_issocket) ioctl(1, NWIOTCPSHUTDOWN, NULL); fatal("error reading from TCP conn.: %s", strerror(errno)); } s= r; for (o= 0; o<s; o += r) { r= write(1, buf+o, s-o); if (r <= 0) { fatal("error writing to stdout: %s", r == 0 ? "EOF" : strerror(errno)); } } } if (stdout_issocket) { r= ioctl(1, NWIOTCPSHUTDOWN, NULL); if (r == -1) { fatal("NWIOTCPSHUTDOWN failed on stdout: %s", strerror(errno)); } } exit(0); default: break; } /* Read from stdin, write to TCP. */ for (;;) { r= read(0, buf, BUF_SIZE); if (r == 0) break; if (r == -1) { s_errno= errno; kill(cpid, SIGTERM); fatal("error reading from stdin: %s", strerror(s_errno)); } s= r; for (o= 0; o<s; o += r) { r= write(tcpfd, buf+o, s-o); if (r <= 0) { s_errno= errno; kill(cpid, SIGTERM); fatal("error writing to TCP conn.: %s", r == 0 ? "EOF" : strerror(s_errno)); } } if (push) ioctl(tcpfd, NWIOTCPPUSH, NULL); } if (ioctl(tcpfd, NWIOTCPSHUTDOWN, NULL) == -1) { s_errno= errno; kill(cpid, SIGTERM); fatal("unable to shut down TCP conn.: %s", strerror(s_errno)); } r= waitpid(cpid, &loc, 0); if (r == -1) { s_errno= errno; kill(cpid, SIGTERM); fatal("waitpid failed: %s", strerror(s_errno)); } if (WIFEXITED(loc)) exit(WEXITSTATUS(loc)); kill(getpid(), WTERMSIG(loc)); exit(1); } static void fatal(char *fmt, ...) { va_list ap; va_start(ap, fmt); fprintf(stderr, "%s: ", progname); vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); va_end(ap); exit(1); } static void usage(void) { fprintf(stderr, "Usage: %s [-BPs] [-t timeout] hostname portname\n", progname); exit(1); } /* * $PchId: socket.c,v 1.3 2005/01/31 22:33:20 philip Exp $ */
package sbt package internal package parser import java.io.File import scala.io.Source object NewFormatSpec extends AbstractSpec { implicit val splitter: SplitExpressions.SplitExpression = <API key>.splitExpressions test("New Format should handle lines") { val rootPath = getClass.getResource("/new-format").getPath println(s"Reading files from: $rootPath") val allFiles = new File(rootPath).listFiles.toList allFiles foreach { path => println(s"$path") val lines = Source.fromFile(path).getLines().toList val (_, statements) = splitter(path, lines) } } }