text
stringlengths
1
1.05M
import Controller from "./Controller"; import { enableCultureSensitiveFormatting } from "cx/ui"; enableCultureSensitiveFormatting(); import { Repeater, ContentResolver } from "cx/widgets"; export default ({ repo }) => ( <cx> <div class="kpi-header" ws controller={{ type: Controller, repo }}> Recent Issues: <a href="#" onClick={(e, { store }) => { e.preventDefault(); store.toggle("$data.settings.visible"); }} > <strong text:bind="$data.repo" /> </a> </div> <div class="kpi-main" style="justify-content: start; align-items: start"> <ul> <Repeater records:bind="$data.issues"> <li> <a href:bind="$record.html_url" target="_blank" rel="noopener" text:bind="$record.title" /> </li> </Repeater> </ul> </div> <div class="kpi-footer"> <a href:tpl="https://github.com/{$data.repo}/issues" target="_blank" rel="noopener" > GitHub.com </a> </div> <ContentResolver visible:bind="$data.settings.visible" onResolve={() => System.import("./settings").then(x => x.default)} /> </cx> );
#!/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. ################################################################################ CACHE_DIR="$HOME/flink_cache" CACHE_BUILD_DIR="$CACHE_DIR/$TRAVIS_BUILD_NUMBER" CACHE_FLINK_DIR="$CACHE_BUILD_DIR/flink" HERE="`dirname \"$0\"`" # relative HERE="`( cd \"$HERE\" && pwd )`" # absolutized and normalized if [ -z "$HERE" ] ; then # error; for some reason, the path is not accessible # to the script (e.g. permissions re-evaled after suid) exit 1 # fail fi source "${HERE}/travis/fold.sh" source "${HERE}/travis/stage.sh" source "${HERE}/travis/shade.sh" function deleteOldCaches() { while read CACHE_DIR; do local old_number="${CACHE_DIR##*/}" if [ "$old_number" -lt "$TRAVIS_BUILD_NUMBER" ]; then echo "Deleting old cache $CACHE_DIR" rm -rf "$CACHE_DIR" fi done } # delete leftover caches from previous builds find "$CACHE_DIR" -mindepth 1 -maxdepth 1 | grep -v "$TRAVIS_BUILD_NUMBER" | deleteOldCaches function getCurrentStage() { STAGE_NUMBER=$(echo "$TRAVIS_JOB_NUMBER" | cut -d'.' -f 2) case $STAGE_NUMBER in (1) echo "$STAGE_COMPILE" ;; (2) echo "$STAGE_COMPILE" ;; (3) echo "$STAGE_CORE" ;; (4) echo "$STAGE_LIBRARIES" ;; (5) echo "$STAGE_CONNECTORS" ;; (6) echo "$STAGE_TESTS" ;; (7) echo "$STAGE_MISC" ;; (8) echo "$STAGE_CORE" ;; (9) echo "$STAGE_LIBRARIES" ;; (10) echo "$STAGE_CONNECTORS" ;; (11) echo "$STAGE_TESTS" ;; (12) echo "$STAGE_MISC" ;; (13) echo "$STAGE_CLEANUP" ;; (14) echo "$STAGE_CLEANUP" ;; (*) echo "Invalid stage detected ($STAGE_NUMBER)" return 1 ;; esac return 0 } STAGE=$(getCurrentStage) if [ $? != 0 ]; then echo "Could not determine current stage." exit 1 fi echo "Current stage: \"$STAGE\"" EXIT_CODE=0 # Run actual compile&test steps if [ $STAGE == "$STAGE_COMPILE" ]; then MVN="mvn clean install -nsu -Dflink.forkCount=2 -Dflink.forkCountTestPackage=2 -Dmaven.javadoc.skip=true -B -DskipTests $PROFILE" $MVN EXIT_CODE=$? if [ $EXIT_CODE == 0 ]; then printf "\n\n==============================================================================\n" printf "Checking dependency convergence\n" printf "==============================================================================\n" ./tools/check_dependency_convergence.sh EXIT_CODE=$? else printf "\n==============================================================================\n" printf "Previous build failure detected, skipping dependency-convergence check.\n" printf "==============================================================================\n" fi if [ $EXIT_CODE == 0 ]; then check_shaded_artifacts EXIT_CODE=$(($EXIT_CODE+$?)) check_shaded_artifacts_s3_fs hadoop EXIT_CODE=$(($EXIT_CODE+$?)) check_shaded_artifacts_s3_fs presto EXIT_CODE=$(($EXIT_CODE+$?)) check_shaded_artifacts_connector_elasticsearch "" EXIT_CODE=$(($EXIT_CODE+$?)) check_shaded_artifacts_connector_elasticsearch 2 EXIT_CODE=$(($EXIT_CODE+$?)) check_shaded_artifacts_connector_elasticsearch 5 EXIT_CODE=$(($EXIT_CODE+$?)) else echo "==============================================================================" echo "Previous build failure detected, skipping shaded dependency check." echo "==============================================================================" fi if [ $EXIT_CODE == 0 ]; then echo "Creating cache build directory $CACHE_FLINK_DIR" mkdir -p "$CACHE_FLINK_DIR" cp -r . "$CACHE_FLINK_DIR" function minimizeCachedFiles() { # reduces the size of the cached directory to speed up # the packing&upload / download&unpacking process # by removing files not required for subsequent stages # original jars find "$CACHE_FLINK_DIR" -maxdepth 8 -type f -name 'original-*.jar' | xargs rm -rf # .git directory # not deleting this can cause build stability issues # merging the cached version sometimes fails rm -rf "$CACHE_FLINK_DIR/.git" } start_fold "minimize_cache" "Minimizing cache" travis_time_start minimizeCachedFiles travis_time_finish end_fold "minimize_cache" else echo "==============================================================================" echo "Previous build failure detected, skipping cache setup." echo "==============================================================================" fi elif [ $STAGE != "$STAGE_CLEANUP" ]; then if ! [ -e $CACHE_FLINK_DIR ]; then echo "Cached flink dir $CACHE_FLINK_DIR does not exist. Exiting build." exit 1 fi # merged compiled flink into local clone # this prevents the cache from being re-uploaded start_fold "merge_cache" "Merging cache" travis_time_start cp -RT "$CACHE_FLINK_DIR" "." travis_time_finish end_fold "merge_cache" start_fold "adjust_timestamps" "Adjusting timestamps" travis_time_start # adjust timestamps to prevent recompilation find . -type f -name '*.java' | xargs touch find . -type f -name '*.scala' | xargs touch find . -type f -name '*.class' | xargs touch find . -type f -name '*.timestamp' | xargs touch travis_time_finish end_fold "adjust_timestamps" TEST="$STAGE" "./tools/travis_mvn_watchdog.sh" 300 EXIT_CODE=$? else echo "Cleaning up $CACHE_BUILD_DIR" rm -rf "$CACHE_BUILD_DIR" fi # Exit code for Travis build success/failure exit $EXIT_CODE
/** * @file 对vuex的mutation实现的核心类 */ // import {propertyPathUtil, DataProxy, cloneUtil} from 'my-store-adapter'
import sum from '../functions/sum.js'; import { piper } from 'tpipe'; import sumInputMapper from '../mappers/sum.mappers.js'; function massageAWSRequest(input, event, context) { return { ...input, ...event, parameters: { ...input.parameters, ...event.params, query: { ...event.params.queryString } } } } function massageAWSResponse(o, i, event, context, callback) { callback(null, o.body); } const sumPipe = piper(sum) .incorporate({ inputMappings: [massageAWSRequest] }) .input(sumInputMapper) .finally(massageAWSResponse) .pipe; export default sumPipe.getHandler()
#! /usr/bin/env bash # # Copyright 2020 by userdocs and contributors # # SPDX-License-Identifier: Apache-2.0 # # @author - userdocs # # @contributors IceCodeNew # # @credits - https://gist.github.com/notsure2 # # shellcheck disable=SC2034,SC1091 # Why are these checks excluded? # # https://github.com/koalaman/shellcheck/wiki/SC2034 There a quite a few variables defined by combining other variables that mean nothing on their own. This behavior is intentional and the warning can be skipped. # # https://github.com/koalaman/shellcheck/wiki/SC1091 I am sourcing /etc/os-release for some variables. It's not available to shellcheck to source and it's a safe file so we can skip this # # Script Formatting - https://marketplace.visualstudio.com/items?itemName=foxundermoon.shell-format # ##################################################################################################################################################### # Set some script features - https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html ##################################################################################################################################################### set -a ##################################################################################################################################################### # Unset some variables to set defaults. ##################################################################################################################################################### unset qb_skip_delete qb_skip_icu qb_git_proxy qb_curl_proxy qb_install_dir qb_build_dir qb_working_dir qb_modules_test qb_python_version qb_patches_url ##################################################################################################################################################### # Color me up Scotty - define some color values to use as variables in the scripts. ##################################################################################################################################################### cr="\e[31m" && clr="\e[91m" # [c]olor[r]ed && [c]olor[l]ight[r]ed cg="\e[32m" && clg="\e[92m" # [c]olor[g]reen && [c]olor[l]ight[g]reen cy="\e[33m" && cly="\e[93m" # [c]olor[y]ellow && [c]olor[l]ight[y]ellow cb="\e[34m" && clb="\e[94m" # [c]olor[b]lue && [c]olor[l]ight[b]lue cm="\e[35m" && clm="\e[95m" # [c]olor[m]agenta && [c]olor[l]ight[m]agenta cc="\e[36m" && clc="\e[96m" # [c]olor[c]yan && [c]olor[l]ight[c]yan # tb="\e[1m" && td="\e[2m" && tu="\e[4m" && tn="\n" # [t]ext[b]old && [t]ext[d]im && [t]ext[u]nderlined && [t]ext[n]ewline # cdef="\e[39m" # [c]olor[default] cend="\e[0m" # [c]olor[end] ##################################################################################################################################################### # CHeck we are on a supported OS and release. ##################################################################################################################################################### what_id="$(source /etc/os-release && printf "%s" "${ID}")" # Get the main platform name, for example: debian, ubuntu or alpine what_version_codename="$(source /etc/os-release && printf "%s" "${VERSION_CODENAME}")" # Get the codename for this this OS. Note, ALpine does not have a unique codename. what_version_id="$(source /etc/os-release && printf "%s" "${VERSION_ID}")" # Get the version number for this codename, for example: 10, 20.04, 3.12.4 # if [[ "${what_id}" =~ ^(alpine)$ ]]; then # If alpine, set the codename to alpine. We check for min v3.10 later with codenames. what_version_codename="alpine" fi # ## Check against allowed codenames or if the codename is alpine version greater thab 3.10 if [[ ! "${what_version_codename}" =~ ^(alpine|buster|bionic|focal)$ ]] || [[ "${what_version_codename}" =~ ^(alpine)$ && "${what_version_id//\./}" -lt "3100" ]]; then echo echo -e " ${cly}This is not a supported OS. There is no reason to continue.${cend}" echo echo -e " id: ${td}${cly}${what_id}${cend} codename: ${td}${cly}${what_version_codename}${cend} version: ${td}${clr}${what_version_id}${cend}" echo echo -e " ${td}These are the supported platforms${cend}" echo echo -e " ${clm}Debian${cend} - ${clb}buster${cend}" echo echo -e " ${clm}Ubuntu${cend} - ${clb}bionic${cend} - ${clb}focal${cend}" echo echo -e " ${clm}Alpine${cend} - ${clb}3.10.0${cend} or greater" echo exit fi ##################################################################################################################################################### # This function sets some default values we use but whose values can be overridden by certain flags ##################################################################################################################################################### set_default_values() { DEBIAN_FRONTEND="noninteractive" TZ="Europe/London" # For docker deploys to not get prompted to set the timezone. # qb_patches_url="" # Provide a git username and repo in this format - username/repo" - In this repo the structure needs to be like this /patches/libtorrent/1.2.11/patch and/or /patches/qbittorrent/4.3.1/patch and you patch file will be automatically fetched and loadded for those matching tags. # libtorrent_version='1.2' # Set this here so it is easy to see and change # qt_version='5.15' # Set this here so it is easy to see and change # qb_python_version="3" # we are only using python3 but it's easier to just change this if we need to. # qb_modules=("all" "install" "bison" "gawk" "glibc" "zlib" "icu" "openssl" "boost" "libtorrent" "qtbase" "qttools" "qbittorrent") # Define our list of available modules in an array. # delete=() # modules listed in this array will be removed from teh default list of modules, changing the behaviour of all or install # if [[ "${what_id}" =~ ^(alpine)$ ]]; then # if alpines delete modules we don't use and set the required packages array delete+=("bison" "gawk" "glibc") qb_required_pkgs=("bash" "bash-completion" "build-base" "curl" "pkgconf" "autoconf" "automake" "libtool" "git" "perl" "python${qb_python_version}" "python${qb_python_version}-dev" "py${qb_python_version}-numpy" "py${qb_python_version}-numpy-dev" "linux-headers") fi # if [[ "${what_id}" =~ ^(debian|ubuntu)$ ]]; then # if debian based set the required packages array qb_required_pkgs=("build-essential" "curl" "pkg-config" "automake" "libtool" "git" "perl" "python${qb_python_version}" "python${qb_python_version}-dev" "python${qb_python_version}-numpy") fi # if [[ "${1}" != 'install' ]]; then # remove this module by default unless provided as a first argument to the script. delete+=("install") fi # if [[ "${qb_skip_icu}" != 'no' ]]; then # skip icu by default unless the -i flag is used delete+=("icu") fi # qb_working_dir="$(printf "%s" "$(pwd <(dirname "${0}"))")" # Get the full path to the scripts location to use with setting some path related variables. qb_working_dir_short="${qb_working_dir/$HOME/\~}" # echo the working dir but replace the $HOME path with ~ # qb_install_dir="${qb_working_dir}/qb-build" # install relative to the script location. qb_install_dir_short="${qb_install_dir/$HOME/\~}" # echo the install dir but replace the $HOME path with ~ } ##################################################################################################################################################### # This function will check for a list of defined dependencies from the qb_required_pkgs array. Apps like python3 and python2 are dynamically set ##################################################################################################################################################### check_dependencies() { echo -e "${tn}${tb}Checking if required core dependencies are installed${cend}${tn}" # for pkg in "${qb_required_pkgs[@]}"; do # if [[ "${what_id}" =~ ^(alpine)$ ]]; then pkgman() { apk info -e "${pkg}"; } fi # if [[ "${what_id}" =~ ^(debian|ubuntu)$ ]]; then pkgman() { dpkg -s "${pkg}"; } fi # if pkgman > /dev/null 2>&1; then echo -e " Dependency - ${cg}OK${cend} - ${pkg}" else if [[ -n "${pkg}" ]]; then deps_installed='no' echo -e " Dependency - ${cr}NO${cend} - ${pkg}" qb_checked_required_pkgs+=("$pkg") fi fi done # if [[ "${deps_installed}" = 'no' ]]; then # Check if user is able to install the dependencies, if yes then do so, if no then exit. if [[ "$(id -un)" = 'root' ]]; then echo -e "${tn}${cg}Updating${cend}${tn}" # if [[ "${what_id}" =~ ^(alpine)$ ]]; then CDN_URL="http://dl-cdn.alpinelinux.org/alpine/latest-stable/main" apk update --repository="${CDN_URL}" apk upgrade --repository="${CDN_URL}" apk fix fi # if [[ "${what_id}" =~ ^(debian|ubuntu)$ ]]; then apt-get update -y apt-get upgrade -y apt-get autoremove -y fi # [[ -f /var/run/reboot-required ]] && { echo -e "${tn}${cr}This machine requires a reboot to continue installation. Please reboot now.${cend}${tn}" exit } # echo -e "${tn}${cg}Installing required dependencies${cend}${tn}" # if [[ "${what_id}" =~ ^(alpine)$ ]]; then if ! apk add "${qb_checked_required_pkgs[@]}" --repository="${CDN_URL}"; then echo exit fi fi # if [[ "${what_id}" =~ ^(debian|ubuntu)$ ]]; then if ! apt-get install -y "${qb_checked_required_pkgs[@]}"; then echo exit fi fi # echo -e "${tn}${cg}Dependencies installed!${cend}" # deps_installed='yes' else echo -e "${tn}${tb}Please request or install the missing core dependencies before using this script${cend}" # echo -e "${tn}apk add ${qb_checked_required_pkgs[*]}${tn}" # exit fi fi # ## All checks passed echo if [[ "${deps_installed}" != 'no' ]]; then echo -e "${tn}${tb}All checks - ${cg}OK${cend}${tb} - core dependencies are installed, continuing to build${cend}" fi } ##################################################################################################################################################### # 1: curl and git http/https proxy detection use -p username:pass@URL:PORT or -p URL:PORT ##################################################################################################################################################### while (("${#}")); do case "${1}" in -b | --build-directory) qb_build_dir="${2}" shift 2 ;; -p | --proxy) qb_git_proxy="${2}" qb_curl_proxy="${2}" shift 2 ;; -o | --optimize) optimize="-march=native" shift ;; -h-o | --help-optimize) echo echo -e "${tb}${tu}Here is the help description for this flag:${cend}" echo echo -e " ${cly}Warning, using this flag will mean your static build is limited to a matching CPU${cend}" echo echo -e " Example: ${clb}-o${cend}" echo echo -e " Additonal flags used: ${clc}-march=native${cend}" echo exit ;; -h-p | --help-proxy) echo echo -e "${tb}${tu}Here is the help description for this flag:${cend}" echo echo -e " Specify a proxy URL and PORT to use with curl and git" echo echo -e " ${td}Example:${cend} ${td}${clb}-p${cend} ${td}${clc}username:password@https://123.456.789.321:8443${cend}" echo echo -e " ${td}${clb}-p${cend} ${td}${clc}https://proxy.com:12345${cend}" echo echo -e " ${cy}You can use this flag with this help command to see the value if called before the help option:${cend}" echo echo -e " ${td}${clb}-p${cend} ${td}${clc}https://proxy.com:12345${cend} ${td}${clb}-h-p${cend}" echo [[ -n "${qb_curl_proxy}" ]] && echo -e " proxy command: ${clc}${qb_curl_proxy}${tn}${cend}" exit ;; --) # end argument parsing shift break ;; *) # preserve positional arguments params1+=("${1}") shift ;; esac done # eval set -- "${params1[@]}" # Set positional arguments in their proper place. ##################################################################################################################################################### # 2: curl test download functions - default is no proxy - curl is a test function and curl_curl is the command function ##################################################################################################################################################### curl_curl() { if [[ -z "${qb_curl_proxy}" ]]; then "$(type -P curl)" -sNL4fq --connect-timeout 5 --retry 5 --retry-delay 5 --retry-max-time 25 "${@}" else "$(type -P curl)" -sNL4fq --connect-timeout 5 --retry 5 --retry-delay 5 --retry-max-time 25 --proxy-insecure -x "${qb_curl_proxy}" "${@}" fi } curl() { if ! curl_curl "${@}"; then echo 'error_url' fi } curl_test() { curl_curl "${@}" } ##################################################################################################################################################### # 3: git test download functions - default is no proxy - git is a test function and git_git is the command function ##################################################################################################################################################### git_git() { if [[ -z "${qb_git_proxy}" ]]; then "$(type -P git)" "${@}" else "$(type -P git)" -c http.sslVerify=false -c http.https://github.com.proxy="${qb_git_proxy}" "${@}" fi } # git() { if [[ "${2}" = '-t' ]]; then url_test="${1}" tag_flag="${2}" tag_test="${3}" else url_test="${11}" # 11th place in our download folder function fi # if ! curl -I "${url_test%\.git}" &> /dev/null; then echo echo -e " ${cy}There is an issue with your proxy settings or network connection${cend}" echo exit fi # status="$( git_git ls-remote --exit-code "${url_test}" "${tag_flag}" "${tag_test}" &> /dev/null echo "${?}" )" # if [[ "${tag_flag}" = '-t' && "${status}" = '0' ]]; then echo "${tag_test}" elif [[ "${tag_flag}" = '-t' && "${status}" -ge '1' ]]; then echo 'error_tag' else if ! git_git "${@}"; then echo echo -e " ${cy}There is an issue with your proxy settings or network connection${cend}" echo exit fi fi } # test_git_ouput() { if [[ "${1}" = 'error_tag' ]]; then echo -e "${tn} ${cy}Sorry, the provided ${3} tag ${cr}$2${cend}${cy} is not valid${cend}" fi } ##################################################################################################################################################### # This function sets the build and installation directory. If the argument -b is used to set a build directory that directory is set and used. # If nothing is specified or the switch is not used it defaults to the hard-coded path relative to the scripts location - qbittorrent-build ##################################################################################################################################################### set_build_directory() { if [[ -n "${qb_build_dir}" ]]; then if [[ "${qb_build_dir}" =~ ^/ ]]; then qb_install_dir="${qb_build_dir}" qb_install_dir_short="${qb_install_dir/$HOME/\~}" else qb_install_dir="${qb_working_dir}/${qb_build_dir}" qb_install_dir_short="${qb_working_dir_short}/${qb_build_dir}" fi fi # ## Set lib and include directory paths based on install path. include_dir="${qb_install_dir}/include" lib_dir="${qb_install_dir}/lib" # ## Define some build specific variables PATH="${qb_install_dir}/bin:${HOME}/bin${PATH:+:${PATH}}" LD_LIBRARY_PATH="-L${lib_dir}" PKG_CONFIG_PATH="-L${lib_dir}/pkgconfig" } ##################################################################################################################################################### # This function sets some compiler flags globally - b2 settings are set in the ~/user-config.jam set in the installation_modules function ##################################################################################################################################################### custom_flags_set() { CXXFLAGS="${optimize/*/$optimize }-std=c++17" CPPFLAGS="${optimize/*/$optimize }--static -static -I${include_dir}" LDFLAGS="${optimize/*/$optimize }--static -static -Wl,--no-as-needed -L${lib_dir} -lpthread -pthread" } # custom_flags_reset() { CXXFLAGS="${optimize/*/$optimize }-std=c++17" CPPFLAGS="" LDFLAGS="" } ##################################################################################################################################################### # This function is where we set your URL that we use with other functions. ##################################################################################################################################################### set_module_urls() { bison_url="http://ftpmirror.gnu.org/gnu/bison/$(grep -Eo 'bison-([0-9]{1,3}[.]?)([0-9]{1,3}[.]?)([0-9]{1,3}?)\.tar.gz' <(curl http://ftpmirror.gnu.org/gnu/bison/) | sort -V | tail -1)" # gawk_url="http://ftpmirror.gnu.org/gnu/gawk/$(grep -Eo 'gawk-([0-9]{1,3}[.]?)([0-9]{1,3}[.]?)([0-9]{1,3}?)\.tar.gz' <(curl http://ftpmirror.gnu.org/gnu/gawk/) | sort -V | tail -1)" # # glibc_url="http://ftpmirror.gnu.org/gnu/libc/$(grep -Eo 'glibc-([0-9]{1,3}[.]?)([0-9]{1,3}[.]?)([0-9]{1,3}?)\.tar.gz' <(curl http://ftpmirror.gnu.org/gnu/libc/) | sort -V | tail -1)" glibc_url="http://ftpmirror.gnu.org/gnu/libc/glibc-2.31.tar.gz" # zlib_github_tag="$(grep -Eom1 'v1.2.([0-9]{1,2})' <(curl https://github.com/madler/zlib/releases))" zlib_url="https://github.com/madler/zlib/archive/${zlib_github_tag}.tar.gz" # icu_url="$(grep -Eom1 'ht(.*)icu4c(.*)-src.tgz' <(curl https://api.github.com/repos/unicode-org/icu/releases/latest))" # openssl_github_tag="$(grep -Eom1 'OpenSSL_1_1_([0-9][a-z])' <(curl "https://github.com/openssl/openssl/releases"))" openssl_url="https://github.com/openssl/openssl/archive/${openssl_github_tag}.tar.gz" # boost_version="$(sed -rn 's#(.*)e">Version (.*\.[0-9]{1,2})</s(.*)#\2#p' <(curl "https://www.boost.org/users/download/"))" boost_github_tag="boost-${boost_version}" boost_url="https://dl.bintray.com/boostorg/release/${boost_version}/source/boost_${boost_version//./_}.tar.gz" boost_url_status="$(curl_test -so /dev/null --head --write-out '%{http_code}' "https://dl.bintray.com/boostorg/release/${boost_version}/source/boost_${boost_version//./_}.tar.gz")" boost_github_url="https://github.com/boostorg/boost.git" # while [[ -z "${qtbase_github_tag}" && "${qtbase_page}" -le 3 ]]; do ((qtbase_page++)); qtbase_github_tag="$(grep -Eom1 "v${qt_version}.([0-9]{1,2})" <(curl "https://api.github.com/repos/qt/qtbase/tags?per_page=100&page=${qtbase_page}"))"; done qtbase_github_url="https://github.com/qt/qtbase.git" while [[ -z "${qttools_github_tag}" && "${qttools_page}" -le 3 ]]; do ((qttools_page++)); qttools_github_tag="$(grep -Eom1 "v${qt_version}.([0-9]{1,2})" <(curl "https://api.github.com/repos/qt/qttools/tags?per_page=100&page=${qttools_page}"))"; done qttools_github_url="https://github.com/qt/qttools.git" # libtorrent_github_url="https://github.com/arvidn/libtorrent.git" libtorrent_github_tag_default="$(grep -Eom1 "v${libtorrent_version}.([0-9]{1,2})" <(curl "https://github.com/arvidn/libtorrent/tags"))" libtorrent_github_tag="${libtorrent_github_tag:-$libtorrent_github_tag_default}" # qbittorrent_github_url="https://github.com/qbittorrent/qBittorrent.git" qbittorrent_github_tag_default="$(grep -Eom1 'release-([0-9]{1,4}\.?)+$' <(curl "https://github.com/qbittorrent/qBittorrent/tags"))" qbittorrent_github_tag="${qbitorrent_github_tag:-$qbittorrent_github_tag_default}" # url_test="$(curl -so /dev/null "https://www.google.com")" } ##################################################################################################################################################### # This function verifies the module names from the array qb_modules in the default values function. ##################################################################################################################################################### installation_modules() { params_count="${#}" params_test=1 # ## remove modules from the delete array from the qb_modules array for target in "${delete[@]}"; do for i in "${!qb_modules[@]}"; do if [[ "${qb_modules[i]}" = "${target}" ]]; then unset 'qb_modules[i]' fi done done # while [[ "${params_test}" -le "${params_count}" && "${params_count}" -gt '1' ]]; do if [[ "${qb_modules[*]}" =~ ${*:$params_test:1} ]]; then : else qb_modules_test="fail" fi params_test="$((params_test + 1))" done # if [[ "${params_count}" -le '1' ]]; then if [[ "${qb_modules[*]}" =~ ${*:$params_test:1} && -n "${*:$params_test:1}" ]]; then : else qb_modules_test="fail" fi fi # ## Activate all validated modules for installation and define some core variables. if [[ "${qb_modules_test}" != 'fail' ]]; then if [[ "${*}" =~ ([[:space:]]|^)"all"([[:space:]]|$) ]]; then for module in "${qb_modules[@]}"; do eval "skip_${module}=no" done else for module in "${@}"; do eval "skip_${module}=no" done fi # ## Create the directories we need. mkdir -p "${qb_install_dir}/logs" mkdir -p "${qb_install_dir}/completed" # ## Set some python variables we need. python_major="$(python"${qb_python_version}" -c "import sys; print(sys.version_info[0])")" python_minor="$(python"${qb_python_version}" -c "import sys; print(sys.version_info[1])")" python_micro="$(python"${qb_python_version}" -c "import sys; print(sys.version_info[2])")" # python_short_version="${python_major}.${python_minor}" python_link_version="${python_major}${python_minor}" # echo -e "using gcc : : : <cflags>${optimize/*/$optimize }-std=c++17 <cxxflags>${optimize/*/$optimize }-std=c++17 ;${tn}using python : ${python_short_version} : /usr/bin/python${python_short_version} : /usr/include/python${python_short_version} : /usr/lib/python${python_short_version} ;" > "$HOME/user-config.jam" # ## Echo the build directory. echo -e "${tn}${tb}Install Prefix${cend} : ${clc}${qb_install_dir_short}${cend}" # ## Some basic help echo -e "${tn}${tb}Script help${cend} : ${clc}${qb_working_dir_short}/$(basename -- "$0")${cend} ${clb}-h${cend}" else echo -e "${tn} ${cr}One or more of the provided modules are not supported${cend}" echo -e "${tn}${tb}This is a list of supported modules${cend}" echo -e "${tn} ${clm}${qb_modules[*]}${tn}${cend}" exit fi } ##################################################################################################################################################### # This function will test to see if a Jamfile patch file exists via the variable patches_github_url for the tag used. ##################################################################################################################################################### apply_patches() { patch_app_name="${1}" # Libtorrent has two tag formats libtorrent-1_2_11 and the newer v1.2.11. Moving forward v1.2.11 is the standard format. Make sure we always get the same outcome for either [[ "${libtorrent_github_tag}" =~ ^RC_ ]] && libtorrent_patch_tag="${libtorrent_github_tag}" [[ "${libtorrent_github_tag}" =~ ^libtorrent- ]] && libtorrent_patch_tag="${libtorrent_github_tag#libtorrent-}" && libtorrent_patch_tag="${libtorrent_patch_tag//_/\.}" [[ "${libtorrent_github_tag}" =~ ^v[0-9] ]] && libtorrent_patch_tag="${libtorrent_github_tag#v}" # # qbittorrent has a consistent tag format of release-4.3.1. qbittorrent_patch_tag="${qbittorrent_github_tag#release-}" # if [[ "${patch_app_name}" == 'bootstrap-help' ]]; then return fi # if [[ "${patch_app_name}" == 'bootstrap' ]]; then mkdir -p "${qb_install_dir}/patches/libtorrent/${libtorrent_patch_tag}" mkdir -p "${qb_install_dir}/patches/qbittorrent/${qbittorrent_patch_tag}" else patch_tag="${patch_app_name}_patch_tag" patch_dir="${qb_install_dir}/patches/${patch_app_name}/${!patch_tag}" patch_file="${patch_dir}/patch" patch_file_url="https://raw.githubusercontent.com/${qb_patches_url}/master/patches/${patch_app_name}/${!patch_tag}/patch" patch_jamfile="${qb_install_dir}/libtorrent/Jamfile" patch_jamfile_url="https://raw.githubusercontent.com/${qb_patches_url}/master/patches/${patch_app_name}/${!patch_tag}/Jamfile" # [[ ! -d "${patch_dir}" ]] && mkdir -p "${patch_dir}" # if [[ -f "${patch_file}" ]]; then [[ "${patch_app_name}" == 'libtorrent' ]] && echo # purely comsetic echo -e "${cr} Using ${!patch_tag} existing patch file${cend}" [[ "${patch_app_name}" == 'qbittorrent' ]] && echo # purely comsetic else if curl_test "${patch_file_url}" -o "${patch_file}"; then [[ "${patch_app_name}" == 'libtorrent' ]] && echo # purely comsetic echo -e "${cr} Using ${!patch_tag} downloaded patch file${cend}" [[ "${patch_app_name}" == 'qbittorrent' ]] && echo # purely comsetic fi fi # if [[ "${patch_app_name}" == 'libtorrent' ]]; then if [[ -f "${patch_dir}/Jamfile" ]]; then cp -f "${patch_dir}/Jamfile" "${patch_jamfile}" echo echo -e "${cr} Using existing custom Jamfile file${cend}" echo elif curl_test "${patch_jamfile_url}" -o "${patch_jamfile}"; then echo echo -e "${cr} Using downloaded custom Jamfile file${cend}" echo else curl_test "https://raw.githubusercontent.com/arvidn/libtorrent/${libtorrent_patch_tag}/Jamfile" -o "${patch_jamfile}" echo echo -e "${cr} Using libtorrent branch master Jamfile file${cend}" echo fi fi # [[ -f "${patch_file}" ]] && patch -p1 < "${patch_file}" fi } ##################################################################################################################################################### # This function is to test a directory exists before attemtping to cd and fail with and exit code if it doesn't. ##################################################################################################################################################### _cd() { if cd "${1}" > /dev/null 2>&1; then cd "${1}" || exit else echo -e "This directory does not exist. There is a problem" echo echo -e "${clr}${1}${cend}" echo exit 1 fi } ##################################################################################################################################################### # This function is for downloading source code archives ##################################################################################################################################################### download_file() { if [[ -n "${1}" ]]; then url_filename="${2}" [[ -n "${3}" ]] && subdir="/${3}" || subdir="" echo -e "${tn}${cg}Installing $1${cend}${tn}" file_name="${qb_install_dir}/${1}.tar.gz" [[ -f "${file_name}" ]] && rm -rf {"${qb_install_dir:?}/$(tar tf "${file_name}" | grep -Eom1 "(.*)[^/]")","${file_name}"} curl "${url_filename}" -o "${file_name}" tar xf "${file_name}" -C "${qb_install_dir}" app_dir="${qb_install_dir}/$(tar tf "${file_name}" | head -1 | cut -f1 -d"/")${subdir}" mkdir -p "${app_dir}" _cd "${app_dir}" else echo echo "You must provide a filename name for the function - download_file" echo "It creates the name from the appname_github_tag variable set in the URL section" echo echo "download_file filename url" echo exit fi } ##################################################################################################################################################### # This function is for downloading git releases based on their tag. ##################################################################################################################################################### download_folder() { if [[ -n "${1}" ]]; then github_tag="${1}_github_tag" url_github="${2}" [[ -n "${3}" ]] && subdir="/${3}" || subdir="" echo -e "${tn}${cg}Installing ${1}${cend}${tn}" folder_name="${qb_install_dir}/${1}" folder_inc="${qb_install_dir}/include/${1}" [[ -d "${folder_name}" ]] && rm -rf "${folder_name}" [[ "${1}" == 'libtorrent' && -d "${folder_inc}" ]] && rm -rf "${folder_inc}" git clone --no-tags --single-branch --branch "${!github_tag}" --shallow-submodules --recurse-submodules -j"$(nproc)" --depth 1 "${url_github}" "${folder_name}" mkdir -p "${folder_name}${subdir}" [[ -d "${folder_name}${subdir}" ]] && _cd "${folder_name}${subdir}" else echo echo "You must provide a tag name for the function - download_folder" echo "It creates the tag from the appname_github_tag variable set in the URL section" echo echo "download_folder tagname url subdir" echo exit fi } ##################################################################################################################################################### # This function is for removing files and folders we no longer need ##################################################################################################################################################### delete_function() { if [[ -n "${1}" ]]; then if [[ -z "${qb_skip_delete}" ]]; then [[ "$2" = 'last' ]] && echo -e "${tn}${clr}Deleting $1 installation files and folders${cend}${tn}" || echo -e "${tn}${clr}Deleting ${1} installation files and folders${cend}" # file_name="${qb_install_dir}/${1}.tar.gz" folder_name="${qb_install_dir}/${1}" [[ -f "${file_name}" ]] && rm -rf {"${qb_install_dir:?}/$(tar tf "${file_name}" | grep -Eom1 "(.*)[^/]")","${file_name}"} [[ -d "${folder_name}" ]] && rm -rf "${folder_name}" [[ -d "${qb_working_dir}" ]] && _cd "${qb_working_dir}" else [[ "${2}" = 'last' ]] && echo -e "${tn}${clr}Skipping $1 deletion${cend}${tn}" || echo -e "${tn}${clr}Skipping ${1} deletion${cend}" fi else echo echo "The delete_function works in tandem with the application_name function" echo "Set the appname using the application_name function then use this function." echo echo "delete_function appname" echo exit fi } ##################################################################################################################################################### # This function sets the name of the application to be used with the functions download_file/folder and delete_function ##################################################################################################################################################### application_name() { last_app_name="skip_${app_name}" app_name="${1}" app_name_skip="skip_${app_name}" app_url="${app_name}_url" app_github_url="${app_name}_github_url" } ##################################################################################################################################################### # This function skips the deletion of the -n flag is supplied ##################################################################################################################################################### application_skip() { if [[ "${1}" = 'last' ]]; then echo -e "${tn}Skipping ${clm}$app_name${cend} module installation${tn}" else echo -e "${tn}Skipping ${clm}$app_name${cend} module installation" fi } ##################################################################################################################################################### # This function installs qt ##################################################################################################################################################### install_qbittorrent() { if [[ -f "${qb_install_dir}/completed/qbittorrent-nox" ]]; then # if [[ "$(id -un)" = 'root' ]]; then mkdir -p "/usr/local/bin" cp -rf "${qb_install_dir}/completed/qbittorrent-nox" "/usr/local/bin" else mkdir -p "${HOME}/bin" cp -rf "${qb_install_dir}/completed/qbittorrent-nox" "${HOME}/bin" fi # echo -e " ${tn}${tu}qbittorrent-nox has been installed!${cend}${tn}" echo -e " Run it using this command:${tn}" # [[ "$(id -un)" = 'root' ]] && echo -e " ${cg}qbittorrent-nox${cend}${tn}" || echo -e " ${cg}~/bin/qbittorrent-nox${cend}${tn}" # exit else echo -e "${tn}qbittorrent-nox has not been built to the defined install directory:${tn}" echo -e "${cg}${qb_install_dir_short}/completed${cend}${tn}" echo -e "Please build it using the script first then install${tn}" # exit fi } ##################################################################################################################################################### # Functions part 1: Use some of our functions ##################################################################################################################################################### set_default_values "${@}" # see functions # check_dependencies # see functions # set_build_directory # see functions # set_module_urls # see functions ##################################################################################################################################################### # This section controls our flags that we can pass to the script to modify some variables and behavior. ##################################################################################################################################################### while (("${#}")); do case "${1}" in -bs | --boot-strap) apply_patches bootstrap echo echo -e " ${cly}Using the defaults, these directories have been created:${cend}" echo echo -e " ${clc}$qb_install_dir_short/patches/libtorrent/${libtorrent_patch_tag}${cend}" echo echo -e " ${clc}$qb_install_dir_short/patches/qbittorrent/${qbittorrent_patch_tag}${cend}" echo echo -e " If a patch file, named ${cg}patch${cend} is found in these directories it will be applied to the relevant module with a matching tag." echo exit ;; -d | --debug) lt_debug="debug-symbols=on" qb_debug="--enable-debug" shift ;; -n | --no-delete) qb_skip_delete='yes' shift ;; -i | --icu) qb_skip_icu='no' [[ "${qb_skip_icu}" = 'no' ]] && delete=("${delete[@]/icu/}") shift ;; -m | --master) libtorrent_github_tag="$(git "${libtorrent_github_url}" -t "RC_${libtorrent_version//./_}")" test_git_ouput "${libtorrent_github_tag}" "RC_${libtorrent_version//./_}" "libtorrent" # qbittorrent_github_tag="$(git "${qbittorrent_github_url}" -t "master")" test_git_ouput "${qbittorrent_github_tag}" "master" "qbittorrent" shift ;; -lm | --libtorrent-master) libtorrent_github_tag="$(git "${libtorrent_github_url}" -t "RC_${libtorrent_version//./_}")" test_git_ouput "${libtorrent_github_tag}" "RC_${libtorrent_version//./_}" "libtorrent" shift ;; -lt | --libtorrent-tag) libtorrent_github_tag="$(git "${libtorrent_github_url}" -t "$2")" test_git_ouput "${libtorrent_github_tag}" "$2" "libtorrent" shift 2 ;; -pr | --patch-repo) if [[ "$(curl "https://github.com/${2}")" != 'error_url' ]]; then qb_patches_url="${2}" else echo echo -e " ${cy}This repo does not exist:${cend}" echo echo -e " https://github.com/${2}" echo echo -e " ${cy}Please provide a valid username and repo.${cend}" echo exit fi shift 2 ;; -qm | --qbittorrent-master) qbittorrent_github_tag="$(git "${qbittorrent_github_url}" -t "master")" test_git_ouput "${qbittorrent_github_tag}" "master" "qbittorrent" shift ;; -qt | --qbittorrent-tag) qbittorrent_github_tag="$(git "${qbittorrent_github_url}" -t "$2")" test_git_ouput "${qbittorrent_github_tag}" "$2" "qbittorrent" shift 2 ;; -h | --help) echo echo -e "${tb}${tu}Here are a list of available options${cend}" echo echo -e " ${cg}Use:${cend} ${clb}-b${cend} ${td}or${cend} ${clb}--build-directory${cend} ${cy}Help:${cend} ${clb}-h-b${cend} ${td}or${cend} ${clb}--help-build-directory${cend}" echo -e " ${cg}Use:${cend} ${clb}-d${cend} ${td}or${cend} ${clb}--debug${cend} ${cy}Help:${cend} ${clb}-h-d${cend} ${td}or${cend} ${clb}--help-debug${cend}" echo -e " ${cg}Use:${cend} ${clb}-bs${cend} ${td}or${cend} ${clb}--boot-strap${cend} ${cy}Help:${cend} ${clb}-h-bs${cend} ${td}or${cend} ${clb}--help-boot-strap${cend}" echo -e " ${cg}Use:${cend} ${clb}-i${cend} ${td}or${cend} ${clb}--icu${cend} ${cy}Help:${cend} ${clb}-h-i${cend} ${td}or${cend} ${clb}--help-icu${cend}" echo -e " ${cg}Use:${cend} ${clb}-lm${cend} ${td}or${cend} ${clb}--libtorrent-master${cend} ${cy}Help:${cend} ${clb}-h-lm${cend} ${td}or${cend} ${clb}--help-libtorrent-master${cend}" echo -e " ${cg}Use:${cend} ${clb}-lt${cend} ${td}or${cend} ${clb}--libtorrent-tag${cend} ${cy}Help:${cend} ${clb}-h-lt${cend} ${td}or${cend} ${clb}--help-libtorrent-tag${cend}" echo -e " ${cg}Use:${cend} ${clb}-m${cend} ${td}or${cend} ${clb}--master${cend} ${cy}Help:${cend} ${clb}-h-m${cend} ${td}or${cend} ${clb}--help-master${cend}" echo -e " ${cg}Use:${cend} ${clb}-n${cend} ${td}or${cend} ${clb}--no-delete${cend} ${cy}Help:${cend} ${clb}-h-n${cend} ${td}or${cend} ${clb}--help-no-delete${cend}" echo -e " ${cg}Use:${cend} ${clb}-o${cend} ${td}or${cend} ${clb}--optimize${cend} ${cy}Help:${cend} ${clb}-h-o${cend} ${td}or${cend} ${clb}--help-optimize${cend}" echo -e " ${cg}Use:${cend} ${clb}-p${cend} ${td}or${cend} ${clb}--proxy${cend} ${cy}Help:${cend} ${clb}-h-p${cend} ${td}or${cend} ${clb}--help-proxy${cend}" echo -e " ${cg}Use:${cend} ${clb}-pr${cend} ${td}or${cend} ${clb}--patch-repo${cend} ${cy}Help:${cend} ${clb}-h-pr${cend} ${td}or${cend} ${clb}--help-patch-repo${cend}" echo -e " ${cg}Use:${cend} ${clb}-qm${cend} ${td}or${cend} ${clb}--qbittorrent-master${cend} ${cy}Help:${cend} ${clb}-h-qm${cend} ${td}or${cend} ${clb}--help-qbittorrent-master${cend}" echo -e " ${cg}Use:${cend} ${clb}-qt${cend} ${td}or${cend} ${clb}--qbittorrent-tag${cend} ${cy}Help:${cend} ${clb}-h-qt${cend} ${td}or${cend} ${clb}--help-qbittorrent-tag${cend}" echo echo -e "${tb}${tu}Module specific help - flags are used with the modules listed here.${cend}" echo echo -e " ${cg}Use:${cend} ${clm}all${cend} ${td}or${cend} ${clm}module-name${cend} ${cg}Usage:${cend} ${clc}${qb_working_dir_short}/$(basename -- "$0")${cend} ${clm}all${cend} ${clb}-i${cend}" echo echo -e " ${td}${clm}all${cend} ${td}-${cend} ${td}Install all modules${cend}" echo -e " ${td}${clm}install${cend} ${td}-${cend} ${td}${cly}optional${cend} ${td}Install the ${td}${clc}${qb_install_dir_short}/completed/qbittorrent-nox${cend} ${td}binary${cend}" [[ "${what_id}" =~ ^(debian|ubuntu)$ ]] && echo -e "${td} ${clm}bison${cend} ${td}-${cend} ${td}${clr}required${cend} ${td}Build bison${cend}" [[ "${what_id}" =~ ^(debian|ubuntu)$ ]] && echo -e " ${td}${clm}gawk${cend} ${td}-${cend} ${td}${clr}required${cend} ${td}Build gawk${cend}" [[ "${what_id}" =~ ^(debian|ubuntu)$ ]] && echo -e " ${td}${clm}glibc${cend} ${td}-${cend} ${td}${clr}required${cend} ${td}Build libc locally to statically link nss${cend}" echo -e " ${td}${clm}zlib${cend} ${td}-${cend} ${td}${clr}required${cend} ${td}Build zlib locally${cend}" echo -e " ${td}${clm}icu${cend} ${td}-${cend} ${td}${cly}optional${cend} ${td}Build ICU locally${cend}" echo -e " ${td}${clm}openssl${cend} ${td}-${cend} ${td}${clr}required${cend} ${td}Build openssl locally${cend}" echo -e " ${td}${clm}boost${cend} ${td}-${cend} ${td}${clr}required${cend} ${td}Download, extract and build the boost library files${cend}" echo -e " ${td}${clm}qtbase${cend} ${td}-${cend} ${td}${clr}required${cend} ${td}Build qtbase locally${cend}" echo -e " ${td}${clm}qttools${cend} ${td}-${cend} ${td}${clr}required${cend} ${td}Build qttools locally${cend}" echo -e " ${td}${clm}libtorrent${cend} ${td}-${cend} ${td}${clr}required${cend} ${td}Build libtorrent locally with b2${cend}" echo -e " ${td}${clm}qbittorrent${cend} ${td}-${cend} ${td}${clr}required${cend} ${td}Build qbitorrent locally${cend}" echo exit ;; -h-b | --help-build-directory) echo echo -e "${tb}${tu}Here is the help description for this flag:${cend}" echo echo -e " Default build location: ${cc}${qb_install_dir_short}${cend}" echo echo -e " ${clb}-b${cend} or ${clb}--build-directory${cend} to set the location of the build directory." echo echo -e " ${cy}Paths are relative to the script location. I recommend that you use a full path.${cend}" echo echo -e " ${td}Example:${cend} ${td}${cg}${qb_working_dir_short}/$(basename -- "$0")${cend} ${td}${clm}all${cend} ${td}- Will install all modules and build libtorrent to the default build location${cend}" echo echo -e " ${td}Example:${cend} ${td}${cg}${qb_working_dir_short}/$(basename -- "$0")${cend} ${td}${clm}all ${clb}-b${cend} ${td}${clc}\"\$HOME/build\"${cend} ${td}- Will specify a build directory and install all modules to that custom location${cend}" echo echo -e " ${td}Example:${cend} ${td}${cg}${qb_working_dir_short}/$(basename -- "$0")${cend} ${td}${clm}module${cend} ${td}- Will install a single module to the default build location${cend}" echo echo -e " ${td}Example:${cend} ${td}${cg}${qb_working_dir_short}/$(basename -- "$0")${cend} ${td}${clm}module${cend} ${clb}-b${cend} ${td}${clc}\"\$HOME/build\"${cend} ${td}- will specify a custom build directory and install a specific module use to that custom location${cend}" # echo exit ;; -h-bs | --help-boot-strap) apply_patches bootstrap-help echo echo -e "${tb}${tu}Here is the help description for this flag:${cend}" echo echo -e " Creates dirs in this structure: ${cc}${qb_install_dir_short}/patches/APPNAME/TAG/patch${cend}" echo echo -e " Add you patches there, for example." echo echo -e " ${cc}${qb_install_dir_short}/patches/libtorrent/${libtorrent_patch_tag}/patch${cend}" echo echo -e " ${cc}${qb_install_dir_short}/patches/qbittorrent/${qbittorrent_patch_tag}/patch${cend}" echo exit ;; -h-d | --help-debug) echo echo -e "${tb}${tu}Here is the help description for this flag:${cend}" echo echo -e " Enables debug symbols for libtorrent and qbitorrent when building" echo exit ;; -h-n | --help-no-delete) echo echo -e "${tb}${tu}Here is the help description for this flag:${cend}" echo echo -e " Skip all delete functions for selected modules to leave source code directories behind." echo echo -e " ${td}This flag is provided with no arguments.${cend}" echo echo -e " ${clb}-n${cend}" echo exit ;; -h-i | --help-icu) echo echo -e "${tb}${tu}Here is the help description for this flag:${cend}" echo echo -e " Use ICU libraries when building qBittorrent. Final binary size will be around ~50Mb" echo echo -e " ${td}This flag is provided with no arguments.${cend}" echo echo -e " ${clb}-i${cend}" echo exit ;; -h-m | --help-master) echo echo -e "${tb}${tu}Here is the help description for this flag:${cend}" echo echo -e " Always use the master branch for ${cg}libtorrent RC_${libtorrent_version//./_}${cend}" echo echo -e " Always use the master branch for ${cg}qBittorrent ${qbittorrent_github_tag/release-/}${cend}" echo echo -e " ${td}This flag is provided with no arguments.${cend}" echo echo -e " ${clb}-lm${cend}" echo exit ;; -h-lm | --help-libtorrent-master) echo echo -e "${tb}${tu}Here is the help description for this flag:${cend}" echo echo -e " Always use the master branch for ${cg}libtorrent-$libtorrent_version${cend}" echo echo -e " This master that will be used is: ${cg}RC_${libtorrent_version//./_}${cend}" echo echo -e " ${td}This flag is provided with no arguments.${cend}" echo echo -e " ${clb}-lm${cend}" echo exit ;; -h-lt | --help-libtorrent-tag) echo echo -e "${tb}${tu}Here is the help description for this flag:${cend}" echo echo -e " Use a provided libtorrent tag when cloning from github." echo echo -e " ${cy}You can use this flag with this help command to see the value if called before the help option.${cend}" echo echo -e " ${cg}${qb_working_dir_short}/$(basename -- "$0")${cend}${clb} -lt ${clc}RC_2_0${cend} ${clb}-h-lt${cend}" if [[ ! "${libtorrent_github_tag}" =~ (error_tag|error_22) ]]; then echo echo -e " ${td}This is tag that will be used is: ${cg}$libtorrent_github_tag${cend}" fi echo echo -e " ${td}This flag must be provided with arguments.${cend}" echo echo -e " ${clb}-lt${cend} ${clc}libtorrent-1_2_11${cend}" echo exit ;; -h-pr | --help-patch-repo) apply_patches bootstrap-help echo echo -e "${tb}${tu}Here is the help description for this flag:${cend}" echo echo -e " Specify a username and repo to use patches hosted on github${cend}" echo echo -e " ${cg}Example:${cend} ${clb}-pr${cend} ${clc}usnerame/repo${cend}" echo echo -e " ${cy}There is a specific github directory format you need to use with this flag${cend}" echo echo -e " ${clc}patches/libtorrent/$libtorrent_patch_tag/patch${cend}" echo -e " ${clc}patches/libtorrent/$libtorrent_patch_tag/Jamfile${cend} ${clr}(defaults to branch master)${cend}" echo echo -e " ${clc}patches/qbittorrent/$qbittorrent_patch_tag/patch${cend}" echo echo -e " ${cy}If an installation tag matches a hosted tag patch file, it will be automaticlaly used.${cend}" echo echo -e " The tag name will alway be an abbreviated version of the default or specificed tag.${cend}" echo exit ;; -h-qm | --help-qbittorrent-master) echo echo -e "${tb}${tu}Here is the help description for this flag:${cend}" echo echo -e " Always use the master branch for ${cg}qBittorrent${cend}" echo echo -e " This master that will be used is: ${cg}master${cend}" echo echo -e " ${td}This flag is provided with no arguments.${cend}" echo echo -e " ${clb}-qm${cend}" echo exit ;; -h-qt | --help-qbittorrent-tag) echo echo -e "${tb}${tu}Here is the help description for this flag:${cend}" echo echo -e " Use a provided qBittorrent tag when cloning from github." echo echo -e " ${cy}You can use this flag with this help command to see the value if called before the help option.${cend}" echo echo -e " ${cg}${qb_working_dir_short}/$(basename -- "$0")${cend}${clb} -qt ${clc}release-4.3.0.1${cend} ${clb}-h-qt${cend}" # if [[ ! "${qbittorrent_github_tag}" =~ (error_tag|error_22) ]]; then echo echo -e " ${td}This tag that will be used is: ${cg}$qbittorrent_github_tag${cend}" fi echo echo -e " ${td}This flag must be provided with arguments.${cend}" echo echo -e " ${clb}-qt${cend} ${clc}release-4.3.0.1${cend}" echo exit ;; --) # end argument parsing shift break ;; -*) # unsupported flags echo -e "${tn}Error: Unsupported flag ${cr}$1${cend} - use ${cg}-h${cend} or ${cg}--help${cend} to see the valid options${tn}" >&2 exit 1 ;; *) # preserve positional arguments params2+=("${1}") shift ;; esac done # eval set -- "${params2[@]}" # Set positional arguments in their proper place. ##################################################################################################################################################### # Functions part 2: Use some of our functions ##################################################################################################################################################### [[ "${*}" =~ ([[:space:]]|^)"install"([[:space:]]|$) ]] && install_qbittorrent "${@}" # see functions ##################################################################################################################################################### # Lets dip out now if we find that any github tags failed validation ##################################################################################################################################################### [[ "${url_test}" = "error_url" ]] && { echo echo -e " ${cy}There is an issue with your proxy settings or network connection${cend}" echo exit } # [[ "${libtorrent_github_tag}" = "error_tag" || "${qbittorrent_github_tag}" = "error_tag" ]] && { echo exit } ##################################################################################################################################################### # Functions part 3: Use some of our functions ##################################################################################################################################################### installation_modules "${@}" # see functions ##################################################################################################################################################### # bison installation ##################################################################################################################################################### application_name bison # if [[ "${!app_name_skip:-yes}" = 'no' || "${1}" = "${app_name}" ]]; then custom_flags_reset download_file "${app_name}" "${!app_url}" # ./configure --prefix="${qb_install_dir}" 2>&1 | tee "${qb_install_dir}/logs/${app_name}.log.txt" make -j"$(nproc)" CXXFLAGS="${CXXFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" make install 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" # delete_function "${app_name}" else application_skip fi ##################################################################################################################################################### # gawk installation ##################################################################################################################################################### application_name gawk # if [[ "${!app_name_skip:-yes}" = 'no' || "$1" = "${app_name}" ]]; then custom_flags_reset download_file "${app_name}" "${!app_url}" # ./configure --prefix="$qb_install_dir" 2>&1 | tee "${qb_install_dir}/logs/${app_name}.log.txt" make -j"$(nproc)" CXXFLAGS="${CXXFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" make install 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" # delete_function "${app_name}" else application_skip fi ##################################################################################################################################################### # glibc installation ##################################################################################################################################################### application_name glibc # if [[ "${!app_name_skip:-yes}" = 'no' || "${1}" = "${app_name}" ]]; then custom_flags_reset download_file "${app_name}" "${!app_url}" # mkdir -p build _cd "${app_dir}/build" "${app_dir}/configure" --prefix="${qb_install_dir}" --enable-static-nss 2>&1 | tee "${qb_install_dir}/logs/${app_name}.log.txt" make -j"$(nproc)" 2>&1 | tee -a "${qb_install_dir}/logs/$app_name.log.txt" make install 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" # delete_function "${app_name}" else application_skip fi ##################################################################################################################################################### # zlib installation ##################################################################################################################################################### application_name zlib # if [[ "${!app_name_skip:-yes}" = 'no' || "${1}" = "${app_name}" ]]; then custom_flags_set download_file "${app_name}" "${!app_url}" # ./configure --prefix="${qb_install_dir}" --static 2>&1 | tee "${qb_install_dir}/logs/${app_name}.log.txt" make -j"$(nproc)" CXXFLAGS="${CXXFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" make install 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" # delete_function "${app_name}" else application_skip fi ##################################################################################################################################################### # ICU installation ##################################################################################################################################################### application_name icu # if [[ "${!app_name_skip:-yes}" = 'no' || "${1}" = "${app_name}" ]]; then custom_flags_reset download_file "${app_name}" "${!app_url}" "/source" # ./configure --prefix="${qb_install_dir}" --disable-shared --enable-static CXXFLAGS="${CXXFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" 2>&1 | tee "${qb_install_dir}/logs/${app_name}.log.txt" make -j"$(nproc)" 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" make install 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" # delete_function "${app_name}" else application_skip fi ##################################################################################################################################################### # openssl installation ##################################################################################################################################################### application_name openssl # if [[ "${!app_name_skip:-yes}" = 'no' || "${1}" = "${app_name}" ]]; then custom_flags_set download_file "${app_name}" "${!app_url}" # ./config --prefix="${qb_install_dir}" threads no-shared no-dso no-comp CXXFLAGS="${CXXFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" 2>&1 | tee "${qb_install_dir}/logs/${app_name}.log.txt" make -j"$(nproc)" 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" make install_sw install_ssldirs 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" # delete_function "${app_name}" else application_skip fi ##################################################################################################################################################### # boost libraries install ##################################################################################################################################################### application_name boost # if [[ "${!app_name_skip:-yes}" = 'no' ]] || [[ "${1}" = "${app_name}" ]]; then custom_flags_set # [[ -d "${qb_install_dir}/boost" ]] && delete_function "${app_name}" # if [[ "${boost_url_status}" =~ (200) ]]; then download_file "${app_name}" "${boost_url}" mv -f "${qb_install_dir}/boost_${boost_version//./_}/" "${qb_install_dir}/boost" _cd "${qb_install_dir}/boost" fi # if [[ "${boost_url_status}" =~ (403|404) ]]; then download_folder "${app_name}" "${!app_github_url}" fi # "${qb_install_dir}/boost/bootstrap.sh" 2>&1 | tee "${qb_install_dir}/logs/${app_name}.log.txt" else application_skip fi ##################################################################################################################################################### # libtorrent installation ##################################################################################################################################################### application_name libtorrent # if [[ "${!app_name_skip:-yes}" = 'no' ]] || [[ "${1}" = "${app_name}" ]]; then if [[ ! -d "${qb_install_dir}/boost" ]]; then echo -e "${tn}${clr}Warning${cend} - You must install the boost module before you can use the libtorrent module" echo else custom_flags_set download_folder "${app_name}" "${!app_github_url}" # apply_patches "${app_name}" # BOOST_ROOT="${qb_install_dir}/boost" BOOST_INCLUDEDIR="${qb_install_dir}/boost" BOOST_BUILD_PATH="${qb_install_dir}/boost" # "${qb_install_dir}/boost/b2" -j"$(nproc)" address-model="$(getconf LONG_BIT)" "${lt_debug}" optimization=speed cxxstd=17 dht=on encryption=on crypto=openssl i2p=on extensions=on variant=release threading=multi link=static boost-link=static cxxflags="${CXXFLAGS}" cflags="${CPPFLAGS}" linkflags="${LDFLAGS}" install --prefix="${qb_install_dir}" 2>&1 | tee "${qb_install_dir}/logs/${app_name}.log.txt" # delete_function "${app_name}" fi else application_skip fi ##################################################################################################################################################### # qtbase installation ##################################################################################################################################################### application_name qtbase # if [[ "${!app_name_skip:-yes}" = 'no' ]] || [[ "${1}" = "${app_name}" ]]; then custom_flags_set download_folder "${app_name}" "${!app_github_url}" # [[ "${qb_skip_icu}" = 'no' ]] && icu='-icu' || icu='-no-icu' ./configure -prefix "${qb_install_dir}" "${icu}" -opensource -confirm-license -release -openssl-linked -static -c++std c++17 -qt-pcre -no-iconv -no-feature-glib -no-feature-opengl -no-feature-dbus -no-feature-gui -no-feature-widgets -no-feature-testlib -no-compile-examples -I "${include_dir}" -L "${lib_dir}" QMAKE_LFLAGS="${LDFLAGS}" 2>&1 | tee "${qb_install_dir}/logs/${app_name}.log.txt" make -j"$(nproc)" 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" make install 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" # delete_function "${app_name}" else application_skip fi ##################################################################################################################################################### # qttools installation ##################################################################################################################################################### application_name qttools # if [[ "${!app_name_skip:-yes}" = 'no' ]] || [[ "${1}" = "${app_name}" ]]; then custom_flags_set download_folder "${app_name}" "${!app_github_url}" # "${qb_install_dir}/bin/qmake" -set prefix "${qb_install_dir}" 2>&1 | tee "${qb_install_dir}/logs/${app_name}.log.txt" "${qb_install_dir}/bin/qmake" QMAKE_CXXFLAGS="-static" QMAKE_LFLAGS="-static" 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" make -j"$(nproc)" 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" make install 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" # delete_function "${app_name}" else application_skip fi ##################################################################################################################################################### # qBittorrent installation ##################################################################################################################################################### application_name qbittorrent # if [[ "${!app_name_skip:-yes}" = 'no' ]] || [[ "${1}" = "${app_name}" ]]; then if [[ ! -d "${qb_install_dir}/boost" ]]; then echo -e "${tn}${clr}Warning${cend} - You must install the boost libtorrent qbtbase qttools modules before you can use the qbittorrent module" echo else custom_flags_set download_folder "${app_name}" "${!app_github_url}" # apply_patches "${app_name}" # ./bootstrap.sh 2>&1 | tee "${qb_install_dir}/logs/${app_name}.log.txt" ./configure --prefix="${qb_install_dir}" "${qb_debug}" --with-boost="${qb_install_dir}/boost" --with-boost-libdir="${lib_dir}" openssl_CFLAGS="${include_dir}" openssl_LIBS="${lib_dir}" --disable-gui CXXFLAGS="${CXXFLAGS} -I${qb_install_dir}/boost" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS} -l:libboost_system.a" openssl_CFLAGS="-I${include_dir}" openssl_LIBS="-L${lib_dir} -l:libcrypto.a -l:libssl.a" libtorrent_CFLAGS="-I${include_dir}" libtorrent_LIBS="-L${lib_dir} -l:libtorrent.a" zlib_CFLAGS="-I${include_dir}" zlib_LIBS="-L${lib_dir} -l:libz.a" QT_QMAKE="${qb_install_dir}/bin" 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" # make -j"$(nproc)" 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" make install 2>&1 | tee -a "${qb_install_dir}/logs/${app_name}.log.txt" # [[ -f "${qb_install_dir}/bin/qbittorrent-nox" ]] && cp -f "${qb_install_dir}/bin/qbittorrent-nox" "${qb_install_dir}/completed/qbittorrent-nox" # delete_function boost delete_function "${app_name}" last fi else application_skip last fi ##################################################################################################################################################### # We are all done so now exit ##################################################################################################################################################### exit
#!/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. # # invokes the changelog generator from # https://github.com/github-changelog-generator/github-changelog-generator # # With the config located in # arrow-rs/.github_changelog_generator # # Usage: # CHANGELOG_GITHUB_TOKEN=<TOKEN> ./update_change_log.sh set -e SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SOURCE_TOP_DIR="$(cd "${SOURCE_DIR}/../../" && pwd)" pushd ${SOURCE_TOP_DIR} docker run -it --rm -e CHANGELOG_GITHUB_TOKEN=$CHANGELOG_GITHUB_TOKEN -v "$(pwd)":/usr/local/src/your-app githubchangeloggenerator/github-changelog-generator \ --user apache \ --project arrow-rs \ --cache-file=.githubchangeloggenerator.cache \ --cache-log=.githubchangeloggenerator.cache.log \ --http-cache \ --max-issues=300 \ --since-tag 9.0.2 \ --future-release 9.1.0
<reponame>PinoEire/archi /** * This program and the accompanying materials * are made available under the terms of the License * which accompanies this distribution in the file LICENSE.txt */ package com.archimatetool.editor.views.tree; import java.util.ArrayList; import java.util.List; import com.archimatetool.editor.ui.LocalClipboard; import com.archimatetool.model.IArchimateModelObject; /** * TreeModel Cut and Paste objects storage * * @author <NAME> */ public class TreeModelCutAndPaste { public static TreeModelCutAndPaste INSTANCE = new TreeModelCutAndPaste(); private List<IArchimateModelObject> objects = new ArrayList<IArchimateModelObject>(); private TreeModelCutAndPaste() { } public boolean hasContents() { return LocalClipboard.getDefault().getContents() == this && !getObjects().isEmpty(); } public List<IArchimateModelObject> getObjects() { return objects; } public void clear() { if(LocalClipboard.getDefault().getContents() == this) { LocalClipboard.getDefault().setContents(""); //$NON-NLS-1$ } getObjects().clear(); } public void setContents(List<IArchimateModelObject> objects) { this.objects = objects; LocalClipboard.getDefault().setContents(this); } }
<reponame>Sasha7b9Work/S8-53M2<filename>sources/VS/ThirdParty/wxWidgets/samples/listctrl/listtest.cpp ///////////////////////////////////////////////////////////////////////////// // Name: listctrl.cpp // Purpose: wxListCtrl sample // Author: <NAME> // Modified by: // Created: 04/01/98 // Copyright: (c) <NAME> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifndef WX_PRECOMP #include "wx/wx.h" #endif #ifndef wxHAS_IMAGES_IN_RESOURCES #include "../sample.xpm" #endif #ifndef wxHAS_IMAGES_IN_RESOURCES #include "bitmaps/toolbrai.xpm" #include "bitmaps/toolchar.xpm" #include "bitmaps/tooldata.xpm" #include "bitmaps/toolnote.xpm" #include "bitmaps/tooltodo.xpm" #include "bitmaps/toolchec.xpm" #include "bitmaps/toolgame.xpm" #include "bitmaps/tooltime.xpm" #include "bitmaps/toolword.xpm" #include "bitmaps/small1.xpm" #endif #include "wx/imaglist.h" #include "wx/listctrl.h" #include "wx/timer.h" // for wxStopWatch #include "wx/colordlg.h" // for wxGetColourFromUser #include "wx/settings.h" #include "wx/sizer.h" #include "wx/sysopt.h" #include "wx/numdlg.h" #include "wx/selstore.h" #include "listtest.h" // ---------------------------------------------------------------------------- // Constants and globals // ---------------------------------------------------------------------------- const wxChar *SMALL_VIRTUAL_VIEW_ITEMS[][2] = { { wxT("Cat"), wxT("meow") }, { wxT("Cow"), wxT("moo") }, { wxT("Crow"), wxT("caw") }, { wxT("Dog"), wxT("woof") }, { wxT("Duck"), wxT("quack") }, { wxT("Mouse"), wxT("squeak") }, { wxT("Owl"), wxT("hoo") }, { wxT("Pig"), wxT("oink") }, { wxT("Pigeon"), wxT("coo") }, { wxT("Sheep"), wxT("baaah") }, }; // number of items in icon/small icon view static const int NUM_ICONS = 9; int wxCALLBACK MyCompareFunction(wxIntPtr item1, wxIntPtr item2, wxIntPtr WXUNUSED(sortData)) { // inverse the order if (item1 < item2) return 1; if (item1 > item2) return -1; return 0; } // ---------------------------------------------------------------------------- // MyApp // ---------------------------------------------------------------------------- wxIMPLEMENT_APP(MyApp); // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit() { if ( !wxApp::OnInit() ) return false; // Create the main frame window MyFrame *frame = new MyFrame("wxListCtrl Test"); // Show the frame frame->Show(true); return true; } // ---------------------------------------------------------------------------- // MyFrame // ---------------------------------------------------------------------------- wxBEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(LIST_QUIT, MyFrame::OnQuit) EVT_MENU(LIST_ABOUT, MyFrame::OnAbout) EVT_MENU(LIST_LIST_VIEW, MyFrame::OnListView) EVT_MENU(LIST_REPORT_VIEW, MyFrame::OnReportView) EVT_MENU(LIST_ICON_VIEW, MyFrame::OnIconView) EVT_MENU(LIST_ICON_TEXT_VIEW, MyFrame::OnIconTextView) EVT_MENU(LIST_SMALL_ICON_VIEW, MyFrame::OnSmallIconView) EVT_MENU(LIST_SMALL_ICON_TEXT_VIEW, MyFrame::OnSmallIconTextView) EVT_MENU(LIST_VIRTUAL_VIEW, MyFrame::OnVirtualView) EVT_MENU(LIST_SMALL_VIRTUAL_VIEW, MyFrame::OnSmallVirtualView) EVT_MENU(LIST_SET_ITEMS_COUNT, MyFrame::OnSetItemsCount) EVT_MENU(LIST_GOTO, MyFrame::OnGoTo) EVT_MENU(LIST_FOCUS_LAST, MyFrame::OnFocusLast) EVT_MENU(LIST_TOGGLE_FIRST, MyFrame::OnToggleFirstSel) EVT_MENU(LIST_DESELECT_ALL, MyFrame::OnDeselectAll) EVT_MENU(LIST_SELECT_ALL, MyFrame::OnSelectAll) EVT_MENU(LIST_DELETE, MyFrame::OnDelete) EVT_MENU(LIST_ADD, MyFrame::OnAdd) EVT_MENU(LIST_EDIT, MyFrame::OnEdit) EVT_MENU(LIST_DELETE_ALL, MyFrame::OnDeleteAll) EVT_MENU(LIST_SORT, MyFrame::OnSort) EVT_MENU(LIST_SET_FG_COL, MyFrame::OnSetFgColour) EVT_MENU(LIST_SET_BG_COL, MyFrame::OnSetBgColour) EVT_MENU(LIST_ROW_LINES, MyFrame::OnSetRowLines) EVT_MENU(LIST_ROW_LINES_ON_BLANK, MyFrame::OnSetRowLinesOnBlank) EVT_MENU(LIST_CUSTOM_HEADER_ATTR, MyFrame::OnCustomHeaderAttr) EVT_MENU(LIST_TOGGLE_MULTI_SEL, MyFrame::OnToggleMultiSel) EVT_MENU(LIST_SHOW_COL_INFO, MyFrame::OnShowColInfo) EVT_MENU(LIST_SHOW_SEL_INFO, MyFrame::OnShowSelInfo) EVT_MENU(LIST_SHOW_VIEW_RECT, MyFrame::OnShowViewRect) #ifdef wxHAS_LISTCTRL_COLUMN_ORDER EVT_MENU(LIST_SET_COL_ORDER, MyFrame::OnSetColOrder) EVT_MENU(LIST_GET_COL_ORDER, MyFrame::OnGetColOrder) #endif // wxHAS_LISTCTRL_COLUMN_ORDER EVT_MENU(LIST_FREEZE, MyFrame::OnFreeze) EVT_MENU(LIST_THAW, MyFrame::OnThaw) EVT_MENU(LIST_TOGGLE_LINES, MyFrame::OnToggleLines) EVT_MENU(LIST_TOGGLE_HEADER, MyFrame::OnToggleHeader) EVT_MENU(LIST_TOGGLE_BELL, MyFrame::OnToggleBell) EVT_MENU(LIST_CHECKVISIBILITY, MyFrame::OnCheckVisibility) #ifdef __WXOSX__ EVT_MENU(LIST_MAC_USE_GENERIC, MyFrame::OnToggleMacUseGeneric) #endif // __WXOSX__ EVT_MENU(LIST_FIND, MyFrame::OnFind) EVT_MENU(LIST_TOGGLE_CHECKBOX, MyFrame::OnToggleItemCheckBox) EVT_MENU(LIST_GET_CHECKBOX, MyFrame::OnGetItemCheckBox) EVT_MENU(LIST_TOGGLE_CHECKBOXES, MyFrame::OnToggleCheckBoxes) EVT_UPDATE_UI(LIST_SHOW_COL_INFO, MyFrame::OnUpdateUIEnableInReport) EVT_UPDATE_UI(LIST_TOGGLE_HEADER, MyFrame::OnUpdateUIEnableInReport) EVT_UPDATE_UI(LIST_CUSTOM_HEADER_ATTR, MyFrame::OnUpdateUIEnableInReport) EVT_UPDATE_UI(LIST_TOGGLE_MULTI_SEL, MyFrame::OnUpdateToggleMultiSel) EVT_UPDATE_UI(LIST_TOGGLE_CHECKBOXES, MyFrame::OnUpdateToggleCheckBoxes) EVT_UPDATE_UI(LIST_TOGGLE_HEADER, MyFrame::OnUpdateToggleHeader) EVT_UPDATE_UI(LIST_ROW_LINES, MyFrame::OnUpdateRowLines) EVT_UPDATE_UI(LIST_ROW_LINES_ON_BLANK, MyFrame::OnUpdateUIEnableInReport) wxEND_EVENT_TABLE() // My frame constructor MyFrame::MyFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(600, 500)) { m_listCtrl = NULL; m_logWindow = NULL; m_smallVirtual = false; m_numListItems = 10; // Give it an icon SetIcon(wxICON(sample)); // Make an image list containing large icons m_imageListNormal = new wxImageList(32, 32, true); m_imageListSmall = new wxImageList(16, 16, true); #ifdef wxHAS_IMAGES_IN_RESOURCES m_imageListNormal->Add( wxIcon("icon1", wxBITMAP_TYPE_ICO_RESOURCE) ); m_imageListNormal->Add( wxIcon("icon2", wxBITMAP_TYPE_ICO_RESOURCE) ); m_imageListNormal->Add( wxIcon("icon3", wxBITMAP_TYPE_ICO_RESOURCE) ); m_imageListNormal->Add( wxIcon("icon4", wxBITMAP_TYPE_ICO_RESOURCE) ); m_imageListNormal->Add( wxIcon("icon5", wxBITMAP_TYPE_ICO_RESOURCE) ); m_imageListNormal->Add( wxIcon("icon6", wxBITMAP_TYPE_ICO_RESOURCE) ); m_imageListNormal->Add( wxIcon("icon7", wxBITMAP_TYPE_ICO_RESOURCE) ); m_imageListNormal->Add( wxIcon("icon8", wxBITMAP_TYPE_ICO_RESOURCE) ); m_imageListNormal->Add( wxIcon("icon9", wxBITMAP_TYPE_ICO_RESOURCE) ); m_imageListSmall->Add( wxIcon("iconsmall", wxBITMAP_TYPE_ICO_RESOURCE) ); #else m_imageListNormal->Add( wxIcon( toolbrai_xpm ) ); m_imageListNormal->Add( wxIcon( toolchar_xpm ) ); m_imageListNormal->Add( wxIcon( tooldata_xpm ) ); m_imageListNormal->Add( wxIcon( toolnote_xpm ) ); m_imageListNormal->Add( wxIcon( tooltodo_xpm ) ); m_imageListNormal->Add( wxIcon( toolchec_xpm ) ); m_imageListNormal->Add( wxIcon( toolgame_xpm ) ); m_imageListNormal->Add( wxIcon( tooltime_xpm ) ); m_imageListNormal->Add( wxIcon( toolword_xpm ) ); m_imageListSmall->Add( wxIcon( small1_xpm) ); #endif // Make a menubar wxMenu *menuFile = new wxMenu; menuFile->Append(LIST_ABOUT, "&About"); menuFile->AppendSeparator(); menuFile->Append(LIST_QUIT, "E&xit\tAlt-X"); wxMenu *menuView = new wxMenu; menuView->Append(LIST_LIST_VIEW, "&List view\tF1"); menuView->Append(LIST_REPORT_VIEW, "&Report view\tF2"); menuView->Append(LIST_ICON_VIEW, "&Icon view\tF3"); menuView->Append(LIST_ICON_TEXT_VIEW, "Icon view with &text\tF4"); menuView->Append(LIST_SMALL_ICON_VIEW, "&Small icon view\tF5"); menuView->Append(LIST_SMALL_ICON_TEXT_VIEW, "Small icon &view with text\tF6"); menuView->Append(LIST_VIRTUAL_VIEW, "&Virtual view\tF7"); menuView->Append(LIST_SMALL_VIRTUAL_VIEW, "Small virtual vie&w\tF8"); menuView->AppendSeparator(); menuView->Append(LIST_SET_ITEMS_COUNT, "Set &number of items"); #ifdef __WXOSX__ menuView->AppendSeparator(); menuView->AppendCheckItem(LIST_MAC_USE_GENERIC, "Mac: Use Generic Control"); #endif wxMenu *menuList = new wxMenu; menuList->Append(LIST_GOTO, "&Go to item #3\tCtrl-3"); menuList->Append(LIST_FOCUS_LAST, "&Make last item current\tCtrl-L"); menuList->Append(LIST_TOGGLE_FIRST, "To&ggle first item\tCtrl-G"); menuList->Append(LIST_DESELECT_ALL, "&Deselect All\tCtrl-D"); menuList->Append(LIST_SELECT_ALL, "S&elect All\tCtrl-A"); menuList->AppendSeparator(); menuList->Append(LIST_SHOW_COL_INFO, "Show &column info\tCtrl-C"); menuList->Append(LIST_SHOW_SEL_INFO, "Show &selected items\tCtrl-S"); menuList->Append(LIST_SHOW_VIEW_RECT, "Show &view rect"); #ifdef wxHAS_LISTCTRL_COLUMN_ORDER menuList->Append(LIST_SET_COL_ORDER, "Se&t columns order\tShift-Ctrl-O"); menuList->Append(LIST_GET_COL_ORDER, "Sho&w columns order\tCtrl-O"); #endif // wxHAS_LISTCTRL_COLUMN_ORDER menuList->AppendSeparator(); menuList->Append(LIST_SORT, "Sor&t\tCtrl-T"); menuList->Append(LIST_FIND, "Test Find() performance"); menuList->AppendSeparator(); menuList->Append(LIST_ADD, "&Append an item\tCtrl-P"); menuList->Append(LIST_EDIT, "&Edit the item\tCtrl-E"); menuList->Append(LIST_DELETE, "&Delete first item\tCtrl-X"); menuList->Append(LIST_DELETE_ALL, "Delete &all items"); menuList->AppendSeparator(); menuList->Append(LIST_FREEZE, "Free&ze\tCtrl-Z"); menuList->Append(LIST_THAW, "Tha&w\tCtrl-W"); menuList->AppendSeparator(); menuList->AppendCheckItem(LIST_TOGGLE_LINES, "Toggle &lines\tCtrl-I"); menuList->AppendCheckItem(LIST_TOGGLE_MULTI_SEL, "&Multiple selection\tCtrl-M"); menuList->Check(LIST_TOGGLE_MULTI_SEL, true); menuList->AppendCheckItem(LIST_TOGGLE_HEADER, "Toggle &header\tCtrl-H"); menuList->Check(LIST_TOGGLE_HEADER, true); menuList->AppendCheckItem(LIST_TOGGLE_BELL, "Toggle &bell on no match"); menuList->Append( LIST_CHECKVISIBILITY, "Check if lines 2 and 9 are visible" ); menuList->AppendSeparator(); menuList->AppendCheckItem(LIST_TOGGLE_CHECKBOXES, "&Enable Checkboxes"); menuList->Check(LIST_TOGGLE_CHECKBOXES, true); menuList->Append(LIST_TOGGLE_CHECKBOX, "Toggle the item checkbox state"); menuList->Append(LIST_GET_CHECKBOX, "Get the item checkbox state"); wxMenu *menuCol = new wxMenu; menuCol->Append(LIST_SET_FG_COL, "&Foreground colour..."); menuCol->Append(LIST_SET_BG_COL, "&Background colour..."); menuCol->AppendCheckItem(LIST_ROW_LINES, "Alternating colours"); menuCol->AppendCheckItem(LIST_ROW_LINES_ON_BLANK, "Extend to whole window"); menuCol->AppendCheckItem(LIST_CUSTOM_HEADER_ATTR, "&Custom header attributes"); wxMenuBar *menubar = new wxMenuBar; menubar->Append(menuFile, "&File"); menubar->Append(menuView, "&View"); menubar->Append(menuList, "&List"); menubar->Append(menuCol, "&Colour"); SetMenuBar(menubar); m_panel = new wxPanel(this, wxID_ANY); m_logWindow = new wxTextCtrl(m_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY | wxTE_MULTILINE | wxSUNKEN_BORDER); m_logOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_logWindow)); RecreateList(wxLC_REPORT | wxLC_SINGLE_SEL); #ifdef __WXMSW__ // this is useful to know specially when debugging :) wxLogMessage("Your version of comctl32.dll is: %d", wxApp::GetComCtl32Version()); #endif #if wxUSE_STATUSBAR CreateStatusBar(); #endif // wxUSE_STATUSBAR wxBoxSizer* const sizer = new wxBoxSizer(wxVERTICAL); sizer->Add(m_listCtrl, wxSizerFlags(2).Expand().Border()); sizer->Add(m_logWindow, wxSizerFlags(1).Expand().Border()); m_panel->SetSizer(sizer); SetClientSize(m_panel->GetBestSize()); } MyFrame::~MyFrame() { delete wxLog::SetActiveTarget(m_logOld); delete m_imageListNormal; delete m_imageListSmall; } bool MyFrame::CheckNonVirtual() const { if ( !m_listCtrl->HasFlag(wxLC_VIRTUAL) ) return true; // "this" == whatever wxLogWarning("Can't do this in virtual view, sorry."); return false; } void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { Close(true); } void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageDialog dialog(this, "List test sample\nJulian Smart (c) 1997", "About list test"); dialog.ShowModal(); } void MyFrame::OnFreeze(wxCommandEvent& WXUNUSED(event)) { wxLogMessage("Freezing the control"); m_listCtrl->Freeze(); } void MyFrame::OnThaw(wxCommandEvent& WXUNUSED(event)) { wxLogMessage("Thawing the control"); m_listCtrl->Thaw(); } void MyFrame::OnToggleLines(wxCommandEvent& event) { m_listCtrl->SetSingleStyle(wxLC_HRULES | wxLC_VRULES, event.IsChecked()); } void MyFrame::OnToggleHeader(wxCommandEvent& event) { wxLogMessage("%s the header", event.IsChecked() ? "Showing" : "Hiding"); m_listCtrl->ToggleWindowStyle(wxLC_NO_HEADER); } void MyFrame::OnToggleBell(wxCommandEvent& event) { m_listCtrl->EnableBellOnNoMatch(event.IsChecked()); } void MyFrame::OnCheckVisibility(wxCommandEvent& WXUNUSED(event)) { if ( m_listCtrl->IsVisible(2) ) wxLogMessage( "Line 2 is visible" ); else wxLogMessage( "Line 2 is not visible" ); if ( m_listCtrl->IsVisible(9) ) wxLogMessage( "Line 9 is visible" ); else wxLogMessage( "Line 9 is not visible" ); } #ifdef __WXOSX__ void MyFrame::OnToggleMacUseGeneric(wxCommandEvent& event) { wxSystemOptions::SetOption("mac.listctrl.always_use_generic", event.IsChecked()); } #endif // __WXOSX__ void MyFrame::OnGoTo(wxCommandEvent& WXUNUSED(event)) { if ( m_listCtrl->IsEmpty() ) { wxLogMessage("Attempt go to item #3 when list is empty"); return; } long index = 3; m_listCtrl->SetItemState(index, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); long sel = m_listCtrl->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if ( sel != -1 ) m_listCtrl->SetItemState(sel, 0, wxLIST_STATE_SELECTED); m_listCtrl->SetItemState(index, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); } void MyFrame::OnFocusLast(wxCommandEvent& WXUNUSED(event)) { long index = m_listCtrl->GetItemCount() - 1; if ( index == -1 ) { return; } m_listCtrl->SetItemState(index, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); m_listCtrl->EnsureVisible(index); } void MyFrame::OnToggleFirstSel(wxCommandEvent& WXUNUSED(event)) { if ( !m_listCtrl->IsEmpty() ) { m_listCtrl->SetItemState(0, (~m_listCtrl->GetItemState(0, wxLIST_STATE_SELECTED) ) & wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); } else { wxLogMessage("Attempt toggle first item when list is empty"); } } void MyFrame::OnDeselectAll(wxCommandEvent& WXUNUSED(event)) { if ( !CheckNonVirtual() ) return; int n = m_listCtrl->GetItemCount(); for (int i = 0; i < n; i++) m_listCtrl->SetItemState(i,0,wxLIST_STATE_SELECTED); } void MyFrame::OnSelectAll(wxCommandEvent& WXUNUSED(event)) { if ( !CheckNonVirtual() ) return; int n = m_listCtrl->GetItemCount(); for (int i = 0; i < n; i++) m_listCtrl->SetItemState(i,wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); } // ---------------------------------------------------------------------------- // changing listctrl modes // ---------------------------------------------------------------------------- void MyFrame::RecreateList(long flags, bool withText) { // we could avoid recreating it if we don't set/clear the wxLC_VIRTUAL // style, but it is more trouble to do it than not #if 0 if ( !m_listCtrl || ((flags & wxLC_VIRTUAL) != (m_listCtrl->GetWindowStyleFlag() & wxLC_VIRTUAL)) ) #endif { wxListCtrl* const old = m_listCtrl; m_listCtrl = new MyListCtrl(m_panel, LIST_CTRL, wxDefaultPosition, wxDefaultSize, flags | wxBORDER_THEME | wxLC_EDIT_LABELS); if ( old ) { wxSizer* const sizer = m_panel->GetSizer(); sizer->Replace(old, m_listCtrl); delete old; sizer->Layout(); } switch ( flags & wxLC_MASK_TYPE ) { case wxLC_LIST: InitWithListItems(); break; case wxLC_ICON: InitWithIconItems(withText); break; case wxLC_SMALL_ICON: InitWithIconItems(withText, true); break; case wxLC_REPORT: if ( flags & wxLC_VIRTUAL ) InitWithVirtualItems(); else InitWithReportItems(); break; default: wxFAIL_MSG( "unknown listctrl mode" ); } wxMenuBar* const mb = GetMenuBar(); if ( mb ) m_listCtrl->EnableBellOnNoMatch(mb->IsChecked(LIST_TOGGLE_BELL)); } GetMenuBar()->Check(LIST_ROW_LINES, false); GetMenuBar()->Check(LIST_ROW_LINES_ON_BLANK, false); m_logWindow->Clear(); } void MyFrame::OnListView(wxCommandEvent& WXUNUSED(event)) { RecreateList(wxLC_LIST); } void MyFrame::InitWithListItems() { for ( int i = 0; i < m_numListItems; i++ ) { m_listCtrl->InsertItem(i, wxString::Format("Item %d", i)); } } void MyFrame::OnReportView(wxCommandEvent& WXUNUSED(event)) { RecreateList(wxLC_REPORT); } void MyFrame::InitWithReportItems() { m_listCtrl->SetImageList(m_imageListSmall, wxIMAGE_LIST_SMALL); // note that under MSW for SetColumnWidth() to work we need to create the // items with images initially even if we specify dummy image id wxListItem itemCol; itemCol.SetText("Column 1"); itemCol.SetImage(-1); m_listCtrl->InsertColumn(0, itemCol); itemCol.SetText("Column 2 (auto size excluding header)"); itemCol.SetAlign(wxLIST_FORMAT_CENTRE); m_listCtrl->InsertColumn(1, itemCol); itemCol.SetText("Column 3 (auto size including header)"); itemCol.SetAlign(wxLIST_FORMAT_RIGHT); m_listCtrl->InsertColumn(2, itemCol); if ( m_numListItems <= 0 ) { m_listCtrl->SetColumnWidth( 0, 100 ); m_listCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE ); m_listCtrl->SetColumnWidth( 2, wxLIST_AUTOSIZE_USEHEADER ); return; } // to speed up inserting we hide the control temporarily m_listCtrl->Hide(); wxStopWatch sw; for ( int i = 0; i < m_numListItems; i++ ) { m_listCtrl->InsertItemInReportView(i); } m_logWindow->WriteText(wxString::Format("%d items inserted in %ldms\n", m_numListItems, sw.Time())); m_listCtrl->Show(); // we leave all mask fields to 0 and only change the colour wxListItem item; item.m_itemId = 0; item.SetTextColour(*wxRED); m_listCtrl->SetItem( item ); if ( m_numListItems > 2 ) { item.m_itemId = 2; item.SetTextColour(*wxGREEN); m_listCtrl->SetItem( item ); } if ( m_numListItems > 4 ) { item.m_itemId = 4; item.SetTextColour(*wxLIGHT_GREY); item.SetFont(*wxITALIC_FONT); item.SetBackgroundColour(*wxRED); m_listCtrl->SetItem( item ); } m_listCtrl->SetTextColour(*wxBLUE); if ( m_numListItems > 1 ) { // Set images in columns m_listCtrl->SetItemColumnImage(1, 1, 0); } if ( m_numListItems > 3 ) { wxListItem info; info.SetImage(0); info.SetId(3); info.SetColumn(2); m_listCtrl->SetItem(info); } // test SetItemFont too m_listCtrl->SetItemFont(0, *wxITALIC_FONT); m_listCtrl->SetColumnWidth( 0, wxLIST_AUTOSIZE ); m_listCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE ); m_listCtrl->SetColumnWidth( 2, wxLIST_AUTOSIZE_USEHEADER ); } void MyFrame::InitWithIconItems(bool withText, bool sameIcon) { m_listCtrl->SetImageList(m_imageListNormal, wxIMAGE_LIST_NORMAL); m_listCtrl->SetImageList(m_imageListSmall, wxIMAGE_LIST_SMALL); for ( int i = 0; i < NUM_ICONS; i++ ) { int image = sameIcon ? 0 : i; if ( withText ) { // Make labels of different widths to test the layout. wxString label; if ( !(i % 5) ) label.Printf("Longer label %d", i); else label.Printf("Label %d", i); m_listCtrl->InsertItem(i, label, image); } else { m_listCtrl->InsertItem(i, image); } } } void MyFrame::OnIconView(wxCommandEvent& WXUNUSED(event)) { RecreateList(wxLC_ICON, false); } void MyFrame::OnIconTextView(wxCommandEvent& WXUNUSED(event)) { RecreateList(wxLC_ICON); } void MyFrame::OnSmallIconView(wxCommandEvent& WXUNUSED(event)) { RecreateList(wxLC_SMALL_ICON, false); } void MyFrame::OnSmallIconTextView(wxCommandEvent& WXUNUSED(event)) { RecreateList(wxLC_SMALL_ICON); } void MyFrame::OnVirtualView(wxCommandEvent& WXUNUSED(event)) { m_smallVirtual = false; RecreateList(wxLC_REPORT | wxLC_VIRTUAL); } void MyFrame::OnSmallVirtualView(wxCommandEvent& WXUNUSED(event)) { m_smallVirtual = true; RecreateList(wxLC_REPORT | wxLC_VIRTUAL); } void MyFrame::OnSetItemsCount(wxCommandEvent& WXUNUSED(event)) { int numItems = wxGetNumberFromUser ( "Enter the initial number of items for " "the list and report views", "Number of items:", "wxWidgets wxListCtrl sample", m_numListItems, 0, 10000, this ); if ( numItems == -1 || numItems == m_numListItems ) return; m_numListItems = numItems; if ( m_listCtrl->HasFlag(wxLC_REPORT) && !m_listCtrl->HasFlag(wxLC_VIRTUAL) ) RecreateList(wxLC_REPORT); else if ( m_listCtrl->HasFlag(wxLC_LIST) ) RecreateList(wxLC_LIST); } void MyFrame::InitWithVirtualItems() { m_listCtrl->SetImageList(m_imageListSmall, wxIMAGE_LIST_SMALL); if ( m_smallVirtual ) { m_listCtrl->AppendColumn("Animal"); m_listCtrl->AppendColumn("Sound"); m_listCtrl->SetItemCount(WXSIZEOF(SMALL_VIRTUAL_VIEW_ITEMS)); } else { m_listCtrl->AppendColumn("First Column (size auto)"); m_listCtrl->AppendColumn("Second Column (150px)"); m_listCtrl->SetItemCount(1000000); m_listCtrl->SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER); m_listCtrl->SetColumnWidth(1, 150); } } void MyFrame::OnSort(wxCommandEvent& WXUNUSED(event)) { wxStopWatch sw; m_listCtrl->SortItems(MyCompareFunction, 0); m_logWindow->WriteText(wxString::Format("Sorting %d items took %ld ms\n", m_listCtrl->GetItemCount(), sw.Time())); } void MyFrame::OnFind(wxCommandEvent& WXUNUSED(event)) { wxStopWatch sw; const int itemCount = m_listCtrl->GetItemCount(); for ( int i = 0; i < itemCount; i++ ) m_listCtrl->FindItem(-1, i); wxLogMessage("Calling Find() for all %d items took %ld ms", itemCount, sw.Time()); } void MyFrame::OnShowSelInfo(wxCommandEvent& WXUNUSED(event)) { int selCount = m_listCtrl->GetSelectedItemCount(); wxLogMessage("%d items selected:", selCount); // don't show too many items size_t shownCount = 0; long item = m_listCtrl->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); while ( item != -1 ) { wxLogMessage("\t%ld (%s)", item, m_listCtrl->GetItemText(item)); if ( ++shownCount > 10 ) { wxLogMessage("\t... more selected items snipped..."); break; } item = m_listCtrl->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); } } void MyFrame::OnShowViewRect(wxCommandEvent& WXUNUSED(event)) { const wxRect r = m_listCtrl->GetViewRect(); wxLogMessage("View rect: (%d, %d)-(%d, %d)", r.GetLeft(), r.GetTop(), r.GetRight(), r.GetBottom()); } // ---------------------------------------------------------------------------- // column order tests // ---------------------------------------------------------------------------- #ifdef wxHAS_LISTCTRL_COLUMN_ORDER static wxString DumpIntArray(const wxArrayInt& a) { wxString s("{ "); const size_t count = a.size(); for ( size_t n = 0; n < count; n++ ) { if ( n ) s += ", "; s += wxString::Format("%lu", (unsigned long)a[n]); } s += " }"; return s; } void MyFrame::OnSetColOrder(wxCommandEvent& WXUNUSED(event)) { wxArrayInt order(3); order[0] = 2; order[1] = 0; order[2] = 1; if ( m_listCtrl->SetColumnsOrder(order) ) { wxLogMessage("Column order set to %s", DumpIntArray(order)); } } void MyFrame::OnGetColOrder(wxCommandEvent& WXUNUSED(event)) { // show what GetColumnsOrder() returns const wxArrayInt order = m_listCtrl->GetColumnsOrder(); wxString msg = "Columns order: " + DumpIntArray(m_listCtrl->GetColumnsOrder()) + "\n"; int n; const int count = m_listCtrl->GetColumnCount(); // show the results of GetColumnOrder() for each column msg += "GetColumnOrder() results:\n"; for ( n = 0; n < count; n++ ) { msg += wxString::Format(" %2d -> %2d\n", n, m_listCtrl->GetColumnOrder(n)); } // and the results of GetColumnIndexFromOrder() too msg += "GetColumnIndexFromOrder() results:\n"; for ( n = 0; n < count; n++ ) { msg += wxString::Format(" %2d -> %2d\n", n, m_listCtrl->GetColumnIndexFromOrder(n)); } wxLogMessage("%s", msg); } #endif // wxHAS_LISTCTRL_COLUMN_ORDER void MyFrame::OnShowColInfo(wxCommandEvent& WXUNUSED(event)) { int count = m_listCtrl->GetColumnCount(); wxLogMessage("%d columns:", count); for ( int c = 0; c < count; c++ ) { wxLogMessage("\tcolumn %d has width %d", c, m_listCtrl->GetColumnWidth(c)); } } void MyFrame::OnUpdateUIEnableInReport(wxUpdateUIEvent& event) { event.Enable( (m_listCtrl->GetWindowStyleFlag() & wxLC_REPORT) != 0 ); } void MyFrame::OnToggleMultiSel(wxCommandEvent& WXUNUSED(event)) { long flags = m_listCtrl->GetWindowStyleFlag(); if ( flags & wxLC_SINGLE_SEL ) flags &= ~wxLC_SINGLE_SEL; else flags |= wxLC_SINGLE_SEL; m_logWindow->WriteText(wxString::Format("Current selection mode: %sle\n", (flags & wxLC_SINGLE_SEL) ? "sing" : "multip")); RecreateList(flags); } void MyFrame::OnUpdateToggleMultiSel(wxUpdateUIEvent& event) { event.Check(!m_listCtrl->HasFlag(wxLC_SINGLE_SEL)); } void MyFrame::OnToggleCheckBoxes(wxCommandEvent& WXUNUSED(event)) { if ( !m_listCtrl->EnableCheckBoxes(!m_listCtrl->HasCheckBoxes()) ) { wxLogMessage("Failed to toggle checkboxes (not supported?)"); } else { wxLogMessage("Checkboxes are now %s", m_listCtrl->HasCheckBoxes() ? "enabled" : "disabled"); } } void MyFrame::OnUpdateToggleCheckBoxes(wxUpdateUIEvent& event) { bool cbEnabled = m_listCtrl->HasCheckBoxes(); event.Check(cbEnabled); GetMenuBar()->Enable(LIST_TOGGLE_CHECKBOX, cbEnabled); GetMenuBar()->Enable(LIST_GET_CHECKBOX, cbEnabled); } void MyFrame::OnUpdateToggleHeader(wxUpdateUIEvent& event) { event.Check(!m_listCtrl->HasFlag(wxLC_NO_HEADER)); } void MyFrame::OnUpdateRowLines(wxUpdateUIEvent& event) { event.Enable(m_listCtrl->HasFlag(wxLC_VIRTUAL)); } void MyFrame::OnSetFgColour(wxCommandEvent& WXUNUSED(event)) { m_listCtrl->SetForegroundColour(wxGetColourFromUser(this)); m_listCtrl->Refresh(); } void MyFrame::OnSetBgColour(wxCommandEvent& WXUNUSED(event)) { m_listCtrl->SetBackgroundColour(wxGetColourFromUser(this)); m_listCtrl->Refresh(); } void MyFrame::OnSetRowLines(wxCommandEvent& event) { m_listCtrl->EnableAlternateRowColours(event.IsChecked()); m_listCtrl->Refresh(); } void MyFrame::OnSetRowLinesOnBlank(wxCommandEvent& event) { m_listCtrl->ExtendRulesAndAlternateColour(event.IsChecked()); } void MyFrame::OnCustomHeaderAttr(wxCommandEvent& event) { wxItemAttr attr; if ( event.IsChecked() ) { attr.SetTextColour(*wxBLUE); attr.SetFont(wxFontInfo(24).Italic()); } //else: leave it as default to disable custom header attributes if ( !m_listCtrl->SetHeaderAttr(attr) ) wxLogMessage("Sorry, header attributes not supported on this platform"); } void MyFrame::OnAdd(wxCommandEvent& WXUNUSED(event)) { m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), "Appended item"); } void MyFrame::OnEdit(wxCommandEvent& WXUNUSED(event)) { // demonstrate cancelling editing: this currently is wxMSW-only #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) if ( m_listCtrl->GetEditControl() ) { m_listCtrl->EndEditLabel(true); } else // start editing #endif // __WXMSW__ { long itemCur = m_listCtrl->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED); if ( itemCur != -1 ) { m_listCtrl->EditLabel(itemCur); } else { m_logWindow->WriteText("No item to edit"); } } } void MyFrame::OnToggleItemCheckBox(wxCommandEvent& WXUNUSED(event)) { long item = m_listCtrl->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); while (item != -1) { bool checked = m_listCtrl->IsItemChecked(item); m_listCtrl->CheckItem(item, !checked); item = m_listCtrl->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); } } void MyFrame::OnGetItemCheckBox(wxCommandEvent& WXUNUSED(event)) { long item = m_listCtrl->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); while (item != -1) { bool checked = m_listCtrl->IsItemChecked(item); wxLogMessage("Item %ld is %s", item, checked ? "checked" : "unchecked"); item = m_listCtrl->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); } } void MyFrame::OnDelete(wxCommandEvent& WXUNUSED(event)) { if ( m_listCtrl->GetItemCount() ) { m_listCtrl->DeleteItem(0); } else { m_logWindow->WriteText("Nothing to delete"); } } void MyFrame::OnDeleteAll(wxCommandEvent& WXUNUSED(event)) { wxStopWatch sw; int itemCount = m_listCtrl->GetItemCount(); m_listCtrl->DeleteAllItems(); m_logWindow->WriteText(wxString::Format("Deleting %d items took %ld ms\n", itemCount, sw.Time())); } // ---------------------------------------------------------------------------- // MyListCtrl // ---------------------------------------------------------------------------- wxBEGIN_EVENT_TABLE(MyListCtrl, wxListCtrl) EVT_LIST_BEGIN_DRAG(LIST_CTRL, MyListCtrl::OnBeginDrag) EVT_LIST_BEGIN_RDRAG(LIST_CTRL, MyListCtrl::OnBeginRDrag) EVT_LIST_BEGIN_LABEL_EDIT(LIST_CTRL, MyListCtrl::OnBeginLabelEdit) EVT_LIST_END_LABEL_EDIT(LIST_CTRL, MyListCtrl::OnEndLabelEdit) EVT_LIST_DELETE_ITEM(LIST_CTRL, MyListCtrl::OnDeleteItem) EVT_LIST_DELETE_ALL_ITEMS(LIST_CTRL, MyListCtrl::OnDeleteAllItems) EVT_LIST_ITEM_SELECTED(LIST_CTRL, MyListCtrl::OnSelected) EVT_LIST_ITEM_DESELECTED(LIST_CTRL, MyListCtrl::OnDeselected) EVT_LIST_KEY_DOWN(LIST_CTRL, MyListCtrl::OnListKeyDown) EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, MyListCtrl::OnActivated) EVT_LIST_ITEM_FOCUSED(LIST_CTRL, MyListCtrl::OnFocused) EVT_LIST_ITEM_CHECKED(LIST_CTRL, MyListCtrl::OnChecked) EVT_LIST_ITEM_UNCHECKED(LIST_CTRL, MyListCtrl::OnUnChecked) EVT_LIST_ITEM_RIGHT_CLICK(LIST_CTRL, MyListCtrl::OnItemRightClick) EVT_LIST_COL_CLICK(LIST_CTRL, MyListCtrl::OnColClick) EVT_LIST_COL_RIGHT_CLICK(LIST_CTRL, MyListCtrl::OnColRightClick) EVT_LIST_COL_BEGIN_DRAG(LIST_CTRL, MyListCtrl::OnColBeginDrag) EVT_LIST_COL_DRAGGING(LIST_CTRL, MyListCtrl::OnColDragging) EVT_LIST_COL_END_DRAG(LIST_CTRL, MyListCtrl::OnColEndDrag) EVT_LIST_CACHE_HINT(LIST_CTRL, MyListCtrl::OnCacheHint) #if USE_CONTEXT_MENU EVT_CONTEXT_MENU(MyListCtrl::OnContextMenu) #endif EVT_CHAR(MyListCtrl::OnChar) EVT_RIGHT_DOWN(MyListCtrl::OnRightClick) wxEND_EVENT_TABLE() void MyListCtrl::OnCacheHint(wxListEvent& event) { wxLogMessage( "OnCacheHint: cache items %ld..%ld", event.GetCacheFrom(), event.GetCacheTo() ); } void MyListCtrl::SetColumnImage(int col, int image) { wxListItem item; item.SetMask(wxLIST_MASK_IMAGE); item.SetImage(image); SetColumn(col, item); } void MyListCtrl::OnColClick(wxListEvent& event) { int col = event.GetColumn(); if ( col == -1 ) { return; // clicked outside any column. } // set or unset image static bool x = false; x = !x; SetColumnImage(col, x ? 0 : -1); wxLogMessage( "OnColumnClick at %d.", col ); } void MyListCtrl::OnColRightClick(wxListEvent& event) { int col = event.GetColumn(); if ( col != -1 ) { SetColumnImage(col, -1); } // Show popupmenu at position wxMenu menu("Test"); menu.Append(LIST_ABOUT, "&About"); PopupMenu(&menu, event.GetPoint()); wxLogMessage( "OnColumnRightClick at %d.", event.GetColumn() ); } void MyListCtrl::LogColEvent(const wxListEvent& event, const wxString& name) { const int col = event.GetColumn(); wxLogMessage("%s: column %d (width = %d or %d).", name, col, event.GetItem().GetWidth(), GetColumnWidth(col)); } void MyListCtrl::OnColBeginDrag(wxListEvent& event) { LogColEvent( event, "OnColBeginDrag" ); if ( event.GetColumn() == 0 ) { wxLogMessage("Resizing this column shouldn't work."); event.Veto(); } } void MyListCtrl::OnColDragging(wxListEvent& event) { LogColEvent( event, "OnColDragging" ); } void MyListCtrl::OnColEndDrag(wxListEvent& event) { LogColEvent( event, "OnColEndDrag" ); } void MyListCtrl::OnBeginDrag(wxListEvent& event) { const wxPoint& pt = event.m_pointDrag; int flags; wxLogMessage( "OnBeginDrag at (%d, %d), item %ld.", pt.x, pt.y, HitTest(pt, flags) ); } void MyListCtrl::OnBeginRDrag(wxListEvent& event) { wxLogMessage( "OnBeginRDrag at %d,%d.", event.m_pointDrag.x, event.m_pointDrag.y ); } void MyListCtrl::OnBeginLabelEdit(wxListEvent& event) { wxLogMessage( "OnBeginLabelEdit: %s", event.m_item.m_text); wxTextCtrl * const text = GetEditControl(); if ( !text ) { wxLogMessage("BUG: started to edit but no edit control"); } else { wxLogMessage("Edit control value: \"%s\"", text->GetValue()); } } void MyListCtrl::OnEndLabelEdit(wxListEvent& event) { wxLogMessage( "OnEndLabelEdit: %s", ( event.IsEditCancelled() ? wxString("[cancelled]") : event.m_item.m_text ) ); } void MyListCtrl::OnDeleteItem(wxListEvent& event) { LogEvent(event, "OnDeleteItem"); wxLogMessage( "Number of items when delete event is sent: %d", GetItemCount() ); } void MyListCtrl::OnDeleteAllItems(wxListEvent& event) { LogEvent(event, "OnDeleteAllItems"); } void MyListCtrl::OnSelected(wxListEvent& event) { LogEvent(event, "OnSelected"); if ( GetWindowStyle() & wxLC_REPORT ) { wxListItem info; info.m_itemId = event.m_itemIndex; info.m_col = 1; info.m_mask = wxLIST_MASK_TEXT; if ( GetItem(info) ) { wxLogMessage("Value of the 2nd field of the selected item: %s", info.m_text); } else { wxFAIL_MSG("wxListCtrl::GetItem() failed"); } } } void MyListCtrl::OnDeselected(wxListEvent& event) { LogEvent(event, "OnDeselected"); } void MyListCtrl::OnActivated(wxListEvent& event) { LogEvent(event, "OnActivated"); } void MyListCtrl::OnFocused(wxListEvent& event) { LogEvent(event, "OnFocused"); event.Skip(); } void MyListCtrl::OnItemRightClick(wxListEvent& event) { LogEvent(event, "OnItemRightClick"); event.Skip(); } void MyListCtrl::OnChecked(wxListEvent& event) { LogEvent(event, "OnChecked"); if ( IsVirtual() ) { CheckItem(event.GetIndex(), true); } event.Skip(); } void MyListCtrl::OnUnChecked(wxListEvent& event) { LogEvent(event, "OnUnChecked"); if ( IsVirtual() ) { CheckItem(event.GetIndex(), false); } event.Skip(); } void MyListCtrl::OnListKeyDown(wxListEvent& event) { long item; if ( !wxGetKeyState(WXK_SHIFT) ) { LogEvent(event, "OnListKeyDown"); event.Skip(); } switch ( event.GetKeyCode() ) { case 'C': // colorize { wxListItem info; info.m_itemId = event.GetIndex(); if ( info.m_itemId == -1 ) { // no item break; } GetItem(info); wxItemAttr *attr = info.GetAttributes(); if ( !attr || !attr->HasTextColour() ) { info.SetTextColour(*wxCYAN); SetItem(info); RefreshItem(info.m_itemId); } } break; case 'N': // next item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED); if ( item++ == GetItemCount() - 1 ) { item = 0; } wxLogMessage("Focusing item %ld", item); SetItemState(item, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); EnsureVisible(item); break; case 'R': // show bounding rectangle { item = event.GetIndex(); wxRect r; if ( !GetItemRect(item, r) ) { wxLogError("Failed to retrieve rect of item %ld", item); break; } wxLogMessage("Bounding rect of item %ld is (%d, %d)-(%d, %d)", item, r.x, r.y, r.x + r.width, r.y + r.height); } break; case '1': // show sub item bounding rectangle for the given column case '2': // (and icon/label rectangle if Shift/Ctrl is pressed) case '3': case '4': // this column is invalid but we want to test it too if ( InReportView() ) { int subItem = event.GetKeyCode() - '1'; item = event.GetIndex(); wxRect r; int code = wxLIST_RECT_BOUNDS; if ( wxGetKeyState(WXK_SHIFT) ) code = wxLIST_RECT_ICON; else if ( wxGetKeyState(WXK_CONTROL) ) code = wxLIST_RECT_LABEL; if ( !GetSubItemRect(item, subItem, r, code) ) { wxLogError("Failed to retrieve rect of item %ld column %d", item, subItem + 1); break; } wxString part; switch ( code ) { case wxLIST_RECT_BOUNDS: part = "total rectangle"; break; case wxLIST_RECT_ICON: part = "icon"; break; case wxLIST_RECT_LABEL: part = "label"; break; } wxLogMessage("Bounding rect of the %s of the item %ld column %d is (%d, %d)-(%d, %d)", part, item, subItem + 1, r.x, r.y, r.x + r.width, r.y + r.height); } break; case 'U': // update if ( !IsVirtual() ) break; if ( m_updated != -1 ) RefreshItem(m_updated); m_updated = event.GetIndex(); if ( m_updated != -1 ) { // we won't see changes to this item as it's selected, update // the next one (or the first one if we're on the last item) if ( ++m_updated == GetItemCount() ) m_updated = 0; wxLogMessage("Updating colour of the item %ld", m_updated); RefreshItem(m_updated); } break; case 'D': // delete item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); while ( item != -1 ) { DeleteItem(item); wxLogMessage("Item %ld deleted", item); // -1 because the indices were shifted by DeleteItem() item = GetNextItem(item - 1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); } break; case 'I': // insert if ( GetWindowStyle() & wxLC_REPORT ) { if ( GetWindowStyle() & wxLC_VIRTUAL ) { SetItemCount(GetItemCount() + 1); } else // !virtual { int idx = event.GetIndex(); if ( idx == -1 ) idx = 0; InsertItemInReportView(idx); } break; } wxFALLTHROUGH; default: event.Skip(); } } void MyListCtrl::OnChar(wxKeyEvent& event) { wxLogMessage("Got char event."); event.Skip(); } void MyListCtrl::OnRightClick(wxMouseEvent& event) { if ( !event.ControlDown() ) { event.Skip(); return; } int flags; long subitem; long item = HitTest(event.GetPosition(), flags, &subitem); wxString where; switch ( flags ) { case wxLIST_HITTEST_ABOVE: where = "above"; break; case wxLIST_HITTEST_BELOW: where = "below"; break; case wxLIST_HITTEST_NOWHERE: where = "nowhere near"; break; case wxLIST_HITTEST_ONITEMICON: where = "on icon of"; break; case wxLIST_HITTEST_ONITEMLABEL: where = "on label of"; break; case wxLIST_HITTEST_TOLEFT: where = "to the left of"; break; case wxLIST_HITTEST_TORIGHT: where = "to the right of"; break; default: where = "not clear exactly where on"; break; } wxLogMessage("Right double click %s item %ld, subitem %ld", where, item, subitem); } void MyListCtrl::LogEvent(const wxListEvent& event, const wxString& eventName) { wxLogMessage("Item %ld: %s (item text = %s, data = %ld)", event.GetIndex(), eventName, event.GetText(), static_cast<long>(event.GetData())); } wxString MyListCtrl::OnGetItemText(long item, long column) const { if ( GetItemCount() == WXSIZEOF(SMALL_VIRTUAL_VIEW_ITEMS) ) { return SMALL_VIRTUAL_VIEW_ITEMS[item][column]; } else // "big" virtual control { return wxString::Format("Column %ld of item %ld", column, item); } } void MyListCtrl::CheckItem(long item, bool check) { if ( IsVirtual() ) { m_checked.SelectItem(item, check); RefreshItem(item); } else { wxListCtrl::CheckItem(item, check); } } bool MyListCtrl::IsItemChecked(long item) const { if ( IsVirtual() ) { return m_checked.IsSelected(item); } else { return wxListCtrl::IsItemChecked(item); } } bool MyListCtrl::OnGetItemIsChecked(long item) const { return IsItemChecked(item); } int MyListCtrl::OnGetItemColumnImage(long item, long column) const { if (!column) return 0; if (!(item % 3) && column == 1) return 0; return -1; } wxItemAttr *MyListCtrl::OnGetItemAttr(long item) const { // test to check that RefreshItem() works correctly: when m_updated is // set to some item and it is refreshed, we highlight the item if ( item == m_updated ) { static wxItemAttr s_attrHighlight(*wxRED, wxNullColour, wxNullFont); return &s_attrHighlight; } return wxListCtrl::OnGetItemAttr(item); } void MyListCtrl::InsertItemInReportView(int i) { wxString buf; buf.Printf("This is item %d", i); long tmp = InsertItem(i, buf, 0); SetItemData(tmp, i); buf.Printf("Col 1, item %d", i); SetItem(tmp, 1, buf); buf.Printf("Item %d in column 2", i); SetItem(tmp, 2, buf); } #if USE_CONTEXT_MENU void MyListCtrl::OnContextMenu(wxContextMenuEvent& event) { if (GetEditControl() == NULL) { wxPoint point = event.GetPosition(); // If from keyboard if ( (point.x == -1) && (point.y == -1) ) { wxSize size = GetSize(); point.x = size.x / 2; point.y = size.y / 2; } else { point = ScreenToClient(point); } int flags; ShowContextMenu(point, HitTest(point, flags)); } else { // the user is editing: // allow the text control to display its context menu // if it has one (it has on Windows) rather than display our one event.Skip(); } } #endif void MyListCtrl::ShowContextMenu(const wxPoint& pos, long item) { wxMenu menu; menu.Append(wxID_ANY, wxString::Format("Menu for item %ld", item)); menu.Append(wxID_ABOUT, "&About"); menu.AppendSeparator(); menu.Append(wxID_EXIT, "E&xit"); PopupMenu(&menu, pos.x, pos.y); }
export class User { constructor( public _id: string, public email: string, public username: string, public profilePicture: string, public phoneNumber: string, public bio: string, public followers: Array<string>, public followings: Array<string>, public posts: Array<string>, public createdAt: string, public updatedAt: string, private token?: string, ) {} get tokenValue() { return this.token; } }
const JWT = require('jsonwebtoken'); const lti = require('ims-lti'); const fromEvent = require('graphcool-lib').fromEvent; export default async (event: any) => { if (!event.context.graphcool.rootToken) { console.log('Please provide a valid root token!') return { error: 'assignment-lti-grade not configured correctly.' }; } try { const graphcool: any = fromEvent(event); const api: any = graphcool.api('simple/v1'); const ltiSessionIdJWT: string = event.data.ltiSessionIdJWT; //this JWT is signed in the assignment-lti-launch function and merely contains the ltiSessionId, which is the actual graph.cool id of the LTISession stored in the database const ltiSessionId: string = JWT.verify(ltiSessionIdJWT, process.env.PRENDUS_JWT_SECRET).ltiSessionId; // console.log('ltiSessionId', ltiSessionId); const outcomeService: object | null = await getOutcomeService(api, ltiSessionId); //this service allows for the grade to be passed back to the LTI consumer. It has a method that abstracts away that functionality for us // console.log('outcomeService', outcomeService); if (outcomeService !== null) await sendGrade(outcomeService, 1); //only pass back a grade if the LTI consumer has setup grade passback // await deleteLTISession(api, ltiSessionId); //we do not keep LTISessions in the database. The user creates a session when they launch, and the session ends completely when they submit their grade return { data: { success: true } }; } catch(error) { // do not show the full details of the error to the user. The error will show up in the function logs which are only available to us console.log(error); return { error: 'An error occurred' }; } }; async function getOutcomeService(api: any, ltiSessionId: string): Promise<object | null> { const data = await api.request(` query($ltiSessionId: ID!) { LTISession(id: $ltiSessionId) { serializedOutcomeService } } `, { ltiSessionId }); //TODO temp solution, remove once the ltiSessionIdJWT can be deleted on the client if (data.LTISession === null) { console.log('LTISession does not exist, it was most likely deleted...this really should not happen, perhaps the ltiSessionIdJWT was not deleted properly from the client'); return null; } //TODO temp solution, remove once the ltiSessionIdJWT can be deleted on the client // the outcomeService property will be null if the LTI consumer has not setup grade passback if (data.LTISession.serializedOutcomeService.outcomeService === null) { return null; } else { const outcomeService = new lti.OutcomeService({ ...data.LTISession.serializedOutcomeService }); return outcomeService; } } async function deleteLTISession(api: any, ltiSessionId: string): Promise<string> { const data = await api.request(` mutation($ltiSessionId: ID!) { deleteLTISession(id: $ltiSessionId) { id } } `, { ltiSessionId }); //TODO temp solution, remove once the ltiSessionIdJWT can be deleted on the client if (data.deleteLTISession === null) { console.log('LTISession does not exist, it was most likely deleted...this really should not happen, perhaps the ltiSessionIdJWT was not deleted properly from the client'); return null; } //TODO temp solution, remove once the ltiSessionIdJWT can be deleted on the client return data.deleteLTISession.id; } function sendGrade(outcomeService: any, grade: number): Promise<void> { return new Promise((resolve, reject) => { // console.log('grade', grade); // console.log('outcomeService.send_replace_result', outcomeService.send_replace_result); outcomeService.send_replace_result(grade, (error: any, result: any) => { // console.log('error', error); // console.log('result', result); if (error) { reject(error); } else { resolve(); } }); }); }
// Actions for managing todos export const ADD_TODO = 'ADD_TODO'; export const REMOVE_TODO = 'REMOVE_TODO'; // Action creators for the above actions function addTodo(description) { return { type: ADD_TODO, description }; } function removeTodo(index) { return { type: REMOVE_TODO, index }; } // Reducer for updating the redux state export default function todosReducer(state = [], action) { switch (action.type) { case ADD_TODO: return [...state, action.description]; case REMOVE_TODO: return [ ...state.slice(0, action.index), ...state.slice(action.index + 1) ]; default: return state; } } // React Component for displaying the todo list class ToDoList extends Component { constructor(props) { super(props); this.state = { descriptions: [], }; } addTodo = () => { const description = this.input.value; this.props.dispatch(addTodo(description)); this.input.value = ''; }; deleteTodo = (index) => { this.props.dispatch(removeTodo(index)); }; displayTodos = () => ( this.props.todos.map((description, index) => ( <div key={description}> <p>{description}</p> <button onClick={() => this.deleteTodo(index)}> Delete </button> </div> )) ) render() { return ( <div> <h1>To Do List</h1> <input ref={(input) => this.input = input} /> <button onClick={this.addTodo}> Add </button> {this.displayTodos()} </div> ); } } // Connect the component to the redux store const mapStateToProps = (state) => ({ todos: state }); export default connect(mapStateToProps)(ToDoList);
fn find_min(arr: &[i32]) -> i32 { let mut min = arr[0]; for ele in arr { if ele < min { min = ele; } } min }
const TIERS = ['iron', 'bronze', 'silver', 'gold', 'platinum', 'diamond', 'master', 'challenger'] /** * Returns true if string passed as argument is a valid tier * * @param tier tier name * @return bool */ function IsValidTier(tier) { for(var i = 0; i < TIERS.length; i++) { if(tier.toLowerCase() === TIERS[i]) return true; } return false; } module.exports = { tiers: TIERS, IsValidTier: IsValidTier };
<filename>tools/shared/src/XmlTagTextWalker.cpp // // Created by yuan on 7/26/19. // #include "XmlTagTextWalker.h" #include <string> #include <string.h> XmlTagTextWalker::XmlTagTextWalker(const TagNodeFilterDict& tagNodeFilterDict) : tagNodeFilterDict_(tagNodeFilterDict) { for (const std::string& tag : tagNodeFilterDict_.getKeys()) tagTextDict_[tag] = std::vector<std::string>(); } bool XmlTagTextWalker::for_each(pugi::xml_node &node) { if (auto tagNode = tagTextDict_.find(std::string(node.name())); tagNode != tagTextDict_.end()) { std::string filteredText = tagNodeFilterDict_[tagNode->first](node); if (!filteredText.empty()) tagNode->second.emplace_back(filteredText); /* if (node.find_child([](pugi::xml_node& childNode) { return strcmp(childNode.name(), "text") == 0; })) { const char* textTag = node.child("text").text().get(); int tagLen = strlen(textTag); if (tagLen != 0) { tagNode->second.emplace_back(textTag); } } */ } return true; } void XmlTagTextWalker::reset() { for (auto& p : tagTextDict_) p.second.clear(); }
package owlmoney.logic.parser.investment; import java.util.Iterator; import owlmoney.logic.command.Command; import owlmoney.logic.command.bank.DeleteInvestmentCommand; import owlmoney.logic.parser.exception.ParserException; /** * Represents the parsing of inputs for deleting an investment account.. */ public class ParseDeleteInvestment extends ParseInvestment { private static final String DELETE_COMMAND = "/delete"; /** * Creates an instance of ParseDeleteInvestment. * * @param data Raw user input data. * @throws ParserException If there are redundant parameters or if the first parameter is not valid. */ public ParseDeleteInvestment(String data) throws ParserException { super(data); checkRedundantParameter(AMOUNT_PARAMETER, DELETE_COMMAND); checkRedundantParameter(NEW_NAME_PARAMETER, DELETE_COMMAND); checkFirstParameter(); } /** * Checks each user input for each parameter. * * @throws ParserException If there are any invalid user input. */ public void checkParameter() throws ParserException { Iterator<String> investmentIterator = investmentParameters.keySet().iterator(); while (investmentIterator.hasNext()) { String key = investmentIterator.next(); String value = investmentParameters.get(key); if (NAME_PARAMETER.equals(key) && (value == null || value.isBlank())) { logger.warning(key + " cannot be empty when deleting an investment account"); throw new ParserException(key + " cannot be empty when deleting an investment account"); } else if (NAME_PARAMETER.equals(key)) { checkName(NAME_PARAMETER, value); } } } /** * Returns the command to execute the deletion of investment account. * * @return DeleteInvestmentCommand to be executed. */ public Command getCommand() { DeleteInvestmentCommand newDeleteInvestmentCommand = new DeleteInvestmentCommand(investmentParameters.get(NAME_PARAMETER)); logger.info("Successful creation of DeleteInvestmentCommand object"); return newDeleteInvestmentCommand; } }
/* Copyright 2021 freecodeformat.com */ package com.littlejenny.gulimall.order.to.paypal.capture; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; /* Time: 2021-08-28 20:21:32 @author <EMAIL>codeformat.com @website http://www.freecodeformat.com/json2javabean.php */ @Data public class Payer { @JsonProperty("payment_method") private String paymentMethod; private String status; @JsonProperty("payer_info") private PayerInfo payerInfo; }
<filename>pluginreg.cpp /* vim:set ts=4 sw=4: * * (C) 2008 <NAME> <EMAIL> * * IdcPerl - a perl scripting plugin for the Interactive Disassembler by hex-rays. * see http://www.xs4all.nl/~itsme/projects/idcperl * * this file contains the code to register the plugin with ida, * */ #include <string> #include <vector> // ida includes #include <pro.h> #include <ida.hpp> #include <idp.hpp> #include <bytes.hpp> #include <loader.hpp> // for plugin_t #include <kernwin.hpp> #include <diskio.hpp> // perl includes #include "extern.h" #include "perl.h" #include "xsub.h" #undef do_open #undef do_close #ifdef DYNAMIC_PERL #include "redefperlasdll.h" #include "perldllprocs.h" #include "perldll.h" #endif #include "perlinterp.h" #include "pluginreg.h" #if IDA_SDK_VERSION>=530 #include "langreg.h" #endif #if IDA_SDK_VERSION>=540 #include "clireg.h" #endif #ifdef _WITH_CANCEL #include "perlthread.h" #endif #ifdef TRACE_PLUGIN #define tracemsg msg #else #define tracemsg(...) #endif #ifdef DYNAMIC_PERL PerlDll dll; #endif // base interpreter, contains autorun code. Perl interp; Perl *clonedinterp; bool g_keepstate= false; #define PERLERR_IDALOG 0 #define PERLERR_POPUP 1 #define PERLERR_WINDOW 2 ushort g_perlerrors= 0; int parseversion(const char *versionstr) { const char *dot= strchr(versionstr, '.'); if (dot==NULL) return 0; return strtol(versionstr, 0, 10)*100 + strtol(dot+1, 0, 10); } int idaapi findmaxversion(const char *name, void *ud) { const char *dash= strstr(name, "idaperl-"); if (dash==NULL) return 0; int version= parseversion(dash+8); if (version > *(int*)ud) *(int*)ud= version; return 0; } bool is_newest_version() { int maxversion=0; enumerate_system_files(NULL, 0, "plugins", "*", findmaxversion, &maxversion); int myversion= parseversion(IDAPERL_VERSION); return myversion==maxversion; } void read_blob(int blobsupid, std::string& buffer) { netnode n(IDAPERLNODE, 0, true); buffer.resize(n.blobsize(blobsupid, stag)); if (buffer.size()) { size_t blobsize= buffer.size(); n.getblob(&buffer[0], &blobsize, blobsupid, stag); tracemsg("readblob(%08x), %s\n", blobsupid, buffer.c_str()); } } void save_blob(int blobsupid, const std::string& buffer) { tracemsg("saveblob(%08x), %s\n", blobsupid, buffer.c_str()); netnode n(IDAPERLNODE, 0, true); n.setblob(buffer.c_str(), buffer.size(), blobsupid, stag); } bool edit_blob(int blobsupid, const std::string& title, std::string& buffer, const std::string& initialval) { read_blob(blobsupid, buffer); if (buffer.empty()) { buffer=initialval; } buffer.resize(65536); char *txt= asktext(buffer.size(), &buffer[0], &buffer[0], "%s", title.c_str()); if (txt) { buffer.resize(strlen(txt)); save_blob(blobsupid, buffer); return true; } else { buffer.clear(); return false; } } void exec_perlcode(const std::string&perlcode) { #ifdef DYNAMIC_PERL if (!dll.isloaded()) return; #endif #ifdef CLONE_PERL if (!g_keepstate && clonedinterp) { delete clonedinterp; clonedinterp= NULL; } if (clonedinterp==NULL) { clonedinterp= interp.clone(); } #else clonedinterp= &interp; #endif #ifdef _WITH_CANCEL perlthread pt(clonedinterp, perlcode); if (pt.wait(10000) && pt.cancelwait()) { pt.cancel(); } #else char errbuf[1024]; if (!clonedinterp->exec(perlcode.c_str(), errbuf, 1024)) msg("IDAPERL ERROR: %s\n", errbuf); #endif } void exec_autorun() { #ifdef DYNAMIC_PERL if (!dll.isloaded()) return; #endif std::string perlcode; read_blob(ISUP_AUTORUN, perlcode); #ifdef _WITH_CANCEL perlthread pt(&interp, perlcode); if (pt.wait(10000) && pt.cancelwait()) { pt.cancel(); } #else char errbuf[1024]; if (!interp.exec(perlcode.c_str(), errbuf, 1024)) msg("IDAPERL ERROR: %s\n", errbuf); #endif } void unload_perl() { #ifdef DYNAMIC_PERL if (!dll.isloaded()) return; #endif #ifdef CLONE_PERL if (clonedinterp) { delete clonedinterp; clonedinterp= NULL; } #endif interp.free(); #ifdef DYNAMIC_PERL dll.unload(); #endif } bool load_perl() { #ifdef DYNAMIC_PERL if (!dll.load()) return false; #endif if (!interp.initialize()) return false; msg("idaperl interpreter reinitialized\n"); exec_autorun(); return true; } Perl *cloneinterp() { #ifdef CLONE_PERL return interp.clone(); #else return &interp; #endif } void destroyclone(Perl *clone) { #ifdef CLONE_PERL delete clone; #endif } bool read_file(const std::string& filename, std::string& data) { FILE *f= qfopen(filename.c_str(), "rb"); if (f==NULL) { msg("error opening %s\n", filename.c_str()); return false; } qfseek(f, 0, SEEK_END); size_t fsize= qftell(f); if (fsize<=0 || fsize>=0x10000) { msg("invalid size: %08lx\n", fsize); qfclose(f); return false; } qfseek(f, 0, SEEK_SET); data.resize(fsize); size_t res= qfread(f, &data[0], data.size()); qfclose(f); if (res!=data.size()) { msg("error reading %s\n", filename.c_str()); return false; } return true; } //////////////////////////////////////////////////// // saved script management struct savedscript { std::string tag; std::string script; }; typedef std::vector<savedscript> savedscriptlist_t; savedscriptlist_t saved_scripts; bool extract_tag(const std::string& perlcode, std::string& tag) { size_t starttag= perlcode.find("#:"); if (starttag==perlcode.npos) return false; if (starttag==0 || perlcode[starttag-1]=='\r' || perlcode[starttag-1]=='\n') { size_t endtag= perlcode.find_first_of("\r\n", starttag); if (starttag+2<perlcode.size()) { tag= perlcode.substr(starttag+2, endtag==perlcode.npos?endtag:endtag-starttag-2); tracemsg("found tag: %s\n", tag.c_str()); return true; } } tracemsg("no tag in script\n"); return false; } void load_saved_scripts() { tracemsg("load_saved_scripts\n"); for (unsigned i=1 ; i<=MAX_SAVEDSCRIPTS ; i++) { std::string buffer; read_blob(ISUP_SAVED+0x100*(i-1), buffer); std::string tag; if (extract_tag(buffer, tag)) { saved_scripts.resize(i); saved_scripts.back().tag= tag; saved_scripts.back().script= buffer; } } tracemsg("found %d scripts\n", (int)saved_scripts.size()); } void savescript(const std::string& tag, const std::string& perlcode) { for (unsigned i=0 ; i<saved_scripts.size() ; i++) { if (saved_scripts[i].tag==tag) { saved_scripts[i].script= perlcode; save_blob(ISUP_SAVED+i*0x100, perlcode); tracemsg("saved script # %d\n", i); return; } } if (saved_scripts.size()==MAX_SAVEDSCRIPTS) { msg("not saving script, you can save up to %d scripts\n", MAX_SAVEDSCRIPTS); return; } saved_scripts.resize(saved_scripts.size()+1); saved_scripts.back().tag= tag; saved_scripts.back().script= perlcode; save_blob(ISUP_SAVED+(saved_scripts.size()-1)*0x100, perlcode); tracemsg("now total %d saved scripts\n", (int)saved_scripts.size()); } //////////////////////////////////////////////////// // ida event handlers // menu+run handler bool idaapi run_immediate(void*) { std::string perlcode; if (edit_blob(ISUP_MANUAL, "enter perl code", perlcode, "use warnings;\n" "use strict;\n" "use IDC;\n")) { exec_perlcode(perlcode); std::string tag; if (extract_tag(perlcode, tag)) savescript(tag, perlcode); return true; } return false; } // menu handler bool idaapi pick_script(void*) { if (saved_scripts.empty()) return false; std::string layout= "choose perl script\n"; layout += "scripts\n"; for (unsigned i=0 ; i<saved_scripts.size() ; i++) { layout += "<"; layout += saved_scripts[i].tag; layout += ":R"; if (i+1==saved_scripts.size()) // the last item layout += ">"; layout += ">\n"; } layout += "wrapper\n" "<none:R> <e~x~ec:r>\n" "<heads:R> <~e~dit:r>\n" "<addrs:R> <~d~elete:r>>\n" "<functions:R>\n" "<fchunks:R>>\n"; /* */ static int scriptid=0; /*not static*/ int action=0; /* */ static int wrapper=0; int ok= AskUsingForm_c(layout.c_str(), &scriptid, &action, &wrapper); if (!ok) return false; std::string code= saved_scripts[scriptid].script; if (action==1) { tracemsg("editting before exec\n"); // todo: add wrapper when editting save_blob(ISUP_MANUAL, code); return run_immediate(NULL); } else if (action==2) { saved_scripts.erase(saved_scripts.begin()+scriptid); for (unsigned i=scriptid ; i<saved_scripts.size() ; i++) { save_blob(ISUP_SAVED+i*0x100, saved_scripts[i].script); } save_blob(ISUP_SAVED+saved_scripts.size()*0x100, ""); } else { if (wrapper) { std::string firstfn, nextfn, endfn; switch(wrapper) { case 0: break; case 1: nextfn="NextHead($ea,$__end)"; firstfn="ScreenEA()"; endfn="$ea==ScreenEA()"; break; case 2: nextfn="NextAddr($ea)"; firstfn="ScreenEA()"; endfn="$ea<ScreenEA()+ItemSize(ScreenEA())"; break; case 3: nextfn="NextFunction($ea)"; firstfn="FirstSeg()"; endfn="1"; break; case 4: nextfn="NextFuncFchunk(ScreenEA(), $ea)"; firstfn="FirstFuncFchunk(ScreenEA())"; endfn="1"; break; } code= "use IDC;" "use IDA;" "my ($__begin, $__end)= (SelBegin(), SelEnd());" "for (my $ea=($__begin!=BADADDR)?$__begin:"+firstfn+" ; $ea!=BADADDR && (($__begin!=BADADDR) ? $ea<$__end : "+endfn+") ; $ea="+nextfn+") {\n" +code +"}"; ; } exec_perlcode(code); } return true; } #ifdef __NT__ const char *scriptwildcard="\\*.pl"; #else const char *scriptwildcard="/*.pl"; #endif std::string g_scriptdir= idadir("perl"); // menu+run handler bool idaapi run_file(void *) { const char *perlfile= askfile_c(0, (g_scriptdir+scriptwildcard).c_str(), "select perl script"); if (perlfile==NULL) return false; std::string perlcode; if (!read_file(perlfile, perlcode)) return false; size_t slash= std::string(perlfile).find_last_of("/\\"); if (slash!=std::string::npos) g_scriptdir=std::string(perlfile).substr(0, slash); exec_perlcode(perlcode); return true; } // menu+run handler bool idaapi reset_interpreter(void*) { #ifdef DYNAMIC_PERL if (!dll.isloaded()) return false; #endif unload_perl(); load_perl(); return false; } std::string gethotkeyname(short hotkey) { std::string keyname; if (hotkey&0x8000) { if (!keyname.empty()) keyname+="+"; keyname+="alt"; } if (!keyname.empty()) keyname+="-"; int c= (hotkey&0xff); if ((c>='0' && c<='9') || (c>='A' && c<='Z')) keyname += c; else if (c>=0x70 && c<=0x87) { char fbuf[8]; qsnprintf(fbuf, 8, "F%d", c-0x6f); keyname += fbuf; } else { char fbuf[8]; qsnprintf(fbuf, 8, "%02x", c); keyname += fbuf; } return keyname; } // menu+run handler bool idaapi about_idaperl(void *) { static std::string hotkeyname; if (hotkeyname.empty()) { for (plugin_info_t *pi= get_plugins() ; pi ; pi=pi->next) { if (pi->entry==&PLUGIN) { msg("%p: %04x %04x %2d F=%x p='%s' on='%s' n='%s'\n", pi, pi->org_hotkey, pi->hotkey, pi->arg, pi->flags, pi->path, pi->org_name, pi->name); hotkeyname= gethotkeyname(pi->hotkey); break; } } } msg("IDAPERL, by Wil<NAME>, <EMAIL>\n" " %s : execute immediate perl\n" " alt-3 : execute perl file\n" " alt-4 : reset perl interpreter\n" " alt-5 : pick recent immediate perl\n" " alt-6 : help\n", hotkeyname.c_str()); return false; } // ida edit callback void idaapi autorun_edit(TView *[],int) { std::string perlbuf; edit_blob(ISUP_AUTORUN, "enter perl autorun code", perlbuf, ""); } // menu handler bool idaapi config_idaperl(void *) { #ifdef DYNAMIC_PERL if (!dll.isloaded()) return false; #endif const char*layout= "IDAPerl Configuration\n" "<keep perl state:C>>\n" "<##perl errors##idalog:R>\n" "<popup:R>\n" "<seperate window:R>>\n" "<autorun:B::::>\n"; ushort checkboxes= (g_keepstate?1:0); int ok= AskUsingForm_c(layout, &checkboxes, &g_perlerrors, autorun_edit); if (ok) g_keepstate= (checkboxes&1)!=0; return false; } //-------------------------------------------------------------------------- // // Initialize. // // IDA will call this function only once. // If this function returns PLGUIN_SKIP, IDA will never load it again. // If this function returns PLUGIN_OK, IDA will unload the plugin but // remember that the plugin agreed to work with the database. // The plugin will be loaded again if the user invokes it by // pressing the hotkey or selecting it from the menu. // After the second load the plugin will stay on memory. // If this function returns PLUGIN_KEEP, IDA will keep the plugin // in the memory. In this case the initialization function can hook // into the processor module and user interface notification points. // See the hook_to_notification_point() function. // // In this example we check the input file format and make the decision. // You may or may not check any other conditions to decide what you do: // whether you agree to work with the database or not. // int idaapi init(void) { // if ( inf.filetype == f_ELF ) return PLUGIN_SKIP; tracemsg("plugin init\n"); // prevent accidental activation of multiple versions //if (!is_newest_version()) { // msg("IDCPERL: found multiple versions, only loading latest\n"); // return PLUGIN_SKIP; //} if (!load_perl()) return PLUGIN_SKIP; add_menu_item("File/IDC Command", "Run P~e~rl Script", "Alt-3", SETMENU_APP, run_file, 0); add_menu_item("File/IDC Command", "Pick P~e~rl Script", "Alt-5", SETMENU_APP, pick_script, 0); add_menu_item("File/IDC Command", "Reset Perl ~I~nterpreter", "Alt-4", SETMENU_APP, reset_interpreter, 0); add_menu_item( #ifdef _WIN32 "Help/External help", #else "Help/Check for free update", #endif "IDAPerl Help", "Alt-6", SETMENU_APP, about_idaperl, 0); add_menu_item("Options/Font", "IDAPerl Options", "", SETMENU_APP, config_idaperl, 0); #if IDA_SDK_VERSION>=530 register_language(); #endif #if IDA_SDK_VERSION>=540 register_cli(); #endif msg("\n" "IDAPERL version %s\n" "by <NAME>, email: <EMAIL>\n" "www: http://www.xs4all.nl/~itsme/\n", IDAPERL_VERSION); // Please uncomment the following line to see how the notification works // hook_to_notification_point(HT_UI, sample_callback, NULL); // Please uncomment the following line to see how the user-defined prefix works // set_user_defined_prefix(prefix_width, get_user_defined_prefix); load_saved_scripts(); return PLUGIN_KEEP; } //-------------------------------------------------------------------------- // Terminate. // Usually this callback is empty. // The plugin should unhook from the notification lists if // hook_to_notification_point() was used. // // IDA will call this function when the user asks to exit. // This function won't be called in the case of emergency exits. void idaapi term(void) { #ifdef DYNAMIC_PERL if (!dll.isloaded()) return; #endif tracemsg("plugin term\n"); #if IDA_SDK_VERSION>=530 deregister_language(); #endif #if IDA_SDK_VERSION>=540 deregister_cli(); #endif //unhook_from_notification_point(HT_UI, sample_callback); //set_user_defined_prefix(0, NULL); unload_perl(); msg("idaperl-%s terminated\n", IDAPERL_VERSION); } //-------------------------------------------------------------------------- // // The plugin method // // This is the main function of plugin. // // It will be called when the user selects the plugin. // // arg - the input argument, it can be specified in // plugins.cfg file. The default is zero. // // void idaapi run(int arg) { #ifdef DYNAMIC_PERL if (!dll.isloaded()) return; #endif tracemsg("plugin run(%d)\n", arg); switch(arg) { case 0: run_immediate(NULL); break; case 1: run_file(NULL); break; case 2: reset_interpreter(NULL); break; case 3: about_idaperl(NULL); break; } } //-------------------------------------------------------------------------- char comment[] = "runs perl scripts"; char help[] = "no help yet\n"; //-------------------------------------------------------------------------- // This is the preferred name of the plugin module in the menu system // The preferred name may be overriden in plugins.cfg file char wanted_name[] = "idaperl"; // This is the preferred hotkey for the plugin module // The preferred hotkey may be overriden in plugins.cfg file // Note: IDA won't tell you if the hotkey is not correct // It will just disable the hotkey. char wanted_hotkey[] = "Alt-2"; //-------------------------------------------------------------------------- // // PLUGIN DESCRIPTION BLOCK // //-------------------------------------------------------------------------- plugin_t PLUGIN = { IDP_INTERFACE_VERSION, 0, // plugin flags init, // initialize term, // terminate. this pointer may be NULL. run, // invoke plugin comment, // long comment about the plugin // it could appear in the status line // or as a hint help, // multiline help about the plugin wanted_name, // the preferred short name of the plugin wanted_hotkey // the preferred hotkey to run the plugin };
#include <iostream> #include <vector> #include <string> #include <stack> using namespace std; string removeWS(string var) { string temp; for(int i = 0;i < var.length();i++) if(var[i] != ' ') temp.push_back(var[i]); return temp; } bool isValid(string var) { bool a = 1; for(int i = 0;i < var.length();i++) if(var[i] >= 'a') a = 0; return a; } int operatorLevel(char a) { switch(a) { case '+': case '-': return 1; case '*': case '/': return 2; case '^': return 3; } } void converter(string var) { var = removeWS(var); vector<char> output; stack<char> stack; for(int i = 0;i < var.length();i++) { if(var[i] != '+' && var[i] != '-' && var[i] != '*' && var[i] != '/' && var[i] != '^' && var[i] != '(' && var[i] != ')') output.push_back(var[i]); else { if(stack.empty()) stack.push(var[i]); else { while(!stack.empty() && operatorLevel(var[i]) <= operatorLevel(stack.top())) { if(var[i] != '(' && var[i] != ')') output.push_back(stack.top()); stack.pop(); } stack.push(var[i]); } } } while(!stack.empty()) { output.push_back(stack.top()); stack.pop(); } for(int i = 0;i < var.length();i++) cout << output[i]; cout << endl; } int main() { string input; cout << "[Input] > "; while(getline(cin, input) && (input != "exit")) { converter(input); cout << "[Input] > "; } return 0; }
import java.util.Scanner; public class Order { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter the number of items: "); int numOfItems = sc.nextInt(); System.out.println("Enter the price of each item: "); double itemPrice = sc.nextDouble(); double totalCost = numOfItems * itemPrice; System.out.println("Total cost: " + totalCost); sc.close(); } }
<filename>test-data/comp-changes/old/src/main/unused/fieldLessAccessible/FieldLessAccessibleSuper.java<gh_stars>1-10 package main.unused.fieldLessAccessible; public class FieldLessAccessibleSuper { public int superPublic2Private; public int superPublic2Protected; public int superPublic2PackagePrivate; protected int superProtected2Private; int superPackagePrivate2Private; int superPackagePrivateToProtected; }
python -m sockeye.train --source data/toy/train.en.tok --target data/toy/train.de.tok --source-metadata data/toy/train.en.deps --validation-source data/toy/val.en.tok --validation-target data/toy/val.de.tok --val-source-metadata data/toy/val.en.deps --use-cpu --use-gcn --output toy_model --batch-size 2 --no-bucketing --rnn-num-hidden 32 --num-embed 32 --checkpoint-frequency 50 rm -rf toy_model
# _plot_umap.py __module_name__ = "_plot_umap.py" __author__ = ", ".join(["<NAME>"]) __email__ = ", ".join(["<EMAIL>",]) # package imports # # --------------- # import matplotlib.pyplot as plt import numpy as np import vinplots def _setup_plot(): """""" plot = vinplots.Plot() plot.construct(nplots=2, ncols=2, figsize_width=2, figsize_height=1.2) plot.style(spines_to_delete=["top", "right"], color="grey", spines_to_color=['bottom', 'left'], spines_positioning_amount=5) ax = plot.AxesDict[0][0] return plot, ax def _plot_umap(adata, umap_key, plot_by, colors_dict=False): """""" try: adata.obs = adata.obs.reset_index() except: pass umap = adata.obsm[umap_key] if not colors_dict: c = vinplots.color_palettes.SHAREseq plot, ax = _setup_plot() for n, i in enumerate(adata.obs[plot_by].unique()): if colors_dict: c_ = colors_dict[i] else: c_ = c[n] idx = adata.obs.loc[adata.obs[plot_by] == i].index.astype(int) ax.scatter(umap[:, 0][idx], umap[:, 1][idx], c=c_, label=i, s=5, alpha=0.8) ax.set_title("Harmonized Data") ax.legend(bbox_to_anchor=(1.05, 1.05), edgecolor="white", markerscale=2) plt.tight_layout() return plot
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fastBackward = void 0; var fastBackward = { "viewBox": "0 0 1792 1792", "children": [{ "name": "path", "attribs": { "d": "M1747 141q19-19 32-13t13 32v1472q0 26-13 32t-32-13l-710-710q-9-9-13-19v710q0 26-13 32t-32-13l-710-710q-9-9-13-19v678q0 26-19 45t-45 19h-128q-26 0-45-19t-19-45v-1408q0-26 19-45t45-19h128q26 0 45 19t19 45v678q4-10 13-19l710-710q19-19 32-13t13 32v710q4-10 13-19z" } }] }; exports.fastBackward = fastBackward;
#!/bin/bash fats_dir=`dirname "${BASH_SOURCE[0]}"`/fats if [ -d "$fats_dir" ]; then source ${fats_dir}/diagnostics.sh fi
var ObservableArray = require("data/observable-array").ObservableArray; const getFrameById = require("tns-core-modules/ui/frame").getFrameById; var PageDataViewModel = require("./page_data-view-model"); var Observable = require("data/observable"); const appSettings = require("application-settings"); var pagedataViewModel = new PageDataViewModel(); var year = ""; var month = ""; var day = ""; var date = ""; function pageLoaded(args) { var page = args.object; const TODAY = new Date(); var page_data = new Observable.fromObject({ selectedListPickerDate: 14, listPickerHour: ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"], selectedListPickerIndex: TODAY.getUTCHours() }); page_data.set("date_pick", TODAY); // the binded date property accepts Date object page_data.set("minDate", new Date(2018, 0, 29)); // the binded minDate property accepts Date object page_data.set("maxDate", new Date(2030, 4, 12)); // the binded maxDate property accepts Date object day = TODAY.getUTCDate().toString(); month = (TODAY.getUTCMonth() + 1).toString(); year = TODAY.getUTCFullYear().toString(); if(day < 10) day = "0" + day; if(month < 10) month = "0" + month; console.log("Giorno: " + day); console.log("Mese: " + month); console.log("Anno: " + year); date = year + month + day; console.log("Date: "+ date); page.bindingContext = page_data; } //Navigation button -> PAGE_DATA to PAGE1 //const Button = require("tns-core-modules/ui/button").Button; //const Page = require("tns-core-modules/ui/page").Page; function onTap(args) { var button = args.object; const page = button.page; var ora; /*Creating string YYYYMMDDZHH00 */ date = year + month + day; if(page.getViewById("hours_search").selectedIndex < 10) ora = "0" + page.getViewById("hours_search").selectedIndex; else ora = page.getViewById("hours_search").selectedIndex; date = date + "Z" + ora + "00"; appSettings.setString("data", date); //Done, sending to page1 const navigationEntry = { moduleName: "page_selection_place/page_selection_place", animated: true }; console.log("[PAGE_DATA] SELECTED DATA = ", date); page.frame.navigate(navigationEntry); } exports.onTap = onTap; function onDatePickerLoaded(args) { const datePicker = args.object; datePicker.on("dayChange", (args) => { date = ""; if (day < 10) day = "0"+args.value; else day = args.value; }); datePicker.on("monthChange", (args) => { date = ""; if (month < 10) month = "0"+args.value; else month = args.value; }); datePicker.on("yearChange", (args) => { date = ""; year = args.value; }); } exports.onDatePickerLoaded = onDatePickerLoaded; exports.pageLoaded = pageLoaded;
package io.opensphere.arcgis2.esri; import java.io.Serializable; import org.codehaus.jackson.annotate.JsonAutoDetect; import org.codehaus.jackson.annotate.JsonMethod; import org.codehaus.jackson.annotate.JsonProperty; /** * The Class EsriDrawingInfo. */ @JsonAutoDetect(JsonMethod.NONE) public class EsriDrawingInfo implements Serializable { /** Serial version UID. */ private static final long serialVersionUID = 1L; /** My brightness. */ @JsonProperty("brightness") private int myBrightness; /** My contrast. */ @JsonProperty("contrast") private int myContrast; /** My labeling information. */ @JsonProperty("labelingInfo") private Object myLabelingInfo; /** My renderer. */ @JsonProperty("renderer") private EsriRenderer myRenderer; /** My scale symbols boolean. */ @JsonProperty("scaleSymbols") private boolean myScaleSymbols; /** My transparency. */ @JsonProperty("transparency") private int myTransparency; /** * Gets the brightness. * * @return the brightness */ public int getBrightness() { return myBrightness; } /** * Gets the contrast. * * @return the contrast */ public int getContrast() { return myContrast; } /** * Gets the labeling info. * * @return the labeling info */ public Object getLabelingInfo() { return myLabelingInfo; } /** * Gets the renderer. * * @return the renderer */ public EsriRenderer getRenderer() { return myRenderer; } /** * Gets the transparency. * * @return the transparency */ public int getTransparency() { return myTransparency; } /** * Checks if scale symbols flag is set. * * @return true, if symbols are scaled */ public boolean isScaleSymbols() { return myScaleSymbols; } /** * Sets the brightness. * * @param brightness the new brightness */ public void setBrightness(int brightness) { myBrightness = brightness; } /** * Sets the contrast. * * @param contrast the new contrast */ public void setContrast(int contrast) { myContrast = contrast; } /** * Sets the labeling info. * * @param labelingInfo the new labeling info */ public void setLabelingInfo(Object labelingInfo) { myLabelingInfo = labelingInfo; } /** * Sets the renderer. * * @param renderer the new renderer */ public void setRenderer(EsriRenderer renderer) { myRenderer = renderer; } /** * Sets the scale symbols flag. * * @param scaleSymbols the new scale symbols flag */ public void setScaleSymbols(boolean scaleSymbols) { myScaleSymbols = scaleSymbols; } /** * Sets the transparency. * * @param transparency the new transparency */ public void setTransparency(int transparency) { myTransparency = transparency; } }
<reponame>stefanvodita/lucene<filename>lucene/suggest/src/test/org/apache/lucene/search/suggest/SuggestRebuildTestUtil.java /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.lucene.search.suggest; import static org.junit.Assert.assertNull; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.concurrent.Semaphore; import java.util.concurrent.atomic.AtomicReference; import org.apache.lucene.util.BytesRef; /** Reusable Logic for confirming that Lookup impls can return suggestions during a 'rebuild' */ public final class SuggestRebuildTestUtil { /** * Given a {@link Lookup} impl and some assertion callbacks, confirms that assertions which pass * after an initial build will continue to pass during a (slow) rebuild w/new data (in a * background thread), and that (optional) new assertions will pass once the rebuild is complete * * @param suggester to be tested * @param initialData initial data to use for initial {@link Lookup#build} * @param initialChecks assertions to test after the initial build, and during the re-{@link * Lookup#build} * @param extraData will be aded to <code>initialData</code> and used to re-<code>build()</code> * the suggester * @param finalChecks assertions to test after the re-<code>build()</code> completes */ public static void testLookupsDuringReBuild( final Lookup suggester, final List<Input> initialData, final ExceptionalCallback initialChecks, final List<Input> extraData, final ExceptionalCallback finalChecks) throws Exception { // copy we can mutate final List<Input> data = new ArrayList<>(initialData); suggester.build(new InputArrayIterator(data)); // sanity check initial results initialChecks.check(suggester); // modify source data we're going to build from, and spin up background thread that // will rebuild (slowly) data.addAll(extraData); final Semaphore readyToCheck = new Semaphore(0); final Semaphore readyToAdvance = new Semaphore(0); final AtomicReference<Throwable> buildError = new AtomicReference<>(); final Thread rebuilder = new Thread( () -> { try { suggester.build( new DelayedInputIterator( readyToCheck, readyToAdvance, new InputArrayIterator(data.iterator()))); } catch (Throwable t) { buildError.set(t); readyToCheck.release(data.size() * 100); // flood the semaphore so we don't block } }); rebuilder.start(); // at every stage of the slow rebuild, we should still be able to get our original suggestions // (+1 iteration to ensure final next() call can return null) for (int i = 0; i < data.size() + 1; i++) { try { assertNull(buildError.get()); readyToCheck.acquire(); initialChecks.check(suggester); readyToAdvance.release(); } catch (Throwable t) { readyToAdvance.release(data.size() * 100); // flood the semaphore so we don't block throw t; } } // once all the data is released from the iterator, the background rebuild should finish, and // suggest results // should change rebuilder.join(); assertNull(buildError.get()); finalChecks.check(suggester); } /** * Simple marker interface to allow {@link #testLookupsDuringReBuild} callbacks to throw * Exceptions */ public static interface ExceptionalCallback { public void check(final Lookup suggester) throws Exception; } /** * An InputArrayIterator wrapper whose {@link InputIterator#next} method releases on a Semaphore, * and then acquires from a differnet Semaphore. */ private static final class DelayedInputIterator implements InputIterator { final Semaphore releaseOnNext; final Semaphore acquireOnNext; final InputIterator inner; public DelayedInputIterator( final Semaphore releaseOnNext, final Semaphore acquireOnNext, final InputIterator inner) { assert null != releaseOnNext; assert null != acquireOnNext; assert null != inner; this.releaseOnNext = releaseOnNext; this.acquireOnNext = acquireOnNext; this.inner = inner; } @Override public BytesRef next() throws IOException { releaseOnNext.release(); try { acquireOnNext.acquire(); } catch (InterruptedException e) { throw new RuntimeException(e); } return inner.next(); } @Override public long weight() { return inner.weight(); } @Override public BytesRef payload() { return inner.payload(); } @Override public boolean hasPayloads() { return inner.hasPayloads(); } @Override public Set<BytesRef> contexts() { return inner.contexts(); } @Override public boolean hasContexts() { return inner.hasContexts(); } } }
import assert from "node:assert"; import { extract } from "../../../src/core/scrapers.js"; describe("Scraper: GoPlay", function () { it("should return URL when it's not a video", async function () { const url = new URL("https://www.goplay.be/programmas"); const options = { depth: false, incognito: false }; const file = await extract(url, options); assert.strictEqual(file, url.href); }); it("should return video URL", async function () { const url = new URL("https://www.goplay.be/video/homeparty-met-kat" + "/kat-praat-met-onze-echte-helden-de-zorgverleners"); const options = { depth: false, incognito: false }; const file = await extract(url, options); assert.strictEqual(file, "https://stream2-vod.cdn1.sbs.prd.telenet-ops.be/non-geo/vier" + "/homepartymetkat/3b576cf4fa1df85b8cc29c90efcdac81a9f97ecf" + "/HOMEPARTYMETKAT_zorg/HOMEPARTYMETKAT_zorg.m3u8"); }); });
/* * editusrdlg.cpp * 用户信息修改界面 * * Created on: 2016年10月11日 * Author: Lzy */ #include "editusrdlg.h" EditUsrDlg::EditUsrDlg(QWidget *parent) : NewUsrDlg(parent) { QString str = tr("编辑用户"); editTitle(str); } EditUsrDlg::~EditUsrDlg() { } void EditUsrDlg::setUsrId(int id) { mId = id; sUserItem user = DbUser::bulid()->findById(id); loadUsrInfo(user); } bool EditUsrDlg::saveUsrInfo(sUserItem &user) { user.id = mId; DbUser* db = DbUser::bulid(); return db->updateItem(user); }
import subprocess import sys def execute_command_as_user(username, command): try: subprocess.run(['sudo', '-u', username] + command.split(), check=True) except subprocess.CalledProcessError as e: print(f"Error: {e}") sys.exit(1) if __name__ == "__main__": if len(sys.argv) != 3: print("Usage: sudo_simulator <username> <command>") sys.exit(1) username = sys.argv[1] command = sys.argv[2] execute_command_as_user(username, command)
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/512+512+512-FW/13-model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/512+512+512-FW/13-512+512+512-shuffled-256 --do_eval --per_device_eval_batch_size 1 --dataloader_drop_last --augmented --augmentation_function shuffle_first_third_sixth --eval_function last_sixth_eval
#!/usr/bin/env bash source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh" print_header "Customizing the environment" "Sylius" run_command "git fetch origin $TRAVIS_BRANCH:refs/remotes/origin/$TRAVIS_BRANCH" || exit $? # Make origin/master available for is_suitable steps run_command "phpenv config-rm xdebug.ini" # Disable XDebug run_command "echo \"memory_limit=6144M\" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini" || exit $? # Increase memory limit to 6GB run_command "composer self-update --preview" run_command "mkdir -p \"${SYLIUS_CACHE_DIR}\"" || exit $? # Create Sylius cache directory run_command "mkdir -p web/media/image" || exit $? # Create Sylius images directory
package com.gusparis.monthpicker.builder; import android.widget.NumberPicker; import java.text.DateFormatSymbols; import java.util.Arrays; public class MonthFormatter { public static NumberPicker.Formatter getMonthFormatter(String type, DateFormatSymbols dfs) { switch (type) { case "short": return new ShortMonth(dfs); case "number": return new NumberMonth(); case "shortNumber": return new ShortNumberMonth(); default: return new FullMonth(dfs); } } private static class FullMonth implements NumberPicker.Formatter { private String [] months; public FullMonth(DateFormatSymbols dfs) { // String [] newMonths = new String[3000]; // String [] monthNames = dfs.getMonths(); // for (int i = 0; i < 3000; i ++) { // newMonths[i] = monthNames[i % 12]; // } months = dfs.getMonths(); } @Override public String format(int i) { final int idx = (i % 12); return months[idx]; } } private static class ShortMonth implements NumberPicker.Formatter { private String [] months; public ShortMonth(DateFormatSymbols dfs) { months = dfs.getShortMonths(); } @Override public String format(int i) { final int idx = (i % 12); return months[idx]; } } private static class NumberMonth implements NumberPicker.Formatter { @Override public String format(int i) { final int idx = (i % 12); return String.format("%02d", idx + 1); } } private static class ShortNumberMonth implements NumberPicker.Formatter { @Override public String format(int i) { final int idx = (i % 12); return String.valueOf(idx + 1); } } }
<filename>src/main/java/me/xapu1337/recodes/trollgui/Trolls/ExplodePlayerTroll.java package me.xapu1337.recodes.trollgui.Trolls; import me.xapu1337.recodes.trollgui.Cores.Core; import me.xapu1337.recodes.trollgui.Handlers.TrollHandler; import org.bukkit.World; import org.bukkit.entity.Player; import java.util.Random; public class ExplodePlayerTroll extends TrollHandler { Random random = new Random(); public ExplodePlayerTroll(Player caller, Player victim) { super(caller, victim); } /** * Executed from the TrollGUI Class everything inside this function gets executed. */ @Override public void execute() { World victimWorld = victim.getWorld(); victimWorld.createExplosion(victim.getLocation(), Core.instance.getConfig().getBoolean("MenuItems.trollMenu.explodePlayer.options.explodeRandomness") ? random.nextInt(Core.instance.getConfig().getInt("MenuItems.trollMenu.explodePlayer.options.explodeRadius") + 1) : Core.instance.getConfig().getInt("MenuItems.trollMenu.explodePlayer.options.explodeRadius") + 1 , false); } }
#!/bin/bash script_dir=$(dirname "$(readlink -f "$0")") export KB_DEPLOYMENT_CONFIG=$script_dir/../deploy.cfg export PYTHONPATH=$script_dir/../lib:$PATH:$PYTHONPATH uwsgi --master --processes 5 --threads 5 --http :5000 --wsgi-file $script_dir/../lib/test/testServer.py
<gh_stars>0 import React from 'react'; import ReactDOM from 'react-dom'; // Step to create a Components // 1) Create a new Component, this Component should produce some HTML const App = () => { return <h2>Hi, Welcome to the REACT Library, Just another great JS Library</h2> } // 2) Take this Component's generated HTML and put it on the page (In the DOM) ReactDOM.render(<App />, document.querySelector('.container'));
<gh_stars>0 (function (global) { 'use strict'; var aa = require('aa'), Channel = aa.Channel; var slice = [].slice; var CANCEL_ERROR = new Error('Cancel'); // Executors function Executors(n) { if (arguments.length === 0) n = 1; if (typeof n !== 'number') throw new TypeError('maximum threads must be a number'); if (n < 1 || n !== n) throw new TypeError('maximum threads must be a positive finite number'); var executorChannel = Channel(); var closed = false; var canceled = false; var allExecutors = aa(startExecutors); executor.end = closeExecutors; executor.cancel = cancelExecutors; return executor; // startExecutors function *startExecutors() { var shadowExecutors = []; for (var i = 0; i < n; ++i) shadowExecutors.push(shadowExecutor); yield shadowExecutors; } // closeExecutors function *closeExecutors() { if (closed) return; closed = true; for (var i = 0; i < n; ++i) executorChannel(); // send end of channel to executor's queue yield allExecutors; } // cancelExecutors function *cancelExecutors() { if (canceled) return; canceled = true; closeExecutors(); } // shadowExecutor function *shadowExecutor() { var elem; while (!canceled && (elem = yield executorChannel)) { try { elem.result(yield elem.fn.apply(elem.ctx, elem.args)); } catch (e) { elem.result(e); } } while (elem = yield executorChannel) elem.result(CANCEL_ERROR); } // executor function *executor(fn) { var result = Channel(); executorChannel({fn:fn, ctx:this, args:slice.call(arguments, 1), result:result}); return yield result; } } // Executors if (typeof module === 'object' && module && module.exports) module.exports = Executors; else global.executors = global.Executors = Executors; })(Function('return this')());
/* * Copyright 2013 Japplis. * * 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.joeffice.tools; import javax.swing.*; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; public class JTableCellSelection { public static void showDemo(JComponent demo, String title) { JFrame mainFrame = new JFrame(); mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); mainFrame.setTitle(title); mainFrame.add(demo); mainFrame.pack(); mainFrame.setVisible(true); } public static void main(String[] args) { final JTable table = new JTable(10, 10) { public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend) { System.out.println(rowIndex + "," + columnIndex + "," + toggle + "," + extend); super.changeSelection(rowIndex, columnIndex, toggle, extend); } }; table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); table.setCellSelectionEnabled(true); table.addRowSelectionInterval(6, 7); // Select 2 lines /*table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent lse) { System.out.println(lse.getFirstIndex() + ";" + lse.getLastIndex() + ";" + table.isCellSelected(8, 2)); } });*/ showDemo(new JScrollPane(table), "Select a block and some rows"); } }
<gh_stars>0 /* * Copyright 2014-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.dbflute.bhv.readable; /** * The handler of entity row. * @param <ENTITY> The type of entity. * @author jflute */ @FunctionalInterface public interface EntityRowHandler<ENTITY> { /** * Handle entity as row. * @param entity The entity as row. (NotNull) */ void handle(ENTITY entity); /** * Does it break the cursor? (skip next rows?)<br> * You can skip next records by your overriding. <br> * (cannot skip the first record, this determination is after one row handling) * <pre> * <span style="color: #0000C0">memberBhv</span>.<span style="color: #CC4747">selectCursor</span>(<span style="color: #553000">cb</span> <span style="color: #90226C; font-weight: bold"><span style="font-size: 120%">-</span>&gt;</span> { * <span style="color: #553000">cb</span>.query().set... * }, new EntityRowHandler&lt;Member&gt;() { <span style="color: #3F7E5E">// not lambda for override</span> * private boolean <span style="color: #0000C0">breakCursor</span>; * public void handle(Member <span style="color: #553000">member</span>) { * ... * if (...) { <span style="color: #3F7E5E">// means the final row</span> * <span style="color: #0000C0">breakCursor</span> = true; <span style="color: #3F7E5E">// skip the next records</span> * } * } * public boolean <span style="color: #CC4747">isBreakCursor</span>() { * return <span style="color: #0000C0">breakCursor</span>; * } * }); * </pre> * @return The determination, true or false. */ default boolean isBreakCursor() { return false; } }
<reponame>mohamedpop871/Telemetry-System<gh_stars>0 #include "USART.h" void INIT_UART(void) { UBRR0 = (F_CPU/16UL/BAUD)-1; UCSR0B |= 1 << TXEN0 | 1 << RXCIE0 | 1 << RXEN0; UCSR0B &= ~(1 << UCSZ02); UCSR0C |= 1 << UCSZ00 | 1 << UCSZ01; Send = 0; } void USART_TX(uint8_t data ) { /* Wait for empty transmit buffer */ while ( !( UCSR0A & (1<<UDRE0)) ) ; /* Put data into buffer, sends the data */ UDR0 = data; } void USART_PRINTF(const char *str) { int x = 0; while (str[x]){ USART_TX(str[x]); x++; } } ISR (USART0_RX_vect) { if (UDR0 == 1) { Send = 1; } else { Send = 0; } }
#!/bin/bash echo "Install dependencies..." echo apt-get update apt-get install -y software-properties-common build-essential nodejs node-gyp npm echo "Install MRAA and its dependencies.." echo add-apt-repository -y ppa:mraa/mraa apt-get update apt-get install -y libmraa1 libmraa-dev mraa-tools libupm-dev upm-examples echo "Install MRAA plugin for java script..." echo #Install MRAA plugins for java script npm install mraa -g echo "Pick up the right node module...." echo # Pick up the right node binary update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10 echo "Export node path..." echo export NODE_PATH=/usr/local/lib/node_modules/
#!/bin/sh docker-compose run --rm regression "npx wait-on http://cosmos:5000 && yarn run visual-regression:exec $@"
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String input = reader.readLine(); String[] numbers = input.split(" "); int sum = 0; for (String number : numbers) { int num = Integer.parseInt(number); if (num % 2 == 0) { sum += num; } } System.out.println("Sum of even numbers: " + sum); } }
# Initialize the product database produtos = {} # Function to add a new product to the database def add_product(): codigo = int(input('Introduza o Código do novo produto: ')) nome = input('Introduza o Nome do novo produto: ') preco = float(input('Introduza o Preço do novo produto: ')) produtos[codigo] = {'Nome': nome, 'Preço': preco} # Function to display all products in the database def display_products(): for codigo, produto in produtos.items(): print(f'Código: {codigo}, Nome: {produto["Nome"]}, Preço: {produto["Preço"]}') # Main program while True: print('Menu:') print('1. Adicionar novo produto') print('2. Alterar preço do produto') print('3. Aplicar percentagem de aumento no preço de todos os produtos') print('4. Mostrar todos os produtos') print('5. Sair') acao = int(input('Escolha uma ação: ')) if acao == 1: add_product() elif acao == 2: codigo = int(input('Introduza o Código do produto a alterar: ')) preco = float(input('Introduza o Novo Preço do produto: ')) produtos[codigo]['Preço'] = preco elif acao == 3: percentagem = float(input('Introduza a percentagem de aumento do preço: ')) for k in produtos: produtos[k]['Preço'] = round(produtos[k]['Preço'] + produtos[k]['Preço'] * (percentagem / 100), 2) elif acao == 4: display_products() elif acao == 5: break else: print('Ação inválida. Por favor, escolha uma ação válida.')
#!/bin/bash ###================================### header "CLEANING UP" comment "removing loopback device" losetup -d ${LOOP} losetup comment "deleting ${IMG_NEW}" rm ${IMG_NEW}
<reponame>congleetea/fuse /* * 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_GRAPH_DESERIALIZER_H #define FUSE_CORE_GRAPH_DESERIALIZER_H #include <fuse_msgs/SerializedGraph.h> #include <fuse_core/constraint.h> #include <fuse_core/graph.h> #include <fuse_core/variable.h> #include <pluginlib/class_loader.h> namespace fuse_core { /** * @brief Serialize a graph into a message */ void serializeGraph(const fuse_core::Graph& graph, fuse_msgs::SerializedGraph& msg); /** * @brief Deserialize a graph * * The deserializer object loads all of the known Variable and Constraint libraries, allowing derived types contained * within the graph to be properly deserialized. The libraries will be unloaded on destruction. As a consequence, the * deserializer object must outlive any created graph instances. */ class GraphDeserializer { public: /** * @brief Constructor */ GraphDeserializer(); /** * @brief Deserialize a SerializedGraph message into a fuse Graph object. * * If no plugin is available for a contained Variable or Constraint, or an error occurs during deserialization, * an exception is thrown. * * @param[in] msg The SerializedGraph message to be deserialized * @return A unique_ptr to a derived Graph object */ fuse_core::Graph::UniquePtr deserialize(const fuse_msgs::SerializedGraph::ConstPtr& msg); /** * @brief Deserialize a SerializedGraph message into a fuse Graph object. * * If no plugin is available for a contained Variable or Constraint, or an error occurs during deserialization, * an exception is thrown. * * @param[in] msg The SerializedGraph message to be deserialized * @return A unique_ptr to a derived Graph object */ fuse_core::Graph::UniquePtr deserialize(const fuse_msgs::SerializedGraph& msg); private: pluginlib::ClassLoader<fuse_core::Variable> variable_loader_; //!< Pluginlib class loader for Variable types pluginlib::ClassLoader<fuse_core::Constraint> constraint_loader_; //!< Pluginlib class loader for Constraint types pluginlib::ClassLoader<fuse_core::Graph> graph_loader_; //!< Pluginlib class loader for Graph types }; } // namespace fuse_core #endif // FUSE_CORE_GRAPH_DESERIALIZER_H
<reponame>dubbl/procgen<filename>halloween/seeded_rnd.js // code by <NAME> // http://michalbe.blogspot.dk/2011/02/javascript-random-numbers-with-custom_23.html var CustomRandom = function(nseed) { var seed, constant = Math.pow(2, 13)+1, prime = 1987, maximum = 1000; if (nseed) { seed = nseed; } if (seed == null) { seed = (new Date()).getTime(); } return { next : function(min, max) { seed *= constant; seed += prime; if (min >= 0 && max > min) { return min+seed%maximum/maximum*(max-min); } else { return seed%maximum/maximum; } }, nextInt : function(min, max) { if (min > max) { return Math.round(this.next(max, min)); } return Math.round(this.next(min, max)); } } }
package com.danli.Schedule; import com.danli.config.RedisKeyConfig; import com.danli.entity.Blog; import com.danli.service.BlogService; import com.danli.service.RedisService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.Map; import java.util.Set; /** * 定时任务,定时同步浏览量到数据库,24小时1次,然后清空缓存 * * @author luzhiwei * @date 2021/12/12 */ @Component @EnableScheduling @EnableAsync public class RedisSyncScheduleTask { @Autowired RedisService redisService; @Autowired BlogService blogService; Logger logger = LoggerFactory.getLogger(RedisSyncScheduleTask.class); /** * 从Redis同步博客文章浏览量到数据库 */ @Async @Scheduled(fixedDelay = 24*60*60*1000) //间隔24小时秒 public void syncBlogViewsToDatabase() { logger.info("执行定时任务"); String redisKey = RedisKeyConfig.BLOG_VIEWS_MAP; Map blogViewsMap = redisService.getMapByHash(redisKey); Set<Integer> keys = blogViewsMap.keySet(); deleteAllCache(); for (Integer key : keys) { Integer views = (Integer) blogViewsMap.get(key); Blog blog = blogService.getById(key); blog.setViews(blog.getViews()+views); blogService.saveOrUpdate(blog); } logger.info("完成任务"); } /** * 清除所有缓存 */ // @Async // @Scheduled(fixedDelay = 60*1000) public void deleteAllCache() { redisService.deleteAllKeys(); } }
import Axios from "axios"; const baseURL = process.env.NODE_ENV === "development" ? "http://localhost:8080/api/travel/" : "http://www.potato865.cn/travel/static/mock/"; const instance = Axios.create({ baseURL, timeout: 5000 }); export default instance;
<reponame>vadi2/codeql package org.springframework.security.config.annotation.web.configurers; import org.springframework.security.config.annotation.web.AbstractRequestMatcherRegistry; public abstract class AbstractConfigAttributeRequestMatcherRegistry<C> extends AbstractRequestMatcherRegistry<C> {}
#!/bin/bash set -e docker-compose -f docker-compose.yml up -d elasticsearch docker-compose -f docker-compose.yml up --exit-code-from elasticsearch-init elasticsearch-init docker-compose -f docker-compose.yml up --exit-code-from spark-submit spark-submit docker-compose -f docker-compose.yml up --exit-code-from elasticsearch-tester elasticsearch-tester exit_code=$(docker ps -aq -f label=com.docker.compose.project=elasticsearch | xargs -I{} docker inspect {} --format='{{.State.ExitCode}}' | paste -sd+ - | bc) docker-compose -f docker-compose.yml down exit $exit_code
#!/bin/bash dieharder -d 12 -g 36 -S 1293787541
<reponame>Spotts9/mattermost-webapp<gh_stars>0 // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. // *************************************************************** // - [#] indicates a test step (e.g. # Go to a page) // - [*] indicates an assertion (e.g. * Check the title) // - Use element ID when selecting an element. Create one if none. // *************************************************************** // Group: @keyboard_shortcuts describe('Keyboard Shortcuts', () => { let testTeam; let testChannel; let testUser; let otherUser; before(() => { cy.apiInitSetup().then(({team, channel, user}) => { testTeam = team; testChannel = channel; testUser = user; cy.apiCreateUser({prefix: 'other'}).then(({user: user1}) => { otherUser = user1; cy.apiAddUserToTeam(testTeam.id, otherUser.id).then(() => { cy.apiAddUserToChannel(testChannel.id, otherUser.id); }); }); }); }); it('MM-T1235 Arrow up key - no Edit modal open up if user has not posted any message yet', () => { const message2 = 'Test message from User 2'; cy.apiLogin(otherUser); // # Visit the channel using the channel name cy.visit(`/${testTeam.name}/channels/${testChannel.name}`); // # Post message in the channel from User 2 cy.postMessage(message2); cy.apiLogout(); cy.apiLogin(testUser); cy.visit(`/${testTeam.name}/channels/${testChannel.name}`); // # Press UP arrow cy.get('#post_textbox').type('{uparrow}'); // * Verify that Edit modal should not be visible cy.get('#editPostModal').should('not.exist'); }); it('MM-T1236 Arrow up key - Edit modal open up for own message of a user', () => { const message1 = 'Test message from User 1'; const message2 = 'Test message from User 2'; cy.apiLogin(testUser); // # Visit the channel using the channel name cy.visit(`/${testTeam.name}/channels/${testChannel.name}`); // # Post message in the channel from User 1 cy.postMessage(message1); cy.apiLogout(); cy.apiLogin(otherUser); // # Visit the channel using the channel name cy.visit(`/${testTeam.name}/channels/${testChannel.name}`); // # Post message in the channel from User 2 cy.postMessage(message2); cy.apiLogout(); cy.apiLogin(testUser); cy.visit(`/${testTeam.name}/channels/${testChannel.name}`); // # Press UP arrow cy.get('#post_textbox').type('{uparrow}'); // * Verify that the Edit Post Modal is visible cy.get('#editPostModal').should('be.visible'); // * Verify that the Edit textbox contains previously sent message by user 1 cy.get('#edit_textbox').should('have.text', message1); }); });
import java.util.Random; public class PasswordGenerator { // Characters which have been used private static final String CHAR_LIST = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$&"; private static final int RANDOM_STRING_LENGTH = 8; public String generatePassword() { StringBuffer randStr = new StringBuffer(); boolean hasUppercase = false, hasLowercase = false, hasSpecialChar = false, hasNumber = false; Random randomGenerator = new Random(); while (hasUppercase == false || hasLowercase == false || hasSpecialChar == false || hasNumber == false) { int randomInt = 0; char ch; randomInt = randomGenerator.nextInt(CHAR_LIST.length()); ch = CHAR_LIST.charAt(randomInt); randStr.append(ch); if (Character.isUpperCase(ch)) { hasUppercase = true; } else if (Character.isLowerCase(ch)) { hasLowercase = true; } else if (Character.isDigit(ch)) { hasNumber = true; } else { hasSpecialChar = true; } if (randStr.length() == RANDOM_STRING_LENGTH) { if (hasUppercase == false || hasLowercase == false || hasSpecialChar == false || hasNumber == false) { randStr = new StringBuffer(); hasUppercase = false; hasLowercase = false; hasSpecialChar = false; hasNumber = false; } else { break; } } } return randStr.toString(); } }
CREATE OR REPLACE FUNCTION IS_PALINDROME (str VARCHAR2) RETURN BOOLEAN IS BEGIN DECLARE rev_str VARCHAR2 (256); BEGIN rev_str := REVERSE (str); IF rev_str = str THEN RETURN TRUE; ELSE RETURN FALSE; END IF; END; END;
<gh_stars>0 package br.com.neobank.bank.test; import org.junit.*; import br.com.neobank.bank.model.CheckingAccount; import br.com.neobank.bank.model.SavingsAccount; public class TestAccount { @Test public void testDeposit() { CheckingAccount ca = new CheckingAccount(123, 4567); ca.deposit(100.00); Assert.assertEquals(100.00, ca.getBalance(), 0.0001); } @Test public void testTransferBetween2AccountTypes() { CheckingAccount ca = new CheckingAccount(123, 4567); ca.deposit(100.00); SavingsAccount sa = new SavingsAccount(980, 7654); sa.deposit(100.00); try { ca.transfer(20.00, sa); } catch (Exception e) { System.out.println(e.getMessage()); } double expectedBalanceCA = 79.50; double expectedBalanceSA = 120.00; Assert.assertEquals(expectedBalanceCA, ca.getBalance(), 0.00001); Assert.assertEquals(expectedBalanceSA, sa.getBalance(), 0.00001); } }
package com.danli.service.impl; import com.danli.service.MailService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.mail.MailProperties; import org.springframework.mail.SimpleMailMessage; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import javax.mail.internet.MimeMessage; /** * @author luzhiwei * @date 2021/12/12 */ @Service public class MailServiceImpl implements MailService { @Autowired private JavaMailSender javaMailSender; @Autowired private MailProperties mailProperties; /** * 发送普通文本邮件 * * @param toAccount 收件人 * @param subject 主题 * @param content 内容 */ @Override @Async public void sendSimpleMail(String toAccount, String subject, String content) { try { SimpleMailMessage message = new SimpleMailMessage(); message.setFrom(mailProperties.getUsername()); message.setTo(toAccount); message.setSubject(subject); message.setText(content); javaMailSender.send(message); } catch (Exception e) { e.printStackTrace(); } } /** * 发送HTML邮件 * * @param toAccount 收件人 * @param subject 主题 * @param content 内容(可以包含<html>等标签) */ @Override @Async public void sendHtmlMail(String toAccount, String subject, String content) { try { MimeMessage mimeMessage = javaMailSender.createMimeMessage(); MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage); messageHelper.setFrom(mailProperties.getUsername()); messageHelper.setTo(toAccount); messageHelper.setSubject(subject); messageHelper.setText(content, true); javaMailSender.send(mimeMessage); } catch (Exception e) { e.printStackTrace(); } } }
<filename>src/glibc_cxx_wrap/test_2.cc #include "glibc_cxx_wrap/sys/cxx_inotify.h" #include "glibc_cxx_wrap/sys/cxx_mman.h" #include "glibc_cxx_wrap/sys/cxx_stat.h" #include "glibc_cxx_wrap/sys/cxx_epoll.h" #include "glibc_cxx_wrap/sys/cxx_timerfd.h" #include "glibc_cxx_wrap/macros.h" #include "glibc_cxx_wrap/cxx_time.h" #include "glibc_cxx_wrap/13_low_level_io.h" #include "glibc_cxx_wrap/14_file_system_interface.h"
#!/bin/sh docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD" \ && make tag \ && make push
#!/bin/bash ###################################### # Test_Svg.sh # Utilité: test de sauvegarde de sauvegarde avec serveur "Maitre" # Auteur: RootKitDev <RootKit.Dev@gmail.com> # Mise à jour le: 22/02/2017 ###################################### Save_User="athena" REMOTE_HOST="Master.host" EXPORT_PATH="$HOME_PATH/MasterHost//CkSum_Export" HOME_PATH="/home/athena" SAVE_PATH="$HOME_PATH/folder/Data" if [[ -e $SAVE_PATH/test_svg.tar.gz ]] then tar -zxf $SAVE_PATH/test_svg.tar.gz -C $SAVE_PATH/ > /dev/null 2>&1 mv $SAVE_PATH/file_test_svg $SAVE_PATH/remote_file_test_svg scp $SAVE_PATH/remote_file_test_svg $Save_User@$REMOTE_HOST:$EXPORT_PATH > /dev/null 2>&1 ssh $Save_User@$REMOTE_HOST "chmod 777 $EXPORT_PATH/*" > /dev/null 2>&1 rm $SAVE_PATH/*test_svg* fi
<gh_stars>0 package cn.stylefeng.roses.kernel.validator.api.validators.phone; import javax.validation.Constraint; import javax.validation.Payload; import java.lang.annotation.*; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** * 校验手机号码格式 * * @author fengshuonan * @date 2020/10/31 14:53 */ @Documented @Constraint(validatedBy = PhoneValueValidator.class) @Target({ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public @interface PhoneValue { String message() default "手机号码格式不正确"; Class[] groups() default {}; Class<? extends Payload>[] payload() default {}; /** * 是否必填 * <p> * 如果必填,在校验的时候本字段没值就会报错 */ boolean required() default true; @Target({ElementType.FIELD, ElementType.PARAMETER}) @Retention(RUNTIME) @Documented @interface List { PhoneValue[] value(); } }
package testdata //nolint var TestCaseLangKZCurrencyKZTInt = map[int64]string{ 488: "төрт жүз сексен сегіз теңге", 458: "төрт жүз елу сегіз теңге", 21: "жиырма бір теңге", 116: "жүз он алты теңге", 494: "төрт жүз тоқсан төрт теңге", 234: "екі жүз отыз төрт теңге", 349: "үш жүз қырық тоғыз теңге", 228: "екі жүз жиырма сегіз теңге", 283: "екі жүз сексен үш теңге", 489: "төрт жүз сексен тоғыз теңге", 231: "екі жүз отыз бір теңге", 495: "төрт жүз тоқсан бес теңге", 304: "үш жүз төрт теңге", 256: "екі жүз елу алты теңге", 475: "төрт жүз жетпіс бес теңге", 279: "екі жүз жетпіс тоғыз теңге", 254: "екі жүз елу төрт теңге", 112: "жүз он екі теңге", 446: "төрт жүз қырық алты теңге", 95: "тоқсан бес теңге", 354: "үш жүз елу төрт теңге", 63: "алпыс үш теңге", 423: "төрт жүз жиырма үш теңге", 209: "екі жүз тоғыз теңге", 325: "үш жүз жиырма бес теңге", 45: "қырық бес теңге", 262: "екі жүз алпыс екі теңге", 190: "жүз тоқсан теңге", 9: "тоғыз теңге", 452: "төрт жүз елу екі теңге", 72: "жетпіс екі теңге", 172: "жүз жетпіс екі теңге", 211: "екі жүз он бір теңге", 394: "үш жүз тоқсан төрт теңге", 278: "екі жүз жетпіс сегіз теңге", 2: "екі теңге", 85: "сексен бес теңге", 193: "жүз тоқсан үш теңге", 272: "екі жүз жетпіс екі теңге", 273: "екі жүз жетпіс үш теңге", 300: "үш жүз теңге", 83: "сексен үш теңге", 442: "төрт жүз қырық екі теңге", 456: "төрт жүз елу алты теңге", 35: "отыз бес теңге", 120: "жүз жиырма теңге", 397: "үш жүз тоқсан жеті теңге", 483: "төрт жүз сексен үш теңге", 311: "үш жүз он бір теңге", 280: "екі жүз сексен теңге", 158: "жүз елу сегіз теңге", 411: "төрт жүз он бір теңге", 497: "төрт жүз тоқсан жеті теңге", 62: "алпыс екі теңге", 214: "екі жүз он төрт теңге", 363: "үш жүз алпыс үш теңге", 101: "жүз бір теңге", 184: "жүз сексен төрт теңге", 98: "тоқсан сегіз теңге", 277: "екі жүз жетпіс жеті теңге", 187: "жүз сексен жеті теңге", 341: "үш жүз қырық бір теңге", 215: "екі жүз он бес теңге", 424: "төрт жүз жиырма төрт теңге", 250: "екі жүз елу теңге", 176: "жүз жетпіс алты теңге", 498: "төрт жүз тоқсан сегіз теңге", 444: "төрт жүз қырық төрт теңге", 185: "жүз сексен бес теңге", 28: "жиырма сегіз теңге", 425: "төрт жүз жиырма бес теңге", 122: "жүз жиырма екі теңге", 16: "он алты теңге", 360: "үш жүз алпыс теңге", 206: "екі жүз алты теңге", 219: "екі жүз он тоғыз теңге", 133: "жүз отыз үш теңге", 336: "үш жүз отыз алты теңге", 143: "жүз қырық үш теңге", 347: "үш жүз қырық жеті теңге", 110: "жүз он теңге", 140: "жүз қырық теңге", 227: "екі жүз жиырма жеті теңге", 88: "сексен сегіз теңге", 490: "төрт жүз тоқсан теңге", 255: "екі жүз елу бес теңге", 167: "жүз алпыс жеті теңге", 303: "үш жүз үш теңге", 64: "алпыс төрт теңге", 146: "жүз қырық алты теңге", 451: "төрт жүз елу бір теңге", 4501: "төрт мың бес жүз бір теңге", 6901: "алты мың тоғыз жүз бір теңге", 6137: "алты мың жүз отыз жеті теңге", 5106: "бес мың жүз алты теңге", 9241: "тоғыз мың екі жүз қырық бір теңге", 5242: "бес мың екі жүз қырық екі теңге", 9276: "тоғыз мың екі жүз жетпіс алты теңге", 2134: "екі мың жүз отыз төрт теңге", 7973: "жеті мың тоғыз жүз жетпіс үш теңге", 3924: "үш мың тоғыз жүз жиырма төрт теңге", 107: "жүз жеті теңге", 8449: "сегіз мың төрт жүз қырық тоғыз теңге", 8904: "сегіз мың тоғыз жүз төрт теңге", 7523: "жеті мың бес жүз жиырма үш теңге", 410: "төрт жүз он теңге", 6486: "алты мың төрт жүз сексен алты теңге", 9051: "тоғыз мың елу бір теңге", 1151: "бір мың жүз елу бір теңге", 7995: "жеті мың тоғыз жүз тоқсан бес теңге", 1692: "бір мың алты жүз тоқсан екі теңге", 3988: "үш мың тоғыз жүз сексен сегіз теңге", 4930: "төрт мың тоғыз жүз отыз теңге", 8899: "сегіз мың сегіз жүз тоқсан тоғыз теңге", 5521: "бес мың бес жүз жиырма бір теңге", 2376: "екі мың үш жүз жетпіс алты теңге", 2460: "екі мың төрт жүз алпыс теңге", 6506: "алты мың бес жүз алты теңге", 686: "алты жүз сексен алты теңге", 2543: "екі мың бес жүз қырық үш теңге", 2583: "екі мың бес жүз сексен үш теңге", 8733: "сегіз мың жеті жүз отыз үш теңге", 879: "сегіз жүз жетпіс тоғыз теңге", 4589: "төрт мың бес жүз сексен тоғыз теңге", 1053: "бір мың елу үш теңге", 9767: "тоғыз мың жеті жүз алпыс жеті теңге", 2828: "екі мың сегіз жүз жиырма сегіз теңге", 9249: "тоғыз мың екі жүз қырық тоғыз теңге", 1307: "бір мың үш жүз жеті теңге", 6279: "алты мың екі жүз жетпіс тоғыз теңге", 7397: "жеті мың үш жүз тоқсан жеті теңге", 2036: "екі мың отыз алты теңге", 7669: "жеті мың алты жүз алпыс тоғыз теңге", 9734: "тоғыз мың жеті жүз отыз төрт теңге", 5514: "бес мың бес жүз он төрт теңге", 3349: "үш мың үш жүз қырық тоғыз теңге", 797: "жеті жүз тоқсан жеті теңге", 6648: "алты мың алты жүз қырық сегіз теңге", 3697: "үш мың алты жүз тоқсан жеті теңге", 7487: "жеті мың төрт жүз сексен жеті теңге", 9095: "тоғыз мың тоқсан бес теңге", 8355: "сегіз мың үш жүз елу бес теңге", 9334: "тоғыз мың үш жүз отыз төрт теңге", 4349: "төрт мың үш жүз қырық тоғыз теңге", 8653: "сегіз мың алты жүз елу үш теңге", 4620: "төрт мың алты жүз жиырма теңге", 1401: "бір мың төрт жүз бір теңге", 9530: "тоғыз мың бес жүз отыз теңге", 3470: "үш мың төрт жүз жетпіс теңге", 3633: "үш мың алты жүз отыз үш теңге", 308: "үш жүз сегіз теңге", 3009: "үш мың тоғыз теңге", 7892: "жеті мың сегіз жүз тоқсан екі теңге", 8927: "сегіз мың тоғыз жүз жиырма жеті теңге", 6815: "алты мың сегіз жүз он бес теңге", 5571: "бес мың бес жүз жетпіс бір теңге", 3347: "үш мың үш жүз қырық жеті теңге", 9172: "тоғыз мың жүз жетпіс екі теңге", 7116: "жеті мың жүз он алты теңге", 1225: "бір мың екі жүз жиырма бес теңге", 2375: "екі мың үш жүз жетпіс бес теңге", 4631: "төрт мың алты жүз отыз бір теңге", 7029: "жеті мың жиырма тоғыз теңге", 3537: "үш мың бес жүз отыз жеті теңге", 8750: "сегіз мың жеті жүз елу теңге", 9472: "тоғыз мың төрт жүз жетпіс екі теңге", 5689: "бес мың алты жүз сексен тоғыз теңге", 909: "тоғыз жүз тоғыз теңге", 5809: "бес мың сегіз жүз тоғыз теңге", 3385: "үш мың үш жүз сексен бес теңге", 4499: "төрт мың төрт жүз тоқсан тоғыз теңге", 9131: "тоғыз мың жүз отыз бір теңге", 5664: "бес мың алты жүз алпыс төрт теңге", 7635: "жеті мың алты жүз отыз бес теңге", 147: "жүз қырық жеті теңге", 3872: "үш мың сегіз жүз жетпіс екі теңге", 1962: "бір мың тоғыз жүз алпыс екі теңге", 7118: "жеті мың жүз он сегіз теңге", 2651: "екі мың алты жүз елу бір теңге", 1636: "бір мың алты жүз отыз алты теңге", 2278: "екі мың екі жүз жетпіс сегіз теңге", 6034: "алты мың отыз төрт теңге", 5056: "бес мың елу алты теңге", 500: "бес жүз теңге", 8627: "сегіз мың алты жүз жиырма жеті теңге", 4036: "төрт мың отыз алты теңге", 3631: "үш мың алты жүз отыз бір теңге", 9146: "тоғыз мың жүз қырық алты теңге", 3722: "үш мың жеті жүз жиырма екі теңге", 249636: "екі жүз қырық тоғыз мың алты жүз отыз алты теңге", 765318: "жеті жүз алпыс бес мың үш жүз он сегіз теңге", 131187: "жүз отыз бір мың жүз сексен жеті теңге", 326204: "үш жүз жиырма алты мың екі жүз төрт теңге", 737038: "жеті жүз отыз жеті мың отыз сегіз теңге", 532524: "бес жүз отыз екі мың бес жүз жиырма төрт теңге", 915240: "тоғыз жүз он бес мың екі жүз қырық теңге", 46963: "қырық алты мың тоғыз жүз алпыс үш теңге", 3109: "үш мың жүз тоғыз теңге", 498947: "төрт жүз тоқсан сегіз мың тоғыз жүз қырық жеті теңге", 718294: "жеті жүз он сегіз мың екі жүз тоқсан төрт теңге", 308826: "үш жүз сегіз мың сегіз жүз жиырма алты теңге", 443721: "төрт жүз қырық үш мың жеті жүз жиырма бір теңге", 498684: "төрт жүз тоқсан сегіз мың алты жүз сексен төрт теңге", 375520: "үш жүз жетпіс бес мың бес жүз жиырма теңге", 863596: "сегіз жүз алпыс үш мың бес жүз тоқсан алты теңге", 777192: "жеті жүз жетпіс жеті мың жүз тоқсан екі теңге", 160790: "жүз алпыс мың жеті жүз тоқсан теңге", 234908: "екі жүз отыз төрт мың тоғыз жүз сегіз теңге", 905345: "тоғыз жүз бес мың үш жүз қырық бес теңге", 180218: "жүз сексен мың екі жүз он сегіз теңге", 417277: "төрт жүз он жеті мың екі жүз жетпіс жеті теңге", 738598: "жеті жүз отыз сегіз мың бес жүз тоқсан сегіз теңге", 783066: "жеті жүз сексен үш мың алпыс алты теңге", 362848: "үш жүз алпыс екі мың сегіз жүз қырық сегіз теңге", 447375: "төрт жүз қырық жеті мың үш жүз жетпіс бес теңге", 692112: "алты жүз тоқсан екі мың жүз он екі теңге", 687760: "алты жүз сексен жеті мың жеті жүз алпыс теңге", 992118: "тоғыз жүз тоқсан екі мың жүз он сегіз теңге", 505382: "бес жүз бес мың үш жүз сексен екі теңге", 989029: "тоғыз жүз сексен тоғыз мың жиырма тоғыз теңге", 72544: "жетпіс екі мың бес жүз қырық төрт теңге", 437404: "төрт жүз отыз жеті мың төрт жүз төрт теңге", 832192: "сегіз жүз отыз екі мың жүз тоқсан екі теңге", 345460: "үш жүз қырық бес мың төрт жүз алпыс теңге", 252731: "екі жүз елу екі мың жеті жүз отыз бір теңге", 631183: "алты жүз отыз бір мың жүз сексен үш теңге", 141245: "жүз қырық бір мың екі жүз қырық бес теңге", 819486: "сегіз жүз он тоғыз мың төрт жүз сексен алты теңге", 136613: "жүз отыз алты мың алты жүз он үш теңге", 551302: "бес жүз елу бір мың үш жүз екі теңге", 517023: "бес жүз он жеті мың жиырма үш теңге", 870364: "сегіз жүз жетпіс мың үш жүз алпыс төрт теңге", 35028: "отыз бес мың жиырма сегіз теңге", 674659: "алты жүз жетпіс төрт мың алты жүз елу тоғыз теңге", 425162: "төрт жүз жиырма бес мың жүз алпыс екі теңге", 110145: "жүз он мың жүз қырық бес теңге", 886453: "сегіз жүз сексен алты мың төрт жүз елу үш теңге", 904646: "тоғыз жүз төрт мың алты жүз қырық алты теңге", 198199: "жүз тоқсан сегіз мың жүз тоқсан тоғыз теңге", 49950: "қырық тоғыз мың тоғыз жүз елу теңге", 204310: "екі жүз төрт мың үш жүз он теңге", 305179: "үш жүз бес мың жүз жетпіс тоғыз теңге", 489795: "төрт жүз сексен тоғыз мың жеті жүз тоқсан бес теңге", 328556: "үш жүз жиырма сегіз мың бес жүз елу алты теңге", 174018: "жүз жетпіс төрт мың он сегіз теңге", 11501: "он бір мың бес жүз бір теңге", 832347: "сегіз жүз отыз екі мың үш жүз қырық жеті теңге", 314407: "үш жүз он төрт мың төрт жүз жеті теңге", 328447: "үш жүз жиырма сегіз мың төрт жүз қырық жеті теңге", 705833: "жеті жүз бес мың сегіз жүз отыз үш теңге", 452152: "төрт жүз елу екі мың жүз елу екі теңге", 43337: "қырық үш мың үш жүз отыз жеті теңге", 294052: "екі жүз тоқсан төрт мың елу екі теңге", 469322: "төрт жүз алпыс тоғыз мың үш жүз жиырма екі теңге", 147174: "жүз қырық жеті мың жүз жетпіс төрт теңге", 226578: "екі жүз жиырма алты мың бес жүз жетпіс сегіз теңге", 431638: "төрт жүз отыз бір мың алты жүз отыз сегіз теңге", 628342: "алты жүз жиырма сегіз мың үш жүз қырық екі теңге", 333569: "үш жүз отыз үш мың бес жүз алпыс тоғыз теңге", 382128: "үш жүз сексен екі мың жүз жиырма сегіз теңге", 388074: "үш жүз сексен сегіз мың жетпіс төрт теңге", 197309: "жүз тоқсан жеті мың үш жүз тоғыз теңге", 50750: "елу мың жеті жүз елу теңге", 637390: "алты жүз отыз жеті мың үш жүз тоқсан теңге", 127185: "жүз жиырма жеті мың жүз сексен бес теңге", 92466: "тоқсан екі мың төрт жүз алпыс алты теңге", 151509: "жүз елу бір мың бес жүз тоғыз теңге", 689908: "алты жүз сексен тоғыз мың тоғыз жүз сегіз теңге", 286082: "екі жүз сексен алты мың сексен екі теңге", 831145: "сегіз жүз отыз бір мың жүз қырық бес теңге", 820905: "сегіз жүз жиырма мың тоғыз жүз бес теңге", 686005: "алты жүз сексен алты мың бес теңге", 814163: "сегіз жүз он төрт мың жүз алпыс үш теңге", 476322: "төрт жүз жетпіс алты мың үш жүз жиырма екі теңге", 19973: "он тоғыз мың тоғыз жүз жетпіс үш теңге", 640756: "алты жүз қырық мың жеті жүз елу алты теңге", 633901: "алты жүз отыз үш мың тоғыз жүз бір теңге", 786939: "жеті жүз сексен алты мың тоғыз жүз отыз тоғыз теңге", 690873: "алты жүз тоқсан мың сегіз жүз жетпіс үш теңге", 355182: "үш жүз елу бес мың жүз сексен екі теңге", 85568: "сексен бес мың бес жүз алпыс сегіз теңге", 861562: "сегіз жүз алпыс бір мың бес жүз алпыс екі теңге", 946575: "тоғыз жүз қырық алты мың бес жүз жетпіс бес теңге", 647588: "алты жүз қырық жеті мың бес жүз сексен сегіз теңге", 639426: "алты жүз отыз тоғыз мың төрт жүз жиырма алты теңге", 233351: "екі жүз отыз үш мың үш жүз елу бір теңге", 456653: "төрт жүз елу алты мың алты жүз елу үш теңге", 66141: "алпыс алты мың жүз қырық бір теңге", 682956: "алты жүз сексен екі мың тоғыз жүз елу алты теңге", 564833711: "бес жүз алпыс төрт миллион сегіз жүз отыз үш мың жеті жүз он бір теңге", 860558694: "сегіз жүз алпыс миллион бес жүз елу сегіз мың алты жүз тоқсан төрт теңге", 129417035: "жүз жиырма тоғыз миллион төрт жүз он жеті мың отыз бес теңге", 906633616: "тоғыз жүз алты миллион алты жүз отыз үш мың алты жүз он алты теңге", 668908031: "алты жүз алпыс сегіз миллион тоғыз жүз сегіз мың отыз бір теңге", 831085368: "сегіз жүз отыз бір миллион сексен бес мың үш жүз алпыс сегіз теңге", 434640103: "төрт жүз отыз төрт миллион алты жүз қырық мың жүз үш теңге", 272436955: "екі жүз жетпіс екі миллион төрт жүз отыз алты мың тоғыз жүз елу бес теңге", 475521787: "төрт жүз жетпіс бес миллион бес жүз жиырма бір мың жеті жүз сексен жеті теңге", 146790369: "жүз қырық алты миллион жеті жүз тоқсан мың үш жүз алпыс тоғыз теңге", 931142291: "тоғыз жүз отыз бір миллион жүз қырық екі мың екі жүз тоқсан бір теңге", 537045344: "бес жүз отыз жеті миллион қырық бес мың үш жүз қырық төрт теңге", 183402194: "жүз сексен үш миллион төрт жүз екі мың жүз тоқсан төрт теңге", 379143766: "үш жүз жетпіс тоғыз миллион жүз қырық үш мың жеті жүз алпыс алты теңге", 305455410: "үш жүз бес миллион төрт жүз елу бес мың төрт жүз он теңге", 318927911: "үш жүз он сегіз миллион тоғыз жүз жиырма жеті мың тоғыз жүз он бір теңге", 471631675: "төрт жүз жетпіс бір миллион алты жүз отыз бір мың алты жүз жетпіс бес теңге", 689853790: "алты жүз сексен тоғыз миллион сегіз жүз елу үш мың жеті жүз тоқсан теңге", 801949646: "сегіз жүз бір миллион тоғыз жүз қырық тоғыз мың алты жүз қырық алты теңге", 467474078: "төрт жүз алпыс жеті миллион төрт жүз жетпіс төрт мың жетпіс сегіз теңге", 949048963: "тоғыз жүз қырық тоғыз миллион қырық сегіз мың тоғыз жүз алпыс үш теңге", 152806739: "жүз елу екі миллион сегіз жүз алты мың жеті жүз отыз тоғыз теңге", 761608819: "жеті жүз алпыс бір миллион алты жүз сегіз мың сегіз жүз он тоғыз теңге", 699130364: "алты жүз тоқсан тоғыз миллион жүз отыз мың үш жүз алпыс төрт теңге", 32909185: "отыз екі миллион тоғыз жүз тоғыз мың жүз сексен бес теңге", 764792284: "жеті жүз алпыс төрт миллион жеті жүз тоқсан екі мың екі жүз сексен төрт теңге", 793275787: "жеті жүз тоқсан үш миллион екі жүз жетпіс бес мың жеті жүз сексен жеті теңге", 376399838: "үш жүз жетпіс алты миллион үш жүз тоқсан тоғыз мың сегіз жүз отыз сегіз теңге", 347229049: "үш жүз қырық жеті миллион екі жүз жиырма тоғыз мың қырық тоғыз теңге", 541597516: "бес жүз қырық бір миллион бес жүз тоқсан жеті мың бес жүз он алты теңге", 252445591: "екі жүз елу екі миллион төрт жүз қырық бес мың бес жүз тоқсан бір теңге", 613607371: "алты жүз он үш миллион алты жүз жеті мың үш жүз жетпіс бір теңге", 539601439: "бес жүз отыз тоғыз миллион алты жүз бір мың төрт жүз отыз тоғыз теңге", 369298555: "үш жүз алпыс тоғыз миллион екі жүз тоқсан сегіз мың бес жүз елу бес теңге", 232796304: "екі жүз отыз екі миллион жеті жүз тоқсан алты мың үш жүз төрт теңге", 137246754: "жүз отыз жеті миллион екі жүз қырық алты мың жеті жүз елу төрт теңге", 585218698: "бес жүз сексен бес миллион екі жүз он сегіз мың алты жүз тоқсан сегіз теңге", 735618610: "жеті жүз отыз бес миллион алты жүз он сегіз мың алты жүз он теңге", 944216168: "тоғыз жүз қырық төрт миллион екі жүз он алты мың жүз алпыс сегіз теңге", 204530234: "екі жүз төрт миллион бес жүз отыз мың екі жүз отыз төрт теңге", 15933436: "он бес миллион тоғыз жүз отыз үш мың төрт жүз отыз алты теңге", 216415283: "екі жүз он алты миллион төрт жүз он бес мың екі жүз сексен үш теңге", 206972820: "екі жүз алты миллион тоғыз жүз жетпіс екі мың сегіз жүз жиырма теңге", 914687613: "тоғыз жүз он төрт миллион алты жүз сексен жеті мың алты жүз он үш теңге", 99622771: "тоқсан тоғыз миллион алты жүз жиырма екі мың жеті жүз жетпіс бір теңге", 512094942: "бес жүз он екі миллион тоқсан төрт мың тоғыз жүз қырық екі теңге", 323608745: "үш жүз жиырма үш миллион алты жүз сегіз мың жеті жүз қырық бес теңге", 285938198: "екі жүз сексен бес миллион тоғыз жүз отыз сегіз мың жүз тоқсан сегіз теңге", 318227391: "үш жүз он сегіз миллион екі жүз жиырма жеті мың үш жүз тоқсан бір теңге", 374527864: "үш жүз жетпіс төрт миллион бес жүз жиырма жеті мың сегіз жүз алпыс төрт теңге", 95650622: "тоқсан бес миллион алты жүз елу мың алты жүз жиырма екі теңге", 677851494: "алты жүз жетпіс жеті миллион сегіз жүз елу бір мың төрт жүз тоқсан төрт теңге", 250043743: "екі жүз елу миллион қырық үш мың жеті жүз қырық үш теңге", 610080007: "алты жүз он миллион сексен мың жеті теңге", 380521603: "үш жүз сексен миллион бес жүз жиырма бір мың алты жүз үш теңге", 204393756: "екі жүз төрт миллион үш жүз тоқсан үш мың жеті жүз елу алты теңге", 169731891: "жүз алпыс тоғыз миллион жеті жүз отыз бір мың сегіз жүз тоқсан бір теңге", 181657327: "жүз сексен бір миллион алты жүз елу жеті мың үш жүз жиырма жеті теңге", 771347010: "жеті жүз жетпіс бір миллион үш жүз қырық жеті мың он теңге", 963502665: "тоғыз жүз алпыс үш миллион бес жүз екі мың алты жүз алпыс бес теңге", 755693490: "жеті жүз елу бес миллион алты жүз тоқсан үш мың төрт жүз тоқсан теңге", 154179782: "жүз елу төрт миллион жүз жетпіс тоғыз мың жеті жүз сексен екі теңге", 401426437: "төрт жүз бір миллион төрт жүз жиырма алты мың төрт жүз отыз жеті теңге", 942841876: "тоғыз жүз қырық екі миллион сегіз жүз қырық бір мың сегіз жүз жетпіс алты теңге", 891041501: "сегіз жүз тоқсан бір миллион қырық бір мың бес жүз бір теңге", 643772849: "алты жүз қырық үш миллион жеті жүз жетпіс екі мың сегіз жүз қырық тоғыз теңге", 461092121: "төрт жүз алпыс бір миллион тоқсан екі мың жүз жиырма бір теңге", 577803341: "бес жүз жетпіс жеті миллион сегіз жүз үш мың үш жүз қырық бір теңге", 742675347: "жеті жүз қырық екі миллион алты жүз жетпіс бес мың үш жүз қырық жеті теңге", 341272932: "үш жүз қырық бір миллион екі жүз жетпіс екі мың тоғыз жүз отыз екі теңге", 58600845: "елу сегіз миллион алты жүз мың сегіз жүз қырық бес теңге", 249667003: "екі жүз қырық тоғыз миллион алты жүз алпыс жеті мың үш теңге", 128129084: "жүз жиырма сегіз миллион жүз жиырма тоғыз мың сексен төрт теңге", 814904385: "сегіз жүз он төрт миллион тоғыз жүз төрт мың үш жүз сексен бес теңге", 328954727: "үш жүз жиырма сегіз миллион тоғыз жүз елу төрт мың жеті жүз жиырма жеті теңге", 534495181: "бес жүз отыз төрт миллион төрт жүз тоқсан бес мың жүз сексен бір теңге", 21469823: "жиырма бір миллион төрт жүз алпыс тоғыз мың сегіз жүз жиырма үш теңге", 381748512: "үш жүз сексен бір миллион жеті жүз қырық сегіз мың бес жүз он екі теңге", 237884437: "екі жүз отыз жеті миллион сегіз жүз сексен төрт мың төрт жүз отыз жеті теңге", 990952212: "тоғыз жүз тоқсан миллион тоғыз жүз елу екі мың екі жүз он екі теңге", 228422701: "екі жүз жиырма сегіз миллион төрт жүз жиырма екі мың жеті жүз бір теңге", 3512668: "үш миллион бес жүз он екі мың алты жүз алпыс сегіз теңге", 270325560: "екі жүз жетпіс миллион үш жүз жиырма бес мың бес жүз алпыс теңге", 568983453: "бес жүз алпыс сегіз миллион тоғыз жүз сексен үш мың төрт жүз елу үш теңге", 887787398: "сегіз жүз сексен жеті миллион жеті жүз сексен жеті мың үш жүз тоқсан сегіз теңге", 898544736: "сегіз жүз тоқсан сегіз миллион бес жүз қырық төрт мың жеті жүз отыз алты теңге", 358720946: "үш жүз елу сегіз миллион жеті жүз жиырма мың тоғыз жүз қырық алты теңге", 453919661: "төрт жүз елу үш миллион тоғыз жүз он тоғыз мың алты жүз алпыс бір теңге", 891261317: "сегіз жүз тоқсан бір миллион екі жүз алпыс бір мың үш жүз он жеті теңге", 253272485: "екі жүз елу үш миллион екі жүз жетпіс екі мың төрт жүз сексен бес теңге", 328946694: "үш жүз жиырма сегіз миллион тоғыз жүз қырық алты мың алты жүз тоқсан төрт теңге", 346581408: "үш жүз қырық алты миллион бес жүз сексен бір мың төрт жүз сегіз теңге", 362741175: "үш жүз алпыс екі миллион жеті жүз қырық бір мың жүз жетпіс бес теңге", 414766615: "төрт жүз он төрт миллион жеті жүз алпыс алты мың алты жүз он бес теңге", 122302802: "жүз жиырма екі миллион үш жүз екі мың сегіз жүз екі теңге", 34285789: "отыз төрт миллион екі жүз сексен бес мың жеті жүз сексен тоғыз теңге", 130862300: "жүз отыз миллион сегіз жүз алпыс екі мың үш жүз теңге", 409405010: "төрт жүз тоғыз миллион төрт жүз бес мың он теңге", 443201267: "төрт жүз қырық үш миллион екі жүз бір мың екі жүз алпыс жеті теңге", 771776311: "жеті жүз жетпіс бір миллион жеті жүз жетпіс алты мың үш жүз он бір теңге", 353101624478: "үш жүз елу үш миллиард жүз бір миллион алты жүз жиырма төрт мың төрт жүз жетпіс сегіз теңге", 919393143208: "тоғыз жүз он тоғыз миллиард үш жүз тоқсан үш миллион жүз қырық үш мың екі жүз сегіз теңге", 986327356703: "тоғыз жүз сексен алты миллиард үш жүз жиырма жеті миллион үш жүз елу алты мың жеті жүз үш теңге", 62560269267: "алпыс екі миллиард бес жүз алпыс миллион екі жүз алпыс тоғыз мың екі жүз алпыс жеті теңге", 661221765567: "алты жүз алпыс бір миллиард екі жүз жиырма бір миллион жеті жүз алпыс бес мың бес жүз алпыс жеті теңге", 88777547175: "сексен сегіз миллиард жеті жүз жетпіс жеті миллион бес жүз қырық жеті мың жүз жетпіс бес теңге", 579503679545: "бес жүз жетпіс тоғыз миллиард бес жүз үш миллион алты жүз жетпіс тоғыз мың бес жүз қырық бес теңге", 604386643710: "алты жүз төрт миллиард үш жүз сексен алты миллион алты жүз қырық үш мың жеті жүз он теңге", 62959664654: "алпыс екі миллиард тоғыз жүз елу тоғыз миллион алты жүз алпыс төрт мың алты жүз елу төрт теңге", 513262942421: "бес жүз он үш миллиард екі жүз алпыс екі миллион тоғыз жүз қырық екі мың төрт жүз жиырма бір теңге", 505356570870: "бес жүз бес миллиард үш жүз елу алты миллион бес жүз жетпіс мың сегіз жүз жетпіс теңге", 445803588020: "төрт жүз қырық бес миллиард сегіз жүз үш миллион бес жүз сексен сегіз мың жиырма теңге", 898906170873: "сегіз жүз тоқсан сегіз миллиард тоғыз жүз алты миллион жүз жетпіс мың сегіз жүз жетпіс үш теңге", 755868853780: "жеті жүз елу бес миллиард сегіз жүз алпыс сегіз миллион сегіз жүз елу үш мың жеті жүз сексен теңге", 417154301158: "төрт жүз он жеті миллиард жүз елу төрт миллион үш жүз бір мың жүз елу сегіз теңге", 684305388272: "алты жүз сексен төрт миллиард үш жүз бес миллион үш жүз сексен сегіз мың екі жүз жетпіс екі теңге", 339064838498: "үш жүз отыз тоғыз миллиард алпыс төрт миллион сегіз жүз отыз сегіз мың төрт жүз тоқсан сегіз теңге", 134919159754: "жүз отыз төрт миллиард тоғыз жүз он тоғыз миллион жүз елу тоғыз мың жеті жүз елу төрт теңге", 19885559886: "он тоғыз миллиард сегіз жүз сексен бес миллион бес жүз елу тоғыз мың сегіз жүз сексен алты теңге", 32113245322: "отыз екі миллиард жүз он үш миллион екі жүз қырық бес мың үш жүз жиырма екі теңге", 519858660948: "бес жүз он тоғыз миллиард сегіз жүз елу сегіз миллион алты жүз алпыс мың тоғыз жүз қырық сегіз теңге", 892491802983: "сегіз жүз тоқсан екі миллиард төрт жүз тоқсан бір миллион сегіз жүз екі мың тоғыз жүз сексен үш теңге", 897880609258: "сегіз жүз тоқсан жеті миллиард сегіз жүз сексен миллион алты жүз тоғыз мың екі жүз елу сегіз теңге", 248351493414: "екі жүз қырық сегіз миллиард үш жүз елу бір миллион төрт жүз тоқсан үш мың төрт жүз он төрт теңге", 387940187371: "үш жүз сексен жеті миллиард тоғыз жүз қырық миллион жүз сексен жеті мың үш жүз жетпіс бір теңге", 512058661520: "бес жүз он екі миллиард елу сегіз миллион алты жүз алпыс бір мың бес жүз жиырма теңге", 309258593798: "үш жүз тоғыз миллиард екі жүз елу сегіз миллион бес жүз тоқсан үш мың жеті жүз тоқсан сегіз теңге", 458811429037: "төрт жүз елу сегіз миллиард сегіз жүз он бір миллион төрт жүз жиырма тоғыз мың отыз жеті теңге", 587453890843: "бес жүз сексен жеті миллиард төрт жүз елу үш миллион сегіз жүз тоқсан мың сегіз жүз қырық үш теңге", 211440178230: "екі жүз он бір миллиард төрт жүз қырық миллион жүз жетпіс сегіз мың екі жүз отыз теңге", 767943080511: "жеті жүз алпыс жеті миллиард тоғыз жүз қырық үш миллион сексен мың бес жүз он бір теңге", 427122703035: "төрт жүз жиырма жеті миллиард жүз жиырма екі миллион жеті жүз үш мың отыз бес теңге", 769746389561: "жеті жүз алпыс тоғыз миллиард жеті жүз қырық алты миллион үш жүз сексен тоғыз мың бес жүз алпыс бір теңге", 373069942783: "үш жүз жетпіс үш миллиард алпыс тоғыз миллион тоғыз жүз қырық екі мың жеті жүз сексен үш теңге", 458410101851: "төрт жүз елу сегіз миллиард төрт жүз он миллион жүз бір мың сегіз жүз елу бір теңге", 700264859309: "жеті жүз миллиард екі жүз алпыс төрт миллион сегіз жүз елу тоғыз мың үш жүз тоғыз теңге", 521157974420: "бес жүз жиырма бір миллиард жүз елу жеті миллион тоғыз жүз жетпіс төрт мың төрт жүз жиырма теңге", 708956782573: "жеті жүз сегіз миллиард тоғыз жүз елу алты миллион жеті жүз сексен екі мың бес жүз жетпіс үш теңге", 807278271396: "сегіз жүз жеті миллиард екі жүз жетпіс сегіз миллион екі жүз жетпіс бір мың үш жүз тоқсан алты теңге", 708759951426: "жеті жүз сегіз миллиард жеті жүз елу тоғыз миллион тоғыз жүз елу бір мың төрт жүз жиырма алты теңге", 153829346889: "жүз елу үш миллиард сегіз жүз жиырма тоғыз миллион үш жүз қырық алты мың сегіз жүз сексен тоғыз теңге", 515549411365: "бес жүз он бес миллиард бес жүз қырық тоғыз миллион төрт жүз он бір мың үш жүз алпыс бес теңге", 768501399896: "жеті жүз алпыс сегіз миллиард бес жүз бір миллион үш жүз тоқсан тоғыз мың сегіз жүз тоқсан алты теңге", 166133768498: "жүз алпыс алты миллиард жүз отыз үш миллион жеті жүз алпыс сегіз мың төрт жүз тоқсан сегіз теңге", 942866049195: "тоғыз жүз қырық екі миллиард сегіз жүз алпыс алты миллион қырық тоғыз мың жүз тоқсан бес теңге", 643445943500: "алты жүз қырық үш миллиард төрт жүз қырық бес миллион тоғыз жүз қырық үш мың бес жүз теңге", 398562781690: "үш жүз тоқсан сегіз миллиард бес жүз алпыс екі миллион жеті жүз сексен бір мың алты жүз тоқсан теңге", 685927817397: "алты жүз сексен бес миллиард тоғыз жүз жиырма жеті миллион сегіз жүз он жеті мың үш жүз тоқсан жеті теңге", 85305291351: "сексен бес миллиард үш жүз бес миллион екі жүз тоқсан бір мың үш жүз елу бір теңге", 237928906226: "екі жүз отыз жеті миллиард тоғыз жүз жиырма сегіз миллион тоғыз жүз алты мың екі жүз жиырма алты теңге", 447792899101: "төрт жүз қырық жеті миллиард жеті жүз тоқсан екі миллион сегіз жүз тоқсан тоғыз мың жүз бір теңге", 536537712450: "бес жүз отыз алты миллиард бес жүз отыз жеті миллион жеті жүз он екі мың төрт жүз елу теңге", 525515537254: "бес жүз жиырма бес миллиард бес жүз он бес миллион бес жүз отыз жеті мың екі жүз елу төрт теңге", 54978474421: "елу төрт миллиард тоғыз жүз жетпіс сегіз миллион төрт жүз жетпіс төрт мың төрт жүз жиырма бір теңге", 258858388622: "екі жүз елу сегіз миллиард сегіз жүз елу сегіз миллион үш жүз сексен сегіз мың алты жүз жиырма екі теңге", 375289280643: "үш жүз жетпіс бес миллиард екі жүз сексен тоғыз миллион екі жүз сексен мың алты жүз қырық үш теңге", 985633379624: "тоғыз жүз сексен бес миллиард алты жүз отыз үш миллион үш жүз жетпіс тоғыз мың алты жүз жиырма төрт теңге", 514554582750: "бес жүз он төрт миллиард бес жүз елу төрт миллион бес жүз сексен екі мың жеті жүз елу теңге", 227345719651: "екі жүз жиырма жеті миллиард үш жүз қырық бес миллион жеті жүз он тоғыз мың алты жүз елу бір теңге", 56905622760: "елу алты миллиард тоғыз жүз бес миллион алты жүз жиырма екі мың жеті жүз алпыс теңге", 384096863450: "үш жүз сексен төрт миллиард тоқсан алты миллион сегіз жүз алпыс үш мың төрт жүз елу теңге", 921638215405: "тоғыз жүз жиырма бір миллиард алты жүз отыз сегіз миллион екі жүз он бес мың төрт жүз бес теңге", 248793992904: "екі жүз қырық сегіз миллиард жеті жүз тоқсан үш миллион тоғыз жүз тоқсан екі мың тоғыз жүз төрт теңге", 384460658361: "үш жүз сексен төрт миллиард төрт жүз алпыс миллион алты жүз елу сегіз мың үш жүз алпыс бір теңге", 328630787153: "үш жүз жиырма сегіз миллиард алты жүз отыз миллион жеті жүз сексен жеті мың жүз елу үш теңге", 264855819658: "екі жүз алпыс төрт миллиард сегіз жүз елу бес миллион сегіз жүз он тоғыз мың алты жүз елу сегіз теңге", 944318046748: "тоғыз жүз қырық төрт миллиард үш жүз он сегіз миллион қырық алты мың жеті жүз қырық сегіз теңге", 587563671701: "бес жүз сексен жеті миллиард бес жүз алпыс үш миллион алты жүз жетпіс бір мың жеті жүз бір теңге", 222032707081: "екі жүз жиырма екі миллиард отыз екі миллион жеті жүз жеті мың сексен бір теңге", 542557106115: "бес жүз қырық екі миллиард бес жүз елу жеті миллион жүз алты мың жүз он бес теңге", 960576335042: "тоғыз жүз алпыс миллиард бес жүз жетпіс алты миллион үш жүз отыз бес мың қырық екі теңге", 428633859139: "төрт жүз жиырма сегіз миллиард алты жүз отыз үш миллион сегіз жүз елу тоғыз мың жүз отыз тоғыз теңге", 701887285782: "жеті жүз бір миллиард сегіз жүз сексен жеті миллион екі жүз сексен бес мың жеті жүз сексен екі теңге", 649295677539: "алты жүз қырық тоғыз миллиард екі жүз тоқсан бес миллион алты жүз жетпіс жеті мың бес жүз отыз тоғыз теңге", 403576642259: "төрт жүз үш миллиард бес жүз жетпіс алты миллион алты жүз қырық екі мың екі жүз елу тоғыз теңге", 575990369033: "бес жүз жетпіс бес миллиард тоғыз жүз тоқсан миллион үш жүз алпыс тоғыз мың отыз үш теңге", 974133894909: "тоғыз жүз жетпіс төрт миллиард жүз отыз үш миллион сегіз жүз тоқсан төрт мың тоғыз жүз тоғыз теңге", 701589626820: "жеті жүз бір миллиард бес жүз сексен тоғыз миллион алты жүз жиырма алты мың сегіз жүз жиырма теңге", 615752532629: "алты жүз он бес миллиард жеті жүз елу екі миллион бес жүз отыз екі мың алты жүз жиырма тоғыз теңге", 487530192487: "төрт жүз сексен жеті миллиард бес жүз отыз миллион жүз тоқсан екі мың төрт жүз сексен жеті теңге", 244266162045: "екі жүз қырық төрт миллиард екі жүз алпыс алты миллион жүз алпыс екі мың қырық бес теңге", 285435293057: "екі жүз сексен бес миллиард төрт жүз отыз бес миллион екі жүз тоқсан үш мың елу жеті теңге", 742938640345: "жеті жүз қырық екі миллиард тоғыз жүз отыз сегіз миллион алты жүз қырық мың үш жүз қырық бес теңге", 382267144611: "үш жүз сексен екі миллиард екі жүз алпыс жеті миллион жүз қырық төрт мың алты жүз он бір теңге", 669924220597: "алты жүз алпыс тоғыз миллиард тоғыз жүз жиырма төрт миллион екі жүз жиырма мың бес жүз тоқсан жеті теңге", 242816162036: "екі жүз қырық екі миллиард сегіз жүз он алты миллион жүз алпыс екі мың отыз алты теңге", 428294367182: "төрт жүз жиырма сегіз миллиард екі жүз тоқсан төрт миллион үш жүз алпыс жеті мың жүз сексен екі теңге", 486367094670: "төрт жүз сексен алты миллиард үш жүз алпыс жеті миллион тоқсан төрт мың алты жүз жетпіс теңге", 210048155967: "екі жүз он миллиард қырық сегіз миллион жүз елу бес мың тоғыз жүз алпыс жеті теңге", 48443973731: "қырық сегіз миллиард төрт жүз қырық үш миллион тоғыз жүз жетпіс үш мың жеті жүз отыз бір теңге", 59293129051: "елу тоғыз миллиард екі жүз тоқсан үш миллион жүз жиырма тоғыз мың елу бір теңге", 852112804862: "сегіз жүз елу екі миллиард жүз он екі миллион сегіз жүз төрт мың сегіз жүз алпыс екі теңге", 173623641820: "жүз жетпіс үш миллиард алты жүз жиырма үш миллион алты жүз қырық бір мың сегіз жүз жиырма теңге", 263773593532: "екі жүз алпыс үш миллиард жеті жүз жетпіс үш миллион бес жүз тоқсан үш мың бес жүз отыз екі теңге", 321228817889: "үш жүз жиырма бір миллиард екі жүз жиырма сегіз миллион сегіз жүз он жеті мың сегіз жүз сексен тоғыз теңге", 997734399574: "тоғыз жүз тоқсан жеті миллиард жеті жүз отыз төрт миллион үш жүз тоқсан тоғыз мың бес жүз жетпіс төрт теңге", 853675589026: "сегіз жүз елу үш миллиард алты жүз жетпіс бес миллион бес жүз сексен тоғыз мың жиырма алты теңге", 229928698092: "екі жүз жиырма тоғыз миллиард тоғыз жүз жиырма сегіз миллион алты жүз тоқсан сегіз мың тоқсан екі теңге", 39461552394: "отыз тоғыз миллиард төрт жүз алпыс бір миллион бес жүз елу екі мың үш жүз тоқсан төрт теңге", 233176675265: "екі жүз отыз үш миллиард жүз жетпіс алты миллион алты жүз жетпіс бес мың екі жүз алпыс бес теңге", 916551877693793: "тоғыз жүз он алты триллион бес жүз елу бір миллиард сегіз жүз жетпіс жеті миллион алты жүз тоқсан үш мың жеті жүз тоқсан үш теңге", 403357702863709: "төрт жүз үш триллион үш жүз елу жеті миллиард жеті жүз екі миллион сегіз жүз алпыс үш мың жеті жүз тоғыз теңге", 910114183700106: "тоғыз жүз он триллион жүз он төрт миллиард жүз сексен үш миллион жеті жүз мың жүз алты теңге", 249663227526272: "екі жүз қырық тоғыз триллион алты жүз алпыс үш миллиард екі жүз жиырма жеті миллион бес жүз жиырма алты мың екі жүз жетпіс екі теңге", 471985151114097: "төрт жүз жетпіс бір триллион тоғыз жүз сексен бес миллиард жүз елу бір миллион жүз он төрт мың тоқсан жеті теңге", 36347055154300: "отыз алты триллион үш жүз қырық жеті миллиард елу бес миллион жүз елу төрт мың үш жүз теңге", 276870259710023: "екі жүз жетпіс алты триллион сегіз жүз жетпіс миллиард екі жүз елу тоғыз миллион жеті жүз он мың жиырма үш теңге", 385330965815582: "үш жүз сексен бес триллион үш жүз отыз миллиард тоғыз жүз алпыс бес миллион сегіз жүз он бес мың бес жүз сексен екі теңге", 733357099968000: "жеті жүз отыз үш триллион үш жүз елу жеті миллиард тоқсан тоғыз миллион тоғыз жүз алпыс сегіз мың теңге", 543988326783558: "бес жүз қырық үш триллион тоғыз жүз сексен сегіз миллиард үш жүз жиырма алты миллион жеті жүз сексен үш мың бес жүз елу сегіз теңге", 598202594551792: "бес жүз тоқсан сегіз триллион екі жүз екі миллиард бес жүз тоқсан төрт миллион бес жүз елу бір мың жеті жүз тоқсан екі теңге", 43151503982784: "қырық үш триллион жүз елу бір миллиард бес жүз үш миллион тоғыз жүз сексен екі мың жеті жүз сексен төрт теңге", 904235713701108: "тоғыз жүз төрт триллион екі жүз отыз бес миллиард жеті жүз он үш миллион жеті жүз бір мың жүз сегіз теңге", 555359305677962: "бес жүз елу бес триллион үш жүз елу тоғыз миллиард үш жүз бес миллион алты жүз жетпіс жеті мың тоғыз жүз алпыс екі теңге", 671765045482392: "алты жүз жетпіс бір триллион жеті жүз алпыс бес миллиард қырық бес миллион төрт жүз сексен екі мың үш жүз тоқсан екі теңге", 795545610451441: "жеті жүз тоқсан бес триллион бес жүз қырық бес миллиард алты жүз он миллион төрт жүз елу бір мың төрт жүз қырық бір теңге", 873881917988817: "сегіз жүз жетпіс үш триллион сегіз жүз сексен бір миллиард тоғыз жүз он жеті миллион тоғыз жүз сексен сегіз мың сегіз жүз он жеті теңге", 474643943754940: "төрт жүз жетпіс төрт триллион алты жүз қырық үш миллиард тоғыз жүз қырық үш миллион жеті жүз елу төрт мың тоғыз жүз қырық теңге", 134951454940853: "жүз отыз төрт триллион тоғыз жүз елу бір миллиард төрт жүз елу төрт миллион тоғыз жүз қырық мың сегіз жүз елу үш теңге", 329639892299708: "үш жүз жиырма тоғыз триллион алты жүз отыз тоғыз миллиард сегіз жүз тоқсан екі миллион екі жүз тоқсан тоғыз мың жеті жүз сегіз теңге", 451412723278945: "төрт жүз елу бір триллион төрт жүз он екі миллиард жеті жүз жиырма үш миллион екі жүз жетпіс сегіз мың тоғыз жүз қырық бес теңге", 127968703393249: "жүз жиырма жеті триллион тоғыз жүз алпыс сегіз миллиард жеті жүз үш миллион үш жүз тоқсан үш мың екі жүз қырық тоғыз теңге", 862950185110798: "сегіз жүз алпыс екі триллион тоғыз жүз елу миллиард жүз сексен бес миллион жүз он мың жеті жүз тоқсан сегіз теңге", 896826227758254: "сегіз жүз тоқсан алты триллион сегіз жүз жиырма алты миллиард екі жүз жиырма жеті миллион жеті жүз елу сегіз мың екі жүз елу төрт теңге", 382169979101751: "үш жүз сексен екі триллион жүз алпыс тоғыз миллиард тоғыз жүз жетпіс тоғыз миллион жүз бір мың жеті жүз елу бір теңге", 277693388283570: "екі жүз жетпіс жеті триллион алты жүз тоқсан үш миллиард үш жүз сексен сегіз миллион екі жүз сексен үш мың бес жүз жетпіс теңге", 789460615387538: "жеті жүз сексен тоғыз триллион төрт жүз алпыс миллиард алты жүз он бес миллион үш жүз сексен жеті мың бес жүз отыз сегіз теңге", 774034343033283: "жеті жүз жетпіс төрт триллион отыз төрт миллиард үш жүз қырық үш миллион отыз үш мың екі жүз сексен үш теңге", 649994601604636: "алты жүз қырық тоғыз триллион тоғыз жүз тоқсан төрт миллиард алты жүз бір миллион алты жүз төрт мың алты жүз отыз алты теңге", 16736098593299: "он алты триллион жеті жүз отыз алты миллиард тоқсан сегіз миллион бес жүз тоқсан үш мың екі жүз тоқсан тоғыз теңге", 365090135511118: "үш жүз алпыс бес триллион тоқсан миллиард жүз отыз бес миллион бес жүз он бір мың жүз он сегіз теңге", 587997299668833: "бес жүз сексен жеті триллион тоғыз жүз тоқсан жеті миллиард екі жүз тоқсан тоғыз миллион алты жүз алпыс сегіз мың сегіз жүз отыз үш теңге", 829145853581897: "сегіз жүз жиырма тоғыз триллион жүз қырық бес миллиард сегіз жүз елу үш миллион бес жүз сексен бір мың сегіз жүз тоқсан жеті теңге", 401992016542348: "төрт жүз бір триллион тоғыз жүз тоқсан екі миллиард он алты миллион бес жүз қырық екі мың үш жүз қырық сегіз теңге", 376175590919258: "үш жүз жетпіс алты триллион жүз жетпіс бес миллиард бес жүз тоқсан миллион тоғыз жүз он тоғыз мың екі жүз елу сегіз теңге", 329101710651109: "үш жүз жиырма тоғыз триллион жүз бір миллиард жеті жүз он миллион алты жүз елу бір мың жүз тоғыз теңге", 625437683775323: "алты жүз жиырма бес триллион төрт жүз отыз жеті миллиард алты жүз сексен үш миллион жеті жүз жетпіс бес мың үш жүз жиырма үш теңге", 6085973071007: "алты триллион сексен бес миллиард тоғыз жүз жетпіс үш миллион жетпіс бір мың жеті теңге", 138002135640787: "жүз отыз сегіз триллион екі миллиард жүз отыз бес миллион алты жүз қырық мың жеті жүз сексен жеті теңге", 217770193104851: "екі жүз он жеті триллион жеті жүз жетпіс миллиард жүз тоқсан үш миллион жүз төрт мың сегіз жүз елу бір теңге", 699103222408991: "алты жүз тоқсан тоғыз триллион жүз үш миллиард екі жүз жиырма екі миллион төрт жүз сегіз мың тоғыз жүз тоқсан бір теңге", 523675313376810: "бес жүз жиырма үш триллион алты жүз жетпіс бес миллиард үш жүз он үш миллион үш жүз жетпіс алты мың сегіз жүз он теңге", 120596973644456: "жүз жиырма триллион бес жүз тоқсан алты миллиард тоғыз жүз жетпіс үш миллион алты жүз қырық төрт мың төрт жүз елу алты теңге", 787924967149550: "жеті жүз сексен жеті триллион тоғыз жүз жиырма төрт миллиард тоғыз жүз алпыс жеті миллион жүз қырық тоғыз мың бес жүз елу теңге", 230912237410003: "екі жүз отыз триллион тоғыз жүз он екі миллиард екі жүз отыз жеті миллион төрт жүз он мың үш теңге", 152500900509976: "жүз елу екі триллион бес жүз миллиард тоғыз жүз миллион бес жүз тоғыз мың тоғыз жүз жетпіс алты теңге", 567247599684870: "бес жүз алпыс жеті триллион екі жүз қырық жеті миллиард бес жүз тоқсан тоғыз миллион алты жүз сексен төрт мың сегіз жүз жетпіс теңге", 182010656780055: "жүз сексен екі триллион он миллиард алты жүз елу алты миллион жеті жүз сексен мың елу бес теңге", 950187486603914: "тоғыз жүз елу триллион жүз сексен жеті миллиард төрт жүз сексен алты миллион алты жүз үш мың тоғыз жүз он төрт теңге", 80329332447642: "сексен триллион үш жүз жиырма тоғыз миллиард үш жүз отыз екі миллион төрт жүз қырық жеті мың алты жүз қырық екі теңге", 178966814326078: "жүз жетпіс сегіз триллион тоғыз жүз алпыс алты миллиард сегіз жүз он төрт миллион үш жүз жиырма алты мың жетпіс сегіз теңге", 238405567916965: "екі жүз отыз сегіз триллион төрт жүз бес миллиард бес жүз алпыс жеті миллион тоғыз жүз он алты мың тоғыз жүз алпыс бес теңге", 633865973095250: "алты жүз отыз үш триллион сегіз жүз алпыс бес миллиард тоғыз жүз жетпіс үш миллион тоқсан бес мың екі жүз елу теңге", 435362590366483: "төрт жүз отыз бес триллион үш жүз алпыс екі миллиард бес жүз тоқсан миллион үш жүз алпыс алты мың төрт жүз сексен үш теңге", 175721529596222: "жүз жетпіс бес триллион жеті жүз жиырма бір миллиард бес жүз жиырма тоғыз миллион бес жүз тоқсан алты мың екі жүз жиырма екі теңге", 678057169862020: "алты жүз жетпіс сегіз триллион елу жеті миллиард жүз алпыс тоғыз миллион сегіз жүз алпыс екі мың жиырма теңге", 468522634070590: "төрт жүз алпыс сегіз триллион бес жүз жиырма екі миллиард алты жүз отыз төрт миллион жетпіс мың бес жүз тоқсан теңге", 224700875476034: "екі жүз жиырма төрт триллион жеті жүз миллиард сегіз жүз жетпіс бес миллион төрт жүз жетпіс алты мың отыз төрт теңге", 96189402636972: "тоқсан алты триллион жүз сексен тоғыз миллиард төрт жүз екі миллион алты жүз отыз алты мың тоғыз жүз жетпіс екі теңге", 577410730695477: "бес жүз жетпіс жеті триллион төрт жүз он миллиард жеті жүз отыз миллион алты жүз тоқсан бес мың төрт жүз жетпіс жеті теңге", 25174429651687: "жиырма бес триллион жүз жетпіс төрт миллиард төрт жүз жиырма тоғыз миллион алты жүз елу бір мың алты жүз сексен жеті теңге", 366944901545220: "үш жүз алпыс алты триллион тоғыз жүз қырық төрт миллиард тоғыз жүз бір миллион бес жүз қырық бес мың екі жүз жиырма теңге", 547841099200572: "бес жүз қырық жеті триллион сегіз жүз қырық бір миллиард тоқсан тоғыз миллион екі жүз мың бес жүз жетпіс екі теңге", 902898729310396: "тоғыз жүз екі триллион сегіз жүз тоқсан сегіз миллиард жеті жүз жиырма тоғыз миллион үш жүз он мың үш жүз тоқсан алты теңге", 734343698947439: "жеті жүз отыз төрт триллион үш жүз қырық үш миллиард алты жүз тоқсан сегіз миллион тоғыз жүз қырық жеті мың төрт жүз отыз тоғыз теңге", 129037626445431: "жүз жиырма тоғыз триллион отыз жеті миллиард алты жүз жиырма алты миллион төрт жүз қырық бес мың төрт жүз отыз бір теңге", 965688701982959: "тоғыз жүз алпыс бес триллион алты жүз сексен сегіз миллиард жеті жүз бір миллион тоғыз жүз сексен екі мың тоғыз жүз елу тоғыз теңге", 279525122721622: "екі жүз жетпіс тоғыз триллион бес жүз жиырма бес миллиард жүз жиырма екі миллион жеті жүз жиырма бір мың алты жүз жиырма екі теңге", 933670175221274: "тоғыз жүз отыз үш триллион алты жүз жетпіс миллиард жүз жетпіс бес миллион екі жүз жиырма бір мың екі жүз жетпіс төрт теңге", 779151444279828: "жеті жүз жетпіс тоғыз триллион жүз елу бір миллиард төрт жүз қырық төрт миллион екі жүз жетпіс тоғыз мың сегіз жүз жиырма сегіз теңге", 265363177417011: "екі жүз алпыс бес триллион үш жүз алпыс үш миллиард жүз жетпіс жеті миллион төрт жүз он жеті мың он бір теңге", 618604064437024: "алты жүз он сегіз триллион алты жүз төрт миллиард алпыс төрт миллион төрт жүз отыз жеті мың жиырма төрт теңге", 877023805198274: "сегіз жүз жетпіс жеті триллион жиырма үш миллиард сегіз жүз бес миллион жүз тоқсан сегіз мың екі жүз жетпіс төрт теңге", 596456674913870: "бес жүз тоқсан алты триллион төрт жүз елу алты миллиард алты жүз жетпіс төрт миллион тоғыз жүз он үш мың сегіз жүз жетпіс теңге", 744588291273823: "жеті жүз қырық төрт триллион бес жүз сексен сегіз миллиард екі жүз тоқсан бір миллион екі жүз жетпіс үш мың сегіз жүз жиырма үш теңге", 471401511127250: "төрт жүз жетпіс бір триллион төрт жүз бір миллиард бес жүз он бір миллион жүз жиырма жеті мың екі жүз елу теңге", 908155115089866: "тоғыз жүз сегіз триллион жүз елу бес миллиард жүз он бес миллион сексен тоғыз мың сегіз жүз алпыс алты теңге", 688808733787847: "алты жүз сексен сегіз триллион сегіз жүз сегіз миллиард жеті жүз отыз үш миллион жеті жүз сексен жеті мың сегіз жүз қырық жеті теңге", 335928259995071: "үш жүз отыз бес триллион тоғыз жүз жиырма сегіз миллиард екі жүз елу тоғыз миллион тоғыз жүз тоқсан бес мың жетпіс бір теңге", 245379982720233: "екі жүз қырық бес триллион үш жүз жетпіс тоғыз миллиард тоғыз жүз сексен екі миллион жеті жүз жиырма мың екі жүз отыз үш теңге", 17368667412725: "он жеті триллион үш жүз алпыс сегіз миллиард алты жүз алпыс жеті миллион төрт жүз он екі мың жеті жүз жиырма бес теңге", 562059805881774: "бес жүз алпыс екі триллион елу тоғыз миллиард сегіз жүз бес миллион сегіз жүз сексен бір мың жеті жүз жетпіс төрт теңге", 204411537288558: "екі жүз төрт триллион төрт жүз он бір миллиард бес жүз отыз жеті миллион екі жүз сексен сегіз мың бес жүз елу сегіз теңге", 791138855660903: "жеті жүз тоқсан бір триллион жүз отыз сегіз миллиард сегіз жүз елу бес миллион алты жүз алпыс мың тоғыз жүз үш теңге", 837472570443195: "сегіз жүз отыз жеті триллион төрт жүз жетпіс екі миллиард бес жүз жетпіс миллион төрт жүз қырық үш мың жүз тоқсан бес теңге", 140931158138947: "жүз қырық триллион тоғыз жүз отыз бір миллиард жүз елу сегіз миллион жүз отыз сегіз мың тоғыз жүз қырық жеті теңге", 555934089598408: "бес жүз елу бес триллион тоғыз жүз отыз төрт миллиард сексен тоғыз миллион бес жүз тоқсан сегіз мың төрт жүз сегіз теңге", 50423214100431: "елу триллион төрт жүз жиырма үш миллиард екі жүз он төрт миллион жүз мың төрт жүз отыз бір теңге", 272162973456798: "екі жүз жетпіс екі триллион жүз алпыс екі миллиард тоғыз жүз жетпіс үш миллион төрт жүз елу алты мың жеті жүз тоқсан сегіз теңге", 435244981814324: "төрт жүз отыз бес триллион екі жүз қырық төрт миллиард тоғыз жүз сексен бір миллион сегіз жүз он төрт мың үш жүз жиырма төрт теңге", 73252040196255: "жетпіс үш триллион екі жүз елу екі миллиард қырық миллион жүз тоқсан алты мың екі жүз елу бес теңге", 844489761989339: "сегіз жүз қырық төрт триллион төрт жүз сексен тоғыз миллиард жеті жүз алпыс бір миллион тоғыз жүз сексен тоғыз мың үш жүз отыз тоғыз теңге", 586113344505668: "бес жүз сексен алты триллион жүз он үш миллиард үш жүз қырық төрт миллион бес жүз бес мың алты жүз алпыс сегіз теңге", 562165085616403: "бес жүз алпыс екі триллион жүз алпыс бес миллиард сексен бес миллион алты жүз он алты мың төрт жүз үш теңге", 383261029052505: "үш жүз сексен үш триллион екі жүз алпыс бір миллиард жиырма тоғыз миллион елу екі мың бес жүз бес теңге", 747599553598030: "жеті жүз қырық жеті триллион бес жүз тоқсан тоғыз миллиард бес жүз елу үш миллион бес жүз тоқсан сегіз мың отыз теңге", 104788651392826: "жүз төрт триллион жеті жүз сексен сегіз миллиард алты жүз елу бір миллион үш жүз тоқсан екі мың сегіз жүз жиырма алты теңге", 67115286330830: "алпыс жеті триллион жүз он бес миллиард екі жүз сексен алты миллион үш жүз отыз мың сегіз жүз отыз теңге", 800319567133103: "сегіз жүз триллион үш жүз он тоғыз миллиард бес жүз алпыс жеті миллион жүз отыз үш мың жүз үш теңге", 289863409714379: "екі жүз сексен тоғыз триллион сегіз жүз алпыс үш миллиард төрт жүз тоғыз миллион жеті жүз он төрт мың үш жүз жетпіс тоғыз теңге", 965732432404140085: "тоғыз жүз алпыс бес квадриллион жеті жүз отыз екі триллион төрт жүз отыз екі миллиард төрт жүз төрт миллион жүз қырық мың сексен бес теңге", 208877073260506426: "екі жүз сегіз квадриллион сегіз жүз жетпіс жеті триллион жетпіс үш миллиард екі жүз алпыс миллион бес жүз алты мың төрт жүз жиырма алты теңге", 233268567977123456: "екі жүз отыз үш квадриллион екі жүз алпыс сегіз триллион бес жүз алпыс жеті миллиард тоғыз жүз жетпіс жеті миллион жүз жиырма үш мың төрт жүз елу алты теңге", 887834595742932925: "сегіз жүз сексен жеті квадриллион сегіз жүз отыз төрт триллион бес жүз тоқсан бес миллиард жеті жүз қырық екі миллион тоғыз жүз отыз екі мың тоғыз жүз жиырма бес теңге", 622608366177568319: "алты жүз жиырма екі квадриллион алты жүз сегіз триллион үш жүз алпыс алты миллиард жүз жетпіс жеті миллион бес жүз алпыс сегіз мың үш жүз он тоғыз теңге", 438732998350353387: "төрт жүз отыз сегіз квадриллион жеті жүз отыз екі триллион тоғыз жүз тоқсан сегіз миллиард үш жүз елу миллион үш жүз елу үш мың үш жүз сексен жеті теңге", 875990284800700966: "сегіз жүз жетпіс бес квадриллион тоғыз жүз тоқсан триллион екі жүз сексен төрт миллиард сегіз жүз миллион жеті жүз мың тоғыз жүз алпыс алты теңге", 617400322075148902: "алты жүз он жеті квадриллион төрт жүз триллион үш жүз жиырма екі миллиард жетпіс бес миллион жүз қырық сегіз мың тоғыз жүз екі теңге", 313063084676805889: "үш жүз он үш квадриллион алпыс үш триллион сексен төрт миллиард алты жүз жетпіс алты миллион сегіз жүз бес мың сегіз жүз сексен тоғыз теңге", 465297282964223239: "төрт жүз алпыс бес квадриллион екі жүз тоқсан жеті триллион екі жүз сексен екі миллиард тоғыз жүз алпыс төрт миллион екі жүз жиырма үш мың екі жүз отыз тоғыз теңге", 709736796542119522: "жеті жүз тоғыз квадриллион жеті жүз отыз алты триллион жеті жүз тоқсан алты миллиард бес жүз қырық екі миллион жүз он тоғыз мың бес жүз жиырма екі теңге", 977508551092789280: "тоғыз жүз жетпіс жеті квадриллион бес жүз сегіз триллион бес жүз елу бір миллиард тоқсан екі миллион жеті жүз сексен тоғыз мың екі жүз сексен теңге", 981740218366997586: "тоғыз жүз сексен бір квадриллион жеті жүз қырық триллион екі жүз он сегіз миллиард үш жүз алпыс алты миллион тоғыз жүз тоқсан жеті мың бес жүз сексен алты теңге", 353926724831862459: "үш жүз елу үш квадриллион тоғыз жүз жиырма алты триллион жеті жүз жиырма төрт миллиард сегіз жүз отыз бір миллион сегіз жүз алпыс екі мың төрт жүз елу тоғыз теңге", 974600018617678455: "тоғыз жүз жетпіс төрт квадриллион алты жүз триллион он сегіз миллиард алты жүз он жеті миллион алты жүз жетпіс сегіз мың төрт жүз елу бес теңге", 947235102879632724: "тоғыз жүз қырық жеті квадриллион екі жүз отыз бес триллион жүз екі миллиард сегіз жүз жетпіс тоғыз миллион алты жүз отыз екі мың жеті жүз жиырма төрт теңге", 545499563878532782: "бес жүз қырық бес квадриллион төрт жүз тоқсан тоғыз триллион бес жүз алпыс үш миллиард сегіз жүз жетпіс сегіз миллион бес жүз отыз екі мың жеті жүз сексен екі теңге", 455495933374775746: "төрт жүз елу бес квадриллион төрт жүз тоқсан бес триллион тоғыз жүз отыз үш миллиард үш жүз жетпіс төрт миллион жеті жүз жетпіс бес мың жеті жүз қырық алты теңге", 176524227854578545: "жүз жетпіс алты квадриллион бес жүз жиырма төрт триллион екі жүз жиырма жеті миллиард сегіз жүз елу төрт миллион бес жүз жетпіс сегіз мың бес жүз қырық бес теңге", 51485927690523859: "елу бір квадриллион төрт жүз сексен бес триллион тоғыз жүз жиырма жеті миллиард алты жүз тоқсан миллион бес жүз жиырма үш мың сегіз жүз елу тоғыз теңге", 574952939186587496: "бес жүз жетпіс төрт квадриллион тоғыз жүз елу екі триллион тоғыз жүз отыз тоғыз миллиард жүз сексен алты миллион бес жүз сексен жеті мың төрт жүз тоқсан алты теңге", 7214769764330411: "жеті квадриллион екі жүз он төрт триллион жеті жүз алпыс тоғыз миллиард жеті жүз алпыс төрт миллион үш жүз отыз мың төрт жүз он бір теңге", 188624933427564503: "жүз сексен сегіз квадриллион алты жүз жиырма төрт триллион тоғыз жүз отыз үш миллиард төрт жүз жиырма жеті миллион бес жүз алпыс төрт мың бес жүз үш теңге", 751796200892198553: "жеті жүз елу бір квадриллион жеті жүз тоқсан алты триллион екі жүз миллиард сегіз жүз тоқсан екі миллион жүз тоқсан сегіз мың бес жүз елу үш теңге", 989345384155410390: "тоғыз жүз сексен тоғыз квадриллион үш жүз қырық бес триллион үш жүз сексен төрт миллиард жүз елу бес миллион төрт жүз он мың үш жүз тоқсан теңге", 718604816819208563: "жеті жүз он сегіз квадриллион алты жүз төрт триллион сегіз жүз он алты миллиард сегіз жүз он тоғыз миллион екі жүз сегіз мың бес жүз алпыс үш теңге", 747147140410223524: "жеті жүз қырық жеті квадриллион жүз қырық жеті триллион жүз қырық миллиард төрт жүз он миллион екі жүз жиырма үш мың бес жүз жиырма төрт теңге", 906127715094746924: "тоғыз жүз алты квадриллион жүз жиырма жеті триллион жеті жүз он бес миллиард тоқсан төрт миллион жеті жүз қырық алты мың тоғыз жүз жиырма төрт теңге", 102564645475062712: "жүз екі квадриллион бес жүз алпыс төрт триллион алты жүз қырық бес миллиард төрт жүз жетпіс бес миллион алпыс екі мың жеті жүз он екі теңге", 35280919297955030: "отыз бес квадриллион екі жүз сексен триллион тоғыз жүз он тоғыз миллиард екі жүз тоқсан жеті миллион тоғыз жүз елу бес мың отыз теңге", 659124390700419217: "алты жүз елу тоғыз квадриллион жүз жиырма төрт триллион үш жүз тоқсан миллиард жеті жүз миллион төрт жүз он тоғыз мың екі жүз он жеті теңге", 984561554487229097: "тоғыз жүз сексен төрт квадриллион бес жүз алпыс бір триллион бес жүз елу төрт миллиард төрт жүз сексен жеті миллион екі жүз жиырма тоғыз мың тоқсан жеті теңге", 47254660791930884: "қырық жеті квадриллион екі жүз елу төрт триллион алты жүз алпыс миллиард жеті жүз тоқсан бір миллион тоғыз жүз отыз мың сегіз жүз сексен төрт теңге", 457774476801473257: "төрт жүз елу жеті квадриллион жеті жүз жетпіс төрт триллион төрт жүз жетпіс алты миллиард сегіз жүз бір миллион төрт жүз жетпіс үш мың екі жүз елу жеті теңге", 400923139921249526: "төрт жүз квадриллион тоғыз жүз жиырма үш триллион жүз отыз тоғыз миллиард тоғыз жүз жиырма бір миллион екі жүз қырық тоғыз мың бес жүз жиырма алты теңге", 355854878430885464: "үш жүз елу бес квадриллион сегіз жүз елу төрт триллион сегіз жүз жетпіс сегіз миллиард төрт жүз отыз миллион сегіз жүз сексен бес мың төрт жүз алпыс төрт теңге", 152480075950959627: "жүз елу екі квадриллион төрт жүз сексен триллион жетпіс бес миллиард тоғыз жүз елу миллион тоғыз жүз елу тоғыз мың алты жүз жиырма жеті теңге", 737698674790554756: "жеті жүз отыз жеті квадриллион алты жүз тоқсан сегіз триллион алты жүз жетпіс төрт миллиард жеті жүз тоқсан миллион бес жүз елу төрт мың жеті жүз елу алты теңге", 352860006888802950: "үш жүз елу екі квадриллион сегіз жүз алпыс триллион алты миллиард сегіз жүз сексен сегіз миллион сегіз жүз екі мың тоғыз жүз елу теңге", 950723952450122530: "тоғыз жүз елу квадриллион жеті жүз жиырма үш триллион тоғыз жүз елу екі миллиард төрт жүз елу миллион жүз жиырма екі мың бес жүз отыз теңге", 456982695847521382: "төрт жүз елу алты квадриллион тоғыз жүз сексен екі триллион алты жүз тоқсан бес миллиард сегіз жүз қырық жеті миллион бес жүз жиырма бір мың үш жүз сексен екі теңге", 760589896410059698: "жеті жүз алпыс квадриллион бес жүз сексен тоғыз триллион сегіз жүз тоқсан алты миллиард төрт жүз он миллион елу тоғыз мың алты жүз тоқсан сегіз теңге", 811707319612808689: "сегіз жүз он бір квадриллион жеті жүз жеті триллион үш жүз он тоғыз миллиард алты жүз он екі миллион сегіз жүз сегіз мың алты жүз сексен тоғыз теңге", 300477837600455329: "үш жүз квадриллион төрт жүз жетпіс жеті триллион сегіз жүз отыз жеті миллиард алты жүз миллион төрт жүз елу бес мың үш жүз жиырма тоғыз теңге", 46746224735570141: "қырық алты квадриллион жеті жүз қырық алты триллион екі жүз жиырма төрт миллиард жеті жүз отыз бес миллион бес жүз жетпіс мың жүз қырық бір теңге", 288886238958219159: "екі жүз сексен сегіз квадриллион сегіз жүз сексен алты триллион екі жүз отыз сегіз миллиард тоғыз жүз елу сегіз миллион екі жүз он тоғыз мың жүз елу тоғыз теңге", 390247672801546326: "үш жүз тоқсан квадриллион екі жүз қырық жеті триллион алты жүз жетпіс екі миллиард сегіз жүз бір миллион бес жүз қырық алты мың үш жүз жиырма алты теңге", 198050908811400185: "жүз тоқсан сегіз квадриллион елу триллион тоғыз жүз сегіз миллиард сегіз жүз он бір миллион төрт жүз мың жүз сексен бес теңге", 166601843742499617: "жүз алпыс алты квадриллион алты жүз бір триллион сегіз жүз қырық үш миллиард жеті жүз қырық екі миллион төрт жүз тоқсан тоғыз мың алты жүз он жеті теңге", 922990912845960398: "тоғыз жүз жиырма екі квадриллион тоғыз жүз тоқсан триллион тоғыз жүз он екі миллиард сегіз жүз қырық бес миллион тоғыз жүз алпыс мың үш жүз тоқсан сегіз теңге", 91881742363428985: "тоқсан бір квадриллион сегіз жүз сексен бір триллион жеті жүз қырық екі миллиард үш жүз алпыс үш миллион төрт жүз жиырма сегіз мың тоғыз жүз сексен бес теңге", 145667424164551761: "жүз қырық бес квадриллион алты жүз алпыс жеті триллион төрт жүз жиырма төрт миллиард жүз алпыс төрт миллион бес жүз елу бір мың жеті жүз алпыс бір теңге", 674183829840982940: "алты жүз жетпіс төрт квадриллион жүз сексен үш триллион сегіз жүз жиырма тоғыз миллиард сегіз жүз қырық миллион тоғыз жүз сексен екі мың тоғыз жүз қырық теңге", 183236432926042128: "жүз сексен үш квадриллион екі жүз отыз алты триллион төрт жүз отыз екі миллиард тоғыз жүз жиырма алты миллион қырық екі мың жүз жиырма сегіз теңге", 34119565137292865: "отыз төрт квадриллион жүз он тоғыз триллион бес жүз алпыс бес миллиард жүз отыз жеті миллион екі жүз тоқсан екі мың сегіз жүз алпыс бес теңге", 398914512104926001: "үш жүз тоқсан сегіз квадриллион тоғыз жүз он төрт триллион бес жүз он екі миллиард жүз төрт миллион тоғыз жүз жиырма алты мың бір теңге", 403768432209194223: "төрт жүз үш квадриллион жеті жүз алпыс сегіз триллион төрт жүз отыз екі миллиард екі жүз тоғыз миллион жүз тоқсан төрт мың екі жүз жиырма үш теңге", 328930967130043428: "үш жүз жиырма сегіз квадриллион тоғыз жүз отыз триллион тоғыз жүз алпыс жеті миллиард жүз отыз миллион қырық үш мың төрт жүз жиырма сегіз теңге", 555682826963517726: "бес жүз елу бес квадриллион алты жүз сексен екі триллион сегіз жүз жиырма алты миллиард тоғыз жүз алпыс үш миллион бес жүз он жеті мың жеті жүз жиырма алты теңге", 638836340888558678: "алты жүз отыз сегіз квадриллион сегіз жүз отыз алты триллион үш жүз қырық миллиард сегіз жүз сексен сегіз миллион бес жүз елу сегіз мың алты жүз жетпіс сегіз теңге", 992458131008706997: "тоғыз жүз тоқсан екі квадриллион төрт жүз елу сегіз триллион жүз отыз бір миллиард сегіз миллион жеті жүз алты мың тоғыз жүз тоқсан жеті теңге", 296224148896686517: "екі жүз тоқсан алты квадриллион екі жүз жиырма төрт триллион жүз қырық сегіз миллиард сегіз жүз тоқсан алты миллион алты жүз сексен алты мың бес жүз он жеті теңге", 843097446034079436: "сегіз жүз қырық үш квадриллион тоқсан жеті триллион төрт жүз қырық алты миллиард отыз төрт миллион жетпіс тоғыз мың төрт жүз отыз алты теңге", 13864547445721066: "он үш квадриллион сегіз жүз алпыс төрт триллион бес жүз қырық жеті миллиард төрт жүз қырық бес миллион жеті жүз жиырма бір мың алпыс алты теңге", 388750735129945457: "үш жүз сексен сегіз квадриллион жеті жүз елу триллион жеті жүз отыз бес миллиард жүз жиырма тоғыз миллион тоғыз жүз қырық бес мың төрт жүз елу жеті теңге", 360983088187698459: "үш жүз алпыс квадриллион тоғыз жүз сексен үш триллион сексен сегіз миллиард жүз сексен жеті миллион алты жүз тоқсан сегіз мың төрт жүз елу тоғыз теңге", 932764983953418779: "тоғыз жүз отыз екі квадриллион жеті жүз алпыс төрт триллион тоғыз жүз сексен үш миллиард тоғыз жүз елу үш миллион төрт жүз он сегіз мың жеті жүз жетпіс тоғыз теңге", 669537237805617961: "алты жүз алпыс тоғыз квадриллион бес жүз отыз жеті триллион екі жүз отыз жеті миллиард сегіз жүз бес миллион алты жүз он жеті мың тоғыз жүз алпыс бір теңге", 561641847581026421: "бес жүз алпыс бір квадриллион алты жүз қырық бір триллион сегіз жүз қырық жеті миллиард бес жүз сексен бір миллион жиырма алты мың төрт жүз жиырма бір теңге", 175425977746582801: "жүз жетпіс бес квадриллион төрт жүз жиырма бес триллион тоғыз жүз жетпіс жеті миллиард жеті жүз қырық алты миллион бес жүз сексен екі мың сегіз жүз бір теңге", 932426159383699474: "тоғыз жүз отыз екі квадриллион төрт жүз жиырма алты триллион жүз елу тоғыз миллиард үш жүз сексен үш миллион алты жүз тоқсан тоғыз мың төрт жүз жетпіс төрт теңге", 131262848313130899: "жүз отыз бір квадриллион екі жүз алпыс екі триллион сегіз жүз қырық сегіз миллиард үш жүз он үш миллион жүз отыз мың сегіз жүз тоқсан тоғыз теңге", 77494384580488934: "жетпіс жеті квадриллион төрт жүз тоқсан төрт триллион үш жүз сексен төрт миллиард бес жүз сексен миллион төрт жүз сексен сегіз мың тоғыз жүз отыз төрт теңге", 92137576091500891: "тоқсан екі квадриллион жүз отыз жеті триллион бес жүз жетпіс алты миллиард тоқсан бір миллион бес жүз мың сегіз жүз тоқсан бір теңге", 766254075468101004: "жеті жүз алпыс алты квадриллион екі жүз елу төрт триллион жетпіс бес миллиард төрт жүз алпыс сегіз миллион жүз бір мың төрт теңге", 167602886679935367: "жүз алпыс жеті квадриллион алты жүз екі триллион сегіз жүз сексен алты миллиард алты жүз жетпіс тоғыз миллион тоғыз жүз отыз бес мың үш жүз алпыс жеті теңге", 917958505327553918: "тоғыз жүз он жеті квадриллион тоғыз жүз елу сегіз триллион бес жүз бес миллиард үш жүз жиырма жеті миллион бес жүз елу үш мың тоғыз жүз он сегіз теңге", 897962423839798529: "сегіз жүз тоқсан жеті квадриллион тоғыз жүз алпыс екі триллион төрт жүз жиырма үш миллиард сегіз жүз отыз тоғыз миллион жеті жүз тоқсан сегіз мың бес жүз жиырма тоғыз теңге", 365788677528466135: "үш жүз алпыс бес квадриллион жеті жүз сексен сегіз триллион алты жүз жетпіс жеті миллиард бес жүз жиырма сегіз миллион төрт жүз алпыс алты мың жүз отыз бес теңге", 702440370995353103: "жеті жүз екі квадриллион төрт жүз қырық триллион үш жүз жетпіс миллиард тоғыз жүз тоқсан бес миллион үш жүз елу үш мың жүз үш теңге", 210696831404870559: "екі жүз он квадриллион алты жүз тоқсан алты триллион сегіз жүз отыз бір миллиард төрт жүз төрт миллион сегіз жүз жетпіс мың бес жүз елу тоғыз теңге", 945096143159945505: "тоғыз жүз қырық бес квадриллион тоқсан алты триллион жүз қырық үш миллиард жүз елу тоғыз миллион тоғыз жүз қырық бес мың бес жүз бес теңге", 956168609624737052: "тоғыз жүз елу алты квадриллион жүз алпыс сегіз триллион алты жүз тоғыз миллиард алты жүз жиырма төрт миллион жеті жүз отыз жеті мың елу екі теңге", 133289812612308860: "жүз отыз үш квадриллион екі жүз сексен тоғыз триллион сегіз жүз он екі миллиард алты жүз он екі миллион үш жүз сегіз мың сегіз жүз алпыс теңге", 261143663828461893: "екі жүз алпыс бір квадриллион жүз қырық үш триллион алты жүз алпыс үш миллиард сегіз жүз жиырма сегіз миллион төрт жүз алпыс бір мың сегіз жүз тоқсан үш теңге", 994892980334485280: "тоғыз жүз тоқсан төрт квадриллион сегіз жүз тоқсан екі триллион тоғыз жүз сексен миллиард үш жүз отыз төрт миллион төрт жүз сексен бес мың екі жүз сексен теңге", 883505399901127009: "сегіз жүз сексен үш квадриллион бес жүз бес триллион үш жүз тоқсан тоғыз миллиард тоғыз жүз бір миллион жүз жиырма жеті мың тоғыз теңге", 109197634608380790: "жүз тоғыз квадриллион жүз тоқсан жеті триллион алты жүз отыз төрт миллиард алты жүз сегіз миллион үш жүз сексен мың жеті жүз тоқсан теңге", 307301814274968271: "үш жүз жеті квадриллион үш жүз бір триллион сегіз жүз он төрт миллиард екі жүз жетпіс төрт миллион тоғыз жүз алпыс сегіз мың екі жүз жетпіс бір теңге", 325226486717242071: "үш жүз жиырма бес квадриллион екі жүз жиырма алты триллион төрт жүз сексен алты миллиард жеті жүз он жеті миллион екі жүз қырық екі мың жетпіс бір теңге", 390985064091868927: "үш жүз тоқсан квадриллион тоғыз жүз сексен бес триллион алпыс төрт миллиард тоқсан бір миллион сегіз жүз алпыс сегіз мың тоғыз жүз жиырма жеті теңге", 615903161636752778: "алты жүз он бес квадриллион тоғыз жүз үш триллион жүз алпыс бір миллиард алты жүз отыз алты миллион жеті жүз елу екі мың жеті жүз жетпіс сегіз теңге", 192204423060223577: "жүз тоқсан екі квадриллион екі жүз төрт триллион төрт жүз жиырма үш миллиард алпыс миллион екі жүз жиырма үш мың бес жүз жетпіс жеті теңге", 3274301798916126: "үш квадриллион екі жүз жетпіс төрт триллион үш жүз бір миллиард жеті жүз тоқсан сегіз миллион тоғыз жүз он алты мың жүз жиырма алты теңге", 110438963736102907: "жүз он квадриллион төрт жүз отыз сегіз триллион тоғыз жүз алпыс үш миллиард жеті жүз отыз алты миллион жүз екі мың тоғыз жүз жеті теңге", 167043013847985813: "жүз алпыс жеті квадриллион қырық үш триллион он үш миллиард сегіз жүз қырық жеті миллион тоғыз жүз сексен бес мың сегіз жүз он үш теңге", 583866557904755600: "бес жүз сексен үш квадриллион сегіз жүз алпыс алты триллион бес жүз елу жеті миллиард тоғыз жүз төрт миллион жеті жүз елу бес мың алты жүз теңге", 977247464033137654: "тоғыз жүз жетпіс жеті квадриллион екі жүз қырық жеті триллион төрт жүз алпыс төрт миллиард отыз үш миллион жүз отыз жеті мың алты жүз елу төрт теңге", 832284785057363698: "сегіз жүз отыз екі квадриллион екі жүз сексен төрт триллион жеті жүз сексен бес миллиард елу жеті миллион үш жүз алпыс үш мың алты жүз тоқсан сегіз теңге", 258441301725663874: "екі жүз елу сегіз квадриллион төрт жүз қырық бір триллион үш жүз бір миллиард жеті жүз жиырма бес миллион алты жүз алпыс үш мың сегіз жүз жетпіс төрт теңге", }
<gh_stars>0 const defaultState = { notifications: [] }; export default (state = defaultState, action) => { switch (action.type) { case 'ENQUEUE_SNACKBAR': return { notifications: state.notifications.concat(action.notification) }; case 'REMOVE_SNACKBAR': return { notifications: state.notifications.filter(notification => notification.key !== action.key ) }; default: return state; } };
source ../../../../../settings64_vivado.sh make clean make
DROP FUNCTION refresh_recent_crate_downloads(); DROP INDEX recent_crate_downloads_crate_id; DROP MATERIALIZED VIEW recent_crate_downloads;
import re # Define a class to represent a field descriptor class FieldDescriptor: def __init__(self, name, full_name, index, number, type, default_value): self.name = name self.full_name = full_name self.index = index self.number = number self.type = type self.default_value = default_value # Parse the given field descriptors and extract information def parse_field_descriptors(field_descriptors): parsed_fields = [] for descriptor in field_descriptors: name = re.search(r"name='(.*?)'", descriptor).group(1) full_name = re.search(r'full_name=\'(.*?)\'', descriptor).group(1) index = int(re.search(r'index=(\d+)', descriptor).group(1)) number = int(re.search(r'number=(\d+)', descriptor).group(1)) type = int(re.search(r'type=(\d+)', descriptor).group(1)) default_value_match = re.search(r'default_value=(.*?)(,|\))', descriptor) default_value = default_value_match.group(1) if default_value_match else None parsed_fields.append(FieldDescriptor(name, full_name, index, number, type, default_value)) return parsed_fields # Example usage field_descriptors = [ "_descriptor.FieldDescriptor(name='zip', full_name='v3.asset.ip.v4.geolocation.Message.zip', index=10, number=12, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b('').decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR)", "_descriptor.FieldDescriptor(name='latitude', full_name='v3.asset.ip.v4.geolocation.Message.latitude', index=11, number=13, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None)" ] parsed_fields = parse_field_descriptors(field_descriptors) # Output the extracted information for field in parsed_fields: print(f"Name: {field.name}") print(f"Full Name: {field.full_name}") print(f"Index: {field.index}") print(f"Number: {field.number}") print(f"Type: {field.type}") print(f"Default Value: {field.default_value}\n")
import React, { Component } from 'react'; export default class Loading extends Component { render() { return ( <div id="Loading"> <div className="better better-title">Loading...</div> </div> ); } }
# SHORTHAND alias hard="git reset --hard" alias soft="git reset --hard" alias stash="git stash -u" alias unstash="git stash pop" alias clone="git clone --recursive" alias remote="git remote -v" origin_set(){ git remote remove origin 2> /dev/null git remote add origin $@ git remote -v } tag_delete(){ git tag -d $1 git push origin :refs/tags/$1 } git_rebase(){ git rebase -S $@ } git_update(){ # update from arg or current branch local branch if (( $# > 0 ));then echo "update from from origin/$@" git fetch -v git_rebase origin/$@ return 0 fi if branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null); then if [[ "$branch" == "HEAD" ]]; then echo "Error: Cannot update from detached state." return 1 fi echo "update from from origin/$branch" git fetch -v git_rebase origin/$branch return 0 else echo "Error: Not a git repository" return 1 fi } git_log(){ git log --graph --pretty=format:'%C(bold blue)%h%Creset %C(cyan)[%cr] %C(magenta)%an%Creset - %Creset%s%C(yellow)%d%Creset' --abbrev-commit } # push to current branch with args # TODO: refacotr git_push and git_push_upstream to use a helper fn git_push() { local branch if branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null); then if [[ "$branch" == "HEAD" ]]; then echo "Error: Cannot push from detached state." return 1 fi echo "Pushing to $branch $@" git push origin $branch $@ -v --follow-tags return 0 else echo "Error: Not a git repository" return 1 fi } # pull from arg or current branch git_pull() { local branch if (( $# > 0 ));then echo "Pulling from $@" git pull origin $@ -v return 0 fi if branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null); then if [[ "$branch" == "HEAD" ]]; then echo "Error: Cannot pull from detached state." return 1 fi echo "Pulling from $branch" git pull origin $branch -v return 0 else echo "Error: Not a git repository" return 1 fi } git_commit(){ git commit -S "$@" && git verify-commit HEAD } git_commit_message(){ git_commit -m "$(echo $@)" } git_tag(){ if (( $# < 1 ));then return 1 elif (( $# > 1 ));then git tag -a -s $@ return 0 else git tag -s -a $@ && git verify-tag $1 return 0 fi } git_branch(){ if (( $# < 1 ));then git branch -av return 0 else git branch "$@" fi } git_push_upstream() { local branch if branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null); then if [[ "$branch" == "HEAD" ]]; then echo "Error: Cannot push from detached state." return 1 fi echo "Pushing to $branch $@" git push upstream $branch $@ -v return 0 else echo "Error: Not a git repository" return 1 fi } # pull from arg or current branch git_pull_upstream() { local branch if (( $# > 0 ));then echo "Pulling from $@" git pull upstream $@ -v return 0 fi if branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null); then if [[ "$branch" == "HEAD" ]]; then echo "Error: Cannot pull from detached state." return 1 fi echo "Pulling from $branch" git pull upstream $branch -v return 0 else echo "Error: Not a git repository" return 1 fi }
#!/bin/bash set -e echo This will overwrite any existing repository git hooks you currently have read -n 1 -r -p "Do you want to continue? " choice echo case "$choice" in y|Y) echo "Installing hooks" rm -rf "$(git rev-parse --show-toplevel)/.git/hooks" ln -s "../scripts/hooks" "$(git rev-parse --show-toplevel)/.git/hooks" ;; *) echo "Exiting..." esac
#!/bin/bash exec >installCAPI.log exec 2>&1 sudo apt-get update sudo sed -i "s/PasswordAuthentication no/PasswordAuthentication yes/" /etc/ssh/sshd_config sudo adduser staginguser --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password sudo echo "staginguser:ArcPassw0rd" | sudo chpasswd # Injecting environment variables from Azure deployment echo '#!/bin/bash' >> vars.sh echo $adminUsername:$1 | awk '{print substr($1,2); }' >> vars.sh echo $SPN_CLIENT_ID:$2 | awk '{print substr($1,2); }' >> vars.sh echo $SPN_CLIENT_SECRET:$3 | awk '{print substr($1,2); }' >> vars.sh echo $SPN_TENANT_ID:$4 | awk '{print substr($1,2); }' >> vars.sh echo $vmName:$5 | awk '{print substr($1,2); }' >> vars.sh echo $location:$6 | awk '{print substr($1,2); }' >> vars.sh echo $stagingStorageAccountName:$7 | awk '{print substr($1,2); }' >> vars.sh echo $logAnalyticsWorkspace:$8 | awk '{print substr($1,2); }' >> vars.sh echo $arcK8sClusterName:$9 | awk '{print substr($1,2); }' >> vars.sh echo $templateBaseUrl:${10} | awk '{print substr($1,2); }' >> vars.sh sed -i '2s/^/export adminUsername=/' vars.sh sed -i '3s/^/export SPN_CLIENT_ID=/' vars.sh sed -i '4s/^/export SPN_CLIENT_SECRET=/' vars.sh sed -i '5s/^/export SPN_TENANT_ID=/' vars.sh sed -i '6s/^/export vmName=/' vars.sh sed -i '7s/^/export location=/' vars.sh sed -i '8s/^/export stagingStorageAccountName=/' vars.sh sed -i '9s/^/export logAnalyticsWorkspace=/' vars.sh sed -i '10s/^/export arcK8sClusterName=/' vars.sh sed -i '11s/^/export templateBaseUrl=/' vars.sh chmod +x vars.sh . ./vars.sh # Creating login message of the day (motd) sudo curl -o /etc/profile.d/welcomeCAPI.sh ${templateBaseUrl}artifacts/welcomeCAPI.sh # Syncing this script log to 'jumpstart_logs' directory for ease of troubleshooting sudo -u $adminUsername mkdir -p /home/${adminUsername}/jumpstart_logs while sleep 1; do sudo -s rsync -a /var/lib/waagent/custom-script/download/0/installCAPI.log /home/${adminUsername}/jumpstart_logs/installCAPI.log; done & # Installing Azure CLI & Azure Arc extensions curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash sudo -u $adminUsername az extension add --name connectedk8s sudo -u $adminUsername az extension add --name k8s-configuration sudo -u $adminUsername az extension add --name k8s-extension echo "Log in to Azure" sudo -u $adminUsername az login --service-principal --username $SPN_CLIENT_ID --password $SPN_CLIENT_SECRET --tenant $SPN_TENANT_ID subscriptionId=$(sudo -u $adminUsername az account show --query id --output tsv) export AZURE_RESOURCE_GROUP=$(sudo -u $adminUsername az resource list --query "[?name=='$stagingStorageAccountName']".[resourceGroup] --resource-type "Microsoft.Storage/storageAccounts" -o tsv) az -v echo "" # Installing snap sudo apt install snapd # Installing Docker sudo snap install docker sudo groupadd docker sudo usermod -aG docker $adminUsername # Installing kubectl sudo snap install kubectl --classic # Installing kustomize sudo snap install kustomize # Set CAPI deployment environment variables export CLUSTERCTL_VERSION="1.1.3" # Do not change! export CAPI_PROVIDER="azure" # Do not change! export CAPI_PROVIDER_VERSION="1.2.1" # Do not change! export AZURE_ENVIRONMENT="AzurePublicCloud" # Do not change! export KUBERNETES_VERSION="1.22.8" # Do not change! export CONTROL_PLANE_MACHINE_COUNT="1" export WORKER_MACHINE_COUNT="3" export AZURE_LOCATION=$location # Name of the Azure datacenter location. export CLUSTER_NAME=$(echo "${arcK8sClusterName,,}") # Converting to lowercase case variable > # Name of the CAPI workload cluster. Must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*') export AZURE_SUBSCRIPTION_ID=$subscriptionId export AZURE_TENANT_ID=$SPN_TENANT_ID export AZURE_CLIENT_ID=$SPN_CLIENT_ID export AZURE_CLIENT_SECRET=$SPN_CLIENT_SECRET export AZURE_CONTROL_PLANE_MACHINE_TYPE="Standard_D4s_v4" export AZURE_NODE_MACHINE_TYPE="Standard_D8s_v4" # Base64 encode the variables - Do not change! export AZURE_SUBSCRIPTION_ID_B64="$(echo -n "$subscriptionId" | base64 | tr -d '\n')" export AZURE_TENANT_ID_B64="$(echo -n "$SPN_TENANT_ID" | base64 | tr -d '\n')" export AZURE_CLIENT_ID_B64="$(echo -n "$SPN_CLIENT_ID" | base64 | tr -d '\n')" export AZURE_CLIENT_SECRET_B64="$(echo -n "$SPN_CLIENT_SECRET" | base64 | tr -d '\n')" # Settings needed for AzureClusterIdentity used by the AzureCluster export AZURE_CLUSTER_IDENTITY_SECRET_NAME="cluster-identity-secret" export CLUSTER_IDENTITY_NAME="cluster-identity" export AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE="default" # Installing Rancher K3s single node cluster using k3sup echo "" sudo mkdir ~/.kube sudo -u $adminUsername mkdir /home/${adminUsername}/.kube curl -sLS https://get.k3sup.dev | sh sudo k3sup install --local --context arcdatacapimgmt --k3s-extra-args '--no-deploy traefik' sudo chmod 644 /etc/rancher/k3s/k3s.yaml sudo cp kubeconfig ~/.kube/config sudo cp kubeconfig /home/${adminUsername}/.kube/config sudo cp /var/lib/waagent/custom-script/download/0/kubeconfig /home/${adminUsername}/.kube/config-mgmt sudo cp kubeconfig /home/${adminUsername}/.kube/config.staging sudo chown -R $adminUsername /home/${adminUsername}/.kube/ sudo chown -R staginguser /home/${adminUsername}/.kube/config.staging export KUBECONFIG=/var/lib/waagent/custom-script/download/0/kubeconfig kubectl config set-context arcdatacapimgmt # Installing clusterctl echo "" curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/v${CLUSTERCTL_VERSION}/clusterctl-linux-amd64 -o clusterctl sudo chmod +x ./clusterctl sudo mv ./clusterctl /usr/local/bin/clusterctl clusterctl version # Installing Helm 3 echo "" sudo snap install helm --classic echo "" echo "Making sure Rancher K3s cluster is ready..." echo "" sudo kubectl wait --for=condition=Available --timeout=60s --all deployments -A >/dev/null sudo kubectl get nodes -o wide | expand | awk 'length($0) > length(longest) { longest = $0 } { lines[NR] = $0 } END { gsub(/./, "=", longest); print "/=" longest "=\\"; n = length(longest); for(i = 1; i <= NR; ++i) { printf("| %s %*s\n", lines[i], n - length(lines[i]) + 1, "|"); } print "\\=" longest "=/" }' echo "" # Creating a secret to include the password of the Service Principal identity created in Azure # This secret will be referenced by the AzureClusterIdentity used by the AzureCluster kubectl create secret generic "${AZURE_CLUSTER_IDENTITY_SECRET_NAME}" --from-literal=clientSecret="${AZURE_CLIENT_SECRET}" # Converting the Rancher K3s cluster to a Cluster API management cluster echo "Converting the Kubernetes cluster to a management cluster with the Cluster API Azure Provider (CAPZ)..." clusterctl init --infrastructure=azure:v${CAPI_PROVIDER_VERSION} echo "Making sure cluster is ready..." echo "" sudo kubectl wait --for=condition=Available --timeout=60s --all deployments -A >/dev/null echo "" # Creating CAPI Workload cluster yaml manifest echo "Deploying Kubernetes workload cluster" echo "" sudo curl -o capz_kustomize/patches/AzureCluster.yaml --create-dirs ${templateBaseUrl}artifacts/capz_kustomize/patches/AzureCluster.yaml sudo curl -o capz_kustomize/patches/Cluster.yaml ${templateBaseUrl}artifacts/capz_kustomize/patches/Cluster.yaml sudo curl -o capz_kustomize/patches/KubeadmControlPlane.yaml ${templateBaseUrl}artifacts/capz_kustomize/patches/KubeadmControlPlane.yaml sudo curl -o capz_kustomize/kustomization.yaml ${templateBaseUrl}artifacts/capz_kustomize/kustomization.yaml sed -e "s|CAPI_PROVIDER_VERSION|v$CAPI_PROVIDER_VERSION|" -i capz_kustomize/kustomization.yaml kubectl kustomize capz_kustomize/ > jumpstart.yaml clusterctl generate yaml --from jumpstart.yaml > template.yaml # Creating Microsoft Defender for Cloud audit secret echo "" echo "Creating Microsoft Defender for Cloud audit secret" echo "" curl -o audit.yaml https://raw.githubusercontent.com/Azure/Azure-Security-Center/master/Pricing%20%26%20Settings/Defender%20for%20Kubernetes/audit-policy.yaml cat <<EOF | kubectl apply -f - apiVersion: v1 kind: Secret metadata: name: audit type: Opaque data: audit.yaml: $(cat "audit.yaml" | base64 -w0) username: $(echo -n "jumpstart" | base64 -w0) EOF # Deploying CAPI Workload cluster echo "" sudo kubectl apply -f template.yaml echo "" until sudo kubectl get cluster --all-namespaces | grep -q "Provisioned"; do echo "Waiting for Kubernetes control plane to be in Provisioned phase..." && sleep 20 ; done echo "" sudo kubectl get cluster --all-namespaces echo "" until sudo kubectl get kubeadmcontrolplane --all-namespaces | grep -q "true"; do echo "Waiting for control plane to initialize. This may take a few minutes..." && sleep 20 ; done echo "" sudo kubectl get kubeadmcontrolplane --all-namespaces clusterctl get kubeconfig $CLUSTER_NAME > $CLUSTER_NAME.kubeconfig echo "" sudo kubectl --kubeconfig=./$CLUSTER_NAME.kubeconfig apply -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/main/templates/addons/calico.yaml echo "" CLUSTER_TOTAL_MACHINE_COUNT=`expr $CONTROL_PLANE_MACHINE_COUNT + $WORKER_MACHINE_COUNT` export CLUSTER_TOTAL_MACHINE_COUNT="$(echo $CLUSTER_TOTAL_MACHINE_COUNT)" until [[ $(sudo kubectl --kubeconfig=./$CLUSTER_NAME.kubeconfig get nodes | grep -c -w "Ready") == $CLUSTER_TOTAL_MACHINE_COUNT ]]; do echo "Waiting all nodes to be in Ready state. This may take a few minutes..." && sleep 30 ; done 2> /dev/null echo "" sudo kubectl --kubeconfig=./$CLUSTER_NAME.kubeconfig label node -l '!node-role.kubernetes.io/master' node-role.kubernetes.io/worker=worker echo "" sudo kubectl --kubeconfig=./$CLUSTER_NAME.kubeconfig get nodes -o wide | expand | awk 'length($0) > length(longest) { longest = $0 } { lines[NR] = $0 } END { gsub(/./, "=", longest); print "/=" longest "=\\"; n = length(longest); for(i = 1; i <= NR; ++i) { printf("| %s %*s\n", lines[i], n - length(lines[i]) + 1, "|"); } print "\\=" longest "=/" }' # kubeconfig files housekeeping echo "" sudo -u $adminUsername rm -f /home/${adminUsername}/.kube/config.staging clusterctl get kubeconfig $CLUSTER_NAME > /home/${adminUsername}/.kube/config sudo service sshd restart # Creating Storage Class with azure-managed-disk for the CAPI cluster echo "" sudo -u $adminUsername kubectl apply -f ${templateBaseUrl}artifacts/capiStorageClass.yaml # Renaming CAPI cluster context name echo "" sudo -u $adminUsername kubectl config rename-context "$CLUSTER_NAME-admin@$CLUSTER_NAME" "arcdata-capi" # Onboarding the cluster to Azure Arc echo "" workspaceResourceId=$(sudo -u $adminUsername az resource show --resource-group $AZURE_RESOURCE_GROUP --name $logAnalyticsWorkspace --resource-type "Microsoft.OperationalInsights/workspaces" --query id -o tsv) sudo -u $adminUsername az connectedk8s connect --name $arcK8sClusterName --resource-group $AZURE_RESOURCE_GROUP --location $location --tags 'Project=jumpstart_azure_arc_data_services' # Enabling Azure Policy for Kubernetes on the cluster echo "" sudo -u $adminUsername az k8s-extension create --name "arc-azurepolicy" --cluster-name $arcK8sClusterName --resource-group $AZURE_RESOURCE_GROUP --cluster-type connectedClusters --extension-type Microsoft.PolicyInsights # Installing Container Insights and Microsoft Defender for Containers cluster extensions echo "" sudo -u $adminUsername az k8s-extension create --name "azuremonitor-containers" --cluster-name $arcK8sClusterName --resource-group $AZURE_RESOURCE_GROUP --cluster-type connectedClusters --extension-type Microsoft.AzureMonitor.Containers --configuration-settings logAnalyticsWorkspaceResourceID=$workspaceResourceId echo "" sudo -u $adminUsername az k8s-extension create -n "azure-defender" --cluster-name $arcK8sClusterName --resource-group $AZURE_RESOURCE_GROUP --cluster-type connectedClusters --extension-type Microsoft.AzureDefender.Kubernetes --configuration-settings logAnalyticsWorkspaceResourceID=$workspaceResourceId --debug # Copying workload CAPI kubeconfig file to staging storage account echo "" sudo -u $adminUsername az extension add --upgrade -n storage-preview storageAccountRG=$(sudo -u $adminUsername az storage account show --name $stagingStorageAccountName --query 'resourceGroup' | sed -e 's/^"//' -e 's/"$//') storageContainerName="staging-capi" export localPath="/home/${adminUsername}/.kube/config" storageAccountKey=$(sudo -u $adminUsername az storage account keys list --resource-group $storageAccountRG --account-name $stagingStorageAccountName --query [0].value | sed -e 's/^"//' -e 's/"$//') sudo -u $adminUsername az storage container create -n $storageContainerName --account-name $stagingStorageAccountName --account-key $storageAccountKey sudo -u $adminUsername az storage azcopy blob upload --container $storageContainerName --account-name $stagingStorageAccountName --account-key $storageAccountKey --source $localPath # Uploading this script log to staging storage for ease of troubleshooting echo "" log="/home/${adminUsername}/jumpstart_logs/installCAPI.log" sudo -u $adminUsername az storage azcopy blob upload --container $storageContainerName --account-name $stagingStorageAccountName --account-key $storageAccountKey --source $log
<gh_stars>0 package com.common; /** * @program: spring * @ClassName MyImportSelector * @description:$ * @author: 李杰 * @create: 2020-05-24 15:13 * @Version 1.0 **/ public class MyImportSelector { }
#!/bin/sh gcc -c -fpic `xml2-config --cflags --libs` dataHandler.c gcc -shared -o libDataHandle.so dataHandler.o gcc -c `xml2-config --cflags --libs` dataHandler.c ar rs libDataHandle.a dataHandler.o
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2008 <NAME> All rights reserved. # """ """ __version__ = "$Id$" #end_pymotw_header import os import tempfile with tempfile.NamedTemporaryFile() as temp: print 'temp:' print ' ', temp print 'temp.name:' print ' ', temp.name print 'Exists after close:', os.path.exists(temp.name)
#!/bin/bash -i # Author: Jake Crawford # Created: 07 Feb 2022 # Updated: 11 Feb 2022 # Details: Streamlines Sceptre installation based on the installation README # Variables file=$1 target_dir="/opt" sym_name="sceptre" sym_full="$target_dir/$sym_name" sym_target="" sym_internal="/bin/sceptregui" backup_dir="$target_dir/${sym_name:0:3}_backup" bashrc="*.bashrc" exit_status=0 # Pre-checks # - Check for Root access if (($EUID != 0)); then echo "The installer must be run as root/sudo. (Example: sudo ./sceptre_installer.sh sceptre-#.##.#-os-version-info.tar)" exit 1 fi # - Validate file input if (($# == 0)); then read -p "The file to be installed must be specified. Please enter the file now: " $file fi # Installation echo "Beginnning installation of '$sym_name' from '$file'..." # - Sym Link echo "- Checking for old Symbolic Links..." if test -f "$sym_full"; then echo "-- Found old Symbolic Link. Removing..." sym_target=$(readlink $sym_full) rm $sym_full echo "-- Removed old Sym Link '$sym_full'." fi echo "- Checked for old Symbolic Links." # - ID tar extraction method echo "- Identifying tar file extraction method..." target_ext="xf" if [ "$file" == "*.gz" ]; then target_ext="xzf" fi echo "- Identified tar file extraction method '$target_ext'." # - Backup old installations if found echo "- Backing up any old '$sym_name' copies to '$backup_dir'..." if mkdir $backup_dir >/dev/null 2>/dev/null; then echo "-- Backup folder created '$backup_dir'." else echo "-- Backup folder '$backup_dir' already exists." fi if mv $target_dir/*${sym_name}* $backup_dir/ >/dev/null 2>/dev/null; then echo "-- Moved old '${sym_name}' copies." else echo "-- No old '${sym_name}' copies found." fi echo "- Backup complete." # - Extact tar file echo "- Extracting tar file..." if tar -$target_ext $file -C $target_dir; then sym_target="$(ls -t $target_dir | grep ${sym_name} | head -1)" echo "- Extracted tar file to '${target_dir}/$sym_target'." else echo "- Extraction failed." echo "- Replacing backups..." mv $backup_dir/* $target_dir echo "- Replaced backups." exit_status=1 fi # - Create Symbolic Link echo "- Creating sym link at '$sym_full'..." ln -s ${sym_target}${sym_internal} $sym_full chmod 777 $sym_full echo "- Created sym link." # - Check PATH for Target Directory echo "- Checking if '$target_dir' is on PATH '$PATH'..." addToPath () { cur_bashrc=$(find $1 -maxdepth 1 -name "$bashrc" -type f) path_add="export PATH=$PATH:${target_dir}" if [ ! "$(grep "export PATH=" $cur_bashrc | grep "${target_dir}")" ]; then echo "-- No '${target_dir}' on PATH for '$cur_bashrc'. Adding..." echo $path_add >> $cur_bashrc source $cur_bashrc if [[ $PATH != *":${target_dir}"* ]]; then echo "-- Add failed." exit_status=1 else echo "-- Added '$target_dir' to file '$cur_bashrc' PATH '$PATH'." fi else echo "-- Found '${target_dir}' on PATH for '$cur_bashrc'." fi } addToPath /etc/ addToPath ~/ for dir in /home/*/; do addToPath $dir done echo "- Checked for '$target_dir' on PATH." # Finalize Installation completion="complete!" if [ $exit_status == 1 ]; then completion="failed." else echo "- Removing old copies of '$sym_name'..." if rm -rf $backup_dir >/dev/null 2>/dev/null; then echo "- Removed old copies of '$sym_name'." else echo "- Failed to remove old copies of '$sym_name'. (Possibly due to a fresh install with no backups.)" fi echo "Current version: $($sym_name --version)" echo "Runnable with command: ${sym_name}" echo "(May require a new terminal for PATH changes to take effect.)" fi echo "Installation of '$file' $completion" exit $exit_status
<gh_stars>0 // importando dados dos filmes contidos em filme.json (coloquem eles na pasta raiz) const filmes = require("./filmes.json"); // transformando o objeto filmes em uma array para ter acesso ao metodos map, filter, reduce, etc let listaDeFilmes = Array.from(filmes); // dica: criem as funções de callback separadas e não dentro dos métodos para facilitar o racíocinio, // além de, praticar um pouco a criação de funções em JS // 1. gere uma lista com todos os filmes contendo a quantidade de atores no elenco (map) // 2. gere uma lista com todos os gêneros de filmes que existem na lista de filmes (map) // 3. liste os filmes em que o Clark de 38 anos trabalhou (filter) // 4. liste os filmes que possuem duração maior que 130 minutos (filter) // 5. quantos filmes duram menos que 110 minutos? (reduce) // 6. qual é o filme com maior elenco? (reduce)
def is_even(num): # check if the number is divisible by 2 if num % 2 == 0: return True else: return False if __name__ == '__main__': num = 7 print(is_even(num)) # Output: False
import { authorize, val } from "plumier" import { Column, Entity, ManyToOne } from "typeorm" import { EntityBase } from "../../_shared/entity-base" import { User } from "../users/users-entity" @Entity() export class Image extends EntityBase { @val.required() @Column() name: string @authorize.readonly() @Column() mimeType: string @authorize.readonly() @Column() size: number @authorize.readonly() @ManyToOne(x => User) owner: User @authorize.readonly() @Column() url: string }
/* * Copyright 2002 Sun Microsystems, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistribution 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 Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * * You acknowledge that Software is not designed, licensed or intended * for use in the design, construction, operation or maintenance of * any nuclear facility. */ package com.sun.j2ee.blueprints.xmldocuments; import java.io.*; import java.net.URL; import java.util.Properties; import java.util.Locale; import javax.xml.parsers.*; import org.w3c.dom.*; import org.xml.sax.*; import org.xml.sax.helpers.*; import javax.xml.transform.*; import javax.xml.transform.dom.*; import javax.xml.transform.sax.*; import javax.xml.transform.stream.*; public final class XMLDocumentUtils { public static final String DEFAULT_ENCODING = "UTF-8"; public static final String SCHEMAS_DIRECTORY_PATH = "/com/sun/j2ee/blueprints/xmldocuments/rsrc/schemas/"; public static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; public static final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; public static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema"; public static final String W3C_XML_SCHEMA_LOCATION_QNAME = "xsi:schemaLocation"; public static final String W3C_XML_SCHEMA_INSTANCE_NS = "http://www.w3.org/2001/XMLSchema-instance"; public static final String SAX_NS_PREFIXES = "http://xml.org/sax/features/namespace-prefixes"; private XMLDocumentUtils() {} public static String getAttribute(Element element, String name, boolean optional) throws XMLDocumentException { String value = element.getAttribute(name); if (value == null && !optional) { throw new XMLDocumentException("Attribute " + name + " of " + element.getTagName() + " expected."); } return value; } public static String getAttributeAsString(Element element, String name, boolean optional) throws XMLDocumentException { return getAttribute(element, name, optional); } public static int getAttributeAsInt(Element element, String name, boolean optional) throws XMLDocumentException { try { return Integer.parseInt(getAttribute(element, name, optional)); } catch (NumberFormatException exception) { throw new XMLDocumentException(element.getTagName() + "/@" + name + " attribute: value format error.", exception); } } public static Element getFirstChild(Element element, String name, boolean optional) throws XMLDocumentException { for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) { if (child.getNodeType() == Node.ELEMENT_NODE) { if (((Element) child).getTagName().equals(name)) { return (Element) child; } break; } } if (!optional) { throw new XMLDocumentException(name + " element expected as first child of " + element.getTagName() + "."); } return null; } public static Element getChild(Element element, String name, boolean optional) throws XMLDocumentException { for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) { if (child.getNodeType() == Node.ELEMENT_NODE) { if (((Element) child).getTagName().equals(name)) { return (Element) child; } } } if (!optional) { throw new XMLDocumentException(name + " element expected as child of " + element.getTagName() + "."); } return null; } public static Element getSibling(Element element, boolean optional) throws XMLDocumentException { return getSibling(element, element.getTagName(), optional); } public static Element getSibling(Element element, String name, boolean optional) throws XMLDocumentException { for (Node sibling = element.getNextSibling(); sibling != null; sibling = sibling.getNextSibling()) { if (sibling.getNodeType() == Node.ELEMENT_NODE) { if (((Element) sibling).getTagName().equals(name)) { return (Element) sibling; } } } if (!optional) { throw new XMLDocumentException(name + " element expected after " + element.getTagName() + "."); } return null; } public Element getNextSibling(Element element, boolean optional) throws XMLDocumentException { return getNextSibling(element, element.getTagName(), optional); } public static Element getNextSibling(Element element, String name, boolean optional) throws XMLDocumentException { for (Node sibling = element.getNextSibling(); sibling != null; sibling = sibling.getNextSibling()) { if (sibling.getNodeType() == Node.ELEMENT_NODE) { if (((Element) sibling).getTagName().equals(name)) { return (Element) sibling; } break; } } if (!optional) { throw new XMLDocumentException(name + " element expected after " + element.getTagName() + "."); } return null; } public static String getContent(Element element, boolean optional) throws XMLDocumentException { StringBuffer buffer = new StringBuffer(); for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) { if (child.getNodeType() == Node.TEXT_NODE || child.getNodeType() == Node.CDATA_SECTION_NODE) { try { buffer.append(((Text) child).getData()); } catch (DOMException e) {} } } if (!optional && buffer.length() == 0) { throw new XMLDocumentException(element.getTagName() + " element: content expected."); } return buffer.toString(); } public static String getContentAsString(Element element, boolean optional) throws XMLDocumentException { return getContent(element, optional); } public static int getContentAsInt(Element element, boolean optional) throws XMLDocumentException { try { return Integer.parseInt(getContent(element, optional)); } catch (NumberFormatException exception) { throw new XMLDocumentException(element.getTagName() + " element: content format error.", exception); } } public static float getContentAsFloat(Element element, boolean optional) throws XMLDocumentException { try { return Float.parseFloat(getContent(element, optional)); } catch (NumberFormatException exception) { throw new XMLDocumentException(element.getTagName() + " element: content format error.", exception); } } public static String getAttributeNS(Element element, String nsURI, String name, boolean optional) throws XMLDocumentException { String value = element.getAttributeNS(nsURI, name); if (value == null && !optional) { throw new XMLDocumentException("Attribute " + name + " of " + element.getTagName() + " expected."); } return value; } public static String getAttributeAsStringNS(Element element, String nsURI, String name, boolean optional) throws XMLDocumentException { return getAttributeNS(element, nsURI, name, optional); } public static int getAttributeAsIntNS(Element element, String nsURI, String name, boolean optional) throws XMLDocumentException { try { return Integer.parseInt(getAttributeNS(element, nsURI, name, optional)); } catch (NumberFormatException exception) { throw new XMLDocumentException(element.getTagName() + "/@" + name + " attribute: value format error.", exception); } } public static Element getFirstChildNS(Element element, String nsURI, String name, boolean optional) throws XMLDocumentException { for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) { if (child.getNodeType() == Node.ELEMENT_NODE) { if (((Element) child).getLocalName().equals(name) && ((Element) child).getNamespaceURI().equals(nsURI)) { return (Element) child; } break; } } if (!optional) { throw new XMLDocumentException(name + " element expected as first child of " + element.getTagName() + "."); } return null; } public static Element getChildNS(Element element, String nsURI, String name, boolean optional) throws XMLDocumentException { for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) { if (child.getNodeType() == Node.ELEMENT_NODE) { if (((Element) child).getLocalName().equals(name) && ((Element) child).getNamespaceURI().equals(nsURI)) { return (Element) child; } } } if (!optional) { throw new XMLDocumentException(name + " element expected as child of " + element.getTagName() + "."); } return null; } public static Element getSiblingNS(Element element, boolean optional) throws XMLDocumentException { return getSiblingNS(element, element.getNamespaceURI(), element.getLocalName(), optional); } public static Element getSiblingNS(Element element, String nsURI, String name, boolean optional) throws XMLDocumentException { for (Node sibling = element.getNextSibling(); sibling != null; sibling = sibling.getNextSibling()) { if (sibling.getNodeType() == Node.ELEMENT_NODE) { if (((Element) sibling).getLocalName().equals(name) && ((Element) sibling).getNamespaceURI().equals(nsURI)) { return (Element) sibling; } } } if (!optional) { throw new XMLDocumentException(name + " element expected after " + element.getTagName() + "."); } return null; } public Element getNextSiblingNS(Element element, boolean optional) throws XMLDocumentException { return getNextSiblingNS(element, element.getNamespaceURI(), element.getLocalName(), optional); } public static Element getNextSiblingNS(Element element, String nsURI, String name, boolean optional) throws XMLDocumentException { for (Node sibling = element.getNextSibling(); sibling != null; sibling = sibling.getNextSibling()) { if (sibling.getNodeType() == Node.ELEMENT_NODE) { if (((Element) sibling).getLocalName().equals(name) && ((Element) sibling).getNamespaceURI().equals(nsURI)) { return (Element) sibling; } break; } } if (!optional) { throw new XMLDocumentException(name + " element expected after " + element.getTagName() + "."); } return null; } public static Element createElement(Document document, String name, String value) { if (value != null) { Element element = (Element) document.createElement(name); element.appendChild(document.createTextNode(value)); return element; } throw new IllegalArgumentException("XMLDocumentUtils.createElement: value of " + name + " element can't be null."); } public static Element createElement(Document document, String name, long value) { return createElement(document, name, Long.toString(value)); } public static Element createElement(Document document, String name, float value) { return createElement(document, name, Float.toString(value)); } public static Element createElement(Document document, String name, Element child) { Element element = (Element) document.createElement(name); element.appendChild(child); return element; } public static void appendChild(Document document, Node root, String name, String value) { Node node = document.createElement(name); node.appendChild(document.createTextNode(value != null ? value : "")); root.appendChild(node); return; } public static void appendChild(Document document, Node root, String name, long value) { appendChild(document, root, name, Long.toString(value)); return; } public static void appendChild(Document document, Node root, String name, float value) { appendChild(document, root, name, Float.toString(value)); return; } public static void appendChild(Node root, String name, String value) { appendChild(root.getOwnerDocument(), root, name, value); return; } public static Element createElement(Document document, String nsURI, String name, String value) { if (value != null) { Element element = (Element) document.createElementNS(nsURI, name); element.appendChild(document.createTextNode(value != null ? value : "")); return element; } throw new IllegalArgumentException("XMLDocumentUtils.createElement: value of " + name + " element can't be null."); } public static Element createElement(Document document, String nsURI, String name, long value) { return createElement(document, nsURI, name, Long.toString(value)); } public static Element createElement(Document document, String nsURI, String name, float value) { return createElement(document, nsURI, name, Float.toString(value)); } public static Element createElement(Document document, String nsURI, String name, Element child) { Element element = (Element) document.createElement(name); element.appendChild(child); return element; } public static void appendChild(Document document, Node root, String nsURI, String name, String value) { Node node = document.createElementNS(nsURI, name); node.appendChild(document.createTextNode(value != null ? value : "")); root.appendChild(node); return; } public static void appendChild(Document document, Node root, String nsURI, String name, long value) { appendChild(document, root, nsURI, name, Long.toString(value)); return; } public static void appendChild(Document document, Node root, String nsURI, String name, float value) { appendChild(document, root, nsURI, name, Float.toString(value)); return; } public static void appendChild(Node root, String name, String nsURI, String value) { appendChild(root.getOwnerDocument(), root, nsURI, name, value); return; } public static void serialize(Transformer transformer, Document document, String dtdPublicId, String dtdSystemId, boolean xsdSupport, String encoding, Result result) throws XMLDocumentException { try { transformer.setOutputProperty(OutputKeys.METHOD, "xml"); if (!xsdSupport) { if (dtdSystemId != null) { transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, dtdSystemId); } transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, dtdPublicId); } /*else { Element root = document.getDocumentElement(); root.setAttributeNS(W3C_XML_SCHEMA_INSTANCE_NS, W3C_XML_SCHEMA_LOCATION_QNAME, dtdPublicId + " " + dtdSystemId); }*/ transformer.setOutputProperty(OutputKeys.ENCODING, encoding); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.transform(new DOMSource(document), result); } catch (Exception exception) { exception.printStackTrace(System.err); throw new XMLDocumentException(exception); } return; } public static void toXML(Document document, String dtdPublicId, String dtdSystemId, String encoding, Result result) throws XMLDocumentException { serialize(createTransformer(), document, dtdPublicId, dtdSystemId, false, encoding, result); return; } public static void toXML(Document document, String dtdPublicId, String dtdSystemId, Result result) throws XMLDocumentException { toXML(document, dtdPublicId, dtdSystemId, DEFAULT_ENCODING, result); return; } public static void toXML(Document document, String dtdPublicId, URL entityCatalogURL, Result result) throws XMLDocumentException { toXML(document, dtdPublicId, entityCatalogURL, DEFAULT_ENCODING, result); return; } public static void toXML(Document document, String dtdPublicId, URL entityCatalogURL, String encoding, Result result) throws XMLDocumentException { try { CustomEntityResolver entityResolver = new CustomEntityResolver(entityCatalogURL); String dtdSystemId = entityResolver.mapEntityURI(dtdPublicId); toXML(document, dtdPublicId, dtdSystemId, encoding, result); } catch (Exception exception) { exception.printStackTrace(System.err); throw new XMLDocumentException(exception); } return; } public static void toXML(Document document, String dtdPublicId, URL entityCatalogURL, boolean xsdSupport, Result result) throws XMLDocumentException { toXML(document, dtdPublicId, entityCatalogURL, xsdSupport, DEFAULT_ENCODING, result); return; } public static void toXML(Document document, String dtdPublicId, URL entityCatalogURL, boolean xsdSupport, String encoding, Result result) throws XMLDocumentException { try { CustomEntityResolver entityResolver = new CustomEntityResolver(entityCatalogURL); String dtdSystemId = entityResolver.mapEntityURI(dtdPublicId); serialize(createTransformer(), document, dtdPublicId, dtdSystemId, xsdSupport, encoding, result); } catch (Exception exception) { exception.printStackTrace(System.err); throw new XMLDocumentException(exception); } return; } public static Document deserialize(Transformer transformer, Source source, String dtdPublicId, final URL entityCatalogURL, boolean validating, boolean xsdSupport) throws XMLDocumentException { Node node; if (source instanceof DOMSource) { node = ((DOMSource) source).getNode(); } else { node = transform(transformer, source, dtdPublicId, entityCatalogURL, validating, xsdSupport); } Document document; if (node != null && node instanceof Document) { document = (Document) node; } else { throw new XMLDocumentException("Document node required."); } if (!xsdSupport) { if (!XMLDocumentUtils.checkDocumentType(document, dtdPublicId)) { throw new XMLDocumentException("Document not of type: " + dtdPublicId); } } return document; } public static Document transform(Transformer transformer, Source source, String dtdPublicId, URL entityCatalogURL, boolean validating, boolean xsdSupport) throws XMLDocumentException { DOMResult result = new DOMResult(); transform(transformer, source, result, dtdPublicId, entityCatalogURL, validating, xsdSupport); return (Document) result.getNode(); } public static void transform(Transformer transformer, Source source, Result result, String dtdPublicId, URL entityCatalogURL, boolean validating, boolean xsdSupport) throws XMLDocumentException { try { if (!(source instanceof DOMSource)) { if (source.getSystemId() == null) { // Set the base URI to resolve relative URI source.setSystemId(SCHEMAS_DIRECTORY_PATH); } CustomEntityResolver entityResolver = new CustomEntityResolver(entityCatalogURL); SAXSource saxSource = null; if (source instanceof StreamSource) { InputSource inputSource = SAXSource.sourceToInputSource(source); if (inputSource == null) { throw new XMLDocumentException("Can't convert this source."); } saxSource = new SAXSource(inputSource); } else if (source instanceof SAXSource) { saxSource = (SAXSource) source; } XMLReader reader = saxSource.getXMLReader(); if (reader == null) { reader = createParser(validating, xsdSupport, entityResolver, dtdPublicId).getXMLReader(); saxSource.setXMLReader(reader); } source = saxSource; } transformer.transform(source, result); return; } catch (Exception exception) { exception.printStackTrace(System.err); throw new XMLDocumentException(exception); } } public static Document fromXML(Source source, String dtdPublicId, final URL entityCatalogURL, boolean validating) throws XMLDocumentException { return deserialize(createTransformer(), source, dtdPublicId, entityCatalogURL, validating, false); } public static Document fromXML(InputSource source, String dtdPublicId, final URL entityCatalogURL, boolean validating) throws XMLDocumentException { Document document; try { if (source.getSystemId() == null) { // Set the base URI to resolve relative URI source.setSystemId(SCHEMAS_DIRECTORY_PATH); } DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); builderFactory.setValidating(validating); DocumentBuilder builder = builderFactory.newDocumentBuilder(); builder.setErrorHandler(new ErrorHandler() { public void warning(SAXParseException exception) { System.err.println("[Warning]: " + exception.getMessage()); return; } public void error(SAXParseException exception) { System.err.println("[Error]: " + exception.getMessage()); return; } public void fatalError(SAXParseException exception) throws SAXException { System.err.println("[Fatal Error]: " + exception.getMessage()); throw exception; } }); builder.setEntityResolver(new CustomEntityResolver(entityCatalogURL)); document = builder.parse(source); } catch (Exception exception) { throw new XMLDocumentException(exception); } if (!validating || XMLDocumentUtils.checkDocumentType(document, dtdPublicId)) { return document; } throw new XMLDocumentException("Document not of type: " + dtdPublicId); } public static DocumentBuilder createDocumentBuilder() throws XMLDocumentException { try { DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); builderFactory.setNamespaceAware(true); DocumentBuilder builder = builderFactory.newDocumentBuilder(); return builder; } catch (Exception exception) { exception.printStackTrace(System.err); throw new XMLDocumentException(exception); } } public static SAXParser createParser(boolean validating, boolean xsdSupport, URL entityCatalogURL, String schemaURI) throws XMLDocumentException { return createParser(validating, xsdSupport, new CustomEntityResolver(entityCatalogURL), schemaURI); } public static SAXParser createParser(boolean validating, boolean xsdSupport, CustomEntityResolver entityResolver, String schemaURI) throws XMLDocumentException { try { SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setValidating(validating); parserFactory.setNamespaceAware(true); SAXParser parser = parserFactory.newSAXParser(); if (xsdSupport) { try { parser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA); } catch(SAXNotRecognizedException exception) { System.err.println(exception); } try { parser.setProperty(JAXP_SCHEMA_SOURCE, entityResolver.mapEntityURI(schemaURI)); } catch(SAXNotRecognizedException exception) { System.err.println(exception); } } XMLReader reader = parser.getXMLReader(); try { reader.setFeature(SAX_NS_PREFIXES, true); } catch (SAXException exception) {} reader.setErrorHandler(new ErrorHandler() { public void warning(SAXParseException exception) { System.err.println("[Warning]: " + exception.getMessage()); return; } public void error(SAXParseException exception) { System.err.println("[Error]: " + exception.getMessage()); return; } public void fatalError(SAXParseException exception) throws SAXException { System.err.println("[Fatal Error]: " + exception.getMessage()); throw exception; } }); reader.setEntityResolver(entityResolver); return parser; } catch (Exception exception) { exception.printStackTrace(System.err); throw new XMLDocumentException(exception); } } public static Document createDocument() throws XMLDocumentException { return createDocumentBuilder().newDocument(); } public static Transformer createTransformer() throws XMLDocumentException { try { TransformerFactory transformerFactory = TransformerFactory.newInstance(); return transformerFactory.newTransformer(); } catch (Exception exception) { exception.printStackTrace(System.err); throw new XMLDocumentException(exception); } } public static boolean checkDocumentType(Document document, String dtdPublicId) { DocumentType documentType = document.getDoctype(); if (documentType != null) { String publicId = documentType.getPublicId(); return publicId != null && publicId.equals(dtdPublicId); } // System.err.println("Can't check document type: " + dtdPublicId); return true; // false; Due to problem of IdentityTransformer not creating the DocType nodes } /** * Convert a string based locale into a Locale Object * <br> * <br>Strings are formatted: * <br> * <br>language_contry_variant * **/ public static Locale getLocaleFromString(String localeString) { if (localeString == null) { return null; } if (localeString.toLowerCase().equals("default")) { return Locale.getDefault(); } int languageIndex = localeString.indexOf('_'); if (languageIndex == -1) { return null; } int countryIndex = localeString.indexOf('_', languageIndex +1); String country = null; if (countryIndex == -1) { if (localeString.length() > languageIndex) { country = localeString.substring(languageIndex +1, localeString.length()); } else { return null; } } int variantIndex = -1; if (countryIndex != -1) { countryIndex = localeString.indexOf('_', countryIndex +1); } String language = localeString.substring(0, languageIndex); String variant = null; if (variantIndex != -1) { variant = localeString.substring(variantIndex +1, localeString.length()); } if (variant != null) { return new Locale(language, country, variant); } else { return new Locale(language, country); } } }
#!/bin/bash # statTest.sh -- test suite for STAT # # How to run all STAT tests: # # alienv enter AliRoot/latest # load AliRoot environment # cd <AliRoot_Build_Directory> # ctest --output-on-failure -R func_STAT_* # # Or extra verbose: # # ctest --extra-verbose -R func_STAT_* # # Tests output will be printed only in case of failures. source $ALICE_ROOT/libexec/alilog4bash.sh if [[ ! $ALIROOT_SOURCE ]]; then echo "ALIROOT_SOURCE must be defined to the source directory of AliRoot." exit 1 fi export ROOT_HIST=0 testAliTreePlayer() { cp $ALIROOT_SOURCE/STAT/test/AliTreePlayerTest.C . root -n -b -l <<\EOF 2>&1 | tee testAliTreePlayer.log gSystem->AddIncludePath("-I$ALICE_ROOT/include"); .x ./AliTreePlayerTest.C+ EOF N_GOOD=$(grep -cE 'AliTreePlayerTest\..*Test.*OK' testAliTreePlayer.log) N_BAD=$(grep -c "E-" testAliTreePlayer.log) TEST_STATUS=0 if [[ $N_GOOD != 4 ]]; then alilog_error "statTest.testAliTreePlayer: Invariant test failed" ((TEST_STATUS++)) fi if [[ $N_BAD != 0 ]]; then alilog_error "statTest.testAliTreePlayer: Invariant test failed" ((TEST_STATUS+=2)) fi if [[ $TEST_STATUS == 0 ]]; then alilog_success "statTest.testAliTreePlayer: All OK" else alilog_error "statTest.testAliTreePlayer: FAILED (code $TEST_STATUS)" fi exit $TEST_STATUS } testAliTMinutiToolkitTestLinear() { cp $ALIROOT_SOURCE/STAT/test/AliTMinuitToolkitTestLinear.C . root -n -b -l <<\EOF 2>&1 | tee testAliTMinutiToolkitTestLinear.log gSystem->AddIncludePath("-I$ALICE_ROOT/include"); .x ./AliTMinuitToolkitTestLinear.C+(50,3) EOF NPDF=$(ls -1 *.pdf | grep -c '\.pdf') if [[ $NPDF == 2 ]]; then alilog_success "statTest.testAliTMinutiToolkitTestLinear: All OK" exit 0 else alilog_error "statTest.testAliTMinutiToolkitTestLinear: FAILED" exit 1 fi } testAliDrawStyleTest() { cp $ALIROOT_SOURCE/STAT/test/AliDrawStyleTest.C . root -n -b -l <<\EOF 2>&1 | tee AliDrawStyleTest.log gSystem->AddIncludePath("-I$ALICE_ROOT/include"); .x ./AliDrawStyleTest.C+ EOF N_GOOD=$(grep -cE 'Ali.*OK' AliDrawStyleTest.log) N_BAD=$(grep -c "E-Ali" AliDrawStyleTest.log) TEST_STATUS=0 if [[ $N_GOOD != 27 ]]; then alilog_error "statTest.AliDrawStyleTest: Test FAILED" ((TEST_STATUS++)) fi if [[ $N_BAD != 0 ]]; then alilog_error "statTest.AliDrawStyleTest: Test FAILED" ((TEST_STATUS+=2)) fi if [[ $TEST_STATUS == 0 ]]; then alilog_success "statTest.AliDrawStyleTest: All OK" else alilog_error "statTest.: FAILED (code $TEST_STATUS)" fi exit $TEST_STATUS } [[ $1 ]] && $1
import React from "react" import { graphql } from "gatsby" import Helmet from "react-helmet" import { Link } from "gatsby" import Layout from "../components/layout" import SEO from "../components/seo" import PostLink from "../components/PostLink" function IndexPage({ data }) { return ( <Layout> <SEO title="Home" /> <Helmet> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8" ></script> </Helmet> <section className="heroBanner"> <h1>Hi, I'm <NAME>.</h1> <h2> I'm a frontend web developer and former attorney. Welcome to my web development blog. Find me <Link to="/me" id="nav-me">around the web</Link>. </h2> </section> <section className="latestPosts"> <h2>Recent Posts</h2> <div className="postLinks"> {data.allMarkdownRemark.edges.slice(0, 5).map(({ node }, i) => ( <PostLink node={node} key={i} /> ))} </div> </section> </Layout> ) } export const query = graphql` query { allMarkdownRemark(sort: { fields: [frontmatter___date], order: DESC }) { totalCount edges { node { id frontmatter { title date(formatString: "DD MMM, YYYY") } fields { slug } } } } } ` export default IndexPage
#!/bin/bash # Copyright 2013-2015 Brno University of Technology (author: Karel Vesely) # 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 # # THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED # WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, # MERCHANTABLITY OR NON-INFRINGEMENT. # See the Apache 2 License for the specific language governing permissions and # limitations under the License. # To be run from ../../ # # Restricted Boltzman Machine (RBM) pre-training by Contrastive Divergence # algorithm (CD-1). A stack of RBMs forms a Deep Belief Neetwork (DBN). # # This script by default pre-trains on plain features (ie. saved fMLLR features), # building a 'feature_transform' containing +/-5 frame splice and global CMVN. # # There is also a support for adding speaker-based CMVN, deltas, i-vectors, # or passing custom 'feature_transform' or its prototype. # # Begin configuration. # topology, initialization, nn_depth=6 # number of hidden layers, hid_dim=2048 # number of neurons per layer, param_stddev_first=0.1 # init parameters in 1st RBM param_stddev=0.1 # init parameters in other RBMs input_vis_type=gauss # type of visible nodes on DBN input # number of iterations, rbm_iter=1 # number of pre-training epochs (Gaussian-Bernoulli RBM has 2x more) # pre-training opts, rbm_lrate=0.4 # RBM learning rate rbm_lrate_low=0.01 # lower RBM learning rate (for Gaussian units) rbm_l2penalty=0.0002 # L2 penalty (increases RBM-mixing rate) rbm_extra_opts= # data processing, copy_feats=true # resave the features to tmpdir, copy_feats_tmproot=/tmp/kaldi.XXXX # sets tmproot for 'copy-feats', # feature processing, splice=5 # (default) splice features both-ways along time axis, cmvn_opts= # (optional) adds 'apply-cmvn' to input feature pipeline, see opts, delta_opts= # (optional) adds 'add-deltas' to input feature pipeline, see opts, ivector= # (optional) adds 'append-vector-to-feats', the option is rx-filename for the 2nd stream, ivector_append_tool=append-vector-to-feats # (optional) the tool for appending ivectors, feature_transform_proto= # (optional) use this prototype for 'feature_transform', feature_transform= # (optional) directly use this 'feature_transform', # misc. verbose=1 # enable per-cache reports skip_cuda_check=false # End configuration. echo "$0 $@" # Print the command line for logging [ -f path.sh ] && . ./path.sh; . parse_options.sh || exit 1; set -euo pipefail if [ $# != 2 ]; then echo "Usage: $0 <data> <exp-dir>" echo " e.g.: $0 data/train exp/rbm_pretrain" echo "main options (for others, see top of script file)" echo " --config <config-file> # config containing options" echo "" echo " --nn-depth <N> # number of RBM layers" echo " --hid-dim <N> # number of hidden units per layer" echo " --rbm-iter <N> # number of CD-1 iterations per layer" echo " # can be used to subsample large datasets" echo " --rbm-lrate <float> # learning-rate for Bernoulli-Bernoulli RBMs" echo " --rbm-lrate-low <float> # learning-rate for Gaussian-Bernoulli RBM" echo "" echo " --cmvn-opts <string> # add 'apply-cmvn' to input feature pipeline" echo " --delta-opts <string> # add 'add-deltas' to input feature pipeline" echo " --splice <N> # splice +/-N frames of input features" echo " --copy-feats <bool> # copy features to /tmp, lowers storage stress" echo "" echo " --feature_transform_proto <file> # use this prototype for 'feature_transform'" echo " --feature-transform <file> # directly use this 'feature_transform'" exit 1; fi data=$1 dir=$2 for f in $data/feats.scp; do [ ! -f $f ] && echo "$0: no such file $f" && exit 1; done echo "# INFO" echo "$0 : Pre-training Deep Belief Network as a stack of RBMs" printf "\t dir : $dir \n" printf "\t Train-set : $data '$(cat $data/feats.scp | wc -l)'\n" echo [ -e $dir/${nn_depth}.dbn ] && echo "$0 Skipping, already have $dir/${nn_depth}.dbn" && exit 0 # check if CUDA compiled in and GPU is available, if ! $skip_cuda_check; then cuda-gpu-available || exit 1; fi mkdir -p $dir/log ###### PREPARE FEATURES ###### echo echo "# PREPARING FEATURES" if [ "$copy_feats" == "true" ]; then # re-save the features to local disk into /tmp/, tmpdir=$(mktemp -d $copy_feats_tmproot) trap "echo \"# Removing features tmpdir $tmpdir @ $(hostname)\"; ls $tmpdir; rm -r $tmpdir" INT QUIT TERM EXIT copy-feats scp:$data/feats.scp ark,scp:$tmpdir/train.ark,$dir/train_sorted.scp || exit 1 else # or copy the list, cp $data/feats.scp $dir/train_sorted.scp fi # shuffle the list, utils/shuffle_list.pl --srand 777 <$dir/train_sorted.scp >$dir/train.scp # create a 10k utt subset for global cmvn estimates, head -n 10000 $dir/train.scp > $dir/train.scp.10k # for debugging, add list with non-local features, utils/shuffle_list.pl --srand 777 <$data/feats.scp >$dir/train.scp_non_local ###### OPTIONALLY IMPORT FEATURE SETTINGS ###### ivector_dim= # no ivectors, if [ ! -z $feature_transform ]; then D=$(dirname $feature_transform) echo "# importing feature settings from dir '$D'" [ -e $D/cmvn_opts ] && cmvn_opts=$(cat $D/cmvn_opts) [ -e $D/delta_opts ] && delta_opts=$(cat $D/delta_opts) [ -e $D/ivector_dim ] && ivector_dim=$(cat $D/ivector_dim) [ -e $D/ivector_append_tool ] && ivector_append_tool=$(cat $D/ivector_append_tool) echo "# cmvn_opts='$cmvn_opts' delta_opts='$delta_opts' ivector_dim='$ivector_dim'" fi ###### PREPARE FEATURE PIPELINE ###### # read the features feats_tr="ark:copy-feats scp:$dir/train.scp ark:- |" # optionally add per-speaker CMVN if [ ! -z "$cmvn_opts" ]; then echo "+ 'apply-cmvn' with '$cmvn_opts' using statistics : $data/cmvn.scp" [ ! -r $data/cmvn.scp ] && echo "Missing $data/cmvn.scp" && exit 1; [ ! -r $data/utt2spk ] && echo "Missing $data/utt2spk" && exit 1; feats_tr="$feats_tr apply-cmvn $cmvn_opts --utt2spk=ark:$data/utt2spk scp:$data/cmvn.scp ark:- ark:- |" else echo "# 'apply-cmvn' not used," fi # optionally add deltas if [ ! -z "$delta_opts" ]; then feats_tr="$feats_tr add-deltas $delta_opts ark:- ark:- |" echo "# + 'add-deltas' with '$delta_opts'" fi # keep track of the config, [ ! -z "$cmvn_opts" ] && echo "$cmvn_opts" >$dir/cmvn_opts [ ! -z "$delta_opts" ] && echo "$delta_opts" >$dir/delta_opts # # get feature dim, feat_dim=$(feat-to-dim "$feats_tr" -) echo "# feature dim : $feat_dim (input of 'feature_transform')" # Now we start building 'feature_transform' which goes right in front of a NN. # The forwarding is computed on a GPU before the frame shuffling is applied. # # Same GPU is used both for 'feature_transform' and the NN training. # So it has to be done by a single process (we are using exclusive mode). # This also reduces the CPU-GPU uploads/downloads to minimum. if [ ! -z "$feature_transform" ]; then echo "# importing 'feature_transform' from '$feature_transform'" tmp=$dir/imported_$(basename $feature_transform) cp $feature_transform $tmp; feature_transform=$tmp else # Make default proto with splice, if [ ! -z $feature_transform_proto ]; then echo "# importing custom 'feature_transform_proto' from : $feature_transform_proto" else echo "+ default 'feature_transform_proto' with splice +/-$splice frames" feature_transform_proto=$dir/splice${splice}.proto echo "<Splice> <InputDim> $feat_dim <OutputDim> $(((2*splice+1)*feat_dim)) <BuildVector> -$splice:$splice </BuildVector>" >$feature_transform_proto fi # Initialize 'feature-transform' from a prototype, feature_transform=$dir/tr_$(basename $feature_transform_proto .proto).nnet nnet-initialize --binary=false $feature_transform_proto $feature_transform # Renormalize the MLP input to zero mean and unit variance, feature_transform_old=$feature_transform feature_transform=${feature_transform%.nnet}_cmvn-g.nnet echo "# compute normalization stats from 10k sentences" nnet-forward --print-args=true --use-gpu=yes $feature_transform_old \ "$(echo $feats_tr | sed 's|train.scp|train.scp.10k|')" ark:- |\ compute-cmvn-stats ark:- $dir/cmvn-g.stats echo "# + normalization of NN-input at '$feature_transform'" nnet-concat --print-args=false --binary=false $feature_transform_old \ "cmvn-to-nnet $dir/cmvn-g.stats -|" $feature_transform fi if [ ! -z $ivector ]; then echo echo "# ADDING IVECTOR FEATURES" # The iVectors are concatenated 'as they are' directly to the input of the neural network, # To do this, we paste the features, and use <ParallelComponent> where the 1st component # contains the transform and 2nd network contains <Copy> component. echo "# getting dims," dim_raw=$(feat-to-dim "$feats_tr" -) dim_raw_and_ivec=$(feat-to-dim "$feats_tr $ivector_append_tool ark:- '$ivector' ark:- |" -) dim_ivec=$((dim_raw_and_ivec - dim_raw)) echo "# dims, feats-raw $dim_raw, ivectors $dim_ivec," # Should we do something with 'feature_transform'? if [ ! -z $ivector_dim ]; then # No, the 'ivector_dim' comes from dir with 'feature_transform' with iVec forwarding, echo "# assuming we got '$feature_transform' with ivector forwarding," [ $ivector_dim != $dim_ivec ] && \ echo -n "Error, i-vector dimensionality mismatch!" && \ echo " (expected $ivector_dim, got $dim_ivec in $ivector)" && exit 1 else # Yes, adjust the transform to do ``iVec forwarding'', feature_transform_old=$feature_transform feature_transform=${feature_transform%.nnet}_ivec_copy.nnet echo "# setting up ivector forwarding into '$feature_transform'," dim_transformed=$(feat-to-dim "$feats_tr nnet-forward $feature_transform_old ark:- ark:- |" -) nnet-initialize --print-args=false <(echo "<Copy> <InputDim> $dim_ivec <OutputDim> $dim_ivec <BuildVector> 1:$dim_ivec </BuildVector>") $dir/tr_ivec_copy.nnet nnet-initialize --print-args=false <(echo "<ParallelComponent> <InputDim> $((dim_raw+dim_ivec)) <OutputDim> $((dim_transformed+dim_ivec)) <NestedNnetFilename> $feature_transform_old $dir/tr_ivec_copy.nnet </NestedNnetFilename>") $feature_transform fi echo $dim_ivec >$dir/ivector_dim # mark down the iVec dim! echo $ivector_append_tool >$dir/ivector_append_tool # pasting the iVecs to the feaures, echo "# + ivector input '$ivector'" feats_tr="$feats_tr $ivector_append_tool ark:- '$ivector' ark:- |" fi ###### Show the final 'feature_transform' in the log, echo echo "### Showing the final 'feature_transform':" nnet-info $feature_transform echo "###" ###### MAKE LINK TO THE FINAL feature_transform, so the other scripts will find it ###### [ -f $dir/final.feature_transform ] && unlink $dir/final.feature_transform (cd $dir; ln -s $(basename $feature_transform) final.feature_transform ) feature_transform=$dir/final.feature_transform ###### GET THE DIMENSIONS ###### num_fea=$(feat-to-dim --print-args=false "$feats_tr nnet-forward --use-gpu=no $feature_transform ark:- ark:- |" - 2>/dev/null) num_hid=$hid_dim ###### PERFORM THE PRE-TRAINING ###### for depth in $(seq 1 $nn_depth); do echo echo "# PRE-TRAINING RBM LAYER $depth" RBM=$dir/$depth.rbm [ -f $RBM ] && echo "RBM '$RBM' already trained, skipping." && continue # The first RBM needs special treatment, because of Gussian input nodes, if [ "$depth" == "1" ]; then # This is usually Gaussian-Bernoulli RBM (not if CNN layers are part of input transform) # initialize, echo "# initializing '$RBM.init'" echo "<Rbm> <InputDim> $num_fea <OutputDim> $num_hid <VisibleType> $input_vis_type <HiddenType> bern <ParamStddev> $param_stddev_first" > $RBM.proto nnet-initialize $RBM.proto $RBM.init 2>$dir/log/nnet-initialize.$depth.log || exit 1 # pre-train, num_iter=$rbm_iter; [ $input_vis_type == "gauss" ] && num_iter=$((2*rbm_iter)) # 2x more epochs for Gaussian input [ $input_vis_type == "bern" ] && rbm_lrate_low=$rbm_lrate # original lrate for Bernoulli input echo "# pretraining '$RBM' (input $input_vis_type, lrate $rbm_lrate_low, iters $num_iter)" rbm-train-cd1-frmshuff --learn-rate=$rbm_lrate_low --l2-penalty=$rbm_l2penalty \ --num-iters=$num_iter --verbose=$verbose \ --feature-transform=$feature_transform \ $rbm_extra_opts \ $RBM.init "$feats_tr" $RBM 2>$dir/log/rbm.$depth.log || exit 1 else # This is Bernoulli-Bernoulli RBM, # cmvn stats for init, echo "# computing cmvn stats '$dir/$depth.cmvn' for RBM initialization" if [ ! -f $dir/$depth.cmvn ]; then nnet-forward --print-args=false --use-gpu=yes \ "nnet-concat $feature_transform $dir/$((depth-1)).dbn - |" \ "$(echo $feats_tr | sed 's|train.scp|train.scp.10k|')" ark:- | \ compute-cmvn-stats --print-args=false ark:- - | \ cmvn-to-nnet --print-args=false - $dir/$depth.cmvn || exit 1 else echo "# compute-cmvn-stats already done, skipping." fi # initialize, echo "initializing '$RBM.init'" echo "<Rbm> <InputDim> $num_hid <OutputDim> $num_hid <VisibleType> bern <HiddenType> bern <ParamStddev> $param_stddev <VisibleBiasCmvnFilename> $dir/$depth.cmvn" > $RBM.proto nnet-initialize $RBM.proto $RBM.init 2>$dir/log/nnet-initialize.$depth.log || exit 1 # pre-train, echo "pretraining '$RBM' (lrate $rbm_lrate, iters $rbm_iter)" rbm-train-cd1-frmshuff --learn-rate=$rbm_lrate --l2-penalty=$rbm_l2penalty \ --num-iters=$rbm_iter --verbose=$verbose \ --feature-transform="nnet-concat $feature_transform $dir/$((depth-1)).dbn - |" \ $rbm_extra_opts \ $RBM.init "$feats_tr" $RBM 2>$dir/log/rbm.$depth.log || exit 1 fi # Create DBN stack, if [ "$depth" == "1" ]; then echo "# converting RBM to $dir/$depth.dbn" rbm-convert-to-nnet $RBM $dir/$depth.dbn else echo "# appending RBM to $dir/$depth.dbn" nnet-concat $dir/$((depth-1)).dbn "rbm-convert-to-nnet $RBM - |" $dir/$depth.dbn fi done echo echo "# REPORT" echo "# RBM pre-training progress (line per-layer)" grep progress $dir/log/rbm.*.log echo echo "Pre-training finished." sleep 3 exit 0
#!/usr/bin/env bash read -n 1 -p "Are you sure you want to generate new keys: [N] " i case $i in y|Y) ;; *) echo; echo "Aborted"; exit 1;; esac rm server.* openssl genrsa -des3 -out server.key.secure -passout pass:testkey 4096 && \ openssl rsa -in server.key.secure -out server.key -passin pass:testkey && \ rm server.key.secure && \ openssl req -new -key server.key -out server.csr -batch -passin pass:testkey && \ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt -passin pass:testkey && \ openssl x509 -in server.crt -out server.crt.der -outform der && \ chmod 0600 server.key
<reponame>sintefneodroid/droid<filename>docs/cvs/classdroid_1_1_runtime_1_1_prototyping_1_1_evaluation_1_1_reach_goal.js var classdroid_1_1_runtime_1_1_prototyping_1_1_evaluation_1_1_reach_goal = [ [ "InternalEvaluate", "classdroid_1_1_runtime_1_1_prototyping_1_1_evaluation_1_1_reach_goal.html#aaa4ea21b5d1a8273192d044d8867bffd", null ], [ "InternalReset", "classdroid_1_1_runtime_1_1_prototyping_1_1_evaluation_1_1_reach_goal.html#a1d29ffbd8938ed31c2dc13ace30eb509", null ], [ "PostSetup", "classdroid_1_1_runtime_1_1_prototyping_1_1_evaluation_1_1_reach_goal.html#ae2b17a6d5836031b0a28064e9abef8a1", null ], [ "SetGoal", "classdroid_1_1_runtime_1_1_prototyping_1_1_evaluation_1_1_reach_goal.html#a3edae7648abdf12a674ee01b674d6e95", null ] ];
python examples/eval.py examples/configs/mnist/four0123/eval/quito/real/opt2/300.yml --run-dir=runs/mnist.four0123.train.baseline.u3cu3_s0.human.param36/ --jobs=4
<gh_stars>0 package com.breakersoft.plow.scheduler; import java.util.UUID; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.stereotype.Component; import com.breakersoft.plow.Job; import com.breakersoft.plow.Layer; import com.breakersoft.plow.LayerE; import com.breakersoft.plow.Node; import com.breakersoft.plow.Task; import com.breakersoft.plow.dispatcher.DispatchService; import com.breakersoft.plow.dispatcher.NodeDispatcher; import com.breakersoft.plow.dispatcher.ProcDispatcher; import com.breakersoft.plow.dispatcher.domain.DispatchNode; import com.breakersoft.plow.dispatcher.domain.DispatchProc; import com.breakersoft.plow.rnd.thrift.Ping; import com.breakersoft.plow.rnd.thrift.RunTaskResult; import com.breakersoft.plow.service.JobService; import com.breakersoft.plow.service.NodeService; import com.breakersoft.plow.service.StateManager; import com.breakersoft.plow.thrift.TaskState; /** * Manages the the running procs on a node. * * @author chambers * */ @Component public class SchedulerEventHandler { private static final Logger logger = org.slf4j.LoggerFactory.getLogger(SchedulerEventHandler.class); @Autowired SchedulerService schedulerService; @Autowired StatsService statsService; @Autowired NodeService nodeService; @Autowired NodeDispatcher nodeDispatcher; @Autowired DispatchService dispatchService; @Autowired JobService jobService; @Autowired StateManager jobStateManager; @Autowired ProcDispatcher procDispatcher; /** * This is a oneway method, the RNDaemon is not listening for a response. * * @param ping */ public void handleNodePing(Ping ping) { logger.info("{} node reporting in.", ping.getHostname()); DispatchNode node; try { node = dispatchService.getDispatchNode(ping.hostname); nodeService.updateNode(node, ping); } catch (EmptyResultDataAccessException e) { Node newNode = nodeService.createNode(ping); node = dispatchService.getDispatchNode(newNode.getName()); } if (!ping.tasks.isEmpty()) { statsService.updateProcRuntimeStats(ping.tasks); statsService.updateTaskRuntimeStats(ping.tasks); } if (node.isDispatchable()) { nodeDispatcher.book(node); } } public void handleRunTaskResult(RunTaskResult result) { Task task = null; DispatchProc proc = null; try { task = jobService.getTask(UUID.fromString(result.taskId)); proc = dispatchService.getDispatchProc(result.procId); } catch (EmptyResultDataAccessException e) { logger.error("Bad task complete ping Job:" + result.jobId + ", Task: " + result.taskId, e); return; } TaskState newState; if (result.exitStatus == 0) { newState = TaskState.SUCCEEDED; } else { if (dispatchService.isAtMaxRetries(task)) { newState = TaskState.DEAD; } else { newState = TaskState.WAITING; } } logger.info("{} new state {}", task, newState.toString()); if (dispatchService.stopTask(task, newState, result.exitStatus, result.exitSignal)) { dispatchService.unassignProc(proc); if (newState.equals(TaskState.SUCCEEDED)) { jobStateManager.satisfyDependsOn(task); final Layer layer = new LayerE(task); if (jobService.isLayerComplete(layer)) { jobStateManager.satisfyDependsOn(layer); } } } if (proc.isUnbooked()) { dispatchService.deallocateProc(proc, "Proc was unbooked"); } if (jobService.isJobPaused(task)) { dispatchService.deallocateProc(proc, "The job for task '" + task + "' was paused."); return; } if (jobService.isFinished(task)) { Job job = jobService.getJob(UUID.fromString(result.jobId)); dispatchService.deallocateProc(proc, "Job is finished " + task.getJobId()); jobStateManager.shutdownJob(job); return; } procDispatcher.book(proc); } }
<reponame>schinmayee/nimbus //##################################################################### // Copyright 2002-2010, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>. // This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt. //##################################################################### // Class INCOMPRESSIBLE //##################################################################### #include <PhysBAM_Tools/Grids_Dyadic/DYADIC_GRID_ITERATOR_CELL.h> #include <PhysBAM_Tools/Grids_Dyadic/DYADIC_GRID_ITERATOR_FACE.h> #include <PhysBAM_Tools/Grids_Dyadic/DYADIC_GRID_ITERATOR_NODE.h> #include <PhysBAM_Tools/Grids_Dyadic_Advection/ADVECTION_SEMI_LAGRANGIAN_DYADIC.h> #include <PhysBAM_Tools/Grids_Dyadic_Interpolation/LINEAR_INTERPOLATION_DYADIC.h> #include <PhysBAM_Tools/Grids_Dyadic_Interpolation/LINEAR_INTERPOLATION_DYADIC_HELPER.h> #include <PhysBAM_Tools/Grids_RLE_Advection/ADVECTION_SEMI_LAGRANGIAN_RLE.h> #include <PhysBAM_Tools/Grids_RLE_Interpolation/AVERAGING_RLE.h> #include <PhysBAM_Tools/Grids_Uniform/UNIFORM_GRID_ITERATOR_CELL.h> #include <PhysBAM_Tools/Grids_Uniform/UNIFORM_GRID_ITERATOR_FACE.h> #include <PhysBAM_Tools/Grids_Uniform/UNIFORM_GRID_ITERATOR_NODE.h> #include <PhysBAM_Tools/Grids_Uniform_Advection/ADVECTION_SEMI_LAGRANGIAN_UNIFORM_DEFINITION.h> #include <PhysBAM_Geometry/Advection_Collidable/ADVECTION_WRAPPER_COLLIDABLE_FACE.h> #include <PhysBAM_Geometry/Grids_Dyadic_Advection_Collidable/ADVECTION_SEMI_LAGRANGIAN_COLLIDABLE_FACE_DYADIC.h> #include <PhysBAM_Geometry/Grids_RLE_Advection_Collidable/ADVECTION_SEMI_LAGRANGIAN_COLLIDABLE_FACE_RLE.h> #include <PhysBAM_Geometry/Grids_Uniform_Advection_Collidable/ADVECTION_SEMI_LAGRANGIAN_COLLIDABLE_FACE_SLIP_UNIFORM.h> #include <PhysBAM_Geometry/Grids_Uniform_Advection_Collidable/ADVECTION_SEMI_LAGRANGIAN_COLLIDABLE_FACE_UNIFORM.h> #include <PhysBAM_Geometry/Grids_Uniform_Collisions/GRID_BASED_COLLISION_GEOMETRY_UNIFORM.h> #include <PhysBAM_Geometry/Grids_Uniform_Interpolation_Collidable/FACE_LOOKUP_COLLIDABLE_SLIP_UNIFORM.h> #include <PhysBAM_Fluids/PhysBAM_Incompressible/Incompressible_Flows/INCOMPRESSIBLE.h> #include <PhysBAM_Fluids/PhysBAM_Incompressible/Incompressible_Flows/INCOMPRESSIBLE_POLICY.h> #include <PhysBAM_Fluids/PhysBAM_Incompressible/Incompressible_Flows/PROJECTION_DYADIC.h> #include <PhysBAM_Fluids/PhysBAM_Incompressible/Incompressible_Flows/PROJECTION_DYNAMICS_UNIFORM.h> #include <PhysBAM_Fluids/PhysBAM_Incompressible/Incompressible_Flows/PROJECTION_RLE.h> #include <PhysBAM_Dynamics/Advection_Equations/ADVECTION_WRAPPER_FIRE_DYADIC.h> #include <PhysBAM_Dynamics/Advection_Equations/ADVECTION_WRAPPER_FIRE_MULTIPHASE_DYADIC.h> #include <PhysBAM_Dynamics/Advection_Equations/ADVECTION_WRAPPER_FIRE_MULTIPHASE_RLE.h> #include <PhysBAM_Dynamics/Advection_Equations/ADVECTION_WRAPPER_FIRE_MULTIPHASE_UNIFORM.h> #include <PhysBAM_Dynamics/Advection_Equations/ADVECTION_WRAPPER_FIRE_RLE.h> #include <PhysBAM_Dynamics/Interpolation/FACE_LOOKUP_FIRE_MULTIPHASE_DYADIC.h> #include <PhysBAM_Dynamics/Interpolation/FACE_LOOKUP_FIRE_MULTIPHASE_RLE.h> #include <PhysBAM_Dynamics/Interpolation/FACE_LOOKUP_FIRE_MULTIPHASE_UNIFORM.h> #include <PhysBAM_Dynamics/Interpolation/FACE_LOOKUP_FIRE_RLE.h> using namespace PhysBAM; //##################################################################### // Constructor //##################################################################### template<class T_GRID> INCOMPRESSIBLE<T_GRID>:: INCOMPRESSIBLE() :use_force_x(false),use_force_y(false),use_force_z(false),use_force(false),conserve_kinetic_energy(false),use_variable_surface_tension(false),use_variable_viscosity(false), use_variable_vorticity_confinement(false),nonzero_viscosity(false),nonzero_surface_tension(false), nested_semi_lagrangian_collidable(0),semi_lagrangian_collidable(0),nested_semi_lagrangian_collidable_slip(0),semi_lagrangian_collidable_slip(0), nested_semi_lagrangian_fire_multiphase(0),semi_lagrangian_fire_multiphase(0),nested_nested_semi_lagrangian_fire_multiphase_collidable(0), nested_semi_lagrangian_fire_multiphase_collidable(0),semi_lagrangian_fire_multiphase_collidable(0) { advection=0; // TODO: add a default advection, possibly semi-lagrangian Set_Max_Time_Step(); Set_Gravity(0); Set_Surface_Tension(0); Set_Viscosity(0); Set_Vorticity_Confinement(0); Set_Maximum_Implicit_Viscosity_Iterations(); Use_Explicit_Part_Of_Implicit_Viscosity(); // for multiphase Use_GFM(); } //##################################################################### // Destructor //##################################################################### template<class T_GRID> INCOMPRESSIBLE<T_GRID>:: ~INCOMPRESSIBLE() { delete nested_semi_lagrangian_collidable;delete semi_lagrangian_collidable; delete nested_semi_lagrangian_collidable_slip;delete semi_lagrangian_collidable_slip; delete nested_semi_lagrangian_fire_multiphase;delete semi_lagrangian_fire_multiphase; delete nested_nested_semi_lagrangian_fire_multiphase_collidable;delete nested_semi_lagrangian_fire_multiphase_collidable; delete semi_lagrangian_fire_multiphase_collidable; } //##################################################################### // Function Use_Semi_Lagrangian_Collidable_Advection //##################################################################### template<class T_GRID> void INCOMPRESSIBLE<T_GRID>:: Use_Semi_Lagrangian_Collidable_Advection(T_GRID_BASED_COLLISION_GEOMETRY& body_list) { nested_semi_lagrangian_collidable=new T_ADVECTION_SEMI_LAGRANGIAN_COLLIDABLE_FACE(body_list,valid_mask); semi_lagrangian_collidable=new ADVECTION_WRAPPER_COLLIDABLE_FACE<T_GRID,T,T_FACE_LOOKUP,T_ADVECTION_SEMI_LAGRANGIAN_COLLIDABLE_FACE,T_FACE_LOOKUP_COLLIDABLE>(*nested_semi_lagrangian_collidable,body_list,valid_mask); Set_Custom_Advection(*semi_lagrangian_collidable); } //##################################################################### // Function Use_Semi_Lagrangian_Collidable_Slip_Advection //##################################################################### template<class T_GRID> void INCOMPRESSIBLE<T_GRID>:: Use_Semi_Lagrangian_Collidable_Slip_Advection(T_GRID_BASED_COLLISION_GEOMETRY& body_list) { nested_semi_lagrangian_collidable_slip=new T_ADVECTION_SEMI_LAGRANGIAN_COLLIDABLE_SLIP_FACE(body_list); semi_lagrangian_collidable_slip=new ADVECTION_WRAPPER_COLLIDABLE_FACE<T_GRID,T,T_FACE_LOOKUP,T_ADVECTION_SEMI_LAGRANGIAN_COLLIDABLE_SLIP_FACE,T_FACE_LOOKUP_COLLIDABLE_SLIP>(*nested_semi_lagrangian_collidable_slip,body_list,valid_mask); Set_Custom_Advection(*semi_lagrangian_collidable_slip); } //##################################################################### // Function Use_Semi_Lagrangian_Fire_Multiphase_Advection //##################################################################### template<class T_GRID> void INCOMPRESSIBLE<T_GRID>:: Use_Semi_Lagrangian_Fire_Multiphase_Advection(const T_PROJECTION& projection,const T_LEVELSET_MULTIPLE& levelset_multiple_n_plus_one) { nested_semi_lagrangian_fire_multiphase=new T_ADVECTION_SEMI_LAGRANGIAN_FIRE_MULTIPHASE(); semi_lagrangian_fire_multiphase=new T_ADVECTION_WRAPPER_SEMI_LAGRANGIAN_FIRE_MULTIPHASE(*nested_semi_lagrangian_fire_multiphase,projection,levelset_multiple_n_plus_one); Set_Custom_Advection(*semi_lagrangian_fire_multiphase); } //##################################################################### // Function Use_Semi_Lagrangian_Fire_Multiphase_Collidable_Advection //##################################################################### template<class T_GRID> void INCOMPRESSIBLE<T_GRID>:: Use_Semi_Lagrangian_Fire_Multiphase_Collidable_Advection(T_GRID_BASED_COLLISION_GEOMETRY& body_list,const T_PROJECTION& projection,const T_LEVELSET_MULTIPLE& levelset_multiple_n_plus_one) { nested_nested_semi_lagrangian_fire_multiphase_collidable=new T_ADVECTION_SEMI_LAGRANGIAN_FIRE_MULTIPHASE_COLLIDABLE(body_list,valid_mask); nested_semi_lagrangian_fire_multiphase_collidable=new T_NESTED_ADVECTION_WRAPPER_SEMI_LAGRANGIAN_FIRE_MULTIPHASE_COLLIDABLE(*nested_nested_semi_lagrangian_fire_multiphase_collidable, body_list,valid_mask); semi_lagrangian_fire_multiphase_collidable=new T_ADVECTION_WRAPPER_SEMI_LAGRANGIAN_FIRE_MULTIPHASE_COLLIDABLE(*nested_semi_lagrangian_fire_multiphase_collidable,projection, levelset_multiple_n_plus_one); Set_Custom_Advection(*semi_lagrangian_fire_multiphase_collidable); } //##################################################################### #define INSTANTIATION_HELPER(T,T_GRID,d) \ template class ADVECTION_SEMI_LAGRANGIAN_UNIFORM<T_GRID,T,AVERAGING_UNIFORM<T_GRID,FACE_LOOKUP_FIRE_MULTIPHASE_UNIFORM<T_GRID > >,LINEAR_INTERPOLATION_UNIFORM<T_GRID,T,FACE_LOOKUP_FIRE_MULTIPHASE_UNIFORM<T_GRID > > >; #define P(...) __VA_ARGS__ INSTANTIATION_HELPER(float,P(GRID<VECTOR<float,1> >),2) INSTANTIATION_HELPER(float,P(GRID<VECTOR<float,2> >),2); INSTANTIATION_HELPER(float,P(GRID<VECTOR<float,3> >),3); template class INCOMPRESSIBLE<GRID<VECTOR<float,1> > >; template class INCOMPRESSIBLE<GRID<VECTOR<float,2> > >; template class INCOMPRESSIBLE<GRID<VECTOR<float,3> > >; #ifndef COMPILE_WITHOUT_DYADIC_SUPPORT template class INCOMPRESSIBLE<OCTREE_GRID<float> >; template class INCOMPRESSIBLE<QUADTREE_GRID<float> >; #endif #ifndef COMPILE_WITHOUT_RLE_SUPPORT template class INCOMPRESSIBLE<RLE_GRID_2D<float> >; template class INCOMPRESSIBLE<RLE_GRID_3D<float> >; #endif #ifndef COMPILE_WITHOUT_DOUBLE_SUPPORT INSTANTIATION_HELPER(double,P(GRID<VECTOR<double,1> >),2); INSTANTIATION_HELPER(double,P(GRID<VECTOR<double,2> >),2); INSTANTIATION_HELPER(double,P(GRID<VECTOR<double,3> >),3); template class INCOMPRESSIBLE<GRID<VECTOR<double,1> > >; template class INCOMPRESSIBLE<GRID<VECTOR<double,2> > >; template class INCOMPRESSIBLE<GRID<VECTOR<double,3> > >; #ifndef COMPILE_WITHOUT_DYADIC_SUPPORT template class INCOMPRESSIBLE<OCTREE_GRID<double> >; template class INCOMPRESSIBLE<QUADTREE_GRID<double> >; #endif #ifndef COMPILE_WITHOUT_RLE_SUPPORT template class INCOMPRESSIBLE<RLE_GRID_2D<double> >; template class INCOMPRESSIBLE<RLE_GRID_3D<double> >; #endif #endif
#!/bin/bash # This script parses in the command line parameters from runCust, # maps them to the correct command line parameters for DispNet training script and launches that task # The last line of runCust should be: bash $CONFIG_FILE --data-dir $DATA_DIR --log-dir $LOG_DIR # Parse the command line parameters # that runCust will give out DATA_DIR=NONE LOG_DIR=NONE CONFIG_DIR=NONE MODEL_DIR=NONE # Parsing command line arguments: while [[ $# > 0 ]] do key="$1" case $key in -h|--help) echo "Usage: run_dispnet_training_philly.sh [run_options]" echo "Options:" echo " -d|--data-dir <path> - directory path to input data (default NONE)" echo " -l|--log-dir <path> - directory path to save the log files (default NONE)" echo " -p|--config-file-dir <path> - directory path to config file directory (default NONE)" echo " -m|--model-dir <path> - directory path to output model file (default NONE)" exit 1 ;; -d|--data-dir) DATA_DIR="$2" shift # pass argument ;; -p|--config-file-dir) CONFIG_DIR="$2" shift # pass argument ;; -m|--model-dir) MODEL_DIR="$2" shift # pass argument ;; -l|--log-dir) LOG_DIR="$2" shift ;; *) echo Unkown option $key ;; esac shift # past argument or value done # Prints out the arguments that were passed into the script echo "DATA_DIR=$DATA_DIR" echo "LOG_DIR=$LOG_DIR" echo "CONFIG_DIR=$CONFIG_DIR" echo "MODEL_DIR=$MODEL_DIR" # Run training on philly # Add the root folder of the code to the PYTHONPATH export PYTHONPATH=$PYTHONPATH:$CONFIG_DIR # Run the actual job python $CONFIG_DIR/examples/AnytimeNetwork/resnet-ann.py \ --data_dir=$DATA_DIR \ --log_dir=$LOG_DIR \ --model_dir=$MODEL_DIR \ --load=${MODEL_DIR}/checkpoint \ -n=9 -c=128 -s=1 --ds_name=cifar100 --batch_size=64 --nr_gpu=1 --samloss=100 --exp_gamma=0.07 --sum_rand_ratio=0 --is_select_arr -f=5
/* * Copyright 2019 <NAME> * * 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 io.openvalidation.generation; import com.github.jknack.handlebars.Handlebars; import com.github.jknack.handlebars.Helper; import com.github.jknack.handlebars.Options; import com.github.jknack.handlebars.Template; import com.github.jknack.handlebars.helper.ConditionalHelpers; import com.github.jknack.handlebars.io.ClassPathTemplateLoader; import com.github.jknack.handlebars.io.TemplateLoader; import com.github.jknack.handlebars.io.TemplateSource; import io.openvalidation.common.ast.ASTArithmeticalOperator; import io.openvalidation.common.ast.ASTComparisonOperator; import io.openvalidation.common.ast.ASTItem; import io.openvalidation.common.ast.condition.ASTConditionConnector; import io.openvalidation.common.utils.ResourceUtils; import io.openvalidation.common.validation.Validator; import java.io.IOException; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; public class CodeGenerator { private static Map<String, String> inheritance; static { inheritance = new HashMap<>(); inheritance.put("node", "javascript"); } public static String generate( String language, String partial, ASTItem model, boolean isInlinePartial) throws Exception { Validator.shouldNotBeEmpty(partial, "Name of partial Template"); Validator.shouldNotBeEmpty(language, "output Programming Language"); Validator.shouldNotBeEmpty(model, "AST model"); if (!partial.equals("{{tmpl}}")) { if (partial.equals("main") && model.getType().equals("astmodel") || partial.equals("framework") && model.getType().equals("astmodel") || partial.equals("validatorfactory") && model.getType().equals("astmodel")) { } else { Validator.shouldEquals( model.getType(), partial, "model type", "model type: '" + model.getType() + "' - partial template name'" + partial + "'"); } Validator.shouldBeFals( isInlinePartial, "cause partial content is not {{tmpl}}, IS INLINE PARTIAL"); } else { Validator.shouldBeTrue( isInlinePartial, "cause partial content is {{tmpl}}, IS INLINE PARTIAL"); } TemplateLoader loader = new ClassPathTemplateLoader(); // loader.setPrefix("/" + language); Handlebars handlebars = new Handlebars(loader); handlebars.registerHelpers(ConditionalHelpers.class); handlebars.infiniteLoops(true); handlebars.registerHelper( "equals", new Helper<Object>() { public CharSequence apply(Object a, Options options) throws IOException { Object b = options.param(0, null); if (a == null || b == null) return options.inverse(); return (a.toString().toLowerCase().equals(b.toString().toLowerCase())) ? options.fn() : options.inverse(); } }); handlebars.registerHelper( "not_equals", new Helper<Object>() { public CharSequence apply(Object a, Options options) throws IOException { Object b = options.param(0, null); if (a == null || b == null) return (a == null && b == null) ? options.inverse() : options.fn(); return (a.toString().toLowerCase().equals(b.toString().toLowerCase())) ? options.inverse() : options.fn(); } }); handlebars.registerHelper( "tmpl", new Helper<Object>() { public CharSequence apply(Object a, Options options) throws IOException { Object b = options.param(0, null); String tmplFullName = null; String tmplName = null; String errors = ""; TemplateSource t = null; Template tmpl = null; try { if (a != null && a instanceof String) tmplName = a.toString(); else if (options.context.model() instanceof ASTArithmeticalOperator) tmplName = ((ASTArithmeticalOperator) options.context.model()).getType(); else if (options.context.model() instanceof ASTComparisonOperator) tmplName = ASTComparisonOperator.class.getSimpleName().toLowerCase(); else if (options.context.model() instanceof ASTConditionConnector) tmplName = ASTConditionConnector.class.getSimpleName().toLowerCase(); else tmplName = ((ASTItem) options.context.model()).getType(); // inheritance if (ResourceUtils.exists("/" + language + "/" + tmplName + ".hbs")) tmplFullName = "/" + language + "/" + tmplName; else if (inheritance.containsKey(language) && ResourceUtils.exists( "/" + inheritance.get(language) + "/" + tmplName + ".hbs")) tmplFullName = "/" + inheritance.get(language) + "/" + tmplName; else tmplFullName = "/common/" + tmplName; // tmplFullName = ResourceUtils.exists("/" + language + "/" + // tmplName + ".hbs")? // tmplName : "../common/" + tmplName; t = options.handlebars.getLoader().sourceAt(tmplFullName); tmpl = options.handlebars.compile(t); return new Handlebars.SafeString(tmpl.apply(options.context)); } catch (Exception e) { String stcktr = String.join( "\n", Arrays.stream(e.getStackTrace()) .map(s -> s.toString()) .collect(Collectors.toList())); errors += "\n\n### ERRROR: \n\n" + e.toString() + stcktr + "\n\n:ERRROR ###\n\n"; if (t != null) errors = "\n\n Template NAME: " + t.filename() + errors + "\n\n"; if (tmpl != null) errors = "\n\n Template Content: " + tmpl.text() + errors + "\n\n"; int x = 0; } return "TEMPLATE [" + tmplName + " - " + tmplFullName + " language: " + language + "] NOT FOUND!]\n\n" + errors; } }); Template template = (isInlinePartial) ? handlebars.compileInline(partial) : handlebars.compile( "/" + language + "/" + partial); // compileInline("start [{{name}}] end"); return template.apply(model); } }
/** * @license * Copyright (c) 2018, General Electric * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import React, { Component } from 'react'; class ContextBrowser extends Component { constructor(props) { super(props); this._handleItemSelected = e => { const {item} = e.detail; if (this.props.onSelectedChanged && item !== this.props.selected) { console.log('selected'); this.props.onSelectedChanged(item); } }; } componentDidMount() { this.$browser.openTrigger = this.$trigger; this.$browser.addEventListener('px-app-asset-selected', this._handleItemSelected, false); this.updateProps(this.$browser, this.props); } componentWillUnmount() { this.$browser.removeEventListener('px-app-asset-selected', this._handleItemSelected); } componentWillReceiveProps(nextProps) { this.updateProps(this.$browser, nextProps); } updateProps(el, props) { el.items = props.items; el.selected = props.selected; } render() { return ( <div> <px-context-browser-trigger ref={n => {this.$trigger = n}}></px-context-browser-trigger> <px-context-browser ref={n => {this.$browser = n}}></px-context-browser> </div> ); } } export default ContextBrowser;
public class CustomObject { private String name; private int age; private boolean isStudent; public CustomObject(String name, int age, boolean isStudent) { this.name = name; this.age = age; this.isStudent = isStudent; } @Override public String toString() { return "Name: " + name + ", Age: " + age + ", Is Student: " + isStudent; } public static void main(String[] args) { CustomObject obj = new CustomObject("John", 25, true); System.out.println(">>" + obj.toString()); } }
#!/bin/bash ################################################################################ # Copyright 2013-2017 Aerospike, Inc. # # 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. ################################################################################ CWD=$(pwd) SCRIPT_DIR=$(dirname $0) BASE_DIR=$(cd "${SCRIPT_DIR}/.."; pwd) INIFILE=${BASE_DIR}/aerospike-client-c.ini CHECKSUMS=${BASE_DIR}/aerospike-client-c.sha256 AEROSPIKE=${CWD}/aerospike-client-c LIB_PATH=${PREFIX} DOWNLOAD=${DOWNLOAD_C_CLIENT:-1} COPY_FILES=1 DOWNLOAD_DIR=${AEROSPIKE}/package AEROSPIKE_C_VERSION=${AEROSPIKE_C_VERSION:-'latest'} unset PKG_TYPE PKG_VERSION PKG_SUFFIX PKG_ARTIFACT ################################################################################ # # FUNCTIONS # ################################################################################ has_cmd() { hash "$1" 2> /dev/null } download() { artifact=$1 version=$2 dest_dir=$3 dest="${dest_dir}/${artifact}" mkdir -p ${dest_dir} url="https://artifacts.aerospike.com/aerospike-client-c/${version}/${artifact}" printf "info: downloading '%s' to '%s'\n" "${url}" "${dest}" if has_cmd curl; then curl -f -L ${url} --output ${dest} if [ $? != 0 ]; then echo "error: Unable to download package from '${url}'" exit 1 fi elif has_cmd wget; then wget -O ${dest} ${url} if [ $? != 0 ]; then echo "error: Unable to download package from '${url}'" exit 1 fi else echo "error: Not able to find 'curl' or 'wget'. Either is required to download the package." exit 1 fi return 0 } function check_lib_path() { [ -d "$1" ] && [ -f "$1/lib/libaerospike.a" ] && [ -f "$1/include/aerospike/aerospike.h" ] } ################################################################################ # LIB_PATH is not defined, so we want to see if we can derive it. ################################################################################ if [ $DOWNLOAD == 0 ] && [ -z $LIB_PATH ]; then # first, check to see if there is a local client if check_lib_path ${AEROSPIKE}; then LIB_PATH=${AEROSPIKE} COPY_FILES=0 # next, check to see if there is an installed client elif check_lib_path "/usr"; then LIB_PATH=/usr fi # If we can't find it, then download it. if [ ! $LIB_PATH ]; then DOWNLOAD=1 fi fi if [ $DOWNLOAD ] && [ $DOWNLOAD == 1 ]; then ############################################################################## # DETECT OPERATING ENVIRONMENT ############################################################################## PKG_VERSION=${AEROSPIKE_C_VERSION} PKG_BUILD="${AEROSPIKE_C_FLAVOR:+-$AEROSPIKE_C_FLAVOR}-devel" sysname=$(uname | tr '[:upper:]' '[:lower:]') case ${sysname} in ############################################################################ # LINUX ############################################################################ "linux" ) PKG_DIST=$($SCRIPT_DIR/os_version) if [ $? -ne 0 ]; then printf "%s\n" "$PKG_DIST" >&2 exit 1 fi case $PKG_DIST in "el"* ) PKG_VERSION="${AEROSPIKE_C_VERSION//-/_}-1" PKG_SUFFIX="${PKG_DIST}.x86_64.rpm" PKG_TYPE="rpm" ;; "debian"* ) PKG_SUFFIX="${PKG_DIST}.x86_64.deb" PKG_TYPE="deb" ;; "ubuntu"* ) PKG_SUFFIX="${PKG_DIST}.04.x86_64.deb" PKG_TYPE="deb" ;; "ami"* ) PKG_VERSION="${AEROSPIKE_C_VERSION//-/_}-1" PKG_SUFFIX="el6.x86_64.rpm" PKG_TYPE="rpm" ;; * ) printf "error: Linux distribution not supported: '%s'\n" "$PKG_DIST" >&2 exit 1 ;; esac PKG_ARTIFACT="aerospike-client-c${PKG_BUILD}-${PKG_VERSION}.${PKG_SUFFIX}" LIB_PATH=${AEROSPIKE}/package/usr ;; ############################################################################ # MAC OS X ############################################################################ "darwin" ) PKG_ARTIFACT="aerospike-client-c${PKG_BUILD}-${PKG_VERSION}.pkg" PKG_TYPE="pkg" LIB_PATH=${AEROSPIKE}/package/usr/local ;; ############################################################################ # OTHER ############################################################################ * ) printf "error: OS not supported: '%s'\n" "${sysname}" >&2 exit 1 ;; esac ############################################################################## # DOWNLOAD and extract the package, if it does not exist. # We will then move the files to the correct location for building. ############################################################################## if check_lib_path ${AEROSPIKE}; then printf "warning: '%s' directory exists.\n" "${AEROSPIKE}" printf "warning: \n" printf "warning: We will be using this directory, rather than downloading a\n" printf "warning: new package. If you would like to download a new package\n" printf "warning: please remove the '%s' directory.\n" $(basename ${AEROSPIKE}) else ############################################################################## # DOWNLOAD TGZ ############################################################################## if [ -f ${AEROSPIKE}/package/${PKG_ARTIFACT} ]; then printf "warning: '%s' file exists.\n" "${AEROSPIKE}/package/${PKG_ARTIFACT}" printf "warning: \n" printf "warning: We will be using this package, rather than downloading a new package.\n" printf "warning: If you would like to download a new package please remove\n" printf "warning: the package file.\n" else download ${PKG_ARTIFACT} ${AEROSPIKE_C_VERSION} ${DOWNLOAD_DIR} fi ############################################################################## # EXTRACT FILES FROM DEVEL INSTALLER ############################################################################## # let's go into the directory cd ${AEROSPIKE}/package # Extract the contents of the `devel` installer package into `aerospike-client` printf "info: extracting files from '%s'\n" ${PKG_ARTIFACT} case ${PKG_TYPE} in "rpm" ) rpm2cpio ${PKG_ARTIFACT} | cpio -idmu --no-absolute-filenames --quiet ;; "deb" ) dpkg -x ${PKG_ARTIFACT} . ;; "pkg" ) xar -xf ${PKG_ARTIFACT} Payload cpio -idmu -I Payload --quiet rm Payload ;; esac # let's return to parent directory cd ${CWD} fi fi ################################################################################ # PERFORM CHECKS ################################################################################ AEROSPIKE_LIBRARY=${LIB_PATH}/lib/libaerospike.a AEROSPIKE_INCLUDE=${LIB_PATH}/include printf "\n" >&1 printf "CHECK\n" >&1 if [ -f ${AEROSPIKE_LIBRARY} ]; then printf " [✓] %s\n" "${AEROSPIKE_LIBRARY}" >&1 else printf " [✗] %s\n" "${AEROSPIKE_LIBRARY}" >&1 FAILED=1 fi if [ -f ${AEROSPIKE_INCLUDE}/aerospike/aerospike.h ]; then printf " [✓] %s\n" "${AEROSPIKE_INCLUDE}/aerospike/aerospike.h" >&1 else printf " [✗] %s\n" "${AEROSPIKE_INCLUDE}/aerospike/aerospike.h" >&1 FAILED=1 fi printf "\n" >&1 if [ $FAILED ]; then exit 1 fi ################################################################################ # COPY FILES TO AEROSPIKE-C-CLIENT DIR ################################################################################ if [ $COPY_FILES == 1 ]; then rm -rf ${AEROSPIKE}/{lib,include} mkdir -p ${AEROSPIKE}/{lib,include} cp ${AEROSPIKE_LIBRARY} ${AEROSPIKE}/lib/ cp -R ${AEROSPIKE_INCLUDE}/{aerospike,citrusleaf} ${AEROSPIKE}/include/ fi
db.posts.find({ "likes": {$exists: true, $gt: 3} });
from abc import ABC, abstractmethod class Product(ABC): @abstractmethod def cost(self): pass class Book(Product): def __init__(self, price, tax): self.price = price self.tax = tax def cost(self): return self.price + (self.price * self.tax) class Toy(Product): def __init__(self, price, shipping_charge): self.price = price self.shipping_charge = shipping_charge def cost(self): return self.price + self.shipping_charge
#!/bin/sh #Matthew Fitzgerald 2020 #Alexander Aguilar 2020 ## CHANGE THESE ## Directory to Development Server SERVER_PATH='~/Desktop/DevServer' ## Plugin Source File PLUGIN_PATH='~/Desktop/FitzNetHardcore' # Remove old files (Clean) cd $SERVER_PATH rm banned* cd plugins rm -r Fitz* # Maven Compile cd $PLUGIN_PATH mvn # Add new jar into file cp $PLUGIN_PATH/target/Fitz-NetHardcore-1.15.2-SNAPSHOT.jar $PLUGIN_PATH/plugins/ # Run Server cd $SERVER_PATH java -jar spigot.jar nogui
<gh_stars>0 package com.example.demo.model; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.activerecord.Model; import lombok.Data; import java.io.Serializable; @Data @TableName(value = "t_storage") public class Storage extends Model<Storage> { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Integer id; private String commodityCode; private String name; private Integer count; }
<html> <head> <script> function startDrawing(e) { var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext("2d"); ctx.fillStyle = "#FF0000"; ctx.fillRect(e.pageX - 40, e.pageY - 40, 20, 20); ctx.fillStyle = "#00FF00"; ctx.fillRect(e.pageX - 80, e.pageY - 80, 20, 20); ctx.fillStyle = "#0000FF"; ctx.fillRect(e.pageX - 120, e.pageY - 120, 20, 20); } </script> </head> <body onmousemove="startDrawing(event)"> <canvas id="myCanvas" width="400" height="400"></canvas> </body> </html>
<gh_stars>1-10 """ Includes backend api and CrossWeb code """ from openloop.crossweb import * from flask import Blueprint, render_template, request from openloop.names import generate from flask_httpauth import HTTPBasicAuth import secrets import datetime def api_render(): p = Page() p.append(Heading("Programming Interface", 0)) keys = Card("API Keys", 7) keys.add_flow("api.api_keys", 10000) p.append(keys) form_card = Card("Active Feeds", 5) form = Form("api.keys_submit") form.append(Heading("Register Feed", 2)) row = Row() form_elem = Form_Element() form_elem.append(Label("Label Name")) form_elem.append(Input("name", placeholder="My Sensor")) row.append(form_elem) form.append(row) form.append(Form_Check("Enable OpenLite on device", "lite", False)) form.append(Form_Button("Register")) form_card.append(form) form = Form("api.keys_delete") form.append(Heading("Delete Feed", 2)) row = Row() form_elem = Form_Element() form_elem.append(Label("IoT ID")) form_elem.append(Input("id", placeholder="Elements Flower")) form_elem.append(Form_Button("Delete", "danger")) row.append(form_elem) form.append(row) form_card.append(form) p.append(form_card) return p.export() class API_Handler: def __init__(self, shared): api = Blueprint("api", __name__) self.shared = shared self.api = api devices_db = shared.database.db["devices"] stream_db = shared.database.db["streams"] database_on = shared.database.working api_auth = HTTPBasicAuth() self.api_auth = api_auth @api_auth.verify_password def verify_password(username, password): if database_on: account = devices_db.find_one({"name": username}) if account != None and account["key"] == password: return account @api.route("/stream", methods=["POST"]) @api_auth.login_required def stream(): device = api_auth.current_user() data = request.form package = { "device": device["_id"], "time": datetime.datetime.utcnow() } for i in data: package[i] = data[i] stream_db.insert_one(package) return {"status": "complete"} shared.flow["api"] = { "api_keys": self.api_keys, "keys_submit": self.keys_submit, "keys_delete": self.keys_delete } @api.route("/") @shared.vault.login_required def api(): return render_template("blank.jinja", methods=shared.methods, html=api_render(), title="API") def api_keys(self): if self.shared.database.working: devices = self.shared.database.db["devices"] table = Table() head = Table_Header() head_row = Table_Row() head_row.append(Table_Cell("IoT ID")) head_row.append(Table_Cell("IoT Key")) head_row.append(Table_Cell("Label")) head_row.append(Table_Cell("OpenLite")) head.append(head_row) table.append(head) body = Table_Body() for device in devices.find(): row = Table_Row() row.append(Table_Cell(device['name'])) row.append(Table_Cell(device['key'])) row.append(Table_Cell(device['label'])) if device["lite"] == True: row.append(Table_Cell("Enabled")) else: row.append(Table_Cell("Disabled")) body.append(row) table.append(body) return table.export() else: p = Div() p.append(Heading("MongoDB 423", 2)) p.append("MongoDB is not connected, reboot and try again?") return p.export() def keys_submit(self, args): if self.shared.database.working: devices = self.shared.database.db["devices"] checking = True while checking: uuid = generate() query = devices.find_one({"uuid": uuid}) if query == None or len(query) == 0: lite = args.get("lite", False) if lite == "on": lite = True device = { "label": args.get("name", ""), "name": uuid, "key": secrets.token_urlsafe(16), "status": None, "lite": lite } checking = False devices.insert_one(device) def keys_delete(self, args): if self.shared.database.working: print("Delete") devices = self.shared.database.db["devices"] devices.delete_one({"name": args.get("id")})
#!/bin/bash # This script requires depot_tools to be on path. print_usage () { echo "Usage: create_sdk_cipd_united_package.sh <VERSION_TAG> [PATH_TO_SDK_DIR]" echo " where:" echo " - VERSION_TAG is the tag of the cipd packages, e.g. 28r6 or 31v1" echo " - PATH_TO_SDK_DIR is the path to the sdk folder. If omitted, this defaults to" echo " your ANDROID_SDK_ROOT environment variable." echo "" echo "This script downloads the packages specified in android_sdk_packages.txt and uploads" echo "them to CIPD for linux, mac, and windows." echo "" echo "Manage the packages to download in 'packages.txt'. You can use" echo "'sdkmanager --list --include_obsolete' in cmdline-tools to list all available packages." echo "Packages should be listed in the format of <package-name>:<directory-to-upload>." echo "For example, build-tools;31.0.0:build-tools" echo "Multiple directories to upload can be specified by delimiting by additional ':'" echo "" echo "This script expects the cmdline-tools to be installed in your specified PATH_TO_SDK_DIR" echo "and should only be run on linux or macos hosts." } # Validate version is provided if [[ $1 == "" ]]; then print_usage exit 1 fi # Validate path contains depot_tools if [[ `which cipd` == "" ]]; then echo "'cipd' command not found. depot_tools should be on the path." exit 1 fi sdk_path=${2:-$ANDROID_SDK_ROOT} version_tag=$1 # Validate directory contains all SDK packages if [[ ! -d "$sdk_path" ]]; then echo "Android SDK at '$sdk_path' not found." print_usage exit 1 fi if [[ ! -d "$sdk_path/cmdline-tools" ]]; then echo "SDK directory does not contain $sdk_path/cmdline-tools." print_usage exit 1 fi platforms=("linux" "macosx" "windows") package_file_name="packages.txt" # Find the sdkmanager in cmdline-tools. We default to using latest if available. sdkmanager_path="$sdk_path/cmdline-tools/latest/bin/sdkmanager" find_results=() while IFS= read -r line; do find_results+=("$line") done < <(find "$sdk_path/cmdline-tools" -name sdkmanager) i=0 while [ ! -f "$sdkmanager_path" ]; do if [ $i -ge ${#find_results[@]} ]; then echo "Unable to find sdkmanager in the SDK directory. Please ensure cmdline-tools is installed." exit 1 fi sdkmanager_path="${find_results[$i]}" echo $sdkmanager_path ((i++)) done # We create a new temporary SDK directory because the default working directory # tends to not update/re-download packages if they are being used. This guarantees # a clean install of Android SDK. temp_dir=`mktemp -d -t android_sdk` for platform in "${platforms[@]}"; do sdk_root="$temp_dir/sdk_$platform" upload_dir="$sdk_root/upload" echo "Creating temporary working directory for $platform: $sdk_root" mkdir $sdk_root mkdir $upload_dir # Download all the packages with sdkmanager. for package in $(cat $package_file_name); do echo $package split=(${package//:/ }) echo "Installing ${split[0]}" REPO_OS_OVERRIDE=$platform yes "y" | $sdkmanager_path --sdk_root=$sdk_root ${split[0]} # We copy only the relevant directories to a temporary dir # for upload. sdkmanager creates extra files that we don't need. array_length=${#split[@]} for (( i=1; i<${array_length}; i++ )); do cp -r "$sdk_root/${split[$i]}" "$upload_dir" done done # Mac uses a different sdkmanager name than the platform name used in gn. cipd_name="$platform-amd64" if [[ $platform == "macosx" ]]; then cipd_name="mac-amd64" fi echo "Uploading $cipd_name to CIPD" cipd create -in $upload_dir -name "flutter/android/sdk/all/$cipd_name" -install-mode copy -tag version:$version_tag rm -rf $sdk_root done rm -rf $temp_dir
<filename>src/main/java/net/silentchaos512/iconify/icon/type/ToolTypeIcon.java<gh_stars>0 package net.silentchaos512.iconify.icon.type; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketBuffer; import net.minecraft.util.JSONUtils; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.ToolType; import net.silentchaos512.iconify.api.icon.IIconSerializer; import net.silentchaos512.iconify.icon.IconSerializers; import java.util.function.Function; public class ToolTypeIcon extends SimpleIcon { private ToolType toolType = null; public ToolTypeIcon(ResourceLocation iconId) { super(iconId); } @Override public IIconSerializer<?> getSerializer() { return IconSerializers.TOOL_TYPE; } @Override public boolean test(ItemStack stack) { return toolType != null && stack.getToolTypes().contains(this.toolType); } public static class Serializer extends SimpleIcon.Serializer<ToolTypeIcon> { public Serializer(ResourceLocation name, Function<ResourceLocation, ToolTypeIcon> constructor) { super(name, constructor); } @Override public ToolTypeIcon deserialize(ResourceLocation id, JsonObject json) { ToolTypeIcon icon = super.deserialize(id, json); String str = JSONUtils.getAsString(json, "tool_type"); if (str.isEmpty()) { throw new JsonParseException("tool_type may not be empty"); } icon.toolType = ToolType.get(str); return icon; } @Override public ToolTypeIcon read(ResourceLocation id, PacketBuffer buffer) { ToolTypeIcon icon = super.read(id, buffer); icon.toolType = ToolType.get(buffer.readUtf()); return icon; } @Override public void write(PacketBuffer buffer, ToolTypeIcon icon) { super.write(buffer, icon); buffer.writeUtf(icon.toolType.getName()); } } }
<filename>client/about/about.controller.js angular.module('read-and-learn').controller('aboutController', function ($rootScope, $location, $scope, $timeout) { });