answer
stringlengths
15
1.25M
package issues.issue130; public class Impl_0 { public int a = 0; protected void printMe(String s) { System.out.println(s); } }
/** * Wraps the * * @param text * {string} haystack to search through * @param search * {string} needle to search for * @param [caseSensitive] * {boolean} optional boolean to use case-sensitive searching */ angular.module('ui.highlight', []).filter('highlight', function(highlight) { return function(text, search, caseSensitive) { if (search || angular.isNumber(search)) { var ltext = text.toString(); var lsearch = search.toString(); if (caseSensitive) { return ltext.split(lsearch).join('<span class="ui-match">' + lsearch + '</span>'); } else { return ltext.replace(new RegExp(lsearch, 'gi'), '<span class="ui-match">$&</span>'); } } else { return text; } }; });
FROM ubuntu:18.04 LABEL maintainer="chriamue@gmail.com" RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential clang git cmake \ qt5-default qttools5-dev qttools5-dev-tools libboost-system-dev <API key> libboost-python-dev python-numpy \ libopencv-dev libpoco-dev libdlib-dev RUN cd / && git clone https://github.com/annotatorproject/annotatorlib RUN cd /annotatorlib && mkdir build && cd build \ && cmake -DCMAKE_BUILD_TYPE=Release .. \ && make -j3 && make install && ldconfig \ && ln -s /usr/local/lib/pyannotatorlib.so /usr/lib/python2.7/pyannotatorlib.so RUN cd /annotatorlib/source/imagesets && git clone https://github.com/annotatorproject/<API key> \ && cd ../../build && cmake .. && make -j3 && make install && ldconfig
package at.jku.sea.cloud.rest.pojo.stream.provider; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; import com.fasterxml.jackson.annotation.JsonTypeName; import at.jku.sea.cloud.rest.pojo.<API key>; @JsonTypeInfo(use = Id.NAME, property = "__type") @JsonTypeName(value = "<API key>") public class <API key> extends PojoProvider { private <API key> collectionArtifact; public <API key>() { } public <API key>(<API key> collectionArtifact) { this.collectionArtifact = collectionArtifact; } public <API key> <API key>() { return collectionArtifact; } public void <API key>(<API key> collectionArtifact) { this.collectionArtifact = collectionArtifact; } }
package com.sebastian_daschner.<API key>.beans.boundary; import javax.inject.Inject; import javax.json.Json; import javax.json.JsonObject; import javax.json.JsonObjectBuilder; import javax.ws.rs.BadRequestException; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; @Path("beans") public class BeansResource { @Inject BeanCommandService commandService; @Inject BeanQueryService queryService; @GET public JsonObject getBeans() { final JsonObjectBuilder builder = Json.createObjectBuilder(); queryService.getStoredBeans() .entrySet().forEach(e -> builder.add(e.getKey(), e.getValue())); return builder.build(); } @POST public void storeBeans(JsonObject object) { final String beanOrigin = object.getString("beanOrigin", null); final int amount = object.getInt("amount", 0); if (beanOrigin == null || amount == 0) throw new BadRequestException(); commandService.storeBeans(beanOrigin, amount); } }
#!/bin/bash -e # Shutdown script for Datafari if (( EUID != 0 )); then echo "You need to be root to run this script." 1>&2 exit 100 fi DIR=../../../macosx/bin source "<API key>.sh" source "${DIR}/utils.sh" if is_running $SOLR_PID_FILE; then SOLR_INCLUDE=$SOLR_ENV $SOLR_INSTALL_DIR/bin/solr stop else echo "Warn : Solr does not seem to be running." fi if is_running $CASSANDRA_PID_FILE; then kill $(cat $CASSANDRA_PID_FILE) rm $CASSANDRA_PID_FILE else echo "Warn : Cassandra does not seem to be running." fi
package com.intellij.execution.configurations; import com.intellij.execution.ExecutionBundle; import com.intellij.openapi.options.<API key>; import com.intellij.openapi.progress.<API key>; import com.intellij.openapi.ui.ValidationInfo; import com.intellij.openapi.util.NlsContexts.DialogMessage; import com.intellij.util.ThrowableRunnable; import javax.swing.*; import static com.intellij.openapi.util.NlsContexts.DialogTitle; public class <API key> extends <API key> { public <API key>(@DialogMessage String message, @DialogTitle String title) { super(message, title); } public <API key>(@DialogMessage String message) { super(message, ExecutionBundle.message("run.configuration.error.dialog.title")); } public <API key>(@DialogMessage String message, Throwable cause) { super(message, cause, ExecutionBundle.message("run.configuration.error.dialog.title")); } public static <T extends Throwable> ValidationInfo validate(JComponent component, ThrowableRunnable<T> runnable) { try { runnable.run(); return new ValidationInfo("", component); } catch (<API key> e) { throw e; } catch (Throwable t) { return new ValidationInfo(t.getMessage(), component); } } }
package org.jboss.resteasy.client.core; import org.jboss.resteasy.client.ClientExecutor; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.client.ProxyConfig; import org.jboss.resteasy.client.core.extractors.ClientErrorHandler; import org.jboss.resteasy.client.core.extractors.<API key>; import org.jboss.resteasy.client.core.extractors.EntityExtractor; import org.jboss.resteasy.client.core.extractors.<API key>; import org.jboss.resteasy.client.core.marshallers.<API key>; import org.jboss.resteasy.client.core.marshallers.Marshaller; import org.jboss.resteasy.client.exception.mapper.<API key>; import org.jboss.resteasy.resteasy_jaxrs.i18n.Messages; import org.jboss.resteasy.specimpl.ResteasyUriBuilder; import org.jboss.resteasy.spi.<API key>; import org.jboss.resteasy.util.MediaTypeHelper; import javax.ws.rs.Path; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import javax.ws.rs.ext.Providers; import java.lang.reflect.Method; import java.net.URI; import java.util.HashMap; import java.util.Map; /** * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a> * @version $Revision: 1 $ */ @SuppressWarnings("unchecked") public class ClientInvoker extends <API key> implements MethodInvoker { protected <API key> providerFactory; protected String httpMethod; protected ResteasyUriBuilder uri; protected Method method; protected Class declaring; protected MediaType accepts; protected Marshaller[] marshallers; protected ClientExecutor executor; protected boolean followRedirects; protected EntityExtractor extractor; protected <API key> extractorFactory; protected URI baseUri; protected Map<String, Object> attributes = new HashMap<String, Object>(); public ClientInvoker(URI baseUri, Class declaring, Method method, <API key> providerFactory, ClientExecutor executor, <API key> extractorFactory) { this(baseUri, declaring, method, new ProxyConfig(null, executor, providerFactory, extractorFactory, null, null, null)); } public ClientInvoker(URI baseUri, Class declaring, Method method, ProxyConfig config) { this.declaring = declaring; this.method = method; this.marshallers = <API key>.createMarshallers(declaring, method, providerFactory, config.getServerConsumes()); this.providerFactory = config.getProviderFactory(); this.executor = config.getExecutor(); accepts = MediaTypeHelper.getProduces(declaring, method, config.getServerProduces()); this.uri = new ResteasyUriBuilder(); this.baseUri = baseUri; uri.uri(baseUri); if (declaring.isAnnotationPresent(Path.class)) uri.path(declaring); if (method.isAnnotationPresent(Path.class)) uri.path(method); this.extractorFactory = config.getExtractorFactory(); this.extractor = extractorFactory.createExtractor(method); } public Map<String, Object> getAttributes() { return attributes; } public MediaType getAccepts() { return accepts; } public Method getMethod() { return method; } public Class getDeclaring() { return declaring; } public <API key> getProviderFactory() { return providerFactory; } public Object invoke(Object[] args) { boolean isProvidersSet = <API key>.getContextData(Providers.class) != null; if (!isProvidersSet) <API key>.pushContext(Providers.class, providerFactory); try { if (uri == null) throw new RuntimeException(Messages.MESSAGES.<API key>()); ClientRequest request = createRequest(args); BaseClientResponse clientResponse = null; try { clientResponse = (BaseClientResponse) request.httpMethod(httpMethod); } catch (Exception e) { <API key><Exception> mapper = providerFactory.<API key>(Exception.class); if (mapper != null) { throw mapper.toException(e); } throw new RuntimeException(e); } ClientErrorHandler errorHandler = new ClientErrorHandler(providerFactory.<API key>()); clientResponse.<API key>(method.toString()); clientResponse.setAnnotations(method.getAnnotations()); <API key> <API key> = new <API key>(request, clientResponse, errorHandler, extractorFactory, baseUri); return extractor.extractEntity(<API key>); } finally { if (!isProvidersSet) <API key>.popContextData(Providers.class); } } protected ClientRequest createRequest(Object[] args) { ClientRequest request = new ClientRequest(uri, executor, providerFactory); request.getAttributes().putAll(attributes); if (accepts != null) request.header(HttpHeaders.ACCEPT, accepts.toString()); this.<API key>(request); boolean <API key> = ClientResponse.class.isAssignableFrom(method.getReturnType()); request.followRedirects(!<API key> || this.followRedirects); for (int i = 0; i < marshallers.length; i++) { marshallers[i].build(request, args[i]); } return request; } public String getHttpMethod() { return httpMethod; } public void setHttpMethod(String httpMethod) { this.httpMethod = httpMethod; } public boolean isFollowRedirects() { return followRedirects; } public void setFollowRedirects(boolean followRedirects) { this.followRedirects = followRedirects; } public void followRedirects() { setFollowRedirects(true); } }
module.exports = { "env": { "es6": true, "node": true }, "globals": { "expect": true, "it": true, "describe": true, }, "extends": "eslint:recommended", "parser": "babel-eslint", "parserOptions": { "ecmaFeatures": { "<API key>": true, "jsx": true }, "sourceType": "module" }, "plugins": [ "react" ], "rules": { "no-unused-vars": 2, "react/jsx-uses-vars": 2, "react/jsx-uses-react": 2, "indent": [ "error", 2 ], "linebreak-style": [ "error", "unix" ], "quotes": [ "error", "single" ], "semi": [ "error", "always" ] } };
/* Public domain */ typedef struct vg_point { struct vg_node _inherit; float size; /* Size in pixels (0.0 = invisible) */ } VG_Point; #define VGPOINT(p) ((VG_Point *)(p)) /* Begin generated block */ __BEGIN_DECLS extern DECLSPEC VG_NodeOps vgPointOps; static __inline__ VG_Point * VG_PointNew(void *pNode, VG_Vector pos) { VG_Point *vp; vp = (VG_Point *)AG_Malloc(sizeof(VG_Point)); VG_NodeInit(vp, &vgPointOps); VG_Translate(vp, pos); VG_NodeAttach(pNode, vp); return (vp); } static __inline__ void VG_PointSize(VG_Point *vp, float r) { VG_Lock(VGNODE(vp)->vg); vp->size = r; VG_Unlock(VGNODE(vp)->vg); } __END_DECLS /* Close generated block */
// Decompiler options: braces fieldsfirst space lnc package cn.com.smartdevices.bracelet.view; import android.animation.Animator; // Referenced classes of package cn.com.smartdevices.bracelet.view: // RoundProgressBar class s implements android.animation.Animator.AnimatorListener { final RoundProgressBar a; s(RoundProgressBar roundprogressbar) { a = roundprogressbar; super(); } public void onAnimationCancel(Animator animator) { } public void onAnimationEnd(Animator animator) { if (RoundProgressBar.a(a) < RoundProgressBar.b(a) && RoundProgressBar.c(a) < RoundProgressBar.b(a)) { RoundProgressBar.a(a, RoundProgressBar.b(a)); RoundProgressBar.a(a, RoundProgressBar.a(a) - RoundProgressBar.c(a), RoundProgressBar.c(a), RoundProgressBar.a(a)); } } public void onAnimationRepeat(Animator animator) { } public void onAnimationStart(Animator animator) { } }
(function(window) { var DEFAULT_ERROR_ID = 'error-default'; /** * Very simple base class for views. * Provides functionality for active/inactive. * * The first time the view is activated * the onactive function/event will fire. * * The .seen property is added to each object * with view in its prototype. .seen can be used * to detect if the view has ever been activated. * * @param {String|Object} options options or a selector for element. */ function View(options) { if (typeof(options) === 'undefined') { options = {}; } if (typeof(options) === 'string') { this.selectors = { element: options }; } else { var key; if (typeof(options) === 'undefined') { options = {}; } for (key in options) { if (options.hasOwnProperty(key)) { this[key] = options[key]; } } } this.hideErrors = this.hideErrors.bind(this); } const INVALID_CSS = /([^a-zA-Z\-\_0-9])/g; View.ACTIVE = 'active'; View.prototype = { seen: false, activeClass: View.ACTIVE, errorVisible: false, get element() { return this._findElement('element'); }, get status() { return this._findElement('status'); }, get errors() { return this._findElement('errors'); }, /** * Creates a string id for a given model. * * view.idForModel('foo-', { _id: 1 }); // => foo-1 * view.idForModel('foo-', '2'); // => foo-2 * * @param {String} prefix of string. * @param {Object|String|Numeric} objectOrString representation of model. */ idForModel: function(prefix, objectOrString) { prefix += (typeof(objectOrString) === 'object') ? objectOrString._id : objectOrString; return prefix; }, calendarId: function(input) { if (typeof(input) !== 'string') { input = input.calendarId; } input = this.cssClean(input); return 'calendar-id-' + input; }, /** * Delegate pattern event listener. * * @param {HTMLElement} element parent element. * @param {String} type type of dom event. * @param {String} selector css selector element should match * _note_ there is no magic here this * is determined from the root of the document. * @param {Function|Object} handler event handler. * first argument is the raw * event second is the element * matching the pattern. */ delegate: function(element, type, selector, handler) { if (typeof(handler) === 'object') { var context = handler; handler = function() { context.handleEvent.apply(context, arguments); }; } element.addEventListener(type, function(e) { var target = e.target; while (target !== element) { if ('mozMatchesSelector' in target && target.mozMatchesSelector(selector)) { return handler(e, target); } target = target.parentNode; } }); }, cssClean: function(string) { if (typeof(string) !== 'string') return string; //TODO: I am worried about the performance //of using this all over the place =/ //consider sanitizing all keys to ensure //they don't blow up when used as a selector? return string.replace(INVALID_CSS, '-'); }, /** * Finds a caches a element defined * by selectors * * @param {String} selector name as defined in selectors. * @param {Boolean} all true when to find all elements. (default false). */ _findElement: function(name, all, element) { if (typeof(all) === 'object') { element = all; all = false; } element = element || document; var cacheName; var selector; if (typeof(all) === 'undefined') { all = false; } if (name in this.selectors) { cacheName = '_' + name + 'Element'; selector = this.selectors[name]; if (!this[cacheName]) { if (all) { this[cacheName] = element.querySelectorAll(selector); } else { this[cacheName] = element.querySelector(selector); } } return this[cacheName]; } return null; }, /** * Displays a list of errors * * @param {Array} list error list * (see Event.validaitonErrors) or Error object. */ showErrors: function(list) { var _ = navigator.mozL10n.get; var errors = ''; // We can pass Error objects or // Array of {name: foo} objects if (!Array.isArray(list)) { list = [list]; } var i = 0; var len = list.length; for (; i < len; i++) { var name = list[i].l10nID || list[i].name; errors += _('error-' + name) || _(DEFAULT_ERROR_ID); } // populate error and display it. this.errors.textContent = errors; this.errorVisible = true; this.status.classList.add(this.activeClass); this.status.addEventListener('animationend', this.hideErrors); }, hideErrors: function() { this.status.classList.remove(this.activeClass); this.status.removeEventListener('animationend', this.hideErrors); this.errorVisible = false; }, onactive: function() { if (this.errorVisible) { this.hideErrors(); } //seen can be set to anything other //then false to override this behaviour if (this.seen === false) { this.onfirstseen(); } // intentionally using 'in' if ('dispatch' in this) { this.dispatch.apply(this, arguments); } this.seen = true; if (this.element) { this.element.classList.add(this.activeClass); } }, oninactive: function() { if (this.element) { this.element.classList.remove(this.activeClass); } }, onfirstseen: function() {} }; Calendar.View = View; }(this));
require_extension('D'); require_rv64; require_fp; <API key> = RM; WRITE_FRD(i64_to_f64(RS1)); set_fp_exceptions;
# This code was automatically generated using xdrgen # DO NOT EDIT or your changes may be overwritten require 'xdr' # enum ManageOfferEffect # <API key> = 0, # <API key> = 1, # <API key> = 2 module Stellar class ManageOfferEffect < XDR::Enum member :<API key>, 0 member :<API key>, 1 member :<API key>, 2 seal end end
package com.artemis; import static org.junit.Assert.assertEquals; import java.util.<API key>; import com.artemis.systems.<API key>; import com.artemis.utils.IntBag; import org.junit.Test; import com.artemis.utils.ImmutableBag; public class EntitySystemTest { @SuppressWarnings("static-method") @Test(expected = <API key>.class) public void <API key>() { World w = new World(new WorldConfiguration() .setSystem(new IteratorTestSystem(0))); Entity e = w.createEntity(); e.edit().add(new C()); e.disable(); w.process(); } @SuppressWarnings("static-method") @Test public void <API key>() { World w = new World(new WorldConfiguration() .setSystem(new IteratorTestSystem(1))); Entity e = w.createEntity(); e.edit().add(new C()); w.process(); } @Test public void aspect_exclude_only() { ExcludingSystem es1 = new ExcludingSystem(); EmptySystem es2 = new EmptySystem(); World w = new World(new WorldConfiguration() .setSystem(es1) .setSystem(es2)); Entity e = w.createEntity(); w.process(); assertEquals(1, es1.getActives().size()); assertEquals(1, es2.getActives().size()); } public static class C extends Component {} public static class C2 extends Component {} public static class IteratorTestSystem extends EntitySystem { public int expectedSize; @SuppressWarnings("unchecked") public IteratorTestSystem(int expectedSize) { super(Aspect.all(C.class)); this.expectedSize = expectedSize; } @Override protected void processSystem() { assertEquals(expectedSize, subscription.getEntities().size()); getActives().iterator().next(); } @Override protected boolean checkProcessing() { return true; } } public static class ExcludingSystem extends <API key> { public ExcludingSystem() { super(Aspect.exclude(C.class)); } @Override protected void process(Entity e) {} } public static class EmptySystem extends <API key> { public EmptySystem() { super(Aspect.all()); } @Override protected void process(Entity e) {} } }
package com.sqisland.gce2retrofit; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.stream.JsonReader; import com.squareup.javawriter.JavaWriter; import org.apache.commons.cli.BasicParser; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; import org.apache.commons.lang3.text.WordUtils; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.Reader; import java.io.Writer; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import static javax.lang.model.element.Modifier.PUBLIC; public class Generator { private static final String OPTION_CLASS_MAP = "classmap"; private static final String OPTION_METHODS = "methods"; private static Gson gson = new Gson(); public enum MethodType { SYNC, ASYNC, REACTIVE } public static void main(String... args) throws IOException, URISyntaxException { Options options = getOptions(); CommandLine cmd = getCommandLine(options, args); if (cmd == null) { return; } String[] arguments = cmd.getArgs(); if (arguments.length != 2) { HelpFormatter formatter = new HelpFormatter(); formatter.printHelp("java -jar gce2retrofit.jar discovery.json output_dir", options); System.exit(1); } String discoveryFile = arguments[0]; String outputDir = arguments[1]; Map<String, String> classMap = cmd.hasOption(OPTION_CLASS_MAP)? readClassMap(new FileReader(cmd.getOptionValue(OPTION_CLASS_MAP))) : null; EnumSet<MethodType> methodTypes = getMethods(cmd.getOptionValue(OPTION_METHODS)); generate(new FileReader(discoveryFile), new FileWriterFactory(new File(outputDir)), classMap, methodTypes); } private static Options getOptions() { Options options = new Options(); options.addOption( OPTION_CLASS_MAP, true, "Map fields to classes. Format: field_name\\tclass_name"); options.addOption( OPTION_METHODS, true, "Methods to generate, either sync, async or reactive. Default is to generate sync & async."); return options; } private static CommandLine getCommandLine(Options options, String... args) { CommandLineParser parser = new BasicParser(); try { CommandLine cmd = parser.parse(options, args); return cmd; } catch (ParseException e) { System.out.println("Unexpected exception:" + e.getMessage()); } return null; } public static void generate( Reader discoveryReader, WriterFactory writerFactory, Map<String, String> classMap, EnumSet<MethodType> methodTypes) throws IOException, URISyntaxException { JsonReader jsonReader = new JsonReader(discoveryReader); Discovery discovery = gson.fromJson(jsonReader, Discovery.class); String packageName = StringUtil.getPackageName(discovery.baseUrl); if (packageName == null || packageName.isEmpty()) { packageName = StringUtil.getPackageName(discovery.rootUrl); } String modelPackageName = packageName + ".model"; for (Entry<String, JsonElement> entry : discovery.schemas.entrySet()) { generateModel( writerFactory, modelPackageName, entry.getValue().getAsJsonObject(), classMap); } if (discovery.resources != null) { <API key>( writerFactory, packageName, "", discovery.resources, methodTypes); } if (discovery.name != null && discovery.methods != null) { generateInterface( writerFactory, packageName, discovery.name, discovery.methods, methodTypes); } } public static Map<String, String> readClassMap(Reader reader) throws IOException { Map<String, String> classMap = new HashMap<String, String>(); String line; BufferedReader bufferedReader = new BufferedReader(reader); while ((line = bufferedReader.readLine()) != null) { String[] fields = line.split("\t"); if (fields.length == 2) { classMap.put(fields[0], fields[1]); } } return classMap; } public static EnumSet<MethodType> getMethods(String input) { EnumSet<MethodType> methodTypes = EnumSet.noneOf(MethodType.class); if (input != null) { String[] parts = input.split(","); for (String part : parts) { if ("sync".equals(part) || "both".equals(part)) { methodTypes.add(MethodType.SYNC); } if ("async".equals(part) || "both".equals(part)) { methodTypes.add(MethodType.ASYNC); } if ("reactive".equals(part)) { methodTypes.add(MethodType.REACTIVE); } } } if (methodTypes.isEmpty()) { methodTypes = EnumSet.of(Generator.MethodType.ASYNC, Generator.MethodType.SYNC); } return methodTypes; } private static void generateModel( WriterFactory writerFactory, String modelPackageName, JsonObject schema, Map<String, String> classMap) throws IOException { String id = schema.get("id").getAsString(); String path = StringUtil.getPath(modelPackageName, id + ".java"); Writer writer = writerFactory.getWriter(path); JavaWriter javaWriter = new JavaWriter(writer); javaWriter.emitPackage(modelPackageName) .emitImports("com.google.gson.annotations.SerializedName") .emitEmptyLine() .emitImports("java.util.List") .emitEmptyLine(); String type = schema.get("type").getAsString(); if (type.equals("object")) { javaWriter.beginType(modelPackageName + "." + id, "class", EnumSet.of(PUBLIC)); generateObject(javaWriter, schema, classMap); javaWriter.endType(); } else if (type.equals("string")) { javaWriter.beginType(modelPackageName + "." + id, "enum", EnumSet.of(PUBLIC)); generateEnum(javaWriter, schema); javaWriter.endType(); } writer.close(); } private static void generateObject( JavaWriter javaWriter, JsonObject schema, Map<String, String> classMap) throws IOException { JsonElement element = schema.get("properties"); if (element == null) { return; } JsonObject properties = element.getAsJsonObject(); for (Entry<String, JsonElement> entry : properties.entrySet()) { String key = entry.getKey(); String variableName = key; if (StringUtil.isReservedWord(key)) { javaWriter.emitAnnotation("SerializedName(\"" + key + "\")"); variableName += "_"; } PropertyType propertyType = gson.fromJson( entry.getValue(), PropertyType.class); String javaType = propertyType.toJavaType(); if (classMap != null && classMap.containsKey(key)) { javaType = classMap.get(key); } javaWriter.emitField(javaType, variableName, EnumSet.of(PUBLIC)); } } private static void generateEnum(JavaWriter javaWriter, JsonObject schema) throws IOException { JsonArray enums = schema.get("enum").getAsJsonArray(); for (int i = 0; i < enums.size(); ++i) { javaWriter.emitEnumValue(enums.get(i).getAsString()); } } private static void <API key>( WriterFactory writerFactory, String packageName, String resourceName, JsonObject resources, EnumSet<MethodType> methodTypes) throws IOException { for (Entry<String, JsonElement> entry : resources.entrySet()) { JsonObject entryValue = entry.getValue().getAsJsonObject(); if (entryValue.has("methods")) { generateInterface(writerFactory, packageName, resourceName + "_" + entry.getKey(), entryValue.get("methods").getAsJsonObject(), methodTypes); } if (entryValue.has("resources")) { <API key>(writerFactory, packageName, resourceName + "_" + entry.getKey(), entryValue.get("resources").getAsJsonObject(), methodTypes); } } } private static void generateInterface( WriterFactory writerFactory, String packageName, String resourceName, JsonObject methods, EnumSet<MethodType> methodTypes) throws IOException { String capitalizedName = WordUtils.capitalizeFully(resourceName, '_'); String className = capitalizedName.replaceAll("_", ""); String path = StringUtil.getPath(packageName, className + ".java"); Writer fileWriter = writerFactory.getWriter(path); JavaWriter javaWriter = new JavaWriter(fileWriter); javaWriter.emitPackage(packageName) .emitImports(packageName + ".model.*") .emitEmptyLine() .emitImports( "retrofit.Callback", "retrofit.client.Response", "retrofit.http.GET", "retrofit.http.POST", "retrofit.http.PATCH", "retrofit.http.DELETE", "retrofit.http.Body", "retrofit.http.Path", "retrofit.http.Query"); if (methodTypes.contains(MethodType.REACTIVE)) { javaWriter.emitImports("rx.Observable"); } javaWriter.emitEmptyLine(); javaWriter.beginType( packageName + "." + className, "interface", EnumSet.of(PUBLIC)); for (Entry<String, JsonElement> entry : methods.entrySet()) { String methodName = entry.getKey(); Method method = gson.fromJson(entry.getValue(), Method.class); for (MethodType methodType : methodTypes) { javaWriter.emitAnnotation(method.httpMethod, "\"/" + method.path + "\""); emitMethodSignature(fileWriter, methodName, method, methodType); } } javaWriter.endType(); fileWriter.close(); } // TODO: Use JavaWriter to emit method signature private static void emitMethodSignature( Writer writer, String methodName, Method method, MethodType methodType) throws IOException { ArrayList<String> params = new ArrayList<String>(); if (method.request != null) { params.add("@Body " + method.request.$ref + " " + (method.request.parameterName != null ? method.request.parameterName : "resource")); } for (Entry<String, JsonElement> param : getParams(method)) { params.add(param2String(param)); } String returnValue = "void"; if (methodType == MethodType.SYNC && "POST".equals(method.httpMethod)) { returnValue = "Response"; } if (method.response != null) { if (methodType == MethodType.SYNC) { returnValue = method.response.$ref; } else if (methodType == MethodType.REACTIVE) { returnValue = "Observable<" + method.response.$ref + ">"; } } if (methodType == MethodType.ASYNC) { if (method.response == null) { params.add("Callback<Void> cb"); } else { params.add("Callback<" + method.response.$ref + "> cb"); } } writer.append(" " + returnValue + " " + methodName + (methodType == MethodType.REACTIVE ? "Rx" : "") + "("); for (int i = 0; i < params.size(); ++i) { if (i != 0) { writer.append(", "); } writer.append(params.get(i)); } writer.append(");\n"); } /** * Assemble a list of parameters, with the first entries matching the ones * listed in parameterOrder * * @param method The method containing parameters and parameterOrder * @return Ordered parameters */ private static List<Entry<String, JsonElement>> getParams(Method method) { List<Entry<String, JsonElement>> params = new ArrayList<Entry<String, JsonElement>>(); if (method.parameters == null) { return params; } // Convert the entry set into a map, and extract the keys not listed in // parameterOrder HashMap<String, Entry<String, JsonElement>> map = new HashMap<String, Entry<String, JsonElement>>(); List<String> remaining = new ArrayList<String>(); for (Entry<String, JsonElement> entry : method.parameters.entrySet()) { String key = entry.getKey(); map.put(key, entry); if (method.parameterOrder == null || !method.parameterOrder.contains(key)) { remaining.add(key); } } // Add the keys in parameterOrder if (method.parameterOrder != null) { for (String key : method.parameterOrder) { params.add(map.get(key)); } } // Then add the keys not in parameterOrder for (String key : remaining) { params.add(map.get(key)); } return params; } private static String param2String(Entry<String, JsonElement> param) { StringBuffer buf = new StringBuffer(); String paramName = param.getKey(); ParameterType paramType = gson.fromJson( param.getValue(), ParameterType.class); if ("path".equals(paramType.location)) { buf.append("@Path(\"" + paramName + "\") "); } if ("query".equals(paramType.location)) { buf.append("@Query(\"" + paramName + "\") "); } String type = paramType.toJavaType(); if (!paramType.required) { type = StringUtil.primitiveToObject(type); } buf.append(type + " " + paramName); return buf.toString(); } }
#!/usr/bin/env ruby # set.rb - defines the Set class # Documentation by Akinori MUSHA and Gavin Sinclair. # terms as Ruby. # $Id: set.rb 8696 2009-01-10 21:17:58Z headius $ # == Overview # This library provides the Set class, which deals with a collection # of unordered values with no duplicates. It is a hybrid of Array's # intuitive inter-operation facilities and Hash's fast lookup. If you # need to keep values ordered, use the SortedSet class. # The method +to_set+ is added to Enumerable for convenience. # See the Set class for an example of usage. # Set implements a collection of unordered values with no duplicates. # This is a hybrid of Array's intuitive inter-operation facilities and # Hash's fast lookup. # Several methods accept any Enumerable object (implementing +each+) # for greater flexibility: new, replace, merge, subtract, |, &, -, ^. # The equality of each couple of elements is determined according to # Object#eql? and Object#hash, since Set uses Hash as storage. # Finally, if you are using class Set, you can also use Enumerable#to_set # for convenience. # == Example # require 'set' # s1 = Set.new [1, 2] # -> #<Set: {1, 2}> # s2 = [1, 2].to_set # -> #<Set: {1, 2}> # s1 == s2 # -> true # s1.add("foo") # -> #<Set: {1, 2, "foo"}> # s1.merge([2, 6]) # -> #<Set: {6, 1, 2, "foo"}> # s1.subset? s2 # -> false # s2.subset? s1 # -> true class Set include Enumerable # Creates a new set containing the given objects. def self.[](*ary) new(ary) end # Creates a new set containing the elements of the given enumerable # object. # If a block is given, the elements of enum are preprocessed by the # given block. def initialize(enum = nil, &block) # :yields: o @hash ||= Hash.new enum.nil? and return if block enum.each { |o| add(block[o]) } else merge(enum) end end # Copy internal hash. def initialize_copy(orig) @hash = orig.instance_eval{@hash}.dup end # Returns the number of elements. def size @hash.size end alias length size # Returns true if the set contains no elements. def empty? @hash.empty? end # Removes all elements and returns self. def clear @hash.clear self end # Replaces the contents of the set with the contents of the given # enumerable object and returns self. def replace(enum) if enum.class == self.class @hash.replace(enum.instance_eval { @hash }) else enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable" clear enum.each { |o| add(o) } end self end # Converts the set to an array. The order of elements is uncertain. def to_a @hash.keys end def flatten_merge(set, seen = Set.new) set.each { |e| if e.is_a?(Set) if seen.include?(e_id = e.object_id) raise ArgumentError, "tried to flatten recursive Set" end seen.add(e_id) flatten_merge(e, seen) seen.delete(e_id) else add(e) end } self end protected :flatten_merge # Returns a new set that is a copy of the set, flattening each # containing set recursively. def flatten self.class.new.flatten_merge(self) end # Equivalent to Set#flatten, but replaces the receiver with the # result in place. Returns nil if no modifications were made. def flatten! if detect { |e| e.is_a?(Set) } replace(flatten()) else nil end end # Returns true if the set contains the given object. def include?(o) @hash.include?(o) end alias member? include? # Returns true if the set is a superset of the given set. def superset?(set) set.is_a?(Set) or raise ArgumentError, "value must be a set" return false if size < set.size set.all? { |o| include?(o) } end # Returns true if the set is a proper superset of the given set. def proper_superset?(set) set.is_a?(Set) or raise ArgumentError, "value must be a set" return false if size <= set.size set.all? { |o| include?(o) } end # Returns true if the set is a subset of the given set. def subset?(set) set.is_a?(Set) or raise ArgumentError, "value must be a set" return false if set.size < size all? { |o| set.include?(o) } end # Returns true if the set is a proper subset of the given set. def proper_subset?(set) set.is_a?(Set) or raise ArgumentError, "value must be a set" return false if set.size <= size all? { |o| set.include?(o) } end # Calls the given block once for each element in the set, passing # the element as parameter. def each @hash.each_key { |o| yield(o) } self end # Adds the given object to the set and returns self. Use +merge+ to # add several elements at once. def add(o) @hash[o] = true self end alias << add # Adds the given object to the set and returns self. If the # object is already in the set, returns nil. def add?(o) if include?(o) nil else add(o) end end # Deletes the given object from the set and returns self. Use +subtract+ to # delete several items at once. def delete(o) @hash.delete(o) self end # Deletes the given object from the set and returns self. If the # object is not in the set, returns nil. def delete?(o) if include?(o) delete(o) else nil end end # Deletes every element of the set for which block evaluates to # true, and returns self. def delete_if to_a.each { |o| @hash.delete(o) if yield(o) } self end # Do collect() destructively. def collect! set = self.class.new each { |o| set << yield(o) } replace(set) end alias map! collect! # Equivalent to Set#delete_if, but returns nil if no changes were # made. def reject! n = size delete_if { |o| yield(o) } size == n ? nil : self end # Merges the elements of the given enumerable object to the set and # returns self. def merge(enum) if enum.is_a?(Set) @hash.update(enum.instance_eval { @hash }) else enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable" enum.each { |o| add(o) } end self end # Deletes every element that appears in the given enumerable object # and returns self. def subtract(enum) enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable" enum.each { |o| delete(o) } self end # Returns a new set built by merging the set and the elements of the # given enumerable object. def |(enum) enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable" dup.merge(enum) end alias + | alias union | # Returns a new set built by duplicating the set, removing every # element that appears in the given enumerable object. def -(enum) enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable" dup.subtract(enum) end alias difference - # Returns a new set containing elements common to the set and the # given enumerable object. def &(enum) enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable" n = self.class.new enum.each { |o| n.add(o) if include?(o) } n end alias intersection & # Returns a new set containing elements exclusive between the set # and the given enumerable object. (set ^ enum) is equivalent to # ((set | enum) - (set & enum)). def ^(enum) enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable" n = Set.new(enum) each { |o| if n.include?(o) then n.delete(o) else n.add(o) end } n end # Returns true if two sets are equal. The equality of each couple # of elements is defined according to Object#eql?. def ==(set) equal?(set) and return true set.is_a?(Set) && size == set.size or return false hash = @hash.dup set.all? { |o| hash.include?(o) } end def hash # :nodoc: @hash.hash end def eql?(o) # :nodoc: return false unless o.is_a?(Set) @hash.eql?(o.instance_eval{@hash}) end # Classifies the set by the return value of the given block and # returns a hash of {value => set of elements} pairs. The block is # called once for each element of the set, passing the element as # parameter. # require 'set' # files = Set.new(Dir.glob("*.rb")) # hash = files.classify { |f| File.mtime(f).year } # p hash # => {2000=>#<Set: {"a.rb", "b.rb"}>, # # 2001=>#<Set: {"c.rb", "d.rb", "e.rb"}>, # # 2002=>#<Set: {"f.rb"}>} def classify # :yields: o h = {} each { |i| x = yield(i) (h[x] ||= self.class.new).add(i) } h end # Divides the set into a set of subsets according to the commonality # defined by the given block. # If the arity of the block is 2, elements o1 and o2 are in common # if block.call(o1, o2) is true. Otherwise, elements o1 and o2 are # in common if block.call(o1) == block.call(o2). # require 'set' # numbers = Set[1, 3, 4, 6, 9, 10, 11] # set = numbers.divide { |i,j| (i - j).abs == 1 } # p set # => #<Set: {#<Set: {1}>, # # #<Set: {11, 9, 10}>, # # #<Set: {3, 4}>, # # #<Set: {6}>}> def divide(&func) if func.arity == 2 require 'tsort' class << dig = {} # :nodoc: include TSort alias tsort_each_node each_key def tsort_each_child(node, &block) fetch(node).each(&block) end end each { |u| dig[u] = a = [] each{ |v| func.call(u, v) and a << v } } set = Set.new() dig.<API key> { |css| set.add(self.class.new(css)) } set else Set.new(classify(&func).values) end end InspectKey = :__inspect_key__ # :nodoc: # Returns a string containing a human-readable representation of the # set. ("#<Set: {element1, element2, ...}>") def inspect ids = (Thread.current[InspectKey] ||= []) if ids.include?(object_id) return sprintf('#<%s: {...}>', self.class.name) end begin ids << object_id return sprintf('#<%s: {%s}>', self.class, to_a.inspect[1..-2]) ensure ids.pop end end def pretty_print(pp) # :nodoc: pp.text sprintf('#<%s: {', self.class.name) pp.nest(1) { pp.seplist(self) { |o| pp.pp o } } pp.text "}>" end def pretty_print_cycle(pp) # :nodoc: pp.text sprintf('#<%s: {%s}>', self.class.name, empty? ? '' : '...') end end # SortedSet implements a set which elements are sorted in order. See Set. class SortedSet < Set @@setup = false class << self def [](*ary) # :nodoc: new(ary) end def setup # :nodoc: @@setup and return module_eval { # a hack to shut up warning alias old_init initialize remove_method :old_init } begin require 'rbtree' module_eval %{ def initialize(*args, &block) @hash = RBTree.new super end } rescue LoadError module_eval %{ def initialize(*args, &block) @keys = nil super end def clear @keys = nil super end def replace(enum) @keys = nil super end def add(o) @keys = nil @hash[o] = true self end alias << add def delete(o) @keys = nil @hash.delete(o) self end def delete_if n = @hash.size super @keys = nil if @hash.size != n self end def merge(enum) @keys = nil super end def each to_a.each { |o| yield(o) } self end def to_a (@keys = @hash.keys).sort! unless @keys @keys end } end @@setup = true end end def initialize(*args, &block) # :nodoc: SortedSet.setup initialize(*args, &block) end end module Enumerable # Makes a set from the enumerable object with given arguments. # Needs to +require "set"+ to use this method. def to_set(klass = Set, *args, &block) klass.new(self, *args, &block) end end # =begin # == RestricedSet class # RestricedSet implements a set with restrictions defined by a given # block. # Set # Creates a new restricted set containing the elements of the given # enumerable object. Restrictions are defined by the given block. # If the block's arity is 2, it is called with the RestrictedSet # itself and an object to see if the object is allowed to be put in # the set. # Otherwise, the block is called with an object to see if the object # is allowed to be put in the set. # Returns the restriction procedure of the set. # =end # class RestricedSet < Set # def initialize(*args, &block) # @proc = block or raise ArgumentError, "missing a block" # if @proc.arity == 2 # instance_eval %{ # def add(o) # @hash[o] = true if @proc.call(self, o) # self # end # alias << add # def add?(o) # if include?(o) || !@proc.call(self, o) # nil # else # @hash[o] = true # self # end # end # def replace(enum) # enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable" # clear # enum.each { |o| add(o) } # self # end # def merge(enum) # enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable" # enum.each { |o| add(o) } # self # end # else # instance_eval %{ # def add(o) # if @proc.call(o) # @hash[o] = true # end # self # end # alias << add # def add?(o) # if include?(o) || !@proc.call(o) # nil # else # @hash[o] = true # self # end # end # end # super(*args) # end # def restriction_proc # @proc # end # end if $0 == __FILE__ eval DATA.read, nil, $0, __LINE__+4 end __END__ require 'test/unit' class TC_Set < Test::Unit::TestCase def test_aref <API key> { Set[] Set[nil] Set[1,2,3] } assert_equal(0, Set[].size) assert_equal(1, Set[nil].size) assert_equal(1, Set[[]].size) assert_equal(1, Set[[nil]].size) set = Set[2,4,6,4] assert_equal(Set.new([2,4,6]), set) end def test_s_new <API key> { Set.new() Set.new(nil) Set.new([]) Set.new([1,2]) Set.new('a'..'c') Set.new('XYZ') } assert_raises(ArgumentError) { Set.new(false) } assert_raises(ArgumentError) { Set.new(1) } assert_raises(ArgumentError) { Set.new(1,2) } assert_equal(0, Set.new().size) assert_equal(0, Set.new(nil).size) assert_equal(0, Set.new([]).size) assert_equal(1, Set.new([nil]).size) ary = [2,4,6,4] set = Set.new(ary) ary.clear assert_equal(false, set.empty?) assert_equal(3, set.size) ary = [1,2,3] s = Set.new(ary) { |o| o * 2 } assert_equal([2,4,6], s.sort) end def test_clone set1 = Set.new set2 = set1.clone set1 << 'abc' assert_equal(Set.new, set2) end def test_dup set1 = Set[1,2] set2 = set1.dup assert_not_same(set1, set2) assert_equal(set1, set2) set1.add(3) assert_not_equal(set1, set2) end def test_size assert_equal(0, Set[].size) assert_equal(2, Set[1,2].size) assert_equal(2, Set[1,2,1].size) end def test_empty? assert_equal(true, Set[].empty?) assert_equal(false, Set[1, 2].empty?) end def test_clear set = Set[1,2] ret = set.clear assert_same(set, ret) assert_equal(true, set.empty?) end def test_replace set = Set[1,2] ret = set.replace('a'..'c') assert_same(set, ret) assert_equal(Set['a','b','c'], set) end def test_to_a set = Set[1,2,3,2] ary = set.to_a assert_equal([1,2,3], ary.sort) end def test_flatten # test1 set1 = Set[ 1, Set[ 5, Set[7, Set[0] ], Set[6,2], 1 ], 3, Set[3,4] ] set2 = set1.flatten set3 = Set.new(0..7) assert_not_same(set2, set1) assert_equal(set3, set2) # test2; destructive orig_set1 = set1 set1.flatten! assert_same(orig_set1, set1) assert_equal(set3, set1) # test3; multiple occurrences of a set in an set set1 = Set[1, 2] set2 = Set[set1, Set[set1, 4], 3] <API key> { set2.flatten! } assert_equal(Set.new(1..4), set2) # test4; recursion set2 = Set[] set1 = Set[1, set2] set2.add(set1) assert_raises(ArgumentError) { set1.flatten! } # test5; miscellaneous empty = Set[] set = Set[Set[empty, "a"],Set[empty, "b"]] <API key> { set.flatten } set1 = empty.merge(Set["no_more", set]) assert_nil(Set.new(0..31).flatten!) x = Set[Set[],Set[1,2]].flatten! y = Set[1,2] assert_equal(x, y) end def test_include? set = Set[1,2,3] assert_equal(true, set.include?(1)) assert_equal(true, set.include?(2)) assert_equal(true, set.include?(3)) assert_equal(false, set.include?(0)) assert_equal(false, set.include?(nil)) set = Set["1",nil,"2",nil,"0","1",false] assert_equal(true, set.include?(nil)) assert_equal(true, set.include?(false)) assert_equal(true, set.include?("1")) assert_equal(false, set.include?(0)) assert_equal(false, set.include?(true)) end def test_superset? set = Set[1,2,3] assert_raises(ArgumentError) { set.superset?() } assert_raises(ArgumentError) { set.superset?(2) } assert_raises(ArgumentError) { set.superset?([2]) } assert_equal(true, set.superset?(Set[])) assert_equal(true, set.superset?(Set[1,2])) assert_equal(true, set.superset?(Set[1,2,3])) assert_equal(false, set.superset?(Set[1,2,3,4])) assert_equal(false, set.superset?(Set[1,4])) assert_equal(true, Set[].superset?(Set[])) end def <API key>? set = Set[1,2,3] assert_raises(ArgumentError) { set.proper_superset?() } assert_raises(ArgumentError) { set.proper_superset?(2) } assert_raises(ArgumentError) { set.proper_superset?([2]) } assert_equal(true, set.proper_superset?(Set[])) assert_equal(true, set.proper_superset?(Set[1,2])) assert_equal(false, set.proper_superset?(Set[1,2,3])) assert_equal(false, set.proper_superset?(Set[1,2,3,4])) assert_equal(false, set.proper_superset?(Set[1,4])) assert_equal(false, Set[].proper_superset?(Set[])) end def test_subset? set = Set[1,2,3] assert_raises(ArgumentError) { set.subset?() } assert_raises(ArgumentError) { set.subset?(2) } assert_raises(ArgumentError) { set.subset?([2]) } assert_equal(true, set.subset?(Set[1,2,3,4])) assert_equal(true, set.subset?(Set[1,2,3])) assert_equal(false, set.subset?(Set[1,2])) assert_equal(false, set.subset?(Set[])) assert_equal(true, Set[].subset?(Set[1])) assert_equal(true, Set[].subset?(Set[])) end def test_proper_subset? set = Set[1,2,3] assert_raises(ArgumentError) { set.proper_subset?() } assert_raises(ArgumentError) { set.proper_subset?(2) } assert_raises(ArgumentError) { set.proper_subset?([2]) } assert_equal(true, set.proper_subset?(Set[1,2,3,4])) assert_equal(false, set.proper_subset?(Set[1,2,3])) assert_equal(false, set.proper_subset?(Set[1,2])) assert_equal(false, set.proper_subset?(Set[])) assert_equal(false, Set[].proper_subset?(Set[])) end def test_each ary = [1,3,5,7,10,20] set = Set.new(ary) assert_raises(LocalJumpError) { set.each } <API key> { set.each { |o| ary.delete(o) or raise "unexpected element: } ary.empty? or raise "forgotten elements: #{ary.join(', ')}" } end def test_add set = Set[1,2,3] ret = set.add(2) assert_same(set, ret) assert_equal(Set[1,2,3], set) ret = set.add?(2) assert_nil(ret) assert_equal(Set[1,2,3], set) ret = set.add(4) assert_same(set, ret) assert_equal(Set[1,2,3,4], set) ret = set.add?(5) assert_same(set, ret) assert_equal(Set[1,2,3,4,5], set) end def test_delete set = Set[1,2,3] ret = set.delete(4) assert_same(set, ret) assert_equal(Set[1,2,3], set) ret = set.delete?(4) assert_nil(ret) assert_equal(Set[1,2,3], set) ret = set.delete(2) assert_equal(set, ret) assert_equal(Set[1,3], set) ret = set.delete?(1) assert_equal(set, ret) assert_equal(Set[3], set) end def test_delete_if set = Set.new(1..10) ret = set.delete_if { |i| i > 10 } assert_same(set, ret) assert_equal(Set.new(1..10), set) set = Set.new(1..10) ret = set.delete_if { |i| i % 3 == 0 } assert_same(set, ret) assert_equal(Set[1,2,4,5,7,8,10], set) end def test_collect! set = Set[1,2,3,'a','b','c',-1..1,2..4] ret = set.collect! { |i| case i when Numeric i * 2 when String i.upcase else nil end } assert_same(set, ret) assert_equal(Set[2,4,6,'A','B','C',nil], set) end def test_reject! set = Set.new(1..10) ret = set.reject! { |i| i > 10 } assert_nil(ret) assert_equal(Set.new(1..10), set) ret = set.reject! { |i| i % 3 == 0 } assert_same(set, ret) assert_equal(Set[1,2,4,5,7,8,10], set) end def test_merge set = Set[1,2,3] ret = set.merge([2,4,6]) assert_same(set, ret) assert_equal(Set[1,2,3,4,6], set) end def test_subtract set = Set[1,2,3] ret = set.subtract([2,4,6]) assert_same(set, ret) assert_equal(Set[1,3], set) end def test_plus set = Set[1,2,3] ret = set + [2,4,6] assert_not_same(set, ret) assert_equal(Set[1,2,3,4,6], ret) end def test_minus set = Set[1,2,3] ret = set - [2,4,6] assert_not_same(set, ret) assert_equal(Set[1,3], ret) end def test_and set = Set[1,2,3,4] ret = set & [2,4,6] assert_not_same(set, ret) assert_equal(Set[2,4], ret) end def test_xor set = Set[1,2,3,4] ret = set ^ [2,4,5,5] assert_not_same(set, ret) assert_equal(Set[1,3,5], ret) end def test_eq set1 = Set[2,3,1] set2 = Set[1,2,3] assert_equal(set1, set1) assert_equal(set1, set2) assert_not_equal(Set[1], [1]) set1 = Class.new(Set)["a", "b"] set2 = Set["a", "b", set1] set1 = set1.add(set1.clone) # assert_equal(set1, set2) # assert_equal(set2, set1) assert_equal(set2, set2.clone) assert_equal(set1.clone, set1) assert_not_equal(Set[Exception.new,nil], Set[Exception.new,Exception.new], "[ruby-dev:26127]") end # def test_hash # end # def test_eql? # end def test_classify set = Set.new(1..10) ret = set.classify { |i| i % 3 } assert_equal(3, ret.size) assert_instance_of(Hash, ret) ret.each_value { |value| assert_instance_of(Set, value) } assert_equal(Set[3,6,9], ret[0]) assert_equal(Set[1,4,7,10], ret[1]) assert_equal(Set[2,5,8], ret[2]) end def test_divide set = Set.new(1..10) ret = set.divide { |i| i % 3 } assert_equal(3, ret.size) n = 0 ret.each { |s| n += s.size } assert_equal(set.size, n) assert_equal(set, ret.flatten) set = Set[7,10,5,11,1,3,4,9,0] ret = set.divide { |a,b| (a - b).abs == 1 } assert_equal(4, ret.size) n = 0 ret.each { |s| n += s.size } assert_equal(set.size, n) assert_equal(set, ret.flatten) ret.each { |s| if s.include?(0) assert_equal(Set[0,1], s) elsif s.include?(3) assert_equal(Set[3,4,5], s) elsif s.include?(7) assert_equal(Set[7], s) elsif s.include?(9) assert_equal(Set[9,10,11], s) else raise "unexpected group: #{s.inspect}" end } end def test_inspect set1 = Set[1] assert_equal('#<Set: {1}>', set1.inspect) set2 = Set[Set[0], 1, 2, set1] assert_equal(false, set2.inspect.include?('#<Set: {...}>')) set1.add(set2) assert_equal(true, set1.inspect.include?('#<Set: {...}>')) end # def test_pretty_print # end # def <API key> # end end class TC_SortedSet < Test::Unit::TestCase def test_sortedset s = SortedSet[4,5,3,1,2] assert_equal([1,2,3,4,5], s.to_a) prev = nil s.each { |o| assert(prev < o) if prev; prev = o } assert_not_nil(prev) s.map! { |o| -2 * o } assert_equal([-10,-8,-6,-4,-2], s.to_a) prev = nil ret = s.each { |o| assert(prev < o) if prev; prev = o } assert_not_nil(prev) assert_same(s, ret) s = SortedSet.new([2,1,3]) { |o| o * -2 } assert_equal([-6,-4,-2], s.to_a) s = SortedSet.new(['one', 'two', 'three', 'four']) a = [] ret = s.delete_if { |o| a << o; o[0] == ?t } assert_same(s, ret) assert_equal(['four', 'one'], s.to_a) assert_equal(['four', 'one', 'three', 'two'], a) s = SortedSet.new(['one', 'two', 'three', 'four']) a = [] ret = s.reject! { |o| a << o; o[0] == ?t } assert_same(s, ret) assert_equal(['four', 'one'], s.to_a) assert_equal(['four', 'one', 'three', 'two'], a) s = SortedSet.new(['one', 'two', 'three', 'four']) a = [] ret = s.reject! { |o| a << o; false } assert_same(nil, ret) assert_equal(['four', 'one', 'three', 'two'], s.to_a) assert_equal(['four', 'one', 'three', 'two'], a) end end class TC_Enumerable < Test::Unit::TestCase def test_to_set ary = [2,5,4,3,2,1,3] set = ary.to_set assert_instance_of(Set, set) assert_equal([1,2,3,4,5], set.sort) set = ary.to_set { |o| o * -2 } assert_instance_of(Set, set) assert_equal([-10,-8,-6,-4,-2], set.sort) set = ary.to_set(SortedSet) assert_instance_of(SortedSet, set) assert_equal([1,2,3,4,5], set.to_a) set = ary.to_set(SortedSet) { |o| o * -2 } assert_instance_of(SortedSet, set) assert_equal([-10,-8,-6,-4,-2], set.sort) end end # class TC_RestricedSet < Test::Unit::TestCase # def test_s_new # assert_raises(ArgumentError) { RestricedSet.new } # s = RestricedSet.new([-1,2,3]) { |o| o > 0 } # assert_equal([2,3], s.sort) # end # def <API key> # s = RestricedSet.new([-1,2,3]) { |o| o > 0 } # f = s.restriction_proc # assert_instance_of(Proc, f) # assert(f[1]) # assert(!f[0]) # end # def test_replace # s = RestricedSet.new(-3..3) { |o| o > 0 } # assert_equal([1,2,3], s.sort) # s.replace([-2,0,3,4,5]) # assert_equal([3,4,5], s.sort) # end # def test_merge # s = RestricedSet.new { |o| o > 0 } # s.merge(-5..5) # assert_equal([1,2,3,4,5], s.sort) # s.merge([10,-10,-8,8]) # assert_equal([1,2,3,4,5,8,10], s.sort) # end # end
# AUTOGENERATED FILE FROM balenalib/revpi-core-3-ubuntu:bionic-run # A few reasons for installing <API key> OpenJDK: # 1. Oracle. Licensing prevents us from redistributing the official JDK. # 2. Compiling OpenJDK also requires the JDK to be installed, and it gets # really hairy. # For some sample build times, see Debian's buildd logs: # Default to UTF-8 file.encoding ENV LANG C.UTF-8 # add a simple script that can auto-detect the appropriate JAVA_HOME value # based on whether the JDK or only the JRE is installed RUN { \ echo '#!/bin/sh'; \ echo 'set -e'; \ echo; \ echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \ } > /usr/local/bin/docker-java-home \ && chmod +x /usr/local/bin/docker-java-home # do some fancy footwork to create a JAVA_HOME that's <API key> RUN ln -svT "/usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)" /docker-java-home ENV JAVA_HOME /docker-java-home RUN set -ex; \ \ # deal with slim variants not having man page directories (which causes "update-alternatives" to fail) if [ ! -d /usr/share/man/man1 ]; then \ mkdir -p /usr/share/man/man1; \ fi; \ \ apt-get update; \ apt-get install -y --<API key> \ <API key> \ ; \ add-apt-repository ppa:openjdk-r/ppa; \ apt-get update; \ apt-get install -y --<API key> \ openjdk-8-jre \ ; \
#!/bin/bash # This shell scripts generates the top-level Markdown structure of the # Snabb lwAFTR manual. # The authors list is automatically generated from Git history, # ordered from most to least commits. # Script based on src/doc/genbook.sh lwaftr_app=../../../apps/lwaftr/ cat <<EOF % Snabb lwAFTR Manual % $(git log --pretty="%an" $lwaftr_app | \ grep -v -e '^root$' | \ sort | uniq -c | sort -nr | sed 's/^[0-9 ]* awk 'BEGIN { first=1; } (NF >= 2) { if (first) { first=0 } else { printf("; ") }; printf("%s", $0) } END { print("") }') % Version $(git log -n1 --format="format:%h, %ad%n") $(cat README.welcome.md) $(cat README.build.md) $(cat README.running.md) $(cat README.testing.md) $(cat README.troubleshooting.md) $(cat README.bindingtable.md) $(cat README.configuration.md) $(cat README.rfccompliance.md) $(cat README.benchmarking.md) $(cat README.performance.md) $(cat README.virtualization.md) EOF
from hazelcast.serialization.bits import * from hazelcast.protocol.client_message import ClientMessage from hazelcast.protocol.custom_codec import * from hazelcast.util import <API key> from hazelcast.protocol.codec.map_message_type import * REQUEST_TYPE = <API key> RESPONSE_TYPE = 101 RETRYABLE = True def calculate_size(name, registration_id): """ Calculates the request payload size""" data_size = 0 data_size += calculate_size_str(name) data_size += calculate_size_str(registration_id) return data_size def encode_request(name, registration_id): """ Encode request into client_message""" client_message = ClientMessage(payload_size=calculate_size(name, registration_id)) client_message.set_message_type(REQUEST_TYPE) client_message.set_retryable(RETRYABLE) client_message.append_str(name) client_message.append_str(registration_id) client_message.update_frame_length() return client_message def decode_response(client_message, to_object=None): """ Decode response from client message""" parameters = dict(response=None) parameters['response'] = client_message.read_bool() return parameters
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for checks.""" from grr.lib import flags from grr.lib import test_lib from grr.lib.checks import hints from grr.lib.rdfvalues import client as rdf_client from grr.lib.rdfvalues import config_file as rdf_config_file from grr.lib.rdfvalues import protodict as rdf_protodict class HintsTests(test_lib.GRRBaseTest): """Test hint operations.""" def testCheckOverlay(self): """Overlay(hint1, hint2) should populate hint2 with the values of hint1.""" # Fully populated hint. full = { "problem": "Terminator needs trousers.\n", "fix": "Give me your clothes.\n", "format": "{mission}, {target}\n", "summary": "I'll be back." } # Partial hint partial = { "problem": "Terminator needs to go shopping.", "fix": "Phased plasma rifle in the 40-watt range.", "format": "", "summary": "" } # Partial overlaid with full. overlay = { "problem": "Terminator needs to go shopping.", "fix": "Phased plasma rifle in the 40-watt range.", "format": "{mission}, {target}", "summary": "I'll be back." } # Empty hint. empty = {"problem": "", "fix": "", "format": "", "summary": ""} # Empty hint should not clobber populated hint. starts_full = full.copy() starts_empty = empty.copy() hints.Overlay(starts_full, starts_empty) self.assertDictEqual(full, starts_full) self.assertDictEqual(empty, starts_empty) # Populate empty hint from partially populated hint. starts_partial = partial.copy() starts_empty = empty.copy() hints.Overlay(starts_empty, starts_partial) self.assertDictEqual(partial, starts_partial) self.assertDictEqual(partial, starts_empty) # Overlay the full and partial hints to get the hybrid. starts_full = full.copy() starts_partial = partial.copy() hints.Overlay(starts_partial, starts_full) self.assertDictEqual(full, starts_full) self.assertDictEqual(overlay, starts_partial) def testRdfFormatter(self): """Hints format RDF values with arbitrary values and attributes.""" # Create a complex RDF value rdf = rdf_client.ClientSummary() rdf.system_info.system = "Linux" rdf.system_info.node = "coreai.skynet.com" # Users (repeated) rdf.users = [rdf_client.User(username=u) for u in ("root", "jconnor")] # Interface (nested, repeated) addresses = [ rdf_client.NetworkAddress(human_readable=a) for a in ("1.1.1.1", "2.2.2.2", "3.3.3.3") ] eth0 = rdf_client.Interface(ifname="eth0", addresses=addresses[:2]) ppp0 = rdf_client.Interface(ifname="ppp0", addresses=addresses[2]) rdf.interfaces = [eth0, ppp0] template = ("{system_info.system} {users.username} {interfaces.ifname} " "{interfaces.addresses.human_readable}\n") hinter = hints.Hinter(template=template) expected = "Linux root,jconnor eth0,ppp0 1.1.1.1,2.2.2.2,3.3.3.3" result = hinter.Render(rdf) self.assertEqual(expected, result) def <API key>(self): """rdfvalue.KeyValue items need special handling to expand k and v.""" key = rdf_protodict.DataBlob().SetValue("skynet") value = rdf_protodict.DataBlob().SetValue([1997]) rdf = rdf_protodict.KeyValue(k=key, v=value) template = "{k}: {v}" hinter = hints.Hinter(template=template) expected = "skynet: 1997" result = hinter.Render(rdf) self.assertEqual(expected, result) def <API key>(self): sshd = rdf_config_file.SshdConfig() sshd.config = rdf_protodict.AttributedDict(skynet="operational") template = "{config.skynet}" hinter = hints.Hinter(template=template) expected = "operational" result = hinter.Render(sshd) self.assertEqual(expected, result) def <API key>(self): rdf = rdf_protodict.Dict() user1 = rdf_client.User(username="drexler") user2 = rdf_client.User(username="joy") rdf["cataclysm"] = "GreyGoo" rdf["thinkers"] = [user1, user2] rdf["reference"] = { "ecophage": ["bots", ["nanobots", ["picobots"]]], "doomsday": { "books": ["cats cradle", "prey"] } } template = ("{cataclysm}; {thinkers.username}; {reference.ecophage}; " "{reference.doomsday}\n") hinter = hints.Hinter(template=template) expected = ("GreyGoo; drexler,joy; bots,nanobots,picobots; " "books:cats cradle,prey") result = hinter.Render(rdf) self.assertEqual(expected, result) def testStatModeFormat(self): rdf = rdf_client.StatEntry(st_mode=33204) expected = "-rw-rw-r template = "{st_mode}" hinter = hints.Hinter(template=template) result = hinter.Render(rdf) self.assertEqual(expected, result) def main(argv): test_lib.main(argv) if __name__ == "__main__": flags.StartMain(main)
/** * Extension ID of Files.app. * @type {string} * @const */ var <API key> = '<API key>'; /** * Calls a remote test util in Files.app's extension. See: test_util.js. * * @param {string} func Function name. * @param {?string} appId Target window's App ID or null for functions * not requiring a window. * @param {Array.<*>} args Array of arguments. * @param {function(*)} callback Callback handling the function's result. */ function callRemoteTestUtil(func, appId, args, callback) { chrome.runtime.sendMessage( <API key>, { func: func, appId: appId, args: args }, callback); } chrome.test.runTests([ // Waits for the C++ code to send a string identifying a test, then runs that // test. function testRunner() { var command = chrome.extension.inIncognitoContext ? 'which test guest' : 'which test non-guest'; chrome.test.sendMessage(command, function(testCaseName) { // Run one of the test cases defined in the testcase namespace, in // test_cases.js. The test case name is passed via StartTest call in // <API key>.cc. if (testcase[testCaseName]) testcase[testCaseName](); else chrome.test.fail('Bogus test name passed to testRunner()'); }); } ]);
package theinternet.pages; import com.frameworkium.core.ui.annotations.Visible; import com.frameworkium.core.ui.pages.BasePage; import com.frameworkium.core.ui.pages.PageFactory; import io.qameta.allure.Step; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import ru.yandex.qatools.htmlelements.annotations.Name; import ru.yandex.qatools.htmlelements.element.FileInput; public class FileUploadPage extends BasePage<FileUploadPage> { @Visible @Name("Choose Files button") @FindBy(css = "input#file-upload") private FileInput chooseFileInput; @Visible @Name("Upload button") @FindBy(css = "input#file-submit") private WebElement uploadButton; @Step("Upload a file by choosing file and then clicking upload") public <API key> uploadFile(String filePath) { chooseFileInput.setFileToUpload(filePath); uploadButton.click(); return PageFactory.newInstance(<API key>.class); } }
import { Type } from 'angular2/src/facade/lang'; import { CanActivate } from './<API key>'; import { reflector } from 'angular2/src/core/reflection/reflection'; export function hasLifecycleHook(e, type) { if (!(type instanceof Type)) return false; return e.name in type.prototype; } export function getCanActivateHook(type) { var annotations = reflector.annotations(type); for (let i = 0; i < annotations.length; i += 1) { let annotation = annotations[i]; if (annotation instanceof CanActivate) { return annotation.fn; } } return null; } //# sourceMappingURL=<API key>.js.map
var msg = require('./locale'); var api = require('./apiJavascript.js'); var paramLists = require('./paramLists.js'); module.exports.blocks = [ {func: 'setDroid', parent: api, category: '', params: ['"R2-D2"'], dropdown: { 0: ['"random"', '"R2-D2"', '"C-3PO"'] } }, {func: 'setDroidSpeed', parent: api, category: '', params: ['"fast"'], dropdown: { 0: ['"random"', '"slow"', '"normal"', '"fast"'] } }, {func: 'setBackground', parent: api, category: '', params: ['"Hoth"'], dropdown: { 0: ['"random"', '"Endor"', '"Hoth"', '"Starship"'] } }, {func: 'setMap', parent: api, category: '', params: ['"blank"'], dropdown: { 0: ['"random"', '"blank"', '"circle"', '"horizontal"', '"grid"', '"blobs"'] } }, {func: 'moveRight', parent: api, category: '', }, {func: 'moveLeft', parent: api, category: '', }, {func: 'moveUp', parent: api, category: '', }, {func: 'moveDown', parent: api, category: '', }, {func: 'goRight', parent: api, category: '', }, {func: 'goLeft', parent: api, category: '', }, {func: 'goUp', parent: api, category: '', }, {func: 'goDown', parent: api, category: '', }, {func: 'playSound', parent: api, category: '', params: ['"R2-D2sound1"'], dropdown: { 0: paramLists.playSoundDropdown } }, {func: 'endGame', parent: api, category: '', params: ['"win"'], dropdown: { 0: ['"win"', '"lose"'] } }, {func: 'addPoints', parent: api, category: '', params: ["100"] }, {func: 'removePoints', parent: api, category: '', params: ["100"] }, {func: 'addCharacter', parent: api, category: '', params: ['"PufferPig"'], dropdown: { 0: ['"random"', '"Stormtrooper"', '"RebelPilot"', '"PufferPig"', '"Mynock"', '"MouseDroid"', '"Tauntaun"', '"Probot"'] } }, {func: 'moveFast', parent: api, category: '', params: ['"PufferPig"'], dropdown: { 0: ['"random"', '"Stormtrooper"', '"RebelPilot"', '"PufferPig"', '"Mynock"', '"MouseDroid"', '"Tauntaun"', '"Probot"'] } }, {func: 'moveNormal', parent: api, category: '', params: ['"PufferPig"'], dropdown: { 0: ['"random"', '"Stormtrooper"', '"RebelPilot"', '"PufferPig"', '"Mynock"', '"MouseDroid"', '"Tauntaun"', '"Probot"'] } }, {func: 'moveSlow', parent: api, category: '', params: ['"PufferPig"'], dropdown: { 0: ['"random"', '"Stormtrooper"', '"RebelPilot"', '"PufferPig"', '"Mynock"', '"MouseDroid"', '"Tauntaun"', '"Probot"'] } }, {func: 'whenLeft', block: 'function whenLeft() {}', expansion: 'function whenLeft() {\n __;\n}', category: '' }, {func: 'whenRight', block: 'function whenRight() {}', expansion: 'function whenRight() {\n __;\n}', category: '' }, {func: 'whenUp', block: 'function whenUp() {}', expansion: 'function whenUp() {\n __;\n}', category: '' }, {func: 'whenDown', block: 'function whenDown() {}', expansion: 'function whenDown() {\n __;\n}', category: '' }, {func: 'whenTouchObstacle', block: 'function whenTouchObstacle() {}', expansion: 'function whenTouchObstacle() {\n __;\n}', category: '' }, {func: 'whenGetCharacter', block: 'function whenGetCharacter() {}', expansion: 'function whenGetCharacter() {\n __;\n}', category: '' }, {func: 'whenGetStormtrooper', block: 'function whenGetStormtrooper() {}', expansion: 'function whenGetStormtrooper() {\n __;\n}', category: '' }, {func: 'whenGetRebelPilot', block: 'function whenGetRebelPilot() {}', expansion: 'function whenGetRebelPilot() {\n __;\n}', category: '' }, {func: 'whenGetPufferPig', block: 'function whenGetPufferPig() {}', expansion: 'function whenGetPufferPig() {\n __;\n}', category: '' }, {func: 'whenGetMynock', block: 'function whenGetMynock() {}', expansion: 'function whenGetMynock() {\n __;\n}', category: '' }, {func: 'whenGetMouseDroid', block: 'function whenGetMouseDroid() {}', expansion: 'function whenGetMouseDroid() {\n __;\n}', category: '' }, {func: 'whenGetTauntaun', block: 'function whenGetTauntaun() {}', expansion: 'function whenGetTauntaun() {\n __;\n}', category: '' }, {func: 'whenGetProbot', block: 'function whenGetProbot() {}', expansion: 'function whenGetProbot() {\n __;\n}', category: '' }, {func: '<API key>', block: 'function <API key>() {}', expansion: 'function <API key>() {\n __;\n}', category: '' }, {func: '<API key>', block: 'function <API key>() {}', expansion: 'function <API key>() {\n __;\n}', category: '' }, {func: '<API key>', block: 'function <API key>() {}', expansion: 'function <API key>() {\n __;\n}', category: '' }, {func: '<API key>', block: 'function <API key>() {}', expansion: 'function <API key>() {\n __;\n}', category: '' }, {func: 'whenGetAllMynocks', block: 'function whenGetAllMynocks() {}', expansion: 'function whenGetAllMynocks() {\n __;\n}', category: '' }, {func: '<API key>', block: 'function <API key>() {}', expansion: 'function <API key>() {\n __;\n}', category: '' }, {func: 'whenGetAllTauntauns', block: 'function whenGetAllTauntauns() {}', expansion: 'function whenGetAllTauntauns() {\n __;\n}', category: '' }, {func: 'whenGetAllProbots', block: 'function whenGetAllProbots() {}', expansion: 'function whenGetAllProbots() {\n __;\n}', category: '' }, // Functions hidden from autocomplete - not used in hoc2015: {func: '<API key>', block: 'function <API key>() {}', expansion: 'function <API key>() {\n __;\n}', category: '', noAutocomplete: true }, {func: 'whenTouchRebelPilot', block: 'function whenTouchRebelPilot() {}', expansion: 'function whenTouchRebelPilot() {\n __;\n}', category: '', noAutocomplete: true }, {func: 'whenTouchPufferPig', block: 'function whenTouchPufferPig() {}', expansion: 'function whenTouchPufferPig() {\n __;\n}', category: '', noAutocomplete: true }, {func: 'whenTouchMynock', block: 'function whenTouchMynock() {}', expansion: 'function whenTouchMynock() {\n __;\n}', category: '', noAutocomplete: true }, {func: 'whenTouchMouseDroid', block: 'function whenTouchMouseDroid() {}', expansion: 'function whenTouchMouseDroid() {\n __;\n}', category: '', noAutocomplete: true }, {func: 'whenTouchTauntaun', block: 'function whenTouchTauntaun() {}', expansion: 'function whenTouchTauntaun() {\n __;\n}', category: '', noAutocomplete: true }, {func: 'whenTouchProbot', block: 'function whenTouchProbot() {}', expansion: 'function whenTouchProbot() {\n __;\n}', category: '', noAutocomplete: true }, {func: 'whenTouchCharacter', block: 'function whenTouchCharacter() {}', expansion: 'function whenTouchCharacter() {\n __;\n}', category: '', noAutocomplete: true }, {func: 'changeScore', parent: api, category: '', params: ["1"], noAutocomplete: true }, {func: 'whenTouchGoal', block: 'function whenTouchGoal() {}', expansion: 'function whenTouchGoal() {\n __;\n}', category: '', noAutocomplete: true }, {func: 'whenTouchAllGoals', block: 'function whenTouchAllGoals() {}', expansion: 'function whenTouchAllGoals() {\n __;\n}', category: '', noAutocomplete: true }, {func: 'whenScore1000', block: 'function whenScore1000() {}', expansion: 'function whenScore1000() {\n __;\n}', category: '', noAutocomplete: true }, {func: 'setToChase', parent: api, category: '', params: ['"PufferPig"'], dropdown: { 0: ['"random"', '"Stormtrooper"', '"RebelPilot"', '"PufferPig"', '"Mynock"', '"MouseDroid"', '"Tauntaun"', '"Probot"'] }, noAutocomplete: true }, {func: 'setToFlee', parent: api, category: '', params: ['"PufferPig"'], dropdown: { 0: ['"random"', '"Stormtrooper"', '"RebelPilot"', '"PufferPig"', '"Mynock"', '"MouseDroid"', '"Tauntaun"', '"Probot"'] }, noAutocomplete: true }, {func: 'setToRoam', parent: api, category: '', params: ['"PufferPig"'], dropdown: { 0: ['"random"', '"Stormtrooper"', '"RebelPilot"', '"PufferPig"', '"Mynock"', '"MouseDroid"', '"Tauntaun"', '"Probot"'] }, noAutocomplete: true }, {func: 'setToStop', parent: api, category: '', params: ['"PufferPig"'], dropdown: { 0: ['"random"', '"Stormtrooper"', '"RebelPilot"', '"PufferPig"', '"Mynock"', '"MouseDroid"', '"Tauntaun"', '"Probot"'] }, noAutocomplete: true }, {func: 'setSprite', parent: api, category: '', params: ['0', '"R2-D2"'], dropdown: { 1: ['"random"', '"R2-D2"', '"C-3PO"'] }, noAutocomplete: true }, {func: 'setSpritePosition', parent: api, category: '', params: ["0", "7"], noAutocomplete: true }, {func: 'setSpriteSpeed', parent: api, category: '', params: ["0", "8"], noAutocomplete: true }, {func: 'setSpriteEmotion', parent: api, category: '', params: ["0", "1"], noAutocomplete: true }, {func: 'setSpriteSize', parent: api, category: '', params: ["0", "1.0"], noAutocomplete: true }, {func: 'throwProjectile', parent: api, category: '', params: ["0", "1", '"blue_fireball"'], noAutocomplete: true }, {func: 'vanish', parent: api, category: '', params: ["0"], noAutocomplete: true }, {func: 'move', parent: api, category: '', params: ["0", "1"], noAutocomplete: true }, {func: 'showDebugInfo', parent: api, category: '', params: ["false"], noAutocomplete: true }, {func: 'onEvent', parent: api, category: '', params: ["'when-left'", "function() {\n \n}"], noAutocomplete: true }, ]; module.exports.categories = { '': { color: 'red', blocks: [] }, 'Play Lab': { color: 'red', blocks: [] }, Commands: { color: 'red', blocks: [] }, Events: { color: 'green', blocks: [] }, }; module.exports.<API key> = true; module.exports.showParamDropdowns = true;
jsx3.require("jsx3.chart.Axis");jsx3.Class.defineClass("jsx3.chart.CategoryAxis",jsx3.chart.Axis,null,function(c,p){var ub={d:"h6",a:"aligned",c:"av",f:"gn",b:"between",e:"tickAlignment"};c.TICKS_ALIGNED=ub.a;c.TICKS_BETWEEN=ub.b;c.MAX_TICKS=200;c.BG={aligned:1,between:1};p.init=function(i,r,q){this.jsxsuper(i,r,q);this.tickAlignment=ub.b;this.categoryField=null;this.paddingLow=null;this.paddingHigh=null;this.Ho(ub.c,0);this.Ho(ub.d,0);};p.getTickAlignment=function(){return this.tickAlignment;};p.setTickAlignment=function(l){if(c.BG[l]){this.tickAlignment=l;}else throw new jsx3.<API key>(ub.e,l);};p.getCategoryField=function(){return this.categoryField;};p.setCategoryField=function(m){this.categoryField=m;};p.getPaddingLow=function(){return this.paddingLow!=null?this.paddingLow:0;};p.setPaddingLow=function(h){this.paddingLow=h;};p.getPaddingHigh=function(){return this.paddingHigh!=null?this.paddingHigh:0;};p.setPaddingHigh=function(r){this.paddingHigh=r;};p.fl=function(){this.Ll(ub.f);var da=this.getChart();if(da==null){this.Ho(ub.c,0);this.Ho(ub.d,0);}else{var tb=da.pe(this,true);var ib=da.bh();this.Ho(ub.d,tb.length);this.Ho(ub.c,ib!=null?ib.length:0);}};p.Hf=function(){var nb=this.pj(ub.f);if(nb!=null)return nb;var B=this.pj(ub.c);nb=[];if(B<1)return nb;var ga=this.getPaddingLow();var Va=this.getPaddingHigh();var x=this.tickAlignment==ub.b?B+1:B;var La=x-1;var fb=La+ga+Va;var pb=this.length/fb;var C=ga*pb;for(var Qa=0;Qa<x&&Qa<c.MAX_TICKS;Qa++)nb.push(Math.round(C+Qa*pb));this.Ho(ub.f,nb);return nb;};p.se=function(){var B=this.pj(ub.c);if(this.tickAlignment==ub.b){var Ab=this.Hf();var Xa=[];for(var va=0;va<B;va++)Xa[va]=Math.round((Ab[va]+Ab[va+1])/2);return Xa;}else return this.Hf();};p.Xj=function(b){var Pa=b;var z=this.getChart();if(this.categoryField&&z!=null){var ab=z.bh();if(ab!=null){var ga=ab[b];if(ga!=null)Pa=ga.getAttribute([this.categoryField]);}}return Pa;};p.mo=function(){return false;};p.getRangeForCategory=function(j){var _=this.Hf();if(this.tickAlignment==ub.b){if(j<0||j>=_.length-1)return null;else return [_[j],_[j+1]];}else{if(j<0||j>=_.length||_.length<2)return null;var Xa=j==0?_[1]-_[0]:_[j]-_[j-1];return [Math.round(_[j]-Xa/2),Math.round(_[j]+Xa/2)];}};p.getPointForCategory=function(n){var Aa=this.Hf();if(this.tickAlignment==ub.b){if(n<0||n>=Aa.length-1)return null;else return Math.round((Aa[n]+Aa[n+1])/2);}else return Aa[n];};c.getVersion=function(){return jsx3.chart.si;};});
(function(f, define){ define([], f); })(function(){ (function( window, undefined ) { var kendo = window.kendo || (window.kendo = { cultures: {} }); kendo.cultures["nn"] = { name: "nn", numberFormat: { pattern: ["-n"], decimals: 2, ",": " ", ".": ",", groupSize: [3], percent: { pattern: ["-n %","n %"], decimals: 2, ",": " ", ".": ",", groupSize: [3], symbol: "%" }, currency: { pattern: ["$ -n","$ n"], decimals: 2, ",": " ", ".": ",", groupSize: [3], symbol: "kr" } }, calendars: { standard: { days: { names: ["søndag","måndag","tysdag","onsdag","torsdag","fredag","laurdag"], namesAbbr: ["sø","må","ty","on","to","fr","la"], namesShort: ["sø","må","ty","on","to","fr","la"] }, months: { names: ["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember",""], namesAbbr: ["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des",""] }, AM: [""], PM: [""], patterns: { d: "dd.MM.yyyy", D: "d. MMMM yyyy", F: "d. MMMM yyyy HH:mm:ss", g: "dd.MM.yyyy HH:mm", G: "dd.MM.yyyy HH:mm:ss", m: "d. MMMM", M: "d. MMMM", s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss", t: "HH:mm", T: "HH:mm:ss", u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'", y: "MMMM yyyy", Y: "MMMM yyyy" }, "/": ".", ":": ":", firstDay: 1 } } } })(this); return window.kendo; }, typeof define == 'function' && define.amd ? define : function(_, f){ f(); });
using System; using System.Text; using System.Threading.Tasks; using Foundatio.Extensions; namespace Foundatio.Serializer { public interface ISerializer { Task<object> DeserializeAsync(byte[] data, Type objectType); Task<byte[]> SerializeAsync(object value); } public static class <API key> { public static Task<object> DeserializeAsync(this ISerializer serializer, string data, Type objectType) { return serializer.DeserializeAsync(Encoding.UTF8.GetBytes(data ?? String.Empty), objectType); } public static async Task<T> DeserializeAsync<T>(this ISerializer serializer, byte[] data) { return (T)await serializer.DeserializeAsync(data, typeof(T)).AnyContext(); } public static Task<T> DeserializeAsync<T>(this ISerializer serializer, string data) { return DeserializeAsync<T>(serializer, Encoding.UTF8.GetBytes(data ?? String.Empty)); } public static async Task<string> <API key>(this ISerializer serializer, object value) { if (value == null) return null; return Encoding.UTF8.GetString(await serializer.SerializeAsync(value).AnyContext()); } } }
package ec2 import ( "github.com/crowdmob/goamz/aws" "time" ) func Sign(auth aws.Auth, method, path string, params map[string]string, host string) { sign(auth, method, path, params, host) } func fixedTime() time.Time { return time.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC) } func FakeTime(fakeIt bool) { if fakeIt { timeNow = fixedTime } else { timeNow = time.Now } }
\section{File List} Here is a list of all files with brief descriptions\-:\begin{DoxyCompactList} \item\contentsline{section}{build/catkin\-\_\-generated/\hyperlink{<API key>}{generate\-\_\-cached\-\_\-setup.\-py} }{\pageref{<API key>}}{} \item\contentsline{section}{build/catkin\-\_\-generated/\hyperlink{order__packages_8py}{order\-\_\-packages.\-py} }{\pageref{order__packages_8py}}{} \item\contentsline{section}{build/catkin\-\_\-generated/installspace/\hyperlink{<API key>}{\-\_\-setup\-\_\-util.\-py} }{\pageref{<API key>}}{} \item\contentsline{section}{build/\-C\-Make\-Files/2.\-8.\-12.\-2/\-Compiler\-Id\-C/\hyperlink{CMakeCCompilerId_8c}{C\-Make\-C\-Compiler\-Id.\-c} }{\pageref{CMakeCCompilerId_8c}}{} \item\contentsline{section}{build/\-C\-Make\-Files/2.\-8.\-12.\-2/\-Compiler\-Id\-C\-X\-X/\hyperlink{<API key>}{C\-Make\-C\-X\-X\-Compiler\-Id.\-cpp} }{\pageref{<API key>}}{} \item\contentsline{section}{build/nubot\-\_\-common/catkin\-\_\-generated/\hyperlink{<API key>}{pkg.\-develspace.\-context.\-pc.\-py} }{\pageref{<API key>}}{} \item\contentsline{section}{build/nubot\-\_\-common/catkin\-\_\-generated/\hyperlink{<API key>}{pkg.\-installspace.\-context.\-pc.\-py} }{\pageref{<API key>}}{} \item\contentsline{section}{build/nubot\-\_\-common/cmake/\hyperlink{<API key>}{nubot\-\_\-common-\/genmsg-\/context.\-py} }{\pageref{<API key>}}{} \item\contentsline{section}{build/nubot\-\_\-simulation/nubot\-\_\-description/catkin\-\_\-generated/\hyperlink{nubot__simulation_2nubot__description_2catkin__generated_2pkg_8develspace_8context_8pc_8py}{pkg.\-develspace.\-context.\-pc.\-py} }{\pageref{nubot__simulation_2nubot__description_2catkin__generated_2pkg_8develspace_8context_8pc_8py}}{} \item\contentsline{section}{build/nubot\-\_\-simulation/nubot\-\_\-description/catkin\-\_\-generated/\hyperlink{nubot__simulation_2nubot__description_2catkin__generated_2pkg_8installspace_8context_8pc_8py}{pkg.\-installspace.\-context.\-pc.\-py} }{\pageref{nubot__simulation_2nubot__description_2catkin__generated_2pkg_8installspace_8context_8pc_8py}}{} \item\contentsline{section}{build/nubot\-\_\-simulation/nubot\-\_\-gazebo/catkin\-\_\-generated/\hyperlink{nubot__simulation_2nubot__gazebo_2catkin__generated_2pkg_8develspace_8context_8pc_8py}{pkg.\-develspace.\-context.\-pc.\-py} }{\pageref{nubot__simulation_2nubot__gazebo_2catkin__generated_2pkg_8develspace_8context_8pc_8py}}{} \item\contentsline{section}{build/nubot\-\_\-simulation/nubot\-\_\-gazebo/catkin\-\_\-generated/\hyperlink{nubot__simulation_2nubot__gazebo_2catkin__generated_2pkg_8installspace_8context_8pc_8py}{pkg.\-installspace.\-context.\-pc.\-py} }{\pageref{nubot__simulation_2nubot__gazebo_2catkin__generated_2pkg_8installspace_8context_8pc_8py}}{} \item\contentsline{section}{devel/\hyperlink{<API key>}{\-\_\-setup\-\_\-util.\-py} }{\pageref{<API key>}}{} \item\contentsline{section}{devel/include/nubot\-\_\-common/\hyperlink{BallHandle_8h}{Ball\-Handle.\-h} }{\pageref{BallHandle_8h}}{} \item\contentsline{section}{devel/include/nubot\-\_\-common/\hyperlink{<API key>}{Ball\-Handle\-Request.\-h} }{\pageref{<API key>}}{} \item\contentsline{section}{devel/include/nubot\-\_\-common/\hyperlink{<API key>}{Ball\-Handle\-Response.\-h} }{\pageref{<API key>}}{} \item\contentsline{section}{devel/include/nubot\-\_\-common/\hyperlink{Shoot_8h}{Shoot.\-h} }{\pageref{Shoot_8h}}{} \item\contentsline{section}{devel/include/nubot\-\_\-common/\hyperlink{ShootRequest_8h}{Shoot\-Request.\-h} }{\pageref{ShootRequest_8h}}{} \item\contentsline{section}{devel/include/nubot\-\_\-common/\hyperlink{ShootResponse_8h}{Shoot\-Response.\-h} }{\pageref{ShootResponse_8h}}{} \item\contentsline{section}{devel/include/nubot\-\_\-common/\hyperlink{VelCmd_8h}{Vel\-Cmd.\-h} }{\pageref{VelCmd_8h}}{} \item\contentsline{section}{devel/include/nubot\-\_\-gazebo/\hyperlink{<API key>}{Nubot\-Gazebo\-Config.\-h} }{\pageref{<API key>}}{} \item\contentsline{section}{devel/lib/python2.\-7/dist-\/packages/nubot\-\_\-common/\hyperlink{<API key>}{\-\_\-\-\_\-init\-\_\-\-\_\-.\-py} }{\pageref{<API key>}}{} \item\contentsline{section}{devel/lib/python2.\-7/dist-\/packages/nubot\-\_\-common/msg/\hyperlink{<API key>}{\-\_\-\-\_\-init\-\_\-\-\_\-.\-py} }{\pageref{<API key>}}{} \item\contentsline{section}{devel/lib/python2.\-7/dist-\/packages/nubot\-\_\-common/msg/\hyperlink{__VelCmd_8py}{\-\_\-\-Vel\-Cmd.\-py} }{\pageref{__VelCmd_8py}}{} \item\contentsline{section}{devel/lib/python2.\-7/dist-\/packages/nubot\-\_\-common/srv/\hyperlink{<API key>}{\-\_\-\-\_\-init\-\_\-\-\_\-.\-py} }{\pageref{<API key>}}{} \item\contentsline{section}{devel/lib/python2.\-7/dist-\/packages/nubot\-\_\-common/srv/\hyperlink{__BallHandle_8py}{\-\_\-\-Ball\-Handle.\-py} }{\pageref{__BallHandle_8py}}{} \item\contentsline{section}{devel/lib/python2.\-7/dist-\/packages/nubot\-\_\-common/srv/\hyperlink{__Shoot_8py}{\-\_\-\-Shoot.\-py} }{\pageref{__Shoot_8py}}{} \item\contentsline{section}{devel/lib/python2.\-7/dist-\/packages/nubot\-\_\-gazebo/\hyperlink{<API key>}{\-\_\-\-\_\-init\-\_\-\-\_\-.\-py} }{\pageref{<API key>}}{} \item\contentsline{section}{devel/lib/python2.\-7/dist-\/packages/nubot\-\_\-gazebo/cfg/\hyperlink{<API key>}{\-\_\-\-\_\-init\-\_\-\-\_\-.\-py} }{\pageref{<API key>}}{} \item\contentsline{section}{devel/lib/python2.\-7/dist-\/packages/nubot\-\_\-gazebo/cfg/\hyperlink{<API key>}{Nubot\-Gazebo\-Config.\-py} }{\pageref{<API key>}}{} \item\contentsline{section}{src/nubot\-\_\-common/core/include/nubot/core/\hyperlink{Angle_8hpp}{Angle.\-hpp} }{\pageref{Angle_8hpp}}{} \item\contentsline{section}{src/nubot\-\_\-common/core/include/nubot/core/\hyperlink{Circle_8hpp}{Circle.\-hpp} }{\pageref{Circle_8hpp}}{} \item\contentsline{section}{src/nubot\-\_\-common/core/include/nubot/core/\hyperlink{core_8hpp}{core.\-hpp} }{\pageref{core_8hpp}}{} \item\contentsline{section}{src/nubot\-\_\-common/core/include/nubot/core/\hyperlink{DPoint_8hpp}{D\-Point.\-hpp} }{\pageref{DPoint_8hpp}}{} \item\contentsline{section}{src/nubot\-\_\-common/core/include/nubot/core/\hyperlink{Line_8hpp}{Line.\-hpp} }{\pageref{Line_8hpp}}{} \item\contentsline{section}{src/nubot\-\_\-common/core/include/nubot/core/\hyperlink{PPoint_8hpp}{P\-Point.\-hpp} }{\pageref{PPoint_8hpp}}{} \item\contentsline{section}{src/nubot\-\_\-common/core/include/nubot/core/\hyperlink{time_8hpp}{time.\-hpp} }{\pageref{time_8hpp}}{} \item\contentsline{section}{src/nubot\-\_\-simulation/nubot\-\_\-gazebo/plugins/\hyperlink{nubot__gazebo_8cc}{nubot\-\_\-gazebo.\-cc} }{\pageref{nubot__gazebo_8cc}}{} \item\contentsline{section}{src/nubot\-\_\-simulation/nubot\-\_\-gazebo/plugins/\hyperlink{nubot__gazebo_8hh}{nubot\-\_\-gazebo.\-hh} }{\pageref{nubot__gazebo_8hh}}{} \item\contentsline{section}{src/nubot\-\_\-simulation/nubot\-\_\-gazebo/plugins/\hyperlink{nubot__PID_8cc}{nubot\-\_\-\-P\-I\-D.\-cc} }{\pageref{nubot__PID_8cc}}{} \item\contentsline{section}{src/nubot\-\_\-simulation/nubot\-\_\-gazebo/plugins/\hyperlink{nubot__PID_8hh}{nubot\-\_\-\-P\-I\-D.\-hh} }{\pageref{nubot__PID_8hh}}{} \item\contentsline{section}{src/nubot\-\_\-simulation/nubot\-\_\-gazebo/plugins/\hyperlink{<API key>}{nubot\-\_\-teleop\-\_\-keyboard.\-cc} }{\pageref{<API key>}}{} \item\contentsline{section}{src/nubot\-\_\-simulation/nubot\-\_\-gazebo/plugins/\hyperlink{<API key>}{nubot\-\_\-teleop\-\_\-keyboard.\-hh} }{\pageref{<API key>}}{} \item\contentsline{section}{src/nubot\-\_\-simulation/nubot\-\_\-gazebo/plugins/\hyperlink{<API key>}{parabolic\-\_\-transition\-\_\-planning.\-cc} }{\pageref{<API key>}}{} \item\contentsline{section}{src/nubot\-\_\-simulation/nubot\-\_\-gazebo/plugins/\hyperlink{<API key>}{parabolic\-\_\-transition\-\_\-planning.\-hh} }{\pageref{<API key>}}{} \item\contentsline{section}{src/nubot\-\_\-simulation/nubot\-\_\-gazebo/plugins/\hyperlink{vector__angle_8hh}{vector\-\_\-angle.\-hh} }{\pageref{vector__angle_8hh}}{} \end{DoxyCompactList}
/* jshint node:true */ 'use strict'; describe(require('path').basename(__filename), function () { var base = require('./base-task-data-spec'); base.before(function (context) { context.taskdefinition = helper.require( '/lib/task-data/base-tasks/<API key>.js' ); }); describe('task-data', function () { base.examples(); }); });
using System; using System.Collections.Generic; using System.Linq; using System.Text; using RestSharp.Deserializers; namespace Twilio { public class IpAddress : TwilioBase { public string Sid { get; set; } public string FriendlyName { get; set; } [DeserializeAs(Name="IpAddress")] public string Address { get; set; } } }
package provision import ( "bytes" "fmt" "io/ioutil" "net/url" "path" "path/filepath" "strconv" "strings" log "github.com/Sirupsen/logrus" "github.com/docker/machine/libmachine/auth" "github.com/docker/machine/libmachine/provision/pkgaction" "github.com/docker/machine/libmachine/swarm" "github.com/docker/machine/utils" ) type DockerOptions struct { EngineOptions string EngineOptionsPath string } func <API key>(p Provisioner) error { // install docker - until cloudinit we use ubuntu everywhere so we // just install it using the docker repos if output, err := p.SSHCommand("if ! type docker; then curl -sSL https://get.docker.com | sh -; fi"); err != nil { var buf bytes.Buffer if _, err := buf.ReadFrom(output.Stderr); err != nil { return err } return fmt.Errorf("error installing docker: %s\n", buf.String()) } return nil } func ConfigureAuth(p Provisioner, authOptions auth.AuthOptions) error { var ( err error ) machineName := p.GetDriver().GetMachineName() org := machineName bits := 2048 ip, err := p.GetDriver().GetIP() if err != nil { return err } // copy certs to client dir for docker client machineDir := filepath.Join(utils.GetMachineDir(), machineName) if err := utils.CopyFile(authOptions.CaCertPath, filepath.Join(machineDir, "ca.pem")); err != nil { log.Fatalf("Error copying ca.pem to machine dir: %s", err) } if err := utils.CopyFile(authOptions.ClientCertPath, filepath.Join(machineDir, "cert.pem")); err != nil { log.Fatalf("Error copying cert.pem to machine dir: %s", err) } if err := utils.CopyFile(authOptions.ClientKeyPath, filepath.Join(machineDir, "key.pem")); err != nil { log.Fatalf("Error copying key.pem to machine dir: %s", err) } log.Debugf("generating server cert: %s ca-key=%s private-key=%s org=%s", authOptions.ServerCertPath, authOptions.CaCertPath, authOptions.PrivateKeyPath, org, ) // TODO: Switch to passing just authOptions to this func // instead of all these individual fields err = utils.GenerateCert( []string{ip}, authOptions.ServerCertPath, authOptions.ServerKeyPath, authOptions.CaCertPath, authOptions.PrivateKeyPath, org, bits, ) if err != nil { return fmt.Errorf("error generating server cert: %s", err) } if err := p.Service("docker", pkgaction.Stop); err != nil { return err } dockerDir := p.GetDockerOptionsDir() if _, err := p.SSHCommand(fmt.Sprintf("sudo mkdir -p %s", dockerDir)); err != nil { return err } // upload certs and configure TLS auth caCert, err := ioutil.ReadFile(authOptions.CaCertPath) if err != nil { return err } // due to windows clients, we cannot use filepath.Join as the paths // will be mucked on the linux hosts machineCaCertPath := path.Join(dockerDir, "ca.pem") authOptions.CaCertRemotePath = machineCaCertPath serverCert, err := ioutil.ReadFile(authOptions.ServerCertPath) if err != nil { return err } <API key> := path.Join(dockerDir, "server.pem") authOptions.<API key> = <API key> serverKey, err := ioutil.ReadFile(authOptions.ServerKeyPath) if err != nil { return err } <API key> := path.Join(dockerDir, "server-key.pem") authOptions.ServerKeyRemotePath = <API key> if _, err = p.SSHCommand(fmt.Sprintf("echo \"%s\" | sudo tee %s", string(caCert), machineCaCertPath)); err != nil { return err } if _, err = p.SSHCommand(fmt.Sprintf("echo \"%s\" | sudo tee %s", string(serverKey), <API key>)); err != nil { return err } if _, err = p.SSHCommand(fmt.Sprintf("echo \"%s\" | sudo tee %s", string(serverCert), <API key>)); err != nil { return err } dockerUrl, err := p.GetDriver().GetURL() if err != nil { return err } u, err := url.Parse(dockerUrl) if err != nil { return err } dockerPort := 2376 parts := strings.Split(u.Host, ":") if len(parts) == 2 { dPort, err := strconv.Atoi(parts[1]) if err != nil { return err } dockerPort = dPort } dkrcfg, err := p.<API key>(dockerPort, authOptions) if err != nil { return err } if _, err = p.SSHCommand(fmt.Sprintf("echo \"%s\" | sudo tee -a %s", dkrcfg.EngineOptions, dkrcfg.EngineOptionsPath)); err != nil { return err } if err := p.Service("docker", pkgaction.Start); err != nil { return err } return nil } func <API key>(driverName string, authOptions auth.AuthOptions) string { return fmt.Sprintf(`--tlsverify --tlscacert=%s --tlskey=%s --tlscert=%s %s`, authOptions.CaCertRemotePath, authOptions.ServerKeyRemotePath, authOptions.<API key>, fmt.Sprintf("--label=provider=%s", driverName), ) } func configureSwarm(p Provisioner, swarmOptions swarm.SwarmOptions) error { if !swarmOptions.IsSwarm { return nil } basePath := p.GetDockerOptionsDir() ip, err := p.GetDriver().GetIP() if err != nil { return err } tlsCaCert := path.Join(basePath, "ca.pem") tlsCert := path.Join(basePath, "server.pem") tlsKey := path.Join(basePath, "server-key.pem") masterArgs := fmt.Sprintf("--tlsverify --tlscacert=%s --tlscert=%s --tlskey=%s -H %s %s", tlsCaCert, tlsCert, tlsKey, swarmOptions.Host, swarmOptions.Discovery) nodeArgs := fmt.Sprintf("--addr %s:2376 %s", ip, swarmOptions.Discovery) u, err := url.Parse(swarmOptions.Host) if err != nil { return err } parts := strings.Split(u.Host, ":") port := parts[1] // TODO: Do not hardcode daemon port, ask the driver if err := utils.WaitForDocker(ip, 2376); err != nil { return err } if _, err := p.SSHCommand(fmt.Sprintf("sudo docker pull %s", swarm.DockerImage)); err != nil { return err } dockerDir := p.GetDockerOptionsDir() // if master start master agent if swarmOptions.Master { log.Debug("launching swarm master") log.Debugf("master args: %s", masterArgs) if _, err = p.SSHCommand(fmt.Sprintf("sudo docker run -d -p %s:%s --restart=always --name swarm-agent-master -v %s:%s %s manage %s", port, port, dockerDir, dockerDir, swarm.DockerImage, masterArgs)); err != nil { return err } } // start node agent log.Debug("launching swarm node") log.Debugf("node args: %s", nodeArgs) if _, err = p.SSHCommand(fmt.Sprintf("sudo docker run -d --restart=always --name swarm-agent -v %s:%s %s join %s", dockerDir, dockerDir, swarm.DockerImage, nodeArgs)); err != nil { return err } return nil }
#include <shell/shell_rtt.h> #include <init.h> #include <SEGGER_RTT.h> #include <logging/log.h> BUILD_ASSERT_MSG(!(IS_ENABLED(<API key>) && COND_CODE_0(<API key>, (1), (0))), "Conflicting log RTT backend enabled on the same channel"); SHELL_RTT_DEFINE(shell_transport_rtt); SHELL_DEFINE(shell_rtt, <API key>, &shell_transport_rtt, <API key>, <API key>, SHELL_FLAG_OLF_CRLF); LOG_MODULE_REGISTER(shell_rtt, <API key>); static bool rtt_blocking; static void timer_handler(struct k_timer *timer) { const struct shell_rtt *sh_rtt = <API key>(timer); if (SEGGER_RTT_HasData(0)) { sh_rtt->handler(<API key>, sh_rtt->context); } } static int init(const struct shell_transport *transport, const void *config, <API key> evt_handler, void *context) { struct shell_rtt *sh_rtt = (struct shell_rtt *)transport->ctx; sh_rtt->handler = evt_handler; sh_rtt->context = context; k_timer_init(&sh_rtt->timer, timer_handler, NULL); <API key>(&sh_rtt->timer, (void *)sh_rtt); k_timer_start(&sh_rtt->timer, <API key>, <API key>); return 0; } static int uninit(const struct shell_transport *transport) { return 0; } static int enable(const struct shell_transport *transport, bool blocking) { struct shell_rtt *sh_rtt = (struct shell_rtt *)transport->ctx; if (blocking) { rtt_blocking = true; k_timer_stop(&sh_rtt->timer); } return 0; } static int write(const struct shell_transport *transport, const void *data, size_t length, size_t *cnt) { struct shell_rtt *sh_rtt = (struct shell_rtt *)transport->ctx; const u8_t *data8 = (const u8_t *)data; if (rtt_blocking) { *cnt = <API key>(0, data8, length); while (<API key>(0)) { /* empty */ } } else { *cnt = SEGGER_RTT_Write(0, data8, length); } sh_rtt->handler(<API key>, sh_rtt->context); return 0; } static int read(const struct shell_transport *transport, void *data, size_t length, size_t *cnt) { *cnt = SEGGER_RTT_Read(0, data, length); return 0; } const struct shell_transport_api <API key> = { .init = init, .uninit = uninit, .enable = enable, .write = write, .read = read }; static int enable_shell_rtt(struct device *arg) { ARG_UNUSED(arg); bool log_backend = <API key> > 0; u32_t level = (<API key> > LOG_LEVEL_DBG) ? <API key> : <API key>; shell_init(&shell_rtt, NULL, true, log_backend, level); return 0; } /* Function is used for testing purposes */ const struct shell *<API key>(void) { return &shell_rtt; } SYS_INIT(enable_shell_rtt, POST_KERNEL, 0);
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Fri Sep 05 23:35:02 UTC 2014 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Class org.apache.hadoop.fs.http.server.<API key>.LenParam (Apache Hadoop HttpFS 2.5.1 API) </TITLE> <META NAME="date" CONTENT="2014-09-05"> <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.fs.http.server.<API key>.LenParam (Apache Hadoop HttpFS 2.5.1 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/fs/http/server/<API key>.LenParam.html" title="class in org.apache.hadoop.fs.http.server"><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/fs/http/server//<API key>.LenParam.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="<API key>.LenParam.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.fs.http.server.<API key>.LenParam</B></H2> </CENTER> No usage of org.apache.hadoop.fs.http.server.<API key>.LenParam <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/fs/http/server/<API key>.LenParam.html" title="class in org.apache.hadoop.fs.http.server"><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/fs/http/server//<API key>.LenParam.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="<API key>.LenParam.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>
<?php namespace FontLib\WOFF; use FontLib\Table\DirectoryEntry; /** * WOFF font file. * * @package php-font-lib * * @property TableDirectoryEntry[] $directory */ class File extends \FontLib\TrueType\File { function parseHeader() { if (!empty($this->header)) { return; } $this->header = new Header($this); $this->header->parse(); } public function load($file) { parent::load($file); $this->parseTableEntries(); $dataOffset = $this->pos() + count($this->directory) * 20; $fw = $this->getTempFile(false); $fr = $this->f; $this->f = $fw; $offset = $this->header->encode(); foreach ($this->directory as $entry) { // Read ... $this->f = $fr; $this->seek($entry->offset); $data = $this->read($entry->length); if ($entry->length < $entry->origLength) { $data = gzuncompress($data); } // Prepare data ... $length = strlen($data); $entry->length = $entry->origLength = $length; $entry->offset = $dataOffset; // Write ... $this->f = $fw; // Woff Entry $this->seek($offset); $offset += $this->write($entry->tag, 4); // tag $offset += $this->writeUInt32($dataOffset); // offset $offset += $this->writeUInt32($length); // length $offset += $this->writeUInt32($length); // origLength $offset += $this->writeUInt32(DirectoryEntry::computeChecksum($data)); // checksum // Data $this->seek($dataOffset); $dataOffset += $this->write($data, $length); } $this->f = $fw; $this->seek(0); // Need to re-parse this, don't know why $this->header = null; $this->directory = array(); $this->parseTableEntries(); } }
using Newtonsoft.Json; namespace Nest { [JsonObject] public interface ILoggingAction : IAction { [JsonProperty("text")] string Text { get; set; } [JsonProperty("category")] string Category { get; set; } [JsonProperty("level")] LogLevel? Level { get; set; } } public class LoggingAction : ActionBase, ILoggingAction { public override ActionType ActionType => ActionType.Logging; public string Text { get; set; } public string Category { get; set; } public LogLevel? Level { get; set; } public LoggingAction(string name) : base(name) {} } public class <API key> : <API key><<API key>, ILoggingAction>, ILoggingAction { protected override ActionType ActionType => ActionType.Logging; LogLevel? ILoggingAction.Level { get; set; } string ILoggingAction.Text { get; set; } string ILoggingAction.Category { get; set; } public <API key>(string name) : base(name) {} public <API key> Level(LogLevel level) => Assign(a => a.Level = level); public <API key> Text(string text) => Assign(a => a.Text = text); public <API key> Category(string category) => Assign(a => a.Category = category); } }
package com.bt.pi.sss; import com.bt.pi.app.common.entities.User; public interface UserManager { boolean userExists(String accessKey); User getUserByAccessKey(String accessKey); }
#pragma once #include <aws/events/<API key>.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/events/model/ConnectionState.h> #include <aws/core/utils/DateTime.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class <API key>; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace CloudWatchEvents { namespace Model { class <API key> <API key> { public: <API key>(); <API key>(const Aws::<API key><Aws::Utils::Json::JsonValue>& result); <API key>& operator=(const Aws::<API key><Aws::Utils::Json::JsonValue>& result); /** * <p>The ARN of the connection that was updated.</p> */ inline const Aws::String& GetConnectionArn() const{ return m_connectionArn; } /** * <p>The ARN of the connection that was updated.</p> */ inline void SetConnectionArn(const Aws::String& value) { m_connectionArn = value; } /** * <p>The ARN of the connection that was updated.</p> */ inline void SetConnectionArn(Aws::String&& value) { m_connectionArn = std::move(value); } /** * <p>The ARN of the connection that was updated.</p> */ inline void SetConnectionArn(const char* value) { m_connectionArn.assign(value); } /** * <p>The ARN of the connection that was updated.</p> */ inline <API key>& WithConnectionArn(const Aws::String& value) { SetConnectionArn(value); return *this;} /** * <p>The ARN of the connection that was updated.</p> */ inline <API key>& WithConnectionArn(Aws::String&& value) { SetConnectionArn(std::move(value)); return *this;} /** * <p>The ARN of the connection that was updated.</p> */ inline <API key>& WithConnectionArn(const char* value) { SetConnectionArn(value); return *this;} /** * <p>The state of the connection that was updated.</p> */ inline const ConnectionState& GetConnectionState() const{ return m_connectionState; } /** * <p>The state of the connection that was updated.</p> */ inline void SetConnectionState(const ConnectionState& value) { m_connectionState = value; } /** * <p>The state of the connection that was updated.</p> */ inline void SetConnectionState(ConnectionState&& value) { m_connectionState = std::move(value); } /** * <p>The state of the connection that was updated.</p> */ inline <API key>& WithConnectionState(const ConnectionState& value) { SetConnectionState(value); return *this;} /** * <p>The state of the connection that was updated.</p> */ inline <API key>& WithConnectionState(ConnectionState&& value) { SetConnectionState(std::move(value)); return *this;} /** * <p>A time stamp for the time that the connection was created.</p> */ inline const Aws::Utils::DateTime& GetCreationTime() const{ return m_creationTime; } /** * <p>A time stamp for the time that the connection was created.</p> */ inline void SetCreationTime(const Aws::Utils::DateTime& value) { m_creationTime = value; } /** * <p>A time stamp for the time that the connection was created.</p> */ inline void SetCreationTime(Aws::Utils::DateTime&& value) { m_creationTime = std::move(value); } /** * <p>A time stamp for the time that the connection was created.</p> */ inline <API key>& WithCreationTime(const Aws::Utils::DateTime& value) { SetCreationTime(value); return *this;} /** * <p>A time stamp for the time that the connection was created.</p> */ inline <API key>& WithCreationTime(Aws::Utils::DateTime&& value) { SetCreationTime(std::move(value)); return *this;} /** * <p>A time stamp for the time that the connection was last modified.</p> */ inline const Aws::Utils::DateTime& GetLastModifiedTime() const{ return m_lastModifiedTime; } /** * <p>A time stamp for the time that the connection was last modified.</p> */ inline void SetLastModifiedTime(const Aws::Utils::DateTime& value) { m_lastModifiedTime = value; } /** * <p>A time stamp for the time that the connection was last modified.</p> */ inline void SetLastModifiedTime(Aws::Utils::DateTime&& value) { m_lastModifiedTime = std::move(value); } /** * <p>A time stamp for the time that the connection was last modified.</p> */ inline <API key>& <API key>(const Aws::Utils::DateTime& value) { SetLastModifiedTime(value); return *this;} /** * <p>A time stamp for the time that the connection was last modified.</p> */ inline <API key>& <API key>(Aws::Utils::DateTime&& value) { SetLastModifiedTime(std::move(value)); return *this;} /** * <p>A time stamp for the time that the connection was last authorized.</p> */ inline const Aws::Utils::DateTime& <API key>() const{ return <API key>; } /** * <p>A time stamp for the time that the connection was last authorized.</p> */ inline void <API key>(const Aws::Utils::DateTime& value) { <API key> = value; } /** * <p>A time stamp for the time that the connection was last authorized.</p> */ inline void <API key>(Aws::Utils::DateTime&& value) { <API key> = std::move(value); } /** * <p>A time stamp for the time that the connection was last authorized.</p> */ inline <API key>& <API key>(const Aws::Utils::DateTime& value) { <API key>(value); return *this;} /** * <p>A time stamp for the time that the connection was last authorized.</p> */ inline <API key>& <API key>(Aws::Utils::DateTime&& value) { <API key>(std::move(value)); return *this;} private: Aws::String m_connectionArn; ConnectionState m_connectionState; Aws::Utils::DateTime m_creationTime; Aws::Utils::DateTime m_lastModifiedTime; Aws::Utils::DateTime <API key>; }; } // namespace Model } // namespace CloudWatchEvents } // namespace Aws
using System; using BEPUphysics.BroadPhaseEntries; using BEPUphysics.BroadPhaseSystems; using BEPUphysics.BroadPhaseEntries.MobileCollidables; using BEPUphysics.CollisionTests; using BEPUphysics.CollisionTests.CollisionAlgorithms.GJK; using BEPUphysics.CollisionTests.Manifolds; using BEPUphysics.Constraints.Collision; using BEPUphysics.PositionUpdating; using BEPUphysics.Settings; namespace BEPUphysics.NarrowPhaseSystems.Pairs { <summary> Handles a convex-convex collision pair. </summary> public class <API key> : <API key> { ConvexCollidable convexA; ConvexCollidable convexB; <API key> contactManifold = new <API key>(); public override Collidable CollidableA { get { return convexA; } } public override Collidable CollidableB { get { return convexB; } } <summary> Gets the contact manifold used by the pair handler. </summary> public override ContactManifold ContactManifold { get { return contactManifold; } } public override Entities.Entity EntityA { get { return convexA.entity; } } public override Entities.Entity EntityB { get { return convexB.entity; } } <summary> Initializes the pair handler. </summary> <param name="entryA">First entry in the pair.</param> <param name="entryB">Second entry in the pair.</param> public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB) { convexA = entryA as ConvexCollidable; convexB = entryB as ConvexCollidable; if (convexA == null || convexB == null) { throw new ArgumentException("Inappropriate types used to initialize pair."); } base.Initialize(entryA, entryB); } <summary> Cleans up the pair handler. </summary> public override void CleanUp() { base.CleanUp(); convexA = null; convexB = null; } } }
<?php final class <API key> extends <API key> { public function getBaseURI() { return '/differential/'; } public function getName() { return pht('Differential'); } public function getMenuName() { return pht('Code Review'); } public function getShortDescription() { return pht('Pre-Commit Review'); } public function getIcon() { return 'fa-cog'; } public function isPinnedByDefault(PhabricatorUser $viewer) { return true; } public function <API key>(PhabricatorUser $viewer) { return array( array( 'name' => pht('Differential User Guide'), 'href' => PhabricatorEnv::getDoclink('Differential User Guide'), ), ); } public function <API key>() { return array( new <API key>(), ); } public function getTitleGlyph() { return "\xE2\x9A\x99"; } public function getOverview() { return pht( 'Differential is a **code review application** which allows '. 'engineers to review, discuss and approve changes to software.'); } public function getRoutes() { return array( '/D(?P<id>[1-9]\d*)' => '<API key>', '/differential/' => array( '(?:query/(?P<queryKey>[^/]+)/)?' => '<API key>', 'diff/' => array( '(?P<id>[1-9]\d*)/' => '<API key>', 'create/' => '<API key>', ), 'changeset/' => '<API key>', 'revision/' => array( $this->getEditRoutePattern('edit/') => '<API key>', $this->getEditRoutePattern('attach/(?P<diffID>[^/]+)/to/') => '<API key>', 'closedetails/(?P<phid>[^/]+)/' => '<API key>', 'update/(?P<revisionID>[1-9]\d*)/' => '<API key>', 'operation/(?P<id>[1-9]\d*)/' => '<API key>', 'inlines/(?P<id>[1-9]\d*)/' => '<API key>', ), 'comment/' => array( 'preview/(?P<id>[1-9]\d*)/' => '<API key>', 'save/(?P<id>[1-9]\d*)/' => '<API key>', 'inline/' => array( 'preview/(?P<id>[1-9]\d*)/' => '<API key>', 'edit/(?P<id>[1-9]\d*)/' => '<API key>', ), ), 'preview/' => '<API key>', ), ); } public function getApplicationOrder() { return 0.100; } public function getRemarkupRules() { return array( new <API key>(), ); } public function <API key>() { return true; } public function getAppEmailBlurb() { return pht( 'Send email to these addresses to create revisions. The body of the '. 'message and / or one or more attachments should be the output of a '. '"diff" command. %s', phutil_tag( 'a', array( 'href' => $this-><API key>(), ), pht('Learn More'))); } protected function <API key>() { return array( <API key>::CAPABILITY => array( 'caption' => pht('Default view policy for newly created revisions.'), 'template' => <API key>::TYPECONST, 'capability' => <API key>::CAN_VIEW, ), ); } public function <API key>() { return array( 'revision' => array( 'name' => pht('Email Commands: Revisions'), 'header' => pht('Interacting with Differential Revisions'), 'object' => new <API key>(), 'summary' => pht( 'This page documents the commands you can use to interact with '. 'revisions in Differential.'), ), ); } public function <API key>() { return array( <API key>::TYPECONST, ); } }
namespace System.Web.Mvc { public abstract class MvcFilter : IMvcFilter { protected MvcFilter() { } protected MvcFilter(bool allowMultiple, int order) { AllowMultiple = allowMultiple; Order = order; } public bool AllowMultiple { get; private set; } public int Order { get; private set; } } }
(function(f, define){ define([], f); })(function(){ (function( window, undefined ) { var kendo = window.kendo || (window.kendo = { cultures: {} }); kendo.cultures["he"] = { name: "he", numberFormat: { pattern: ["-n"], decimals: 2, ",": ",", ".": ".", groupSize: [3], percent: { pattern: ["-n%","n%"], decimals: 2, ",": ",", ".": ".", groupSize: [3], symbol: "%" }, currency: { pattern: ["$-n","$ n"], decimals: 2, ",": ",", ".": ".", groupSize: [3], symbol: "₪" } }, calendars: { standard: { days: { names: ["יום ראשון","יום שני","יום שלישי","יום רביעי","יום חמישי","יום שישי","שבת"], namesAbbr: ["יום א","יום ב","יום ג","יום ד","יום ה","יום ו","שבת"], namesShort: ["א","ב","ג","ד","ה","ו","ש"] }, months: { names: ["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר",""], namesAbbr: ["ינו","פבר","מרץ","אפר","מאי","יונ","יול","אוג","ספט","אוק","נוב","דצמ",""] }, AM: ["AM","am","AM"], PM: ["PM","pm","PM"], patterns: { d: "dd/MM/yyyy", D: "dddd dd MMMM yyyy", F: "dddd dd MMMM yyyy HH:mm:ss", g: "dd/MM/yyyy HH:mm", G: "dd/MM/yyyy HH:mm:ss", m: "dd MMMM", M: "dd MMMM", s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss", t: "HH:mm", T: "HH:mm:ss", u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'", y: "MMMM yyyy", Y: "MMMM yyyy" }, "/": "/", ":": ":", firstDay: 0 } } } })(this); return window.kendo; }, typeof define == 'function' && define.amd ? define : function(_, f){ f(); });
package net.stickycode.configuration.value; import net.stickycode.configuration.ConfigurationValue; public class SystemValue implements ConfigurationValue { private String value; public SystemValue(String value) { this.value = value; } @Override public String get() { return value; } @Override public boolean hasPrecedence(ConfigurationValue v) { if (ApplicationValue.class.isAssignableFrom(v.getClass())) return false; if (SystemValue.class.isAssignableFrom(v.getClass())) return false; return true; } @Override public String toString() { return getClass().getSimpleName() + "{" + value + "}"; } }
// Generated by xsd compiler for android/java // DO NOT CHANGE! package com.ebay.marketplace.search.v1.services; import com.leansoft.nano.annotation.*; /** * * Reserved for future use. * */ @RootElement(name = "<API key>", namespace = "http: public class <API key> extends <API key> { @Element private <API key> <API key>; @Element private <API key> <API key>; @Element private <API key> <API key>; /** * public getter * * * Reserved for future use. * * * @returns com.ebay.marketplace.search.v1.services.<API key> */ public <API key> <API key>() { return this.<API key>; } /** * public setter * * * Reserved for future use. * * * @param com.ebay.marketplace.search.v1.services.<API key> */ public void <API key>(<API key> <API key>) { this.<API key> = <API key>; } /** * public getter * * * Reserved for future use. * * * @returns com.ebay.marketplace.search.v1.services.<API key> */ public <API key> <API key>() { return this.<API key>; } /** * public setter * * * Reserved for future use. * * * @param com.ebay.marketplace.search.v1.services.<API key> */ public void <API key>(<API key> <API key>) { this.<API key> = <API key>; } /** * public getter * * * Reserved for future use. * * * @returns com.ebay.marketplace.search.v1.services.<API key> */ public <API key> <API key>() { return this.<API key>; } /** * public setter * * * Reserved for future use. * * * @param com.ebay.marketplace.search.v1.services.<API key> */ public void <API key>(<API key> <API key>) { this.<API key> = <API key>; } }
package transaction import ( . "DNA/common" "DNA/common/serialization" "DNA/core/contract" "DNA/core/contract/program" sig "DNA/core/signature" "DNA/core/transaction/payload" . "DNA/errors" "crypto/sha256" "errors" "fmt" "io" "sort" ) //for different transaction types with different payload format //and transaction process methods type TransactionType byte const ( BookKeeping TransactionType = 0x00 IssueAsset TransactionType = 0x01 BookKeeper TransactionType = 0x02 PrivacyPayload TransactionType = 0x20 RegisterAsset TransactionType = 0x40 TransferAsset TransactionType = 0x80 Record TransactionType = 0x81 DeployCode TransactionType = 0xd0 DataFile TransactionType = 0x12 ) //Payload define the func for loading the payload data //base on payload type which have different struture type Payload interface { // Get payload data Data(version byte) []byte //Serialize payload data Serialize(w io.Writer, version byte) error Deserialize(r io.Reader, version byte) error } //Transaction is used for carry information or action to Ledger //validated transaction will be added to block and updates state correspondingly var TxStore ILedgerStore type Transaction struct { TxType TransactionType PayloadVersion byte Payload Payload Attributes []*TxAttribute UTXOInputs []*UTXOTxInput BalanceInputs []*BalanceTxInput Outputs []*TxOutput Programs []*program.Program //Inputs/Outputs map base on Asset (needn't serialize) AssetOutputs map[Uint256][]*TxOutput AssetInputAmount map[Uint256]Fixed64 AssetOutputAmount map[Uint256]Fixed64 hash *Uint256 } //Serialize the Transaction func (tx *Transaction) Serialize(w io.Writer) error { err := tx.SerializeUnsigned(w) if err != nil { return NewDetailErr(err, ErrNoCode, "Transaction txSerializeUnsigned Serialize failed.") } //Serialize Transaction's programs lens := uint64(len(tx.Programs)) err = serialization.WriteVarUint(w, lens) if err != nil { return NewDetailErr(err, ErrNoCode, "Transaction WriteVarUint failed.") } if lens > 0 { for _, p := range tx.Programs { err = p.Serialize(w) if err != nil { return NewDetailErr(err, ErrNoCode, "Transaction Programs Serialize failed.") } } } return nil } //Serialize the Transaction data without contracts func (tx *Transaction) SerializeUnsigned(w io.Writer) error { //txType w.Write([]byte{byte(tx.TxType)}) //PayloadVersion w.Write([]byte{tx.PayloadVersion}) //Payload if tx.Payload == nil { return errors.New("Transaction Payload is nil.") } tx.Payload.Serialize(w, tx.PayloadVersion) //[]*txAttribute err := serialization.WriteVarUint(w, uint64(len(tx.Attributes))) if err != nil { return NewDetailErr(err, ErrNoCode, "Transaction item txAttribute length serialization failed.") } if len(tx.Attributes) > 0 { for _, attr := range tx.Attributes { attr.Serialize(w) } } //[]*UTXOInputs err = serialization.WriteVarUint(w, uint64(len(tx.UTXOInputs))) if err != nil { return NewDetailErr(err, ErrNoCode, "Transaction item UTXOInputs length serialization failed.") } if len(tx.UTXOInputs) > 0 { for _, utxo := range tx.UTXOInputs { utxo.Serialize(w) } } // TODO BalanceInputs //[]*Outputs err = serialization.WriteVarUint(w, uint64(len(tx.Outputs))) if err != nil { return NewDetailErr(err, ErrNoCode, "Transaction item Outputs length serialization failed.") } if len(tx.Outputs) > 0 { for _, output := range tx.Outputs { output.Serialize(w) } } return nil } //deserialize the Transaction func (tx *Transaction) Deserialize(r io.Reader) error { // tx deserialize err := tx.DeserializeUnsigned(r) if err != nil { return NewDetailErr(err, ErrNoCode, "transaction Deserialize error") } // tx program lens, err := serialization.ReadVarUint(r, 0) if err != nil { return NewDetailErr(err, ErrNoCode, "transaction tx program Deserialize error") } programHashes := []*program.Program{} if lens > 0 { for i := 0; i < int(lens); i++ { outputHashes := new(program.Program) outputHashes.Deserialize(r) programHashes = append(programHashes, outputHashes) } tx.Programs = programHashes } return nil } func (tx *Transaction) DeserializeUnsigned(r io.Reader) error { var txType [1]byte _, err := io.ReadFull(r, txType[:]) if err != nil { return err } tx.TxType = TransactionType(txType[0]) return tx.<API key>(r) } func (tx *Transaction) <API key>(r io.Reader) error { var payloadVersion [1]byte _, err := io.ReadFull(r, payloadVersion[:]) tx.PayloadVersion = payloadVersion[0] if err != nil { return err } //payload //tx.Payload.Deserialize(r) switch tx.TxType { case RegisterAsset: tx.Payload = new(payload.RegisterAsset) case IssueAsset: tx.Payload = new(payload.IssueAsset) case TransferAsset: tx.Payload = new(payload.TransferAsset) case BookKeeping: tx.Payload = new(payload.BookKeeping) case Record: tx.Payload = new(payload.Record) case BookKeeper: tx.Payload = new(payload.BookKeeper) case PrivacyPayload: tx.Payload = new(payload.PrivacyPayload) case DataFile: tx.Payload = new(payload.DataFile) default: return errors.New("[Transaction],invalide transaction type.") } err = tx.Payload.Deserialize(r, tx.PayloadVersion) if err != nil { return NewDetailErr(err, ErrNoCode, "Payload Parse error") } //attributes Len, err := serialization.ReadVarUint(r, 0) if err != nil { return err } if Len > uint64(0) { for i := uint64(0); i < Len; i++ { attr := new(TxAttribute) err = attr.Deserialize(r) if err != nil { return err } tx.Attributes = append(tx.Attributes, attr) } } //UTXOInputs Len, err = serialization.ReadVarUint(r, 0) if err != nil { return err } if Len > uint64(0) { for i := uint64(0); i < Len; i++ { utxo := new(UTXOTxInput) err = utxo.Deserialize(r) if err != nil { return err } tx.UTXOInputs = append(tx.UTXOInputs, utxo) } } //TODO balanceInputs //Outputs Len, err = serialization.ReadVarUint(r, 0) if err != nil { return err } if Len > uint64(0) { for i := uint64(0); i < Len; i++ { output := new(TxOutput) output.Deserialize(r) tx.Outputs = append(tx.Outputs, output) } } return nil } func (tx *Transaction) GetProgramHashes() ([]Uint160, error) { if tx == nil { return []Uint160{}, errors.New("[Transaction],GetProgramHashes transaction is nil.") } hashs := []Uint160{} uniqHashes := []Uint160{} // add inputUTXO's transaction <API key>, err := tx.GetReference() if err != nil { return nil, NewDetailErr(err, ErrNoCode, "[Transaction], GetProgramHashes failed.") } for _, output := range <API key> { programHash := output.ProgramHash hashs = append(hashs, programHash) } for _, attribute := range tx.Attributes { if attribute.Usage == Script { dataHash, err := <API key>(attribute.Data) if err != nil { return nil, NewDetailErr(errors.New("[Transaction], GetProgramHashes err."), ErrNoCode, "") } hashs = append(hashs, Uint160(dataHash)) } } switch tx.TxType { case RegisterAsset: issuer := tx.Payload.(*payload.RegisterAsset).Issuer <API key>, err := contract.<API key>(issuer) if err != nil { return nil, NewDetailErr(err, ErrNoCode, "[Transaction], GetProgramHashes <API key> failed.") } astHash, err := ToCodeHash(<API key>) if err != nil { return nil, NewDetailErr(err, ErrNoCode, "[Transaction], GetProgramHashes ToCodeHash failed.") } hashs = append(hashs, astHash) case IssueAsset: result := tx.<API key>() if err != nil { return nil, NewDetailErr(err, ErrNoCode, "[Transaction], <API key> failed.") } for k := range result { tx, err := TxStore.GetTransaction(k) if err != nil { return nil, NewDetailErr(err, ErrNoCode, fmt.Sprintf("[Transaction], GetTransaction failed With AssetID:=%x", k)) } if tx.TxType != RegisterAsset { return nil, NewDetailErr(errors.New("[Transaction] error"), ErrNoCode, fmt.Sprintf("[Transaction], Transaction Type ileage With AssetID:=%x", k)) } switch v1 := tx.Payload.(type) { case *payload.RegisterAsset: hashs = append(hashs, v1.Controller) default: return nil, NewDetailErr(errors.New("[Transaction] error"), ErrNoCode, fmt.Sprintf("[Transaction], payload is illegal", k)) } } case DataFile: issuer := tx.Payload.(*payload.DataFile).Issuer <API key>, err := contract.<API key>(issuer) if err != nil { return nil, NewDetailErr(err, ErrNoCode, "[Transaction], GetProgramHashes <API key> failed.") } astHash, err := ToCodeHash(<API key>) if err != nil { return nil, NewDetailErr(err, ErrNoCode, "[Transaction], GetProgramHashes ToCodeHash failed.") } hashs = append(hashs, astHash) case TransferAsset: case Record: case BookKeeper: issuer := tx.Payload.(*payload.BookKeeper).Issuer <API key>, err := contract.<API key>(issuer) if err != nil { return nil, NewDetailErr(err, ErrNoCode, "[Transaction - BookKeeper], GetProgramHashes <API key> failed.") } astHash, err := ToCodeHash(<API key>) if err != nil { return nil, NewDetailErr(err, ErrNoCode, "[Transaction - BookKeeper], GetProgramHashes ToCodeHash failed.") } hashs = append(hashs, astHash) case PrivacyPayload: issuer := tx.Payload.(*payload.PrivacyPayload).EncryptAttr.(*payload.EcdhAes256).FromPubkey <API key>, err := contract.<API key>(issuer) if err != nil { return nil, NewDetailErr(err, ErrNoCode, "[Transaction], GetProgramHashes <API key> failed.") } astHash, err := ToCodeHash(<API key>) if err != nil { return nil, NewDetailErr(err, ErrNoCode, "[Transaction], GetProgramHashes ToCodeHash failed.") } hashs = append(hashs, astHash) default: } //remove dupilicated hashes uniq := make(map[Uint160]bool) for _, v := range hashs { uniq[v] = true } for k := range uniq { uniqHashes = append(uniqHashes, k) } sort.Sort(byProgramHashes(uniqHashes)) return uniqHashes, nil } func (tx *Transaction) SetPrograms(programs []*program.Program) { tx.Programs = programs } func (tx *Transaction) GetPrograms() []*program.Program { return tx.Programs } func (tx *Transaction) GetOutputHashes() ([]Uint160, error) { //TODO: implement Transaction.GetOutputHashes() return []Uint160{}, nil } func (tx *Transaction) GenerateAssetMaps() { //TODO: implement Transaction.GenerateAssetMaps() } func (tx *Transaction) GetMessage() []byte { return sig.GetHashData(tx) } func (tx *Transaction) Hash() Uint256 { if tx.hash == nil { d := sig.GetHashData(tx) temp := sha256.Sum256([]byte(d)) f := Uint256(sha256.Sum256(temp[:])) tx.hash = &f } return *tx.hash } func (tx *Transaction) SetHash(hash Uint256) { tx.hash = &hash } func (tx *Transaction) Type() InventoryType { return TRANSACTION } func (tx *Transaction) Verify() error { //TODO: Verify() return nil } func (tx *Transaction) GetReference() (map[*UTXOTxInput]*TxOutput, error) { if tx.TxType == RegisterAsset { return nil, nil } //UTXO input / Outputs reference := make(map[*UTXOTxInput]*TxOutput) // Key indexv UTXOInput for _, utxo := range tx.UTXOInputs { transaction, err := TxStore.GetTransaction(utxo.ReferTxID) if err != nil { return nil, NewDetailErr(err, ErrNoCode, "[Transaction], GetReference failed.") } index := utxo.ReferTxOutputIndex reference[utxo] = transaction.Outputs[index] } return reference, nil } func (tx *Transaction) <API key>() (TransactionResult, error) { result := make(map[Uint256]Fixed64) outputResult := tx.<API key>() InputResult, err := tx.<API key>() if err != nil { return nil, err } //calc the balance of input vs output for outputAssetid, outputValue := range outputResult { if inputValue, ok := InputResult[outputAssetid]; ok { result[outputAssetid] = inputValue - outputValue } else { result[outputAssetid] -= outputValue } } for inputAssetid, inputValue := range InputResult { if _, exist := result[inputAssetid]; !exist { result[inputAssetid] += inputValue } } return result, nil } func (tx *Transaction) <API key>() TransactionResult { var result = make(map[Uint256]Fixed64) for _, v := range tx.Outputs { amout, ok := result[v.AssetID] if ok { result[v.AssetID] = amout + v.Value } else { result[v.AssetID] = v.Value } } return result } func (tx *Transaction) <API key>() (TransactionResult, error) { reference, err := tx.GetReference() if err != nil { return nil, err } var result = make(map[Uint256]Fixed64) for _, v := range reference { amout, ok := result[v.AssetID] if ok { result[v.AssetID] = amout + v.Value } else { result[v.AssetID] = v.Value } } return result, nil } type byProgramHashes []Uint160 func (a byProgramHashes) Len() int { return len(a) } func (a byProgramHashes) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a byProgramHashes) Less(i, j int) bool { if a[i].CompareTo(a[j]) > 0 { return false } else { return true } }
// Use, modification and distribution are subject to the #ifndef <API key> #define <API key> #ifdef _MSC_VER #pragma once #endif #include <boost/config.hpp> #include <boost/cstdint.hpp> // for geofeatures_boost::uintmax_t #include <boost/detail/workaround.hpp> #include <boost/type_traits/is_integral.hpp> #include <algorithm> // for min and max #include <boost/config/no_tr1/cmath.hpp> #include <climits> #include <cfloat> #if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) # include <math.h> #endif #ifndef <API key> # include <limits> #endif #include <boost/math/tools/user.hpp> #if (defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__NetBSD__) \ || (defined(__hppa) && !defined(__OpenBSD__)) || (defined(<API key>) && (DBL_MANT_DIG != LDBL_MANT_DIG))) \ && !defined(<API key>) # define <API key> #endif #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) // Borland post 5.8.2 uses Dinkumware's std C lib which // doesn't have true long double precision. Earlier // versions are problematic too: # define <API key> # define <API key> # define <API key> _control87(MCW_EM,MCW_EM) # include <float.h> #endif #ifdef __IBMCPP__ // For reasons I don't unserstand, the tests with IMB's compiler all // pass at long double precision, but fail with real_concept, those tests // are disabled for now. (JM 2012). # define <API key> #endif #ifdef sun // Any use of __float128 in program startup code causes a segfault (tested JM 2015, Solaris 11). # define <API key> #endif #ifdef __HAIKU__ // Not sure what's up with the math detection on Haiku, but linking fails with // float128 code enabled, and we don't have an implementation of __expl, so // disabling long double functions for now as well. # define <API key> # define <API key> #endif #if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) && ((LDBL_MANT_DIG == 106) || (__LDBL_MANT_DIG__ == 106)) && !defined(<API key>) // Darwin's rather strange "double double" is rather hard to // support, it should be possible given enough effort though... # define <API key> #endif #if defined(unix) && defined(__INTEL_COMPILER) && (__INTEL_COMPILER <= 1000) && !defined(<API key>) // Intel compiler prior to version 10 has sporadic problems // calling the long double overloads of the std lib math functions: // calling ::powl is OK, but std::pow(long double, long double) // may segfault depending upon the value of the arguments passed // and the specific Linux distribution. // We'll be conservative and disable long double support for this compiler. // Comment out this #define and try building the tests to determine whether // your Intel compiler version has this issue or not. # define <API key> #endif #if defined(unix) && defined(__INTEL_COMPILER) // Intel compiler has sporadic issues compiling std::fpclassify depending on // the exact OS version used. Use our own code for this as we know it works // well on Intel processors: #define <API key> #endif #if defined(BOOST_MSVC) && !defined(_WIN32_WCE) // Better safe than sorry, our tests don't support hardware exceptions: # define <API key> _control87(MCW_EM,MCW_EM) #endif #ifdef __IBMCPP__ # define <API key> #endif #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) # define BOOST_MATH_USE_C99 #endif #if (defined(__hpux) && !defined(__hppa)) # define BOOST_MATH_USE_C99 #endif #if defined(__GNUC__) && defined(_GLIBCXX_USE_C99) # define BOOST_MATH_USE_C99 #endif #if defined(_LIBCPP_VERSION) && !defined(_MSC_VER) # define BOOST_MATH_USE_C99 #endif #if defined(__CYGWIN__) || defined(__HP_aCC) || defined(BOOST_INTEL) \ || defined(<API key>) \ || (defined(__GNUC__) && !defined(BOOST_MATH_USE_C99))\ || defined(<API key>) # define <API key> #endif #if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590) # include "boost/type.hpp" # include "boost/non_type.hpp" # define <API key>(t) geofeatures_boost::type<t>* = 0 # define <API key>(t) geofeatures_boost::type<t>* # define <API key>(t, v) geofeatures_boost::non_type<t, v>* = 0 # define <API key>(t, v) geofeatures_boost::non_type<t, v>* # define <API key>(t) \ , <API key>(t) # define <API key>(t) \ , <API key>(t) # define <API key>(t, v) \ , <API key>(t, v) # define <API key>(t, v) \ , <API key>(t, v) #else // no workaround needed: expand to nothing # define <API key>(t) # define <API key>(t) # define <API key>(t, v) # define <API key>(t, v) # define <API key>(t) # define <API key>(t) # define <API key>(t, v) # define <API key>(t, v) #endif // __SUNPRO_CC #if (defined(__SUNPRO_CC) || defined(__hppa) || defined(__GNUC__)) && !defined(<API key>) // Sun's compiler emits a hard error if a constant underflows, // as does aCC on PA-RISC, while gcc issues a large number of warnings: # define <API key>(x) 0.0 #else # define <API key>(x) x #endif #if BOOST_WORKAROUND(BOOST_MSVC, < 1400) // Define if constants too large for a float cause "bad" // values to be stored in the data, rather than infinity // or a suitably large value. # define <API key> #endif // Tune performance options for specific compilers: #ifdef BOOST_MSVC # define <API key> 2 #elif defined(BOOST_INTEL) # define <API key> 2 # define <API key> 2 #elif defined(__GNUC__) # define <API key> 3 # define <API key> 3 # define <API key>(RT, IT) RT # define <API key>(RV, SUF) RV##.0L #endif #if defined(BOOST_NO_LONG_LONG) && !defined(<API key>) # define <API key>(RT, IT) RT # define <API key>(RV, SUF) RV##.0L #endif // The maximum order of polynomial that will be evaluated // via an unrolled specialisation: #ifndef <API key> # define <API key> 17 #endif // Set the method used to evaluate polynomials and rationals: #ifndef <API key> # define <API key> 1 #endif #ifndef <API key> # define <API key> 0 #endif // decide whether to store constants as integers or reals: #ifndef <API key> # define <API key>(RT, IT) IT #endif #ifndef <API key> # define <API key>(RV, SUF) RV##SUF #endif // Test whether to support __float128: #if defined(<API key>) && defined(BOOST_GCC) && !defined(__STRICT_ANSI__) \ && !defined(<API key>) || defined(<API key>) // Only enable this when the compiler really is GCC as clang and probably // intel too don't support __float128 yet :-( #ifndef <API key> # define <API key> #endif # if defined(BOOST_INTEL) && defined(<API key>) && (<API key> >= 1310) && defined(__GNUC__) # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) # define <API key> __float128 # endif # elif defined(__GNUC__) # define <API key> __float128 # endif # ifndef <API key> # define <API key> _Quad # endif #endif // Check for WinCE with no iostream support: #if defined(_WIN32_WCE) && !defined(__SGI_STL_PORT) # define <API key> #endif // Helper macro for controlling the FP behaviour: #ifndef <API key> # define <API key> #endif // Helper macro for using statements: #define <API key> \ using std::abs;\ using std::acos;\ using std::cos;\ using std::fmod;\ using std::modf;\ using std::tan;\ using std::asin;\ using std::cosh;\ using std::frexp;\ using std::pow;\ using std::tanh;\ using std::atan;\ using std::exp;\ using std::ldexp;\ using std::sin;\ using std::atan2;\ using std::fabs;\ using std::log;\ using std::sinh;\ using std::ceil;\ using std::floor;\ using std::log10;\ using std::sqrt; #define <API key> <API key> namespace geofeatures_boost {} namespace boost = geofeatures_boost; namespace geofeatures_boost{ namespace math{ namespace tools { template <class T> inline T max <API key>(T a, T b, T c) { return (std::max)((std::max)(a, b), c); } template <class T> inline T max <API key>(T a, T b, T c, T d) { return (std::max)((std::max)(a, b), (std::max)(c, d)); } } // namespace tools template <class T> void <API key>(const T&) { } namespace detail{ template <class T> struct <API key> { static const bool value = geofeatures_boost::is_integral<T>::value #ifndef <API key> || (std::numeric_limits<T>::is_specialized && std::numeric_limits<T>::is_integer) #endif ; }; } }} // namespace geofeatures_boost namespace math #ifdef __GLIBC_PREREQ # if __GLIBC_PREREQ(2,14) # define <API key> # endif #endif #if ((defined(__linux__) && !defined(__UCLIBC__) && !defined(<API key>)) || defined(__QNX__) || defined(__IBMCPP__)) && !defined(BOOST_NO_FENV_H) // Basically powl and expl can return garbage when the result is small and certain exception flags are set // on entrance to these functions. This appears to have been fixed in Glibc 2.14 (May 2011). #include <boost/detail/fenv.hpp> # ifdef FE_ALL_EXCEPT namespace geofeatures_boost {} namespace boost = geofeatures_boost; namespace geofeatures_boost{ namespace math{ namespace detail { struct fpu_guard { fpu_guard() { fegetexceptflag(&m_flags, FE_ALL_EXCEPT); feclearexcept(FE_ALL_EXCEPT); } ~fpu_guard() { fesetexceptflag(&m_flags, FE_ALL_EXCEPT); } private: fexcept_t m_flags; }; } // namespace detail }} // namespaces # define <API key> geofeatures_boost::math::detail::fpu_guard local_guard_object; # define <API key> do{ fexcept_t cpu_flags; fegetexceptflag(&cpu_flags, FE_ALL_EXCEPT); <API key>(cpu_flags); } while(0); # else # define <API key> # define <API key> # endif #else // All other platforms. # define <API key> # define <API key> #endif #ifdef <API key> # include <iostream> # include <iomanip> # include <typeinfo> # define <API key>(x) \ std::cout << std::setprecision(35) << __FILE__ << ":" << __LINE__ << " " << x << std::endl; # define <API key>(name) <API key>(BOOST_STRINGIZE(name) << " = " << name) #else # define <API key>(x) # define <API key>(name) #endif #endif // <API key>
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports System.Threading Imports System.Threading.Tasks Imports System.Xml.Linq Imports Microsoft.CodeAnalysis.Completion Imports Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion Imports Microsoft.CodeAnalysis.Editor.UnitTests.Extensions Imports Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces Imports Microsoft.CodeAnalysis.Options Imports Microsoft.CodeAnalysis.VisualBasic.Completion.SuggestionMode Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Completion.CompletionProviders Public Class <API key> Inherits <API key> Public Sub New(workspaceFixture As <API key>) MyBase.New(workspaceFixture) End Sub <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Class C $$ End Class</a> Await <API key>(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Class C Public $$ End Class</a> Await VerifyBuilderAsync(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Module M Public $$ End Module</a> Await VerifyBuilderAsync(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Structure S Public $$ End Structure</a> Await VerifyBuilderAsync(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Class C WithEvents $$ End Class</a> Await VerifyBuilderAsync(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Class C Protected Friend $$ End Class</a> Await VerifyBuilderAsync(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Class C Public Sub Bar($$ End Sub End Class</a> Await VerifyBuilderAsync(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Class C Public Sub Bar(Optional foo as Integer, $$ End Sub End Class</a> Await <API key>(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Class C Public Sub Bar(Optional $$ End Sub End Class</a> Await VerifyBuilderAsync(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Class C Public Sub Bar(Optional x $$ End Sub End Class</a> Await <API key>(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Class C Public Sub Bar(Optional x As $$ End Sub End Class</a> Await <API key>(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Class C Public Sub Bar(Optional x As Integer $$ End Sub End Class</a> Await <API key>(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Class C Public Sub Bar(ByVal $$ End Sub End Class</a> Await VerifyBuilderAsync(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Class C Public Sub Bar(ByVal x $$ End Sub End Class</a> Await <API key>(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Class C Sub Foo $$ End Class</a> Await <API key>(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Class C Public Property SomeProp $$ End Class</a> Await <API key>(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestSelectClause1() As Task Dim markup = <a>Class z Sub bar() Dim a = New Integer(1, 2, 3) {} Dim foo = From z In a Select $$ End Sub End Class</a> Await VerifyBuilderAsync(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestSelectClause2() As Task Dim markup = <a>Class z Sub bar() Dim a = New Integer(1, 2, 3) {} Dim foo = From z In a Select 1, $$ End Sub End Class</a> Await VerifyBuilderAsync(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestForStatement1() As Task Dim markup = <a>Class z Sub bar() For $$ End Sub End Class</a> Await VerifyBuilderAsync(markup) End Function <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestForStatement2() As Task Dim markup = <a>Class z Sub bar() For $$ = 1 To 10 Next End Sub End Class</a> Await VerifyBuilderAsync(markup) End Function <WorkItem(545351, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545351")> <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a>Option Explicit Off Class C1 Sub M() Console.WriteLine($$ End Sub End Class </a> Await VerifyBuilderAsync(markup) End Function <WorkItem(546659, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/546659")> <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestUsingStatement() As Task Dim markup = <a> Class C1 Sub M() Using $$ End Sub End Class </a> Await VerifyBuilderAsync(markup) End Function <WorkItem(734596, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/734596")> <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a> Option Explicit Off Class C1 Sub M() $$ End Sub End Class </a> Await VerifyBuilderAsync(markup) End Function <WorkItem(734596, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/734596")> <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a> Option Explicit Off Class C1 Sub M() a = $$ End Sub End Class </a> Await VerifyBuilderAsync(markup) End Function <WorkItem(960416, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/960416")> <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function TestReadonlyField() As Task Dim markup = <a> Class C1 Readonly $$ Sub M() End Sub End Class </a> Await VerifyBuilderAsync(markup) End Function <WorkItem(1044441, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1044441")> <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function BuilderInDebugger() As Task Dim markup = <a> Class C1 Sub Foo() Dim __o = $$ End Sub End Class </a> Await VerifyBuilderAsync(markup, CompletionTrigger.Default, useDebuggerOptions:=True) End Function <WorkItem(7213, "https://github.com/dotnet/roslyn/issues/7213")> <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a> Namespace $$ End Class </a> Await VerifyBuilderAsync(markup, CompletionTrigger.Default) End Function <WorkItem(7213, "https://github.com/dotnet/roslyn/issues/7213")> <Fact, Trait(Traits.Feature, Traits.Features.Completion)> Public Async Function <API key>() As Task Dim markup = <a> Namespace A.$$ End Class </a> Await VerifyBuilderAsync(markup, CompletionTrigger.Default) End Function Private Function <API key>(markup As XElement, Optional triggerInfo As CompletionTrigger? = Nothing, Optional useDebuggerOptions As Boolean = False) As Task Return <API key>(markup, isBuilder:=False, triggerInfo:=triggerInfo, useDebuggerOptions:=useDebuggerOptions) End Function Private Function VerifyBuilderAsync(markup As XElement, Optional triggerInfo As CompletionTrigger? = Nothing, Optional useDebuggerOptions As Boolean = False) As Task Return <API key>(markup, isBuilder:=True, triggerInfo:=triggerInfo, useDebuggerOptions:=useDebuggerOptions) End Function Private Async Function <API key>(markup As XElement, isBuilder As Boolean, triggerInfo As CompletionTrigger?, Optional useDebuggerOptions As Boolean = False) As Task Dim code As String = Nothing Dim position As Integer = 0 MarkupTestFile.GetPosition(markup.NormalizedValue, code, position) Using workspaceFixture = New <API key>() Dim options = If(useDebuggerOptions, (Await workspaceFixture.GetWorkspaceAsync()).Options.<API key>(), (Await workspaceFixture.GetWorkspaceAsync()).Options) Dim document1 = Await workspaceFixture.UpdateDocumentAsync(code, SourceCodeKind.Regular) Await CheckResultsAsync(document1, position, isBuilder, triggerInfo, options) If Await <API key>(document1, position) Then Dim document2 = Await workspaceFixture.UpdateDocumentAsync(code, SourceCodeKind.Regular, cleanBeforeUpdate:=False) Await CheckResultsAsync(document2, position, isBuilder, triggerInfo, options) End If End Using End Function Private Async Function CheckResultsAsync(document As Document, position As Integer, isBuilder As Boolean, triggerInfo As CompletionTrigger?, options As OptionSet) As Task triggerInfo = If(triggerInfo, CompletionTrigger.<API key>("a"c)) Dim service = <API key>(document.Project.Solution.Workspace) Dim context = Await service.GetContextAsync( service.ExclusiveProviders?(0), document, position, triggerInfo.Value, options, CancellationToken.None) If isBuilder Then Assert.NotNull(context) Assert.NotNull(context.SuggestionModeItem) Else If context IsNot Nothing Then Assert.True(context.SuggestionModeItem Is Nothing, "group.Builder = " & If(context.SuggestionModeItem IsNot Nothing, context.SuggestionModeItem.DisplayText, "null")) End If End If End Function Friend Overrides Function <API key>() As CompletionProvider Return New <API key>() End Function End Class End Namespace
/* * Rules for CKEditor content */ .textEditorContent { font-size: 0.9em; word-wrap: break-word; word-break: break-word; } .textEditorContent img { height: auto; max-width: 100%; max-height: 100%; } .textEditorContent ul { margin: inherit; padding: 10px 40px; } .textEditorContent .description table, .textEditorContent .description th, .textEditorContent .description td { border: 1px dotted #d3d3d3; } .textEditorContent .description abbr[title] { border: none; } .textEditorContent .description select { font-family: unset; color: initial; } .textEditorContent .description h1, .textEditorContent .description h2, .textEditorContent .description h3, .textEditorContent .description h4, .textEditorContent .description h5, .textEditorContent .description h6, .textEditorContent .description p, .textEditorContent .description ul { margin: 0.5em 0; } .textEditorContent .description hr { border-color: #ccc; }
<?php for ($i = 0; $i < $this->length; ++$i) { if (is_object($objectOrArray)) { $value = $this->readProperty($objectOrArray, $i); // arrays need to be treated separately (due to PHP bug?) } elseif (is_array($objectOrArray)) { $property = $this->elements[$i]; if (!array_key_exists($property, $objectOrArray)) { $objectOrArray[$property] = $i + 1 < $this->length ? array() : null; } $value =& $objectOrArray[$property]; } else { throw new <API key>($objectOrArray, 'object or array'); } $objectOrArray =& $value; } return $value;
var express = require( 'express' ), router = require( './router' ); var app = express(); app.set('port', (process.env.PORT || 3000)); router.define( app ); // Set up port app.listen(app.get('port'), function() { console.log("Node app is running at localhost:" + app.get('port')); });
import backgroundImages from '@const/background-images'; import * as actions from './actions.js'; import Background from './class.js'; // const getObj = (indexString) => { const getListInitial = (type) => { let list = []; if (type === 'default') { list = backgroundImages.map( (filename, index) => new Background(filename, type + '-' + index) ); } return list; }; export const initList = (currentIndex = 'default-0') => { const listDefault = getListInitial('default'); const listCustom = getListInitial('custom'); const [type, index] = currentIndex.split('-'); const current = eval( 'list' + type.substr(0, 1).toUpperCase() + type.substr(1) )[index]; // const currentPath = current ? { // original: current.getPath(), // blured: current.getPath('blured') return (dispatch) => { dispatch( actions.init({ list: { default: listDefault, custom: listCustom, }, current, // currentIndex, // currentPath }) ); }; }; export const add = (/*filename*/) => {}; export const remove = (/*indexCustom*/) => {}; export const change = (obj) => { return (dispatch) => { dispatch(actions.change(obj)); }; }; export const mainImgLoaded = () => (dispatch) => dispatch(actions.mainLoaded());
package org.carlspring.strongbox.validation; import javax.inject.Inject; import javax.validation.ConstraintValidator; import javax.validation.<API key>; import org.carlspring.strongbox.authorization.service.<API key>; import org.springframework.util.StringUtils; /** * @author Pablo Tirado */ public class <API key> implements ConstraintValidator<UniqueRoleName, String> { @Inject private <API key> <API key>; @Override public void initialize(UniqueRoleName constraint) { // empty by design } @Override public boolean isValid(String roleName, <API key> context) { return StringUtils.isEmpty(roleName) || !<API key>.get().getRoles().stream().anyMatch(r -> r.getName().equals(roleName)); } }
#chmod change a file's access permision: chomd mode file chmod -R 777 [dir_name] chmod 777 [file_name] chmod a=rwx [file_name] chmod ugo+r [file_name] chmod a+r [file_name] chmod ug+w,o-w [filename] chmod -R a+r * first 7 -->User second 7-->Group third 7 -->Other all r=4 w=2 x=1 rwx=4+2+1=7 rw-=4+2=6 r-x=4+1=5 chmod -R 777 [dir_name]
#pragma once #include <aws/proton/Proton_EXPORTS.h> #include <aws/proton/ProtonRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Proton { namespace Model { class AWS_PROTON_API <API key> : public ProtonRequest { public: <API key>(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* <API key>() const override { return "<API key>"; } Aws::String SerializePayload() const override; Aws::Http::<API key> <API key>() const override; /** * <p>The environment template major version to delete.</p> */ inline const Aws::String& GetMajorVersion() const{ return m_majorVersion; } /** * <p>The environment template major version to delete.</p> */ inline bool <API key>() const { return <API key>; } /** * <p>The environment template major version to delete.</p> */ inline void SetMajorVersion(const Aws::String& value) { <API key> = true; m_majorVersion = value; } /** * <p>The environment template major version to delete.</p> */ inline void SetMajorVersion(Aws::String&& value) { <API key> = true; m_majorVersion = std::move(value); } /** * <p>The environment template major version to delete.</p> */ inline void SetMajorVersion(const char* value) { <API key> = true; m_majorVersion.assign(value); } /** * <p>The environment template major version to delete.</p> */ inline <API key>& WithMajorVersion(const Aws::String& value) { SetMajorVersion(value); return *this;} /** * <p>The environment template major version to delete.</p> */ inline <API key>& WithMajorVersion(Aws::String&& value) { SetMajorVersion(std::move(value)); return *this;} /** * <p>The environment template major version to delete.</p> */ inline <API key>& WithMajorVersion(const char* value) { SetMajorVersion(value); return *this;} /** * <p>The environment template minor version to delete.</p> */ inline const Aws::String& GetMinorVersion() const{ return m_minorVersion; } /** * <p>The environment template minor version to delete.</p> */ inline bool <API key>() const { return <API key>; } /** * <p>The environment template minor version to delete.</p> */ inline void SetMinorVersion(const Aws::String& value) { <API key> = true; m_minorVersion = value; } /** * <p>The environment template minor version to delete.</p> */ inline void SetMinorVersion(Aws::String&& value) { <API key> = true; m_minorVersion = std::move(value); } /** * <p>The environment template minor version to delete.</p> */ inline void SetMinorVersion(const char* value) { <API key> = true; m_minorVersion.assign(value); } /** * <p>The environment template minor version to delete.</p> */ inline <API key>& WithMinorVersion(const Aws::String& value) { SetMinorVersion(value); return *this;} /** * <p>The environment template minor version to delete.</p> */ inline <API key>& WithMinorVersion(Aws::String&& value) { SetMinorVersion(std::move(value)); return *this;} /** * <p>The environment template minor version to delete.</p> */ inline <API key>& WithMinorVersion(const char* value) { SetMinorVersion(value); return *this;} /** * <p>The name of the environment template.</p> */ inline const Aws::String& GetTemplateName() const{ return m_templateName; } /** * <p>The name of the environment template.</p> */ inline bool <API key>() const { return <API key>; } /** * <p>The name of the environment template.</p> */ inline void SetTemplateName(const Aws::String& value) { <API key> = true; m_templateName = value; } /** * <p>The name of the environment template.</p> */ inline void SetTemplateName(Aws::String&& value) { <API key> = true; m_templateName = std::move(value); } /** * <p>The name of the environment template.</p> */ inline void SetTemplateName(const char* value) { <API key> = true; m_templateName.assign(value); } /** * <p>The name of the environment template.</p> */ inline <API key>& WithTemplateName(const Aws::String& value) { SetTemplateName(value); return *this;} /** * <p>The name of the environment template.</p> */ inline <API key>& WithTemplateName(Aws::String&& value) { SetTemplateName(std::move(value)); return *this;} /** * <p>The name of the environment template.</p> */ inline <API key>& WithTemplateName(const char* value) { SetTemplateName(value); return *this;} private: Aws::String m_majorVersion; bool <API key>; Aws::String m_minorVersion; bool <API key>; Aws::String m_templateName; bool <API key>; }; } // namespace Model } // namespace Proton } // namespace Aws
package org.wso2.carbon.apimgt.rest.api.publisher.v1.dto; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.ArrayList; import java.util.List; import org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.AlertTypeDTO; import javax.validation.constraints.*; import io.swagger.annotations.*; import java.util.Objects; import javax.xml.bind.annotation.*; import org.wso2.carbon.apimgt.rest.api.util.annotations.Scope; public class AlertTypesListDTO { private Integer count = null; private List<AlertTypeDTO> alerts = new ArrayList<>(); /** * The number of alerts **/ public AlertTypesListDTO count(Integer count) { this.count = count; return this; } @ApiModelProperty(example = "3", value = "The number of alerts") @JsonProperty("count") public Integer getCount() { return count; } public void setCount(Integer count) { this.count = count; } public AlertTypesListDTO alerts(List<AlertTypeDTO> alerts) { this.alerts = alerts; return this; } @ApiModelProperty(value = "") @JsonProperty("alerts") public List<AlertTypeDTO> getAlerts() { return alerts; } public void setAlerts(List<AlertTypeDTO> alerts) { this.alerts = alerts; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } AlertTypesListDTO alertTypesList = (AlertTypesListDTO) o; return Objects.equals(count, alertTypesList.count) && Objects.equals(alerts, alertTypesList.alerts); } @Override public int hashCode() { return Objects.hash(count, alerts); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AlertTypesListDTO {\n"); sb.append(" count: ").append(toIndentedString(count)).append("\n"); sb.append(" alerts: ").append(toIndentedString(alerts)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
cordova.define('cordova/plugin_list', function(require, exports, module) { module.exports = [ { "file": "plugins/<API key>/whitelist.js", "id": "<API key>.whitelist", "pluginId": "<API key>", "runs": true }, { "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js", "id": "cordova-plugin-file.DirectoryEntry", "pluginId": "cordova-plugin-file", "clobbers": [ "window.DirectoryEntry" ] }, { "file": "plugins/cordova-plugin-file/www/DirectoryReader.js", "id": "cordova-plugin-file.DirectoryReader", "pluginId": "cordova-plugin-file", "clobbers": [ "window.DirectoryReader" ] }, { "file": "plugins/cordova-plugin-file/www/Entry.js", "id": "cordova-plugin-file.Entry", "pluginId": "cordova-plugin-file", "clobbers": [ "window.Entry" ] }, { "file": "plugins/cordova-plugin-file/www/File.js", "id": "cordova-plugin-file.File", "pluginId": "cordova-plugin-file", "clobbers": [ "window.File" ] }, { "file": "plugins/cordova-plugin-file/www/FileEntry.js", "id": "cordova-plugin-file.FileEntry", "pluginId": "cordova-plugin-file", "clobbers": [ "window.FileEntry" ] }, { "file": "plugins/cordova-plugin-file/www/FileError.js", "id": "cordova-plugin-file.FileError", "pluginId": "cordova-plugin-file", "clobbers": [ "window.FileError" ] }, { "file": "plugins/cordova-plugin-file/www/FileReader.js", "id": "cordova-plugin-file.FileReader", "pluginId": "cordova-plugin-file", "clobbers": [ "window.FileReader" ] }, { "file": "plugins/cordova-plugin-file/www/FileSystem.js", "id": "cordova-plugin-file.FileSystem", "pluginId": "cordova-plugin-file", "clobbers": [ "window.FileSystem" ] }, { "file": "plugins/cordova-plugin-file/www/FileUploadOptions.js", "id": "cordova-plugin-file.FileUploadOptions", "pluginId": "cordova-plugin-file", "clobbers": [ "window.FileUploadOptions" ] }, { "file": "plugins/cordova-plugin-file/www/FileUploadResult.js", "id": "cordova-plugin-file.FileUploadResult", "pluginId": "cordova-plugin-file", "clobbers": [ "window.FileUploadResult" ] }, { "file": "plugins/cordova-plugin-file/www/FileWriter.js", "id": "cordova-plugin-file.FileWriter", "pluginId": "cordova-plugin-file", "clobbers": [ "window.FileWriter" ] }, { "file": "plugins/cordova-plugin-file/www/Flags.js", "id": "cordova-plugin-file.Flags", "pluginId": "cordova-plugin-file", "clobbers": [ "window.Flags" ] }, { "file": "plugins/cordova-plugin-file/www/LocalFileSystem.js", "id": "cordova-plugin-file.LocalFileSystem", "pluginId": "cordova-plugin-file", "clobbers": [ "window.LocalFileSystem" ], "merges": [ "window" ] }, { "file": "plugins/cordova-plugin-file/www/Metadata.js", "id": "cordova-plugin-file.Metadata", "pluginId": "cordova-plugin-file", "clobbers": [ "window.Metadata" ] }, { "file": "plugins/cordova-plugin-file/www/ProgressEvent.js", "id": "cordova-plugin-file.ProgressEvent", "pluginId": "cordova-plugin-file", "clobbers": [ "window.ProgressEvent" ] }, { "file": "plugins/cordova-plugin-file/www/fileSystems.js", "id": "cordova-plugin-file.fileSystems", "pluginId": "cordova-plugin-file" }, { "file": "plugins/cordova-plugin-file/www/requestFileSystem.js", "id": "cordova-plugin-file.requestFileSystem", "pluginId": "cordova-plugin-file", "clobbers": [ "window.requestFileSystem" ] }, { "file": "plugins/cordova-plugin-file/www/<API key>.js", "id": "cordova-plugin-file.<API key>", "pluginId": "cordova-plugin-file", "merges": [ "window" ] }, { "file": "plugins/cordova-plugin-file/www/android/FileSystem.js", "id": "cordova-plugin-file.androidFileSystem", "pluginId": "cordova-plugin-file", "merges": [ "FileSystem" ] }, { "file": "plugins/cordova-plugin-file/www/fileSystems-roots.js", "id": "cordova-plugin-file.fileSystems-roots", "pluginId": "cordova-plugin-file", "runs": true }, { "file": "plugins/cordova-plugin-file/www/fileSystemPaths.js", "id": "cordova-plugin-file.fileSystemPaths", "pluginId": "cordova-plugin-file", "merges": [ "cordova" ], "runs": true }, { "file": "plugins/<API key>/www/FileTransferError.js", "id": "<API key>.FileTransferError", "pluginId": "<API key>", "clobbers": [ "window.FileTransferError" ] }, { "file": "plugins/<API key>/www/FileTransfer.js", "id": "<API key>.FileTransfer", "pluginId": "<API key>", "clobbers": [ "window.FileTransfer" ] }, { "file": "plugins/<API key>/www/device.js", "id": "<API key>.device", "pluginId": "<API key>", "clobbers": [ "device" ] }, { "file": "plugins/de.appplant.cordova.plugin.email-composer/www/email_composer.js", "id": "de.appplant.cordova.plugin.email-composer.EmailComposer", "pluginId": "de.appplant.cordova.plugin.email-composer", "clobbers": [ "cordova.plugins.email", "plugin.email" ] } ]; module.exports.metadata = // TOP OF METADATA {} // BOTTOM OF METADATA });
function <API key> (BaseString) { BaseString.call(this, 'credential_types'); let t = this.t; let ns = this.credential_types; ns.<API key> = { <API key>: t.s('This credential type is currently being used by one or more credentials. Credentials that use this credential type must be deleted before the credential type can be deleted.') }; } <API key>.$inject = ['BaseStringService']; export default <API key>;
package libnetwork import ( "fmt" ) // ErrNoSuchNetwork is returned when a network query finds no result type ErrNoSuchNetwork string func (nsn ErrNoSuchNetwork) Error() string { return fmt.Sprintf("network %s not found", string(nsn)) } // BadRequest denotes the type of this error func (nsn ErrNoSuchNetwork) BadRequest() {} // ErrNoSuchEndpoint is returned when a endpoint query finds no result type ErrNoSuchEndpoint string func (nse ErrNoSuchEndpoint) Error() string { return fmt.Sprintf("endpoint %s not found", string(nse)) } // BadRequest denotes the type of this error func (nse ErrNoSuchEndpoint) BadRequest() {} // <API key> is returned if an invalid driver // name is passed. type <API key> string func (ind <API key>) Error() string { return fmt.Sprintf("invalid driver bound to network: %s", string(ind)) } // BadRequest denotes the type of this error func (ind <API key>) BadRequest() {} // ErrInvalidJoin is returned if a join is attempted on an endpoint // which already has a container joined. type ErrInvalidJoin struct{} func (ij ErrInvalidJoin) Error() string { return "a container has already joined the endpoint" } // BadRequest denotes the type of this error func (ij ErrInvalidJoin) BadRequest() {} // ErrNoContainer is returned when the endpoint has no container // attached to it. type ErrNoContainer struct{} func (nc ErrNoContainer) Error() string { return "a container has already joined the endpoint" } // Maskable denotes the type of this error func (nc ErrNoContainer) Maskable() {} // ErrInvalidID is returned when a query-by-id method is being invoked // with an empty id parameter type ErrInvalidID string func (ii ErrInvalidID) Error() string { return fmt.Sprintf("invalid id: %s", string(ii)) } // BadRequest denotes the type of this error func (ii ErrInvalidID) BadRequest() {} // ErrInvalidName is returned when a query-by-name or resource create method is // invoked with an empty name parameter type ErrInvalidName string func (in ErrInvalidName) Error() string { return fmt.Sprintf("invalid name: %s", string(in)) } // BadRequest denotes the type of this error func (in ErrInvalidName) BadRequest() {} // <API key> type is returned when an invalid LibNetwork config file is detected type <API key> string func (cf <API key>) Error() string { return fmt.Sprintf("Invalid Config file %q", string(cf)) } // NetworkTypeError type is returned when the network type string is not // known to libnetwork. type NetworkTypeError string func (nt NetworkTypeError) Error() string { return fmt.Sprintf("unknown driver %q", string(nt)) } // NotFound denotes the type of this error func (nt NetworkTypeError) NotFound() {} // NetworkNameError is returned when a network with the same name already exists. type NetworkNameError string func (nnr NetworkNameError) Error() string { return fmt.Sprintf("network with name %s already exists", string(nnr)) } // Forbidden denotes the type of this error func (nnr NetworkNameError) Forbidden() {} // UnknownNetworkError is returned when libnetwork could not find in it's database // a network with the same name and id. type UnknownNetworkError struct { name string id string } func (une *UnknownNetworkError) Error() string { return fmt.Sprintf("unknown network %s id %s", une.name, une.id) } // NotFound denotes the type of this error func (une *UnknownNetworkError) NotFound() {} // <API key> is returned when a network is deleted which has active // endpoints in it. type <API key> struct { name string id string } func (aee *<API key>) Error() string { return fmt.Sprintf("network with name %s id %s has active endpoints", aee.name, aee.id) } // Forbidden denotes the type of this error func (aee *<API key>) Forbidden() {} // <API key> is returned when libnetwork could not find in it's database // an endpoint with the same name and id. type <API key> struct { name string id string } func (uee *<API key>) Error() string { return fmt.Sprintf("unknown endpoint %s id %s", uee.name, uee.id) } // NotFound denotes the type of this error func (uee *<API key>) NotFound() {} // <API key> is returned when an endpoint is deleted which has active // containers attached to it. type <API key> struct { name string id string } func (ace *<API key>) Error() string { return fmt.Sprintf("endpoint with name %s id %s has active containers", ace.name, ace.id) } // Forbidden denotes the type of this error func (ace *<API key>) Forbidden() {} // <API key> is returned when an invalid container id is passed // in Join/Leave type <API key> string func (id <API key>) Error() string { return fmt.Sprintf("invalid container id %s", string(id)) } // BadRequest denotes the type of this error func (id <API key>) BadRequest() {}
#include <aws/servicediscovery/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 ServiceDiscovery { namespace Model { <API key>::<API key>() : m_sOAHasBeenSet(false) { } <API key>::<API key>(JsonView jsonValue) : m_sOAHasBeenSet(false) { *this = jsonValue; } <API key>& <API key>::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("SOA")) { m_sOA = jsonValue.GetObject("SOA"); m_sOAHasBeenSet = true; } return *this; } JsonValue <API key>::Jsonize() const { JsonValue payload; if(m_sOAHasBeenSet) { payload.WithObject("SOA", m_sOA.Jsonize()); } return payload; } } // namespace Model } // namespace ServiceDiscovery } // namespace Aws
# please insert nothing before this line: -*- mode: cperl; cperl-indent-level: 4; <API key>: 4; indent-tabs-mode: nil -*- package TestApache::scanhdrs2; use strict; use warnings FATAL => 'all'; use Apache::Test; use Apache2::Const -compile => 'OK'; sub handler { my $r = shift; my $location = $r->args; print "Location: $location\n\n"; Apache2::Const::OK; } 1; __END__ SetHandler perl-script PerlOptions +ParseHeaders
const ng = require('angular'); ng.module('porybox.static', ['ngRoute']).config(['$routeProvider', $routeProvider => { [ 'about', 'donate', '<API key>', 'faq', 'how-to-pk6-1-bvs', '<API key>', '<API key>', '<API key>', 'how-to-pk7-1-bvs', '<API key>', '<API key>', 'how-to-pk7-4-tea', 'markdown', 'privacy-policy', 'tos' ].forEach(pageName => { $routeProvider.when(`/${pageName}`, {templateUrl: `/static/${pageName}.html`}); }); $routeProvider.when('/<API key>', {redirectTo: '/<API key>'}); }]);
ID_PAGE: 22591 PG_TITLE: How to use LOD Babylon.js comes with an integrated support for level of detail. This feature allows you to specify different meshes based on distance to viewer. For instance, here is how to define 4 levels of details for a given mesh: javascript var knot00 = BABYLON.Mesh.CreateTorusKnot("knot0", 0.5, 0.2, 128, 64, 2, 3, scene); var knot01 = BABYLON.Mesh.CreateTorusKnot("knot1", 0.5, 0.2, 32, 16, 2, 3, scene); var knot02 = BABYLON.Mesh.CreateTorusKnot("knot2", 0.5, 0.2, 24, 12, 2, 3, scene); var knot03 = BABYLON.Mesh.CreateTorusKnot("knot3", 0.5, 0.2, 16, 8, 2, 3, scene); knot00.addLODLevel(15, knot01); knot00.addLODLevel(30, knot02); knot00.addLODLevel(45, knot03); knot00.addLODLevel(55, null); The first parameter used with ```addLODLevel``` defines the distance to the camera. Beyond this distance, the specified level is used. Each level is independent and can have its own material. By defining a level of detail to null, you disable rendering of the current mesh, when it is viewed beyond the indicated distance to camera. When a mesh is used as a level of detail for another mesh, it is linked to it and cannot be rendered directly. You can remove a LOD level by using ```removeLODLevel```: javascript knot00.removeLODLevel(knot02); knot00.removeLODLevel(null); Try: [LOD playground](http://www.<API key>.com/#QE7KM) ## Using LOD and instances By default, instances will use LOD defined on root mesh. You do not have to specify anything on instances: javascript var count = 3; var scale = 4; var knot00 = BABYLON.Mesh.CreateTorusKnot("knot0", 0.5, 0.2, 128, 64, 2, 3, scene); var knot01 = BABYLON.Mesh.CreateTorusKnot("knot1", 0.5, 0.2, 32, 16, 2, 3, scene); var knot02 = BABYLON.Mesh.CreateTorusKnot("knot2", 0.5, 0.2, 24, 12, 2, 3, scene); var knot03 = BABYLON.Mesh.CreateTorusKnot("knot3", 0.5, 0.2, 16, 8, 2, 3, scene); knot00.setEnabled(false); knot00.addLODLevel(15, knot01); knot00.addLODLevel(30, knot02); knot00.addLODLevel(45, knot03); knot00.addLODLevel(55, null); for (var x = -count; x <= count; x++) {     for (var y = -count; y <= count; y++) {         for (var z = 5; z < 10; z++) {             var knot = knot00.createInstance("knotI"),             knot.position = new BABYLON.Vector3(x * scale, y * scale, z * scale);         }     } } Try: [LOD and instances playground](http://www.<API key>.com/#14ESWC)
Follow these simple instructions to install this custom symbol; the overall process should only take a minutes. 1. In Windows Explorer, navigate to the "PIPC\PIVision" installation folder on your PI Vision server; typically, it's located in "C:\Program Files\PIPC\PIVision" 2. From within the folder named "PIVision", navigate to the "\Scripts\app\editor\symbols" sub-folder. 3. Within the folder named "symbols", if there is not already a folder called "ext", create a folder called "ext". 4. This is a symbol that uses the free plotly library; thus, download the plotly library .js file, located at https://cdn.plot.ly/plotly-latest.min.js. Now that the "ext" folder exists, or already exits, copy and paste the plotly-latest.min.js file that you just downloaded into the "ext" folder. 5. Now that the "ext" folder exists, or already exits, open it, and paste into the "ext" folder the one .js and two .html files contained in the custom symbol .ZIP folder that you were sent. 6. Within the folder named "ext", if there is not already a folder called "Icons", create a folder called "Icons". 7. Now that the "Icons" folder exists, or already exits, open it, and paste into the "Icons" folder the one .png image file contained in the custom symbol .ZIP folder that you were sent. The next time you open a web browser and navigate to PI Vision and create a new PI Vision display, you will see this new symbol appear in the top-left-hand corner of the PI Vision display editor.
title: Action Collection # Action Collection Design * Extract common code from the Resource Reporter and Data Collector. * Expose a general purpose API for querying a record of all actions taken during the Chef run. * Enable utilities like the 'zap' cookbook to be written to interact properly with Custom Resources. The Action Collection tracks all actions taken by all Chef resources. The resources can be in recipe code, as sub-resources of custom resources or they may be built "by hand". Since the Action Collection hooks the events which are fired from the `run_action` method on Chef::Resource it does not matter how the resources were built (as long as they were correctly passed the Chef `run_context`). This is complementary, but superior, to the resource collection which has an incomplete picture of what might happen or has happened in the run since there are many common ways of invoking resource actions which are not captured by how the resource collection is built. Replaying the sequence of actions in the Action Collection would be closer to replaying the chef-client converge than trying to re-converge the resource collection (although both of those models are still flawed in the presence of any imperative code that controls the shape of those objects). This design extracts common duplicated code from the Data Collection and old Resource Reporter, and is designed to be used by other consumers which need to ask questions like "in this run, what file resources had actions fired on them?", which can then be used to answer questions like "which files is Chef managing in this directory?". # Usage ## Action Collection Event Hook Registration Consumers may register an event handler which hooks the `<API key>` hook. This event is fired directly before recipes are compiled and converged (after library loading, attributes, etc). This is just before the earliest point in time that a resource should fire an action so represents the latest point that a consumer should make a decision about if it needs the Action Collection to be enabled or not. Consumers can hook this method. They will be passed the Action Collection instance, which can be saved by the caller to be queried later. They should then register themselves with the Action Collection (since without registering any interest, the Action Collection will disable itself). ruby def <API key>(action_collection) @action_collection = action_collection action_collection.register(self) end ## Library Registration Any cookbook library code may also register itself with the Action Collection. The Action Collection will be registered with the `run_context` after it is created, so registration may be accomplished easily: ruby Chef.run_context.action_collection.register(self) ## Action Collection Requires Registration If one of the prior methods is not used to register for the Action Collection, then the Action Collection will disable itself and will not compile the Action Collection in order to not waste the memory overhead of tracking the actions during the run. The Data Collector takes advantage of this since if the run start message from the Data Collector is refused by the server, then the Data Collector disables itself, and then does not register with the Action Collection, which would disable the Action Collection. This makes use of the delayed hooking through the `<API key>` so that the Data Collector never registers itself after it is disabled. ## Searching There is a function `filtered_collection` which returns "slices" off of the `ActionCollection` object. The `max_nesting` argument can be used to prune how deep into sub-resources the returned view goes (`max_nesting: 0` will return only resources in recipe context, with any hand created resources, but no subresources). There are also 5 different states of the action: `up_to_date`, `skipped`, `updated`, `failed`, `unprocessed` which can be filtered on. All of these are true by default, so they must be disabled to remove them from the filtered collection. The `ActionCollection` object itself implements enumerable and returns `ActionRecord` objects (see the `ActionCollection` code for the fields exposed on `ActionRecord`s). This would return all file resources in any state in the recipe context: Chef.run_context.action_collection.filtered_collection(max_nesting: 0).select { |rec| rec.new_resource.is_a?(Chef::Resource::File) } NOTE: As the Action Collection API was initially designed around the Resource Reporter and Data Collector use cases, the searching API is currently rudimentary and could easily lift some of the searching features on the name of the resource from the resource collection, and could use a more fluent API for composing searches. # Implementation Details ## Resource Event Lifecycle Hooks Resources actions fire off several events in sequence: 1. `<API key>` - this is always fired first 2. `<API key>` - this is normally always second, but may be skipped in the case of a resource which throws an exception during `<API key>` (which means that the `current_resource` off the `ActionRecord` may be nil). 3. `resource_up_to_date` / `resource_skipped` / `resource_updated` / `resource_failed` - one of these is always called which corresponds to the state of the action. 4. `resource_completed` - this is always fired last For skipped resources, the conditional will be saved in the `ActionRecord`. For failed resources the exception is saved in the `ActionRecord`. ## Unprocessed Resources The unprocessed resource concept is to report on resources which are left in the resource collection after a failure. A successful Chef run should never leave any unprocessed resources (`action :nothing` resources are still inspected by the resource collection and are processed). There must be an exception thrown during the execution of the resource collection, and the unprocessed resources were never visited by the runner that executes the resource collection. This list will be necessarily incomplete of any unprocessed sub-resources in custom resources, since the run was aborted before those resources executed actions and built their own sub-resource collections. This was a design requirement of the Data Collector. To implement this in a more sane manner the runner that evaluates the resource collection now tracks the resources that it visits.
This sample Android app demonstrates having several maps as pages in a `ViewPager`. This app is covered in [the chapter on Maps V2](https://commonsware.com/Android/previews/<API key>) in [*The Busy Coder's Guide to Android Development*](https://commonsware.com/Android/).
package connect import ( "strings" "testing" ) func <API key>(t *testing.T) { t.Parallel() if strings.ContainsRune(New().Help(), '\t') { t.Fatal("help has tabs") } }
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> <!-- Title and other stuffs --> <title>3 BootstrapMac - JS</title> <meta name="keywords" content="Bootstrap,Bootstrap,Bootstrap,Bootstrap,,,," /> <meta name="description" content="JSBootstrap,,,Bootstrap,BootstrapBootstrap" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content=""> <!-- Stylesheets --> <link href="style/bootstrap.css" rel="stylesheet"> <!-- Font awesome icon --> <link rel="stylesheet" href="style/font-awesome.css"> <!-- jQuery UI --> <link rel="stylesheet" href="style/jquery-ui.css"> <!-- Calendar --> <link rel="stylesheet" href="style/fullcalendar.css"> <!-- prettyPhoto --> <link rel="stylesheet" href="style/prettyPhoto.css"> <!-- Star rating --> <link rel="stylesheet" href="style/rateit.css"> <!-- Date picker --> <link rel="stylesheet" href="style/<API key>.min.css"> <!-- CLEditor --> <link rel="stylesheet" href="style/jquery.cleditor.css"> <!-- Uniform --> <link rel="stylesheet" href="style/uniform.default.css"> <!-- Bootstrap toggle --> <link rel="stylesheet" href="style/bootstrap-switch.css"> <!-- Main stylesheet --> <link href="style/style.css" rel="stylesheet"> <!-- Widgets stylesheet --> <link href="style/widgets.css" rel="stylesheet"> <!-- HTML5 Support for IE --> <!--[if lt IE 9]> <script src="js/html5shim.js"></script> <![endif] <!-- Favicon --> <link rel="shortcut icon" href="img/favicon/favicon.png"> </head> <body> <div class="navbar navbar-fixed-top bs-docs-nav" role="banner"> <div class="conjtainer"> <!-- Menu button for smallar screens --> <div class="navbar-header"> <button class="navbar-toggle btn-navbar" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse"> <span>Menu</span> </button> <!-- Site name for smallar screens --> <a href="index.html" class="navbar-brand hidden-lg">MacBeth</a> </div> <!-- Navigation starts --> <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation"> <ul class="nav navbar-nav"> <!-- Upload to server link. Class "dropdown-big" creates big dropdown --> <li class="dropdown dropdown-big"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="label label-success"><i class="icon-cloud-upload"></i></span> Upload to Cloud</a> <!-- Dropdown --> <ul class="dropdown-menu"> <li> <!-- Progress bar --> <p>Photo Upload in Progress</p> <!-- Bootstrap progress bar --> <div class="progress progress-striped active"> <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%"> <span class="sr-only">40% Complete</span> </div> </div> <hr /> <!-- Progress bar --> <p>Video Upload in Progress</p> <!-- Bootstrap progress bar --> <div class="progress progress-striped active"> <div class="progress-bar <API key>" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"> <span class="sr-only">80% Complete</span> </div> </div> <hr /> <!-- Dropdown menu footer --> <div class="drop-foot"> <a href="#">View All</a> </div> </li> </ul> </li> <!-- Sync to server link --> <li class="dropdown dropdown-big"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="label label-danger"><i class="icon-refresh"></i></span> Sync with Server</a> <!-- Dropdown --> <ul class="dropdown-menu"> <li> <!-- Using "icon-spin" class to rotate icon. --> <p><span class="label label-info"><i class="icon-cloud"></i></span> Syncing Members Lists to Server</p> <hr /> <p><span class="label label-warning"><i class="icon-cloud"></i></span> Syncing Bookmarks Lists to Cloud</p> <hr /> <!-- Dropdown menu footer --> <div class="drop-foot"> <a href="#">View All</a> </div> </li> </ul> </li> </ul> <!-- Search form --> <form class="navbar-form navbar-left" role="search"> <div class="form-group"> <input type="text" class="form-control" placeholder="Search"> </div> </form> <!-- Links --> <ul class="nav navbar-nav pull-right"> <li class="dropdown pull-right"> <a data-toggle="dropdown" class="dropdown-toggle" href=" <i class="icon-user"></i> Admin <b class="caret"></b> </a> <!-- Dropdown menu --> <ul class="dropdown-menu"> <li><a href="#"><i class="icon-user"></i> Profile</a></li> <li><a href="#"><i class="icon-cogs"></i> Settings</a></li> <li><a href="login.html"><i class="icon-off"></i> Logout</a></li> </ul> </li> </ul> </nav> </div> </div> <!-- Header starts --> <header> <div class="container"> <div class="row"> <!-- Logo section --> <div class="col-md-4"> <!-- Logo. --> <div class="logo"> <h1><a href="#">Mac<span class="bold"></span></a></h1> <p class="meta"></p> </div> <!-- Logo ends --> </div> <!-- Button section --> <div class="col-md-4"> <!-- Buttons --> <ul class="nav nav-pills"> <!-- Comment button with number of latest comments count --> <li class="dropdown dropdown-big"> <a class="dropdown-toggle" href="#" data-toggle="dropdown"> <i class="icon-comments"></i> Chats <span class="label label-info">6</span> </a> <ul class="dropdown-menu"> <li> <!-- Heading - h5 --> <h5><i class="icon-comments"></i> Chats</h5> <!-- Use hr tag to add border --> <hr /> </li> <li> <!-- List item heading h6 --> <h6><a href="#">Hi :)</a> <span class="label label-warning pull-right">10:42</span></h6> <div class="clearfix"></div> <hr /> </li> <li> <h6><a href="#">How are you?</a> <span class="label label-warning pull-right">20:42</span></h6> <div class="clearfix"></div> <hr /> </li> <li> <h6><a href="#">What are you doing?</a> <span class="label label-warning pull-right">14:42</span></h6> <div class="clearfix"></div> <hr /> </li> <li> <div class="drop-foot"> <a href="#">View All</a> </div> </li> </ul> </li> <!-- Message button with number of latest messages count--> <li class="dropdown dropdown-big"> <a class="dropdown-toggle" href="#" data-toggle="dropdown"> <i class="icon-envelope-alt"></i> Inbox <span class="label label-primary">6</span> </a> <ul class="dropdown-menu"> <li> <!-- Heading - h5 --> <h5><i class="icon-envelope-alt"></i> Messages</h5> <!-- Use hr tag to add border --> <hr /> </li> <li> <!-- List item heading h6 --> <h6><a href="#">Hello how are you?</a></h6> <!-- List item para --> <p>Quisque eu consectetur erat eget semper...</p> <hr /> </li> <li> <h6><a href="#">Today is wonderful?</a></h6> <p>Quisque eu consectetur erat eget semper...</p> <hr /> </li> <li> <div class="drop-foot"> <a href="#">View All</a> </div> </li> </ul> </li> <!-- Members button with number of latest members count --> <li class="dropdown dropdown-big"> <a class="dropdown-toggle" href="#" data-toggle="dropdown"> <i class="icon-user"></i> Users <span class="label label-success">6</span> </a> <ul class="dropdown-menu"> <li> <!-- Heading - h5 --> <h5><i class="icon-user"></i> Users</h5> <!-- Use hr tag to add border --> <hr /> </li> <li> <!-- List item heading h6--> <h6><a href="#">Ravi Kumar</a> <span class="label label-warning pull-right">Free</span></h6> <div class="clearfix"></div> <hr /> </li> <li> <h6><a href="#">Balaji</a> <span class="label label-important pull-right">Premium</span></h6> <div class="clearfix"></div> <hr /> </li> <li> <h6><a href="#">Kumarasamy</a> <span class="label label-warning pull-right">Free</span></h6> <div class="clearfix"></div> <hr /> </li> <li> <div class="drop-foot"> <a href="#">View All</a> </div> </li> </ul> </li> </ul> </div> <!-- Data section --> <div class="col-md-4"> <div class="header-data"> <!-- Traffic data --> <div class="hdata"> <div class="mcol-left"> <!-- Icon with red background --> <i class="icon-signal bred"></i> </div> <div class="mcol-right"> <!-- Number of visitors --> <p><a href="#">7000</a> <em>visits</em></p> </div> <div class="clearfix"></div> </div> <!-- Members data --> <div class="hdata"> <div class="mcol-left"> <!-- Icon with blue background --> <i class="icon-user bblue"></i> </div> <div class="mcol-right"> <!-- Number of visitors --> <p><a href="#">3000</a> <em>users</em></p> </div> <div class="clearfix"></div> </div> <!-- revenue data --> <div class="hdata"> <div class="mcol-left"> <!-- Icon with green background --> <i class="icon-money bgreen"></i> </div> <div class="mcol-right"> <!-- Number of visitors --> <p><a href="#">5000</a><em>orders</em></p> </div> <div class="clearfix"></div> </div> </div> </div> </div> </div> </header> <!-- Header ends --> <!-- Main content starts --> <div class="content"> <!-- Sidebar --> <div class="sidebar"> <div class="sidebar-dropdown"><a href="#">Navigation</a></div> <!--- Sidebar navigation --> <!-- If the main navigation has sub navigation, then add the class "has_sub" to "li" of main navigation. --> <ul id="nav"> <!-- Main menu with font awesome icon --> <li><a href="index.html"><i class="icon-home"></i> Dashboard</a> <!-- Sub menu markup <ul> <li><a href="#">Submenu #1</a></li> <li><a href="#">Submenu #2</a></li> <li><a href="#">Submenu #3</a></li> </ul> </li> <li class="has_sub"><a href="#" class="open"><i class="icon-list-alt"></i> Widgets <span class="pull-right"><i class="icon-chevron-right"></i></span></a> <ul> <li><a href="widgets1.html">Widgets #1</a></li> <li><a href="widgets2.html">Widgets #2</a></li> <li><a href="widgets3.html">Widgets #3</a></li> </ul> </li> <li class="has_sub"><a href="#"><i class="icon-file-alt"></i> Pages #1 <span class="pull-right"><i class="icon-chevron-right"></i></span></a> <ul> <li><a href="post.html">Post</a></li> <li><a href="login.html">Login</a></li> <li><a href="register.html">Register</a></li> <li><a href="support.html">Support</a></li> <li><a href="invoice.html">Invoice</a></li> <li><a href="profile.html">Profile</a></li> <li><a href="gallery.html">Gallery</a></li> </ul> </li> <li class="has_sub"><a href="#"><i class="icon-file-alt"></i> Pages #2 <span class="pull-right"><i class="icon-chevron-right"></i></span></a> <ul> <li><a href="media.html">Media</a></li> <li><a href="statement.html">Statement</a></li> <li><a href="error.html">Error</a></li> <li><a href="error-log.html">Error Log</a></li> <li><a href="calendar.html">Calendar</a></li> <li><a href="grid.html">Grid</a></li> </ul> </li> <li><a href="charts.html"><i class="icon-bar-chart"></i> Charts</a></li> <li><a href="tables.html"><i class="icon-table"></i> Tables</a></li> <li><a href="forms.html"><i class="icon-tasks"></i> Forms</a></li> <li><a href="ui.html"><i class="icon-magic"></i> User Interface</a></li> <li><a href="calendar.html"><i class="icon-calendar"></i> Calendar</a></li> </ul> </div> <!-- Sidebar ends --> <!-- Main bar --> <div class="mainbar"> <!-- Page heading --> <div class="page-head"> <h2 class="pull-left"><i class="icon-list-alt"></i> Widgets</h2> <!-- Breadcrumb --> <div class="bread-crumb pull-right"> <a href="index.html"><i class="icon-home"></i> Home</a> <!-- Divider --> <span class="divider">/</span> <a href="#" class="bread-current">Dashboard</a> </div> <div class="clearfix"></div> </div> <!-- Page heading ends --> <!-- Matter --> <div class="matter"> <div class="container"> <div class="row"> <!-- Operating System --> <div class="col-md-4"> <div class="widget"> <!-- Widget title --> <div class="widget-head"> <div class="pull-left">Operating System</div> <div class="widget-icons pull-right"> <a href="#" class="wminimize"><i class="icon-chevron-up"></i></a> <a href="#" class="wclose"><i class="icon-remove"></i></a> </div> <div class="clearfix"></div> </div> <div class="widget-content referrer"> <!-- Widget content --> <table class="table table-striped table-bordered table-hover"> <tr> <th><center>#</center></th> <th>Operating System</th> <th>Visits</th> </tr> <tr> <td><img src="img/icons/windows.png" alt="" /> <td>Windows 7</td> <td>3,005</td> </tr> <tr> <td><img src="img/icons/android.png" alt="" /> <td>Android ICS</td> <td>2,505</td> </tr> <tr> <td><img src="img/icons/ios.png" alt="" /> <td>Apple IOS</td> <td>1,405</td> </tr> <tr> <td><img src="img/icons/linux.png" alt="" /> <td>Linux</td> <td>4,005</td> </tr> <tr> <td><img src="img/icons/mac.png" alt="" /> <td>Mac</td> <td>505</td> </tr> <tr> <td><img src="img/icons/metro.png" alt="" /> <td>Windows Mobile</td> <td>305</td> </tr> </table> <div class="widget-foot"> </div> </div> </div> </div> <!-- Browsers --> <div class="col-md-4"> <div class="widget"> <!-- Widget title --> <div class="widget-head"> <div class="pull-left">Browsers</div> <div class="widget-icons pull-right"> <a href="#" class="wminimize"><i class="icon-chevron-up"></i></a> <a href="#" class="wclose"><i class="icon-remove"></i></a> </div> <div class="clearfix"></div> </div> <div class="widget-content referrer"> <!-- Widget content --> <table class="table table-striped table-bordered table-hover"> <tr> <th><center>#</center></th> <th>Browsers</th> <th>Visits</th> </tr> <tr> <td><img src="img/icons/chrome.png" alt="" /> <td>Google Chrome</td> <td>3,005</td> </tr> <tr> <td><img src="img/icons/firefox.png" alt="" /> <td>Mozilla Firefox</td> <td>2,505</td> </tr> <tr> <td><img src="img/icons/ie.png" alt="" /> <td>Internet Explorer</td> <td>1,405</td> </tr> <tr> <td><img src="img/icons/opera.png" alt="" /> <td>Opera</td> <td>4,005</td> </tr> <tr> <td><img src="img/icons/safari.png" alt="" /> <td>Safari</td> <td>505</td> </tr> </table> <div class="widget-foot"> </div> </div> </div> </div> <!-- Recent News --> <div class="col-md-4"> <div class="widget"> <!-- Widget title --> <div class="widget-head"> <div class="pull-left">Recent News</div> <div class="widget-icons pull-right"> <a href="#" class="wminimize"><i class="icon-chevron-up"></i></a> <a href="#" class="wclose"><i class="icon-remove"></i></a> </div> <div class="clearfix"></div> </div> <div class="widget-content referrer"> <!-- Widget content --> <div class="padd"> <ul class="latest-news"> <li> <!-- Title and date --> <h6><a href="#">Morbi ac felis nec </a> - <span>Jan 1, 2012</span></h6> <p>Suspendisse potenti. Morbi ac felis fermentum. Aenean lacus hendrerit sed rhoncus erat hendrerit. </p> </li> <li> <!-- Title and date --> <h6><a href="#">Aac felis nec imperdiet</a> - <span>Jan 1, 2012</span></h6> <p>Suspendisse potenti. Morbi ac felis fermentum. Aenean lacus hendrerit sed rhoncus erat hendrerit. </p> </li> <li> <!-- Title and date --> <h6><a href="#">Felis nec imperdiet</a> - <span>Jan 1, 2012</span></h6> <p>Suspendisse potenti. Morbi ac felis fermentum. Aenean hendrerit sed rhoncus erat hendrerit. </p> </li> </ul> </div> <div class="widget-foot"> </div> </div> </div> </div> </div> <div class="row"> <!-- Task widget --> <div class="col-md-5"> <div class="widget"> <!-- Widget title --> <div class="widget-head"> <div class="pull-left">Tasks</div> <div class="widget-icons pull-right"> <a href="#" class="wminimize"><i class="icon-chevron-up"></i></a> <a href="#" class="wclose"><i class="icon-remove"></i></a> </div> <div class="clearfix"></div> </div> <div class="widget-content"> <!-- Widget content --> <!-- Task list starts --> <ul class="task"> <li> <!-- Checkbox --> <span class="uni"><input value="check1" type="checkbox"></span> <!-- Task --> Goto Shopping in Walmart <span class="label label-danger">Important</span> <!-- Delete button --> <a href="#" class="pull-right"><i class="icon-remove"></i></a> </li> <li> <!-- Checkbox --> <span class="uni"><input value="check1" type="checkbox"></span> <!-- Task --> Download some action movies <!-- Delete button --> <a href="#" class="pull-right"><i class="icon-remove"></i></a> </li> <li> <!-- Checkbox --> <span class="uni"><input value="check1" type="checkbox"></span> <!-- Task --> Read Harry Potter VII Book <span class="label label-danger">Important</span> <!-- Delete button --> <a href="#" class="pull-right"><i class="icon-remove"></i></a> </li> <li> <!-- Checkbox --> <span class="uni"><input value="check1" type="checkbox"></span> <!-- Task --> Collect cash from friends for camp <!-- Delete button --> <a href="#" class="pull-right"><i class="icon-remove"></i></a> </li> <li> <!-- Checkbox --> <span class="uni"><input value="check1" type="checkbox"></span> <!-- Task --> Sleep till tomorrow everning <!-- Delete button --> <a href="#" class="pull-right"><i class="icon-remove"></i></a> </li> </ul> <div class="clearfix"></div> <div class="widget-foot"> </div> </div> </div> </div> <div class="col-md-7"> <div class="widget"> <div class="widget-head"> <div class="pull-left">Quick Posts</div> <div class="widget-icons pull-right"> <a href="#" class="wminimize"><i class="icon-chevron-up"></i></a> <a href="#" class="wclose"><i class="icon-remove"></i></a> </div> <div class="clearfix"></div> </div> <div class="widget-content"> <div class="padd"> <div class="form quick-post"> <!-- Edit profile form (not working)--> <form class="form-horizontal"> <!-- Title --> <div class="form-group"> <label class="control-label col-lg-3" for="title">Title</label> <div class="col-lg-9"> <input type="text" class="form-control" id="title"> </div> </div> <!-- Content --> <div class="form-group"> <label class="control-label col-lg-3" for="content">Content</label> <div class="col-lg-9"> <textarea class="form-control" id="content"></textarea> </div> </div> <!-- Cateogry --> <div class="form-group"> <label class="control-label col-lg-3">Category</label> <div class="col-lg-9"> <select class="form-control"> <option value="">- Choose Cateogry -</option> <option value="1">General</option> <option value="2">News</option> <option value="3">Media</option> <option value="4">Funny</option> </select> </div> </div> <!-- Tags --> <div class="form-group"> <label class="control-label col-lg-3" for="tags">Tags</label> <div class="col-lg-9"> <input type="text" class="form-control" id="tags"> </div> </div> <!-- Buttons --> <div class="form-group"> <!-- Buttons --> <div class="col-lg-offset-2 col-lg-9"> <button type="submit" class="btn btn-success">Publish</button> <button type="submit" class="btn btn-danger">Save Draft</button> <button type="reset" class="btn btn-default">Reset</button> </div> </div> </form> </div> </div> <div class="widget-foot"> <!-- Footer goes here --> </div> </div> </div> </div> </div> </div> </div> <!-- Matter ends --> </div> <!-- Mainbar ends --> <div class="clearfix"></div> </div> <!-- Content ends --> <!-- Footer starts --> <footer> <div class="container"> <div class="row"> <div class="col-md-12"> <p class="copy">Copyright &copy; 2012 | <a href="#">Your Site</a> </p> </div> </div> </div> </footer> <!-- Footer ends --> <!-- Scroll to top --> <span class="totop"><a href="#"><i class="icon-chevron-up"></i></a></span> <script src="js/jquery.js"></script> <!-- jQuery --> <script src="js/bootstrap.js"></script> <!-- Bootstrap --> <script src="js/jquery-ui-1.9.2.custom.min.js"></script> <!-- jQuery UI --> <script src="js/fullcalendar.min.js"></script> <!-- Full Google Calendar - Calendar --> <script src="js/jquery.rateit.min.js"></script> <!-- RateIt - Star rating --> <script src="js/jquery.prettyPhoto.js"></script> <!-- prettyPhoto --> <!-- jQuery Flot --> <script src="js/excanvas.min.js"></script> <script src="js/jquery.flot.js"></script> <script src="js/jquery.flot.resize.js"></script> <script src="js/jquery.flot.pie.js"></script> <script src="js/jquery.flot.stack.js"></script> <!-- jQuery Notification - Noty --> <script src="js/jquery.noty.js"></script> <!-- jQuery Notify --> <script src="js/themes/default.js"></script> <!-- jQuery Notify --> <script src="js/layouts/bottom.js"></script> <!-- jQuery Notify --> <script src="js/layouts/topRight.js"></script> <!-- jQuery Notify --> <script src="js/layouts/top.js"></script> <!-- jQuery Notify --> <!-- jQuery Notification ends --> <script src="js/sparklines.js"></script> <!-- Sparklines --> <script src="js/jquery.cleditor.min.js"></script> <!-- CLEditor --> <script src="js/<API key>.min.js"></script> <!-- Date picker --> <script src="js/jquery.uniform.min.js"></script> <!-- jQuery Uniform --> <script src="js/bootstrap-switch.min.js"></script> <!-- Bootstrap Toggle --> <script src="js/filter.js"></script> <!-- Filter for support page --> <script src="js/custom.js"></script> <!-- Custom codes --> <script src="js/charts.js"></script> <!-- Charts & Graphs --> </body> </html>
package at.jku.sea.cloud.exceptions; /** * @author alexander noehrer */ public class <API key> extends RuntimeException { private static final long serialVersionUID = 1L; public <API key>(final long version, final long id) { super("artifact (id=" + id + ", version=" + version + ") is not a collection"); } }
namespace System.Web.Razor.Parser { [Flags] public enum BalancingModes { None = 0, BacktrackOnFailure = 1, NoErrorOnFailure = 2, <API key> = 4, <API key> = 8 } }
CREATE TABLE port_group ( id INTEGER CONSTRAINT port_group_id_nn NOT NULL, network_id INTEGER CONSTRAINT <API key> NOT NULL, network_tag INTEGER CONSTRAINT <API key> NOT NULL, usage VARCHAR2(32) CONSTRAINT port_group_usage_nn NOT NULL, creation_date DATE CONSTRAINT <API key> NOT NULL, CONSTRAINT <API key> UNIQUE (network_id), CONSTRAINT <API key> FOREIGN KEY (network_id) REFERENCES network (id) ON DELETE CASCADE, CONSTRAINT port_group_pk PRIMARY KEY (id) ); CREATE SEQUENCE port_group_seq; DECLARE CURSOR pg_curs IS SELECT ov.network_id, ov.vlan_id, vi.vlan_type, MAX(ov.creation_date) AS creation_date FROM observed_vlan ov JOIN vlan_info vi ON ov.vlan_id = vi.vlan_id GROUP BY ov.network_id, ov.vlan_id, vi.vlan_type; pg_rec pg_curs%ROWTYPE; BEGIN FOR pg_rec IN pg_curs LOOP INSERT INTO port_group (id, network_id, network_tag, usage, creation_date) VALUES (port_group_seq.NEXTVAL, pg_rec.network_id, pg_rec.vlan_id, pg_rec.vlan_type, pg_rec.creation_date); END LOOP; END; / CREATE INDEX <API key> ON port_group (usage, network_tag) COMPRESS 1; ALTER TABLE observed_vlan ADD port_group_id INTEGER; UPDATE observed_vlan SET port_group_id = (SELECT id FROM port_group WHERE observed_vlan.network_id = port_group.network_id); ALTER TABLE observed_vlan MODIFY port_group_id INTEGER CONSTRAINT <API key> NOT NULL; ALTER TABLE observed_vlan DROP PRIMARY KEY DROP INDEX; ALTER TABLE observed_vlan DROP COLUMN network_id; ALTER TABLE observed_vlan DROP COLUMN vlan_id; ALTER TABLE observed_vlan DROP COLUMN creation_date; ALTER TABLE observed_vlan ADD CONSTRAINT observed_vlan_pk PRIMARY KEY (network_device_id, port_group_id); ALTER TABLE observed_vlan ADD CONSTRAINT obs_vlan_pg_fk FOREIGN KEY (port_group_id) REFERENCES port_group (id) ON DELETE CASCADE; CREATE INDEX <API key> ON observed_vlan (port_group_id); ALTER TABLE interface RENAME COLUMN port_group TO port_group_name; ALTER TABLE interface ADD port_group_id INTEGER; ALTER TABLE interface ADD CONSTRAINT iface_pg_fk FOREIGN KEY (port_group_id) REFERENCES port_group (id); ALTER TABLE interface ADD CONSTRAINT iface_pg_ck CHECK (port_group_id IS NULL OR port_group_name IS NULL); DECLARE CURSOR vm_iface_curs IS SELECT interface.id, port_group.id AS pg_id FROM interface JOIN hardware_entity ON interface.hardware_entity_id = hardware_entity.id JOIN model ON hardware_entity.model_id = model.id JOIN virtual_machine ON virtual_machine.machine_id = hardware_entity.id JOIN "resource" ON virtual_machine.resource_id = "resource".id JOIN resholder ON "resource".holder_id = resholder.id JOIN clstr ON resholder.cluster_id = clstr.id JOIN esx_cluster ON esx_cluster.esx_cluster_id = clstr.id JOIN network_device ON esx_cluster.network_device_id = network_device.hardware_entity_id JOIN observed_vlan ON network_device.hardware_entity_id = observed_vlan.network_device_id JOIN port_group ON observed_vlan.port_group_id = port_group.id JOIN vlan_info ON port_group.usage = vlan_info.vlan_type AND port_group.network_tag = vlan_info.vlan_id WHERE (model.model_type = 'virtual_machine' OR model.model_type = 'virtual_appliance') AND vlan_info.port_group = interface.port_group_name FOR UPDATE OF interface.port_group_name, interface.port_group_id; vm_iface_rec vm_iface_curs%ROWTYPE; BEGIN FOR vm_iface_rec IN vm_iface_curs LOOP UPDATE interface SET port_group_name = NULL, port_group_id = vm_iface_rec.pg_id WHERE CURRENT OF vm_iface_curs; END LOOP; END; / COMMIT; QUIT;
// Code generated by protoc-gen-go. DO NOT EDIT. // source: micro/go-plugins/registry/gossip/proto/gossip.proto package gossip import ( fmt "fmt" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.<API key> // please upgrade the proto package // Update is the message broadcast type Update struct { // time to live for entry Expires uint64 `protobuf:"varint,1,opt,name=expires,proto3" json:"expires,omitempty"` // type of update Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` // what action is taken Action int32 `protobuf:"varint,3,opt,name=action,proto3" json:"action,omitempty"` // any other associated metadata about the data Metadata map[string]string `protobuf:"bytes,6,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // the payload data; Data []byte `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` <API key> struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Update) Reset() { *m = Update{} } func (m *Update) String() string { return proto.CompactTextString(m) } func (*Update) ProtoMessage() {} func (*Update) Descriptor() ([]byte, []int) { return <API key>, []int{0} } func (m *Update) XXX_Unmarshal(b []byte) error { return <API key>.Unmarshal(m, b) } func (m *Update) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return <API key>.Marshal(b, m, deterministic) } func (m *Update) XXX_Merge(src proto.Message) { <API key>.Merge(m, src) } func (m *Update) XXX_Size() int { return <API key>.Size(m) } func (m *Update) XXX_DiscardUnknown() { <API key>.DiscardUnknown(m) } var <API key> proto.InternalMessageInfo func (m *Update) GetExpires() uint64 { if m != nil { return m.Expires } return 0 } func (m *Update) GetType() int32 { if m != nil { return m.Type } return 0 } func (m *Update) GetAction() int32 { if m != nil { return m.Action } return 0 } func (m *Update) GetMetadata() map[string]string { if m != nil { return m.Metadata } return nil } func (m *Update) GetData() []byte { if m != nil { return m.Data } return nil } func init() { proto.RegisterType((*Update)(nil), "gossip.Update") proto.RegisterMapType((map[string]string)(nil), "gossip.Update.MetadataEntry") } func init() { proto.RegisterFile("micro/go-plugins/registry/gossip/proto/gossip.proto", <API key>) } var <API key> = []byte{ // 223 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x8f, 0x41, 0x4b, 0x03, 0x31, 0x10, 0x85, 0x49, 0xb7, 0x4d, 0xed, 0xa8, 0x20, 0x83, 0x48, 0x10, 0x0f, 0x8b, 0xa7, 0xbd, 0xb8, 0x01, 0x7b, 0x29, 0x7a, 0xf6, 0xe8, 0x25, 0xe0, 0x0f, 0x88, 0x6d, 0x08, 0xc1, 0x76, 0x13, 0x92, 0xa9, 0x98, 0x9f, 0xea, 0xbf, 0x91, 0x26, 0x51, 0xf0, 0xf6, 0xbe, 0x99, 0x37, 0xbc, 0x37, 0xb0, 0x3e, 0xb8, 0x6d, 0xf4, 0xd2, 0xfa, 0x87, 0xb0, 0x3f, 0x5a, 0x37, 0x25, 0x19, 0x8d, 0x75, 0x89, 0x62, 0x96, 0xd6, 0xa7, 0xe4, 0x82, 0x0c, 0xd1, 0x93, 0x6f, 0x30, 0x16, 0x40, 0x5e, 0xe9, 0xfe, 0x9b, 0x01, 0x7f, 0x0b, 0x3b, 0x4d, 0x06, 0x05, 0x2c, 0xcd, 0x57, 0x70, 0xd1, 0x24, 0xc1, 0x7a, 0x36, 0xcc, 0xd5, 0x2f, 0x22, 0xc2, 0x9c, 0x72, 0x30, 0x62, 0xd6, 0xb3, 0x61, 0xa1, 0x8a, 0xc6, 0x1b, 0xe0, 0x7a, 0x4b, 0xce, 0x4f, 0xa2, 0x2b, 0xd3, 0x46, 0xb8, 0x81, 0xb3, 0x83, 0x21, 0xbd, 0xd3, 0xa4, 0x05, 0xef, 0xbb, 0xe1, 0xfc, 0xf1, 0x6e, 0x6c, 0xc9, 0x35, 0x67, 0x7c, 0x6d, 0xeb, 0x97, 0x89, 0x62, 0x56, 0x7f, 0xee, 0x53, 0x4a, 0xb9, 0x5a, 0xf6, 0x6c, 0xb8, 0x50, 0x45, 0xdf, 0x3e, 0xc3, 0xe5, 0x3f, 0x3b, 0x5e, 0x41, 0xf7, 0x61, 0x72, 0x29, 0xb8, 0x52, 0x27, 0x89, 0xd7, 0xb0, 0xf8, 0xd4, 0xfb, 0x63, 0x6d, 0xb7, 0x52, 0x15, 0x9e, 0x66, 0x1b, 0xf6, 0xce, 0xcb, 0xab, 0xeb, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8c, 0xfb, 0xd3, 0xd6, 0x21, 0x01, 0x00, 0x00, }
# RTK RTK - [GitHub](https://github.com/ApolloAuto/apollo)Apollo - [](../quickstart/<API key>.md)Docker - [Apollo](http://data.apollo.auto/?name=sensor%20data&data_key=multisensor&data_type=1&locale=en-us&lang=en)demo*apollo3.5* ## 2. apollo 2.1 ApolloDocker bash docker/scripts/dev_start.sh bash docker/scripts/dev_into.sh 2.2 # (Optional) To make sure you start clean bash apollo.sh clean -a bash apollo.sh build_opt ## 3. RTK cyber_launch start /apollo/modules/localization/launch/rtk_localization.launch /apollo/data/loglog - localization.INFO : INFOlog - localization.WARNING : WARNINGlog - localization.ERROR : ERRORlog - localization.out : - localizaiton.flags : localization ## 4. record demo"apollo3.5"DATA_PATH cd DATA_PATH/records cyber_recorder play -f record.* cyber_launch start /apollo/modules/localization/launch/msf_visualizer.launch /apollo/cyber/data/map_visual topic - /apollo/sensor/lidar128/compensator/PointCloud2 - /apollo/localization/pose ![1](images/rtk_localization/online_visualizer.png)
package String::CRC32; require Exporter; require DynaLoader; @ISA = qw(Exporter DynaLoader); $VERSION = 1.5; # Items to export into callers namespace by default @EXPORT = qw(crc32); # Other items we are prepared to export if requested @EXPORT_OK = qw(); bootstrap String::CRC32; 1;
/* * Package : org.ludo.codegenerator.core.gen.bean * Source : IStereotype.java */ package org.ludo.codegenerator.core.gen.bean; import java.io.Serializable; import java.util.Date; import java.util.ArrayList; import java.util.List; import org.ludo.codegenerator.core.gen.bean.impl.AttributBean; import org.ludo.codegenerator.core.gen.bean.impl.ClasseBean; import org.ludo.codegenerator.core.gen.bean.abst.IStereotypeAbstract; /** * <b>Description :</b> * IStereotype * */ public interface IStereotype extends IStereotypeAbstract, Serializable { }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_147-icedtea) on Tue Mar 27 20:06:55 PDT 2012 --> <title>Uses of Class Img</title> <meta name="date" content="2012-03-27"> <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><! if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class Img"; } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar_top"> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../Img.html" title="class in &lt;Unnamed&gt;">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../overview-tree.html">Tree</a></li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li><a href="../index-files/index-1.html">Index</a></li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../index.html?class-useImg.html" target="_top">Frames</a></li> <li><a href="Img.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../allclasses-noframe.html">All 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"> <h2 title="Uses of Class Img" class="title">Uses of Class<br>Img</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../Img.html" title="class in &lt;Unnamed&gt;">Img</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href>&amp;lt;Unnamed&amp;gt;</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name> </a> <h3>Uses of <a href="../Img.html" title="class in &lt;Unnamed&gt;">Img</a> in <a href="../package-summary.html">&lt;Unnamed&gt;</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../package-summary.html">&lt;Unnamed&gt;</a> with type parameters of type <a href="../Img.html" title="class in &lt;Unnamed&gt;">Img</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>private java.util.HashMap&lt;java.lang.Character,<a href="../Img.html" title="class in &lt;Unnamed&gt;">Img</a>&gt;</code></td> <td class="colLast"><span class="strong">ImageSet.</span><code><strong><a href="../ImageSet.html#image_set">image_set</a></strong></code> <div class="block">set of id character to SWT.Image mappings for game map images</div> </td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../package-summary.html">&lt;Unnamed&gt;</a> that return types with arguments of type <a href="../Img.html" title="class in &lt;Unnamed&gt;">Img</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>java.util.HashMap&lt;java.lang.Character,<a href="../Img.html" title="class in &lt;Unnamed&gt;">Img</a>&gt;</code></td> <td class="colLast"><span class="strong">ImageSet.</span><code><strong><a href="../ImageSet.html#getImage_set()">getImage_set</a></strong>()</code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Method parameters in <a href="../package-summary.html">&lt;Unnamed&gt;</a> with type arguments of type <a href="../Img.html" title="class in &lt;Unnamed&gt;">Img</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="strong">ImageSet.</span><code><strong><a href="../ImageSet.html#setImage_set(java.util.HashMap)">setImage_set</a></strong>(java.util.HashMap&lt;java.lang.Character,<a href="../Img.html" title="class in &lt;Unnamed&gt;">Img</a>&gt;&nbsp;image_set)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <div class="bottomNav"><a name="navbar_bottom"> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>"> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../Img.html" title="class in &lt;Unnamed&gt;">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../overview-tree.html">Tree</a></li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li><a href="../index-files/index-1.html">Index</a></li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../index.html?class-useImg.html" target="_top">Frames</a></li> <li><a href="Img.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../allclasses-noframe.html">All 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> </body> </html>
package org.glob3.mobile.specific; import java.util.Map; import org.glob3.mobile.generated.IByteBuffer; import org.glob3.mobile.generated.IJSONParser; import org.glob3.mobile.generated.JSONArray; import org.glob3.mobile.generated.JSONBaseObject; import org.glob3.mobile.generated.JSONBoolean; import org.glob3.mobile.generated.JSONDouble; import org.glob3.mobile.generated.JSONFloat; import org.glob3.mobile.generated.JSONInteger; import org.glob3.mobile.generated.JSONLong; import org.glob3.mobile.generated.JSONNull; import org.glob3.mobile.generated.JSONObject; import org.glob3.mobile.generated.JSONString; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.JsonPrimitive; public class <API key> extends IJSONParser { @Override public JSONBaseObject parse(final IByteBuffer buffer, final boolean nullAsObject) { return parse(buffer.getAsString(), nullAsObject); } @Override public JSONBaseObject parse(final String string, final boolean nullAsObject) { final JsonParser parser = new JsonParser(); final JsonElement element = parser.parse(string); return convert(element, nullAsObject); } private JSONBaseObject convert(final JsonElement element, final boolean nullAsObject) { if (element.isJsonNull()) { return nullAsObject ? new JSONNull() : null; } else if (element.isJsonObject()) { final JsonObject jsonObject = (JsonObject) element; final JSONObject result = new JSONObject(); for (final Map.Entry<String, JsonElement> entry : jsonObject.entrySet()) { result.put(entry.getKey(), convert(entry.getValue(), nullAsObject)); } return result; } else if (element.isJsonPrimitive()) { final JsonPrimitive jsonPrimitive = (JsonPrimitive) element; if (jsonPrimitive.isBoolean()) { return new JSONBoolean(jsonPrimitive.getAsBoolean()); } else if (jsonPrimitive.isNumber()) { final double doubleValue = jsonPrimitive.getAsDouble(); final long longValue = (long) doubleValue; if (doubleValue == longValue) { final int intValue = (int) longValue; return (intValue == longValue) ? new JSONInteger(intValue) : new JSONLong(longValue); } final float floatValue = (float) doubleValue; return (floatValue == doubleValue) ? new JSONFloat(floatValue) : new JSONDouble(doubleValue); } else if (jsonPrimitive.isString()) { return new JSONString(jsonPrimitive.getAsString()); } else { throw new RuntimeException("JSON unsopoerted" + element.getClass()); } } else if (element.isJsonArray()) { final JsonArray jsonArray = (JsonArray) element; final JSONArray result = new JSONArray(); for (final JsonElement child : jsonArray) { result.add(convert(child, nullAsObject)); } return result; } else { throw new RuntimeException("JSON unsopoerted" + element.getClass()); } } }
using System; using System.Collections.Generic; using System.Linq; using XenAdmin.Core; using XenAPI; namespace XenAdmin.Actions { public class EnableHAAction : PureAsyncAction { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private readonly Dictionary<VM, VMStartupOptions> startupOptions; private readonly SR[] heartbeatSRs; private readonly long failuresToTolerate; public EnableHAAction(Pool pool, Dictionary<VM, VMStartupOptions> startupOptions, List<SR> heartbeatSRs, long failuresToTolerate) : base(pool.Connection, string.Format(Messages.ENABLING_HA_ON, Helpers.GetName(pool).Ellipsise(50)), Messages.ENABLING_HA, false) { if (heartbeatSRs.Count == 0) throw new ArgumentException("You must specify at least 1 heartbeat SR"); Pool = pool; this.startupOptions = startupOptions; this.heartbeatSRs = heartbeatSRs.ToArray(); this.failuresToTolerate = failuresToTolerate; } public List<SR> HeartbeatSRs { get { return new List<SR>(heartbeatSRs); } } protected override void Run() { if (startupOptions != null) { double increment = 10.0 / Math.Max(startupOptions.Count, 1); int i = 0; // First set any VM restart priorities supplied foreach (VM vm in startupOptions.Keys) { // Set new VM restart priority and ha_always_run log.DebugFormat("Setting HA priority on {0} to {1}", vm.Name(), startupOptions[vm].HaRestartPriority); XenAPI.VM.<API key>(this.Session, vm, (VM.HA_Restart_Priority)startupOptions[vm].HaRestartPriority); // Set new VM order and start_delay log.DebugFormat("Setting start order on {0} to {1}", vm.Name(), startupOptions[vm].Order); XenAPI.VM.set_order(this.Session, vm.opaque_ref, startupOptions[vm].Order); log.DebugFormat("Setting start order on {0} to {1}", vm.Name(), startupOptions[vm].StartDelay); XenAPI.VM.set_start_delay(this.Session, vm.opaque_ref, startupOptions[vm].StartDelay); this.PercentComplete = (int)(++i * increment); } } this.PercentComplete = 10; log.DebugFormat("Setting <API key> to {0}", failuresToTolerate); XenAPI.Pool.<API key>(this.Session, Pool.opaque_ref, failuresToTolerate); var refs = heartbeatSRs.Select(sr => new XenRef<SR>(sr.opaque_ref)).ToList(); try { log.Debug("Enabling HA for pool " + Pool.Name()); // NB the line below also performs a pool db sync RelatedTask = XenAPI.Pool.async_enable_ha(this.Session, refs, new Dictionary<string, string>()); PollToCompletion(15, 100); log.Debug("Success enabling HA on pool " + Pool.Name()); } catch (Failure f) { if (f.ErrorDescription.Count > 1 && f.ErrorDescription[0] == "VDI_NOT_AVAILABLE") { var vdi = Connection.Resolve(new XenRef<VDI>(f.ErrorDescription[1])); if (vdi != null) throw new Failure(string.Format(FriendlyErrorNames.VDI_NOT_AVAILABLE, vdi.uuid)); } throw; } this.Description = Messages.COMPLETED; } } }
<?php declare(strict_types=1); namespace Mindy\Orm\Tests\Databases\Sqlite; use Mindy\Orm\Tests\QueryBuilder\QueryTest; class SqliteQueryTest extends QueryTest { public $driver = 'sqlite'; }
# <API key>: true require_relative "../../helpers/file" module Byebug # Reopens the +info+ command to define the +file+ subcommand class InfoCommand < Command # Information about a particular source file class FileCommand < Command include Helpers::FileHelper include Helpers::StringHelper self.<API key> = true def self.regexp /^\s* f(?:ile)? (?:\s+ (.+))? \s*$/x end def self.description <<-DESCRIPTION inf[o] f[ile] #{short_description} It informs about file name, number of lines, possible breakpoints in the file, last modification time and sha1 digest. DESCRIPTION end def self.short_description "Information about a particular source file." end def execute file = @match[1] || frame.file return errmsg(pr("info.errors.undefined_file", file: file)) unless File.exist?(file) puts prettify <<-RUBY File #{info_file_basic(file)} Breakpoint line numbers: #{<API key>(file)} Modification time: #{info_file_mtime(file)} Sha1 Signature: #{info_file_sha1(file)} RUBY end private def info_file_basic(file) path = File.expand_path(file) return unless File.exist?(path) s = n_lines(path) == 1 ? "" : "s" "#{path} (#{n_lines(path)} line#{s})" end def <API key>(file) breakpoints = Breakpoint.potential_lines(file) return unless breakpoints breakpoints.to_a.sort.join(" ") end def info_file_mtime(file) File.stat(file).mtime end def info_file_sha1(file) require "digest/sha1" Digest::SHA1.hexdigest(file) end end end end
#include "private.h" #include <Elementary.h> #include "config.h" #include "termio.h" #include "media.h" #include "options.h" #include "options_wallpaper.h" #include "extns.h" #include "media.h" #include "main.h" #include <sys/stat.h> typedef struct _Background_Item { const char *path; Eina_Bool selected; Elm_Object_Item *item; } Background_Item; typedef struct <API key> { <API key> *class; Background_Item *item; } <API key>; static Eina_Stringshare *_system_path, *_user_path; static Evas_Object *_bg_grid = NULL, *_term = NULL, *_entry = NULL, *_flip = NULL, *_bubble = NULL; static Eina_List *_backgroundlist = NULL; static Ecore_Timer *_bubble_disappear; static Ecore_Thread *_thread; static void _cb_fileselector(void *data EINA_UNUSED, Evas_Object *obj, void* event) { if (event) { elm_object_text_set(_entry, <API key>(obj)); elm_flip_go_to(_flip, EINA_TRUE, ELM_FLIP_PAGE_LEFT); } else { elm_flip_go_to(_flip, EINA_TRUE, ELM_FLIP_PAGE_LEFT); } } static Eina_Bool <API key>(void *data EINA_UNUSED) { evas_object_del(_bubble); _bubble_disappear = NULL; return <API key>; } static void _bubble_show(char *text) { Evas_Object *opbox = <API key>(_bg_grid); Evas_Object *o; int x = 0, y = 0, w , h; <API key>(_bg_grid, &x, &y, &w ,&h); if (_bubble_disappear) { ecore_timer_del(_bubble_disappear); <API key>(NULL); } _bubble = elm_bubble_add(opbox); elm_bubble_pos_set(_bubble, <API key>); evas_object_resize(_bubble, 200, 50); evas_object_move(_bubble, (x + w - 200), (y + h - 50)); evas_object_show(_bubble); o = elm_label_add(_bubble); elm_object_text_set(o, text); <API key>(_bubble, o); _bubble_disappear = ecore_timer_add(2.0, <API key>, NULL); } static char * _grid_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) { Background_Item *item = data; const char *s; if (!item->path) return strdup(_("None")); s = ecore_file_file_get(item->path); if (s) return strdup(s); return NULL; } static Evas_Object * _grid_content_get(void *data, Evas_Object *obj, const char *part) { Background_Item *item = data; Evas_Object *o, *oe; Config *config = termio_config_get(_term); char path[PATH_MAX]; if (!strcmp(part, "elm.swallow.icon")) { if (item->path) { int i; Media_Type type; for (i = 0; extn_edj[i]; i++) { if (<API key>(item->path, extn_edj[i])) return media_add(obj, item->path, config, MEDIA_BG, MEDIA_TYPE_EDJE); } type = media_src_type_get(item->path); return media_add(obj, item->path, config, MEDIA_THUMB, type); } else { if (!config->theme) return NULL; snprintf(path, PATH_MAX, "%s/themes/%s", <API key>(), config->theme); o = elm_layout_add(obj); oe = elm_layout_edje_get(o); if (!<API key>(oe, path, "terminology/background")) { evas_object_del(o); return NULL; } evas_object_show(o); return o; } } return NULL; } static void _item_selected(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { Background_Item *item = data; Config *config = termio_config_get(_term); if (!config) return; if (!item->path) { // no background <API key>(config->background); config->background = NULL; config_save(config, NULL); main_media_update(config); } else if (<API key>(&(config->background), item->path)) { config_save(config, NULL); main_media_update(config); } } static void <API key>(<API key> *msg_data) { <API key> *insert_msg = msg_data; Config *config = termio_config_get(_term); if (insert_msg && insert_msg->item && insert_msg->class && config) { Background_Item *item = insert_msg->item; <API key> *item_class = insert_msg->class; item->item = <API key>(_bg_grid, item_class, item, _item_selected, item); if ((!item->path) && (!config->background)) { <API key>(item->item, EINA_TRUE); <API key>(item->item, <API key>); } else if ((item->path) && (config->background)) { if (strcmp(item->path, config->background) == 0) { <API key>(item->item, EINA_TRUE); <API key>(item->item, <API key>); } } } free(msg_data); } static Eina_List* <API key>(Eina_List *list, const char *root_path, <API key> *class) { Eina_List *childs = ecore_file_ls(root_path); char *file_name, path[PATH_MAX]; int i, j; Background_Item *item; const char **extns[5] = { extn_img, extn_scale, extn_edj, extn_mov, NULL }; const char **ex; <API key> *notify; if (!childs) return list; EINA_LIST_FREE(childs, file_name) { snprintf(path, PATH_MAX, "%s/%s", root_path, file_name); if ((!ecore_file_is_dir(path)) && (file_name[0] != '.')) { //file is found, search for correct file endings ! for (j = 0; extns[j]; j++) { ex = extns[j]; for (i = 0; ex[i]; i++) { if (<API key>(file_name, ex[i])) { //File is found and valid item = calloc(1, sizeof(Background_Item)); if (item) { notify = calloc(1, sizeof(<API key>)); item->path = <API key>(path); list = eina_list_append(list, item); //insert item to gengrid notify->class = class; notify->item = item; //<API key>(th, notify); <API key>(notify); } break; } } } } free(file_name); } return list; } static void _refresh_directory(const char* data) { Background_Item *item; <API key> *item_class; // This will run elm_gengrid_clear elm_gengrid_clear(_bg_grid); if (_backgroundlist) { EINA_LIST_FREE(_backgroundlist, item) { if (item->path) <API key>(item->path); free(item); } _backgroundlist = NULL; } item_class = <API key>(); item_class->func.text_get = _grid_text_get; item_class->func.content_get = _grid_content_get; item = calloc(1, sizeof(Background_Item)); _backgroundlist = eina_list_append(_backgroundlist, item); //Insert None Item <API key> *notify = calloc(1, sizeof(<API key>)); notify->class = item_class; notify->item = item; <API key>(notify); _backgroundlist = <API key>(_backgroundlist, data, item_class); <API key>(item_class); _thread = NULL; } static void <API key>(const char *path) { if(!ecore_file_exists(path)) return; _refresh_directory(path); } static void _cb_entry_changed(void *data EINA_UNUSED, Evas_Object *parent, void *event EINA_UNUSED) { const char *path = elm_object_text_get(parent); <API key>(path); } static void _cb_hoversel_select(void *data, Evas_Object *hoversel EINA_UNUSED, void *event EINA_UNUSED) { Evas_Object *o; char *path = data; if (path) { elm_object_text_set(_entry, path); } else { o = <API key>(_flip, "back"); <API key>(o, elm_object_text_get(_entry)); elm_flip_go_to(_flip, EINA_FALSE, ELM_FLIP_PAGE_RIGHT); } } static void <API key>(void) { char path[PATH_MAX]; snprintf(path, PATH_MAX, "%s/backgrounds/", <API key>()); if (_system_path) <API key>(&_system_path, path); else _system_path = <API key>(path); } static const char* <API key>(void){ char path[PATH_MAX], *user; user = getenv("HOME"); if(!user) return NULL; snprintf(path, PATH_MAX, "%s/.config/terminology/background/", user); if (!ecore_file_exists(path)) ecore_file_mkpath(path); if (!_user_path) _user_path = <API key>(path); else <API key>(&_user_path, path); return _user_path; } static const char* _import_background(const char* background) { char path[PATH_MAX]; const char *filename = ecore_file_file_get(background); if (!filename) return NULL; if (!<API key>()) return NULL; snprintf(path, PATH_MAX, "%s/%s", _user_path, filename); if (!ecore_file_cp(background, path)) return NULL; return <API key>(path); } static void <API key>(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { Config *config = termio_config_get(_term); char *<API key> = ecore_file_dir_get(config->background); if (!_user_path) { if (!<API key>()) return; } if (!config->background) return; if (strncmp(<API key>, _user_path, strlen(<API key>)) == 0) { _bubble_show(_("Source file is target file")); free(<API key>); return; } const char *newfile = _import_background(config->background); if (newfile) { <API key>(&(config->background), newfile); config_save(config, NULL); main_media_update(config); <API key>(newfile); _bubble_show(_("Picture imported")); elm_object_text_set(_entry, <API key>); } else { _bubble_show(_("Failed")); } free(<API key>); } void options_wallpaper(Evas_Object *opbox, Evas_Object *term) { Evas_Object *frame, *o, *bx, *bx2; Config *config = termio_config_get(term); char path[PATH_MAX], *<API key>; _term = term; frame = o = elm_frame_add(opbox); <API key>(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); <API key>(o, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_object_text_set(o, _("Background")); evas_object_show(o); elm_box_pack_end(opbox, o); _flip = o = elm_flip_add(opbox); <API key>(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); <API key>(o, EVAS_HINT_FILL, EVAS_HINT_FILL); <API key>(frame, o); evas_object_show(o); o = <API key>(opbox); <API key>(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); <API key>(o, EVAS_HINT_FILL, EVAS_HINT_FILL); <API key>(_flip, "back", o); <API key>(o, EINA_TRUE); <API key>(o, "done", _cb_fileselector, NULL); evas_object_show(o); bx = o = elm_box_add(opbox); <API key>(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); <API key>(o, EVAS_HINT_FILL, EVAS_HINT_FILL); <API key>(_flip, "front", bx); evas_object_show(o); bx2 = o = elm_box_add(opbox); <API key>(o, EVAS_HINT_EXPAND, 0.0); <API key>(o, EVAS_HINT_FILL, 0.0); <API key>(o, EINA_TRUE); elm_box_pack_start(bx, o); evas_object_show(o); _entry = o = elm_entry_add(opbox); <API key>(o, EVAS_HINT_EXPAND, 0.0); <API key>(o, EVAS_HINT_FILL, 0.0); <API key>(o, EINA_TRUE); <API key>(o, EINA_TRUE); <API key>(o, <API key>, <API key>); <API key>(_entry, "changed", _cb_entry_changed, NULL); elm_box_pack_start(bx2, o); evas_object_show(o); o = elm_hoversel_add(opbox); <API key>(o, 0.0, 0.0); <API key>(o, EVAS_HINT_FILL, 0.0); elm_object_text_set(o, _("Select Path")); elm_box_pack_end(bx2, o); evas_object_show(o); snprintf(path, PATH_MAX, "%s/backgrounds/", <API key>()); <API key>(); <API key>(o, _("System"), NULL, ELM_ICON_NONE, _cb_hoversel_select , _system_path); if (<API key>()) <API key>(o, _("User"), NULL, ELM_ICON_NONE, _cb_hoversel_select , _user_path); //In the other case it has failed, so dont show the user item <API key>(o, _("Other"), NULL, ELM_ICON_NONE, _cb_hoversel_select , NULL); _bg_grid = o = elm_gengrid_add(opbox); <API key>(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); <API key>(o, EVAS_HINT_FILL, EVAS_HINT_FILL); <API key>(o, "clicked,double", <API key>, NULL); <API key>(o, <API key>() * 100, <API key>() * 80); elm_box_pack_end(bx, o); evas_object_show(o); o = elm_label_add(opbox); <API key>(o, EVAS_HINT_EXPAND, 0.0); <API key>(o, EVAS_HINT_FILL, 0.0); elm_object_text_set(o, _("Double click on a picture to import it")); elm_box_pack_end(bx, o); evas_object_show(o); if (config->background) { <API key> = ecore_file_dir_get(config->background); elm_object_text_set(_entry, <API key>); free(<API key>); } else { elm_object_text_set(_entry, _system_path); } } void <API key>(void) { Background_Item *item; EINA_LIST_FREE(_backgroundlist, item) { if (item->path) <API key>(item->path); free(item); } _backgroundlist = NULL; if (_user_path) { <API key>(_user_path); _user_path = NULL; } if (_system_path) { <API key>(_system_path); _system_path = NULL; } }
#include "config.h" #if ENABLE(WEB_SOCKETS) #include "WebSocketHandshake.h" #include "Base64.h" #include "Cookie.h" #include "CookieJar.h" #include "Document.h" #include "HTTPHeaderMap.h" #include "KURL.h" #include "Logging.h" #include "ScriptCallStack.h" #include "<API key>.h" #include "SecurityOrigin.h" #include <wtf/<API key>.h> #include <wtf/MD5.h> #include <wtf/SHA1.h> #include <wtf/StdLibExtras.h> #include <wtf/StringExtras.h> #include <wtf/Vector.h> #include <wtf/text/CString.h> #include <wtf/text/StringBuilder.h> #include <wtf/text/WTFString.h> #include <wtf/unicode/CharacterNames.h> namespace WebCore { static const char <API key>[] = "!\"#$%&'()*+,-./:;<=>?@<API key>[\\]^_`<API key>{|}~"; static String resourceName(const KURL& url) { String name = url.path(); if (name.isEmpty()) name = "/"; if (!url.query().isNull()) name += "?" + url.query(); ASSERT(!name.isEmpty()); ASSERT(!name.contains(' ')); return name; } static String hostName(const KURL& url, bool secure) { ASSERT(url.protocolIs("wss") == secure); StringBuilder builder; builder.append(url.host().lower()); if (url.port() && ((!secure && url.port() != 80) || (secure && url.port() != 443))) { builder.append(':'); builder.append(String::number(url.port())); } return builder.toString(); } static const size_t <API key> = 128; static String trimConsoleMessage(const char* p, size_t len) { String s = String(p, std::min<size_t>(len, <API key>)); if (len > <API key>) s.append(horizontalEllipsis); return s; } static uint32_t <API key>(uint32_t n) { if (!n) return 0; if (n == std::numeric_limits<uint32_t>::max()) return <API key>(); uint32_t max = std::numeric_limits<uint32_t>::max() - (std::numeric_limits<uint32_t>::max() % n); ASSERT(!(max % n)); uint32_t v; do { v = <API key>(); } while (v >= max); return v % n; } static void <API key>(uint32_t& number, String& key) { uint32_t space = <API key>(12) + 1; uint32_t max = 4294967295U / space; number = <API key>(max); uint32_t product = number * space; String s = String::number(product); int n = <API key>(12) + 1; DEFINE_STATIC_LOCAL(String, randomChars, (<API key>)); for (int i = 0; i < n; i++) { int pos = <API key>(s.length() + 1); int chpos = <API key>(randomChars.length()); s.insert(randomChars.substring(chpos, 1), pos); } DEFINE_STATIC_LOCAL(String, spaceChar, (" ")); for (uint32_t i = 0; i < space; i++) { int pos = <API key>(s.length() - 1) + 1; s.insert(spaceChar, pos); } ASSERT(s[0] != ' '); ASSERT(s[s.length() - 1] != ' '); key = s; } static void generateHixie76Key3(unsigned char key3[8]) { <API key>(key3, 8); } static void setChallengeNumber(unsigned char* buf, uint32_t number) { unsigned char* p = buf + 3; for (int i = 0; i < 4; i++) { *p = number & 0xFF; --p; number >>= 8; } } static void <API key>(uint32_t number1, uint32_t number2, unsigned char key3[8], unsigned char expectedChallenge[16]) { unsigned char challenge[16]; setChallengeNumber(&challenge[0], number1); setChallengeNumber(&challenge[4], number2); memcpy(&challenge[8], key3, 8); MD5 md5; md5.addBytes(challenge, sizeof(challenge)); Vector<uint8_t, 16> digest; md5.checksum(digest); memcpy(expectedChallenge, digest.data(), 16); } static String <API key>() { static const size_t nonceSize = 16; unsigned char key[nonceSize]; <API key>(key, nonceSize); return base64Encode(reinterpret_cast<char*>(key), nonceSize); } static String <API key>(const String& secWebSocketKey) { static const char* const webSocketKeyGUID = "<API key>"; static const size_t sha1HashSize = 20; // FIXME: This should be defined in SHA1.h. SHA1 sha1; CString keyData = secWebSocketKey.ascii(); sha1.addBytes(reinterpret_cast<const uint8_t*>(keyData.data()), keyData.length()); sha1.addBytes(reinterpret_cast<const uint8_t*>(webSocketKeyGUID), strlen(webSocketKeyGUID)); Vector<uint8_t, sha1HashSize> hash; sha1.computeHash(hash); return base64Encode(reinterpret_cast<const char*>(hash.data()), sha1HashSize); } WebSocketHandshake::WebSocketHandshake(const KURL& url, const String& protocol, <API key>* context, bool useHixie76Protocol) : m_url(url) , m_clientProtocol(protocol) , m_secure(m_url.protocolIs("wss")) , m_context(context) , <API key>(useHixie76Protocol) , m_mode(Incomplete) { if (<API key>) { uint32_t number1; uint32_t number2; <API key>(number1, <API key>); <API key>(number2, <API key>); generateHixie76Key3(m_hixie76Key3); <API key>(number1, number2, m_hixie76Key3, <API key>); } else { m_secWebSocketKey = <API key>(); m_expectedAccept = <API key>(m_secWebSocketKey); } } WebSocketHandshake::~WebSocketHandshake() { } const KURL& WebSocketHandshake::url() const { return m_url; } void WebSocketHandshake::setURL(const KURL& url) { m_url = url.copy(); } const String WebSocketHandshake::host() const { return m_url.host().lower(); } const String& WebSocketHandshake::clientProtocol() const { return m_clientProtocol; } void WebSocketHandshake::setClientProtocol(const String& protocol) { m_clientProtocol = protocol; } bool WebSocketHandshake::secure() const { return m_secure; } String WebSocketHandshake::clientOrigin() const { return m_context->securityOrigin()->toString(); } String WebSocketHandshake::clientLocation() const { StringBuilder builder; builder.append(m_secure ? "wss" : "ws"); builder.append(": builder.append(hostName(m_url, m_secure)); builder.append(resourceName(m_url)); return builder.toString(); } CString WebSocketHandshake::<API key>() const { // Keep the following consistent with <API key>(). StringBuilder builder; builder.append("GET "); builder.append(resourceName(m_url)); builder.append(" HTTP/1.1\r\n"); Vector<String> fields; if (<API key>) fields.append("Upgrade: WebSocket"); else fields.append("Upgrade: websocket"); fields.append("Connection: Upgrade"); fields.append("Host: " + hostName(m_url, m_secure)); if (<API key>) fields.append("Origin: " + clientOrigin()); else fields.append("<API key>: " + clientOrigin()); if (!m_clientProtocol.isEmpty()) fields.append("<API key>: " + m_clientProtocol); KURL url = httpURLFor<API key>(); if (m_context->isDocument()) { Document* document = static_cast<Document*>(m_context); String cookie = <API key>(document, url); if (!cookie.isEmpty()) fields.append("Cookie: " + cookie); // Set "Cookie2: <cookie>" if cookies 2 exists for url? } if (<API key>) { fields.append("Sec-WebSocket-Key1: " + <API key>); fields.append("Sec-WebSocket-Key2: " + <API key>); } else { fields.append("Sec-WebSocket-Key: " + m_secWebSocketKey); fields.append("<API key>: 8"); } // Fields in the handshake are sent by the client in a random order; the // order is not meaningful. Thus, it's ok to send the order we constructed // the fields. for (size_t i = 0; i < fields.size(); i++) { builder.append(fields[i]); builder.append("\r\n"); } builder.append("\r\n"); CString handshakeHeader = builder.toString().utf8(); // Hybi-10 handshake is complete at this point. if (!<API key>) return handshakeHeader; // Hixie-76 protocol requires sending eight-byte data (so-called "key3") after the request header fields. char* characterBuffer = 0; CString msg = CString::newUninitialized(handshakeHeader.length() + sizeof(m_hixie76Key3), characterBuffer); memcpy(characterBuffer, handshakeHeader.data(), handshakeHeader.length()); memcpy(characterBuffer + handshakeHeader.length(), m_hixie76Key3, sizeof(m_hixie76Key3)); return msg; } <API key> WebSocketHandshake::<API key>() const { // Keep the following consistent with <API key>(). // FIXME: do we need to store m_secWebSocketKey1, m_secWebSocketKey2 and // m_key3 in <API key>? <API key> request("GET", m_url); if (<API key>) request.addHeaderField("Upgrade", "WebSocket"); else request.addHeaderField("Upgrade", "websocket"); request.addHeaderField("Connection", "Upgrade"); request.addHeaderField("Host", hostName(m_url, m_secure)); if (<API key>) request.addHeaderField("Origin", clientOrigin()); else request.addHeaderField("<API key>", clientOrigin()); if (!m_clientProtocol.isEmpty()) request.addHeaderField("<API key>:", m_clientProtocol); KURL url = httpURLFor<API key>(); if (m_context->isDocument()) { Document* document = static_cast<Document*>(m_context); String cookie = <API key>(document, url); if (!cookie.isEmpty()) request.addHeaderField("Cookie", cookie); // Set "Cookie2: <cookie>" if cookies 2 exists for url? } if (<API key>) { request.addHeaderField("Sec-WebSocket-Key1", <API key>); request.addHeaderField("Sec-WebSocket-Key2", <API key>); request.setKey3(m_hixie76Key3); } else { request.addHeaderField("Sec-WebSocket-Key", m_secWebSocketKey); request.addHeaderField("<API key>", "8"); } return request; } void WebSocketHandshake::reset() { m_mode = Incomplete; } void WebSocketHandshake::<API key>() { m_context = 0; } int WebSocketHandshake::readServerHandshake(const char* header, size_t len) { m_mode = Incomplete; int statusCode; String statusText; int lineLength = readStatusLine(header, len, statusCode, statusText); if (lineLength == -1) return -1; if (statusCode == -1) { m_mode = Failed; // m_failureReason is set inside readStatusLine(). return len; } LOG(Network, "response code: %d", statusCode); m_response.setStatusCode(statusCode); m_response.setStatusText(statusText); if (statusCode != 101) { m_mode = Failed; m_failureReason = "Unexpected response code: " + String::number(statusCode); return len; } m_mode = Normal; if (!strnstr(header, "\r\n\r\n", len)) { // Just hasn't been received fully yet. m_mode = Incomplete; return -1; } const char* p = readHTTPHeaders(header + lineLength, header + len); if (!p) { LOG(Network, "readHTTPHeaders failed"); m_mode = Failed; // m_failureReason is set inside readHTTPHeaders(). return len; } if (!<API key>()) { LOG(Network, "header process failed"); m_mode = Failed; return p - header; } if (!<API key>) { // Hybi-10 handshake is complete at this point. m_mode = Connected; return p - header; } // In hixie-76 protocol, server's handshake contains sixteen-byte data (called "challenge response") // after the header fields. if (len < static_cast<size_t>(p - header + sizeof(<API key>))) { // Just hasn't been received /expected/ yet. m_mode = Incomplete; return -1; } m_response.<API key>(static_cast<const unsigned char*>(static_cast<const void*>(p))); if (memcmp(p, <API key>, sizeof(<API key>))) { m_mode = Failed; return (p - header) + sizeof(<API key>); } m_mode = Connected; return (p - header) + sizeof(<API key>); } WebSocketHandshake::Mode WebSocketHandshake::mode() const { return m_mode; } String WebSocketHandshake::failureReason() const { return m_failureReason; } String WebSocketHandshake::<API key>() const { return m_response.headerFields().get("<API key>"); } String WebSocketHandshake::<API key>() const { return m_response.headerFields().get("<API key>"); } String WebSocketHandshake::<API key>() const { return m_response.headerFields().get("<API key>"); } String WebSocketHandshake::serverSetCookie() const { return m_response.headerFields().get("set-cookie"); } String WebSocketHandshake::serverSetCookie2() const { return m_response.headerFields().get("set-cookie2"); } String WebSocketHandshake::serverUpgrade() const { return m_response.headerFields().get("upgrade"); } String WebSocketHandshake::serverConnection() const { return m_response.headerFields().get("connection"); } String WebSocketHandshake::<API key>() const { return m_response.headerFields().get("<API key>"); } String WebSocketHandshake::<API key>() const { return m_response.headerFields().get("<API key>"); } const <API key>& WebSocketHandshake::<API key>() const { return m_response; } KURL WebSocketHandshake::httpURLFor<API key>() const { KURL url = m_url.copy(); bool couldSetProtocol = url.setProtocol(m_secure ? "https" : "http"); ASSERT_UNUSED(couldSetProtocol, couldSetProtocol); return url; } // Returns the header length (including "\r\n"), or -1 if we have not received enough data yet. // If the line is malformed or the status code is not a 3-digit number, // statusCode and statusText will be set to -1 and a null string, respectively. int WebSocketHandshake::readStatusLine(const char* header, size_t headerLength, int& statusCode, String& statusText) { // Arbitrary size limit to prevent the server from sending an unbounded // amount of data with no newlines and forcing us to buffer it all. static const int maximumLength = 1024; statusCode = -1; statusText = String(); const char* space1 = 0; const char* space2 = 0; const char* p; size_t consumedLength; for (p = header, consumedLength = 0; consumedLength < headerLength; p++, consumedLength++) { if (*p == ' ') { if (!space1) space1 = p; else if (!space2) space2 = p; } else if (*p == '\0') { // The caller isn't prepared to deal with null bytes in status // line. WebSockets specification doesn't prohibit this, but HTTP // does, so we'll just treat this as an error. m_failureReason = "Status line contains embedded null"; return p + 1 - header; } else if (*p == '\n') break; } if (consumedLength == headerLength) return -1; // We have not received '\n' yet. const char* end = p + 1; int lineLength = end - header; if (lineLength > maximumLength) { m_failureReason = "Status line is too long"; return maximumLength; } // The line must end with "\r\n". if (lineLength < 2 || *(end - 2) != '\r') { m_failureReason = "Status line does not end with CRLF"; return lineLength; } if (!space1 || !space2) { m_failureReason = "No response code found: " + trimConsoleMessage(header, lineLength - 2); return lineLength; } String statusCodeString(space1 + 1, space2 - space1 - 1); if (statusCodeString.length() != 3) // Status code must consist of three digits. return lineLength; for (int i = 0; i < 3; ++i) if (statusCodeString[i] < '0' || statusCodeString[i] > '9') { m_failureReason = "Invalid status code: " + statusCodeString; return lineLength; } bool ok = false; statusCode = statusCodeString.toInt(&ok); ASSERT(ok); statusText = String(space2 + 1, end - space2 - 3); // Exclude "\r\n". return lineLength; } const char* WebSocketHandshake::readHTTPHeaders(const char* start, const char* end) { m_response.clearHeaderFields(); Vector<char> name; Vector<char> value; for (const char* p = start; p < end; p++) { name.clear(); value.clear(); for (; p < end; p++) { switch (*p) { case '\r': if (name.isEmpty()) { if (p + 1 < end && *(p + 1) == '\n') return p + 2; m_failureReason = "CR doesn't follow LF at " + trimConsoleMessage(p, end - p); return 0; } m_failureReason = "Unexpected CR in name at " + trimConsoleMessage(name.data(), name.size()); return 0; case '\n': m_failureReason = "Unexpected LF in name at " + trimConsoleMessage(name.data(), name.size()); return 0; case ':': break; default: name.append(*p); continue; } if (*p == ':') { ++p; break; } } for (; p < end && *p == 0x20; p++) { } for (; p < end; p++) { switch (*p) { case '\r': break; case '\n': m_failureReason = "Unexpected LF in value at " + trimConsoleMessage(value.data(), value.size()); return 0; default: value.append(*p); } if (*p == '\r') { ++p; break; } } if (p >= end || *p != '\n') { m_failureReason = "CR doesn't follow LF after value at " + trimConsoleMessage(p, end - p); return 0; } AtomicString nameStr = AtomicString::fromUTF8(name.data(), name.size()); String valueStr = String::fromUTF8(value.data(), value.size()); if (nameStr.isNull()) { m_failureReason = "Invalid UTF-8 sequence in header name"; return 0; } if (valueStr.isNull()) { m_failureReason = "Invalid UTF-8 sequence in header value"; return 0; } LOG(Network, "name=%s value=%s", nameStr.string().utf8().data(), valueStr.utf8().data()); m_response.addHeaderField(nameStr, valueStr); } ASSERT_NOT_REACHED(); return 0; } bool WebSocketHandshake::<API key>() { const String& <API key> = this-><API key>(); const String& <API key> = this-><API key>(); const String& <API key> = this-><API key>(); const String& serverUpgrade = this->serverUpgrade(); const String& serverConnection = this->serverConnection(); const String& <API key> = this-><API key>(); const String& <API key> = this-><API key>(); if (serverUpgrade.isNull()) { m_failureReason = "Error during WebSocket handshake: 'Upgrade' header is missing"; return false; } if (serverConnection.isNull()) { m_failureReason = "Error during WebSocket handshake: 'Connection' header is missing"; return false; } if (<API key>) { if (<API key>.isNull()) { m_failureReason = "Error during WebSocket handshake: '<API key>' header is missing"; return false; } if (<API key>.isNull()) { m_failureReason = "Error during WebSocket handshake: '<API key>' header is missing"; return false; } } else { if (<API key>.isNull()) { m_failureReason = "Error during WebSocket handshake: '<API key>' header is missing"; return false; } } if (!equalIgnoringCase(serverUpgrade, "websocket")) { m_failureReason = "Error during WebSocket handshake: 'Upgrade' header value is not 'WebSocket'"; return false; } if (!equalIgnoringCase(serverConnection, "upgrade")) { m_failureReason = "Error during WebSocket handshake: 'Connection' header value is not 'Upgrade'"; return false; } if (<API key>) { if (clientOrigin() != <API key>) { m_failureReason = "Error during WebSocket handshake: origin mismatch: " + clientOrigin() + " != " + <API key>; return false; } if (clientLocation() != <API key>) { m_failureReason = "Error during WebSocket handshake: location mismatch: " + clientLocation() + " != " + <API key>; return false; } if (!m_clientProtocol.isEmpty() && m_clientProtocol != <API key>) { m_failureReason = "Error during WebSocket handshake: protocol mismatch: " + m_clientProtocol + " != " + <API key>; return false; } } else { if (<API key> != m_expectedAccept) { m_failureReason = "Error during WebSocket handshake: <API key> mismatch"; return false; } if (!<API key>.isNull()) { // WebSocket protocol extensions are not supported yet. // We do not send <API key> header in our request, thus // servers should not return this header, either. m_failureReason = "Error during WebSocket handshake: <API key> header is invalid"; return false; } } return true; } } // namespace WebCore #endif // ENABLE(WEB_SOCKETS)
/* optimized and unoptimized vector and matrix functions */ #ifndef _ODE_MATRIX_H_ #define _ODE_MATRIX_H_ #include "common.h" #ifdef __cplusplus extern "C" { #endif /* set a vector/matrix of size n to all zeros, or to a specific value. */ ODE_API void dSetZero (dReal *a, int n); ODE_API void dSetValue (dReal *a, int n, dReal value); /* get the dot product of two n*1 vectors. if n <= 0 then * zero will be returned (in which case a and b need not be valid). */ ODE_API dReal dDot (const dReal *a, const dReal *b, int n); /* get the dot products of (a0,b), (a1,b), etc and return them in outsum. * all vectors are n*1. if n <= 0 then zeroes will be returned (in which case * the input vectors need not be valid). this function is somewhat faster * than calling dDot() for all of the combinations separately. */ /* NOT INCLUDED in the library for now. void dMultidot2 (const dReal *a0, const dReal *a1, const dReal *b, dReal *outsum, int n); */ /* matrix multiplication. all matrices are stored in standard row format. * the digit refers to the argument that is transposed: * 0: A = B * C (sizes: A:p*r B:p*q C:q*r) * 1: A = B' * C (sizes: A:p*r B:q*p C:q*r) * 2: A = B * C' (sizes: A:p*r B:p*q C:r*q) * case 1,2 are equivalent to saying that the operation is A=B*C but * B or C are stored in standard column format. */ ODE_API void dMultiply0 (dReal *A, const dReal *B, const dReal *C, int p,int q,int r); ODE_API void dMultiply1 (dReal *A, const dReal *B, const dReal *C, int p,int q,int r); ODE_API void dMultiply2 (dReal *A, const dReal *B, const dReal *C, int p,int q,int r); /* do an in-place cholesky decomposition on the lower triangle of the n*n * symmetric matrix A (which is stored by rows). the resulting lower triangle * will be such that L*L'=A. return 1 on success and 0 on failure (on failure * the matrix is not positive definite). */ ODE_API int dFactorCholesky (dReal *A, int n); /* solve for x: L*L'*x = b, and put the result back into x. * L is size n*n, b is size n*1. only the lower triangle of L is considered. */ ODE_API void dSolveCholesky (const dReal *L, dReal *b, int n); /* compute the inverse of the n*n positive definite matrix A and put it in * Ainv. this is not especially fast. this returns 1 on success (A was * positive definite) or 0 on failure (not PD). */ ODE_API int dInvertPDMatrix (const dReal *A, dReal *Ainv, int n); /* check whether an n*n matrix A is positive definite, return 1/0 (yes/no). * positive definite means that x'*A*x > 0 for any x. this performs a * cholesky decomposition of A. if the decomposition fails then the matrix * is not positive definite. A is stored by rows. A is not altered. */ ODE_API int dIsPositiveDefinite (const dReal *A, int n); /* factorize a matrix A into L*D*L', where L is lower triangular with ones on * the diagonal, and D is diagonal. * A is an n*n matrix stored by rows, with a leading dimension of n rounded * up to 4. L is written into the strict lower triangle of A (the ones are not * written) and the reciprocal of the diagonal elements of D are written into * d. */ ODE_API void dFactorLDLT (dReal *A, dReal *d, int n, int nskip); /* solve L*x=b, where L is n*n lower triangular with ones on the diagonal, * and x,b are n*1. b is overwritten with x. * the leading dimension of L is `nskip'. */ ODE_API void dSolveL1 (const dReal *L, dReal *b, int n, int nskip); /* solve L'*x=b, where L is n*n lower triangular with ones on the diagonal, * and x,b are n*1. b is overwritten with x. * the leading dimension of L is `nskip'. */ ODE_API void dSolveL1T (const dReal *L, dReal *b, int n, int nskip); /* in matlab syntax: a(1:n) = a(1:n) .* d(1:n) */ ODE_API void dVectorScale (dReal *a, const dReal *d, int n); /* given `L', a n*n lower triangular matrix with ones on the diagonal, * and `d', a n*1 vector of the reciprocal diagonal elements of an n*n matrix * D, solve L*D*L'*x=b where x,b are n*1. x overwrites b. * the leading dimension of L is `nskip'. */ ODE_API void dSolveLDLT (const dReal *L, const dReal *d, dReal *b, int n, int nskip); /* given an L*D*L' factorization of an n*n matrix A, return the updated * factorization L2*D2*L2' of A plus the following "top left" matrix: * * [ b a' ] <-- b is a[0] * [ a 0 ] <-- a is a[1..n-1] * * - L has size n*n, its leading dimension is nskip. L is lower triangular * with ones on the diagonal. only the lower triangle of L is referenced. * - d has size n. d contains the reciprocal diagonal elements of D. * - a has size n. * the result is written into L, except that the left column of L and d[0] * are not actually modified. see ldltaddTL.m for further comments. */ ODE_API void dLDLTAddTL (dReal *L, dReal *d, const dReal *a, int n, int nskip); /* given an L*D*L' factorization of a permuted matrix A, produce a new * factorization for row and column `r' removed. * - A has size n1*n1, its leading dimension in nskip. A is symmetric and * positive definite. only the lower triangle of A is referenced. * A itself may actually be an array of row pointers. * - L has size n2*n2, its leading dimension in nskip. L is lower triangular * with ones on the diagonal. only the lower triangle of L is referenced. * - d has size n2. d contains the reciprocal diagonal elements of D. * - p is a permutation vector. it contains n2 indexes into A. each index * must be in the range 0..n1-1. * - r is the row/column of L to remove. * the new L will be written within the old L, i.e. will have the same leading * dimension. the last row and column of L, and the last element of d, are * undefined on exit. * * a fast O(n^2) algorithm is used. see ldltremove.m for further comments. */ ODE_API void dLDLTRemove (dReal **A, const int *p, dReal *L, dReal *d, int n1, int n2, int r, int nskip); /* given an n*n matrix A (with leading dimension nskip), remove the r'th row * and column by moving elements. the new matrix will have the same leading * dimension. the last row and column of A are untouched on exit. */ ODE_API void dRemoveRowCol (dReal *A, int n, int nskip, int r); //#if defined(__ODE__) void _dSetZero (dReal *a, size_t n); void _dSetValue (dReal *a, size_t n, dReal value); dReal _dDot (const dReal *a, const dReal *b, int n); void _dMultiply0 (dReal *A, const dReal *B, const dReal *C, int p,int q,int r); void _dMultiply1 (dReal *A, const dReal *B, const dReal *C, int p,int q,int r); void _dMultiply2 (dReal *A, const dReal *B, const dReal *C, int p,int q,int r); int _dFactorCholesky (dReal *A, int n, void *tmpbuf); void _dSolveCholesky (const dReal *L, dReal *b, int n, void *tmpbuf); int _dInvertPDMatrix (const dReal *A, dReal *Ainv, int n, void *tmpbuf); int <API key> (const dReal *A, int n, void *tmpbuf); void _dFactorLDLT (dReal *A, dReal *d, int n, int nskip); void _dSolveL1 (const dReal *L, dReal *b, int n, int nskip); void _dSolveL1T (const dReal *L, dReal *b, int n, int nskip); void _dVectorScale (dReal *a, const dReal *d, int n); void _dSolveLDLT (const dReal *L, const dReal *d, dReal *b, int n, int nskip); void _dLDLTAddTL (dReal *L, dReal *d, const dReal *a, int n, int nskip, void *tmpbuf); void _dLDLTRemove (dReal **A, const int *p, dReal *L, dReal *d, int n1, int n2, int r, int nskip, void *tmpbuf); void _dRemoveRowCol (dReal *A, int n, int nskip, int r); PURE_INLINE size_t <API key>(int n) { return dPAD(n) * sizeof(dReal); } PURE_INLINE size_t <API key>(int n) { return dPAD(n) * sizeof(dReal); } PURE_INLINE size_t <API key>(int n) { size_t FactorCholesky_size = <API key>(n); size_t SolveCholesky_size = <API key>(n); size_t MaxCholesky_size = FactorCholesky_size > SolveCholesky_size ? FactorCholesky_size : SolveCholesky_size; return dPAD(n) * (n + 1) * sizeof(dReal) + MaxCholesky_size; } PURE_INLINE size_t <API key>(int n) { return dPAD(n) * n * sizeof(dReal) + <API key>(n); } PURE_INLINE size_t <API key>(int nskip) { return nskip * 2 * sizeof(dReal); } PURE_INLINE size_t <API key>(int n2, int nskip) { return n2 * sizeof(dReal) + <API key>(nskip); } // For internal use #define dSetZero(a, n) _dSetZero(a, n) #define dSetValue(a, n, value) _dSetValue(a, n, value) #define dDot(a, b, n) _dDot(a, b, n) #define dMultiply0(A, B, C, p, q, r) _dMultiply0(A, B, C, p, q, r) #define dMultiply1(A, B, C, p, q, r) _dMultiply1(A, B, C, p, q, r) #define dMultiply2(A, B, C, p, q, r) _dMultiply2(A, B, C, p, q, r) #define dFactorCholesky(A, n, tmpbuf) _dFactorCholesky(A, n, tmpbuf) #define dSolveCholesky(L, b, n, tmpbuf) _dSolveCholesky(L, b, n, tmpbuf) #define dInvertPDMatrix(A, Ainv, n, tmpbuf) _dInvertPDMatrix(A, Ainv, n, tmpbuf) #define dIsPositiveDefinite(A, n, tmpbuf) <API key>(A, n, tmpbuf) #define dFactorLDLT(A, d, n, nskip) _dFactorLDLT(A, d, n, nskip) #define dSolveL1(L, b, n, nskip) _dSolveL1(L, b, n, nskip) #define dSolveL1T(L, b, n, nskip) _dSolveL1T(L, b, n, nskip) #define dVectorScale(a, d, n) _dVectorScale(a, d, n) #define dSolveLDLT(L, d, b, n, nskip) _dSolveLDLT(L, d, b, n, nskip) #define dLDLTAddTL(L, d, a, n, nskip, tmpbuf) _dLDLTAddTL(L, d, a, n, nskip, tmpbuf) #define dLDLTRemove(A, p, L, d, n1, n2, r, nskip, tmpbuf) _dLDLTRemove(A, p, L, d, n1, n2, r, nskip, tmpbuf) #define dRemoveRowCol(A, n, nskip, r) _dRemoveRowCol(A, n, nskip, r) #define <API key>(n) <API key>(n) #define <API key>(n) <API key>(n) #define <API key>(n) <API key>(n) #define <API key>(n) <API key>(n) #define <API key>(nskip) <API key>(nskip) #define <API key>(n2, nskip) <API key>(n2, nskip) //#endif // defined(__ODE__) #ifdef __cplusplus } #endif #endif
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <!-- template designed by Marco Von Ballmoos --> <title>Docs for page edit_clock.php</title> <link rel="stylesheet" href="../media/stylesheet.css" /> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/> </head> <body> <div class="page-body"> <h2 class="file-name">/examples/edit_clock.php</h2> <a name="sec-description"></a> <div class="info-box"> <div class="info-box-title">Description</div> <div class="nav-bar"> <span class="disabled">Description</span> | <a href="#sec-includes">Includes</a> </div> <div class="info-box-body"> </div> </div> <a name="sec-includes"></a> <div class="info-box"> <div class="info-box-title">Includes</div> <div class="nav-bar"> <a href="#sec-description">Description</a> | <span class="disabled">Includes</span> </div> <div class="info-box-body"> <a name="_/home/automation/Desktop/netconf-php-master/netconf/Device_php"></a> <div class="oddrow"> <div> <span class="include-title"> <span class="include-type">include</span> (<span class="include-name">'/home/automation/Desktop/netconf-php-master/netconf/Device.php'</span>) (line <span class="line-number">2</span>) </span> </div> </div> </div> </div> <p class="notes" id="credit"> Documentation generated on Thu, 27 Feb 2014 13:55:59 +0000 by <a href="http: </p> </div></body> </html>
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import os import logging import traceback import mallet_lda class MalletTagTopics(mallet_lda.MalletLDA): """ Topic modeling with separation based on tags """ def _basic_params(self): self.name = 'mallet_lda_tags' self.categorical = False self.template_name = 'mallet_lda' self.dry_run = False self.topics = 50 self.dfr = len(self.extra_args) > 0 if self.dfr: self.dfr_dir = self.extra_args[0] def post_setup(self): if self.named_args is not None: if 'tags' in self.named_args: self.tags = self.named_args['tags'] for filename in self.metadata.keys(): my_tags = [x for (x, y) in self.tags.iteritems() if int(self.metadata[filename]['itemID' ]) in y] if len(my_tags) > 0: self.metadata[filename]['label'] = my_tags[0] else: del self.metadata[filename] self.files.remove(filename) if __name__ == '__main__': try: processor = MalletTagTopics(track_progress=False) processor.process() except: logging.error(traceback.format_exc())
cask 'kanmusmemory' do version '0.15' sha256 '<SHA256-like>' url "http://relog.xii.jp/download/kancolle/KanmusuMemory-#{version}-mac.dmg" appcast 'https://github.com/ioriayane/KanmusuMemory/releases.atom', :checkpoint => '<SHA256-like>' name 'KanmusuMemory' homepage 'http://relog.xii.jp/mt5r/2013/08/post-349.html' license :apache app 'KanmusuMemory.app' end
class Zmap < Formula desc "Network scanner for Internet-wide network studies" homepage "https://zmap.io" url "https://github.com/zmap/zmap/archive/v2.1.1.tar.gz" sha256 "<SHA256-like>" revision 1 head "https://github.com/zmap/zmap.git" bottle do rebuild 1 sha256 "<SHA256-like>" => :mojave sha256 "<SHA256-like>" => :high_sierra sha256 "<SHA256-like>" => :sierra end depends_on "byacc" => :build depends_on "cmake" => :build depends_on "gengetopt" => :build depends_on "pkg-config" => :build depends_on "gmp" depends_on "json-c" depends_on "libdnet" def install inreplace ["conf/zmap.conf", "src/zmap.c", "src/zopt.ggo.in"], "/etc", etc system "cmake", ".", *std_cmake_args, "-DENABLE_DEVELOPMENT=OFF", "-<API key>=ON" system "make" system "make", "install" end test do system "#{sbin}/zmap", "--version" end end
import sys import os import subprocess import string printable = set(string.printable) def sanitize(txt): txt = ''.join(filter(lambda c: c in printable, txt)) return txt def traverse(t, outfile): print>>outfile, sanitize(t.code+'\t'+t.description) for c in t.children: traverse(c, outfile) def getEdges(t, outfile): for c in t.children: print >>outfile, sanitize(t.code+'\t'+c.code) getEdges(c, outfile) print 'cloning github repository sirrice/icd9.git' subprocess.call('git clone https://github.com/sirrice/icd9.git', shell=1) sys.path.append('icd9') from icd9 import ICD9 tree = ICD9('icd9/codes.json') toplevelnodes = tree.children print 'creating name file' outfile = file('code.names', 'w') traverse(tree, outfile) outfile.close() print 'creating edges file' outfile = file('code.edges', 'w') getEdges(tree, outfile) outfile.close() print 'cleaning up' #os.chdir('..') #subprocess.call('rm -rf icd9', shell=1)
<?php class GuildWarsMenu extends btThemeMenu { public function __construct($sqlConnection) { parent::__construct("guildwars", $sqlConnection); } public function displayLink() { if($this->intMenuSection == 3) { $menuLinkInfo = $this->menuItemObj->objLink->get_info(); $checkURL = parse_url($menuLinkInfo['link']); if(!isset($checkURL['scheme']) || $checkURL['scheme'] = "") { $menuLinkInfo['link'] = MAIN_ROOT.$menuLinkInfo['link']; } echo "<div style='display: inline-block; vertical-align: middle; height: 50px; padding-right: 20px'><a href='".$menuLinkInfo['link']."' target='".$menuLinkInfo['linktarget']."'>".$menuItemInfo['name']."</a></div>"; } else { parent::displayLink(); } } public function displayMenuCategory($loc="top") { $menuCatInfo = $this->menuCatObj->get_info(); if($loc == "top") { echo $this->getHeaderCode($menuCatInfo); } else { echo "<br>"; } } public function displayLoggedOut() { echo " <form action='".MAIN_ROOT."login.php' method='post' style='padding: 0px; margin: 0px'> <div class='usernameIMG'></div> <div class='usernameTextDiv'> <input name='user' type='text' class='loginTextbox'> </div> <div class='passwordIMG'></div> <div class='passwordTextDiv'> <input name='pass' type='password' class='loginTextbox'> </div> <div class='rememberMeCheckBox' id='fakeRememberMe'></div> <div class='rememberMeIMG'></div> <div id='fakeSubmit' class='loginButton'></div> <input type='checkbox' name='rememberme' value='1' id='realRememberMe' style='display: none'> <input type='submit' name='submit' id='realSubmit' style='display: none' value='Log In'> </form> "; } public function displayLoggedIn() { echo " <div class='loggedInIMG'></div> <div class='loggedInProfilePic'>".$this->memberObj->getProfilePic("45px", "60px")."</div> <div class='<API key>'></div> <div class='<API key>'> ".$this->memberObj->getMemberLink(array("color" => "false"))." </div> <div class='loggedInRankIMG'></div> <div class='loggedInRankText'> ".$this->data['memberRank']." </div> <div class='<API key>'> <div class='<API key>'></div> <div class='<API key>'> <a href='".MAIN_ROOT."members'>My Account</a> - ".$this->data['pmLink']." - <a href='".MAIN_ROOT."members/signout.php'>Sign Out</a><br> </div> </div> "; } } ?>
cask :v1 => 'chunkulus' do version :latest sha256 :no_check url 'http://presstube.com/screensavers/<API key>.zip' homepage 'http://presstube.com/blog/2011/chunkulus/' license :unknown screen_saver 'presstube-chunkulus.app/Contents/Resources/Presstube - Chunkulus.saver' postflight do system '/usr/libexec/PlistBuddy', '-c', 'Set :CFBundleName Chunkulus (Presstube)', "#{staged_path}/presstube-chunkulus.app/Contents/Resources/Presstube - Chunkulus.saver/Contents/Info.plist" end caveats <<-EOS.undent #{token} requires Adobe Air, available via brew cask install adobe-air EOS end
// I would prefer this to be delete.lua and load it using NSBundle // But I failed. I don't know why. static const char * deletelua = "" "-- This script receives three parameters, all encoded with\n" "-- MessagePack. The decoded values are used for deleting a model\n" "-- instance in Redis and removing any reference to it in sets\n" "-- (indices) and hashes (unique indices).\n" " "-- # model\n" " "-- Table with three attributes:\n" "-- id (model instance id)\n" "-- key (hash where the attributes will be saved)\n" "-- name (model name)\n" " "-- # uniques\n" " "-- Fields and values to be removed from the unique indices.\n" " "-- # tracked\n" " "-- Keys that share the lifecycle of this model instance, that\n" "-- should be removed as this object is deleted.\n" " "local model = cmsgpack.unpack(ARGV[1])\n" "local uniques = cmsgpack.unpack(ARGV[2])\n" "local tracked = cmsgpack.unpack(ARGV[3])\n" "\n" "local function remove_indices(model)\n" " local memo = model.key .. \":_indices\"\n" " local existing = redis.call(\"SMEMBERS\", memo)\n" "\n" " for _, key in ipairs(existing) do\n" " redis.call(\"SREM\", key, model.id)\n" " redis.call(\"SREM\", memo, key)\n" " end\n" "end\n" "\n" "local function remove_uniques(model, uniques)\n" " local memo = model.key .. \":_uniques\"\n" "\n" " for field, _ in pairs(uniques) do\n" " local key = model.name .. \":uniques:\" .. field\n" "\n" " local field = redis.call(\"HGET\", memo, key)\n" " if field then\n" " redis.call(\"HDEL\", key, field)\n" " end\n" " redis.call(\"HDEL\", memo, key)\n" " end\n" "end\n" "\n" "local function remove_tracked(model, tracked)\n" " for _, tracked_key in ipairs(tracked) do\n" " local key = model.key .. \":\" .. tracked_key\n" "\n" " redis.call(\"DEL\", key)\n" " end\n" "end\n" "\n" "local function delete(model)\n" " local keys = {\n" " model.key .. \":counters\",\n" " model.key .. \":_indices\",\n" " model.key .. \":_uniques\",\n" " model.key\n" " }\n" "\n" " redis.call(\"SREM\", model.name .. \":all\", model.id)\n" " redis.call(\"DEL\", unpack(keys))\n" "end\n" "\n" "remove_indices(model)\n" "remove_uniques(model, uniques)\n" "remove_tracked(model, tracked)\n" "delete(model)\n" "\n" "return model.id\n";
using System; using System.Collections.Generic; using System.IO; using XenAdmin.Network; using XenAdmin.Core; using XenAPI; using XenAdmin.Actions; using XenAdmin; using System.Linq; using System.Globalization; using System.Xml; namespace <API key> { public class <API key> { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly List<string> reportExcluded = new List<string> { "blobs", "vncterm", "xapi-debug" }; private static readonly Dictionary<string, int> reportWithVerbosity = new Dictionary<string, int> { {"host-crashdump-logs", 2}, {"system-logs", 2}, {"tapdisk-logs", 2}, {"xapi", 2}, {"xcp-rrdd-plugins", 2}, {"xenserver-install", 2}, {"xenserver-logs", 2} }; public readonly string outputFile; public <API key>() { string name = string.Format("{0}{1}.zip", Messages.BUGTOOL_FILE_PREFIX, DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss", CultureInfo.InvariantCulture)); string folder = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); if (Directory.Exists(folder)) Directory.Delete(folder); Directory.CreateDirectory(folder); if (!name.EndsWith(".zip")) name = string.Concat(name, ".zip"); outputFile = string.Format(@"{0}\{1}", folder, name); } public void RunBugtool(IXenConnection connection, Session session) { if (connection == null || session == null) return; // Fetch the common capabilities of all hosts. Dictionary<Host, List<string>> hostCapabilities = new Dictionary<Host, List<string>>(); foreach (Host host in connection.Cache.Hosts) { <API key> action = new <API key>(host); action.RunExternal(session); if (!action.Succeeded) return; List<string> keys = new List<string>(); XmlDocument doc = new XmlDocument(); doc.LoadXml(action.Result); foreach (XmlNode node in doc.<API key>("capability")) { foreach (XmlAttribute a in node.Attributes) { if (a.Name == "key") keys.Add(a.Value); } } hostCapabilities[host] = keys; } List<string> combination = null; foreach (List<string> capabilities in hostCapabilities.Values) { if (capabilities == null) continue; if (combination == null) { combination = capabilities; continue; } combination = Helpers.ListsCommonItems<string>(combination, capabilities); } if (combination == null || combination.Count <= 0) return; // The list of the reports which are required in Health Check Report. List<string> reportIncluded = combination.Except(reportExcluded).ToList(); // Verbosity works for xen-bugtool since Dundee. if (Helpers.DundeeOrGreater(connection)) { List<string> verbReport = new List<string>(reportWithVerbosity.Keys); int idx = -1; for (int x = 0; x < verbReport.Count; x++) { idx = reportIncluded.IndexOf(verbReport[x]); if (idx >= 0) { reportIncluded[idx] = reportIncluded[idx] + ":" + reportWithVerbosity[verbReport[x]].ToString(); } } } // Ensure downloaded filenames are unique even for hosts with the same hostname: append a counter to the timestring string filepath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); if (Directory.Exists(filepath)) Directory.Delete(filepath); Directory.CreateDirectory(filepath); string timestring = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"); // Collect all master/slave information to output as a separate text file with the report List<string> mastersInfo = new List<string>(); int i = 0; Pool p = Helpers.GetPool(connection); foreach (Host host in connection.Cache.Hosts) { // master/slave information if (p == null) { mastersInfo.Add(string.Format("Server '{0}' is a stand alone server", host.Name())); } else { mastersInfo.Add(string.Format("Server '{0}' is a {1} of pool '{2}'", host.Name(), p.master.opaque_ref == host.opaque_ref ? "master" : "slave", p.Name())); } HostWithStatus hostWithStatus = new HostWithStatus(host, 0); <API key> statAction = new <API key>(hostWithStatus, reportIncluded, filepath, timestring + "-" + ++i); statAction.RunExternal(session); } // output the slave/master info string mastersDestination = string.Format("{0}\\{1}-Masters.txt", filepath, timestring); <API key>(mastersInfo, mastersDestination); // output the XenCenter metadata var metadata = <API key>.Provider.<API key>(false); string metadataDestination = string.Format("{0}\\{1}-Metadata.json", filepath, timestring); <API key>(new List<string> {metadata}, metadataDestination); // Finish the collection of logs with bugtool. // Start to zip the files. <API key> zipAction = new <API key>(filepath, outputFile); zipAction.RunExternal(session); log.InfoFormat("Server Status Report is collected: {0}", outputFile); } private void <API key>(List<string> info, string fileName) { if (File.Exists(fileName)) File.Delete(fileName); StreamWriter sw = null; try { sw = new StreamWriter(fileName); foreach (string s in info) sw.WriteLine(s); sw.Flush(); } catch (Exception e) { log.ErrorFormat("Exception while writing {0} file: {1}", fileName, e); } finally { if (sw != null) sw.Close(); } } } }
class PureFtpd < Formula desc "Secure and efficient FTP server" homepage "https: url "https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.49.tar.gz" sha256 "<SHA256-like>" revision 1 bottle do cellar :any sha256 "<SHA256-like>" => :catalina sha256 "<SHA256-like>" => :mojave sha256 "<SHA256-like>" => :high_sierra sha256 "<SHA256-like>" => :sierra end depends_on "libsodium" depends_on "openssl@1.1" def install args = %W[ --<API key> --prefix=#{prefix} --mandir=#{man} --sysconfdir=#{etc} --with-everything --with-pam --with-tls --with-bonjour ] system "./configure", *args system "make", "install" end plist_options manual: "pure-ftpd" def plist <<~EOS <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "- <plist version="1.0"> <dict> <key>KeepAlive</key> <true/> <key>Label</key> <string>#{plist_name}</string> <key>ProgramArguments</key> <array> <string>#{opt_sbin}/pure-ftpd</string> <string>--chrooteveryone</string> <string>--createhomedir</string> <string>--allowdotfiles</string> <string>--login=puredb:#{etc}/pureftpd.pdb</string> </array> <key>RunAtLoad</key> <true/> <key>WorkingDirectory</key> <string>#{var}</string> <key>StandardErrorPath</key> <string>#{var}/log/pure-ftpd.log</string> <key>StandardOutPath</key> <string>#{var}/log/pure-ftpd.log</string> </dict> </plist> EOS end test do system bin/"pure-pw", "--help" end end
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>DbSync: <API key> Interface Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body onload='searchBox.OnSelectItem(0);'> <!-- Generated by Doxygen 1.7.4 --> <script type="text/javascript"><! var searchBox = new SearchBox("searchBox", "search",false,'Search'); --></script> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">DbSync</div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li id="searchli"> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> </div> <div class="headertitle"> <div class="title"><API key> Interface Reference</div> </div> </div> <div class="contents"> <!-- doxytag: class="<API key>" --><div class="dynheader"> Inheritance diagram for <API key>:</div> <div class="dyncontent"> <div class="center"> <img src="<API key>.png" usemap="#<API key>" alt=""/> <map id="<API key>" name="<API key>"> <area href="<API key>.html" alt="<API key>" shape="rect" coords="0,56,227,80"/> </map> </div></div> <p><a href="<API key>.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">__construct</a> (array $config)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">parseSchema</a> ($tableName)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">createAlter</a> ($config, $tableName)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">parseTrigger</a> ($triggerName)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">createTriggerSql</a> ($config)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">execute</a> ($sql)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">getTriggerList</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">getTableByTrigger</a> ($triggerName)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">getTableList</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">hasTable</a> ($tableName)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">hasTrigger</a> ($triggerName)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">fetchData</a> ($tableName)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">insert</a> ($data, $tableName)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">merge</a> ($data, $tableName)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">truncate</a> ($tableName)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">dropTable</a> ($tableName)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">dropTrigger</a> ($triggerName)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">isEmpty</a> ($tableName)</td></tr> </table> <hr/><h2>Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::__construct" ref="<API key>" args="(array $config)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::__construct </td> <td>(</td> <td class="paramtype">array $&#160;</td> <td class="paramname"><em>config</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Constructor</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramtype">array</td><td class="paramname">$config</td><td></td></tr> </table> </dd> </dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::createAlter" ref="<API key>" args="($config, $tableName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::createAlter </td> <td>(</td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>config</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>tableName</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Generate Alter Table</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramtype">array</td><td class="paramname">$config</td><td></td></tr> <tr><td class="paramtype">string</td><td class="paramname">$tableName</td><td></td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>string </dd></dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::createTriggerSql" ref="<API key>" args="($config)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::createTriggerSql </td> <td>(</td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>config</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Generate trigger sql</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramtype">array</td><td class="paramname">$config</td><td></td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>string </dd></dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::dropTable" ref="<API key>" args="($tableName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::dropTable </td> <td>(</td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>tableName</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Drop table</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramtype">string</td><td class="paramname">$tableName</td><td></td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>number </dd></dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::dropTrigger" ref="<API key>" args="($triggerName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::dropTrigger </td> <td>(</td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>triggerName</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Drop trigger</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramtype">string</td><td class="paramname">$triggerName</td><td></td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>number </dd></dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::execute" ref="<API key>" args="($sql)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::execute </td> <td>(</td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>sql</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Execute sql query</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramtype">string</td><td class="paramname">$sql</td><td></td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>integer </dd></dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::fetchData" ref="<API key>" args="($tableName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::fetchData </td> <td>(</td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>tableName</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Fetch all data from table</p> <dl class="return"><dt><b>Returns:</b></dt><dd>array </dd></dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::getTableByTrigger" ref="<API key>" args="($triggerName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::getTableByTrigger </td> <td>(</td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>triggerName</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Get table name by trigger name</p> <dl class="return"><dt><b>Returns:</b></dt><dd>string </dd></dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::getTableList" ref="<API key>" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::getTableList </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Get tables list</p> <dl class="return"><dt><b>Returns:</b></dt><dd>array </dd></dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::getTriggerList" ref="<API key>" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::getTriggerList </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Get triggers list</p> <dl class="return"><dt><b>Returns:</b></dt><dd>array </dd></dl> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::hasTable" ref="<API key>" args="($tableName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::hasTable </td> <td>(</td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>tableName</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Is db table exists</p> <dl class="return"><dt><b>Returns:</b></dt><dd>boolen </dd></dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::hasTrigger" ref="<API key>" args="($triggerName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::hasTrigger </td> <td>(</td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>triggerName</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Is db trigger exists</p> <dl class="return"><dt><b>Returns:</b></dt><dd>boolen </dd></dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::insert" ref="<API key>" args="($data, $tableName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::insert </td> <td>(</td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>data</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>tableName</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Push data to db table</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramtype">boolen</td><td class="paramname">$force</td><td></td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>boolen </dd></dl> <dl><dt><b>Exceptions:</b></dt><dd> <table class="exception"> <tr><td class="paramname">Exception</td><td></td></tr> </table> </dd> </dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::isEmpty" ref="<API key>" args="($tableName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::isEmpty </td> <td>(</td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>tableName</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Is db table empty</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramtype">string</td><td class="paramname">$tableName</td><td></td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>boolean </dd></dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::merge" ref="<API key>" args="($data, $tableName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::merge </td> <td>(</td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>data</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>tableName</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Merge data to db table</p> <dl><dt><b>Exceptions:</b></dt><dd> <table class="exception"> <tr><td class="paramname">Exception</td><td></td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>boolean </dd></dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::parseSchema" ref="<API key>" args="($tableName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::parseSchema </td> <td>(</td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>tableName</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Parse schema</p> <dl class="return"><dt><b>Returns:</b></dt><dd>array </dd></dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::parseTrigger" ref="<API key>" args="($triggerName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::parseTrigger </td> <td>(</td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>triggerName</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Fetch db triggers</p> <dl class="return"><dt><b>Returns:</b></dt><dd>string </dd></dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <a class="anchor" id="<API key>"></a><!-- doxytag: member="<API key>::truncate" ref="<API key>" args="($tableName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><API key>::truncate </td> <td>(</td> <td class="paramtype">$&#160;</td> <td class="paramname"><em>tableName</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Truncate table</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramtype">string</td><td class="paramname">$tableName</td><td></td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>number </dd></dl> <p>Implemented in <a class="el" href="<API key>.html#<API key>"><API key></a>.</p> </div> </div> <hr/>The documentation for this interface was generated from the following file:<ul> <li>DbSync/DbAdapter/AdapterInterface.php</li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a></div> <!-- iframe showing the search results (closed by default) --> <div id="<API key>"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr class="footer"/><address class="footer"><small>Generated on Thu Nov 3 2011 03:55:10 for DbSync by&#160; <a href="http: <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address> </body> </html>
<?php $service_doc['departamentos|departments'] = array( 'en' => array ( 'pattern' => '/ubigeo/departments', 'description' => 'Lists the ubigeo codes for all departments', ), 'es' => array( 'patron' => '/ubigeo/departamentos', 'descripción' => 'Lista los códigos de ubigeo de todos los departamentos', ) ); $fdepas = function () use ($app, $db) { $res = get_from_cache('departamentos'); if ($res === false) { $stmt = $db->query("select * from ubigeo where nombreCompleto like '% $res = $stmt->fetchAll(); save_to_cache('departamentos', $res); } echo json_encode(array( $app->request()->getResourceUri() => $res )); }; $app->get('/ubigeo/departamentos', $fdepas)->name('departamentos'); $app->get('/ubigeo/departments', $fdepas)->name('departments');
#!/usr/bin/env python """Bootstrap setuptools installation To use setuptools in your package's setup.py, include this file in the same directory and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() To require a specific version of setuptools, set a download mirror, or use an alternate download directory, simply supply the appropriate options to ``use_setuptools()``. This file can also be run as a script to install or upgrade setuptools. """ import os import shutil import sys import tempfile import zipfile import optparse import subprocess import platform import textwrap import contextlib from distutils import log try: # noinspection PyCompatibility from urllib.request import urlopen except ImportError: # noinspection PyCompatibility from urllib2 import urlopen try: from site import USER_SITE except ImportError: USER_SITE = None DEFAULT_VERSION = "7.0" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): """ Return True if the command succeeded. """ args = (sys.executable,) + args return subprocess.call(args) == 0 def _install(archive_filename, install_args=()): with archive_context(archive_filename): # installing log.warn('Installing Setuptools') if not _python_cmd('setup.py', 'install', *install_args): log.warn('Something went wrong during the installation.') log.warn('See the error message above.') # exitcode will be 2 return 2 def _build_egg(egg, archive_filename, to_dir): with archive_context(archive_filename): # building an egg log.warn('Building a Setuptools egg in %s', to_dir) _python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir) # returning the result log.warn(egg) if not os.path.exists(egg): raise IOError('Could not build the egg.') class ContextualZipFile(zipfile.ZipFile): """ Supplement ZipFile class to support context manager for Python 2.6 """ def __enter__(self): return self def __exit__(self, type, value, traceback): self.close() def __new__(cls, *args, **kwargs): """ Construct a ZipFile or ContextualZipFile as appropriate """ if hasattr(zipfile.ZipFile, '__exit__'): return zipfile.ZipFile(*args, **kwargs) return super(ContextualZipFile, cls).__new__(cls) @contextlib.contextmanager def archive_context(filename): # extracting the archive tmpdir = tempfile.mkdtemp() log.warn('Extracting in %s', tmpdir) old_wd = os.getcwd() try: os.chdir(tmpdir) with ContextualZipFile(filename) as archive: archive.extractall() # going in the directory subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0]) os.chdir(subdir) log.warn('Now working in %s', subdir) yield finally: os.chdir(old_wd) shutil.rmtree(tmpdir) def _do_download(version, download_base, to_dir, download_delay): egg = os.path.join(to_dir, 'setuptools-%s-py%d.%d.egg' % (version, sys.version_info[0], sys.version_info[1])) if not os.path.exists(egg): archive = download_setuptools(version, download_base, to_dir, download_delay) _build_egg(egg, archive, to_dir) sys.path.insert(0, egg) # Remove previously-imported pkg_resources if present (see if 'pkg_resources' in sys.modules: del sys.modules['pkg_resources'] import setuptools setuptools.<API key> = egg def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, download_delay=15): to_dir = os.path.abspath(to_dir) rep_modules = 'pkg_resources', 'setuptools' imported = set(sys.modules).intersection(rep_modules) try: import pkg_resources except ImportError: return _do_download(version, download_base, to_dir, download_delay) try: pkg_resources.require("setuptools>=" + version) return except pkg_resources.<API key>: return _do_download(version, download_base, to_dir, download_delay) except pkg_resources.VersionConflict as VC_err: if imported: msg = textwrap.dedent(""" The required version of setuptools (>={version}) is not available, and can't be installed while this script is running. Please install a more recent version first, using 'easy_install -U setuptools'. (Currently using {VC_err.args[0]!r}) """).format(VC_err=VC_err, version=version) sys.stderr.write(msg) sys.exit(2) # otherwise, reload ok del pkg_resources, sys.modules['pkg_resources'] return _do_download(version, download_base, to_dir, download_delay) def _clean_check(cmd, target): """ Run the command to download target. If the command fails, clean up before re-raising the error. """ try: subprocess.check_call(cmd) except subprocess.CalledProcessError: if os.access(target, os.F_OK): os.unlink(target) raise def <API key>(url, target): """ Download the file at url to target using Powershell (which will validate trust). Raise an exception if the command cannot complete. """ target = os.path.abspath(target) ps_cmd = ( "[System.Net.WebRequest]::DefaultWebProxy.Credentials = " "[System.Net.CredentialCache]::DefaultCredentials; " "(new-object System.Net.WebClient).DownloadFile(%(url)r, %(target)r)" % vars() ) cmd = [ 'powershell', '-Command', ps_cmd, ] _clean_check(cmd, target) def has_powershell(): if platform.system() != 'Windows': return False cmd = ['powershell', '-Command', 'echo test'] with open(os.path.devnull, 'wb') as devnull: try: subprocess.check_call(cmd, stdout=devnull, stderr=devnull) except Exception: return False return True <API key>.viable = has_powershell def download_file_curl(url, target): cmd = ['curl', url, '--silent', '--output', target] _clean_check(cmd, target) def has_curl(): cmd = ['curl', '--version'] with open(os.path.devnull, 'wb') as devnull: try: subprocess.check_call(cmd, stdout=devnull, stderr=devnull) except Exception: return False return True download_file_curl.viable = has_curl def download_file_wget(url, target): cmd = ['wget', url, '--quiet', '--output-document', target] _clean_check(cmd, target) def has_wget(): cmd = ['wget', '--version'] with open(os.path.devnull, 'wb') as devnull: try: subprocess.check_call(cmd, stdout=devnull, stderr=devnull) except Exception: return False return True download_file_wget.viable = has_wget def <API key>(url, target): """ Use Python to download the file, even though it cannot authenticate the connection. """ src = urlopen(url) try: # Read all the data in one block. data = src.read() finally: src.close() # Write all the data in one block to avoid creating a partial file. with open(target, "wb") as dst: dst.write(data) <API key>.viable = lambda: True def get_best_downloader(): downloaders = ( <API key>, download_file_curl, download_file_wget, <API key>, ) viable_downloaders = (dl for dl in downloaders if dl.viable()) return next(viable_downloaders, None) def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, delay=15, downloader_factory=get_best_downloader): """ Download setuptools from a specified location and return its filename `version` should be a valid setuptools version number that is available as an sdist for download under the `download_base` URL (which should end with a '/'). `to_dir` is the directory where the egg will be downloaded. `delay` is the number of seconds to pause before an actual download attempt. ``downloader_factory`` should be a function taking no arguments and returning a function for downloading a URL to a target. """ # making sure we use the absolute path to_dir = os.path.abspath(to_dir) zip_name = "setuptools-%s.zip" % version url = download_base + zip_name saveto = os.path.join(to_dir, zip_name) if not os.path.exists(saveto): # Avoid repeated downloads log.warn("Downloading %s", url) downloader = downloader_factory() downloader(url, saveto) return os.path.realpath(saveto) def _build_install_args(options): """ Build the arguments to 'python setup.py install' on the setuptools package """ return ['--user'] if options.user_install else [] def _parse_args(): """ Parse the command line for options """ parser = optparse.OptionParser() parser.add_option( '--user', dest='user_install', action='store_true', default=False, help='install in user site package (requires Python 2.6 or later)') parser.add_option( '--download-base', dest='download_base', metavar="URL", default=DEFAULT_URL, help='alternative URL from where to download the setuptools package') parser.add_option( '--insecure', dest='downloader_factory', action='store_const', const=lambda: <API key>, default=get_best_downloader, help='Use internal, non-validating downloader' ) parser.add_option( '--version', help="Specify which version to download", default=DEFAULT_VERSION, ) options, args = parser.parse_args() # positional arguments are ignored return options def main(): """Install or upgrade setuptools and EasyInstall""" options = _parse_args() archive = download_setuptools( version=options.version, download_base=options.download_base, downloader_factory=options.downloader_factory, ) return _install(archive, _build_install_args(options)) if __name__ == '__main__': sys.exit(main())
import sys import unittest from streamlink.plugin.api.utils import itertags def <API key>(): v = sys.version_info if (v.major == 3) and ( # 3.7.0 - 3.7.2 (v.minor == 7 and v.micro <= 2) # 3.8.0a1 or (v.minor == 8 and v.micro == 0 and v.releaselevel == 'alpha' and v.serial <= 1) ): return True else: return False class TestPluginUtil(unittest.TestCase): def <API key>(self): title = list(itertags(self.test_html, "title")) self.assertTrue(len(title), 1) self.assertEqual(title[0].tag, "title") self.assertEqual(title[0].text, "Title") self.assertEqual(title[0].attributes, {}) def <API key>(self): script = list(itertags(self.test_html, "script")) self.assertTrue(len(script), 2) self.assertEqual(script[0].tag, "script") self.assertEqual(script[0].text, "") self.assertEqual(script[0].attributes, {"src": "https://test.se/test.js"}) self.assertEqual(script[1].tag, "script") self.assertEqual(script[1].text.strip(), """Tester.ready(function () {\nalert("Hello, world!"); });""") self.assertEqual(script[1].attributes, {}) @unittest.skipIf(<API key>(), "python3.7 issue, see bpo-34294") def <API key>(self): metas = list(itertags(self.test_html, "meta")) self.assertTrue(len(metas), 3) self.assertTrue(all(meta.tag == "meta" for meta in metas)) self.assertEqual(metas[0].text, None) self.assertEqual(metas[1].text, None) self.assertEqual(metas[2].text, None) self.assertEqual(metas[0].attributes, {"property": "og:type", "content": "website"}) self.assertEqual(metas[1].attributes, {"property": "og:url", "content": "http://test.se/"}) self.assertEqual(metas[2].attributes, {"property": "og:site_name", "content": "Test"}) def test_multi_line_a(self): anchor = list(itertags(self.test_html, "a")) self.assertTrue(len(anchor), 1) self.assertEqual(anchor[0].tag, "a") self.assertEqual(anchor[0].text, "bar") self.assertEqual(anchor[0].attributes, {"href": "http://test.se/foo"}) @unittest.skipIf(<API key>(), "python3.7 issue, see bpo-34294") def test_no_end_tag(self): links = list(itertags(self.test_html, "link")) self.assertTrue(len(links), 1) self.assertEqual(links[0].tag, "link") self.assertEqual(links[0].text, None) self.assertEqual(links[0].attributes, {"rel": "stylesheet", "type": "text/css", "href": "https://test.se/test.css"}) def test_tag_inner_tag(self): links = list(itertags(self.test_html, "p")) self.assertTrue(len(links), 1) self.assertEqual(links[0].tag, "p") self.assertEqual(links[0].text.strip(), '<a \nhref="http://test.se/foo">bar</a>') self.assertEqual(links[0].attributes, {})
import { inject, injectable } from 'inversify'; import { ServiceIdentifiers } from '../../../container/ServiceIdentifiers'; import * as ESTree from 'estree'; import { TNodeWithStatements } from '../../../types/node/TNodeWithStatements'; import { <API key> } from '../../../types/container/custom-nodes/<API key>'; import { <API key> } from '../../../interfaces/node-transformers/<API key>/<API key>/<API key>'; import { TStatement } from '../../../types/node/TStatement'; import { ICustomNode } from '../../../interfaces/custom-nodes/ICustomNode'; import { TInitialData } from '../../../types/TInitialData'; import { <API key> } from '../../../interfaces/node-transformers/<API key>/<API key>/<API key>'; import { <API key> } from '../../../enums/custom-nodes/<API key>'; import { <API key> } from '../../../custom-nodes/<API key>/<API key>'; import { NodeAppender } from '../../../node/NodeAppender'; import { NodeGuards } from '../../../node/NodeGuards'; import { NodeStatementUtils } from '../../../node/NodeStatementUtils'; import { NodeUtils } from '../../../node/NodeUtils'; import { <API key> } from '../../../types/node/<API key>'; import { <API key> } from '../../../node/<API key>'; @injectable() export class <API key> implements <API key> { /** * @type {<API key>} */ private readonly <API key>: <API key>; /** * @param {<API key>} <API key> */ public constructor ( @inject(ServiceIdentifiers.<API key>) <API key>: <API key>, ) { this.<API key> = <API key>; } /** * extracts object expression: * var object = { * foo: 1, * bar: 2 * }; * * to: * var _0xabc123 = { * foo: 1, * bar: 2 * }; * var object = _0xabc123; * * @param {ObjectExpression} <API key> * @param {Statement} hostStatement * @returns {<API key>} */ public extract ( <API key>: ESTree.ObjectExpression, hostStatement: ESTree.Statement ): <API key> { return this.<API key>( <API key>, hostStatement ); } /** * @param {ObjectExpression} <API key> * @param {Statement} hostStatement * @returns {Node} */ private <API key> ( <API key>: ESTree.ObjectExpression, hostStatement: ESTree.Statement ): <API key> { const <API key>: TNodeWithStatements = NodeStatementUtils.getScopeOfNode(hostStatement); const lexicalScopeNode: <API key> | null = NodeGuards.<API key>(<API key>) ? <API key> : <API key>.getLexicalScope(<API key>) ?? null; if (!lexicalScopeNode) { throw new Error('Cannot find lexical scope node for the host statement node'); } const properties: (ESTree.Property | ESTree.SpreadElement)[] = <API key>.properties; const <API key>: ESTree.VariableDeclaration = this.<API key>( lexicalScopeNode, properties ); const statementsToInsert: TStatement[] = [<API key>]; NodeAppender.insertBefore(<API key>, statementsToInsert, hostStatement); NodeUtils.parentizeAst(<API key>); NodeUtils.parentizeNode(<API key>, <API key>); const <API key>: ESTree.Identifier = this.<API key>(<API key>); const <API key>: ESTree.ObjectExpression = this.<API key>(<API key>); return { nodeToReplace: <API key>, <API key>: <API key>, <API key>: <API key> }; } /** * @param {<API key>} lexicalScopeNode * @param {(Property | SpreadElement)[]} properties * @returns {VariableDeclaration} */ private <API key> ( lexicalScopeNode: <API key>, properties: (ESTree.Property | ESTree.SpreadElement)[] ): ESTree.VariableDeclaration { const <API key>: ICustomNode<TInitialData<<API key>>> = this.<API key>( <API key>.<API key> ); <API key>.initialize(lexicalScopeNode, properties); const statementNode: TStatement = <API key>.getNode()[0]; if ( !statementNode || !NodeGuards.<API key>(statementNode) ) { throw new Error('`<API key>.getNode()[0]` should returns array with `VariableDeclaration` node'); } return statementNode; } /** * @param {VariableDeclaration} <API key> * @returns {Identifier} */ private <API key> (<API key>: ESTree.VariableDeclaration): ESTree.Identifier { const <API key>: ESTree.Pattern = <API key>.declarations[0].id; if (!NodeGuards.isIdentifierNode(<API key>)) { throw new Error('`<API key>` should contain `VariableDeclarator` node with `Identifier` id property'); } return <API key>; } /** * @param {VariableDeclaration} <API key> * @returns {Identifier} */ private <API key> (<API key>: ESTree.VariableDeclaration): ESTree.ObjectExpression { const <API key>: ESTree.Expression | null = <API key>.declarations[0].init ?? null; if (!<API key> || !NodeGuards.<API key>(<API key>)) { throw new Error('`<API key>` should contain `VariableDeclarator` node with `ObjectExpression` init property'); } return <API key>; } }
# $FreeBSD: soc2013/dpl/head/usr.sbin/nfsdumpstate/Makefile 192854 2009-05-26 15:19:04Z rmacklem $ PROG= nfsdumpstate MAN= nfsdumpstate.8 .include <bsd.prog.mk>
function(modal) { function ajaxifyLinks (context) { $('a.address-choice', context).click(function() { modal.loadUrl(this.href); return false; }); $('.pagination a', context).click(function() { var page = this.getAttribute("data-page"); setPage(page); return false; }); }; var searchUrl = $('form.address-search', modal.body).attr('action') function search() { $.ajax({ url: searchUrl, data: {q: $('#id_q').val()}, success: function(data, status) { $('#search-results').html(data); ajaxifyLinks($('#search-results')); } }); return false; }; function setPage(page) { if($('#id_q').val().length){ dataObj = {q: $('#id_q').val(), p: page}; } else { dataObj = {p: page}; } $.ajax({ url: searchUrl, data: dataObj, success: function(data, status) { $('#search-results').html(data); ajaxifyLinks($('#search-results')); } }); return false; } ajaxifyLinks(modal.body); function submitForm() { var formdata = new FormData(this); $.ajax({ url: this.action, data: formdata, processData: false, contentType: false, type: 'POST', dataType: 'text', success: function(response){ modal.loadResponseText(response); } }); return false; } $('form.address-create', modal.body).submit(submitForm); $('form.address-edit', modal.body).submit(submitForm); $('form.address-search', modal.body).submit(search); $('#id_q').on('input', function() { clearTimeout($.data(this, 'timer')); var wait = setTimeout(search, 50); $(this).data('timer', wait); }); {% url '<API key>' as autocomplete_url %} $('#id_tags', modal.body).tagit({ autocomplete: {source: "{{ autocomplete_url|addslashes }}"} }); function detectErrors() { var errorSections = {}; // First count up all the errors $('form.address-create .error-message').each(function(){ var parentSection = $(this).closest('section'); if(!errorSections[parentSection.attr('id')]){ errorSections[parentSection.attr('id')] = 0; } errorSections[parentSection.attr('id')] = errorSections[parentSection.attr('id')]+1; }); // Now identify them on each tab for(var index in errorSections) { $('.tab-nav a[href=#'+ index +']').addClass('errors').attr('data-count', errorSections[index]); } } detectErrors(); }