text
stringlengths
1
1.05M
/* * Software License Agreement (BSD License) * * Copyright (c) 2019, Locus Robotics * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT 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 FUSE_CORE_AUTODIFF_LOCAL_PARAMETERIZATION_H #define FUSE_CORE_AUTODIFF_LOCAL_PARAMETERIZATION_H #include <fuse_core/local_parameterization.h> #include <fuse_core/macros.h> #include <ceres/internal/autodiff.h> #include <memory> namespace fuse_core { /** * @brief Create a local parameterization with the Jacobians computed via automatic differentiation. * * To get an auto differentiated local parameterization, you must define two classes with a templated operator() * (a.k.a. a functor). * * The first functor should compute: * * Plus(x, delta) -> x_plus_delta * * And the second functor should compute the inverse operation: * * Minus(x1, x2) -> delta * * Minus() should be defined such that if Plus(x1, delta) -> x2, then Minus(x1, x2) -> delta * * The autodiff framework substitutes appropriate "Jet" objects for the template parameter T in order to compute * the derivative when necessary, but this is hidden, and you should write the function as if T were a scalar type * (e.g. a double-precision floating point number). * * Additionally the GlobalSize and LocalSize must be specified as template parameters. * - GlobalSize is the size of the variables x1 and x2. If this is a quaternion, the GloblaSize would be 4. * - LocalSize is the size of delta, and may be different from GlobalSize. For quaternions, there are only 3 degrees * of freedom, so the LocalSize is 3. * * For more information on local parameterizations, see fuse_core::LocalParameterization */ template <typename PlusFunctor, typename MinusFunctor, int kGlobalSize, int kLocalSize> class AutoDiffLocalParameterization : public LocalParameterization { public: SMART_PTR_DEFINITIONS(AutoDiffLocalParameterization<PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize>); /** * @brief Constructs new PlusFunctor and MinusFunctor instances */ AutoDiffLocalParameterization(); /** * @brief Takes ownership of the provided PlusFunctor and MinusFunctor instances */ AutoDiffLocalParameterization(PlusFunctor* plus_functor, MinusFunctor* minus_functor); /** * @brief Generalization of the addition operation, implemented by the provided PlusFunctor * * @param[in] x The starting variable value, of size \p GlobalSize() * @param[in] delta The variable increment to apply, of size \p LocalSize() * @param[out] x_plus_delta The final variable value, of size \p GlobalSize() * @return True if successful, false otherwise */ bool Plus( const double* x, const double* delta, double* x_plus_delta) const override; /** * @brief The Jacobian of Plus(x, delta) w.r.t delta at delta = 0, computed using automatic differentiation * * @param[in] x The value used to evaluate the Jacobian, of size GloblaSize() * @param[out] jacobian The Jacobian in row-major order, of size \p GlobalSize() x \p LocalSize() * @return True is successful, false otherwise */ bool ComputeJacobian( const double* x, double* jacobian) const override; /** * @brief Generalization of the subtraction operation, implemented by the provided MinusFunctor * * @param[in] x1 The value of the first variable, of size \p GlobalSize() * @param[in] x2 The value of the second variable, of size \p GlobalSize() * @param[out] delta The difference between the second variable and the first, of size \p LocalSize() * @return True if successful, false otherwise */ bool Minus( const double* x1, const double* x2, double* delta) const override; /** * @brief The Jacobian of Minus(x1, x2) w.r.t x2 evaluated at x1 = x2 = x, computed using automatic differentiation * @param[in] x The value used to evaluate the Jacobian, of size \p GlobalSize() * @param[out] jacobian The Jacobian in row-major order, of size \p LocalSize() x \p GlobalSize() * @return True is successful, false otherwise */ bool ComputeMinusJacobian( const double* x, double* jacobian) const override; /** * @brief The size of the variable parameterization in the nonlinear manifold */ int GlobalSize() const override { return kGlobalSize; } /** * @brief The size of a delta vector in the linear tangent space to the nonlinear manifold */ int LocalSize() const override { return kLocalSize; } private: std::unique_ptr<PlusFunctor> plus_functor_; std::unique_ptr<MinusFunctor> minus_functor_; }; template <typename PlusFunctor, typename MinusFunctor, int kGlobalSize, int kLocalSize> AutoDiffLocalParameterization<PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize>::AutoDiffLocalParameterization() : plus_functor_(new PlusFunctor()), minus_functor_(new MinusFunctor()) { } template <typename PlusFunctor, typename MinusFunctor, int kGlobalSize, int kLocalSize> AutoDiffLocalParameterization<PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize>::AutoDiffLocalParameterization( PlusFunctor* plus_functor, MinusFunctor* minus_functor) : plus_functor_(plus_functor), minus_functor_(minus_functor) { } template <typename PlusFunctor, typename MinusFunctor, int kGlobalSize, int kLocalSize> bool AutoDiffLocalParameterization<PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize>::Plus( const double* x, const double* delta, double* x_plus_delta) const { return (*plus_functor_)(x, delta, x_plus_delta); } template <typename PlusFunctor, typename MinusFunctor, int kGlobalSize, int kLocalSize> bool AutoDiffLocalParameterization<PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize>::ComputeJacobian( const double* x, double* jacobian) const { double zero_delta[kLocalSize] = {}; // zero-initialize double x_plus_delta[kGlobalSize]; const double* parameter_ptrs[2] = {x, zero_delta}; double* jacobian_ptrs[2] = {NULL, jacobian}; return ceres::internal::AutoDiff<PlusFunctor, double, kGlobalSize, kLocalSize> ::Differentiate(*plus_functor_, parameter_ptrs, kGlobalSize, x_plus_delta, jacobian_ptrs); } template <typename PlusFunctor, typename MinusFunctor, int kGlobalSize, int kLocalSize> bool AutoDiffLocalParameterization<PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize>::Minus( const double* x1, const double* x2, double* delta) const { return (*minus_functor_)(x1, x2, delta); } template <typename PlusFunctor, typename MinusFunctor, int kGlobalSize, int kLocalSize> bool AutoDiffLocalParameterization<PlusFunctor, MinusFunctor, kGlobalSize, kLocalSize>::ComputeMinusJacobian( const double* x, double* jacobian) const { double delta[kLocalSize] = {}; // zero-initialize const double* parameter_ptrs[2] = {x, x}; double* jacobian_ptrs[2] = {NULL, jacobian}; return ceres::internal::AutoDiff<MinusFunctor, double, kGlobalSize, kGlobalSize> ::Differentiate(*minus_functor_, parameter_ptrs, kLocalSize, delta, jacobian_ptrs); } } // namespace fuse_core #endif // FUSE_CORE_AUTODIFF_LOCAL_PARAMETERIZATION_H
#!/bin/bash SRC_FRONTEND_ROOT=src-frontend FS_ROOT=fs function compress_css_for_html () { purifycss "$SRC_FRONTEND_ROOT/$1" "$SRC_FRONTEND_ROOT/$2" --min true --out "$FS_ROOT/$1" } function compress_html () { html-minifier --collapse-inline-tag-whitespace --collapse-whitespace --remove-comments \ --remove-attribute-quotes --remove-redundant-attributes --output "$FS_ROOT/$1" \ "$SRC_FRONTEND_ROOT/$1" } function compress_js () { uglifyjs -c -m "toplevel=true,reserved=['configure_sta','configure_ap','disable_webui']" \ -o "$FS_ROOT/$1" "$SRC_FRONTEND_ROOT/$1" } function make () { echo Compressing css... compress_css_for_html __mgwwc_lit.css __mgwwc_index.html compress_css_for_html __mgwwc_util.css __mgwwc_index.html echo Compressing js... compress_js __mgwwc_main.js echo Compressing html... compress_html __mgwwc_index.html echo Done. } make
#!/bin/bash echo "===== Download Cloud Seeder App =====" URL=$(curl -s https://api.github.com/repos/Arshad-Barves/cloudseeder/releases/latest | grep browser_download_url | cut -d '"' -f 4) wget $URL -O tcloud.tgz echo "===== Unarchive App =====" mkdir tcloud tar zxf tcloud.tgz -C tcloud --strip-components 1 echo "===== Install dependencies =====" cd tcloud npm install --only=prod
// Copyright (c) 2021 rookie-ninja // // Use of this source code is governed by an Apache-style // license that can be found in the LICENSE file. package rkentry // HealthyResponse response of /healthy type HealthyResponse struct { Healthy bool `json:"healthy" yaml:"healthy"` } // GcResponse response of /gc // Returns memory stats of GC before and after. type GcResponse struct { MemStatBeforeGc *MemInfo `json:"memStatBeforeGc" yaml:"memStatBeforeGc"` MemStatAfterGc *MemInfo `json:"memStatAfterGc" yaml:"memStatAfterGc"` } // ConfigsResponse response of /configs type ConfigsResponse struct { Entries []*ConfigsResponseElement `json:"entries" yaml:"entries"` } // ConfigsResponseElement element for ConfigsResponse type ConfigsResponseElement struct { EntryName string `json:"entryName" yaml:"entryName"` EntryType string `json:"entryType" yaml:"entryType"` EntryDescription string `json:"entryDescription" yaml:"entryDescription"` EntryMeta map[string]interface{} `json:"entryMeta" yaml:"entryMeta"` Path string `json:"path" yaml:"path"` } // ApisResponse response for path of /apis type ApisResponse struct { Entries []*ApisResponseElement `json:"entries" yaml:"entries"` } // ApiResponseElement element for ApisResponse type ApisResponseElement struct { EntryName string `json:"entryName" yaml:"entryName"` Method string `json:"method" yaml:"method"` Path string `json:"path" yaml:"path"` Gw string `json:"gw" yaml:"gw"` Port uint64 `json:"port" yaml:"port"` SwUrl string `json:"swUrl" yaml:"swUrl"` } // SysResponse response of /sys type SysResponse struct { CpuInfo *CpuInfo `json:"cpuInfo" yaml:"cpuInfo"` MemInfo *MemInfo `json:"memInfo" yaml:"memInfo"` NetInfo *NetInfo `json:"netInfo" yaml:"netInfo"` OsInfo *OsInfo `json:"osInfo" yaml:"osInfo"` GoEnvInfo *GoEnvInfo `json:"goEnvInfo" yaml:"goEnvInfo"` } // EntriesResponse response of /entries type EntriesResponse struct { Entries map[string][]*EntriesResponseElement `json:"entries" yaml:"entries"` } // EntriesResponseElement element for EntriesResponse type EntriesResponseElement struct { EntryName string `json:"entryName" yaml:"entryName"` EntryType string `json:"entryType" yaml:"entryType"` EntryDescription string `json:"entryDescription" yaml:"entryDescription"` EntryMeta Entry `json:"entryMeta" yaml:"entryMeta"` } // CertsResponse response of /certs type CertsResponse struct { Entries []*CertsResponseElement `json:"entries" yaml:"entries"` } // CertsResponseElement element for CertsResponse type CertsResponseElement struct { EntryName string `json:"entryName" yaml:"entryName"` EntryType string `json:"entryType" yaml:"entryType"` EntryDescription string `json:"entryDescription" yaml:"entryDescription"` ServerCertPath string `json:"serverCertPath" yaml:"serverCertPath"` ServerKeyPath string `json:"serverKeyPath" yaml:"serverKeyPath"` ClientCertPath string `json:"clientCertPath" yaml:"clientCertPath"` ClientKeyPath string `json:"clientKeyPath" yaml:"clientKeyPath"` Endpoint string `json:"endpoint" yaml:"endpoint"` Locale string `json:"locale" yaml:"locale"` Provider string `json:"provider" yaml:"provider"` ServerCert string `json:"serverCert" yaml:"serverCert"` ClientCert string `json:"clientCert" yaml:"clientCert"` } // LogsResponse response of /logs. type LogsResponse struct { Entries map[string][]*LogsResponseElement `json:"entries" yaml:"entries"` } // LogsResponseElement element for LogsResponse type LogsResponseElement struct { EntryName string `json:"entryName" yaml:"entryName"` EntryType string `json:"entryType" yaml:"entryType"` EntryDescription string `json:"entryDescription" yaml:"entryDescription"` EntryMeta Entry `json:"entryMeta" yaml:"entryMeta"` OutputPaths []string `json:"outputPaths" yaml:"outputPaths"` ErrorOutputPaths []string `json:"errorOutputPaths" yaml:"errorOutputPaths"` } // ReqResponse response of /req type ReqResponse struct { Metrics []*ReqMetricsRK `json:"metrics" yaml:"metrics"` } // DepResponse response of /dep type DepResponse struct { GoMod string `json:"goMod" yaml:"goMod"` } // LicenseResponse response of /license type LicenseResponse struct { License string `json:"license" yaml:"license"` } // ReadmeResponse response of /readme type ReadmeResponse struct { Readme string `json:"readme" yaml:"readme"` } // GwErrorMappingResponse response of /gwErrorMapping type GwErrorMappingResponse struct { Mapping map[int32]*GwErrorMappingResponseElement `json:"mapping" yaml:"mapping"` } // GwErrorMappingResponseElement element for GwErrorMappingResponse type GwErrorMappingResponseElement struct { GrpcCode int32 `json:"grpcCode" yaml:"grpcCode"` GrpcText string `json:"grpcText" yaml:"grpcText"` RestCode int32 `json:"restCode" yaml:"restCode"` RestText string `json:"restText" yaml:"restText"` } // GitResponse response of /git type GitResponse struct { Package string `json:"package" yaml:"package"` Url string `json:"url" yaml:"url"` Branch string `yaml:"branch" json:"branch"` Tag string `yaml:"tag" json:"tag"` CommitId string `yaml:"commitId" json:"commitId"` CommitIdAbbr string `yaml:"commitIdAbbr" json:"commitIdAbbr"` CommitDate string `yaml:"commitDate" json:"commitDate"` CommitSub string `yaml:"commitSub" json:"commitSub"` CommitterName string `yaml:"committerName" json:"committerName"` CommitterEmail string `yaml:"committerEmail" json:"committerEmail"` }
def reverse_string(string): rev_string = "" for char in string: rev_string = char + rev_string return rev_string result = reverse_string("Hello World") print(result)
<?xml version="1.0" encoding="UTF-8"?> <bookstore> <book> <title>The Lord of the Rings</title> <author>J.R.R. Tolkien</author> <publisher>George Allen &amp; Unwin</publisher> </book> <book> <title>Harry Potter and the Sorcerer's Stone</title> <author>J.K. Rowling</author> <publisher>Arthur A. Levine Books</publisher> </book> <book> <title>1984</title> <author>George Orwell</author> <publisher>Secker &amp; Warburg</publisher> </book> </bookstore>
function checkParentheses(str) { let stack = []; for (let i = 0; i < str.length; i++) { if (str[i] === '(' || str[i] === '[' || str[i] === '{') { stack.push(str[i]); } else if (str[i] === ')' || str[i] === ']' || str[i] === '}') { let current_char = str[i]; let last_char = stack[stack.length - 1]; if ( (current_char === ')' && last_char === '(') || (current_char === ']' && last_char === '[') || (current_char === '}' && last_char === '{') ) { stack.pop(); } } } return stack.length === 0; }
package com.pangzhao.controller.bak; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; //Rest模式 @RestController @RequestMapping("/books") public class BookController extends BaseClass{ //创建记录日志的的对象 // private static final Logger log = LoggerFactory.getLogger(BookController.class); @GetMapping public String getById(){ System.out.println("springboot is running...2"); log.debug("debug..."); log.info("info..."); log.warn("warn..."); log.error("error..."); return "springboot is running...2"; } }
package aserg.gtf.util; public class ConfigInfo { private float normalizedDOA = 0.75f; private float absoluteDOA = 3.293f; private float tfCoverage = 0.5f; public ConfigInfo(float normalizedDOA, float absoluteDOA, float tfCoverage) { super(); this.normalizedDOA = 0.75f; this.absoluteDOA = 3.293f; this.tfCoverage = 0.5f; } // public float getNormalizedDOA() { // return normalizedDOA; // } // public float getAbsoluteDOA() { // return absoluteDOA; // } // public float getTfCoverage() { // return tfCoverage; // } }
package com.siyuan.enjoyreading.adapter; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.androidapp.utils.ImageLoaderUtils; import com.siyuan.enjoyreading.R; import com.siyuan.enjoyreading.entity.SmallCategoryItem; import java.util.ArrayList; import java.util.List; public class SmallCategoryAdapter extends BaseAdapter { private Context mContext; private List<SmallCategoryItem> keywords = new ArrayList<>(); public SmallCategoryAdapter(Context context, List<SmallCategoryItem> searchKeywords) { mContext = context; keywords.clear(); keywords.addAll(searchKeywords); } @Override public int getCount() { return keywords.size(); } @Override public SmallCategoryItem getItem(int position) { return keywords.get(position); } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { holder = new ViewHolder(); convertView = View.inflate(mContext, R.layout.item_small_category, null); holder.iconImageView = convertView.findViewById(R.id.iv_keyword); holder.titleView = convertView.findViewById(R.id.tv_keyword); holder.baseView = convertView.findViewById(R.id.container); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.titleView.setText(getItem(position).getName()); ImageLoaderUtils.display(mContext, holder.iconImageView, getItem(position).getIcon_url()); return convertView; } class ViewHolder { LinearLayout baseView; ImageView iconImageView; TextView titleView; } }
#!/bin/bash # Set up your host machine for CodeReady Containers crc setup # Start the CodeReady Containers virtual machine crc start --memory 16384 # Add the cached oc executable to your PATH: eval $(crc oc-env) # Log in as a cluster admin user to install the operators needed oc config use-context crc-admin # Subscribe to the required operators oc apply -f https://raw.githubusercontent.com/kiali/demos/master/federated-travels/ossm-subs.yaml # Install two independent meshes (east and west) oc create namespace east-mesh-system oc apply -n east-mesh-system -f https://raw.githubusercontent.com/kiali/demos/master/federated-travels/east/east-ossm.yaml oc create namespace west-mesh-system oc apply -n west-mesh-system -f https://raw.githubusercontent.com/kiali/demos/master/federated-travels/west/west-ossm.yaml # Create the namespaces for the Travels application in both meshes: oc create namespace east-travel-agency oc create namespace east-travel-portal oc create namespace east-travel-control oc create namespace west-travel-agency # Wait for both control planes to be ready oc wait --for condition=Ready -n east-mesh-system smmr/default --timeout 300s oc wait --for condition=Ready -n west-mesh-system smmr/default --timeout 300s # Create a configmap in each mesh namespace containing the root certificate that is used to validate client certificates in the trust domain used by the other mesh oc get configmap istio-ca-root-cert -o jsonpath='{.data.root-cert\.pem}' -n east-mesh-system > east-cert.pem oc create configmap east-ca-root-cert --from-file=root-cert.pem=east-cert.pem -n west-mesh-system oc get configmap istio-ca-root-cert -o jsonpath='{.data.root-cert\.pem}' -n west-mesh-system > west-cert.pem oc create configmap west-ca-root-cert --from-file=root-cert.pem=west-cert.pem -n east-mesh-system # Configure all the federation resources for travels application oc apply -n east-mesh-system -f https://raw.githubusercontent.com/kiali/demos/master/federated-travels/east/east-federation.yaml oc apply -n west-mesh-system -f https://raw.githubusercontent.com/kiali/demos/master/federated-travels/west/west-federation.yaml # Create the application resources oc apply -n east-travel-agency -f https://raw.githubusercontent.com/kiali/demos/master/federated-travels/east/east-travel-agency.yaml oc apply -n east-travel-portal -f https://raw.githubusercontent.com/kiali/demos/master/federated-travels/east/east-travel-portal.yaml oc apply -n east-travel-control -f https://raw.githubusercontent.com/kiali/demos/master/federated-travels/east/east-travel-control.yaml oc apply -n west-travel-agency -f https://raw.githubusercontent.com/kiali/demos/master/federated-travels/west/west-travel-agency.yaml echo "Installation complete. Visit both Kiali instances to look for the complete topology: Links: East Kiali: https://kiali-east-mesh-system.apps-crc.testing West Kiali: https://kiali-west-mesh-system.apps-crc.testing Log in with kubeadmin user: $(crc console --credentials) "
#!/bin/bash # Usage : # bash c14-get-infos.sh [dev or nothing] # Path of the script rootPath="$(dirname "$0")" # Environment : set $dev, $env and $progress if needed if [ -z ${dev+x} ]; then source $rootPath/get-env.sh $1 fi # C14 variables retrieval in the scope, according to the environment # platformIds, protocols and sshIds are arrays userToken=$(xmllint --xpath 'string(infos/userToken)' $rootPath/c14-infos.xml) safeId=$(xmllint --xpath 'string(infos/safeId)' $rootPath/c14-infos.xml) description=$(xmllint --xpath 'string(infos/description)' $rootPath/c14-infos.xml) platformIds=($(xmllint --xpath 'string(infos/platformIds)' $rootPath/c14-infos.xml)) protocols=($(xmllint --xpath 'string(infos/protocols)' $rootPath/c14-infos.xml)) duplicates=$(xmllint --xpath 'string(infos/duplicates)' $rootPath/c14-infos.xml) archivesRetention=$(xmllint --xpath 'string(infos/archivesRetention)' $rootPath/c14-infos.xml) parity=$(xmllint --xpath 'string(infos/parity)' $rootPath/c14-infos.xml) crypto=$(xmllint --xpath 'string(infos/crypto)' $rootPath/c14-infos.xml) if [[ $dev = "dev" ]]; then sshIds=($(xmllint --xpath 'string(infos/sshIdsDev)' $rootPath/c14-infos.xml)) else sshIds=($(xmllint --xpath 'string(infos/sshIds)' $rootPath/c14-infos.xml)) fi # The absence of mandatory variables stops the script if [ -z $userToken ] || [ -z $safeId ] || [ -z $description ] || [ -z $platformIds ] || [ -z $protocols ] || [ -z $duplicates ] || [ -z $archivesRetention ] || [ -z $parity ] || [ -z $crypto ] || [ -z $sshIds ]; then echo `date +%Y-%m-%d_%H:%M:%S`" : At least one C14 mandatory environment variable is missing" exit 1 fi
from sense_hat import SenseHat # Initialize the Sense HAT sense = SenseHat() # Define the grid dimensions grid_size = 5 # Define the grid with player, goal, and obstacles grid = [ [' ', ' ', ' ', ' ', ' '], [' ', ' ', ' ', ' ', ' '], [' ', ' ', ' ', ' ', ' '], [' ', ' ', ' ', ' ', ' '], [' ', ' ', ' ', ' ', ' '] ] # Set the player's initial position player_position = [0, 0] grid[player_position[0]][player_position[1]] = 'P' # Set the goal position goal_position = [4, 4] grid[goal_position[0]][goal_position[1]] = 'G' # Set the obstacle positions obstacle_positions = [[2, 1], [3, 2], [1, 3]] for obstacle_position in obstacle_positions: grid[obstacle_position[0]][obstacle_position[1]] = 'X' # Display the initial grid sense.set_pixels(sum(grid, [])) # Function to update the grid and handle player movement def update_grid(direction): new_position = player_position.copy() if direction == 'up' and player_position[0] > 0: new_position[0] -= 1 elif direction == 'down' and player_position[0] < grid_size - 1: new_position[0] += 1 elif direction == 'left' and player_position[1] > 0: new_position[1] -= 1 elif direction == 'right' and player_position[1] < grid_size - 1: new_position[1] += 1 if grid[new_position[0]][new_position[1]] == ' ': grid[player_position[0]][player_position[1]] = ' ' player_position[0], player_position[1] = new_position[0], new_position[1] grid[player_position[0]][player_position[1]] = 'P' sense.set_pixels(sum(grid, [])) elif grid[new_position[0]][new_position[1]] == 'G': sense.show_message("Goal reached!") elif grid[new_position[0]][new_position[1]] == 'X': sense.show_message("Game over - collided with an obstacle!") # Main game loop while True: for event in sense.stick.get_events(): if event.action == 'pressed': if event.direction == 'up' or event.direction == 'down' or event.direction == 'left' or event.direction == 'right': update_grid(event.direction)
const selectionsort = (list, cmp) => { const maxlen = list.length const compare = cmp || ((a, b) => { return (a - b) }) let minPos let temp for (let index = 0; index < maxlen - 1; index++) { minPos = index for (let current = index + 1; current < maxlen; current++) { if (compare(list[minPos], list[current]) > 0) { minPos = current } } if (minPos !== index) { temp = list[minPos] list[minPos] = list[index] list[index] = temp } } return list } export default selectionsort
<gh_stars>10-100 from flask_jwt_extended import jwt_required from functools import partial import os import shutil import time import uuid from shakenfist import artifact from shakenfist.artifact import Artifact, Artifacts from shakenfist import blob from shakenfist.config import config from shakenfist.daemons import daemon from shakenfist import etcd from shakenfist.external_api import base as api_base from shakenfist import logutil from shakenfist.tasks import SnapshotTask LOG, HANDLER = logutil.setup(__name__) daemon.set_log_level(LOG, 'api') class InstanceSnapshotEndpoint(api_base.Resource): @jwt_required @api_base.arg_is_instance_uuid @api_base.requires_instance_ownership @api_base.redirect_instance_request @api_base.requires_instance_active def post(self, instance_uuid=None, instance_from_db=None, all=None, device=None, max_versions=0): disks = instance_from_db.block_devices['devices'] if instance_from_db.uefi: disks.append({ 'type': 'nvram', 'device': 'nvram', 'path': os.path.join(instance_from_db.instance_path, 'nvram'), 'snapshot_ignores': False }) # Filter if requested if device: new_disks = [] for d in disks: if d['device'] == device: new_disks.append(d) disks = new_disks elif not all: disks = [disks[0]] LOG.with_fields({ 'instance': instance_uuid, 'devices': disks}).info('Devices for snapshot') out = {} for disk in disks: if disk['snapshot_ignores']: continue if disk['type'] not in ['qcow2', 'nvram']: continue if not os.path.exists(disk['path']): continue a = Artifact.from_url( Artifact.TYPE_SNAPSHOT, '%s%s/%s' % (artifact.INSTANCE_URL, instance_uuid, disk['device']), max_versions) blob_uuid = str(uuid.uuid4()) entry = a.add_index(blob_uuid) out[disk['device']] = { 'source_url': a.source_url, 'artifact_uuid': a.uuid, 'artifact_index': entry['index'], 'blob_uuid': blob_uuid } if disk['type'] == 'nvram': # These are small and don't use qemu-img to capture, so just # do them now. blob.ensure_blob_path() dest_path = blob.Blob.filepath(blob_uuid) shutil.copyfile(disk['path'], dest_path) st = os.stat(dest_path) b = blob.Blob.new(blob_uuid, st.st_size, time.time(), time.time()) b.observe() a.state = Artifact.STATE_CREATED else: etcd.enqueue(config.NODE_NAME, { 'tasks': [SnapshotTask(instance_uuid, disk, a.uuid, blob_uuid)], }) instance_from_db.add_event('api', 'snapshot of %s requested' % disk, None, a.uuid) return out @jwt_required @api_base.arg_is_instance_uuid @api_base.requires_instance_ownership def get(self, instance_uuid=None, instance_from_db=None): out = [] for snap in Artifacts([partial(artifact.instance_snapshot_filter, instance_uuid)]): ev = snap.external_view_without_index() for idx in snap.get_all_indexes(): # Give the blob uuid a better name b = blob.Blob.from_db(idx['blob_uuid']) if not b: continue bout = b.external_view() bout['blob_uuid'] = bout['uuid'] del bout['uuid'] # Merge it with the parent artifact a = ev.copy() a.update(bout) out.append(a) return out
#!/bin/bash #SBATCH --job-name=/data/unibas/boittier/test-neighbours2 #SBATCH --nodes=1 #SBATCH --ntasks=1 #SBATCH --partition=short #SBATCH --output=/data/unibas/boittier/test-neighbours2_%A-%a.out hostname # Path to scripts and executables cubefit=/home/unibas/boittier/fdcm_project/mdcm_bin/cubefit.x fdcm=/home/unibas/boittier/fdcm_project/fdcm.x ars=/home/unibas/boittier/fdcm_project/ARS.py # Variables for the job n_steps=10 n_charges=24 scan_name=SCAN_amide1.pdb- suffix=.xyz.chk cubes_dir=/data/unibas/boittier/fdcm/amide/scan-large output_dir=/data/unibas/boittier/test-neighbours2 frames=/home/unibas/boittier/fdcm_project/mdcms/amide/model1/frames.txt initial_fit=/home/unibas/boittier/fdcm_project/mdcms/amide/model1/24_charges_refined.xyz initial_fit_cube=/home/unibas/boittier/fdcm_project/mdcms/amide/model1/amide1.pdb.chk prev_frame=0 start_frame=1 next_frame=2 acd=/home/unibas/boittier/fdcm_project/0_fit.xyz.acd start=$start_frame next=$next_frame dir='frame_'$next output_name=$output_dir/$dir/$dir'-'$start'-'$next'.xyz' initial_fit=$output_dir/"frame_"$start/"frame_"$start'-'$prev_frame'-'$start'.xyz' # Go to the output directory mkdir -p $output_dir cd $output_dir mkdir -p $dir cd $dir # Do Initial Fit # for initial fit esp1=$cubes_dir/$scan_name$start$suffix'.p.cube' dens1=$cubes_dir/$scan_name$start$suffix'.d.cube' esp=$cubes_dir/$scan_name$next$suffix'.p.cube' dens=$cubes_dir/$scan_name$next$suffix'.d.cube' # adjust reference frame python $ars -charges $initial_fit -pcube $dens1 -pcube2 $dens -frames $frames -output $output_name -acd $acd > $output_name.ARS.log # do gradient descent fit $fdcm -xyz $output_name.global -dens $dens -esp $esp -stepsize 0.2 -n_steps $n_steps -learning_rate 0.5 -output $output_name > $output_name.GD.log # adjust reference frame python $ars -charges $output_name -pcube $esp -pcube2 $esp -frames $frames -output $output_name -acd $acd > $output_name.ARS-2.log # make a cube file for the fit $cubefit -v -generate -esp $esp -dens $dens -xyz refined.xyz > $output_name.cubemaking.log # do analysis $cubefit -v -analysis -esp $esp -esp2 $n_charges'charges.cube' -dens $dens > $output_name.analysis.log echo $PWD sbatch /home/unibas/boittier/fdcm_project/job_files/test-neighbours10/frame_1_6.sh sbatch /home/unibas/boittier/fdcm_project/job_files/test-neighbours10/frame_1_30.sh sbatch /home/unibas/boittier/fdcm_project/job_files/test-neighbours10/frame_2_3.sh
import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.linear_model import LogisticRegression # Import dataset dataset = pd.read_csv('transactions.csv') # Separate features (X) and target (y) X = dataset.iloc[:, :-1].values y = dataset.iloc[:, -1].values # Split data into training set and test set X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 0) # Feature scaling sc = StandardScaler() X_train = sc.fit_transform(X_train) X_test = sc.transform(X_test) # Train the model classifier = LogisticRegression(random_state = 0) classifier.fit(X_train, y_train) # Test model y_pred = classifier.predict(X_test)
<reponame>lananh265/social-network "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ic_event_seat_twotone = void 0; var ic_event_seat_twotone = { "viewBox": "0 0 24 24", "children": [{ "name": "path", "attribs": { "d": "M0 0h24v24H0V0z", "fill": "none" }, "children": [] }, { "name": "path", "attribs": { "d": "M9 5h6v7H9z", "opacity": ".3" }, "children": [] }, { "name": "path", "attribs": { "d": "M4 21h2v-4h12v4h2v-6H4zM17 5c0-1.1-.9-2-2-2H9c-1.1 0-2 .9-2 2v9h10V5zm-2 7H9V5h6v7zm4-2h3v3h-3zM2 10h3v3H2z" }, "children": [] }] }; exports.ic_event_seat_twotone = ic_event_seat_twotone;
package a4.kovger.phodb.db.search; import a4.kovger.phodb.db.MetaEntity; import java.util.Date; public class DateFilter implements Filter { enum Type { BEFORE{ public boolean apply(DateFilter f) { return f.date1.before(f.theDate); } }, AFTER { public boolean apply(DateFilter f) { return f.date1.after(f.theDate); } }, AT { public boolean apply(DateFilter f) { return f.date1.equals(f.theDate); } }, BETWEEN { public boolean apply(DateFilter f) { return f.date1.before(f.theDate) && f.date2.after(f.theDate); } } } private Date date1, date2, theDate; public static DateFilter before(Date date1) { DateFilter df = new DateFilter(Type.BEFORE); df.date1 = date1; return df; } public static DateFilter after(Date date1) { DateFilter df = new DateFilter(Type.AFTER); df.date1 = date1; return df; } private Type type; private DateFilter(Type type) { this.type = type; } public void setDate1(Date date1) { this.date1 = date1; } public void setDate2(Date date2) { this.date2 = date2; } @Override public boolean filter(MetaEntity me) { return false; } }
def flatten_inventory(data): result = [] for category in data['clothing']: for item in category.values(): for clothing_item in item: result.append((clothing_item['name'], clothing_item['popularity'])) return result
export const environment = { production: true, careerApiEndpointUrl: 'http://api.career.damjanko.com/' };
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import React from 'react'; import { FormattedMessage } from 'react-intl'; import ReactSelect from 'react-select'; import { InputActionMeta } from 'react-select/src/types'; import { getOptionValue } from 'react-select/src/builtins'; import { Constants, A11yCustomEventTypes } from 'utils/constants'; import SaveButton from 'components/save_button'; import MultiSelectList from './multiselect_list'; import './select_user_mode.scss'; import './select_box.scss'; import DeptTree from './department_tree'; export type Value = { deleteAt?: number; display_name?: string; id: string; label: string; scheme_id?: string; value: string; }; export type Props<T extends Value> = { ariaLabelRenderer: getOptionValue<T>; buttonSubmitLoadingText?: JSX.Element | string; buttonSubmitText?: JSX.Element | string; handleAdd: (value: T) => void; handleDelete: (values: T[]) => void; handleInput: (input: string, multiselect: MultiSelect<T>) => void; handlePageChange?: (newPage: number, currentPage: number) => void; handleSubmit: (value?: T[]) => void; loading?: boolean; maxValues?: number; noteText?: JSX.Element; numRemainingText?: JSX.Element; optionRenderer: ( option: T, isSelected: boolean, onAdd: (value: T) => void, onMouseMove: (value: T) => void ) => void; options: T[]; perPage: number; placeholderText?: string; saving?: boolean; submitImmediatelyOn?: (value: T) => void; totalCount?: number; users?: unknown[]; valueRenderer: (props: { data: T }) => any; values: T[]; } export type State = { a11yActive: boolean; input: string; page: number; showDeptTree: boolean; } const KeyCodes = Constants.KeyCodes; export default class MultiSelect<T extends Value> extends React.PureComponent<Props<T>, State> { private listRef = React.createRef<MultiSelectList<T>>() private reactSelectRef = React.createRef<ReactSelect>() private selected: T | null = null public static defaultProps = { ariaLabelRenderer: defaultAriaLabelRenderer, } public constructor(props: Props<T>) { super(props); this.state = { a11yActive: false, page: 0, input: '', showDeptTree: false, }; } public componentDidMount() { const inputRef: unknown = this.reactSelectRef.current && this.reactSelectRef.current.select.inputRef; document.addEventListener<'keydown'>('keydown', this.handleEnterPress); if (inputRef && typeof (inputRef as HTMLElement).addEventListener === 'function') { (inputRef as HTMLElement).addEventListener(A11yCustomEventTypes.ACTIVATE, this.handleA11yActivateEvent); (inputRef as HTMLElement).addEventListener(A11yCustomEventTypes.DEACTIVATE, this.handleA11yDeactivateEvent); this.reactSelectRef.current!.focus(); // known from ternary definition of inputRef } } public componentWillUnmount() { const inputRef: unknown = this.reactSelectRef.current && this.reactSelectRef.current.select.inputRef; if (inputRef && typeof (inputRef as HTMLElement).addEventListener === 'function') { (inputRef as HTMLElement).removeEventListener(A11yCustomEventTypes.ACTIVATE, this.handleA11yActivateEvent); (inputRef as HTMLElement).removeEventListener(A11yCustomEventTypes.DEACTIVATE, this.handleA11yDeactivateEvent); } document.removeEventListener('keydown', this.handleEnterPress); } private handleA11yActivateEvent = () => { this.setState({ a11yActive: true }); } private handleA11yDeactivateEvent = () => { this.setState({ a11yActive: false }); } private nextPage = () => { if (this.props.handlePageChange) { this.props.handlePageChange(this.state.page + 1, this.state.page); } if (this.listRef.current) { this.listRef.current.setSelected(0); } this.setState({ page: this.state.page + 1 }); } private prevPage = () => { if (this.state.page === 0) { return; } if (this.props.handlePageChange) { this.props.handlePageChange(this.state.page - 1, this.state.page); } if (this.listRef.current) { this.listRef.current.setSelected(0); } this.setState({ page: this.state.page - 1 }); } public resetPaging = () => { this.setState({ page: 0 }); } private onSelect = (selected: T | null) => { this.selected = selected; } private onAdd = (value: T) => { if (this.props.maxValues && this.props.values.length >= this.props.maxValues) { return; } for (let i = 0; i < this.props.values.length; i++) { if (this.props.values[i].id === value.id) { return; } } this.props.handleAdd(value); this.selected = null; if (this.reactSelectRef.current) { this.reactSelectRef.current.select.handleInputChange( { currentTarget: { value: '' } } as React.KeyboardEvent<HTMLInputElement>, ); this.reactSelectRef.current.focus(); } const submitImmediatelyOn = this.props.submitImmediatelyOn; if (submitImmediatelyOn && submitImmediatelyOn(value)) { this.props.handleSubmit([value]); } } private onInput = (input: string, change: InputActionMeta) => { if (!change) { return; } if (change.action === 'input-blur' || change.action === 'menu-close') { return; } if (this.state.input === input) { return; } this.setState({ input }); if (this.listRef.current) { if (input === '') { this.listRef.current.setSelected(-1); } else { this.listRef.current.setSelected(0); } } this.selected = null; this.props.handleInput(input, this); } private onInputKeyDown = (e: React.KeyboardEvent) => { if (e.key === KeyCodes.ENTER[0]) { e.preventDefault(); } } private handleEnterPress = (e: KeyboardEvent) => { if (e.key === KeyCodes.ENTER[0]) { if (this.selected == null) { this.props.handleSubmit(); return; } this.onAdd(this.selected); } } private handleOnClick = (e: React.MouseEvent<HTMLButtonElement>) => { e.preventDefault(); this.props.handleSubmit(); } private onChange: ReactSelect['onChange'] = (_, change) => { if (change.action !== 'remove-value' && change.action !== 'pop-value') { return; } const values = [...this.props.values]; for (let i = 0; i < values.length; i++) { // Types of ReactSelect do not match the behavior here, if (values[i].id === (change as any).removedValue.id) { values.splice(i, 1); break; } } this.props.handleDelete(values); } public render() { const options = Object.assign([...this.props.options]); const { totalCount, users, values } = this.props; let numRemainingText; if (this.props.numRemainingText) { numRemainingText = this.props.numRemainingText; } else if (this.props.maxValues != null) { numRemainingText = ( <FormattedMessage id='multiselect.numRemaining' defaultMessage='You can add {num, number} more. ' values={{ num: this.props.maxValues - this.props.values.length, }} /> ); } let buttonSubmitText; if (this.props.buttonSubmitText) { buttonSubmitText = this.props.buttonSubmitText; } else if (this.props.maxValues != null) { buttonSubmitText = ( <FormattedMessage id='multiselect.go' defaultMessage='Go' /> ); } let optionsToDisplay = []; let nextButton; let previousButton; let noteTextContainer; if (this.props.noteText) { noteTextContainer = ( <div className='multi-select__note'> <div className='note__icon'> <FormattedMessage id='generic_icons.info' defaultMessage='Info Icon' > {(title) => ( <span className='fa fa-info' title={title as string} /> )} </FormattedMessage> </div> <div>{this.props.noteText}</div> </div> ); } const valueMap: Record<string, boolean> = {}; for (let i = 0; i < values.length; i++) { valueMap[values[i].id] = true; } for (let i = options.length - 1; i >= 0; i--) { if (valueMap[options[i].id]) { options.splice(i, 1); } } if (options && options.length > this.props.perPage) { const pageStart = this.state.page * this.props.perPage; const pageEnd = pageStart + this.props.perPage; optionsToDisplay = options.slice(pageStart, pageEnd); if (!this.props.loading) { if (options.length > pageEnd) { nextButton = ( <button className='btn btn-link filter-control filter-control__next' onClick={this.nextPage} > <FormattedMessage id='filtered_user_list.next' defaultMessage='Next' /> </button> ); } if (this.state.page > 0) { previousButton = ( <button className='btn btn-link filter-control filter-control__prev' onClick={this.prevPage} > <FormattedMessage id='filtered_user_list.prev' defaultMessage='Previous' /> </button> ); } } } else { optionsToDisplay = options; } let memberCount; if (users && users.length && totalCount) { memberCount = ( <FormattedMessage id='multiselect.numMembers' defaultMessage='{memberOptions, number} of {totalCount, number} members' values={{ memberOptions: optionsToDisplay.length, totalCount: this.props.totalCount, }} /> ); } return ( <div className='filtered-user-list'> <div className='filter-row filter-row--full'> <div className='multi-select__container react-select'> <ReactSelect id='selectItems' ref={this.reactSelectRef as React.RefObject<any>} // type of ref on @types/react-select is outdated isMulti={true} options={this.props.options} styles={styles} components={{ Menu: nullComponent, IndicatorsContainer: nullComponent, MultiValueLabel: paddedComponent(this.props.valueRenderer), }} isClearable={false} openMenuOnFocus={false} menuIsOpen={false} onInputChange={this.onInput} onKeyDown={this.onInputKeyDown as React.KeyboardEventHandler} onChange={this.onChange} value={this.props.values} placeholder={this.props.placeholderText} inputValue={this.state.input} getOptionValue={(option: Value) => option.id} getOptionLabel={this.props.ariaLabelRenderer} aria-label={this.props.placeholderText} className={this.state.a11yActive ? 'multi-select__focused' : ''} classNamePrefix='react-select-auto react-select' /> <SaveButton id='saveItems' saving={this.props.saving} disabled={this.props.saving} onClick={this.handleOnClick} defaultMessage={buttonSubmitText} savingMessage={this.props.buttonSubmitLoadingText} /> </div> <div id='multiSelectHelpMemberInfo' className='multi-select__help' > {numRemainingText} {memberCount} </div> <div id='multiSelectMessageNote' className='multi-select__help' > {noteTextContainer} </div> </div> <div className='select-user-mode'> <a onClick={() => { this.setState({ showDeptTree: !this.state.showDeptTree }); }} > <FormattedMessage id='invitation_modal.members.dept-filter-enable' defaultMessage='Seach User Filtered By Department' /> {' '} <span className={`direction-icon ${this.state.showDeptTree ? 'up' : 'down'}`}>^</span> </a> </div> <div className={`select-box ${this.state.showDeptTree ? '' : 'hide-dept'}`}> <div> <DeptTree /> </div> </div> <MultiSelectList ref={this.listRef} options={optionsToDisplay} optionRenderer={this.props.optionRenderer} ariaLabelRenderer={this.props.ariaLabelRenderer} page={this.state.page} perPage={this.props.perPage} onPageChange={this.props.handlePageChange} onAdd={this.onAdd} onSelect={this.onSelect} loading={this.props.loading} /> <div className='filter-controls'> {previousButton} {nextButton} </div> </div> ); } } function defaultAriaLabelRenderer(option: Value) { if (!option) { return null; } return option.label; } const nullComponent = () => null; const paddedComponent = (WrappedComponent: any) => { return (props: { data: any }) => { return ( <div style={{ paddingLeft: '10px' }}> <WrappedComponent {...props} /> </div> ); }; }; const styles = { container: () => { return { display: 'table-cell', paddingRight: '15px', verticalAlign: 'top', width: '100%', }; }, };
<filename>tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/ToDoDatabase.java // Copyright 2007, 2008 The Apache Software Foundation // // 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.apache.tapestry5.integration.app1.services; import org.apache.tapestry5.integration.app1.data.ToDoItem; import java.util.List; public interface ToDoDatabase { /** * Adds an item to the database, first assigning a unique id to the item. */ void add(ToDoItem item); /** * Finds all items, sorted ascending by each item's order property. */ List<ToDoItem> findAll(); /** * Updates an existing item. * * @param item * @throws RuntimeException if the item does not exist */ void update(ToDoItem item); /** * Resets the database, clearing out all data, re-adding base data. */ void reset(); /** * Deletes all items from the database. */ void clear(); /** * Removes an existing item * * @param itemId item to remove * @throws RuntimeException if the item does not exist */ void remove(long itemId); /** * Gets the item, or returns null. */ ToDoItem get(long itemId); }
#!/bin/bash #from https://stackoverflow.com/questions/24641948/merging-csv-files-appending-instead-of-merging/24643455 if [ "$#" -ne 1 ]; then echo ">>> Illegal number of parameters running merge_csvs.sh" exit 2 fi dir=$1; base_dir_name=$(basename $dir) OutFileName="$base_dir_name.csv" #output csv has name directory.csv i=0 # Reset a counter for filename in $dir/*.csv; do #echo "$filename" if [ "$filename" != "$OutFileName" ] ; # Avoid recursion then if [[ $i -eq 0 ]] ; then head -1 "$filename" > $dir/"$OutFileName" # Copy header if it is the first file fi tail -n +2 "$filename" >> $dir/"$OutFileName" # Append from the 2nd line each file i=$(( $i + 1 )) # Increase the counter fi done
package carrot import ( "encoding/json" log "github.com/sirupsen/logrus" ) type response interface { AddParam() AddParams() } // for use of controller-level control type ResponseParams map[string]interface{} // NewOffset instantiates a struct to hold coordinate data used later to create JSON objects. func NewOffset(x float64, y float64, z float64) (*offset, error) { return &offset{ X: x, Y: y, Z: z, }, nil } // NewPayload instantiates a struct to hold offset and params data used later to create JSON objects. func NewPayload(sessionToken string, offset *offset, params map[string]interface{}) (payload, error) { sessions := NewDefaultSessionManager() primaryToken, err := sessions.GetPrimaryDeviceToken() if err != nil { return payload{}, err } // if the requester is a primary device, // don't do any transform math // likewise, if the incoming offset is empty, don't perform a transform if sessionToken == string(primaryToken) || offset == nil { return newPayloadNoTransform(offset, params) } currentSession, err := sessions.Get(SessionToken(sessionToken)) if err != nil { return payload{}, err } //do transform math to get event placement e_p, err := getE_P(currentSession, offset) //if err != nil { // return payload{}, err //} log.Info() return payload{ Offset: e_p, Params: params, }, nil } // newPayloadNoTransform instantiates a struct to hold payload data without modifying // the offset content used later to create JSON objects. func newPayloadNoTransform(offset *offset, params map[string]interface{}) (payload, error) { return payload{ Offset: offset, Params: params, }, nil } // NewResponse instantiates a struct that will be directly converted to a JSON object to be broadcasted to devices. func NewResponse(sessionToken string, endpoint string, payload payload) (*messageData, error) { return &messageData{ SessionToken: sessionToken, Endpoint: endpoint, Payload: payload, }, nil } // AddParam adds a new parameter to the params field of the payload but does not override existing ones. func (md *messageData) AddParam(key string, value interface{}) { if md.Payload.Params == nil { md.Payload.Params = make(map[string]interface{}) } params := md.Payload.Params _, exists := params[key] if !exists { params[key] = value } } // AddParams adds new parameters to the params field of the payload but does not override existing ones. func (md *messageData) AddParams(rp ResponseParams) { for key, value := range rp { md.AddParam(key, value) } } // Build converts response struct into JSON object that will be broadcasted to devices. func (md *messageData) Build() ([]byte, error) { res, err := json.Marshal(md) return res, err } // CreateDefaultResponse generates a JSON object (ready to broadcast response) from a request in one step. // This function offers brevity but does not support extra input from controllers (skips adding params). func CreateDefaultResponse(req *Request) ([]byte, error) { payload, err := NewPayload(string(req.SessionToken), req.Offset, req.Params) r, err := NewResponse(string(req.SessionToken), req.endpoint, payload) res, err := r.Build() return res, err }
sudo apt-get -y update sudo apt-get -y upgrade # relevant dependencies sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev sudo apt-get install -y libxine2-dev libv4l-dev sudo apt-get install -y libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev sudo apt-get install -y qt5-default libgtk2.0-dev libtbb-dev sudo apt-get install -y libatlas-base-dev sudo apt-get install -y libfaac-dev libmp3lame-dev libtheora-dev sudo apt-get install -y libvorbis-dev libxvidcore-dev sudo apt-get install -y libopencore-amrnb-dev libopencore-amrwb-dev sudo apt-get install -y x264 v4l-utils # Optional dependencies sudo apt-get install -y libprotobuf-dev protobuf-compiler sudo apt-get install -y libgoogle-glog-dev libgflags-dev sudo apt-get install -y libgphoto2-dev libeigen3-dev libhdf5-dev doxygen
import ReportEsApi from './report_es_api'; export default ReportEsApi;
<reponame>kotik-coder/PULsE<filename>src/main/java/pulse/util/PropertyHolderListener.java package pulse.util; /** * A listener used by {@code PropertyHolder}s to track changes with the * associated {@code Propert}ies. */ public interface PropertyHolderListener { /** * This event is triggered by any {@code PropertyHolder}, the properties of * which have been changed. * * @param event the event associated with actions taken on a * {@code Property}. */ public void onPropertyChanged(PropertyEvent event); }
'use strict'; if (typeof require !== 'undefined') { var ShioriConverter = require('shiori_converter').ShioriConverter; } /** * SHIORI/2.x/3.x transaction class with protocol version converter */ class ShioriTransaction { /** * constructor * @return {ShioriTransaction} this */ constructor() { } /** * request * @return {ShioriJK.Message.Request} request */ get request() { return this._request; } /** * request * @param {ShioriJK.Message.Request} request - request * @return {ShioriJK.Message.Request} request */ set request(request) { this._request = request; this._request.to = this.request_to.bind(this); return this._request; } /** * response * @return {ShioriJK.Message.Response} response */ get response() { return this._response; } /** * response * @param {ShioriJK.Message.Response} response - response * @return {ShioriJK.Message.Response} response */ set response(response) { this._response = response; this._response.to = this.response_to.bind(this); return this._response; } /** * convert request to specified protocol version * (this method needs ShioriConverter) * @param {string} version - target protocol version * @return {ShioriJK.Message.Request} specified version request */ request_to(version) { return ShioriConverter.request_to(this.request, version); } /** * convert response to specified protocol version * (this method needs ShioriConverter) * @param {string} version - target protocol version * @return {ShioriJK.Message.Response} specified version response */ response_to(version) { return ShioriConverter.response_to(this.request, this.response, version); } } export {ShioriTransaction};
<filename>lock/release_test.go package lock import ( "testing" "time" . "github.com/smartystreets/goconvey/convey" ) func TestRelease(t *testing.T) { locker := NewEtcdLocker(client(), true) Convey("After release a key should be lockable immediately", t, func() { lock, err := locker.Acquire("/lock-release", 10) So(lock, ShouldNotBeNil) So(err, ShouldBeNil) err = lock.Release() So(err, ShouldBeNil) lock, err = locker.Acquire("/lock-release", 10) So(lock, ShouldNotBeNil) So(err, ShouldBeNil) err = lock.Release() So(err, ShouldBeNil) }) Convey("After expiration, release a lock shouldn't produce an error", t, func() { lock, _ := locker.Acquire("/lock-release-exp", 1) time.Sleep(2) err := lock.Release() So(err, ShouldBeNil) }) Convey("Release a nil lock should not panic", t, func() { var lock *EtcdLock err := lock.Release() So(err, ShouldNotBeNil) }) }
import { createSelector } from "reselect"; import { initialState } from "./reducer"; /** * Direct selector to the dashboard state domain */ const selectDashboardDomain = state => state.get("dashboard", initialState); /** * Other specific selectors */ /** * Default selector used by Dashboard */ const makeSelectDashboard = () => createSelector(selectDashboardDomain, substate => substate.toJS()); const makeFeaturedEventSelector = () => { console.log("Dashboard selector being called"); return createSelector(selectDashboardDomain, substate => { console.log( "featuredEvents in Dashboard selector", substate.get("featuredEvents") ); return substate.get("featuredEvents"); }); }; const makeEventsSelector = () => createSelector(selectDashboardDomain, substate => substate.get("events")); export default makeSelectDashboard; export { selectDashboardDomain, makeFeaturedEventSelector, makeEventsSelector };
cd data/wikipedia_sci if [ ! -e text8 ]; then cd ../../ wget http://mattmahoney.net/dc/text8.zip -O text8.gz mv text8.gz data/wikipedia_sci && cd data/wikipedia_sci gzip -d text8.gz -f cd ../../ fi
# Powerline export powerline_branch= export powerline_line_number= export powerline_readonly= export powerline_extra_column_number= export powerline_left_hard_divider= export powerline_left_soft_divider= export powerline_right_hard_divider= export powerline_right_soft_divider= export powerline_extra_right_half_circle_thick= export powerline_extra_right_half_circle_thin= export powerline_extra_left_half_circle_thick= export powerline_extra_left_half_circle_thin= export powerline_extra_lower_left_triangle= export powerline_extra_backslash_separator= export powerline_extra_lower_right_triangle= export powerline_extra_forwardslash_separator= export powerline_extra_upper_left_triangle= export powerline_extra_forwardslash_separator_redundant= export powerline_extra_upper_right_triangle= export powerline_extra_backslash_separator_redundant= export powerline_extra_flame_thick= export powerline_extra_flame_thin= export powerline_extra_flame_thick_mirrored= export powerline_extra_flame_thin_mirrored= export powerline_extra_pixelated_squares_small= export powerline_extra_pixelated_squares_small_mirrored= export powerline_extra_pixelated_squares_big= export powerline_extra_pixelated_squares_big_mirrored= export powerline_extra_ice_waveform= export powerline_extra_ice_waveform_mirrored= export powerline_extra_honeycomb= export powerline_extra_honeycomb_outline= export powerline_extra_lego_separator= export powerline_extra_lego_separator_thin= export powerline_extra_lego_block_facing= export powerline_extra_lego_block_sideways= export powerline_extra_trapezoid_top_bottom= export powerline_extra_trapezoid_top_bottom_mirrored= # Octicons export oct_heart= export oct_zap= export oct_light_bulb= export oct_repo= export oct_repo_forked= export oct_repo_push= export oct_repo_pull= export oct_book= export oct_octoface= export oct_git_pull_request= export oct_mark_github= export oct_cloud_download= export oct_cloud_upload= export oct_keyboard= export oct_gist= export oct_file_code= export oct_file_text= export oct_file_media= export oct_file_zip= export oct_file_pdf= export oct_tag= export oct_file_directory= export oct_file_submodule= export oct_person= export oct_jersey= export oct_git_commit= export oct_git_branch= export oct_git_merge= export oct_mirror= export oct_issue_opened= export oct_issue_reopened= export oct_issue_closed= export oct_star= export oct_comment= export oct_question= export oct_alert= export oct_search= export oct_gear= export oct_radio_tower= export oct_tools= export oct_sign_out= export oct_rocket= export oct_rss= export oct_clippy= export oct_sign_in= export oct_organization= export oct_device_mobile= export oct_unfold= export oct_check= export oct_mail= export oct_mail_read= export oct_arrow_up= export oct_arrow_right= export oct_arrow_down= export oct_arrow_left= export oct_pin= export oct_gift= export oct_graph= export oct_triangle_left= export oct_credit_card= export oct_clock= export oct_ruby= export oct_broadcast= export oct_key= export oct_repo_force_push= export oct_repo_clone= export oct_diff= export oct_eye= export oct_comment_discussion= export oct_mail_reply= export oct_primitive_dot= export oct_primitive_square= export oct_device_camera= export oct_device_camera_video= export oct_pencil= export oct_info= export oct_triangle_right= export oct_triangle_down= export oct_link= export oct_plus= export oct_three_bars= export oct_code= export oct_location= export oct_list_unordered= export oct_list_ordered= export oct_quote= export oct_versions= export oct_calendar= export oct_lock= export oct_diff_added= export oct_diff_removed= export oct_diff_modified= export oct_diff_renamed= export oct_horizontal_rule= export oct_arrow_small_right= export oct_milestone= export oct_checklist= export oct_megaphone= export oct_chevron_right= export oct_bookmark= export oct_settings= export oct_dashboard= export oct_history= export oct_link_external= export oct_mute= export oct_x= export oct_circle_slash= export oct_pulse= export oct_sync= export oct_telescope= export oct_gist_secret= export oct_home= export oct_stop= export oct_bug= export oct_logo_github= export oct_file_binary= export oct_database= export oct_server= export oct_diff_ignored= export oct_ellipsis= export oct_no_newline= export oct_hubot= export oct_arrow_small_up= export oct_arrow_small_down= export oct_arrow_small_left= export oct_chevron_up= export oct_chevron_down= export oct_chevron_left= export oct_triangle_up= export oct_git_compare= export oct_logo_gist= export oct_file_symlink_file= export oct_file_symlink_directory= export oct_squirrel= export oct_globe= export oct_unmute= export oct_mention= export oct_package= export oct_browser= export oct_terminal= export oct_markdown= export oct_dash= export oct_fold= export oct_inbox= export oct_trashcan= export oct_paintcan= export oct_flame= export oct_briefcase= export oct_plug= export oct_circuit_board= export oct_mortar_board= export oct_law= export oct_thumbsup= export oct_thumbsdown= export oct_desktop_download= export oct_beaker= export oct_bell= export oct_watch= export oct_shield= export oct_bold= export oct_text_size= export oct_italic= export oct_tasklist= export oct_verified= export oct_smiley= export oct_unverified= export oct_ellipses= export oct_file= export oct_grabber= export oct_plus_small= export oct_reply= export oct_device_desktop= # Font Awesome export fa_glass= export fa_music= export fa_search= export fa_envelope_o= export fa_heart= export fa_star= export fa_star_o= export fa_user= export fa_film= export fa_th_large= export fa_th= export fa_th_list= export fa_check= export fa_close= export fa_search_plus= export fa_search_minus= export fa_power_off= export fa_signal= export fa_cog= export fa_trash_o= export fa_home= export fa_file_o= export fa_clock_o= export fa_road= export fa_download= export fa_arrow_circle_o_down= export fa_arrow_circle_o_up= export fa_inbox= export fa_play_circle_o= export fa_repeat= export fa_refresh= export fa_list_alt= export fa_lock= export fa_flag= export fa_headphones= export fa_volume_off= export fa_volume_down= export fa_volume_up= export fa_qrcode= export fa_barcode= export fa_tag= export fa_tags= export fa_book= export fa_bookmark= export fa_print= export fa_camera= export fa_font= export fa_bold= export fa_italic= export fa_text_height= export fa_text_width= export fa_align_left= export fa_align_center= export fa_align_right= export fa_align_justify= export fa_list= export fa_dedent= export fa_indent= export fa_video_camera= export fa_image= export fa_pencil= export fa_map_marker= export fa_adjust= export fa_tint= export fa_edit= export fa_share_square_o= export fa_check_square_o= export fa_arrows= export fa_step_backward= export fa_fast_backward= export fa_backward= export fa_play= export fa_pause= export fa_stop= export fa_forward= export fa_fast_forward= export fa_step_forward= export fa_eject= export fa_chevron_left= export fa_chevron_right= export fa_plus_circle= export fa_minus_circle= export fa_times_circle= export fa_check_circle= export fa_question_circle= export fa_info_circle= export fa_crosshairs= export fa_times_circle_o= export fa_check_circle_o= export fa_ban= export fa_arrow_left= export fa_arrow_right= export fa_arrow_up= export fa_arrow_down= export fa_mail_forward= export fa_expand= export fa_compress= export fa_plus= export fa_minus= export fa_asterisk= export fa_exclamation_circle= export fa_gift= export fa_leaf= export fa_fire= export fa_eye= export fa_eye_slash= export fa_exclamation_triangle= export fa_plane= export fa_calendar= export fa_random= export fa_comment= export fa_magnet= export fa_chevron_up= export fa_chevron_down= export fa_retweet= export fa_shopping_cart= export fa_folder= export fa_folder_open= export fa_arrows_v= export fa_arrows_h= export fa_bar_chart= export fa_twitter_square= export fa_facebook_square= export fa_camera_retro= export fa_key= export fa_cogs= export fa_comments= export fa_thumbs_o_up= export fa_thumbs_o_down= export fa_star_half= export fa_heart_o= export fa_sign_out= export fa_linkedin_square= export fa_thumb_tack= export fa_external_link= export fa_sign_in= export fa_trophy= export fa_github_square= export fa_upload= export fa_lemon_o= export fa_phone= export fa_square_o= export fa_bookmark_o= export fa_phone_square= export fa_twitter= export fa_facebook= export fa_github= export fa_unlock= export fa_credit_card= export fa_feed= export fa_hdd_o= export fa_bullhorn= export fa_bell_o= export fa_certificate= export fa_hand_o_right= export fa_hand_o_left= export fa_hand_o_up= export fa_hand_o_down= export fa_arrow_circle_left= export fa_arrow_circle_right= export fa_arrow_circle_up= export fa_arrow_circle_down= export fa_globe= export fa_wrench= export fa_tasks= export fa_filter= export fa_briefcase= export fa_arrows_alt= export fa_group= export fa_chain= export fa_cloud= export fa_flask= export fa_cut= export fa_copy= export fa_paperclip= export fa_floppy_o= export fa_square= export fa_bars= export fa_list_ul= export fa_list_ol= export fa_strikethrough= export fa_underline= export fa_table= export fa_magic= export fa_truck= export fa_pinterest= export fa_pinterest_square= export fa_google_plus_square= export fa_google_plus= export fa_money= export fa_caret_down= export fa_caret_up= export fa_caret_left= export fa_caret_right= export fa_columns= export fa_sort= export fa_sort_desc= export fa_sort_asc= export fa_envelope= export fa_linkedin= export fa_rotate_left= export fa_gavel= export fa_dashboard= export fa_comment_o= export fa_comments_o= export fa_bolt= export fa_sitemap= export fa_umbrella= export fa_clipboard= export fa_lightbulb_o= export fa_exchange= export fa_cloud_download= export fa_cloud_upload= export fa_user_md= export fa_stethoscope= export fa_suitcase= export fa_bell= export fa_coffee= export fa_cutlery= export fa_file_text_o= export fa_building_o= export fa_hospital_o= export fa_ambulance= export fa_medkit= export fa_fighter_jet= export fa_beer= export fa_h_square= export fa_plus_square= export fa_angle_double_left= export fa_angle_double_right= export fa_angle_double_up= export fa_angle_double_down= export fa_angle_left= export fa_angle_right= export fa_angle_up= export fa_angle_down= export fa_desktop= export fa_laptop= export fa_tablet= export fa_mobile= export fa_circle_o= export fa_quote_left= export fa_quote_right= export fa_spinner= export fa_circle= export fa_mail_reply= export fa_github_alt= export fa_folder_o= export fa_folder_open_o= export fa_expand_alt= export fa_collapse_alt= export fa_smile_o= export fa_frown_o= export fa_meh_o= export fa_gamepad= export fa_keyboard_o= export fa_flag_o= export fa_flag_checkered= export fa_terminal= export fa_code= export fa_mail_reply_all= export fa_star_half_empty= export fa_location_arrow= export fa_crop= export fa_code_fork= export fa_chain_broken= export fa_question= export fa_info= export fa_exclamation= export fa_superscript= export fa_subscript= export fa_eraser= export fa_puzzle_piece= export fa_microphone= export fa_microphone_slash= export fa_shield= export fa_calendar_o= export fa_fire_extinguisher= export fa_rocket= export fa_maxcdn= export fa_chevron_circle_left= export fa_chevron_circle_right= export fa_chevron_circle_up= export fa_chevron_circle_down= export fa_html5= export fa_css3= export fa_anchor= export fa_unlock_alt= export fa_bullseye= export fa_ellipsis_h= export fa_ellipsis_v= export fa_rss_square= export fa_play_circle= export fa_ticket= export fa_minus_square= export fa_minus_square_o= export fa_level_up= export fa_level_down= export fa_check_square= export fa_pencil_square= export fa_external_link_square= export fa_share_square= export fa_compass= export fa_caret_square_o_down= export fa_caret_square_o_up= export fa_caret_square_o_right= export fa_eur= export fa_gbp= export fa_dollar= export fa_inr= export fa_cny= export fa_rouble= export fa_krw= export fa_bitcoin= export fa_file= export fa_file_text= export fa_sort_alpha_asc= export fa_sort_alpha_desc= export fa_sort_amount_asc= export fa_sort_amount_desc= export fa_sort_numeric_asc= export fa_sort_numeric_desc= export fa_thumbs_up= export fa_thumbs_down= export fa_youtube_square= export fa_youtube= export fa_xing= export fa_xing_square= export fa_youtube_play= export fa_dropbox= export fa_stack_overflow= export fa_instagram= export fa_flickr= export fa_adn= export fa_bitbucket= export fa_bitbucket_square= export fa_tumblr= export fa_tumblr_square= export fa_long_arrow_down= export fa_long_arrow_up= export fa_long_arrow_left= export fa_long_arrow_right= export fa_apple= export fa_windows= export fa_android= export fa_linux= export fa_dribbble= export fa_skype= export fa_foursquare= export fa_trello= export fa_female= export fa_male= export fa_gittip= export fa_sun_o= export fa_moon_o= export fa_archive= export fa_bug= export fa_vk= export fa_weibo= export fa_renren= export fa_pagelines= export fa_stack_exchange= export fa_arrow_circle_o_right= export fa_arrow_circle_o_left= export fa_caret_square_o_left= export fa_dot_circle_o= export fa_wheelchair= export fa_vimeo_square= export fa_try= export fa_plus_square_o= export fa_space_shuttle= export fa_slack= export fa_envelope_square= export fa_wordpress= export fa_openid= export fa_bank= export fa_graduation_cap= export fa_yahoo= export fa_google= export fa_reddit= export fa_reddit_square= export fa_stumbleupon_circle= export fa_stumbleupon= export fa_delicious= export fa_digg= export fa_pied_piper_pp= export fa_pied_piper_alt= export fa_drupal= export fa_joomla= export fa_language= export fa_fax= export fa_building= export fa_child= export fa_paw= export fa_spoon= export fa_cube= export fa_cubes= export fa_behance= export fa_behance_square= export fa_steam= export fa_steam_square= export fa_recycle= export fa_automobile= export fa_cab= export fa_tree= export fa_spotify= export fa_deviantart= export fa_soundcloud= export fa_database= export fa_file_pdf_o= export fa_file_word_o= export fa_file_excel_o= export fa_file_powerpoint_o= export fa_file_image_o= export fa_file_archive_o= export fa_file_audio_o= export fa_file_movie_o= export fa_file_code_o= export fa_vine= export fa_codepen= export fa_jsfiddle= export fa_life_bouy= export fa_circle_o_notch= export fa_ra= export fa_empire= export fa_git_square= export fa_git= export fa_hacker_news= export fa_tencent_weibo= export fa_qq= export fa_wechat= export fa_paper_plane= export fa_paper_plane_o= export fa_history= export fa_circle_thin= export fa_header= export fa_paragraph= export fa_sliders= export fa_share_alt= export fa_share_alt_square= export fa_bomb= export fa_futbol_o= export fa_tty= export fa_binoculars= export fa_plug= export fa_slideshare= export fa_twitch= export fa_yelp= export fa_newspaper_o= export fa_wifi= export fa_calculator= export fa_paypal= export fa_google_wallet= export fa_cc_visa= export fa_cc_mastercard= export fa_cc_discover= export fa_cc_amex= export fa_cc_paypal= export fa_cc_stripe= export fa_bell_slash= export fa_bell_slash_o= export fa_trash= export fa_copyright= export fa_at= export fa_eyedropper= export fa_paint_brush= export fa_birthday_cake= export fa_area_chart= export fa_pie_chart= export fa_line_chart= export fa_lastfm= export fa_lastfm_square= export fa_toggle_off= export fa_toggle_on= export fa_bicycle= export fa_bus= export fa_ioxhost= export fa_angellist= export fa_cc= export fa_ils= export fa_meanpath= export fa_buysellads= export fa_connectdevelop= export fa_dashcube= export fa_forumbee= export fa_leanpub= export fa_sellsy= export fa_shirtsinbulk= export fa_simplybuilt= export fa_skyatlas= export fa_cart_plus= export fa_cart_arrow_down= export fa_diamond= export fa_ship= export fa_user_secret= export fa_motorcycle= export fa_street_view= export fa_heartbeat= export fa_venus= export fa_mars= export fa_mercury= export fa_intersex= export fa_transgender_alt= export fa_venus_double= export fa_mars_double= export fa_venus_mars= export fa_mars_stroke= export fa_mars_stroke_v= export fa_mars_stroke_h= export fa_neuter= export fa_genderless= export fa__523= export fa__524= export fa_facebook_official= export fa_pinterest_p= export fa_whatsapp= export fa_server= export fa_user_plus= export fa_user_times= export fa_bed= export fa_viacoin= export fa_train= export fa_subway= export fa_medium= export fa_y_combinator= export fa_optin_monster= export fa_opencart= export fa_expeditedssl= export fa_battery= export fa_battery_3= export fa_battery_2= export fa_battery_1= export fa_battery_0= export fa_mouse_pointer= export fa_i_cursor= export fa_object_group= export fa_object_ungroup= export fa_sticky_note= export fa_sticky_note_o= export fa_cc_jcb= export fa_cc_diners_club= export fa_clone= export fa_balance_scale= export fa_hourglass_o= export fa_hourglass_1= export fa_hourglass_2= export fa_hourglass_3= export fa_hourglass= export fa_hand_grab_o= export fa_hand_paper_o= export fa_hand_scissors_o= export fa_hand_lizard_o= export fa_hand_spock_o= export fa_hand_pointer_o= export fa_hand_peace_o= export fa_trademark= export fa_registered= export fa_creative_commons= export fa_gg= export fa_gg_circle= export fa_tripadvisor= export fa_odnoklassniki= export fa_odnoklassniki_square= export fa_get_pocket= export fa_wikipedia_w= export fa_safari= export fa_chrome= export fa_firefox= export fa_opera= export fa_internet_explorer= export fa_television= export fa_contao= export fa_500px= export fa_amazon= export fa_calendar_plus_o= export fa_calendar_minus_o= export fa_calendar_times_o= export fa_calendar_check_o= export fa_industry= export fa_map_pin= export fa_map_signs= export fa_map_o= export fa_map= export fa_commenting= export fa_commenting_o= export fa_houzz= export fa_vimeo= export fa_black_tie= export fa_fonticons= export fa_reddit_alien= export fa_edge= export fa_credit_card_alt= export fa_codiepie= export fa_modx= export fa_fort_awesome= export fa_usb= export fa_product_hunt= export fa_mixcloud= export fa_scribd= export fa_pause_circle= export fa_pause_circle_o= export fa_stop_circle= export fa_stop_circle_o= export fa_shopping_bag= export fa_shopping_basket= export fa_hashtag= export fa_bluetooth= export fa_bluetooth_b= export fa_percent= export fa_gitlab= export fa_wpbeginner= export fa_wpforms= export fa_envira= export fa_universal_access= export fa_wheelchair_alt= export fa_question_circle_o= export fa_blind= export fa_audio_description= export fa_volume_control_phone= export fa_braille= export fa_assistive_listening_systems= export fa_american_sign_language_interpreting= export fa_deaf= export fa_glide= export fa_glide_g= export fa_sign_language= export fa_low_vision= export fa_viadeo= export fa_viadeo_square= export fa_snapchat= export fa_snapchat_ghost= export fa_snapchat_square= export fa_pied_piper= export fa_first_order= export fa_yoast= export fa_themeisle= export fa_google_plus_circle= export fa_fa= export fa_handshake_o= export fa_envelope_open= export fa_envelope_open_o= export fa_linode= export fa_address_book= export fa_address_book_o= export fa_address_card= export fa_address_card_o= export fa_user_circle= export fa_user_circle_o= export fa_user_o= export fa_id_badge= export fa_drivers_license= export fa_drivers_license_o= export fa_quora= export fa_free_code_camp= export fa_telegram= export fa_thermometer= export fa_thermometer_3= export fa_thermometer_2= export fa_thermometer_1= export fa_thermometer_0= export fa_shower= export fa_bath= export fa_podcast= export fa_window_maximize= export fa_window_minimize= export fa_window_restore= export fa_times_rectangle= export fa_times_rectangle_o= export fa_bandcamp= export fa_grav= export fa_etsy= export fa_imdb= export fa_ravelry= export fa_eercast= export fa_microchip= export fa_snowflake_o= export fa_superpowers= export fa_wpexplorer= export fa_meetup= # Material Design Icons export md_error= export md_error_outline= export md_warning= export md_add_alert= export md_album= export md_av_timer= export md_closed_caption= export md_equalizer= export md_explicit= export md_fast_forward= export md_fast_rewind= export md_games= export md_hearing= export md_high_quality= export md_loop= export md_mic= export md_mic_none= export md_mic_off= export md_movie= export md_library_add= export md_library_books= export md_library_music= export md_new_releases= export md_not_interested= export md_pause= export md_pause_circle_filled= export md_pause_circle_outline= export md_play_arrow= export md_play_circle_filled= export md_play_circle_outline= export md_playlist_add= export md_queue= export md_queue_music= export md_radio= export md_recent_actors= export md_repeat= export md_repeat_one= export md_replay= export md_shuffle= export md_skip_next= export md_skip_previous= export md_snooze= export md_stop= export md_subtitles= export md_surround_sound= export md_video_library= export md_videocam= export md_videocam_off= export md_volume_down= export md_volume_mute= export md_volume_off= export md_volume_up= export md_web= export md_hd= export md_sort_by_alpha= export md_airplay= export md_forward_10= export md_forward_30= export md_forward_5= export md_replay_10= export md_replay_30= export md_replay_5= export md_add_to_queue= export md_fiber_dvr= export md_fiber_new= export md_playlist_play= export md_art_track= export md_fiber_manual_record= export md_fiber_smart_record= export md_music_video= export md_subscriptions= export md_playlist_add_check= export md_queue_play_next= export md_remove_from_queue= export md_slow_motion_video= export md_web_asset= export md_fiber_pin= export md_branding_watermark= export md_call_to_action= export md_featured_play_list= export md_featured_video= export md_note= export md_video_call= export md_video_label= export md_business= export md_call= export md_call_end= export md_call_made= export md_call_merge= export md_call_missed= export md_call_received= export md_call_split= export md_chat= export md_clear_all= export md_comment= export md_contacts= export md_dialer_sip= export md_dialpad= export md_email= export md_forum= export md_import_export= export md_invert_colors_off= export md_live_help= export md_location_off= export md_location_on= export md_message= export md_chat_bubble= export md_chat_bubble_outline= export md_no_sim= export md_phone= export md_portable_wifi_off= export md_contact_phone= export md_contact_mail= export md_ring_volume= export md_speaker_phone= export md_stay_current_landscape= export md_stay_current_portrait= export md_stay_primary_landscape= export md_stay_primary_portrait= export md_swap_calls= export md_textsms= export md_voicemail= export md_vpn_key= export md_phonelink_erase= export md_phonelink_lock= export md_phonelink_ring= export md_phonelink_setup= export md_present_to_all= export md_import_contacts= export md_mail_outline= export md_screen_share= export md_stop_screen_share= export md_call_missed_outgoing= export md_rss_feed= export md_add= export md_add_box= export md_add_circle= export md_add_circle_outline= export md_archive= export md_backspace= export md_block= export md_clear= export md_content_copy= export md_content_cut= export md_content_paste= export md_create= export md_drafts= export md_filter_list= export md_flag= export md_forward= export md_gesture= export md_inbox= export md_link= export md_mail= export md_markunread= export md_redo= export md_remove= export md_remove_circle= export md_remove_circle_outline= export md_reply= export md_reply_all= export md_report= export md_save= export md_select_all= export md_send= export md_sort= export md_text_format= export md_undo= export md_font_download= export md_move_to_inbox= export md_unarchive= export md_next_week= export md_weekend= export md_delete_sweep= export md_low_priority= export md_access_alarm= export md_access_alarms= export md_access_time= export md_add_alarm= export md_airplanemode_inactive= export md_airplanemode_active= export md_battery_alert= export md_battery_charging_full= export md_battery_full= export md_battery_std= export md_battery_unknown= export md_bluetooth= export md_bluetooth_connected= export md_bluetooth_disabled= export md_bluetooth_searching= export md_brightness_auto= export md_brightness_high= export md_brightness_low= export md_brightness_medium= export md_data_usage= export md_developer_mode= export md_devices= export md_dvr= export md_gps_fixed= export md_gps_not_fixed= export md_gps_off= export md_location_disabled= export md_location_searching= export md_graphic_eq= export md_network_cell= export md_network_wifi= export md_nfc= export md_wallpaper= export md_widgets= export md_screen_lock_landscape= export md_screen_lock_portrait= export md_screen_lock_rotation= export md_screen_rotation= export md_sd_storage= export md_settings_system_daydream= export md_signal_cellular_4_bar= export md_signal_cellular_connected_no_internet_4_bar= export md_signal_cellular_no_sim= export md_signal_cellular_null= export md_signal_cellular_off= export md_signal_wifi_4_bar= export md_signal_wifi_4_bar_lock= export md_signal_wifi_off= export md_storage= export md_usb= export md_wifi_lock= export md_wifi_tethering= export md_attach_file= export md_attach_money= export md_border_all= export md_border_bottom= export md_border_clear= export md_border_color= export md_border_horizontal= export md_border_inner= export md_border_left= export md_border_outer= export md_border_right= export md_border_style= export md_border_top= export md_border_vertical= export md_format_align_center= export md_format_align_justify= export md_format_align_left= export md_format_align_right= export md_format_bold= export md_format_clear= export md_format_color_fill= export md_format_color_reset= export md_format_color_text= export md_format_indent_decrease= export md_format_indent_increase= export md_format_italic= export md_format_line_spacing= export md_format_list_bulleted= export md_format_list_numbered= export md_format_paint= export md_format_quote= export md_format_size= export md_format_strikethrough= export md_format_textdirection_l_to_r= export md_format_textdirection_r_to_l= export md_format_underlined= export md_functions= export md_insert_chart= export md_insert_comment= export md_insert_drive_file= export md_insert_emoticon= export md_insert_invitation= export md_insert_link= export md_insert_photo= export md_merge_type= export md_mode_comment= export md_mode_edit= export md_publish= export md_space_bar= export md_strikethrough_s= export md_vertical_align_bottom= export md_vertical_align_center= export md_vertical_align_top= export md_wrap_text= export md_money_off= export md_drag_handle= export md_format_shapes= export md_highlight= export md_linear_scale= export md_short_text= export md_text_fields= export md_monetization_on= export md_title= export md_attachment= export md_cloud= export md_cloud_circle= export md_cloud_done= export md_cloud_download= export md_cloud_off= export md_cloud_queue= export md_cloud_upload= export md_file_download= export md_file_upload= export md_folder= export md_folder_open= export md_folder_shared= export md_create_new_folder= export md_cast= export md_cast_connected= export md_computer= export md_desktop_mac= export md_desktop_windows= export md_developer_board= export md_dock= export md_gamepad= export md_headset= export md_headset_mic= export md_keyboard= export md_keyboard_arrow_down= export md_keyboard_arrow_left= export md_keyboard_arrow_right= export md_keyboard_arrow_up= export md_keyboard_backspace= export md_keyboard_capslock= export md_keyboard_hide= export md_keyboard_return= export md_keyboard_tab= export md_keyboard_voice= export md_laptop= export md_laptop_chromebook= export md_laptop_mac= export md_laptop_windows= export md_memory= export md_mouse= export md_phone_android= export md_phone_iphone= export md_phonelink= export md_phonelink_off= export md_router= export md_scanner= export md_security= export md_sim_card= export md_smartphone= export md_speaker= export md_speaker_group= export md_tablet= export md_tablet_android= export md_tablet_mac= export md_toys= export md_tv= export md_watch= export md_device_hub= export md_power_input= export md_devices_other= export md_videogame_asset= export md_add_to_photos= export md_adjust= export md_assistant= export md_assistant_photo= export md_audiotrack= export md_blur_circular= export md_blur_linear= export md_blur_off= export md_blur_on= export md_brightness_1= export md_brightness_2= export md_brightness_3= export md_brightness_4= export md_brightness_5= export md_brightness_6= export md_brightness_7= export md_broken_image= export md_brush= export md_camera= export md_camera_alt= export md_camera_front= export md_camera_rear= export md_camera_roll= export md_center_focus_strong= export md_center_focus_weak= export md_collections= export md_color_lens= export md_colorize= export md_compare= export md_control_point= export md_control_point_duplicate= export md_crop_16_9= export md_crop_3_2= export md_crop= export md_crop_5_4= export md_crop_7_5= export md_crop_din= export md_crop_free= export md_crop_landscape= export md_crop_original= export md_crop_portrait= export md_crop_square= export md_dehaze= export md_details= export md_edit= export md_exposure= export md_exposure_neg_1= export md_exposure_neg_2= export md_exposure_plus_1= export md_exposure_plus_2= export md_exposure_zero= export md_filter_1= export md_filter_2= export md_filter_3= export md_filter= export md_filter_4= export md_filter_5= export md_filter_6= export md_filter_7= export md_filter_8= export md_filter_9= export md_filter_9_plus= export md_filter_b_and_w= export md_filter_center_focus= export md_filter_drama= export md_filter_frames= export md_filter_hdr= export md_filter_none= export md_filter_tilt_shift= export md_filter_vintage= export md_flare= export md_flash_auto= export md_flash_off= export md_flash_on= export md_flip= export md_gradient= export md_grain= export md_grid_off= export md_grid_on= export md_hdr_off= export md_hdr_on= export md_hdr_strong= export md_hdr_weak= export md_healing= export md_image= export md_image_aspect_ratio= export md_iso= export md_landscape= export md_leak_add= export md_leak_remove= export md_lens= export md_looks_3= export md_looks= export md_looks_4= export md_looks_5= export md_looks_6= export md_looks_one= export md_looks_two= export md_loupe= export md_monochrome_photos= export md_movie_creation= export md_music_note= export md_nature= export md_nature_people= export md_navigate_before= export md_navigate_next= export md_palette= export md_panorama= export md_panorama_fish_eye= export md_panorama_horizontal= export md_panorama_vertical= export md_panorama_wide_angle= export md_photo= export md_photo_album= export md_photo_camera= export md_photo_library= export md_picture_as_pdf= export md_portrait= export md_remove_red_eye= export md_rotate_90_degrees_ccw= export md_rotate_left= export md_rotate_right= export md_slideshow= export md_straighten= export md_style= export md_switch_camera= export md_switch_video= export md_tag_faces= export md_texture= export md_timelapse= export md_timer_10= export md_timer_3= export md_timer= export md_timer_off= export md_tonality= export md_transform= export md_tune= export md_view_comfy= export md_view_compact= export md_wb_auto= export md_wb_cloudy= export md_wb_incandescent= export md_wb_sunny= export md_collections_bookmark= export md_photo_size_select_actual= export md_photo_size_select_large= export md_photo_size_select_small= export md_vignette= export md_wb_iridescent= export md_crop_rotate= export md_linked_camera= export md_add_a_photo= export md_movie_filter= export md_photo_filter= export md_burst_mode= export md_beenhere= export md_directions= export md_directions_bike= export md_directions_bus= export md_directions_car= export md_directions_boat= export md_directions_subway= export md_directions_railway= export md_directions_transit= export md_directions_walk= export md_flight= export md_hotel= export md_layers= export md_layers_clear= export md_local_airport= export md_local_atm= export md_local_activity= export md_local_bar= export md_local_cafe= export md_local_car_wash= export md_local_convenience_store= export md_local_drink= export md_local_florist= export md_local_gas_station= export md_local_grocery_store= export md_local_hospital= export md_local_hotel= export md_local_laundry_service= export md_local_library= export md_local_mall= export md_local_movies= export md_local_offer= export md_local_parking= export md_local_pharmacy= export md_local_phone= export md_local_pizza= export md_local_play= export md_local_post_office= export md_local_printshop= export md_local_dining= export md_local_see= export md_local_shipping= export md_local_taxi= export md_person_pin= export md_map= export md_my_location= export md_navigation= export md_pin_drop= export md_place= export md_rate_review= export md_restaurant_menu= export md_satellite= export md_store_mall_directory= export md_terrain= export md_traffic= export md_directions_run= export md_add_location= export md_edit_location= export md_near_me= export md_person_pin_circle= export md_zoom_out_map= export md_restaurant= export md_ev_station= export md_streetview= export md_subway= export md_train= export md_tram= export md_transfer_within_a_station= export md_apps= export md_arrow_back= export md_arrow_drop_down= export md_arrow_drop_down_circle= export md_arrow_drop_up= export md_arrow_forward= export md_cancel= export md_check= export md_chevron_left= export md_chevron_right= export md_close= export md_expand_less= export md_expand_more= export md_fullscreen= export md_fullscreen_exit= export md_menu= export md_more_horiz= export md_more_vert= export md_refresh= export md_unfold_less= export md_unfold_more= export md_arrow_upward= export md_subdirectory_arrow_left= export md_subdirectory_arrow_right= export md_arrow_downward= export md_first_page= export md_last_page= export md_adb= export md_bluetooth_audio= export md_disc_full= export md_do_not_disturb_alt= export md_do_not_disturb= export md_drive_eta= export md_event_available= export md_event_busy= export md_event_note= export md_folder_special= export md_mms= export md_more= export md_network_locked= export md_phone_bluetooth_speaker= export md_phone_forwarded= export md_phone_in_talk= export md_phone_locked= export md_phone_missed= export md_phone_paused= export md_sd_card= export md_sim_card_alert= export md_sms= export md_sms_failed= export md_sync= export md_sync_disabled= export md_sync_problem= export md_system_update= export md_tap_and_play= export md_time_to_leave= export md_vibration= export md_voice_chat= export md_vpn_lock= export md_airline_seat_flat= export md_airline_seat_flat_angled= export md_airline_seat_individual_suite= export md_airline_seat_legroom_extra= export md_airline_seat_legroom_normal= export md_airline_seat_legroom_reduced= export md_airline_seat_recline_extra= export md_airline_seat_recline_normal= export md_confirmation_number= export md_live_tv= export md_ondemand_video= export md_personal_video= export md_power= export md_wc= export md_wifi= export md_enhanced_encryption= export md_network_check= export md_no_encryption= export md_rv_hookup= export md_do_not_disturb_off= export md_do_not_disturb_on= export md_priority_high= export md_pie_chart= export md_pie_chart_outlined= export md_bubble_chart= export md_multiline_chart= export md_show_chart= export md_cake= export md_domain= export md_group= export md_group_add= export md_location_city= export md_mood= export md_mood_bad= export md_notifications= export md_notifications_none= export md_notifications_off= export md_notifications_active= export md_notifications_paused= export md_pages= export md_party_mode= export md_people= export md_people_outline= export md_person= export md_person_add= export md_person_outline= export md_plus_one= export md_poll= export md_public= export md_school= export md_share= export md_whatshot= export md_sentiment_dissatisfied= export md_sentiment_neutral= export md_sentiment_satisfied= export md_sentiment_very_dissatisfied= export md_sentiment_very_satisfied= export md_check_box= export md_check_box_outline_blank= export md_radio_button_unchecked= export md_radio_button_checked= export md_star= export md_star_half= export md_star_border= export md_3d_rotation= export md_accessibility= export md_account_balance= export md_account_balance_wallet= export md_account_box= export md_account_circle= export md_add_shopping_cart= export md_alarm= export md_alarm_add= export md_alarm_off= export md_alarm_on= export md_android= export md_announcement= export md_aspect_ratio= export md_assessment= export md_assignment= export md_assignment_ind= export md_assignment_late= export md_assignment_return= export md_assignment_returned= export md_assignment_turned_in= export md_autorenew= export md_backup= export md_book= export md_bookmark= export md_bookmark_border= export md_bug_report= export md_build= export md_cached= export md_change_history= export md_check_circle= export md_chrome_reader_mode= export md_class= export md_code= export md_credit_card= export md_dashboard= export md_delete= export md_description= export md_dns= export md_done= export md_done_all= export md_event= export md_exit_to_app= export md_explore= export md_extension= export md_face= export md_favorite= export md_favorite_border= export md_feedback= export md_find_in_page= export md_find_replace= export md_flip_to_back= export md_flip_to_front= export md_get_app= export md_grade= export md_group_work= export md_help= export md_highlight_off= export md_history= export md_home= export md_hourglass_empty= export md_hourglass_full= export md_https= export md_info= export md_info_outline= export md_input= export md_invert_colors= export md_label= export md_label_outline= export md_language= export md_launch= export md_list= export md_lock= export md_lock_open= export md_lock_outline= export md_loyalty= export md_markunread_mailbox= export md_note_add= export md_open_in_browser= export md_open_in_new= export md_open_with= export md_pageview= export md_payment= export md_perm_camera_mic= export md_perm_contact_calendar= export md_perm_data_setting= export md_perm_device_information= export md_perm_identity= export md_perm_media= export md_perm_phone_msg= export md_perm_scan_wifi= export md_picture_in_picture= export md_polymer= export md_power_settings_new= export md_print= export md_query_builder= export md_question_answer= export md_receipt= export md_redeem= export md_report_problem= export md_restore= export md_room= export md_schedule= export md_search= export md_settings= export md_settings_applications= export md_settings_backup_restore= export md_settings_bluetooth= export md_settings_cell= export md_settings_brightness= export md_settings_ethernet= export md_settings_input_antenna= export md_settings_input_component= export md_settings_input_composite= export md_settings_input_hdmi= export md_settings_input_svideo= export md_settings_overscan= export md_settings_phone= export md_settings_power= export md_settings_remote= export md_settings_voice= export md_shop= export md_shop_two= export md_shopping_basket= export md_shopping_cart= export md_speaker_notes= export md_spellcheck= export md_stars= export md_store= export md_subject= export md_supervisor_account= export md_swap_horiz= export md_swap_vert= export md_swap_vertical_circle= export md_system_update_alt= export md_tab= export md_tab_unselected= export md_theaters= export md_thumb_down= export md_thumb_up= export md_thumbs_up_down= export md_toc= export md_today= export md_toll= export md_track_changes= export md_translate= export md_trending_down= export md_trending_flat= export md_trending_up= export md_turned_in= export md_turned_in_not= export md_verified_user= export md_view_agenda= export md_view_array= export md_view_carousel= export md_view_column= export md_view_day= export md_view_headline= export md_view_list= export md_view_module= export md_view_quilt= export md_view_stream= export md_view_week= export md_visibility= export md_visibility_off= export md_card_giftcard= export md_card_membership= export md_card_travel= export md_work= export md_youtube_searched_for= export md_eject= export md_camera_enhance= export md_help_outline= export md_reorder= export md_zoom_in= export md_zoom_out= export md_http= export md_event_seat= export md_flight_land= export md_flight_takeoff= export md_play_for_work= export md_gif= export md_indeterminate_check_box= export md_offline_pin= export md_all_out= export md_copyright= export md_fingerprint= export md_gavel= export md_lightbulb_outline= export md_picture_in_picture_alt= export md_important_devices= export md_touch_app= export md_accessible= export md_compare_arrows= export md_date_range= export md_donut_large= export md_donut_small= export md_line_style= export md_line_weight= export md_motorcycle= export md_opacity= export md_pets= export md_pregnant_woman= export md_record_voice_over= export md_rounded_corner= export md_rowing= export md_timeline= export md_update= export md_watch_later= export md_pan_tool= export md_euro_symbol= export md_g_translate= export md_remove_shopping_cart= export md_restore_page= export md_speaker_notes_off= export md_delete_forever= export md_ac_unit= export md_airport_shuttle= export md_all_inclusive= export md_beach_access= export md_business_center= export md_casino= export md_child_care= export md_child_friendly= export md_fitness_center= export md_free_breakfast= export md_golf_course= export md_hot_tub= export md_kitchen= export md_pool= export md_room_service= export md_smoke_free= export md_smoking_rooms= export md_spa= export md_u10fffd= # File Icons export file_regex= export file_arch_linux= export file_e= export file_glyphs= export file_knockout= export file_lean= export file_metal= export file_povray= export file_s= export file_tt= export file_vagrant= export file_xmos= export file_a= export file_chai= export file_stylus= export file_textile= export file_unreal= export file_purebasic= export file_ts= export file_scheme= export file_textmate= export file_x10= export file_apl= export file_ansible= export file_arttext= export file_antwar= export file_opa= export file_codecov= export file_yang= export file_pm2= export file_hg= export file_pawn= export file_julia= export file_shipit= export file_mocha= export file_nib= export file_shuriken= export file_alex= export file_twig= export file_1c= export file_tex= export file_bibtex= export file_mustache= export file_gulp= export file_grunt= export file_ember= export file_go= export file_jenkins= export file_gnu= export file_composer= export file_meteor= export file_ai= export file_psd= export file_silverstripe= export file_maxscript= export file_kivy= export file_crystal= export file_gradle= export file_groovy= export file_r= export file_vue= export file_haxe= export file_lisp= export file_e909= export file_fortran= export file_ada= export file_dyalog= export file_jade= export file_e90e= export file_font= export file_postcss= export file_scad= export file_e912= export file_raml= export file_ls= export file_saltstack= export file_terraform= export file_org= export file_asciidoc= export file_riot= export file_ocaml= export file_lua= export file_npm= export file_llvm= export file_e91e= export file_babel= export file_marko= export file_flow= export file_broccoli= export file_appveyor= export file_cakefile= export file_apple= export file_emacs= export file_sketch= export file_doxygen= export file_cf= export file_pascal= export file_abap= export file_antlr= export file_api= export file_as= export file_arc= export file_arduino= export file_augeas= export file_ahk= export file_autoit= export file_ats= export file_alloy= export file_manpage= export file_j= export file_glade= export file_boo= export file_brain= export file_bro= export file_bluespec= export file_stylelint= export file_ant= export file_cmake= export file_clips= export file_mapbox= export file_cp= export file_chuck= export file_jinja= export file_isabelle= export file_doge= export file_idl= export file_jake= export file_verilog= export file_phalcon= export file_fabfile= export file_lfe= export file_nmap= export file_ampl= export file_ceylon= export file_chapel= export file_cirru= export file_clarion= export file_nunjucks= export file_mediawiki= export file_postscript= export file_tcl= export file_owl= export file_jsonld= export file_sparql= export file_sas= export file_clean= export file_click= export file_nvidia= export file_creole= export file_coq= export file_diff= export file_patch= export file_byond= export file_cython= export file_darcs= export file_eagle= export file_ecere= export file_eiffel= export file_em= export file_flux= export file_factor= export file_fancy= export file_perl6= export file_gentoo= export file_frege= export file_fantom= export file_freemarker= export file_gap= export file_cl= export file_gams= export file_godot= export file_gml= export file_genshi= export file_pointwise= export file_gf= export file_golo= export file_gosu= export file_harbour= export file_graphql= export file_graphviz= export file_hashicorp= export file_hy= export file_igorpro= export file_io= export file_ioke= export file_idris= export file_inform7= export file_inno= export file_sublime= export file_jupyter= export file_krl= export file_kotlin= export file_labview= export file_lsl= export file_lasso= export file_logtalk= export file_lookml= export file_mako= export file_mathematica= export file_matlab= export file_e992= export file_max= export file_mercury= export file_mirah= export file_modula2= export file_monkey= export file_nimrod= export file_nit= export file_nix= export file_amx= export file_netlogo= export file_numpy= export file_objj= export file_opencl= export file_processing= export file_ox= export file_scd= export file_stata= export file_stan= export file_sqf= export file_slash= export file_shen= export file_self= export file_scilab= export file_vhdl= export file_sage= export file_robot= export file_red= export file_rebol= export file_xojo= export file_rdoc= export file_racket= export file_purescript= export file_uno= export file_varnish= export file_propeller= export file_turing= export file_pony= export file_pogo= export file_pike= export file_urweb= export file_parrot= export file_papyrus= export file_pan= export file_oz= export file_oxygene= export file_progress= export file_txl= export file_cabal= export file_sysverilog= export file_pickle= export file_xpages= export file_xtend= export file_zephir= export file_zimpl= export file_ec= export file_mupad= export file_ooc= export file_rst= export file_karma= export file_hack= export file_shopify= export file_pug_alt= export file_e9d1= export file_sbt= export file_e9d3= export file_scrutinizer= export file_cc= export file_brakeman= export file_newrelic= export file_thor= export file_nuget= export file_powershell= export file_sf= export file_minecraft= export file_sqlite= export file_protractor= export file_typings= export file_strings= export file_nant= export file_csscript= export file_cake= export file_openoffice= export file_keynote= export file_jsx= export file_tsx= export file_model= export file_finder= export file_access= export file_onenote= export file_powerpoint= export file_word= export file_excel= export file_storyist= export file_csound= export file_dbase= export file_zbrush= export file_ae= export file_indesign= export file_premiere= export file_maya= export file_e9f7= export file_khronos= export file_audacity= export file_blender= export file_lightwave= export file_fbx= export file_e9fd= export file_typedoc= export file_alpine= export file_yui= export file_ea01= export file_ea02= export file_ea03= export file_normalize= export file_neko= export file_mathjax= export file_leaflet= export file_gdb= export file_fuelux= export file_eq= export file_chartjs= export file_ea0c= export file_ea0d= export file_ea0e= export file_eslint= export file_d3= export file_cordova= export file_circleci= export file_pug= export file_powerbuilder= export file_dylib= export file_rexx= export file_svn= export file_mruby= export file_wercker= export file_yarn= export file_editorconfig= export file_snyk= export file_reason= export file_nsis= export file_v8= export file_rollup= export file_ea21= export file_ea22= export file_ea23= export file_rascal= export file_gn= export file_nodemon= export file_electron= export file_1c_alt= export file_swagger= export file_bithound= export file_polymer= export file_platformio= export file_shippable= export file_ea2e= export file_sequelize= export file_redux= export file_rspec= export file_phpunit= export file_octave= export file_nuclide= export file_infopath= export file_lime= export file_lerna= export file_kitchenci= export file_jest= export file_jasmine= export file_haxedevelop= export file_gitlab= export file_drone= export file_virtualbox= export file_doclets= export file_delphi= export file_codekit= export file_chef= export file_cakephp= export file_cobol= export file_bundler= export file_buck= export file_brunch= export file_aurelia= export file_vmware= export file_rhino= export file_ejs= export file_kicad= export file_hoplon= export file_abif= export file_watchman= export file_p4= export file_nanoc= export file_miranda= export file_minizinc= export file_meson= export file_jison= export file_franca= export file_devicetree= export file_caddy= export file_bem= export file_bazel= export file_angelscript= export file_esdoc= export file_twine= export file_squarespace= export file_phoenix= export file_test_dir= export file_webpack= export file_test_coffee= export file_test_generic= export file_test_js= export file_test_perl= export file_test_python= export file_test_react= export file_test_ruby= export file_test_ts= export file_codeship= export file_nxc= export file_brotli= export file_proselint= export file_bintray= export file_mjml= export file_wasm= export file_ea71= export file_nasm= export file_ea73= export file_peg= export file_jolie= export file_nano= export file_xamarin= export file_f012= export file_tag= export file_cucumber= export file_video= export file_config= export file_dashboard= export file_puppet= export file_terminal= export file_markdownlint= export file_react= export file_f101= export file_elm= export file_boot= export file_cljs= export file_lein= export file_docker= export file_php= export file_ionic= export file_haml= export file_f17b= export file_ff= export file_u1f3c1= export file_tern= export file_default= export file_sigils= export file_nginx= # Weather Icons export weather_day_cloudy_gusts= export weather_day_cloudy_windy= export weather_day_cloudy= export weather_day_fog= export weather_day_hail= export weather_day_lightning= export weather_day_rain_mix= export weather_day_rain_wind= export weather_day_rain= export weather_day_showers= export weather_day_snow= export weather_day_sprinkle= export weather_day_sunny_overcast= export weather_day_sunny= export weather_day_storm_showers= export weather_day_thunderstorm= export weather_cloudy_gusts= export weather_cloudy_windy= export weather_cloudy= export weather_fog= export weather_hail= export weather_lightning= export weather_rain_mix= export weather_rain_wind= export weather_rain= export weather_showers= export weather_snow= export weather_sprinkle= export weather_storm_showers= export weather_thunderstorm= export weather_windy= export weather_night_alt_cloudy_gusts= export weather_night_alt_cloudy_windy= export weather_night_alt_hail= export weather_night_alt_lightning= export weather_night_alt_rain_mix= export weather_night_alt_rain_wind= export weather_night_alt_rain= export weather_night_alt_showers= export weather_night_alt_snow= export weather_night_alt_sprinkle= export weather_night_alt_storm_showers= export weather_night_alt_thunderstorm= export weather_night_clear= export weather_night_cloudy_gusts= export weather_night_cloudy_windy= export weather_night_cloudy= export weather_night_hail= export weather_night_lightning= export weather_night_rain_mix= export weather_night_rain_wind= export weather_night_rain= export weather_night_showers= export weather_night_snow= export weather_night_sprinkle= export weather_night_storm_showers= export weather_night_thunderstorm= export weather_celsius= export weather_cloud_down= export weather_cloud_refresh= export weather_cloud_up= export weather_cloud= export weather_degrees= export weather_direction_down_left= export weather_direction_down= export weather_fahrenheit= export weather_horizon_alt= export weather_horizon= export weather_direction_left= export weather_f049= export weather_night_fog= export weather_refresh_alt= export weather_refresh= export weather_direction_right= export weather_raindrops= export weather_strong_wind= export weather_sunrise= export weather_sunset= export weather_thermometer_exterior= export weather_thermometer_internal= export weather_thermometer= export weather_tornado= export weather_direction_up_right= export weather_direction_up= export weather_f059= export weather_f05a= export weather_f05b= export weather_f05c= export weather_f05d= export weather_f05e= export weather_f060= export weather_f061= export weather_smoke= export weather_dust= export weather_snow_wind= export weather_day_snow_wind= export weather_night_snow_wind= export weather_night_alt_snow_wind= export weather_day_sleet_storm= export weather_night_sleet_storm= export weather_night_alt_sleet_storm= export weather_day_snow_thunderstorm= export weather_night_snow_thunderstorm= export weather_night_alt_snow_thunderstorm= export weather_solar_eclipse= export weather_lunar_eclipse= export weather_meteor= export weather_hot= export weather_hurricane= export weather_smog= export weather_alien= export weather_snowflake_cold= export weather_stars= export weather_raindrop= export weather_barometer= export weather_humidity= export weather_na= export weather_flood= export weather_day_cloudy_high= export weather_night_alt_cloudy_high= export weather_night_cloudy_high= export weather_night_alt_partly_cloudy= export weather_sandstorm= export weather_night_partly_cloudy= export weather_umbrella= export weather_day_windy= export weather_night_alt_cloudy= export weather_direction_up_left= export weather_direction_down_right= export weather_time_12= export weather_time_1= export weather_time_2= export weather_time_3= export weather_time_4= export weather_time_5= export weather_time_6= export weather_time_7= export weather_time_8= export weather_time_9= export weather_time_10= export weather_time_11= export weather_moon_new= export weather_moon_waxing_crescent_1= export weather_moon_waxing_crescent_2= export weather_moon_waxing_crescent_3= export weather_moon_waxing_crescent_4= export weather_moon_waxing_crescent_5= export weather_moon_waxing_crescent_6= export weather_moon_first_quarter= export weather_moon_waxing_gibbous_1= export weather_moon_waxing_gibbous_2= export weather_moon_waxing_gibbous_3= export weather_moon_waxing_gibbous_4= export weather_moon_waxing_gibbous_5= export weather_moon_waxing_gibbous_6= export weather_moon_full= export weather_moon_waning_gibbous_1= export weather_moon_waning_gibbous_2= export weather_moon_waning_gibbous_3= export weather_moon_waning_gibbous_4= export weather_moon_waning_gibbous_5= export weather_moon_waning_gibbous_6= export weather_moon_third_quarter= export weather_moon_waning_crescent_1= export weather_moon_waning_crescent_2= export weather_moon_waning_crescent_3= export weather_moon_waning_crescent_4= export weather_moon_waning_crescent_5= export weather_moon_waning_crescent_6= export weather_wind_direction= export weather_day_sleet= export weather_night_sleet= export weather_night_alt_sleet= export weather_sleet= export weather_day_haze= export weather_wind_beaufort_0= export weather_wind_beaufort_1= export weather_wind_beaufort_2= export weather_wind_beaufort_3= export weather_wind_beaufort_4= export weather_wind_beaufort_5= export weather_wind_beaufort_6= export weather_wind_beaufort_7= export weather_wind_beaufort_8= export weather_wind_beaufort_9= export weather_wind_beaufort_10= export weather_wind_beaufort_11= export weather_wind_beaufort_12= export weather_day_light_wind= export weather_tsunami= export weather_earthquake= export weather_fire= export weather_volcano= export weather_moonrise= export weather_moonset= export weather_train= export weather_small_craft_advisory= export weather_gale_warning= export weather_storm_warning= export weather_hurricane_warning= export weather_moon_alt_waxing_crescent_1= export weather_moon_alt_waxing_crescent_2= export weather_moon_alt_waxing_crescent_3= export weather_moon_alt_waxing_crescent_4= export weather_moon_alt_waxing_crescent_5= export weather_moon_alt_waxing_crescent_6= export weather_moon_alt_first_quarter= export weather_moon_alt_waxing_gibbous_1= export weather_moon_alt_waxing_gibbous_2= export weather_moon_alt_waxing_gibbous_3= export weather_moon_alt_waxing_gibbous_4= export weather_moon_alt_waxing_gibbous_5= export weather_moon_alt_waxing_gibbous_6= export weather_moon_alt_full= export weather_moon_alt_waning_gibbous_1= export weather_moon_alt_waning_gibbous_2= export weather_moon_alt_waning_gibbous_3= export weather_moon_alt_waning_gibbous_4= export weather_moon_alt_waning_gibbous_5= export weather_moon_alt_waning_gibbous_6= export weather_moon_alt_third_quarter= export weather_moon_alt_waning_crescent_1= export weather_moon_alt_waning_crescent_2= export weather_moon_alt_waning_crescent_3= export weather_moon_alt_waning_crescent_4= export weather_moon_alt_waning_crescent_5= export weather_moon_alt_waning_crescent_6= export weather_moon_alt_new= # Linux Icons export linux_archlinux= export linux_centos= export linux_debian= export linux_fedora= export linux_linuxmint= export linux_linuxmint_inverse= export linux_mageia= export linux_mandriva= export linux_opensuse= export linux_redhat= export linux_slackware= export linux_slackware_inverse= export linux_ubuntu= export linux_ubuntu_inverse= export linux_freebsd= export linux_coreos= export linux_gentoo= export linux_elementary= export linux_fedora_inverse= export linux_sabayon= export linux_aosc= export linux_nixos= export linux_tux= export linux_raspberry_pi= export linux_manjaro= export linux_apple= export linux_docker= export linux_alpine= # My (sebastiencs) Icons export myicons_0001= export myicons_0002= export myicons_0003= export myicons_0004= export myicons_0005= export myicons_0006= export myicons_0007= export myicons_0008= export myicons_0009= export myicons_000a= export myicons_000b= export myicons_000d= export myicons_000e= export myicons_0010= export myicons_0011= export myicons_0013= export myicons_0014= export myicons_arch_linux_arrow= # Devicons export dev_bing_small= export dev_css_tricks= export dev_git= export dev_bitbucket= export dev_mysql= export dev_streamline= export dev_database= export dev_dropbox= export dev_github_alt= export dev_github_badge= export dev_github= export dev_wordpress= export dev_visualstudio= export dev_jekyll_small= export dev_android= export dev_windows= export dev_stackoverflow= export dev_apple= export dev_linux= export dev_appstore= export dev_ghost_small= export dev_yahoo= export dev_codepen= export dev_github_full= export dev_nodejs_small= export dev_nodejs= export dev_hackernews= export dev_ember= export dev_dojo= export dev_django= export dev_npm= export dev_ghost= export dev_modernizr= export dev_unity_small= export dev_raspberry_pi= export dev_blackberry= export dev_go= export dev_git_branch= export dev_git_pull_request= export dev_git_merge= export dev_git_compare= export dev_git_commit= export dev_cssdeck= export dev_yahoo_small= export dev_techcrunch= export dev_smashing_magazine= export dev_netmagazine= export dev_codrops= export dev_phonegap= export dev_google_drive= export dev_html5_multimedia= export dev_html5_device_access= export dev_html5_connectivity= export dev_html5_3d_effects= export dev_html5= export dev_scala= export dev_java= export dev_ruby= export dev_ubuntu= export dev_ruby_on_rails= export dev_python= export dev_php= export dev_markdown= export dev_laravel= export dev_magento= export dev_joomla= export dev_drupal= export dev_chrome= export dev_ie= export dev_firefox= export dev_opera= export dev_bootstrap= export dev_safari= export dev_css3= export dev_css3_full= export dev_sass= export dev_grunt= export dev_bower= export dev_javascript= export dev_javascript_shield= export dev_jquery= export dev_coffeescript= export dev_backbone= export dev_angular= export dev_jquery_ui= export dev_swift= export dev_symfony= export dev_symfony_badge= export dev_less= export dev_stylus= export dev_trello= export dev_atlassian= export dev_jira= export dev_envato= export dev_snap_svg= export dev_raphael= export dev_google_analytics= export dev_compass= export dev_onedrive= export dev_gulp= export dev_atom= export dev_cisco= export dev_nancy= export dev_jenkins= export dev_clojure= export dev_perl= export dev_clojure_alt= export dev_celluloid= export dev_w3c= export dev_redis= export dev_postgresql= export dev_webplatform= export dev_requirejs= export dev_opensource= export dev_typo3= export dev_uikit= export dev_doctrine= export dev_groovy= export dev_nginx= export dev_haskell= export dev_zend= export dev_gnu= export dev_yeoman= export dev_heroku= export dev_msql_server= export dev_debian= export dev_travis= export dev_dotnet= export dev_codeigniter= export dev_javascript_badge= export dev_yii= export dev_composer= export dev_krakenjs_badge= export dev_krakenjs= export dev_mozilla= export dev_firebase= export dev_sizzlejs= export dev_creativecommons= export dev_creativecommons_badge= export dev_mitlicence= export dev_senchatouch= export dev_bugsense= export dev_extjs= export dev_mootools_badge= export dev_mootools= export dev_ruby_rough= export dev_komodo= export dev_coda= export dev_bintray= export dev_terminal= export dev_code= export dev_responsive= export dev_dart= export dev_aptana= export dev_mailchimp= export dev_netbeans= export dev_dreamweaver= export dev_brackets= export dev_eclipse= export dev_cloud9= export dev_scrum= export dev_prolog= export dev_terminal_badge= export dev_code_badge= export dev_mongodb= export dev_meteor= export dev_meteorfull= export dev_fsharp= export dev_rust= export dev_ionic= export dev_sublime= export dev_appcelerator= export dev_asterisk= export dev_aws= export dev_digital_ocean= export dev_dlang= export dev_docker= export dev_erlang= export dev_google_cloud_platform= export dev_grails= export dev_illustrator= export dev_intellij= export dev_materializecss= export dev_openshift= export dev_photoshop= export dev_rackspace= export dev_react= export dev_redhat= export dev_scriptcs= export dev_e6bd= export dev_e6be= export dev_e6bf= export dev_e6c0= export dev_e6c1= export dev_e6c2= export dev_e6c3= export dev_sqllite= export dev_vim= # Pomicons export pom_clean_code= export pom_pomodoro_done= export pom_pomodoro_estimated= export pom_pomodoro_ticking= export pom_pomodoro_squashed= export pom_short_pause= export pom_long_pause= export pom_away= export pom_pair_programming= export pom_internal_interruption= export pom_external_interruption= # Linea Icons export linea_arrows_anticlockwise= export linea_arrows_anticlockwise_dashed= export linea_arrows_button_down= export linea_arrows_button_off= export linea_arrows_button_on= export linea_arrows_button_up= export linea_arrows_check= export linea_arrows_circle_check= export linea_arrows_circle_down= export linea_arrows_circle_downleft= export linea_arrows_circle_downright= export linea_arrows_circle_left= export linea_arrows_circle_minus= export linea_arrows_circle_plus= export linea_arrows_circle_remove= export linea_arrows_circle_right= export linea_arrows_circle_up= export linea_arrows_circle_upleft= export linea_arrows_circle_upright= export linea_arrows_clockwise= export linea_arrows_clockwise_dashed= export linea_arrows_compress= export linea_arrows_deny= export linea_arrows_diagonal= export linea_arrows_diagonal2= export linea_arrows_down= export linea_arrows_down_double= export linea_arrows_downleft= export linea_arrows_downright= export linea_arrows_drag_down= export linea_arrows_drag_down_dashed= export linea_arrows_drag_horiz= export linea_arrows_drag_left= export linea_arrows_drag_left_dashed= export linea_arrows_drag_right= export linea_arrows_drag_right_dashed= export linea_arrows_drag_up= export linea_arrows_drag_up_dashed= export linea_arrows_drag_vert= export linea_arrows_exclamation= export linea_arrows_expand= export linea_arrows_expand_diagonal1= export linea_arrows_expand_horizontal1= export linea_arrows_expand_vertical1= export linea_arrows_fit_horizontal= export linea_arrows_fit_vertical= export linea_arrows_glide= export linea_arrows_glide_horizontal= export linea_arrows_glide_vertical= export linea_arrows_hamburger1= export linea_arrows_hamburger_2= export linea_arrows_horizontal= export linea_arrows_info= export linea_arrows_keyboard_alt= export linea_arrows_keyboard_cmd= export linea_arrows_keyboard_delete= export linea_arrows_keyboard_down= export linea_arrows_keyboard_left= export linea_arrows_keyboard_return= export linea_arrows_keyboard_right= export linea_arrows_keyboard_shift= export linea_arrows_keyboard_tab= export linea_arrows_keyboard_up= export linea_arrows_left= export linea_arrows_left_double_32= export linea_arrows_minus= export linea_arrows_move= export linea_arrows_move2= export linea_arrows_move_bottom= export linea_arrows_move_left= export linea_arrows_move_right= export linea_arrows_move_top= export linea_arrows_plus= export linea_arrows_question= export linea_arrows_remove= export linea_arrows_right= export linea_arrows_right_double= export linea_arrows_rotate= export linea_arrows_rotate_anti= export linea_arrows_rotate_anti_dashed= export linea_arrows_rotate_dashed= export linea_arrows_shrink= export linea_arrows_shrink_diagonal1= export linea_arrows_shrink_diagonal2= export linea_arrows_shrink_horizonal2= export linea_arrows_shrink_horizontal1= export linea_arrows_shrink_vertical1= export linea_arrows_shrink_vertical2= export linea_arrows_sign_down= export linea_arrows_sign_left= export linea_arrows_sign_right= export linea_arrows_sign_up= export linea_arrows_slide_down1= export linea_arrows_slide_down2= export linea_arrows_slide_left1= export linea_arrows_slide_left2= export linea_arrows_slide_right1= export linea_arrows_slide_right2= export linea_arrows_slide_up1= export linea_arrows_slide_up2= export linea_arrows_slim_down= export linea_arrows_slim_down_dashed= export linea_arrows_slim_left= export linea_arrows_slim_left_dashed= export linea_arrows_slim_right= export linea_arrows_slim_right_dashed= export linea_arrows_slim_up= export linea_arrows_slim_up_dashed= export linea_arrows_square_check= export linea_arrows_square_down= export linea_arrows_square_downleft= export linea_arrows_square_downright= export linea_arrows_square_left= export linea_arrows_square_minus= export linea_arrows_square_plus= export linea_arrows_square_remove= export linea_arrows_square_right= export linea_arrows_square_up= export linea_arrows_square_upleft= export linea_arrows_square_upright= export linea_arrows_squares= export linea_arrows_stretch_diagonal1= export linea_arrows_stretch_diagonal2= export linea_arrows_stretch_diagonal3= export linea_arrows_stretch_diagonal4= export linea_arrows_stretch_horizontal1= export linea_arrows_stretch_horizontal2= export linea_arrows_stretch_vertical1= export linea_arrows_stretch_vertical2= export linea_arrows_switch_horizontal= export linea_arrows_switch_vertical= export linea_arrows_up= export linea_arrows_up_double_33= export linea_arrows_upleft= export linea_arrows_upright= export linea_arrows_vertical= export linea_basic_lock_open= export linea_basic_magic_mouse= export linea_basic_magnifier= export linea_basic_magnifier_minus= export linea_basic_magnifier_plus= export linea_basic_mail= export linea_basic_mail_multiple= export linea_basic_mail_open= export linea_basic_mail_open_text= export linea_basic_male= export linea_basic_map= export linea_basic_message= export linea_basic_message_multiple= export linea_basic_message_txt= export linea_basic_mixer2= export linea_basic_info= export linea_basic_ipod= export linea_basic_joypad= export linea_basic_key= export linea_basic_keyboard= export linea_basic_laptop= export linea_basic_life_buoy= export linea_basic_lightbulb= export linea_basic_link= export linea_basic_lock= export linea_basic_mouse= export linea_basic_notebook= export linea_basic_notebook_pen= export linea_basic_notebook_pencil= export linea_basic_paperplane= export linea_basic_pencil_ruler= export linea_basic_pencil_ruler_pen= export linea_basic_clubs= export linea_basic_compass= export linea_basic_cup= export linea_basic_diamonds= export linea_basic_display= export linea_basic_download= export linea_basic_exclamation= export linea_basic_eye= export linea_basic_eye_closed= export linea_basic_female= export linea_basic_flag1= export linea_basic_flag2= export linea_basic_floppydisk= export linea_basic_folder= export linea_basic_folder_multiple= export linea_basic_gear= export linea_basic_geolocalize_01= export linea_basic_geolocalize_05= export linea_basic_globe= export linea_basic_gunsight= export linea_basic_hammer= export linea_basic_headset= export linea_basic_heart= export linea_basic_heart_broken= export linea_basic_helm= export linea_basic_home= export linea_basic_photo= export linea_basic_rss= export linea_basic_picture= export linea_basic_picture_multiple= export linea_basic_pin1= export linea_basic_pin2= export linea_basic_accelerator= export linea_basic_alarm= export linea_basic_anchor= export linea_basic_anticlockwise= export linea_basic_archive= export linea_basic_archive_full= export linea_basic_ban= export linea_basic_battery_charge= export linea_basic_battery_empty= export linea_basic_battery_full= export linea_basic_battery_half= export linea_basic_bolt= export linea_basic_book= export linea_basic_book_pen= export linea_basic_book_pencil= export linea_basic_bookmark= export linea_basic_calculator= export linea_basic_calendar= export linea_basic_cards_diamonds= export linea_basic_cards_hearts= export linea_basic_case= export linea_basic_chronometer= export linea_basic_clessidre= export linea_basic_clock= export linea_basic_clockwise= export linea_basic_cloud= export linea_basic_postcard= export linea_basic_postcard_multiple= export linea_basic_printer= export linea_basic_question= export linea_basic_server= export linea_basic_server2= export linea_basic_server_cloud= export linea_basic_server_download= export linea_basic_server_upload= export linea_basic_settings= export linea_basic_share= export linea_basic_sheet= export linea_basic_sheet_multiple= export linea_basic_sheet_pen= export linea_basic_sheet_pencil= export linea_basic_sheet_txt= export linea_basic_signs= export linea_basic_smartphone= export linea_basic_spades= export linea_basic_spread= export linea_basic_spread_bookmark= export linea_basic_spread_text= export linea_basic_spread_text_bookmark= export linea_basic_star= export linea_basic_tablet= export linea_basic_target= export linea_basic_todo= export linea_basic_todo_pen= export linea_basic_todo_pencil= export linea_basic_todo_txt= export linea_basic_todolist_pen= export linea_basic_todolist_pencil= export linea_basic_trashcan= export linea_basic_trashcan_full= export linea_basic_trashcan_refresh= export linea_basic_trashcan_remove= export linea_basic_upload= export linea_basic_usb= export linea_basic_video= export linea_basic_watch= export linea_basic_webpage= export linea_basic_webpage_img_txt= export linea_basic_webpage_multiple= export linea_basic_webpage_txt= export linea_basic_world= export linea_elaboration_document_previous= export linea_elaboration_document_refresh= export linea_elaboration_document_remove= export linea_elaboration_document_search= export linea_elaboration_document_star= export linea_elaboration_document_upload= export linea_elaboration_folder_check= export linea_elaboration_folder_cloud= export linea_elaboration_folder_document= export linea_elaboration_folder_download= export linea_elaboration_folder_flagged= export linea_elaboration_folder_graph= export linea_elaboration_folder_heart= export linea_elaboration_folder_minus= export linea_elaboration_folder_next= export linea_elaboration_document_flagged= export linea_elaboration_document_graph= export linea_elaboration_document_heart= export linea_elaboration_document_minus= export linea_elaboration_document_next= export linea_elaboration_document_noaccess= export linea_elaboration_document_note= export linea_elaboration_document_pencil= export linea_elaboration_document_picture= export linea_elaboration_document_plus= export linea_elaboration_folder_noaccess= export linea_elaboration_folder_note= export linea_elaboration_folder_pencil= export linea_elaboration_folder_picture= export linea_elaboration_folder_plus= export linea_elaboration_folder_previous= export linea_elaboration_folder_refresh= export linea_elaboration_calendar_empty= export linea_elaboration_calendar_flagged= export linea_elaboration_calendar_heart= export linea_elaboration_calendar_minus= export linea_elaboration_calendar_next= export linea_elaboration_calendar_noaccess= export linea_elaboration_calendar_pencil= export linea_elaboration_calendar_plus= export linea_elaboration_calendar_previous= export linea_elaboration_calendar_refresh= export linea_elaboration_calendar_remove= export linea_elaboration_calendar_search= export linea_elaboration_calendar_star= export linea_elaboration_calendar_upload= export linea_elaboration_cloud_check= export linea_elaboration_cloud_download= export linea_elaboration_cloud_minus= export linea_elaboration_cloud_noaccess= export linea_elaboration_cloud_plus= export linea_elaboration_cloud_refresh= export linea_elaboration_cloud_remove= export linea_elaboration_cloud_search= export linea_elaboration_cloud_upload= export linea_elaboration_document_check= export linea_elaboration_document_cloud= export linea_elaboration_document_download= export linea_elaboration_folder_remove= export linea_elaboration_mail_heart= export linea_elaboration_folder_search= export linea_elaboration_folder_star= export linea_elaboration_folder_upload= export linea_elaboration_mail_check= export linea_elaboration_bookmark_checck= export linea_elaboration_bookmark_minus= export linea_elaboration_bookmark_plus= export linea_elaboration_bookmark_remove= export linea_elaboration_briefcase_check= export linea_elaboration_briefcase_download= export linea_elaboration_briefcase_flagged= export linea_elaboration_briefcase_minus= export linea_elaboration_briefcase_plus= export linea_elaboration_briefcase_refresh= export linea_elaboration_briefcase_remove= export linea_elaboration_briefcase_search= export linea_elaboration_briefcase_star= export linea_elaboration_briefcase_upload= export linea_elaboration_browser_check= export linea_elaboration_browser_download= export linea_elaboration_browser_minus= export linea_elaboration_browser_plus= export linea_elaboration_browser_refresh= export linea_elaboration_browser_remove= export linea_elaboration_browser_search= export linea_elaboration_browser_star= export linea_elaboration_browser_upload= export linea_elaboration_calendar_check= export linea_elaboration_calendar_cloud= export linea_elaboration_calendar_download= export linea_elaboration_mail_cloud= export linea_elaboration_mail_document= export linea_elaboration_mail_download= export linea_elaboration_mail_flagged= export linea_elaboration_mail_next= export linea_elaboration_mail_noaccess= export linea_elaboration_mail_note= export linea_elaboration_mail_pencil= export linea_elaboration_mail_picture= export linea_elaboration_mail_previous= export linea_elaboration_mail_refresh= export linea_elaboration_mail_remove= export linea_elaboration_mail_search= export linea_elaboration_mail_star= export linea_elaboration_mail_upload= export linea_elaboration_message_check= export linea_elaboration_message_dots= export linea_elaboration_message_happy= export linea_elaboration_message_heart= export linea_elaboration_message_minus= export linea_elaboration_message_note= export linea_elaboration_message_plus= export linea_elaboration_message_refresh= export linea_elaboration_message_remove= export linea_elaboration_message_sad= export linea_elaboration_smartphone_cloud= export linea_elaboration_smartphone_heart= export linea_elaboration_smartphone_noaccess= export linea_elaboration_smartphone_note= export linea_elaboration_smartphone_pencil= export linea_elaboration_smartphone_picture= export linea_elaboration_smartphone_refresh= export linea_elaboration_smartphone_search= export linea_elaboration_tablet_cloud= export linea_elaboration_tablet_heart= export linea_elaboration_tablet_noaccess= export linea_elaboration_tablet_note= export linea_elaboration_tablet_pencil= export linea_elaboration_tablet_picture= export linea_elaboration_tablet_refresh= export linea_elaboration_tablet_search= export linea_elaboration_todolist_2= export linea_elaboration_todolist_check= export linea_elaboration_todolist_cloud= export linea_elaboration_todolist_download= export linea_elaboration_todolist_flagged= export linea_elaboration_todolist_minus= export linea_elaboration_todolist_noaccess= export linea_elaboration_todolist_pencil= export linea_elaboration_todolist_plus= export linea_elaboration_todolist_refresh= export linea_elaboration_todolist_remove= export linea_elaboration_todolist_search= export linea_elaboration_todolist_star= export linea_elaboration_todolist_upload= export linea_ecommerce_receipt_kips= export linea_ecommerce_receipt_lira= export linea_ecommerce_receipt_naira= export linea_ecommerce_receipt_pesos= export linea_ecommerce_receipt_pound= export linea_ecommerce_receipt_rublo= export linea_ecommerce_receipt_rupee= export linea_ecommerce_receipt_tugrik= export linea_ecommerce_receipt_won= export linea_ecommerce_receipt_yen= export linea_ecommerce_receipt_yen2= export linea_ecommerce_recept_colon= export linea_ecommerce_rublo= export linea_ecommerce_rupee= export linea_ecommerce_safe= export linea_ecommerce_naira= export linea_ecommerce_pesos= export linea_ecommerce_pound= export linea_ecommerce_receipt= export linea_ecommerce_receipt_bath= export linea_ecommerce_receipt_cent= export linea_ecommerce_receipt_dollar= export linea_ecommerce_receipt_euro= export linea_ecommerce_receipt_franc= export linea_ecommerce_receipt_guarani= export linea_ecommerce_sale= export linea_ecommerce_sales= export linea_ecommerce_ticket= export linea_ecommerce_tugriks= export linea_ecommerce_wallet= export linea_ecommerce_won= export linea_ecommerce_yen= export linea_ecommerce_cart_content= export linea_ecommerce_cart_download= export linea_ecommerce_cart_minus= export linea_ecommerce_cart_plus= export linea_ecommerce_cart_refresh= export linea_ecommerce_cart_remove= export linea_ecommerce_cart_search= export linea_ecommerce_cart_upload= export linea_ecommerce_cent= export linea_ecommerce_colon= export linea_ecommerce_creditcard= export linea_ecommerce_diamond= export linea_ecommerce_dollar= export linea_ecommerce_euro= export linea_ecommerce_franc= export linea_ecommerce_gift= export linea_ecommerce_graph1= export linea_ecommerce_graph2= export linea_ecommerce_graph3= export linea_ecommerce_graph_decrease= export linea_ecommerce_graph_increase= export linea_ecommerce_guarani= export linea_ecommerce_kips= export linea_ecommerce_lira= export linea_ecommerce_megaphone= export linea_ecommerce_money= export linea_ecommerce_yen2= export linea_ecommerce_bag= export linea_ecommerce_bag_check= export linea_ecommerce_bag_cloud= export linea_ecommerce_bag_download= export linea_ecommerce_bag_minus= export linea_ecommerce_bag_plus= export linea_ecommerce_bag_refresh= export linea_ecommerce_bag_remove= export linea_ecommerce_bag_search= export linea_ecommerce_bag_upload= export linea_ecommerce_banknote= export linea_ecommerce_banknotes= export linea_ecommerce_basket= export linea_ecommerce_basket_check= export linea_ecommerce_basket_cloud= export linea_ecommerce_basket_download= export linea_ecommerce_basket_minus= export linea_ecommerce_basket_plus= export linea_ecommerce_basket_refresh= export linea_ecommerce_basket_remove= export linea_ecommerce_basket_search= export linea_ecommerce_basket_upload= export linea_ecommerce_bath= export linea_ecommerce_cart= export linea_ecommerce_cart_check= export linea_ecommerce_cart_cloud= export linea_music_stop_button= export linea_music_tape= export linea_music_volume_down= export linea_music_volume_up= export linea_music_beginning_button= export linea_music_bell= export linea_music_cd= export linea_music_diapason= export linea_music_eject_button= export linea_music_end_button= export linea_music_fastforward_button= export linea_music_headphones= export linea_music_ipod= export linea_music_loudspeaker= export linea_music_microphone= export linea_music_microphone_old= export linea_music_mixer= export linea_music_mute= export linea_music_note_multiple= export linea_music_note_single= export linea_music_pause_button= export linea_music_play_button= export linea_music_playlist= export linea_music_radio_ghettoblaster= export linea_music_radio_portable= export linea_music_record= export linea_music_recordplayer= export linea_music_repeat_button= export linea_music_rewind_button= export linea_music_shuffle_button= export linea_software_paragraph_justify_center= export linea_software_paragraph_justify_left= export linea_software_paragraph_justify_right= export linea_software_paragraph_space_after= export linea_software_paragraph_space_before= export linea_software_pathfinder_exclude= export linea_software_pathfinder_intersect= export linea_software_pathfinder_subtract= export linea_software_pathfinder_unite= export linea_software_pen= export linea_software_pen_add= export linea_software_pen_remove= export linea_software_pencil= export linea_software_polygonallasso= export linea_software_reflect_horizontal= export linea_software_magnete= export linea_software_pages= export linea_software_paintbrush= export linea_software_paintbucket= export linea_software_paintroller= export linea_software_paragraph= export linea_software_paragraph_align_left= export linea_software_paragraph_align_right= export linea_software_paragraph_center= export linea_software_paragraph_justify_all= export linea_software_reflect_vertical= export linea_software_remove_vectorpoint= export linea_software_scale_expand= export linea_software_scale_reduce= export linea_software_selection_oval= export linea_software_selection_polygon= export linea_software_selection_rectangle= export linea_software_indent_firstline= export linea_software_indent_left= export linea_software_indent_right= export linea_software_lasso= export linea_software_layers1= export linea_software_layers2= export linea_software_layout= export linea_software_layout_2columns= export linea_software_layout_3columns= export linea_software_layout_4boxes= export linea_software_layout_4columns= export linea_software_layout_4lines= export linea_software_layout_8boxes= export linea_software_layout_header= export linea_software_layout_header_2columns= export linea_software_layout_header_3columns= export linea_software_layout_header_4boxes= export linea_software_layout_header_4columns= export linea_software_layout_header_complex= export linea_software_layout_header_complex2= export linea_software_layout_header_complex3= export linea_software_layout_header_complex4= export linea_software_layout_header_sideleft= export linea_software_layout_header_sideright= export linea_software_layout_sidebar_left= export linea_software_layout_sidebar_right= export linea_software_selection_roundedrectangle= export linea_software_vector_line= export linea_software_shape_oval= export linea_software_shape_polygon= export linea_software_shape_rectangle= export linea_software_shape_roundedrectangle= export linea_software_add_vectorpoint= export linea_software_box_oval= export linea_software_box_polygon= export linea_software_box_rectangle= export linea_software_box_roundedrectangle= export linea_software_character= export linea_software_crop= export linea_software_eyedropper= export linea_software_font_allcaps= export linea_software_font_baseline_shift= export linea_software_font_horizontal_scale= export linea_software_font_kerning= export linea_software_font_leading= export linea_software_font_size= export linea_software_font_smallcapital= export linea_software_font_smallcaps= export linea_software_font_strikethrough= export linea_software_font_tracking= export linea_software_font_underline= export linea_software_font_vertical_scale= export linea_software_horizontal_align_center= export linea_software_horizontal_align_left= export linea_software_horizontal_align_right= export linea_software_horizontal_distribute_center= export linea_software_horizontal_distribute_left= export linea_software_horizontal_distribute_right= export linea_software_slice= export linea_software_transform_bezier= export linea_software_vector_box= export linea_software_vector_composite= export linea_software_vertical_align_bottom= export linea_software_vertical_align_center= export linea_software_vertical_align_top= export linea_software_vertical_distribute_bottom= export linea_software_vertical_distribute_center= export linea_software_vertical_distribute_top= export linea_weather_aquarius= export linea_weather_aries= export linea_weather_cancer= export linea_weather_capricorn= export linea_weather_cloud= export linea_weather_cloud_drop= export linea_weather_cloud_lightning= export linea_weather_cloud_snowflake= export linea_weather_downpour_fullmoon= export linea_weather_downpour_halfmoon= export linea_weather_downpour_sun= export linea_weather_drop= export linea_weather_first_quarter= export linea_weather_fog= export linea_weather_fog_fullmoon= export linea_weather_fog_halfmoon= export linea_weather_fog_sun= export linea_weather_fullmoon= export linea_weather_gemini= export linea_weather_hail= export linea_weather_hail_fullmoon= export linea_weather_hail_halfmoon= export linea_weather_hail_sun= export linea_weather_last_quarter= export linea_weather_leo= export linea_weather_libra= export linea_weather_lightning= export linea_weather_mistyrain= export linea_weather_mistyrain_fullmoon= export linea_weather_mistyrain_halfmoon= export linea_weather_mistyrain_sun= export linea_weather_moon= export linea_weather_moondown_full= export linea_weather_moondown_half= export linea_weather_moonset_full= export linea_weather_moonset_half= export linea_weather_move2= export linea_weather_newmoon= export linea_weather_pisces= export linea_weather_rain= export linea_weather_rain_fullmoon= export linea_weather_rain_halfmoon= export linea_weather_rain_sun= export linea_weather_sagittarius= export linea_weather_scorpio= export linea_weather_snow= export linea_weather_snow_fullmoon= export linea_weather_snow_halfmoon= export linea_weather_snow_sun= export linea_weather_snowflake= export linea_weather_star= export linea_weather_storm_11= export linea_weather_storm_32= export linea_weather_storm_fullmoon= export linea_weather_storm_halfmoon= export linea_weather_storm_sun= export linea_weather_sun= export linea_weather_sundown= export linea_weather_sunset= export linea_weather_taurus= export linea_weather_tempest= export linea_weather_tempest_fullmoon= export linea_weather_tempest_halfmoon= export linea_weather_tempest_sun= export linea_weather_variable_fullmoon= export linea_weather_variable_halfmoon= export linea_weather_variable_sun= export linea_weather_virgo= export linea_weather_waning_cresent= export linea_weather_waning_gibbous= export linea_weather_waxing_cresent= export linea_weather_waxing_gibbous= export linea_weather_wind= export linea_weather_wind_e= export linea_weather_wind_fullmoon= export linea_weather_wind_halfmoon= export linea_weather_wind_n= export linea_weather_wind_ne= export linea_weather_wind_nw= export linea_weather_wind_s= export linea_weather_wind_se= export linea_weather_wind_sun= export linea_weather_wind_sw= export linea_weather_wind_w= export linea_weather_windgust= # Font mfizz Icons export mfizz_3dprint= export mfizz_alpinelinux= export mfizz_angular= export mfizz_angular_alt= export mfizz_antenna= export mfizz_apache= export mfizz_archlinux= export mfizz_aws= export mfizz_azure= export mfizz_backbone= export mfizz_blackberry= export mfizz_bomb= export mfizz_bootstrap= export mfizz_c= export mfizz_cassandra= export mfizz_centos= export mfizz_clojure= export mfizz_codeigniter= export mfizz_codepen= export mfizz_coffee_bean= export mfizz_cplusplus= export mfizz_csharp= export mfizz_css= export mfizz_css3= export mfizz_css3_alt= export mfizz_d3= export mfizz_database= export mfizz_database_alt= export mfizz_database_alt2= export mfizz_debian= export mfizz_docker= export mfizz_dreamhost= export mfizz_elixir= export mfizz_elm= export mfizz_erlang= export mfizz_exherbo= export mfizz_fedora= export mfizz_fire_alt= export mfizz_freebsd= export mfizz_freecodecamp= export mfizz_gentoo= export mfizz_ghost= export mfizz_git= export mfizz_gnome= export mfizz_go= export mfizz_go_alt= export mfizz_google= export mfizz_google_alt= export mfizz_google_code= export mfizz_google_developers= export mfizz_gradle= export mfizz_grails= export mfizz_grails_alt= export mfizz_grunt= export mfizz_gulp= export mfizz_gulp_alt= export mfizz_hadoop= export mfizz_haskell= export mfizz_heroku= export mfizz_html= export mfizz_html5= export mfizz_html5_alt= export mfizz_iphone= export mfizz_java= export mfizz_java_bold= export mfizz_java_duke= export mfizz_javascript= export mfizz_javascript_alt= export mfizz_jetty= export mfizz_jquery= export mfizz_kde= export mfizz_laravel= export mfizz_line_graph= export mfizz_linux_mint= export mfizz_looking= export mfizz_magento= export mfizz_mariadb= export mfizz_maven= export mfizz_microscope= export mfizz_mobile_device= export mfizz_mobile_phone_alt= export mfizz_mobile_phone_broadcast= export mfizz_mongodb= export mfizz_mssql= export mfizz_mysql= export mfizz_mysql_alt= export mfizz_netbsd= export mfizz_nginx= export mfizz_nginx_alt= export mfizz_nginx_alt2= export mfizz_nodejs= export mfizz_npm= export mfizz_objc= export mfizz_openshift= export mfizz_oracle= export mfizz_oracle_alt= export mfizz_osx= export mfizz_perl= export mfizz_phone_alt= export mfizz_phone_gap= export mfizz_phone_retro= export mfizz_php= export mfizz_php_alt= export mfizz_playframework= export mfizz_playframework_alt= export mfizz_plone= export mfizz_postgres= export mfizz_postgres_alt= export mfizz_python= export mfizz_raspberrypi= export mfizz_reactjs= export mfizz_redhat= export mfizz_redis= export mfizz_ruby= export mfizz_ruby_on_rails= export mfizz_ruby_on_rails_alt= export mfizz_rust= export mfizz_sass= export mfizz_satellite= export mfizz_scala= export mfizz_scala_alt= export mfizz_script= export mfizz_script_alt= export mfizz_shell= export mfizz_sitefinity= export mfizz_solaris= export mfizz_splatter= export mfizz_spring= export mfizz_suse= export mfizz_svg= export mfizz_symfony= export mfizz_tomcat= export mfizz_ubuntu= export mfizz_unity= export mfizz_wireless= export mfizz_wordpress= export mfizz_x11= # Firacode Icons export firacode_asterisk= export firacode_plus= export firacode_hyphen= export firacode_sad= export firacode_w_w_w= export firacode_asterisk_asterisk= export firacode_asterisk_asterisk_asterisk= export firacode_asterisk_asterisk_slash= export firacode_asterisk_greater= export firacode_asterisk_slash= export firacode_backslash_backslash= export firacode_bbb= export firacode_braceleft_hyphen= export firacode_bracketleft_bracketright= export firacode_colon_colon= export firacode_colon_colon_colon= export firacode_colon_equal= export firacode_exclam_exclam= export firacode_exclam_equal= export firacode_exclam_equal_equal= export firacode_hyphen_braceright= export firacode_hyphen_hyphen= export firacode_hyphen_hyphen_hyphen= export firacode_hyphen_hyphen_greater= export firacode_hyphen_greater= export firacode_hyphen_greater_greater= export firacode_hyphen_less= export firacode_hyphen_less_less= export firacode_hyphen_asciitilde= export firacode_numbersign_braceleft= export firacode_numbersign_bracketleft= export firacode_numbersign_numbersign= export firacode_nnn= export firacode_nnnn= export firacode_numbersign_parenleft= export firacode_numbersign_question= export firacode_numbersign_underscore= export firacode_nup= export firacode_period_hyphen= export firacode_period_equal= export firacode_period_period= export firacode_period_period_less= export firacode_period_period_period= export firacode_question_equal= export firacode_question_question= export firacode_semicolon_semicolon= export firacode_slash_asterisk= export firacode_slash_asterisk_asterisk= export firacode_slash_equal= export firacode_slash_equal_equal= export firacode_slash_greater= export firacode_slash_slash= export firacode_slash_slash_slash= export firacode_ampersand_ampersand= export firacode_bar_bar= export firacode_bar_bar_equal= export firacode_bar_equal= export firacode_bar_greater= export firacode_asciicircum_equal= export firacode_dollar_greater= export firacode_plus_plus= export firacode_plus_plus_plus= export firacode_plus_greater= export firacode_equal_colon_equal= export firacode_equal_equal= export firacode_equal_equal_equal= export firacode_equal_equal_greater= export firacode_equal_greater= export firacode_equal_greater_greater= export firacode_equal_less= export firacode_equal_less_less= export firacode_equal_slash_equal= export firacode_greater_hyphen= export firacode_greater_equal= export firacode_greater_equal_greater= export firacode_greater_greater= export firacode_greater_greater_hyphen= export firacode_greater_greater_equal= export firacode_greater_greater_greater= export firacode_less_asterisk= export firacode_less_asterisk_greater= export firacode_less_bar= export firacode_less_bar_greater= export firacode_less_dollar= export firacode_less_dollar_greater= export firacode_less_exclam_hyphen_hyphen= export firacode_less_hyphen= export firacode_less_hyphen_hyphen= export firacode_less_hyphen_greater= export firacode_less_plus= export firacode_less_plus_greater= export firacode_less_equal= export firacode_less_equal_equal= export firacode_less_equal_greater= export firacode_less_equal_less= export firacode_less_greater= export firacode_less_less= export firacode_less_less_hyphen= export firacode_less_less_equal= export firacode_less_less_less= export firacode_less_asciitilde= export firacode_less_asciitilde_asciitilde= export firacode_less_slash= export firacode_less_slash_greater= export firacode_asciitilde_at= export firacode_asciitilde_hyphen= export firacode_asciitilde_equal= export firacode_asciitilde_greater= export firacode_asciitilde_asciitilde= export firacode_aag= export firacode_percent_percent= export firacode_x_multiply= export firacode_colon_uc= export firacode_plus_lc= export firacode_plus_tosf2= export firacode_nameme_1114119=
#!/bin/sh set -e echo "Got base path at '$1'" echo "Got curent version of '$2'" echo "Got previsous version of '$3'" if [ ! -f /usr/lib/contractor/util/blueprintLoader ] then echo "WARNING: contractor not found, assuming you are installing for the PXE resources only, skiping blueprint loading." exit 0 fi echo "Loading Blueprints..." /usr/lib/contractor/util/blueprintLoader ${1}usr/lib/contractor/resources/ubuntu.toml
#!/usr/bin/env python # # Copyright 2007 <NAME>. # # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in all # copies and that both that copyright notice and this permission # notice appear in supporting documentation, and that the name of Doug # Hellmann not be used in advertising or publicity pertaining to # distribution of the software without specific, written prior # permission. # # <NAME> DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN # NO EVENT SHALL <NAME> 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. # """Unit tests to verify exceptions. """ #end_pymotw_header import unittest def raises_error(*args, **kwds): raise ValueError('Invalid value: ' + str(args) + str(kwds)) class ExceptionTest(unittest.TestCase): def testTrapLocally(self): try: raises_error('a', b='c') except ValueError: pass else: self.fail('Did not see ValueError') def testFailUnlessRaises(self): self.failUnlessRaises(ValueError, raises_error, 'a', b='c') if __name__ == '__main__': unittest.main()
import { ApolloCache } from "@apollo/client"; import { TypedDocumentNode } from "@graphql-typed-document-node/core"; import produce from "immer"; export interface ApolloCacheUpdateQueryParams<Query, QueryVariables> { query: TypedDocumentNode<Query, QueryVariables>; variables: QueryVariables; update: (query: Query) => void; } export function apolloCacheUpdateQuery<Query, QueryVariables>( cache: ApolloCache<any>, params: ApolloCacheUpdateQueryParams<Query, QueryVariables>, ) { const { query, variables, update } = params; let queryResult: Query | null = null; try { queryResult = cache.readQuery<Query, QueryVariables>({ query, variables, }); } catch (error) {} if (queryResult) { cache.writeQuery<Query, QueryVariables>({ query, variables, data: produce(queryResult, update), }); } }
module.exports = { root: true, "env": { "browser": true, "es6": true }, "extends": [ "eslint-config-prettier", 'airbnb-typescript', "eslint:recommended", "eslint-config-jsdoc", "plugin:promise/recommended", "plugin:import/recommended", "plugin:react/recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended-requiring-type-checking" ], "globals": { "Atomics": "readonly", "SharedArrayBuffer": "readonly" }, "parser": "@typescript-eslint/parser", "parserOptions": { "project": "./tsconfig.json", "tsconfigRootDir": "./", "ecmaFeatures": { "jsx": true }, "ecmaVersion": 2020, "sourceType": "module" }, "settings": { "react": { "createClass": "createReactClass", "pragma": "React", "version": "detect" }, "propWrapperFunctions": [ "forbidExtraProps", { "property": "freeze", "object": "Object" }, { "property": "myFavoriteWrapper" } ], "linkComponents": [ "Hyperlink", { "name": "Link", "linkAttribute": "to" } ] }, "plugins": [ "prettier", "@typescript-eslint", "react", "jsdoc", "promise", "import" ], "rules": { "import/prefer-default-export": 0, "prettier/prettier": 0, "linebreak-style": [ "error", "unix" ], "quotes": [ "error", "double" ], "@typescript-eslint/quotes": ["error", "double"], "semi": [ "error", "always" ], "@typescript-eslint/space-before-function-paren": [ "error", "always" ], "space-before-function-paren": [ "error", "always" ], "@typescript-eslint/unbound-method": 0, "react/jsx-indent": 0, "react/jsx-indent-props":0, "react/jsx-props-no-spreading": ["error", { "html": "ignore" }], "import/no-extraneous-dependencies": ["error", {"devDependencies": true}], "@typescript-eslint/indent": ["error",4], "no-console": 0, "max-len": ["error", 120], "react/jsx-uses-react": "error", "react/jsx-uses-vars": "error", "react/boolean-prop-naming": "error", "react/button-has-type": "error", "react/destructuring-assignment": ["error", "always"], "react/forbid-component-props": "error", "react/no-access-state-in-setstate": "error", "react/no-typos": "error", 'import/no-unresolved': ['error', { ignore: ['resume-app', 'theme'] }], } };
#!/usr/bin/env bash # shellcheck disable=SC2091 ############################################################################### function cmd { printf "./avalanche-cli.sh avm get-all-balances" ; } function check { local result="$1" ; local result_u ; result_u=$(printf '%s' "$result" | cut -d' ' -f3) ; local result_h ; result_h=$(printf '%s' "$result" | cut -d' ' -f5) ; local result_d ; result_d=$(printf '%s' "$result" | cut -d' ' -f7) ; local expect_u ; expect_u="'https://api.avax.network/ext/bc/${2-X}'" ; assertEquals "$expect_u" "$result_u" ; local expect_h ; expect_h="'content-type:application/json'" ; assertEquals "$expect_h" "$result_h" ; local expect_d ; expect_d="'{" ; expect_d+='"jsonrpc":"2.0",' ; expect_d+='"id":1,' ; expect_d+='"method":"avm.getAllBalances",' ; expect_d+='"params":{' ; expect_d+='"address":"ADDRESS"' ; expect_d+="}}'" ; assertEquals "$expect_d" "$result_d" ; local expect="curl --url $expect_u --header $expect_h --data $expect_d" ; assertEquals "$expect" "$result" ; } function test_avm__get_all_balances_1a { check "$(AVAX_ID_RPC=1 $(cmd) -@ ADDRESS)" ; } function test_avm__get_all_balances_1b { check "$(AVAX_ID_RPC=1 AVAX_ADDRESS=ADDRESS $(cmd))" ; } function test_avm__get_all_balances_2a { check "$(AVAX_ID_RPC=1 $(cmd) -@ ADDRESS -b BC_ID)" BC_ID ; } function test_avm__get_all_balances_2b { check "$(AVAX_ID_RPC=1 AVAX_BLOCKCHAIN_ID=BC_ID $(cmd) -@ ADDRESS)" BC_ID ; } ############################################################################### ###############################################################################
<gh_stars>0 // Copyright 2022 DeepL SE (https://www.deepl.com) // Use of this source code is governed by an MIT // license that can be found in the LICENSE file. const uuid = require('uuid'); const util = require('./util'); const glossaries = new Map(); util.scheduleCleanup(glossaries, (glossary, glossaryId) => { console.log(`Removing glossary "${glossary.name}" (${glossaryId})`); }); function findEntry(entryList, sourceEntry) { for (let i = 0; i < entryList.length; i += 1) { if (entryList[i].source === sourceEntry) { return entryList[i].target; } } return undefined; } function convertListToGlossaryTsv(entriesList) { return entriesList.map((value) => `${value.source}\t${value.target}`).join('\n'); } function convertGlossaryTsvToList(entriesTsv) { const entryList = []; const entries = entriesTsv.split('\n'); if (entries.length === 0) { throw new util.HttpError('Bad request', 400, 'Missing or invalid argument: entries'); } for (let entryIndex = 0; entryIndex < entries.length; entryIndex += 1) { const entryPosition = 0; // TODO Implement calculation of entry positions const entry = entries[entryIndex].trim(); if (entry !== '') { const tabPosition = entry.indexOf('\t'); if (tabPosition === -1) { throw new util.HttpError('Invalid glossary entries provided', 400, `Key with the index ${entryIndex} (starting at position ${entryPosition}) misses tab separator`); } const source = entry.substr(0, tabPosition); const target = entry.substr(tabPosition + 1); if (findEntry(entryList, source) !== undefined) { throw new util.HttpError('Invalid glossary entries provided', 400, `Key with the index ${entryIndex} (starting at position ${entryPosition}) duplicates key with the index {} (starting at position {})`); } entryList.push({ source, target }); } } return entryList; } function extractGlossaryInfo(glossary) { return { glossary_id: glossary.glossaryId, name: glossary.name, ready: glossary.ready, target_lang: glossary.targetLang.toLowerCase(), source_lang: glossary.sourceLang.toLowerCase(), creation_time: glossary.created.toISOString(), entry_count: glossary.entryList.length, }; } function isSupportedLanguagePair(sourceLang, targetLang) { const supportedLanguages = ['EN>DE', 'EN>FR', 'EN>ES', 'DE>EN', 'ES>EN', 'FR>EN']; return supportedLanguages.includes(`${sourceLang}>${targetLang}`); } function isValidGlossaryId(glossaryId) { return uuid.validate(glossaryId); } function translateWithGlossary(entryList, input) { for (let entryIndex = 0; entryIndex < entryList.length; entryIndex += 1) { const { source, target } = entryList[entryIndex]; if (source === input) { return target; } } return null; } function createGlossary(name, authKey, targetLang, sourceLang, entriesTsv) { if (!isSupportedLanguagePair(sourceLang, targetLang)) { throw new util.HttpError('Unsupported glossary source and target language pair', 400); } const entryList = convertGlossaryTsvToList(entriesTsv); const glossaryId = uuid.v1(); // Add glossary to list const glossary = { glossaryId, name, created: new Date(), used: new Date(), ready: true, authKey, sourceLang, targetLang, entryList, translate: (input) => translateWithGlossary(glossary.entryList, input), }; glossaries.set(glossaryId, glossary); console.log(`Created glossary "${glossary.name}" (${glossaryId})`); return extractGlossaryInfo(glossary); } function getGlossary(glossaryId, authKey) { const glossary = glossaries.get(glossaryId); if (glossary?.authKey === authKey) { glossary.used = new Date(); return glossary; } throw new util.HttpError('not found', 404); } function getGlossaryInfo(glossaryId, authKey) { return extractGlossaryInfo(getGlossary(glossaryId, authKey)); } function getGlossaryInfoList(authKey) { const result = []; // eslint-disable-next-line no-restricted-syntax for (const [, glossary] of glossaries.entries()) { if (glossary.authKey === authKey) { result.push(extractGlossaryInfo(glossary)); } } return result; } function getGlossaryEntries(glossaryId, authKey) { const glossary = getGlossary(glossaryId, authKey); return convertListToGlossaryTsv(glossary.entryList); } function removeGlossary(glossaryId, authKey) { const glossary = getGlossary(glossaryId, authKey); console.log(`Removing glossary "${glossary.name}" (${glossaryId})`); glossaries.delete(glossaryId); console.log('Done'); } module.exports = { createGlossary, isValidGlossaryId, getGlossary, getGlossaryInfo, getGlossaryInfoList, getGlossaryEntries, removeGlossary, };
docker build --no-cache -t kamir/cdsw-base-4-maven-rosbag-extractor-v4 . docker push kamir/cdsw-base-4-maven-rosbag-extractor-v4:latest export T=$(date +%I_%M_%S) echo "current time is: "$T docker image ls docker run -it -d --name container_$T kamir/cdsw-base-4-maven-rosbag-extractor-v4 docker container ls read -p "Container-ID to connect to : " C_ID echo $C_ID docker exec -i -t $C_ID /bin/bash docker container stop $C_ID
<reponame>1024pix/pix-ui import Component from '@glimmer/component'; export default class PixBlockComponent extends Component { text = 'pix-block'; get getShadowWeight() { const shadowParam = this.args.shadow; const correctsWeight = ['light', 'heavy']; return correctsWeight.includes(shadowParam) ? shadowParam : 'light'; } }
SELECT customer_id, SUM(amount) AS totalAmount, AVG(amount) AS avgAmount, COUNT(amount) AS countAmount FROM payments WHERE payment_date > '2021-01-01' GROUP BY customer_id ORDER BY averageAmount DESC;
<filename>client.org/app/scripts/app.js<gh_stars>0 // app/scripts/app.js 'use strict'; /** * @ngdoc overview * @name yeoaskar * @description * # yeoaskar * * Main module of the application. */ var app = angular.module('yeoaskar', [ 'ngAnimate', 'ngCookies', 'ngResource', 'ngRoute', 'ngSanitize', 'ngTouch' ]); app.config(function ($routeProvider) { $routeProvider .when('/', { templateUrl: 'views/main.html', controller: 'MainCtrl' }) .when('/about', { templateUrl: 'views/about.html', controller: 'AboutCtrl' }) .when('/groups', { templateUrl: 'views/elements.html', controller: 'ElementsCtrl' }) .otherwise({ redirectTo: '/' }); }); app.factory('Element', ['$resource', function($resource) { return $resource('/api/v1]/elements/:id.json', null, { 'update': { method:'PUT' } }); }]);
#!/bin/bash export FLASK_APP=labelmaker.py flask run --host=0.0.0.0
#!/bin/bash # # 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. # # This script will update apache beam master branch with next release version # and cut release branch for current development version. # Parse parameters passing into the script set -e function usage() { echo 'Usage: set_version.sh <version> [--release] [--debug]' } IS_SNAPSHOT_VERSION=yes while [[ $# -gt 0 ]] ; do arg="$1" case $arg in --release) unset IS_SNAPSHOT_VERSION shift ;; --debug) set -x shift ;; *) if [[ -z "$TARGET_VERSION" ]] ; then TARGET_VERSION="$1" shift else echo "Unknown argument: $1. Target version already set to $TARGET_VERSION" usage exit 1 fi ;; esac done if [[ -z $TARGET_VERSION ]] ; then echo "No target version supplied" usage exit 1 fi if [[ -z "$IS_SNAPSHOT_VERSION" ]] ; then # Fixing a release version sed -i -e "s/version=.*/version=$TARGET_VERSION/" gradle.properties sed -i -e "s/project.version = .*/project.version = '$TARGET_VERSION'/" buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy sed -i -e "s/^__version__ = .*/__version__ = '${TARGET_VERSION}'/" sdks/python/apache_beam/version.py # TODO: [BEAM-4767] sed -i -e "s/'dataflow.container_version' : .*/'dataflow.container_version' : 'beam-${RELEASE}'/" runners/google-cloud-dataflow-java/build.gradle else # For snapshot version: # Java/gradle appends -SNAPSHOT # In the Gradle plugin, the -SNAPSHOT is dynamic so we don't add it here # Python appends .dev # The Dataflow container remains unchanged as in this case it is beam-master-<date> form sed -i -e "s/version=.*/version=$TARGET_VERSION-SNAPSHOT/" gradle.properties sed -i -e "s/project.version = .*/project.version = '$TARGET_VERSION'/" buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy sed -i -e "s/^__version__ = .*/__version__ = '${TARGET_VERSION}.dev'/" sdks/python/apache_beam/version.py sed -i -e "s/'dataflow.container_version' : .*/'dataflow.container_version' : 'beam-master-.*'/" runners/google-cloud-dataflow-java/build.gradle fi
#!/usr/bin/env bash # 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. set -xe : ${KUBECONFIG:="$HOME/.airship/kubeconfig"} # Available Modes: quick, certified-conformance, non-disruptive-conformance. # (default quick) : ${CONFORMANCE_MODE:="quick"} : ${TIMEOUT:=10800} : ${TARGET_CLUSTER_CONTEXT:="target-cluster"} mkdir -p /tmp/sonobuoy_snapshots/e2e cd /tmp/sonobuoy_snapshots/e2e # Run aggregator, and default plugins e2e and systemd-logs sonobuoy run --plugin e2e --plugin systemd-logs -m ${CONFORMANCE_MODE} \ --context "$TARGET_CLUSTER_CONTEXT" \ --kubeconfig ${KUBECONFIG} \ --wait --timeout ${TIMEOUT} \ --log_dir /tmp/sonobuoy_snapshots/e2e # Get information on pods kubectl get all -n sonobuoy --kubeconfig ${KUBECONFIG} --context "$TARGET_CLUSTER_CONTEXT" # Check sonobuoy status sonobuoy status --kubeconfig ${KUBECONFIG} --context "$TARGET_CLUSTER_CONTEXT" # Get logs sonobuoy logs --kubeconfig ${KUBECONFIG} --context "$TARGET_CLUSTER_CONTEXT" # Store Results results=$(sonobuoy retrieve --kubeconfig ${KUBECONFIG} --context $TARGET_CLUSTER_CONTEXT) echo "Results: ${results}" # Display Results sonobuoy results $results ls -ltr /tmp/sonobuoy_snapshots/e2e
if command -v kubectl > /dev/null ; then source <(kubectl completion zsh) fi
public class SearchIndexAction { // Implementation of SearchIndexAction class is not provided } public class Document { // Implementation of Document class is not provided } public class DocumentManager { private SearchIndexAction searchIndexAction; public void setSearchIndexAction(SearchIndexAction searchIndexAction) { this.searchIndexAction = searchIndexAction; } public void indexDocument(Document document) { // Implement indexing of the document using the specified search index action if (searchIndexAction != null) { searchIndexAction.index(document); } else { throw new IllegalStateException("Search index action is not set"); } } public List<Document> searchDocument(String query) { // Implement searching for documents matching the query using the specified search index action if (searchIndexAction != null) { return searchIndexAction.search(query); } else { throw new IllegalStateException("Search index action is not set"); } } }
<reponame>oueya1479/OpenOLAT /** * <a href="http://www.openolat.org"> * OpenOLAT - Online Learning and Training</a><br> * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at the * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a> * <p> * Unless required by applicable law or agreed to in writing,<br> * software distributed under the License is distributed on an "AS IS" BASIS, <br> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> * See the License for the specific language governing permissions and <br> * limitations under the License. * <p> * Initial code contributed and copyrighted by<br> * frentix GmbH, http://www.frentix.com * <p> */ package org.olat.ims.lti13.ui; import org.olat.core.gui.UserRequest; import org.olat.core.gui.components.form.flexible.FormItem; import org.olat.core.gui.components.form.flexible.FormItemContainer; import org.olat.core.gui.components.form.flexible.elements.SingleSelection; import org.olat.core.gui.components.form.flexible.elements.TextElement; import org.olat.core.gui.components.form.flexible.impl.FormBasicController; import org.olat.core.gui.components.form.flexible.impl.FormEvent; import org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer; import org.olat.core.gui.components.util.SelectionValues; import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.Event; import org.olat.core.gui.control.WindowControl; import org.olat.ims.lti13.LTI13Module; import org.olat.ims.lti13.LTI13Platform; import org.olat.ims.lti13.LTI13SharedToolDeployment; import org.olat.ims.lti13.LTI13Tool.PublicKeyType; import org.springframework.beans.factory.annotation.Autowired; /** * * Initial date: 6 avr. 2021<br> * @author srosse, <EMAIL>, http://www.frentix.com * */ public class LTI13SharedToolDeploymentController extends FormBasicController { private SingleSelection publicKeyTypeEl; private TextElement publicKeyEl; private TextElement publicKeyUrlEl; private LTI13Platform platform; private LTI13SharedToolDeployment deployment; @Autowired private LTI13Module lti13Module; public LTI13SharedToolDeploymentController(UserRequest ureq, WindowControl wControl, LTI13SharedToolDeployment deployment) { super(ureq, wControl); this.deployment = deployment; platform = deployment.getPlatform(); initForm(null); updatePublicKeyUI(); } @Override protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) { uifactory.addStaticTextElement("deployment.id", deployment.getDeploymentId(), formLayout); uifactory.addStaticTextElement("tool.client.id", platform.getClientId(), formLayout); String url = deployment.getToolUrl(); uifactory.addStaticTextElement("tool.url", url, formLayout); String loginInitiationUrl = lti13Module.getToolLoginInitiationUri(); uifactory.addStaticTextElement("tool.login.initiation", loginInitiationUrl, formLayout); String loginRedirectUrl = lti13Module.getToolLoginRedirectUri(); uifactory.addStaticTextElement("tool.login.redirection", loginRedirectUrl, formLayout); SelectionValues kValues = new SelectionValues(); kValues.add(SelectionValues.entry(PublicKeyType.KEY.name(), translate("tool.public.key.type.key"))); kValues.add(SelectionValues.entry(PublicKeyType.URL.name(), translate("tool.public.key.type.url"))); publicKeyTypeEl = uifactory.addDropdownSingleselect("tool.public.key.type", "tool.public.key.type", formLayout, kValues.keys(), kValues.values()); publicKeyTypeEl.addActionListener(FormEvent.ONCHANGE); publicKeyTypeEl.select(kValues.keys()[0], true); String publicKey = platform.getPublicKey(); publicKeyEl = uifactory.addTextAreaElement("tool.public.key.value", "tool.public.key.value", -1, 15, 60, false, true, true, publicKey, formLayout); publicKeyEl.setEnabled(false); String publicKeyUrl = platform.getPublicKeyUrl(); publicKeyUrlEl = uifactory.addTextElement("tool.public.key.url", "tool.public.key.url", 255, publicKeyUrl, formLayout); publicKeyUrlEl.setEnabled(false); FormLayoutContainer buttonLayout = FormLayoutContainer.createButtonLayout("buttons", getTranslator()); formLayout.add("buttons", buttonLayout); uifactory.addFormSubmitButton("ok", buttonLayout); } private void updatePublicKeyUI() { if(!publicKeyTypeEl.isOneSelected()) return; String selectedKey = publicKeyTypeEl.getSelectedKey(); publicKeyEl.setVisible(PublicKeyType.KEY.name().equals(selectedKey)); publicKeyUrlEl.setVisible(PublicKeyType.URL.name().equals(selectedKey)); } @Override protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) { if(publicKeyTypeEl == source) { updatePublicKeyUI(); } super.formInnerEvent(ureq, source, event); } @Override protected void formOK(UserRequest ureq) { fireEvent(ureq, Event.DONE_EVENT); } @Override protected void formCancelled(UserRequest ureq) { fireEvent(ureq, Event.CANCELLED_EVENT); } }
<gh_stars>100-1000 //===--- SyntaxFactory.h - Swift Syntax Builder Interface -------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// // // This file defines the SyntaxFactory, one of the most important client-facing // types in lib/Syntax and likely to be very commonly used. // // Effectively a namespace, SyntaxFactory is never instantiated, but is *the* // one-stop shop for making new Syntax nodes. Putting all of these into a // collection of static methods provides a single point of API lookup for // clients' convenience and also allows the library to hide all of the // constructors for all Syntax nodes, as the SyntaxFactory is friend to all. // //===----------------------------------------------------------------------===// #ifndef SWIFT_SYNTAX_SyntaxFactory_H #define SWIFT_SYNTAX_SyntaxFactory_H #include "swift/Syntax/DeclSyntax.h" #include "swift/Syntax/GenericSyntax.h" #include "swift/Syntax/TokenSyntax.h" #include "swift/Syntax/TypeSyntax.h" #include "swift/Syntax/Trivia.h" #include "llvm/ADT/ArrayRef.h" #include <vector> namespace swift { namespace syntax { #define SYNTAX(Id, Parent) class Id##Syntax; #include "swift/Syntax/SyntaxKinds.def" class DeclSyntax; class ExprSyntax; class StmtSyntax; class UnknownSyntax; struct TokenSyntax; /// The Syntax builder - the one-stop shop for making new Syntax nodes. struct SyntaxFactory { /// Collect a list of tokens into a piece of "unknown" syntax. static UnknownSyntax makeUnknownSyntax(llvm::ArrayRef<RC<TokenSyntax>> Tokens); #pragma mark - Declarations #pragma mark - declaration-modifier /// Make a declaration modifier with the specified elements. static DeclModifierSyntax makeDeclModifier(RC<TokenSyntax> Name, RC<TokenSyntax> LeftParen, RC<TokenSyntax> Argument, RC<TokenSyntax> RightParen); /// Make a declaration modifier with all missing elements. static DeclModifierSyntax makeBlankDeclModifier(); /// Make a declaration modifier list with the specified modifiers. static DeclModifierListSyntax makeDeclModifierList(const std::vector<DeclModifierSyntax> &Modifiers); /// Make an empty declaration modifier list. static DeclModifierListSyntax makeBlankDeclModifierList(); #pragma mark - struct-declaration /// Make a struct declaration with the specified elements. static StructDeclSyntax makeStructDecl(RC<TokenSyntax> StructToken, RC<TokenSyntax> Identifier, Syntax GenericParameters, Syntax WhereClause, RC<TokenSyntax> LeftBrace, Syntax DeclMembers, RC<TokenSyntax> RightBrace); /// Make a struct declaration with all missing elements. static StructDeclSyntax makeBlankStructDecl(); /// Make a typealias declaration with the specified elements. static TypeAliasDeclSyntax makeTypealiasDecl(RC<TokenSyntax> TypealiasToken, RC<TokenSyntax> Identifier, GenericParameterClauseSyntax GenericParams, RC<TokenSyntax> AssignmentToken, TypeSyntax Type); /// Make a typealias declaration with all missing elements. static TypeAliasDeclSyntax makeBlankTypealiasDecl(); /// Make an empty list of declaration members. static DeclMembersSyntax makeBlankDeclMembers(); /// Make a function declaration with the specified elements. static FunctionDeclSyntax makeFunctionDecl(TypeAttributesSyntax Attributes, DeclModifierListSyntax Modifiers, RC<TokenSyntax> FuncKeyword, RC<TokenSyntax> Identifier, llvm::Optional<GenericParameterClauseSyntax> GenericParams, FunctionSignatureSyntax Signature, llvm::Optional<GenericWhereClauseSyntax> GenericWhereClause, llvm::Optional<CodeBlockStmtSyntax> Body); /// Make a function declaration with all missing elements. static FunctionDeclSyntax makeBlankFunctionDecl(); #pragma mark - function-parameter /// Make a function parameter with the given elements. static FunctionParameterSyntax makeFunctionParameter(RC<TokenSyntax> ExternalName, RC<TokenSyntax> LocalName, RC<TokenSyntax> Colon, llvm::Optional<TypeSyntax> ParameterTypeSyntax, RC<TokenSyntax> Ellipsis, RC<TokenSyntax> Equal, llvm::Optional<ExprSyntax> DefaultValue, RC<TokenSyntax> TrailingComma); /// Make a function parameter with all elements marked as missing. static FunctionParameterSyntax makeBlankFunctionParameter(); #pragma mark - function-parameter-list /// Make a function parameter list with the given parameters. static FunctionParameterListSyntax makeFunctionParameterList( std::vector<FunctionParameterSyntax> Parameters); /// Make an empty function parameter list. static FunctionParameterListSyntax makeBlankFunctionParameterList(); #pragma mark - function-signature /// Make a function signature with the given elements. static FunctionSignatureSyntax makeFunctionSignature(RC<TokenSyntax> LeftParen, FunctionParameterListSyntax ParameterList, RC<TokenSyntax> RightParen, RC<TokenSyntax> ThrowsOrRethrows, RC<TokenSyntax> Arrow, TypeAttributesSyntax ReturnTypeAttributes, TypeSyntax ReturnTypeSyntax); /// Make a blank function signature. static FunctionSignatureSyntax makeBlankFunctionSignature(); //-/ Make a function declaration with the given elements. // TODO //-/ Make a blank function declaration. // TODO #pragma mark - Statements /// Make a code block with the specified elements. static CodeBlockStmtSyntax makeCodeBlock(RC<TokenSyntax> LeftBraceToken, StmtListSyntax Elements, RC<TokenSyntax> RightBraceToken); /// Make a code block with all missing elements. static CodeBlockStmtSyntax makeBlankCodeBlock(); /// Make a fallthrough statement with the give `fallthrough` keyword. static FallthroughStmtSyntax makeFallthroughStmt(RC<TokenSyntax> FallthroughKeyword); /// Make a fallthrough statement with the `fallthrough` keyword /// marked as missing. static FallthroughStmtSyntax makeBlankFallthroughStmt(); /// Make a break statement with the give `break` keyword and /// destination label. static BreakStmtSyntax makeBreakStmt(RC<TokenSyntax> BreakKeyword, RC<TokenSyntax> Label); /// Make a break statement with the `break` keyword /// and destination label marked as missing. static BreakStmtSyntax makeBlankBreakStmtSyntax(); /// Make a continue statement with the given `continue` keyword and /// destination label. static ContinueStmtSyntax makeContinueStmt(RC<TokenSyntax> ContinueKeyword, RC<TokenSyntax> Label); /// Make a continue statement with the `continue` keyword /// and destination label marked as missing. static ContinueStmtSyntax makeBlankContinueStmtSyntax(); /// Make a return statement with the given `return` keyword and returned /// expression. static ReturnStmtSyntax makeReturnStmt(RC<TokenSyntax> ReturnKeyword, ExprSyntax ReturnedExpression); /// Make a return statement with the `return` keyword and return expression /// marked as missing. static ReturnStmtSyntax makeBlankReturnStmt(); /// Make a statement list from a loosely connected list of statements. static StmtListSyntax makeStmtList(const std::vector<StmtSyntax> &Statements); /// Make an empty statement list. static StmtListSyntax makeBlankStmtList(); #pragma mark - Expressions /// Make an integer literal with the given '+'/'-' sign and string of digits. static IntegerLiteralExprSyntax makeIntegerLiteralExpr(RC<TokenSyntax> Sign, RC<TokenSyntax> Digits); /// Make an integer literal with the sign and string of digits marked /// as missing. static IntegerLiteralExprSyntax makeBlankIntegerLiteralExpr(); /// Make a symbolic reference with the given identifier and optionally a /// generic argument clause. static SymbolicReferenceExprSyntax makeSymbolicReferenceExpr(RC<TokenSyntax> Identifier, llvm::Optional<GenericArgumentClauseSyntax> GenericArgs); /// Make a symbolic reference expression with the identifier and /// generic argument clause marked as missing. static SymbolicReferenceExprSyntax makeBlankSymbolicReferenceExpr(); /// Make a function call argument with all elements marked as missing. static FunctionCallArgumentSyntax makeBlankFunctionCallArgument(); /// Make a function call argument based on an expression with the /// given elements. static FunctionCallArgumentSyntax makeFunctionCallArgument(RC<TokenSyntax> Label, RC<TokenSyntax> Colon, ExprSyntax ExpressionArgument, RC<TokenSyntax> TrailingComma); /// Make a function call argument list with the given arguments. static FunctionCallArgumentListSyntax makeFunctionCallArgumentList( std::vector<FunctionCallArgumentSyntax> Arguments); /// Make a function call argument list with no arguments. static FunctionCallArgumentListSyntax makeBlankFunctionCallArgumentList(); /// Make a function call expression with the given elements. static FunctionCallExprSyntax makeFunctionCallExpr(ExprSyntax CalledExpr, RC<TokenSyntax> LeftParen, FunctionCallArgumentListSyntax Arguments, RC<TokenSyntax> RightParen); /// Make a function call expression with all elements marked as missing. static FunctionCallExprSyntax makeBlankFunctionCallExpr(); #pragma mark - Tokens /// Make a 'static' keyword with the specified leading and trailing trivia. static RC<TokenSyntax> makeStaticKeyword(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a 'public' keyword with the specified leading and trailing trivia. static RC<TokenSyntax> makePublicKeyword(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a 'func' keyword with the specified leading and trailing trivia. static RC<TokenSyntax> makeFuncKeyword(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a 'fallthrough' keyword with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeFallthroughKeyword(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make an at-sign '@' token with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeAtSignToken(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a 'break' keyword with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeBreakKeyword(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a 'continue' keyword with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeContinueKeyword(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a 'return' keyword with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeReturnKeyword(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a left angle '<' token with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeLeftAngleToken(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a right angle '>' token with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeRightAngleToken(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a left parenthesis '(' token with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeLeftParenToken(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a right parenthesis ')' token with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeRightParenToken(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a left brace '{' token with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeLeftBraceToken(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a right brace '}' token with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeRightBraceToken(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a left square bracket '[' token with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeLeftSquareBracketToken(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a right square bracket ']' token with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeRightSquareBracketToken(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a postfix question '?' token with the specified trailing trivia. /// The leading trivia is assumed to be of zero width. static RC<TokenSyntax> makeQuestionPostfixToken(const Trivia &TrailingTrivia); /// Make an exclamation '!' token with the specified trailing trivia. /// The leading trivia is assumed to be of zero width. static RC<TokenSyntax> makeExclaimPostfixToken(const Trivia &TrailingTrivia); /// Make an identifier token with the specified leading and trailing trivia. static RC<TokenSyntax> makeIdentifier(OwnedString Name, const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a comma ',' token with the specified leading and trailing trivia. static RC<TokenSyntax> makeCommaToken(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a colon ':' token with the specified leading and trailing trivia. static RC<TokenSyntax> makeColonToken(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a dot '.' token with the specified leading and trailing trivia. static RC<TokenSyntax> makeDotToken(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a 'struct' keyword with the specified leading and trailing trivia. static RC<TokenSyntax> makeStructKeyword(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a 'where' keyword with the specified leading and trailing trivia. static RC<TokenSyntax> makeWhereKeyword(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a 'inout' keyword with the specified leading and trailing trivia. static RC<TokenSyntax> makeInoutKeyword(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a 'throws' keyword with the specified leading and trailing trivia. static RC<TokenSyntax> makeThrowsKeyword(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a 'rethrows' keyword with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeRethrowsKeyword(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a 'typealias' keyword with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeTypealiasKeyword(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make an equal '=' token with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeEqualToken(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make an arrow '->' token with the specified leading and trailing trivia. static RC<TokenSyntax> makeArrow(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make an equality '==' binary operator with the specified leading and /// trailing trivia. static RC<TokenSyntax> makeEqualityOperator(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make the terminal identifier token `Type` static RC<TokenSyntax> makeTypeToken(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make the terminal identifier token `Protocol` static RC<TokenSyntax> makeProtocolToken(const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a token representing the digits of an integer literal. /// /// Note: This is not a stand-in for the expression, which can contain /// a minus sign. static RC<TokenSyntax> makeIntegerLiteralToken(OwnedString Digits, const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); #pragma mark - Operators /// Make a prefix operator with the given text. static RC<TokenSyntax> makePrefixOperator(OwnedString Name, const Trivia &LeadingTrivia); #pragma mark - Types #pragma mark - type-attribute /// Make a type attribute with the specified elements. static TypeAttributeSyntax makeTypeAttribute(RC<TokenSyntax> AtSignToken, RC<TokenSyntax> Identifier, RC<TokenSyntax> LeftParen, BalancedTokensSyntax BalancedTokens, RC<TokenSyntax> RightParen); /// Make a type attribute with all elements marked as missing. static TypeAttributeSyntax makeBlankTypeAttribute(); #pragma mark - type-attributes /// Make a set of type attributes with all elements marked as missing. static TypeAttributesSyntax makeBlankTypeAttributes(); #pragma mark - balanced-tokens /// Make a list of balanced tokens. static BalancedTokensSyntax makeBalancedTokens(RawSyntax::LayoutList Tokens); /// Make an empty list of balanced tokens. static BalancedTokensSyntax makeBlankBalancedTokens(); #pragma mark - type-identifier /// Make a non-generic type identifier with some name. static TypeIdentifierSyntax makeTypeIdentifier(OwnedString Name, const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a generic type identifier. static TypeIdentifierSyntax makeTypeIdentifier(RC<TokenSyntax> Identifier, GenericArgumentClauseSyntax GenericArgs); /// Make a bare "Any" type. static TypeIdentifierSyntax makeAnyTypeIdentifier(); /// Make a bare "Self" type. static TypeIdentifierSyntax makeSelfTypeIdentifier(); #pragma mark - tuple-type /// Make a bare "()" void tuple type static TupleTypeSyntax makeVoidTupleType(); /// Make a tuple type from a type element list and the provided left/right /// paren tokens. static TupleTypeSyntax makeTupleType(RC<TokenSyntax> LParen, TupleTypeElementListSyntax Elements, RC<TokenSyntax> RParen); /// Make a tuple type element of the form 'Name: ElementType' static TupleTypeElementSyntax makeTupleTypeElement(RC<TokenSyntax> Name, RC<TokenSyntax> Colon, TypeSyntax ElementType, llvm::Optional<RC<TokenSyntax>> MaybeComma = llvm::None); /// Make a tuple type element without a label. static TupleTypeElementSyntax makeTupleTypeElement(TypeSyntax ElementType, llvm::Optional<RC<TokenSyntax>> MaybeComma = llvm::None); /// Make a tuple type element list. static TupleTypeElementListSyntax makeTupleTypeElementList(std::vector<TupleTypeElementSyntax> ElementTypes); #pragma mark - optional-type /// Make an optional type, such as `Int?` static OptionalTypeSyntax makeOptionalType(TypeSyntax BaseType, const Trivia &TrailingTrivia); /// Make an optional type with all elements marked as missing. static OptionalTypeSyntax makeBlankOptionalType(); #pragma mark - implicitly-unwrapped-optional-type /// Make an implicitly unwrapped optional type, such as `Int!` static ImplicitlyUnwrappedOptionalTypeSyntax makeImplicitlyUnwrappedOptionalType(TypeSyntax BaseType, const Trivia &TrailingTrivia); static ImplicitlyUnwrappedOptionalTypeSyntax makeBlankImplicitlyUnwrappedOptionalType(); #pragma mark - metatype-type /// Make a metatype type, as in `T.Type` /// `Type` is a terminal token here, not a placeholder for something else. static MetatypeTypeSyntax makeMetatypeType(TypeSyntax BaseType, RC<TokenSyntax> DotToken, RC<TokenSyntax> TypeToken); /// Make a metatype type with all elements marked as missing. static MetatypeTypeSyntax makeBlankMetatypeType(); #pragma mark - array-type /// Make a sugared Array type, as in `[MyType]`. static ArrayTypeSyntax makeArrayType(RC<TokenSyntax> LeftSquareBracket, TypeSyntax ElementType, RC<TokenSyntax> RightSquareBracket); /// Make an array type with all elements marked as missing. static ArrayTypeSyntax makeBlankArrayType(); #pragma mark - dictionary-type /// Make a Dictionary type, as in `[Key : Value]`. static DictionaryTypeSyntax makeDictionaryType(RC<TokenSyntax> LeftSquareBracket, TypeSyntax KeyType, RC<TokenSyntax> Colon, TypeSyntax ValueType, RC<TokenSyntax> RightSquareBracket); /// Make an a dictionary type with all elements marked as missing. static DictionaryTypeSyntax makeBlankDictionaryType(); #pragma mark - function-type-argument /// Make a function argument type syntax with the specified elements. static FunctionTypeArgumentSyntax makeFunctionTypeArgument(RC<TokenSyntax> ExternalParameterName, RC<TokenSyntax> LocalParameterName, TypeAttributesSyntax TypeAttributes, RC<TokenSyntax> InoutKeyword, RC<TokenSyntax> ColonToken, TypeSyntax ParameterTypeSyntax); /// Make a simple function type argument syntax with the given label and /// simple type name. static FunctionTypeArgumentSyntax makeFunctionTypeArgument(RC<TokenSyntax> LocalParameterName, RC<TokenSyntax> ColonToken, TypeSyntax ParameterType); /// Make a simple function type argument syntax with the given simple /// type name. static FunctionTypeArgumentSyntax makeFunctionTypeArgument(TypeSyntax TypeArgument); /// Make a function argument type syntax with all elements marked as missing. static FunctionTypeArgumentSyntax makeBlankFunctionArgumentType(); #pragma mark - function-type /// Make a function type, for example, `(Int, Int) throws -> Int` static FunctionTypeSyntax makeFunctionType(TypeAttributesSyntax TypeAttributes, RC<TokenSyntax> LeftParen, FunctionParameterListSyntax ArgumentList, RC<TokenSyntax> RightParen, RC<TokenSyntax> ThrowsOrRethrows, RC<TokenSyntax> Arrow, TypeSyntax ReturnType); /// Make a function type with all elements marked as missing. static FunctionTypeSyntax makeBlankFunctionType(); #pragma mark - tuple-type-element-list /// Make a list of type arguments with all elements marked as missing. static TupleTypeElementListSyntax makeBlankTupleTypeElementList(); #pragma mark - Generics /// Make an empty generic parameter clause. static GenericParameterClauseSyntax makeBlankGenericParameterClause(); /// Make an empty generic argument clause. static GenericArgumentClauseSyntax makeBlankGenericArgumentClause(); /// Make an empty generic where clause. static GenericWhereClauseSyntax makeBlankGenericWhereClause(); /// Make a same-type requirement with the specified elements. /// /// Any elements are allowed to be marked as missing. static SameTypeRequirementSyntax makeSameTypeRequirement(TypeIdentifierSyntax LeftTypeIdentifier, RC<TokenSyntax> EqualityToken, TypeSyntax RightType); /// Make a list of generic requirements with the given loosely collected /// requirements/ static GenericRequirementListSyntax makeGenericRequirementList( std::vector<GenericRequirementSyntax> &Requirements); /// Make an empty list of generic requirements. static GenericRequirementListSyntax makeBlankGenericRequirementList(); /// Make a same-type requirement with all elements marked as missing. static SameTypeRequirementSyntax makeBlankSameTypeRequirement(); /// Make an empty same-type-requirement with all missing elements. static SameTypeRequirementSyntax makeSameTypeRequirement(); /// Make a generic parameter with the specified name and trivia. static GenericParameterSyntax makeGenericParameter(OwnedString TypeName, const Trivia &LeadingTrivia, const Trivia &TrailingTrivia); /// Make a generic parameter with all elements marked as missing. static GenericParameterSyntax makeBlankGenericParameter(); }; } // end namespace syntax } // end namespace swift #endif // SWIFT_SYNTAX_SyntaxFactory_H
<reponame>adityaanjeet/ud839_Miwok-lesson-one /* * Copyright (C) 2016 The Android Open Source Project * * 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 com.example.android.miwok; import android.media.MediaPlayer; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import java.util.ArrayList; public class NumbersActivity extends AppCompatActivity { private MediaPlayer mediaPlayer; private MediaPlayer.OnCompletionListener mCompletionListener = new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mp) { releaseMediaPlayer(); } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_numbers); final ArrayList<Word> words = new ArrayList<>(); words.add(new Word("one", "lutti", R.drawable.number_one, R.raw.number_one)); words.add(new Word("two", "otiiko", R.drawable.number_two, R.raw.number_two)); words.add(new Word("three", "tolookosu", R.drawable.number_three, R.raw.number_three)); words.add(new Word("four", "oyyisa", R.drawable.number_four, R.raw.number_four)); words.add(new Word("five", "massokka", R.drawable.number_five, R.raw.number_five)); words.add(new Word("six", "temmokka", R.drawable.number_six, R.raw.number_six)); words.add(new Word("seven", "kenekaku", R.drawable.number_seven, R.raw.number_seven)); words.add(new Word("eight", "kawinta", R.drawable.number_eight, R.raw.number_eight)); words.add(new Word("nine", "wo’e", R.drawable.number_nine, R.raw.number_nine)); words.add(new Word("ten", "na’aacha", R.drawable.number_ten, R.raw.number_ten)); //Log table used in order to verify the content of the ArrayList words. // Log.v("NumberActivity","Word at index 0: " + words.get(0)); // Log.v("NumberActivity","Word at index 1: " + words.get(1)); // Log.v("NumberActivity","Word at index 2: " + words.get(2)); // Log.v("NumberActivity","Word at index 3: " + words.get(3)); // Log.v("NumberActivity","Word at index 4: " + words.get(4)); // Log.v("NumberActivity","Word at index 5: " + words.get(5)); // Log.v("NumberActivity","Word at index 6: " + words.get(6)); // Log.v("NumberActivity","Word at index 7: " + words.get(7)); // Log.v("NumberActivity","Word at index 8: " + words.get(8)); // Log.v("NumberActivity","Word at index 9: " + words.get(9)); wordAdapter adapter = new wordAdapter(this, words, R.color.category_numbers); ListView listView = (ListView) findViewById(R.id.number_listView); assert listView != null; listView.setAdapter(adapter); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Word word = words.get(position); //relesing previous medi that was playing and in the middle a new media has been asked to play. releaseMediaPlayer(); mediaPlayer = MediaPlayer.create(NumbersActivity.this, word.getAudio()); //start the mediaPlayer mediaPlayer.start(); //releasing the media player when the media has completed the playing media file. mediaPlayer.setOnCompletionListener(mCompletionListener); } }); } //Method to release the media file that was playing from the resource. This is used in order to minimise the memory taken by the app. public void releaseMediaPlayer() { if (mediaPlayer != null) { mediaPlayer.release(); mediaPlayer = null; } } }
/* * 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 com.dmitrievanthony.tree.core.local; import com.dmitrievanthony.tree.core.LeafNode; import com.dmitrievanthony.tree.core.local.criteria.GiniSplitCalculator; import com.dmitrievanthony.tree.core.local.criteria.SplitCalculator; import java.util.HashMap; import java.util.Map; /** * Decision tree classifier based on local decision tree trainer. */ public class LocalDecisionTreeClassifier extends LocalDecisionTree { /** Default split calculator used for classification. */ private static final SplitCalculator defaultSplitCalc = new GiniSplitCalculator(); /** * Constructs a new instance of local decision tree classifier. * * @param maxDeep Max tree deep. * @param minImpurityDecrease Min impurity decrease. */ public LocalDecisionTreeClassifier(int maxDeep, double minImpurityDecrease) { super(defaultSplitCalc, maxDeep, minImpurityDecrease); } /** {@inheritDoc} */ @Override LeafNode createLeafNode(double[] labels) { Map<Double, Integer> cnt = new HashMap<>(); for (double label : labels) { if (cnt.containsKey(label)) cnt.put(label, cnt.get(label) + 1); else cnt.put(label, 1); } double bestVal = 0; int bestCnt = -1; for (Map.Entry<Double, Integer> e : cnt.entrySet()) { if (e.getValue() > bestCnt) { bestCnt = e.getValue(); bestVal = e.getKey(); } } return new LeafNode(bestVal); } }
#!/bin/bash # Copyright (c) 2013 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. if [ -d "$1" ]; then cd "$1" else echo "Usage: $0 <datadir>" >&2 echo "Removes obsolete LitecoinEco database files" >&2 exit 1 fi LEVEL=0 if [ -f wallet.dat -a -f addr.dat -a -f blkindex.dat -a -f blk0001.dat ]; then LEVEL=1; fi if [ -f wallet.dat -a -f peers.dat -a -f blkindex.dat -a -f blk0001.dat ]; then LEVEL=2; fi if [ -f wallet.dat -a -f peers.dat -a -f coins/CURRENT -a -f blktree/CURRENT -a -f blocks/blk00000.dat ]; then LEVEL=3; fi if [ -f wallet.dat -a -f peers.dat -a -f chainstate/CURRENT -a -f blocks/index/CURRENT -a -f blocks/blk00000.dat ]; then LEVEL=4; fi case $LEVEL in 0) echo "Error: no LitecoinEco datadir detected." exit 1 ;; 1) echo "Detected old LitecoinEco datadir (before 0.7)." echo "Nothing to do." exit 0 ;; 2) echo "Detected LitecoinEco 0.7 datadir." ;; 3) echo "Detected LitecoinEco pre-0.8 datadir." ;; 4) echo "Detected LitecoinEco 0.8 datadir." ;; esac FILES="" DIRS="" if [ $LEVEL -ge 3 ]; then FILES=$(echo $FILES blk????.dat blkindex.dat); fi if [ $LEVEL -ge 2 ]; then FILES=$(echo $FILES addr.dat); fi if [ $LEVEL -ge 4 ]; then DIRS=$(echo $DIRS coins blktree); fi for FILE in $FILES; do if [ -f $FILE ]; then echo "Deleting: $FILE" rm -f $FILE fi done for DIR in $DIRS; do if [ -d $DIR ]; then echo "Deleting: $DIR/" rm -rf $DIR fi done echo "Done."
<gh_stars>0 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ic_crop_3_2_outline = void 0; var ic_crop_3_2_outline = { "viewBox": "0 0 24 24", "children": [{ "name": "path", "attribs": { "d": "M0 0h24v24H0V0z", "fill": "none" }, "children": [] }, { "name": "path", "attribs": { "d": "M19 4H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H5V6h14v12z" }, "children": [] }] }; exports.ic_crop_3_2_outline = ic_crop_3_2_outline;
#!/usr/bin/env bash unzip tests/usnjrnl.zip usncarve.py -h usn.py -h usncarve.py -f usnjrnl.bin -o /tmp/usn-carved.bin echo "[ + ] Carve completed" echo "[ + ] Attempting to parse carved records" xxd /tmp/usn-carved.bin usn.py -f /tmp/usn-carved.bin -o /tmp/usn-parsed.txt cat /tmp/usn-parsed.txt rm /tmp/usn-parsed.txt usn.py --csv -f /tmp/usn-carved.bin -o /tmp/usn-parsed.txt cat /tmp/usn-parsed.txt rm /tmp/usn-parsed.txt usn.py --verbose -f /tmp/usn-carved.bin -o /tmp/usn-parsed.txt cat /tmp/usn-parsed.txt rm /tmp/usn-parsed.txt usn.py --tln -f /tmp/usn-carved.bin -o /tmp/usn-parsed.txt cat /tmp/usn-parsed.txt rm /tmp/usn-parsed.txt usn.py --tln --system ThisIsASystemName -f /tmp/usn-carved.bin -o /tmp/usn-parsed.txt cat /tmp/usn-parsed.txt rm /tmp/usn-parsed.txt usn.py --body -f /tmp/usn-carved.bin -o /tmp/usn-parsed.txt cat /tmp/usn-parsed.txt mactime -b /tmp/usn-parsed.txt
#!/bin/bash function abs_path() { SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" done echo "$( cd -P "$( dirname "$SOURCE" )" && pwd )" } BIN=`abs_path` cd $BIN # do backup bash $BIN/hugegraph ${*:1:$(($#-2))}"/hugegraph-backup-`date +%y%m%d%H%M`/" DIR=`eval echo '${'$(($#-2))'}'` NUM=`eval echo '${'$#'}'` # delete redundant backups if needed for i in `ls -lt $DIR | grep -v "total" | grep "hugegraph-backup-" | awk -v awkNum="$NUM" '{if(NR>awkNum){print $9}}'` do rm -fr "$DIR/$i" done
<filename>algorithm/data_structure/jds03-4.js //--- 数组 --- //splice /* let numbers = [1, 3, 54]; numbers.splice(2,0,1,2,3); //第一个参数为操作的索引位置,第二个参数为删除的个数,第三位以后为插入的值 console.log(numbers); */ //concat /* const zero = 0; const positiveNumbers = [1, 2, 3]; const negativeNumbers = [-3, -2, -1]; let numbers = negativeNumbers.concat(zero, positiveNumbers); console.log(numbers); */ //数组的迭代器函数 /* const isEven = x => x % 2 === 0; let numbers = [1, 2, 3, 4, 5]; //every 迭代每个元素直到返回 false console.log(numbers.every(isEven)); //some 会迭代每个元素直到返回 true console.log(numbers.some(isEven)); //forEach //map 返回每个元素的函数处理结果 console.log(numbers.map(isEven)); //filter 只返回使函数为 true 的元素 console.log(numbers.filter(isEven)); //reduce //接受 previousValue, currentValue, index 和 array (后两者可选) //返回一个将被叠加到累加器的值,reduce 方法停止后返回这个累加器 let reduceNumbers = numbers.reduce((previous, current) => previous + current); console.log(reduceNumbers); //ES6 //for...of 迭代数组 for (const n of numbers) { console.log(n % 2 === 0 ? 'even' : 'odd'); } //Array 的 @@iterator 属性,通过 Symbol.iterator 访问 let iterator = numbers[Symbol.iterator](); console.log(iterator.next().value); console.log(iterator.next().value); console.log(iterator.next().value); console.log(iterator.next().value); console.log(iterator.next().value); console.log(iterator.next().value); //undefined iterator = numbers[Symbol.iterator](); for (const n of iterator) { console.log(n); } const arr = [1, 2, 3]; console.log(arr.join('-'));//1-2-3*/ //类型数组 /* let length = 5; let int16 = new Int16Array(length);//16位二进制补码整数 console.log(int16); //Int16Array(5) [ 0, 0, 0, 0, 0 ] let array16 = []; array16.length = length; console.log(array16); //[ <5 empty items> ] for (let i = 0; i < length; i++){ int16[i] = i + 1; } console.log(int16); */ //--- Stack --- //后进先出 LIFO class Stack { constructor() { this.items = []; } //push 添加元素到栈顶,即末尾 push(element) { this.items.push(element); } //从 栈顶(末尾)移除元素 pop() { return this.items.pop(); } //查看栈顶元素 peek() { return this.items[this.items.length - 1]; } //检查栈是否为空 isEmpty() { return this.items.length === 0; } size() { return this.items.length; } //清空 clear() { this.items = []; } } /*const stack = new Stack(); console.log(stack.isEmpty()); stack.push(5); stack.push(8); console.log(stack.peek());//8 stack.push(11); console.log(stack.size());//3 console.log(stack.isEmpty()); stack.pop(); stack.pop(); console.log(stack.size());//1 */ //--- 基于 JS 对象 的 Stack 类 --- /* class Stack { constructor() { this.count = 0; this.items = {}; } push(element) { this.items[this.count] = element; this.count++; } size() { return this.count; } isEmpty() { return this.count === 0; } pop() { if(this.isEmpty()){ return undefined; } this.count--; const result = this.items[this.count]; delete this.items[this.count]; return result; } peek() { if (this.isEmpty()) { return undefined; } return this.items[this.count - 1]; } clear() { this.items = {}; this.count = 0; } toString(){ if(this.isEmpty()){ return ''; } let objString = `${this.items[0]}`; for (let i = 1; i < this.count; i++){ objString = `${objString},${this.items[i]}`; } return objString; } } //保护数据结构内部元素 const stack = new Stack(); console.log(Object.getOwnPropertyNames(stack)); console.log(Object.keys(stack)); console.log(stack.count); */ //Symbol 实现类也不能实现 /* const _items = Symbol('stackItems'); class Stack { constructor(){ this[_items] = []; } }*/ //WeakMap 实现类 /* const items = new WeakMap(); class Stack { constructor(){ items.set(this, []); } push(element){ const s = items.get(this); s.push(element); } pop(){ const s = items.get(this); const r = s.pop(); return r; } } */ //十进制到二进制与栈 /* function decimalToBinary(decNumber) { const remStack = new Stack(); let number = decNumber; let rem; let binaryString = ''; while (number > 0) { rem = Math.floor(number % 2); remStack.push(rem); number = Math.floor(number / 2); } while (!remStack.isEmpty()) { binaryString += remStack.pop().toString(); } return binaryString; } console.log(decimalToBinary(10090)); */ //进制转换算法 function baseConverter(decNumber, base) { const remStack = new Stack(); const digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; let number = decNumber; let rem; let binaryString = ''; if (!(base >= 2 && base <= 36)) { return ''; } while (number > 0) { rem = Math.floor(number % base); remStack.push(rem); number = Math.floor(number / base); } while (!remStack.isEmpty()) { binaryString += digits[remStack.pop()]; } return binaryString; } console.log(baseConverter(10090, 36));
<filename>src/components/Navigation/NavigationItem/NavigationItem.tsx import React from 'react'; import Link from 'next/link'; import Image from 'next/image'; import { useRouter } from 'next/router'; import { Nav } from 'react-bootstrap'; import { MenuItem } from '@types-app/index'; import { asset, getLinkAttributes } from '@utils/index'; import styles from './NavigationItem.module.scss'; type Props = { item: MenuItem; }; const NavigationItem: React.FC<Props> = ({ item }) => { const { asPath } = useRouter(); const { title, link, id, icon } = item; const getClassNames = () => { const classes = ''; if (asPath === link) { classes.concat(' ', 'nav-link--active'); } return classes.concat(' ', icon ? styles.navLinkIcon : styles.navLinkText); }; return ( <Nav.Item key={id}> {link === '<nolink>' ? ( <span className={'nav-link'}>{title}</span> ) : ( <Link href={link} passHref> <Nav.Link title={title} {...getLinkAttributes(link)} className={getClassNames()} > {icon ? ( <Image alt={`${title}`} width={icon.width} height={icon.height} src={asset(icon.url)} /> ) : null} {title ? <span className={'nav-item-text'}>{title}</span> : null} </Nav.Link> </Link> )} </Nav.Item> ); }; export default NavigationItem;
package csulb.cecs343.lair; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class CurrentFolderLevel { public static String level = "1"; public static List<String> levelLog = new ArrayList<>(Arrays.asList("1")); }
#!/bin/sh # Step 1. Remove pre-existing artifacts and set up PACKAGING_DIR="${SRCROOT}/../../../Packaging" RELEASE_DIR="${PACKAGING_DIR}/${PROJECT_NAME}" TEMP_BUILD_DIR="${RELEASE_DIR}/build" if [ -d "${RELEASE_DIR}" ]; then rm -rf "${RELEASE_DIR}" fi mkdir -p "${RELEASE_DIR}" IPHONE="iphone" OS="os" SIMULATOR="simulator" UNIVERSAL="universal" IPHONE_DIR="${TEMP_BUILD_DIR}/${CONFIGURATION}-${IPHONE}${OS}" SIMULATOR_DIR="${TEMP_BUILD_DIR}/${CONFIGURATION}-${IPHONE}${SIMULATOR}" UNIVERSAL_DIR="${TEMP_BUILD_DIR}/${CONFIGURATION}-${UNIVERSAL}" IPHONE_NAME="${PROJECT_NAME}-iOS" SIMULATOR_NAME="${PROJECT_NAME}-iOS-${SIMULATOR}" UNIVERSAL_NAME="${PROJECT_NAME}-iOS-${UNIVERSAL}" # Step 2. Build Device and Simulator versions xcodebuild -project "${PROJECT_NAME}".xcodeproj -scheme "${PROJECT_NAME}" -configuration "${CONFIGURATION}" -sdk "${IPHONE}${OS}" ONLY_ACTIVE_ARCH=NO clean BUILD_DIR="${TEMP_BUILD_DIR}" archive -UseModernBuildSystem=NO xcodebuild -project "${PROJECT_NAME}".xcodeproj -scheme "${PROJECT_NAME}" -configuration "${CONFIGURATION}" -sdk "${IPHONE}${SIMULATOR}" ONLY_ACTIVE_ARCH=NO clean BUILD_DIR="${TEMP_BUILD_DIR}" build -UseModernBuildSystem=NO # Step 3. Prepare universal folder for creation of universal executable via lipo # a) Grab framework file instead of symlink cp -L -R "${IPHONE_DIR}/${PROJECT_NAME}.framework" "${RELEASE_DIR}" rm "${IPHONE_DIR}/${PROJECT_NAME}.framework" mv "${RELEASE_DIR}/${PROJECT_NAME}.framework" "${IPHONE_DIR}" # b) Copy the framework structure (from iphoneos build) to the universal folder cp -R "${IPHONE_DIR}/" "${UNIVERSAL_DIR}" # c) Remove iphoneos executable to ensure universal zip will contain universal executable rm "${UNIVERSAL_DIR}/${PROJECT_NAME}.framework/${PROJECT_NAME}" # d) Copy the Swift modules (from iphonesimulator build) to the universal folder if [ -d "${SIMULATOR_DIR}/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule" ]; then cp -R "${SIMULATOR_DIR}/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule/." "${UNIVERSAL_DIR}/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule" fi # Step 4. Create universal binary file using lipo and place the combined executable in the copied framework directory lipo -create -output "${BUILT_PRODUCTS_DIR}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${SIMULATOR_DIR}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${IPHONE_DIR}/${PROJECT_NAME}.framework/${PROJECT_NAME}" cp "${BUILT_PRODUCTS_DIR}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${UNIVERSAL_DIR}/${PROJECT_NAME}.framework/${PROJECT_NAME}" # Step 5. Move outputs mv "${IPHONE_DIR}" "${TEMP_BUILD_DIR}/${IPHONE_NAME}" mv "${SIMULATOR_DIR}" "${TEMP_BUILD_DIR}/${SIMULATOR_NAME}" mv "${UNIVERSAL_DIR}" "${TEMP_BUILD_DIR}/${UNIVERSAL_NAME}" cp "${PACKAGING_DIR}/LICENSE.md" "${TEMP_BUILD_DIR}/${IPHONE_NAME}/LICENSE.md" cp "${PACKAGING_DIR}/LICENSE.md" "${TEMP_BUILD_DIR}/${SIMULATOR_NAME}/LICENSE.md" cp "${PACKAGING_DIR}/LICENSE.md" "${TEMP_BUILD_DIR}/${UNIVERSAL_NAME}/LICENSE.md" # Step 6. Copy universal framework to project directory (for linking by other projects) if [ -d "${SRCROOT}/universal-build" ]; then rm -rf "${SRCROOT}/universal-build" fi mkdir "${SRCROOT}/universal-build" cp -R "${TEMP_BUILD_DIR}/${UNIVERSAL_NAME}/${PROJECT_NAME}.framework" "${SRCROOT}/universal-build" # Step 7. Clean up and zip cd "${TEMP_BUILD_DIR}" zip -rm "${RELEASE_DIR}/${IPHONE_NAME}.zip" "${IPHONE_NAME}" zip -rm "${RELEASE_DIR}/${SIMULATOR_NAME}.zip" "${SIMULATOR_NAME}" zip -rm "${RELEASE_DIR}/${UNIVERSAL_NAME}.zip" "${UNIVERSAL_NAME}" # Step 8. Open packaging directory rm -rf "${TEMP_BUILD_DIR}"
#!/bin/bash ######## # Help # ######## if [[ $1 = "--help" || -z "$1" ]] ; then echo "screensaver --help" echo "usage: screensaver [options] idle-time" echo "" echo "Lightweight screensaver for Ubuntu" echo "" echo "options:" echo " --v, --version print the version" echo " --help print this output" echo " --debug enable debug mode that will print additional messages in stdout" echo "" echo "idle-time" echo " The time in milliseconds when the computer is considered to be idle." echo "" echo "Documentation can be found at https://github.com/IonicaBizau/screensaver" exit fi idle=false idleAfter=$1 brightnessValue=`xbacklight -get` ######### # Debug # ######### if [[ $idleAfter = "--debug" ]] ; then echo "[$(date +"%m-%d-%y-%T")] Debug mode enabled" idleAfter=$2 fi while true; do idleTimeMillis=$(./getIdle) if [[ $idleTimeMillis -gt $idleAfter && $idle = false ]] ; then kill "$fadeInPID" brightnessValue=`xbacklight -get` xbacklight -set 0 -time 4000 -steps 500 & fadeOutPID=$! idle=true fi if [[ $idleTimeMillis -lt $idleAfter && $idle = true ]] ; then kill "$fadeOutPID" echo "Fade in to $brightnessValue" xbacklight -set $brightnessValue -time 300 -steps 100 & fadeInPID=$! idle=false fi sleep 0.1 done
#!/bin/sh xrandr --output DVI-D-0 --off --output HDMI-1 --off --output HDMI-0 --mode 1920x1080 --pos 4480x360 --rotate normal --output DP-3 --off --output DP-2 --primary --mode 2560x1440 --pos 1920x0 --rotate normal --output DP-1 --mode 1920x1080 --pos 0x360 --rotate normal --output DP-0 --off
package br.usp.poli.lta.nlpdep.mwirth2ape.labeling; import br.usp.poli.lta.nlpdep.mwirth2ape.model.Token; import java.util.LinkedList; public class ProductionToken extends Token { private NTerm nterm; private LinkedList<LabelElement> labels; private LinkedList<LabelElement> preLabels; private LinkedList<LabelElement> postLabels; public ProductionToken(Token token) { setType(token.getType()); setValue(token.getValue()); this.preLabels = new LinkedList<>(); this.postLabels = new LinkedList<>(); } public ProductionToken(String type, String value) { setType(type); setValue(value); this.preLabels = new LinkedList<>(); this.postLabels = new LinkedList<>(); } public NTerm getNterm() { return nterm; } public void setNterm(NTerm nterm) { this.nterm = nterm; } public LinkedList<LabelElement> getLabels() { return labels; } public void setLabels(LinkedList<LabelElement> labels) { this.labels = labels; } public void pushLabel(String label) { if (this.labels == null) { this.labels = new LinkedList<>(); } LabelElement newLabelElement = new LabelElement(); newLabelElement.setValue(label); //newLabelElement.setProduction(null); this.labels.push(newLabelElement); } public void pushLabel(String label, Production production) { if (this.labels == null) { this.labels = new LinkedList<>(); } LabelElement newLabelElement = new LabelElement(); newLabelElement.setValue(label); newLabelElement.setProduction(production); this.labels.push(newLabelElement); } ///// public LinkedList<LabelElement> getPostLabels() { return postLabels; } public void setPostLabels(LinkedList<LabelElement> newPostLabels) { if (newPostLabels != null) { if (this.postLabels == null) { this.postLabels = new LinkedList<>(); } this.postLabels = newPostLabels; } } public void pushPostLabels(LinkedList<LabelElement> newPostLabels) { if (newPostLabels != null) { if (this.postLabels == null) { this.postLabels = new LinkedList<>(); } LinkedList<LabelElement> addPostLabels = (LinkedList<LabelElement>) newPostLabels.clone(); addPostLabels.addAll(this.postLabels); this.postLabels = addPostLabels; } } public void addPostLabels(LinkedList<LabelElement> newPostLabels) { if (newPostLabels != null) { if (this.postLabels == null) { this.postLabels = new LinkedList<>(); } LinkedList<LabelElement> addPostLabels = (LinkedList<LabelElement>) newPostLabels.clone(); this.postLabels.addAll(addPostLabels); } } ///// public LinkedList<LabelElement> getPreLabels() { return preLabels; } public void setPreLabels(LinkedList<LabelElement> newPreLabels) { if (newPreLabels != null) { if (this.preLabels == null) { this.preLabels = new LinkedList<>(); } this.preLabels = newPreLabels; } } public void pushPreLabels(LinkedList<LabelElement> newPreLabels) { if (newPreLabels != null) { if (this.preLabels == null) { this.preLabels = new LinkedList<>(); } LinkedList<LabelElement> addPreLabels = (LinkedList<LabelElement>) newPreLabels.clone(); addPreLabels.addAll(this.preLabels); this.preLabels = addPreLabels; } } public void addPreLabels(LinkedList<LabelElement> newPreLabels) { if (newPreLabels != null) { if (this.preLabels == null) { this.preLabels = new LinkedList<>(); } LinkedList<LabelElement> addPreLabels = (LinkedList<LabelElement>) newPreLabels.clone(); this.preLabels.addAll(addPreLabels); } } @Override public String toString() { return "ProductionToken{" + "nterm=" + nterm + ", labels=" + labels + ", preLabels=" + preLabels + ", postLabels=" + postLabels + '}'; } }
<gh_stars>0 #include <errno.h> #include <string.h> #include "double_private.h" void double_array_fprint( FILE * out, int n, const double * a, const char * format) { int i; for (i = 0; i < DOUBLE_ARRAY_FPRINT_FORMAT_TOTAL; ++i) if (!strcmp(format, double_array_fprint_format[i])) { double_array_fprint_function[i](out, n, a); if (errno) { perror("double_array_fprint - printing failed"); return; } return; } errno = EINVAL; fprintf(stderr, "double_array_fprint - format %s is not supported: %s\n", format, strerror(errno)); }
<filename>srclibs/game/src/scriptloader.cpp #include "scriptloader.h" #include <filesystem> #include <iostream> namespace fs = std::filesystem; std::string ScriptLoader::nilscript; ScriptLoader::ScriptLoader() {} ScriptLoader::~ScriptLoader() {} bool ScriptLoader::loadScript(const std::string& path) { std::ifstream file(path, std::ios::in | std::ios::binary); if(!file.is_open() || file.bad()) return false; std::string data; std::streamsize read; do { char chunk[1024]; read = file.readsome(chunk, sizeof(chunk)); if(read) data.append(chunk, read); } while(read != 0); std::string name = fs::path(path).filename().string(); rawfiles.insert_or_assign(name, std::move(data)); return true; }
(function(){ "use strict"; angular.module("myApp").value("Config", { getUrl: "http://apprepublicaja.esy.es/apirepublicaja/v1/" }); angular.module("myApp").service("Data",function($http, Config){ //Recupera os anuncios this.getData = function(params){ return $http({ method: "POST", url: Config.getUrl + "recuperaAnuncios.php", data: params, headers:{ 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8' } }); }; //Login this.loginData = function(credential){ return $http({ method: "POST", url: Config.getUrl + "apiLogin.php", data: credential, headers:{ 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8' } }); }; //Cadastro de Usuarios this.setData = function(dados){ return $http({ method: "POST", url: Config.getUrl + "cadastroUsuario.php", data: dados, headers:{ 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8' } }); }; //Deleta anúncio this.delData = function(idanuncio){ return $http({ method: "POST", url: Config.getUrl + "deletaAnuncio.php", data: idanuncio, headers:{ 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8' } }); }; //Anuncia República this.setAnuncio = function(dadosAnuncio){ return $http({ method: "POST", url: Config.getUrl + "anunciaRep.php", data: dadosAnuncio, headers:{ 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8' } }); }; //Atualiza Cadastro this.setUpdate = function(usuario){ return $http({ method: "POST", url: Config.getUrl + "atualizaCadastro.php", data: usuario, headers:{ 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8' } }); }; }); })();
<filename>db/DB_Languages.js require( "dotenv" ).config(); const { CockroachDB, DataTypes, Op } = require( "./CockroachDB" ); const utils = require( "../utils/useful" ); class DB extends CockroachDB { constructor() { super( { "alpha2": DataTypes.STRING, "English": DataTypes.STRING, }, "LangCodes" ); } async initialize() { await this.sync(); // Sync the DB await this.deleteAll(); // Clear everything // --- Load via CSV data --- await this.loadCSV( "data/languagecodes.csv" ); } async test() { // await this.remove({ // "alpha2": "ie" // }); await this.update({ "English": "English (Updated)" }, { "alpha2": "en" }); return await this.data( { // Use Op.iLike instead of Op.like for case-insensitive search "English": { [Op.iLike]: "%en%" } }); } } module.exports = { DB };
import tensorflow as tf from tensorflow.keras import models, layers # Inputs player1_win_loss = layers.Input(shape=(1,)) player1_aces = layers.Input(shape=(1,)) player1_first_serve_percentage = layers.Input(shape=(1,)) player1_second_serve_percentage = layers.Input(shape=(1,)) player1_unforced_errors = layers.Input(shape=(1,)) player2_win_loss = layers.Input(shape=(1,)) player2_aces = layers.Input(shape=(1,)) player2_first_serve_percentage = layers.Input(shape=(1,)) player2_second_serve_percentage = layers.Input(shape=(1,)) player2_unforced_errors = layers.Input(shape=(1,)) # Model Architecture inputs = [player1_win_loss, player1_aces, player1_first_serve_percentage, player1_second_serve_percentage, player1_unforced_errors, player2_win_loss, player2_aces, player2_first_serve_percentage, player2_second_serve_percentage, player2_unforced_errors] concatenated = layers.Concatenate()(inputs) dense1 = layers.Dense(64, activation='relu')(concatenated) dense2 = layers.Dense(64, activation='relu')(dense1) outputs = layers.Dense(1, activation='sigmoid')(dense2) # Build the model model = models.Model(inputs=inputs, outputs=outputs) model.compile(optimizer='Adam', loss='binary_crossentropy', metrics=['accuracy']) # Training model.fit([player1_win_loss, player1_aces, player1_first_serve_percentage, player1_second_serve_percentage, player1_unforced_errors, player2_win_loss, player2_aces, player2_first_serve_percentage, player2_second_serve_percentage, player2_unforced_errors], labels, epochs=10) # Prediction player1_stats = [0.76, 15, 75, 70, 25] player2_stats = [0.54, 10, 60, 65, 32] prediction = model.predict([player1_stats, player2_stats]) print('The probability of Player 1 winning is: ', prediction)
const defines = require('./defines'); const yuri2 = require('yuri2js'); const work = function (opt) { const app = opt.app; //适合子进程的一些函数 global.yuri2web||(global.yuri2web = { _online: 0, _requested: 0, _creatAt:new Date(), log(...data){ app.log(...data); }, getId(){ return app.workerId; }, cpState() { return yuri2.jsonMerge(process.memoryUsage(), { pid: process.pid, online: this._online, requested: this._requested, state: this.stateHandle(), logs: app.getLogs(), createAt:this._creatAt.getTime(), }) }, stateHandle(){ return "undefined"; }, cpSend(sign){ //接收sign命令 this.commandHandle(sign); }, commandHandle(){ return "undefined"; }, kill() { const that=this; this.paused = true; //安全关闭 setInterval(function () { if (that._online <= 0) { process.exit(0) } }, 200); //30秒强制关闭 setTimeout(function () { process.exit(0); }, 30000) }, visit(){ this._requested++; this._online++; }, leave(){ this._online--; }, }); if (opt.isSub) { //主进程发送启动命令 process.on('message', function (m, fd) { switch (m.type) { case defines.TYPE_MSG_LISTEN: { opt.work(fd,global.yuri2web); !m.feedback || process.send({type: defines.TYPE_MSG_HANDLE_BACKUP_REL}, fd); opt.app.log(`listening...`); break; } } }); process.on('uncaughtException', function (err) { yuri2web.log(err); setTimeout(function () { process.exit(1); }, 3000) }); } }; module.exports = work;
def generate_xctool_command(platform, build_type): if platform == "iPhoneOS": if build_type == "library": return 'xctool -project build-mac/mailcore2.xcodeproj -sdk iphoneos7.1 -scheme "static mailcore2 ios" build ARCHS="armv7 armv7s arm64"' elif build_type == "test": return '#echo Link test for iPhoneOS\nxcodebuild -project build-mac/mailcore2.xcodeproj -sdk iphoneos7.1 -target "test-ios" CODE_SIGN_IDENTITY="" build' elif platform == "iPhoneSimulator": if build_type == "library": return 'xctool -project build-mac/mailcore2.xcodeproj -sdk iphonesimulator7.1 -scheme "static mailcore2 ios" build ARCHS="i386 x86_64"' elif build_type == "test": return 'xctool -project build-mac/mailcore2.xcodeproj -sdk iphonesimulator7.1 -scheme "test-ios" build ARCHS="i386 x86_64"' elif platform == "Mac": if build_type == "library": return 'xctool -project build-mac/mailcore2.xcodeproj -sdk macosx10.8 -scheme "static mailcore2 osx" build' elif build_type == "framework": return 'xctool -project build-mac/mailcore2.xcodeproj -sdk macosx10.8 -scheme "mailcore osx" build' elif build_type == "test": return 'xctool -project build-mac/mailcore2.xcodeproj -sdk macosx10.8 -scheme "tests" build' return "Invalid platform or build type"
<?php // Connect to database $db = mysqli_connect('localhost', 'username','password','employee'); // Store employee information $name = $_POST['name']; $age = $_POST['age']; // Create SQL query $sql = "INSERT INTO employee (name, age) VALUES ('$name', '$age')"; // Execute query if (mysqli_query($db, $sql)) { echo "New employee added successfully!"; }else{ echo "Error: ". $sql . "<br>" . mysqli_error($db); } // Close connection mysqli_close($db); ?>
#!/bin/bash python3 alphazero.py --budget=1000000 --stochastic --parallel --game=RaceStrategy --gamma=0.99 --max_ep_len=55 --eval_freq=1 --c=2.2 --n_ep=1 --eval_episodes=10 --n_mcts=50 --mcts_only --n_experiments=1 --unbiased --budget_scheduler --slope=2.9 --max_workers=10 --min_budget=30
package org.moskito.control.connectors.parsers; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import net.anotheria.moskito.core.threshold.ThresholdStatus; import org.moskito.control.connectors.response.*; import org.moskito.control.common.HealthColor; import org.moskito.control.common.AccumulatorDataItem; import org.moskito.control.common.Status; import org.moskito.control.common.ThresholdDataItem; import org.moskito.controlagent.data.nowrunning.EntryPoint; import java.util.*; /** * JSON Connector Response parser. Supports version1 of the protocol. * * @author lrosenberg * @since 15.06.13 12:39 */ public class V1Parser implements ConnectorResponseParser{ @Override public ConnectorStatusResponse parseStatusResponse(Map serverReply) { Map reply = (Map) serverReply.get("reply"); Status status = new Status(); status.setHealth(HealthColor.valueOf((String)reply.get("status"))); List thresholds = (List)reply.get("thresholds"); for (Object t : thresholds){ Map messageMap = (Map)t; String message = messageMap.get("threshold")+": "+messageMap.get("value"); status.addMessage(message); } return new ConnectorStatusResponse(status); } @Override public ConnectorAccumulatorResponse parseAccumulatorResponse(Map serverReply) { ConnectorAccumulatorResponse ret = new ConnectorAccumulatorResponse(); Map reply = (Map) serverReply.get("reply"); Collection values = reply.values(); for (Object replyValue : values){ Map mapForKey = (Map)replyValue; String name = (String)mapForKey.get("name"); List<Map> items = (List)mapForKey.get("items"); ArrayList<AccumulatorDataItem> parsedItems = new ArrayList<AccumulatorDataItem>(); for (Map m : items){ AccumulatorDataItem item = new AccumulatorDataItem(((Double)m.get("timestamp")).longValue(), (String)m.get("value")); parsedItems.add(item); } ret.addDataLine(name, parsedItems); } return ret; } @Override public ConnectorThresholdsResponse parseThresholdsResponse(Map serverReply) { List<ThresholdDataItem> items = new LinkedList<ThresholdDataItem>(); List<Map> thresholdsReply = (List<Map>) serverReply.get("reply"); for (Map replyItem : thresholdsReply) { ThresholdDataItem item = new ThresholdDataItem(); item.setName((String) replyItem.get("name")); try{ item.setStatus(HealthColor.getHealthColor(ThresholdStatus.valueOf((String) replyItem.get("status")))); }catch(NullPointerException e){ //this exception means that the transmitted status was null item.setStatus(HealthColor.NONE); } item.setLastValue((String) replyItem.get("lastValue")); item.setStatusChangeTimestamp(((Double) replyItem.get("statusChangeTimestamp")).longValue()); items.add(item); } return new ConnectorThresholdsResponse(items); } @Override public ConnectorNowRunningResponse parseNowRunningResponse(Map serverReply) { Gson gson = new GsonBuilder().create(); List<Map> entryPointsAsMap = (List<Map>) serverReply.get("reply"); List<EntryPoint> ret = new LinkedList<>(); for (Map entryPointAsMap : entryPointsAsMap){ ret.add(gson.fromJson(gson.toJson(entryPointAsMap), EntryPoint.class )); } return new ConnectorNowRunningResponse(ret); } @Override public ConnectorAccumulatorsNamesResponse parseAccumulatorsNamesResponse(Map serverReply) { List<String> names = new ArrayList<String>(); List<Map> reply = (List) serverReply.get("reply"); for (Map replyItem : reply) { names.add((String)replyItem.get("name")); } return new ConnectorAccumulatorsNamesResponse(names); } /** * Used to get some value from server reply * map. Casts it to String. * * @param map reply map * @param key key to get value * @param type value type. Casting of value depends on it type * @return string representation of value from map or "value not present" string if * entry with such key not contains in reply map */ private String safeGetReplyMapValue(Map map, Object key, ResponseValueType type){ Object value = map.get(key); if(value == null) return "value not present"; switch (type) { case TYPE_LONG: // gson always parses numbers as double // so it be good to remove fractional part from number // if it need to be long return String.valueOf(((Double) value).longValue()); case TYPE_DOUBLE: case TYPE_STRING: default: return String.valueOf(value); } } @Override public ConnectorInformationResponse parseInformationResponse(Map serverResponse) { Map<String, String> infoMap = new HashMap<>(); ConnectorInformationResponse response = new ConnectorInformationResponse(); Map reply = (Map) serverResponse.get("reply"); infoMap.put("JVM Version", safeGetReplyMapValue(reply, "javaVersion", ResponseValueType.TYPE_STRING) ); infoMap.put("PID", safeGetReplyMapValue(reply, "pid", ResponseValueType.TYPE_LONG) ); infoMap.put("Start Command", safeGetReplyMapValue(reply, "startCommand", ResponseValueType.TYPE_STRING) ); infoMap.put("Machine Name", safeGetReplyMapValue(reply, "machineName", ResponseValueType.TYPE_STRING) ); infoMap.put("Uptime", safeGetReplyMapValue(reply, "uptime", ResponseValueType.TYPE_LONG) ); infoMap.put("Uphours", safeGetReplyMapValue(reply, "uphours", ResponseValueType.TYPE_DOUBLE) ); infoMap.put("Updays", safeGetReplyMapValue(reply, "updays", ResponseValueType.TYPE_DOUBLE) ); response.setInfo(infoMap); return response; } @Override public ConnectorConfigResponse parseConfigResponse(Map serverReply) { Map reply = (Map) serverReply.get("reply"); Gson gson = new GsonBuilder().setPrettyPrinting().create(); String config = gson.toJson(reply); ConnectorConfigResponse response = new ConnectorConfigResponse(); response.setConfig(config); return response; } private enum ResponseValueType { TYPE_LONG, TYPE_DOUBLE, TYPE_STRING } }
SELECT * FROM items WHERE date_added >= CURDATE();
import React, { useState } from "react"; import CustomButton from "../../../CustomButton"; import tradeApiClient from "services/tradeApiClient"; import useSelectedExchange from "hooks/useSelectedExchange"; import { showErrorAlert, showSuccessAlert } from "store/actions/ui"; import { useDispatch } from "react-redux"; import { useIntl, FormattedMessage } from "react-intl"; import { Tabs, Tab, Box, OutlinedInput, Typography, InputAdornment, CircularProgress, } from "@material-ui/core"; import { useForm } from "react-hook-form"; import "./MarginModal.scss"; import { formatNumber } from "utils/formatters"; import useBalance from "hooks/useBalance"; /** * @typedef {Object} MarginModalProps * @property {Position} position * @property {function} onClose */ /** * Display modal to adjust position margin. * * @param {MarginModalProps} props Component properties. * @returns {JSX.Element} JSX. */ const MarginModal = ({ position, onClose }) => { const [mode, setMode] = useState("ADD"); const [loading, setLoading] = useState(false); const dispatch = useDispatch(); const selectedExchange = useSelectedExchange(); const intl = useIntl(); const { register, handleSubmit, errors } = useForm(); const { balance, balanceLoading } = useBalance(selectedExchange.internalId); const maxRemoveableMargin = position.margin - (position.positionSizeQuote + position.unrealizedProfitLosses + position.profit); /** * @param {React.ChangeEvent} event . * @param {string} newValue . * @returns {void} */ const handleModeChange = (event, newValue) => { setMode(newValue); }; /** * @typedef {Object} FormData * @prop {string} amount */ /** * @param {FormData} data . * @returns {void} */ const onSubmit = (data) => { const { amount } = data; const payload = { internalExchangeId: selectedExchange.internalId, positionId: position.positionId, amount: parseFloat(amount) * (mode === "ADD" ? 1 : -1), }; setLoading(true); tradeApiClient .transferMargin(payload) .then(() => { dispatch(showSuccessAlert("", intl.formatMessage({ id: "margin.success" }))); onClose(); }) .catch((e) => { dispatch(showErrorAlert(e)); }) .finally(() => { setLoading(false); }); }; return ( <form className="marginModal" onSubmit={handleSubmit(onSubmit)}> <Tabs aria-label="Margin Tabs" className="tabs" classes={{ flexContainer: "marginTabsContainer" }} onChange={handleModeChange} value={mode} > <Tab classes={{ selected: "selected" }} label={intl.formatMessage({ id: "margin.add" })} value="ADD" /> <Tab classes={{ selected: "selected" }} label={intl.formatMessage({ id: "margin.remove" })} value="REMOVE" /> </Tabs> {balanceLoading && ( <Box alignItems="center" className="loadingBox" display="flex" flexDirection="row" justifyContent="center" > <CircularProgress color="primary" size={35} /> </Box> )} {!balanceLoading && ( <Box className="marginBox"> <Box className="amountInput" display="flex" flexDirection="row"> <OutlinedInput className="customInput" endAdornment={<InputAdornment position="end">XBT</InputAdornment>} error={Boolean(errors.amount)} inputProps={{ min: 0, step: "any", }} inputRef={register({ validate: (value) => !isNaN(value) && parseFloat(value) >= 0 && parseFloat(value) < balance.totalAvailableBTC, })} // doesn't work with mui for some reason? // inputRef={register({ // required: true, // min: 0, // max: balance.totalAvailableBTC, // })} name="amount" placeholder={intl.formatMessage({ id: "withdraw.amount" })} type="number" /> </Box> <Box className="line" display="flex" justifyContent="center"> <Typography className="callout1"> <FormattedMessage id="margin.current" />: {formatNumber(position.margin)} XBT </Typography> </Box> <Box className="line" display="flex" justifyContent="center"> {mode === "ADD" ? ( <Typography className="callout1"> <FormattedMessage id="deposit.available" />:{" "} {formatNumber(balance.totalAvailableBTC)} XBT </Typography> ) : ( <Typography className="callout1"> <FormattedMessage id="margin.maxremoveable" />:{" "} {formatNumber(maxRemoveableMargin <= 0 ? 0 : maxRemoveableMargin)} XBT </Typography> )} </Box> </Box> )} <CustomButton className="submitButton" disabled={balanceLoading || loading || (mode === "REMOVE" && maxRemoveableMargin <= 0)} loading={loading} type="submit" > <FormattedMessage id="confirm.accept" /> </CustomButton> </form> ); }; export default MarginModal;
// Based on code originally written by <NAME> in the public domain, // https://web.archive.org/web/20070212102708/http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_avl.aspx package avltree import ( "sync" "github.com/johan-bolmsjo/gods/v2/list" "github.com/johan-bolmsjo/gods/v2/math" ) // Maximum tree height supported by a tree. // This is a *large* tree, larger than reasonable. const maxTreeHeight = 48 /****************************************************************************** * Tree *****************************************************************************/ // Tree is an AVL tree. type Tree[K, V any] struct { root *node[K, V] length int nodePool *nodePool[K, V] compareKeys math.Comparator[K] iters list.Node[*Iterator[K, V]] } // New creates an AVL tree using the supplied compare function and tree options. // Avoid using pointer keys that are dereferenced by the compare function as // modifying such keys outside of the tree invalidates the ordering invariant of // the tree. func New[K, V any](compareKeys math.Comparator[K], options ...TreeOption[K, V]) *Tree[K, V] { tree := &Tree[K, V]{ compareKeys: compareKeys, } for _, option := range options { option(tree) } tree.iters.InitLinks() return tree } // Add association between key and value to the tree. Any existing association // for key is overwritten with key and value. func (tree *Tree[K, V]) Add(key K, value V) { // Empty tree case if tree.root == nil { tree.root = tree.nodePool.get() tree.root.key = key tree.root.value = value tree.length++ return } // Set up false tree root to ease maintenance var head node[K, V] t := &head t.link[directionRight] = tree.root var dir direction var s *node[K, V] // Place to rebalance and parent var p, q *node[K, V] // Iterator and save pointer // Search down the tree, saving rebalance points for s, p = t.link[directionRight], t.link[directionRight]; ; p = q { cmp := tree.compareKeys(p.key, key) if cmp == 0 { // Update association p.key, p.value = key, value return } dir = directionOfBool(cmp < 0) if q = p.link[dir]; q == nil { break } if q.balance != 0 { t = p s = q } } q = tree.nodePool.get() q.key, q.value = key, value p.link[dir] = q // Update balance factors for p = s; p != q; p = p.link[dir] { dir = directionOfBool(tree.compareKeys(p.key, key) < 0) p.balance += dir.balance() } q = s // Save rebalance point for parent fix // Rebalance if necessary if math.AbsSigned(s.balance) > 1 { dir = directionOfBool(tree.compareKeys(s.key, key) < 0) s = s.insertBalance(dir) } // Fix parent if q == head.link[directionRight] { tree.root = s } else { t.link[directionOfBool(q == t.link[directionRight])] = s } // Mark all iterators for path update for e := tree.iters.Next(); e != &tree.iters; e = e.Next() { iter := e.Value iter.update = true } tree.length++ } // Remove any association with key from tree. func (tree *Tree[K, V]) Remove(key K) { if tree.root == nil { return } curr := tree.root var up [maxTreeHeight]*node[K, V] var upd [maxTreeHeight]direction var top int // Search down tree and save path for { if curr == nil { return } cmp := tree.compareKeys(curr.key, key) if cmp == 0 { break } // Push direction and node onto stack upd[top] = directionOfBool(cmp < 0) up[top] = curr top++ curr = curr.link[upd[top-1]] } // Remove the node if curr.link[directionLeft] == nil || curr.link[directionRight] == nil { // Which child is non-nil? dir := directionOfBool(curr.link[directionLeft] == nil) // Fix parent if top != 0 { up[top-1].link[upd[top-1]] = curr.link[dir] } else { tree.root = curr.link[dir] } } else { // Find the inorder successor heir := curr.link[directionRight] // Save this path too upd[top] = directionRight up[top] = curr top++ for heir.link[directionLeft] != nil { upd[top] = directionLeft up[top] = heir top++ heir = heir.link[directionLeft] } // Swap associations tmpKey, tmpValue := curr.key, curr.value curr.key, curr.value = heir.key, heir.value heir.key, heir.value = tmpKey, tmpValue // Unlink successor and fix parent up[top-1].link[directionOfBool(up[top-1] == curr)] = heir.link[directionRight] curr = heir } // Walk back up the search path var done bool for top--; top >= 0 && !done; top-- { // Update balance factors up[top].balance += upd[top].inverseBalance() // Terminate or rebalance as necessary if math.AbsSigned(up[top].balance) == 1 { break } else if math.AbsSigned(up[top].balance) > 1 { up[top], done = up[top].removeBalance(upd[top]) // Fix parent if top != 0 { up[top-1].link[upd[top-1]] = up[top] } else { tree.root = up[0] } } } // Update iterators for e := tree.iters.Next(); e != &tree.iters; e = e.Next() { iter := e.Value // All iterators need their path updated iter.update = true // Iterators positioned on the removed node need update performed now if iter.curr == curr { iter.update = false if !iter.buildPathNext() { // This one fell of the edge e = e.Prev() iter.Close() } } } tree.nodePool.put(curr, nil) tree.length-- } // Clear removes all associations from the tree and invalidates all iterators. A // non-nil release function is called on each association in the tree. The // release function must not fail. Remove each association by itself (for // example by using an iterator) if it can fail and handle errors properly. func (tree *Tree[K, V]) Clear(release func(K, V)) { curr := tree.root // Destruction by rotation for curr != nil { var save *node[K, V] if curr.link[directionLeft] == nil { // Remove node save = curr.link[directionRight] tree.nodePool.put(curr, release) } else { // Rotate right save = curr.link[directionLeft] curr.link[directionLeft] = save.link[directionRight] save.link[directionRight] = curr } curr = save } tree.root = nil tree.length = 0 for tree.iters.IsLinked() { tree.iters.Next().Value.Close() } } // Length returns the number of associations in the tree. func (tree *Tree[K, V]) Length() int { return tree.length } // Find value associated with key. Returns the found value and true or the zero // value of V and false if no assocation was found. func (tree *Tree[K, V]) Find(key K) (V, bool) { curr := tree.root for curr != nil { cmp := tree.compareKeys(curr.key, key) if cmp == 0 { break } curr = curr.link[directionOfBool(cmp < 0)] } if curr != nil { return curr.value, true } return zeroValue[V]() } // FindEqualOrLesser returns the association that match key or the association // with the immediately lesser key and true. The zero values of K and V and // false is returned if no assocation was found. func (tree *Tree[K, V]) FindEqualOrLesser(key K) (K, V, bool) { var lesser *node[K, V] curr := tree.root for curr != nil { cmp := tree.compareKeys(curr.key, key) if cmp == 0 { break } if cmp < 0 { lesser = curr } curr = curr.link[directionOfBool(cmp < 0)] } if curr != nil { return curr.key, curr.value, true } else if lesser != nil { return lesser.key, lesser.value, true } return zeroAssoc[K, V]() } // FindEqualOrGreater returns the association that match key or the immediately // greater association and true. The zero values of K and V and false is // returned if no assocation was found. func (tree *Tree[K, V]) FindEqualOrGreater(key K) (K, V, bool) { var greater *node[K, V] curr := tree.root for curr != nil { cmp := tree.compareKeys(curr.key, key) if cmp == 0 { break } if cmp > 0 { greater = curr } curr = curr.link[directionOfBool(cmp < 0)] } if curr != nil { return curr.key, curr.value, true } else if greater != nil { return greater.key, greater.value, true } return zeroAssoc[K, V]() } // FindLowest returns the association with the lowest key and true. The zero value // of K and V and false is returned if the tree is empty. func (tree *Tree[K, V]) FindLowest() (K, V, bool) { return tree.edgeNode(directionLeft) } // FindHighest returns the association with the highest key and true. The zero value // of K and V and false is returned if the tree is empty. func (tree *Tree[K, V]) FindHighest() (K, V, bool) { return tree.edgeNode(directionRight) } // Apply calls the supplied function for each association in the tree. func (tree *Tree[K, V]) Apply(f func(K, V)) { iter := tree.NewIterator() for k, v, ok := iter.Next(); ok; k, v, ok = iter.Next() { f(k, v) } } // NewIterator creates an iterator that advances from low to high key values. // Make sure to close the iterator by calling its Close method when done. func (tree *Tree[K, V]) NewIterator() *Iterator[K, V] { return tree.iterator(directionRight) } // NewReverseIterator creates an iterator that advances from high to low key // values. Make sure to close the iterator by calling its Close method when // done. func (tree *Tree[K, V]) NewReverseIterator() *Iterator[K, V] { return tree.iterator(directionLeft) } func (tree *Tree[K, V]) edgeNode(dir direction) (K, V, bool) { node := tree.root if node == nil { return zeroAssoc[K, V]() } for node.link[dir] != nil { node = node.link[dir] } return node.key, node.value, true } func (tree *Tree[K, V]) iterator(dir direction) *Iterator[K, V] { iter := &Iterator[K, V]{tree: tree, dir: dir} iter.listNode.InitLinks().Value = iter if iter.buildPathStart() { tree.iters.LinkNext(&iter.listNode) } return iter } // Validate tree invariants. A valid tree should always be balanced and sorted. func (tree *Tree[K, V]) Validate() (balanced, sorted bool) { balanced = true sorted = true if tree.root != nil { tree.validateNode(tree.root, &balanced, &sorted, 0) } return } func (tree *Tree[K, V]) validateNode(node *node[K, V], rvBalanced, rvSorted *bool, depth int) int { depth++ var depthLink [2]int for dir := directionLeft; dir <= directionRight; dir++ { depthLink[dir] = depth if node.link[dir] != nil { cmp := tree.compareKeys(node.link[dir].key, node.key) if dir == directionOfBool(cmp < 0) { *rvSorted = false } depthLink[dir] = tree.validateNode(node.link[dir], rvBalanced, rvSorted, depth) } } if math.AbsSigned(depthLink[directionLeft]-depthLink[directionRight]) > 1 { *rvBalanced = false } return math.MaxInteger(depthLink[directionLeft], depthLink[directionRight]) } /****************************************************************************** * Iterator *****************************************************************************/ // Iterator that is used to iterate over associations in a tree. type Iterator[K, V any] struct { listNode list.Node[*Iterator[K, V]] // List node to make it linkable to tree iterator list tree *Tree[K, V] // Tree iterator belongs to curr *node[K, V] // Current node path [maxTreeHeight]*node[K, V] // Traversal path top int // Top of stack dir direction // Direction of movement update bool // Update path before moving } // Next returns the next association from the iterator. The zero values of K and // V and false is returned if the iterator is not positioned on any association // (such as when all associations has been visited). Close has been called when // false is returned. func (iter *Iterator[K, V]) Next() (K, V, bool) { if !iter.listNode.IsLinked() { return zeroAssoc[K, V]() } if iter.update { iter.buildPathCurr() iter.update = false } key, value := iter.curr.key, iter.curr.value if !iter.advance() { iter.Close() } return key, value, true } // Close invalidates the iterator and removes its reference from the tree it's // associated with. It's safe to call the Next method on closed iterators. func (iter *Iterator[K, V]) Close() { iter.listNode.Unlink() // Clear pointers to avoid GC memory leaks. iter.tree = nil iter.curr = nil for i := range iter.path { iter.path[i] = nil } } // Move iterator according to its recorded direction and report whether it fell // over the edge. func (iter *Iterator[K, V]) advance() bool { dir := iter.dir if iter.curr.link[dir] != nil { // Continue down this branch iter.path[iter.top] = iter.curr iter.curr = iter.curr.link[dir] iter.top++ for iter.curr.link[dir.other()] != nil { iter.path[iter.top] = iter.curr iter.curr = iter.curr.link[dir.other()] iter.top++ } } else { // Move to the next branch var last *node[K, V] for { if iter.top == 0 { iter.curr = nil break } iter.top-- last = iter.curr iter.curr = iter.path[iter.top] if last != iter.curr.link[dir] { break } } } return iter.curr != nil } // Build path to first or last association depending on iterator direction and // report if it was successful. func (iter *Iterator[K, V]) buildPathStart() bool { dir := iter.dir.other() iter.curr = iter.tree.root iter.top = 0 if iter.curr != nil { for iter.curr.link[dir] != nil { iter.path[iter.top] = iter.curr iter.curr = iter.curr.link[dir] iter.top++ } return true } return false } // Build path to current node (should always be in tree). func (iter *Iterator[K, V]) buildPathCurr() { tree := iter.tree key := iter.curr.key iter.curr = tree.root iter.top = 0 for cmp := tree.compareKeys(iter.curr.key, key); cmp != 0; cmp = tree.compareKeys(iter.curr.key, key) { iter.path[iter.top] = iter.curr iter.curr = iter.curr.link[directionOfBool(cmp < 0)] iter.top++ } } // Build path to node next to current node and report whether it fell over the // edge. func (iter *Iterator[K, V]) buildPathNext() bool { tree := iter.tree key := iter.curr.key var match *node[K, V] iter.curr = tree.root iter.top = 0 for iter.curr != nil { dir := directionOfBool(tree.compareKeys(iter.curr.key, key) < 0) if dir != iter.dir { // This node matched the direction criteria. match = iter.curr } iter.path[iter.top] = iter.curr iter.curr = iter.curr.link[dir] iter.top++ } if match != nil { // Wind back path to best match. for iter.curr != match { iter.top-- iter.curr = iter.path[iter.top] } return true } return false } /****************************************************************************** * Tree Options *****************************************************************************/ type TreeOption[K, V any] func(*Tree[K, V]) // WithSyncPool creates a tree option to use a sync.Pool to reuse nodes to // reduce pressure on the garbage collector. It may improve performance for // trees with lots of updates. The option holds an instance of a sync.Pool that // may be used by multiple trees in multiple go routines in a safe manner. func WithSyncPool[K, V any]() TreeOption[K, V] { nodePool := newNodePool[K, V]() return func(tree *Tree[K, V]) { tree.nodePool = nodePool } } /****************************************************************************** * Node *****************************************************************************/ type node[K, V any] struct { link [2]*node[K, V] //Left and right links. balance int // Balance factor key K value V } // Two way single rotation func (root *node[K, V]) singleRotation(dir direction) *node[K, V] { odir := dir.other() save := root.link[odir] root.link[odir] = save.link[dir] save.link[dir] = root return save } // Two way double rotation. func (root *node[K, V]) doubleRotation(dir direction) *node[K, V] { odir := dir.other() save := root.link[odir].link[dir] root.link[odir].link[dir] = save.link[odir] save.link[odir] = root.link[odir] root.link[odir] = save save = root.link[odir] root.link[odir] = save.link[dir] save.link[dir] = root return save } // Adjust balance before double rotation. func (root *node[K, V]) adjustBalance(dir direction, bal int) { n1 := root.link[dir] n2 := n1.link[dir.other()] if n2.balance == 0 { root.balance = 0 n1.balance = 0 } else if n2.balance == bal { root.balance = -bal n1.balance = 0 } else { // n2.balance == -bal root.balance = 0 n1.balance = bal } n2.balance = 0 } // Rebalance after insertion. func (root *node[K, V]) insertBalance(dir direction) *node[K, V] { n := root.link[dir] bal := dir.balance() if n.balance == bal { root.balance, n.balance = 0, 0 root = root.singleRotation(dir.other()) } else { // n.balance == -bal root.adjustBalance(dir, bal) root = root.doubleRotation(dir.other()) } return root } // Rebalance after deletion. func (root *node[K, V]) removeBalance(dir direction) (rnode *node[K, V], done bool) { n := root.link[dir.other()] bal := dir.balance() if n.balance == -bal { root.balance = 0 n.balance = 0 root = root.singleRotation(dir) } else if n.balance == bal { root.adjustBalance(dir.other(), -bal) root = root.doubleRotation(dir) } else { // n.balance == 0 root.balance = -bal n.balance = bal root = root.singleRotation(dir) done = true } return root, done } /****************************************************************************** * Node pool *****************************************************************************/ // A type safe wrapper around sync.Pool. type nodePool[K, V any] struct { pool sync.Pool } // newNodePool allocates a new node pool holding nodes with keys of type K and // values of type V. func newNodePool[K, V any]() *nodePool[K, V] { return &nodePool[K, V]{pool: sync.Pool{New: func() any { return new(node[K, V]) }}} } // Get node from pool. The pool may be nil in which case a normal allocation is // performed. func (pool *nodePool[K, V]) get() *node[K, V] { if pool != nil { return pool.pool.Get().(*node[K, V]) } return &node[K, V]{} } // Return node to pool. The pool may be nil in which case the release function // is called but no other action is performed. func (pool *nodePool[K, V]) put(node *node[K, V], release func(K, V)) { if release != nil { release(node.key, node.value) } if pool != nil { // Clear pointers to avoid GC memory leaks as the node will be put in a // pool for reuse. Unless this is done this reachable object may keep // other objects alive which could otherwise be garbage collected. node.link[directionLeft] = nil node.link[directionRight] = nil // Keys and values can also be or contain pointers. node.key, _ = zeroValue[K]() node.value, _ = zeroValue[V]() // Clear balance before putting node in pool. node.balance = 0 pool.pool.Put(node) } } /****************************************************************************** * Miscellaneous *****************************************************************************/ // direction select left or right node links. type direction int8 const ( directionLeft direction = 0 directionRight direction = 1 ) func (dir direction) other() direction { return dir ^ 1 // invert direction } func (dir direction) balance() int { if dir == directionLeft { return -1 } return +1 } func (dir direction) inverseBalance() int { if dir != directionLeft { return -1 } return +1 } func directionOfBool(b bool) direction { if b { return directionRight } return directionLeft } func zeroValue[V any]() (v V, ok bool) { return } func zeroAssoc[K, V any]() (k K, v V, ok bool) { return }
#!/usr/bin/env bash echo '=====开始安装夕颜源码环境=====' echo '=====开始运行mysql=====' docker-compose -f ../yaml/mysql.yml up -d echo '=====mysql正在进行初始化=====' ../config/wait-for-it.sh http://localhost:3306 --timeout=60 -- echo "=====mysql已经准备就绪=====" echo '=====开始部署portainer可视化工具=====' docker-compose -f ../yaml/portainer.yml up -d echo '=====开始运行nacos=====' docker-compose -f ../yaml/nacos.yml up -d echo '=====nacos正在进行初始化,请等待...=====' ../config/wait-for-it.sh http://localhost:8848 --timeout=60 -- echo "=====nacos已经准备就绪=====" echo '=====开始部署seata=====' docker-compose -f ../yaml/seata.yml up -d echo '=====开始部署kafka=====' docker-compose -f ../yaml/kafka.yml up -d echo '=====开始运行elasticsearch=====' docker-compose -f ../yaml/elasticsearch.yml up -d echo '=====开始运行redis=====' docker-compose -f ../yaml/redis.yml up -d echo '=====开始部署nginx=====' docker-compose -f ../yaml/nginx.yml up -d echo '======================' echo '=====开始运行后台=====' echo '======================' echo '=====开始运行xxl-job=====' docker-compose -f ../yaml/xxl-job.yml up -d echo '=====xxl-job正在进行初始化,请等待...=====' ../config/wait-for-it.sh http://localhost:8088 --timeout=60 -- echo "=====nacos已经准备就绪=====" echo '=====开始运行xiyan-gateway=====' docker-compose -f ../yaml/xiyan-gateway.yml up -d echo '=====开始运行xiyan-web-service=====' docker-compose -f ../yaml/xiyan-web-service.yml up -d ../config/wait-for-it.sh http://localhost:port --timeout=60 -- echo "=====已经准备就绪=====" echo '=====开始运行system-base-service=====' docker-compose -f ../yaml/system-base-service.yml up -d echo '=====开始运行search-service=====' docker-compose -f ../yaml/search-service.yml up -d echo '=====开始运行oss-service=====' docker-compose -f ../yaml/oss-service.yml up -d ../config/wait-for-it.sh http://localhost:port --timeout=60 -- echo "=====已经准备就绪=====" echo '=====开始运行pay=====' docker-compose -f ../yaml/pay.yml up -d echo '======================' echo '=====开始运行前台=====' echo '======================' echo '=====开始部署前端源码=====' docker-compose -f ../yaml/vue-xiyan-web.yml up -d echo '执行完成 日志目录: ./log' echo '======================================================' echo '=====所有服务已经启动【请检查是否存在错误启动的】=====' echo '======================================================'
#!/usr/bin/env bash # # 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. set -e export GOOS=windows export GOARCH=amd64 PROFILE=dev PROJECT_HOME=`pwd` if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then . ${PROJECT_HOME}/assembly/common/app.properties fi if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then . ${PROJECT_HOME}/assembly/common/build.sh fi
def calculate_w(U: Tensor) -> Tensor: # Sum along the second axis to calculate w w = tf.reduce_sum(U, axis=1) return w
<filename>packages/sorted-map/tests/functions/toArray.ts<gh_stars>100-1000 import test from 'ava'; import { empty, toArray } from '../../src'; import { SortedMap, fromStringArray, pairsFrom } from '../test-utils'; const values = ['A', 'B', 'C', 'D', 'E']; let map: SortedMap; test.beforeEach(() => { map = fromStringArray(values); }); test('returns an empty array if the map is empty', t => { t.is(toArray(empty()).length, 0); }); test('returns an array containing each member of the input map', t => { t.deepEqual(toArray(map), pairsFrom(values)); });
#!/bin/bash DOCKER_TAG='' case "$TRAVIS_BRANCH" in "master") DOCKER_TAG=latest ;; "develop") DOCKER_TAG=dev ;; esac docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD docker build -t dshop.services.operations:$DOCKER_TAG . docker tag dshop.services.operations:$DOCKER_TAG $DOCKER_USERNAME/dshop.services.operations:$DOCKER_TAG docker push $DOCKER_USERNAME/dshop.services.operations:$DOCKER_TAG
// @ts-check import React from "react"; import { storiesOf } from "@storybook/react"; import { CodeSurfer } from "@code-surfer/standalone"; import { StoryWithSlider } from "./utils"; storiesOf("Title & Subtitle", module) .add("Title", () => <TitleStory />) .add("Subtitle", () => <SubtitleStory />) .add("Fit Code", () => <ZoomStory />); const code = `var x0 = 3 var x1 = 1 var x0 = 3`; function TitleStory() { const steps = [ { code, title: "Title 1", lang: "js" }, { code, title: "Title 2" }, { code, title: "Title 2" }, { code }, { code, title: "Title 3" } ]; return ( <StoryWithSlider max={steps.length - 1}> {progress => <CodeSurfer progress={progress} steps={steps} />} </StoryWithSlider> ); } function SubtitleStory() { const steps = [ { code, subtitle: "Subtitle 1", lang: "js" }, { code, subtitle: "Subtitle 2" }, { code, subtitle: "Subtitle 2" }, { code }, { code, subtitle: "Subtitle 3" } ]; return ( <StoryWithSlider max={steps.length - 1}> {progress => <CodeSurfer progress={progress} steps={steps} />} </StoryWithSlider> ); } function ZoomStory() { const fiveLines = ` console.log(1) console.log(1) console.log(1) console.log(1) console.log(1)`; const code = fiveLines + fiveLines + fiveLines; const steps = [ { code, title: "title 1", subtitle: "Subtitle 1", lang: "js" }, { code, subtitle: "Subtitle 2" }, { code, title: "title 2" }, { code } ]; return ( <StoryWithSlider max={steps.length - 1}> {progress => <CodeSurfer progress={progress} steps={steps} />} </StoryWithSlider> ); }
// // Created by ooooo on 2020/3/12. // #ifndef CPP_016__SOLUTION1_H_ #define CPP_016__SOLUTION1_H_ #include <iostream> using namespace std; /** * o(n) timeout */ class Solution { public: double myPow(double x, int n) { double ans = 1.0; if (n < 0) return 1.0 / myPow(x, -n); while (n) { ans *= x; n--; } return ans; } }; #endif //CPP_016__SOLUTION1_H_
#!/usr/bin/env bash # shellcheck disable=SC1090,SC2154,SC2155 # Copyright Istio 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. # @setup multicluster set -e set -u set -o pipefail kubectl_get_egress_gateway_for_remote_cluster() { response=$(kubectl get pod -l app=istio-egressgateway -n external-istiod --context="${CTX_REMOTE_CLUSTER}" -o jsonpath="{.items[*].status.phase}") echo "$response" } # Override some snip functions to configure the istiod gateway using TLS passthrough in the test environemnt. snip_get_external_istiod_iop_modified() { snip_get_external_istiod_iop # Update config file: delete CA certificates and meshID, and update pilot vars # TODO(https://github.com/istio/istio/issues/31690) remove 'env' replace sed -i \ -e '/proxyMetadata:/,+2d' \ -e '/INJECTION_WEBHOOK_CONFIG_NAME/,+1d' \ -e "/VALIDATION_WEBHOOK_CONFIG_NAME/,+1d" \ external-istiod.yaml } snip_get_external_istiod_gateway_config_modified() { TMP="$EXTERNAL_ISTIOD_ADDR" EXTERNAL_ISTIOD_ADDR='"*"' snip_get_external_istiod_gateway_config # Update config file: delete the DestinationRule, don't terminate TLS in the Gateway, and use TLS routing in the VirtualService sed -i \ -e '55,$d' \ -e 's/mode: SIMPLE/mode: PASSTHROUGH/' -e '/credentialName:/d' \ -e 's/http:/tls:/' -e 's/https/tls/' -e "/route:/i\ sniHosts:\n - ${EXTERNAL_ISTIOD_ADDR}" \ external-istiod-gw.yaml EXTERNAL_ISTIOD_ADDR="$TMP" } # Set the CTX_EXTERNAL_CLUSTER, CTX_REMOTE_CLUSTER, and REMOTE_CLUSTER_NAME env variables. _set_kube_vars # helper function to initialize KUBECONFIG_FILES and KUBE_CONTEXTS export CTX_EXTERNAL_CLUSTER="${KUBE_CONTEXTS[0]}" export CTX_REMOTE_CLUSTER="${KUBE_CONTEXTS[2]}" export REMOTE_CLUSTER_NAME="${CTX_REMOTE_CLUSTER}" # Set up the istiod gateway in the external cluster. snip_set_up_a_gateway_in_the_external_cluster_1 echo y | snip_set_up_a_gateway_in_the_external_cluster_2 _verify_like snip_set_up_a_gateway_in_the_external_cluster_3 "$snip_set_up_a_gateway_in_the_external_cluster_3_out" export SSL_SECRET_NAME="UNUSED" export EXTERNAL_ISTIOD_ADDR=$(kubectl \ --context="${CTX_EXTERNAL_CLUSTER}" \ -n istio-system get svc istio-ingressgateway \ -o jsonpath='{.status.loadBalancer.ingress[0].ip}') # Set up the remote cluster. snip_get_remote_config_cluster_iop #set +e #ignore failures here echo y | snip_set_up_the_remote_config_cluster_2 #set -e _verify_like snip_set_up_the_remote_config_cluster_3 "$snip_set_up_the_remote_config_cluster_3_out" # Install istiod on the external cluster. snip_set_up_the_control_plane_in_the_external_cluster_1 snip_set_up_the_control_plane_in_the_external_cluster_2 snip_get_external_istiod_iop_modified echo y | istioctl manifest generate -f external-istiod.yaml --set values.pilot.env.ISTIOD_CUSTOM_HOST="${EXTERNAL_ISTIOD_ADDR}" | kubectl apply --context="${CTX_EXTERNAL_CLUSTER}" -f - _verify_like snip_set_up_the_control_plane_in_the_external_cluster_5 "$snip_set_up_the_control_plane_in_the_external_cluster_5_out" snip_get_external_istiod_gateway_config_modified snip_set_up_the_control_plane_in_the_external_cluster_7 # Validate the installation. snip_deploy_a_sample_application_1 snip_deploy_a_sample_application_2 _verify_like snip_deploy_a_sample_application_3 "$snip_deploy_a_sample_application_3_out" _verify_contains snip_deploy_a_sample_application_4 "Hello version: v1" # Install ingress with istioctl echo y | snip_enable_gateways_1 # And egress with helm _rewrite_helm_repo snip_enable_gateways_4 _verify_same kubectl_get_egress_gateway_for_remote_cluster "Running" _verify_like snip_test_the_ingress_gateway_1 "$snip_test_the_ingress_gateway_1_out" snip_test_the_ingress_gateway_2 export GATEWAY_URL=$(kubectl \ --context="${CTX_REMOTE_CLUSTER}" \ -n external-istiod get svc istio-ingressgateway \ -o jsonpath='{.status.loadBalancer.ingress[0].ip}') _verify_contains snip_test_the_ingress_gateway_4 "Hello version: v1" # Adding clusters to the mesh. export CTX_SECOND_CLUSTER="${KUBE_CONTEXTS[1]}" export SECOND_CLUSTER_NAME="${CTX_SECOND_CLUSTER}" snip_get_second_config_cluster_iop echo y | snip_register_the_new_cluster_2 # Confirm remote cluster’s webhook configuration has been installed _verify_like snip_register_the_new_cluster_3 "$snip_register_the_new_cluster_3_out" # Create a secret with credentials to allow the control plane to access the endpoints on the second remote cluster and install it snip_register_the_new_cluster_4 # Setup east-west gateways snip_setup_eastwest_gateways_1 snip_setup_eastwest_gateways_2 _verify_like snip_setup_eastwest_gateways_3 "$snip_setup_eastwest_gateways_3_out" _verify_like snip_setup_eastwest_gateways_4 "$snip_setup_eastwest_gateways_4_out" snip_setup_eastwest_gateways_5 # Validate the installation. snip_validate_the_installation_1 snip_validate_the_installation_2 _verify_like snip_validate_the_installation_3 "$snip_validate_the_installation_3_out" _verify_contains snip_validate_the_installation_4 "Hello version:" _verify_lines snip_validate_the_installation_5 " + Hello version: v1 + Hello version: v2 " # @cleanup _set_kube_vars # helper function to initialize KUBECONFIG_FILES and KUBE_CONTEXTS export CTX_EXTERNAL_CLUSTER="${KUBE_CONTEXTS[0]}" export CTX_REMOTE_CLUSTER="${KUBE_CONTEXTS[2]}" export CTX_SECOND_CLUSTER="${KUBE_CONTEXTS[1]}" # TODO put the cleanup instructions in the doc and then call the snips. kubectl delete ns sample --context="${CTX_REMOTE_CLUSTER}" kubectl delete ns sample --context="${CTX_SECOND_CLUSTER}" kubectl delete -f external-istiod-gw.yaml --context="${CTX_EXTERNAL_CLUSTER}" istioctl manifest generate -f remote-config-cluster.yaml | kubectl delete --context="${CTX_REMOTE_CLUSTER}" -f - istioctl manifest generate -f second-config-cluster.yaml | kubectl delete --context="${CTX_SECOND_CLUSTER}" -f - istioctl manifest generate -f eastwest-gateway-1.yaml | kubectl delete --context="${CTX_REMOTE_CLUSTER}" -f - istioctl manifest generate -f eastwest-gateway-2.yaml | kubectl delete --context="${CTX_SECOND_CLUSTER}" -f - istioctl manifest generate -f external-istiod.yaml | kubectl delete --context="${CTX_EXTERNAL_CLUSTER}" -f - istioctl manifest generate -f controlplane-gateway.yaml | kubectl delete --context="${CTX_EXTERNAL_CLUSTER}" -f - #TODO remove the following lines when https://github.com/istio/istio/issues/38599 is fixed kubectl delete validatingwebhookconfigurations istiod-default-validator --context="${CTX_REMOTE_CLUSTER}" kubectl delete validatingwebhookconfigurations istiod-default-validator --context="${CTX_EXTERNAL_CLUSTER}" kubectl delete mutatingwebhookconfigurations istio-revision-tag-default-external-istiod --context="${CTX_REMOTE_CLUSTER}" kubectl delete mutatingwebhookconfigurations istio-revision-tag-default-external-istiod --context="${CTX_EXTERNAL_CLUSTER}" kubectl delete mutatingwebhookconfigurations istio-revision-tag-default --context="${CTX_EXTERNAL_CLUSTER}" kubectl delete ns istio-system external-istiod --context="${CTX_EXTERNAL_CLUSTER}" kubectl delete ns external-istiod --context="${CTX_REMOTE_CLUSTER}" kubectl delete ns external-istiod --context="${CTX_SECOND_CLUSTER}" rm external-istiod-gw.yaml remote-config-cluster.yaml external-istiod.yaml controlplane-gateway.yaml eastwest-gateway-1.yaml eastwest-gateway-2.yaml second-config-cluster.yaml
import React from "react"; import { Box, Flex, Text, Icon } from "rimble-ui"; const colors = { positive: "155, 66%, 45%", negative: "8, 86%, 46%" }; const ExampleCard = ({ variant, ...props }) => { let colorPrimary = "0,0%,0%", iconName = "ThumbDown", cardLabel = "{ missing variant }"; if (variant === "positive") { colorPrimary = colors.positive; iconName = "Check"; cardLabel = "Do"; } else if (variant === "negative") { colorPrimary = colors.negative; iconName = "Close"; cardLabel = `Don't`; } return ( <Box bg={"blacks.0"} borderTop={`4px solid HSLA(${colorPrimary}, 1.00)`} height={"100%"} > <Box border={1} borderColor={"blacks.3"} borderWidth={"0 1px 1px 1px"} p={4} height={"100%"} > <Flex alignItems={"center"} mb={4}> <Box size={"3rem"} bg={"white"} border={`8px solid HSLA(${colorPrimary}, 0.25)`} borderRadius={"100%"} > <Flex size={"100%"} border={`2px solid HSLA(${colorPrimary}, 1.00)`} borderRadius={"100%"} alignItems={"center"} justifyContent={"center"} > <Icon name={iconName} size={"20px"} color={`HSLA(${colorPrimary}, 1.00)`} /> </Flex> </Box> <Text ml={3} fontSize={"18px"} fontWeight={3}> {cardLabel} </Text> </Flex> {props.children} </Box> </Box> ); }; export default ExampleCard;
package BinarySearch import ( "math/rand" "testing" "time" "fmt" ) func SortArray(array []int) { for itemIndex, itemValue := range array { for itemIndex != 0 && array[itemIndex-1] > itemValue { array[itemIndex] = array[itemIndex-1] itemIndex -= 1 } array[itemIndex] = itemValue } } func TestBinarySearch(t *testing.T) { random := rand.New(rand.NewSource(time.Now().UnixNano())) array := make([]int, random.Intn(100-10)+10) for i := range array { array[i] = random.Intn(100000) } fmt.Println("Print array before sort......",array) SortArray(array) fmt.Println("Print array after sort......",array) for _, value := range array { fmt.Println("The current value is ", value) result := BinarySearch(array, value) if result == -1 { t.Fail() } } } /* C:\Users\li-370\ForkGitW\LearnGolang\Data-Structures-and-Algorithms-master -> origin\BinarySearch (master -> origin) λ go test Print array before sort...... [36504 27161 53827 45200 41856 67370 40244 51790 38259 52434 86625 31323 3184 14801 40902 39030 65771 54763 8522 84538 48553 68848 63242 89433 15702 4837 6659 31127 65540 66988 88771] Print array after sort...... [3184 4837 6659 8522 14801 15702 27161 31127 31323 36504 38259 39030 40244 40902 41856 45200 48553 51790 52434 53827 54763 63242 65540 65771 66988 67370 68848 84538 86625 88771 89433] The current value is 3184 function::BinarySearch........ 3184 The current value is 4837 function::BinarySearch........ 4837 The current value is 6659 function::BinarySearch........ 6659 The current value is 8522 function::BinarySearch........ 8522 The current value is 14801 function::BinarySearch........ 14801 The current value is 15702 function::BinarySearch........ 15702 The current value is 27161 function::BinarySearch........ 27161 The current value is 31127 function::BinarySearch........ 31127 The current value is 31323 function::BinarySearch........ 31323 The current value is 36504 function::BinarySearch........ 36504 The current value is 38259 function::BinarySearch........ 38259 The current value is 39030 function::BinarySearch........ 39030 The current value is 40244 function::BinarySearch........ 40244 The current value is 40902 function::BinarySearch........ 40902 The current value is 41856 function::BinarySearch........ 41856 The current value is 45200 function::BinarySearch........ 45200 The current value is 48553 function::BinarySearch........ 48553 The current value is 51790 function::BinarySearch........ 51790 The current value is 52434 function::BinarySearch........ 52434 The current value is 53827 function::BinarySearch........ 53827 The current value is 54763 function::BinarySearch........ 54763 The current value is 63242 function::BinarySearch........ 63242 The current value is 65540 function::BinarySearch........ 65540 The current value is 65771 function::BinarySearch........ 65771 The current value is 66988 function::BinarySearch........ 66988 The current value is 67370 function::BinarySearch........ 67370 The current value is 68848 function::BinarySearch........ 68848 The current value is 84538 function::BinarySearch........ 84538 The current value is 86625 function::BinarySearch........ 86625 The current value is 88771 function::BinarySearch........ 88771 The current value is 89433 function::BinarySearch........ 89433 PASS ok _/C_/Users/li-370/ForkGitW/LearnGolang/Data-Structures-and-Algorithms-master/BinarySearch 2.768s */
<reponame>wschat/ws-vue<filename>src/components/upload/http.js /** * XMLHttpRequest 简单封装(主要用于上传组件) * @param {string} url 请求路径(请带上前缀 例:http://) * @param {Object} data 传输的数据 在该函数内会使用FormData进行二次处理(存在则自动使用post请求) * @param {Object} options 一些配置项 * @return {Promise} */ export default function(url,data={},options={}){ return new Promise((resolve,reject)=>{ const xhr=new XMLHttpRequest(); const config=Object.assign({ methods:'get', timeout:6000, headers:{ //'Content-Type':'application/x-www-form-urlencoded', }, onerror(e){ console.log(e) }, ontimeout(){}, onprogress(){}, },options); let dataKeys=Object.keys(data); if(dataKeys.length>0){ config.methods='post'; let formData=new FormData(); dataKeys.forEach(key=>{ formData.append(key,data[key]) }); data=formData; } xhr.open(config.methods,url); if(config.headers){ Object.keys(config.headers).forEach(key=>{ xhr.setRequestHeader(key,config.headers[key]); }) } xhr.timeout=config.timeout; if(config.with){ xhr.withCredentials=config.with; } xhr.onload=function(){ if((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304){ let rs=xhr.response||xhr.responseText; try { resolve(JSON.parse(rs)); } catch (e) { resolve(rs); } }else{ let msg=''; if(xhr.response) { msg=xhr.response.error||xhr.response||xhr.responseText; }else{ msg=`error: ${url} status: ${xhr.status}`; } reject(msg) } } if(xhr.upload){ xhr.upload.onprogress=e=>{ if(e.total>0){ e.percent=parseInt(e.loaded/e.total*100); } config.onprogress(e); } } xhr.onerror=config.onerror; xhr.ontimeout=config.ontimeout; try{ xhr.send(data); }catch(e){ reject(e) } }) }
<gh_stars>10-100 // groan. export function range(start: number, end: number, step: number = 1): number[] { return [...Array(Math.ceil((end - start) / step)).keys()].map(i => i * step + start); } export function arrayGrouped<A>(array: A[], groupSize: number): A[][] { return range(0, array.length, groupSize).map(i => array.slice(i, i + groupSize)); } // return the most popular string from a list. export function consensus<A>( array: Array<A | undefined>, comparer: (a: A | undefined, b: A | undefined) => number ): A | undefined { const sorted: Array<[ A, number ]> = array.filter(x => x !== undefined).sort(comparer).map(item => [ item, 1 ] as [ A, number ]); if (sorted.length == 0) return undefined; let i = 1; while (i < sorted.length) { if (comparer(sorted[i - 1][0], sorted[i][0]) == 0) { sorted[i - 1][1]++; sorted.splice(i, 1); } else { i++; } } return sorted.sort((a, b) => b[1] - a[1])[0][0]; } export function partition<A>(array: A[], f: (item: A) => boolean): [ A[], A[] ] { const left: A[] = []; const right: A[] = []; array.forEach(item => (f(item) ? left : right).push(item)); return [ left, right ]; } export function flatten<A>(array: A[][]): A[] { return Array.prototype.concat.apply([], array); } export function flatMap<A, B>(array: A[], f: (a: A) => B[]): B[] { return flatten(array.map(f)); } export function groupBy<A>(array: A[], grouper: (a: A) => string): { [key: string]: A[] } { const rv: { [key: string]: A[] } = {}; array.forEach(a => { const key = grouper(a); if (rv[key] === undefined) rv[key] = []; rv[key].push(a); }); return rv; }
#!/bin/sh # How to use this test script: # Put all of your tests into a directory like "tests/scanner". # Name the good tests goodXX.bminor and the bad tests badXX.bminor. # Then use run-tests.sh and give the location of the compiler # executable, the command-line option, and the test directory. # This script will run all of the tests, and show you the # details of which ones failed. # For example: # run-tests.sh $HOME/mycompiler/bminor -scan tests/scanner if [ $# -ne 3 ] then echo "Usage: $0 <compiler> <mode> <test-dir>" exit 1 fi COMPILER=$1 MODE=$2 TESTDIR=$3 LINES=------------------------------------------- for testfile in ${TESTDIR}/good*.bminor do if ${COMPILER} ${MODE} $testfile > $testfile.out 2>&1 then echo "$testfile success (as expected)" else echo "$testfile failure (INCORRECT)" echo ${LINES} echo Test Input: echo ${LINES} cat $testfile echo ${LINES} echo Your Output: echo ${LINES} cat $testfile.out echo ${LINES} fi done for testfile in ${TESTDIR}/bad*.bminor do if ${COMPILER} ${MODE} $testfile > $testfile.out 2>&1 then echo "$testfile success (INCORRECT)" echo ${LINES} echo Test Input: echo ${LINES} cat $testfile echo ${LINES} echo Your Output: echo ${LINES} cat $testfile.out echo ${LINES} else echo "$testfile failure (as expected)" fi done
<filename>app/src/main/java/com/kp/twitterclient/activities/BaseActivity.java package com.kp.twitterclient.activities; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v4.view.ViewPager; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.View; import android.widget.ImageView; import android.widget.RelativeLayout; import com.activeandroid.ActiveAndroid; import com.astuetz.PagerSlidingTabStrip; import com.kp.twitterclient.R; import com.kp.twitterclient.adapters.TweetsPagerAdapter; import com.kp.twitterclient.applications.TwitterApplication; import com.kp.twitterclient.applications.TwitterClient; import com.kp.twitterclient.fragments.TweetsListFragment; import com.kp.twitterclient.helpers.NetworkAvailabilityCheck; import com.kp.twitterclient.models.User; import com.loopj.android.http.JsonHttpResponseHandler; import org.json.JSONObject; import cz.msebera.android.httpclient.Header; public class BaseActivity extends AppCompatActivity { private TwitterClient twitterClient; private User loggedInUser; private ImageView scrollToTop; private ViewPager vpPager; private TweetsPagerAdapter viewPagerAdapter; private PagerSlidingTabStrip tabsStrip; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_base); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActiveAndroid.setLoggingEnabled(true); twitterClient = TwitterApplication.getRestClient(); if (getSupportActionBar() != null) { getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#55ACEE"))); getSupportActionBar().setDisplayShowCustomEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(false); getSupportActionBar().setDisplayShowTitleEnabled(false); setupScrollToTopButton(getSupportActionBar()); } FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); if (fab != null) { fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); } }); } getLoggedInUserInfo(); } private void setupScrollToTopButton(ActionBar actionBar) { scrollToTop = new ImageView(this); scrollToTop.setClickable(true); scrollToTop.setEnabled(true); scrollToTop.setBackgroundResource(R.drawable.ic_twitter_white); RelativeLayout relative = new RelativeLayout(this); relative.addView(scrollToTop); actionBar.setCustomView(relative); } private void getLoggedInUserInfo() { if (isNetworkAvailable()) { twitterClient.getLoggedInUserInfo(new JsonHttpResponseHandler() { @Override public void onSuccess(int statusCode, Header[] headers, JSONObject response) { Log.d("USER", response.toString()); loggedInUser = User.fromJSON(response); loadFragments(); } @Override public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { Log.e("ERROR", errorResponse.toString()); } }); } else { loadFragments(); } } private void loadFragments() { // Get the viewpager and setup a PageChangeListener vpPager = (ViewPager) findViewById(R.id.viewpager); // Get the view pager adapter for the pager viewPagerAdapter = new TweetsPagerAdapter(getSupportFragmentManager(), loggedInUser); vpPager.setAdapter(viewPagerAdapter); // Find the sliding tabstrips tabsStrip = (PagerSlidingTabStrip) findViewById(R.id.tabs); // Attach the tabstrip to the view pager tabsStrip.setViewPager(vpPager); setupPageChangeListener(); } private void setupPageChangeListener() { tabsStrip.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(final int position) { scrollToTop.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { ((TweetsListFragment) viewPagerAdapter.getRegisteredFragment(position)).scrollToTop(); } }); } }); } private boolean isNetworkAvailable() { return NetworkAvailabilityCheck.isNetworkAvailable(this); } }
<reponame>ShibaPipi/sarair import Avatar from 'antd/es/avatar' import 'antd/es/avatar/style/css' export { Avatar }
#!/bin/bash source /home/admin/_version.info source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf # all system/service info gets detected by blitz.statusscan.sh source <(sudo /home/admin/config.scripts/blitz.statusscan.sh) source <(sudo /home/admin/config.scripts/internet.sh status) # when admin and no other error found run LND setup check if [ "$USER" == "admin" ] && [ ${#lndErrorFull} -eq 0 ]; then lndErrorFull=$(sudo /home/admin/config.scripts/lnd.check.sh basic-setup | grep "err=" | tail -1) fi # set follow up info different for LCD and ADMIN adminStr="ssh admin@${localip} ->Password A" if [ "$USER" == "admin" ]; then adminStr="Use CTRL+c to EXIT to Terminal" fi # waiting for Internet connection if [ "${state}" = "nointernet" ]; then l1="Waiting for Internet ...\n" l2="Please check infrastructure:\n" l3="Router online? Network connected?\n" dialog --backtitle "RaspiBlitz ${codeVersion} ${localip}" --infobox "$l1$l2$l3" 5 45 sleep 3 exit 0 fi # bitcoin errors always first if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == "blockchain-error" ]; then #################### # Copy Blockchain Source Mode # https://github.com/rootzoll/raspiblitz/issues/1081 #################### if [ "${state}" = "copysource" ]; then l1="Copy Blockchain Source Modus\n" l2="May needs restart node when done.\n" l3="Restart from Terminal: restart" dialog --backtitle "RaspiBlitz ${codeVersion} (${state}) ${localIP}" --infobox "$l1$l2$l3" 5 45 sleep 3 exit 1 fi #################### # On Bitcoin Error #################### height=6 width=43 title="Blockchain Info" if [ ${#bitcoinErrorShort} -eq 0 ]; then bitcoinErrorShort="Initial Startup - Please Wait" fi if [ "$USER" != "admin" ]; then if [ ${uptime} -gt 600 ]; then if [ ${uptime} -gt 1000 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == "blockchain-error" ]; then infoStr=" The ${network}d service is NOT RUNNING!\n ${bitcoinErrorShort}\n Login for more details & options:" else infoStr=" The ${network}d service is running:\n ${bitcoinErrorShort}\n Login with SSH for more details:" fi else infoStr=" The ${network}d service is starting:\n ${bitcoinErrorShort}\n Login with SSH for more details:" fi else # output when user login in as admin and bitcoind is not running if [ ${uptime} -lt 600 ]; then infoStr=" The ${network}d service is starting:\n ${bitcoinErrorShort}\n Please wait at least 10min ..." elif [[ "${bitcoinErrorFull}" == *"error code: -28"* ]]; then infoStr=" The ${network}d service is warming up:\n ${bitcoinErrorShort}\n Please wait ..." elif [ ${#bitcoinErrorFull} -gt 0 ] || [ "${bitcoinErrorShort}" == "Error found in Logs" ] || [ "${1}" == "blockchain-error" ]; then clear echo "" echo "*****************************************" echo "* The ${network}d service is not running." echo "*****************************************" echo "If you just started some config/setup, this might be OK." echo if [ ${startcountBlockchain} -gt 1 ]; then echo "${startcountBlockchain} RESTARTS DETECTED - ${network}d might be in a error loop" cat /home/admin/systemd.blockchain.log | grep "ERROR" | tail -n -1 echo fi if [ ${#bitcoinErrorFull} -gt 0 ]; then echo "More Error Detail:" echo ${bitcoinErrorFull} echo fi echo "POSSIBLE OPTIONS:" source <(/home/admin/config.scripts/network.txindex.sh status) if [ "${txindex}" == "1" ]; then echo "-> Use command 'repair' and then choose 'DELETE-INDEX' to try rebuilding transaction index." fi echo "-> Use command 'repair' and then choose 'RESET-CHAIN' to try downloading new blockchain." echo "-> Use command 'debug' for more log output you can use for getting support." echo "-> Use command 'menu' to open main menu." echo "-> Have you tried to turn it off and on again? Use command 'restart'" echo "" exit 1 fi fi # LND errors second elif [ ${lndActive} -eq 0 ] || [ ${#lndErrorFull} -gt 0 ] || [ "${1}" == "lightning-error" ]; then #################### # On LND Error #################### height=6 width=43 title="Lightning Info" if [ ${uptime} -gt 600 ] || [ "${1}" == "lightning-error" ]; then if [ ${#lndErrorShort} -gt 0 ]; then height=6 lndErrorShort=" ${lndErrorShort}\n" fi if [ ${lndActive} -eq 0 ]; then infoStr=" The LND service is not running.\n${lndErrorShort} Login for more details:" else infoStr=" The LND service is running with error.\n${lndErrorShort} Login for more details:" fi if [ "$USER" == "admin" ]; then clear echo "" echo "****************************************" if [ ${lndActive} -eq 0 ]; then echo "* The LND service is not running." else echo "* The LND service is running with error." fi echo "****************************************" echo "If you just started some config/setup, this might be OK." echo if [ ${startcountLightning} -gt 1 ]; then echo "${startcountLightning} RESTARTS DETECTED - LND might be in a error loop" cat /home/admin/systemd.lightning.log | grep "ERROR" | tail -n -1 fi sudo journalctl -u lnd -b --no-pager -n14 | grep "lnd\[" sudo /home/admin/config.scripts/lnd.check.sh basic-setup | grep "err=" if [ ${#lndErrorFull} -gt 0 ]; then echo "More Error Detail:" echo ${lndErrorFull} fi echo echo "-> Use command 'repair' and then choose 'BACKUP-LND' to make a just in case backup." echo "-> Use command 'debug' for more log output you can use for getting support." echo "-> Use command 'menu' to open main menu." echo "-> Have you tried to turn it off and on again? Use command 'restart'" echo "" exit 1 else source <(sudo /home/admin/config.scripts/lnd.check.sh basic-setup) if [ ${wallet} -eq 0 ] || [ ${macaroon} -eq 0 ] || [ ${config} -eq 0 ] || [ ${tls} -eq 0 ]; then infoStr=" The LND service needs RE-SETUP.\n Login with SSH to continue:" fi fi else infoStr=" The LND service is starting.\n Login for more details:" if [ "$USER" == "admin" ]; then infoStr=" The LND service is starting.\n Please wait up to 5min ..." fi fi # if LND wallet is locked elif [ ${walletLocked} -gt 0 ]; then height=5 width=43 if [ "${autoUnlock}" = "on" ]; then title="Auto Unlock" infoStr=" Waiting for Wallet Auto-Unlock.\n Please wait up to 5min ..." else title="Action Required" infoStr=" LND WALLET IS LOCKED !!!\n" if [ "${rtlWebinterface}" = "on" ]; then height=6 infoStr="${infoStr} Browser: http://${localip}:3000\n PasswordB=login / PasswordC=unlock" else infoStr="${infoStr} Please use SSH to unlock:" fi if [ ${startcountLightning} -gt 1 ]; then width=45 height=$((height+3)) infoStr=" LIGHTNING RESTARTED - login for details\n${infoStr}" adminStr="${adminStr}\n or choose 'INFO' in main menu\n or type 'raspiblitz' on terminal" fi fi else #################### # Sync Progress #################### # check number of peers source <(sudo -u admin /home/admin/config.scripts/network.monitor.sh peer-status) # basic dialog info height=6 width=45 title="Node is Syncing" actionString="Please wait - this can take some time" # formatting BLOCKCHAIN SYNC PROGRESS if [ ${#syncProgress} -eq 0 ]; then if [ ${startcountBlockchain} -lt 2 ]; then syncProgress="waiting" else syncProgress="${startcountBlockchain} restarts" actionString="Login with SSH for more details:" fi elif [ ${#syncProgress} -lt 6 ]; then syncProgress=" ${syncProgress} % ${peers} peers" else syncProgress="${syncProgress} % ${peers} peers" fi # formatting LIGHTNING SCAN PROGRESS if [ ${#scanProgress} -eq 0 ]; then # in case of LND RPC is not ready yet if [ ${scanTimestamp} -eq -2 ]; then scanProgress="prepare sync" # in case LND restarting >2 elif [ ${startcountLightning} -gt 2 ]; then scanProgress="${startcountLightning} restarts" actionString="Login with SSH for more details:" # check if a specific error can be identified for restarts lndSetupErrorCount=$(sudo /home/admin/config.scripts/lnd.check.sh basic-setup | grep -c "err=") if [ ${lndSetupErrorCount} -gt 0 ]; then scanProgress="possible error" fi # unkown cases else scanProgress="waiting" fi elif [ ${#scanProgress} -lt 6 ]; then scanProgress=" ${scanProgress} % ${lndPeers} peers" else scanProgress="${scanProgress} % ${lndPeers} peers" fi # setting info string infoStr=" Blockchain Progress : ${syncProgress}\n Lightning Progress : ${scanProgress}\n ${actionString}" fi # display info to user dialog --title " ${title} " --backtitle "RaspiBlitz ${codeVersion} ${hostname} / ${network} / ${chain} / ${tempCelsius}°C" --infobox "${infoStr}\n ${adminStr}" ${height} ${width}
/** * This class is generated by jOOQ */ package io.cattle.platform.core.model.tables; /** * This class is generated by jOOQ. */ @javax.annotation.Generated(value = { "http://www.jooq.org", "3.3.0" }, comments = "This class is generated by jOOQ") @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class AuthTokenTable extends org.jooq.impl.TableImpl<io.cattle.platform.core.model.tables.records.AuthTokenRecord> { private static final long serialVersionUID = -1111251379; /** * The singleton instance of <code>cattle.auth_token</code> */ public static final io.cattle.platform.core.model.tables.AuthTokenTable AUTH_TOKEN = new io.cattle.platform.core.model.tables.AuthTokenTable(); /** * The class holding records for this type */ @Override public java.lang.Class<io.cattle.platform.core.model.tables.records.AuthTokenRecord> getRecordType() { return io.cattle.platform.core.model.tables.records.AuthTokenRecord.class; } /** * The column <code>cattle.auth_token.id</code>. */ public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.AuthTokenRecord, java.lang.Long> ID = createField("id", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); /** * The column <code>cattle.auth_token.account_id</code>. */ public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.AuthTokenRecord, java.lang.Long> ACCOUNT_ID = createField("account_id", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); /** * The column <code>cattle.auth_token.created</code>. */ public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.AuthTokenRecord, java.util.Date> CREATED = createField("created", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).asConvertedDataType(new io.cattle.platform.db.jooq.converter.DateConverter()), this, ""); /** * The column <code>cattle.auth_token.expires</code>. */ public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.AuthTokenRecord, java.util.Date> EXPIRES = createField("expires", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).asConvertedDataType(new io.cattle.platform.db.jooq.converter.DateConverter()), this, ""); /** * The column <code>cattle.auth_token.key</code>. */ public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.AuthTokenRecord, java.lang.String> KEY = createField("key", org.jooq.impl.SQLDataType.VARCHAR.length(40).nullable(false), this, ""); /** * The column <code>cattle.auth_token.value</code>. */ public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.AuthTokenRecord, java.lang.String> VALUE = createField("value", org.jooq.impl.SQLDataType.CLOB.length(16777215).nullable(false), this, ""); /** * The column <code>cattle.auth_token.version</code>. */ public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.AuthTokenRecord, java.lang.String> VERSION = createField("version", org.jooq.impl.SQLDataType.VARCHAR.length(255).nullable(false), this, ""); /** * The column <code>cattle.auth_token.provider</code>. */ public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.AuthTokenRecord, java.lang.String> PROVIDER = createField("provider", org.jooq.impl.SQLDataType.VARCHAR.length(255).nullable(false), this, ""); /** * Create a <code>cattle.auth_token</code> table reference */ public AuthTokenTable() { this("auth_token", null); } /** * Create an aliased <code>cattle.auth_token</code> table reference */ public AuthTokenTable(java.lang.String alias) { this(alias, io.cattle.platform.core.model.tables.AuthTokenTable.AUTH_TOKEN); } private AuthTokenTable(java.lang.String alias, org.jooq.Table<io.cattle.platform.core.model.tables.records.AuthTokenRecord> aliased) { this(alias, aliased, null); } private AuthTokenTable(java.lang.String alias, org.jooq.Table<io.cattle.platform.core.model.tables.records.AuthTokenRecord> aliased, org.jooq.Field<?>[] parameters) { super(alias, io.cattle.platform.core.model.CattleTable.CATTLE, aliased, parameters, ""); } /** * {@inheritDoc} */ @Override public org.jooq.Identity<io.cattle.platform.core.model.tables.records.AuthTokenRecord, java.lang.Long> getIdentity() { return io.cattle.platform.core.model.Keys.IDENTITY_AUTH_TOKEN; } /** * {@inheritDoc} */ @Override public org.jooq.UniqueKey<io.cattle.platform.core.model.tables.records.AuthTokenRecord> getPrimaryKey() { return io.cattle.platform.core.model.Keys.KEY_AUTH_TOKEN_PRIMARY; } /** * {@inheritDoc} */ @Override public java.util.List<org.jooq.UniqueKey<io.cattle.platform.core.model.tables.records.AuthTokenRecord>> getKeys() { return java.util.Arrays.<org.jooq.UniqueKey<io.cattle.platform.core.model.tables.records.AuthTokenRecord>>asList(io.cattle.platform.core.model.Keys.KEY_AUTH_TOKEN_PRIMARY, io.cattle.platform.core.model.Keys.KEY_AUTH_TOKEN_KEY); } /** * {@inheritDoc} */ @Override public java.util.List<org.jooq.ForeignKey<io.cattle.platform.core.model.tables.records.AuthTokenRecord, ?>> getReferences() { return java.util.Arrays.<org.jooq.ForeignKey<io.cattle.platform.core.model.tables.records.AuthTokenRecord, ?>>asList(io.cattle.platform.core.model.Keys.FK_AUTH_TOKEN__ACCOUNT_ID); } /** * {@inheritDoc} */ @Override public io.cattle.platform.core.model.tables.AuthTokenTable as(java.lang.String alias) { return new io.cattle.platform.core.model.tables.AuthTokenTable(alias, this); } /** * Rename this table */ public io.cattle.platform.core.model.tables.AuthTokenTable rename(java.lang.String name) { return new io.cattle.platform.core.model.tables.AuthTokenTable(name, null); } }
<reponame>Lyrositor/rpbot<gh_stars>0 import binascii import hashlib import os from typing import Tuple, Iterable, Optional, Union from discord import Message, TextChannel from fuzzywuzzy.process import extractOne MAX_MESSAGE_LENGTH = 2000 def hash_password(password: str) -> Tuple[str, str]: salt = os.urandom(8) key = hashlib.pbkdf2_hmac('sha256', password.encode('utf-8'), salt, 100000) return ( binascii.hexlify(key).decode('utf-8'), binascii.hexlify(salt).decode('utf-8') ) def verify_password(password: str, hashed_password: Tuple[str, str]) -> bool: actual_key = binascii.unhexlify(hashed_password[0].encode('utf-8')) salt = binascii.unhexlify(hashed_password[1].encode('utf-8')) key = hashlib.pbkdf2_hmac('sha256', password.encode('utf-8'), salt, 100000) return key == actual_key async def reply(original_message: Union[Message, TextChannel], text: str) -> None: lines = text.split('\n') messages = [''] for line in lines: if len(messages[-1] + line) > MAX_MESSAGE_LENGTH: messages.append('') messages[-1] += line + '\n' for message in messages: if isinstance(original_message, Message): channel = original_message.channel else: channel = original_message await channel.send(message.strip()) def fuzzy_search(query: str, options: Iterable[str]) -> Optional[str]: result = extractOne(query, sorted(options), score_cutoff=50) if result is not None: return result[0] return None
#!/bin/sh set -eu /usr/bin/env python3 "$@" -Dq='2**383 - 31' -Dmodulus_bytes='23 + 15/16' -Da24='121665'
<reponame>Lambda-School-Labs/frontend-vbb-portal export const meetingStatus = { CHECKED_IN: 'CHECKED_IN', EXPIRED: 'EXPIRED', NOT_CHECK_IN: 'NOT_CHECKED_IN', PRE_CHECK_IN: 'PRE_CHECK_IN', }; export default meetingStatus;
#!/bin/bash ppid=$$ maxmem=0 $@ & pid=`pgrep -P ${ppid} -n -f $1` # $! may work here but not later while [[ ${pid} -ne "" ]]; do #mem=`ps v | grep "^[ ]*${pid}" | awk '{print $8}'` #the previous does not work with MPI mem=`cat /proc/${pid}/status | grep VmRSS | awk '{print $2}'` if [[ ${mem} -gt ${maxmem} ]]; then maxmem=${mem} fi sleep 1 savedpid=${pid} pid=`pgrep -P ${ppid} -n -f $1` done wait ${savedpid} # don't wait, job is finished exitstatus=$? # catch the exit status of wait, the same of $@ echo -e "Memory usage for $@ is: ${maxmem} KB. Exit status: ${exitstatus}\n"
/** * @module botframework-streaming */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { IReceiveResponse } from './IReceiveResponse'; import { StreamingRequest } from '../streamingRequest'; /** * Abstraction to define the characteristics of a streaming transport server. * Example possible implementations include WebSocket transport server or NamedPipe transport server. */ export interface IStreamingTransportServer { start(onListen?: () => void): Promise<string>; disconnect(): void; send(request: StreamingRequest): Promise<IReceiveResponse>; isConnected?: boolean; }
themes=( casper attila london massively bleak the-shell vapor pico # lyra ) for theme in "${themes[@]}" do cp -Rf "node_modules/$theme" content/themes done
def encrypt(string): result = "" for i in range(len(string)): char = string[i] # Encrypt uppercase characters if (char.isupper()): result += chr((ord(char) + 3 - 65) % 26 + 65) # Encrypt lowercase characters else: result += chr((ord(char) + 3 - 97) % 26 + 97) return result