text
stringlengths
2
99k
meta
dict
/*********************************************************************** * * * This software is part of the ast package * * Copyright (c) 1990-2011 AT&T Intellectual Property * * and is licensed under the * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * * * * A copy of the License is available at * * http://www.eclipse.org/org/documents/epl-v10.html * * (with md5 checksum b35adb5213ca9657e911e9befb180842) * * * * Information and Software Systems Research * * AT&T Research * * Florham Park NJ * * * * Glenn Fowler <gsf@research.att.com> * * * ***********************************************************************/ #pragma prototyped /* * Glenn Fowler * AT&T Research * * send an action to the coshell for execution */ #include "colib.h" #include <proc.h> #include <ls.h> static Cojob_t* service(register Coshell_t* co, Coservice_t* cs, Cojob_t* cj, int flags, Sfio_t* sp) { Proc_t* proc; size_t n; int i; int j; int fds[2]; long ops[4]; char* s; char** a; if (flags & CO_DEBUG) { for (a = cs->argv; *a; a++) sfprintf(sp, " %s", *a); if (!(s = costash(sp))) goto nospace; errormsg(state.lib, ERROR_LIBRARY|2, "service %s:%s", cs->path, s); } if (pipe(fds) < 0) { errormsg(state.lib, ERROR_LIBRARY|ERROR_SYSTEM|2, "%s: cannot allocate service pipe", cs->name); return 0; } if (co->flags & CO_SHELL) for (i = 0; i < elementsof(fds); i++) if (fds[i] < 10 && (j = fcntl(fds[i], F_DUPFD, 10)) >= 0) { close(fds[i]); fds[i] = j; } cs->fd = fds[1]; ops[0] = PROC_FD_DUP(fds[0], 0, PROC_FD_PARENT); ops[1] = PROC_FD_CLOSE(fds[1], PROC_FD_CHILD); ops[2] = PROC_FD_DUP(co->gsmfd, 1, 0); ops[3] = 0; if (!(proc = procopen(cs->path, cs->argv, NiL, ops, PROC_DAEMON|PROC_IGNORE))) { errormsg(state.lib, ERROR_LIBRARY|ERROR_SYSTEM|2, "%s: cannot connect to %s service", cs->path, cs->name); close(fds[0]); close(fds[1]); return 0; } fcntl(cs->fd, F_SETFD, FD_CLOEXEC); cs->pid = proc->pid; procfree(proc); sfprintf(sp, "id=%d info\n", cj->id); n = sfstrtell(sp); if (!(s = costash(sp))) goto bad; if (write(cs->fd, s, n) != n || sfpoll(&co->msgfp, 1, 5 * 1000) <= 0) goto bad; cj->pid = 0; cj->status = 0; cj->local = 0; cj->service = cs; co->svc_outstanding++; co->svc_running++; if (!cowait(co, cj, -1)) goto bad; return cj; bad: errormsg(state.lib, ERROR_LIBRARY|ERROR_SYSTEM|2, "%s: service not responding", cs->name); nospace: cj->pid = CO_PID_FREE; cs->pid = 0; close(cs->fd); cs->fd = -1; return 0; } static Cojob_t* request(register Coshell_t* co, Cojob_t* cj, Coservice_t* cs, const char* action, int flags) { ssize_t n; ssize_t i; Sfio_t* sp; if (!(sp = sfstropen())) { errormsg(state.lib, ERROR_LIBRARY|2, "out of space"); return 0; } if (!cs->fd && !service(co, cs, cj, flags, sp)) goto bad; if (!cs->pid) goto bad; if (flags & CO_DEBUG) errormsg(state.lib, ERROR_LIBRARY|2, "job %d commands:\n\n%s %s\n", cj->id, cs->name, action); if (!(flags & CO_SILENT)) sfprintf(sfstderr, "+ %s %s\n", cs->name, action); sfprintf(sp, "id=%d %s\n", cj->id, action); n = sfstrtell(sp); action = sfstrbase(sp); while ((i = write(cs->fd, action, n)) > 0 && (n -= i) > 0) action += i; sfstrclose(sp); if (n) goto bad; sfclose(sp); cj->pid = 0; cj->status = 0; cj->local = 0; cj->service = cs; co->svc_outstanding++; co->svc_running++; co->total++; return cj; bad: cj->pid = CO_PID_FREE; sfclose(sp); return 0; } Cojob_t* coexec(register Coshell_t* co, const char* action, int flags, const char* out, const char* err, const char* att) { register Cojob_t* cj; register Sfio_t* sp; register Coservice_t* cs; int n; int i; int og; int cg; char* s; char* t; char* env; char* red; char* sh[4]; struct stat sto; struct stat ste; /* * get a free job slot */ for (cj = co->jobs; cj; cj = cj->next) if (cj->pid == CO_PID_FREE) break; if (cj) cj->service = 0; else if (!(cj = vmnewof(co->vm, 0, Cojob_t, 1, 0))) return 0; else { cj->coshell = co; cj->pid = CO_PID_FREE; cj->id = ++co->slots; cj->next = co->jobs; co->jobs = cj; } /* * set the flags */ flags &= ~co->mask; flags |= co->flags; cj->flags = flags; /* * check service intercepts */ for (cs = co->service; cs; cs = cs->next) { for (s = cs->name, t = (char*)action; *s && *s == *t; s++, t++); if (!*s && *t == ' ') return request(co, cj, cs, t + 1, flags); } cj->flags &= ~CO_SERVICE; red = (cj->flags & CO_APPEND) ? ">>" : ">"; /* * package the action */ if (!(env = coinitialize(co, co->flags))) return 0; if (!(sp = sfstropen())) return 0; n = strlen(action); if (co->flags & CO_SERVER) { /* * leave it to server */ sfprintf(sp, "#%05d\ne %d %d %s %s %s", 0, cj->id, cj->flags, state.pwd, out, err); if (att) sfprintf(sp, " (%d:%s)", strlen(att), att); else sfprintf(sp, " %s", att); sfprintf(sp, " (%d:%s) (%d:%s)\n", strlen(env), env, n, action); } else if (co->flags & CO_INIT) { if (flags & CO_DEBUG) sfprintf(sp, "set -x\n"); sfprintf(sp, "%s%s\necho x %d $? >&$%s\n", env, action, cj->id, CO_ENV_MSGFD); } else if (flags & CO_KSH) { #if !_lib_fork && defined(_map_spawnve) Sfio_t* tp; tp = sp; if (!(sp = sfstropen())) sp = tp; #endif sfprintf(sp, "{\ntrap 'set %s$?; trap \"\" 0; IFS=\"\n\"; print -u$%s x %d $1 $(times); exit $1' 0 HUP INT QUIT TERM%s\n%s%s%s", (flags & CO_SILENT) ? "" : "+x ", CO_ENV_MSGFD, cj->id, (flags & CO_IGNORE) ? "" : " ERR", env, n > CO_MAXEVAL ? "" : "eval '", (flags & CO_SILENT) ? "" : "set -x\n"); if (n > CO_MAXEVAL) sfputr(sp, action, -1); else { coquote(sp, action, 0); sfprintf(sp, "\n'"); } sfprintf(sp, "\n} </dev/null"); if (out) { if (*out == '/') sfprintf(sp, " %s%s", red, out); else sfprintf(sp, " %s%s/%s", red, state.pwd, out); } else if ((flags & CO_SERIALIZE) && (cj->out = pathtemp(NiL, 64, NiL, "coo", NiL))) sfprintf(sp, " >%s", cj->out); if (err) { if (out && streq(out, err)) sfprintf(sp, " 2>&1"); else if (*err == '/') sfprintf(sp, " 2%s%s", red, err); else sfprintf(sp, " 2%s%s/%s", red, state.pwd, err); } else if (flags & CO_SERIALIZE) { if (!out && !fstat(1, &sto) && !fstat(2, &ste) && sto.st_dev == ste.st_dev && sto.st_ino == ste.st_ino) sfprintf(sp, " 2>&1"); else if (cj->err = pathtemp(NiL, 64, NiL, "coe", NiL)) sfprintf(sp, " 2>%s", cj->err); } #if !_lib_fork && defined(_map_spawnve) if (sp != tp) { sfprintf(tp, "%s -c '", state.sh); if (!(s = costash(sp))) return 0; coquote(tp, s, 0); sfprintf(tp, "'"); sfstrclose(sp); sp = tp; } #endif sfprintf(sp, " &\nprint -u$%s j %d $!\n", CO_ENV_MSGFD, cj->id); } else { #if !_lib_fork && defined(_map_spawnve) Sfio_t* tp; tp = sp; if (!(sp = sfstropen())) sp = tp; #endif flags |= CO_IGNORE; if (co->mode & CO_MODE_SEPARATE) { flags &= ~CO_SERIALIZE; og = '{'; cg = '}'; } else { og = '('; cg = ')'; } sfprintf(sp, "%c\n%s%sset -%s%s\n", og, env, n > CO_MAXEVAL ? "" : "eval '", (flags & CO_IGNORE) ? "" : "e", (flags & CO_SILENT) ? "" : "x"); if (n > CO_MAXEVAL) sfprintf(sp, "%s", action); else { coquote(sp, action, 0); sfprintf(sp, "\n'"); } sfprintf(sp, "\n%c </dev/null", cg); if (out) { if (*out == '/') sfprintf(sp, " %s%s", red, out); else sfprintf(sp, " %s%s/%s", red, state.pwd, out); } else if ((flags & CO_SERIALIZE) && (cj->out = pathtemp(NiL, 64, NiL, "coo", NiL))) sfprintf(sp, " >%s", cj->out); if (err) { if (out && streq(out, err)) sfprintf(sp, " 2>&1"); else if (*err == '/') sfprintf(sp, " 2%s%s", red, err); else sfprintf(sp, " 2%s%s/%s", red, state.pwd, err); } else if (flags & CO_SERIALIZE) { if (out) sfprintf(sp, " 2>&1"); else if (cj->err = pathtemp(NiL, 64, NiL, "coe", NiL)) sfprintf(sp, " 2>%s", cj->err); } if (!(co->mode & CO_MODE_SEPARATE)) { if (flags & CO_OSH) sfprintf(sp, " && echo x %d 0 >&$%s || echo x %d $? >&$%s", cj->id, CO_ENV_MSGFD, cj->id, CO_ENV_MSGFD); else sfprintf(sp, " && echo x %d 0 `times` >&$%s || echo x %d $? `times` >&$%s", cj->id, CO_ENV_MSGFD, cj->id, CO_ENV_MSGFD); } #if !_lib_fork && defined(_map_spawnve) if (sp != tp) { sfprintf(tp, "%s -c '", state.sh); if (!(s = costash(sp))) return 0; coquote(tp, s, 0); sfprintf(tp, "'"); sfstrclose(sp); sp = tp; } #endif if (!(co->mode & CO_MODE_SEPARATE)) sfprintf(sp, " &\necho j %d $! >&$%s\n", cj->id, CO_ENV_MSGFD); } n = sfstrtell(sp); if (!costash(sp)) return 0; if (flags & CO_SERVER) sfprintf(sp, "#%05d\n", n - 7); s = sfstrseek(sp, 0, SEEK_SET); if (flags & CO_DEBUG) errormsg(state.lib, ERROR_LIBRARY|2, "job %d commands:\n\n%s\n", cj->id, s); if (co->mode & CO_MODE_SEPARATE) { sh[0] = state.sh; sh[1] = "-c"; sh[2] = s; sh[3] = 0; cj->status = procrun(state.sh, sh, 0); sfstrclose(sp); cj->pid = CO_PID_ZOMBIE; cj->local = 0; co->outstanding++; co->total++; } else { /* * send it off */ while ((i = write(co->cmdfd, s, n)) > 0 && (n -= i) > 0) s += i; sfstrclose(sp); if (n) return 0; /* * it's a job */ cj->pid = 0; cj->status = 0; cj->local = 0; co->outstanding++; co->running++; co->total++; if (co->mode & CO_MODE_ACK) cj = cowait(co, cj, -1); } return cj; }
{ "pile_set_name": "Github" }
/* *************************************************************************** * This file is part of SharpNEAT - Evolution of Neural Networks. * * Copyright 2004-2016 Colin Green (sharpneat@gmail.com) * * SharpNEAT is free software; you can redistribute it and/or modify * it under the terms of The MIT License (MIT). * * You should have received a copy of the MIT License * along with SharpNEAT; if not, see https://opensource.org/licenses/MIT. */ using System.Diagnostics; using SharpNeat.Core; using SharpNeat.Phenomes; namespace SharpNeat.Domains.BinarySixMultiplexer { /// <summary> /// Binary 6-Multiplexer task. /// Two inputs supply a binary number between 0 and 3. This number selects one of the /// further 4 inputs (six inputs in total). The correct response is the selected input's /// input signal (0 or 1). /// </summary> public class BinarySixMultiplexerEvaluator : IPhenomeEvaluator<IBlackBox> { const double StopFitness = 1000.0; ulong _evalCount; bool _stopConditionSatisfied; #region IPhenomeEvaluator<IBlackBox> Members /// <summary> /// Gets the total number of evaluations that have been performed. /// </summary> public ulong EvaluationCount { get { return _evalCount; } } /// <summary> /// Gets a value indicating whether some goal fitness has been achieved and that /// the evolutionary algorithm/search should stop. This property's value can remain false /// to allow the algorithm to run indefinitely. /// </summary> public bool StopConditionSatisfied { get { return _stopConditionSatisfied; } } /// <summary> /// Evaluate the provided IBlackBox against the Binary 6-Multiplexer problem domain and return /// its fitness score. /// </summary> public FitnessInfo Evaluate(IBlackBox box) { double fitness = 0.0; bool success = true; double output; ISignalArray inputArr = box.InputSignalArray; ISignalArray outputArr = box.OutputSignalArray; _evalCount++; // 64 test cases. for(int i=0; i<64; i++) { // Apply bitmask to i and shift left to generate the input signals. // In addition we scale 0->1 to be 0.1->1.0 // Note. We /could/ eliminate all the boolean logic by pre-building a table of test // signals and correct responses. int tmp = i; for(int j=0; j<6; j++) { inputArr[j] = tmp&0x1; tmp >>= 1; } // Activate the black box. box.Activate(); if(!box.IsStateValid) { // Any black box that gets itself into an invalid state is unlikely to be // any good, so let's just exit here. return FitnessInfo.Zero; } // Read output signal. output = outputArr[0]; Debug.Assert(output >= 0.0, "Unexpected negative output."); // Determine the correct answer by using highly cryptic bit manipulation :) // The condition is true if the correct answer is true (1.0). if(((1<<(2+(i&0x3)))&i) != 0) { // correct answer = true. // Assign fitness on sliding scale between 0.0 and 1.0 based on squared error. // In tests squared error drove evolution significantly more efficiently in this domain than absolute error. // Note. To base fitness on absolute error use: fitness += output; fitness += 1.0-((1.0-output)*(1.0-output)); if(output<0.5) { success=false; } } else { // correct answer = false. // Assign fitness on sliding scale between 0.0 and 1.0 based on squared error. // In tests squared error drove evolution significantly more efficiently in this domain than absolute error. // Note. To base fitness on absolute error use: fitness += 1.0-output; fitness += 1.0-(output*output); if(output>=0.5) { success=false; } } // Reset black box state ready for next test case. box.ResetState(); } // If the correct answer was given in each case then add a bonus value to the fitness. if(success) { fitness += 1000.0; } if(fitness > StopFitness) { _stopConditionSatisfied = true; } return new FitnessInfo(fitness, fitness); } /// <summary> /// Reset the internal state of the evaluation scheme if any exists. /// Note. The Binary Multiplexer problem domain has no internal state. This method does nothing. /// </summary> public void Reset() { } #endregion } }
{ "pile_set_name": "Github" }
# frozen_string_literal: true class IiifManifestCachePrewarmJob < Hyrax::ApplicationJob ## # @param work [ActiveFedora::Base] def perform(work) presenter = Hyrax::IiifManifestPresenter.new(work) manifest_builder.manifest_for(presenter: presenter) end private def manifest_builder Hyrax::CachingIiifManifestBuilder.new end end
{ "pile_set_name": "Github" }
/* * Copyright 2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.gradle.plugins.ide.eclipse.model; import com.google.common.base.Objects; import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import java.io.Serializable; import java.util.Map; /** * A build command. */ public class BuildCommand implements Serializable { private String name; private Map<String, String> arguments; public BuildCommand(String name) { this(name, Maps.<String, String>newLinkedHashMap()); } public BuildCommand(String name, Map<String, String> arguments) { this.name = Preconditions.checkNotNull(name); this.arguments = Preconditions.checkNotNull(arguments); } public String getName() { return name; } public void setName(String name) { this.name = name; } public Map<String, String> getArguments() { return arguments; } public void setArguments(Map<String, String> arguments) { this.arguments = arguments; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } BuildCommand that = (BuildCommand) o; return Objects.equal(name, that.name) && Objects.equal(arguments, that.arguments); } @Override public int hashCode() { return Objects.hashCode(name, arguments); } @Override public String toString() { return "BuildCommand{name='" + name + "', arguments=" + arguments + "}"; } }
{ "pile_set_name": "Github" }
''' After the bounding boxes have been drawn using `draw_bounding_boxes.py`, every bounded box must be cropped and copied into its own image in order to train and test the net on them. No resizing to 256x256 is necessary because I let caffe do that. TODO make sure caffe warps rather than crops. The source images should be in `data/imagenet/<wnid>/images/all`, and the cropped images will be placed in `data/imagenet/<wnid>/images/cropped`. ''' import gflags from gflags import FLAGS from flags import set_gflags # This default wnid is for eggs gflags.DEFINE_string('bounding_boxes_csv', None, 'The log that contains the bounding box coordinates') gflags.MarkFlagAsRequired('bounding_boxes_csv') gflags.DEFINE_string('dst', None, 'Where to store the cropped images') gflags.MarkFlagAsRequired('dst') from cropping_utils import get_crop_box import csv from PIL import Image from os.path import dirname, abspath, join, splitext, basename from os import system from random import randint ROOT = dirname(abspath(__file__)) if __name__ == '__main__': set_gflags() system('mkdir -p ' + FLAGS.dst) count = 0 with open(FLAGS.bounding_boxes_csv) as csvfile: reader = csv.reader(csvfile) for row in reader: for i in range(1, len(row), 4): count += 1 if count % 100 == 0: print count filename = row[0] image = Image.open(filename) width, height = image.size target = join(FLAGS.dst, splitext(basename(filename))[0]) image.crop(get_crop_box(row, i, width, height) ).save(target + '_' + str(int(i/4)) + '.jpg')
{ "pile_set_name": "Github" }
// g2o - General Graph Optimization // Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef G2O_STUFF_MISC_H #define G2O_STUFF_MISC_H #include "macros.h" #include <cmath> #ifndef M_PI #define M_PI 3.14159265358979323846 #endif /** @addtogroup utils **/ // @{ /** \file misc.h * \brief some general case utility functions * * This file specifies some general case utility functions **/ namespace g2o { /** * return the square value */ template <typename T> inline T square(T x) { return x*x; } /** * return the hypot of x and y */ template <typename T> inline T hypot(T x, T y) { return (T) (sqrt(x*x + y*y)); } /** * return the squared hypot of x and y */ template <typename T> inline T hypot_sqr(T x, T y) { return x*x + y*y; } /** * convert from degree to radian */ inline double deg2rad(double degree) { return degree * 0.01745329251994329576; } /** * convert from radian to degree */ inline double rad2deg(double rad) { return rad * 57.29577951308232087721; } /** * normalize the angle */ inline double normalize_theta(double theta) { if (theta >= -M_PI && theta < M_PI) return theta; double multiplier = floor(theta / (2*M_PI)); theta = theta - multiplier*2*M_PI; if (theta >= M_PI) theta -= 2*M_PI; if (theta < -M_PI) theta += 2*M_PI; return theta; } /** * inverse of an angle, i.e., +180 degree */ inline double inverse_theta(double th) { return normalize_theta(th + M_PI); } /** * average two angles */ inline double average_angle(double theta1, double theta2) { double x, y; x = cos(theta1) + cos(theta2); y = sin(theta1) + sin(theta2); if(x == 0 && y == 0) return 0; else return std::atan2(y, x); } /** * sign function. * @return the sign of x. +1 for x > 0, -1 for x < 0, 0 for x == 0 */ template <typename T> inline int sign(T x) { if (x > 0) return 1; else if (x < 0) return -1; else return 0; } /** * clamp x to the interval [l, u] */ template <typename T> inline T clamp(T l, T x, T u) { if (x < l) return l; if (x > u) return u; return x; } /** * wrap x to be in the interval [l, u] */ template <typename T> inline T wrap(T l, T x, T u) { T intervalWidth = u - l; while (x < l) x += intervalWidth; while (x > u) x -= intervalWidth; return x; } /** * tests whether there is a NaN in the array */ inline bool arrayHasNaN(const double* array, int size, int* nanIndex = 0) { for (int i = 0; i < size; ++i) if (g2o_isnan(array[i])) { if (nanIndex) *nanIndex = i; return true; } return false; } /** * The following two functions are used to force linkage with static libraries. */ extern "C" { typedef void (* ForceLinkFunction) (void); } struct ForceLinker { ForceLinker(ForceLinkFunction function) { (function)(); } }; } // end namespace // @} #endif
{ "pile_set_name": "Github" }
MD5加密 === `MD5`是一种不可逆的加密算法只能将原文加密,不能讲密文再还原去,原来把加密后将这个数组通过`Base64`给变成字符串, 这样是不严格的业界标准的做法是对其加密之后用每个字节`&15`然后就能得到一个`int`型的值,再将这个`int`型的值变成16进制的字符串.虽然MD5不可逆, 但是网上出现了将常用的数字用`md5`加密之后通过数据库查询,所以`MD5`简单的情况下仍然可以查出来,一般可以对其多加密几次或者`&15`之后再和别的数运算等, 这称之为*加盐*. ```java public class MD5Utils { /** * md5加密的工具方法 */ public static String encode(String password){ try { MessageDigest digest = MessageDigest.getInstance("md5"); byte[] result = digest.digest(password.getBytes()); StringBuilder sb = new StringBuilder();//有的数很小还不到10所以得到16进制的字符串有一个 //的情况,这里对于小于10的值前面加上0 //16进制的方式 把结果集byte数组 打印出来 for(byte b :result){ int number = (b&0xff);//加盐. String str =Integer.toHexString(number); if(str.length()==1){ sb.append("0"); } sb.append(str); } return sb.toString(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); return ""; } } } ``` ---- - 邮箱 :charon.chui@gmail.com - Good Luck!
{ "pile_set_name": "Github" }
{ "createNameRegistratorZeroMem" : { "_info" : { "comment" : "", "filledwith" : "testeth 1.6.0-alpha.0-11+commit.978e68d2", "lllcversion" : "Version: 0.5.0-develop.2018.11.9+commit.9709dfe0.Linux.g++", "source" : "src/GeneralStateTestsFiller/stSystemOperationsTest/createNameRegistratorZeroMemFiller.json", "sourceHash" : "0edc45aa868919728eb0d092dff0389cafbf4e419afecca4e36a9fdee61c5d2c" }, "env" : { "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", "currentDifficulty" : "0x20000", "currentGasLimit" : "0x0f4240", "currentNumber" : "0x01", "currentTimestamp" : "0x03e8", "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" }, "post" : { "Byzantium" : [ { "hash" : "0xd9804558d3cf4692b46acf3d314718d66552150ecb7c8cde1057d366fe1fd3dd", "indexes" : { "data" : 0, "gas" : 0, "value" : 0 }, "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ], "Constantinople" : [ { "hash" : "0xd9804558d3cf4692b46acf3d314718d66552150ecb7c8cde1057d366fe1fd3dd", "indexes" : { "data" : 0, "gas" : 0, "value" : 0 }, "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ], "ConstantinopleFix" : [ { "hash" : "0xd9804558d3cf4692b46acf3d314718d66552150ecb7c8cde1057d366fe1fd3dd", "indexes" : { "data" : 0, "gas" : 0, "value" : 0 }, "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ], "EIP150" : [ { "hash" : "0x534c4ab86305a6e229b8e02dc82bcbdadbf0181384643b14ee0ed128a3a30764", "indexes" : { "data" : 0, "gas" : 0, "value" : 0 }, "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ], "EIP158" : [ { "hash" : "0xd9804558d3cf4692b46acf3d314718d66552150ecb7c8cde1057d366fe1fd3dd", "indexes" : { "data" : 0, "gas" : 0, "value" : 0 }, "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ], "Frontier" : [ { "hash" : "0x534c4ab86305a6e229b8e02dc82bcbdadbf0181384643b14ee0ed128a3a30764", "indexes" : { "data" : 0, "gas" : 0, "value" : 0 }, "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ], "Homestead" : [ { "hash" : "0x534c4ab86305a6e229b8e02dc82bcbdadbf0181384643b14ee0ed128a3a30764", "indexes" : { "data" : 0, "gas" : 0, "value" : 0 }, "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ] }, "pre" : { "0x095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x7c601080600c6000396000f3006000355415600957005b60203560003555600052600060036017f0600055", "nonce" : "0x00", "storage" : { } }, "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "0x0de0b6b3a7640000", "code" : "", "nonce" : "0x00", "storage" : { } } }, "transaction" : { "data" : [ "0x" ], "gasLimit" : [ "0x0493e0" ], "gasPrice" : "0x01", "nonce" : "0x00", "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "to" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87", "value" : [ "0x0186a0" ] } } }
{ "pile_set_name": "Github" }
/* * INET An implementation of the TCP/IP protocol suite for the LINUX * operating system. INET is implemented using the BSD Socket * interface as the means of communication with the user level. * * The Internet Protocol (IP) module. * * Version: $Id: ip_input.c,v 1.55 2002/01/12 07:39:45 davem Exp $ * * Authors: Ross Biro * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> * Donald Becker, <becker@super.org> * Alan Cox, <Alan.Cox@linux.org> * Richard Underwood * Stefan Becker, <stefanb@yello.ping.de> * Jorge Cwik, <jorge@laser.satlink.net> * Arnt Gulbrandsen, <agulbra@nvg.unit.no> * * * Fixes: * Alan Cox : Commented a couple of minor bits of surplus code * Alan Cox : Undefining IP_FORWARD doesn't include the code * (just stops a compiler warning). * Alan Cox : Frames with >=MAX_ROUTE record routes, strict routes or loose routes * are junked rather than corrupting things. * Alan Cox : Frames to bad broadcast subnets are dumped * We used to process them non broadcast and * boy could that cause havoc. * Alan Cox : ip_forward sets the free flag on the * new frame it queues. Still crap because * it copies the frame but at least it * doesn't eat memory too. * Alan Cox : Generic queue code and memory fixes. * Fred Van Kempen : IP fragment support (borrowed from NET2E) * Gerhard Koerting: Forward fragmented frames correctly. * Gerhard Koerting: Fixes to my fix of the above 8-). * Gerhard Koerting: IP interface addressing fix. * Linus Torvalds : More robustness checks * Alan Cox : Even more checks: Still not as robust as it ought to be * Alan Cox : Save IP header pointer for later * Alan Cox : ip option setting * Alan Cox : Use ip_tos/ip_ttl settings * Alan Cox : Fragmentation bogosity removed * (Thanks to Mark.Bush@prg.ox.ac.uk) * Dmitry Gorodchanin : Send of a raw packet crash fix. * Alan Cox : Silly ip bug when an overlength * fragment turns up. Now frees the * queue. * Linus Torvalds/ : Memory leakage on fragmentation * Alan Cox : handling. * Gerhard Koerting: Forwarding uses IP priority hints * Teemu Rantanen : Fragment problems. * Alan Cox : General cleanup, comments and reformat * Alan Cox : SNMP statistics * Alan Cox : BSD address rule semantics. Also see * UDP as there is a nasty checksum issue * if you do things the wrong way. * Alan Cox : Always defrag, moved IP_FORWARD to the config.in file * Alan Cox : IP options adjust sk->priority. * Pedro Roque : Fix mtu/length error in ip_forward. * Alan Cox : Avoid ip_chk_addr when possible. * Richard Underwood : IP multicasting. * Alan Cox : Cleaned up multicast handlers. * Alan Cox : RAW sockets demultiplex in the BSD style. * Gunther Mayer : Fix the SNMP reporting typo * Alan Cox : Always in group 224.0.0.1 * Pauline Middelink : Fast ip_checksum update when forwarding * Masquerading support. * Alan Cox : Multicast loopback error for 224.0.0.1 * Alan Cox : IP_MULTICAST_LOOP option. * Alan Cox : Use notifiers. * Bjorn Ekwall : Removed ip_csum (from slhc.c too) * Bjorn Ekwall : Moved ip_fast_csum to ip.h (inline!) * Stefan Becker : Send out ICMP HOST REDIRECT * Arnt Gulbrandsen : ip_build_xmit * Alan Cox : Per socket routing cache * Alan Cox : Fixed routing cache, added header cache. * Alan Cox : Loopback didn't work right in original ip_build_xmit - fixed it. * Alan Cox : Only send ICMP_REDIRECT if src/dest are the same net. * Alan Cox : Incoming IP option handling. * Alan Cox : Set saddr on raw output frames as per BSD. * Alan Cox : Stopped broadcast source route explosions. * Alan Cox : Can disable source routing * Takeshi Sone : Masquerading didn't work. * Dave Bonn,Alan Cox : Faster IP forwarding whenever possible. * Alan Cox : Memory leaks, tramples, misc debugging. * Alan Cox : Fixed multicast (by popular demand 8)) * Alan Cox : Fixed forwarding (by even more popular demand 8)) * Alan Cox : Fixed SNMP statistics [I think] * Gerhard Koerting : IP fragmentation forwarding fix * Alan Cox : Device lock against page fault. * Alan Cox : IP_HDRINCL facility. * Werner Almesberger : Zero fragment bug * Alan Cox : RAW IP frame length bug * Alan Cox : Outgoing firewall on build_xmit * A.N.Kuznetsov : IP_OPTIONS support throughout the kernel * Alan Cox : Multicast routing hooks * Jos Vos : Do accounting *before* call_in_firewall * Willy Konynenberg : Transparent proxying support * * * * To Fix: * IP fragmentation wants rewriting cleanly. The RFC815 algorithm is much more efficient * and could be made very efficient with the addition of some virtual memory hacks to permit * the allocation of a buffer that can then be 'grown' by twiddling page tables. * Output fragmentation wants updating along with the buffer management to use a single * interleaved copy algorithm so that fragmenting has a one copy overhead. Actual packet * output should probably do its own fragmentation at the UDP/RAW layer. TCP shouldn't cause * fragmentation anyway. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include <asm/system.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> #include <linux/errno.h> #include <linux/net.h> #include <linux/socket.h> #include <linux/sockios.h> #include <linux/in.h> #include <linux/inet.h> #include <linux/inetdevice.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <net/snmp.h> #include <net/ip.h> #include <net/protocol.h> #include <net/route.h> #include <linux/skbuff.h> #include <net/sock.h> #include <net/arp.h> #include <net/icmp.h> #include <net/raw.h> #include <net/checksum.h> #include <linux/netfilter_ipv4.h> #include <net/xfrm.h> #include <linux/mroute.h> #include <linux/netlink.h> /* * SNMP management statistics */ DEFINE_SNMP_STAT(struct ipstats_mib, ip_statistics) __read_mostly; /* * Process Router Attention IP option */ int ip_call_ra_chain(struct sk_buff *skb) { struct ip_ra_chain *ra; u8 protocol = ip_hdr(skb)->protocol; struct sock *last = NULL; read_lock(&ip_ra_lock); for (ra = ip_ra_chain; ra; ra = ra->next) { struct sock *sk = ra->sk; /* If socket is bound to an interface, only report * the packet if it came from that interface. */ if (sk && inet_sk(sk)->num == protocol && (!sk->sk_bound_dev_if || sk->sk_bound_dev_if == skb->dev->ifindex)) { if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) { if (ip_defrag(skb, IP_DEFRAG_CALL_RA_CHAIN)) { read_unlock(&ip_ra_lock); return 1; } } if (last) { struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC); if (skb2) raw_rcv(last, skb2); } last = sk; } } if (last) { raw_rcv(last, skb); read_unlock(&ip_ra_lock); return 1; } read_unlock(&ip_ra_lock); return 0; } static inline int ip_local_deliver_finish(struct sk_buff *skb) { __skb_pull(skb, ip_hdrlen(skb)); /* Point into the IP datagram, just past the header. */ skb_reset_transport_header(skb); rcu_read_lock(); { /* Note: See raw.c and net/raw.h, RAWV4_HTABLE_SIZE==MAX_INET_PROTOS */ int protocol = ip_hdr(skb)->protocol; int hash; struct sock *raw_sk; struct net_protocol *ipprot; resubmit: hash = protocol & (MAX_INET_PROTOS - 1); raw_sk = sk_head(&raw_v4_htable[hash]); /* If there maybe a raw socket we must check - if not we * don't care less */ if (raw_sk && !raw_v4_input(skb, ip_hdr(skb), hash)) raw_sk = NULL; if ((ipprot = rcu_dereference(inet_protos[hash])) != NULL) { int ret; if (!ipprot->no_policy) { if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) { kfree_skb(skb); goto out; } nf_reset(skb); } ret = ipprot->handler(skb); if (ret < 0) { protocol = -ret; goto resubmit; } IP_INC_STATS_BH(IPSTATS_MIB_INDELIVERS); } else { if (!raw_sk) { if (xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) { IP_INC_STATS_BH(IPSTATS_MIB_INUNKNOWNPROTOS); icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PROT_UNREACH, 0); } } else IP_INC_STATS_BH(IPSTATS_MIB_INDELIVERS); kfree_skb(skb); } } out: rcu_read_unlock(); return 0; } /* * Deliver IP Packets to the higher protocol layers. */ int ip_local_deliver(struct sk_buff *skb) { /* * Reassemble IP fragments. */ if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) { if (ip_defrag(skb, IP_DEFRAG_LOCAL_DELIVER)) return 0; } return NF_HOOK(PF_INET, NF_IP_LOCAL_IN, skb, skb->dev, NULL, ip_local_deliver_finish); } static inline int ip_rcv_options(struct sk_buff *skb) { struct ip_options *opt; struct iphdr *iph; struct net_device *dev = skb->dev; /* It looks as overkill, because not all IP options require packet mangling. But it is the easiest for now, especially taking into account that combination of IP options and running sniffer is extremely rare condition. --ANK (980813) */ if (skb_cow(skb, skb_headroom(skb))) { IP_INC_STATS_BH(IPSTATS_MIB_INDISCARDS); goto drop; } iph = ip_hdr(skb); if (ip_options_compile(NULL, skb)) { IP_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS); goto drop; } opt = &(IPCB(skb)->opt); if (unlikely(opt->srr)) { struct in_device *in_dev = in_dev_get(dev); if (in_dev) { if (!IN_DEV_SOURCE_ROUTE(in_dev)) { if (IN_DEV_LOG_MARTIANS(in_dev) && net_ratelimit()) printk(KERN_INFO "source route option " "%u.%u.%u.%u -> %u.%u.%u.%u\n", NIPQUAD(iph->saddr), NIPQUAD(iph->daddr)); in_dev_put(in_dev); goto drop; } in_dev_put(in_dev); } if (ip_options_rcv_srr(skb)) goto drop; } return 0; drop: return -1; } static inline int ip_rcv_finish(struct sk_buff *skb) { const struct iphdr *iph = ip_hdr(skb); struct rtable *rt; /* * Initialise the virtual path cache for the packet. It describes * how the packet travels inside Linux networking. */ if (skb->dst == NULL) { int err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, skb->dev); if (unlikely(err)) { if (err == -EHOSTUNREACH) IP_INC_STATS_BH(IPSTATS_MIB_INADDRERRORS); else if (err == -ENETUNREACH) IP_INC_STATS_BH(IPSTATS_MIB_INNOROUTES); goto drop; } } #ifdef CONFIG_NET_CLS_ROUTE if (unlikely(skb->dst->tclassid)) { struct ip_rt_acct *st = ip_rt_acct + 256*smp_processor_id(); u32 idx = skb->dst->tclassid; st[idx&0xFF].o_packets++; st[idx&0xFF].o_bytes+=skb->len; st[(idx>>16)&0xFF].i_packets++; st[(idx>>16)&0xFF].i_bytes+=skb->len; } #endif if (iph->ihl > 5 && ip_rcv_options(skb)) goto drop; rt = (struct rtable*)skb->dst; if (rt->rt_type == RTN_MULTICAST) IP_INC_STATS_BH(IPSTATS_MIB_INMCASTPKTS); else if (rt->rt_type == RTN_BROADCAST) IP_INC_STATS_BH(IPSTATS_MIB_INBCASTPKTS); return dst_input(skb); drop: kfree_skb(skb); return NET_RX_DROP; } /* * Main IP Receive routine. */ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) { struct iphdr *iph; u32 len; /* When the interface is in promisc. mode, drop all the crap * that it receives, do not try to analyse it. */ if (skb->pkt_type == PACKET_OTHERHOST) goto drop; IP_INC_STATS_BH(IPSTATS_MIB_INRECEIVES); if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) { IP_INC_STATS_BH(IPSTATS_MIB_INDISCARDS); goto out; } if (!pskb_may_pull(skb, sizeof(struct iphdr))) goto inhdr_error; iph = ip_hdr(skb); /* * RFC1122: 3.1.2.2 MUST silently discard any IP frame that fails the checksum. * * Is the datagram acceptable? * * 1. Length at least the size of an ip header * 2. Version of 4 * 3. Checksums correctly. [Speed optimisation for later, skip loopback checksums] * 4. Doesn't have a bogus length */ if (iph->ihl < 5 || iph->version != 4) goto inhdr_error; if (!pskb_may_pull(skb, iph->ihl*4)) goto inhdr_error; iph = ip_hdr(skb); if (unlikely(ip_fast_csum((u8 *)iph, iph->ihl))) goto inhdr_error; len = ntohs(iph->tot_len); if (skb->len < len) { IP_INC_STATS_BH(IPSTATS_MIB_INTRUNCATEDPKTS); goto drop; } else if (len < (iph->ihl*4)) goto inhdr_error; /* Our transport medium may have padded the buffer out. Now we know it * is IP we can trim to the true length of the frame. * Note this now means skb->len holds ntohs(iph->tot_len). */ if (pskb_trim_rcsum(skb, len)) { IP_INC_STATS_BH(IPSTATS_MIB_INDISCARDS); goto drop; } /* Remove any debris in the socket control block */ memset(IPCB(skb), 0, sizeof(struct inet_skb_parm)); return NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, dev, NULL, ip_rcv_finish); inhdr_error: IP_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS); drop: kfree_skb(skb); out: return NET_RX_DROP; } EXPORT_SYMBOL(ip_statistics);
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?><!-- ~ Nextcloud Talk application ~ ~ @author Mario Danic ~ Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com> ~ ~ This program is free software: you can redistribute it and/or modify ~ it under the terms of the GNU General Public License as published by ~ the Free Software Foundation, either version 3 of the License, or ~ at your option) any later version. ~ ~ This program is distributed in the hope that it will be useful, ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ~ GNU General Public License for more details. ~ ~ You should have received a copy of the GNU General Public License ~ along with this program. If not, see <http://www.gnu.org/licenses/>. --> <merge xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content"> <RelativeLayout android:layout_height="wrap_content" android:layout_width="match_parent" android:animateLayoutChanges="true"> <include layout="@layout/item_message_quote" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone" /> <androidx.emoji.widget.EmojiEditText android:id="@id/messageInput" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/quotedMessageLayout" android:layout_centerHorizontal="true" android:layout_toStartOf="@id/sendButtonSpace" android:layout_toEndOf="@id/attachmentButtonSpace" android:imeOptions="actionDone" android:inputType="textAutoCorrect|textMultiLine|textCapSentences" android:lineSpacingMultiplier="1.2" /> <ImageButton android:id="@id/attachmentButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/quotedMessageLayout" android:scaleType="centerInside" /> <ImageButton android:id="@+id/smileyButton" android:layout_width="36dp" android:layout_height="36dp" android:layout_below="@id/quotedMessageLayout" android:layout_toStartOf="@id/messageSendButton" android:background="@color/transparent" android:src="@drawable/ic_insert_emoticon_black_24dp" android:tint="@color/emoji_icons" /> <ImageButton android:id="@id/messageSendButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_below="@id/quotedMessageLayout" android:scaleType="centerInside" /> <Space android:id="@id/attachmentButtonSpace" android:layout_width="0dp" android:layout_height="0dp" android:layout_below="@id/quotedMessageLayout" android:layout_toEndOf="@id/attachmentButton" /> <Space android:id="@id/sendButtonSpace" android:layout_width="0dp" android:layout_height="0dp" android:layout_below="@id/quotedMessageLayout" android:layout_toStartOf="@id/smileyButton" /> </RelativeLayout> </merge>
{ "pile_set_name": "Github" }
"use strict"; import { paths } from "../gulpfile.babel"; import gulp from "gulp"; import gulpif from "gulp-if"; import rename from "gulp-rename"; import sass from "gulp-sass"; import mincss from "gulp-clean-css"; import groupmedia from "gulp-group-css-media-queries"; import autoprefixer from "gulp-autoprefixer"; import sourcemaps from "gulp-sourcemaps"; import plumber from "gulp-plumber"; import browsersync from "browser-sync"; import debug from "gulp-debug"; import yargs from "yargs"; const argv = yargs.argv, production = !!argv.production; gulp.task("styles", () => { return gulp.src(paths.styles.src) .pipe(gulpif(!production, sourcemaps.init())) .pipe(plumber()) .pipe(sass()) .pipe(groupmedia()) .pipe(gulpif(production, autoprefixer({ cascade: false, grid: true }))) .pipe(gulpif(production, mincss({ compatibility: "ie8", level: { 1: { specialComments: 0, removeEmpty: true, removeWhitespace: true }, 2: { mergeMedia: true, removeEmpty: true, removeDuplicateFontRules: true, removeDuplicateMediaBlocks: true, removeDuplicateRules: true, removeUnusedAtRules: false } } }))) .pipe(gulpif(production, rename({ suffix: ".min" }))) .pipe(plumber.stop()) .pipe(gulpif(!production, sourcemaps.write("./maps/"))) .pipe(gulp.dest(paths.styles.dist)) .pipe(debug({ "title": "CSS files" })) .pipe(browsersync.stream()); });
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.7.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.macro.cloud</groupId> <artifactId>seata-storage-service</artifactId> <version>0.0.1-SNAPSHOT</version> <name>seata-storage-service</name> <description>Demo project for Spring Boot</description> <properties> <java.version>1.8</java.version> <spring-cloud.version>Greenwich.SR2</spring-cloud.version> <mysql-connector-java.version>5.1.37</mysql-connector-java.version> <mybatis-spring-boot-starter.version>2.0.0</mybatis-spring-boot-starter.version> <druid-spring-boot-starter.version>1.1.10</druid-spring-boot-starter.version> <lombok.version>1.18.8</lombok.version> <seata.version>0.9.0</seata.version> </properties> <dependencies> <!--nacos--> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> </dependency> <!--seata--> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-seata</artifactId> <exclusions> <exclusion> <artifactId>seata-all</artifactId> <groupId>io.seata</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>io.seata</groupId> <artifactId>seata-all</artifactId> <version>${seata.version}</version> </dependency> <!--feign--> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-openfeign</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>${mybatis-spring-boot-starter.version}</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${mysql-connector-java.version}</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>${druid-spring-boot-starter.version}</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>${lombok.version}</version> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-alibaba-dependencies</artifactId> <version>2.1.0.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project>
{ "pile_set_name": "Github" }
{ "name": "Purple Network", "displayName": "Purple Network", "properties": [ "ho-mobile.it" ] }
{ "pile_set_name": "Github" }
/* * Copyright 2004-2020 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.engine; import org.h2.message.DbException; import org.h2.message.Trace; import org.h2.table.Table; /** * Represents a role. Roles can be granted to users, and to other roles. */ public class Role extends RightOwner { private final boolean system; //org.h2.engine.Database.open(int, int)里预定义了一个publicRole = new Role(this, 0, Constants.PUBLIC_ROLE_NAME, true); //Constants.PUBLIC_ROLE_NAME="PUBLIC" public Role(Database database, int id, String roleName, boolean system) { super(database, id, roleName, Trace.USER); this.system = system; } @Override public String getCreateSQLForCopy(Table table, String quotedName) { throw DbException.throwInternalError(toString()); } /** * Get the CREATE SQL statement for this object. * * @param ifNotExists true if IF NOT EXISTS should be used * @return the SQL statement */ public String getCreateSQL(boolean ifNotExists) { if (system) { //system角色不需要生成create语句,在org.h2.engine.Database.open(int, int)里会自动建立 return null; } StringBuilder buff = new StringBuilder("CREATE ROLE "); if (ifNotExists) { buff.append("IF NOT EXISTS "); } getSQL(buff, true); return buff.toString(); } @Override public String getCreateSQL() { return getCreateSQL(false); } @Override public int getType() { return DbObject.ROLE; } //dorp role时会调用 //删除权限(类似于调用revoke命令) @Override public void removeChildrenAndResources(Session session) { //与一个role相关的权限有三种 //前两种是此role被动授予给其他RightOwner的(包括用户和其他角色) //另一种是授予给此role自己的 //此role被授予给哪些user了,那们这些user要把此权限删了 for (User user : database.getAllUsers()) { Right right = user.getRightForRole(this); if (right != null) { //此方法内部会调用Right的removeChildrenAndResources,然后会触发User的revokeRole database.removeDatabaseObject(session, right); } } //此role被授予给哪些Role了,那们这些Role要把此权限删了 for (Role r2 : database.getAllRoles()) { Right right = r2.getRightForRole(this); if (right != null) { //此方法内部会调用Right的removeChildrenAndResources,然后会触发Role的revokeRole database.removeDatabaseObject(session, right); } } //授予给此role自己的权限要删除 for (Right right : database.getAllRights()) { if (right.getGrantee() == this) { //此方法内部会调用Right的removeChildrenAndResources,然后会触发Role的revokeRole database.removeDatabaseObject(session, right); } } database.removeMeta(session, getId()); invalidate(); } }
{ "pile_set_name": "Github" }
/* * * Copyright 2017, 2018 IBM Corp. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.hyperledger.fabric.sdk.idemix; import java.io.PrintWriter; import java.io.StringWriter; import java.util.Arrays; import java.util.Base64; import javax.json.Json; import javax.json.JsonObject; import javax.json.JsonObjectBuilder; import javax.json.JsonWriter; import com.google.protobuf.ByteString; import org.apache.milagro.amcl.FP256BN.BIG; import org.apache.milagro.amcl.FP256BN.ECP; import org.apache.milagro.amcl.RAND; import org.hyperledger.fabric.protos.idemix.Idemix; /** * IdemixCredRequest represents the first message of the idemix issuance protocol, * in which the user requests a credential from the issuer. */ public class IdemixCredRequest { private final ECP nym; private final BIG issuerNonce; private final BIG proofC; private final BIG proofS; private static final String CREDREQUEST_LABEL = "credRequest"; /** * Constructor * * @param sk the secret key of the user * @param issuerNonce a nonce * @param ipk the issuer public key */ public IdemixCredRequest(BIG sk, BIG issuerNonce, IdemixIssuerPublicKey ipk) { if (sk == null) { throw new IllegalArgumentException("Cannot create idemix credrequest from null Secret Key input"); } if (issuerNonce == null) { throw new IllegalArgumentException("Cannot create idemix credrequest from null issuer nonce input"); } if (ipk == null) { throw new IllegalArgumentException("Cannot create idemix credrequest from null Issuer Public Key input"); } final RAND rng = IdemixUtils.getRand(); nym = ipk.getHsk().mul(sk); this.issuerNonce = new BIG(issuerNonce); // Create Zero Knowledge Proof BIG rsk = IdemixUtils.randModOrder(rng); ECP t = ipk.getHsk().mul(rsk); // Make proofData: total 3 elements of G1, each 2*FIELD_BYTES+1 (ECP), // plus length of String array, // plus one BIG byte[] proofData = new byte[0]; proofData = IdemixUtils.append(proofData, CREDREQUEST_LABEL.getBytes()); proofData = IdemixUtils.append(proofData, IdemixUtils.ecpToBytes(t)); proofData = IdemixUtils.append(proofData, IdemixUtils.ecpToBytes(ipk.getHsk())); proofData = IdemixUtils.append(proofData, IdemixUtils.ecpToBytes(nym)); proofData = IdemixUtils.append(proofData, IdemixUtils.bigToBytes(issuerNonce)); proofData = IdemixUtils.append(proofData, ipk.getHash()); proofC = IdemixUtils.hashModOrder(proofData); // Compute proofS = ... proofS = BIG.modmul(proofC, sk, IdemixUtils.GROUP_ORDER).plus(rsk); proofS.mod(IdemixUtils.GROUP_ORDER); } /** * Construct a IdemixCredRequest from a serialized credrequest * * @param proto a protobuf representation of a credential request */ IdemixCredRequest(Idemix.CredRequest proto) { if (proto == null) { throw new IllegalArgumentException("Cannot create idemix credrequest from null input"); } nym = IdemixUtils.transformFromProto(proto.getNym()); proofC = BIG.fromBytes(proto.getProofC().toByteArray()); proofS = BIG.fromBytes(proto.getProofS().toByteArray()); issuerNonce = BIG.fromBytes(proto.getIssuerNonce().toByteArray()); } /** * @return a pseudonym of the credential requester */ ECP getNym() { return nym; } /** * @return a proto version of this IdemixCredRequest */ Idemix.CredRequest toProto() { return Idemix.CredRequest.newBuilder() .setNym(IdemixUtils.transformToProto(nym)) .setProofC(ByteString.copyFrom(IdemixUtils.bigToBytes(proofC))) .setProofS(ByteString.copyFrom(IdemixUtils.bigToBytes(proofS))) .setIssuerNonce(ByteString.copyFrom(IdemixUtils.bigToBytes(issuerNonce))) .build(); } /** * Cryptographically verify the IdemixCredRequest * * @param ipk the issuer public key * @return true iff valid */ boolean check(IdemixIssuerPublicKey ipk) { if (nym == null || issuerNonce == null || proofC == null || proofS == null || ipk == null) { return false; } ECP t = ipk.getHsk().mul(proofS); t.sub(nym.mul(proofC)); byte[] proofData = new byte[0]; proofData = IdemixUtils.append(proofData, CREDREQUEST_LABEL.getBytes()); proofData = IdemixUtils.append(proofData, IdemixUtils.ecpToBytes(t)); proofData = IdemixUtils.append(proofData, IdemixUtils.ecpToBytes(ipk.getHsk())); proofData = IdemixUtils.append(proofData, IdemixUtils.ecpToBytes(nym)); proofData = IdemixUtils.append(proofData, IdemixUtils.bigToBytes(issuerNonce)); proofData = IdemixUtils.append(proofData, ipk.getHash()); // Hash proofData to hproofdata byte[] hproofdata = IdemixUtils.bigToBytes(IdemixUtils.hashModOrder(proofData)); return Arrays.equals(IdemixUtils.bigToBytes(proofC), hproofdata); } // Convert the enrollment request to a JSON string public String toJson() { StringWriter stringWriter = new StringWriter(); JsonWriter jsonWriter = Json.createWriter(new PrintWriter(stringWriter)); jsonWriter.writeObject(toJsonObject()); jsonWriter.close(); return stringWriter.toString(); } // Convert the enrollment request to a JSON object public JsonObject toJsonObject() { JsonObjectBuilder factory = Json.createObjectBuilder(); if (nym != null) { JsonObjectBuilder factory2 = Json.createObjectBuilder(); factory2.add("x", Base64.getEncoder().encodeToString(IdemixUtils.bigToBytes(nym.getX()))); factory2.add("y", Base64.getEncoder().encodeToString(IdemixUtils.bigToBytes(nym.getY()))); factory.add("nym", factory2.build()); } if (issuerNonce != null) { String b64encoded = Base64.getEncoder().encodeToString(IdemixUtils.bigToBytes(issuerNonce)); factory.add("issuer_nonce", b64encoded); } if (proofC != null) { factory.add("proof_c", Base64.getEncoder().encodeToString(IdemixUtils.bigToBytes(proofC))); } if (proofS != null) { factory.add("proof_s", Base64.getEncoder().encodeToString(IdemixUtils.bigToBytes(proofS))); } return factory.build(); } }
{ "pile_set_name": "Github" }
Baseline images originally generated on a Mac Mini Model Name: Mac mini Model Identifier: Macmini4,1 Processor Name: Intel Core 2 Duo Chipset Model: NVIDIA GeForce 320M These images were originally copied over wholesale from base-MacPro-fixed, which seemed to match up against the Mac Mini-generated images just fine.
{ "pile_set_name": "Github" }
//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ // // Purpose: // // $NoKeywords: $ //============================================================================= #ifndef MATCHMAKINGTYPES_H #define MATCHMAKINGTYPES_H #ifdef _WIN32 #pragma once #endif #ifdef POSIX #ifndef _snprintf #define _snprintf snprintf #endif #endif #include <stdio.h> #include <string.h> // // Max size (in bytes of UTF-8 data, not in characters) of server fields, including null terminator. // WARNING: These cannot be changed easily, without breaking clients using old interfaces. // const int k_cbMaxGameServerGameDir = 32; const int k_cbMaxGameServerMapName = 32; const int k_cbMaxGameServerGameDescription = 64; const int k_cbMaxGameServerName = 64; const int k_cbMaxGameServerTags = 128; const int k_cbMaxGameServerGameData = 2048; struct MatchMakingKeyValuePair_t { MatchMakingKeyValuePair_t() { m_szKey[0] = m_szValue[0] = 0; } MatchMakingKeyValuePair_t( const char *pchKey, const char *pchValue ) { strncpy( m_szKey, pchKey, sizeof(m_szKey) ); // this is a public header, use basic c library string funcs only! m_szKey[ sizeof( m_szKey ) - 1 ] = '\0'; strncpy( m_szValue, pchValue, sizeof(m_szValue) ); m_szValue[ sizeof( m_szValue ) - 1 ] = '\0'; } char m_szKey[ 256 ]; char m_szValue[ 256 ]; }; enum EMatchMakingServerResponse { eServerResponded = 0, eServerFailedToRespond, eNoServersListedOnMasterServer // for the Internet query type, returned in response callback if no servers of this type match }; // servernetadr_t is all the addressing info the serverbrowser needs to know about a game server, // namely: its IP, its connection port, and its query port. class servernetadr_t { public: void Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort ); #ifdef NETADR_H netadr_t GetIPAndQueryPort(); #endif // Access the query port. uint16 GetQueryPort() const; void SetQueryPort( uint16 usPort ); // Access the connection port. uint16 GetConnectionPort() const; void SetConnectionPort( uint16 usPort ); // Access the IP uint32 GetIP() const; void SetIP( uint32 ); // This gets the 'a.b.c.d:port' string with the connection port (instead of the query port). const char *GetConnectionAddressString() const; const char *GetQueryAddressString() const; // Comparison operators and functions. bool operator<(const servernetadr_t &netadr) const; void operator=( const servernetadr_t &that ) { m_usConnectionPort = that.m_usConnectionPort; m_usQueryPort = that.m_usQueryPort; m_unIP = that.m_unIP; } private: const char *ToString( uint32 unIP, uint16 usPort ) const; uint16 m_usConnectionPort; // (in HOST byte order) uint16 m_usQueryPort; uint32 m_unIP; }; inline void servernetadr_t::Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort ) { m_unIP = ip; m_usQueryPort = usQueryPort; m_usConnectionPort = usConnectionPort; } #ifdef NETADR_H inline netadr_t servernetadr_t::GetIPAndQueryPort() { return netadr_t( m_unIP, m_usQueryPort ); } #endif inline uint16 servernetadr_t::GetQueryPort() const { return m_usQueryPort; } inline void servernetadr_t::SetQueryPort( uint16 usPort ) { m_usQueryPort = usPort; } inline uint16 servernetadr_t::GetConnectionPort() const { return m_usConnectionPort; } inline void servernetadr_t::SetConnectionPort( uint16 usPort ) { m_usConnectionPort = usPort; } inline uint32 servernetadr_t::GetIP() const { return m_unIP; } inline void servernetadr_t::SetIP( uint32 unIP ) { m_unIP = unIP; } inline const char *servernetadr_t::ToString( uint32 unIP, uint16 usPort ) const { static char s[4][64]; static int nBuf = 0; unsigned char *ipByte = (unsigned char *)&unIP; _snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort ); const char *pchRet = s[nBuf]; ++nBuf; nBuf %= ( (sizeof(s)/sizeof(s[0])) ); return pchRet; } inline const char* servernetadr_t::GetConnectionAddressString() const { return ToString( m_unIP, m_usConnectionPort ); } inline const char* servernetadr_t::GetQueryAddressString() const { return ToString( m_unIP, m_usQueryPort ); } inline bool servernetadr_t::operator<(const servernetadr_t &netadr) const { return ( m_unIP < netadr.m_unIP ) || ( m_unIP == netadr.m_unIP && m_usQueryPort < netadr.m_usQueryPort ); } //----------------------------------------------------------------------------- // Purpose: Data describing a single server //----------------------------------------------------------------------------- class gameserveritem_t { public: gameserveritem_t(); const char* GetName() const; void SetName( const char *pName ); public: servernetadr_t m_NetAdr; ///< IP/Query Port/Connection Port for this server int m_nPing; ///< current ping time in milliseconds bool m_bHadSuccessfulResponse; ///< server has responded successfully in the past bool m_bDoNotRefresh; ///< server is marked as not responding and should no longer be refreshed char m_szGameDir[k_cbMaxGameServerGameDir]; ///< current game directory char m_szMap[k_cbMaxGameServerMapName]; ///< current map char m_szGameDescription[k_cbMaxGameServerGameDescription]; ///< game description uint32 m_nAppID; ///< Steam App ID of this server int m_nPlayers; ///< total number of players currently on the server. INCLUDES BOTS!! int m_nMaxPlayers; ///< Maximum players that can join this server int m_nBotPlayers; ///< Number of bots (i.e simulated players) on this server bool m_bPassword; ///< true if this server needs a password to join bool m_bSecure; ///< Is this server protected by VAC uint32 m_ulTimeLastPlayed; ///< time (in unix time) when this server was last played on (for favorite/history servers) int m_nServerVersion; ///< server version as reported to Steam private: /// Game server name char m_szServerName[k_cbMaxGameServerName]; // For data added after SteamMatchMaking001 add it here public: /// the tags this server exposes char m_szGameTags[k_cbMaxGameServerTags]; /// steamID of the game server - invalid if it's doesn't have one (old server, or not connected to Steam) CSteamID m_steamID; }; inline gameserveritem_t::gameserveritem_t() { m_szGameDir[0] = m_szMap[0] = m_szGameDescription[0] = m_szServerName[0] = 0; m_bHadSuccessfulResponse = m_bDoNotRefresh = m_bPassword = m_bSecure = false; m_nPing = m_nAppID = m_nPlayers = m_nMaxPlayers = m_nBotPlayers = m_ulTimeLastPlayed = m_nServerVersion = 0; m_szGameTags[0] = 0; } inline const char* gameserveritem_t::GetName() const { // Use the IP address as the name if nothing is set yet. if ( m_szServerName[0] == 0 ) return m_NetAdr.GetConnectionAddressString(); else return m_szServerName; } inline void gameserveritem_t::SetName( const char *pName ) { strncpy( m_szServerName, pName, sizeof( m_szServerName ) ); m_szServerName[ sizeof( m_szServerName ) - 1 ] = '\0'; } #endif // MATCHMAKINGTYPES_H
{ "pile_set_name": "Github" }
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: e7e7db9a2688ed540af9819c456ba2e2, type: 3} m_Name: DefaultTheme m_EditorClassIdentifier: definitions: - ClassName: ScaleOffsetColorTheme AssemblyQualifiedName: Microsoft.MixedReality.Toolkit.UI.ScaleOffsetColorTheme, Microsoft.MixedReality.Toolkit.SDK stateProperties: - name: Scale type: 6 values: - Name: Default String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 1, y: 1, z: 1} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0, g: 0, b: 0, a: 0} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} - Name: Focus String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 1.06, y: 1.06, z: 1.06} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0, g: 0, b: 0, a: 0} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} - Name: Press String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 1, y: 1, z: 1} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0, g: 0, b: 0, a: 0} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} - Name: Disabled String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 1, y: 1, z: 1} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0, g: 0, b: 0, a: 0} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} startValue: Name: String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 0, y: 0, z: 0} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0, g: 0, b: 0, a: 0} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} defaultValue: Name: String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 0, y: 0, z: 0} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0, g: 0, b: 0, a: 0} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} targetShader: {fileID: 0} shaderPropertyName: PropId: 0 ShaderOptions: [] ShaderOptionNames: [] ShaderName: - name: Offset type: 6 values: - Name: Default String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 0, y: 0, z: 0} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0, g: 0, b: 0, a: 0} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} - Name: Focus String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 0, y: 0, z: 0} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0, g: 0, b: 0, a: 0} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} - Name: Press String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 0, y: 0, z: 0.01} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0, g: 0, b: 0, a: 0} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} - Name: Disabled String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 0, y: 0, z: 0} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0, g: 0, b: 0, a: 0} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} startValue: Name: String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 0, y: 0, z: 0} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0, g: 0, b: 0, a: 0} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} defaultValue: Name: String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 0, y: 0, z: 0} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0, g: 0, b: 0, a: 0} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} targetShader: {fileID: 0} shaderPropertyName: PropId: 0 ShaderOptions: [] ShaderOptionNames: [] ShaderName: - name: Color type: 2 values: - Name: Default String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 0, y: 0, z: 0} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0.1764706, g: 0.49019608, b: 0.6039216, a: 1} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} - Name: Focus String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 0, y: 0, z: 0} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0, g: 0.654902, b: 0.8039216, a: 1} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} - Name: Press String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 0, y: 0, z: 0} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0.09019608, g: 0.4392157, b: 0.5647059, a: 1} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} - Name: Disabled String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 0, y: 0, z: 0} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0.39215687, g: 0.39215687, b: 0.39215687, a: 1} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} startValue: Name: String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 0, y: 0, z: 0} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0, g: 0, b: 0, a: 0} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} defaultValue: Name: String: Bool: 0 Int: 0 Float: 0 Texture: {fileID: 0} Material: {fileID: 0} Shader: {fileID: 0} GameObject: {fileID: 0} Vector2: {x: 0, y: 0} Vector3: {x: 0, y: 0, z: 0} Vector4: {x: 0, y: 0, z: 0, w: 0} Color: {r: 0, g: 0, b: 0, a: 0} Quaternion: {x: 0, y: 0, z: 0, w: 0} AudioClip: {fileID: 0} Animation: {fileID: 0} targetShader: {fileID: 4800000, guid: 5bdea20278144b11916d77503ba1467a, type: 3} shaderPropertyName: _Color PropId: 0 ShaderOptions: [] ShaderOptionNames: - _Color - _SpecColor - _RimColor - _EmissionColor ShaderName: customProperties: [] easing: Enabled: 1 Curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 value: 0 inSlope: 2 outSlope: 2 tangentMode: 0 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 1 value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 0 LerpTime: 0.3 states: {fileID: 11400000, guid: 5eac1712038236e4b8ffdb3893804fe1, type: 2}
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.5.0) on Thu May 15 17:17:31 EDT 2008 --> <TITLE> ReplicationManagerStartPolicy (Oracle - Berkeley DB Java API) </TITLE> <META NAME="keywords" CONTENT="com.sleepycat.db.ReplicationManagerStartPolicy class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../style.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="ReplicationManagerStartPolicy (Oracle - Berkeley DB Java API)"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ReplicationManagerStartPolicy.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&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> <b>Berkeley DB</b><br><font size="-1"> version 4.7.25</font></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../com/sleepycat/db/ReplicationManagerSiteInfo.html" title="class in com.sleepycat.db"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../com/sleepycat/db/ReplicationManagerStats.html" title="class in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?com/sleepycat/db/ReplicationManagerStartPolicy.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ReplicationManagerStartPolicy.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> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.sleepycat.db</FONT> <BR> Class ReplicationManagerStartPolicy</H2> <PRE> <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.sleepycat.db.ReplicationManagerStartPolicy</B> </PRE> <HR> <DL> <DT><PRE>public final class <B>ReplicationManagerStartPolicy</B><DT>extends <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></DL> </PRE> <P> This class provides definitions of the various start policies thatcan be specified when starting a replication client using the<A HREF="../../../com/sleepycat/db/Environment.html#replicationManagerStart(int, com.sleepycat.db.ReplicationManagerStartPolicy)"><CODE>Environment.replicationManagerStart</CODE></A> call. <P> <P> <HR> <P> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Field Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../com/sleepycat/db/ReplicationManagerStartPolicy.html" title="class in com.sleepycat.db">ReplicationManagerStartPolicy</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/db/ReplicationManagerStartPolicy.html#REP_CLIENT">REP_CLIENT</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start as a client site, and do not call for an election.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../com/sleepycat/db/ReplicationManagerStartPolicy.html" title="class in com.sleepycat.db">ReplicationManagerStartPolicy</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/db/ReplicationManagerStartPolicy.html#REP_ELECTION">REP_ELECTION</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start as a client, and call for an election if no master is found.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../com/sleepycat/db/ReplicationManagerStartPolicy.html" title="class in com.sleepycat.db">ReplicationManagerStartPolicy</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/db/ReplicationManagerStartPolicy.html#REP_MASTER">REP_MASTER</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start as a master site, and do not call for an election.</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/db/ReplicationManagerStartPolicy.html#toString()">toString</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ============ FIELD DETAIL =========== --> <A NAME="field_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Field Detail</B></FONT></TH> </TR> </TABLE> <A NAME="REP_MASTER"><!-- --></A><H3> REP_MASTER</H3> <PRE> public static final <A HREF="../../../com/sleepycat/db/ReplicationManagerStartPolicy.html" title="class in com.sleepycat.db">ReplicationManagerStartPolicy</A> <B>REP_MASTER</B></PRE> <DL> <DD>Start as a master site, and do not call for an election. Note there must never be more than a single master in any replication group, and only one site should ever be started with the DB_REP_MASTER flag specified. <P> <DL> </DL> </DL> <HR> <A NAME="REP_CLIENT"><!-- --></A><H3> REP_CLIENT</H3> <PRE> public static final <A HREF="../../../com/sleepycat/db/ReplicationManagerStartPolicy.html" title="class in com.sleepycat.db">ReplicationManagerStartPolicy</A> <B>REP_CLIENT</B></PRE> <DL> <DD>Start as a client site, and do not call for an election. <P> <DL> </DL> </DL> <HR> <A NAME="REP_ELECTION"><!-- --></A><H3> REP_ELECTION</H3> <PRE> public static final <A HREF="../../../com/sleepycat/db/ReplicationManagerStartPolicy.html" title="class in com.sleepycat.db">ReplicationManagerStartPolicy</A> <B>REP_ELECTION</B></PRE> <DL> <DD>Start as a client, and call for an election if no master is found. <P> <DL> </DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="toString()"><!-- --></A><H3> toString</H3> <PRE> public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>toString</B>()</PRE> <DL> <DD> <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ReplicationManagerStartPolicy.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&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> <b>Berkeley DB</b><br><font size="-1"> version 4.7.25</font></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../com/sleepycat/db/ReplicationManagerSiteInfo.html" title="class in com.sleepycat.db"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../com/sleepycat/db/ReplicationManagerStats.html" title="class in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?com/sleepycat/db/ReplicationManagerStartPolicy.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ReplicationManagerStartPolicy.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> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> </BODY> </HTML>
{ "pile_set_name": "Github" }
#ifndef STAN_MATH_PRIM_PROB_STUDENT_T_CCDF_LOG_HPP #define STAN_MATH_PRIM_PROB_STUDENT_T_CCDF_LOG_HPP #include <stan/math/prim/meta.hpp> #include <stan/math/prim/prob/student_t_lccdf.hpp> namespace stan { namespace math { /** \ingroup prob_dists * @deprecated use <code>student_t_lccdf</code> */ template <typename T_y, typename T_dof, typename T_loc, typename T_scale> return_type_t<T_y, T_dof, T_loc, T_scale> student_t_ccdf_log( const T_y& y, const T_dof& nu, const T_loc& mu, const T_scale& sigma) { return student_t_lccdf<T_y, T_dof, T_loc, T_scale>(y, nu, mu, sigma); } } // namespace math } // namespace stan #endif
{ "pile_set_name": "Github" }
theme: jekyll-theme-cayman google_analytics: UA-154547557-1
{ "pile_set_name": "Github" }
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "net/http" "strings" "sync" ) var ( commonBuildOnce sync.Once commonLowerHeader map[string]string // Go-Canonical-Case -> lower-case commonCanonHeader map[string]string // lower-case -> Go-Canonical-Case ) func buildCommonHeaderMapsOnce() { commonBuildOnce.Do(buildCommonHeaderMaps) } func buildCommonHeaderMaps() { common := []string{ "accept", "accept-charset", "accept-encoding", "accept-language", "accept-ranges", "age", "access-control-allow-origin", "allow", "authorization", "cache-control", "content-disposition", "content-encoding", "content-language", "content-length", "content-location", "content-range", "content-type", "cookie", "date", "etag", "expect", "expires", "from", "host", "if-match", "if-modified-since", "if-none-match", "if-unmodified-since", "last-modified", "link", "location", "max-forwards", "proxy-authenticate", "proxy-authorization", "range", "referer", "refresh", "retry-after", "server", "set-cookie", "strict-transport-security", "trailer", "transfer-encoding", "user-agent", "vary", "via", "www-authenticate", } commonLowerHeader = make(map[string]string, len(common)) commonCanonHeader = make(map[string]string, len(common)) for _, v := range common { chk := http.CanonicalHeaderKey(v) commonLowerHeader[chk] = v commonCanonHeader[v] = chk } } func lowerHeader(v string) string { buildCommonHeaderMapsOnce() if s, ok := commonLowerHeader[v]; ok { return s } return strings.ToLower(v) }
{ "pile_set_name": "Github" }
.shapeshift_awaiting { padding-top: 30px; margin-bottom: 25px; ._subtitle { font-size: $subtitle_font_size; line-height: 1.2; text-align: center; color: #999; margin-bottom: 15px; @include breakpoint(portrait) { font-size: $subtitle_font_size--portrait; margin-bottom: 30px; } } ._loading_icon { width: 25px; height: 25px; display: block; margin: 0 auto; animation: infinite-spinning 1s linear infinite; @include breakpoint(portrait) { width: 35px; height: 35px; } .svg-refresh { fill: darken($grey, 20%); } } }
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 16875ebd39366059092b0cd97de961cd DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
####################### Distance (``distance``) ####################### The following example demonstrates how to compute distances between all data instances from Iris: >>> from Orange.data import Table >>> from Orange.distance import Euclidean >>> iris = Table('iris') >>> dist_matrix = Euclidean(iris) >>> # Distance between first two examples >>> dist_matrix.X[0, 1] 0.53851648 To compute distances between all columns, we set `axis` to 0. >>> Euclidean(iris, axis=0) DistMatrix([[ 0. , 36.17927584, 28.9542743 , 57.1913455 ], [ 36.17927584, 0. , 25.73382987, 25.81259383], [ 28.9542743 , 25.73382987, 0. , 33.87270287], [ 57.1913455 , 25.81259383, 33.87270287, 0. ]]) Finally, we can compute distances between all pairs of rows from two tables. >>> iris1 = iris[:100] >>> iris2 = iris[100:] >>> dist = Euclidean(iris_even, iris_odd) >>> dist.shape (75, 100) Most metrics can be fit on training data to normalize values and handle missing data. We do so by calling the constructor without arguments or with parameters, such as `normalize`, and then pass the data to method `fit`. >>> dist_model = Euclidean(normalize=True).fit(iris1) >>> dist = dist_model(iris2[:3]) >>> dist DistMatrix([[ 0. , 1.36778277, 1.11352233], [ 1.36778277, 0. , 1.57810546], [ 1.11352233, 1.57810546, 0. ]]) The above distances are computed on the first three rows of `iris2`, normalized by means and variances computed from `iris1`. Here are five closest neighbors of `iris2[0]` from `iris1`:: >>> dist0 = dist_model(iris1, iris2[0]) >>> neigh_idx = np.argsort(dist0.flatten())[:5] >>> iris1[neigh_idx] [[5.900, 3.200, 4.800, 1.800 | Iris-versicolor], [6.700, 3.000, 5.000, 1.700 | Iris-versicolor], [6.300, 3.300, 4.700, 1.600 | Iris-versicolor], [6.000, 3.400, 4.500, 1.600 | Iris-versicolor], [6.400, 3.200, 4.500, 1.500 | Iris-versicolor] ] All distances share a common interface. .. autoclass:: Orange.distance.Distance Handling discrete and missing data ================================== Discrete data is handled as appropriate for the particular distance. For instance, the Euclidean distance treats a pair of values as either the same or different, contributing either 0 or 1 to the squared sum of differences. In other cases -- particularly in Jaccard and cosine distance, discrete values are treated as zero or non-zero. Missing data is not simply imputed. We assume that values of each variable are distributed by some unknown distribution and compute - without assuming a particular distribution shape - the expected distance. For instance, for the Euclidean distance it turns out that the expected squared distance between a known and a missing value equals the square of the known value's distance from the mean of the missing variable, plus its variance. Supported distances =================== Euclidean distance ------------------ For numeric values, the Euclidean distance is the square root of sums of squares of pairs of values from rows or columns. For discrete values, 1 is added if the two values are different. To put all numeric data on the same scale, and in particular when working with a mixture of numeric and discrete data, it is recommended to enable normalization by adding `normalize=True` to the constructor. With this, numeric values are normalized by subtracting their mean and divided by deviation multiplied by the square root of two. The mean and deviation are computed on the training data, if the `fit` method is used. When computing distances between two tables and without explicitly calling `fit`, means and variances are computed from the first table only. Means and variances are always computed from columns, disregarding the axis over which we compute the distances, since columns represent variables and hence come from a certain distribution. As described above, the expected squared difference between a known and a missing value equals the squared difference between the known value and the mean, plus the variance. The squared difference between two unknown values equals twice the variance. For normalized data, the difference between a known and missing numeric value equals the square of the known value + 0.5. The difference between two missing values is 1. For discrete data, the expected difference between a known and a missing value equals the probablity that the two values are different, which is 1 minus the probability of the known value. If both values are missing, the probability of them being different equals 1 minus the sum of squares of all probabilities (also known as the Gini index). Manhattan distance ------------------ Manhattan distance is the sum of absolute pairwise distances. Normalization and treatment of missing values is similar as in the Euclidean distance, except that medians and median absolute distance from the median (MAD) are used instead of means and deviations. For discrete values, distances are again 0 or 1, hence the Manhattan distance for discrete columns is the same as the Euclidean. Cosine distance --------------- Cosine similarity is the dot product divided by the product of lengths (where the length is the square of dot product of a row/column with itself). Cosine distance is computed by subtracting the similarity from one. In calculation of dot products, missing values are replaced by means. In calculation of lengths, the contribution of a missing value equals the square of the mean plus the variance. (The difference comes from the fact that in the former case the missing values are independent.) Non-zero discrete values are replaced by 1. This introduces the notion of a "base value", which is the first in the list of possible values. In most cases, this will only make sense for indicator (i.e. two-valued, boolean attributes). Cosine distance does not support any column-wise normalization. Jaccard distance ---------------- Jaccard similarity between two sets is defined as the size of their intersection divided by the size of the union. Jaccard distance is computed by subtracting the similarity from one. In Orange, attribute values are interpreted as membership indicator. In row-wise distances, columns are interpreted as sets, and non-zero values in a row (including negative values of numeric features) indicate that the row belongs to the particular sets. In column-wise distances, rows are sets and values indicate the sets to which the column belongs. For missing values, relative frequencies from the training data are used as probabilities for belonging to a set. That is, for row-wise distances, we compute the relative frequency of non-zero values in each column, and vice-versa for column-wise distances. For intersection (union) of sets, we then add the probability of belonging to both (any of) the two sets instead of adding a 0 or 1. SpearmanR, AbsoluteSpearmanR, PearsonR, AbsolutePearsonR -------------------------------------------------------- The four correlation-based distance measure equal (1 - the correlation coefficient) / 2. For `AbsoluteSpearmanR` and `AbsolutePearsonR`, the absolute value of the coefficient is used. These distances do not handle missing or discrete values. Mahalanobis distance -------------------- Mahalanobis distance is similar to cosine distance, except that the data is projected into the PCA space. Mahalanobis distance does not handle missing or discrete values.
{ "pile_set_name": "Github" }
#!/bin/bash #################### # Notes # #################### # # Created 20200625 by Nathan Worster # # This script assumes that the macOS Beta installer is already staged in the Applications folder, and will convert that .app installer into a bootable .dmg. # To download the latest macOS beta, go to https://developer.apple.com/download/ or, if applicable, https://appleseed.apple.com/. # The .dmg file will be placed in ~/Downloads. # This script must be run with sudo using "sudo bash <filename>" if run outside of an MDM. # #################### # Variables # #################### dmgName=$"macOS11BigSurBeta" #################### # Script # #################### cd ~/Downloads # Create and mount sparse volume: hdiutil create -o install_container -size 15G -layout SPUD -fs HFS+J -type SPARSE hdiutil attach install_container.sparseimage -noverify -mountpoint /Volumes/install_build # Copy contents of installer .app into mounted volume: /Applications/Install\ macOS\ Beta.app/Contents/Resources/createinstallmedia --nointeraction --volume /Volumes/install_build # Detach the completed image: hdiutil detach -force /Volumes/Install\ macOS\ Beta # Convert and rename the image: hdiutil convert install_container.sparseimage -format UDZO -o $dmgName.dmg # Cleanup rm install_container.sparseimage exit 0
{ "pile_set_name": "Github" }
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. #include "brpc/policy/couchbase_authenticator.h" #include "butil/base64.h" #include "butil/iobuf.h" #include "butil/string_printf.h" #include "butil/sys_byteorder.h" #include "brpc/policy/memcache_binary_header.h" namespace brpc { namespace policy { namespace { constexpr char kPlainAuthCommand[] = "PLAIN"; constexpr char kPadding[1] = {'\0'}; } // namespace // To get the couchbase authentication protocol, see // https://developer.couchbase.com/documentation/server/3.x/developer/dev-guide-3.0/sasl.html int CouchbaseAuthenticator::GenerateCredential(std::string* auth_str) const { const brpc::policy::MemcacheRequestHeader header = { brpc::policy::MC_MAGIC_REQUEST, brpc::policy::MC_BINARY_SASL_AUTH, butil::HostToNet16(sizeof(kPlainAuthCommand) - 1), 0, 0, 0, butil::HostToNet32(sizeof(kPlainAuthCommand) + 1 + bucket_name_.length() * 2 + bucket_password_.length()), 0, 0}; auth_str->clear(); auth_str->append(reinterpret_cast<const char*>(&header), sizeof(header)); auth_str->append(kPlainAuthCommand, sizeof(kPlainAuthCommand) - 1); auth_str->append(bucket_name_); auth_str->append(kPadding, sizeof(kPadding)); auth_str->append(bucket_name_); auth_str->append(kPadding, sizeof(kPadding)); auth_str->append(bucket_password_); return 0; } } // namespace policy } // namespace brpc
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.IO; using System.Text; namespace Dotmim.Sync.Serialization { internal class DmBinaryReader : BinaryReader { public DmBinaryReader(Stream ms) : base(ms) { } public DmBinaryReader(Stream ms, Encoding encoding) : base(ms, encoding) { } public object Read(Type valueType) { if (valueType == typeof(bool)) return base.ReadBoolean(); else if (valueType == typeof(Byte)) return base.ReadByte(); else if (valueType == typeof(Char)) return base.ReadChar(); else if (valueType == typeof(Double)) return base.ReadDouble(); else if (valueType == typeof(Single)) return base.ReadSingle(); else if (valueType == typeof(Int32)) return base.ReadInt32(); else if (valueType == typeof(Int64)) return base.ReadInt64(); else if (valueType == typeof(Int16)) return base.ReadInt16(); else if (valueType == typeof(UInt32)) return base.ReadUInt32(); else if (valueType == typeof(UInt64)) return base.ReadUInt64(); else if (valueType == typeof(UInt16)) return base.ReadUInt16(); else if (valueType == typeof(Byte[])) return this.ReadBytes(); else if (valueType == typeof(DateTime)) return this.ReadDatetime(); else if (valueType == typeof(DateTimeOffset)) return this.ReadDatetimeOffset(); else if (valueType == typeof(Decimal)) return base.ReadDecimal(); else if (valueType == typeof(Guid)) return this.ReadGuid(); else if (valueType == typeof(String)) return this.ReadString(); else if (valueType == typeof(SByte)) return base.ReadSByte(); else if (valueType == typeof(TimeSpan)) return this.ReadTimeSpan(); return null; } public override string ReadString() { var res = base.ReadString(); return res; } /// <summary> /// Read bytes with the length availabe in the first byte /// </summary> public Byte[] ReadBytes() { var byteLength = this.Read7BitEncodedInt(); if (byteLength < 0) throw new ArgumentOutOfRangeException("Byte length not serialized, can't read this byte array"); if (byteLength == 0) return new Byte[0]; return base.ReadBytes(byteLength); } public TimeSpan ReadTimeSpan() { long value = base.ReadInt64(); return TimeSpan.FromTicks(value); } public Guid ReadGuid() { Byte[] buffer = new Byte[16]; var arrayByte = base.ReadBytes(buffer.Length); return new Guid(arrayByte); } public DateTime ReadDatetime() { long value = base.ReadInt64(); return new DateTime(value); } public DateTimeOffset ReadDatetimeOffset() { long value = base.ReadInt64(); long offset = base.ReadInt64(); return new DateTimeOffset(value, TimeSpan.FromTicks(offset)); } } }
{ "pile_set_name": "Github" }
every once in a while a movie comes along that completely redefines the genre : with dramas , it was citizen kane , with arthouse it was pulp fiction , and with comedy it was , well , that jim carrey guy ( okay , so he's not a movie , but he did have a huge influence on the genre . not to mention an expensive one . ) sometimes a movie even combines them all into a big , sprawling motion picture event , as did forrest gump four years ago . with action films , it was aliens , whic was released to much hype seven years after it's equally-innovative parent , alien ( 1979 ) . directed and written by james cameron ( t2 : judgement day , the abyss , true lies ) , the authority on action films , it was a masterful encore to his sci-fi thriller the terminator ( 1984 ) . while the original alien film was a dark , enclosed horror film that featured one alien slowly massacering a horrified crew , james cameron took the big-budget action film with aliens , which featured multiple aliens doing basically the same thing , although on a much-larger scale . and boy , did he take that route ! i'd say at about 165 mph or so . . . the film opens 57 years after the original , with lt . ripley ( weaver ) being found in her ship in a cryogenic state by a salvage vessel . if you'll recall , at the end of alien ripley , the only surviving member , cryogenically " hibernated " herself after expelling the rogue alien from her ship . unfortunately , she thought she'd only be out for a couple of weeks . . . once she's returned to earth , ripley is quickly interrogated by " the company " , who quickly dismiss her and her stories as lunacy . in truth , they believe her , as they soon approach ripley with an offer to travel with some marines to a new colony planet as an " alien advisor " . it seems that the colony planet was a once-breeding ground for the nasty aliens , and now all communication with the planet has been lost . . . it doesn't exactly take a genius to guess what happens next : ripley agrees , and before you can say " big mistake " , she and the half dozen marines , plus the slimy corporate guy ( reiser ) , who has more than it looks like up under his sleeve , are off to the colony . when they arrive , they find the planet in ruins . only one survivor is found , a little girl , newt , who confirms that , yes , the aliens were here and that she only managed to survive by hidding in the ventilation system . and soon enough , the marines come under attack from the aliens . . . what happens for the next hour and a half or so is what completely sets this movie apart from any other standard alien sci-fi movie : the action scenes . cameron directs them so skillfully , and so suspensefully , that you're literally ringing your hands by the time the finale rolls around . which features , in my opinion , the best fight scene ever recorded on film , as ripley straps herself into a huge robot and battles the nasty queen alien to the death . many people will tell you that this film , while being a great action film , has no real drama and is all cliches . well , they would be wrong , my friends . if this film had no " drama " , then why was sigourney weaver nominated for best actress at the 1987 academy awards ? that's right , best actress . you know that any action film that has an oscar nomination attached to it for something other than technical stuff like editing and f/x has got to be good . in short , aliens combines all the right elements ( great action and f/x , drama , a good plot , good dialogue , and great villains ) into what could arguably be called the best action film of all time . then again , maybe not . movies rise and fall from glory and , sad to say , aliens was wrestled from it's throne of best action movie by another cameron film , t2 : judgement day , in 1991 . so who will be the next king ? well , let's wait until december 19th and see yet another james cameron film-the highest budgeted film of all time-titanic to make that decision . i can't wait .
{ "pile_set_name": "Github" }
noinst_DATA = pygimp.html EXTRA_DIST = \ pygimp.sgml \ pygimp.html \ structure-of-plugin.html \ procedural-database.html \ gimp-module-procedures.html \ gimp-objects.html \ support-modules.html \ end-note.html printed: pygimp.ps pygimp.pdf #clean: # rm -f *.html pygimp.ps pygimp.pdf pygimp.ps: pygimp.sgml db2ps $(srcdir)/pygimp.sgml pygimp.pdf: pygimp.sgml db2pdf $(srcdir)/pygimp.sgml pygimp.html: pygimp.sgml cd $(srcdir) && db2html --nochunks pygimp.sgml cd $(srcdir) && mv pygimp/*.html . rm -rf $(srcdir)/pygimp .PHONY: printed #clean
{ "pile_set_name": "Github" }
namespace NLayerApp.Domain.MainBoundedContext.ERPModule.Aggregates.CountryAgg { using NLayerApp.Domain.Seedwork; /// <summary> /// Base contract for country repository /// </summary> public interface ICountryRepository :IRepository<Country> { } }
{ "pile_set_name": "Github" }
create table parent ( a int primary key auto_increment, b int not null, c int not null, unique(b) using hash, index(c)) engine = ndb; create table child ( a int primary key auto_increment, b int not null, c int not null, unique(b) using hash, index(c)) engine = ndb; create table blobchild ( a int primary key auto_increment, b int not null, c int not null, d text, unique(b) using hash, index(c)) engine = ndb; alter table blobchild add constraint fkbad foreign key(a) references parent (a) on delete cascade on update restrict; ERROR HY000: Cannot add foreign key constraint show warnings; Level Code Message Warning 1296 Got error 21034 'Create foreign key failed - child table has Blob or Text column and on-delete-cascade is not allowed' from NDB Error 1215 Cannot add foreign key constraint alter table child add constraint fkname foreign key (a) references parent (a) on delete cascade on update restrict; insert into parent values (1,1,1),(2,2,2); insert into child values (1,1,1),(2,2,2); insert into child values (3,3,3); ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `fkname` FOREIGN KEY (`a`) REFERENCES `parent` (`a`) ON DELETE CASCADE ON UPDATE RESTRICT) begin; delete from parent where a = 1; select * from child order by 1,2,3; a b c 2 2 2 commit; delete from child; delete from parent; alter table child drop foreign key fkname; alter table blobchild add constraint fkbad foreign key(b) references parent (a) on delete cascade on update restrict; ERROR HY000: Cannot add foreign key constraint show warnings; Level Code Message Warning 1296 Got error 21034 'Create foreign key failed - child table has Blob or Text column and on-delete-cascade is not allowed' from NDB Error 1215 Cannot add foreign key constraint alter table child add constraint fkname foreign key (b) references parent (a) on delete cascade on update restrict; insert into parent values (1,1,1),(2,2,2); insert into child values (1,1,1),(2,2,2); insert into child values (3,3,3); ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `fkname` FOREIGN KEY (`b`) REFERENCES `parent` (`a`) ON DELETE CASCADE ON UPDATE RESTRICT) update child set b = 3 where a = 1; ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `fkname` FOREIGN KEY (`b`) REFERENCES `parent` (`a`) ON DELETE CASCADE ON UPDATE RESTRICT) begin; delete from parent where a = 1; select * from child order by 1,2,3; a b c 2 2 2 commit; delete from child; delete from parent; alter table child drop foreign key fkname; alter table blobchild add constraint fkbad foreign key(a) references parent (b) on delete cascade on update restrict; ERROR HY000: Cannot add foreign key constraint show warnings; Level Code Message Warning 1296 Got error 21034 'Create foreign key failed - child table has Blob or Text column and on-delete-cascade is not allowed' from NDB Error 1215 Cannot add foreign key constraint alter table child add constraint fkname foreign key (a) references parent (b) on delete cascade on update restrict; insert into parent values (1,1,1),(2,2,2); insert into child values (1,1,1),(2,2,2); insert into child values (3,3,3); ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `fkname` FOREIGN KEY (`a`) REFERENCES `parent` (`b`) ON DELETE CASCADE ON UPDATE RESTRICT) update parent set b = 3 where a = 1; ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `fkname` FOREIGN KEY (`a`) REFERENCES `parent` (`b`) ON DELETE CASCADE ON UPDATE RESTRICT) begin; delete from parent where a = 1; select * from child order by 1,2,3; a b c 2 2 2 commit; delete from child; delete from parent; alter table child drop foreign key fkname; alter table blobchild add constraint fkbad foreign key(b) references parent (b) on delete cascade on update restrict; ERROR HY000: Cannot add foreign key constraint show warnings; Level Code Message Warning 1296 Got error 21034 'Create foreign key failed - child table has Blob or Text column and on-delete-cascade is not allowed' from NDB Error 1215 Cannot add foreign key constraint alter table child add constraint fkname foreign key (b) references parent (b) on delete cascade on update restrict; insert into parent values (1,1,1),(2,2,2); insert into child values (1,1,1),(2,2,2); update child set b = 3 where a = 1; ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `fkname` FOREIGN KEY (`b`) REFERENCES `parent` (`b`) ON DELETE CASCADE ON UPDATE RESTRICT) insert into child values (3,3,3); ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `fkname` FOREIGN KEY (`b`) REFERENCES `parent` (`b`) ON DELETE CASCADE ON UPDATE RESTRICT) update parent set b = 3 where a = 1; ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `fkname` FOREIGN KEY (`b`) REFERENCES `parent` (`b`) ON DELETE CASCADE ON UPDATE RESTRICT) begin; delete from parent where a = 1; select * from child order by 1,2,3; a b c 2 2 2 commit; delete from child; delete from parent; alter table child drop foreign key fkname; alter table blobchild add constraint fkbad foreign key(c) references parent (a) on delete cascade on update restrict; ERROR HY000: Cannot add foreign key constraint show warnings; Level Code Message Warning 1296 Got error 21034 'Create foreign key failed - child table has Blob or Text column and on-delete-cascade is not allowed' from NDB Error 1215 Cannot add foreign key constraint alter table child add constraint fkname foreign key (c) references parent (a) on delete cascade on update restrict; insert into parent values (1,1,1),(2,2,2); insert into child values (1,1,1),(2,2,2); update child set c = 3 where a = 1; ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `fkname` FOREIGN KEY (`c`) REFERENCES `parent` (`a`) ON DELETE CASCADE ON UPDATE RESTRICT) insert into child values (3,3,3); ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `fkname` FOREIGN KEY (`c`) REFERENCES `parent` (`a`) ON DELETE CASCADE ON UPDATE RESTRICT) begin; delete from parent where a = 1; select * from child order by 1,2,3; a b c 2 2 2 commit; delete from child; delete from parent; alter table child drop foreign key fkname; alter table blobchild add constraint fkbad foreign key(c) references parent (b) on delete cascade on update restrict; ERROR HY000: Cannot add foreign key constraint show warnings; Level Code Message Warning 1296 Got error 21034 'Create foreign key failed - child table has Blob or Text column and on-delete-cascade is not allowed' from NDB Error 1215 Cannot add foreign key constraint alter table child add constraint fkname foreign key (c) references parent (b) on delete cascade on update restrict; insert into parent values (1,1,1),(2,2,2); insert into child values (1,1,1),(2,2,2); update child set c = 3 where a = 1; ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `fkname` FOREIGN KEY (`c`) REFERENCES `parent` (`b`) ON DELETE CASCADE ON UPDATE RESTRICT) insert into child values (3,3,3); ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `fkname` FOREIGN KEY (`c`) REFERENCES `parent` (`b`) ON DELETE CASCADE ON UPDATE RESTRICT) update parent set b = 3 where a = 1; ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `fkname` FOREIGN KEY (`c`) REFERENCES `parent` (`b`) ON DELETE CASCADE ON UPDATE RESTRICT) begin; delete from parent where a = 1; select * from child order by 1,2,3; a b c 2 2 2 commit; insert into parent values (1,1,1); insert into child values (1,1,1); insert into child select a+2,a+2,1+(a % 2) from child; insert into child select a+4,a+4,1+(a % 2) from child; insert into child select a+8,a+8,1+(a % 2) from child; insert into child select a+16,a+16,1+(a % 2) from child; insert into child select a+32,a+32,1+(a % 2) from child; insert into child select a+64,a+64,1+(a % 2) from child; select c, count(*) from child group by c order by 1,2; c count(*) 1 64 2 64 delete from parent where a = 1; select c, count(*) from child group by c order by 1,2; c count(*) 2 64 delete from parent where a = 2; delete from child; delete from parent; alter table child drop foreign key fkname; drop table parent, child, blobchild;
{ "pile_set_name": "Github" }
/* Driver for ST stb6000 DVBS Silicon tuner Copyright (C) 2008 Igor M. Liplianin (liplianin@me.by) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __DVB_STB6000_H__ #define __DVB_STB6000_H__ #include <linux/i2c.h> #include "dvb_frontend.h" /** * Attach a stb6000 tuner to the supplied frontend structure. * * @param fe Frontend to attach to. * @param addr i2c address of the tuner. * @param i2c i2c adapter to use. * @return FE pointer on success, NULL on failure. */ #if defined(CONFIG_DVB_STB6000) || (defined(CONFIG_DVB_STB6000_MODULE) \ && defined(MODULE)) extern struct dvb_frontend *stb6000_attach(struct dvb_frontend *fe, int addr, struct i2c_adapter *i2c); #else static inline struct dvb_frontend *stb6000_attach(struct dvb_frontend *fe, int addr, struct i2c_adapter *i2c) { printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); return NULL; } #endif /* CONFIG_DVB_STB6000 */ #endif /* __DVB_STB6000_H__ */
{ "pile_set_name": "Github" }
What is a "Bootloader" ? What is "stk500" ? What is "avrdude" ? What symptoms indicate a bootloading problem? What are common causes of bootloading problems? What information can I collect to debug a bootloading problem? Can my Arduino have the bootloader damaged? How can I tell if my bootloader is damaged? Why else would I want to upload a new bootloader? Can I replace or upload a new bootloader with no additional equipment? How can I replace or upload a new bootloader?
{ "pile_set_name": "Github" }
#!/bin/bash # assumes this script (config.sh) lives in "${JAMR_HOME}/scripts/" # TODO: check that we live in the scripts directory. export JAMR_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." > /dev/null && pwd )" export CLASSPATH=".:${JAMR_HOME}/target/scala-2.10/jamr-assembly-0.1-SNAPSHOT.jar" # change the following enviroment variables for your configuration export CDEC="${JAMR_HOME}/tools/cdec" export ILLINOIS_NER="${JAMR_HOME}/tools/IllinoisNerExtended" export ILLINOIS_NER_JAR="${ILLINOIS_NER}/target/IllinoisNerExtended-2.7.jar" export WNHOME="${JAMR_HOME}/tools/WordNet-3.0" export SCALA="${JAMR_HOME}/tools/scala-2.11.2/bin/scala" export SMATCH="${JAMR_HOME}/scripts/smatch_v1_0/smatch_modified.py" export TRAIN_FILE="${JAMR_HOME}/data/LDC2013E117_DEFT_Phase_1_AMR_Annotation_R3/data/deft-amr-release-r3-proxy.train" export DEV_FILE="${JAMR_HOME}/data/LDC2013E117_DEFT_Phase_1_AMR_Annotation_R3/data/deft-amr-release-r3-proxy.dev" export TEST_FILE="${JAMR_HOME}/data/LDC2013E117_DEFT_Phase_1_AMR_Annotation_R3/data/deft-amr-release-r3-proxy.test" export MODEL_DIR="${JAMR_HOME}/models/ACL2014_LDC2013E117" # ideally keep this the same as the config_SOMETHING.sh # The options specified below will override any options specified in the scripts # CONCEPT_ID_TRAINING_OPTIONS and RELATION_ID_TRAINING_OPTIONS will override PARSER_OPTIONS export STAGE1_FEATURES="bias,length,fromNERTagger,conceptGivenPhrase" export PARSER_OPTIONS=" --stage1-features ${STAGE1_FEATURES} --stage2-decoder LR --stage2-features rootConcept,rootDependencyPathv1,bias,typeBias,self,fragHead,edgeCount,distance,logDistance,posPathv3,dependencyPathv4,conceptBigram --stage2-labelset ${JAMR_HOME}/resources/labelset-r3 --output-format AMR,nodes,edges,root --ignore-parser-errors --print-stack-trace-on-errors " export CONCEPT_EXTRACT_OPTIONS=" --stage1-features ${STAGE1_FEATURES} " export CONCEPT_ID_TRAINING_OPTIONS=" --training-optimizer Adagrad --training-passes 10 --training-stepsize 1 " export RELATION_ID_TRAINING_OPTIONS=" --training-optimizer Adagrad --training-passes 10 --training-save-interval 1 "
{ "pile_set_name": "Github" }
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" #import "NSCoding-Protocol.h" #import "NSCopying-Protocol.h" @interface WebUndefined : NSObject <NSCoding, NSCopying> { } + (id)undefined; + (id)allocWithZone:(struct _NSZone *)arg1; - (void)dealloc; - (id)autorelease; - (unsigned int)retainCount; - (oneway void)release; - (id)retain; - (id)copyWithZone:(struct _NSZone *)arg1; - (void)encodeWithCoder:(id)arg1; - (id)initWithCoder:(id)arg1; - (id)description; @end
{ "pile_set_name": "Github" }
"====================================================================== | | ReadBuffer and WriteBuffer classes | | ======================================================================" "====================================================================== | | Copyright 1999, 2000, 2001, 2002, 2003, 2007, 2008, 2009 Free Software Foundation, Inc. | Written by Paolo Bonzini. | | This file is part of GNU Smalltalk. | | GNU Smalltalk is free software; you can redistribute it and/or modify it | under the terms of the GNU General Public License as published by the Free | Software Foundation; either version 2, or (at your option) any later version. | | GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | details. | | You should have received a copy of the GNU General Public License along with | GNU Smalltalk; see the file COPYING. If not, write to the Free Software | Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ======================================================================" WriteStream subclass: WriteBuffer [ | flushBlock | <category: 'Examples-Useful tools'> <comment: ' I''m a WriteStream that, instead of growing the collection, evaluates an user defined block and starts over with the same collection.'> flush [ "Evaluate the flushing block and reset the stream" <category: 'buffer handling'> flushBlock notNil ifTrue: [flushBlock value: collection value: ptr - 1]. ptr := 1 ] close [ <category: 'buffer handling'> super close. flushBlock := nil ] flushBlock: block [ "Set which block will be used to flush the buffer. The block will be evaluated with a collection and an Integer n as parameters, and will have to write the first n elements of the collection." <category: 'buffer handling'> flushBlock := block ] growCollection [ <category: 'private'> self flush ] growCollectionTo: n [ <category: 'private'> self shouldNotImplement ] isFull [ <category: 'testing'> ^self position = self collection size ] next: n putAll: aCollection startingAt: pos [ "Put n characters or bytes of aCollection, starting at the pos-th, in the collection buffer." <category: 'accessing-writing'> | end written amount | ptr = collection size ifTrue: [self growCollection]. written := 0. [end := collection size min: ptr + (n - written - 1). end >= ptr ifTrue: [collection replaceFrom: ptr to: end with: aCollection startingAt: pos + written. written := written + (end - ptr + 1). ptr := end + 1]. written < n] whileTrue: [self growCollection]. ] ] ReadStream subclass: ReadBuffer [ | fillBlock | <category: 'Examples-Useful tools'> <comment: ' I''m a ReadStream that, when the end of the stream is reached, evaluates an user defined block to try to get some more data.'> ReadBuffer class >> on: aCollection [ "Answer a Stream that uses aCollection as a buffer. You should ensure that the fillBlock is set before the first operation, because the buffer will report that the data has ended until you set the fillBlock." <category: 'instance creation'> ^(super on: aCollection) setToEnd; yourself "Force a buffer load soon" ] close [ <category: 'buffer handling'> super close. fillBlock := nil ] atEnd [ "Answer whether the data stream has ended." <category: 'buffer handling'> self basicAtEnd ifFalse: [^false]. fillBlock isNil ifTrue: [^true]. endPtr := fillBlock value: collection value: collection size. ptr := 1. ^self basicAtEnd ] pastEnd [ "Try to fill the buffer if the data stream has ended." <category: 'buffer handling'> self atEnd ifTrue: [^super pastEnd]. "Else, the buffer has been filled." ^self next ] bufferContents [ "Answer the data that is in the buffer, and empty it." <category: 'buffer handling'> | contents | self basicAtEnd ifTrue: [^self species new: 0]. contents := self collection copyFrom: ptr to: endPtr. endPtr := ptr - 1. "Empty the buffer" ^contents ] availableBytes [ "Answer how many bytes are available in the buffer." <category: 'buffer handling'> self isEmpty ifTrue: [ self fill ]. ^endPtr + 1 - ptr ] nextAvailable: anInteger putAllOn: aStream [ "Copy the next anInteger objects from the receiver to aStream. Return the number of items stored." <category: 'accessing-reading'> self isEmpty ifTrue: [ self fill ]. ^super nextAvailable: anInteger putAllOn: aStream ] nextAvailable: anInteger into: aCollection startingAt: pos [ "Place the next anInteger objects from the receiver into aCollection, starting at position pos. Return the number of items stored." <category: 'accessing-reading'> self isEmpty ifTrue: [ self fill ]. ^super nextAvailable: anInteger into: aCollection startingAt: pos ] fill [ "Fill the buffer with more data if it is empty, and answer true if the fill block was able to read more data." <category: 'buffer handling'> ^self atEnd not ] fillBlock: block [ "Set the block that fills the buffer. It receives a collection and the number of bytes to fill in it, and must return the number of bytes actually read" <category: 'buffer handling'> fillBlock := block ] isEmpty [ "Answer whether the next input operation will force a buffer fill" <category: 'buffer handling'> ^self basicAtEnd ] isFull [ "Answer whether the buffer has been just filled" <category: 'buffer handling'> ^self notEmpty and: [self position = 0] ] notEmpty [ "Check whether the next input operation will force a buffer fill and answer true if it will not." <category: 'buffer handling'> ^self basicAtEnd not ] upToEnd [ "Returns a collection of the same type that the stream accesses, up to but not including the object anObject. Returns the entire rest of the stream's contents if anObject is not present." <category: 'accessing-reading'> | ws | ws := String new writeStream. [self nextAvailablePutAllOn: ws. self atEnd] whileFalse. ^ws contents ] upTo: anObject [ "Returns a collection of the same type that the stream accesses, up to but not including the object anObject. Returns the entire rest of the stream's contents if anObject is not present." <category: 'accessing-reading'> | result r ws | self atEnd ifTrue: [^collection copyEmpty: 0]. r := collection indexOf: anObject startingAt: ptr ifAbsent: [0]. r = 0 ifFalse: [result := self next: r - ptr. self next. ^result]. ws := String new writeStream. [self nextAvailablePutAllOn: ws. self atEnd ifTrue: [^ws contents]. r := collection indexOf: anObject startingAt: ptr ifAbsent: [0]. r = 0] whileTrue. self next: r - 1 putAllOn: ws; next. ^ws contents ] ]
{ "pile_set_name": "Github" }
sha256:e7f673b2c5ccd047c48b4eecd5452b2db1b9454daf07b23068ad239f98afaa29
{ "pile_set_name": "Github" }
blast=2.7.1 bbmap=38.56 bmtagger=3.101 bwa=0.7.17 cd-hit=4.6.8 cd-hit-auxtools=4.6.8 diamond=0.9.10 kmc=3.1.1rc1 gatk=3.8 kaiju=1.6.3_yesimon krakenuniq=0.5.7_yesimon krona=2.7.1 last=876 lbzip2=2.5 lz4-c=1.9.1 fastqc=0.11.7 gap2seq=3.1.1a2 mafft=7.402 mummer4=4.0.0beta2 muscle=3.8.1551 mvicuna=1.0 novoalign=3.07.00 parallel=20160622 picard-slim=2.21.1 pigz=2.4 prinseq=0.20.4 samtools=1.9 snpeff=4.3.1t spades=3.12.0 tbl2asn=25.6 trimmomatic=0.38 trinity=date.2011_11_26 unzip=6.0 vphaser2=2.0 r-base=3.5.1 # Python packages below arrow=0.12.1 bedtools=2.28.0 biopython=1.72 future==0.16.0 matplotlib=2.2.4 pysam=0.15.0 pybedtools=0.7.10 PyYAML=5.1
{ "pile_set_name": "Github" }
## @file # Shell application that will test the crypto library. # # UEFI Application for the Validation of cryptography library (based on OpenSSL 0.9.8zb). # # Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at # http://opensource.org/licenses/bsd-license.php # # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # ## [Defines] INF_VERSION = 0x00010005 BASE_NAME = Cryptest MODULE_UNI_FILE = Cryptest.uni FILE_GUID = fb925ac7-192a-9567-8586-7c6f5f710607 MODULE_TYPE = UEFI_APPLICATION VERSION_STRING = 1.0 ENTRY_POINT = CryptestMain # # The following information is for reference only and not required by the build tools. # # VALID_ARCHITECTURES = IA32 X64 IPF # [Sources] Cryptest.h Cryptest.c HashVerify.c HmacVerify.c BlockCipherVerify.c RsaVerify.c RsaVerify2.c AuthenticodeVerify.c TSVerify.c DhVerify.c RandVerify.c [Packages] MdePkg/MdePkg.dec CryptoPkg/CryptoPkg.dec [LibraryClasses] UefiApplicationEntryPoint UefiLib BaseLib UefiBootServicesTableLib BaseMemoryLib DebugLib MemoryAllocationLib BaseCryptLib [UserExtensions.TianoCore."ExtraFiles"] CryptestExtra.uni
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (c) 2017, WSO2 Inc. (http://wso2.com) All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <groupId>org.wso2.am</groupId> <artifactId>org.wso2.carbon.apimgt.samples</artifactId> <version>3.2.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>org.wso2.carbon.apimgt.samples.sample2</artifactId> <name>Sample Two</name> <dependencies> <dependency> <groupId>org.wso2.am</groupId> <artifactId>org.wso2.carbon.apimgt.samples.utils</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>CreateSampleTwoRawData</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> <executions> <execution> <id>make-assembly</id> <!-- this is used for inheritance merges --> <phase>package</phase> <!-- bind to the packaging phase --> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
{ "pile_set_name": "Github" }
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 2012-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at * https://oss.oracle.com/licenses/CDDL+GPL-1.1 * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" * exception as provided by Oracle in the GPL Version 2 section of the License * file that accompanied this code. * * Modifications: * If applicable, add the following below the License Header, with the fields * enclosed by brackets [] replaced by your own identifying information: * "Portions Copyright [year] [name of copyright owner]" * * Contributor(s): * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */ package org.glassfish.contextpropagation.weblogic.workarea; import java.io.IOException; /** * <code>WorkContext</code> is a marker interface used for marshaling * and unmarshaling user data in a <code>WorkArea</code>. The * interfaces {@link WorkContextOutput} and * {@link WorkContextInput} will only allow primtive types and * objects implementing <code>WorkContext</code> to be marshaled. This * limits the type surface area that needs to be dealt with by * underlying protocols. <code>WorkContext</code> is analogous to * {@link java.io.Externalizable} but with some restrictions on the types * that can be marshaled. Advanced {@link java.io.Externalizable} * features, such as enveloping, are not supported - implementations * should provide their own versioning scheme if * necessary. <code>WorkContext</code> implementations must provide a * public no-arg constructor. * */ public interface WorkContext { /** * Writes the implementation of <code>WorkContext</code> to the * {@link WorkContextOutput} data stream. */ public void writeContext(WorkContextOutput out) throws IOException; /** * Reads the implementation of <code>WorkContext</code> from the * {@link WorkContextInput} data stream. */ public void readContext(WorkContextInput in) throws IOException; }
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.usergrid.chop.webapp.service.util; import org.apache.commons.lang.StringUtils; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class JsonUtil { private static Logger LOG = LoggerFactory.getLogger(JsonUtil.class); public static void put(JSONObject json, String key, Object value) { try { json.put(key, value); } catch (JSONException e) { LOG.error("Exception while put to json: ", e); } } public static void inc(JSONObject json, String key, long incValue) { try { long value = json.optLong(key) + incValue; json.put(key, value); } catch (JSONException e) { LOG.error("Exception while inc json: ", e); } } public static void copy(JSONObject src, JSONObject dest) { Iterator iter = src.keys(); try { while (iter.hasNext()) { String key = (String) iter.next(); put(dest, key, src.get(key)); } } catch (JSONException e) { LOG.error("Exception while copying json: ", e); } } public static void copy(JSONObject src, JSONObject dest, String key) { Object value = src.opt(key); if (value != null) { put(dest, key, value); } } public static List<String> getKeys(JSONObject json) { ArrayList<String> keys = new ArrayList<String>(); Iterator iter = json.keys(); while (iter.hasNext()) { keys.add((String) iter.next()); } return keys; } public static JSONArray parseArray(String s) { JSONArray arr = new JSONArray(); if (StringUtils.isEmpty(s)) { return arr; } try { arr = new JSONArray(s); } catch (JSONException e) { LOG.error("Exception while parsing string to json: ", e); } return arr; } public static JSONObject get(JSONArray arr, int i) { JSONObject json = null; try { json = arr.getJSONObject(i); } catch (JSONException e) { LOG.error("Exception while getting element from json array: ", e); } return json; } }
{ "pile_set_name": "Github" }
--TEST-- Ensure extends does trigger autoload. --FILE-- <?php spl_autoload_register(function ($name) { echo "In autoload: "; var_dump($name); }); class C extends UndefBase { } ?> --EXPECTF-- In autoload: string(9) "UndefBase" Fatal error: Class 'UndefBase' not found in %s on line %d
{ "pile_set_name": "Github" }
/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/certificates/v1beta1" cache "k8s.io/client-go/tools/cache" ) // CertificateSigningRequestInformer provides access to a shared informer and lister for // CertificateSigningRequests. type CertificateSigningRequestInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.CertificateSigningRequestLister } type certificateSigningRequestInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredCertificateSigningRequestInformer(client, resyncPeriod, indexers, nil) } // NewFilteredCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CertificatesV1beta1().CertificateSigningRequests().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CertificatesV1beta1().CertificateSigningRequests().Watch(context.TODO(), options) }, }, &certificatesv1beta1.CertificateSigningRequest{}, resyncPeriod, indexers, ) } func (f *certificateSigningRequestInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredCertificateSigningRequestInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *certificateSigningRequestInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&certificatesv1beta1.CertificateSigningRequest{}, f.defaultInformer) } func (f *certificateSigningRequestInformer) Lister() v1beta1.CertificateSigningRequestLister { return v1beta1.NewCertificateSigningRequestLister(f.Informer().GetIndexer()) }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> </root>
{ "pile_set_name": "Github" }
<?xml version="1.0" standalone="no" ?> <!DOCTYPE pov SYSTEM "/usr/share/cgc-docs/replay.dtd"> <pov> <cbid>CROMU_00001</cbid> <replay> <read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read> <read echo="ascii"><delim> </delim><match><data>: </data></match></read> <write echo="ascii"><data>1\n</data></write> <read echo="ascii"><delim> </delim><match><data>username: </data></match></read> <write echo="ascii"><data>yshaoqo\n</data></write> <read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read> <read echo="ascii"><delim> </delim><match><data>: </data></match></read> <write echo="ascii"><data>1\n</data></write> <read echo="ascii"><delim> </delim><match><data>username: </data></match></read> <write echo="ascii"><data>ohrrxpw\n</data></write> <read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read> <read echo="ascii"><delim> </delim><match><data>: </data></match></read> <write echo="ascii"><data>1\n</data></write> <read echo="ascii"><delim> </delim><match><data>username: </data></match></read> <write echo="ascii"><data>woazhso\n</data></write> <read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read> <read echo="ascii"><delim> </delim><match><data>: </data></match></read> <write echo="ascii"><data>1\n</data></write> <read echo="ascii"><delim> </delim><match><data>username: </data></match></read> <write echo="ascii"><data>zgupmmy\n</data></write> <read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read> <read echo="ascii"><delim> </delim><match><data>: </data></match></read> <write echo="ascii"><data>2\n</data></write> <read echo="ascii"><delim> </delim><match><data>username: </data></match></read> <write echo="ascii"><data>zgupmmy\n</data></write> <read echo="ascii"><delim>\n</delim><match><data>Login Success\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read> <read echo="ascii"><delim> </delim><match><data>: </data></match></read> <write echo="ascii"><data>1\n</data></write> <read echo="ascii"><delim> </delim><match><data>To: </data></match></read> <write echo="ascii"><data>yshaoqo\n</data></write> <read echo="ascii"><delim> </delim><match><data>Message: </data></match></read> <write echo="ascii"><data>ybpvlsuzujxkanw\n</data></write> <read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read> <read echo="ascii"><delim> </delim><match><data>: </data></match></read> <write echo="ascii"><data>1\n</data></write> <read echo="ascii"><delim> </delim><match><data>To: </data></match></read> <write echo="ascii"><data>ohrrxpw\n</data></write> <read echo="ascii"><delim> </delim><match><data>Message: </data></match></read> <write echo="ascii"><data>psriwspzznul\n</data></write> <read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read> <read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read> <read echo="ascii"><delim> </delim><match><data>: </data></match></read> <write echo="ascii"><data>6\n</data></write> <read echo="ascii"><delim>\n</delim><match><data>Exiting...\n</data></match></read> </replay> </pov>
{ "pile_set_name": "Github" }
using System.Reflection; using System.Runtime.InteropServices; using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Microsoft.WindowsAzure.MobileServices.UWP.Test")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: ComVisible(false)] [assembly: NeutralResourcesLanguageAttribute("en-US")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "pile_set_name": "Github" }
version https://git-lfs.github.com/spec/v1 oid sha256:978f83a273b46a3f5bb0bcfaf856af51b9bd2ad4d2d8f443b48d408e9392aad9 size 3059
{ "pile_set_name": "Github" }
#ifndef FSA_HPP #define FSA_HPP #include "fsa.h" //------------------- state ---------------- // the copy constructer; state::state(const state& s) { this->name = s.name; //this->links = s.links; this->weights = s.weights; this->h_dict = s.h_dict; this->next_word_index_set = s.next_word_index_set; this->next_word_index_set_ready = s.next_word_index_set_ready; } state::state(std::string name){ this->name = name; //this->links = new std::unordered_map<std::string,std::unordered_set<state> >(); //this->weights = new std::unordered_map<std::string,std::unordered_map<state,float> >(); this->weights = new std::unordered_map<int,std::unordered_map<std::string, std::pair<state*,float> > >(); this->h_dict = NULL; this->next_word_index_set = new std::unordered_set<int>(); this->next_word_index_set_ready = false; } void state::process_link(state* d, int word, float weight, bool log_space){ if (!log_space) { weight = std::log(weight); } if (weights->count(word) == 0){ (*weights)[word] = std::unordered_map<std::string, std::pair<state*,float>>(); } (*weights)[word][d->name] = std::pair<state*,float>(d,weight); } std::string state::toString() const{ std::string s = ""; s += "Name: "+this->name+ "\n"; s += "Links:\n"; for (auto const &i:*(this->weights)){ s += "--"+ std::to_string(i.first)+"--> "; for (auto const &j:i.second){ state* st = j.second.first; float weight = j.second.second; s += fmt::format("{} {}",st->name,weight); } s += '\n'; } return s; } std::unordered_set<int>* state::next_word_indicies() { if (this->next_word_index_set_ready){ return this->next_word_index_set; } else { for (auto & item : *(this->weights)){ int index = item.first; if (index == -1){ // word = *e* for (auto & state_item : item.second){ //item.second is unordered_map<string, pair<state*,float> >; std::unordered_set<int>* temp_word_index_set = state_item.second.first->next_word_indicies(); for (int index : *(temp_word_index_set)) { this->next_word_index_set->insert(index); } } } else { this->next_word_index_set->insert(index); } } this->h_dict = (int *)malloc(this->next_word_index_set->size()*1*sizeof(int)); //std::cout<<this->name << " " << this->h_dict << " " << this->next_word_index_set->size() <<"\n"; //CUDA_ERROR_WRAPPER(cudaHostRegister(this->h_dict, this->next_word_index_set->size()*1*sizeof(int), cudaHostRegisterPortable),"h_dict in fsa.hpp pinned memeory error!"); int i = 0; for (int index : *(this->next_word_index_set)){ this->h_dict[i] = index; i+=1; } this->next_word_index_set_ready = true; return this->next_word_index_set; } } void state::next_states(std::vector<sw>& results, int word ){ // the fsa should not contains a *e* circle. int c = this->weights->count(word); if (c > 0){ for (auto const &s: this->weights->at(word)){ sw temp_sw; temp_sw.s = s.second.first; temp_sw.weight = s.second.second; results.push_back(temp_sw); } } int empty = -1; c = this->weights->count(empty); if (c > 0){ for (auto const & s: this->weights->at(empty)){ float weight = s.second.second; state* st = s.second.first; std::vector<sw> sws; st->next_states(sws, word); for (auto const & i:sws){ sw temp_sw; temp_sw.s = i.s; temp_sw.weight = weight + i.weight; results.push_back(temp_sw); } } } } //------------------- fsa ---------------- void fsa::print_fsa(){ std::cout << "start_state: " << this->start_state->name<<"\n" ; std::cout << "end_state: " << this->end_state->name<<"\n" ; std::cout << "\n"; for (auto const & s: this->states){ std::cout << s.second->toString() <<'\n'; } std::cout << this->index2words[0] <<"\n"; std::cout << this->index2words[1] <<"\n"; std::cout << this->index2words[2] <<"\n"; std::vector<sw> sws; this->next_states(this->start_state,1,sws); for (auto const & s:sws){ std::cout << "have: " << s.s->name << "\n"; } } void fsa::load_fsa(){ //Timer timer; //timer.start("load_fsa"); std::chrono::time_point<std::chrono::system_clock> total_start= std::chrono::system_clock::now(); //for (0 (1 "k")) boost::regex e3q{"\\(([^ ]+)[ ]+\\(([^ ]+)[ ]+\"(.*)\"[ ]*\\)\\)"}; //for (0 (1 sf)) boost::regex e3{"\\(([^ ]+)[ ]+\\(([^ ]+)[ ]+([^ ]+)[ ]*\\)\\)"}; //for (0 (1 "k" 0.5)) boost::regex e4q{"\\(([^ ]+)[ ]+\\(([^ ]+)[ ]+\"(.*)\"[ ]+([^ ]+)[ ]*\\)\\)"}; //for (0 (1 sf 0.5)) boost::regex e4{"\\(([^ ]+)[ ]+\\(([^ ]+)[ ]+([^ ]+)[ ]+([^ ]+)[ ]*\\)\\)"}; boost::regex regexes[4] = {e3q,e3,e4q,e4}; std::ifstream fin(this->fsa_filename.c_str()); std::string line; // for the end_state; std::getline(fin, line); states[line] = new state(line); end_state = states[line]; bool is_first_link = true; int i =0 ; int num_links = 0; float default_weight = 1.0; if (this->log_space){ default_weight = 0.0; } /* timer.start("read_lines"); std::vector<std::string> lines; while (std::getline(fin,line)) { //std::cout<<line<<'\n'; if (line.size() == 0 || line[0] == '#'){ continue; } lines.push_back(line); } timer.end("read_lines"); timer.start("read_lines2"); //fourObj ** fours = (fourObj **)malloc(lines.size()*sizeof(fourObj*)); #pragma omp parallel for for (int i =0 ;i < lines.size(); i ++ ){ fourObj fo; line = lines[i]; boost::smatch sm; bool matched = false; for (int r=0;r<1;r++){ boost::regex e = regexes[r]; if (boost::regex_search(line,sm,e)){ //std::cout<<sm.size()<<" "<<r<<"\n"; fo.s = sm[1]; fo.d = sm[2]; std::string word = sm[3]; int word_index = 2; if (word == "*e*"){ word_index = -1; } else { if (this->word2index.count(word)>0){ word_index = this->word2index[word]; } else { std::cout<<fmt::format("{} is not in vocab set\n",word); } } fo.word_index = word_index; matched = true; float weight = default_weight; if (sm.size() == 5){ weight = std::stof(sm[4]); } if (sm.size() == 6) { weight = std::stof(sm[5]); } fo.weight = weight; //break; } } if (!matched) { std::cerr<<"Error in Line "<<i+2<<": "<<line<<"\n"; //throw("Error when parsing fsa."); } //fours[i] = fo; } */ /* for (int i = 0 ; i < lines.size(); i ++){ delete fours[i]; } free(fours); timer.end("read_lines2"); */ while (std::getline(fin,line)) { std::string s; std::string d; std::string word; int word_index = -2; float weight = default_weight; //std::cout<<line<<'\n'; if (line.size() == 0 || line[0] == '#'){ continue; } //timer.start("regex_match"); boost::smatch sm; bool matched = false; for (int r=0;r<4;r++){ boost::regex e = regexes[r]; if (boost::regex_search(line,sm,e)){ //std::cout<<sm.size()<<" "<<r<<"\n"; s = sm[1]; d = sm[2]; word = sm[3]; matched = true; if (sm.size() == 5){ weight = std::stof(sm[4]); } if (sm.size() == 6) { weight = std::stof(sm[5]); } break; } } if (!matched){ std::cerr<<"Error in Line "<<i+2<<": "<<line<<"\n"; throw("Error when parsing fsa."); } //timer.end("regex_match"); //std::cout<<s<<" "<<d<<" "<<word<<" "<<weight<<"\n"; if (states.count(s) == 0){ states[s] = new state(s); } if (states.count(d) == 0){ states[d] = new state(d); } if (is_first_link){ // for start symbol; this->start_state = states[s]; is_first_link = false; } if (word == "*e*"){ word_index = -1; } else { if (this->word2index.count(word)>0){ word_index = this->word2index[word]; } else { std::cout<<fmt::format("{} is not in vocab set\n",word); } } //timer.start("process_link"); if (word_index != -2){ states[s]->process_link(states[d],word_index,weight,this->log_space); num_links += 1; } //timer.end("process_link"); i+=1; } if (this->states.count("<EOF>") == 0) { this->end_state->process_link(this->end_state,this->word2index["<EOF>"],default_weight, this->log_space); } std::chrono::time_point<std::chrono::system_clock> total_end=std::chrono::system_clock::now(); std::chrono::duration<double> total_dur = total_end - total_start; std::cout<<"------------------------FSA Info------------------------\n"; std::cout<<"Number of States: "<< this->states.size() <<"\n"; std::cout<<"Number of Links: "<< num_links <<"\n"; std::cout<<"Start State: "<< this->start_state->name <<"\n"; std::cout<<"End State: "<< this->end_state->name <<"\n"; std::cout<<"Loading with "<<total_dur.count()<<"s \n"; std::cout<<"--------------------------------------------------------\n"; //timer.end("load_fsa"); //timer.report(); } void fsa::convert_name_to_index(std::unordered_map<std::string,int> &dict){ for (auto const & i:dict){ //std::cout<<i.first<<" "<<i.second<<"\n"; this->index2words[i.second] = i.first; this->word2index[i.first] = i.second; //std::cout<<this->index2words.size()<<"\n"; } } void fsa::next_states(state* current_state,int index, std::vector<sw>& results){ if (this->index2words.count(index) > 0){ current_state->next_states(results, index); } } #endif
{ "pile_set_name": "Github" }
// Copyright Aleksey Gurtovoy 2000-2004 // Copyright Jaap Suter 2003 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // Preprocessed version of "boost/mpl/bitor.hpp" header // -- DO NOT modify by hand! namespace boost { namespace mpl { template< typename Tag1 , typename Tag2 > struct bitor_impl : if_c< ( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1) > BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2) ) , aux::cast2nd_impl< bitor_impl< Tag1,Tag1 >,Tag1, Tag2 > , aux::cast1st_impl< bitor_impl< Tag2,Tag2 >,Tag1, Tag2 > >::type { }; /// for Digital Mars C++/compilers with no CTPS/TTP support template<> struct bitor_impl< na,na > { template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); }; }; template< typename Tag > struct bitor_impl< na,Tag > { template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); }; }; template< typename Tag > struct bitor_impl< Tag,na > { template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); }; }; template< typename T > struct bitor_tag { typedef typename T::tag type; }; template< typename BOOST_MPL_AUX_NA_PARAM(N1) , typename BOOST_MPL_AUX_NA_PARAM(N2) , typename N3 = na, typename N4 = na, typename N5 = na > struct bitor_ : bitor_< bitor_< bitor_< bitor_< N1,N2 >, N3>, N4>, N5> { }; template< typename N1, typename N2, typename N3, typename N4 > struct bitor_< N1,N2,N3,N4,na > : bitor_< bitor_< bitor_< N1,N2 >, N3>, N4> { BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC( 5 , bitor_ , ( N1, N2, N3, N4, na ) ) }; template< typename N1, typename N2, typename N3 > struct bitor_< N1,N2,N3,na,na > : bitor_< bitor_< N1,N2 >, N3> { BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC( 5 , bitor_ , ( N1, N2, N3, na, na ) ) }; template< typename N1, typename N2 > struct bitor_< N1,N2,na,na,na > : bitor_impl< typename bitor_tag<N1>::type , typename bitor_tag<N2>::type >::template apply< N1,N2 >::type { BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC( 5 , bitor_ , ( N1, N2, na, na, na ) ) }; BOOST_MPL_AUX_NA_SPEC2(2, 5, bitor_) }} namespace boost { namespace mpl { template<> struct bitor_impl< integral_c_tag,integral_c_tag > { template< typename N1, typename N2 > struct apply : integral_c< typename aux::largest_int< typename N1::value_type , typename N2::value_type >::type , ( BOOST_MPL_AUX_VALUE_WKND(N1)::value | BOOST_MPL_AUX_VALUE_WKND(N2)::value ) > { }; }; }}
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package streaming.dsl.auth import streaming.dsl.auth.OperateType.OperateType /** * Created by allwefantasy on 11/9/2018. */ case class MLSQLTable( db: Option[String], table: Option[String], columns: Option[Set[String]], operateType: OperateType, sourceType: Option[String], tableType: TableTypeMeta) { def tableIdentifier: String = { if (db.isDefined && table.isDefined) { s"${db.get}.${table.get}" } else if (!db.isDefined && table.isDefined) { table.get } else { "" } } } object MLSQLTable { def apply(db: Option[String], table: Option[String], operateType: OperateType, sourceType: Option[String], tableType: TableTypeMeta): MLSQLTable = new MLSQLTable(db, table, None, operateType, sourceType, tableType) } case class MLSQLTableSet(tables: Seq[MLSQLTable]) case class TableTypeMeta(name: String, includes: Set[String]) case class TableAuthResult(granted: Boolean, msg: String) object TableAuthResult { def empty() = { TableAuthResult(false, "") } } object DB_DEFAULT extends Enumeration { type DB_DEFAULT = Value val MLSQL_SYSTEM = Value("mlsql_system") } object OperateType extends Enumeration { type OperateType = Value val SAVE = Value("save") val LOAD = Value("load") val DIRECT_QUERY = Value("directQuery") val CREATE = Value("create") val DROP = Value("drop") val INSERT = Value("insert") val UPDATE = Value("update") val SELECT = Value("select") val SET = Value("set") val EMPTY = Value("empty") def toList = { List(SAVE.toString, LOAD.toString, DIRECT_QUERY.toString, CREATE.toString, DROP.toString, INSERT.toString, UPDATE.toString, SELECT.toString, SET.toString, EMPTY.toString) } } object TableType { val HIVE = TableTypeMeta("hive", Set("hive")) val CUSTOME = TableTypeMeta("custom", Set("custom")) val BINLOG = TableTypeMeta("binlog", Set("binlog")) val HBASE = TableTypeMeta("hbase", Set("hbase")) val HDFS = TableTypeMeta("hdfs", Set("parquet", "binlogRate", "json", "csv", "image", "text", "xml", "excel", "libsvm", "delta", "rate", "streamParquet")) val HTTP = TableTypeMeta("http", Set("http")) val JDBC = TableTypeMeta("jdbc", Set("jdbc", "streamJDBC")) val ES = TableTypeMeta("es", Set("es")) val REDIS = TableTypeMeta("redis", Set("redis")) val KAFKA = TableTypeMeta("kafka", Set("kafka", "kafka8", "kafka9", "adHocKafka")) val SOCKET = TableTypeMeta("socket", Set("socket")) val MONGO = TableTypeMeta("mongo", Set("mongo")) val SOLR = TableTypeMeta("solr", Set("solr", "streamSolr")) val TEMP = TableTypeMeta("temp", Set("temp", "jsonStr", "script", "csvStr", "mockStream", "console", "webConsole")) val API = TableTypeMeta("api", Set("mlsqlAPI", "mlsqlConf")) val WEB = TableTypeMeta("web", Set("crawlersql")) val GRAMMAR = TableTypeMeta("grammar", Set("grammar")) val SYSTEM = TableTypeMeta("system", Set("_mlsql_", "model", "modelList", "modelParams", "modelExample", "modelExplain")) val UNKNOW = TableTypeMeta("unknow", Set("unknow")) def from(str: String) = { List(BINLOG, UNKNOW, KAFKA, SOCKET, REDIS, HIVE, HBASE, HDFS, HTTP, JDBC, ES, MONGO, SOLR, TEMP, API, WEB, GRAMMAR, SYSTEM, CUSTOME).filter(f => f.includes.contains(str)).headOption } def toIncludesList = { List(BINLOG, UNKNOW, KAFKA, SOCKET, REDIS, HIVE, HBASE, HDFS, HTTP, JDBC, ES, MONGO, SOLR, TEMP, API, WEB, GRAMMAR, SYSTEM, CUSTOME).flatMap(f => f.includes).toList } def toList = { List(BINLOG, UNKNOW, KAFKA, SOCKET, REDIS, HIVE, HBASE, HDFS, HTTP, JDBC, ES, MONGO, SOLR, TEMP, API, WEB, GRAMMAR, SYSTEM, CUSTOME).map(f => f.name) } }
{ "pile_set_name": "Github" }
package cn.micro.neural.idempotent.exception; /** * LimiterException * * @author lry */ public class IdempotentException extends RuntimeException { private static final long serialVersionUID = -8228538343786169063L; public IdempotentException(String message) { super(message); } }
{ "pile_set_name": "Github" }
# file format version FILE_VERSION = 1 LIBLOCKDEP_VERSION=$(shell make --no-print-directory -sC ../../.. kernelversion) # Makefiles suck: This macro sets a default value of $(2) for the # variable named by $(1), unless the variable has been set by # environment or command line. This is necessary for CC and AR # because make sets default values, so the simpler ?= approach # won't work as expected. define allow-override $(if $(or $(findstring environment,$(origin $(1))),\ $(findstring command line,$(origin $(1)))),,\ $(eval $(1) = $(2))) endef # Allow setting CC and AR and LD, or setting CROSS_COMPILE as a prefix. $(call allow-override,CC,$(CROSS_COMPILE)gcc) $(call allow-override,AR,$(CROSS_COMPILE)ar) $(call allow-override,LD,$(CROSS_COMPILE)ld) INSTALL = install # Use DESTDIR for installing into a different root directory. # This is useful for building a package. The program will be # installed in this directory as if it was the root directory. # Then the build tool can move it later. DESTDIR ?= DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))' prefix ?= /usr/local libdir_relative = lib libdir = $(prefix)/$(libdir_relative) bindir_relative = bin bindir = $(prefix)/$(bindir_relative) export DESTDIR DESTDIR_SQ INSTALL MAKEFLAGS += --no-print-directory include ../../scripts/Makefile.include # copy a bit from Linux kbuild ifeq ("$(origin V)", "command line") VERBOSE = $(V) endif ifndef VERBOSE VERBOSE = 0 endif ifeq ($(srctree),) srctree := $(patsubst %/,%,$(dir $(CURDIR))) srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree))) #$(info Determined 'srctree' to be $(srctree)) endif # Shell quotes libdir_SQ = $(subst ','\'',$(libdir)) bindir_SQ = $(subst ','\'',$(bindir)) LIB_IN := $(OUTPUT)liblockdep-in.o BIN_FILE = lockdep LIB_FILE = $(OUTPUT)liblockdep.a $(OUTPUT)liblockdep.so.$(LIBLOCKDEP_VERSION) CONFIG_INCLUDES = CONFIG_LIBS = CONFIG_FLAGS = OBJ = $@ N = export Q VERBOSE INCLUDES = -I. -I./uinclude -I./include -I../../include $(CONFIG_INCLUDES) # Set compile option CFLAGS if not set elsewhere CFLAGS ?= -g -DCONFIG_LOCKDEP -DCONFIG_STACKTRACE -DCONFIG_PROVE_LOCKING -DBITS_PER_LONG=__WORDSIZE -DLIBLOCKDEP_VERSION='"$(LIBLOCKDEP_VERSION)"' -rdynamic -O0 -g CFLAGS += -fPIC override CFLAGS += $(CONFIG_FLAGS) $(INCLUDES) $(PLUGIN_DIR_SQ) ifeq ($(VERBOSE),1) Q = print_shared_lib_compile = print_install = else Q = @ print_shared_lib_compile = echo ' LD '$(OBJ); print_static_lib_build = echo ' LD '$(OBJ); print_install = echo ' INSTALL '$1' to $(DESTDIR_SQ)$2'; endif all: export srctree OUTPUT CC LD CFLAGS V include $(srctree)/tools/build/Makefile.include do_compile_shared_library = \ ($(print_shared_lib_compile) \ $(CC) --shared $^ -o $@ -lpthread -ldl -Wl,-soname='"$@"';$(shell ln -sf $@ liblockdep.so)) do_build_static_lib = \ ($(print_static_lib_build) \ $(RM) $@; $(AR) rcs $@ $^) CMD_TARGETS = $(LIB_FILE) TARGETS = $(CMD_TARGETS) all: fixdep all_cmd all_cmd: $(CMD_TARGETS) $(LIB_IN): force $(Q)$(MAKE) $(build)=liblockdep liblockdep.so.$(LIBLOCKDEP_VERSION): $(LIB_IN) $(Q)$(do_compile_shared_library) liblockdep.a: $(LIB_IN) $(Q)$(do_build_static_lib) tags: force $(RM) tags find . -name '*.[ch]' | xargs ctags --extra=+f --c-kinds=+px \ --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' TAGS: force $(RM) TAGS find . -name '*.[ch]' | xargs etags \ --regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' define do_install $(print_install) \ if [ ! -d '$(DESTDIR_SQ)$2' ]; then \ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \ fi; \ $(INSTALL) $1 '$(DESTDIR_SQ)$2' endef install_lib: all_cmd $(Q)$(call do_install,$(LIB_FILE),$(libdir_SQ)) $(Q)$(call do_install,$(BIN_FILE),$(bindir_SQ)) install: install_lib clean: $(RM) *.o *~ $(TARGETS) *.a *liblockdep*.so* $(VERSION_FILES) .*.d .*.cmd $(RM) tags TAGS PHONY += force force: # Declare the contents of the .PHONY variable as phony. We keep that # information in a variable so we can use it in if_changed and friends. .PHONY: $(PHONY)
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10"> <data> <int key="IBDocument.SystemTarget">1050</int> <string key="IBDocument.SystemVersion">10F2108</string> <string key="IBDocument.InterfaceBuilderVersion">823</string> <string key="IBDocument.AppKitVersion">1038.29</string> <string key="IBDocument.HIToolboxVersion">461.00</string> <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string> <string key="NS.object.0">823</string> </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> <integer value="1"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> </object> <object class="NSMutableDictionary" key="IBDocument.Metadata"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys" id="0"> <bool key="EncodedWithXMLCoder">YES</bool> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> </object> </object> <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSCustomObject" id="1001"> <string key="NSClassName">NSObject</string> </object> <object class="NSCustomObject" id="1003"> <string key="NSClassName">FirstResponder</string> </object> <object class="NSCustomObject" id="1004"> <string key="NSClassName">NSApplication</string> </object> <object class="NSCustomView" id="1005"> <reference key="NSNextResponder"/> <int key="NSvFlags">268</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSPopUpButton" id="777100300"> <reference key="NSNextResponder" ref="1005"/> <int key="NSvFlags">268</int> <string key="NSFrame">{{98, 13}, {237, 26}}</string> <reference key="NSSuperview" ref="1005"/> <int key="NSTag">1234</int> <bool key="NSEnabled">YES</bool> <object class="NSPopUpButtonCell" key="NSCell" id="974543815"> <int key="NSCellFlags">-2076049856</int> <int key="NSCellFlags2">2048</int> <object class="NSFont" key="NSSupport" id="260980192"> <string key="NSName">LucidaGrande</string> <double key="NSSize">13</double> <int key="NSfFlags">1044</int> </object> <reference key="NSControlView" ref="777100300"/> <int key="NSButtonFlags">109199615</int> <int key="NSButtonFlags2">129</int> <string key="NSAlternateContents"/> <string key="NSKeyEquivalent"/> <int key="NSPeriodicDelay">400</int> <int key="NSPeriodicInterval">75</int> <nil key="NSMenuItem"/> <bool key="NSMenuItemRespectAlignment">YES</bool> <object class="NSMenu" key="NSMenu" id="277609328"> <string key="NSTitle">OtherViews</string> <object class="NSMutableArray" key="NSMenuItems"> <bool key="EncodedWithXMLCoder">YES</bool> </object> </object> <int key="NSSelectedIndex">-1</int> <int key="NSPreferredEdge">1</int> <bool key="NSUsesItemFromMenu">YES</bool> <bool key="NSAltersState">YES</bool> <int key="NSArrowPosition">2</int> </object> </object> <object class="NSCustomView" id="609776480"> <reference key="NSNextResponder" ref="1005"/> <int key="NSvFlags">292</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSTextField" id="389753419"> <reference key="NSNextResponder" ref="609776480"/> <int key="NSvFlags">289</int> <string key="NSFrame">{{17, 20}, {79, 17}}</string> <reference key="NSSuperview" ref="609776480"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="102144016"> <int key="NSCellFlags">68288064</int> <int key="NSCellFlags2">71304192</int> <string key="NSContents">^IDS_SAVE_PAGE_FILE_FORMAT_PROMPT_MAC</string> <reference key="NSSupport" ref="260980192"/> <reference key="NSControlView" ref="389753419"/> <object class="NSColor" key="NSBackgroundColor"> <int key="NSColorSpace">6</int> <string key="NSCatalogName">System</string> <string key="NSColorName">controlColor</string> <object class="NSColor" key="NSColor"> <int key="NSColorSpace">3</int> <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes> </object> </object> <object class="NSColor" key="NSTextColor"> <int key="NSColorSpace">6</int> <string key="NSCatalogName">System</string> <string key="NSColorName">controlTextColor</string> <object class="NSColor" key="NSColor"> <int key="NSColorSpace">3</int> <bytes key="NSWhite">MAA</bytes> </object> </object> </object> </object> </object> <string key="NSFrameSize">{99, 57}</string> <reference key="NSSuperview" ref="1005"/> <string key="NSClassName">GTMWidthBasedTweaker</string> </object> </object> <string key="NSFrameSize">{352, 57}</string> <reference key="NSSuperview"/> <string key="NSClassName">NSView</string> </object> <object class="NSCustomObject" id="247769375"> <string key="NSClassName">ChromeUILocalizer</string> </object> <object class="NSCustomObject" id="657031678"> <string key="NSClassName">GTMUILocalizerAndLayoutTweaker</string> </object> </object> <object class="IBObjectContainer" key="IBDocument.Objects"> <object class="NSMutableArray" key="connectionRecords"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">viewToSlide_</string> <reference key="source" ref="609776480"/> <reference key="destination" ref="777100300"/> </object> <int key="connectionID">12</int> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">viewToResize_</string> <reference key="source" ref="609776480"/> <reference key="destination" ref="1005"/> </object> <int key="connectionID">13</int> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">localizer_</string> <reference key="source" ref="657031678"/> <reference key="destination" ref="247769375"/> </object> <int key="connectionID">16</int> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">uiObject_</string> <reference key="source" ref="657031678"/> <reference key="destination" ref="1005"/> </object> <int key="connectionID">17</int> </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBObjectRecord"> <int key="objectID">0</int> <reference key="object" ref="0"/> <reference key="children" ref="1000"/> <nil key="parent"/> </object> <object class="IBObjectRecord"> <int key="objectID">-2</int> <reference key="object" ref="1001"/> <reference key="parent" ref="0"/> <string key="objectName">File's Owner</string> </object> <object class="IBObjectRecord"> <int key="objectID">-1</int> <reference key="object" ref="1003"/> <reference key="parent" ref="0"/> <string key="objectName">First Responder</string> </object> <object class="IBObjectRecord"> <int key="objectID">-3</int> <reference key="object" ref="1004"/> <reference key="parent" ref="0"/> <string key="objectName">Application</string> </object> <object class="IBObjectRecord"> <int key="objectID">1</int> <reference key="object" ref="1005"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="777100300"/> <reference ref="609776480"/> </object> <reference key="parent" ref="0"/> </object> <object class="IBObjectRecord"> <int key="objectID">4</int> <reference key="object" ref="777100300"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="974543815"/> </object> <reference key="parent" ref="1005"/> </object> <object class="IBObjectRecord"> <int key="objectID">5</int> <reference key="object" ref="974543815"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="277609328"/> </object> <reference key="parent" ref="777100300"/> </object> <object class="IBObjectRecord"> <int key="objectID">6</int> <reference key="object" ref="277609328"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> </object> <reference key="parent" ref="974543815"/> </object> <object class="IBObjectRecord"> <int key="objectID">10</int> <reference key="object" ref="609776480"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="389753419"/> </object> <reference key="parent" ref="1005"/> </object> <object class="IBObjectRecord"> <int key="objectID">2</int> <reference key="object" ref="389753419"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="102144016"/> </object> <reference key="parent" ref="609776480"/> </object> <object class="IBObjectRecord"> <int key="objectID">3</int> <reference key="object" ref="102144016"/> <reference key="parent" ref="389753419"/> </object> <object class="IBObjectRecord"> <int key="objectID">14</int> <reference key="object" ref="247769375"/> <reference key="parent" ref="0"/> </object> <object class="IBObjectRecord"> <int key="objectID">15</int> <reference key="object" ref="657031678"/> <reference key="parent" ref="0"/> </object> </object> </object> <object class="NSMutableDictionary" key="flattenedProperties"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>-1.IBPluginDependency</string> <string>-2.IBPluginDependency</string> <string>-3.IBPluginDependency</string> <string>1.IBEditorWindowLastContentRect</string> <string>1.IBPluginDependency</string> <string>1.WindowOrigin</string> <string>1.editorWindowContentRectSynchronizationRect</string> <string>14.IBPluginDependency</string> <string>15.IBPluginDependency</string> <string>2.IBPluginDependency</string> <string>3.IBPluginDependency</string> <string>4.IBPluginDependency</string> <string>5.IBPluginDependency</string> <string>6.IBEditorWindowLastContentRect</string> <string>6.IBPluginDependency</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>{{333, 662}, {352, 57}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>{628, 654}</string> <string>{{357, 416}, {480, 272}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>{{249, 696}, {237, 6}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> </object> </object> <object class="NSMutableDictionary" key="unlocalizedProperties"> <bool key="EncodedWithXMLCoder">YES</bool> <reference key="dict.sortedKeys" ref="0"/> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> </object> </object> <nil key="activeLocalization"/> <object class="NSMutableDictionary" key="localizations"> <bool key="EncodedWithXMLCoder">YES</bool> <reference key="dict.sortedKeys" ref="0"/> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> </object> </object> <nil key="sourceID"/> <int key="maxID">17</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBPartialClassDescription"> <string key="className">ChromeUILocalizer</string> <string key="superclassName">GTMUILocalizer</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">browser/ui/cocoa/ui_localizer.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">GTMUILocalizer</string> <string key="superclassName">NSObject</string> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>otherObjectToLocalize_</string> <string>owner_</string> <string>yetAnotherObjectToLocalize_</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>id</string> <string>id</string> <string>id</string> </object> </object> <object class="NSMutableDictionary" key="toOneOutletInfosByName"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>otherObjectToLocalize_</string> <string>owner_</string> <string>yetAnotherObjectToLocalize_</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBToOneOutletInfo"> <string key="name">otherObjectToLocalize_</string> <string key="candidateClassName">id</string> </object> <object class="IBToOneOutletInfo"> <string key="name">owner_</string> <string key="candidateClassName">id</string> </object> <object class="IBToOneOutletInfo"> <string key="name">yetAnotherObjectToLocalize_</string> <string key="candidateClassName">id</string> </object> </object> </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">../third_party/GTM/AppKit/GTMUILocalizer.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">GTMUILocalizerAndLayoutTweaker</string> <string key="superclassName">NSObject</string> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>localizerOwner_</string> <string>localizer_</string> <string>uiObject_</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>id</string> <string>GTMUILocalizer</string> <string>id</string> </object> </object> <object class="NSMutableDictionary" key="toOneOutletInfosByName"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>localizerOwner_</string> <string>localizer_</string> <string>uiObject_</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBToOneOutletInfo"> <string key="name">localizerOwner_</string> <string key="candidateClassName">id</string> </object> <object class="IBToOneOutletInfo"> <string key="name">localizer_</string> <string key="candidateClassName">GTMUILocalizer</string> </object> <object class="IBToOneOutletInfo"> <string key="name">uiObject_</string> <string key="candidateClassName">id</string> </object> </object> </object> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="686310315"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">../third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">GTMWidthBasedTweaker</string> <string key="superclassName">NSView</string> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>viewToResize_</string> <string>viewToSlideAndResize_</string> <string>viewToSlide_</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>id</string> <string>NSView</string> <string>NSView</string> </object> </object> <object class="NSMutableDictionary" key="toOneOutletInfosByName"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>viewToResize_</string> <string>viewToSlideAndResize_</string> <string>viewToSlide_</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBToOneOutletInfo"> <string key="name">viewToResize_</string> <string key="candidateClassName">id</string> </object> <object class="IBToOneOutletInfo"> <string key="name">viewToSlideAndResize_</string> <string key="candidateClassName">NSView</string> </object> <object class="IBToOneOutletInfo"> <string key="name">viewToSlide_</string> <string key="candidateClassName">NSView</string> </object> </object> </object> <reference key="sourceIdentifier" ref="686310315"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">../third_party/GTM/Foundation/GTMNSObject+KeyValueObserving.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">browser/ui/cocoa/objc_zombie.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">browser/ui/cocoa/status_bubble_mac.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">browser/ui/cocoa/view_id_util.h</string> </object> </object> </object> <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBPartialClassDescription"> <string key="className">NSActionCell</string> <string key="superclassName">NSCell</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <string key="superclassName">NSResponder</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="169255477"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSApplication.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="32566220"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="427230916"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSButton</string> <string key="superclassName">NSControl</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSButton.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSButtonCell</string> <string key="superclassName">NSActionCell</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSCell</string> <string key="superclassName">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSControl</string> <string key="superclassName">NSView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="641080286"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSControl.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSFormatter</string> <string key="superclassName">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSMenu</string> <string key="superclassName">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="333152932"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSMenu.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSMenuItemCell</string> <string key="superclassName">NSButtonCell</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSMenuItemCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AddressBook.framework/Headers/ABActions.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSAlert.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSAnimation.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <reference key="sourceIdentifier" ref="169255477"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <reference key="sourceIdentifier" ref="32566220"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSBrowser.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <reference key="sourceIdentifier" ref="427230916"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSComboBox.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSComboBoxCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <reference key="sourceIdentifier" ref="641080286"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSDatePickerCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSDragging.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSDrawer.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSImage.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <reference key="sourceIdentifier" ref="333152932"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSRuleEditor.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSSound.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSSpeechRecognizer.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSSpeechSynthesizer.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSSplitView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSTabView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSTableView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSText.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSTextStorage.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSTextView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSTokenField.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSTokenFieldCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSToolbar.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="182664326"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSWindow.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSConnection.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSError.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSMetadata.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSObject.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSPort.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSSpellServer.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSStream.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSThread.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSURL.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Print.framework/Headers/PDEPluginInterface.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">QuartzCore.framework/Headers/CIImageProvider.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">SecurityInterface.framework/Headers/SFAuthorizationView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">SecurityInterface.framework/Headers/SFCertificatePanel.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">SecurityInterface.framework/Headers/SFChooseIdentityPanel.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSPopUpButton</string> <string key="superclassName">NSButton</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSPopUpButton.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSPopUpButtonCell</string> <string key="superclassName">NSMenuItemCell</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSPopUpButtonCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSResponder</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSResponder</string> <string key="superclassName">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSResponder.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSTextField</string> <string key="superclassName">NSControl</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSTextField.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSTextFieldCell</string> <string key="superclassName">NSActionCell</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSClipView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSView</string> <string key="superclassName">NSResponder</string> <reference key="sourceIdentifier" ref="182664326"/> </object> </object> </object> <int key="IBDocument.localizationMode">0</int> <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> <integer value="1050" key="NS.object.0"/> </object> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> <integer value="1050" key="NS.object.0"/> </object> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string> <integer value="3000" key="NS.object.0"/> </object> <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> <string key="IBDocument.LastKnownRelativeProjectPath">../../chrome.xcodeproj</string> <int key="IBDocument.defaultPropertyAccessControl">3</int> </data> </archive>
{ "pile_set_name": "Github" }
#!/usr/bin/perl # Scilab ( http://www.scilab.org/ ) - This file is part of Scilab # Copyright (C) 2008 - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr> # # Copyright (C) 2012 - 2016 - Scilab Enterprises # # This file is hereby licensed under the terms of the GNU GPL v2.0, # pursuant to article 5.3.4 of the CeCILL v.2.1. # This file was originally licensed under the terms of the CeCILL v2.1, # and continues to be available under such terms. # For more information, see the COPYING file which you should have received # along with this program. use strict; use Cwd; use File::Basename; use XML::Simple; use Data::Dumper; # Current directory my $directory = getcwd(); if( dirname($0) ne '.' ) { $directory .= '/'.dirname($0); } if( dirname($0) =~ m/^\// ) { $directory = dirname($0); } # modules dir path my $sci_modules_dir = $directory; $sci_modules_dir =~ s/\/helptools\/src\/perl//g; # schema path my $rng = $sci_modules_dir.'/helptools/schema/scilab.rng'; # tmp file my $tmp = $directory.'/tmp.txt'; # log file my $log = $directory.'/log.txt'; # XML list my %xmllist; # stats my $nb_bad_file = 0; my %bad_file_list; # Initialisation du fichier de log unless( open(LOG,'> '.$log) ) { print 'The file '.$log.' doesn\'t exist or write access denied'."\n"; exit(0); } # ============================================================================== # First step : get the XML list # ============================================================================== get_xml_list($ARGV[0]); # ============================================================================== # Second step : valid each XML file # ============================================================================== my $xmllist_size = 0; foreach my $xmlfile (sort keys %xmllist) { $xmllist_size++; } my $count = 0; foreach my $xmlfile (sort keys %xmllist) { $count++; my $xmlfile_print = 'SCI/modules'.substr($xmlfile,length($sci_modules_dir)); printf('%04d/%04d - %s ',$count,$xmllist_size,$xmlfile_print); for( my $i =length($xmlfile) ; $i < 120 ; $i++ ) { print '.'; } my $nb_error = valid($xmlfile); if( $nb_error == 0) { print 'OK !'; } else { print "\t".$nb_error.' ERRORS'; } print "\n"; } # ============================================================================== # Third step : Summary # ============================================================================== print "\n\n"; $count = 0; foreach my $bad_file (sort keys %bad_file_list) { $count++; printf(" %02d",$count); print ' - '.$bad_file.' '; for( my $i =length($bad_file) ; $i < 100 ; $i++ ) { print '.'; } print $bad_file_list{$bad_file}." ERRORS\n"; } # ============================================================================== # get_module_list # ============================================================================== sub get_module_list { my %list; unless( chdir($sci_modules_dir) ) { print 'The directory '.$sci_modules_dir.' doesn\'t exist or read access denied'."\n"; del_tmp_file(); exit(0); } my @candidates = <*>; foreach my $candidate (@candidates) { if( -e $sci_modules_dir.'/'.$candidate.'/help' ) { $list{$candidate} = 1; } } return %list; } # ============================================================================== # get_xml_list # ============================================================================== sub get_xml_list { my $dir = $_[0]; my @list_dir; my $current_directory; # On enregistre le répertoire dans lequel on se situe à l'entrée de la fonction my $previous_directory = getcwd(); chdir($dir); @list_dir = <*>; foreach my $list_dir (@list_dir) { $current_directory = getcwd(); if( (-d $list_dir) && ( ! ($list_dir =~ m/^scilab_[a-z][a-z]_[A-Z][A-Z]_help$/ )) ) { get_xml_list($current_directory.'/'.$list_dir); } if( (-f $list_dir) && ($list_dir =~ m/\.xml$/) && ($list_dir ne 'master.xml') && ($list_dir ne 'master_help.xml') ) { $xmllist{$current_directory.'/'.$list_dir} = 1; } } chdir($previous_directory); } # ============================================================================== # valid # ============================================================================== sub valid { my $xmlfile = $_[0]; # construction de la commande my $cmd = 'xmllint --noout --relaxng '.$rng.' '.$xmlfile.' '; $cmd .= '> '.$tmp.' 2>&1'; # Lancement de la commande system($cmd); # Vérification my $nb_error = 0; my $error_str = ''; unless( open(TMP,$tmp) ) { print 'Le fichier '.$tmp.' n\'a pu être ouvert en lecture'."\n"; del_tmp_file(); exit(0); } while(<TMP>) { if( $_ eq $xmlfile.' validates'."\n" ) { $nb_error = 0; $error_str = ''; last; } if( (!($_ =~ m/IDREF attribute linkend references an unknown ID/)) && (!($_ =~ m/Did not expect element ulink there/)) && (!($_ =~ m/element imagedata: Relax-NG validity error :/)) && (!( $_ =~ /fails to validate/)) ) { $nb_error++; $error_str .= $_; } } close(TMP); if( $nb_error > 0 ) { $nb_bad_file++;; $bad_file_list{$xmlfile} = $nb_error; print LOG "=================================================================\n"; print LOG $xmlfile."\n"; print LOG "=================================================================\n"; print LOG $error_str; } return $nb_error; }
{ "pile_set_name": "Github" }
/* global.h: The global variables for bc. */ /* This file is part of bc written for MINIX. Copyright (C) 1991, 1992 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License , or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. You may contact the author by: e-mail: phil@cs.wwu.edu us-mail: Philip A. Nelson Computer Science Department, 9062 Western Washington University Bellingham, WA 98226-9062 *************************************************************************/ /* For the current "break level" and if statements. */ EXTERN int break_label; EXTERN int if_label; EXTERN int continue_label; /* Label numbers. */ EXTERN int next_label; /* Used for "code" generation. */ EXTERN char genstr[80]; EXTERN int out_count; EXTERN char did_gen; /* Interactive and other flags. */ EXTERN char interactive; EXTERN char compile_only; EXTERN char use_math; EXTERN char warn_not_std; EXTERN char std_only; /* global variables for the bc machine. All will be dynamic in size.*/ /* Function storage. main is (0) and functions (1-f_count) */ EXTERN bc_function *functions; EXTERN char **f_names; EXTERN int f_count; /* Variable stoarge and reverse names. */ EXTERN bc_var **variables; EXTERN char **v_names; EXTERN int v_count; /* Array Variable storage and reverse names. */ EXTERN bc_var_array **arrays; EXTERN char **a_names; EXTERN int a_count; /* Execution stack. */ EXTERN estack_rec *ex_stack; /* Function return stack. */ EXTERN fstack_rec *fn_stack; /* Other "storage". */ EXTERN int i_base; EXTERN int o_base; EXTERN int scale; EXTERN char c_code; EXTERN int out_col; EXTERN char runtime_error; EXTERN program_counter pc; /* Input Line numbers and other error information. */ EXTERN int line_no; EXTERN int had_error; /* For larger identifiers, a tree, and how many "storage" locations have been allocated. */ EXTERN int next_array; EXTERN int next_func; EXTERN int next_var; EXTERN id_rec *name_tree; /* For error message production */ EXTERN char **g_argv; EXTERN int g_argc; EXTERN char is_std_in; /* defined in number.c */ extern bc_num _zero_; extern bc_num _one_; /* For use with getopt. Do not declare them here.*/ extern int optind;
{ "pile_set_name": "Github" }
# load-json-file [![Build Status](https://travis-ci.org/sindresorhus/load-json-file.svg?branch=master)](https://travis-ci.org/sindresorhus/load-json-file) > Read and parse a JSON file [Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom), uses [`graceful-fs`](https://github.com/isaacs/node-graceful-fs), and throws more [helpful JSON errors](https://github.com/sindresorhus/parse-json). ## Install ``` $ npm install --save load-json-file ``` ## Usage ```js const loadJsonFile = require('load-json-file'); loadJsonFile('foo.json').then(json => { console.log(json); //=> {foo: true} }); ``` ## API ### loadJsonFile(filepath) Returns a promise that resolves to the parsed JSON. ### loadJsonFile.sync(filepath) Returns the parsed JSON. ## Related - [write-json-file](https://github.com/sindresorhus/write-json-file) - Stringify and write JSON to a file atomically ## License MIT © [Sindre Sorhus](http://sindresorhus.com)
{ "pile_set_name": "Github" }
-- Advanced NPC System by Jiddo if NpcHandler == nil then local storage = Storage.NpcExhaustOnBuy local duration = 1 -- Constant talkdelay behaviors. TALKDELAY_NONE = 0 -- No talkdelay. Npc will reply immedeatly. TALKDELAY_ONTHINK = 1 -- Talkdelay handled through the onThink callback function. (Default) TALKDELAY_EVENT = 2 -- Not yet implemented -- Currently applied talkdelay behavior. TALKDELAY_ONTHINK is default. NPCHANDLER_TALKDELAY = TALKDELAY_ONTHINK -- Constant indexes for defining default messages. MESSAGE_GREET = 1 -- When the player greets the npc. MESSAGE_FAREWELL = 2 -- When the player unGreets the npc. MESSAGE_BUY = 3 -- When the npc asks the player if he wants to buy something. MESSAGE_ONBUY = 4 -- When the player successfully buys something via talk. MESSAGE_BOUGHT = 5 -- When the player bought something through the shop window. MESSAGE_SELL = 6 -- When the npc asks the player if he wants to sell something. MESSAGE_ONSELL = 7 -- When the player successfully sells something via talk. MESSAGE_SOLD = 8 -- When the player sold something through the shop window. MESSAGE_MISSINGMONEY = 9 -- When the player does not have enough money. MESSAGE_NEEDMONEY = 10 -- Same as above, used for shop window. MESSAGE_MISSINGITEM = 11 -- When the player is trying to sell an item he does not have. MESSAGE_NEEDITEM = 12 -- Same as above, used for shop window. MESSAGE_NEEDSPACE = 13 -- When the player don't have any space to buy an item MESSAGE_NEEDMORESPACE = 14 -- When the player has some space to buy an item, but not enough space MESSAGE_IDLETIMEOUT = 15 -- When the player has been idle for longer then idleTime allows. MESSAGE_WALKAWAY = 16 -- When the player walks out of the talkRadius of the npc. MESSAGE_DECLINE = 17 -- When the player says no to something. MESSAGE_SENDTRADE = 18 -- When the npc sends the trade window to the player MESSAGE_NOSHOP = 19 -- When the npc's shop is requested but he doesn't have any MESSAGE_ONCLOSESHOP = 20 -- When the player closes the npc's shop window MESSAGE_ALREADYFOCUSED = 21 -- When the player already has the focus of this npc. MESSAGE_WALKAWAY_MALE = 22 -- When a male player walks out of the talkRadius of the npc. MESSAGE_WALKAWAY_FEMALE = 23 -- When a female player walks out of the talkRadius of the npc. -- Constant indexes for callback functions. These are also used for module callback ids. CALLBACK_CREATURE_APPEAR = 1 CALLBACK_CREATURE_DISAPPEAR = 2 CALLBACK_CREATURE_SAY = 3 CALLBACK_ONTHINK = 4 CALLBACK_GREET = 5 CALLBACK_FAREWELL = 6 CALLBACK_MESSAGE_DEFAULT = 7 CALLBACK_PLAYER_ENDTRADE = 8 CALLBACK_PLAYER_CLOSECHANNEL = 9 CALLBACK_ONBUY = 10 CALLBACK_ONSELL = 11 CALLBACK_ONADDFOCUS = 18 CALLBACK_ONRELEASEFOCUS = 19 CALLBACK_ONTRADEREQUEST = 20 -- Addidional module callback ids CALLBACK_MODULE_INIT = 12 CALLBACK_MODULE_RESET = 13 -- Constant strings defining the keywords to replace in the default messages. TAG_PLAYERNAME = "|PLAYERNAME|" TAG_ITEMCOUNT = "|ITEMCOUNT|" TAG_TOTALCOST = "|TOTALCOST|" TAG_ITEMNAME = "|ITEMNAME|" TAG_TIME = "|TIME|" TAG_BLESSCOST = "|BLESSCOST|" TAG_PVPBLESSCOST = "|PVPBLESSCOST|" TAG_TRAVELCOST = "|TRAVELCOST|" NpcHandler = { keywordHandler = nil, focuses = nil, talkStart = nil, idleTime = 120, talkRadius = 3, talkDelayTime = 1, -- Seconds to delay outgoing messages. talkDelay = nil, callbackFunctions = nil, modules = nil, shopItems = nil, -- They must be here since ShopModule uses 'static' functions eventSay = nil, eventDelayedSay = nil, topic = nil, messages = { -- These are the default replies of all npcs. They can/should be changed individually for each npc. -- Leave empty for no send message [MESSAGE_GREET] = "Greetings, |PLAYERNAME|.", [MESSAGE_FAREWELL] = "Good bye, |PLAYERNAME|.", [MESSAGE_BUY] = "Do you want to buy |ITEMCOUNT| |ITEMNAME| for |TOTALCOST| gold coins?", [MESSAGE_ONBUY] = "Here you are.", [MESSAGE_BOUGHT] = "Bought |ITEMCOUNT|x |ITEMNAME| for |TOTALCOST| gold.", [MESSAGE_SELL] = "Do you want to sell |ITEMCOUNT| |ITEMNAME| for |TOTALCOST| gold coins?", [MESSAGE_ONSELL] = "Here you are, |TOTALCOST| gold.", [MESSAGE_SOLD] = "Sold |ITEMCOUNT|x |ITEMNAME| for |TOTALCOST| gold.", [MESSAGE_MISSINGMONEY] = "You don't have enough money.", [MESSAGE_NEEDMONEY] = "You don't have enough money.", [MESSAGE_MISSINGITEM] = "You don't have so many.", [MESSAGE_NEEDITEM] = "You do not have this object.", [MESSAGE_NEEDSPACE] = "There is not enought room.", [MESSAGE_NEEDMORESPACE] = "You do not have enough capacity for all items.", [MESSAGE_IDLETIMEOUT] = "Good bye.", [MESSAGE_WALKAWAY] = "", [MESSAGE_DECLINE] = "Then not.", [MESSAGE_SENDTRADE] = "Of course, just browse through my wares.", [MESSAGE_NOSHOP] = "Sorry, I'm not offering anything.", [MESSAGE_ONCLOSESHOP] = "Thank you, come back whenever you're in need of something else.", [MESSAGE_ALREADYFOCUSED] = "|PLAYERNAME|, I am already talking to you.", [MESSAGE_WALKAWAY_MALE] = "", [MESSAGE_WALKAWAY_FEMALE] = "" } } -- Creates a new NpcHandler with an empty callbackFunction stack. function NpcHandler:new(keywordHandler) local obj = {} obj.callbackFunctions = {} obj.modules = {} obj.eventSay = {} obj.eventDelayedSay = {} obj.topic = {} obj.focuses = {} obj.talkStart = {} obj.talkDelay = {} obj.keywordHandler = keywordHandler obj.messages = {} obj.shopItems = {} setmetatable(obj.messages, self.messages) self.messages.__index = self.messages setmetatable(obj, self) self.__index = self return obj end -- Re-defines the maximum idle time allowed for a player when talking to this npc. function NpcHandler:setMaxIdleTime(newTime) self.idleTime = newTime end -- Attackes a new keyword handler to this npchandler function NpcHandler:setKeywordHandler(newHandler) self.keywordHandler = newHandler end -- Function used to change the focus of this npc. function NpcHandler:addFocus(newFocus) if self:isFocused(newFocus) then return end self.focuses[#self.focuses + 1] = newFocus self.topic[newFocus] = 0 local callback = self:getCallback(CALLBACK_ONADDFOCUS) if callback == nil or callback(newFocus) then self:processModuleCallback(CALLBACK_ONADDFOCUS, newFocus) end self:updateFocus() end -- Function used to verify if npc is focused to certain player function NpcHandler:isFocused(focus) for _, v in pairs(self.focuses) do if v == focus then return true end end return false end -- This function should be called on each onThink and makes sure the npc faces the player it is talking to. -- Should also be called whenever a new player is focused. function NpcHandler:updateFocus() for _, focus in pairs(self.focuses) do if focus ~= nil then doNpcSetCreatureFocus(focus) return end end doNpcSetCreatureFocus(0) end -- Used when the npc should un-focus the player. function NpcHandler:releaseFocus(focus) if shop_cost[focus] ~= nil then shop_amount[focus] = nil shop_cost[focus] = nil shop_rlname[focus] = nil shop_itemid[focus] = nil shop_container[focus] = nil shop_npcuid[focus] = nil shop_eventtype[focus] = nil shop_subtype[focus] = nil shop_destination[focus] = nil shop_premium[focus] = nil end if self.eventDelayedSay[focus] then self:cancelNPCTalk(self.eventDelayedSay[focus]) end if not self:isFocused(focus) then return end local pos = nil for k, v in pairs(self.focuses) do if v == focus then pos = k end end self.focuses[pos] = nil self.eventSay[focus] = nil self.eventDelayedSay[focus] = nil self.talkStart[focus] = nil self.topic[focus] = nil local callback = self:getCallback(CALLBACK_ONRELEASEFOCUS) if callback == nil or callback(focus) then self:processModuleCallback(CALLBACK_ONRELEASEFOCUS, focus) end if Player(focus) ~= nil then closeShopWindow(focus) --Even if it can not exist, we need to prevent it. self:updateFocus() end end -- Returns the callback function with the specified id or nil if no such callback function exists. function NpcHandler:getCallback(id) local ret = nil if self.callbackFunctions ~= nil then ret = self.callbackFunctions[id] end return ret end -- Changes the callback function for the given id to callback. function NpcHandler:setCallback(id, callback) if self.callbackFunctions ~= nil then self.callbackFunctions[id] = callback end end -- Adds a module to this npchandler and inits it. function NpcHandler:addModule(module) if self.modules ~= nil then self.modules[#self.modules + 1] = module module:init(self) end end -- Calls the callback function represented by id for all modules added to this npchandler with the given arguments. function NpcHandler:processModuleCallback(id, ...) local ret = true for _, module in pairs(self.modules) do local tmpRet = true if id == CALLBACK_CREATURE_APPEAR and module.callbackOnCreatureAppear ~= nil then tmpRet = module:callbackOnCreatureAppear(...) elseif id == CALLBACK_CREATURE_DISAPPEAR and module.callbackOnCreatureDisappear ~= nil then tmpRet = module:callbackOnCreatureDisappear(...) elseif id == CALLBACK_CREATURE_SAY and module.callbackOnCreatureSay ~= nil then tmpRet = module:callbackOnCreatureSay(...) elseif id == CALLBACK_PLAYER_ENDTRADE and module.callbackOnPlayerEndTrade ~= nil then tmpRet = module:callbackOnPlayerEndTrade(...) elseif id == CALLBACK_PLAYER_CLOSECHANNEL and module.callbackOnPlayerCloseChannel ~= nil then tmpRet = module:callbackOnPlayerCloseChannel(...) elseif id == CALLBACK_ONBUY and module.callbackOnBuy ~= nil then tmpRet = module:callbackOnBuy(...) elseif id == CALLBACK_ONSELL and module.callbackOnSell ~= nil then tmpRet = module:callbackOnSell(...) elseif id == CALLBACK_ONTRADEREQUEST and module.callbackOnTradeRequest ~= nil then tmpRet = module:callbackOnTradeRequest(...) elseif id == CALLBACK_ONADDFOCUS and module.callbackOnAddFocus ~= nil then tmpRet = module:callbackOnAddFocus(...) elseif id == CALLBACK_ONRELEASEFOCUS and module.callbackOnReleaseFocus ~= nil then tmpRet = module:callbackOnReleaseFocus(...) elseif id == CALLBACK_ONTHINK and module.callbackOnThink ~= nil then tmpRet = module:callbackOnThink(...) elseif id == CALLBACK_GREET and module.callbackOnGreet ~= nil then tmpRet = module:callbackOnGreet(...) elseif id == CALLBACK_FAREWELL and module.callbackOnFarewell ~= nil then tmpRet = module:callbackOnFarewell(...) elseif id == CALLBACK_MESSAGE_DEFAULT and module.callbackOnMessageDefault ~= nil then tmpRet = module:callbackOnMessageDefault(...) elseif id == CALLBACK_MODULE_RESET and module.callbackOnModuleReset ~= nil then tmpRet = module:callbackOnModuleReset(...) end if not tmpRet then ret = false break end end return ret end -- Returns the message represented by id. function NpcHandler:getMessage(id) local ret = nil if self.messages ~= nil then ret = self.messages[id] end return ret end -- Changes the default response message with the specified id to newMessage. function NpcHandler:setMessage(id, newMessage) if self.messages ~= nil then self.messages[id] = newMessage end end -- Translates all message tags found in msg using parseInfo function NpcHandler:parseMessage(msg, parseInfo) local ret = msg if type(ret) == 'string' then for search, replace in pairs(parseInfo) do ret = string.gsub(ret, search, replace) end else for i = 1, #ret do for search, replace in pairs(parseInfo) do ret[i] = string.gsub(ret[i], search, replace) end end end return ret end -- Makes sure the npc un-focuses the currently focused player function NpcHandler:unGreet(cid) if not self:isFocused(cid) then return end local callback = self:getCallback(CALLBACK_FAREWELL) if callback == nil or callback() then if self:processModuleCallback(CALLBACK_FAREWELL) then local msg = self:getMessage(MESSAGE_FAREWELL) local player = Player(cid) local playerName = player and player:getName() or -1 local parseInfo = { [TAG_PLAYERNAME] = playerName } self:resetNpc(cid) msg = self:parseMessage(msg, parseInfo) self:say(msg, cid, true) self:releaseFocus(cid) end end end -- Greets a new player. function NpcHandler:greet(cid, message) if cid ~= 0 then local callback = self:getCallback(CALLBACK_GREET) if callback == nil or callback(cid, message) then if self:processModuleCallback(CALLBACK_GREET, cid) then local msg = self:getMessage(MESSAGE_GREET) local player = Player(cid) local playerName = player and player:getName() or -1 local parseInfo = { [TAG_PLAYERNAME] = playerName } msg = self:parseMessage(msg, parseInfo) self:say(msg, cid, true) else return end else return end end self:addFocus(cid) end -- Handles onCreatureAppear events. If you with to handle this yourself, please use the CALLBACK_CREATURE_APPEAR callback. function NpcHandler:onCreatureAppear(creature) local cid = creature.uid if cid == getNpcCid() then local npc = Npc() if next(self.shopItems) then local speechBubble = npc:getSpeechBubble() if speechBubble == 3 then npc:setSpeechBubble(4) else npc:setSpeechBubble(2) end else if self:getMessage(MESSAGE_GREET) and npc:getSpeechBubble() < 1 then npc:setSpeechBubble(1) end end end local callback = self:getCallback(CALLBACK_CREATURE_APPEAR) if callback == nil or callback(cid) then if self:processModuleCallback(CALLBACK_CREATURE_APPEAR, cid) then -- end end end -- Handles onCreatureDisappear events. If you with to handle this yourself, please use the CALLBACK_CREATURE_DISAPPEAR callback. function NpcHandler:onCreatureDisappear(creature) local cid = creature.uid if getNpcCid() == cid then return end local callback = self:getCallback(CALLBACK_CREATURE_DISAPPEAR) if callback == nil or callback(cid) then if self:processModuleCallback(CALLBACK_CREATURE_DISAPPEAR, cid) then if self:isFocused(cid) then self:unGreet(cid) end end end end -- Handles onCreatureSay events. If you with to handle this yourself, please use the CALLBACK_CREATURE_SAY callback. function NpcHandler:onCreatureSay(creature, msgtype, msg) local cid = creature.uid local callback = self:getCallback(CALLBACK_CREATURE_SAY) if callback == nil or callback(cid, msgtype, msg) then if self:processModuleCallback(CALLBACK_CREATURE_SAY, cid, msgtype, msg) then if not self:isInRange(cid) then return end if self.keywordHandler ~= nil then if self:isFocused(cid) and msgtype == TALKTYPE_PRIVATE_PN or not self:isFocused(cid) then local ret = self.keywordHandler:processMessage(cid, msg) if not ret then local callback = self:getCallback(CALLBACK_MESSAGE_DEFAULT) if callback ~= nil and callback(cid, msgtype, msg) then self.talkStart[cid] = os.time() end else self.talkStart[cid] = os.time() end end end end end end -- Handles onPlayerEndTrade events. If you wish to handle this yourself, use the CALLBACK_PLAYER_ENDTRADE callback. function NpcHandler:onPlayerEndTrade(creature) local cid = creature.uid local callback = self:getCallback(CALLBACK_PLAYER_ENDTRADE) if callback == nil or callback(cid) then if self:processModuleCallback(CALLBACK_PLAYER_ENDTRADE, cid, msgtype, msg) then if self:isFocused(cid) then local player = Player(cid) local playerName = player and player:getName() or -1 local parseInfo = { [TAG_PLAYERNAME] = playerName } local msg = self:parseMessage(self:getMessage(MESSAGE_ONCLOSESHOP), parseInfo) self:say(msg, cid) end end end end -- Handles onPlayerCloseChannel events. If you wish to handle this yourself, use the CALLBACK_PLAYER_CLOSECHANNEL callback. function NpcHandler:onPlayerCloseChannel(creature) local cid = creature.uid local callback = self:getCallback(CALLBACK_PLAYER_CLOSECHANNEL) if callback == nil or callback(cid) then if self:processModuleCallback(CALLBACK_PLAYER_CLOSECHANNEL, cid, msgtype, msg) then if self:isFocused(cid) then self:unGreet(cid) end end end end -- Handles onBuy events. If you wish to handle this yourself, use the CALLBACK_ONBUY callback. function NpcHandler:onBuy(creature, itemid, subType, amount, ignoreCap, inBackpacks) local cid = creature.uid if (os.time() - getPlayerStorageValue(cid, storage)) >= duration then setPlayerStorageValue(cid, storage, os.time()) -- Delay for buy local callback = self:getCallback(CALLBACK_ONBUY) if callback == nil or callback(cid, itemid, subType, amount, ignoreCap, inBackpacks) then if self:processModuleCallback(CALLBACK_ONBUY, cid, itemid, subType, amount, ignoreCap, inBackpacks) then -- end end else return false end end -- Handles onSell events. If you wish to handle this yourself, use the CALLBACK_ONSELL callback. function NpcHandler:onSell(creature, itemid, subType, amount, ignoreCap, inBackpacks) local cid = creature.uid local callback = self:getCallback(CALLBACK_ONSELL) if callback == nil or callback(cid, itemid, subType, amount, ignoreCap, inBackpacks) then if self:processModuleCallback(CALLBACK_ONSELL, cid, itemid, subType, amount, ignoreCap, inBackpacks) then -- end end end -- Handles onTradeRequest events. If you wish to handle this yourself, use the CALLBACK_ONTRADEREQUEST callback. function NpcHandler:onTradeRequest(cid) local callback = self:getCallback(CALLBACK_ONTRADEREQUEST) if callback == nil or callback(cid) then if self:processModuleCallback(CALLBACK_ONTRADEREQUEST, cid) then return true end end return false end -- Handles onThink events. If you wish to handle this yourself, please use the CALLBACK_ONTHINK callback. function NpcHandler:onThink() local callback = self:getCallback(CALLBACK_ONTHINK) if callback == nil or callback() then if NPCHANDLER_TALKDELAY == TALKDELAY_ONTHINK then for cid, talkDelay in pairs(self.talkDelay) do if talkDelay.time ~= nil and talkDelay.message ~= nil and os.time() >= talkDelay.time then selfSay(talkDelay.message, cid, talkDelay.publicize and true or false) self.talkDelay[cid] = nil end end end if self:processModuleCallback(CALLBACK_ONTHINK) then for _, focus in pairs(self.focuses) do if focus ~= nil then if not self:isInRange(focus) then self:onWalkAway(focus) elseif self.talkStart[focus] ~= nil and (os.time() - self.talkStart[focus]) > self.idleTime then self:unGreet(focus) else self:updateFocus() end end end end end end -- Tries to greet the player with the given cid. function NpcHandler:onGreet(cid, message) if self:isInRange(cid) then if not self:isFocused(cid) then self:greet(cid, message) return end end end -- Simply calls the underlying unGreet function. function NpcHandler:onFarewell(cid) self:unGreet(cid) end -- Should be called on this npc's focus if the distance to focus is greater then talkRadius. function NpcHandler:onWalkAway(cid) if self:isFocused(cid) then local callback = self:getCallback(CALLBACK_CREATURE_DISAPPEAR) if callback == nil or callback() then if self:processModuleCallback(CALLBACK_CREATURE_DISAPPEAR, cid) then local msg = self:getMessage(MESSAGE_WALKAWAY) local player = Player(cid) local playerName = player and player:getName() or -1 local playerSex = player and player:getSex() or 0 local parseInfo = { [TAG_PLAYERNAME] = playerName } local message = self:parseMessage(msg, parseInfo) local msg_male = self:getMessage(MESSAGE_WALKAWAY_MALE) local message_male = self:parseMessage(msg_male, parseInfo) local msg_female = self:getMessage(MESSAGE_WALKAWAY_FEMALE) local message_female = self:parseMessage(msg_female, parseInfo) if message_female ~= message_male then if playerSex == PLAYERSEX_FEMALE then selfSay(message_female) else selfSay(message_male) end elseif message ~= "" then selfSay(message) end self:resetNpc(cid) self:releaseFocus(cid) end end end end -- Returns true if cid is within the talkRadius of this npc. function NpcHandler:isInRange(cid) local distance = Player(cid) ~= nil and getDistanceTo(cid) or -1 if distance == -1 then return false end return distance <= self.talkRadius end -- Resets the npc into its initial state (in regard of the keywordhandler). -- All modules are also receiving a reset call through their callbackOnModuleReset function. function NpcHandler:resetNpc(cid) if self:processModuleCallback(CALLBACK_MODULE_RESET) then self.keywordHandler:reset(cid) end end function NpcHandler:cancelNPCTalk(events) for aux = 1, #events do stopEvent(events[aux].event) end events = nil end function NpcHandler:doNPCTalkALot(msgs, interval, pcid) if self.eventDelayedSay[pcid] then self:cancelNPCTalk(self.eventDelayedSay[pcid]) end self.eventDelayedSay[pcid] = {} local ret = {} for aux = 1, #msgs do self.eventDelayedSay[pcid][aux] = {} doCreatureSayWithDelay(getNpcCid(), msgs[aux], TALKTYPE_PRIVATE_NP, ((aux-1) * (interval or 4000)) + 700, self.eventDelayedSay[pcid][aux], pcid) ret[#ret + 1] = self.eventDelayedSay[pcid][aux] end return(ret) end -- Makes the npc represented by this instance of NpcHandler say something. -- This implements the currently set type of talkdelay. -- shallDelay is a boolean value. If it is false, the message is not delayed. Default value is true. function NpcHandler:say(message, focus, publicize, shallDelay, delay) if type(message) == "table" then return self:doNPCTalkALot(message, delay or 6000, focus) end if self.eventDelayedSay[focus] then self:cancelNPCTalk(self.eventDelayedSay[focus]) end local shallDelay = not shallDelay and true or shallDelay if NPCHANDLER_TALKDELAY == TALKDELAY_NONE or shallDelay == false then selfSay(message, focus, publicize and true or false) return end stopEvent(self.eventSay[focus]) self.eventSay[focus] = addEvent(function(npcId, message, focusId) local npc = Npc(npcId) if npc == nil then return end local player = Player(focusId) if player then local parseInfo = {[TAG_PLAYERNAME] = player:getName(), [TAG_TIME] = getFormattedWorldTime(), [TAG_BLESSCOST] = getBlessingsCost(player:getLevel()), [TAG_PVPBLESSCOST] = getPvpBlessingCost(player:getLevel())} npc:say(self:parseMessage(message, parseInfo), TALKTYPE_PRIVATE_NP, false, player, npc:getPosition()) end end, self.talkDelayTime * 1000, Npc().uid, message, focus) end end
{ "pile_set_name": "Github" }
/* SPDX-License-Identifier: MIT */ #ifndef __NVBIOS_P0260_H__ #define __NVBIOS_P0260_H__ u32 nvbios_P0260Te(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *xnr, u8 *xsz); struct nvbios_P0260E { u32 data; }; u32 nvbios_P0260Ee(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr); u32 nvbios_P0260Ep(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr, struct nvbios_P0260E *); struct nvbios_P0260X { u32 data; }; u32 nvbios_P0260Xe(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr); u32 nvbios_P0260Xp(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr, struct nvbios_P0260X *); #endif
{ "pile_set_name": "Github" }
/* * Copyright 1999-2018 Alibaba Group Holding Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import NameSpaceList from './NameSpaceList'; export default NameSpaceList;
{ "pile_set_name": "Github" }
# Copyright 2000-2004 Michael Hudson-Doyle <micahel@gmail.com> # # All Rights Reserved # # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose is hereby granted without fee, # provided that the above copyright notice appear in all copies and # that both that copyright notice and this permission notice appear in # supporting documentation. # # THE AUTHOR MICHAEL HUDSON DISCLAIMS ALL WARRANTIES WITH REGARD TO # THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY # AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, # INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER # RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF # CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. from pyrepl import reader, commands, input from pyrepl.reader import Reader as R isearch_keymap = tuple( [('\\%03o'%c, 'isearch-end') for c in range(256) if chr(c) != '\\'] + \ [(c, 'isearch-add-character') for c in map(chr, range(32, 127)) if c != '\\'] + \ [('\\%03o'%c, 'isearch-add-character') for c in range(256) if chr(c).isalpha() and chr(c) != '\\'] + \ [('\\\\', 'self-insert'), (r'\C-r', 'isearch-backwards'), (r'\C-s', 'isearch-forwards'), (r'\C-c', 'isearch-cancel'), (r'\C-g', 'isearch-cancel'), (r'\<backspace>', 'isearch-backspace')]) del c ISEARCH_DIRECTION_NONE = '' ISEARCH_DIRECTION_BACKWARDS = 'r' ISEARCH_DIRECTION_FORWARDS = 'f' class next_history(commands.Command): def do(self): r = self.reader if r.historyi == len(r.history): r.error("end of history list") return r.select_item(r.historyi + 1) class previous_history(commands.Command): def do(self): r = self.reader if r.historyi == 0: r.error("start of history list") return r.select_item(r.historyi - 1) class restore_history(commands.Command): def do(self): r = self.reader if r.historyi != len(r.history): if r.get_unicode() != r.history[r.historyi]: r.buffer = list(r.history[r.historyi]) r.pos = len(r.buffer) r.dirty = 1 class first_history(commands.Command): def do(self): self.reader.select_item(0) class last_history(commands.Command): def do(self): self.reader.select_item(len(self.reader.history)) class operate_and_get_next(commands.FinishCommand): def do(self): self.reader.next_history = self.reader.historyi + 1 class yank_arg(commands.Command): def do(self): r = self.reader if r.last_command is self.__class__: r.yank_arg_i += 1 else: r.yank_arg_i = 0 if r.historyi < r.yank_arg_i: r.error("beginning of history list") return a = r.get_arg(-1) # XXX how to split? words = r.get_item(r.historyi - r.yank_arg_i - 1).split() if a < -len(words) or a >= len(words): r.error("no such arg") return w = words[a] b = r.buffer if r.yank_arg_i > 0: o = len(r.yank_arg_yanked) else: o = 0 b[r.pos - o:r.pos] = list(w) r.yank_arg_yanked = w r.pos += len(w) - o r.dirty = 1 class forward_history_isearch(commands.Command): def do(self): r = self.reader r.isearch_direction = ISEARCH_DIRECTION_FORWARDS r.isearch_start = r.historyi, r.pos r.isearch_term = '' r.dirty = 1 r.push_input_trans(r.isearch_trans) class reverse_history_isearch(commands.Command): def do(self): r = self.reader r.isearch_direction = ISEARCH_DIRECTION_BACKWARDS r.dirty = 1 r.isearch_term = '' r.push_input_trans(r.isearch_trans) r.isearch_start = r.historyi, r.pos class isearch_cancel(commands.Command): def do(self): r = self.reader r.isearch_direction = ISEARCH_DIRECTION_NONE r.pop_input_trans() r.select_item(r.isearch_start[0]) r.pos = r.isearch_start[1] r.dirty = 1 class isearch_add_character(commands.Command): def do(self): r = self.reader b = r.buffer r.isearch_term += self.event[-1] r.dirty = 1 p = r.pos + len(r.isearch_term) - 1 if b[p:p+1] != [r.isearch_term[-1]]: r.isearch_next() class isearch_backspace(commands.Command): def do(self): r = self.reader if len(r.isearch_term) > 0: r.isearch_term = r.isearch_term[:-1] r.dirty = 1 else: r.error("nothing to rubout") class isearch_forwards(commands.Command): def do(self): r = self.reader r.isearch_direction = ISEARCH_DIRECTION_FORWARDS r.isearch_next() class isearch_backwards(commands.Command): def do(self): r = self.reader r.isearch_direction = ISEARCH_DIRECTION_BACKWARDS r.isearch_next() class isearch_end(commands.Command): def do(self): r = self.reader r.isearch_direction = ISEARCH_DIRECTION_NONE r.console.forgetinput() r.pop_input_trans() r.dirty = 1 class HistoricalReader(R): """Adds history support (with incremental history searching) to the Reader class. Adds the following instance variables: * history: a list of strings * historyi: * transient_history: * next_history: * isearch_direction, isearch_term, isearch_start: * yank_arg_i, yank_arg_yanked: used by the yank-arg command; not actually manipulated by any HistoricalReader instance methods. """ def collect_keymap(self): return super(HistoricalReader, self).collect_keymap() + ( (r'\C-n', 'next-history'), (r'\C-p', 'previous-history'), (r'\C-o', 'operate-and-get-next'), (r'\C-r', 'reverse-history-isearch'), (r'\C-s', 'forward-history-isearch'), (r'\M-r', 'restore-history'), (r'\M-.', 'yank-arg'), (r'\<page down>', 'last-history'), (r'\<page up>', 'first-history')) def __init__(self, console): super(HistoricalReader, self).__init__(console) self.history = [] self.historyi = 0 self.transient_history = {} self.next_history = None self.isearch_direction = ISEARCH_DIRECTION_NONE for c in [next_history, previous_history, restore_history, first_history, last_history, yank_arg, forward_history_isearch, reverse_history_isearch, isearch_end, isearch_add_character, isearch_cancel, isearch_add_character, isearch_backspace, isearch_forwards, isearch_backwards, operate_and_get_next]: self.commands[c.__name__] = c self.commands[c.__name__.replace('_', '-')] = c self.isearch_trans = input.KeymapTranslator( isearch_keymap, invalid_cls=isearch_end, character_cls=isearch_add_character) def select_item(self, i): self.transient_history[self.historyi] = self.get_unicode() buf = self.transient_history.get(i) if buf is None: buf = self.history[i] self.buffer = list(buf) self.historyi = i self.pos = len(self.buffer) self.dirty = 1 def get_item(self, i): if i <> len(self.history): return self.transient_history.get(i, self.history[i]) else: return self.transient_history.get(i, self.get_unicode()) def prepare(self): super(HistoricalReader, self).prepare() try: self.transient_history = {} if self.next_history is not None \ and self.next_history < len(self.history): self.historyi = self.next_history self.buffer[:] = list(self.history[self.next_history]) self.pos = len(self.buffer) self.transient_history[len(self.history)] = '' else: self.historyi = len(self.history) self.next_history = None except: self.restore() raise def get_prompt(self, lineno, cursor_on_line): if cursor_on_line and self.isearch_direction <> ISEARCH_DIRECTION_NONE: d = 'rf'[self.isearch_direction == ISEARCH_DIRECTION_FORWARDS] return "(%s-search `%s') "%(d, self.isearch_term) else: return super(HistoricalReader, self).get_prompt(lineno, cursor_on_line) def isearch_next(self): st = self.isearch_term p = self.pos i = self.historyi s = self.get_unicode() forwards = self.isearch_direction == ISEARCH_DIRECTION_FORWARDS while 1: if forwards: p = s.find(st, p + 1) else: p = s.rfind(st, 0, p + len(st) - 1) if p != -1: self.select_item(i) self.pos = p return elif ((forwards and i == len(self.history) - 1) or (not forwards and i == 0)): self.error("not found") return else: if forwards: i += 1 s = self.get_item(i) p = -1 else: i -= 1 s = self.get_item(i) p = len(s) def finish(self): super(HistoricalReader, self).finish() ret = self.get_unicode() for i, t in self.transient_history.items(): if i < len(self.history) and i != self.historyi: self.history[i] = t if ret: self.history.append(ret) def test(): from pyrepl.unix_console import UnixConsole reader = HistoricalReader(UnixConsole()) reader.ps1 = "h**> " reader.ps2 = "h/*> " reader.ps3 = "h|*> " reader.ps4 = r"h\*> " while reader.readline(): pass if __name__=='__main__': test()
{ "pile_set_name": "Github" }
# # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'contacts_service' s.version = '0.2.1' s.summary = 'A new Flutter plugin.' s.description = <<-DESC A new Flutter plugin. DESC s.homepage = 'http://example.com' s.license = { :file => '../LICENSE' } s.author = { 'Your Company' => 'email@example.com' } s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' s.ios.deployment_target = '8.0' end
{ "pile_set_name": "Github" }
/* * SpanDSP - a series of DSP components for telephony * * v42bis_tests.c * * Written by Steve Underwood <steveu@coppice.org> * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* THIS IS A WORK IN PROGRESS. IT IS NOT FINISHED. */ /*! \page v42bis_tests_page V.42bis tests \section v42bis_tests_page_sec_1 What does it do? These tests compress the contents of a file specified on the command line, writing the compressed data to v42bis_tests.v42bis. They then read back the contents of the compressed file, decompress, and write the results to v42bis_tests.out. The contents of this file should exactly match the original file. */ #if defined(HAVE_CONFIG_H) #include <config.h> #endif #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <string.h> #include <unistd.h> #include <errno.h> #include <ctype.h> #include <assert.h> #include "spandsp.h" #include "spandsp/private/v42bis.h" #define COMPRESSED_FILE_NAME "v42bis_tests.v42bis" #define OUTPUT_FILE_NAME "v42bis_tests.out" int in_octets_to_date = 0; int out_octets_to_date = 0; static void frame_handler(void *user_data, const uint8_t *buf, int len) { int ret; if ((ret = write((intptr_t) user_data, buf, len)) != len) fprintf(stderr, "Write error %d/%d\n", ret, errno); out_octets_to_date += len; } static void data_handler(void *user_data, const uint8_t *buf, int len) { int ret; if ((ret = write((intptr_t) user_data, buf, len)) != len) fprintf(stderr, "Write error %d/%d\n", ret, errno); out_octets_to_date += len; } int main(int argc, char *argv[]) { int len; v42bis_state_t state_a; v42bis_state_t state_b; uint8_t buf[1024]; int in_fd; int v42bis_fd; int out_fd; int do_compression; int do_decompression; time_t now; do_compression = TRUE; do_decompression = TRUE; if (argc < 2) { fprintf(stderr, "Usage: %s <file>\n", argv[0]); exit(2); } if (do_compression) { if ((in_fd = open(argv[1], O_RDONLY)) < 0) { fprintf(stderr, "Error opening file '%s'.\n", argv[1]); exit(2); } if ((v42bis_fd = open(COMPRESSED_FILE_NAME, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) { fprintf(stderr, "Error opening file '%s'.\n", COMPRESSED_FILE_NAME); exit(2); } time(&now); v42bis_init(&state_a, 3, 512, 6, frame_handler, (void *) (intptr_t) v42bis_fd, 512, data_handler, NULL, 512); v42bis_compression_control(&state_a, V42BIS_COMPRESSION_MODE_ALWAYS); in_octets_to_date = 0; out_octets_to_date = 0; while ((len = read(in_fd, buf, 1024)) > 0) { if (v42bis_compress(&state_a, buf, len)) { fprintf(stderr, "Bad return code from compression\n"); exit(2); } in_octets_to_date += len; } v42bis_compress_flush(&state_a); printf("%d bytes compressed to %d bytes in %lds\n", in_octets_to_date, out_octets_to_date, time(NULL) - now); close(in_fd); close(v42bis_fd); } if (do_decompression) { /* Now open the files for the decompression. */ if ((v42bis_fd = open(COMPRESSED_FILE_NAME, O_RDONLY)) < 0) { fprintf(stderr, "Error opening file '%s'.\n", COMPRESSED_FILE_NAME); exit(2); } if ((out_fd = open(OUTPUT_FILE_NAME, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) { fprintf(stderr, "Error opening file '%s'.\n", OUTPUT_FILE_NAME); exit(2); } time(&now); v42bis_init(&state_b, 3, 512, 6, frame_handler, (void *) (intptr_t) v42bis_fd, 512, data_handler, (void *) (intptr_t) out_fd, 512); in_octets_to_date = 0; out_octets_to_date = 0; while ((len = read(v42bis_fd, buf, 1024)) > 0) { if (v42bis_decompress(&state_b, buf, len)) { fprintf(stderr, "Bad return code from decompression\n"); exit(2); } in_octets_to_date += len; } v42bis_decompress_flush(&state_b); printf("%d bytes decompressed to %d bytes in %lds\n", in_octets_to_date, out_octets_to_date, time(NULL) - now); close(v42bis_fd); close(out_fd); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/
{ "pile_set_name": "Github" }
// Copyright (c) 2014-2017 Wolfgang Borgsmüller // All rights reserved. // // This software may be modified and distributed under the terms // of the BSD license. See the License.txt file for details. // Generated file. Do not edit. using System; namespace Chromium.Remote { /// <summary> /// Structure that manages custom scheme registrations. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_scheme_capi.h">cef/include/capi/cef_scheme_capi.h</see>. /// </remarks> public class CfrSchemeRegistrar : CfrBaseScoped { internal static CfrSchemeRegistrar Wrap(RemotePtr remotePtr) { if(remotePtr == RemotePtr.Zero) return null; return new CfrSchemeRegistrar(remotePtr); } private CfrSchemeRegistrar(RemotePtr remotePtr) : base(remotePtr) {} /// <summary> /// Register a custom scheme. This function should not be called for the built- /// in HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes. /// /// See CfrSchemeOptions for possible values for |options|. /// /// This function may be called on any thread. It should only be called once /// per unique |schemeName| value. If |schemeName| is already registered or /// if an error occurs this function will return false (0). /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_scheme_capi.h">cef/include/capi/cef_scheme_capi.h</see>. /// </remarks> public bool AddCustomScheme(string schemeName, int options) { var connection = RemotePtr.connection; var call = new CfxSchemeRegistrarAddCustomSchemeRemoteCall(); call.@this = RemotePtr.ptr; call.schemeName = schemeName; call.options = options; call.RequestExecution(connection); return call.__retval; } } }
{ "pile_set_name": "Github" }
/* * Copyright 2015 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * */ #include "pp_debug.h" #include <linux/errno.h> #include "hwmgr.h" #include "hardwaremanager.h" #include "power_state.h" #define PHM_FUNC_CHECK(hw) \ do { \ if ((hw) == NULL || (hw)->hwmgr_func == NULL) \ return -EINVAL; \ } while (0) bool phm_is_hw_access_blocked(struct pp_hwmgr *hwmgr) { return hwmgr->block_hw_access; } int phm_block_hw_access(struct pp_hwmgr *hwmgr, bool block) { hwmgr->block_hw_access = block; return 0; } int phm_setup_asic(struct pp_hwmgr *hwmgr) { PHM_FUNC_CHECK(hwmgr); if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_TablelessHardwareInterface)) { if (NULL != hwmgr->hwmgr_func->asic_setup) return hwmgr->hwmgr_func->asic_setup(hwmgr); } else { return phm_dispatch_table(hwmgr, &(hwmgr->setup_asic), NULL, NULL); } return 0; } int phm_power_down_asic(struct pp_hwmgr *hwmgr) { PHM_FUNC_CHECK(hwmgr); if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_TablelessHardwareInterface)) { if (NULL != hwmgr->hwmgr_func->power_off_asic) return hwmgr->hwmgr_func->power_off_asic(hwmgr); } else { return phm_dispatch_table(hwmgr, &(hwmgr->power_down_asic), NULL, NULL); } return 0; } int phm_set_power_state(struct pp_hwmgr *hwmgr, const struct pp_hw_power_state *pcurrent_state, const struct pp_hw_power_state *pnew_power_state) { struct phm_set_power_state_input states; PHM_FUNC_CHECK(hwmgr); states.pcurrent_state = pcurrent_state; states.pnew_state = pnew_power_state; if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_TablelessHardwareInterface)) { if (NULL != hwmgr->hwmgr_func->power_state_set) return hwmgr->hwmgr_func->power_state_set(hwmgr, &states); } else { return phm_dispatch_table(hwmgr, &(hwmgr->set_power_state), &states, NULL); } return 0; } int phm_enable_dynamic_state_management(struct pp_hwmgr *hwmgr) { int ret = 1; bool enabled; PHM_FUNC_CHECK(hwmgr); if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_TablelessHardwareInterface)) { if (NULL != hwmgr->hwmgr_func->dynamic_state_management_enable) ret = hwmgr->hwmgr_func->dynamic_state_management_enable(hwmgr); } else { ret = phm_dispatch_table(hwmgr, &(hwmgr->enable_dynamic_state_management), NULL, NULL); } enabled = ret == 0 ? true : false; cgs_notify_dpm_enabled(hwmgr->device, enabled); return ret; } int phm_disable_dynamic_state_management(struct pp_hwmgr *hwmgr) { int ret = -1; bool enabled; PHM_FUNC_CHECK(hwmgr); if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_TablelessHardwareInterface)) { if (hwmgr->hwmgr_func->dynamic_state_management_disable) ret = hwmgr->hwmgr_func->dynamic_state_management_disable(hwmgr); } else { ret = phm_dispatch_table(hwmgr, &(hwmgr->disable_dynamic_state_management), NULL, NULL); } enabled = ret == 0 ? false : true; cgs_notify_dpm_enabled(hwmgr->device, enabled); return ret; } int phm_force_dpm_levels(struct pp_hwmgr *hwmgr, enum amd_dpm_forced_level level) { PHM_FUNC_CHECK(hwmgr); if (hwmgr->hwmgr_func->force_dpm_level != NULL) return hwmgr->hwmgr_func->force_dpm_level(hwmgr, level); return 0; } int phm_apply_state_adjust_rules(struct pp_hwmgr *hwmgr, struct pp_power_state *adjusted_ps, const struct pp_power_state *current_ps) { PHM_FUNC_CHECK(hwmgr); if (hwmgr->hwmgr_func->apply_state_adjust_rules != NULL) return hwmgr->hwmgr_func->apply_state_adjust_rules( hwmgr, adjusted_ps, current_ps); return 0; } int phm_powerdown_uvd(struct pp_hwmgr *hwmgr) { PHM_FUNC_CHECK(hwmgr); if (hwmgr->hwmgr_func->powerdown_uvd != NULL) return hwmgr->hwmgr_func->powerdown_uvd(hwmgr); return 0; } int phm_powergate_uvd(struct pp_hwmgr *hwmgr, bool gate) { PHM_FUNC_CHECK(hwmgr); if (hwmgr->hwmgr_func->powergate_uvd != NULL) return hwmgr->hwmgr_func->powergate_uvd(hwmgr, gate); return 0; } int phm_powergate_vce(struct pp_hwmgr *hwmgr, bool gate) { PHM_FUNC_CHECK(hwmgr); if (hwmgr->hwmgr_func->powergate_vce != NULL) return hwmgr->hwmgr_func->powergate_vce(hwmgr, gate); return 0; } int phm_enable_clock_power_gatings(struct pp_hwmgr *hwmgr) { PHM_FUNC_CHECK(hwmgr); if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_TablelessHardwareInterface)) { if (NULL != hwmgr->hwmgr_func->enable_clock_power_gating) return hwmgr->hwmgr_func->enable_clock_power_gating(hwmgr); } else { return phm_dispatch_table(hwmgr, &(hwmgr->enable_clock_power_gatings), NULL, NULL); } return 0; } int phm_disable_clock_power_gatings(struct pp_hwmgr *hwmgr) { PHM_FUNC_CHECK(hwmgr); if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_TablelessHardwareInterface)) { if (NULL != hwmgr->hwmgr_func->disable_clock_power_gating) return hwmgr->hwmgr_func->disable_clock_power_gating(hwmgr); } return 0; } int phm_display_configuration_changed(struct pp_hwmgr *hwmgr) { PHM_FUNC_CHECK(hwmgr); if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_TablelessHardwareInterface)) { if (NULL != hwmgr->hwmgr_func->display_config_changed) hwmgr->hwmgr_func->display_config_changed(hwmgr); } else return phm_dispatch_table(hwmgr, &hwmgr->display_configuration_changed, NULL, NULL); return 0; } int phm_notify_smc_display_config_after_ps_adjustment(struct pp_hwmgr *hwmgr) { PHM_FUNC_CHECK(hwmgr); if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_TablelessHardwareInterface)) if (NULL != hwmgr->hwmgr_func->notify_smc_display_config_after_ps_adjustment) hwmgr->hwmgr_func->notify_smc_display_config_after_ps_adjustment(hwmgr); return 0; } int phm_stop_thermal_controller(struct pp_hwmgr *hwmgr) { PHM_FUNC_CHECK(hwmgr); if (hwmgr->hwmgr_func->stop_thermal_controller == NULL) return -EINVAL; return hwmgr->hwmgr_func->stop_thermal_controller(hwmgr); } int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info) { PHM_FUNC_CHECK(hwmgr); if (hwmgr->hwmgr_func->register_internal_thermal_interrupt == NULL) return -EINVAL; return hwmgr->hwmgr_func->register_internal_thermal_interrupt(hwmgr, info); } /** * Initializes the thermal controller subsystem. * * @param pHwMgr the address of the powerplay hardware manager. * @param pTemperatureRange the address of the structure holding the temperature range. * @exception PP_Result_Failed if any of the paramters is NULL, otherwise the return value from the dispatcher. */ int phm_start_thermal_controller(struct pp_hwmgr *hwmgr, struct PP_TemperatureRange *temperature_range) { return phm_dispatch_table(hwmgr, &(hwmgr->start_thermal_controller), temperature_range, NULL); } bool phm_check_smc_update_required_for_display_configuration(struct pp_hwmgr *hwmgr) { PHM_FUNC_CHECK(hwmgr); if (hwmgr->hwmgr_func->check_smc_update_required_for_display_configuration == NULL) return false; return hwmgr->hwmgr_func->check_smc_update_required_for_display_configuration(hwmgr); } int phm_check_states_equal(struct pp_hwmgr *hwmgr, const struct pp_hw_power_state *pstate1, const struct pp_hw_power_state *pstate2, bool *equal) { PHM_FUNC_CHECK(hwmgr); if (hwmgr->hwmgr_func->check_states_equal == NULL) return -EINVAL; return hwmgr->hwmgr_func->check_states_equal(hwmgr, pstate1, pstate2, equal); } int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr, const struct amd_pp_display_configuration *display_config) { PHM_FUNC_CHECK(hwmgr); if (display_config == NULL) return -EINVAL; hwmgr->display_config = *display_config; if (hwmgr->hwmgr_func->store_cc6_data == NULL) return -EINVAL; /* TODO: pass other display configuration in the future */ if (hwmgr->hwmgr_func->store_cc6_data) hwmgr->hwmgr_func->store_cc6_data(hwmgr, display_config->cpu_pstate_separation_time, display_config->cpu_cc6_disable, display_config->cpu_pstate_disable, display_config->nb_pstate_switch_disable); return 0; } int phm_get_dal_power_level(struct pp_hwmgr *hwmgr, struct amd_pp_simple_clock_info *info) { PHM_FUNC_CHECK(hwmgr); if (info == NULL || hwmgr->hwmgr_func->get_dal_power_level == NULL) return -EINVAL; return hwmgr->hwmgr_func->get_dal_power_level(hwmgr, info); } int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr) { PHM_FUNC_CHECK(hwmgr); if (hwmgr->hwmgr_func->set_cpu_power_state != NULL) return hwmgr->hwmgr_func->set_cpu_power_state(hwmgr); return 0; } int phm_get_performance_level(struct pp_hwmgr *hwmgr, const struct pp_hw_power_state *state, PHM_PerformanceLevelDesignation designation, uint32_t index, PHM_PerformanceLevel *level) { PHM_FUNC_CHECK(hwmgr); if (hwmgr->hwmgr_func->get_performance_level == NULL) return -EINVAL; return hwmgr->hwmgr_func->get_performance_level(hwmgr, state, designation, index, level); } /** * Gets Clock Info. * * @param pHwMgr the address of the powerplay hardware manager. * @param pPowerState the address of the Power State structure. * @param pClockInfo the address of PP_ClockInfo structure where the result will be returned. * @exception PP_Result_Failed if any of the paramters is NULL, otherwise the return value from the back-end. */ int phm_get_clock_info(struct pp_hwmgr *hwmgr, const struct pp_hw_power_state *state, struct pp_clock_info *pclock_info, PHM_PerformanceLevelDesignation designation) { int result; PHM_PerformanceLevel performance_level; PHM_FUNC_CHECK(hwmgr); PP_ASSERT_WITH_CODE((NULL != state), "Invalid Input!", return -EINVAL); PP_ASSERT_WITH_CODE((NULL != pclock_info), "Invalid Input!", return -EINVAL); result = phm_get_performance_level(hwmgr, state, PHM_PerformanceLevelDesignation_Activity, 0, &performance_level); PP_ASSERT_WITH_CODE((0 == result), "Failed to retrieve minimum clocks.", return result); pclock_info->min_mem_clk = performance_level.memory_clock; pclock_info->min_eng_clk = performance_level.coreClock; pclock_info->min_bus_bandwidth = performance_level.nonLocalMemoryFreq * performance_level.nonLocalMemoryWidth; result = phm_get_performance_level(hwmgr, state, designation, (hwmgr->platform_descriptor.hardwareActivityPerformanceLevels - 1), &performance_level); PP_ASSERT_WITH_CODE((0 == result), "Failed to retrieve maximum clocks.", return result); pclock_info->max_mem_clk = performance_level.memory_clock; pclock_info->max_eng_clk = performance_level.coreClock; pclock_info->max_bus_bandwidth = performance_level.nonLocalMemoryFreq * performance_level.nonLocalMemoryWidth; return 0; } int phm_get_current_shallow_sleep_clocks(struct pp_hwmgr *hwmgr, const struct pp_hw_power_state *state, struct pp_clock_info *clock_info) { PHM_FUNC_CHECK(hwmgr); if (hwmgr->hwmgr_func->get_current_shallow_sleep_clocks == NULL) return -EINVAL; return hwmgr->hwmgr_func->get_current_shallow_sleep_clocks(hwmgr, state, clock_info); } int phm_get_clock_by_type(struct pp_hwmgr *hwmgr, enum amd_pp_clock_type type, struct amd_pp_clocks *clocks) { PHM_FUNC_CHECK(hwmgr); if (hwmgr->hwmgr_func->get_clock_by_type == NULL) return -EINVAL; return hwmgr->hwmgr_func->get_clock_by_type(hwmgr, type, clocks); } int phm_get_max_high_clocks(struct pp_hwmgr *hwmgr, struct amd_pp_simple_clock_info *clocks) { PHM_FUNC_CHECK(hwmgr); if (hwmgr->hwmgr_func->get_max_high_clocks == NULL) return -EINVAL; return hwmgr->hwmgr_func->get_max_high_clocks(hwmgr, clocks); }
{ "pile_set_name": "Github" }
| package | package := Package name: 'Dolphin Key-Value Prompter'. package paxVersion: 1; preDeclareClassesOnLoad: false; basicComment: 'Dolphin Smalltalk Generic Key-Value Pair Prompter. Copyright (c) Object Arts Ltd. 2005.'. package basicPackageVersion: '6.0'. package classNames add: #KeyValuePrompter; yourself. package binaryGlobalNames: (Set new yourself). package globalAliases: (Set new yourself). package setPrerequisites: #( '..\..\..\Base\Dolphin' '..\..\Base\Dolphin Basic Geometry' '..\..\Base\Dolphin MVP Base' '..\Text\Dolphin Text Presenter' '..\..\Type Converters\Dolphin Type Converters' '..\..\Models\Value\Dolphin Value Models'). package! "Class Definitions"! Dialog subclass: #KeyValuePrompter instanceVariableNames: 'promptPresenter keyPresenter valuePresenter validationBlock' classVariableNames: '' poolDictionaries: '' classInstanceVariableNames: ''! "Global Aliases"! "Loose Methods"! "End of package definition"!
{ "pile_set_name": "Github" }
// // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. // = NetBeans 5.0 FCS Status of Docs Deliverables for NetBeans Plug-in Modules :jbake-type: platform-tutorial :jbake-tags: tutorials :jbake-status: published :syntax: true :source-highlighter: pygments :toc: left :toc-title: :icons: font :experimental: :description: NetBeans 5.0 FCS Status of Docs Deliverables for NetBeans Plug-in Modules - Apache NetBeans :keywords: Apache NetBeans Platform, Platform Tutorials, NetBeans 5.0 FCS Status of Docs Deliverables for NetBeans Plug-in Modules link:mailto:dev@netbeans.apache.org?subject=Feedback:%20NetBeans%20IDE%20Docs%20Plan%20for%20NetBeans%20Modules[Feedback] Below are all the deliverables for developer docs which the docs department was aware of when planning docs for rich-client application developers and plug-in module developers. All deliverables marked *P1* or *P2* were the deliverables to which the docs department commited itself for FCS. All the other deliverables were "nice to have", but no more than that. Explanation of the statuses at time of FCS: * *Planned* means writing has not started, and the related sample -- if any -- has not been put together, but that the basic idea of the deliverable in question is clear and that developers have been identified for help, if necessary. * *Started* means that the sample for the deliverable -- if any -- is being put together and the deliverable has begun to be written but neither have reached a point where they are solid enough to be reviewed. * *First draft* means that the deliverable is available for public consumption -- the steps in the deliverable provide the technical result (i.e., the plug-in works) although there are probably various issues to be solved; there is no conceptual information; the sample code may or may not be attached to the tutorial; the full 4.next features aren't covered. * *Final draft* means that all the 4.next functionality (or, whatever is available at the time) is included in the deliverable, that it includes complete conceptual information, that it has had editorial reviews and technical reviews. Until Frozen status, small tweaks can be added, as well as additional functionality that was added late, but no more. * *Frozen* means frozen, i.e., absolutely no more changes. Next changes to be added will be part of the next release cycle. |=== |*Deliverables* |*Priority &amp; Goal of Deliverable* |*Status on 02/01/06 (i.e., FCS)* |*_Tutorials_* ||--- Quick Start Guide |*P1.* A quick start tutorial for developers interested in developing plug-in extensions for IDE. The tutorial shows how to create, install, modify, and reload a simple NB plug-in that adds a menu item and a toolbar button to the IDE. |Frozen: link:https://netbeans.apache.org/tutorials/quickstart-nbm.html[NetBeans IDE 5.0 Plug-in Module Quick Start Guide] ||--- RCP FeedReader tutorial |*P1.* Platform-specific issues, such as branding. |Frozen (content): Final draft (format): Work being done on adding a template for formatting &amp; consistency. link:https://netbeans.apache.org/tutorials/nbm-feedreader.html[NetBeans IDE 5.0 FeedReader Tutorial] Frozen: link:https://netbeans.apache.org/tutorials/nbm-paintapp.html[NetBeans IDE 5.0 Rich-Client Application Quick Start Guide] ||--- Helpset Tutorial |*P2.* A tutorial that shows how to create your plug-in's help system, integrate it into the standard NB help system, and share it with others. |Frozen: Removed this tutorial, because there is now a wizard and help topics that support this scenario. ||--- Anagram Game Plug-in Tutorial |*P2.* A tutorial that demonstrates the ~TopComponent class of the Windows API. The tutorial shows how to create a plug-in extension that embeds an anagram game in the IDE. |Frozen: link:https://netbeans.apache.org/tutorials/nbm-windowsapi.html[NetBeans Anagram Game Module Tutorial] ||--- Project Sample Tutorial |*P2.* A tutorial that shows how to insert your own project samples into the IDE's New Project wizard and how to share them with others. |Frozen: link:https://netbeans.apache.org/tutorials/nbm-projectsamples.html[NetBeans Project Sample Module Tutorial] ||--- Server Skeleton Tutorial |*P2.* A tutorial that demonstrates the org.netbeans.modules.j2ee.deployment.plugins.api package of the J2EE Server API. The tutorial shows how to build the framework of a server plug-in. Placeholders are provided for your own server-specific implementations. |Frozen for 4.1, but needs to be updated to 5.0: link:https://netbeans.apache.org/tutorials/nbm-server-plugin.html[NetBeans Server-Skeleton Plug-in Tutorial] ||--- System Properties Tutorial |*P2.* A tutorial that demonstrates the org.openide.nodes package of the Nodes API. The tutorial shows how to create a plug-in extension that lets you add, modify, and delete system properties from inside the IDE. |Frozen: link:https://netbeans.apache.org/tutorials/nbm-nodesapi.html[NetBeans System Properties Module Tutorial] ||--- Data Object Tutorial |*P2.* How to create a data object, open it in the IDE, provide cc and syntax highlighting. Manifest file will be used, because it is quite simple. |Frozen: link:https://netbeans.apache.org/tutorials/nbm-filetype.html[NetBeans DataLoader Module Tutorial] First draft: link:https://netbeans.apache.org/tutorials/nbm-mfsyntax.html[NetBeans Manifest File Syntax Highlighting Module Tutorial] Started: NetBeans Code Folding Module Tutorial Planned: NetBeans Code Indentation Module Tutorial Planned: NetBeans Code Completion Module Tutorial ||--- Tag Handler Tutorial |*P3.* A tutorial that demonstrates the ~CookieAction class of the Nodes API. The tutorial shows how to create a plug-in extension that adds a popup menu item to the Source Editor for XML files. When you choose the new popup menu item, the XML file's tags are printed to the Output window. |Frozen: link:https://netbeans.apache.org/tutorials/nbm-taghandler.html[NetBeans Editor Extension Module Tutorial] ||--- File Templates Tutorial |*P3.* How to create and integrate file templates (not including how to create file template wizard) |Frozen: link:https://netbeans.apache.org/tutorials/nbm-filetemplates.html[NetBeans File Template Module Tutorial] ||--- Wizard Tutorial |*P3.* How to create and integrate wizards for files or projects |First draft: I blogged about the Wizard API and the Wizard wizard a lot (and people have been using and referring to them), but I haven't put a tutorial together yet. ||--- Project Templates Tutorial |*P3.* How the IDE recognizes your own project type so that it can be opened in the IDE; how to add a new project type to the New Project wizard; how to use the New Project wizard to create your own project type |Frozen: Removed this tutorial, because there is now a wizard and help topics that support this scenario. ||--- Web Framework Tutorial |*P4.* How to include your own web framework in the IDE, in the same way as Struts and JSF in 4.next. |First draft: I blogged about how to add a web framework's libraries to the Frameworks panel in web applications. But, this hasn't been put into a tutorial yet. |*_Conceptual Docs_* ||--- Glossary |*P1.* Glossary |Frozen: link:https://netbeans.apache.org/tutorials/nbm-glossary.html[Basic Terms for NetBeans Plug-in Module Development] ||--- Introduction to NB APIs |*P1.* Present the most common APIs and provide basic explanations, with references to Javadoc and related tutorials |Frozen: link:https://netbeans.apache.org/tutorials/nbm-idioms.html[Introduction to the NetBeans Idioms and Infrastructure] ||--- Plug-in Extension Diagram |*P3.* Provide a diagram, some kind of visual overview, of which parts of the IDE can be extended by means of plug-ins. |Planned |*_Online Helpset_* ||--- Context sensitive help |*P1.* All u.i. has a help file |Frozen ||--- Built-in help |*P1.* Complete helpset for plug-in developers |Frozen |===
{ "pile_set_name": "Github" }
/* Test for completion thread handling. Copyright (C) 2000-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ #include <aio.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #define MY_SIVAL 27 volatile sig_atomic_t flag; static void callback (sigval_t s) { flag = s.sival_int; } static int wait_flag (void) { while (flag == 0) { puts ("Sleeping..."); sleep (1); } if (flag != MY_SIVAL) { printf ("signal handler received wrong signal, flag is %d\n", flag); return 1; } return 0; } static int do_test (int argc, char *argv[]) { char name[] = "/tmp/aio5.XXXXXX"; int fd; struct aiocb *arr[1]; struct aiocb cb; static const char buf[] = "Hello World\n"; struct sigevent ev; fd = mkstemp (name); if (fd == -1) { printf ("cannot open temp name: %m\n"); return 1; } unlink (name); arr[0] = &cb; cb.aio_fildes = fd; cb.aio_lio_opcode = LIO_WRITE; cb.aio_reqprio = 0; cb.aio_buf = (void *) buf; cb.aio_nbytes = sizeof (buf) - 1; cb.aio_offset = 0; cb.aio_sigevent.sigev_notify = SIGEV_THREAD; cb.aio_sigevent.sigev_notify_function = callback; cb.aio_sigevent.sigev_notify_attributes = NULL; cb.aio_sigevent.sigev_value.sival_int = MY_SIVAL; ev.sigev_notify = SIGEV_THREAD; ev.sigev_notify_function = callback; ev.sigev_notify_attributes = NULL; ev.sigev_value.sival_int = MY_SIVAL; /* First use aio_write. */ if (aio_write (arr[0]) < 0) { if (errno == ENOSYS) { puts ("no aio support in this configuration"); return 0; } printf ("aio_write failed: %m\n"); return 1; } if (wait_flag ()) return 1; puts ("aio_write OK"); flag = 0; /* Again with lio_listio. */ if (lio_listio (LIO_NOWAIT, arr, 1, &ev) < 0) { printf ("lio_listio failed: %m\n"); return 1; } if (wait_flag ()) return 1; puts ("all OK"); return 0; } #include "../test-skeleton.c"
{ "pile_set_name": "Github" }
package com.mmnaseri.cs.clrs.ch29.s1.dsl; /** * @author Milad Naseri (milad.naseri@cdk.com) * @since 1.0 (8/31/16, 11:43 AM) */ public interface Finalizer<E extends Number> extends Maximize<E> { }
{ "pile_set_name": "Github" }
## To deploy and try out the AppEngine application: From CloudShell: * ./deploy.sh * Visit https://<project-name>.appspot.com/ * Use the form to send a request to the service ## To deploy and try out the Dataflow service: * ./run_dataflow.sh
{ "pile_set_name": "Github" }
Hymod Board Database (C) Copyright 2001 Murray Jensen <Murray.Jensen@csiro.au> CSIRO Manufacturing Science and Technology, Preston Lab 25-Jun-01 This stuff is a set of PHP/MySQL scripts to implement a custom board database. It will need *extensive* hacking to modify it to keep the information about your custom boards that you want, however it is a good starting point. How it is used: 1. a board has gone through all the hardware testing etc and is ready to have the flash programmed for the first time - first you go to a web page and fill in information about the board in a form to register it in a database 2. the web stuff allocates a (unique) serial number and (optionally) a (locally administered) ethernet address and stores the information in a database using the serial number as the key (can do whole batches of boards in one go and/or use a previously registered board as defaults for the new board(s)) 3. it then creates a file in the tftp area of a server somewhere containing the board information in a simple text format (one per serial number) 4. all hymod boards have an i2c eeprom, and when U-Boot sees that the eeprom is unitialised, it prompts for a serial number and ethernet address (if not set), then transfers the file created in step 3 from the server and initialises the eeprom from its contents What this means is you can't boot the board until you have allocated a serial number, but you don't have to type it all twice - you do it once on the web and the board then finds the info it needs to initialise its eeprom. The other side of the coin is the reading of the eeprom and how it gets passed to Linux (or another O/S). To see how this is all done for the hymod boards look at the code in the "board/hymod" directory and in the file "include/asm/hymod.h". Hymod boards can have a mezzanine card which also have an eeprom that needs allocating, the same process is used for these as well - just a different i2c address. Other forms provide the following functions: - browsing the board database - editing board information (one at a time) - maintaining/browsing a (simple) per board event log You will need: MySQL (I use version 3.23.7-alpha), PHP4 (with MySQL support enabled) and a web server (I use Apache 1.3.x). I originally started by using phpMyBuilder (http://kyber.dk/phpMyBuilder) but it soon got far more complicated than that could handle (but I left the copyright messages in there anyway). Most of the code resides in the common defs.php file, which shouldn't need much alteration - all the work will be in shaping the front-end php files to your liking. Here's a quick summary of what needs doing to use it for your boards: 1. get phpMyAdmin (http://phpwizard.net/projects/phpMyAdmin/) - it's an invaluable tool for this sort of stuff (this step is optional of course) 2. edit "bddb.css" to your taste, if you could be bothered - I have no idea what is in there or what it does - I copied it from somewhere else ("user.css" from the phpMyEdit (http://phpmyedit.sourcerforge.net) package, I think) - I figure one day I'll see what sort of things I can change in there. 3. create a mysql database - call it whatever you like 4. edit "create_tables.sql" and modify the "boards" table schema to reflect the information you want to keep about your boards. It may or may not be easier to do this and the next step in phpMyAdmin. Check out the MySQL documentation at http://www.mysql.com/doc/ in particular the column types at http://www.mysql.com/doc/C/o/Column_types.html - Note there is only support for a few data types: int - presented as an html text input char/text - presented as an html text input date - presented as an html text input enum - presented as an html radio input I also have what I call "enum_multi" which is a set of enums with the same name, but suffixed with a number e.g. fred0, fred1, fred2. These are presented as a number of html select's with a single label "fred" this is useful for board characteristics that have multiple items of the same type e.g. multiple banks of sdram. 5. use the "create_tables.sql" file to create the "boards" table in the database e.g. mysql dbname < create_tables.sql 6. create a user and password for the web server to log into the MySQL database with; give this user select, insert and update privileges to the database created in 3 (and delete, if you want the "delete" functions in the edit forms to work- I have this turned off). phpMyAdmin helps in this step. 7. edit "config.php" and set the variables: $mysql_user, $mysql_pw, $mysql_db, $bddb_cfgdir and $bddb_label - keep the contents of this file secret - it contains the web servers username and password (the three $mysql_* vars are set from the previous step) 8. edit "defs.php" and a. adjust the various enum value arrays and b. edit the function "pg_foot()" to remove my email address :-) 9. do major hacking on the following files: browse.php, doedit.php, donew.php, edit.php and new.php to reflect your database schema - fortunately the hacking is fairly straight-forward, but it is boring and time-consuming. These notes were written rather hastily - if you find any obvious problems please let me know.
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head xmlns:dyn="http://exslt.org/dynamic"> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="style.css" type="text/css" media="screen"> <link rel="stylesheet" href="print.css" type="text/css" media="print"> <title>Appendixes</title> </head> <body> <script type="text/javascript" language="javascript" src="asdoc.js"></script><script type="text/javascript" language="javascript" src="cookies.js"></script><script type="text/javascript" language="javascript"> <!-- asdocTitle = 'Appendixes - API Documentation'; var baseRef = ''; window.onload = configPage; --></script> <table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable"> <tr> <td align="left" class="titleTableTitle">"RestfulX Framework 1.3.1 API Documenation"</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('all-classes.html')" href="package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('all-classes.html')" href="class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('index-list.html')" href="all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="index.html?appendixes.html&amp;all-classes.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="images/logo.jpg"></td> </tr> <tr class="titleTableRow2"> <td align="left" id="subTitle" class="titleTableSubTitle">Appendixes</td><td align="right" id="subNav" class="titleTableSubNav"></td> </tr> <tr class="titleTableRow3"> <td colspan="2">&nbsp;</td> </tr> </table> <script type="text/javascript" language="javascript"> <!-- if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Appendixes"); titleBar_setSubNav(false,false,false,false,false,false,false,false,false,false,false,false,false,false);} --></script> <div class="MainContent"> <br> <br> <table class="summaryTable" cellspacing="0" cellpadding="3"> <tr> <th>&nbsp;</th><th width="25%">Appendix</th><th width="75%">Description</th> </tr> </table> <p></p> <center class="copyright"> </center> </div> </body> </html> <!-- -->
{ "pile_set_name": "Github" }
/* * Copyright 2012 ZXing authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #import "ZXBookmarkDoCoMoResultParser.h" #import "ZXResult.h" #import "ZXURIParsedResult.h" #import "ZXURIResultParser.h" @implementation ZXBookmarkDoCoMoResultParser - (ZXParsedResult *)parse:(ZXResult *)result { NSString *rawText = [result text]; if (![rawText hasPrefix:@"MEBKM:"]) { return nil; } NSString *title = [[self class] matchSingleDoCoMoPrefixedField:@"TITLE:" rawText:rawText trim:YES]; NSArray *rawUri = [[self class] matchDoCoMoPrefixedField:@"URL:" rawText:rawText trim:YES]; if (rawUri == nil) { return nil; } NSString *uri = rawUri[0]; if (![ZXURIResultParser isBasicallyValidURI:uri]) { return nil; } return [ZXURIParsedResult uriParsedResultWithUri:uri title:title]; } @end
{ "pile_set_name": "Github" }
/** * Variables. */ /** * Body. */ body { font: 100 16px/1.5 "Source Sans", sans-serif; color: white; background-color: #1C1521; } a { color: #847AD1; text-decoration: underline; -webkit-transition: color .2s; transition: color .2s; } a:visited { color: #663399; } a:hover { color: rgb(157, 149, 218); } pre { font: 300 12px/1.2 "Source Code", monospace; color: rgb(204, 207, 221); } /** * Sections. */ .Header, .Section, .Footer { position: relative; padding: 4em 1.5em; } .Section-title { font-size: 1.5em; margin-bottom: .25em; text-align: center; } .Section-description { color: #989EBA; margin-bottom: 1em; } .Section-example { margin-top: 1em; border-radius: .2em; background: #1C1521; padding: 1em; overflow: hidden; } .Section-example-code b { font-weight: 600; color: #847AD1; } .Section-example-code em { font-style: normal; font-weight: 600; color: #5790EF; } .Section-example-code s { font-style: normal; text-decoration: none; color: #605668; } .Section-legend { text-align: center; color: #989EBA; margin-top: .75em; } /** * Header. */ .Header { background: url(images/background.jpg); background-size: cover; text-align: center; padding-bottom: 6em; } .Header-title { font-size: 1.5em; margin-bottom: 4em; } .Header-subtitle { font-size: 2.5em; margin-bottom: .6em; } .Header-description { max-width: 30em; margin-right: auto; margin-left: auto; } .Header-github-link { display: block; position: absolute; top: 3em; right: -6.5em; padding: 1em; width: 20em; text-align: center; background-color: #847AD1; text-transform: uppercase; font-size: .6em; color: white; letter-spacing: 1px; text-decoration: none; white-space: nowrap; -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); -webkit-transform-origin: 50% 50%; -ms-transform-origin: 50% 50%; transform-origin: 50% 50%; } .Header-github-link:hover { font-weight: normal; color: white; } /** * Feature section. */ .Section--feature { background-color: #26202B; } .Section--feature + .Section--feature { padding-top: 0; } .animate .Section--feature .Section-title, .animate .Section--feature .Section-description, .animate .Section--feature .Section-example { opacity: 0; } .Section--feature .Section-description { text-align: center; } /** * First and last feature. */ .Section--feature-variables::before, .Section--feature-no-prefixes::after { content: ''; position: absolute; right: 0; left: 0; } /** * First feature. */ .Section--feature-variables::before { height: 6em; bottom: 100%; background: -webkit-linear-gradient(top, transparent, #26202B); background: linear-gradient(to bottom, transparent, #26202B); } /** * Last feature. */ .Section--feature-no-prefixes { padding-bottom: 2em; } .Section--feature-no-prefixes::after { height: 14em; top: 100%; background: -webkit-linear-gradient(top, #26202B, transparent); background: linear-gradient(to bottom, #26202B, transparent); } /** * Install section. */ .Section--install { padding-top: 2em; padding-bottom: 0; } .Section--install .Section-example { background-color: #120C17; } .Section--install .Section-example-code { line-height: 1.4; } /** * Why section. */ .Section--why .Section-description { color: #989EBA; } /** * Footer. */ .Footer { padding-top: 0; text-align: center; } .Footer-title { font-size: 1.5em; -webkit-transition: -webkit-transform .2s; transition: transform .2s; } .Footer-title:hover { -webkit-transform: scale(1.1); -ms-transform: scale(1.1); transform: scale(1.1); } .Footer-subtitle { color: #989EBA; font-size: .7em; text-transform: uppercase; letter-spacing: 1px; margin-bottom: .5em; } /** * Animation, only happens on first load. */ .Header-subtitle { -webkit-transition: opacity 2s ease-in-out .5s; transition: opacity 2s ease-in-out .5s; } .Header-description { -webkit-transition: opacity 2s ease-in-out 2.5s; transition: opacity 2s ease-in-out 2.5s; } .Header-github-link, .Section--feature .Section-title, .Section--feature .Section-description, .Section--feature .Section-example { -webkit-transition: opacity 2s ease-in-out 4.5s; transition: opacity 2s ease-in-out 4.5s; } .animate .Header-subtitle, .animate .Header-description, .animate .Header-github-link, .animate .Section--feature .Section-title, .animate .Section--feature .Section-description, .animate .Section--feature .Section-example { opacity: 0; } /** * Small screens. */ @media (max-width: 767px) { .Section--feature .Section-example-code:last-child { display: none; /* keep it simpler, just show the api */ } .Section--install s { display: none; /* breaks the line, and just not worth it */ } } /** * Large screens. */ @media (min-width: 768px) { body { font-size: 18px; } pre { font-size: 14px; } /** * Sections. */ .Header, .Section, .Footer { padding: 6em 2em; } .Section-title { font-size: 1.8em; } .Section-example { margin-top: 1.5em; padding: 1.5em; } /** * Header. */ .Header { font-size: 1.2em; padding-bottom: 14%; } .Header-subtitle { font-size: 2.5em; } .Header-description { max-width: 30em; margin-right: auto; margin-left: auto; } .Header-github-link { top: 4em; right: -5em; } /** * Feature section. */ .Section--feature .Section-title, .Section--feature .Section-description, .Section--feature .Section-example { max-width: 40em; margin-right: auto; margin-left: auto; } .Section--feature .Section-example { background-image: url(images/example-background.png); background-position: center center; background-repeat: no-repeat; } .Section--feature .Section-example-code { width: 50%; float: left; box-sizing: border-box; } .Section--feature .Section-example-code:first-child { padding-left: 1em; } .Section--feature .Section-example-code:last-child { padding-left: 3.5em; } /** * Install & Why sections. */ .Section--install, .Section--why { max-width: 26em; margin-right: auto; margin-left: auto; } /** * Install section. */ .Section--install { padding-top: 8em; } .Section--install .Section-example { width: 24em; margin-right: auto; margin-left: auto; } .Section--install .Section-example-code { font-size: 1em; } /** * Why section. */ .Section--why { padding-top: 0; padding-bottom: 0; } }
{ "pile_set_name": "Github" }
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { StyleSheet, View, Text, ImageBackground, Dimensions, LayoutAnimation, UIManager, KeyboardAvoidingView, } from 'react-native'; import { Input, Button, Icon } from 'react-native-elements'; const SCREEN_WIDTH = Dimensions.get('window').width; const SCREEN_HEIGHT = Dimensions.get('window').height; const BG_IMAGE = require('../../../assets/images/bg_screen4.jpg'); // Enable LayoutAnimation on Android UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true); const TabSelector = ({ selected }) => { return ( <View style={styles.selectorContainer}> <View style={selected && styles.selected} /> </View> ); }; TabSelector.propTypes = { selected: PropTypes.bool.isRequired, }; export default class LoginScreen2 extends Component { constructor(props) { super(props); this.state = { email: '', password: '', selectedCategory: 0, isLoading: false, isEmailValid: true, isPasswordValid: true, isConfirmationValid: true, }; this.selectCategory = this.selectCategory.bind(this); this.login = this.login.bind(this); this.signUp = this.signUp.bind(this); } selectCategory(selectedCategory) { LayoutAnimation.easeInEaseOut(); this.setState({ selectedCategory, isLoading: false, }); } validateEmail(email) { var re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); } login() { const { email, password } = this.state; this.setState({ isLoading: true }); // Simulate an API call setTimeout(() => { LayoutAnimation.easeInEaseOut(); this.setState({ isLoading: false, isEmailValid: this.validateEmail(email) || this.emailInput.shake(), isPasswordValid: password.length >= 8 || this.passwordInput.shake(), }); }, 1500); } signUp() { const { email, password, passwordConfirmation } = this.state; this.setState({ isLoading: true }); // Simulate an API call setTimeout(() => { LayoutAnimation.easeInEaseOut(); this.setState({ isLoading: false, isEmailValid: this.validateEmail(email) || this.emailInput.shake(), isPasswordValid: password.length >= 8 || this.passwordInput.shake(), isConfirmationValid: password === passwordConfirmation || this.confirmationInput.shake(), }); }, 1500); } render() { const { selectedCategory, isLoading, isEmailValid, isPasswordValid, isConfirmationValid, email, password, passwordConfirmation, } = this.state; const isLoginPage = selectedCategory === 0; const isSignUpPage = selectedCategory === 1; return ( <View style={styles.container}> <ImageBackground source={BG_IMAGE} style={styles.bgImage}> <View> <KeyboardAvoidingView contentContainerStyle={styles.loginContainer} behavior="position" > <View style={styles.titleContainer}> <View style={{ flexDirection: 'row' }}> <Text style={styles.titleText}>BEAUX</Text> </View> <View style={{ marginTop: -10, marginLeft: 10 }}> <Text style={styles.titleText}>VOYAGES</Text> </View> </View> <View style={{ flexDirection: 'row' }}> <Button disabled={isLoading} type="clear" activeOpacity={0.7} onPress={() => this.selectCategory(0)} containerStyle={{ flex: 1 }} titleStyle={[ styles.categoryText, isLoginPage && styles.selectedCategoryText, ]} title={'Login'} /> <Button disabled={isLoading} type="clear" activeOpacity={0.7} onPress={() => this.selectCategory(1)} containerStyle={{ flex: 1 }} titleStyle={[ styles.categoryText, isSignUpPage && styles.selectedCategoryText, ]} title={'Sign up'} /> </View> <View style={styles.rowSelector}> <TabSelector selected={isLoginPage} /> <TabSelector selected={isSignUpPage} /> </View> <View style={styles.formContainer}> <Input leftIcon={ <Icon name="envelope-o" type="font-awesome" color="rgba(0, 0, 0, 0.38)" size={25} style={{ backgroundColor: 'transparent' }} /> } value={email} keyboardAppearance="light" autoFocus={false} autoCapitalize="none" autoCorrect={false} keyboardType="email-address" returnKeyType="next" inputStyle={{ marginLeft: 10 }} placeholder={'Email'} containerStyle={{ borderBottomColor: 'rgba(0, 0, 0, 0.38)', }} ref={(input) => (this.emailInput = input)} onSubmitEditing={() => this.passwordInput.focus()} onChangeText={(email) => this.setState({ email })} errorMessage={ isEmailValid ? null : 'Please enter a valid email address' } /> <Input leftIcon={ <Icon name="lock" type="simple-line-icon" color="rgba(0, 0, 0, 0.38)" size={25} style={{ backgroundColor: 'transparent' }} /> } value={password} keyboardAppearance="light" autoCapitalize="none" autoCorrect={false} secureTextEntry={true} returnKeyType={isSignUpPage ? 'next' : 'done'} blurOnSubmit={true} containerStyle={{ marginTop: 16, borderBottomColor: 'rgba(0, 0, 0, 0.38)', }} inputStyle={{ marginLeft: 10 }} placeholder={'Password'} ref={(input) => (this.passwordInput = input)} onSubmitEditing={() => isSignUpPage ? this.confirmationInput.focus() : this.login() } onChangeText={(password) => this.setState({ password })} errorMessage={ isPasswordValid ? null : 'Please enter at least 8 characters' } /> {isSignUpPage && ( <Input icon={ <Icon name="lock" type="simple-line-icon" color="rgba(0, 0, 0, 0.38)" size={25} style={{ backgroundColor: 'transparent' }} /> } value={passwordConfirmation} secureTextEntry={true} keyboardAppearance="light" autoCapitalize="none" autoCorrect={false} keyboardType="default" returnKeyType={'done'} blurOnSubmit={true} containerStyle={{ marginTop: 16, borderBottomColor: 'rgba(0, 0, 0, 0.38)', }} inputStyle={{ marginLeft: 10 }} placeholder={'Confirm password'} ref={(input) => (this.confirmationInput = input)} onSubmitEditing={this.signUp} onChangeText={(passwordConfirmation) => this.setState({ passwordConfirmation }) } errorMessage={ isConfirmationValid ? null : 'Please enter the same password' } /> )} <Button buttonStyle={styles.loginButton} containerStyle={{ marginTop: 32, flex: 0 }} activeOpacity={0.8} title={isLoginPage ? 'LOGIN' : 'SIGN UP'} onPress={isLoginPage ? this.login : this.signUp} titleStyle={styles.loginTextButton} loading={isLoading} disabled={isLoading} /> </View> </KeyboardAvoidingView> <View style={styles.helpContainer}> <Button title={'Need help ?'} titleStyle={{ color: 'white' }} buttonStyle={{ backgroundColor: 'transparent' }} underlayColor="transparent" onPress={() => console.log('Account created')} /> </View> </View> </ImageBackground> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1, }, rowSelector: { height: 20, flexDirection: 'row', alignItems: 'center', }, selectorContainer: { flex: 1, alignItems: 'center', }, selected: { position: 'absolute', borderRadius: 50, height: 0, width: 0, top: -5, borderRightWidth: 70, borderBottomWidth: 70, borderColor: 'white', backgroundColor: 'white', }, loginContainer: { alignItems: 'center', justifyContent: 'center', }, loginTextButton: { fontSize: 16, color: 'white', fontWeight: 'bold', }, loginButton: { backgroundColor: 'rgba(232, 147, 142, 1)', borderRadius: 10, height: 50, width: 200, }, titleContainer: { height: 150, backgroundColor: 'transparent', justifyContent: 'center', }, formContainer: { backgroundColor: 'white', width: SCREEN_WIDTH - 30, borderRadius: 10, paddingTop: 32, paddingBottom: 32, alignItems: 'center', }, loginText: { fontSize: 16, fontWeight: 'bold', color: 'white', }, bgImage: { flex: 1, top: 0, left: 0, width: SCREEN_WIDTH, height: SCREEN_HEIGHT, justifyContent: 'center', alignItems: 'center', }, categoryText: { textAlign: 'center', color: 'white', fontSize: 24, fontFamily: 'light', backgroundColor: 'transparent', opacity: 0.54, }, selectedCategoryText: { opacity: 1, }, titleText: { color: 'white', fontSize: 30, fontFamily: 'regular', }, helpContainer: { height: 64, alignItems: 'center', justifyContent: 'center', }, });
{ "pile_set_name": "Github" }
/* This file was generated automatically by the Mojo IDE version B1.3.6. Do not edit this file directly. Instead edit the original Lucid source. This is a temporary file and any changes made to it will be destroyed. */ /* Parameters: CLK_FREQ = 50000000 BAUD = 500000 */ module avr_interface ( input clk, input rst, input cclk, output reg spi_miso, input spi_mosi, input spi_sck, input spi_ss, output reg [3:0] spi_channel, output reg tx, input rx, input [3:0] channel, output reg new_sample, output reg [9:0] sample, output reg [3:0] sample_channel, input [7:0] tx_data, input new_tx_data, output reg tx_busy, input tx_block, output reg [7:0] rx_data, output reg new_rx_data ); localparam CLK_FREQ = 26'h2faf080; localparam BAUD = 19'h7a120; reg n_rdy; wire [1-1:0] M_cclk_detector_ready; reg [1-1:0] M_cclk_detector_cclk; cclk_detector cclk_detector ( .clk(clk), .rst(rst), .cclk(M_cclk_detector_cclk), .ready(M_cclk_detector_ready) ); wire [1-1:0] M_spi_slave_miso; wire [1-1:0] M_spi_slave_done; wire [8-1:0] M_spi_slave_data_out; reg [1-1:0] M_spi_slave_ss; reg [1-1:0] M_spi_slave_mosi; reg [1-1:0] M_spi_slave_sck; reg [8-1:0] M_spi_slave_data_in; spi_slave spi_slave ( .clk(clk), .rst(n_rdy), .ss(M_spi_slave_ss), .mosi(M_spi_slave_mosi), .sck(M_spi_slave_sck), .data_in(M_spi_slave_data_in), .miso(M_spi_slave_miso), .done(M_spi_slave_done), .data_out(M_spi_slave_data_out) ); wire [8-1:0] M_uart_rx_data; wire [1-1:0] M_uart_rx_new_data; reg [1-1:0] M_uart_rx_rx; uart_rx uart_rx ( .clk(clk), .rst(n_rdy), .rx(M_uart_rx_rx), .data(M_uart_rx_data), .new_data(M_uart_rx_new_data) ); wire [1-1:0] M_uart_tx_tx; wire [1-1:0] M_uart_tx_busy; reg [1-1:0] M_uart_tx_block; reg [8-1:0] M_uart_tx_data; reg [1-1:0] M_uart_tx_new_data; uart_tx uart_tx ( .clk(clk), .rst(n_rdy), .block(M_uart_tx_block), .data(M_uart_tx_data), .new_data(M_uart_tx_new_data), .tx(M_uart_tx_tx), .busy(M_uart_tx_busy) ); reg M_newSampleReg_d, M_newSampleReg_q = 1'h0; reg [9:0] M_sampleReg_d, M_sampleReg_q = 1'h0; reg [3:0] M_sampleChannelReg_d, M_sampleChannelReg_q = 1'h0; reg [1:0] M_byteCt_d, M_byteCt_q = 1'h0; reg [3:0] M_block_d, M_block_q = 1'h0; reg M_busy_d, M_busy_q = 1'h0; always @* begin M_newSampleReg_d = M_newSampleReg_q; M_sampleChannelReg_d = M_sampleChannelReg_q; M_byteCt_d = M_byteCt_q; M_busy_d = M_busy_q; M_block_d = M_block_q; M_sampleReg_d = M_sampleReg_q; n_rdy = ~M_cclk_detector_ready; M_cclk_detector_cclk = cclk; M_spi_slave_sck = spi_sck; M_spi_slave_mosi = spi_mosi; M_spi_slave_data_in = 8'hff; M_spi_slave_ss = spi_ss; M_uart_rx_rx = rx; M_uart_tx_data = tx_data; M_uart_tx_new_data = new_tx_data; M_uart_tx_block = M_busy_q; M_block_d = {M_block_q[0+2-:3], tx_block}; new_sample = M_newSampleReg_q; sample = M_sampleReg_q; sample_channel = M_sampleChannelReg_q; tx_busy = M_uart_tx_busy; rx_data = M_uart_rx_data; new_rx_data = M_uart_rx_new_data; spi_channel = M_cclk_detector_ready ? channel : 4'bzzzz; spi_miso = M_cclk_detector_ready && !spi_ss ? M_spi_slave_miso : 1'bz; tx = M_cclk_detector_ready ? M_uart_tx_tx : 1'bz; M_newSampleReg_d = 1'h0; if (M_block_q[3+0-:1] ^ M_block_q[2+0-:1]) begin M_busy_d = 1'h0; end if (!M_uart_tx_busy && new_tx_data) begin M_busy_d = 1'h1; end if (spi_ss) begin M_byteCt_d = 1'h0; end if (M_spi_slave_done) begin if (M_byteCt_q == 1'h0) begin M_sampleReg_d[0+7-:8] = M_spi_slave_data_out; M_byteCt_d = 1'h1; end else begin if (M_byteCt_q == 1'h1) begin M_sampleReg_d[8+1-:2] = M_spi_slave_data_out[0+1-:2]; M_sampleChannelReg_d = M_spi_slave_data_out[4+3-:4]; M_byteCt_d = 2'h2; M_newSampleReg_d = 1'h1; end end end end always @(posedge clk) begin M_block_q <= M_block_d; M_busy_q <= M_busy_d; if (n_rdy == 1'b1) begin M_newSampleReg_q <= 1'h0; M_sampleReg_q <= 1'h0; M_sampleChannelReg_q <= 1'h0; M_byteCt_q <= 1'h0; end else begin M_newSampleReg_q <= M_newSampleReg_d; M_sampleReg_q <= M_sampleReg_d; M_sampleChannelReg_q <= M_sampleChannelReg_d; M_byteCt_q <= M_byteCt_d; end end endmodule
{ "pile_set_name": "Github" }
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ #include "task.h" TEST_IMPL(fail_always) { /* This test always fails. It is used to test the test runner. */ FATAL("Yes, it always fails"); return 2; }
{ "pile_set_name": "Github" }
/** * Marlin 3D Printer Firmware * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ // // Level Bed Corners menu // #include "../../inc/MarlinConfigPre.h" #if HAS_LCD_MENU && ENABLED(LEVEL_BED_CORNERS) #include "menu.h" #include "../../module/motion.h" #include "../../module/planner.h" #if HAS_LEVELING #include "../../feature/bedlevel/bedlevel.h" #endif #ifndef LEVEL_CORNERS_Z_HOP #define LEVEL_CORNERS_Z_HOP 4.0 #endif #ifndef LEVEL_CORNERS_HEIGHT #define LEVEL_CORNERS_HEIGHT 0.0 #endif static_assert(LEVEL_CORNERS_Z_HOP >= 0, "LEVEL_CORNERS_Z_HOP must be >= 0. Please update your configuration."); #if HAS_LEVELING static bool leveling_was_active = false; #endif /** * Level corners, starting in the front-left corner. */ static int8_t bed_corner; static inline void _lcd_goto_next_corner() { line_to_z(LEVEL_CORNERS_Z_HOP); switch (bed_corner) { case 0: current_position[X_AXIS] = X_MIN_BED + LEVEL_CORNERS_INSET; current_position[Y_AXIS] = Y_MIN_BED + LEVEL_CORNERS_INSET; break; case 1: current_position[X_AXIS] = X_MAX_BED - LEVEL_CORNERS_INSET; break; case 2: current_position[Y_AXIS] = Y_MAX_BED - LEVEL_CORNERS_INSET; break; case 3: current_position[X_AXIS] = X_MIN_BED + LEVEL_CORNERS_INSET; break; #if ENABLED(LEVEL_CENTER_TOO) case 4: current_position[X_AXIS] = X_CENTER; current_position[Y_AXIS] = Y_CENTER; break; #endif } planner.buffer_line(current_position, MMM_TO_MMS(manual_feedrate_mm_m[X_AXIS]), active_extruder); line_to_z(LEVEL_CORNERS_HEIGHT); if (++bed_corner > 3 #if ENABLED(LEVEL_CENTER_TOO) + 1 #endif ) bed_corner = 0; } static inline void menu_level_bed_corners() { do_select_screen( PSTR(MSG_BUTTON_NEXT), PSTR(MSG_BUTTON_DONE), _lcd_goto_next_corner, []{ #if HAS_LEVELING set_bed_leveling_enabled(leveling_was_active); #endif ui.goto_previous_screen_no_defer(); }, PSTR( #if ENABLED(LEVEL_CENTER_TOO) MSG_LEVEL_BED_NEXT_POINT #else MSG_NEXT_CORNER #endif ), nullptr, PSTR("?") ); } static inline void _lcd_level_bed_corners_homing() { _lcd_draw_homing(); if (all_axes_homed()) { bed_corner = 0; ui.goto_screen(menu_level_bed_corners); set_ui_selection(true); _lcd_goto_next_corner(); } } void _lcd_level_bed_corners() { ui.defer_status_screen(); if (!all_axes_known()) { set_all_unhomed(); enqueue_and_echo_commands_P(PSTR("G28")); } // Disable leveling so the planner won't mess with us #if HAS_LEVELING leveling_was_active = planner.leveling_active; set_bed_leveling_enabled(false); #endif ui.goto_screen(_lcd_level_bed_corners_homing); } #endif // HAS_LCD_MENU && LEVEL_BED_CORNERS
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <title>Selenium Page Object Generator Options</title> <link rel="stylesheet" href="assets/css/options.css"/> </head> <body> <fieldset> <legend>Target</legend> <select id="target"></select> </fieldset> <fieldset> <legend>Attributes</legend> <div class="left"> <ul> <li> <label for="attributes.letter">Letter Case:</label> <select id="attributes.letter"> <option value="3">Camel</option> <option value="2">Lower</option> <option value="4">Natural</option> <option value="5">Proper</option> <option value="6">Upper</option> </select> </li> <li> <label for="attributes.indent">Indent:</label> <input type="checkbox" id="attributes.indent"> </li> </ul> </div> <div class="right valign"> <label for="attributes.separator">Separator:</label> <input type="text" id="attributes.separator" value=""> </div> </fieldset> <fieldset> <legend>Copyright</legend> <ul> <li> <label for="copyright.claimant">Claimant:</label> <input type="text" id="copyright.claimant" value=""> </li> <li> <label for="copyright.year">Year:</label> <input type="number" id="copyright.year" value=""> </li> </ul> </fieldset> <fieldset> <legend>Fill</legend> <label for="fill.separator">Separator:</label> <input type="text" id="fill.separator" value=""> </fieldset> <fieldset> <legend>Model</legend> <ul> <li> <label for="model.namespace">Namespace:</label> <input type="text" id="model.namespace" value=""> </li> <li> <label for="model.include">Include namespace in filename:</label> <input type="checkbox" id="model.include"> </li> </ul> </fieldset> <fieldset> <legend>Nodes</legend> <div class="left"> <ul> <li> <label for="nodes.angular">Test Framework Has AngularJS Locators Support:</label> <input type="checkbox" id="nodes.angular"> </li> <li> <label for="nodes.root">Root Selector:</label> <input type="text" id="nodes.root" value=""> </li> </ul> </div> <div class="right"> <ul> <li> <label for="nodes.selector">Selector:</label> <input type="text" id="nodes.selector" value=""> </li> <li> <label for="nodes.visibility">Visibility:</label> <select id="nodes.visibility"> <!--<option value="1">Hidden</option>--> <option value="2">Visible</option> <option value="3">All</option> </select> </li> </ul> </div> </fieldset> <fieldset> <legend>Operations</legend> <ul> <li> <label for="operations.fill">Include Fill:</label> <input type="checkbox" id="operations.fill"> </li> <li> <label for="operations.fill.submit">Include Fill and Submit:</label> <input type="checkbox" id="operations.fill.submit"> </li> <li> <label for="operations.submit">Include Submit:</label> <input type="checkbox" id="operations.submit"> </li> <li> <label for="operations.verify.loaded">Include Verify Page Loaded:</label> <input type="checkbox" id="operations.verify.loaded"> </li> <li> <label for="operations.verify.url">Include Verify Page URL:</label> <input type="checkbox" id="operations.verify.url"> </li> <li> <div class="left"> <label for="operations.letter">Letter Case:</label> <select id="operations.letter"> <option value="3">Camel</option> <option value="2">Lower</option> <option value="4">Natural</option> <option value="5">Proper</option> <option value="6">Upper</option> </select> </div> <div class="right"> <label for="operations.separator">Separator:</label> <input type="text" id="operations.separator" value=""> </div> </li> </ul> </fieldset> <fieldset> <legend>Timeout</legend> <input type="text" id="timeout" value=""> </fieldset> <fieldset> <legend>Template (Handlebars.js expression)</legend> <textarea id="template"></textarea> </fieldset> <div class="preloader"></div> <button class="save"><span class="fa fa-save"></span>Save</button> <button class="restore"><span class="fa fa-undo"></span>Restore To Factory Options</button> <span class="notify"></span> <script src="assets/js/options.js"></script> </body> </html>
{ "pile_set_name": "Github" }
# -*- mode: makefile -*- # ----------------------------------------------------------------- # Programmer: Slaven Peles, Cody Balos @ LLNL # ----------------------------------------------------------------- # SUNDIALS Copyright Start # Copyright (c) 2002-2020, Lawrence Livermore National Security # and Southern Methodist University. # All rights reserved. # # See the top-level LICENSE and NOTICE files for details. # # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ----------------------------------------------------------------- # Makefile for @SOLVER@ RAJA examples # # This file is generated from a template using various variables # set at configuration time. It can be used as a template for # other user Makefiles. # ----------------------------------------------------------------- SHELL = @SHELL@ prefix = @prefix@ exec_prefix = @exec_prefix@ includedir = @includedir@ libdir = @libdir@ CC = @CMAKE_C_COMPILER@ CFLAGS = @CMAKE_C_FLAGS@ CXX = @CMAKE_CXX_COMPILER@ NVCC = @CMAKE_CUDA_COMPILER@ NVCCFLAGS = $(subst ;, ,@CMAKE_CUDA_FLAGS@) LD = ${NVCC} LDFLAGS = @LDFLAGS@ -Xcompiler \"-Wl,-rpath,${libdir}\" LIBS = @LIBS@ RAJA_INC_DIR= @RAJA_INCLUDE_PATH@ RAJA_LIB_DIR= @RAJA_LIB_DIR@ RAJAFLAGS = $(subst ;, ,@RAJA_NVCC_FLAGS@) RAJALIBS = -lRAJA TMP_INCS = ${includedir} ${RAJA_INC_DIR} INCLUDES = $(addprefix -I, ${TMP_INCS}) TMP_LIBDIRS = ${libdir} ${RAJA_LIB_DIR} LIBDIRS = $(addprefix -L, ${TMP_LIBDIRS}) TMP_SUNDIALSLIBS = @SOLVER_LIB@ @NVECTOR_LIB@ SUNDIALSLIBS = $(addprefix -l, ${TMP_SUNDIALSLIBS}) LIBRARIES = ${SUNDIALSLIBS} ${RAJALIBS} ${LIBS} EXAMPLES = @EXAMPLES@ @EXAMPLES_BL@ EXAMPLES_DEPENDENCIES = @EXAMPLES_DEPENDENCIES@ OBJECTS = ${EXAMPLES:=.o} OBJECTS_DEPENDENCIES = ${EXAMPLES_DEPENDENCIES:=.o} # ----------------------------------------------------------------------------------------- .SUFFIXES : .o .cu .c.o : ${CC} ${CFLAGS} ${INCLUDES} -c $< .cu.o : ${NVCC} ${NVCCFLAGS} ${RAJAFLAGS} ${INCLUDES} -c $< # ----------------------------------------------------------------------------------------- all: ${OBJECTS} @for i in ${EXAMPLES} ; do \ echo "${LD} -o $${i} $${i}.o ${OBJECTS_DEPENDENCIES} ${INCLUDES} ${LIBDIRS} ${LIBRARIES} ${LDFLAGS}"; \ ${LD} -o $${i} $${i}.o ${OBJECTS_DEPENDENCIES} ${INCLUDES} ${LIBDIRS} ${LIBRARIES} ${LDFLAGS}; \ done ${OBJECTS}: ${OBJECTS_DEPENDENCIES} clean: rm -f ${OBJECTS_DEPENDENCIES} rm -f ${OBJECTS} rm -f ${EXAMPLES} # -----------------------------------------------------------------------------------------
{ "pile_set_name": "Github" }
/* * * (C) COPYRIGHT 2010-2015 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software * Foundation, and any use by you of this program is subject to the terms * of such GNU licence. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, you can access it online at * http://www.gnu.org/licenses/gpl-2.0.html. * * SPDX-License-Identifier: GPL-2.0 * */ /* * Power policy API definitions */ #ifndef _KBASE_PM_POLICY_H_ #define _KBASE_PM_POLICY_H_ /** * kbase_pm_policy_init - Initialize power policy framework * * @kbdev: The kbase device structure for the device (must be a valid pointer) * * Must be called before calling any other policy function * * Return: 0 if the power policy framework was successfully * initialized, -errno otherwise. */ int kbase_pm_policy_init(struct kbase_device *kbdev); /** * kbase_pm_policy_term - Terminate power policy framework * * @kbdev: The kbase device structure for the device (must be a valid pointer) */ void kbase_pm_policy_term(struct kbase_device *kbdev); /** * kbase_pm_update_active - Update the active power state of the GPU * * @kbdev: The kbase device structure for the device (must be a valid pointer) * * Calls into the current power policy */ void kbase_pm_update_active(struct kbase_device *kbdev); /** * kbase_pm_update_cores - Update the desired core state of the GPU * * @kbdev: The kbase device structure for the device (must be a valid pointer) * * Calls into the current power policy */ void kbase_pm_update_cores(struct kbase_device *kbdev); enum kbase_pm_cores_ready { KBASE_CORES_NOT_READY = 0, KBASE_NEW_AFFINITY = 1, KBASE_CORES_READY = 2 }; /** * kbase_pm_request_cores_sync - Synchronous variant of kbase_pm_request_cores() * * @kbdev: The kbase device structure for the device * @tiler_required: true if the tiler is required, false otherwise * @shader_cores: A bitmask of shader cores which are necessary for the job * * When this function returns, the @shader_cores will be in the READY state. * * This is safe variant of kbase_pm_check_transitions_sync(): it handles the * work of ensuring the requested cores will remain powered until a matching * call to kbase_pm_unrequest_cores()/kbase_pm_release_cores() (as appropriate) * is made. */ void kbase_pm_request_cores_sync(struct kbase_device *kbdev, bool tiler_required, u64 shader_cores); /** * kbase_pm_request_cores - Mark one or more cores as being required * for jobs to be submitted * * @kbdev: The kbase device structure for the device * @tiler_required: true if the tiler is required, false otherwise * @shader_cores: A bitmask of shader cores which are necessary for the job * * This function is called by the job scheduler to mark one or more cores as * being required to submit jobs that are ready to run. * * The cores requested are reference counted and a subsequent call to * kbase_pm_register_inuse_cores() or kbase_pm_unrequest_cores() should be * made to dereference the cores as being 'needed'. * * The active power policy will meet or exceed the requirements of the * requested cores in the system. Any core transitions needed will be begun * immediately, but they might not complete/the cores might not be available * until a Power Management IRQ. * * Return: 0 if the cores were successfully requested, or -errno otherwise. */ void kbase_pm_request_cores(struct kbase_device *kbdev, bool tiler_required, u64 shader_cores); /** * kbase_pm_unrequest_cores - Unmark one or more cores as being required for * jobs to be submitted. * * @kbdev: The kbase device structure for the device * @tiler_required: true if the tiler is required, false otherwise * @shader_cores: A bitmask of shader cores (as given to * kbase_pm_request_cores() ) * * This function undoes the effect of kbase_pm_request_cores(). It should be * used when a job is not going to be submitted to the hardware (e.g. the job is * cancelled before it is enqueued). * * The active power policy will meet or exceed the requirements of the * requested cores in the system. Any core transitions needed will be begun * immediately, but they might not complete until a Power Management IRQ. * * The policy may use this as an indication that it can power down cores. */ void kbase_pm_unrequest_cores(struct kbase_device *kbdev, bool tiler_required, u64 shader_cores); /** * kbase_pm_register_inuse_cores - Register a set of cores as in use by a job * * @kbdev: The kbase device structure for the device * @tiler_required: true if the tiler is required, false otherwise * @shader_cores: A bitmask of shader cores (as given to * kbase_pm_request_cores() ) * * This function should be called after kbase_pm_request_cores() when the job * is about to be submitted to the hardware. It will check that the necessary * cores are available and if so update the 'needed' and 'inuse' bitmasks to * reflect that the job is now committed to being run. * * If the necessary cores are not currently available then the function will * return %KBASE_CORES_NOT_READY and have no effect. * * Return: %KBASE_CORES_NOT_READY if the cores are not immediately ready, * * %KBASE_NEW_AFFINITY if the affinity requested is not allowed, * * %KBASE_CORES_READY if the cores requested are already available */ enum kbase_pm_cores_ready kbase_pm_register_inuse_cores( struct kbase_device *kbdev, bool tiler_required, u64 shader_cores); /** * kbase_pm_release_cores - Release cores after a job has run * * @kbdev: The kbase device structure for the device * @tiler_required: true if the tiler is required, false otherwise * @shader_cores: A bitmask of shader cores (as given to * kbase_pm_register_inuse_cores() ) * * This function should be called when a job has finished running on the * hardware. A call to kbase_pm_register_inuse_cores() must have previously * occurred. The reference counts of the specified cores will be decremented * which may cause the bitmask of 'inuse' cores to be reduced. The power policy * may then turn off any cores which are no longer 'inuse'. */ void kbase_pm_release_cores(struct kbase_device *kbdev, bool tiler_required, u64 shader_cores); /** * kbase_pm_request_l2_caches - Request l2 caches * * @kbdev: The kbase device structure for the device (must be a valid pointer) * * Request the use of l2 caches for all core groups, power up, wait and prevent * the power manager from powering down the l2 caches. * * This tells the power management that the caches should be powered up, and * they should remain powered, irrespective of the usage of shader cores. This * does not return until the l2 caches are powered up. * * The caller must call kbase_pm_release_l2_caches() when they are finished * to allow normal power management of the l2 caches to resume. * * This should only be used when power management is active. */ void kbase_pm_request_l2_caches(struct kbase_device *kbdev); /** * kbase_pm_request_l2_caches_l2_is_on - Request l2 caches but don't power on * * @kbdev: The kbase device structure for the device (must be a valid pointer) * * Increment the count of l2 users but do not attempt to power on the l2 * * It is the callers responsibility to ensure that the l2 is already powered up * and to eventually call kbase_pm_release_l2_caches() */ void kbase_pm_request_l2_caches_l2_is_on(struct kbase_device *kbdev); /** * kbase_pm_request_l2_caches - Release l2 caches * * @kbdev: The kbase device structure for the device (must be a valid pointer) * * Release the use of l2 caches for all core groups and allow the power manager * to power them down when necessary. * * This tells the power management that the caches can be powered down if * necessary, with respect to the usage of shader cores. * * The caller must have called kbase_pm_request_l2_caches() prior to a call * to this. * * This should only be used when power management is active. */ void kbase_pm_release_l2_caches(struct kbase_device *kbdev); #endif /* _KBASE_PM_POLICY_H_ */
{ "pile_set_name": "Github" }
// Package lint provides the foundation for tools like staticcheck package lint // import "honnef.co/go/tools/lint" import ( "bytes" "encoding/gob" "fmt" "go/scanner" "go/token" "go/types" "path/filepath" "sort" "strings" "sync" "sync/atomic" "unicode" "golang.org/x/tools/go/analysis" "golang.org/x/tools/go/packages" "honnef.co/go/tools/config" "honnef.co/go/tools/internal/cache" ) type Documentation struct { Title string Text string Since string NonDefault bool Options []string } func (doc *Documentation) String() string { b := &strings.Builder{} fmt.Fprintf(b, "%s\n\n", doc.Title) if doc.Text != "" { fmt.Fprintf(b, "%s\n\n", doc.Text) } fmt.Fprint(b, "Available since\n ") if doc.Since == "" { fmt.Fprint(b, "unreleased") } else { fmt.Fprintf(b, "%s", doc.Since) } if doc.NonDefault { fmt.Fprint(b, ", non-default") } fmt.Fprint(b, "\n") if len(doc.Options) > 0 { fmt.Fprintf(b, "\nOptions\n") for _, opt := range doc.Options { fmt.Fprintf(b, " %s", opt) } fmt.Fprint(b, "\n") } return b.String() } type Ignore interface { Match(p Problem) bool } type LineIgnore struct { File string Line int Checks []string Matched bool Pos token.Position } func (li *LineIgnore) Match(p Problem) bool { pos := p.Pos if pos.Filename != li.File || pos.Line != li.Line { return false } for _, c := range li.Checks { if m, _ := filepath.Match(c, p.Check); m { li.Matched = true return true } } return false } func (li *LineIgnore) String() string { matched := "not matched" if li.Matched { matched = "matched" } return fmt.Sprintf("%s:%d %s (%s)", li.File, li.Line, strings.Join(li.Checks, ", "), matched) } type FileIgnore struct { File string Checks []string } func (fi *FileIgnore) Match(p Problem) bool { if p.Pos.Filename != fi.File { return false } for _, c := range fi.Checks { if m, _ := filepath.Match(c, p.Check); m { return true } } return false } type Severity uint8 const ( Error Severity = iota Warning Ignored ) // Problem represents a problem in some source code. type Problem struct { Pos token.Position End token.Position Message string Check string Severity Severity Related []Related } type Related struct { Pos token.Position End token.Position Message string } func (p Problem) Equal(o Problem) bool { return p.Pos == o.Pos && p.End == o.End && p.Message == o.Message && p.Check == o.Check && p.Severity == o.Severity } func (p *Problem) String() string { return fmt.Sprintf("%s (%s)", p.Message, p.Check) } // A Linter lints Go source code. type Linter struct { Checkers []*analysis.Analyzer CumulativeCheckers []CumulativeChecker GoVersion int Config config.Config Stats Stats RepeatAnalyzers uint } type CumulativeChecker interface { Analyzer() *analysis.Analyzer Result() []types.Object ProblemObject(*token.FileSet, types.Object) Problem } func (l *Linter) Lint(cfg *packages.Config, patterns []string) ([]Problem, error) { var allAnalyzers []*analysis.Analyzer allAnalyzers = append(allAnalyzers, l.Checkers...) for _, cum := range l.CumulativeCheckers { allAnalyzers = append(allAnalyzers, cum.Analyzer()) } // The -checks command line flag overrules all configuration // files, which means that for `-checks="foo"`, no check other // than foo can ever be reported to the user. Make use of this // fact to cull the list of analyses we need to run. // replace "inherit" with "all", as we don't want to base the // list of all checks on the default configuration, which // disables certain checks. checks := make([]string, len(l.Config.Checks)) copy(checks, l.Config.Checks) for i, c := range checks { if c == "inherit" { checks[i] = "all" } } allowed := FilterChecks(allAnalyzers, checks) var allowedAnalyzers []*analysis.Analyzer for _, c := range l.Checkers { if allowed[c.Name] { allowedAnalyzers = append(allowedAnalyzers, c) } } hasCumulative := false for _, cum := range l.CumulativeCheckers { a := cum.Analyzer() if allowed[a.Name] { hasCumulative = true allowedAnalyzers = append(allowedAnalyzers, a) } } r, err := NewRunner(&l.Stats) if err != nil { return nil, err } r.goVersion = l.GoVersion r.repeatAnalyzers = l.RepeatAnalyzers pkgs, err := r.Run(cfg, patterns, allowedAnalyzers, hasCumulative) if err != nil { return nil, err } tpkgToPkg := map[*types.Package]*Package{} for _, pkg := range pkgs { tpkgToPkg[pkg.Types] = pkg for _, e := range pkg.errs { switch e := e.(type) { case types.Error: p := Problem{ Pos: e.Fset.PositionFor(e.Pos, false), Message: e.Msg, Severity: Error, Check: "compile", } pkg.problems = append(pkg.problems, p) case packages.Error: msg := e.Msg if len(msg) != 0 && msg[0] == '\n' { // TODO(dh): See https://github.com/golang/go/issues/32363 msg = msg[1:] } var pos token.Position if e.Pos == "" { // Under certain conditions (malformed package // declarations, multiple packages in the same // directory), go list emits an error on stderr // instead of JSON. Those errors do not have // associated position information in // go/packages.Error, even though the output on // stderr may contain it. if p, n, err := parsePos(msg); err == nil { if abs, err := filepath.Abs(p.Filename); err == nil { p.Filename = abs } pos = p msg = msg[n+2:] } } else { var err error pos, _, err = parsePos(e.Pos) if err != nil { panic(fmt.Sprintf("internal error: %s", e)) } } p := Problem{ Pos: pos, Message: msg, Severity: Error, Check: "compile", } pkg.problems = append(pkg.problems, p) case scanner.ErrorList: for _, e := range e { p := Problem{ Pos: e.Pos, Message: e.Msg, Severity: Error, Check: "compile", } pkg.problems = append(pkg.problems, p) } case error: p := Problem{ Pos: token.Position{}, Message: e.Error(), Severity: Error, Check: "compile", } pkg.problems = append(pkg.problems, p) } } } atomic.StoreUint32(&r.stats.State, StateCumulative) for _, cum := range l.CumulativeCheckers { for _, res := range cum.Result() { pkg := tpkgToPkg[res.Pkg()] if pkg == nil { panic(fmt.Sprintf("analyzer %s flagged object %s in package %s, a package that we aren't tracking", cum.Analyzer(), res, res.Pkg())) } allowedChecks := FilterChecks(allowedAnalyzers, pkg.cfg.Merge(l.Config).Checks) if allowedChecks[cum.Analyzer().Name] { pos := DisplayPosition(pkg.Fset, res.Pos()) // FIXME(dh): why are we ignoring generated files // here? Surely this is specific to 'unused', not all // cumulative checkers if _, ok := pkg.gen[pos.Filename]; ok { continue } p := cum.ProblemObject(pkg.Fset, res) pkg.problems = append(pkg.problems, p) } } } for _, pkg := range pkgs { if !pkg.fromSource { // Don't cache packages that we loaded from the cache continue } cpkg := cachedPackage{ Problems: pkg.problems, Ignores: pkg.ignores, Config: pkg.cfg, } buf := &bytes.Buffer{} if err := gob.NewEncoder(buf).Encode(cpkg); err != nil { return nil, err } id := cache.Subkey(pkg.actionID, "data "+r.problemsCacheKey) if err := r.cache.PutBytes(id, buf.Bytes()); err != nil { return nil, err } } var problems []Problem // Deduplicate line ignores. When U1000 processes a package and // its test variant, it will only emit a single problem for an // unused object, not two problems. We will, however, have two // line ignores, one per package. Without deduplication, one line // ignore will be marked as matched, while the other one won't, // subsequently reporting a "this linter directive didn't match // anything" error. ignores := map[token.Position]Ignore{} for _, pkg := range pkgs { for _, ig := range pkg.ignores { if lig, ok := ig.(*LineIgnore); ok { ig = ignores[lig.Pos] if ig == nil { ignores[lig.Pos] = lig ig = lig } } for i := range pkg.problems { p := &pkg.problems[i] if ig.Match(*p) { p.Severity = Ignored } } } if pkg.cfg == nil { // The package failed to load, otherwise we would have a // valid config. Pass through all errors. problems = append(problems, pkg.problems...) } else { for _, p := range pkg.problems { allowedChecks := FilterChecks(allowedAnalyzers, pkg.cfg.Merge(l.Config).Checks) allowedChecks["compile"] = true if allowedChecks[p.Check] { problems = append(problems, p) } } } for _, ig := range pkg.ignores { ig, ok := ig.(*LineIgnore) if !ok { continue } ig = ignores[ig.Pos].(*LineIgnore) if ig.Matched { continue } couldveMatched := false allowedChecks := FilterChecks(allowedAnalyzers, pkg.cfg.Merge(l.Config).Checks) for _, c := range ig.Checks { if !allowedChecks[c] { continue } couldveMatched = true break } if !couldveMatched { // The ignored checks were disabled for the containing package. // Don't flag the ignore for not having matched. continue } p := Problem{ Pos: ig.Pos, Message: "this linter directive didn't match anything; should it be removed?", Check: "", } problems = append(problems, p) } } if len(problems) == 0 { return nil, nil } sort.Slice(problems, func(i, j int) bool { pi := problems[i].Pos pj := problems[j].Pos if pi.Filename != pj.Filename { return pi.Filename < pj.Filename } if pi.Line != pj.Line { return pi.Line < pj.Line } if pi.Column != pj.Column { return pi.Column < pj.Column } return problems[i].Message < problems[j].Message }) var out []Problem out = append(out, problems[0]) for i, p := range problems[1:] { // We may encounter duplicate problems because one file // can be part of many packages. if !problems[i].Equal(p) { out = append(out, p) } } return out, nil } func FilterChecks(allChecks []*analysis.Analyzer, checks []string) map[string]bool { // OPT(dh): this entire computation could be cached per package allowedChecks := map[string]bool{} for _, check := range checks { b := true if len(check) > 1 && check[0] == '-' { b = false check = check[1:] } if check == "*" || check == "all" { // Match all for _, c := range allChecks { allowedChecks[c.Name] = b } } else if strings.HasSuffix(check, "*") { // Glob prefix := check[:len(check)-1] isCat := strings.IndexFunc(prefix, func(r rune) bool { return unicode.IsNumber(r) }) == -1 for _, c := range allChecks { idx := strings.IndexFunc(c.Name, func(r rune) bool { return unicode.IsNumber(r) }) if isCat { // Glob is S*, which should match S1000 but not SA1000 cat := c.Name[:idx] if prefix == cat { allowedChecks[c.Name] = b } } else { // Glob is S1* if strings.HasPrefix(c.Name, prefix) { allowedChecks[c.Name] = b } } } } else { // Literal check name allowedChecks[check] = b } } return allowedChecks } func DisplayPosition(fset *token.FileSet, p token.Pos) token.Position { if p == token.NoPos { return token.Position{} } // Only use the adjusted position if it points to another Go file. // This means we'll point to the original file for cgo files, but // we won't point to a YACC grammar file. pos := fset.PositionFor(p, false) adjPos := fset.PositionFor(p, true) if filepath.Ext(adjPos.Filename) == ".go" { return adjPos } return pos } var bufferPool = &sync.Pool{ New: func() interface{} { buf := bytes.NewBuffer(nil) buf.Grow(64) return buf }, } func FuncName(f *types.Func) string { buf := bufferPool.Get().(*bytes.Buffer) buf.Reset() if f.Type() != nil { sig := f.Type().(*types.Signature) if recv := sig.Recv(); recv != nil { buf.WriteByte('(') if _, ok := recv.Type().(*types.Interface); ok { // gcimporter creates abstract methods of // named interfaces using the interface type // (not the named type) as the receiver. // Don't print it in full. buf.WriteString("interface") } else { types.WriteType(buf, recv.Type(), nil) } buf.WriteByte(')') buf.WriteByte('.') } else if f.Pkg() != nil { writePackage(buf, f.Pkg()) } } buf.WriteString(f.Name()) s := buf.String() bufferPool.Put(buf) return s } func writePackage(buf *bytes.Buffer, pkg *types.Package) { if pkg == nil { return } s := pkg.Path() if s != "" { buf.WriteString(s) buf.WriteByte('.') } }
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms.Internals; namespace Xamarin.Forms.Controls.XamStore { public class BasePage : ContentPage { private Button MakeButton (string title, Action callback) { var result = new Button(); result.Text = title; result.Clicked += (s, e) => callback(); return result; } public BasePage(string title, Color tint) { ToolbarItems.Add(new ToolbarItem() { Text = "text" }); ToolbarItems.Add(new ToolbarItem() { IconImageSource = "coffee.png" }); Title = title; Shell.SetForegroundColor(this, tint); var grid = new Grid() { Padding = 20, ColumnDefinitions = { new ColumnDefinition {Width = GridLength.Star}, new ColumnDefinition {Width = GridLength.Star}, new ColumnDefinition {Width = GridLength.Star}, } }; grid.Children.Add(new Label { VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center, Text = "Welcome to the " + GetType().Name }, 0, 3, 0, 1); grid.Children.Add(MakeButton("Push", () => Navigation.PushAsync((Page)Activator.CreateInstance(GetType()))), 0, 1); grid.Children.Add(MakeButton("Pop", () => Navigation.PopAsync()), 1, 1); grid.Children.Add(MakeButton("Pop To Root", () => Navigation.PopToRootAsync()), 2, 1); grid.Children.Add(MakeButton("Insert", () => Navigation.InsertPageBefore((Page)Activator.CreateInstance(GetType()), this)), 0, 2); grid.Children.Add(MakeButton("Remove", () => Navigation.RemovePage(Navigation.NavigationStack[Navigation.NavigationStack.Count - 2])), 1, 2); grid.Children.Add(MakeButton("Add Search", () => AddSearchHandler("Added Search", SearchBoxVisibility.Expanded)), 2, 2); grid.Children.Add(MakeButton("Add Toolbar", () => ToolbarItems.Add(new ToolbarItem("Test", "calculator.png", () => { }))), 0, 3); grid.Children.Add(MakeButton("Remove Toolbar", () => ToolbarItems.RemoveAt(0)), 1, 3); grid.Children.Add(MakeButton("Remove Search", RemoveSearchHandler), 2, 3); grid.Children.Add(MakeButton("Add Tab", AddBottomTab), 0, 4); grid.Children.Add(MakeButton("Remove Tab", RemoveBottomTab), 1, 4); grid.Children.Add(MakeButton("Hide Tabs", () => Shell.SetTabBarIsVisible(this, false)), 2, 4); grid.Children.Add(MakeButton("Show Tabs", () => Shell.SetTabBarIsVisible(this, true)), 0, 5); grid.Children.Add(MakeButton("Hide Nav", () => Shell.SetNavBarIsVisible(this, false)), 1, 5); grid.Children.Add(MakeButton("Show Nav", () => Shell.SetNavBarIsVisible(this, true)), 2, 5); grid.Children.Add(MakeButton("Hide Search", () => Shell.GetSearchHandler(this).SearchBoxVisibility = SearchBoxVisibility.Hidden), 0, 6); grid.Children.Add(MakeButton("Collapse Search", () => Shell.GetSearchHandler(this).SearchBoxVisibility = SearchBoxVisibility.Collapsible), 1, 6); grid.Children.Add(MakeButton("Show Search", () => Shell.GetSearchHandler(this).SearchBoxVisibility = SearchBoxVisibility.Expanded), 2, 6); grid.Children.Add(MakeButton("Set Back", () => Shell.SetBackButtonBehavior(this, new BackButtonBehavior() { IconOverride = "calculator.png" })), 0, 7); grid.Children.Add(MakeButton("Clear Back", () => Shell.SetBackButtonBehavior(this, null)), 1, 7); grid.Children.Add(MakeButton("Disable Tab", () => ((Forms.ShellSection)Parent.Parent).IsEnabled = false), 2, 7); grid.Children.Add(MakeButton("Enable Tab", () => ((Forms.ShellSection)Parent.Parent).IsEnabled = true), 0, 8); grid.Children.Add(MakeButton("Enable Search", () => Shell.GetSearchHandler(this).IsSearchEnabled = true), 1, 8); grid.Children.Add(MakeButton("Disable Search", () => Shell.GetSearchHandler(this).IsSearchEnabled = false), 2, 8); grid.Children.Add(MakeButton("Set Title", () => Title = "New Title"), 0, 9); grid.Children.Add(MakeButton("Set Tab Title", () => ((Forms.ShellSection)Parent.Parent).Title = "New Title"), 1, 9); grid.Children.Add(MakeButton("Set GroupTitle", () => ((ShellItem)Parent.Parent.Parent).Title = "New Title"), 2, 9); grid.Children.Add(MakeButton("New Tab Icon", () => ((Forms.ShellSection)Parent.Parent).Icon = "calculator.png"), 0, 10); grid.Children.Add(MakeButton("Flyout Disabled", () => Shell.SetFlyoutBehavior(this, FlyoutBehavior.Disabled)), 1, 10); grid.Children.Add(MakeButton("Flyout Collapse", () => Shell.SetFlyoutBehavior(this, FlyoutBehavior.Flyout)), 2, 10); grid.Children.Add(MakeButton("Flyout Locked", () => Shell.SetFlyoutBehavior(this, FlyoutBehavior.Locked)), 0, 11); grid.Children.Add(MakeButton("Add TitleView", () => Shell.SetTitleView(this, new Label { BackgroundColor = Color.Purple, Margin = new Thickness(5, 10), Text = "TITLE VIEW" })), 1, 11); grid.Children.Add(MakeButton("Null TitleView", () => Shell.SetTitleView(this, null)), 2, 11); grid.Children.Add(MakeButton("FH Fixed", () => ((Shell)Parent.Parent.Parent.Parent).FlyoutHeaderBehavior = FlyoutHeaderBehavior.Fixed), 0, 12); grid.Children.Add(MakeButton("FH Scroll", () => ((Shell)Parent.Parent.Parent.Parent).FlyoutHeaderBehavior = FlyoutHeaderBehavior.Scroll), 1, 12); grid.Children.Add(MakeButton("FH Collapse", () => ((Shell)Parent.Parent.Parent.Parent).FlyoutHeaderBehavior = FlyoutHeaderBehavior.CollapseOnScroll), 2, 12); grid.Children.Add(MakeButton("Add TopTab", AddTopTab), 0, 13); grid.Children.Add(MakeButton("Remove TopTab", RemoveTopTab), 1, 13); grid.Children.Add(MakeButton("Flow Direction", ChangeFlowDirection), 2, 13); grid.Children.Add(MakeSwitch("Nav Visible", out _navBarVisibleSwitch), 0, 14); grid.Children.Add(MakeSwitch("Tab Visible", out _tabBarVisibleSwitch), 1, 14); grid.Children.Add(MakeButton("Push Special", () => { var page = (Page)Activator.CreateInstance(GetType()); Shell.SetNavBarIsVisible (page, _navBarVisibleSwitch.IsToggled); Shell.SetTabBarIsVisible(page, _tabBarVisibleSwitch.IsToggled); Navigation.PushAsync(page); }), 2, 14); grid.Children.Add(MakeButton("Show Alert", async () => { var result = await DisplayAlert("Title", "Message", "Ok", "Cancel"); Console.WriteLine($"Alert result: {result}"); }), 0, 15); grid.Children.Add(MakeButton("Navigate to 'demo' route", async () => await Shell.Current.GoToAsync("demo", true)), 1, 15); grid.Children.Add(MakeButton("Go Back with Text", async () => { var page = (Page)Activator.CreateInstance(GetType()); Shell.SetForegroundColor(page, Color.Pink); Shell.SetBackButtonBehavior(page, new BackButtonBehavior() { //IconOverride = "calculator.png", TextOverride = "back" }); await Navigation.PushAsync(page); }),2, 15); grid.Children.Add(new Label { Text = "Navigate to", VerticalOptions = LayoutOptions.CenterAndExpand }, 0, 16); var navEntry = new Entry { Text = "demo/demo" }; grid.Children.Add(navEntry, 1, 16); grid.Children.Add(MakeButton("GO!", async () => await Shell.Current.GoToAsync(navEntry.Text, true)), 2, 16); var headerWidth = new Slider { Minimum = 0, Maximum = 400, Value = (Shell.Current.FlyoutHeader as VisualElement)?.HeightRequest ?? 0 }; headerWidth.ValueChanged += (_, e) => { if (Shell.Current.FlyoutHeader is VisualElement ve) ve.HeightRequest = e.NewValue; }; grid.Children.Add(new Label { Text = "fly Header", VerticalOptions = LayoutOptions.CenterAndExpand }, 0, 17); grid.Children.Add(headerWidth, 1, 17); grid.Children.Add(MakeButton("bg image", () => Shell.Current.FlyoutBackgroundImage = ImageSource.FromFile("photo.jpg")), 0, 18); grid.Children.Add(MakeButton("bg color", () => Shell.Current.FlyoutBackgroundColor = Color.DarkGreen), 1, 18); grid.Children.Add(MakeButton("bg brush", () => Shell.Current.FlyoutBackground = new LinearGradientBrush { StartPoint = new Point(0, 0), EndPoint = new Point(1, 0), GradientStops = new GradientStopCollection { new GradientStop { Color = Color.Orange, Offset = 0.2f }, new GradientStop { Color = Color.OrangeRed, Offset = 0.8f } } }), 2, 18); grid.Children.Add(MakeButton("bg aFill", () => Shell.Current.FlyoutBackgroundImageAspect = Aspect.AspectFill), 0, 19); grid.Children.Add(MakeButton("bg Fill", () => Shell.Current.FlyoutBackgroundImageAspect = Aspect.Fill), 1, 19); grid.Children.Add(MakeButton("clear bg", () => { Shell.Current.ClearValue(Shell.FlyoutBackgroundColorProperty); Shell.Current.ClearValue(Shell.FlyoutBackgroundImageProperty); }), 2, 19); Entry flyheaderMargin = new Entry(); flyheaderMargin.TextChanged += (_, __) => { int topMargin; if (Int32.TryParse(flyheaderMargin.Text, out topMargin)) (Shell.Current.FlyoutHeader as View).Margin = new Thickness(0, topMargin, 0, 0); else (Shell.Current.FlyoutHeader as View).ClearValue(View.MarginProperty); }; grid.Children.Add(new Label() { Text = "FH Top Margin" }, 0, 20); grid.Children.Add(flyheaderMargin, 1, 20); Content = new ScrollView { Content = grid }; Brush nextBrush = SolidColorBrush.Purple; grid.Children.Add(MakeButton("FlyoutBackdrop Brush", () => { if(nextBrush == SolidColorBrush.Purple) { LinearGradientBrush linearGradientBrush = new LinearGradientBrush(); linearGradientBrush.StartPoint = new Point(0, 0); linearGradientBrush.EndPoint = new Point(1, 1); linearGradientBrush.GradientStops.Add(new GradientStop(Color.FromHex("#8A2387"), 0.1f)); linearGradientBrush.GradientStops.Add(new GradientStop(Color.FromHex("#E94057"), 0.6f)); linearGradientBrush.GradientStops.Add(new GradientStop(Color.FromHex("#F27121"), 1.0f)); nextBrush = linearGradientBrush; } else if(nextBrush is LinearGradientBrush) { nextBrush = Brush.Default; } else { nextBrush = SolidColorBrush.Purple; } Shell.SetFlyoutBackdrop(Shell.Current, nextBrush); }), 0, 21); grid.Children.Add(MakeButton("Hide Nav Shadow", () => Shell.SetNavBarHasShadow(this, false)), 1, 21); grid.Children.Add(MakeButton("Show Nav Shadow", () => Shell.SetNavBarHasShadow(this, true)), 2, 21); } Switch _navBarVisibleSwitch; Switch _tabBarVisibleSwitch; private View MakeSwitch (string label, out Switch control) { return new StackLayout { Children = { new Label {Text = label}, (control = new Switch {IsToggled = true}) } }; } private void ChangeFlowDirection() { var ve = (Shell)Parent.Parent.Parent.Parent; if (ve.FlowDirection != FlowDirection.RightToLeft) ve.FlowDirection = FlowDirection.RightToLeft; else ve.FlowDirection = FlowDirection.LeftToRight; } private void RemoveTopTab() { var shellSection = (ShellSection)Parent.Parent; shellSection.Items.Remove(shellSection.Items[shellSection.Items.Count - 1]); } private void AddTopTab() { var shellSection = (ShellSection)Parent.Parent; shellSection.Items.Add( new Forms.ShellContent() { Title = "New Top Tab", Content = new UpdatesPage() } ); } private void RemoveBottomTab() { var shellitem = (ShellItem)Parent.Parent.Parent; shellitem.Items.Remove(shellitem.Items[shellitem.Items.Count - 1]); } private void AddBottomTab() { var shellitem = (ShellItem)Parent.Parent.Parent; shellitem.Items.Add(new ShellSection { Route = "newitem", Title = "New Item", Icon = "calculator.png", Items = { new Forms.ShellContent() { Content = new UpdatesPage() } } }); } internal class CustomSearchHandler : SearchHandler { protected async override void OnQueryChanged(string oldValue, string newValue) { base.OnQueryChanged(oldValue, newValue); if (string.IsNullOrEmpty(newValue)) { ItemsSource = null; } else { List<string> results = new List<string>(); results.Add(newValue + "initial"); ItemsSource = results; await Task.Delay(2000); results = new List<string>(); for (int i = 0; i < 10; i++) { results.Add(newValue + i); } ItemsSource = results; } } } protected void AddSearchHandler(string placeholder, SearchBoxVisibility visibility) { var searchHandler = new CustomSearchHandler(); searchHandler.BackgroundColor = Color.Orange; searchHandler.CancelButtonColor = Color.Pink; searchHandler.TextColor = Color.White; searchHandler.PlaceholderColor = Color.Yellow; searchHandler.HorizontalTextAlignment = TextAlignment.Center; searchHandler.ShowsResults = true; searchHandler.Keyboard = Keyboard.Numeric; searchHandler.FontFamily = "ChalkboardSE-Regular"; searchHandler.FontAttributes = FontAttributes.Bold; searchHandler.ClearIconName = "Clear"; searchHandler.ClearIconHelpText = "Clears the search field text"; searchHandler.ClearPlaceholderName = "Voice Search"; searchHandler.ClearPlaceholderHelpText = "Start voice search"; searchHandler.QueryIconName = "Search"; searchHandler.QueryIconHelpText = "Press to search app"; searchHandler.Placeholder = placeholder; searchHandler.SearchBoxVisibility = visibility; searchHandler.ClearPlaceholderEnabled = true; searchHandler.ClearPlaceholderIcon = "mic.png"; Shell.SetSearchHandler(this, searchHandler); } protected void RemoveSearchHandler() { ClearValue(Shell.SearchHandlerProperty); } } [Preserve (AllMembers = true)] public class UpdatesPage : BasePage { public UpdatesPage() : base("Available Updates", Color.Default) { AddSearchHandler("Search Updates", SearchBoxVisibility.Collapsible); } } [Preserve (AllMembers = true)] public class InstalledPage : BasePage { public InstalledPage() : base("Installed Items", Color.Default) { AddSearchHandler("Search Installed", SearchBoxVisibility.Collapsible); } } [Preserve (AllMembers = true)] public class LibraryPage : BasePage { public LibraryPage() : base("My Library", Color.Default) { AddSearchHandler("Search Apps", SearchBoxVisibility.Collapsible); } } [Preserve (AllMembers = true)] public class NotificationsPage : BasePage { public NotificationsPage() : base("Notifications", Color.Default) { } } [Preserve (AllMembers = true)] public class SubscriptionsPage : BasePage { public SubscriptionsPage() : base("My Subscriptions", Color.Default) { } } [Preserve (AllMembers = true)] public class HomePage : BasePage { public HomePage() : base("Store Home", Color.Black) { AddSearchHandler("Search Apps", SearchBoxVisibility.Expanded); } } [Preserve (AllMembers = true)] public class GamesPage : BasePage { public GamesPage() : base("Games", Color.Black) { AddSearchHandler("Search Games", SearchBoxVisibility.Expanded); } } [Preserve (AllMembers = true)] public class MoviesPage : BasePage { public MoviesPage() : base("Hot Movies", Color.Default) { AddSearchHandler("Search Movies", SearchBoxVisibility.Expanded); } } [Preserve (AllMembers = true)] public class BooksPage : BasePage { public BooksPage() : base("Bookstore", Color.Default) { AddSearchHandler("Search Books", SearchBoxVisibility.Expanded); } } [Preserve (AllMembers = true)] public class MusicPage : BasePage { public MusicPage() : base("Music", Color.Default) { AddSearchHandler("Search Music", SearchBoxVisibility.Expanded); } } [Preserve (AllMembers = true)] public class NewsPage : BasePage { public NewsPage() : base("Newspapers", Color.Default) { AddSearchHandler("Search Papers", SearchBoxVisibility.Expanded); } } [Preserve (AllMembers = true)] public class AccountsPage : BasePage { public AccountsPage() : base("Account Items", Color.Default) { } } [Preserve (AllMembers = true)] public class WishlistPage : BasePage { public WishlistPage() : base("My Wishlist", Color.Default) { } } [Preserve (AllMembers = true)] public class SettingsPage : BasePage { public SettingsPage() : base("Settings", Color.Default) { } } }
{ "pile_set_name": "Github" }
#!/usr/bin/env python """ Copyright (c) 2006-2020 sqlmap developers (http://sqlmap.org/) See the file 'LICENSE' for copying permission """ from lib.core.enums import DBMS from lib.core.settings import INFORMIX_SYSTEM_DBS from lib.core.unescaper import unescaper from plugins.dbms.informix.enumeration import Enumeration from plugins.dbms.informix.filesystem import Filesystem from plugins.dbms.informix.fingerprint import Fingerprint from plugins.dbms.informix.syntax import Syntax from plugins.dbms.informix.takeover import Takeover from plugins.generic.misc import Miscellaneous class InformixMap(Syntax, Fingerprint, Enumeration, Filesystem, Miscellaneous, Takeover): """ This class defines Informix methods """ def __init__(self): self.excludeDbsList = INFORMIX_SYSTEM_DBS for cls in self.__class__.__bases__: cls.__init__(self) unescaper[DBMS.INFORMIX] = Syntax.escape
{ "pile_set_name": "Github" }
--- title: " Dancing at the Lip of a Volcano: The Kubernetes Security Process - Explained " date: 2017-05-18 slug: kubernetes-security-process-explained url: /blog/2017/05/Kubernetes-Security-Process-Explained --- _Editor's note: Today’s post is by&nbsp; __Jess Frazelle of Google and Brandon Philips of CoreOS about the Kubernetes security disclosures and response policy.__ &nbsp;_ Software running on servers underpins ever growing amounts of the world's commerce, communications, and physical infrastructure. And nearly all of these systems are connected to the internet; which means vital security updates must be applied rapidly. As software developers and IT professionals, we often find ourselves dancing on the edge of a volcano: we may either fall into magma induced oblivion from a security vulnerability exploited before we can fix it, or we may slide off the side of the mountain because of an inadequate process to address security vulnerabilities.&nbsp; The Kubernetes community believes that we can help teams restore their footing on this volcano with a foundation built on Kubernetes. And the bedrock of this foundation requires a process for quickly acknowledging, patching, and releasing security updates to an ever growing community of Kubernetes users.&nbsp; With over 1,200 contributors and [over a million lines of code](https://www.openhub.net/p/kubernetes), each release of Kubernetes is a massive undertaking staffed by brave volunteer [release managers](https://github.com/kubernetes/community/wiki). These normal releases are fully transparent and the process happens in public. However, security releases must be handled differently to keep potential attackers in the dark until a fix is made available to users. We drew inspiration from other open source projects in order to create the [**Kubernetes security release process**](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-release/release.md). Unlike a regularly scheduled release, a security release must be delivered on an accelerated schedule, and we created the [Product Security Team](https://git.k8s.io/security/security-release-process.md#product-security-committee-psc)&nbsp;to handle this process. This team quickly selects a lead to coordinate work and manage communication with the persons that disclosed the vulnerability and the Kubernetes community. The security release process also documents ways to measure vulnerability severity using the [Common Vulnerability Scoring System (CVSS) Version 3.0 Calculator](https://www.first.org/cvss/calculator/3.0). This calculation helps inform decisions on release cadence in the face of holidays or limited developer bandwidth. By making severity criteria transparent we are able to better set expectations and hit critical timelines during an incident where we strive to: - Respond to the person or team who reported the vulnerability and staff a development team responsible for a fix within 24 hours - Disclose a forthcoming fix to users within 7 days of disclosure - Provide advance notice to vendors within 14 days of disclosure - Release a fix within 21 days of disclosure As we [continue to harden Kubernetes](https://lwn.net/Articles/720215/), the security release process will help ensure that Kubernetes remains a secure platform for internet scale computing. If you are interested in learning more about the security release process please watch the presentation from KubeCon Europe 2017 [on YouTube](https://www.youtube.com/watch?v=sNjylW8FV9A)&nbsp;and follow along with the [slides](https://speakerdeck.com/philips/kubecon-eu-2017-dancing-on-the-edge-of-a-volcano). If you are interested in learning more about authentication and authorization in Kubernetes, along with the Kubernetes cluster security model, consider joining [Kubernetes SIG Auth](https://github.com/kubernetes/community/blob/master/sig-auth/README.md). We also hope to see you at security related presentations and panels at the next Kubernetes community event: [CoreOS Fest 2017 in San Francisco on May 31 and June 1](https://coreos.com/fest/). As a thank you to the Kubernetes community, a special 25 percent discount to CoreOS Fest is available using k8s25code&nbsp;or via this special [25 percent off link](https://coreosfest17.eventbrite.com/?discount=k8s25code) to register today for CoreOS Fest 2017.&nbsp; _--Brandon Philips of CoreOS and Jess Frazelle of Google_ - Post questions (or answer questions) on [Stack Overflow](http://stackoverflow.com/questions/tagged/kubernetes) - Join the community portal for advocates on [K8sPort](http://k8sport.org/) - Follow us on Twitter [@Kubernetesio](https://twitter.com/kubernetesio) for latest updates - Connect with the community on [Slack](http://slack.k8s.io/) - Get involved with the Kubernetes project on [GitHub](https://github.com/kubernetes/kubernetes)
{ "pile_set_name": "Github" }
// =============================== // ========= GRID BASE =========== // =============================== $grid-base-color: $neutral-color !default; $grid-base-content-color: $content-color !default; // =============================== // ========= GRID HEADER ========= // =============================== $grid-header-background-color: $content-color; $grid-header-background-gradient: flat !default; $grid-header-border-color: #EAEAEA !default; $grid-header-over-background-color: $mixed-color !default; $grid-header-over-border-color: darken($grid-header-over-background-color, 20%) !default; $grid-header-over-background-gradient: $grid-header-background-gradient !default; $grid-header-padding: 4px 6px !default; $grid-header-trigger-height: 22px !default; // Deprecated $grid-header-trigger-width: 14px !default; // Deprecated $grid-header-color: #606060 !default;//color-by-background($grid-header-background-color) !default; // =============================== // ========= GRID ROWS =========== // =============================== $grid-row-height: 24px !default; $grid-row-cell-color: null !default; $grid-row-cell-font: normal $font-size-small $font-family !default; $grid-row-padding: 0 1px 0 2px !default; $grid-row-cell-font-size: ceil($font-size * .9) !default; $grid-row-cell-line-height: $grid-row-cell-font-size + 4 !default; $grid-row-cell-font: normal #{$grid-row-cell-font-size}/#{$grid-row-cell-line-height} $font-family !default; $grid-row-padding: 0 1px !default; //row wrap $grid-row-wrap-border-color: darken($grid-base-content-color, 5%) !default; $grid-row-wrap-border-width: 0 !default; $grid-row-wrap-border-style: solid !default; //row body $grid-row-body-font: normal $font-size-small $font-family !default; $grid-row-body-padding: 4px !default; //row cell $grid-row-cell-background: $grid-base-content-color !default; $grid-row-cell-border-color: $grid-row-wrap-border-color !default; $grid-row-cell-border-style: solid !default; $grid-row-cell-border-width: 0 !default; //row cell alt $grid-row-cell-alt-background: $neutral-light-color !default; //$mixed-color !default; //row cell over $grid-row-cell-over-background-color: $base-light-color !default;//lighten($base-color, 20%) !default; $grid-row-cell-over-border-color: transparent !default; // Deprecated $grid-row-cell-over-background-gradient: $base-gradient !default; $grid-row-cell-over-color: color-by-background(darken($grid-row-cell-over-background-color, 20%), 80%); //row cell selected $grid-row-cell-selected-border-style: solid !default; // Deprecated $grid-row-cell-selected-background-color: $base-dark-color !default; //lighten($base-color, 15%) !default; $grid-row-cell-selected-border-color: lighten($base-color, 5%) !default; $grid-row-cell-selected-color: color-by-background($base-color, 80%); //row cell focus $grid-row-cell-focus-border-color: adjust-color($neutral-color, $hue: 0deg, $saturation: 0%, $lightness: -6.667%) !default; $grid-row-cell-focus-background-color: adjust-color($neutral-color, $hue: 0deg, $saturation: 0%, $lightness: 0.392%) !default; /*$grid-row-cell-focus-background-gradient: 'grid-row-over' !default;*/ $grid-row-special-background-gradient: $base-gradient !default; //standard cells $grid-cell-font: normal $font-size-small $ui-font-family !default; $grid-cell-inner-padding: 6px 8px !default; $grid-cell-inner-padding-top: 2px !default; $grid-cell-inner-padding-horizontal: 6px !default; $grid-cell-inner-padding-bottom: 3px !default; //special cell $grid-cell-special-over-background-color: $grid-row-cell-over-border-color !default; /*$grid-cell-special-background-gradient: 'grid-cell-special';*/ $grid-row-cell-special-background-gradient: $base-gradient; //cell with col lines $grid-cell-with-col-lines-border-color: #E0E3E6 !default;// adjust-color($base-color, $hue: 0deg, $saturation: -55.556%, $lightness: -2.549%) !default; // =============================== // ======== GROUPED GRID ========= // =============================== $grid-grouped-header-background-color: $neutral-color !default; $grid-grouped-header-padding: 6px 0 0 0; $grid-grouped-title-color: color-by-background($grid-grouped-header-background-color); $grid-grouped-title-font: bold $font-size $font-family; $grid-grouped-title-padding: 5px 5px 5px 17px; // =============================== // ========= EDITOR ========== // =============================== $grid-editor-line-height: $grid-row-height - 5 !default; $grid-editor-font: normal #{$grid-row-cell-font-size}/#{$grid-editor-line-height} $font-family !default; // =============================== // ========= ROW EDITOR ========== // =============================== $grid-row-editor-background-color: adjust-color($base-color, $hue: 1deg, $saturation: 11%, $lightness: 11%) !default; $grid-row-editor-border-color: $panel-border-color !default; $grid-row-editor-border-width: 1px !default; $grid-row-editor-border: $grid-row-editor-border-width solid $grid-row-editor-border-color !important; $grid-row-editor-field-padding-horizontal: 2px !default; $grid-row-editor-checkbox-padding-top: 2px !default; // =============================== // ========= CELL EDITOR ========= // =============================== $grid-cell-editor-field-padding-horizontal: 4px !default; $grid-cell-editor-checkbox-padding-top: 3px !default;
{ "pile_set_name": "Github" }
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2009 Gael Guennebaud <gael.guennebaud@inria.fr> // Copyright (C) 2012 Désiré Nuentsa-Wakam <desire.nuentsa_wakam@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef EIGEN_SPARSE_TRIANGULARVIEW_H #define EIGEN_SPARSE_TRIANGULARVIEW_H namespace Eigen { namespace internal { template<typename MatrixType, int Mode> struct traits<SparseTriangularView<MatrixType,Mode> > : public traits<MatrixType> {}; } // namespace internal template<typename MatrixType, int Mode> class SparseTriangularView : public SparseMatrixBase<SparseTriangularView<MatrixType,Mode> > { enum { SkipFirst = ((Mode&Lower) && !(MatrixType::Flags&RowMajorBit)) || ((Mode&Upper) && (MatrixType::Flags&RowMajorBit)), SkipLast = !SkipFirst, SkipDiag = (Mode&ZeroDiag) ? 1 : 0, HasUnitDiag = (Mode&UnitDiag) ? 1 : 0 }; public: EIGEN_SPARSE_PUBLIC_INTERFACE(SparseTriangularView) class InnerIterator; class ReverseInnerIterator; inline Index rows() const { return m_matrix.rows(); } inline Index cols() const { return m_matrix.cols(); } typedef typename MatrixType::Nested MatrixTypeNested; typedef typename internal::remove_reference<MatrixTypeNested>::type MatrixTypeNestedNonRef; typedef typename internal::remove_all<MatrixTypeNested>::type MatrixTypeNestedCleaned; inline SparseTriangularView(const MatrixType& matrix) : m_matrix(matrix) {} /** \internal */ inline const MatrixTypeNestedCleaned& nestedExpression() const { return m_matrix; } template<typename OtherDerived> typename internal::plain_matrix_type_column_major<OtherDerived>::type solve(const MatrixBase<OtherDerived>& other) const; template<typename OtherDerived> void solveInPlace(MatrixBase<OtherDerived>& other) const; template<typename OtherDerived> void solveInPlace(SparseMatrixBase<OtherDerived>& other) const; protected: MatrixTypeNested m_matrix; }; template<typename MatrixType, int Mode> class SparseTriangularView<MatrixType,Mode>::InnerIterator : public MatrixTypeNestedCleaned::InnerIterator { typedef typename MatrixTypeNestedCleaned::InnerIterator Base; typedef typename SparseTriangularView::Index Index; public: EIGEN_STRONG_INLINE InnerIterator(const SparseTriangularView& view, Index outer) : Base(view.nestedExpression(), outer), m_returnOne(false) { if(SkipFirst) { while((*this) && ((HasUnitDiag||SkipDiag) ? this->index()<=outer : this->index()<outer)) Base::operator++(); if(HasUnitDiag) m_returnOne = true; } else if(HasUnitDiag && ((!Base::operator bool()) || Base::index()>=Base::outer())) { if((!SkipFirst) && Base::operator bool()) Base::operator++(); m_returnOne = true; } } EIGEN_STRONG_INLINE InnerIterator& operator++() { if(HasUnitDiag && m_returnOne) m_returnOne = false; else { Base::operator++(); if(HasUnitDiag && (!SkipFirst) && ((!Base::operator bool()) || Base::index()>=Base::outer())) { if((!SkipFirst) && Base::operator bool()) Base::operator++(); m_returnOne = true; } } return *this; } inline Index row() const { return (MatrixType::Flags&RowMajorBit ? Base::outer() : this->index()); } inline Index col() const { return (MatrixType::Flags&RowMajorBit ? this->index() : Base::outer()); } inline Index index() const { if(HasUnitDiag && m_returnOne) return Base::outer(); else return Base::index(); } inline Scalar value() const { if(HasUnitDiag && m_returnOne) return Scalar(1); else return Base::value(); } EIGEN_STRONG_INLINE operator bool() const { if(HasUnitDiag && m_returnOne) return true; if(SkipFirst) return Base::operator bool(); else { if (SkipDiag) return (Base::operator bool() && this->index() < this->outer()); else return (Base::operator bool() && this->index() <= this->outer()); } } protected: bool m_returnOne; }; template<typename MatrixType, int Mode> class SparseTriangularView<MatrixType,Mode>::ReverseInnerIterator : public MatrixTypeNestedCleaned::ReverseInnerIterator { typedef typename MatrixTypeNestedCleaned::ReverseInnerIterator Base; typedef typename SparseTriangularView::Index Index; public: EIGEN_STRONG_INLINE ReverseInnerIterator(const SparseTriangularView& view, Index outer) : Base(view.nestedExpression(), outer) { eigen_assert((!HasUnitDiag) && "ReverseInnerIterator does not support yet triangular views with a unit diagonal"); if(SkipLast) { while((*this) && (SkipDiag ? this->index()>=outer : this->index()>outer)) --(*this); } } EIGEN_STRONG_INLINE ReverseInnerIterator& operator--() { Base::operator--(); return *this; } inline Index row() const { return Base::row(); } inline Index col() const { return Base::col(); } EIGEN_STRONG_INLINE operator bool() const { if (SkipLast) return Base::operator bool() ; else { if(SkipDiag) return (Base::operator bool() && this->index() > this->outer()); else return (Base::operator bool() && this->index() >= this->outer()); } } }; template<typename Derived> template<int Mode> inline const SparseTriangularView<Derived, Mode> SparseMatrixBase<Derived>::triangularView() const { return derived(); } } // end namespace Eigen #endif // EIGEN_SPARSE_TRIANGULARVIEW_H
{ "pile_set_name": "Github" }
{ "dependencies": { "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0" }, "frameworks": { "uap10.0": {} }, "runtimes": { "win10-arm": {}, "win10-arm-aot": {}, "win10-x86": {}, "win10-x86-aot": {}, "win10-x64": {}, "win10-x64-aot": {} } }
{ "pile_set_name": "Github" }
来源:[浩义(来自豆瓣)](https://www.douban.com/people/hauuyee/)的[广播](https://www.douban.com/people/hauuyee/status/2782798841/) 2020-01-31_15:34:12 经此疫,该说的,都说了,也都被删了。 想做的,从未变,不怕独行,只惧徒劳。 往前看,不悲观,见天就在这人手里。 弃捐勿复道,努力加餐饭。
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <Filter Include="Source Files"> <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> </Filter> <Filter Include="Header Files"> <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> </Filter> <Filter Include="Resource Files"> <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions> </Filter> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\source\as_atomic.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_builder.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_bytecode.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_callfunc.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_callfunc_mips.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_callfunc_sh4.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_callfunc_x86.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_compiler.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_configgroup.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_context.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_datatype.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_gc.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_generic.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_globalproperty.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_memory.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_module.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_objecttype.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_outputbuffer.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_parser.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_restore.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_scriptcode.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_scriptengine.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_scriptfunction.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_scriptnode.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_scriptobject.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_string.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_string_util.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_thread.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_tokenizer.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_typeinfo.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_variablescope.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_callfunc_x64_msvc.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_callfunc_arm.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_callfunc_ppc.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_callfunc_ppc_64.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_callfunc_x64_gcc.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_callfunc_x64_mingw.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\source\as_callfunc_xenon.cpp"> <Filter>Source Files</Filter> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\include\angelscript.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_array.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_builder.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_bytecode.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_callfunc.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_compiler.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_config.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_configgroup.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_context.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_datatype.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_debug.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_generic.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_map.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_module.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_objecttype.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_outputbuffer.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_parser.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_property.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_restore.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_scriptcode.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_scriptengine.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_scriptfunction.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_scriptnode.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_scriptobject.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_string.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_string_util.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_texts.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_thread.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_tokendef.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_tokenizer.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_typeinfo.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_variablescope.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_gc.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_criticalsection.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_symboltable.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_atomic.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_memory.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\..\source\as_namespace.h"> <Filter>Header Files</Filter> </ClInclude> </ItemGroup> <ItemGroup> <CustomBuild Include="..\..\source\as_callfunc_x64_msvc_asm.asm"> <Filter>Source Files</Filter> </CustomBuild> <CustomBuild Include="..\..\source\as_callfunc_arm_msvc.asm"> <Filter>Source Files</Filter> </CustomBuild> </ItemGroup> <ItemGroup> <None Include="..\..\source\as_callfunc_arm_gcc.S"> <Filter>Source Files</Filter> </None> <None Include="..\..\source\as_callfunc_arm_xcode.S"> <Filter>Source Files</Filter> </None> <None Include="..\..\source\as_callfunc_arm_vita.S"> <Filter>Source Files</Filter> </None> </ItemGroup> </Project>
{ "pile_set_name": "Github" }
"""Fixer that changes 'a ,b' into 'a, b'. This also changes '{a :b}' into '{a: b}', but does not touch other uses of colons. It does not touch other uses of whitespace. """ from .. import pytree from ..pgen2 import token from .. import fixer_base class FixWsComma(fixer_base.BaseFix): explicit = True # The user must ask for this fixers PATTERN = """ any<(not(',') any)+ ',' ((not(',') any)+ ',')* [not(',') any]> """ COMMA = pytree.Leaf(token.COMMA, u",") COLON = pytree.Leaf(token.COLON, u":") SEPS = (COMMA, COLON) def transform(self, node, results): new = node.clone() comma = False for child in new.children: if child in self.SEPS: prefix = child.prefix if prefix.isspace() and u"\n" not in prefix: child.prefix = u"" comma = True else: if comma: prefix = child.prefix if not prefix: child.prefix = u" " comma = False return new
{ "pile_set_name": "Github" }
# language: ru # encoding: utf-8 #parent uf: @UF11_Прочее #parent ua: @UA44_Прочая_активность_по_проверке #language: ru @tree @IgnoreOnCIMainBuild Функциональность: ПроверкаИсключенийВшагах02 Сценарий: ПроверкаИсключенийВшагах02 - подготовка. Когда я удаляю все элементы Справочника "Справочник3" Дано Я запускаю сценарий открытия TestClient или подключаю уже существующий И В командном интерфейсе я выбираю 'Основная' 'Справочник3' Тогда открылось окно 'Справочник3' И я нажимаю на кнопку с именем 'ФормаСоздать' Тогда открылось окно 'Справочник3 (создание)' И в поле 'Наименование' я ввожу текст '111' И я нажимаю на кнопку 'Записать' Тогда открылось окно '* (Справочник3)' И я нажимаю на кнопку 'Сформировать отчет' Сценарий: Макет пустой И табличный документ формы с именем "РеквизитТабличныйДокумент" стал пустым Сценарий: Равен другому макету. Разное количество строк. Дано Табличный документ "РеквизитТабличныйДокумент" равен макету "ПроверкаИсключенийРавенство01" Сценарий: Равен другому макету. Разное количество колонок. Дано Табличный документ "РеквизитТабличныйДокумент" равен макету "ПроверкаИсключенийРавенство03" Сценарий: Равен другому макету. Разные значения в ячейках. Дано Табличный документ "РеквизитТабличныйДокумент" равен макету "ПроверкаИсключенийРавенство02" Сценарий: Равен другому макету. Разные значения в ячейках по шаблону Дано Табличный документ "РеквизитТабличныйДокумент" равен макету "ПроверкаИсключенийРавенство04"
{ "pile_set_name": "Github" }
# Get Started with Operators in Kubeapps This guide will walk you through the process of enabling support for Operators in Kubeapps and deploy an Operator instance. In this tutorial we will be using the the [Operator Lifecycle Manager (OLM)](https://github.com/operator-framework/operator-lifecycle-manager) to expose the Operators from the [OperatorHub](https://operatorhub.io/). ## Prerequisites Kubeapps assumes a working Kubernetes cluster (v1.12+) and [`kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/) installed and configured to talk to your Kubernetes cluster. Users following this tutorial require to have admin privileges in the cluster in order to install and manage Operators. ## Step 1: Enabling Operators support in Kubeapps The support for Operators is currently under heavy development. For the moment, it's not enabled by default. If you want to use it, you need to enable the related feature flag. This can be done either at installation time or when upgrading Kubeapps. It's just necessary to enable the flag `featureFlags.operators`: ```bash helm repo add bitnami https://charts.bitnami.com/bitnami helm install --name kubeapps --namespace kubeapps bitnami/kubeapps --set featureFlags.operators=true ``` If you are using Helm 3: ```bash kubectl create namespace kubeapps helm install --name kubeapps --namespace kubeapps bitnami/kubeapps --set featureFlags.operators=true ``` For detailed information on installing, configuring and upgrading Kubeapps, checkout the [chart README](../../chart/kubeapps/README.md). ## Step 2: Install the Operator Lifecycle Manager (OLM) Once you access the dashboard, if you go to Configuration => Operators, you will see a message alerting that the OLM is not installed: ![OLM Not Intalled](../img/OLM-not-installed.png) Follow the instructions to install the latest OLM version: ```bash curl -L https://github.com/operator-framework/operator-lifecycle-manager/releases/download/0.15.1/install.sh -o install.sh chmod +x install.sh ./install.sh 0.15.1 ``` Note that you will need special permissions to manage Operators. If you receive a Forbidden error, apply the following ClusterRole to your admin user: ```bash kubectl create clusterrolebinding kubeapps-operator-cluster-admin --clusterrole=cluster-admin --serviceaccount kubeapps:kubeapps-operator ``` NOTE: replace the `kubeapps:kubeapps-operator` with the service account you are using or the cluster user. ## Step 3: Install an Operator After some minutes, you should be able to see the full list of Operators available: ![Operators Available](../img/operators-available.png) Let's deploy the "Akka Cluster Operator". When clicking on it, the information about the Operator is displayed: ![Operators View](../img/operator-view.png) When clicking on the Deploy button, a form to deploy the operator will be displayed. There are two type of Operators: Global and namespaced. Namespaced Operators will be available in a single namespace while global Operators across the cluster. In this case, we are installing a global Operator: ![Operator Deployment Form](../img/operator-deployment.png) Once the Operator is installed (it may take a minute or two) it would be listed like that and you can start deploy instances of that Operator: ![Installed Operators](../img/installed-operators.png) ## Step 4: Deploy an Operator Instance Now, available Operators are listed in the Catalog along with the existing Helm Charts: ![Operators Catalog](../img/operator-catalog.png) You can filter out Charts and select the Akka Cluster example. That would render the YAML form in which you can modify any setting in order to deploy a custom instance: ![Operator Form](../img/operator-form.png) Finally, when the instance gets deployed, after some minutes, you will be able to inspect its status and resources: ![Operator Instance View](../img/operator-instance-view.png) You can also click in the Update button to modify the instance or in the Delete button to remove it. ## Step 5: Provide Feedback We need your feedback to improve this integration! If you find any issue or have a suggestion please [open an issue in GitHub](https://github.com/kubeapps/kubeapps/issues/new) or contact us in the [#kubeapps](https://kubernetes.slack.com/messages/kubeapps) channel in Slack.
{ "pile_set_name": "Github" }
// Compilation check import './types' import Vue from 'vue' import * as Vuex from 'vuex' Vue.use(Vuex)
{ "pile_set_name": "Github" }
/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( policy "k8s.io/api/policy/v1beta1" ) // The EvictionExpansion interface allows manually adding extra methods to the ScaleInterface. type EvictionExpansion interface { Evict(eviction *policy.Eviction) error } func (c *evictions) Evict(eviction *policy.Eviction) error { return c.client.Post(). AbsPath("/api/v1"). Namespace(eviction.Namespace). Resource("pods"). Name(eviction.Name). SubResource("eviction"). Body(eviction). Do(). Error() }
{ "pile_set_name": "Github" }
'use strict'; module.exports = function generate_required(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $vSchema = 'schema' + $lvl; if (!$isData) { if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) { var $required = []; var arr1 = $schema; if (arr1) { var $property, i1 = -1, l1 = arr1.length - 1; while (i1 < l1) { $property = arr1[i1 += 1]; var $propertySch = it.schema.properties[$property]; if (!($propertySch && it.util.schemaHasRules($propertySch, it.RULES.all))) { $required[$required.length] = $property; } } } } else { var $required = $schema; } } if ($isData || $required.length) { var $currentErrorPath = it.errorPath, $loopRequired = $isData || $required.length >= it.opts.loopRequired, $ownProperties = it.opts.ownProperties; if ($breakOnError) { out += ' var missing' + ($lvl) + '; '; if ($loopRequired) { if (!$isData) { out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; } var $i = 'i' + $lvl, $propertyPath = 'schema' + $lvl + '[' + $i + ']', $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); } out += ' var ' + ($valid) + ' = true; '; if ($isData) { out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; } out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; } out += '; if (!' + ($valid) + ') break; } '; if ($isData) { out += ' } '; } out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; } else { out += ' if ( '; var arr2 = $required; if (arr2) { var $propertyKey, $i = -1, l2 = arr2.length - 1; while ($i < l2) { $propertyKey = arr2[$i += 1]; if ($i) { out += ' || '; } var $prop = it.util.getProperty($propertyKey), $useData = $data + $prop; out += ' ( ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; } } out += ') { '; var $propertyPath = 'missing' + $lvl, $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; } } else { if ($loopRequired) { if (!$isData) { out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; } var $i = 'i' + $lvl, $propertyPath = 'schema' + $lvl + '[' + $i + ']', $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); } if ($isData) { out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; } out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; } out += ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; if ($isData) { out += ' } '; } } else { var arr3 = $required; if (arr3) { var $propertyKey, i3 = -1, l3 = arr3.length - 1; while (i3 < l3) { $propertyKey = arr3[i3 += 1]; var $prop = it.util.getProperty($propertyKey), $missingProperty = it.util.escapeQuotes($propertyKey), $useData = $data + $prop; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); } out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; } } } } it.errorPath = $currentErrorPath; } else if ($breakOnError) { out += ' if (true) {'; } return out; }
{ "pile_set_name": "Github" }
package org.infinispan.factories; import org.infinispan.factories.annotations.DefaultFactoryFor; import org.infinispan.util.concurrent.locks.impl.LockContainer; import org.infinispan.util.concurrent.locks.impl.PerKeyLockContainer; import org.infinispan.util.concurrent.locks.impl.StripedLockContainer; /** * Factory class that creates instances of {@link LockContainer}. * * @author Pedro Ruivo * @since 7.0 */ @DefaultFactoryFor(classes = LockContainer.class) public class LockContainerFactory extends AbstractNamedCacheComponentFactory implements AutoInstantiableFactory { @SuppressWarnings("unchecked") @Override public Object construct(String componentName) { return configuration.locking().useLockStriping() ? new StripedLockContainer(configuration.locking().concurrencyLevel()) : new PerKeyLockContainer(); } }
{ "pile_set_name": "Github" }
* 2014-08-29 Wolfram Schlich <wschlich@gentoo.org> * bashinator.lib.0.sh: add a default value for a possibly missing __ScriptName * bashinator.lib.0.sh, bashinator.cfg.sh: add new configuration variables for prefixing messages with the script name + PID: __PrintPrefixScriptNamePid __LogPrefixScriptNamePid __MailPrefixScriptNamePid * 2014-03-17 Wolfram Schlich <wschlich@gentoo.org> * all files: extend comments * example.sh: add more inline documentation, make libraries + configs user-overridable with environment variables by default bashinator-0.6 (2014-04-14): * 2014-03-14 Wolfram Schlich <wschlich@gentoo.org> * library: add comment with a list of global variables used * library: rename global variable Exit to __ScriptExitCode while still supporting the old name for backwards compatibility * __die(): add (optional) global variable __DieExitCode for customizing the default exit code used by __die() * __die(): remove the hardcoded "FATAL:" message prefix * __msgPrint(): add comments about prefixes and colors for the various severities * __msgLog(): add comments about prefixes for the various severities * __msgMail(): add comments about prefixes for the various severities * bashinator.cfg.sh: add __ScriptGenerateStackTrace global variable with default value of 0 * bashinator.cfg.sh: add more comments * example.sh: fix default variant to system installation instead of local installation * all files: removed obsolete RCS headers bashinator-0.5 (2010-05-13): * 2010-05-13 Wolfram Schlich <wschlich@gentoo.org> * library: allow the user to disable using a safe PATH variable by defining __ScriptUseSafePathEnv=0 * library: allow the user to set a custom umask by defining __ScriptUmask=<umask> * library: message severities can now also be specified numerically (see /usr/include/sys/syslog.h and bashinator.cfg.sh) * library: message severity prefixes are now configurable by the user (see bashinator.cfg.sh * library: allow the user to define custom signal handling functions named __trap<signal> (e.g. __trapSIGHUP). this way, also builtin traps can be overridden. to ignore SIGINTs instead of exiting (default), just define a __trapSIGINT function that does nothing: function __trapSIGINT() { :; } ...and you're done. bashinator-0.4 (2009-10-08): * 2009-10-08 Wolfram Schlich <wschlich@gentoo.org> * library: added __requireCommand() * messaging: added new message configuration options for prefixing messages with their severity and source (file name, line number, function name): __PrintPrefixSeverity __PrintPrefixSource __LogPrefixSeverity __LogPrefixSource __MailPrefixSeverity __MailPrefixSource NOTE: manually printed/logged/mailed messages do not get their source recorded. * __msgPrint(): added rxvt as terminal supporting color * __addPrefix(): improve reliability by escaping certain characters * __addPrefix(): do NOT automatically add any characters to the prefix * __dispatch(): on __init() and __main() failure (return value != 0), __die() with their return value instead of 2 * __requireSource(), __includeSource(): check file argument bashinator-0.3.1 (2009-10-05): * 2009-10-05 Wolfram Schlich <wschlich@gentoo.org> * __boot(): fix bash version number comparison bug which prevented bashinator to work with bash-4.0.x bashinator-0.3 (2009-05-28): * 2009-05-28 Wolfram Schlich <wschlich@gentoo.org> * __boot(): when bash version number check fails, exit instead of return * example.sh: change invocation of __boot() and __dispatch() bashinator-0.2 (2009-05-28): * 2009-05-28 Wolfram Schlich <wschlich@gentoo.org> * library: added __includeSource() and __requireSource() * example.sh: boot bashinator before handling application component files (library, config), so we can use the new __requireSource() for sourcing those files bashinator-0.1 (2009-05-28): * 2009-05-28 Wolfram Schlich <wschlich@gentoo.org> * initial release
{ "pile_set_name": "Github" }
package org.keycloak.testsuite.console.page.clients.settings; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.testsuite.console.page.clients.CreateClientForm; import org.keycloak.testsuite.console.page.fragment.OnOffSwitch; import org.keycloak.testsuite.page.Form; import org.keycloak.testsuite.util.Timer; import org.keycloak.testsuite.util.UIUtils; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; import static org.keycloak.testsuite.util.WaitUtils.pause; import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; /** * @author tkyjovsk */ public class ClientSettingsForm extends CreateClientForm { @FindBy(id = "name") private WebElement nameInput; @FindBy(id = "baseUrl") private WebElement baseUrlInput; @FindBy(id = "adminUrl") private WebElement adminUrlInput; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='enabled']]") private OnOffSwitch enabledSwitch; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='alwaysDisplayInConsole']]") private OnOffSwitch alwaysDisplayInConsole; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='consentRequired']]") private OnOffSwitch consentRequiredSwitch; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='standardFlowEnabled']]") private OnOffSwitch standardFlowEnabledSwitch; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='implicitFlowEnabled']]") private OnOffSwitch implicitFlowEnabledSwitch; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='directAccessGrantsEnabled']]") private OnOffSwitch directAccessGrantsEnabledSwitch; @FindBy(id = "accessType") private Select accessTypeSelect; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='serviceAccountsEnabled']]") private OnOffSwitch serviceAccountsEnabledSwitch; @FindBy(id = "newRedirectUri") private WebElement newRedirectUriInput; @FindBy(xpath = ".//button[contains(@data-ng-click,'addRedirectUri')]") private WebElement newRedirectUriSubmit; @FindBy(xpath = ".//input[@ng-model='client.redirectUris[i]']") private List<WebElement> redirectUriInputs; @FindBy(xpath = ".//button[contains(@data-ng-click, 'deleteRedirectUri')]") private List<WebElement> deleteRedirectUriIcons; @FindBy(id = "newWebOrigin") private WebElement newWebOriginInput; @FindBy(xpath = ".//button[contains(@data-ng-click,'addWebOrigin')]") private WebElement newWebOriginSubmit; @FindBy(xpath = ".//input[ng-model='client.webOrigins[i]']") private List<WebElement> webOriginInputs; @FindBy(xpath = ".//button[contains(@data-ng-click, 'deleteWebOrigin')]") private List<WebElement> deleteWebOriginIcons; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='authorizationServicesEnabled']]") private OnOffSwitch authorizationSettingsEnabledSwitch; @FindBy(xpath = ACTIVE_DIV_XPATH + "/button[text()='Disable Authorization Settings']") private WebElement confirmDisableAuthorizationSettingsButton; public enum OidcAccessType { BEARER_ONLY("bearer-only"), PUBLIC("public"), CONFIDENTIAL("confidential"); private final String name; private OidcAccessType(String name) { this.name = name; } public String getName() { return name; } } public void setBaseUrl(String baseUrl) { UIUtils.setTextInputValue(baseUrlInput, baseUrl); } public String getBaseUrl() { return UIUtils.getTextInputValue(baseUrlInput); } public void setAdminUrl(String adminUrl) { UIUtils.setTextInputValue(adminUrlInput, adminUrl); } public String getAdminUrl() { return UIUtils.getTextInputValue(adminUrlInput); } public void addWebOrigin(String redirectUri) { newWebOriginInput.sendKeys(redirectUri); newWebOriginSubmit.click(); } public List<String> getWebOrigins() { List<String> values = new ArrayList<>(); for (WebElement input : webOriginInputs) { values.add(UIUtils.getTextInputValue(input)); } return values; } public void setWebOrigins(List<String> webOrigins) { while (!deleteWebOriginIcons.isEmpty()) { deleteWebOriginIcons.get(0).click(); pause(100); } if (webOrigins != null) { for (String redirectUri : webOrigins) { addWebOrigin(redirectUri); pause(100); } } } public String getName() { return UIUtils.getTextInputValue(nameInput); } public void setName(String name) { UIUtils.setTextInputValue(nameInput, name); } public boolean isEnabled() { return enabledSwitch.isOn(); } public void setEnabled(boolean enabled) { enabledSwitch.setOn(enabled); } public boolean isAlwaysDisplayInConsole() { return alwaysDisplayInConsole.isOn(); } public void setAlwaysDisplayInConsole(boolean enabled) { alwaysDisplayInConsole.setOn(enabled); } public boolean isAlwaysDisplayInConsoleVisible() { return alwaysDisplayInConsole.isVisible(); } public boolean isConsentRequired() { return consentRequiredSwitch.isOn(); } public void setConsentRequired(boolean consentRequired) { consentRequiredSwitch.setOn(consentRequired); } public void setAccessType(OidcAccessType accessType) { accessTypeSelect.selectByVisibleText(accessType.getName()); } public void addRedirectUri(String redirectUri) { newRedirectUriInput.sendKeys(redirectUri); newRedirectUriSubmit.click(); } public List<String> getRedirectUris() { List<String> values = new ArrayList<>(); for (WebElement input : redirectUriInputs) { values.add(UIUtils.getTextInputValue(input)); } return values; } public void setRedirectUris(List<String> redirectUris) { Timer.DEFAULT.reset(); while (!deleteRedirectUriIcons.isEmpty()) { deleteRedirectUriIcons.get(0).click(); pause(100); } Timer.DEFAULT.reset("deleteRedirectUris"); if (redirectUris != null) { for (String redirectUri : redirectUris) { addRedirectUri(redirectUri); pause(100); } } Timer.DEFAULT.reset("addRedirectUris"); } public boolean isStandardFlowEnabled() { return standardFlowEnabledSwitch.isOn(); } public void setStandardFlowEnabled(boolean standardFlowEnabled) { standardFlowEnabledSwitch.setOn(standardFlowEnabled); } public boolean isImplicitFlowEnabled() { return implicitFlowEnabledSwitch.isOn(); } public void setImplicitFlowEnabled(boolean implicitFlowEnabled) { implicitFlowEnabledSwitch.setOn(implicitFlowEnabled); } public boolean isDirectAccessGrantsEnabled() { return directAccessGrantsEnabledSwitch.isOn(); } public void setDirectAccessGrantsEnabled(boolean directAccessGrantsEnabled) { directAccessGrantsEnabledSwitch.setOn(directAccessGrantsEnabled); } public boolean isServiceAccountsEnabled() { return serviceAccountsEnabledSwitch.isOn(); } public void setServiceAccountsEnabled(boolean serviceAccountsEnabled) { serviceAccountsEnabledSwitch.setOn(serviceAccountsEnabled); } public void setAuthorizationSettingsEnabled(boolean enabled) { authorizationSettingsEnabledSwitch.setOn(enabled); } public boolean isAuthorizationSettingsEnabled() { return authorizationSettingsEnabledSwitch.isOn(); } public void confirmDisableAuthorizationSettings() { confirmDisableAuthorizationSettingsButton.click(); } public class SAMLClientSettingsForm extends Form { public static final String SAML_ASSERTION_SIGNATURE = "saml.assertion.signature"; public static final String SAML_AUTHNSTATEMENT = "saml.authnstatement"; public static final String SAML_ONETIMEUSE_CONDITION = "saml.onetimeuse.condition"; public static final String SAML_CLIENT_SIGNATURE = "saml.client.signature"; public static final String SAML_ENCRYPT = "saml.encrypt"; public static final String SAML_FORCE_POST_BINDING = "saml.force.post.binding"; public static final String SAML_MULTIVALUED_ROLES = "saml.multivalued.roles"; public static final String SAML_SERVER_SIGNATURE = "saml.server.signature"; public static final String SAML_SERVER_SIGNATURE_KEYINFO_EXT = "saml.server.signature.keyinfo.ext"; public static final String SAML_SIGNATURE_ALGORITHM = "saml.signature.algorithm"; public static final String SAML_ASSERTION_CONSUMER_URL_POST = "saml_assertion_consumer_url_post"; public static final String SAML_ASSERTION_CONSUMER_URL_REDIRECT = "saml_assertion_consumer_url_redirect"; public static final String SAML_FORCE_NAME_ID_FORMAT = "saml_force_name_id_format"; public static final String SAML_NAME_ID_FORMAT = "saml_name_id_format"; public static final String SAML_SIGNATURE_CANONICALIZATION_METHOD = "saml_signature_canonicalization_method"; public static final String SAML_SINGLE_LOGOUT_SERVICE_URL_POST = "saml_single_logout_service_url_post"; public static final String SAML_SINGLE_LOGOUT_SERVICE_URL_REDIRECT = "saml_single_logout_service_url_redirect"; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='samlAuthnStatement']]") private OnOffSwitch samlAuthnStatement; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='samlOneTimeUseCondition']]") private OnOffSwitch samlOneTimeUseCondition; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='samlServerSignature']]") private OnOffSwitch samlServerSignature; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='samlServerSignatureEnableKeyInfoExtension']]") private OnOffSwitch samlServerSignatureKeyInfoExt; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='samlAssertionSignature']]") private OnOffSwitch samlAssertionSignature; @FindBy(id = "signatureAlgorithm") private Select signatureAlgorithm; @FindBy(id = "canonicalization") private Select canonicalization; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='samlEncrypt']]") private OnOffSwitch samlEncrypt; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='samlClientSignature']]") private OnOffSwitch samlClientSignature; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='samlForcePostBinding']]") private OnOffSwitch samlForcePostBinding; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='frontchannelLogout']]") private OnOffSwitch frontchannelLogout; @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='samlForceNameIdFormat']]") private OnOffSwitch samlForceNameIdFormat; @FindBy(id = "samlNameIdFormat") private Select samlNameIdFormat; @FindBy(xpath = "//fieldset[contains(@data-ng-show, 'saml')]//i") private WebElement fineGrainCollapsor; @FindBy(id = "consumerServicePost") private WebElement consumerServicePostInput; @FindBy(id = "consumerServiceRedirect") private WebElement consumerServiceRedirectInput; @FindBy(id = "logoutPostBinding") private WebElement logoutPostBindingInput; @FindBy(id = "logoutRedirectBinding") private WebElement logoutRedirectBindingInput; public void setValues(ClientRepresentation client) { waitUntilElement(fineGrainCollapsor).is().visible(); Map<String, String> attributes = client.getAttributes(); samlAuthnStatement.setOn("true".equals(attributes.get(SAML_AUTHNSTATEMENT))); samlOneTimeUseCondition.setOn("true".equals(attributes.get(SAML_ONETIMEUSE_CONDITION))); samlServerSignature.setOn("true".equals(attributes.get(SAML_SERVER_SIGNATURE))); samlAssertionSignature.setOn("true".equals(attributes.get(SAML_ASSERTION_SIGNATURE))); if (samlServerSignature.isOn() || samlAssertionSignature.isOn()) { signatureAlgorithm.selectByVisibleText(attributes.get(SAML_SIGNATURE_ALGORITHM)); canonicalization.selectByValue("string:" + attributes.get(SAML_SIGNATURE_CANONICALIZATION_METHOD)); samlServerSignatureKeyInfoExt.setOn("true".equals(attributes.get(SAML_SERVER_SIGNATURE_KEYINFO_EXT))); } samlEncrypt.setOn("true".equals(attributes.get(SAML_ENCRYPT))); samlClientSignature.setOn("true".equals(attributes.get(SAML_CLIENT_SIGNATURE))); samlForcePostBinding.setOn("true".equals(attributes.get(SAML_FORCE_POST_BINDING))); frontchannelLogout.setOn(client.isFrontchannelLogout()); samlForceNameIdFormat.setOn("true".equals(attributes.get(SAML_FORCE_NAME_ID_FORMAT))); samlNameIdFormat.selectByVisibleText(attributes.get(SAML_NAME_ID_FORMAT)); fineGrainCollapsor.click(); waitUntilElement(consumerServicePostInput).is().present(); UIUtils.setTextInputValue(consumerServicePostInput, attributes.get(SAML_ASSERTION_CONSUMER_URL_POST)); UIUtils.setTextInputValue(consumerServiceRedirectInput, attributes.get(SAML_ASSERTION_CONSUMER_URL_REDIRECT)); UIUtils.setTextInputValue(logoutPostBindingInput, attributes.get(SAML_SINGLE_LOGOUT_SERVICE_URL_POST)); UIUtils.setTextInputValue(logoutRedirectBindingInput, attributes.get(SAML_SINGLE_LOGOUT_SERVICE_URL_REDIRECT)); } } }
{ "pile_set_name": "Github" }