text
stringlengths
2
100k
meta
dict
#!/usr/bin/env sh # # Copyright 2015 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 # # https://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. # ############################################################################## ## ## Gradle start up script for UN*X ## ############################################################################## # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" # Need this for relative symlinks. while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`"/$link" fi done SAVED="`pwd`" cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" warn () { echo "$*" } die () { echo echo "$*" echo exit 1 } # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false case "`uname`" in CYGWIN* ) cygwin=true ;; Darwin* ) darwin=true ;; MINGW* ) msys=true ;; NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else JAVACMD="java" which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi # Increase the maximum file descriptors if we can. if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then MAX_FD="$MAX_FD_LIMIT" fi ulimit -n $MAX_FD if [ $? -ne 0 ] ; then warn "Could not set maximum file descriptor limit: $MAX_FD" fi else warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" fi fi # For Darwin, add options to specify how the application appears in the dock if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi # For Cygwin or MSYS, switch paths to Windows format before running java if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` SEP="" for dir in $ROOTDIRSRAW ; do ROOTDIRS="$ROOTDIRS$SEP$dir" SEP="|" done OURCYGPATTERN="(^($ROOTDIRS))" # Add a user-defined pattern to the cygpath arguments if [ "$GRADLE_CYGPATTERN" != "" ] ; then OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" fi # Now convert the arguments - kludge to limit ourselves to /bin/sh i=0 for arg in "$@" ; do CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` else eval `echo args$i`="\"$arg\"" fi i=`expr $i + 1` done case $i in 0) set -- ;; 1) set -- "$args0" ;; 2) set -- "$args0" "$args1" ;; 3) set -- "$args0" "$args1" "$args2" ;; 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi # Escape application args save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" exec "$JAVACMD" "$@"
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> </dependencies> <scenes> <!--Flutter View Controller--> <scene sceneID="tne-QT-ifu"> <objects> <viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController"> <layoutGuides> <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> </layoutGuides> <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> </view> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> </objects> </scene> </scenes> </document>
{ "pile_set_name": "Github" }
{ "title": "All the widgets" }
{ "pile_set_name": "Github" }
{ "scapy_network_card": "all", "scan_stat": "false", "check_url": "https://sec.ly.com/gourdscanv2/version.txt", "threads_num": "5", "tornado_run_stat": "false", "ip": "0.0.0.0", "flush_time": "120", "scapy_stat": "false", "only_one_match": "True", "mix_addr": "0.0.0.0", "tornado_port": "10806", "mix_stat": "false", "scan_level": "3", "black_domain": "127.0.0.1,0.0.0.0,localhost,google.cn,doubleclick.net,cnzz.com,baidu.com,40017.cn,google-analytics.com,googlesyndication.com,gstatic.com,bing.com,google.com,digicert.com,huihui.cn,tanx.com,qq.com,gtimg.cn,qlogo.cn,qpic.cn,upaiyun.com,gvt2.com,taobao.com,aliyun.com,alicdn.com,360.cn,gravatar.com,sinaimg.cn,githubusercontent.com,githubapp.com,feedburner.com,cloudfront.net,mmstat.com,bdstatic.com,addthis.com,51.la,bidswitch.com,wp.com,sharethis.com,googleapis.com,twimg.com,amazonaws.com,criteo.com,zopim.com,optimizely.com,microsoft.com,uxengine.net,ipinyou.com", "port": "8000", "white_domain": "", "version": "2.1", "session_expires_time": "300", "redis_pass": "Y3rc_Alw4ys_B3_W1th_Y0u", "session_size": "6600", "page_num": "100", "black_ext": "css,flv,mp3,mp4,swf,js,jpg,jpeg,png,css,gif,txt,ico,pdf,css3,txt,rar,zip,mkv,avi,mp4,swf,wmv,exe,msi,mpeg,ppt,pptx,doc,docx,xls,xlsx,woff2,woff,map,svg,ttf,m3u8,webp,tiff,bmp,7z,tgz,tar,bz,tbz,gz,apk,ipa", "mix_port": "10086", "tornado_address": "0.0.0.0", "password": "Y3rc_admin", "account": "admin", "tornado_stat": "false", "redis_host": "127.0.0.1", "scapy_out": "True", "redis_port": "6379", "cookie_secret": "O3h80XXsQiyTiH1eNgKBzQnJrgVuieykhk/yqh0/BTw=" }
{ "pile_set_name": "Github" }
library(rstan) d <- read.csv('../chap08/input/data-conc-2.txt') N <- nrow(d) Time <- c(1, 2, 4, 8, 12, 24) T_new <- 60 Time_new <- seq(from=0, to=24, length=T_new) data <- list(N=N, T=length(Time), Time=Time, Y=d[,-1], T_new=T_new, Time_new=Time_new) fit <- stan(file='model/model8-7b.stan', data=data, seed=1234)
{ "pile_set_name": "Github" }
//===-- llvm-split: command line tool for testing module splitter ---------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This program can be used to test the llvm::SplitModule function. // //===----------------------------------------------------------------------===// #include "llvm/ADT/StringExtras.h" #include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Verifier.h" #include "llvm/IRReader/IRReader.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Support/ToolOutputFile.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Transforms/Utils/SplitModule.h" using namespace llvm; static cl::opt<std::string> InputFilename(cl::Positional, cl::desc("<input bitcode file>"), cl::init("-"), cl::value_desc("filename")); static cl::opt<std::string> OutputFilename("o", cl::desc("Override output filename"), cl::value_desc("filename")); static cl::opt<unsigned> NumOutputs("j", cl::Prefix, cl::init(2), cl::desc("Number of output files")); static cl::opt<bool> PreserveLocals("preserve-locals", cl::Prefix, cl::init(false), cl::desc("Split without externalizing locals")); int main(int argc, char **argv) { LLVMContext Context; SMDiagnostic Err; cl::ParseCommandLineOptions(argc, argv, "LLVM module splitter\n"); std::unique_ptr<Module> M = parseIRFile(InputFilename, Err, Context); if (!M) { Err.print(argv[0], errs()); return 1; } unsigned I = 0; SplitModule(std::move(M), NumOutputs, [&](std::unique_ptr<Module> MPart) { std::error_code EC; std::unique_ptr<ToolOutputFile> Out( new ToolOutputFile(OutputFilename + utostr(I++), EC, sys::fs::F_None)); if (EC) { errs() << EC.message() << '\n'; exit(1); } verifyModule(*MPart); WriteBitcodeToFile(*MPart, Out->os()); // Declare success. Out->keep(); }, PreserveLocals); return 0; }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <!-- /* * Copyright 2020 Gerhard Klostermeier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ --> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="5dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <!-- ASCII --> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <TextView android:id="@+id/textViewDataConversionToolAscii" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minEms="4" android:textAppearance="?android:attr/textAppearanceMedium" android:gravity="right" android:paddingRight="5dp" android:text="@string/text_ascii" /> <EditText android:id="@+id/editTextDataConversionToolAscii" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:imeOptions="actionDone" android:inputType="textNoSuggestions" android:typeface="monospace" android:importantForAutofill="no" /> <ImageButton android:id="@+id/imageButtonDataConversionToolAscii" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/stat_notify_sync" android:contentDescription="@string/text_convert" android:onClick="onConvert" /> </LinearLayout> <!-- Hex --> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <TextView android:id="@+id/textViewDataConversionToolHex" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minEms="4" android:textAppearance="?android:attr/textAppearanceMedium" android:gravity="right" android:paddingRight="5dp" android:text="@string/text_hex" /> <EditText android:id="@+id/editTextDataConversionToolHex" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:typeface="monospace" android:imeOptions="actionDone" android:inputType="textCapCharacters|textNoSuggestions" android:importantForAutofill="no" /> <ImageButton android:id="@+id/imageButtonDataConversionToolHex" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/stat_notify_sync" android:contentDescription="@string/text_convert" android:onClick="onConvert"/> </LinearLayout> <!-- Bin --> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <TextView android:id="@+id/textViewDataConversionToolBin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minEms="4" android:textAppearance="?android:attr/textAppearanceMedium" android:gravity="right" android:paddingRight="5dp" android:text="@string/text_bin" /> <EditText android:id="@+id/editTextDataConversionToolBin" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:inputType="numberSigned" android:typeface="monospace" android:imeOptions="actionDone" android:importantForAutofill="no" /> <ImageButton android:id="@+id/imageButtonDataConversionToolBin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/stat_notify_sync" android:contentDescription="@string/text_convert" android:onClick="onConvert" /> </LinearLayout> </LinearLayout> </ScrollView>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <item xmlns="http://www.supermemo.net/2006/smux"> <lesson-title>GRE词汇:《再要你命三千》</lesson-title> <chapter-title>List 23</chapter-title> <question-title>根据单词,回想词义</question-title> <question><span style='font-size:18; font-family:Comic Sans MS; font-weight:normal; font-style:normal; color:#550000'>sloppy</span><br/><span style='font-size:14; font-family:微软雅黑; font-weight:normal; font-style:normal; color:#000000'>[&lt;font face="Kingsoft Phonetic"&gt;5slRpI&lt;/font&gt;]</span><br/></question> <answer>【考法 1】 adj. 邋遢的,不整洁的: lacking neatness in dress or person&lt;br&gt;【例】 a sloppy child who always seems to have spilled something on his clothes 一个外表邋遢的小孩子,他的衣服似乎总被沾上了什么东西&lt;br&gt;【近】 blowsy, dowdy, frowsy, slovenly, unkempt, untidy&lt;br&gt;【反】 dapper, dashing, sharp, smart, spruce 外表整洁的&lt;br&gt;&lt;br&gt;【考法 2】 adj. 混乱的: lacking in order, neatness, and often cleanliness&lt;br&gt;【例】 dumped the papers in a sloppy pile on the desk 把纸张随意地叠放在书桌上&lt;br&gt;【近】 chaotic, disarranged, disarrayed, disheveled, disorderly, jumbled, littered, rumpled, tousled, tumbled&lt;br&gt;【反】 bandbox, crisp, kempt, neat, orderly, organized, shipshape, snug, tidy, trim 有序的&lt;br&gt;&lt;br&gt;【记】 来自slop 泥浆,溅出,罩衣;slope 斜坡(音:斜楼坡,斜的上楼的坡) 土坡是脏的,泥泞的;<br/></answer> <question-audio>true</question-audio> <modified>2011-10-14</modified> <template-id>10023</template-id> </item>
{ "pile_set_name": "Github" }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { IWorkspacesMainService, IWorkspaceIdentifier, WORKSPACE_EXTENSION, IWorkspaceSavedEvent, UNTITLED_WORKSPACE_NAME, IResolvedWorkspace, IStoredWorkspaceFolder, isRawFileWorkspaceFolder, isStoredWorkspaceFolder, IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces'; import { TPromise } from 'vs/base/common/winjs.base'; import { isParent } from 'vs/platform/files/common/files'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { extname, join, dirname, isAbsolute, resolve } from 'path'; import { mkdirp, writeFile, readFile } from 'vs/base/node/pfs'; import { readFileSync, existsSync, mkdirSync, writeFileSync } from 'fs'; import { isLinux, isMacintosh } from 'vs/base/common/platform'; import { delSync, readdirSync, writeFileAndFlushSync } from 'vs/base/node/extfs'; import { Event, Emitter } from 'vs/base/common/event'; import { ILogService } from 'vs/platform/log/common/log'; import { isEqual } from 'vs/base/common/paths'; import { coalesce } from 'vs/base/common/arrays'; import { createHash } from 'crypto'; import * as json from 'vs/base/common/json'; import * as jsonEdit from 'vs/base/common/jsonEdit'; import { massageFolderPathForWorkspace } from 'vs/platform/workspaces/node/workspaces'; import { toWorkspaceFolders } from 'vs/platform/workspace/common/workspace'; import { URI } from 'vs/base/common/uri'; import { Schemas } from 'vs/base/common/network'; import { Disposable } from 'vs/base/common/lifecycle'; export interface IStoredWorkspace { folders: IStoredWorkspaceFolder[]; } export class WorkspacesMainService extends Disposable implements IWorkspacesMainService { _serviceBrand: any; private workspacesHome: string; private readonly _onWorkspaceSaved = this._register(new Emitter<IWorkspaceSavedEvent>()); get onWorkspaceSaved(): Event<IWorkspaceSavedEvent> { return this._onWorkspaceSaved.event; } private readonly _onUntitledWorkspaceDeleted = this._register(new Emitter<IWorkspaceIdentifier>()); get onUntitledWorkspaceDeleted(): Event<IWorkspaceIdentifier> { return this._onUntitledWorkspaceDeleted.event; } constructor( @IEnvironmentService private environmentService: IEnvironmentService, @ILogService private logService: ILogService ) { super(); this.workspacesHome = environmentService.workspacesHome; } resolveWorkspace(path: string): TPromise<IResolvedWorkspace> { if (!this.isWorkspacePath(path)) { return TPromise.as(null); // does not look like a valid workspace config file } return readFile(path, 'utf8').then(contents => this.doResolveWorkspace(path, contents)); } resolveWorkspaceSync(path: string): IResolvedWorkspace { if (!this.isWorkspacePath(path)) { return null; // does not look like a valid workspace config file } let contents: string; try { contents = readFileSync(path, 'utf8'); } catch (error) { return null; // invalid workspace } return this.doResolveWorkspace(path, contents); } private isWorkspacePath(path: string): boolean { return this.isInsideWorkspacesHome(path) || extname(path) === `.${WORKSPACE_EXTENSION}`; } private doResolveWorkspace(path: string, contents: string): IResolvedWorkspace { try { const workspace = this.doParseStoredWorkspace(path, contents); return { id: this.getWorkspaceId(path), configPath: path, folders: toWorkspaceFolders(workspace.folders, URI.file(dirname(path))) }; } catch (error) { this.logService.warn(error.toString()); } return null; } private doParseStoredWorkspace(path: string, contents: string): IStoredWorkspace { // Parse workspace file let storedWorkspace: IStoredWorkspace = json.parse(contents); // use fault tolerant parser // Filter out folders which do not have a path or uri set if (Array.isArray(storedWorkspace.folders)) { storedWorkspace.folders = storedWorkspace.folders.filter(folder => isStoredWorkspaceFolder(folder)); } // Validate if (!Array.isArray(storedWorkspace.folders)) { throw new Error(`${path} looks like an invalid workspace file.`); } return storedWorkspace; } private isInsideWorkspacesHome(path: string): boolean { return isParent(path, this.environmentService.workspacesHome, !isLinux /* ignore case */); } createWorkspace(folders?: IWorkspaceFolderCreationData[]): TPromise<IWorkspaceIdentifier> { const { workspace, configParent, storedWorkspace } = this.createUntitledWorkspace(folders); return mkdirp(configParent).then(() => { return writeFile(workspace.configPath, JSON.stringify(storedWorkspace, null, '\t')).then(() => workspace); }); } createWorkspaceSync(folders?: IWorkspaceFolderCreationData[]): IWorkspaceIdentifier { const { workspace, configParent, storedWorkspace } = this.createUntitledWorkspace(folders); if (!existsSync(this.workspacesHome)) { mkdirSync(this.workspacesHome); } mkdirSync(configParent); writeFileAndFlushSync(workspace.configPath, JSON.stringify(storedWorkspace, null, '\t')); return workspace; } private createUntitledWorkspace(folders: IWorkspaceFolderCreationData[] = []): { workspace: IWorkspaceIdentifier, configParent: string, storedWorkspace: IStoredWorkspace } { const randomId = (Date.now() + Math.round(Math.random() * 1000)).toString(); const untitledWorkspaceConfigFolder = join(this.workspacesHome, randomId); const untitledWorkspaceConfigPath = join(untitledWorkspaceConfigFolder, UNTITLED_WORKSPACE_NAME); const storedWorkspace: IStoredWorkspace = { folders: folders.map(folder => { const folderResource = folder.uri; let storedWorkspace: IStoredWorkspaceFolder; // File URI if (folderResource.scheme === Schemas.file) { storedWorkspace = { path: massageFolderPathForWorkspace(folderResource.fsPath, untitledWorkspaceConfigFolder, []) }; } // Any URI else { storedWorkspace = { uri: folderResource.toString(true) }; } if (folder.name) { storedWorkspace.name = folder.name; } return storedWorkspace; }) }; return { workspace: { id: this.getWorkspaceId(untitledWorkspaceConfigPath), configPath: untitledWorkspaceConfigPath }, configParent: untitledWorkspaceConfigFolder, storedWorkspace }; } getWorkspaceId(workspaceConfigPath: string): string { if (!isLinux) { workspaceConfigPath = workspaceConfigPath.toLowerCase(); // sanitize for platform file system } return createHash('md5').update(workspaceConfigPath).digest('hex'); } isUntitledWorkspace(workspace: IWorkspaceIdentifier): boolean { return this.isInsideWorkspacesHome(workspace.configPath); } saveWorkspace(workspace: IWorkspaceIdentifier, targetConfigPath: string): TPromise<IWorkspaceIdentifier> { // Return early if target is same as source if (isEqual(workspace.configPath, targetConfigPath, !isLinux)) { return TPromise.as(workspace); } // Read the contents of the workspace file and resolve it return readFile(workspace.configPath).then(raw => { const rawWorkspaceContents = raw.toString(); let storedWorkspace: IStoredWorkspace; try { storedWorkspace = this.doParseStoredWorkspace(workspace.configPath, rawWorkspaceContents); } catch (error) { return TPromise.wrapError(error); } const sourceConfigFolder = dirname(workspace.configPath); const targetConfigFolder = dirname(targetConfigPath); // Rewrite absolute paths to relative paths if the target workspace folder // is a parent of the location of the workspace file itself. Otherwise keep // using absolute paths. storedWorkspace.folders.forEach(folder => { if (isRawFileWorkspaceFolder(folder)) { if (!isAbsolute(folder.path)) { folder.path = resolve(sourceConfigFolder, folder.path); // relative paths get resolved against the workspace location } folder.path = massageFolderPathForWorkspace(folder.path, targetConfigFolder, storedWorkspace.folders); } }); // Preserve as much of the existing workspace as possible by using jsonEdit // and only changing the folders portion. let newRawWorkspaceContents = rawWorkspaceContents; const edits = jsonEdit.setProperty(rawWorkspaceContents, ['folders'], storedWorkspace.folders, { insertSpaces: false, tabSize: 4, eol: (isLinux || isMacintosh) ? '\n' : '\r\n' }); edits.forEach(edit => { newRawWorkspaceContents = jsonEdit.applyEdit(rawWorkspaceContents, edit); }); return writeFile(targetConfigPath, newRawWorkspaceContents).then(() => { const savedWorkspaceIdentifier = { id: this.getWorkspaceId(targetConfigPath), configPath: targetConfigPath }; // Event this._onWorkspaceSaved.fire({ workspace: savedWorkspaceIdentifier, oldConfigPath: workspace.configPath }); // Delete untitled workspace this.deleteUntitledWorkspaceSync(workspace); return savedWorkspaceIdentifier; }); }); } deleteUntitledWorkspaceSync(workspace: IWorkspaceIdentifier): void { if (!this.isUntitledWorkspace(workspace)) { return; // only supported for untitled workspaces } // Delete from disk this.doDeleteUntitledWorkspaceSync(workspace.configPath); // Event this._onUntitledWorkspaceDeleted.fire(workspace); } private doDeleteUntitledWorkspaceSync(configPath: string): void { try { // Delete Workspace delSync(dirname(configPath)); // Mark Workspace Storage to be deleted const workspaceStoragePath = join(this.environmentService.workspaceStorageHome, this.getWorkspaceId(configPath)); if (existsSync(workspaceStoragePath)) { writeFileSync(join(workspaceStoragePath, 'obsolete'), ''); } } catch (error) { this.logService.warn(`Unable to delete untitled workspace ${configPath} (${error}).`); } } getUntitledWorkspacesSync(): IWorkspaceIdentifier[] { let untitledWorkspacePaths: string[] = []; try { untitledWorkspacePaths = readdirSync(this.workspacesHome).map(folder => join(this.workspacesHome, folder, UNTITLED_WORKSPACE_NAME)); } catch (error) { if (error && error.code !== 'ENOENT') { this.logService.warn(`Unable to read folders in ${this.workspacesHome} (${error}).`); } } const untitledWorkspaces: IWorkspaceIdentifier[] = coalesce(untitledWorkspacePaths.map(untitledWorkspacePath => { const workspace = this.resolveWorkspaceSync(untitledWorkspacePath); if (!workspace) { this.doDeleteUntitledWorkspaceSync(untitledWorkspacePath); return null; // invalid workspace } return { id: workspace.id, configPath: untitledWorkspacePath }; })); return untitledWorkspaces; } }
{ "pile_set_name": "Github" }
0.6.5.1
{ "pile_set_name": "Github" }
#pragma warning (disable:4005) #include <windows.h> #include <stdio.h> #include <ntstatus.h> #pragma warning (default:4005) /////////////////////////////////////////////////////////////////////// typedef struct _LSA_UNICODE_STRING { USHORT Length; USHORT MaximumLength; PWSTR Buffer; } LSA_UNICODE_STRING, *PLSA_UNICODE_STRING, UNICODE_STRING, *PUNICODE_STRING; typedef struct _OBJECT_NAME_INFORMATION { UNICODE_STRING Name; } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION; typedef enum _POOL_TYPE { NonPagedPool, PagedPool, NonPagedPoolMustSucceed, DontUseThisType, NonPagedPoolCacheAligned, PagedPoolCacheAligned, NonPagedPoolCacheAlignedMustS, MaxPoolType, NonPagedPoolSession = 32, PagedPoolSession, NonPagedPoolMustSucceedSession, DontUseThisTypeSession, NonPagedPoolCacheAlignedSession, PagedPoolCacheAlignedSession, NonPagedPoolCacheAlignedMustSSession } POOL_TYPE; typedef enum _SYSTEM_INFORMATION_CLASS { SystemHandleInformation = 16, } SYSTEM_INFORMATION_CLASS; typedef struct _SYSTEM_HANDLE_INFORMATION { ULONG ProcessId; UCHAR ObjectTypeNumber; UCHAR Flags; USHORT Handle; PVOID Object; ACCESS_MASK GrantedAccess; } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION; typedef enum _OBJECT_INFORMATION_CLASS { ObjectBasicInformation, ObjectNameInformation, ObjectTypeInformation, ObjectAllTypesInformation, ObjectHandleInformation } OBJECT_INFORMATION_CLASS; typedef struct _OBJECT_BASIC_INFORMATION { ULONG Attributes; ACCESS_MASK GrantedAccess; ULONG HandleCount; ULONG PointerCount; ULONG PagedPoolUsage; ULONG NonPagedPoolUsage; ULONG Reserved [ 3]; ULONG NameInformationLength; ULONG TypeInformationLength; ULONG SecurityDescriptorLength; LARGE_INTEGER CreateTime; } OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION; typedef struct _OBJECT_TYPE_INFORMATION { UNICODE_STRING Name; ULONG ObjectCount; ULONG HandleCount; ULONG Reserved1 [ 4]; ULONG PeakObjectCount; ULONG PeakHandleCount; ULONG Reserved2 [ 4]; ULONG InvalidAttributes; GENERIC_MAPPING GenericMapping; ULONG ValidAccess; UCHAR Unknown; BOOLEAN MaintainHandleDatabase; POOL_TYPE PoolType; ULONG PagedPoolUsage; ULONG NonPagedPoolUsage; } OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION; typedef NTSTATUS (_stdcall *PZWQUERYSYSTEMINFORMATION) ( SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG ); typedef NTSTATUS (_stdcall *PZWDUPLICATEOBJECT) ( HANDLE, HANDLE, HANDLE, PHANDLE, ACCESS_MASK, ULONG, ULONG ); typedef NTSTATUS (_stdcall *PZWQUERYOBJECT) ( HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG ); #define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0) #define DUPLICATE_SAME_ATTRIBUTES 0x00000004 #define NtCurrentProcess() ( (HANDLE) -1 ) /////////////////////////////////////////////////////////////////////// BOOL EnablePrivilege(LPCSTR name) { TOKEN_PRIVILEGES priv = {1, {0, 0, SE_PRIVILEGE_ENABLED}}; LookupPrivilegeValue(0, name, &priv.Privileges[0].Luid); HANDLE hToken; OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken); AdjustTokenPrivileges(hToken, FALSE, &priv, sizeof priv, 0, 0); BOOL rv = GetLastError() == ERROR_SUCCESS; CloseHandle(hToken); return rv; }
{ "pile_set_name": "Github" }
### # #%L # graphwalker-example-archetype # %% # Copyright (C) 2011 - 2014 GraphWalker # %% # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # #L% ### #Thu Sep 11 14:11:23 CEST 2014 package=it.pkg version=0.1-SNAPSHOT groupId=archetype.it artifactId=basic
{ "pile_set_name": "Github" }
CONFIG_ARM=y CONFIG_TARGET_MESON_GXTV=y CONFIG_TXL_P323_V1=y CONFIG_DM=y CONFIG_DM_GPIO=y CONFIG_AML_GPIO=y
{ "pile_set_name": "Github" }
# BAPickView [![BAHome Team Name](https://img.shields.io/badge/Team-BAHome-brightgreen.svg?style=flat)](https://github.com/BAHome "BAHome Team") [![CI Status](https://img.shields.io/travis/boai/BAPickView.svg?style=flat)](https://travis-ci.org/boai/BAPickView) [![Version](https://img.shields.io/cocoapods/v/BAPickView.svg?style=flat)](https://cocoapods.org/pods/BAPickView) [![License](https://img.shields.io/cocoapods/l/BAPickView.svg?style=flat)](https://cocoapods.org/pods/BAPickView) [![Platform](https://img.shields.io/cocoapods/p/BAPickView.svg?style=flat)](https://cocoapods.org/pods/BAPickView) [![](https://img.shields.io/badge/微博-博爱1616-red.svg)](http://weibo.com/538298123) ## Example To run the example project, clone the repo, and run `pod install` from the Example directory first. ## Requirements ## Installation BAPickView is available through [CocoaPods](https://cocoapods.org). To install it, simply add the following line to your Podfile: ```ruby pod 'BAPickView' ``` ## Author boai, [email protected] ## License BAPickView is available under the MIT license. See the LICENSE file for more info. ## 1、功能及简介 * 1、城市选择器,三级联动,可返回省市县和精确的经纬度 <br> * 2、可以自定义 array 显示,性别选择等【目前只支持单行数据】 * 3、日期选择器:年月日,可以完全自定义 NSDateFormatter * 4、日期选择器:年月,可以完全自定义 NSDateFormatter * 5、日期选择器:年周,如:2017年,第21周 * 6、横竖屏适配完美 * 7、可以自定义按钮颜色、背景颜色等 * 8、新增各种展示、消失动画,如:缩放、上下左右展示、消失动画等 * 9、可以自由设置 pickView 居中或者在底部显示,还可以自由定制 toolbar 居中或者在底部显示 <br> * 10、可以自由设置 pickView 字体、字体颜色等内容,注意:日期选择器暂时不能修改字体,有可能被苹果审核不通过,如有特殊需求,可通过 runtime 修改 <br> * 11、新增 各种自定义 datePicker:年、年月、年月日、时间等等,你能想到的效果都有 <br> * 12、可以自定义 datePicker 的字体颜色、字体、字体大小、背景颜色等 <br> * 13、可以自定义 datePicker 的最大、最小年限 <br> * 14、可以自定义 datePicker 的 toolBar 位置、字体、背景颜色等 * 15、可以自定义显示隐藏 分割线和分割线颜色 * 16、日期选择器新增 最大月份限制(感谢简书网友 [@洁简](http://www.jianshu.com/u/62f0c72a2004) 同学提出的 需求!) <br> * 17、日期选择器新增 优化了最大最小年份月份的写法,现在可以自由定义最大最小日期了,详见 demo<br> * 18、新增 选中结果直接显示在 工具栏的中间,且可以自定义颜色、字体 <br> * 19、日期选择器 新增背景年份水印显示 <br> * 20、完美适配 iOS 11 和 iPhone X <br> ## 2、图片示例 ![BAPickView.gif](https://github.com/BAHome/BAPickView/blob/master/Images/BAPickView.gif) ![BAPickView1.png](https://github.com/BAHome/BAPickView/blob/master/Images/BAPickView1.png) ## 3、安装、导入示例和源码地址 * 1、pod 导入【最新版本:![](https://img.shields.io/cocoapods/v/BAPickView.svg?style=flat)】: <br> `pod 'BAPickView'` <br> 如果发现 `pod search BAPickView` 搜索出来的不是最新版本,需要在终端执行 cd 转换文件路径命令退回到 desktop,然后执行 `pod setup` 命令更新本地spec缓存(可能需要几分钟),然后再搜索就可以了。<br> 具体步骤: - pod setup : 初始化 - pod repo update : 更新仓库 - pod search BAPickView * 2、文件夹拖入:下载demo,把 BAPickView 文件夹拖入项目即可,<br> * 3、导入头文件:<br> ` #import "BAPickView_OC.h" `<br> * 4、项目源码地址:<br> OC 版 :[https://github.com/BAHome/BAPickView](https://github.com/BAHome/BAPickView)<br> ## 4、BAPickView 的类结构及 demo 示例 ![BAPickView.png](https://github.com/BAHome/BAPickView/blob/master/Images/BAPickView.png) ### BAPickView_OC.h ``` #ifndef BAPickView_OC_h #define BAPickView_OC_h #import "BAKit_PickerView.h" #import "BAKit_DatePicker.h" #import "BAKit_ConfigurationDefine.h" #import "NSDate+BAKit.h" #import "UIView+BARectCorner.h" #import "NSDateFormatter+BAKit.h" #import "UIView+BAAnimation.h" #import "BAKit_PickerViewConfig.h" #endif /* BAPickView_OC_h */ ``` ### BAKit_PickerView.h ``` #import <UIKit/UIKit.h> #import <CoreLocation/CLLocation.h> #import "BAKit_PickerViewConfig.h" @class BAKit_CityModel; /** 城市选择器的返回值 @param model BAKit_CityModel */ typedef void (^BAKit_PickerViewBlock)(BAKit_CityModel *model); /** 普通数组自定义数据返回,日期选择器返回值 @param resultString resultString */ typedef void (^BAKit_PickerViewResultBlock)(NSString *resultString); @interface BAKit_PickerView : UIView #pragma mark - 自定义属性 @property (nonatomic, copy) BAKit_PickerViewBlock block; @property (nonatomic, copy) BAKit_PickerViewResultBlock resultBlock; /** 是否开启边缘触摸隐藏,默认:YES */ @property (nonatomic, assign) BOOL isTouchEdgeHide; /** 是否关闭选择内容显示在工具栏,默认:YES */ @property (nonatomic, assign) BOOL isShowTitle; /** 动画样式 */ @property(nonatomic, assign) BAKit_PickerViewAnimationType animationType; /** 选择器样式,默认为城市选择器 */ @property(nonatomic, assign) BAKit_PickerViewType pickerViewType; @property(nonatomic, assign) BAKit_PickerViewDateType dateType; @property(nonatomic, assign) BAKit_PickerViewDateMode dateMode; @property(nonatomic, assign) BAKit_PickerViewButtonPositionType buttonPositionType; @property(nonatomic, assign) BAKit_PickerViewPositionType pickerViewPositionType; /** 自定义 NSDateFormatter,返回的日期格式,注意:如果同时设置 BAKit_PickerViewDateType 和 customDateFormatter,以 customDateFormatter 为主 */ @property(nonatomic, strong) NSDateFormatter *customDateFormatter; /** 自定义数据的数组,如:@[@"男", @"女"] */ @property(nonatomic, strong) NSArray *dataArray; /** 自定义多列数据的数组,如:@[@[@"男", @"女"],@[@"21", @"22"],@[@"39", @"40"]] */ @property(nonatomic, strong) NSArray *multipleDataArray; /** 自定义多列数据的标题,如 @[@"性别",@"名字",@"年龄"] 此属性配合multipleDataArray属性使用 , 此处 count 应与多列数据 count 一致否者不管用 */ @property(nonatomic, strong) NSArray *multipleTitleArray; /** toolBar 背景颜色,默认:白色 */ @property(nonatomic, strong) UIColor *ba_backgroundColor_toolBar; /** pickView 背景颜色,默认:白色 */ @property(nonatomic, strong) UIColor *ba_backgroundColor_pickView; /** cancleButton title颜色,默认:黑色 */ @property(nonatomic, strong) UIColor *ba_buttonTitleColor_cancle; /** sureButton title颜色,默认:黑色 */ @property(nonatomic, strong) UIColor *ba_buttonTitleColor_sure; /** title 颜色,默认:黑色 */ @property(nonatomic, strong) UIColor *ba_pickViewTitleColor; /** pickView 字体,默认:[UIFont boldSystemFontOfSize:17],注意:日期选择器暂时不能修改字体,有可能被苹果审核不通过,如有特殊需求,可通过 runtime 修改 */ @property(nonatomic, strong) UIFont *ba_pickViewFont; /** pickView title 字体,默认:[UIFont boldSystemFontOfSize:15] */ @property(nonatomic, strong) UIFont *ba_pickViewTitleFont; /** pickView 字体颜色,默认:[UIColor blackColor],注意:日期选择器暂时不能修改字体,有可能被苹果审核不通过,如有特殊需求,可通过 runtime 修改 */ @property(nonatomic, strong) UIColor *ba_pickViewTextColor; /** 是否显示分割线,默认:NO,不显示,注意:iOS 10 开始,pickerView 默认没有分割线,这里是自己添加的分割线 */ @property(nonatomic, assign) BOOL isShowLineView; /** pickView 分割线颜色,注意:请务必 打开 isShowLineView 开关! */ @property(nonatomic, strong) UIColor *ba_pickViewLineViewColor; #pragma mark - custom method /** 快速创建一个 pickerView @param pickerViewType type 类型 @param configuration 可以设置 BAKit_PickerView 的自定义内容 @param block 回调 */ + (void)ba_creatPickerViewWithType:(BAKit_PickerViewType)pickerViewType configuration:(void (^)(BAKit_PickerView *tempView))configuration block:(BAKit_PickerViewResultBlock)block; /** 快速创建一个 城市选择器 @param configuration 可以设置BAKit_PickerView 的自定义内容 @param block 回调 */ + (void)ba_creatCityPickerViewWithConfiguration:(void (^)(BAKit_PickerView *tempView)) configuration block:(BAKit_PickerViewBlock)block; /** 快速创建一个 自定义单列 pickerView @param dataArray 数组 @param configuration 可以设置BAKit_PickerView 的自定义内容 @param block 回调 */ + (void)ba_creatCustomPickerViewWithDataArray:(NSArray *)dataArray configuration:(void (^)(BAKit_PickerView *tempView)) configuration block:(BAKit_PickerViewResultBlock)block; /** 快速创建一个 自定义多列 pickerView @param dataArray 数组 @[@[@"男", @"女"],@[@"21", @"22"],@[@"39", @"40"]] @param configuration 可以设置 BAKit_PickerView 的自定义内容 @param block 回调 */ + (void)ba_creatCustomMultiplePickerViewWithDataArray:(NSArray *)dataArray configuration:(void (^)(BAKit_PickerView *tempView)) configuration block:(BAKit_PickerViewResultBlock)block; /** 显示 pick */ - (void)ba_pickViewShow; /** 隐藏 pick */ - (void)ba_pickViewHidden; @end @interface BAKit_CityModel : NSObject /** 省 */ @property (nonatomic, copy) NSString *province; /** 市 */ @property (nonatomic, copy) NSString *city; /** 区 */ @property (nonatomic, copy) NSString *area; /** 经纬度 */ @property (nonatomic, assign) CLLocationCoordinate2D coordie; @end ``` ### BAKit_DatePicker.h ``` #import <UIKit/UIKit.h> #import "BAKit_PickerViewConfig.h" @interface BAKit_DatePicker : UIView #pragma mark - 默认配置 /** 日期选择器的最大日期,默认为: 1970年01月01日00时00分00秒 */ @property(strong, nonatomic) NSDate * ba_maxDate; /** 日期选择器的最小日期,默认为: 当前时间 */ @property(strong, nonatomic) NSDate * ba_minDate; /** 日期选择器默认选中的日期,默认为:日期选择器弹出时的日期 */ @property(strong, nonatomic) NSDate *ba_defautDate; #pragma mark - 类型选择 /** 日期选择器 添加弹出动画,默认为:如果不设置该属性将不会显示动画 */ @property(assign, nonatomic) BAKit_PickerViewAnimationType animationType; @property(nonatomic, assign) BAKit_PickerViewButtonPositionType buttonPositionType; @property(nonatomic, assign) BAKit_PickerViewPositionType pickerViewPositionType; #pragma mark - 开关 /*! 是否开启边缘触摸隐藏 默认:YES */ @property (nonatomic, assign) BOOL isTouchEdgeHide; /** 是否显示选择结果显示在工具栏,默认:YES */ @property (nonatomic, assign) BOOL isShowTitle; /** 是否显示背景年份水印,默认:NO */ @property (nonatomic, assign) BOOL isShowBackgroundYearLabel; #pragma mark - color /** toolBar 背景颜色,默认:白色 */ @property(nonatomic, strong) UIColor *ba_backgroundColor_toolBar; /** pickView 背景颜色,默认:白色 */ @property(nonatomic, strong) UIColor *ba_backgroundColor_pickView; /** cancleButton title颜色,默认:黑色 */ @property(nonatomic, strong) UIColor *ba_buttonTitleColor_cancle; /** sureButton title颜色,默认:黑色 */ @property(nonatomic, strong) UIColor *ba_buttonTitleColor_sure; /** title 颜色,默认:黑色 */ @property(nonatomic, strong) UIColor *ba_pickViewTitleColor; /** bgYearTitle 颜色,默认:[UIColor colorWithRed:237.0/255.0 green:240.0/255.0 blue:244.0/255.0 alpha:1] */ @property(nonatomic, strong) UIColor *ba_bgYearTitleColor; /** pickView 字体颜色,默认:[UIColor blackColor],注意:日期选择器暂时不能修改字体,有可能被苹果审核不通过,如有特殊需求,可通过 runtime 修改 */ @property(nonatomic, strong) UIColor *ba_pickViewTextColor; #pragma mark - font /** pickView 字体,默认:非选中状态 [UIFont systemFontOfSize:10],选中状态比非选中状态大5,即 15 */ @property(nonatomic, strong) UIFont *ba_pickViewFont; /** pickView title 字体,默认:[UIFont boldSystemFontOfSize:15] */ @property(nonatomic, strong) UIFont *ba_pickViewTitleFont; /** bgYearTitle 字体,默认:[UIFont boldSystemFontOfSize:100] */ @property(nonatomic, strong) UIFont *ba_bgYearTitleFont; #pragma mark - public method /** 快速创建 BAKit_DatePicker @param pickerViewType pickerViewType @param configuration configuration @param block block */ + (void)ba_creatPickerViewWithType:(BAKit_CustomDatePickerDateType)pickerViewType configuration:(void (^)(BAKit_DatePicker *tempView))configuration block:(BAKit_PickerViewResultBlock)block; /** 显示 pick */ - (void)ba_pickViewShow; /** 隐藏 pick */ - (void)ba_pickViewHidden; @end ``` ### NSDate+BAKit.h ``` #import <Foundation/Foundation.h> #define BAKit_Current_Calendar [NSCalendar currentCalendar] #define BAKit_Current_Date [NSDate date] @interface NSDate (BAKit) @property (nonatomic, readonly) NSInteger year; @property (nonatomic, readonly) NSInteger month; @property (nonatomic, readonly) NSInteger day; @property (nonatomic, readonly) NSInteger nearestHour; @property (nonatomic, readonly) NSInteger hour; @property (nonatomic, readonly) NSInteger minute; @property (nonatomic, readonly) NSInteger second; @property (nonatomic, readonly) NSInteger nanosecond; @property (nonatomic, readonly) NSInteger weekday; //PRC 中国 @property (nonatomic, readonly) NSInteger weekdayPRC; @property (nonatomic, readonly) NSInteger weekdayOrdinal; @property (nonatomic, readonly) NSInteger weekOfMonth; @property (nonatomic, readonly) NSInteger weekOfYear; @property (nonatomic, readonly) NSInteger yearForWeekOfYear; @property (nonatomic, readonly) NSInteger quarter; /** 确定每个月是否为闰月 */ @property (nonatomic, readonly) BOOL isLeapMonth; /** 确定每个月是否为闰年 */ @property (nonatomic, readonly) BOOL isLeapYear; /** 是否是今天 */ @property (nonatomic, readonly) BOOL isToday; /** 是否是昨天 */ @property (nonatomic, readonly) BOOL isYesterday; @property (nonatomic, readonly) BOOL isTomorrow; @property (nonatomic, readonly) BOOL isThisWeek; @property (nonatomic, readonly) BOOL isNextWeek; @property (nonatomic, readonly) BOOL isLastWeek; @property (nonatomic, readonly) BOOL isThisMonth; @property (nonatomic, readonly) BOOL isThisYear; @property (nonatomic, readonly) BOOL isNextYear; @property (nonatomic, readonly) BOOL isLastYear; @property (nonatomic, readonly) BOOL isInFuture; @property (nonatomic, readonly) BOOL isInPast; @property (nonatomic, readonly) BOOL isTypicallyWorkday; @property (nonatomic, readonly) BOOL isTypicallyWeekend; /*! * 计算上报时间差: 几分钟前,几天前,传入 NSDate,自动解析 * * @return 计算上报时间差: 几分钟前,几天前 */ - (NSString *)ba_dateFormattedWithDate; /*! * 计算上报时间差: 几分钟前,几天前,传入 NSString 类型的 date,如:@"2017-04-25 11:18:01",自动解析 * * @return 计算上报时间差: 几分钟前,几天前 */ + (NSString *)ba_dateCreated_at:(NSString *)date; /*! * 获得一个比当前时间大n年的时间,格式为 yyyy-MM-dd */ + (NSString *)ba_dateAfterYears:(NSInteger)count; /*! * 返回一个只有年月日的时间 */ - (NSDate *)ba_dateWithYMD; - (NSDate *)ba_dateWithYM; /*! * 获得与当前时间的差距 */ - (NSDateComponents *)ba_dateDeltaWithNow; /** 距离当前的时间间隔描述 @return 时间间隔描述 */ - (NSString *)ba_dateTimeIntervalDescription; /** 精确到分钟的日期描述 @return 日期描述 */ - (NSString *)ba_dateMinuteDescription; /** 标准时间日期描述 @return 标准时间日期描述 */ - (NSString *)ba_dateFormattedTime; /** 当前日期 距离 1970 时间间隔毫秒 @return 当前日期 距离 1970 时间间隔毫秒 */ - (double)ba_dateTimeIntervalSince1970InMilliSecond; /** 距离 时间间隔毫秒 后的日期 @param timeIntervalInMilliSecond 时间间隔毫秒 @return 距离 时间间隔毫秒 后的日期 */ + (NSDate *)ba_dateWithTimeIntervalInMilliSecondSince1970:(double)timeIntervalInMilliSecond; /** 时间间隔格式化 @param time 时间间隔 @return 时间格式化 */ + (NSString *)ba_dateFormattedTimeFromTimeInterval:(long long)time; #pragma mark UTC //UTC世界统一时间 - (NSNumber *)ba_dateGetUtcTimeIntervalSince1970; - (NSNumber *)ba_dateGetUtcTimeIntervalIntSince1970; - (NSString *)ba_dateTimeIntervalStringSince1970; #pragma mark - 距离当前日期最近的日期 + (NSDate *)ba_dateTomorrow; + (NSDate *)ba_dateYesterday; + (NSDate *)ba_dateWithDaysFromNow:(NSInteger)days; + (NSDate *)ba_dateWithDaysBeforeNow:(NSInteger)days; + (NSDate *)ba_dateWithHoursFromNow:(NSInteger)dHours; + (NSDate *)ba_dateWithHoursBeforeNow:(NSInteger)dHours; + (NSDate *)ba_dateWithMinutesFromNow:(NSInteger)dMinutes; + (NSDate *)ba_dateWithMinutesBeforeNow:(NSInteger)dMinutes; #pragma mark - 比较日期 - (BOOL)ba_dateIsEqualToDateIgnoringTime:(NSDate *)aDate; - (BOOL)ba_dateIsSameWeekAsDate:(NSDate *)aDate; - (BOOL)ba_dateIsSameMonthAsDate:(NSDate *)aDate; - (BOOL)ba_dateIsSameYearAsDate:(NSDate *)aDate; - (BOOL)ba_dateIsEarlierThanDate:(NSDate *)aDate; - (BOOL)ba_dateIsLaterThanDate:(NSDate *)aDate; #pragma mark - 调整日期 - (NSDate *)ba_dateByAddingDays:(NSInteger)dDays; - (NSDate *)ba_dateBySubtractingDays:(NSInteger)dDays; - (NSDate *)ba_dateByAddingHours:(NSInteger)dHours; - (NSDate *)ba_dateBySubtractingHours:(NSInteger)dHours; - (NSDate *)ba_dateByAddingMinutes:(NSInteger)dMinutes; - (NSDate *)ba_dateBySubtractingMinutes:(NSInteger)dMinutes; - (NSDate *)ba_dateAtStartOfDay; - (NSDateComponents *)ba_dateComponentsWithOffsetFromDate:(NSDate *)aDate; #pragma mark - 时间间隔 - (NSInteger)ba_dateMinutesAfterDate:(NSDate *)aDate; - (NSInteger)ba_dateMinutesBeforeDate:(NSDate *)aDate; - (NSInteger)ba_dateHoursAfterDate:(NSDate *)aDate; - (NSInteger)ba_dateHoursBeforeDate:(NSDate *)aDate; - (NSInteger)ba_dateDaysAfterDate:(NSDate *)aDate; - (NSInteger)ba_dateDaysBeforeDate:(NSDate *)aDate; - (NSInteger)ba_dateDistanceInDaysToDate:(NSDate *)anotherDate; /** 多少天之后 */ - (NSDate *)ba_dateGetAfterYear:(int)year OrMonth:(int)month OrDay:(int)day; #pragma mark - 一年有多少周 + (NSString *)ba_dateGetWeekInyearOrMouth:(BOOL)inYear WithDate:(NSDate *)date; // 2015、2009、004、1998 这四年是 53 周(目前已知),其余均是52周 + (NSInteger)ba_dateGetWeekNumbersOfYear:(NSInteger)year; @end /** * 中国农历 */ @interface NSDate (LunarCalendar) /** * 例如 : 2016丙申年四月初一 */ - (NSInteger)lunarShortYear; // 农历年份,数字表示 2016 - (NSString *)lunarLongYear; // 农历年份,干支表示 丙申年 - (NSInteger)lunarShortMonth; // 农历月份,数字表示 4 - (NSString *)lunarLongMonth; // 农历月份,汉字表示 四月 - (NSInteger)lunarShortDay; // 农历日期,数字表示 1 - (NSString *)lunarLongDay; // 农历日期,汉字表示 初一 - (NSString *)lunarSolarTerms;// 农历节气 (立春 雨水 惊蛰 春分...) /** 传入阳历的年月日返回当天的农历节气 */ + (NSString *)getLunarSolarTermsWithYear:(int)iYear Month:(int)iMonth Day:(int)iDay; @end ``` ### demo 示例 ``` - (void)pickView1 { BAKit_WeakSelf [BAKit_PickerView ba_creatCityPickerViewWithConfiguration:^(BAKit_PickerView *tempView) { BAKit_StrongSelf // 设置“取消“和”确定“ button 在 pickerView 的底部 tempView.buttonPositionType = BAKit_PickerViewButtonPositionTypeBottom; // 设置 pickerView 在屏幕中的位置 tempView.pickerViewPositionType = BAKit_PickerViewPositionTypeCenter; // 是否开启边缘触摸隐藏 默认:YES tempView.isTouchEdgeHide = NO; // 动画样式 tempView.animationType = BAKit_PickerViewAnimationTypeBottom; /** pickView 字体,默认:[UIFont boldSystemFontOfSize:17] */ tempView.ba_pickViewFont = [UIFont systemFontOfSize:17]; /** pickView 字体颜色,默认:[UIColor blackColor] */ tempView.ba_pickViewTextColor = [UIColor orangeColor]; self.pickView = tempView; } block:^(BAKit_CityModel *model) { BAKit_StrongSelf // 返回 BAKit_CityModel,包含省市县 和 详细的经纬度 NSString *msg = [NSString stringWithFormat:@"%@%@%@\n纬度:%f\n经度:%f", model.province, model.city, model.area, model.coordie.latitude, model.coordie.longitude]; NSLog(@"%@", msg); BAKit_ShowAlertWithMsg_ios8(msg); }]; } - (void)pickView2 { NSArray *array = @[@"男", @"女"]; BAKit_WeakSelf [BAKit_PickerView ba_creatCustomPickerViewWithDataArray:array configuration:^(BAKit_PickerView *tempView) { BAKit_StrongSelf // 可以自由定制 toolBar 和 pickView 的背景颜色 tempView.ba_backgroundColor_toolBar = [UIColor cyanColor]; tempView.ba_backgroundColor_pickView = [UIColor greenColor]; tempView.animationType = BAKit_PickerViewAnimationTypeTop; tempView.pickerViewPositionType = BAKit_PickerViewPositionTypeCenter; self.pickView = tempView; } block:^(NSString *resultString) { BAKit_StrongSelf BAKit_ShowAlertWithMsg_ios8(resultString); }]; } - (void)pickView3 { BAKit_WeakSelf [BAKit_PickerView ba_creatPickerViewWithType:BAKit_PickerViewTypeDate configuration:^(BAKit_PickerView *tempView) { BAKit_StrongSelf // 可以自由定制 NSDateFormatter tempView.dateMode = BAKit_PickerViewDateModeDate; tempView.dateType = BAKit_PickerViewDateTypeYMDHMS; // NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; // formatter.dateFormat = @"yyyy年MM月dd日"; // tempView.customDateFormatter = formatter; // 可以自由定制按钮颜色 tempView.ba_buttonTitleColor_sure = [UIColor redColor]; tempView.ba_buttonTitleColor_cancle = [UIColor greenColor]; tempView.animationType = BAKit_PickerViewAnimationTypeLeft; self.pickView = tempView; } block:^(NSString *resultString) { BAKit_StrongSelf BAKit_ShowAlertWithMsg_ios8(resultString); }]; } - (void)pickView4 { BAKit_WeakSelf [BAKit_PickerView ba_creatPickerViewWithType:BAKit_PickerViewTypeDateYM configuration:^(BAKit_PickerView *tempView) { BAKit_StrongSelf NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; formatter.dateFormat = @"yyyy-MM"; tempView.customDateFormatter = formatter; tempView.animationType = BAKit_PickerViewAnimationTypeRight; self.pickView = tempView; } block:^(NSString *resultString) { BAKit_StrongSelf BAKit_ShowAlertWithMsg_ios8(resultString); }]; } - (void)pickView5 { BAKit_WeakSelf [BAKit_PickerView ba_creatPickerViewWithType:BAKit_PickerViewTypeDateWeek configuration:^(BAKit_PickerView *tempView) { BAKit_StrongSelf self.pickView = tempView; } block:^(NSString *resultString) { BAKit_StrongSelf BAKit_ShowAlertWithMsg_ios8(resultString); }]; } // 示例2:自定义日期选择器 #pragma mark 自定义日期选择器 - (void)ba_creatDatePickerWithType:(BAKit_CustomDatePickerDateType)type { [BAKit_DatePicker ba_creatPickerViewWithType:type configuration:^(BAKit_DatePicker *tempView) { NSDate *maxdDate; NSDate *mindDate; // 自定义:最大最小日期格式 if (type == BAKit_CustomDatePickerDateTypeYMD) { // NSDateFormatter *format = [NSDateFormatter ba_setupDateFormatterWithYMD]; // maxdDate = [format dateFromString:@"2018-08-09"]; // mindDate = [format dateFromString:@"2016-07-20"]; NSDateFormatter *format = [NSDateFormatter ba_setupDateFormatterWithYMD]; NSDate *today = [[NSDate alloc]init]; [format setDateFormat:@"yyyy-MM-dd"]; // 最小时间,当前时间 mindDate = [format dateFromString:[format stringFromDate:today]]; NSTimeInterval oneDay = 24 * 60 * 60; // 最大时间,当前时间+180天 NSDate *theDay = [today initWithTimeIntervalSinceNow:oneDay * 180]; maxdDate = [format dateFromString:[format stringFromDate:theDay]]; } else if (type == BAKit_CustomDatePickerDateTypeYM) { NSDateFormatter *format = [NSDateFormatter ba_setupDateFormatterWithYM]; maxdDate = [format dateFromString:@"2018-08"]; mindDate = [format dateFromString:@"2016-07"]; } if (maxdDate) { // 自定义:最大日期 tempView.ba_maxDate = maxdDate; } if (mindDate) { // 自定义:最小日期 tempView.ba_minDate = mindDate; } /** 是否显示背景年份水印,默认:NO */ tempView.isShowBackgroundYearLabel = YES; // 是否显示 pickview title // tempView.isShowTitle = NO; // 自定义 pickview title 的字体颜色 tempView.ba_pickViewTitleColor = BAKit_Color_Red_pod; // 自定义 pickview title 的字体 tempView.ba_pickViewTitleFont = [UIFont boldSystemFontOfSize:15]; // 自定义 pickview背景 title 的字体颜色 // tempView.ba_bgYearTitleColor = [UIColor orangeColor]; // // 自定义 pickview背景 title 的字体 // tempView.ba_bgYearTitleFont = [UIFont systemFontOfSize:50]; // 自定义:动画样式 tempView.animationType = BAKit_PickerViewAnimationTypeBottom; // 自定义:pickView 位置 // tempView.pickerViewPositionType = BAKit_PickerViewPositionTypeCenter; // 自定义:toolBar 位置 // tempView.buttonPositionType = BAKit_PickerViewButtonPositionTypeBottom; // 自定义:pickView 文字颜色 tempView.ba_pickViewTextColor = [UIColor redColor]; // 自定义:pickView 文字字体 tempView.ba_pickViewFont = [UIFont systemFontOfSize:13]; // 可以自由定制按钮颜色 tempView.ba_buttonTitleColor_sure = [UIColor redColor]; tempView.ba_buttonTitleColor_cancle = [UIColor greenColor]; // 可以自由定制 toolBar 和 pickView 的背景颜色 // tempView.ba_backgroundColor_toolBar = [UIColor cyanColor]; // tempView.ba_backgroundColor_pickView = [UIColor greenColor]; } block:^(NSString *resultString) { BAKit_ShowAlertWithMsg_ios8(resultString); }]; } 其他示例可下载demo查看源码! ``` ## 5、更新记录:【倒叙】 欢迎使用 [【BAHome】](https://github.com/BAHome) 系列开源代码 ! 如有更多需求,请前往:[【https://github.com/BAHome】](https://github.com/BAHome) 最新更新时间:2019-9-03 【倒叙】 <br> 最新Version:【Version:1.1.9】 <br> 更新内容: <br> 1.1.9.1、优化适配异形屏,优化部分动画性能 <br> 1.1.9.2、`BAKit_PickerView` 系统 `UIDatePicker` 新增 最大最小日期 设置<br> 1.1.9.3、`BAKit_PickerView` 新增 toolBarView 底部线条,isShowTooBarBottomeLine ,可自定义线条颜色<br> 最新更新时间:2019-8-30 【倒叙】 <br> 最新Version:【Version:1.1.8】 <br> 更新内容: <br> 1.1.8.1、优化适配异形屏,优化部分动画性能,(感谢git网友 [@李智慧](https://github.com/luobojiangzi ) 同学提出的 bug!) <br> 最新更新时间:2019-8-20 【倒叙】 <br> 最新Version:【Version:1.1.7】 <br> 更新内容: <br> 1.1.7.1、修复部分自定义日期大小数值去错问题,(感谢git网友 [@李智慧](https://github.com/luobojiangzi ) 同学提出的 bug!) <br> 最新更新时间:2019-2-27 【倒叙】 <br> 最新Version:【Version:1.1.6】 <br> 更新内容: <br> 1.1.6.1、修复部分自定义数组取值不全的问题,(感谢简书网友 [@徐国伟](https://www.jianshu.com/u/cabe0049e1bc ) 同学提出的 bug!) <br> 最新更新时间:2017-12-13 【倒叙】 <br> 最新Version:【Version:1.1.4】 <br> 更新内容: <br> 1.1.4.1、修复 城市选择器 plist 文件读取失败后崩溃的 bug ,新增【城市数据读取失败】打印 log和弹框提示!(感谢简书网友 [@不会凉的黄花菜](http://www.jianshu.com/u/5b75c9f02124 ) 同学提出的 bug!) <br> 最新更新时间:2017-11-02 【倒叙】 <br> 最新Version:【Version:1.1.3】 <br> 更新内容: <br> 1.1.3.1、完美适配 iOS 11 和 iPhone X <br> 最新更新时间:2017-10-08 【倒叙】 <br> 最新Version:【Version:1.1.2】 <br> 更新内容: <br> 1.1.2.1、日期选择器 新增背景年份水印显示 <br> 1.1.2.2、优化部分注释 <br> 最新更新时间:2017-09-01 【倒叙】 <br> 最新Version:【Version:1.1.1】 <br> 更新内容: <br> 1.1.1.1、日期选择器 修复顶部结果显示异常的问题,,详见 demo <br> 最新更新时间:2017-08-05 【倒叙】 <br> 最新Version:【Version:1.1.0】 <br> 更新内容: <br> 1.1.0.1、日期选择器新增 优化了最大最小年份月份的写法,现在可以自由定义最大最小日期了,详见 demo <br> 1.1.0.2、新增 选中结果直接显示在 工具栏的中间,且可以自定义颜色、字体 <br> 1.1.0.3、修复日期选择器横竖屏不适配的 bug <br> 最新更新时间:2017-07-18 【倒叙】 <br> 最新Version:【Version:1.0.9】 <br> 更新内容: <br> 1.0.9.1、日期选择器新增 最大月份限制(感谢简书网友 [@洁简](http://www.jianshu.com/u/62f0c72a2004) 同学提出的 需求!) <br> 最新更新时间:2017-07-17 【倒叙】 <br> 最新Version:【Version:1.0.8】 <br> 更新内容: <br> 1.0.8.1、新增分割线开关和分割线颜色自定义(感谢群里 [@杭州-可米](https://github.com/fan-xiang) 和 [@紫暄](https://github.com/rainy0426)同学提出的 需求!) <br> 最新更新时间:2017-06-28 【倒叙】 <br> 最新Version:【Version:1.0.7】 <br> 更新内容: <br> 1.0.7.1、修复 日期选择器 不同样式下错乱的 bug(感谢群里 [@西瓜Sama](https://github.com/lipengda) 同学提出的 bug!) <br> 最新更新时间:2017-06-23 【倒叙】 <br> 最新Version:【Version:1.0.6】 <br> 更新内容: <br> 1.0.6.1、优化部分宏定义 <br> 最新更新时间:2017-06-22 【倒叙】 <br> 最新Version:【Version:1.0.5】 <br> 更新内容: <br> 1.0.5.1、新增 多种动画样式 <br> 最新更新时间:2017-06-19 【倒叙】 <br> 最新Version:【Version:1.0.4】 <br> 更新内容: <br> 1.0.4.1、新增 各种自定义 datePicker:年、年月、年月日、时间等等,你能想到的效果都有 <br> 1.0.4.2、可以自定义 datePicker 的字体颜色、字体、字体大小、背景颜色等 <br> 1.0.4.3、可以自定义 datePicker 的最大、最小年限 <br> 1.0.4.4、可以自定义 datePicker 的 toolBar 位置、字体、背景颜色等 最新更新时间:2017-06-03 【倒叙】 <br> 最新Version:【Version:1.0.3】 <br> 更新内容: <br> 1.0.3.1、可以自由设置 pickView 居中或者在底部显示,还可以自由定制 toolbar 居中或者在底部显示 <br> 1.0.3.2、可以自由设置 pickView 字体、字体颜色等内容,注意:日期选择器暂时不能修改字体,有可能被苹果审核不通过,如有特殊需求,可通过 runtime 修改 <br> 最新更新时间:2017-05-27 【倒叙】 <br> 最新Version:【Version:1.0.2】 <br> 更新内容: <br> 1.0.2.1、新增进出场动画,缩放、上下左右展示、消失动画 <br> 1.0.2.2、修复 isTouchEdgeHide 失效的 bug <br> 最新更新时间:2017-05-22 【倒叙】 <br> 最新Version:【Version:1.0.1】 <br> 更新内容: <br> 1.0.1.1、新增年周选择器,如:2017年,第21周 <br> 最新更新时间:2017-05-16 【倒叙】 <br> 最新Version:【Version:1.0.0】 <br> 更新内容: <br> 1.0.0.1、城市选择器,三级联动,可返回省市县和精确的经纬度 <br> 1.0.0.2、可以自定义 array 显示,性别选择等【目前只支持单行数据】 <br> 1.0.0.3、日期选择器:年月日,可以完全自定义 NSDateFormatter <br> 1.0.0.4、日期选择器:年月,可以完全自定义 NSDateFormatter <br> 1.0.0.5、横竖屏适配完美 <br> 1.0.0.6、可以自定义按钮颜色、背景颜色等 <br> 1.0.0.7、理论完全兼容现有所有 iOS 系统版本 <br> ## 6、bug 反馈 > 1、开发中遇到 bug,希望小伙伴儿们能够及时反馈与我们 [【BAHome】](https://github.com/BAHome) 团队,我们必定会认真对待每一个问题! <br> > 2、以后提需求和 bug 的同学,记得把 git 或者博客链接给我们,我直接超链到你们那里!希望大家积极参与测试!<br> ## 7、BAHome 团队成员 > 1、QQ 群 479663605 <br> 【注意:此群为 2 元 付费群,介意的小伙伴儿勿扰!】<br> > 孙博岩 <br> QQ:137361770 <br> git:[https://github.com/boai](https://github.com/boai) <br> 简书:[http://www.jianshu.com/u/95c9800fdf47](http://www.jianshu.com/u/95c9800fdf47) <br> 微博:[![](https://img.shields.io/badge/微博-博爱1616-red.svg)](http://weibo.com/538298123) <br> > 马景丽 <br> QQ:1253540493 <br> git:[https://github.com/MaJingli](https://github.com/MaJingli) <br> > 陆晓峰 <br> QQ:442171865 <br> git:[https://github.com/zeR0Lu](https://github.com/zeR0Lu) <br> > 陈集 <br> QQ:3161182978 <br> git:[https://github.com/chenjipdc](https://github.com/chenjipdc) <br> 简书:[http://www.jianshu.com/u/90ae559fc21d](http://www.jianshu.com/u/90ae559fc21d) > 任子丰 <br> QQ:459643690 <br> git:[https://github.com/renzifeng](https://github.com/renzifeng) <br> > 吴丰收 <br> QQ:498121294 <br> > 石少庸 <br> QQ:363605775 <br> git:[https://github.com/CrazyCoderShi](https://github.com/CrazyCoderShi) <br> 简书:[http://www.jianshu.com/u/0726f4d689a3](http://www.jianshu.com/u/0726f4d689a3) > 丁寅初 <br> QQ:1137155216 <br> git:[https://github.com/1137155216](https://github.com/1137155216) <br> 博客园:[http://www.cnblogs.com/ios-dyc1998](http://www.cnblogs.com/ios-dyc1998) > 权军刚 <br> QQ:906910380 <br> git:[https://github.com/Gang679](https://github.com/Gang679) <br> 简书:[http://www.jianshu.com/u/ab83189244d9](http://www.jianshu.com/u/ab83189244d9) ## 8、开发环境 和 支持版本 > 开发使用 最新版本 Xcode,理论上支持 iOS 9 及以上版本,如有版本适配问题,请及时反馈!多谢合作! ## 9、感谢 > 感谢 [【BAHome】](https://github.com/BAHome) 团队成员倾力合作,后期会推出一系列 常用 UI 控件的封装,大家有需求得也可以在 issue 提出,如果合理,我们会尽快推出新版本!<br> > [【BAHome】](https://github.com/BAHome) 的发展离不开小伙伴儿的信任与推广,再次感谢各位小伙伴儿的支持!
{ "pile_set_name": "Github" }
ui: tape scripts: - ./test/_polyfill.js browsers: - name: safari version: latest - name: ie version: 8..latest - name: microsoftedge version: 13..latest - name: android version: 4.4..latest - name: iphone version: latest
{ "pile_set_name": "Github" }
################################################################################ # # grep # ################################################################################ GREP_VERSION = 2.20 GREP_SITE = $(BR2_GNU_MIRROR)/grep GREP_SOURCE = grep-$(GREP_VERSION).tar.xz GREP_LICENSE = GPLv3+ GREP_LICENSE_FILES = COPYING GREP_CONF_OPTS = --disable-perl-regexp \ $(if $(BR2_TOOLCHAIN_USES_MUSL),--with-included-regex) GREP_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) # link with iconv if enabled ifeq ($(BR2_PACKAGE_LIBICONV),y) GREP_CONF_ENV += LIBS=-liconv GREP_DEPENDENCIES += libiconv endif # link with pcre if enabled ifeq ($(BR2_PACKAGE_PCRE),y) GREP_CONF_OPTS += --enable-perl-regexp GREP_DEPENDENCIES += pcre endif # Full grep preferred over busybox grep ifeq ($(BR2_PACKAGE_BUSYBOX),y) GREP_DEPENDENCIES += busybox endif $(eval $(autotools-package))
{ "pile_set_name": "Github" }
package com.pacoapp.paco.shared.model; import java.io.Serializable; public class SignalTimeDAO implements Serializable { public static final int FIXED_TIME = 0; public static final int OFFSET_TIME = 1; public static final int OFFSET_BASIS_SCHEDULED_TIME = 0; public static final int OFFSET_BASIS_RESPONSE_TIME = 1; public static final int MISSED_BEHAVIOR_SKIP = 0; public static final int MISSED_BEHAVIOR_USE_SCHEDULED_TIME = 1; public static final int OFFSET_TIME_DEFAULT = 30 * 60 * 1000; // 30 minutes private int type; // fixed time or offset private int fixedTimeMillisFromMidnight; private int basis; // from previous scheduledTime, from previous responseTime private int offsetTimeMillis; private int missedBasisBehavior; // skip this time, use previousScheduledTime private Long id; private String label; public SignalTimeDAO(Long id, int type2, int basis2, int fixedTimeMillisFromMidnight2, int missedBasisBehavior2, int offsetTimeMillis2, String label) { this.id = id; this.type = type2; this.basis = basis2; this.fixedTimeMillisFromMidnight = fixedTimeMillisFromMidnight2; this.missedBasisBehavior = missedBasisBehavior2; this.offsetTimeMillis = offsetTimeMillis2; this.label = label; } public SignalTimeDAO() { // TODO Auto-generated constructor stub } public int getType() { return type; } public void setType(int type) { this.type = type; } public int getFixedTimeMillisFromMidnight() { return fixedTimeMillisFromMidnight; } public void setFixedTimeMillisFromMidnight(int fixedTimeMillisFromMidnight) { this.fixedTimeMillisFromMidnight = fixedTimeMillisFromMidnight; } public int getBasis() { return basis; } public void setBasis(int basis) { this.basis = basis; } public int getOffsetTimeMillis() { return offsetTimeMillis; } public void setOffsetTimeMillis(int offsetTimeMillis) { this.offsetTimeMillis = offsetTimeMillis; } public int getMissedBasisBehavior() { return missedBasisBehavior; } public void setMissedBasisBehavior(int missedBasisBehavior) { this.missedBasisBehavior = missedBasisBehavior; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getLabel() { return label; } public void setLabel(String label) { this.label = label; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="13F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES"> <dependencies> <deployment version="1070" identifier="macosx"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/> </dependencies> <objects> <customObject id="-2" userLabel="File's Owner" customClass="HIWizardBackupViewController"> <connections> <outlet property="view" destination="1" id="2"/> </connections> </customObject> <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> <customObject id="-3" userLabel="Application" customClass="NSObject"/> <customView id="1"> <rect key="frame" x="0.0" y="0.0" width="850" height="650"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <subviews> <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="J19-Tc-gPi"> <rect key="frame" x="375" y="470" width="100" height="100"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <constraints> <constraint firstAttribute="width" constant="100" id="h3f-ZZ-8Lg"/> <constraint firstAttribute="height" constant="100" id="oEG-Hc-T4Z"/> </constraints> <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="Icon" id="YoY-sh-puc"/> </imageView> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="mdk-zD-vWi"> <rect key="frame" x="231" y="379" width="388" height="51"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="پیکربندی پشتیبان" id="I10-iV-C0e"> <font key="font" metaFont="systemBold" size="42"/> <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gDC-Cm-H3d"> <rect key="frame" x="392" y="59" width="67" height="23"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <buttonCell key="cell" type="smallSquare" title="گام بعدی" bezelStyle="smallSquare" imagePosition="overlaps" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="j0E-b4-dgh" customClass="HIWizardButtonCell"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <font key="font" metaFont="system"/> </buttonCell> <connections> <action selector="nextButtonPressed:" target="-2" id="dES-jo-C6H"/> </connections> </button> <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7tM-tg-fXa"> <rect key="frame" x="700" y="241" width="48" height="23"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <buttonCell key="cell" type="smallSquare" title="فعال" bezelStyle="smallSquare" imagePosition="overlaps" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="f0R-BI-Nz4" customClass="HIWizardSmallButtonCell"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <font key="font" metaFont="system"/> </buttonCell> <connections> <action selector="enable1:" target="-2" id="jR5-70-I6z"/> <binding destination="-2" name="title" keyPath="title1" id="u0M-fU-cOt"/> </connections> </button> <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="REW-5C-7nv"> <rect key="frame" x="700" y="180" width="48" height="23"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <buttonCell key="cell" type="smallSquare" title="فعال" bezelStyle="smallSquare" imagePosition="overlaps" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="lG8-G7-noh" customClass="HIWizardSmallButtonCell"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <font key="font" metaFont="system"/> </buttonCell> <connections> <action selector="enable2:" target="-2" id="ace-Xl-vwl"/> <binding destination="-2" name="title" keyPath="title2" id="iXP-VI-sgl"/> </connections> </button> <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="0Gn-sQ-ZVg"> <rect key="frame" x="123" y="314" width="604" height="57"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <constraints> <constraint firstAttribute="width" constant="600" id="Jn9-t9-FWD"/> <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="57" id="glQ-rH-ZKG"/> </constraints> <textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" id="rIc-eX-ajY"> <font key="font" metaFont="system" size="16"/> <string key="title">تهیه نسخه پشتیبان از کیف پول شما یک معیار امنیتی برای محافظت از کیف پول شما می باشد. بیایید همین حالا از کیف پولتان یک نسخه پشتیبان تهیه کنید. تا اگر حتی کامپیوترتان را از دست دادید، هایو می تواند از این منابع پول شما را بازیابی کند.</string> <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="J7o-F8-7f2"> <rect key="frame" x="174" y="228" width="48" height="48"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <constraints> <constraint firstAttribute="width" constant="42" id="dAz-ic-wy2"/> <constraint firstAttribute="height" constant="42" id="haT-oQ-OfY"/> </constraints> <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" imageFrameStyle="grayBezel" id="g8D-Wb-PMk"/> <connections> <binding destination="-2" name="value" keyPath="icon1" id="Ng6-xr-hub"/> </connections> </imageView> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="a95-bf-yFn"> <rect key="frame" x="232" y="243" width="101" height="19"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="&lt;backup 1>" id="R62-02-u5f"> <font key="font" metaFont="system" size="16"/> <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> <connections> <binding destination="-2" name="value" keyPath="name1" id="wzB-yo-a1l"/> </connections> </textField> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="KYW-eP-TpU"> <rect key="frame" x="232" y="182" width="101" height="19"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="&lt;backup 2>" id="Nax-LU-ZGP"> <font key="font" metaFont="system" size="16"/> <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> <connections> <binding destination="-2" name="value" keyPath="name2" id="VaS-kd-CE9"/> </connections> </textField> <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="VrC-gm-QNl"> <rect key="frame" x="174" y="167" width="48" height="48"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <constraints> <constraint firstAttribute="width" constant="42" id="KFo-Js-WTn"/> <constraint firstAttribute="height" constant="42" id="j01-q7-YGo"/> </constraints> <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" imageFrameStyle="grayBezel" id="8oa-4a-z8g"/> <connections> <binding destination="-2" name="value" keyPath="icon2" id="wB3-8P-XIJ"/> </connections> </imageView> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Vfw-zr-Iz9"> <rect key="frame" x="548" y="243" width="83" height="19"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="فعال شده است" id="OI0-bL-7Zs"> <font key="font" metaFont="system" size="16"/> <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> <connections> <binding destination="-2" name="hidden" keyPath="enabled1" id="SNV-sa-gO0"> <dictionary key="options"> <string key="NSValueTransformerName">NSNegateBoolean</string> </dictionary> </binding> </connections> </textField> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kvT-RL-uZq"> <rect key="frame" x="548" y="241" width="85" height="20"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="غیر فعال شده است" id="M9O-91-CDX"> <font key="font" size="16" name="ZapfDingbatsITC"/> <color key="textColor" red="0.86645009566326525" green="0.54672967535343253" blue="0.47391934301160576" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> <connections> <binding destination="-2" name="hidden" keyPath="enabled1" id="LWY-gp-o1s"/> </connections> </textField> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="faS-RI-DlM"> <rect key="frame" x="548" y="180" width="85" height="20"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="غیر فعال شده است" id="NSS-6s-Nas"> <font key="font" size="16" name="ZapfDingbatsITC"/> <color key="textColor" red="0.86645009569999998" green="0.54672967539999995" blue="0.47391934299999999" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> <connections> <binding destination="-2" name="hidden" keyPath="enabled2" id="KX9-sm-ngV"/> </connections> </textField> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5f4-M2-QLk"> <rect key="frame" x="548" y="182" width="83" height="19"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="فعال شده است" id="KqD-DN-1Yk"> <font key="font" metaFont="system" size="16"/> <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> <connections> <binding destination="-2" name="hidden" keyPath="enabled2" id="8l5-ea-qJ2"> <dictionary key="options"> <string key="NSValueTransformerName">NSNegateBoolean</string> </dictionary> </binding> </connections> </textField> </subviews> <constraints> <constraint firstItem="7tM-tg-fXa" firstAttribute="baseline" secondItem="a95-bf-yFn" secondAttribute="baseline" id="2fE-00-Vam"/> <constraint firstAttribute="centerX" secondItem="mdk-zD-vWi" secondAttribute="centerX" id="2kL-8E-36b"/> <constraint firstItem="kvT-RL-uZq" firstAttribute="baseline" secondItem="Vfw-zr-Iz9" secondAttribute="baseline" id="3SJ-Tm-9jh"/> <constraint firstItem="VrC-gm-QNl" firstAttribute="top" secondItem="J7o-F8-7f2" secondAttribute="bottom" constant="19" id="4zV-bs-8FG"/> <constraint firstItem="J7o-F8-7f2" firstAttribute="top" secondItem="0Gn-sQ-ZVg" secondAttribute="bottom" constant="41" id="4zn-Uu-Zjj"/> <constraint firstItem="J19-Tc-gPi" firstAttribute="top" secondItem="1" secondAttribute="top" constant="80" id="88u-ix-KK1"/> <constraint firstItem="a95-bf-yFn" firstAttribute="baseline" secondItem="Vfw-zr-Iz9" secondAttribute="baseline" id="9Nd-a4-80X"/> <constraint firstItem="kvT-RL-uZq" firstAttribute="leading" secondItem="Vfw-zr-Iz9" secondAttribute="leading" id="Gw3-yu-tNL"/> <constraint firstItem="5f4-M2-QLk" firstAttribute="leading" secondItem="faS-RI-DlM" secondAttribute="leading" id="KSS-ew-I9j"/> <constraint firstItem="J7o-F8-7f2" firstAttribute="leading" secondItem="1" secondAttribute="leading" constant="177" id="KzO-e7-cod"/> <constraint firstItem="7tM-tg-fXa" firstAttribute="trailing" secondItem="REW-5C-7nv" secondAttribute="trailing" id="OkI-f1-Hzx"/> <constraint firstItem="7tM-tg-fXa" firstAttribute="leading" secondItem="REW-5C-7nv" secondAttribute="leading" id="QEr-VH-hlH"/> <constraint firstItem="REW-5C-7nv" firstAttribute="baseline" secondItem="KYW-eP-TpU" secondAttribute="baseline" id="T3N-82-bdg"/> <constraint firstItem="KYW-eP-TpU" firstAttribute="leading" secondItem="VrC-gm-QNl" secondAttribute="trailing" constant="15" id="TTY-JH-MgY"/> <constraint firstAttribute="centerX" secondItem="gDC-Cm-H3d" secondAttribute="centerX" id="WGS-IL-M2j"/> <constraint firstAttribute="centerX" secondItem="0Gn-sQ-ZVg" secondAttribute="centerX" id="WnZ-Wm-UYh"/> <constraint firstItem="mdk-zD-vWi" firstAttribute="top" secondItem="J19-Tc-gPi" secondAttribute="bottom" constant="40" id="ZEk-gO-Ry9"/> <constraint firstItem="7tM-tg-fXa" firstAttribute="leading" secondItem="1" secondAttribute="leading" constant="700" id="aY5-Io-wE2"/> <constraint firstAttribute="bottom" secondItem="gDC-Cm-H3d" secondAttribute="bottom" constant="60" id="bNu-ow-W56"/> <constraint firstItem="J7o-F8-7f2" firstAttribute="centerY" secondItem="a95-bf-yFn" secondAttribute="centerY" constant="0.5" id="cse-rl-u5L"/> <constraint firstItem="J7o-F8-7f2" firstAttribute="trailing" secondItem="VrC-gm-QNl" secondAttribute="trailing" id="ggb-yE-1BP"/> <constraint firstItem="Vfw-zr-Iz9" firstAttribute="leading" secondItem="1" secondAttribute="leading" constant="550" id="hJx-1S-CDR"/> <constraint firstItem="5f4-M2-QLk" firstAttribute="baseline" secondItem="faS-RI-DlM" secondAttribute="baseline" id="hbd-ch-egu"/> <constraint firstItem="5f4-M2-QLk" firstAttribute="baseline" secondItem="KYW-eP-TpU" secondAttribute="baseline" id="oQB-Q6-Hpa"/> <constraint firstItem="a95-bf-yFn" firstAttribute="leading" secondItem="J7o-F8-7f2" secondAttribute="trailing" constant="15" id="oxp-ru-y6q"/> <constraint firstItem="0Gn-sQ-ZVg" firstAttribute="top" secondItem="mdk-zD-vWi" secondAttribute="bottom" constant="8" id="ss7-rd-uia"/> <constraint firstItem="5f4-M2-QLk" firstAttribute="leading" secondItem="Vfw-zr-Iz9" secondAttribute="leading" id="tvL-oC-iBZ"/> <constraint firstItem="VrC-gm-QNl" firstAttribute="centerY" secondItem="KYW-eP-TpU" secondAttribute="centerY" constant="0.5" id="xbZ-Iu-4AL"/> <constraint firstAttribute="centerX" secondItem="J19-Tc-gPi" secondAttribute="centerX" id="yCa-GG-u1A"/> </constraints> </customView> </objects> <resources> <image name="Icon" width="512" height="512"/> </resources> </document>
{ "pile_set_name": "Github" }
""" TUNIT: Truly Unsupervised Image-to-Image Translation Copyright (c) 2020-present NAVER Corp. MIT license """ from tqdm import trange from torch.nn import functional as F import torch.nn import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed from tools.utils import * from tools.ops import compute_grad_gp, update_average, copy_norm_params, calc_iic_loss, \ queue_data, dequeue_data, average_gradients, calc_adv_loss, calc_contrastive_loss, calc_recon_loss def trainGAN_SEMI(data_loader, networks, opts, epoch, args, additional): # avg meter d_losses = AverageMeter() d_advs = AverageMeter() d_gps = AverageMeter() g_losses = AverageMeter() g_advs = AverageMeter() g_imgrecs = AverageMeter() g_styconts = AverageMeter() c_losses = AverageMeter() moco_losses = AverageMeter() iic_losses = AverageMeter() ce_losses = AverageMeter() # set nets D = networks['D'] G = networks['G'] if not args.distributed else networks['G'].module C = networks['C'] if not args.distributed else networks['C'].module G_EMA = networks['G_EMA'] if not args.distributed else networks['G_EMA'].module C_EMA = networks['C_EMA'] if not args.distributed else networks['C_EMA'].module # set opts d_opt = opts['D'] g_opt = opts['G'] c_opt = opts['C'] # switch to train mode D.train() G.train() C.train() G_EMA.train() C_EMA.train() logger = additional['logger'] queue = additional['queue'] train_sup_it = iter(data_loader['SUP']) train_unsup_it = iter(data_loader['UNSUP']) sup_iter_tmp = int(args.iters * args.p_semi) sup_iter_tmp = 100 if sup_iter_tmp < 100 and epoch < args.unsup_start else sup_iter_tmp sup_iter = sup_iter_tmp un_iter = (args.iters - sup_iter_tmp) if epoch >= args.unsup_start else 0 t_sup = trange(0, sup_iter, initial=0, total=sup_iter) t_un = trange(0, un_iter, initial=0, total=un_iter) for i in t_sup: try: imgs, y_org = next(train_sup_it) except: train_sup_it = iter(data_loader['SUP']) imgs, y_org = next(train_sup_it) x_org = imgs[0] x_tf = imgs[1] x_ref_idx = torch.randperm(x_org.size(0)) x_org = x_org.cuda(args.gpu) x_tf = x_tf.cuda(args.gpu) y_org = y_org.cuda(args.gpu) x_ref_idx = x_ref_idx.cuda(args.gpu) x_ref = x_org.clone() x_ref = x_ref[x_ref_idx] ################# # BEGIN Train C # ################# training_mode = 'SUP' q_cont = C.moco(x_org) k_cont = C_EMA.moco(x_tf) k_cont = k_cont.detach() q_disc = C.iic(x_org) k_disc = C.iic(x_tf) moco_loss = calc_contrastive_loss(args, q_cont, k_cont, queue) ce_loss = F.cross_entropy(q_disc, y_org) + F.cross_entropy(k_disc, y_org) c_loss = moco_loss + 5.0 * ce_loss if epoch >= args.separated: c_loss = 0.1 * c_loss c_opt.zero_grad() c_loss.backward() if args.distributed: average_gradients(C) c_opt.step() ############### # END Train C # ############### if epoch >= args.separated: #################### # BEGIN Train GANs # #################### with torch.no_grad(): y_ref = y_org.clone() y_ref = y_ref[x_ref_idx] s_ref = C.moco(x_ref) c_src = G.cnt_encoder(x_org) x_fake = G.decode(c_src, s_ref) x_ref.requires_grad_() d_real_logit, _ = D(x_ref, y_ref) d_fake_logit, _ = D(x_fake.detach(), y_ref) d_adv_real = calc_adv_loss(d_real_logit, 'd_real') d_adv_fake = calc_adv_loss(d_fake_logit, 'd_fake') d_adv = d_adv_real + d_adv_fake d_gp = args.w_gp * compute_grad_gp(d_real_logit, x_ref, is_patch=False) d_loss = d_adv + d_gp d_opt.zero_grad() d_adv_real.backward(retain_graph=True) d_gp.backward() d_adv_fake.backward() if args.distributed: average_gradients(D) d_opt.step() # Train G s_src = C.moco(x_org) s_ref = C.moco(x_ref) c_src = G.cnt_encoder(x_org) x_fake = G.decode(c_src, s_ref) x_rec = G.decode(c_src, s_src) g_fake_logit, _ = D(x_fake, y_ref) g_rec_logit, _ = D(x_rec, y_org) g_adv_fake = calc_adv_loss(g_fake_logit, 'g') g_adv_rec = calc_adv_loss(g_rec_logit, 'g') g_adv = g_adv_fake + g_adv_rec g_imgrec = calc_recon_loss(x_rec, x_org) s_fake = C.moco(x_fake) s_ref_ema = C_EMA.moco(x_ref) s_ref_ema = s_ref_ema.detach() g_sty_contrastive = calc_contrastive_loss(args, s_fake, s_ref_ema, queue) g_loss = args.w_adv * g_adv + args.w_rec * g_imgrec + args.w_vec * g_sty_contrastive g_opt.zero_grad() c_opt.zero_grad() g_loss.backward() if args.distributed: average_gradients(G) average_gradients(C) c_opt.step() g_opt.step() ################## # END Train GANs # ################## queue = queue_data(queue, k_cont) queue = dequeue_data(queue) if epoch >= args.ema_start: training_mode = training_mode + "_EMA" update_average(G_EMA, G) update_average(C_EMA, C) torch.cuda.synchronize() with torch.no_grad(): if epoch >= args.separated: d_losses.update(d_loss.item(), x_org.size(0)) d_advs.update(d_adv.item(), x_org.size(0)) d_gps.update(d_gp.item(), x_org.size(0)) g_losses.update(g_loss.item(), x_org.size(0)) g_advs.update(g_adv.item(), x_org.size(0)) g_imgrecs.update(g_imgrec.item(), x_org.size(0)) g_styconts.update(g_sty_contrastive.item(), x_org.size(0)) c_losses.update(c_loss.item(), x_org.size(0)) moco_losses.update(moco_loss.item(), x_org.size(0)) ce_losses.update(ce_loss.item(), x_org.size(0)) if (i + 1) % args.log_step == 0 and (args.gpu == 0 or args.gpu == '0'): print('Epoch: [{}/{}] [{}/{}] MODE[{}] Avg Loss: D[{d_losses.avg:.2f}] G[{g_losses.avg:.2f}] ' 'C[{c_losses.avg:.2f}]'.format(epoch + 1, args.epochs, i+1, sup_iter, training_mode, d_losses=d_losses, g_losses=g_losses, c_losses=c_losses)) for i in t_un: try: imgs, _ = next(train_unsup_it) except: train_unsup_it = iter(data_loader['UNSUP']) imgs, _ = next(train_unsup_it) x_org = imgs[0] x_tf = imgs[1] x_ref_idx = torch.randperm(x_org.size(0)) x_org = x_org.cuda(args.gpu) x_tf = x_tf.cuda(args.gpu) x_ref_idx = x_ref_idx.cuda(args.gpu) x_ref = x_org.clone() x_ref = x_ref[x_ref_idx] ################# # BEGIN Train C # ################# training_mode = 'ONLYCLS' q_cont = C.moco(x_org) k_cont = C_EMA.moco(x_tf) k_cont = k_cont.detach() q_disc = C.iic(x_org) k_disc = C.iic(x_tf) q_disc = F.softmax(q_disc, 1) k_disc = F.softmax(k_disc, 1) moco_loss = calc_contrastive_loss(args, q_cont, k_cont, queue) iic_loss = calc_iic_loss(q_disc, k_disc) c_loss = moco_loss + 5.0 * iic_loss c_loss = 0.1 * c_loss c_opt.zero_grad() c_loss.backward() if args.distributed: average_gradients(C) c_opt.step() ############### # END Train C # ############### #################### # BEGIN Train GANs # #################### if epoch >= args.separated: training_mode = 'C2GANs' with torch.no_grad(): y_org = torch.argmax(q_disc, 1) y_ref = y_org.clone() y_ref = y_ref[x_ref_idx] s_ref = C.moco(x_ref) c_src = G.cnt_encoder(x_org) x_fake = G.decode(c_src, s_ref) x_ref.requires_grad_() d_real_logit, _ = D(x_ref, y_ref) d_fake_logit, _ = D(x_fake.detach(), y_ref) d_adv_real = calc_adv_loss(d_real_logit, 'd_real') d_adv_fake = calc_adv_loss(d_fake_logit, 'd_fake') d_adv = d_adv_real + d_adv_fake d_gp = args.w_gp * compute_grad_gp(d_real_logit, x_ref, is_patch=False) d_loss = d_adv + d_gp d_opt.zero_grad() d_adv_real.backward(retain_graph=True) d_gp.backward() d_adv_fake.backward() if args.distributed: average_gradients(D) d_opt.step() # Train G s_src = C.moco(x_org) s_ref = C.moco(x_ref) c_src = G.cnt_encoder(x_org) x_fake = G.decode(c_src, s_ref) x_rec = G.decode(c_src, s_src) g_fake_logit, _ = D(x_fake, y_ref) g_rec_logit, _ = D(x_rec, y_org) g_adv_fake = calc_adv_loss(g_fake_logit, 'g') g_adv_rec = calc_adv_loss(g_rec_logit, 'g') g_adv = g_adv_fake + g_adv_rec g_imgrec = calc_recon_loss(x_rec, x_org) s_fake = C.moco(x_fake) s_ref_ema = C_EMA.moco(x_ref) s_ref_ema = s_ref_ema.detach() g_sty_contrastive = calc_contrastive_loss(args, s_fake, s_ref_ema, queue) g_loss = args.w_adv * g_adv + args.w_rec * g_imgrec + args.w_vec * g_sty_contrastive g_opt.zero_grad() c_opt.zero_grad() g_loss.backward() if args.distributed: average_gradients(G) average_gradients(C) c_opt.step() g_opt.step() ################## # END Train GANs # ################## queue = queue_data(queue, k_cont) queue = dequeue_data(queue) if epoch >= args.ema_start: training_mode = training_mode + "_EMA" update_average(G_EMA, G) update_average(C_EMA, C) torch.cuda.synchronize() with torch.no_grad(): if epoch >= args.separated: d_losses.update(d_loss.item(), x_org.size(0)) d_advs.update(d_adv.item(), x_org.size(0)) d_gps.update(d_gp.item(), x_org.size(0)) g_losses.update(g_loss.item(), x_org.size(0)) g_advs.update(g_adv.item(), x_org.size(0)) g_imgrecs.update(g_imgrec.item(), x_org.size(0)) g_styconts.update(g_sty_contrastive.item(), x_org.size(0)) c_losses.update(c_loss.item(), x_org.size(0)) iic_losses.update(iic_loss.item(), x_org.size(0)) moco_losses.update(moco_loss.item(), x_org.size(0)) if (i + 1) % args.log_step == 0 and (args.gpu == 0 or args.gpu == '0'): summary_step = epoch * args.iters + i add_logs(args, logger, 'D/LOSS', d_losses.avg, summary_step) add_logs(args, logger, 'D/ADV', d_advs.avg, summary_step) add_logs(args, logger, 'D/GP', d_gps.avg, summary_step) add_logs(args, logger, 'G/LOSS', g_losses.avg, summary_step) add_logs(args, logger, 'G/ADV', g_advs.avg, summary_step) add_logs(args, logger, 'G/IMGREC', g_imgrecs.avg, summary_step) add_logs(args, logger, 'G/STYCONT', g_styconts.avg, summary_step) add_logs(args, logger, 'C/LOSS', c_losses.avg, summary_step) add_logs(args, logger, 'C/IID', iic_losses.avg, summary_step) add_logs(args, logger, 'C/MOCO', moco_losses.avg, summary_step) add_logs(args, logger, 'C/CE', ce_losses.avg, summary_step) print('Epoch: [{}/{}] [{}/{}] MODE[{}] Avg Loss: D[{d_losses.avg:.2f}] G[{g_losses.avg:.2f}] ' 'C[{c_losses.avg:.2f}]'.format(epoch + 1, args.epochs, i+1, un_iter, training_mode, d_losses=d_losses, g_losses=g_losses, c_losses=c_losses)) copy_norm_params(G_EMA, G) copy_norm_params(C_EMA, C)
{ "pile_set_name": "Github" }
/*********************************************************\ * File: GraphNode.cpp * * * Copyright (C) 2002-2013 The PixelLight Team (http://www.pixellight.org/) * * This file is part of PixelLight. * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or * substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \*********************************************************/ //[-------------------------------------------------------] //[ Includes ] //[-------------------------------------------------------] #include "PLMath/Graph/GraphNode.h" //[-------------------------------------------------------] //[ Namespace ] //[-------------------------------------------------------] using namespace PLCore; namespace PLMath { //[-------------------------------------------------------] //[ Main functions ] //[-------------------------------------------------------] /** * @brief * Constructor */ GraphNode::GraphNode(const String &sName, ElementManager<GraphNode> *pManager) : Element<GraphNode>(sName, pManager) { } /** * @brief * Constructor */ GraphNode::GraphNode(GraphNode &cSource) { // Copy data *this = cSource; } /** * @brief * Destructor */ GraphNode::~GraphNode() { ClearNeighbours(); } //[-------------------------------------------------------] //[ Neighbours ] //[-------------------------------------------------------] /** * @brief * Returns the number of neighbours */ uint32 GraphNode::GetNumOfNeighbours() const { return m_lstNeighbours.GetNumOfElements(); } /** * @brief * Clears all neighbour connectivity */ void GraphNode::ClearNeighbours() { { // Update neighbour connections Iterator<GraphNode*> cIterator = m_lstIsNeighbourFrom.GetIterator(); while (cIterator.HasNext()) { // Remove this node from the neighbours connectivity list cIterator.Next()->RemoveNeighbour(*this); } } m_lstIsNeighbourFrom.Clear(); { // Clear neighbours Iterator<Neighbour*> cIterator = m_lstNeighbours.GetIterator(); while (cIterator.HasNext()) { Neighbour *pNN = cIterator.Next(); pNN->pNode->m_lstIsNeighbourFrom.Remove(this); delete pNN; } } m_lstNeighbours.Clear(); } /** * @brief * Returns whether a node is a neighbour of this node or not */ bool GraphNode::IsNeighbour(const GraphNode &cNode) const { // Check whether the given node is a neighbour of this node or not Iterator<Neighbour*> cIterator = m_lstNeighbours.GetIterator(); while (cIterator.HasNext()) { if (cIterator.Next()->pNode == &cNode) { // The given node is a neighbour of this node return true; } } // The given node is no neighbour of this node return false; } /** * @brief * Returns a neighbour */ const GraphNode *GraphNode::GetNeighbour(uint32 nNeighbour) const { const Neighbour *pNeighbour = m_lstNeighbours[nNeighbour]; return pNeighbour ? pNeighbour->pNode : nullptr; } /** * @brief * Returns a neighbour */ GraphNode *GraphNode::GetNeighbour(uint32 nNeighbour) { Neighbour *pNeighbour = m_lstNeighbours[nNeighbour]; return pNeighbour ? pNeighbour->pNode : nullptr; } /** * @brief * Returns the distance to a neighbour */ float GraphNode::GetNeighbourDistance(uint32 nNeighbour) const { const Neighbour *pNeighbour = m_lstNeighbours[nNeighbour]; return pNeighbour ? pNeighbour->fDistance : -1.0f; } /** * @brief * Adds a neighbour connection */ bool GraphNode::AddNeighbour(GraphNode &cNode, float fDistance) { // Is this node already a neighbour of this node? if (!IsNeighbour(cNode)) { // Add node Neighbour *pNeighbour = new Neighbour(); m_lstNeighbours.Add(pNeighbour); pNeighbour->pNode = &cNode; pNeighbour->fDistance = (fDistance < 0.0f) ? GetDistance(cNode) : fDistance; cNode.m_lstIsNeighbourFrom.Add(this); // Done return true; } // Error! return false; } /** * @brief * Removes a neighbour connection */ bool GraphNode::RemoveNeighbour(GraphNode &cNode) { // Find neighbour list entry Neighbour *pNeighbour = nullptr; { Iterator<Neighbour*> cIterator = m_lstNeighbours.GetIterator(); while (cIterator.HasNext()) { Neighbour *pNeighbourT = cIterator.Next(); if (pNeighbourT->pNode == &cNode) { pNeighbour = pNeighbourT; break; } } } // Remove if (pNeighbour) { cNode.m_lstIsNeighbourFrom.Remove(this); delete pNeighbour; m_lstNeighbours.Remove(pNeighbour); // Done return true; } else return false; // Error! } /** * @brief * Removes a neighbour connection at the given index */ bool GraphNode::RemoveNeighbourAtIndex(uint32 nNeighbour) { Neighbour *pNeighbour = m_lstNeighbours[nNeighbour]; if (pNeighbour) { pNeighbour->pNode->m_lstIsNeighbourFrom.Remove(this); delete pNeighbour; m_lstNeighbours.RemoveAtIndex(nNeighbour); // Done return true; } else return false; // Error! } //[-------------------------------------------------------] //[ Position ] //[-------------------------------------------------------] /** * @brief * Returns the node position */ const Vector3 &GraphNode::GetPos() const { return m_vPos; } /** * @brief * Sets the node position */ void GraphNode::SetPos(const Vector3 &vPos) { SetPos(vPos.x, vPos.y, vPos.z); } /** * @brief * Sets the node position */ void GraphNode::SetPos(float fX, float fY, float fZ) { // Set new position m_vPos.SetXYZ(fX, fY, fZ); { // Calculate all node distances Iterator<Neighbour*> cIterator = m_lstNeighbours.GetIterator(); while (cIterator.HasNext()) { Neighbour *pNeighbour = cIterator.Next(); pNeighbour->fDistance = GetDistance(*pNeighbour->pNode); } } { // Update all neighbour node distances Iterator<GraphNode*> cIterator = m_lstIsNeighbourFrom.GetIterator(); while (cIterator.HasNext()) { // Find this node within the neighbour Iterator<Neighbour*> cNeighbourIterator = cIterator.Next()->m_lstNeighbours.GetIterator(); while (cNeighbourIterator.HasNext()) { Neighbour *pNeighbour = cNeighbourIterator.Next(); if (pNeighbour->pNode == this) { pNeighbour->fDistance = GetDistance(*pNeighbour->pNode); break; } } } } } /** * @brief * Returns the distance between two graph nodes */ float GraphNode::GetDistance(const GraphNode &cNode) const { return (cNode.GetPos()-m_vPos).GetLength(); } //[-------------------------------------------------------] //[ Public virtual PLCore::Element functions ] //[-------------------------------------------------------] GraphNode &GraphNode::operator =(const GraphNode &cSource) { // Call base function *static_cast<Element<GraphNode>*>(this) = cSource; // Copy data m_vPos = cSource.m_vPos; // Return this return *this; } //[-------------------------------------------------------] //[ Namespace ] //[-------------------------------------------------------] } // PLMath
{ "pile_set_name": "Github" }
import * as React from 'react' import Wrapper from '@ui/Wrapper' import { Header, Fallback } from './Header' import { RouteComponentProps } from 'react-router-dom' import { Chat } from '@ui/Chat' import { Messages } from './Messages' import { Loading } from '@ui/Overlays' import {inject, observer} from "mobx-react"; import {AuthStore} from "@store/auth"; type MessageProps = RouteComponentProps<{ guild: string channel: string }> interface Props { match: { params: { channel: string, guild: string // TODO: lmao } } } @observer export class MessagesView extends React.PureComponent<Props> { render() { return ( <Wrapper> <React.Suspense fallback={<Fallback />}> <Header channel={this.props.match.params.channel} guild={this.props.match.params.guild}/> </React.Suspense> <React.Suspense fallback={<Loading />}> <Messages guild={this.props.match.params.guild} channel={this.props.match.params.channel} /> </React.Suspense> <Chat /> </Wrapper> ) } }
{ "pile_set_name": "Github" }
/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1alpha1
{ "pile_set_name": "Github" }
# Yiddish translations for extra package. # Copyright (C) 2020 THE extra'S COPYRIGHT HOLDER # This file is distributed under the same license as the extra package. # Automatically generated, 2020. # msgid "" msgstr "" "Project-Id-Version: extra\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-03-17 11:10-0700\n" "PO-Revision-Date: 2020-03-17 11:10-0700\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" "Language: yi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ASCII\n" "Content-Transfer-Encoding: 8bit\n" #: data/stylesheet.appdata.xml.in:8 msgid "Greenfield" msgstr "" #: data/stylesheet.appdata.xml.in:9 msgid "The Gtk Stylesheet for elementary OS" msgstr "" #: data/stylesheet.appdata.xml.in:11 msgid "" "An original Gtk.CSS stylesheet designed specifically for elementary OS and " "its desktop environment: Pantheon." msgstr "" #: data/stylesheet.appdata.xml.in:54 msgid "elementary, Inc." msgstr ""
{ "pile_set_name": "Github" }
julia 0.6 2- ModuleInterfaceTools 0.1.6
{ "pile_set_name": "Github" }
&FORCE_EVAL METHOD Quickstep &DFT BASIS_SET_FILE_NAME BASIS_SET POTENTIAL_FILE_NAME POTENTIAL &MGRID CUTOFF 200 &END MGRID &QS EPS_DEFAULT 1.0E-12 &END QS &SCF EPS_DIIS 0.1 EPS_SCF 1.0E-8 MAX_DIIS 4 MAX_SCF 3 SCF_GUESS atomic &END SCF &XC &XC_FUNCTIONAL PBE &END XC_FUNCTIONAL &XC_GRID XC_DERIV SPLINE2_smooth XC_SMOOTH_RHO NN10 &END XC_GRID &END XC &END DFT &SUBSYS &CELL ABC 12.0 4.0 4.0 &END CELL &COORD Ar 0.000000 0.000000 0.000000 Ar 4.000000 0.000000 0.000000 Ar 8.000000 0.000000 0.000000 &END COORD &KIND Ar BASIS_SET DZVP-GTH-PADE POTENTIAL GTH-PADE-q8 &END KIND &END SUBSYS &END FORCE_EVAL &GLOBAL PROJECT Ar-9 PRINT_LEVEL MEDIUM &END GLOBAL
{ "pile_set_name": "Github" }
/* SPDX-License-Identifier: GPL-2.0 */ #include <stdarg.h> /* confdata.c */ void conf_parse(const char *name); int conf_read(const char *name); int conf_read_simple(const char *name, int); int conf_write_defconfig(const char *name); int conf_write(const char *name); int conf_write_autoconf(int overwrite); bool conf_get_changed(void); void conf_set_changed_callback(void (*fn)(void)); void conf_set_message_callback(void (*fn)(const char *s)); /* menu.c */ extern struct menu rootmenu; bool menu_is_empty(struct menu *menu); bool menu_is_visible(struct menu *menu); bool menu_has_prompt(struct menu *menu); const char * menu_get_prompt(struct menu *menu); struct menu * menu_get_root_menu(struct menu *menu); struct menu * menu_get_parent_menu(struct menu *menu); bool menu_has_help(struct menu *menu); const char * menu_get_help(struct menu *menu); struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head); void menu_get_ext_help(struct menu *menu, struct gstr *help); /* symbol.c */ extern struct symbol * symbol_hash[SYMBOL_HASHSIZE]; struct symbol * sym_lookup(const char *name, int flags); struct symbol * sym_find(const char *name); const char * sym_escape_string_value(const char *in); struct symbol ** sym_re_search(const char *pattern); const char * sym_type_name(enum symbol_type type); void sym_calc_value(struct symbol *sym); enum symbol_type sym_get_type(struct symbol *sym); bool sym_tristate_within_range(struct symbol *sym,tristate tri); bool sym_set_tristate_value(struct symbol *sym,tristate tri); tristate sym_toggle_tristate_value(struct symbol *sym); bool sym_string_valid(struct symbol *sym, const char *newval); bool sym_string_within_range(struct symbol *sym, const char *str); bool sym_set_string_value(struct symbol *sym, const char *newval); bool sym_is_changeable(struct symbol *sym); struct property * sym_get_choice_prop(struct symbol *sym); const char * sym_get_string_value(struct symbol *sym); const char * prop_get_type_name(enum prop_type type); /* preprocess.c */ enum variable_flavor { VAR_SIMPLE, VAR_RECURSIVE, VAR_APPEND, }; void env_write_dep(FILE *f, const char *auto_conf_name); void variable_add(const char *name, const char *value, enum variable_flavor flavor); void variable_all_del(void); char *expand_dollar(const char **str); char *expand_one_token(const char **str); /* expr.c */ void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken);
{ "pile_set_name": "Github" }
Imports Grpc.Net.Client Imports ProtoBuf.Grpc.Client Imports Shared_VB Module Program Sub Main() DoIt().Wait() End Sub Async Function DoIt() As Task GrpcClientFactory.AllowUnencryptedHttp2 = True Using http = GrpcChannel.ForAddress("http://localhost:10042") Dim client = http.CreateGrpcService(Of ICalculator) Dim result = Await client.MultiplyAsync(New MultiplyRequest With {.X = 12, .Y = 4}) Console.WriteLine(result.Result) End Using End Function End Module
{ "pile_set_name": "Github" }
/****************************************************************************** * * (C)Copyright 1998,1999 SysKonnect, * a business unit of Schneider & Koch & Co. Datensysteme GmbH. * * See the file "skfddi.c" for further information. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * The information in this file is provided "AS IS" without warranty. * ******************************************************************************/ /* SMT 7.2 Status Response Frame Implementation SRF state machine and frame generation */ #include "h/types.h" #include "h/fddi.h" #include "h/smc.h" #include "h/smt_p.h" #define KERNEL #include "h/smtstate.h" #ifndef SLIM_SMT #ifndef BOOT #ifndef lint static const char ID_sccs[] = "@(#)srf.c 1.18 97/08/04 (C) SK " ; #endif /* * function declarations */ static void clear_all_rep(struct s_smc *smc); static void clear_reported(struct s_smc *smc); static void smt_send_srf(struct s_smc *smc); static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index); #define MAX_EVCS ARRAY_SIZE(smc->evcs) struct evc_init { u_char code ; u_char index ; u_char n ; u_short para ; } ; static const struct evc_init evc_inits[] = { { SMT_COND_SMT_PEER_WRAP, 0,1,SMT_P1048 } , { SMT_COND_MAC_DUP_ADDR, INDEX_MAC, NUMMACS,SMT_P208C } , { SMT_COND_MAC_FRAME_ERROR, INDEX_MAC, NUMMACS,SMT_P208D } , { SMT_COND_MAC_NOT_COPIED, INDEX_MAC, NUMMACS,SMT_P208E } , { SMT_EVENT_MAC_NEIGHBOR_CHANGE, INDEX_MAC, NUMMACS,SMT_P208F } , { SMT_EVENT_MAC_PATH_CHANGE, INDEX_MAC, NUMMACS,SMT_P2090 } , { SMT_COND_PORT_LER, INDEX_PORT,NUMPHYS,SMT_P4050 } , { SMT_COND_PORT_EB_ERROR, INDEX_PORT,NUMPHYS,SMT_P4052 } , { SMT_EVENT_PORT_CONNECTION, INDEX_PORT,NUMPHYS,SMT_P4051 } , { SMT_EVENT_PORT_PATH_CHANGE, INDEX_PORT,NUMPHYS,SMT_P4053 } , } ; #define MAX_INIT_EVC ARRAY_SIZE(evc_inits) void smt_init_evc(struct s_smc *smc) { struct s_srf_evc *evc ; const struct evc_init *init ; unsigned int i ; int index ; int offset ; static u_char fail_safe = FALSE ; memset((char *)smc->evcs,0,sizeof(smc->evcs)) ; evc = smc->evcs ; init = evc_inits ; for (i = 0 ; i < MAX_INIT_EVC ; i++) { for (index = 0 ; index < init->n ; index++) { evc->evc_code = init->code ; evc->evc_para = init->para ; evc->evc_index = init->index + index ; #ifndef DEBUG evc->evc_multiple = &fail_safe ; evc->evc_cond_state = &fail_safe ; #endif evc++ ; } init++ ; } if ((unsigned int) (evc - smc->evcs) > MAX_EVCS) { SMT_PANIC(smc,SMT_E0127, SMT_E0127_MSG) ; } /* * conditions */ smc->evcs[0].evc_cond_state = &smc->mib.fddiSMTPeerWrapFlag ; smc->evcs[1].evc_cond_state = &smc->mib.m[MAC0].fddiMACDuplicateAddressCond ; smc->evcs[2].evc_cond_state = &smc->mib.m[MAC0].fddiMACFrameErrorFlag ; smc->evcs[3].evc_cond_state = &smc->mib.m[MAC0].fddiMACNotCopiedFlag ; /* * events */ smc->evcs[4].evc_multiple = &smc->mib.m[MAC0].fddiMACMultiple_N ; smc->evcs[5].evc_multiple = &smc->mib.m[MAC0].fddiMACMultiple_P ; offset = 6 ; for (i = 0 ; i < NUMPHYS ; i++) { /* * conditions */ smc->evcs[offset + 0*NUMPHYS].evc_cond_state = &smc->mib.p[i].fddiPORTLerFlag ; smc->evcs[offset + 1*NUMPHYS].evc_cond_state = &smc->mib.p[i].fddiPORTEB_Condition ; /* * events */ smc->evcs[offset + 2*NUMPHYS].evc_multiple = &smc->mib.p[i].fddiPORTMultiple_U ; smc->evcs[offset + 3*NUMPHYS].evc_multiple = &smc->mib.p[i].fddiPORTMultiple_P ; offset++ ; } #ifdef DEBUG for (i = 0, evc = smc->evcs ; i < MAX_EVCS ; i++, evc++) { if (SMT_IS_CONDITION(evc->evc_code)) { if (!evc->evc_cond_state) { SMT_PANIC(smc,SMT_E0128, SMT_E0128_MSG) ; } evc->evc_multiple = &fail_safe ; } else { if (!evc->evc_multiple) { SMT_PANIC(smc,SMT_E0129, SMT_E0129_MSG) ; } evc->evc_cond_state = &fail_safe ; } } #endif smc->srf.TSR = smt_get_time() ; smc->srf.sr_state = SR0_WAIT ; } static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index) { unsigned int i ; struct s_srf_evc *evc ; for (i = 0, evc = smc->evcs ; i < MAX_EVCS ; i++, evc++) { if (evc->evc_code == code && evc->evc_index == index) return evc; } return NULL; } #define THRESHOLD_2 (2*TICKS_PER_SECOND) #define THRESHOLD_32 (32*TICKS_PER_SECOND) static const char * const srf_names[] = { "None","MACPathChangeEvent", "MACNeighborChangeEvent", "PORTPathChangeEvent", "PORTUndesiredConnectionAttemptEvent", "SMTPeerWrapCondition", "SMTHoldCondition", "MACFrameErrorCondition", "MACDuplicateAddressCondition", "MACNotCopiedCondition", "PORTEBErrorCondition", "PORTLerCondition" } ; void smt_srf_event(struct s_smc *smc, int code, int index, int cond) { struct s_srf_evc *evc ; int cond_asserted = 0 ; int cond_deasserted = 0 ; int event_occurred = 0 ; int tsr ; int T_Limit = 2*TICKS_PER_SECOND ; if (code == SMT_COND_MAC_DUP_ADDR && cond) { RS_SET(smc,RS_DUPADDR) ; } if (code) { DB_SMT("SRF: %s index %d", srf_names[code], index); if (!(evc = smt_get_evc(smc,code,index))) { DB_SMT("SRF : smt_get_evc() failed"); return ; } /* * ignore condition if no change */ if (SMT_IS_CONDITION(code)) { if (*evc->evc_cond_state == cond) return ; } /* * set transition time stamp */ smt_set_timestamp(smc,smc->mib.fddiSMTTransitionTimeStamp) ; if (SMT_IS_CONDITION(code)) { DB_SMT("SRF: condition is %s", cond ? "ON" : "OFF"); if (cond) { *evc->evc_cond_state = TRUE ; evc->evc_rep_required = TRUE ; smc->srf.any_report = TRUE ; cond_asserted = TRUE ; } else { *evc->evc_cond_state = FALSE ; cond_deasserted = TRUE ; } } else { if (evc->evc_rep_required) { *evc->evc_multiple = TRUE ; } else { evc->evc_rep_required = TRUE ; *evc->evc_multiple = FALSE ; } smc->srf.any_report = TRUE ; event_occurred = TRUE ; } #ifdef FDDI_MIB snmp_srf_event(smc,evc) ; #endif /* FDDI_MIB */ } tsr = smt_get_time() - smc->srf.TSR ; switch (smc->srf.sr_state) { case SR0_WAIT : /* SR01a */ if (cond_asserted && tsr < T_Limit) { smc->srf.SRThreshold = THRESHOLD_2 ; smc->srf.sr_state = SR1_HOLDOFF ; break ; } /* SR01b */ if (cond_deasserted && tsr < T_Limit) { smc->srf.sr_state = SR1_HOLDOFF ; break ; } /* SR01c */ if (event_occurred && tsr < T_Limit) { smc->srf.sr_state = SR1_HOLDOFF ; break ; } /* SR00b */ if (cond_asserted && tsr >= T_Limit) { smc->srf.SRThreshold = THRESHOLD_2 ; smc->srf.TSR = smt_get_time() ; smt_send_srf(smc) ; break ; } /* SR00c */ if (cond_deasserted && tsr >= T_Limit) { smc->srf.TSR = smt_get_time() ; smt_send_srf(smc) ; break ; } /* SR00d */ if (event_occurred && tsr >= T_Limit) { smc->srf.TSR = smt_get_time() ; smt_send_srf(smc) ; break ; } /* SR00e */ if (smc->srf.any_report && (u_long) tsr >= smc->srf.SRThreshold) { smc->srf.SRThreshold *= 2 ; if (smc->srf.SRThreshold > THRESHOLD_32) smc->srf.SRThreshold = THRESHOLD_32 ; smc->srf.TSR = smt_get_time() ; smt_send_srf(smc) ; break ; } /* SR02 */ if (!smc->mib.fddiSMTStatRptPolicy) { smc->srf.sr_state = SR2_DISABLED ; break ; } break ; case SR1_HOLDOFF : /* SR10b */ if (tsr >= T_Limit) { smc->srf.sr_state = SR0_WAIT ; smc->srf.TSR = smt_get_time() ; smt_send_srf(smc) ; break ; } /* SR11a */ if (cond_asserted) { smc->srf.SRThreshold = THRESHOLD_2 ; } /* SR11b */ /* SR11c */ /* handled above */ /* SR12 */ if (!smc->mib.fddiSMTStatRptPolicy) { smc->srf.sr_state = SR2_DISABLED ; break ; } break ; case SR2_DISABLED : if (smc->mib.fddiSMTStatRptPolicy) { smc->srf.sr_state = SR0_WAIT ; smc->srf.TSR = smt_get_time() ; smc->srf.SRThreshold = THRESHOLD_2 ; clear_all_rep(smc) ; break ; } break ; } } static void clear_all_rep(struct s_smc *smc) { struct s_srf_evc *evc ; unsigned int i ; for (i = 0, evc = smc->evcs ; i < MAX_EVCS ; i++, evc++) { evc->evc_rep_required = FALSE ; if (SMT_IS_CONDITION(evc->evc_code)) *evc->evc_cond_state = FALSE ; } smc->srf.any_report = FALSE ; } static void clear_reported(struct s_smc *smc) { struct s_srf_evc *evc ; unsigned int i ; smc->srf.any_report = FALSE ; for (i = 0, evc = smc->evcs ; i < MAX_EVCS ; i++, evc++) { if (SMT_IS_CONDITION(evc->evc_code)) { if (*evc->evc_cond_state == FALSE) evc->evc_rep_required = FALSE ; else smc->srf.any_report = TRUE ; } else { evc->evc_rep_required = FALSE ; *evc->evc_multiple = FALSE ; } } } /* * build and send SMT SRF frame */ static void smt_send_srf(struct s_smc *smc) { struct smt_header *smt ; struct s_srf_evc *evc ; SK_LOC_DECL(struct s_pcon,pcon) ; SMbuf *mb ; unsigned int i ; static const struct fddi_addr SMT_SRF_DA = { { 0x80, 0x01, 0x43, 0x00, 0x80, 0x08 } } ; /* * build SMT header */ if (!smc->r.sm_ma_avail) return ; if (!(mb = smt_build_frame(smc,SMT_SRF,SMT_ANNOUNCE,0))) return ; RS_SET(smc,RS_SOFTERROR) ; smt = smtod(mb, struct smt_header *) ; smt->smt_dest = SMT_SRF_DA ; /* DA == SRF multicast */ /* * setup parameter status */ pcon.pc_len = SMT_MAX_INFO_LEN ; /* max para length */ pcon.pc_err = 0 ; /* no error */ pcon.pc_badset = 0 ; /* no bad set count */ pcon.pc_p = (void *) (smt + 1) ; /* paras start here */ smt_add_para(smc,&pcon,(u_short) SMT_P1033,0,0) ; smt_add_para(smc,&pcon,(u_short) SMT_P1034,0,0) ; for (i = 0, evc = smc->evcs ; i < MAX_EVCS ; i++, evc++) { if (evc->evc_rep_required) { smt_add_para(smc,&pcon,evc->evc_para, (int)evc->evc_index,0) ; } } smt->smt_len = SMT_MAX_INFO_LEN - pcon.pc_len ; mb->sm_len = smt->smt_len + sizeof(struct smt_header) ; DB_SMT("SRF: sending SRF at %p, len %d", smt, mb->sm_len); DB_SMT("SRF: state SR%d Threshold %lu", smc->srf.sr_state, smc->srf.SRThreshold / TICKS_PER_SECOND); #ifdef DEBUG dump_smt(smc,smt,"SRF Send") ; #endif smt_send_frame(smc,mb,FC_SMT_INFO,0) ; clear_reported(smc) ; } #endif /* no BOOT */ #endif /* no SLIM_SMT */
{ "pile_set_name": "Github" }
-- -- SELECT_HAVING -- -- load test data CREATE TABLE test_having (a int, b int, c char(8), d char); INSERT INTO test_having VALUES (0, 1, 'XXXX', 'A'); INSERT INTO test_having VALUES (1, 2, 'AAAA', 'b'); INSERT INTO test_having VALUES (2, 2, 'AAAA', 'c'); INSERT INTO test_having VALUES (3, 3, 'BBBB', 'D'); INSERT INTO test_having VALUES (4, 3, 'BBBB', 'e'); INSERT INTO test_having VALUES (5, 3, 'bbbb', 'F'); INSERT INTO test_having VALUES (6, 4, 'cccc', 'g'); INSERT INTO test_having VALUES (7, 4, 'cccc', 'h'); INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I'); INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j'); SELECT b, c FROM test_having GROUP BY b, c HAVING count(*) = 1 ORDER BY b, c; -- HAVING is effectively equivalent to WHERE in this case SELECT b, c FROM test_having GROUP BY b, c HAVING b = 3 ORDER BY b, c; SELECT lower(c), count(c) FROM test_having GROUP BY lower(c) HAVING count(*) > 2 OR min(a) = max(a) ORDER BY lower(c); SELECT c, max(a) FROM test_having GROUP BY c HAVING count(*) > 2 OR min(a) = max(a) ORDER BY c; -- test degenerate cases involving HAVING without GROUP BY -- Per SQL spec, these should generate 0 or 1 row, even without aggregates SELECT min(a), max(a) FROM test_having HAVING min(a) = max(a); SELECT min(a), max(a) FROM test_having HAVING min(a) < max(a); -- errors: ungrouped column references SELECT a FROM test_having HAVING min(a) < max(a); SELECT 1 AS one FROM test_having HAVING a > 1; -- the really degenerate case: need not scan table at all SELECT 1 AS one FROM test_having HAVING 1 > 2; SELECT 1 AS one FROM test_having HAVING 1 < 2; -- and just to prove that we aren't scanning the table: SELECT 1 AS one FROM test_having WHERE 1/a = 1 HAVING 1 < 2; DROP TABLE test_having;
{ "pile_set_name": "Github" }
/etc/nginx/conf.d/comments_only.conf /etc/nginx/conf.d/empty.conf /etc/nginx/conf.d/foobar.conf /etc/nginx/conf.d/multiple.conf
{ "pile_set_name": "Github" }
xul|menupopup { cursor: default !important; background-color: #F0F0F0; border: solid 1px #A0A0A0; padding: 2px; z-index: 100; } xul|menupopup::shadow-right { top: 3px; right: -3px; width: 2px; height: 100%; } xul|menupopup::shadow-bottom { left: 3px; bottom: -3px; width: 100%; height: 2px; } xul|menupopup::shadow-right, xul|menupopup::shadow-bottom { font-size: 3px; /* IE fix */ background-color: #A0A0A0; } xul|menuitem { color: black; } xul|menuitem:hover { color: white; background-color: #3399FF; } xul|menuitem:selected { color: #ffffff; background-color: #3399FF; } xul|menuitem:disabled { color: #808080; } xul|menuitem[type]::image { background-repeat: no-repeat; width: 16px; height: 16px; vertical-align: middle; } xul|menuitem[type=checkbox]::image { background-position: 0px 16px; /* hidden */ background-image: url(media/menuitem_checkbox.gif); } xul|menuitem[type=radio]::image { background-position: 0px 16px; /* hidden */ background-image: url(media/menuitem_radio.gif); } xul|menuitem:checked xul|menuitem::image { background-position: 0px 0px; } xul|menu { color: black; } xul|menu:hover { color: white; background-color: #3399FF; } xul|menu:selected { color: #ffffff; background-color: #3399FF; } xul|menu:disabled { color: #808080; } xul|menu::arrow { background-image: url(media/menuitem_arrow.gif); background-repeat: no-repeat; background-position: 0px 0px; vertical-align: middle; width: 16px; height:16px; } xul|menu::label, xul|menuitem::label, xul|menupopup xul|menu::label { padding: 1px; } xul|menu::label { padding: 2px; padding-left: 5px; padding-right: 5px; } xul|menuitem:checked:selected xul|menuitem::image, xul|menu::arrow:selected { background-position: 0px -16px; } xul|menuitem:checked:disabled xul|menuitem::image, xul|menu::arrow:disabled { background-position: 0px -48px; } xul|menuseparator { border-top: solid 1px #A0A0A0; background-color: #FFFFFF; margin-top: 2px; margin-bottom: 1px; height: 1px; line-height: 1px; } /* */ xul|menu::gateway xul|menupopup { margin-left: 0; margin-top: 0; } xul|menupopup::gateway xul|menupopup { margin-left:16px; margin-top: -3px; }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"/> <link rel="stylesheet" href="style.css" type="text/css"/> <title>Value Stream</title> </head> <body> <p>A <b>Value Stream</b> represents a sequence of activities that create an overall result for a customer, stakeholder, or end user.</p> <p>A value stream describes how an enterprise organizes its activities to create value. Value streams are typically realized by business processes and possibly other core behavior elements. </p> <p>Value streams may be defined at different levels of the organization; e.g., at the enterprise level, business unit level, or department level. Value streams can be a composition or aggregation of value-adding activities. These are also modeled with the value stream element and are known as value (stream) stages, each of which creates and adds incremental value from one stage to the next. These stages are typically related using flow relationships to model the flow of value between them.</p> <p>Resources can be assigned to value streams and capabilities can serve (i.e., enable) a value stream</p> <h2>Category:</h2> <p>Strategy. Behaviour.</p> <h2>Examples:</h2> <p>Acquire Insurance Product, Acquire Data, Perform Analysis.</p> </body> </html>
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alipay.sofa.jraft.rpc.impl.core; import org.mockito.Mockito; import com.alipay.sofa.jraft.entity.PeerId; import com.alipay.sofa.jraft.rpc.RaftServerService; import com.alipay.sofa.jraft.rpc.RpcRequests.RequestVoteRequest; import static org.junit.Assert.assertEquals; import static org.mockito.Matchers.eq; public class PreVoteRequestProcessorTest extends BaseNodeRequestProcessorTest<RequestVoteRequest> { private RequestVoteRequest request; @Override public RequestVoteRequest createRequest(String groupId, PeerId peerId) { request = RequestVoteRequest.newBuilder().setGroupId(groupId). // setServerId("localhostL8082"). // setPeerId(peerId.toString()). // setTerm(0). // setLastLogIndex(0). // setLastLogTerm(0). // setPreVote(false).build(); return request; } @Override public NodeRequestProcessor<RequestVoteRequest> newProcessor() { return new RequestVoteRequestProcessor(null); } @Override public void verify(String interest, RaftServerService service, NodeRequestProcessor<RequestVoteRequest> processor) { assertEquals(interest, RequestVoteRequest.class.getName()); Mockito.verify(service).handleRequestVoteRequest(eq(request)); } }
{ "pile_set_name": "Github" }
/* * ================================================= * Copyright 2006 tagtraum industries incorporated * All rights reserved. * ================================================= */ package com.tagtraum.perf.gcviewer.imp; import static org.junit.Assert.assertEquals; import java.io.InputStream; import com.tagtraum.perf.gcviewer.UnittestHelper; import com.tagtraum.perf.gcviewer.UnittestHelper.FOLDER; import com.tagtraum.perf.gcviewer.model.GCModel; import com.tagtraum.perf.gcviewer.model.GcResourceFile; import org.junit.Test; /** * * Date: Jan 30, 2002 * Time: 5:53:55 PM * @author <a href="mailto:[email protected]">Hendrik Schreiber</a> */ public class TestDataReaderHPUX1_4_1 { @Test public void testParse1() throws Exception { String fileName = "SampleHP-UX1_4_1.txt"; final InputStream in = UnittestHelper.getResourceAsStream(FOLDER.HP, fileName); final DataReader reader = new DataReaderHPUX1_4_1(new GcResourceFile(fileName), in); GCModel model = reader.read(); assertEquals("number of events", 4, model.size()); } }
{ "pile_set_name": "Github" }
#include "general.h" #include "jtagtap.h" int jtagtap_init(void) { TMS_SET_MODE(); for(int i = 0; i <= 50; i++) jtagtap_next(1,0); jtagtap_tms_seq(0xE73C, 16); jtagtap_soft_reset(); return 0; } void jtagtap_reset(void) { #ifdef TRST_PORT volatile int i; gpio_clear(TRST_PORT, TRST_PIN); for(i = 0; i < 10000; i++) asm("nop"); gpio_set(TRST_PORT, TRST_PIN); #endif jtagtap_soft_reset(); } uint8_t jtagtap_next(const uint8_t dTMS, const uint8_t dTDI) { uint16_t ret; gpio_set_val(TMS_PORT, TMS_PIN, dTMS); gpio_set_val(TDI_PORT, TDI_PIN, dTDI); gpio_set(TCK_PORT, TCK_PIN); ret = gpio_get(TDO_PORT, TDO_PIN); gpio_clear(TCK_PORT, TCK_PIN); DEBUG("jtagtap_next(TMS = %d, TDI = %d) = %d\n", dTMS, dTDI, ret); return ret != 0; }
{ "pile_set_name": "Github" }
package org.fossasia.phimpme.utilities; import android.content.Context; /** Created by manuja on 7/6/17. */ public class ActivitySwitchHelper { public static Context context; public static Context getContext() { return context; } public static void setContext(Context context) { ActivitySwitchHelper.context = context; } }
{ "pile_set_name": "Github" }
--- external help file: online version: https://docs.microsoft.com/powershell/module/sharepoint-pnp/update-pnpteamsapp applicable: SharePoint Online schema: 2.0.0 title: Update-PnPTeamsApp --- # Update-PnPTeamsApp ## SYNOPSIS **Required Permissions** * Microsoft Graph API: Group.ReadWrite.All Updates an existing app in the Teams App Catalog. ## SYNTAX ```powershell Update-PnPTeamsApp -Identity <TeamsAppPipeBind> -Path <String> [-ByPassPermissionCheck [<SwitchParameter>]] ``` ## EXAMPLES ### ------------------EXAMPLE 1------------------ ```powershell Update-PnPTeamsApp -Identity 4efdf392-8225-4763-9e7f-4edeb7f721aa -Path c:\myapp.zip ``` Updates the specified app in the teams app catalog with the contents of the referenced zip file. ## PARAMETERS ### -ByPassPermissionCheck Allows the check for required permissions in the access token to be bypassed when set to $true ```yaml Type: SwitchParameter Parameter Sets: (All) Required: False Position: Named Accept pipeline input: False ``` ### -Identity ```yaml Type: TeamsAppPipeBind Parameter Sets: (All) Required: True Position: Named Accept pipeline input: False ``` ### -Path The path pointing to the packaged/zip file containing the app ```yaml Type: String Parameter Sets: (All) Required: True Position: Named Accept pipeline input: False ``` ## RELATED LINKS [SharePoint Developer Patterns and Practices](https://aka.ms/sppnp)
{ "pile_set_name": "Github" }
// The MIT License (MIT) // // Copyright (c) 2018 - 2020 Lutando Ngqakaza // https://github.com/Lutando/Akkatecture // // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do so, // subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using Akkatecture.Jobs; namespace Akkatecture.Sagas.SagaTimeouts { public class SagaTimeoutJobScheduler<TTimeout>: JobScheduler<SagaTimeoutJobScheduler<TTimeout>, TTimeout, SagaTimeoutId> where TTimeout : ISagaTimeoutJob { } }
{ "pile_set_name": "Github" }
import { platform } from "os"; import { IConfig } from "./schema"; function isWindows(): boolean { return platform() === "win32"; } function exeName(str: string): string { return `${str}${isWindows() ? ".exe" : ""}`; } const defaultConfig: IConfig = { auth: { password: null, }, binaries: { ffmpeg: exeName("ffmpeg"), ffprobe: exeName("ffprobe"), izzyPort: 8000, giannaPort: 8001, }, import: { bulk: [], images: [], videos: [], }, log: { maxSize: 2500, }, matching: { applyActorLabels: true, applySceneLabels: true, applyStudioLabels: true, }, persistence: { backup: { enable: true, maxAmount: 10, }, libraryPath: process.cwd(), }, plugins: { allowActorThumbnailOverwrite: false, allowMovieThumbnailOverwrite: false, allowSceneThumbnailOverwrite: false, createMissingActors: false, createMissingLabels: false, createMissingMovies: false, createMissingStudios: false, events: {}, register: {}, }, processing: { doProcessing: true, generatePreviews: true, generateScreenshots: false, imageCompressionSize: 720, readImagesOnImport: false, screenshotInterval: 120, }, scan: { excludeFiles: [], interval: 10800000, scanOnStartup: true, }, server: { https: { certificate: "", enable: false, key: "", }, port: 3000, }, }; export default defaultConfig;
{ "pile_set_name": "Github" }
CORE main.c --pointer-primitive-check ^EXIT=10$ ^SIGNAL=0$ \[main.pointer_primitives.1\] line \d+ pointer in pointer primitive is neither null nor valid in POINTER_OBJECT.*: FAILURE \[main.pointer_primitives.2\] line \d+ pointer in pointer primitive is neither null nor valid in POINTER_OFFSET.*: FAILURE \[main.pointer_primitives.3\] line \d+ pointer in pointer primitive is neither null nor valid in POINTER_OBJECT.*: FAILURE \[main.pointer_primitives.4\] line \d+ pointer in pointer primitive is neither null nor valid in OBJECT_SIZE.*: FAILURE \[main.pointer_primitives.5\] line \d+ pointer in pointer primitive is neither null nor valid in R_OK.*: FAILURE \[main.pointer_primitives.6\] line \d+ pointer in pointer primitive is neither null nor valid in W_OK.*: FAILURE \*\* 7 of \d+ failed -- ^warning: ignoring -- Verifies that checks are added for all pointer primitives
{ "pile_set_name": "Github" }
function updateLayout(mtexFig) % resize figure and reorder subfigs if isempty(mtexFig.children), return;end % store old units and perform all calculations in pixel old_units = get(mtexFig.parent,'Units'); set(mtexFig.parent,'Units','pixels'); figSize = get(mtexFig.parent,'Position'); figSize = figSize(3:4) - sum(reshape(mtexFig.figTightInset,2,2),2).'; % compute layout [mtexFig.ncols,mtexFig.nrows] = calcPartition(mtexFig,figSize); [mtexFig.axisWidth,mtexFig.axisHeight] = calcAxesSize(mtexFig,figSize); % align axes according to layout for i = 1:length(mtexFig.children) % compute position in raster [col,row] = ind2sub([mtexFig.ncols mtexFig.nrows],i); aw = mtexFig.axisWidth + mtexFig.innerPlotSpacing + sum(mtexFig.tightInset([1,3])); ah = mtexFig.axisHeight + mtexFig.innerPlotSpacing + sum(mtexFig.tightInset([2,4])); axisPos = [mtexFig.figTightInset(1:2),0,0] + ... [1 + (col-1)*aw + mtexFig.tightInset(1),... 1 + figSize(2) - row * ah ... + mtexFig.innerPlotSpacing + mtexFig.tightInset(2),... mtexFig.axisWidth,mtexFig.axisHeight]; axisPos(axisPos<0)=0; set(mtexFig.children(i),'Units','Pixel','Position',axisPos); % position the colorbars if numel(mtexFig.cBarAxis) == numel(mtexFig.children) resizeColorBar(mtexFig.cBarAxis(i)) end end if length(mtexFig.cBarAxis)==1 && i>1 pos = get(mtexFig.cBarAxis,'position'); if pos(4)>pos(3) %Vertical bar pos(4) = mtexFig.nrows * mtexFig.axisHeight + ... (mtexFig.nrows-1) * (mtexFig.innerPlotSpacing + sum(mtexFig.tightInset([2,4]))); pos(2) = axisPos(2)+1; pos(1) = mtexFig.ncols*(mtexFig.axisWidth + mtexFig.innerPlotSpacing + ... sum(mtexFig.tightInset([1,3]))) + mtexFig.outerPlotSpacing; else %Horizontal bar pos(3)=mtexFig.ncols*(mtexFig.axisWidth) + ... (mtexFig.ncols-1) * (mtexFig.innerPlotSpacing + sum(mtexFig.tightInset([1,3]))); %c_bar width pos(2) = mtexFig.outerPlotSpacing + 2*pos(4);%axisPos(2) - 2*pos(4); pos(1) = mtexFig.outerPlotSpacing + mtexFig.tightInset(1); %c_bar left end set(mtexFig.cBarAxis,'position',pos); end % revert figure units set(mtexFig.parent,'Units',old_units); function resizeColorBar(cBar) pos = get(cBar,'position'); if pos(4) > pos(3) % vertical set(cBar,'position',... [axisPos(1)+mtexFig.axisWidth+10,... axisPos(2)+1,... pos(3),mtexFig.axisHeight-1]); else % horizonal set(cBar,'position',... [axisPos(1),... axisPos(2)-mtexFig.tightInset(2) + mtexFig.cBarShift,... mtexFig.axisWidth-1,pos(4)]); end end function testit close all mtexFig = mtexFigure; mtexFig.gca rectangle('position',[0,0,1,1]) axis equal tight title('asdsa') xlabel('asd') mtexFig.nextAxis; rectangle('position',[0,0,1,1]) axis equal tight xlabel('asd') title('asdasd2') axis(mtexFig.children(1),'off') axis(mtexFig.children(2),'off') mtexFig.drawNow end end
{ "pile_set_name": "Github" }
/* Class = "NSMenuItem"; title = "Quit SplashBuddy"; ObjectID = "2cR-1q-G3Y"; */ "2cR-1q-G3Y.title" = "Stop SplashBuddy"; /* Class = "NSMenu"; title = "Main Menu"; ObjectID = "5Hn-kG-mLK"; */ "5Hn-kG-mLK.title" = "Hoofdmenu"; /* Class = "NSMenu"; title = "SplashBuddy"; ObjectID = "5pp-rB-Rs5"; */ "5pp-rB-Rs5.title" = "SplashBuddy"; /* Class = "NSMenuItem"; title = "Quit SplashBuddy and set .SplashBuddyDone"; ObjectID = "9sK-Yv-hyG"; */ "9sK-Yv-hyG.title" = "Stop SplashBuddy en stel .SplashBuddyDone in"; /* Class = "NSView"; ibExternalAccessibilityDescription = "Lower Bar"; ObjectID = "9z5-8K-Bsy"; */ "9z5-8K-Bsy.ibExternalAccessibilityDescription" = "Onderste regel"; /* Class = "NSTextFieldCell"; title = "Text Cell"; ObjectID = "HEm-cX-eEV"; */ "HEm-cX-eEV.title" = "Tekstcel"; /* Class = "NSTextFieldCell"; title = "displayName"; ObjectID = "IV9-h3-DQ0"; */ "IV9-h3-DQ0.title" = "displayName"; /* Class = "NSMenuItem"; title = "SplashBuddy"; ObjectID = "Mm1-rq-zaN"; */ "Mm1-rq-zaN.title" = "SplashBuddy"; /* Class = "NSMenuItem"; title = "About SplashBuddy"; ObjectID = "dPN-j3-pc0"; */ "dPN-j3-pc0.title" = "Over SplashBuddy"; /* Class = "NSWindow"; title = "Window"; ObjectID = "eOE-dw-mkn"; */ "eOE-dw-mkn.title" = "Venster"; /* Class = "NSTextFieldCell"; title = "Label"; ObjectID = "gAE-fA-iyd"; */ "gAE-fA-iyd.title" = "Label"; /* Class = "NSButtonCell"; title = "Continue"; ObjectID = "jcN-QC-epo"; */ "jcN-QC-epo.title" = "Ga door"; /* Class = "NSTextFieldCell"; title = "description"; ObjectID = "lnB-mt-lsP"; */ "lnB-mt-lsP.title" = "Beschrijving"; /* Class = "NSViewController"; title = "Main View"; ObjectID = "qDQ-T9-zeE"; */ "qDQ-T9-zeE.title" = "Hoofdscherm";
{ "pile_set_name": "Github" }
/************************************************************************* * * * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * * All rights reserved. Email: [email protected] Web: www.q12.org * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of * * The BSD-style license that is included with this library in * * the file LICENSE-BSD.TXT. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * LICENSE.TXT and LICENSE-BSD.TXT for more details. * * * *************************************************************************/ /* given (A,b,lo,hi), solve the LCP problem: A*x = b+w, where each x(i),w(i) satisfies one of (1) x = lo, w >= 0 (2) x = hi, w <= 0 (3) lo < x < hi, w = 0 A is a matrix of dimension n*n, everything else is a vector of size n*1. lo and hi can be +/- dInfinity as needed. the first `nub' variables are unbounded, i.e. hi and lo are assumed to be +/- dInfinity. we restrict lo(i) <= 0 and hi(i) >= 0. the original data (A,b) may be modified by this function. if the `findex' (friction index) parameter is nonzero, it points to an array of index values. in this case constraints that have findex[i] >= 0 are special. all non-special constraints are solved for, then the lo and hi values for the special constraints are set: hi[i] = abs( hi[i] * x[findex[i]] ) lo[i] = -hi[i] and the solution continues. this mechanism allows a friction approximation to be implemented. the first `nub' variables are assumed to have findex < 0. */ #ifndef _BT_LCP_H_ #define _BT_LCP_H_ #include <stdlib.h> #include <stdio.h> #include <assert.h> #include "LinearMath/btScalar.h" #include "LinearMath/btAlignedObjectArray.h" struct btDantzigScratchMemory { btAlignedObjectArray<btScalar> m_scratch; btAlignedObjectArray<btScalar> L; btAlignedObjectArray<btScalar> d; btAlignedObjectArray<btScalar> delta_w; btAlignedObjectArray<btScalar> delta_x; btAlignedObjectArray<btScalar> Dell; btAlignedObjectArray<btScalar> ell; btAlignedObjectArray<btScalar*> Arows; btAlignedObjectArray<int> p; btAlignedObjectArray<int> C; btAlignedObjectArray<bool> state; }; //return false if solving failed bool btSolveDantzigLCP (int n, btScalar *A, btScalar *x, btScalar *b, btScalar *w, int nub, btScalar *lo, btScalar *hi, int *findex,btDantzigScratchMemory& scratch); #endif //_BT_LCP_H_
{ "pile_set_name": "Github" }
/** * Copyright 2008 - 2015 The Loon Game Engine 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. * * @project loon * @author cping * @email:[email protected] * @version 0.5 */ package loon.geom; import loon.LSysException; import loon.utils.TArray; public class TriangleBasic implements Triangle { /** * */ private static final long serialVersionUID = 1L; private static final float EPSILON = 0.0000000001f; private PointList poly = new PointList(); private PointList tris = new PointList(); private boolean tried; public TriangleBasic() { } @Override public void addPolyPoint(float x, float y) { Point p = new Point(x, y); if (!poly.contains(p)) { poly.add(p); } } public int getPolyPointCount() { return poly.size(); } public float[] getPolyPoint(int index) { return new float[] { poly.get(index).x, poly.get(index).y }; } @Override public boolean triangulate() { tried = true; boolean worked = process(poly, tris); return worked; } @Override public int getTriangleCount() { if (!tried) { throw new LSysException("this not Triangle !"); } return tris.size() / 3; } @Override public float[] getTrianglePoint(int t, int i) { if (!tried) { throw new LSysException("this not Triangle !"); } return tris.get((t * 3) + i).toArray(); } private float area(PointList contour) { int n = contour.size(); float sA = 0.0f; for (int p = n - 1, q = 0; q < n; p = q++) { Point contourP = contour.get(p); Point contourQ = contour.get(q); sA += contourP.getX() * contourQ.getY() - contourQ.getX() * contourP.getY(); } return sA * 0.5f; } private boolean insideTriangle(float Ax, float Ay, float Bx, float By, float Cx, float Cy, float Px, float Py) { float ax, ay, bx, by, cx, cy, apx, apy, bpx, bpy, cpx, cpy; float cCROSSap, bCROSScp, aCROSSbp; ax = Cx - Bx; ay = Cy - By; bx = Ax - Cx; by = Ay - Cy; cx = Bx - Ax; cy = By - Ay; apx = Px - Ax; apy = Py - Ay; bpx = Px - Bx; bpy = Py - By; cpx = Px - Cx; cpy = Py - Cy; aCROSSbp = ax * bpy - ay * bpx; cCROSSap = cx * apy - cy * apx; bCROSScp = bx * cpy - by * cpx; return ((aCROSSbp >= 0.0f) && (bCROSScp >= 0.0f) && (cCROSSap >= 0.0f)); } private boolean snip(PointList contour, int u, int v, int w, int n, int[] V) { int p; float Ax, Ay, Bx, By, Cx, Cy, Px, Py; Ax = contour.get(V[u]).getX(); Ay = contour.get(V[u]).getY(); Bx = contour.get(V[v]).getX(); By = contour.get(V[v]).getY(); Cx = contour.get(V[w]).getX(); Cy = contour.get(V[w]).getY(); if (EPSILON > (((Bx - Ax) * (Cy - Ay)) - ((By - Ay) * (Cx - Ax)))) { return false; } for (p = 0; p < n; p++) { if ((p == u) || (p == v) || (p == w)) { continue; } Px = contour.get(V[p]).getX(); Py = contour.get(V[p]).getY(); if (insideTriangle(Ax, Ay, Bx, By, Cx, Cy, Px, Py)) { return false; } } return true; } private boolean process(PointList contour, PointList result) { result.clear(); int n = contour.size(); if (n < 3) { return false; } int[] sV = new int[n]; if (0.0f < area(contour)) { for (int v = 0; v < n; v++) { sV[v] = v; } } else { for (int v = 0; v < n; v++) { sV[v] = (n - 1) - v; } } int nv = n; int count = 2 * nv; for (int v = nv - 1; nv > 2;) { if (0 >= (count--)) { return false; } int u = v; if (nv <= u) { u = 0; } v = u + 1; if (nv <= v) { v = 0; } int w = v + 1; if (nv <= w) { w = 0; } if (snip(contour, u, v, w, nv, sV)) { int a, b, c, s, t; a = sV[u]; b = sV[v]; c = sV[w]; result.add(contour.get(a)); result.add(contour.get(b)); result.add(contour.get(c)); for (s = v, t = v + 1; t < nv; s++, t++) { sV[s] = sV[t]; } nv--; count = 2 * nv; } } return true; } private static class Point { private float x; private float y; private float[] array; public Point(float x, float y) { this.x = x; this.y = y; array = new float[] { x, y }; } public float getX() { return x; } public float getY() { return y; } public float[] toArray() { return array; } @Override public int hashCode() { return (int) (x * y * 31); } @Override public boolean equals(Object other) { if (other instanceof Point) { Point p = (Point) other; return (p.x == x) && (p.y == y); } return false; } } private static class PointList { private TArray<Point> points = new TArray<Point>(); public PointList() { } public boolean contains(Point p) { return points.contains(p); } public void add(Point point) { points.add(point); } public int size() { return points.size; } public Point get(int i) { return points.get(i); } public void clear() { points.clear(); } } public void startHole() { } }
{ "pile_set_name": "Github" }
package weixin.popular.bean.paymch; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @XmlRootElement(name = "xml") @XmlAccessorType(XmlAccessType.FIELD) public class PayProfitsharingOperation extends MchBase { @XmlJavaTypeAdapter(value = ReceiverOperation.JsonXmlAdapter.class) private ReceiverOperation receiver; public ReceiverOperation getReceiver() { return receiver; } public void setReceiver(ReceiverOperation receiver) { this.receiver = receiver; } }
{ "pile_set_name": "Github" }
# Routing Guards Lab ## Overview - Add preload strategy for all lazy routes - Create a CanActivate Guard - Prevent navigating to Villains - Prevent loading of the Villains code chunk ## Steps 1. Add the PreloadAllModules strategy to the AppRoutingModule 1. Run the app, open dev tools, and go to the network tab 1. Notice heroes and villains bundles both loaded 1. Create a CanActivate routing guard in the CoreModule named AuthGuard using the CLI 1. (hint: create a service) 1. Use a-guard-can-activate snippet to replace the code in the new file 1. Configure the function to return false 1. Apply the guard to the /heroes route in the AppRoutingModule 1. Provide the guard in the AppRoutingModule 1. Run the app, open dev tools - network tab, and click on the Villains navigation 1. Notice the villains chunk loads but it does not get navigated in the UI. 1. Bonus: How could we make it not load at all? Try it.
{ "pile_set_name": "Github" }
func println(val: TriValue) { switch val {
{ "pile_set_name": "Github" }
// The template and inlines for the -*- C++ -*- indirect_array class. // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 2, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software // library without restriction. Specifically, if other files instantiate // templates or use macros or inline functions from this file, or you compile // this file and link it with other files to produce an executable, this // file does not by itself cause the resulting executable to be covered by // the GNU General Public License. This exception does not however // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. /** @file indirect_array.h * This is an internal header file, included by other library headers. * You should not attempt to use it directly. */ // Written by Gabriel Dos Reis <[email protected]> #ifndef _INDIRECT_ARRAY_H #define _INDIRECT_ARRAY_H 1 #pragma GCC system_header _GLIBCXX_BEGIN_NAMESPACE(std) /** * @brief Reference to arbitrary subset of an array. * * An indirect_array is a reference to the actual elements of an array * specified by an ordered array of indices. The way to get an * indirect_array is to call operator[](valarray<size_t>) on a valarray. * The returned indirect_array then permits carrying operations out on the * referenced subset of elements in the original valarray. * * For example, if an indirect_array is obtained using the array (4,2,0) as * an argument, and then assigned to an array containing (1,2,3), then the * underlying array will have array[0]==3, array[2]==2, and array[4]==1. * * @param Tp Element type. */ template <class _Tp> class indirect_array { public: typedef _Tp value_type; // _GLIBCXX_RESOLVE_LIB_DEFECTS // 253. valarray helper functions are almost entirely useless /// Copy constructor. Both slices refer to the same underlying array. indirect_array(const indirect_array&); /// Assignment operator. Assigns elements to corresponding elements /// of @a a. indirect_array& operator=(const indirect_array&); /// Assign slice elements to corresponding elements of @a v. void operator=(const valarray<_Tp>&) const; /// Multiply slice elements by corresponding elements of @a v. void operator*=(const valarray<_Tp>&) const; /// Divide slice elements by corresponding elements of @a v. void operator/=(const valarray<_Tp>&) const; /// Modulo slice elements by corresponding elements of @a v. void operator%=(const valarray<_Tp>&) const; /// Add corresponding elements of @a v to slice elements. void operator+=(const valarray<_Tp>&) const; /// Subtract corresponding elements of @a v from slice elements. void operator-=(const valarray<_Tp>&) const; /// Logical xor slice elements with corresponding elements of @a v. void operator^=(const valarray<_Tp>&) const; /// Logical and slice elements with corresponding elements of @a v. void operator&=(const valarray<_Tp>&) const; /// Logical or slice elements with corresponding elements of @a v. void operator|=(const valarray<_Tp>&) const; /// Left shift slice elements by corresponding elements of @a v. void operator<<=(const valarray<_Tp>&) const; /// Right shift slice elements by corresponding elements of @a v. void operator>>=(const valarray<_Tp>&) const; /// Assign all slice elements to @a t. void operator= (const _Tp&) const; // ~indirect_array(); template<class _Dom> void operator=(const _Expr<_Dom, _Tp>&) const; template<class _Dom> void operator*=(const _Expr<_Dom, _Tp>&) const; template<class _Dom> void operator/=(const _Expr<_Dom, _Tp>&) const; template<class _Dom> void operator%=(const _Expr<_Dom, _Tp>&) const; template<class _Dom> void operator+=(const _Expr<_Dom, _Tp>&) const; template<class _Dom> void operator-=(const _Expr<_Dom, _Tp>&) const; template<class _Dom> void operator^=(const _Expr<_Dom, _Tp>&) const; template<class _Dom> void operator&=(const _Expr<_Dom, _Tp>&) const; template<class _Dom> void operator|=(const _Expr<_Dom, _Tp>&) const; template<class _Dom> void operator<<=(const _Expr<_Dom, _Tp>&) const; template<class _Dom> void operator>>=(const _Expr<_Dom, _Tp>&) const; private: /// Copy constructor. Both slices refer to the same underlying array. indirect_array(_Array<_Tp>, size_t, _Array<size_t>); friend class valarray<_Tp>; friend class gslice_array<_Tp>; const size_t _M_sz; const _Array<size_t> _M_index; const _Array<_Tp> _M_array; // not implemented indirect_array(); }; template<typename _Tp> inline indirect_array<_Tp>::indirect_array(const indirect_array<_Tp>& __a) : _M_sz(__a._M_sz), _M_index(__a._M_index), _M_array(__a._M_array) {} template<typename _Tp> inline indirect_array<_Tp>::indirect_array(_Array<_Tp> __a, size_t __s, _Array<size_t> __i) : _M_sz(__s), _M_index(__i), _M_array(__a) {} template<typename _Tp> inline indirect_array<_Tp>& indirect_array<_Tp>::operator=(const indirect_array<_Tp>& __a) { std::__valarray_copy(__a._M_array, _M_sz, __a._M_index, _M_array, _M_index); return *this; } template<typename _Tp> inline void indirect_array<_Tp>::operator=(const _Tp& __t) const { std::__valarray_fill(_M_array, _M_index, _M_sz, __t); } template<typename _Tp> inline void indirect_array<_Tp>::operator=(const valarray<_Tp>& __v) const { std::__valarray_copy(_Array<_Tp>(__v), _M_sz, _M_array, _M_index); } template<typename _Tp> template<class _Dom> inline void indirect_array<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e) const { std::__valarray_copy(__e, _M_sz, _M_array, _M_index); } #undef _DEFINE_VALARRAY_OPERATOR #define _DEFINE_VALARRAY_OPERATOR(_Op, _Name) \ template<typename _Tp> \ inline void \ indirect_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const\ { \ _Array_augmented_##_Name(_M_array, _M_index, _Array<_Tp>(__v), _M_sz); \ } \ \ template<typename _Tp> \ template<class _Dom> \ inline void \ indirect_array<_Tp>::operator _Op##=(const _Expr<_Dom,_Tp>& __e) const\ { \ _Array_augmented_##_Name(_M_array, _M_index, __e, _M_sz); \ } _DEFINE_VALARRAY_OPERATOR(*, __multiplies) _DEFINE_VALARRAY_OPERATOR(/, __divides) _DEFINE_VALARRAY_OPERATOR(%, __modulus) _DEFINE_VALARRAY_OPERATOR(+, __plus) _DEFINE_VALARRAY_OPERATOR(-, __minus) _DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor) _DEFINE_VALARRAY_OPERATOR(&, __bitwise_and) _DEFINE_VALARRAY_OPERATOR(|, __bitwise_or) _DEFINE_VALARRAY_OPERATOR(<<, __shift_left) _DEFINE_VALARRAY_OPERATOR(>>, __shift_right) #undef _DEFINE_VALARRAY_OPERATOR _GLIBCXX_END_NAMESPACE #endif /* _INDIRECT_ARRAY_H */
{ "pile_set_name": "Github" }
net\authorize\api\contract\v1\DriversLicenseMaskedType: properties: number: expose: true access_type: public_method serialized_name: number xml_element: namespace: AnetApi/xml/v1/schema/AnetApiSchema.xsd accessor: getter: getNumber setter: setNumber type: string state: expose: true access_type: public_method serialized_name: state xml_element: namespace: AnetApi/xml/v1/schema/AnetApiSchema.xsd accessor: getter: getState setter: setState type: string dateOfBirth: expose: true access_type: public_method serialized_name: dateOfBirth xml_element: namespace: AnetApi/xml/v1/schema/AnetApiSchema.xsd accessor: getter: getDateOfBirth setter: setDateOfBirth type: string
{ "pile_set_name": "Github" }
/** * Italiano translation * @author Alberto Tocci ([email protected]) * @author Claudio Nicora ([email protected]) * @author Stefano Galeazzi <[email protected]> * @author Thomas Camaran <[email protected]> * @version 2018-06-08 */ (function(root, factory) { if (typeof define === 'function' && define.amd) { define(['elfinder'], factory); } else if (typeof exports !== 'undefined') { module.exports = factory(require('elfinder')); } else { factory(root.elFinder); } }(this, function(elFinder) { elFinder.prototype.i18.it = { translator : 'Alberto Tocci ([email protected]), Claudio Nicora ([email protected]), Stefano Galeazzi &lt;[email protected]&gt;, Thomas Camaran &lt;[email protected]&gt;', language : 'Italiano', direction : 'ltr', dateFormat : 'd/m/Y H:i', // Mar 13, 2012 05:27 PM fancyDateFormat : '$1 H:i', // will produce smth like: Today 12:25 PM nonameDateFormat : 'ymd-His', // to apply if upload file is noname: 120513172700 messages : { /********************************** errors **********************************/ 'error' : 'Errore', 'errUnknown' : 'Errore sconosciuto.', 'errUnknownCmd' : 'Comando sconosciuto.', 'errJqui' : 'Configurazione JQuery UI non valida. Devono essere inclusi i plugin Selectable, Draggable e Droppable.', 'errNode' : 'elFinder necessita dell\'elemento DOM per essere inizializzato.', 'errURL' : 'Configurazione non valida.Il parametro URL non è settato.', 'errAccess' : 'Accesso negato.', 'errConnect' : 'Impossibile collegarsi al backend.', 'errAbort' : 'Connessione annullata.', 'errTimeout' : 'Timeout di connessione.', 'errNotFound' : 'Backend non trovato.', 'errResponse' : 'Risposta non valida dal backend.', 'errConf' : 'Configurazione backend non valida.', 'errJSON' : 'Modulo PHP JSON non installato.', 'errNoVolumes' : 'Non è stato possibile leggere i volumi.', 'errCmdParams' : 'Parametri non validi per il comando "$1".', 'errDataNotJSON' : 'I dati non sono nel formato JSON.', 'errDataEmpty' : 'Stringa vuota.', 'errCmdReq' : 'La richiesta al backend richiede il nome del comando.', 'errOpen' : 'Impossibile aprire "$1".', 'errNotFolder' : 'L\'oggetto non è una cartella..', 'errNotFile' : 'L\'oggetto non è un file.', 'errRead' : 'Impossibile leggere "$1".', 'errWrite' : 'Non è possibile scrivere in "$1".', 'errPerm' : 'Permesso negato.', 'errLocked' : '"$1" è bloccato e non può essere rinominato, spostato o eliminato.', 'errExists' : 'Il file "$1" è già esistente.', 'errInvName' : 'Nome file non valido.', 'errInvDirname' : 'Nome cartella non valido.', // from v2.1.24 added 12.4.2017 'errFolderNotFound' : 'Cartella non trovata.', 'errFileNotFound' : 'File non trovato.', 'errTrgFolderNotFound' : 'La cartella di destinazione"$1" non è stata trovata.', 'errPopup' : 'Il tuo Browser non consente di aprire finestre di pop-up. Per aprire il file abilita questa opzione nelle impostazioni del tuo Browser.', 'errMkdir' : 'Impossibile creare la cartella "$1".', 'errMkfile' : 'Impossibile creare il file "$1".', 'errRename' : 'Impossibile rinominare "$1".', 'errCopyFrom' : 'Non è possibile copiare file da "$1".', 'errCopyTo' : 'Non è possibile copiare file in "$1".', 'errMkOutLink' : 'Impossibile creare un link all\'esterno della radice del volume.', // from v2.1 added 03.10.2015 'errUpload' : 'Errore di Caricamento.', // old name - errUploadCommon 'errUploadFile' : 'Impossibile Caricare "$1".', // old name - errUpload 'errUploadNoFiles' : 'Non sono stati specificati file da caricare.', 'errUploadTotalSize' : 'La dimensione totale dei file supera il limite massimo consentito.', // old name - errMaxSize 'errUploadFileSize' : 'Le dimensioni del file superano il massimo consentito.', // old name - errFileMaxSize 'errUploadMime' : 'FileType non consentito.', 'errUploadTransfer' : 'Trasferimento errato del file "$1".', 'errUploadTemp' : 'Impossibile creare il file temporaneo per l\'upload.', // from v2.1 added 26.09.2015 'errNotReplace' : 'L\'oggetto "$1" esiste già in questa cartella e non può essere sostituito con un oggetto di un tipo differente.', // new 'errReplace' : 'Impossibile sostituire "$1".', 'errSave' : 'Impossibile salvare "$1".', 'errCopy' : 'Impossibile copiare "$1".', 'errMove' : 'Impossibile spostare "$1".', 'errCopyInItself' : 'Sorgente e destinazione risultato essere uguali.', 'errRm' : 'Impossibile rimuovere "$1".', 'errTrash' : 'Impossibile cestinare.', // from v2.1.24 added 30.4.2017 'errRmSrc' : 'Impossibile eliminare i file origine.', 'errExtract' : 'Impossibile estrarre file da "$1".', 'errArchive' : 'Impossibile creare archivio.', 'errArcType' : 'Tipo di archivio non supportato.', 'errNoArchive' : 'Il file non è un archivio o contiene file non supportati.', 'errCmdNoSupport' : 'Il Backend non supporta questo comando.', 'errReplByChild' : 'La cartella $1 non può essere sostituita da un oggetto in essa contenuto.', 'errArcSymlinks' : 'Per questioni di sicurezza non è possibile estrarre archivi che contengono collegamenti..', // edited 24.06.2012 'errArcMaxSize' : 'La dimensione dell\'archivio supera le massime dimensioni consentite.', 'errResize' : 'Impossibile ridimensionare "$1".', 'errResizeDegree' : 'Angolo di rotazione non valido.', // added 7.3.2013 'errResizeRotate' : 'Impossibile ruotare l\'immagine.', // added 7.3.2013 'errResizeSize' : 'Dimensione dell\'immagine non valida.', // added 7.3.2013 'errResizeNoChange' : 'Dimensione dell\'immagine non modificata.', // added 7.3.2013 'errUsupportType' : 'Tipo di file non supportato.', 'errNotUTF8Content' : 'Il file "$1" non è nel formato UTF-8 e non può essere modificato.', // added 9.11.2011 'errNetMount' : 'Impossibile montare "$1".', // added 17.04.2012 'errNetMountNoDriver' : 'Protocollo non supportato.', // added 17.04.2012 'errNetMountFailed' : 'Mount fallito.', // added 17.04.2012 'errNetMountHostReq' : 'Host richiesto.', // added 18.04.2012 'errSessionExpires' : 'La sessione è scaduta a causa di inattività.', 'errCreatingTempDir' : 'Impossibile creare la cartella temporanea: "$1"', 'errFtpDownloadFile' : 'Impossibile scaricare il file tramite FTP: "$1"', 'errFtpUploadFile' : 'Impossibile caricare il file tramite FTP: "$1"', 'errFtpMkdir' : 'Impossibile creare la cartella remota tramite FTP: "$1"', 'errArchiveExec' : 'Errore durante l\'archiviazione dei file: "$1"', 'errExtractExec' : 'Errore durante l\'estrazione dei file: "$1"', 'errNetUnMount' : 'Impossibile smontare', // from v2.1 added 30.04.2012 'errConvUTF8' : 'Non convertibile nel formato UTF-8', // from v2.1 added 08.04.2014 'errFolderUpload' : 'Per uploadare l0intera cartella usare Google Chrome.', // from v2.1 added 26.6.2015 'errSearchTimeout' : 'Timeout durante la ricerca di "$1". I risultati della ricerca sono parziali.', // from v2.1 added 12.1.2016 'errReauthRequire' : 'E\' necessaria la riautorizzazione.', // from v2.1.10 added 24.3.2016 'errMaxTargets' : 'Il numero massimo di oggetti selezionabili è $1.', // from v2.1.17 added 17.10.2016 'errRestore' : 'Impossibile ripristinare dal cestino: destinazione di ripristino non trovata.', // from v2.1.24 added 3.5.2017 'errEditorNotFound' : 'Impossibile trovare un editor per questo tipo di file.', // from v2.1.25 added 23.5.2017 'errServerError' : 'Si è verificato un errore lato server.', // from v2.1.25 added 16.6.2017 'errEmpty' : 'Impossibile svuotare la cartella "$1".', // from v2.1.25 added 22.6.2017 /******************************* commands names ********************************/ 'cmdarchive' : 'Crea archivio', 'cmdback' : 'Indietro', 'cmdcopy' : 'Copia', 'cmdcut' : 'Taglia', 'cmddownload' : 'Scarica', 'cmdduplicate' : 'Duplica', 'cmdedit' : 'Modifica File', 'cmdextract' : 'Estrai Archivio', 'cmdforward' : 'Avanti', 'cmdgetfile' : 'Seleziona File', 'cmdhelp' : 'Informazioni su...', 'cmdhome' : 'Home', 'cmdinfo' : 'Informazioni', 'cmdmkdir' : 'Nuova cartella', 'cmdmkdirin' : 'In una nuova cartella', // from v2.1.7 added 19.2.2016 'cmdmkfile' : 'Nuovo file', 'cmdopen' : 'Apri', 'cmdpaste' : 'Incolla', 'cmdquicklook' : 'Anteprima', 'cmdreload' : 'Ricarica', 'cmdrename' : 'Rinomina', 'cmdrm' : 'Elimina', 'cmdtrash' : 'Nel cestino', //from v2.1.24 added 29.4.2017 'cmdrestore' : 'Ripristina', //from v2.1.24 added 3.5.2017 'cmdsearch' : 'Ricerca file', 'cmdup' : 'Vai alla directory padre', 'cmdupload' : 'Carica File', 'cmdview' : 'Visualizza', 'cmdresize' : 'Ridimensiona Immagine', 'cmdsort' : 'Ordina', 'cmdnetmount' : 'Monta disco di rete', // added 18.04.2012 'cmdnetunmount': 'Smonta', // from v2.1 added 30.04.2012 'cmdplaces' : 'Aggiungi ad Accesso rapido', // added 28.12.2014 'cmdchmod' : 'Cambia modalità', // from v2.1 added 20.6.2015 'cmdopendir' : 'Apri una cartella', // from v2.1 added 13.1.2016 'cmdcolwidth' : 'Reimposta dimensione colonne', // from v2.1.13 added 12.06.2016 'cmdfullscreen': 'Schermo intero', // from v2.1.15 added 03.08.2016 'cmdmove' : 'Sposta', // from v2.1.15 added 21.08.2016 'cmdempty' : 'Svuota la cartella', // from v2.1.25 added 22.06.2017 'cmdundo' : 'Annulla', // from v2.1.27 added 31.07.2017 'cmdredo' : 'Ripeti', // from v2.1.27 added 31.07.2017 'cmdpreference': 'Preferenze', // from v2.1.27 added 03.08.2017 'cmdselectall' : 'Seleziona tutto', // from v2.1.28 added 15.08.2017 'cmdselectnone': 'Annulla selezione', // from v2.1.28 added 15.08.2017 'cmdselectinvert': 'Inverti selezione', // from v2.1.28 added 15.08.2017 'cmdopennew' : 'Apri in una nuova finestra', // from v2.1.38 added 3.4.2018 /*********************************** buttons ***********************************/ 'btnClose' : 'Chiudi', 'btnSave' : 'Salva', 'btnRm' : 'Elimina', 'btnApply' : 'Applica', 'btnCancel' : 'Annulla', 'btnNo' : 'No', 'btnYes' : 'Sì', 'btnMount' : 'Monta', // added 18.04.2012 'btnApprove': 'Vai a $1 & approva', // from v2.1 added 26.04.2012 'btnUnmount': 'Smonta', // from v2.1 added 30.04.2012 'btnConv' : 'Converti', // from v2.1 added 08.04.2014 'btnCwd' : 'Qui', // from v2.1 added 22.5.2015 'btnVolume' : 'Disco', // from v2.1 added 22.5.2015 'btnAll' : 'Tutti', // from v2.1 added 22.5.2015 'btnMime' : 'Tipo MIME', // from v2.1 added 22.5.2015 'btnFileName':'Nome file', // from v2.1 added 22.5.2015 'btnSaveClose': 'Salva & Chiudi', // from v2.1 added 12.6.2015 'btnBackup' : 'Backup', // fromv2.1 added 28.11.2015 'btnRename' : 'Rinomina', // from v2.1.24 added 6.4.2017 'btnRenameAll' : 'Rinomina (tutto)', // from v2.1.24 added 6.4.2017 'btnPrevious' : 'Indietro ($1/$2)', // from v2.1.24 added 11.5.2017 'btnNext' : 'Avanti ($1/$2)', // from v2.1.24 added 11.5.2017 'btnSaveAs' : 'Salva come', // from v2.1.25 added 24.5.2017 /******************************** notifications ********************************/ 'ntfopen' : 'Apri cartella', 'ntffile' : 'Apri file', 'ntfreload' : 'Ricarica il contenuto della cartella', 'ntfmkdir' : 'Creazione delle directory in corso', 'ntfmkfile' : 'Creazione dei files in corso', 'ntfrm' : 'Eliminazione dei files in corso', 'ntfcopy' : 'Copia file in corso', 'ntfmove' : 'Spostamento file in corso', 'ntfprepare' : 'Preparazione della copia dei file.', 'ntfrename' : 'Sto rinominando i file', 'ntfupload' : 'Caricamento file in corso', 'ntfdownload' : 'Downloading file in corso', 'ntfsave' : 'Salvataggio file in corso', 'ntfarchive' : 'Creazione archivio in corso', 'ntfextract' : 'Estrazione file dall\'archivio in corso', 'ntfsearch' : 'Ricerca files in corso', 'ntfresize' : 'Ridimensionamento immagini', 'ntfsmth' : 'Operazione in corso. Attendere...', 'ntfloadimg' : 'Caricamento immagine in corso', 'ntfnetmount' : 'Montaggio disco di rete', // added 18.04.2012 'ntfnetunmount': 'Smontaggio disco di rete', // from v2.1 added 30.04.2012 'ntfdim' : 'Lettura dimensioni immagine', // added 20.05.2013 'ntfreaddir' : 'Lettura informazioni cartella', // from v2.1 added 01.07.2013 'ntfurl' : 'Lettura URL del collegamento', // from v2.1 added 11.03.2014 'ntfchmod' : 'Modifica della modalità del file', // from v2.1 added 20.6.2015 'ntfpreupload': 'Verifica del nome del file caricato', // from v2.1 added 31.11.2015 'ntfzipdl' : 'Creazione del file da scaricare', // from v2.1.7 added 23.1.2016 'ntfparents' : 'Ottenimento informazioni percorso', // from v2.1.17 added 2.11.2016 'ntfchunkmerge': 'Processazione file caricato', // from v2.1.17 added 2.11.2016 'ntftrash' : 'Spostamento nel cestino', // from v2.1.24 added 2.5.2017 'ntfrestore' : 'Ripristino dal cestino', // from v2.1.24 added 3.5.2017 'ntfchkdir' : 'Controllo cartella destinazione', // from v2.1.24 added 3.5.2017 'ntfundo' : 'Annullamento operazione precedente', // from v2.1.27 added 31.07.2017 'ntfredo' : 'Rifacimento precedente annullamento', // from v2.1.27 added 31.07.2017 /*********************************** volumes *********************************/ 'volume_Trash' : 'Cestino', //from v2.1.24 added 29.4.2017 /************************************ dates **********************************/ 'dateUnknown' : 'Sconosciuto', 'Today' : 'Oggi', 'Yesterday' : 'Ieri', 'msJan' : 'Gen', 'msFeb' : 'Feb', 'msMar' : 'Mar', 'msApr' : 'Apr', 'msMay' : 'Mag', 'msJun' : 'Giu', 'msJul' : 'Lug', 'msAug' : 'Ago', 'msSep' : 'Set', 'msOct' : 'Ott', 'msNov' : 'Nov', 'msDec' : 'Dic', 'January' : 'Gennaio', 'February' : 'Febbraio', 'March' : 'Marzo', 'April' : 'Aprile', 'May' : 'Maggio', 'June' : 'Giugno', 'July' : 'Luglio', 'August' : 'Agosto', 'September' : 'Settembre', 'October' : 'Ottobre', 'November' : 'Novembre', 'December' : 'Dicembre', 'Sunday' : 'Domenica', 'Monday' : 'Lunedì', 'Tuesday' : 'Martedì', 'Wednesday' : 'Mercoledì', 'Thursday' : 'Giovedì', 'Friday' : 'Venerdì', 'Saturday' : 'Sabato', 'Sun' : 'Dom', 'Mon' : 'Lun', 'Tue' : 'Mar', 'Wed' : 'Mer', 'Thu' : 'Gio', 'Fri' : 'Ven', 'Sat' : 'Sab', /******************************** sort variants ********************************/ 'sortname' : 'per nome', 'sortkind' : 'per tipo', 'sortsize' : 'per dimensione', 'sortdate' : 'per data', 'sortFoldersFirst' : 'cartelle in testa', 'sortperm' : 'per permessi', // from v2.1.13 added 13.06.2016 'sortmode' : 'per modalità', // from v2.1.13 added 13.06.2016 'sortowner' : 'per possessore', // from v2.1.13 added 13.06.2016 'sortgroup' : 'per gruppo', // from v2.1.13 added 13.06.2016 'sortAlsoTreeview' : 'Anche vista ad albero', // from v2.1.15 added 01.08.2016 /********************************** new items **********************************/ 'untitled file.txt' : 'NuovoFile.txt', // added 10.11.2015 'untitled folder' : 'NuovaCartella', // added 10.11.2015 'Archive' : 'NuovoArchivio', // from v2.1 added 10.11.2015 /********************************** messages **********************************/ 'confirmReq' : 'Conferma richiesta', 'confirmRm' : 'Sei sicuro di voler eliminare i file?<br />L\'operazione non è reversibile!', 'confirmRepl' : 'Sostituire i file ?', 'confirmRest' : 'Rimpiazza l\'oggetto esistente con quello nel cestino?', // fromv2.1.24 added 5.5.2017 'confirmConvUTF8' : 'Non in formato UTF-8<br/>Convertire in UTF-8?<br/>Il contenuto diventerà UTF-8 salvando dopo la conversione.', // from v2.1 added 08.04.2014 'confirmNonUTF8' : 'La codifica caratteri di questo file non può essere determinata. Sarà temporaneamente convertito in UTF-8 per l\'editting.<br/>Per cortesia, selezionare la codifica caratteri per il file.', // from v2.1.19 added 28.11.2016 'confirmNotSave' : 'Il contenuto è stato modificato.<br/>Le modifiche andranno perse se non si salveranno.', // from v2.1 added 15.7.2015 'confirmTrash' : 'Sei sicuro di voler cestinare gli oggetti?', //from v2.1.24 added 29.4.2017 'apllyAll' : 'Applica a tutti', 'name' : 'Nome', 'size' : 'Dimensione', 'perms' : 'Permessi', 'modify' : 'Modificato il', 'kind' : 'Tipo', 'read' : 'lettura', 'write' : 'scrittura', 'noaccess' : 'nessun accesso', 'and' : 'e', 'unknown' : 'sconosciuto', 'selectall' : 'Seleziona tutti i file', 'selectfiles' : 'Seleziona file', 'selectffile' : 'Seleziona il primo file', 'selectlfile' : 'Seleziona l\'ultimo file', 'viewlist' : 'Visualizza Elenco', 'viewicons' : 'Visualizza Icone', 'viewSmall' : 'Icone piccole', // from v2.1.39 added 22.5.2018 'viewMedium' : 'Icone medie', // from v2.1.39 added 22.5.2018 'viewLarge' : 'Icone grandi', // from v2.1.39 added 22.5.2018 'viewExtraLarge' : 'Icone molto grandi', // from v2.1.39 added 22.5.2018 'places' : 'Accesso rapido', 'calc' : 'Calcola', 'path' : 'Percorso', 'aliasfor' : 'Alias per', 'locked' : 'Bloccato', 'dim' : 'Dimensioni', 'files' : 'File', 'folders' : 'Cartelle', 'items' : 'Oggetti', 'yes' : 'sì', 'no' : 'no', 'link' : 'Collegamento', 'searcresult' : 'Risultati ricerca', 'selected' : 'oggetti selezionati', 'about' : 'Informazioni', 'shortcuts' : 'Scorciatoie', 'help' : 'Aiuto', 'webfm' : 'Gestore file WEB', 'ver' : 'Versione', 'protocolver' : 'versione protocollo', 'homepage' : 'Home del progetto', 'docs' : 'Documentazione', 'github' : 'Seguici su Github', 'twitter' : 'Seguici su Twitter', 'facebook' : 'Seguici su Facebook', 'team' : 'Gruppo', 'chiefdev' : 'sviluppatore capo', 'developer' : 'sviluppatore', 'contributor' : 'collaboratore', 'maintainer' : 'manutentore', 'translator' : 'traduttore', 'icons' : 'Icone', 'dontforget' : 'e non dimenticate di portare l\'asciugamano', 'shortcutsof' : 'Scorciatoie disabilitate', 'dropFiles' : 'Trascina i file qui', 'or' : 'o', 'selectForUpload' : 'Seleziona file da caricare', 'moveFiles' : 'Sposta file', 'copyFiles' : 'Copia file', 'restoreFiles' : 'Ripristina oggetti', // from v2.1.24 added 5.5.2017 'rmFromPlaces' : 'Rimuovi da Accesso rapido', 'aspectRatio' : 'Proporzioni', 'scale' : 'Scala', 'width' : 'Larghezza', 'height' : 'Altezza', 'resize' : 'Ridimensione', 'crop' : 'Ritaglia', 'rotate' : 'Ruota', 'rotate-cw' : 'Ruota di 90° in senso orario', 'rotate-ccw' : 'Ruota di 90° in senso antiorario', 'degree' : 'Gradi', 'netMountDialogTitle' : 'Monta disco di rete', // added 18.04.2012 'protocol' : 'Protocollo', // added 18.04.2012 'host' : 'Host', // added 18.04.2012 'port' : 'Porta', // added 18.04.2012 'user' : 'Utente', // added 18.04.2012 'pass' : 'Password', // added 18.04.2012 'confirmUnmount' : 'Vuoi smontare $1?', // from v2.1 added 30.04.2012 'dropFilesBrowser': 'Rilascia o incolla dal browser', // from v2.1 added 30.05.2012 'dropPasteFiles' : 'Rilascia o incolla files e indirizzi URL qui', // from v2.1 added 07.04.2014 'encoding' : 'Codifica', // from v2.1 added 19.12.2014 'locale' : 'Lingua', // from v2.1 added 19.12.2014 'searchTarget' : 'Destinazione: $1', // from v2.1 added 22.5.2015 'searchMime' : 'Cerca per MIME Type', // from v2.1 added 22.5.2015 'owner' : 'Possessore', // from v2.1 added 20.6.2015 'group' : 'Gruppo', // from v2.1 added 20.6.2015 'other' : 'Altri', // from v2.1 added 20.6.2015 'execute' : 'Esegui', // from v2.1 added 20.6.2015 'perm' : 'Permessi', // from v2.1 added 20.6.2015 'mode' : 'Modalità', // from v2.1 added 20.6.2015 'emptyFolder' : 'La cartella è vuota', // from v2.1.6 added 30.12.2015 'emptyFolderDrop' : 'La cartella è vuota\\A Trascina e rilascia per aggiungere elementi', // from v2.1.6 added 30.12.2015 'emptyFolderLTap' : 'La cartella è vuota\\A Premi a lungo per aggiungere elementi', // from v2.1.6 added 30.12.2015 'quality' : 'Qualità', // from v2.1.6 added 5.1.2016 'autoSync' : 'Sincr. automatica', // from v2.1.6 added 10.1.2016 'moveUp' : 'Sposta in alto', // from v2.1.6 added 18.1.2016 'getLink' : 'Mostra URL link', // from v2.1.7 added 9.2.2016 'selectedItems' : 'Elementi selezionati ($1)', // from v2.1.7 added 2.19.2016 'folderId' : 'ID cartella', // from v2.1.10 added 3.25.2016 'offlineAccess' : 'Permetti accesso non in linea', // from v2.1.10 added 3.25.2016 'reAuth' : 'Per ri-autenticarsi', // from v2.1.10 added 3.25.2016 'nowLoading' : 'Caricamento...', // from v2.1.12 added 4.26.2016 'openMulti' : 'Apri più files', // from v2.1.12 added 5.14.2016 'openMultiConfirm': 'Stai cercando di aprire $1 files. Sei sicuro di volerli aprire nel browser?', // from v2.1.12 added 5.14.2016 'emptySearch' : 'Nessun risultato soddisfa i criteri di ricerca', // from v2.1.12 added 5.16.2016 'editingFile' : 'Il file è in modifica.', // from v2.1.13 added 6.3.2016 'hasSelected' : '$1 elementi sono selezionati.', // from v2.1.13 added 6.3.2016 'hasClipboard' : '$1 elementi negli appunti.', // from v2.1.13 added 6.3.2016 'incSearchOnly' : 'La ricerca incrementale è solo dalla vista corrente.', // from v2.1.13 added 6.30.2016 'reinstate' : 'Reistanzia', // from v2.1.15 added 3.8.2016 'complete' : '$1 completato', // from v2.1.15 added 21.8.2016 'contextmenu' : 'Menu contestuale', // from v2.1.15 added 9.9.2016 'pageTurning' : 'Orientamento pagina', // from v2.1.15 added 10.9.2016 'volumeRoots' : 'Percorsi base del volume', // from v2.1.16 added 16.9.2016 'reset' : 'Resetta', // from v2.1.16 added 1.10.2016 'bgcolor' : 'Colore di sfondo', // from v2.1.16 added 1.10.2016 'colorPicker' : 'Selettore colori', // from v2.1.16 added 1.10.2016 '8pxgrid' : 'Griglia di 8px', // from v2.1.16 added 4.10.2016 'enabled' : 'Abilitato', // from v2.1.16 added 4.10.2016 'disabled' : 'Disabilitato', // from v2.1.16 added 4.10.2016 'emptyIncSearch' : 'Nessun risultato di ricerca nella vista corrente\\APremere [Invio] per espandere l\'oggetto della ricerca.', // from v2.1.16 added 5.10.2016 'emptyLetSearch' : 'Nessun risultato di ricerca tramite prima lettera nella vista corrente.', // from v2.1.23 added 24.3.2017 'textLabel' : 'Etichetta di testo', // from v2.1.17 added 13.10.2016 'minsLeft' : '$1 minuti rimanenti', // from v2.1.17 added 13.11.2016 'openAsEncoding' : 'Riapri con la codifica di caratteri selezionata', // from v2.1.19 added 2.12.2016 'saveAsEncoding' : 'Salva con la codifica di caratteri selezionata', // from v2.1.19 added 2.12.2016 'selectFolder' : 'Seleziona cartella', // from v2.1.20 added 13.12.2016 'firstLetterSearch': 'Cerca tramite la prima lettera', // from v2.1.23 added 24.3.2017 'presets' : 'Opzioni predefinite', // from v2.1.25 added 26.5.2017 'tooManyToTrash' : 'Troppi oggetti da spostare nel cestino', // from v2.1.25 added 9.6.2017 'TextArea' : 'Area di testo', // from v2.1.25 added 14.6.2017 'folderToEmpty' : 'Svuota la cartella "$1".', // from v2.1.25 added 22.6.2017 'filderIsEmpty' : 'Non ci sono oggetti nella cartella "$1".', // from v2.1.25 added 22.6.2017 'preference' : 'Preferenze', // from v2.1.26 added 28.6.2017 'language' : 'Impostazioni Lingua', // from v2.1.26 added 28.6.2017 'clearBrowserData': 'Inizializza le impostazioni salvate nel browser', // from v2.1.26 added 28.6.2017 'toolbarPref' : 'Impostazioni ToolBar', // from v2.1.27 added 2.8.2017 'charsLeft' : '... $1 caratteri rimanenti.', // from v2.1.29 added 30.8.2017 'sum' : 'Somma', // from v2.1.29 added 28.9.2017 'roughFileSize' : 'Dimensione file approssimativa', // from v2.1.30 added 2.11.2017 'autoFocusDialog' : 'Fuoco sull\'elemento sotto al mouse', // from v2.1.30 added 2.11.2017 'select' : 'Seleziona', // from v2.1.30 added 23.11.2017 'selectAction' : 'Azione quando un file è selezionato', // from v2.1.30 added 23.11.2017 'useStoredEditor' : 'Apri con l\'editor usato l\'ultima volta', // from v2.1.30 added 23.11.2017 'selectinvert' : 'Inverti selezione', // from v2.1.30 added 25.11.2017 'renameMultiple' : 'Sei sicuro di voler rinominare $1 selezionati come $2?<br/>Questo non può essere annullato!', // from v2.1.31 added 4.12.2017 'batchRename' : 'Batch rename', // from v2.1.31 added 8.12.2017 'plusNumber' : '+ Numero', // from v2.1.31 added 8.12.2017 'asPrefix' : 'Aggiungi prefisso', // from v2.1.31 added 8.12.2017 'asSuffix' : 'Aggiungi sufisso', // from v2.1.31 added 8.12.2017 'changeExtention' : 'Cambia estensione', // from v2.1.31 added 8.12.2017 'columnPref' : 'Impostazioni delle colonne (visualizzazione elenco)', // from v2.1.32 added 6.2.2018 'reflectOnImmediate' : 'Tutti i cambiamenti saranno immeditamente applicati.', // from v2.1.33 added 2.3.2018 'reflectOnUnmount' : 'Qualsiasi modifica non sarà visibile fino a quando non si monta questo volume.', // from v2.1.33 added 2.3.2018 'unmountChildren' : 'The following volume(s) mounted on this volume also unmounted. Are you sure to unmount it?', // from v2.1.33 added 5.3.2018 'selectionInfo' : 'Seleziona Info', // from v2.1.33 added 7.3.2018 'hashChecker' : 'Algoritmi per visualizzare l\'hash del file', // from v2.1.33 added 10.3.2018 'infoItems' : 'Informazioni (pannello di informazioni sulla selezione)', // from v2.1.38 added 28.3.2018 'pressAgainToExit': 'Premi di nuovo per uscire.', // from v2.1.38 added 1.4.2018 'toolbar' : 'Toolbar', // from v2.1.38 added 4.4.2018 'workspace' : 'Spazio di lavoro', // from v2.1.38 added 4.4.2018 'dialog' : 'Dialog', // from v2.1.38 added 4.4.2018 'all' : 'Tutti', // from v2.1.38 added 4.4.2018 'iconSize' : 'Dimensione icona (Visualizzazione icone)', // form v2.1.39 added 7.5.2018 /********************************** mimetypes **********************************/ 'kindUnknown' : 'Sconosciuto', 'kindRoot' : 'Percorso base del volume', // from v2.1.16 added 16.10.2016 'kindFolder' : 'Cartella', 'kindSelects' : 'Selezioni', // from v2.1.29 added 29.8.2017 'kindAlias' : 'Alias', 'kindAliasBroken' : 'Alias guasto', // applications 'kindApp' : 'Applicazione', 'kindPostscript' : 'Documento Postscript', 'kindMsOffice' : 'Documento Microsoft Office', 'kindMsWord' : 'Documento Microsoft Word', 'kindMsExcel' : 'Documento Microsoft Excel', 'kindMsPP' : 'Presentazione Microsoft Powerpoint', 'kindOO' : 'Documento Open Office', 'kindAppFlash' : 'Applicazione Flash', 'kindPDF' : 'Documento PDF', 'kindTorrent' : 'File Bittorrent', 'kind7z' : 'Archivio 7z', 'kindTAR' : 'Archivio TAR', 'kindGZIP' : 'Archivio GZIP', 'kindBZIP' : 'Archivio BZIP', 'kindXZ' : 'Archivio XZ', 'kindZIP' : 'Archivio ZIP', 'kindRAR' : 'Archivio RAR', 'kindJAR' : 'File Java JAR', 'kindTTF' : 'Font True Type', 'kindOTF' : 'Font Open Type', 'kindRPM' : 'Pacchetto RPM', // texts 'kindText' : 'Documento di testo', 'kindTextPlain' : 'Testo Semplice', 'kindPHP' : 'File PHP', 'kindCSS' : 'File CSS (Cascading Style Sheet)', 'kindHTML' : 'Documento HTML', 'kindJS' : 'File Javascript', 'kindRTF' : 'File RTF (Rich Text Format)', 'kindC' : 'File C', 'kindCHeader' : 'File C (header)', 'kindCPP' : 'File C++', 'kindCPPHeader' : 'File C++ (header)', 'kindShell' : 'Script Unix shell', 'kindPython' : 'File Python', 'kindJava' : 'File Java', 'kindRuby' : 'File Ruby', 'kindPerl' : 'File Perl', 'kindSQL' : 'File SQL', 'kindXML' : 'File XML', 'kindAWK' : 'File AWK', 'kindCSV' : 'File CSV (Comma separated values)', 'kindDOCBOOK' : 'File Docbook XML', 'kindMarkdown' : 'Testo markdown', // added 20.7.2015 // images 'kindImage' : 'Immagine', 'kindBMP' : 'Immagine BMP', 'kindJPEG' : 'Immagine JPEG', 'kindGIF' : 'Immagine GIF', 'kindPNG' : 'Immagine PNG', 'kindTIFF' : 'Immagine TIFF', 'kindTGA' : 'Immagine TGA', 'kindPSD' : 'Immagine Adobe Photoshop', 'kindXBITMAP' : 'Immagine X bitmap', 'kindPXM' : 'Immagine Pixelmator', // media 'kindAudio' : 'File Audio', 'kindAudioMPEG' : 'Audio MPEG', 'kindAudioMPEG4' : 'Audio MPEG-4', 'kindAudioMIDI' : 'Audio MIDI', 'kindAudioOGG' : 'Audio Ogg Vorbis', 'kindAudioWAV' : 'Audio WAV', 'AudioPlaylist' : 'Playlist MP3', 'kindVideo' : 'File Video', 'kindVideoDV' : 'Filmato DV', 'kindVideoMPEG' : 'Filmato MPEG', 'kindVideoMPEG4' : 'Filmato MPEG-4', 'kindVideoAVI' : 'Filmato AVI', 'kindVideoMOV' : 'Filmato Quick Time', 'kindVideoWM' : 'Filmato Windows Media', 'kindVideoFlash' : 'Filmato Flash', 'kindVideoMKV' : 'Filmato Matroska', 'kindVideoOGG' : 'Filmato Ogg' } }; }));
{ "pile_set_name": "Github" }
/** ****************************************************************************** * @file stm32f4xx_hal_dac.h * @author MCD Application Team * @brief Header file of DAC HAL module. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. 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. * 3. Neither the name of STMicroelectronics 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. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_HAL_DAC_H #define __STM32F4xx_HAL_DAC_H #ifdef __cplusplus extern "C" { #endif #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx) || defined(STM32F446xx) ||\ defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F413xx) || defined(STM32F423xx) /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal_def.h" /** @addtogroup STM32F4xx_HAL_Driver * @{ */ /** @addtogroup DAC * @{ */ /* Exported types ------------------------------------------------------------*/ /** @defgroup DAC_Exported_Types DAC Exported Types * @{ */ /** * @brief HAL State structures definition */ typedef enum { HAL_DAC_STATE_RESET = 0x00U, /*!< DAC not yet initialized or disabled */ HAL_DAC_STATE_READY = 0x01U, /*!< DAC initialized and ready for use */ HAL_DAC_STATE_BUSY = 0x02U, /*!< DAC internal processing is ongoing */ HAL_DAC_STATE_TIMEOUT = 0x03U, /*!< DAC timeout state */ HAL_DAC_STATE_ERROR = 0x04U /*!< DAC error state */ }HAL_DAC_StateTypeDef; /** * @brief DAC handle Structure definition */ typedef struct { DAC_TypeDef *Instance; /*!< Register base address */ __IO HAL_DAC_StateTypeDef State; /*!< DAC communication state */ HAL_LockTypeDef Lock; /*!< DAC locking object */ DMA_HandleTypeDef *DMA_Handle1; /*!< Pointer DMA handler for channel 1 */ DMA_HandleTypeDef *DMA_Handle2; /*!< Pointer DMA handler for channel 2 */ __IO uint32_t ErrorCode; /*!< DAC Error code */ }DAC_HandleTypeDef; /** * @brief DAC Configuration regular Channel structure definition */ typedef struct { uint32_t DAC_Trigger; /*!< Specifies the external trigger for the selected DAC channel. This parameter can be a value of @ref DAC_trigger_selection */ uint32_t DAC_OutputBuffer; /*!< Specifies whether the DAC channel output buffer is enabled or disabled. This parameter can be a value of @ref DAC_output_buffer */ }DAC_ChannelConfTypeDef; /** * @} */ /* Exported constants --------------------------------------------------------*/ /** @defgroup DAC_Exported_Constants DAC Exported Constants * @{ */ /** @defgroup DAC_Error_Code DAC Error Code * @{ */ #define HAL_DAC_ERROR_NONE 0x00U /*!< No error */ #define HAL_DAC_ERROR_DMAUNDERRUNCH1 0x01U /*!< DAC channel1 DAM underrun error */ #define HAL_DAC_ERROR_DMAUNDERRUNCH2 0x02U /*!< DAC channel2 DAM underrun error */ #define HAL_DAC_ERROR_DMA 0x04U /*!< DMA error */ /** * @} */ /** @defgroup DAC_trigger_selection DAC Trigger Selection * @{ */ #define DAC_TRIGGER_NONE 0x00000000U /*!< Conversion is automatic once the DAC1_DHRxxxx register has been loaded, and not by external trigger */ #define DAC_TRIGGER_T2_TRGO ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TEN1)) /*!< TIM2 TRGO selected as external conversion trigger for DAC channel */ #define DAC_TRIGGER_T4_TRGO ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM4 TRGO selected as external conversion trigger for DAC channel */ #define DAC_TRIGGER_T5_TRGO ((uint32_t)(DAC_CR_TSEL1_1 | DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM5 TRGO selected as external conversion trigger for DAC channel */ #define DAC_TRIGGER_T6_TRGO ((uint32_t)DAC_CR_TEN1) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */ #define DAC_TRIGGER_T7_TRGO ((uint32_t)(DAC_CR_TSEL1_1 | DAC_CR_TEN1)) /*!< TIM7 TRGO selected as external conversion trigger for DAC channel */ #define DAC_TRIGGER_T8_TRGO ((uint32_t)(DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM8 TRGO selected as external conversion trigger for DAC channel */ #define DAC_TRIGGER_EXT_IT9 ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TSEL1_1 | DAC_CR_TEN1)) /*!< EXTI Line9 event selected as external conversion trigger for DAC channel */ #define DAC_TRIGGER_SOFTWARE ((uint32_t)(DAC_CR_TSEL1 | DAC_CR_TEN1)) /*!< Conversion started by software trigger for DAC channel */ /** * @} */ /** @defgroup DAC_output_buffer DAC Output Buffer * @{ */ #define DAC_OUTPUTBUFFER_ENABLE 0x00000000U #define DAC_OUTPUTBUFFER_DISABLE ((uint32_t)DAC_CR_BOFF1) /** * @} */ /** @defgroup DAC_Channel_selection DAC Channel Selection * @{ */ #define DAC_CHANNEL_1 0x00000000U #define DAC_CHANNEL_2 0x00000010U /** * @} */ /** @defgroup DAC_data_alignment DAC Data Alignment * @{ */ #define DAC_ALIGN_12B_R 0x00000000U #define DAC_ALIGN_12B_L 0x00000004U #define DAC_ALIGN_8B_R 0x00000008U /** * @} */ /** @defgroup DAC_flags_definition DAC Flags Definition * @{ */ #define DAC_FLAG_DMAUDR1 ((uint32_t)DAC_SR_DMAUDR1) #define DAC_FLAG_DMAUDR2 ((uint32_t)DAC_SR_DMAUDR2) /** * @} */ /** @defgroup DAC_IT_definition DAC IT Definition * @{ */ #define DAC_IT_DMAUDR1 ((uint32_t)DAC_SR_DMAUDR1) #define DAC_IT_DMAUDR2 ((uint32_t)DAC_SR_DMAUDR2) /** * @} */ /** * @} */ /* Exported macro ------------------------------------------------------------*/ /** @defgroup DAC_Exported_Macros DAC Exported Macros * @{ */ /** @brief Reset DAC handle state * @param __HANDLE__ specifies the DAC handle. * @retval None */ #define __HAL_DAC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DAC_STATE_RESET) /** @brief Enable the DAC channel * @param __HANDLE__ specifies the DAC handle. * @param __DAC_Channel__ specifies the DAC channel * @retval None */ #define __HAL_DAC_ENABLE(__HANDLE__, __DAC_Channel__) ((__HANDLE__)->Instance->CR |= (DAC_CR_EN1 << (__DAC_Channel__))) /** @brief Disable the DAC channel * @param __HANDLE__ specifies the DAC handle * @param __DAC_Channel__ specifies the DAC channel. * @retval None */ #define __HAL_DAC_DISABLE(__HANDLE__, __DAC_Channel__) ((__HANDLE__)->Instance->CR &= ~(DAC_CR_EN1 << (__DAC_Channel__))) /** @brief Enable the DAC interrupt * @param __HANDLE__ specifies the DAC handle * @param __INTERRUPT__ specifies the DAC interrupt. * @retval None */ #define __HAL_DAC_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR) |= (__INTERRUPT__)) /** @brief Disable the DAC interrupt * @param __HANDLE__ specifies the DAC handle * @param __INTERRUPT__ specifies the DAC interrupt. * @retval None */ #define __HAL_DAC_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR) &= ~(__INTERRUPT__)) /** @brief Checks if the specified DAC interrupt source is enabled or disabled. * @param __HANDLE__ DAC handle * @param __INTERRUPT__ DAC interrupt source to check * This parameter can be any combination of the following values: * @arg DAC_IT_DMAUDR1: DAC channel 1 DMA underrun interrupt * @arg DAC_IT_DMAUDR2: DAC channel 2 DMA underrun interrupt * @retval State of interruption (SET or RESET) */ #define __HAL_DAC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR & (__INTERRUPT__)) == (__INTERRUPT__)) /** @brief Get the selected DAC's flag status. * @param __HANDLE__ specifies the DAC handle. * @param __FLAG__ specifies the flag to clear. * This parameter can be any combination of the following values: * @arg DAC_FLAG_DMAUDR1: DMA underrun 1 flag * @arg DAC_FLAG_DMAUDR2: DMA underrun 2 flag * @retval None */ #define __HAL_DAC_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__)) /** @brief Clear the DAC's flag. * @param __HANDLE__ specifies the DAC handle. * @param __FLAG__ specifies the flag to clear. * This parameter can be any combination of the following values: * @arg DAC_FLAG_DMAUDR1: DMA underrun 1 flag * @arg DAC_FLAG_DMAUDR2: DMA underrun 2 flag * @retval None */ #define __HAL_DAC_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR) = (__FLAG__)) /** * @} */ /* Include DAC HAL Extension module */ #include "stm32f4xx_hal_dac_ex.h" /* Exported functions --------------------------------------------------------*/ /** @addtogroup DAC_Exported_Functions * @{ */ /** @addtogroup DAC_Exported_Functions_Group1 * @{ */ /* Initialization/de-initialization functions *********************************/ HAL_StatusTypeDef HAL_DAC_Init(DAC_HandleTypeDef* hdac); HAL_StatusTypeDef HAL_DAC_DeInit(DAC_HandleTypeDef* hdac); void HAL_DAC_MspInit(DAC_HandleTypeDef* hdac); void HAL_DAC_MspDeInit(DAC_HandleTypeDef* hdac); /** * @} */ /** @addtogroup DAC_Exported_Functions_Group2 * @{ */ /* I/O operation functions ****************************************************/ HAL_StatusTypeDef HAL_DAC_Start(DAC_HandleTypeDef* hdac, uint32_t Channel); HAL_StatusTypeDef HAL_DAC_Stop(DAC_HandleTypeDef* hdac, uint32_t Channel); HAL_StatusTypeDef HAL_DAC_Start_DMA(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t* pData, uint32_t Length, uint32_t Alignment); HAL_StatusTypeDef HAL_DAC_Stop_DMA(DAC_HandleTypeDef* hdac, uint32_t Channel); uint32_t HAL_DAC_GetValue(DAC_HandleTypeDef* hdac, uint32_t Channel); /** * @} */ /** @addtogroup DAC_Exported_Functions_Group3 * @{ */ /* Peripheral Control functions ***********************************************/ HAL_StatusTypeDef HAL_DAC_ConfigChannel(DAC_HandleTypeDef* hdac, DAC_ChannelConfTypeDef* sConfig, uint32_t Channel); HAL_StatusTypeDef HAL_DAC_SetValue(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Alignment, uint32_t Data); /** * @} */ /** @addtogroup DAC_Exported_Functions_Group4 * @{ */ /* Peripheral State functions *************************************************/ HAL_DAC_StateTypeDef HAL_DAC_GetState(DAC_HandleTypeDef* hdac); void HAL_DAC_IRQHandler(DAC_HandleTypeDef* hdac); uint32_t HAL_DAC_GetError(DAC_HandleTypeDef *hdac); void HAL_DAC_ConvCpltCallbackCh1(DAC_HandleTypeDef* hdac); void HAL_DAC_ConvHalfCpltCallbackCh1(DAC_HandleTypeDef* hdac); void HAL_DAC_ErrorCallbackCh1(DAC_HandleTypeDef *hdac); void HAL_DAC_DMAUnderrunCallbackCh1(DAC_HandleTypeDef *hdac); /** * @} */ /** * @} */ /* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private constants ---------------------------------------------------------*/ /** @defgroup DAC_Private_Constants DAC Private Constants * @{ */ /** * @} */ /* Private macros ------------------------------------------------------------*/ /** @defgroup DAC_Private_Macros DAC Private Macros * @{ */ #define IS_DAC_DATA(DATA) ((DATA) <= 0xFFF0U) #define IS_DAC_ALIGN(ALIGN) (((ALIGN) == DAC_ALIGN_12B_R) || \ ((ALIGN) == DAC_ALIGN_12B_L) || \ ((ALIGN) == DAC_ALIGN_8B_R)) #define IS_DAC_CHANNEL(CHANNEL) (((CHANNEL) == DAC_CHANNEL_1) || \ ((CHANNEL) == DAC_CHANNEL_2)) #define IS_DAC_OUTPUT_BUFFER_STATE(STATE) (((STATE) == DAC_OUTPUTBUFFER_ENABLE) || \ ((STATE) == DAC_OUTPUTBUFFER_DISABLE)) #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \ ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \ ((TRIGGER) == DAC_TRIGGER_T8_TRGO) || \ ((TRIGGER) == DAC_TRIGGER_T7_TRGO) || \ ((TRIGGER) == DAC_TRIGGER_T5_TRGO) || \ ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \ ((TRIGGER) == DAC_TRIGGER_T4_TRGO) || \ ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \ ((TRIGGER) == DAC_TRIGGER_SOFTWARE)) /** @brief Set DHR12R1 alignment * @param __ALIGNMENT__ specifies the DAC alignment * @retval None */ #define DAC_DHR12R1_ALIGNMENT(__ALIGNMENT__) (0x00000008U + (__ALIGNMENT__)) /** @brief Set DHR12R2 alignment * @param __ALIGNMENT__ specifies the DAC alignment * @retval None */ #define DAC_DHR12R2_ALIGNMENT(__ALIGNMENT__) (((uint32_t)0x00000014U) + (__ALIGNMENT__)) /** @brief Set DHR12RD alignment * @param __ALIGNMENT__ specifies the DAC alignment * @retval None */ #define DAC_DHR12RD_ALIGNMENT(__ALIGNMENT__) (0x00000020U + (__ALIGNMENT__)) /** * @} */ /* Private functions ---------------------------------------------------------*/ /** @defgroup DAC_Private_Functions DAC Private Functions * @{ */ /** * @} */ #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx ||\ STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||\ STM32F410xx || STM32F446xx || STM32F469xx || STM32F479xx ||\ STM32F413xx || STM32F423xx */ /** * @} */ /** * @} */ #ifdef __cplusplus } #endif #endif /*__STM32F4xx_HAL_DAC_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
{ "pile_set_name": "Github" }
using System; using System.ComponentModel.Composition; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web.Mvc; using Thinktecture.IdentityModel.Authorization.Mvc; using Thinktecture.IdentityServer.Models.Configuration; using Thinktecture.IdentityServer.Repositories; using Thinktecture.IdentityServer.Web.Areas.Admin.ViewModels; namespace Thinktecture.IdentityServer.Web.Areas.Admin.Controllers { [ClaimsAuthorize(Constants.Actions.Administration, Constants.Resources.Configuration)] public class ProtocolController : Controller { [Import] public IConfigurationRepository ConfigurationRepository { get; set; } public ProtocolController() { Container.Current.SatisfyImportsOnce(this); } public ProtocolController(IConfigurationRepository configurationRepository) { ConfigurationRepository = configurationRepository; } public ActionResult Index() { var vm = new ProtocolsViewModel(ConfigurationRepository); return View("Index", vm); } [HttpPost] [ValidateAntiForgeryToken] public ActionResult Index(ProtocolsInputModel model) { if (ModelState.IsValid) { try { model.Update(this.ConfigurationRepository); TempData["Message"] = Resources.ProtocolController.UpdateSuccessful; return RedirectToAction("Index"); } catch (ValidationException ex) { ModelState.AddModelError("", ex.Message); } catch { ModelState.AddModelError("", Resources.ProtocolController.ErrorUpdatingProtocols); } } var vm = new ProtocolsViewModel(ConfigurationRepository); return View("Index", vm); } [ChildActionOnly] public ActionResult Menu() { var pvm = new ProtocolsViewModel(ConfigurationRepository); var list = pvm.Protocols.Where(x => x.Enabled).ToArray(); if (list.Length > 0) { var vm = new ChildMenuViewModel(); vm.Items = list.Select(x => new ChildMenuItem { Controller = "Protocol", Action = "Protocol", Title = x.Name, RouteValues = new { id = x.NameWithoutSpaces } }).ToArray(); return PartialView("ChildMenu", vm); } return new EmptyResult(); } public ActionResult Protocol(string id) { var vm = new ProtocolsViewModel(this.ConfigurationRepository); var protocol = vm.GetProtocol(id); if (protocol == null) return HttpNotFound(); if (id == "ADFSIntegration") { return View("ADFSIntegration", protocol); } return View("Protocol", protocol); } [HttpPost] [ValidateAntiForgeryToken] public ActionResult UpdateADFSIntegration( [Bind(Exclude = "EncryptionCertificate")] AdfsIntegrationConfiguration protocol, [Bind(Prefix = "protocol")] AdfsIntegrationCertInputModel cert, bool? removeCert) { string id = "ADFSIntegration"; if (removeCert == true) { protocol.EncryptionCertificate = null; } else if (cert.EncryptionCertificate != null) { protocol.EncryptionCertificate = cert.Cert; } else { protocol.EncryptionCertificate = this.ConfigurationRepository.AdfsIntegration.EncryptionCertificate; } if (protocol.Enabled) { if (protocol.SamlAuthenticationEnabled && protocol.EncryptionCertificate == null) { ModelState.AddModelError("protocol.EncryptionCertificate", "EncryptionCertificate required when SamlAuthenticationEnabled is enabled."); } if (protocol.JwtAuthenticationEnabled && protocol.EncryptionCertificate == null) { ModelState.AddModelError("protocol.EncryptionCertificate", "EncryptionCertificate required when JwtAuthenticationEnabled is enabled."); } } if (ModelState.IsValid) { try { this.ConfigurationRepository.AdfsIntegration = protocol; TempData["Message"] = "Update Successful"; return RedirectToAction("Protocol", new { id }); } catch (ValidationException ex) { ModelState.AddModelError("", ex.Message); } catch { ModelState.AddModelError("", "Error updating protocol."); } } var vm = new ProtocolsViewModel(this.ConfigurationRepository); var orig = vm.GetProtocol(id); return View("ADFSIntegration", orig); } [HttpPost] [ValidateAntiForgeryToken] public ActionResult UpdateProtocol(string id) { var vm = new ProtocolsViewModel(this.ConfigurationRepository); var protocol = vm.GetProtocol(id); if (this.TryUpdateModel(protocol.Protocol, "protocol")) { try { vm.UpdateProtocol(protocol); TempData["Message"] = Resources.ProtocolController.UpdateSuccessful; return RedirectToAction("Protocol", new { id }); } catch (ValidationException ex) { ModelState.AddModelError("", ex.Message); } catch { ModelState.AddModelError("", Resources.ProtocolController.ErrorUpdatingProtocol); } } return View("Protocol", protocol); } bool TryUpdateModel(object model, string prefix) { if (model == null) { throw new ArgumentNullException("model"); } var valueProvider = this.ValueProvider; Predicate<string> predicate = delegate(string propertyName) { return IsPropertyAllowed(propertyName, null, null); }; var modelType = model.GetType(); IModelBinder binder = this.Binders.GetBinder(modelType); ModelBindingContext context2 = new ModelBindingContext(); context2.ModelMetadata = ModelMetadataProviders.Current.GetMetadataForType(delegate { return model; }, modelType); context2.ModelName = prefix; context2.ModelState = this.ModelState; context2.PropertyFilter = predicate; context2.ValueProvider = valueProvider; ModelBindingContext bindingContext = context2; binder.BindModel(base.ControllerContext, bindingContext); return this.ModelState.IsValid; } internal static bool IsPropertyAllowed(string propertyName, string[] includeProperties, string[] excludeProperties) { bool flag = ((includeProperties == null) || (includeProperties.Length == 0)) || includeProperties.Contains<string>(propertyName, StringComparer.OrdinalIgnoreCase); bool flag2 = (excludeProperties != null) && excludeProperties.Contains<string>(propertyName, StringComparer.OrdinalIgnoreCase); return (flag && !flag2); } } }
{ "pile_set_name": "Github" }
{ "private": true, "name": "react-fetch", "description": "Helpers for creating React data sources", "version": "0.0.0", "repository": { "type" : "git", "url" : "https://github.com/facebook/react.git", "directory": "packages/react-fetch" }, "files": [ "LICENSE", "README.md", "build-info.json", "index.js", "index.node.js", "index.browser.js", "cjs/" ], "peerDependencies": { "react": "^17.0.0-alpha" }, "browser": { "./index.js": "./index.browser.js" } }
{ "pile_set_name": "Github" }
**To retrieve the server-side encryption configuration for a bucket** The following ``get-bucket-encryption`` example retrieves the server-side encryption configuration for the bucket ``my-bucket``. :: aws s3api get-bucket-encryption \ --bucket my-bucket Output:: { "ServerSideEncryptionConfiguration": { "Rules": [ { "ApplyServerSideEncryptionByDefault": { "SSEAlgorithm": "AES256" } } ] } }
{ "pile_set_name": "Github" }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Messenger\Tests\EventListener; use PHPUnit\Framework\TestCase; use Psr\Cache\CacheItemInterface; use Psr\Cache\CacheItemPoolInterface; use Symfony\Component\Messenger\Event\WorkerRunningEvent; use Symfony\Component\Messenger\EventListener\StopWorkerOnRestartSignalListener; use Symfony\Component\Messenger\Worker; /** * @group time-sensitive */ class StopWorkerOnRestartSignalListenerTest extends TestCase { /** * @dataProvider restartTimeProvider */ public function testWorkerStopsWhenMemoryLimitExceeded(?int $lastRestartTimeOffset, bool $shouldStop) { $cachePool = $this->createMock(CacheItemPoolInterface::class); $cacheItem = $this->createMock(CacheItemInterface::class); $cacheItem->expects($this->once())->method('isHIt')->willReturn(true); $cacheItem->expects($this->once())->method('get')->willReturn(null === $lastRestartTimeOffset ? null : time() + $lastRestartTimeOffset); $cachePool->expects($this->once())->method('getItem')->willReturn($cacheItem); $worker = $this->createMock(Worker::class); $worker->expects($shouldStop ? $this->once() : $this->never())->method('stop'); $event = new WorkerRunningEvent($worker, false); $stopOnSignalListener = new StopWorkerOnRestartSignalListener($cachePool); $stopOnSignalListener->onWorkerStarted(); $stopOnSignalListener->onWorkerRunning($event); } public function restartTimeProvider() { yield [null, false]; // no cached restart time, do not restart yield [+10, true]; // 10 seconds after starting, a restart was requested yield [-10, false]; // a restart was requested, but 10 seconds before we started } public function testWorkerDoesNotStopIfRestartNotInCache() { $cachePool = $this->createMock(CacheItemPoolInterface::class); $cacheItem = $this->createMock(CacheItemInterface::class); $cacheItem->expects($this->once())->method('isHIt')->willReturn(false); $cacheItem->expects($this->never())->method('get'); $cachePool->expects($this->once())->method('getItem')->willReturn($cacheItem); $worker = $this->createMock(Worker::class); $worker->expects($this->never())->method('stop'); $event = new WorkerRunningEvent($worker, false); $stopOnSignalListener = new StopWorkerOnRestartSignalListener($cachePool); $stopOnSignalListener->onWorkerStarted(); $stopOnSignalListener->onWorkerRunning($event); } }
{ "pile_set_name": "Github" }
define("ace/mode/lsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; oop.inherits(LSLHighlightRules, TextHighlightRules); function LSLHighlightRules() { var keywordMapper = this.createKeywordMapper({ "constant.language.float.lsl" : "DEG_TO_RAD|PI|PI_BY_TWO|RAD_TO_DEG|SQRT2|TWO_PI", "constant.language.integer.lsl": "ACTIVE|AGENT|AGENT_ALWAYS_RUN|AGENT_ATTACHMENTS|AGENT_AUTOPILOT|AGENT_AWAY|AGENT_BUSY|AGENT_BY_LEGACY_NAME|AGENT_BY_USERNAME|AGENT_CROUCHING|AGENT_FLYING|AGENT_IN_AIR|AGENT_LIST_PARCEL|AGENT_LIST_PARCEL_OWNER|AGENT_LIST_REGION|AGENT_MOUSELOOK|AGENT_ON_OBJECT|AGENT_SCRIPTED|AGENT_SITTING|AGENT_TYPING|AGENT_WALKING|ALL_SIDES|ANIM_ON|ATTACH_AVATAR_CENTER|ATTACH_BACK|ATTACH_BELLY|ATTACH_CHEST|ATTACH_CHIN|ATTACH_HEAD|ATTACH_HUD_BOTTOM|ATTACH_HUD_BOTTOM_LEFT|ATTACH_HUD_BOTTOM_RIGHT|ATTACH_HUD_CENTER_1|ATTACH_HUD_CENTER_2|ATTACH_HUD_TOP_CENTER|ATTACH_HUD_TOP_LEFT|ATTACH_HUD_TOP_RIGHT|ATTACH_LEAR|ATTACH_LEFT_PEC|ATTACH_LEYE|ATTACH_LFOOT|ATTACH_LHAND|ATTACH_LHIP|ATTACH_LLARM|ATTACH_LLLEG|ATTACH_LSHOULDER|ATTACH_LUARM|ATTACH_LULEG|ATTACH_MOUTH|ATTACH_NECK|ATTACH_NOSE|ATTACH_PELVIS|ATTACH_REAR|ATTACH_REYE|ATTACH_RFOOT|ATTACH_RHAND|ATTACH_RHIP|ATTACH_RIGHT_PEC|ATTACH_RLARM|ATTACH_RLLEG|ATTACH_RSHOULDER|ATTACH_RUARM|ATTACH_RULEG|AVOID_CHARACTERS|AVOID_DYNAMIC_OBSTACLES|AVOID_NONE|CAMERA_ACTIVE|CAMERA_BEHINDNESS_ANGLE|CAMERA_BEHINDNESS_LAG|CAMERA_DISTANCE|CAMERA_FOCUS|CAMERA_FOCUS_LAG|CAMERA_FOCUS_LOCKED|CAMERA_FOCUS_OFFSET|CAMERA_FOCUS_THRESHOLD|CAMERA_PITCH|CAMERA_POSITION|CAMERA_POSITION_LAG|CAMERA_POSITION_LOCKED|CAMERA_POSITION_THRESHOLD|CHANGED_ALLOWED_DROP|CHANGED_COLOR|CHANGED_INVENTORY|CHANGED_LINK|CHANGED_MEDIA|CHANGED_OWNER|CHANGED_REGION|CHANGED_REGION_START|CHANGED_SCALE|CHANGED_SHAPE|CHANGED_TELEPORT|CHANGED_TEXTURE|CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES|CHARACTER_AVOIDANCE_MODE|CHARACTER_CMD_JUMP|CHARACTER_CMD_SMOOTH_STOP|CHARACTER_CMD_STOP|CHARACTER_DESIRED_SPEED|CHARACTER_DESIRED_TURN_SPEED|CHARACTER_LENGTH|CHARACTER_MAX_ACCEL|CHARACTER_MAX_DECEL|CHARACTER_MAX_SPEED|CHARACTER_MAX_TURN_RADIUS|CHARACTER_ORIENTATION|CHARACTER_RADIUS|CHARACTER_STAY_WITHIN_PARCEL|CHARACTER_TYPE|CHARACTER_TYPE_A|CHARACTER_TYPE_B|CHARACTER_TYPE_C|CHARACTER_TYPE_D|CHARACTER_TYPE_NONE|CLICK_ACTION_BUY|CLICK_ACTION_NONE|CLICK_ACTION_OPEN|CLICK_ACTION_OPEN_MEDIA|CLICK_ACTION_PAY|CLICK_ACTION_PLAY|CLICK_ACTION_SIT|CLICK_ACTION_TOUCH|CONTENT_TYPE_ATOM|CONTENT_TYPE_FORM|CONTENT_TYPE_HTML|CONTENT_TYPE_JSON|CONTENT_TYPE_LLSD|CONTENT_TYPE_RSS|CONTENT_TYPE_TEXT|CONTENT_TYPE_XHTML|CONTENT_TYPE_XML|CONTROL_BACK|CONTROL_DOWN|CONTROL_FWD|CONTROL_LBUTTON|CONTROL_LEFT|CONTROL_ML_LBUTTON|CONTROL_RIGHT|CONTROL_ROT_LEFT|CONTROL_ROT_RIGHT|CONTROL_UP|DATA_BORN|DATA_NAME|DATA_ONLINE|DATA_PAYINFO|DATA_SIM_POS|DATA_SIM_RATING|DATA_SIM_STATUS|DEBUG_CHANNEL|DENSITY|ERR_GENERIC|ERR_MALFORMED_PARAMS|ERR_PARCEL_PERMISSIONS|ERR_RUNTIME_PERMISSIONS|ERR_THROTTLED|ESTATE_ACCESS_ALLOWED_AGENT_ADD|ESTATE_ACCESS_ALLOWED_AGENT_REMOVE|ESTATE_ACCESS_ALLOWED_GROUP_ADD|ESTATE_ACCESS_ALLOWED_GROUP_REMOVE|ESTATE_ACCESS_BANNED_AGENT_ADD|ESTATE_ACCESS_BANNED_AGENT_REMOVE|FALSE|FORCE_DIRECT_PATH|FRICTION|GCNP_RADIUS|GCNP_STATIC|GRAVITY_MULTIPLIER|HORIZONTAL|HTTP_BODY_MAXLENGTH|HTTP_BODY_TRUNCATED|HTTP_CUSTOM_HEADER|HTTP_METHOD|HTTP_MIMETYPE|HTTP_PRAGMA_NO_CACHE|HTTP_VERBOSE_THROTTLE|HTTP_VERIFY_CERT|INVENTORY_ALL|INVENTORY_ANIMATION|INVENTORY_BODYPART|INVENTORY_CLOTHING|INVENTORY_GESTURE|INVENTORY_LANDMARK|INVENTORY_NONE|INVENTORY_NOTECARD|INVENTORY_OBJECT|INVENTORY_SCRIPT|INVENTORY_SOUND|INVENTORY_TEXTURE|JSON_APPEND|KFM_CMD_PAUSE|KFM_CMD_PLAY|KFM_CMD_SET_MODE|KFM_CMD_STOP|KFM_COMMAND|KFM_DATA|KFM_FORWARD|KFM_LOOP|KFM_MODE|KFM_PING_PONG|KFM_REVERSE|KFM_ROTATION|KFM_TRANSLATION|LAND_LEVEL|LAND_LOWER|LAND_NOISE|LAND_RAISE|LAND_REVERT|LAND_SMOOTH|LINK_ALL_CHILDREN|LINK_ALL_OTHERS|LINK_ROOT|LINK_SET|LINK_THIS|LIST_STAT_GEOMETRIC_MEAN|LIST_STAT_MAX|LIST_STAT_MEAN|LIST_STAT_MEDIAN|LIST_STAT_MIN|LIST_STAT_NUM_COUNT|LIST_STAT_RANGE|LIST_STAT_STD_DEV|LIST_STAT_SUM|LIST_STAT_SUM_SQUARES|LOOP|MASK_BASE|MASK_EVERYONE|MASK_GROUP|MASK_NEXT|MASK_OWNER|OBJECT_ATTACHED_POINT|OBJECT_CHARACTER_TIME|OBJECT_CREATOR|OBJECT_DESC|OBJECT_GROUP|OBJECT_NAME|OBJECT_OWNER|OBJECT_PATHFINDING_TYPE|OBJECT_PHANTOM|OBJECT_PHYSICS|OBJECT_PHYSICS_COST|OBJECT_POS|OBJECT_PRIM_EQUIVALENCE|OBJECT_RENDER_WEIGHT|OBJECT_RETURN_PARCEL|OBJECT_RETURN_PARCEL_OWNER|OBJECT_RETURN_REGION|OBJECT_ROOT|OBJECT_ROT|OBJECT_RUNNING_SCRIPT_COUNT|OBJECT_SCRIPT_MEMORY|OBJECT_SCRIPT_TIME|OBJECT_SERVER_COST|OBJECT_STREAMING_COST|OBJECT_TEMP_ON_REZ|OBJECT_TOTAL_SCRIPT_COUNT|OBJECT_UNKNOWN_DETAIL|OBJECT_VELOCITY|OPT_AVATAR|OPT_CHARACTER|OPT_EXCLUSION_VOLUME|OPT_LEGACY_LINKSET|OPT_MATERIAL_VOLUME|OPT_OTHER|OPT_STATIC_OBSTACLE|OPT_WALKABLE|PARCEL_COUNT_GROUP|PARCEL_COUNT_OTHER|PARCEL_COUNT_OWNER|PARCEL_COUNT_SELECTED|PARCEL_COUNT_TEMP|PARCEL_COUNT_TOTAL|PARCEL_DETAILS_AREA|PARCEL_DETAILS_DESC|PARCEL_DETAILS_GROUP|PARCEL_DETAILS_ID|PARCEL_DETAILS_NAME|PARCEL_DETAILS_OWNER|PARCEL_DETAILS_SEE_AVATARS|PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY|PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS|PARCEL_FLAG_ALLOW_CREATE_OBJECTS|PARCEL_FLAG_ALLOW_DAMAGE|PARCEL_FLAG_ALLOW_FLY|PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY|PARCEL_FLAG_ALLOW_GROUP_SCRIPTS|PARCEL_FLAG_ALLOW_LANDMARK|PARCEL_FLAG_ALLOW_SCRIPTS|PARCEL_FLAG_ALLOW_TERRAFORM|PARCEL_FLAG_LOCAL_SOUND_ONLY|PARCEL_FLAG_RESTRICT_PUSHOBJECT|PARCEL_FLAG_USE_ACCESS_GROUP|PARCEL_FLAG_USE_ACCESS_LIST|PARCEL_FLAG_USE_BAN_LIST|PARCEL_FLAG_USE_LAND_PASS_LIST|PARCEL_MEDIA_COMMAND_AGENT|PARCEL_MEDIA_COMMAND_AUTO_ALIGN|PARCEL_MEDIA_COMMAND_DESC|PARCEL_MEDIA_COMMAND_LOOP|PARCEL_MEDIA_COMMAND_LOOP_SET|PARCEL_MEDIA_COMMAND_PAUSE|PARCEL_MEDIA_COMMAND_PLAY|PARCEL_MEDIA_COMMAND_SIZE|PARCEL_MEDIA_COMMAND_STOP|PARCEL_MEDIA_COMMAND_TEXTURE|PARCEL_MEDIA_COMMAND_TIME|PARCEL_MEDIA_COMMAND_TYPE|PARCEL_MEDIA_COMMAND_UNLOAD|PARCEL_MEDIA_COMMAND_URL|PASSIVE|PATROL_PAUSE_AT_WAYPOINTS|PAYMENT_INFO_ON_FILE|PAYMENT_INFO_USED|PAY_DEFAULT|PAY_HIDE|PERMISSION_ATTACH|PERMISSION_CHANGE_LINKS|PERMISSION_CONTROL_CAMERA|PERMISSION_DEBIT|PERMISSION_OVERRIDE_ANIMATIONS|PERMISSION_RETURN_OBJECTS|PERMISSION_SILENT_ESTATE_MANAGEMENT|PERMISSION_TAKE_CONTROLS|PERMISSION_TELEPORT|PERMISSION_TRACK_CAMERA|PERMISSION_TRIGGER_ANIMATION|PERM_ALL|PERM_COPY|PERM_MODIFY|PERM_MOVE|PERM_TRANSFER|PING_PONG|PRIM_ALPHA_MODE|PRIM_ALPHA_MODE_BLEND|PRIM_ALPHA_MODE_EMISSIVE|PRIM_ALPHA_MODE_MASK|PRIM_ALPHA_MODE_NONE|PRIM_BUMP_BARK|PRIM_BUMP_BLOBS|PRIM_BUMP_BRICKS|PRIM_BUMP_BRIGHT|PRIM_BUMP_CHECKER|PRIM_BUMP_CONCRETE|PRIM_BUMP_DARK|PRIM_BUMP_DISKS|PRIM_BUMP_GRAVEL|PRIM_BUMP_LARGETILE|PRIM_BUMP_NONE|PRIM_BUMP_SHINY|PRIM_BUMP_SIDING|PRIM_BUMP_STONE|PRIM_BUMP_STUCCO|PRIM_BUMP_SUCTION|PRIM_BUMP_TILE|PRIM_BUMP_WEAVE|PRIM_BUMP_WOOD|PRIM_COLOR|PRIM_DESC|PRIM_FLEXIBLE|PRIM_FULLBRIGHT|PRIM_GLOW|PRIM_HOLE_CIRCLE|PRIM_HOLE_DEFAULT|PRIM_HOLE_SQUARE|PRIM_HOLE_TRIANGLE|PRIM_LINK_TARGET|PRIM_MATERIAL|PRIM_MATERIAL_FLESH|PRIM_MATERIAL_GLASS|PRIM_MATERIAL_METAL|PRIM_MATERIAL_PLASTIC|PRIM_MATERIAL_RUBBER|PRIM_MATERIAL_STONE|PRIM_MATERIAL_WOOD|PRIM_MEDIA_ALT_IMAGE_ENABLE|PRIM_MEDIA_AUTO_LOOP|PRIM_MEDIA_AUTO_PLAY|PRIM_MEDIA_AUTO_SCALE|PRIM_MEDIA_AUTO_ZOOM|PRIM_MEDIA_CONTROLS|PRIM_MEDIA_CONTROLS_MINI|PRIM_MEDIA_CONTROLS_STANDARD|PRIM_MEDIA_CURRENT_URL|PRIM_MEDIA_FIRST_CLICK_INTERACT|PRIM_MEDIA_HEIGHT_PIXELS|PRIM_MEDIA_HOME_URL|PRIM_MEDIA_MAX_HEIGHT_PIXELS|PRIM_MEDIA_MAX_URL_LENGTH|PRIM_MEDIA_MAX_WHITELIST_COUNT|PRIM_MEDIA_MAX_WHITELIST_SIZE|PRIM_MEDIA_MAX_WIDTH_PIXELS|PRIM_MEDIA_PARAM_MAX|PRIM_MEDIA_PERMS_CONTROL|PRIM_MEDIA_PERMS_INTERACT|PRIM_MEDIA_PERM_ANYONE|PRIM_MEDIA_PERM_GROUP|PRIM_MEDIA_PERM_NONE|PRIM_MEDIA_PERM_OWNER|PRIM_MEDIA_WHITELIST|PRIM_MEDIA_WHITELIST_ENABLE|PRIM_MEDIA_WIDTH_PIXELS|PRIM_NAME|PRIM_NORMAL|PRIM_OMEGA|PRIM_PHANTOM|PRIM_PHYSICS|PRIM_PHYSICS_SHAPE_CONVEX|PRIM_PHYSICS_SHAPE_NONE|PRIM_PHYSICS_SHAPE_PRIM|PRIM_PHYSICS_SHAPE_TYPE|PRIM_POINT_LIGHT|PRIM_POSITION|PRIM_POS_LOCAL|PRIM_ROTATION|PRIM_ROT_LOCAL|PRIM_SCULPT_FLAG_INVERT|PRIM_SCULPT_FLAG_MIRROR|PRIM_SCULPT_TYPE_CYLINDER|PRIM_SCULPT_TYPE_MASK|PRIM_SCULPT_TYPE_PLANE|PRIM_SCULPT_TYPE_SPHERE|PRIM_SCULPT_TYPE_TORUS|PRIM_SHINY_HIGH|PRIM_SHINY_LOW|PRIM_SHINY_MEDIUM|PRIM_SHINY_NONE|PRIM_SIZE|PRIM_SLICE|PRIM_SPECULAR|PRIM_TEMP_ON_REZ|PRIM_TEXGEN|PRIM_TEXGEN_DEFAULT|PRIM_TEXGEN_PLANAR|PRIM_TEXT|PRIM_TEXTURE|PRIM_TYPE|PRIM_TYPE_BOX|PRIM_TYPE_CYLINDER|PRIM_TYPE_PRISM|PRIM_TYPE_RING|PRIM_TYPE_SCULPT|PRIM_TYPE_SPHERE|PRIM_TYPE_TORUS|PRIM_TYPE_TUBE|PROFILE_NONE|PROFILE_SCRIPT_MEMORY|PSYS_PART_BF_DEST_COLOR|PSYS_PART_BF_ONE|PSYS_PART_BF_ONE_MINUS_DEST_COLOR|PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA|PSYS_PART_BF_ONE_MINUS_SOURCE_COLOR|PSYS_PART_BF_SOURCE_ALPHA|PSYS_PART_BF_SOURCE_COLOR|PSYS_PART_BF_ZERO|PSYS_PART_BLEND_FUNC_DEST|PSYS_PART_BLEND_FUNC_SOURCE|PSYS_PART_BOUNCE_MASK|PSYS_PART_EMISSIVE_MASK|PSYS_PART_END_ALPHA|PSYS_PART_END_COLOR|PSYS_PART_END_GLOW|PSYS_PART_END_SCALE|PSYS_PART_FLAGS|PSYS_PART_FOLLOW_SRC_MASK|PSYS_PART_FOLLOW_VELOCITY_MASK|PSYS_PART_INTERP_COLOR_MASK|PSYS_PART_INTERP_SCALE_MASK|PSYS_PART_MAX_AGE|PSYS_PART_RIBBON_MASK|PSYS_PART_START_ALPHA|PSYS_PART_START_COLOR|PSYS_PART_START_GLOW|PSYS_PART_START_SCALE|PSYS_PART_TARGET_LINEAR_MASK|PSYS_PART_TARGET_POS_MASK|PSYS_PART_WIND_MASK|PSYS_SRC_ACCEL|PSYS_SRC_ANGLE_BEGIN|PSYS_SRC_ANGLE_END|PSYS_SRC_BURST_PART_COUNT|PSYS_SRC_BURST_RADIUS|PSYS_SRC_BURST_RATE|PSYS_SRC_BURST_SPEED_MAX|PSYS_SRC_BURST_SPEED_MIN|PSYS_SRC_MAX_AGE|PSYS_SRC_OMEGA|PSYS_SRC_PATTERN|PSYS_SRC_PATTERN_ANGLE|PSYS_SRC_PATTERN_ANGLE_CONE|PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY|PSYS_SRC_PATTERN_DROP|PSYS_SRC_PATTERN_EXPLODE|PSYS_SRC_TARGET_KEY|PSYS_SRC_TEXTURE|PUBLIC_CHANNEL|PURSUIT_FUZZ_FACTOR|PURSUIT_GOAL_TOLERANCE|PURSUIT_INTERCEPT|PURSUIT_OFFSET|PU_EVADE_HIDDEN|PU_EVADE_SPOTTED|PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED|PU_FAILURE_INVALID_GOAL|PU_FAILURE_INVALID_START|PU_FAILURE_NO_NAVMESH|PU_FAILURE_NO_VALID_DESTINATION|PU_FAILURE_OTHER|PU_FAILURE_PARCEL_UNREACHABLE|PU_FAILURE_TARGET_GONE|PU_FAILURE_UNREACHABLE|PU_GOAL_REACHED|PU_SLOWDOWN_DISTANCE_REACHED|RCERR_CAST_TIME_EXCEEDED|RCERR_SIM_PERF_LOW|RCERR_UNKNOWN|RC_DATA_FLAGS|RC_DETECT_PHANTOM|RC_GET_LINK_NUM|RC_GET_NORMAL|RC_GET_ROOT_KEY|RC_MAX_HITS|RC_REJECT_AGENTS|RC_REJECT_LAND|RC_REJECT_NONPHYSICAL|RC_REJECT_PHYSICAL|RC_REJECT_TYPES|REGION_FLAG_ALLOW_DAMAGE|REGION_FLAG_ALLOW_DIRECT_TELEPORT|REGION_FLAG_BLOCK_FLY|REGION_FLAG_BLOCK_TERRAFORM|REGION_FLAG_DISABLE_COLLISIONS|REGION_FLAG_DISABLE_PHYSICS|REGION_FLAG_FIXED_SUN|REGION_FLAG_RESTRICT_PUSHOBJECT|REGION_FLAG_SANDBOX|REMOTE_DATA_CHANNEL|REMOTE_DATA_REPLY|REMOTE_DATA_REQUEST|REQUIRE_LINE_OF_SIGHT|RESTITUTION|REVERSE|ROTATE|SCALE|SCRIPTED|SIM_STAT_PCT_CHARS_STEPPED|SMOOTH|STATUS_BLOCK_GRAB|STATUS_BLOCK_GRAB_OBJECT|STATUS_BOUNDS_ERROR|STATUS_CAST_SHADOWS|STATUS_DIE_AT_EDGE|STATUS_INTERNAL_ERROR|STATUS_MALFORMED_PARAMS|STATUS_NOT_FOUND|STATUS_NOT_SUPPORTED|STATUS_OK|STATUS_PHANTOM|STATUS_PHYSICS|STATUS_RETURN_AT_EDGE|STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z|STATUS_SANDBOX|STATUS_TYPE_MISMATCH|STATUS_WHITELIST_FAILED|STRING_TRIM|STRING_TRIM_HEAD|STRING_TRIM_TAIL|TOUCH_INVALID_FACE|TRAVERSAL_TYPE|TRAVERSAL_TYPE_FAST|TRAVERSAL_TYPE_NONE|TRAVERSAL_TYPE_SLOW|TRUE|TYPE_FLOAT|TYPE_INTEGER|TYPE_INVALID|TYPE_KEY|TYPE_ROTATION|TYPE_STRING|TYPE_VECTOR|VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY|VEHICLE_ANGULAR_DEFLECTION_TIMESCALE|VEHICLE_ANGULAR_FRICTION_TIMESCALE|VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE|VEHICLE_ANGULAR_MOTOR_DIRECTION|VEHICLE_ANGULAR_MOTOR_TIMESCALE|VEHICLE_BANKING_EFFICIENCY|VEHICLE_BANKING_MIX|VEHICLE_BANKING_TIMESCALE|VEHICLE_BUOYANCY|VEHICLE_FLAG_CAMERA_DECOUPLED|VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT|VEHICLE_FLAG_HOVER_TERRAIN_ONLY|VEHICLE_FLAG_HOVER_UP_ONLY|VEHICLE_FLAG_HOVER_WATER_ONLY|VEHICLE_FLAG_LIMIT_MOTOR_UP|VEHICLE_FLAG_LIMIT_ROLL_ONLY|VEHICLE_FLAG_MOUSELOOK_BANK|VEHICLE_FLAG_MOUSELOOK_STEER|VEHICLE_FLAG_NO_DEFLECTION_UP|VEHICLE_HOVER_EFFICIENCY|VEHICLE_HOVER_HEIGHT|VEHICLE_HOVER_TIMESCALE|VEHICLE_LINEAR_DEFLECTION_EFFICIENCY|VEHICLE_LINEAR_DEFLECTION_TIMESCALE|VEHICLE_LINEAR_FRICTION_TIMESCALE|VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE|VEHICLE_LINEAR_MOTOR_DIRECTION|VEHICLE_LINEAR_MOTOR_OFFSET|VEHICLE_LINEAR_MOTOR_TIMESCALE|VEHICLE_REFERENCE_FRAME|VEHICLE_TYPE_AIRPLANE|VEHICLE_TYPE_BALLOON|VEHICLE_TYPE_BOAT|VEHICLE_TYPE_CAR|VEHICLE_TYPE_NONE|VEHICLE_TYPE_SLED|VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY|VEHICLE_VERTICAL_ATTRACTION_TIMESCALE|VERTICAL|WANDER_PAUSE_AT_WAYPOINTS|XP_ERROR_EXPERIENCES_DISABLED|XP_ERROR_EXPERIENCE_DISABLED|XP_ERROR_EXPERIENCE_SUSPENDED|XP_ERROR_INVALID_EXPERIENCE|XP_ERROR_INVALID_PARAMETERS|XP_ERROR_KEY_NOT_FOUND|XP_ERROR_MATURITY_EXCEEDED|XP_ERROR_NONE|XP_ERROR_NOT_FOUND|XP_ERROR_NOT_PERMITTED|XP_ERROR_NO_EXPERIENCE|XP_ERROR_QUOTA_EXCEEDED|XP_ERROR_RETRY_UPDATE|XP_ERROR_STORAGE_EXCEPTION|XP_ERROR_STORE_DISABLED|XP_ERROR_THROTTLED|XP_ERROR_UNKNOWN_ERROR", "constant.language.integer.boolean.lsl" : "FALSE|TRUE", "constant.language.quaternion.lsl" : "ZERO_ROTATION", "constant.language.string.lsl" : "EOF|JSON_ARRAY|JSON_DELETE|JSON_FALSE|JSON_INVALID|JSON_NULL|JSON_NUMBER|JSON_OBJECT|JSON_STRING|JSON_TRUE|NULL_KEY|TEXTURE_BLANK|TEXTURE_DEFAULT|TEXTURE_MEDIA|TEXTURE_PLYWOOD|TEXTURE_TRANSPARENT|URL_REQUEST_DENIED|URL_REQUEST_GRANTED", "constant.language.vector.lsl" : "TOUCH_INVALID_TEXCOORD|TOUCH_INVALID_VECTOR|ZERO_VECTOR", "invalid.broken.lsl": "LAND_LARGE_BRUSH|LAND_MEDIUM_BRUSH|LAND_SMALL_BRUSH", "invalid.deprecated.lsl" : "ATTACH_LPEC|ATTACH_RPEC|DATA_RATING|OBJECT_ATTACHMENT_GEOMETRY_BYTES|OBJECT_ATTACHMENT_SURFACE_AREA|PRIM_CAST_SHADOWS|PRIM_MATERIAL_LIGHT|PRIM_TYPE_LEGACY|PSYS_SRC_INNERANGLE|PSYS_SRC_OUTERANGLE|VEHICLE_FLAG_NO_FLY_UP|llClearExperiencePermissions|llCloud|llGetExperienceList|llMakeExplosion|llMakeFire|llMakeFountain|llMakeSmoke|llRemoteDataSetRegion|llSound|llSoundPreload|llXorBase64Strings|llXorBase64StringsCorrect", "invalid.illegal.lsl": "event", "invalid.unimplemented.lsl": "CHARACTER_MAX_ANGULAR_ACCEL|CHARACTER_MAX_ANGULAR_SPEED|CHARACTER_TURN_SPEED_MULTIPLIER|PERMISSION_CHANGE_JOINTS|PERMISSION_CHANGE_PERMISSIONS|PERMISSION_RELEASE_OWNERSHIP|PERMISSION_REMAP_CONTROLS|PRIM_PHYSICS_MATERIAL|PSYS_SRC_OBJ_REL_MASK|llCollisionSprite|llPointAt|llRefreshPrimURL|llReleaseCamera|llRemoteLoadScript|llSetPrimURL|llStopPointAt|llTakeCamera", "reserved.godmode.lsl": "llGodLikeRezObject|llSetInventoryPermMask|llSetObjectPermMask", "reserved.log.lsl" : "print", "keyword.control.lsl" : "do|else|for|if|jump|return|while", "storage.type.lsl" : "float|integer|key|list|quaternion|rotation|string|vector", "support.function.lsl": "llAbs|llAcos|llAddToLandBanList|llAddToLandPassList|llAdjustSoundVolume|llAgentInExperience|llAllowInventoryDrop|llAngleBetween|llApplyImpulse|llApplyRotationalImpulse|llAsin|llAtan2|llAttachToAvatar|llAttachToAvatarTemp|llAvatarOnLinkSitTarget|llAvatarOnSitTarget|llAxes2Rot|llAxisAngle2Rot|llBase64ToInteger|llBase64ToString|llBreakAllLinks|llBreakLink|llCSV2List|llCastRay|llCeil|llClearCameraParams|llClearLinkMedia|llClearPrimMedia|llCloseRemoteDataChannel|llCollisionFilter|llCollisionSound|llCos|llCreateCharacter|llCreateKeyValue|llCreateLink|llDataSizeKeyValue|llDeleteCharacter|llDeleteKeyValue|llDeleteSubList|llDeleteSubString|llDetachFromAvatar|llDetectedGrab|llDetectedGroup|llDetectedKey|llDetectedLinkNumber|llDetectedName|llDetectedOwner|llDetectedPos|llDetectedRot|llDetectedTouchBinormal|llDetectedTouchFace|llDetectedTouchNormal|llDetectedTouchPos|llDetectedTouchST|llDetectedTouchUV|llDetectedType|llDetectedVel|llDialog|llDie|llDumpList2String|llEdgeOfWorld|llEjectFromLand|llEmail|llEscapeURL|llEuler2Rot|llEvade|llExecCharacterCmd|llFabs|llFleeFrom|llFloor|llForceMouselook|llFrand|llGenerateKey|llGetAccel|llGetAgentInfo|llGetAgentLanguage|llGetAgentList|llGetAgentSize|llGetAlpha|llGetAndResetTime|llGetAnimation|llGetAnimationList|llGetAnimationOverride|llGetAttached|llGetBoundingBox|llGetCameraPos|llGetCameraRot|llGetCenterOfMass|llGetClosestNavPoint|llGetColor|llGetCreator|llGetDate|llGetDisplayName|llGetEnergy|llGetEnv|llGetExperienceDetails|llGetExperienceErrorMessage|llGetForce|llGetFreeMemory|llGetFreeURLs|llGetGMTclock|llGetGeometricCenter|llGetHTTPHeader|llGetInventoryCreator|llGetInventoryKey|llGetInventoryName|llGetInventoryNumber|llGetInventoryPermMask|llGetInventoryType|llGetKey|llGetLandOwnerAt|llGetLinkKey|llGetLinkMedia|llGetLinkName|llGetLinkNumber|llGetLinkNumberOfSides|llGetLinkPrimitiveParams|llGetListEntryType|llGetListLength|llGetLocalPos|llGetLocalRot|llGetMass|llGetMassMKS|llGetMaxScaleFactor|llGetMemoryLimit|llGetMinScaleFactor|llGetNextEmail|llGetNotecardLine|llGetNumberOfNotecardLines|llGetNumberOfPrims|llGetNumberOfSides|llGetObjectDesc|llGetObjectDetails|llGetObjectMass|llGetObjectName|llGetObjectPermMask|llGetObjectPrimCount|llGetOmega|llGetOwner|llGetOwnerKey|llGetParcelDetails|llGetParcelFlags|llGetParcelMaxPrims|llGetParcelMusicURL|llGetParcelPrimCount|llGetParcelPrimOwners|llGetPermissions|llGetPermissionsKey|llGetPhysicsMaterial|llGetPos|llGetPrimMediaParams|llGetPrimitiveParams|llGetRegionAgentCount|llGetRegionCorner|llGetRegionFPS|llGetRegionFlags|llGetRegionName|llGetRegionTimeDilation|llGetRootPosition|llGetRootRotation|llGetRot|llGetSPMaxMemory|llGetScale|llGetScriptName|llGetScriptState|llGetSimStats|llGetSimulatorHostname|llGetStartParameter|llGetStaticPath|llGetStatus|llGetSubString|llGetSunDirection|llGetTexture|llGetTextureOffset|llGetTextureRot|llGetTextureScale|llGetTime|llGetTimeOfDay|llGetTimestamp|llGetTorque|llGetUnixTime|llGetUsedMemory|llGetUsername|llGetVel|llGetWallclock|llGiveInventory|llGiveInventoryList|llGiveMoney|llGround|llGroundContour|llGroundNormal|llGroundRepel|llGroundSlope|llHTTPRequest|llHTTPResponse|llInsertString|llInstantMessage|llIntegerToBase64|llJson2List|llJsonGetValue|llJsonSetValue|llJsonValueType|llKey2Name|llKeyCountKeyValue|llKeysKeyValue|llLinkParticleSystem|llLinkSitTarget|llList2CSV|llList2Float|llList2Integer|llList2Json|llList2Key|llList2List|llList2ListStrided|llList2Rot|llList2String|llList2Vector|llListFindList|llListInsertList|llListRandomize|llListReplaceList|llListSort|llListStatistics|llListen|llListenControl|llListenRemove|llLoadURL|llLog|llLog10|llLookAt|llLoopSound|llLoopSoundMaster|llLoopSoundSlave|llMD5String|llManageEstateAccess|llMapDestination|llMessageLinked|llMinEventDelay|llModPow|llModifyLand|llMoveToTarget|llNavigateTo|llOffsetTexture|llOpenRemoteDataChannel|llOverMyLand|llOwnerSay|llParcelMediaCommandList|llParcelMediaQuery|llParseString2List|llParseStringKeepNulls|llParticleSystem|llPassCollisions|llPassTouches|llPatrolPoints|llPlaySound|llPlaySoundSlave|llPow|llPreloadSound|llPursue|llPushObject|llReadKeyValue|llRegionSay|llRegionSayTo|llReleaseControls|llReleaseURL|llRemoteDataReply|llRemoteLoadScriptPin|llRemoveFromLandBanList|llRemoveFromLandPassList|llRemoveInventory|llRemoveVehicleFlags|llRequestAgentData|llRequestDisplayName|llRequestExperiencePermissions|llRequestInventoryData|llRequestPermissions|llRequestSecureURL|llRequestSimulatorData|llRequestURL|llRequestUsername|llResetAnimationOverride|llResetLandBanList|llResetLandPassList|llResetOtherScript|llResetScript|llResetTime|llReturnObjectsByID|llReturnObjectsByOwner|llRezAtRoot|llRezObject|llRot2Angle|llRot2Axis|llRot2Euler|llRot2Fwd|llRot2Left|llRot2Up|llRotBetween|llRotLookAt|llRotTarget|llRotTargetRemove|llRotateTexture|llRound|llSHA1String|llSameGroup|llSay|llScaleByFactor|llScaleTexture|llScriptDanger|llScriptProfiler|llSendRemoteData|llSensor|llSensorRemove|llSensorRepeat|llSetAlpha|llSetAngularVelocity|llSetAnimationOverride|llSetBuoyancy|llSetCameraAtOffset|llSetCameraEyeOffset|llSetCameraParams|llSetClickAction|llSetColor|llSetContentType|llSetDamage|llSetForce|llSetForceAndTorque|llSetHoverHeight|llSetKeyframedMotion|llSetLinkAlpha|llSetLinkCamera|llSetLinkColor|llSetLinkMedia|llSetLinkPrimitiveParams|llSetLinkPrimitiveParamsFast|llSetLinkTexture|llSetLinkTextureAnim|llSetLocalRot|llSetMemoryLimit|llSetObjectDesc|llSetObjectName|llSetParcelMusicURL|llSetPayPrice|llSetPhysicsMaterial|llSetPos|llSetPrimMediaParams|llSetPrimitiveParams|llSetRegionPos|llSetRemoteScriptAccessPin|llSetRot|llSetScale|llSetScriptState|llSetSitText|llSetSoundQueueing|llSetSoundRadius|llSetStatus|llSetText|llSetTexture|llSetTextureAnim|llSetTimerEvent|llSetTorque|llSetTouchText|llSetVehicleFlags|llSetVehicleFloatParam|llSetVehicleRotationParam|llSetVehicleType|llSetVehicleVectorParam|llSetVelocity|llShout|llSin|llSitTarget|llSleep|llSqrt|llStartAnimation|llStopAnimation|llStopHover|llStopLookAt|llStopMoveToTarget|llStopSound|llStringLength|llStringToBase64|llStringTrim|llSubStringIndex|llTakeControls|llTan|llTarget|llTargetOmega|llTargetRemove|llTeleportAgent|llTeleportAgentGlobalCoords|llTeleportAgentHome|llTextBox|llToLower|llToUpper|llTransferLindenDollars|llTriggerSound|llTriggerSoundLimited|llUnSit|llUnescapeURL|llUpdateCharacter|llUpdateKeyValue|llVecDist|llVecMag|llVecNorm|llVolumeDetect|llWanderWithin|llWater|llWhisper|llWind|llXorBase64", "support.function.event.lsl" : "at_rot_target|at_target|attach|changed|collision|collision_end|collision_start|control|dataserver|email|experience_permissions|experience_permissions_denied|http_request|http_response|land_collision|land_collision_end|land_collision_start|link_message|listen|money|moving_end|moving_start|no_sensor|not_at_rot_target|not_at_target|object_rez|on_rez|path_update|remote_data|run_time_permissions|sensor|state_entry|state_exit|timer|touch|touch_end|touch_start|transaction_result" }, "identifier"); this.$rules = { "start" : [ { token : "comment.line.double-slash.lsl", regex : "\\/\\/.*$" }, { token : "comment.block.begin.lsl", regex : "\\/\\*", next : "comment" }, { token : "string.quoted.double.lsl", start : '"', end : '"', next : [{ token : "constant.character.escape.lsl", regex : /\\[tn"\\]/ }] }, { token : "constant.numeric.lsl", regex : "(0[xX][0-9a-fA-F]+|[+-]?[0-9]+(?:(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?)?)\\b" }, { token : "entity.name.state.lsl", regex : "\\b((state)\\s+[A-Za-z_]\\w*|default)\\b" }, { token : keywordMapper, regex : "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b" }, { token : "support.function.user-defined.lsl", regex : /\b([a-zA-Z_]\w*)(?=\(.*?\))/ }, { token : "keyword.operator.lsl", regex : "\\+\\+|\\-\\-|<<|>>|&&?|\\|\\|?|\\^|~|[!%<>=*+\\-\\/]=?" }, { token : "invalid.illegal.keyword.operator.lsl", regex : ":=?" }, { token : "punctuation.operator.lsl", regex : "\\,|\\;" }, { token : "paren.lparen.lsl", regex : "[\\[\\(\\{]" }, { token : "paren.rparen.lsl", regex : "[\\]\\)\\}]" }, { token : "text.lsl", regex : "\\s+" } ], "comment" : [ { token : "comment.block.end.lsl", regex : "\\*\\/", next : "start" }, { token : "comment.block.lsl", regex : ".+" } ] }; this.normalizeRules(); } exports.LSLHighlightRules = LSLHighlightRules; }); define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { "use strict"; var Range = require("../range").Range; var MatchingBraceOutdent = function() {}; (function() { this.checkOutdent = function(line, input) { if (! /^\s+$/.test(line)) return false; return /^\s*\}/.test(input); }; this.autoOutdent = function(doc, row) { var line = doc.getLine(row); var match = line.match(/^(\s*\})/); if (!match) return 0; var column = match[1].length; var openBracePos = doc.findMatchingBracket({row: row, column: column}); if (!openBracePos || openBracePos.row == row) return 0; var indent = this.$getIndent(doc.getLine(openBracePos.row)); doc.replace(new Range(row, 0, row, column-1), indent); }; this.$getIndent = function(line) { return line.match(/^\s*/)[0]; }; }).call(MatchingBraceOutdent.prototype); exports.MatchingBraceOutdent = MatchingBraceOutdent; }); define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { "use strict"; var oop = require("../../lib/oop"); var Behaviour = require("../behaviour").Behaviour; var TokenIterator = require("../../token_iterator").TokenIterator; var lang = require("../../lib/lang"); var SAFE_INSERT_IN_TOKENS = ["text", "paren.rparen", "punctuation.operator"]; var SAFE_INSERT_BEFORE_TOKENS = ["text", "paren.rparen", "punctuation.operator", "comment"]; var context; var contextCache = {}; var initContext = function(editor) { var id = -1; if (editor.multiSelect) { id = editor.selection.index; if (contextCache.rangeCount != editor.multiSelect.rangeCount) contextCache = {rangeCount: editor.multiSelect.rangeCount}; } if (contextCache[id]) return context = contextCache[id]; context = contextCache[id] = { autoInsertedBrackets: 0, autoInsertedRow: -1, autoInsertedLineEnd: "", maybeInsertedBrackets: 0, maybeInsertedRow: -1, maybeInsertedLineStart: "", maybeInsertedLineEnd: "" }; }; var getWrapped = function(selection, selected, opening, closing) { var rowDiff = selection.end.row - selection.start.row; return { text: opening + selected + closing, selection: [ 0, selection.start.column + 1, rowDiff, selection.end.column + (rowDiff ? 0 : 1) ] }; }; var CstyleBehaviour = function() { this.add("braces", "insertion", function(state, action, editor, session, text) { var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); if (text == '{') { initContext(editor); var selection = editor.getSelectionRange(); var selected = session.doc.getTextRange(selection); if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { return getWrapped(selection, selected, '{', '}'); } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { CstyleBehaviour.recordAutoInsert(editor, session, "}"); return { text: '{}', selection: [1, 1] }; } else { CstyleBehaviour.recordMaybeInsert(editor, session, "{"); return { text: '{', selection: [1, 1] }; } } } else if (text == '}') { initContext(editor); var rightChar = line.substring(cursor.column, cursor.column + 1); if (rightChar == '}') { var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { CstyleBehaviour.popAutoInsertedClosing(); return { text: '', selection: [1, 1] }; } } } else if (text == "\n" || text == "\r\n") { initContext(editor); var closing = ""; if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { closing = lang.stringRepeat("}", context.maybeInsertedBrackets); CstyleBehaviour.clearMaybeInsertedClosing(); } var rightChar = line.substring(cursor.column, cursor.column + 1); if (rightChar === '}') { var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); if (!openBracePos) return null; var next_indent = this.$getIndent(session.getLine(openBracePos.row)); } else if (closing) { var next_indent = this.$getIndent(line); } else { CstyleBehaviour.clearMaybeInsertedClosing(); return; } var indent = next_indent + session.getTabString(); return { text: '\n' + indent + '\n' + next_indent + closing, selection: [1, indent.length, 1, indent.length] }; } else { CstyleBehaviour.clearMaybeInsertedClosing(); } }); this.add("braces", "deletion", function(state, action, editor, session, range) { var selected = session.doc.getTextRange(range); if (!range.isMultiLine() && selected == '{') { initContext(editor); var line = session.doc.getLine(range.start.row); var rightChar = line.substring(range.end.column, range.end.column + 1); if (rightChar == '}') { range.end.column++; return range; } else { context.maybeInsertedBrackets--; } } }); this.add("parens", "insertion", function(state, action, editor, session, text) { if (text == '(') { initContext(editor); var selection = editor.getSelectionRange(); var selected = session.doc.getTextRange(selection); if (selected !== "" && editor.getWrapBehavioursEnabled()) { return getWrapped(selection, selected, '(', ')'); } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { CstyleBehaviour.recordAutoInsert(editor, session, ")"); return { text: '()', selection: [1, 1] }; } } else if (text == ')') { initContext(editor); var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); var rightChar = line.substring(cursor.column, cursor.column + 1); if (rightChar == ')') { var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { CstyleBehaviour.popAutoInsertedClosing(); return { text: '', selection: [1, 1] }; } } } }); this.add("parens", "deletion", function(state, action, editor, session, range) { var selected = session.doc.getTextRange(range); if (!range.isMultiLine() && selected == '(') { initContext(editor); var line = session.doc.getLine(range.start.row); var rightChar = line.substring(range.start.column + 1, range.start.column + 2); if (rightChar == ')') { range.end.column++; return range; } } }); this.add("brackets", "insertion", function(state, action, editor, session, text) { if (text == '[') { initContext(editor); var selection = editor.getSelectionRange(); var selected = session.doc.getTextRange(selection); if (selected !== "" && editor.getWrapBehavioursEnabled()) { return getWrapped(selection, selected, '[', ']'); } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { CstyleBehaviour.recordAutoInsert(editor, session, "]"); return { text: '[]', selection: [1, 1] }; } } else if (text == ']') { initContext(editor); var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); var rightChar = line.substring(cursor.column, cursor.column + 1); if (rightChar == ']') { var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { CstyleBehaviour.popAutoInsertedClosing(); return { text: '', selection: [1, 1] }; } } } }); this.add("brackets", "deletion", function(state, action, editor, session, range) { var selected = session.doc.getTextRange(range); if (!range.isMultiLine() && selected == '[') { initContext(editor); var line = session.doc.getLine(range.start.row); var rightChar = line.substring(range.start.column + 1, range.start.column + 2); if (rightChar == ']') { range.end.column++; return range; } } }); this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { if (text == '"' || text == "'") { initContext(editor); var quote = text; var selection = editor.getSelectionRange(); var selected = session.doc.getTextRange(selection); if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { return getWrapped(selection, selected, quote, quote); } else if (!selected) { var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); var leftChar = line.substring(cursor.column-1, cursor.column); var rightChar = line.substring(cursor.column, cursor.column + 1); var token = session.getTokenAt(cursor.row, cursor.column); var rightToken = session.getTokenAt(cursor.row, cursor.column + 1); if (leftChar == "\\" && token && /escape/.test(token.type)) return null; var stringBefore = token && /string/.test(token.type); var stringAfter = !rightToken || /string/.test(rightToken.type); var pair; if (rightChar == quote) { pair = stringBefore !== stringAfter; } else { if (stringBefore && !stringAfter) return null; // wrap string with different quote if (stringBefore && stringAfter) return null; // do not pair quotes inside strings var wordRe = session.$mode.tokenRe; wordRe.lastIndex = 0; var isWordBefore = wordRe.test(leftChar); wordRe.lastIndex = 0; var isWordAfter = wordRe.test(leftChar); if (isWordBefore || isWordAfter) return null; // before or after alphanumeric if (rightChar && !/[\s;,.})\]\\]/.test(rightChar)) return null; // there is rightChar and it isn't closing pair = true; } return { text: pair ? quote + quote : "", selection: [1,1] }; } } }); this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { var selected = session.doc.getTextRange(range); if (!range.isMultiLine() && (selected == '"' || selected == "'")) { initContext(editor); var line = session.doc.getLine(range.start.row); var rightChar = line.substring(range.start.column + 1, range.start.column + 2); if (rightChar == selected) { range.end.column++; return range; } } }); }; CstyleBehaviour.isSaneInsertion = function(editor, session) { var cursor = editor.getCursorPosition(); var iterator = new TokenIterator(session, cursor.row, cursor.column); if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) return false; } iterator.stepForward(); return iterator.getCurrentTokenRow() !== cursor.row || this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); }; CstyleBehaviour.$matchTokenType = function(token, types) { return types.indexOf(token.type || token) > -1; }; CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) context.autoInsertedBrackets = 0; context.autoInsertedRow = cursor.row; context.autoInsertedLineEnd = bracket + line.substr(cursor.column); context.autoInsertedBrackets++; }; CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); if (!this.isMaybeInsertedClosing(cursor, line)) context.maybeInsertedBrackets = 0; context.maybeInsertedRow = cursor.row; context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; context.maybeInsertedLineEnd = line.substr(cursor.column); context.maybeInsertedBrackets++; }; CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { return context.autoInsertedBrackets > 0 && cursor.row === context.autoInsertedRow && bracket === context.autoInsertedLineEnd[0] && line.substr(cursor.column) === context.autoInsertedLineEnd; }; CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { return context.maybeInsertedBrackets > 0 && cursor.row === context.maybeInsertedRow && line.substr(cursor.column) === context.maybeInsertedLineEnd && line.substr(0, cursor.column) == context.maybeInsertedLineStart; }; CstyleBehaviour.popAutoInsertedClosing = function() { context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); context.autoInsertedBrackets--; }; CstyleBehaviour.clearMaybeInsertedClosing = function() { if (context) { context.maybeInsertedBrackets = 0; context.maybeInsertedRow = -1; } }; oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; }); define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { "use strict"; var oop = require("../../lib/oop"); var Range = require("../../range").Range; var BaseFoldMode = require("./fold_mode").FoldMode; var FoldMode = exports.FoldMode = function(commentRegex) { if (commentRegex) { this.foldingStartMarker = new RegExp( this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) ); this.foldingStopMarker = new RegExp( this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) ); } }; oop.inherits(FoldMode, BaseFoldMode); (function() { this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/; this._getFoldWidgetBase = this.getFoldWidget; this.getFoldWidget = function(session, foldStyle, row) { var line = session.getLine(row); if (this.singleLineBlockCommentRe.test(line)) { if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) return ""; } var fw = this._getFoldWidgetBase(session, foldStyle, row); if (!fw && this.startRegionRe.test(line)) return "start"; // lineCommentRegionStart return fw; }; this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { var line = session.getLine(row); if (this.startRegionRe.test(line)) return this.getCommentRegionBlock(session, line, row); var match = line.match(this.foldingStartMarker); if (match) { var i = match.index; if (match[1]) return this.openingBracketBlock(session, match[1], row, i); var range = session.getCommentFoldRange(row, i + match[0].length, 1); if (range && !range.isMultiLine()) { if (forceMultiline) { range = this.getSectionRange(session, row); } else if (foldStyle != "all") range = null; } return range; } if (foldStyle === "markbegin") return; var match = line.match(this.foldingStopMarker); if (match) { var i = match.index + match[0].length; if (match[1]) return this.closingBracketBlock(session, match[1], row, i); return session.getCommentFoldRange(row, i, -1); } }; this.getSectionRange = function(session, row) { var line = session.getLine(row); var startIndent = line.search(/\S/); var startRow = row; var startColumn = line.length; row = row + 1; var endRow = row; var maxRow = session.getLength(); while (++row < maxRow) { line = session.getLine(row); var indent = line.search(/\S/); if (indent === -1) continue; if (startIndent > indent) break; var subRange = this.getFoldWidgetRange(session, "all", row); if (subRange) { if (subRange.start.row <= startRow) { break; } else if (subRange.isMultiLine()) { row = subRange.end.row; } else if (startIndent == indent) { break; } } endRow = row; } return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); }; this.getCommentRegionBlock = function(session, line, row) { var startColumn = line.search(/\s*$/); var maxRow = session.getLength(); var startRow = row; var re = /^\s*(?:\/\*|\/\/)#(end)?region\b/; var depth = 1; while (++row < maxRow) { line = session.getLine(row); var m = re.exec(line); if (!m) continue; if (m[1]) depth--; else depth++; if (!depth) break; } var endRow = row; if (endRow > startRow) { return new Range(startRow, startColumn, endRow, line.length); } }; }).call(FoldMode.prototype); }); define("ace/mode/lsl",["require","exports","module","ace/mode/lsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/text","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/lib/oop"], function(require, exports, module) { "use strict"; var Rules = require("./lsl_highlight_rules").LSLHighlightRules; var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent; var Range = require("../range").Range; var TextMode = require("./text").Mode; var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var oop = require("../lib/oop"); var Mode = function() { this.HighlightRules = Rules; this.$outdent = new Outdent(); this.$behaviour = new CstyleBehaviour(); this.foldingRules = new CStyleFoldMode(); }; oop.inherits(Mode, TextMode); (function() { this.lineCommentStart = ["//"]; this.blockComment = { start: "/*", end: "*/" }; this.getNextLineIndent = function(state, line, tab) { var indent = this.$getIndent(line); var tokenizedLine = this.getTokenizer().getLineTokens(line, state); var tokens = tokenizedLine.tokens; var endState = tokenizedLine.state; if (tokens.length && tokens[tokens.length-1].type === "comment.block.lsl") { return indent; } if (state === "start") { var match = line.match(/^.*[\{\(\[]\s*$/); if (match) { indent += tab; } } return indent; }; this.checkOutdent = function(state, line, input) { return this.$outdent.checkOutdent(line, input); }; this.autoOutdent = function(state, doc, row) { this.$outdent.autoOutdent(doc, row); }; this.$id = "ace/mode/lsl"; }).call(Mode.prototype); exports.Mode = Mode; });
{ "pile_set_name": "Github" }
# Load the rails application. require File.expand_path('../application', __FILE__) # Initialize the rails application. Dashboard::Application.initialize!
{ "pile_set_name": "Github" }
import UpdateUserInfoMutation from '../mutations/UpdateUserInfoMutation' relay('MyPictures', { viewer: () => Relay.QL` fragment on ReindexViewer { user { id ${Motion.getView('PaginatedGallery').getFragment('user')} ${Motion.getView('Profile').getFragment('user')} ${UpdateUserInfoMutation.getFragment('user')} } } `, }) view MyPictures { prop viewer on.mount(() => { if (!viewer.user.username || !viewer.user.avatarUrl) { Relay.Store.commitUpdate(new UpdateUserInfoMutation({ user: viewer.user, })) } }) <Profile user={viewer.user} /> <PaginatedGallery user={viewer.user} /> $ = { display: 'flex', flexGrow: 1, flexDirection: 'column', margin: [0, 'auto'], maxWidth: '650px', } $Profile = { flex: '0 0 auto', marginBottom: '5px', } $PaginatedGallery = { display: 'flex', flex: '1 1 0px', } }
{ "pile_set_name": "Github" }
[Unit] Description=Chrony Network Time Daemon After=syslog.target network.target Conflicts=systemd-timesyncd.service [Service] ExecStart=/usr/sbin/chronyd -n Restart=always [Install] WantedBy=multi-user.target
{ "pile_set_name": "Github" }
/* * Copyright 2006-2015 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 com.consol.citrus.container; import java.util.TimerTask; import java.util.concurrent.atomic.AtomicInteger; import com.consol.citrus.AbstractTestContainerBuilder; import com.consol.citrus.TestAction; import com.consol.citrus.TestActionBuilder; import com.consol.citrus.context.TestContext; import com.consol.citrus.exceptions.CitrusRuntimeException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.task.SimpleAsyncTaskExecutor; import org.springframework.util.StringUtils; /** * @author Martin Maher * @since 2.5 */ public class Timer extends AbstractActionContainer implements StopTimer { /** Logger */ private static Logger log = LoggerFactory.getLogger(Timer.class); private final static AtomicInteger nextSerialNumber = new AtomicInteger(0); protected static final String INDEX_SUFFIX = "-index"; private final long interval; private final long delay; private final int repeatCount; private final boolean fork; private final String timerId; protected boolean timerComplete = false; protected CitrusRuntimeException timerException = null; private java.util.Timer timer; public Timer(Builder builder) { super("timer", builder); this.interval = builder.interval; this.delay = builder.delay; this.repeatCount = builder.repeatCount; this.fork = builder.fork; this.timerId = builder.timerId; } @Override public void doExecute(final TestContext context) { if (fork) { SimpleAsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor(); taskExecutor.execute(new Runnable() { public void run() { configureAndRunTimer(context); } }); } else { configureAndRunTimer(context); } } private void configureAndRunTimer(final TestContext context) { timer = new java.util.Timer(getTimerId(), false); context.registerTimer(getTimerId(), this); TimerTask timerTask = new TimerTask() { int indexCount = 0; @Override public void run() { try { indexCount++; updateIndexCountInTestContext(context); log.debug(String.format("Timer event fired #%s - executing nested actions", indexCount)); for (TestActionBuilder<?> actionBuilder : actions) { TestAction action = actionBuilder.build(); setActiveAction(action); action.execute(context); } if (indexCount >= repeatCount) { log.debug(String.format("Timer complete: %s iterations reached", repeatCount)); stopTimer(); } } catch (Exception e) { handleException(e); } } private void updateIndexCountInTestContext(TestContext context) { context.setVariable(getTimerId() + INDEX_SUFFIX, String.valueOf(indexCount)); } private void handleException(Exception e) { if (e instanceof CitrusRuntimeException) { timerException = (CitrusRuntimeException) e; } else { timerException = new CitrusRuntimeException(e); } log.error(String.format("Timer stopped as a result of nested action error (%s)", e.getMessage())); stopTimer(); if (fork) { context.addException(timerException); } } }; timer.scheduleAtFixedRate(timerTask, delay, interval); while (!timerComplete) { try { Thread.sleep(interval); } catch (InterruptedException e) { log.warn("Interrupted while waiting for timer to complete", e); } } if (timerException != null) { throw timerException; } } public String getTimerId() { return timerId; } @Override public void stopTimer() { timer.cancel(); timerComplete = true; } private static int serialNumber() { return nextSerialNumber.getAndIncrement(); } public long getInterval() { return interval; } public long getDelay() { return delay; } public int getRepeatCount() { return repeatCount; } public boolean isFork() { return fork; } /** * Action builder. */ public static class Builder extends AbstractTestContainerBuilder<Timer, Builder> { private long interval = 1000L; private long delay = 0L; private int repeatCount = Integer.MAX_VALUE; private boolean fork = false; private String timerId; /** * Fluent API action building entry method used in Java DSL. * @return */ public static Builder timer() { return new Builder(); } /** * Initial delay in milliseconds before first timer event should fire. * * @param delay */ public Builder delay(long delay) { this.delay = delay; return this; } /** * Interval in milliseconds between each timer. As soon as the interval has elapsed the next timer event is fired. * * @param interval */ public Builder interval(long interval) { this.interval = interval; return this; } /** * The maximum number of times the timer event is fired. Once this maximum number has been reached the timer is * stopped * * @param repeatCount */ public Builder repeatCount(int repeatCount) { this.repeatCount = repeatCount; return this; } /** * Fork the timer so that other actions can run in parallel to the nested timer actions * * @param fork */ public Builder fork(boolean fork) { this.fork = fork; return this; } /** * Set the timer's id. This is useful when referencing the timer from other test actions like stop-timer * * @param timerId a unique timer id within the test context */ public Builder timerId(String timerId) { this.timerId = timerId; return this; } @Override public Timer build() { if (StringUtils.isEmpty(timerId)) { timerId = "citrus-timer-" + serialNumber(); } return super.build(new Timer(this)); } } }
{ "pile_set_name": "Github" }
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np # type: ignore import itertools import onnx from ..base import Base from . import expect class Transpose(Base): @staticmethod def export_default(): # type: () -> None shape = (2, 3, 4) data = np.random.random_sample(shape).astype(np.float32) node = onnx.helper.make_node( 'Transpose', inputs=['data'], outputs=['transposed'] ) transposed = np.transpose(data) expect(node, inputs=[data], outputs=[transposed], name='test_transpose_default') @staticmethod def export_all_permutations(): # type: () -> None shape = (2, 3, 4) data = np.random.random_sample(shape).astype(np.float32) permutations = list(itertools.permutations(np.arange(len(shape)))) for i in range(len(permutations)): node = onnx.helper.make_node( 'Transpose', inputs=['data'], outputs=['transposed'], perm=permutations[i] ) transposed = np.transpose(data, permutations[i]) expect(node, inputs=[data], outputs=[transposed], name='test_transpose_all_permutations_' + str(i))
{ "pile_set_name": "Github" }
//----------------------------------------------------------------------------- // boost aligned_storage.hpp header file // See http://www.boost.org for updates, documentation, and revision history. //----------------------------------------------------------------------------- // // Copyright (c) 2002-2003 // Eric Friedman, Itay Maman // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_ALIGNED_STORAGE_HPP #define BOOST_ALIGNED_STORAGE_HPP #include <boost/type_traits/aligned_storage.hpp> #endif // BOOST_ALIGNED_STORAGE_HPP
{ "pile_set_name": "Github" }
set(TESTUNIT "${LIBNAME}-testrunner") # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G}) # Headers file(GLOB_RECURSE HDRS_G "src/*.h" ) POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G}) POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32 src/WinDriver.cpp ) add_executable( ${TESTUNIT} ${TEST_SRCS} ) add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) target_link_libraries( ${TESTUNIT} PocoPDF PocoFoundation CppUnit ) if( WIN32) add_definitions("-D_AFXDLL") target_link_libraries( ${TESTUNIT} WinTestRunner) endif(WIN32)
{ "pile_set_name": "Github" }
# frozen_string_literal: true module OmniAuth module GoogleOauth2 VERSION = '0.8.0' end end
{ "pile_set_name": "Github" }
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Selectable - Default functionality</title> <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css"> <script src="../../jquery-1.8.3.js"></script> <script src="../../ui/jquery.ui.core.js"></script> <script src="../../ui/jquery.ui.widget.js"></script> <script src="../../ui/jquery.ui.mouse.js"></script> <script src="../../ui/jquery.ui.selectable.js"></script> <link rel="stylesheet" href="../demos.css"> <style> #feedback { font-size: 1.4em; } #selectable .ui-selecting { background: #FECA40; } #selectable .ui-selected { background: #F39814; color: white; } #selectable { list-style-type: none; margin: 0; padding: 0; width: 60%; } #selectable li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; } </style> <script> $(function() { $( "#selectable" ).selectable(); }); </script> </head> <body> <ol id="selectable"> <li class="ui-widget-content">Item 1</li> <li class="ui-widget-content">Item 2</li> <li class="ui-widget-content">Item 3</li> <li class="ui-widget-content">Item 4</li> <li class="ui-widget-content">Item 5</li> <li class="ui-widget-content">Item 6</li> <li class="ui-widget-content">Item 7</li> </ol> <div class="demo-description"> <p>Enable a DOM element (or group of elements) to be selectable. Draw a box with your cursor to select items. Hold down the Ctrl key to make multiple non-adjacent selections. </p> </div> </body> </html>
{ "pile_set_name": "Github" }
<?php /** * This file is part of PHPWord - A pure PHP library for reading and writing * word processing documents. * * PHPWord is free software distributed under the terms of the GNU Lesser * General Public License version 3 as published by the Free Software Foundation. * * For the full copyright and license information, please read the LICENSE * file that was distributed with this source code. For the full list of * contributors, visit https://github.com/PHPOffice/PHPWord/contributors. * * @see https://github.com/PHPOffice/PHPWord * @copyright 2010-2018 PHPWord contributors * @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3 */ namespace PhpOffice\PhpWord\Style; /** * Test class for PhpOffice\PhpWord\Style\AbstractStyle * * @runTestsInSeparateProcesses */ class AbstractStyleTest extends \PHPUnit\Framework\TestCase { /** * Test set style by array */ public function testSetStyleByArray() { $stub = $this->getMockForAbstractClass('\PhpOffice\PhpWord\Style\AbstractStyle'); $stub->setStyleByArray(array('index' => 1)); $this->assertEquals(1, $stub->getIndex()); } /** * Test setBoolVal, setIntVal, setFloatVal, setEnumVal with normal value */ public function testSetValNormal() { $stub = $this->getMockForAbstractClass('\PhpOffice\PhpWord\Style\AbstractStyle'); $this->assertTrue(self::callProtectedMethod($stub, 'setBoolVal', array(true, false))); $this->assertEquals(12, self::callProtectedMethod($stub, 'setIntVal', array(12, 200))); $this->assertEquals(871.1, self::callProtectedMethod($stub, 'setFloatVal', array(871.1, 2.1))); $this->assertEquals(871.1, self::callProtectedMethod($stub, 'setFloatVal', array('871.1', 2.1))); $this->assertEquals('a', self::callProtectedMethod($stub, 'setEnumVal', array('a', array('a', 'b'), 'b'))); } /** * Test setBoolVal, setIntVal, setFloatVal, setEnumVal with default value */ public function testSetValDefault() { $stub = $this->getMockForAbstractClass('\PhpOffice\PhpWord\Style\AbstractStyle'); $this->assertNotTrue(self::callProtectedMethod($stub, 'setBoolVal', array('a', false))); $this->assertEquals(200, self::callProtectedMethod($stub, 'setIntVal', array('foo', 200))); $this->assertEquals(2.1, self::callProtectedMethod($stub, 'setFloatVal', array('foo', 2.1))); $this->assertEquals('b', self::callProtectedMethod($stub, 'setEnumVal', array(null, array('a', 'b'), 'b'))); } /** * Test setEnumVal exception * * @expectedException \InvalidArgumentException */ public function testSetValEnumException() { $stub = $this->getMockForAbstractClass('\PhpOffice\PhpWord\Style\AbstractStyle'); $this->assertEquals('b', self::callProtectedMethod($stub, 'setEnumVal', array('z', array('a', 'b'), 'b'))); } /** * Helper function to call protected method * * @param mixed $object * @param string $method * @param array $args */ public static function callProtectedMethod($object, $method, array $args = array()) { $class = new \ReflectionClass(get_class($object)); $method = $class->getMethod($method); $method->setAccessible(true); return $method->invokeArgs($object, $args); } }
{ "pile_set_name": "Github" }
<!DOCTYPE HTML> <html> <!-- https://bugzilla.mozilla.org/show_bug.cgi?id=980243 --> <head> <meta charset="utf-8"> <title>Test for Bug 980243</title> <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> <script type="application/javascript"> /** Test for Bug 980243 **/ SimpleTest.waitForExplicitFinish(); addLoadEvent(function() { var img = document.querySelector("img"); img.onload = function() { ok(true, "Reached here"); SimpleTest.finish(); } // If ths spec ever changes to treat .src sets differently from // setAttribute("src"), we'll need some sort of canonicalization step // earlier to make the attr value an absolute URI. img.setAttribute("src", img.getAttribute("src")); }); </script> </head> <body> <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=980243">Mozilla Bug 980243</a> <p id="display"></p> <div id="content" style="display: none"> <img src="file_formSubmission_img.jpg"> </div> <pre id="test"> </pre> </body> </html>
{ "pile_set_name": "Github" }
/** * slider插件可悬停控制 */ ; $(function ($, window, document, undefined) { Slider = function (container, options) { /* options = { auto: true, time: 3000, event: 'hover' | 'click', mode: 'slide | fade', controller: $(), activeControllerCls: 'className', exchangeEnd: $.noop } */ "use strict"; //stirct mode not support by IE9- if (!container) return; var options = options || {}, currentIndex = 0, cls = options.activeControllerCls, delay = options.delay, isAuto = options.auto, controller = options.controller, event = options.event, interval, slidesWrapper = container.children().first(), slides = slidesWrapper.children(), length = slides.length, childWidth = container.width(), totalWidth = childWidth * slides.length; function init() { var controlItem = controller.children(); mode(); event == 'hover' ? controlItem.mouseover(function () { stop(); var index = $(this).index(); play(index, options.mode); }).mouseout(function () { isAuto && autoPlay(); }) : controlItem.click(function () { stop(); var index = $(this).index(); play(index, options.mode); isAuto && autoPlay(); }); isAuto && autoPlay(); } //animate mode function mode() { var wrapper = container.children().first(); options.mode == 'slide' ? wrapper.width(totalWidth) : wrapper.children().css({ 'position': 'absolute', 'left': 0, 'top': 0 }) .first().siblings().hide(); } //auto play function autoPlay() { interval = setInterval(function () { triggerPlay(currentIndex); }, options.time); } //trigger play function triggerPlay(cIndex) { var index; (cIndex == length - 1) ? index = 0 : index = cIndex + 1; play(index, options.mode); } //play function play(index, mode) { slidesWrapper.stop(true, true); slides.stop(true, true); mode == 'slide' ? (function () { if (index > currentIndex) { slidesWrapper.animate({ left: '-=' + Math.abs(index - currentIndex) * childWidth + 'px' }, delay); } else if (index < currentIndex) { slidesWrapper.animate({ left: '+=' + Math.abs(index - currentIndex) * childWidth + 'px' }, delay); } else { return; } })() : (function () { if (slidesWrapper.children(':visible').index() == index) return; slidesWrapper.children().fadeOut(delay).eq(index).fadeIn(delay); })(); try { controller.children('.' + cls).removeClass(cls); controller.children().eq(index).addClass(cls); } catch (e) { } currentIndex = index; options.exchangeEnd && typeof options.exchangeEnd == 'function' && options.exchangeEnd.call(this, currentIndex); } //stop function stop() { clearInterval(interval); } //prev frame function prev() { stop(); currentIndex == 0 ? triggerPlay(length - 2) : triggerPlay(currentIndex - 2); isAuto && autoPlay(); } //next frame function next() { stop(); currentIndex == length - 1 ? triggerPlay(-1) : triggerPlay(currentIndex); isAuto && autoPlay(); } //init init(); //expose the Slider API return { prev: function () { prev(); }, next: function () { next(); } } }; }(jQuery, window, document));
{ "pile_set_name": "Github" }
# -*- text -*- # Parsing Expression Grammar 'TEMPLATE'. # Generated for unknown, from file 'TEST' # # Grammar Start Expression # <<MAIN>>: call kleene_3 halt kleene_3: # * # 'a' loc_push error_push call char_1 error_pop_merge fail! jump failed_4 loc_pop_discard jump kleene_3 failed_4: loc_pop_rewind status_ok return char_1: # 'a' input_next "t a" ok! test_char "a" return # #
{ "pile_set_name": "Github" }
@import "../../mobile/common/icons.less"; @import "../../mobile/common/tabstrip.less"; @import "base.less"; // TabStrip .km-tabstrip { padding: 0; display: table; table-layout: fixed; } .km-tabstrip .km-button { font-size: .7em; display: table-cell; border: 0; } .km-tabstrip .km-icon:before { display: none; }
{ "pile_set_name": "Github" }
//===- ARCDisassembler.cpp - Disassembler for ARC ---------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// /// /// \file /// This file is part of the ARC Disassembler. /// //===----------------------------------------------------------------------===// #include "ARC.h" #include "ARCRegisterInfo.h" #include "MCTargetDesc/ARCMCTargetDesc.h" #include "TargetInfo/ARCTargetInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCDisassembler/MCDisassembler.h" #include "llvm/MC/MCFixedLenDisassembler.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/Support/TargetRegistry.h" using namespace llvm; #define DEBUG_TYPE "arc-disassembler" using DecodeStatus = MCDisassembler::DecodeStatus; namespace { /// A disassembler class for ARC. class ARCDisassembler : public MCDisassembler { public: std::unique_ptr<MCInstrInfo const> const MCII; ARCDisassembler(const MCSubtargetInfo &STI, MCContext &Ctx, MCInstrInfo const *MCII) : MCDisassembler(STI, Ctx), MCII(MCII) {} DecodeStatus getInstruction(MCInst &Instr, uint64_t &Size, ArrayRef<uint8_t> Bytes, uint64_t Address, raw_ostream &CStream) const override; }; } // end anonymous namespace static bool readInstruction32(ArrayRef<uint8_t> Bytes, uint64_t Address, uint64_t &Size, uint32_t &Insn) { Size = 4; // Read 2 16-bit values, but swap hi/lo parts. Insn = (Bytes[0] << 16) | (Bytes[1] << 24) | (Bytes[2] << 0) | (Bytes[3] << 8); return true; } static bool readInstruction64(ArrayRef<uint8_t> Bytes, uint64_t Address, uint64_t &Size, uint64_t &Insn) { Size = 8; Insn = ((uint64_t)Bytes[0] << 16) | ((uint64_t)Bytes[1] << 24) | ((uint64_t)Bytes[2] << 0) | ((uint64_t)Bytes[3] << 8) | ((uint64_t)Bytes[4] << 48) | ((uint64_t)Bytes[5] << 56) | ((uint64_t)Bytes[6] << 32) | ((uint64_t)Bytes[7] << 40); return true; } static bool readInstruction48(ArrayRef<uint8_t> Bytes, uint64_t Address, uint64_t &Size, uint64_t &Insn) { Size = 6; Insn = ((uint64_t)Bytes[0] << 0) | ((uint64_t)Bytes[1] << 8) | ((uint64_t)Bytes[2] << 32) | ((uint64_t)Bytes[3] << 40) | ((uint64_t)Bytes[4] << 16) | ((uint64_t)Bytes[5] << 24); return true; } static bool readInstruction16(ArrayRef<uint8_t> Bytes, uint64_t Address, uint64_t &Size, uint32_t &Insn) { Size = 2; Insn = (Bytes[0] << 0) | (Bytes[1] << 8); return true; } template <unsigned B> static DecodeStatus DecodeSignedOperand(MCInst &Inst, unsigned InsnS, uint64_t Address = 0, const void *Decoder = nullptr); template <unsigned B> static DecodeStatus DecodeFromCyclicRange(MCInst &Inst, unsigned InsnS, uint64_t Address = 0, const void *Decoder = nullptr); template <unsigned B> static DecodeStatus DecodeBranchTargetS(MCInst &Inst, unsigned InsnS, uint64_t Address, const void *Decoder); static DecodeStatus DecodeMEMrs9(MCInst &, unsigned, uint64_t, const void *); static DecodeStatus DecodeLdLImmInstruction(MCInst &, uint64_t, uint64_t, const void *); static DecodeStatus DecodeStLImmInstruction(MCInst &, uint64_t, uint64_t, const void *); static DecodeStatus DecodeLdRLImmInstruction(MCInst &, uint64_t, uint64_t, const void *); static DecodeStatus DecodeMoveHRegInstruction(MCInst &Inst, uint64_t, uint64_t, const void *); static const uint16_t GPR32DecoderTable[] = { ARC::R0, ARC::R1, ARC::R2, ARC::R3, ARC::R4, ARC::R5, ARC::R6, ARC::R7, ARC::R8, ARC::R9, ARC::R10, ARC::R11, ARC::R12, ARC::R13, ARC::R14, ARC::R15, ARC::R16, ARC::R17, ARC::R18, ARC::R19, ARC::R20, ARC::R21, ARC::R22, ARC::R23, ARC::R24, ARC::R25, ARC::GP, ARC::FP, ARC::SP, ARC::ILINK, ARC::R30, ARC::BLINK}; static DecodeStatus DecodeGPR32RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder) { if (RegNo >= 32) { LLVM_DEBUG(dbgs() << "Not a GPR32 register."); return MCDisassembler::Fail; } unsigned Reg = GPR32DecoderTable[RegNo]; Inst.addOperand(MCOperand::createReg(Reg)); return MCDisassembler::Success; } static DecodeStatus DecodeGBR32ShortRegister(MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder) { // Enumerates registers from ranges [r0-r3],[r12-r15]. if (RegNo > 3) RegNo += 8; // 4 for r12, etc... return DecodeGPR32RegisterClass(Inst, RegNo, Address, Decoder); } #include "ARCGenDisassemblerTables.inc" static unsigned decodeCField(unsigned Insn) { return fieldFromInstruction(Insn, 6, 6); } static unsigned decodeBField(unsigned Insn) { return (fieldFromInstruction(Insn, 12, 3) << 3) | fieldFromInstruction(Insn, 24, 3); } static unsigned decodeAField(unsigned Insn) { return fieldFromInstruction(Insn, 0, 6); } static DecodeStatus DecodeMEMrs9(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Dec) { // We have the 9-bit immediate in the low bits, 6-bit register in high bits. unsigned S9 = Insn & 0x1ff; unsigned R = (Insn & (0x7fff & ~0x1ff)) >> 9; DecodeGPR32RegisterClass(Inst, R, Address, Dec); Inst.addOperand(MCOperand::createImm(SignExtend32<9>(S9))); return MCDisassembler::Success; } static bool DecodeSymbolicOperand(MCInst &Inst, uint64_t Address, uint64_t Value, const void *Decoder) { static const uint64_t atLeast = 2; // TODO: Try to force emitter to use MCDisassembler* instead of void*. auto Disassembler = static_cast<const MCDisassembler *>(Decoder); return (nullptr != Disassembler && Disassembler->tryAddingSymbolicOperand(Inst, Value, Address, true, 0, atLeast)); } static void DecodeSymbolicOperandOff(MCInst &Inst, uint64_t Address, uint64_t Offset, const void *Decoder) { uint64_t nextAddress = Address + Offset; if (!DecodeSymbolicOperand(Inst, Address, nextAddress, Decoder)) Inst.addOperand(MCOperand::createImm(Offset)); } template <unsigned B> static DecodeStatus DecodeBranchTargetS(MCInst &Inst, unsigned InsnS, uint64_t Address, const void *Decoder) { static_assert(B > 0, "field is empty"); DecodeSymbolicOperandOff(Inst, Address, SignExtend32<B>(InsnS), Decoder); return MCDisassembler::Success; } template <unsigned B> static DecodeStatus DecodeSignedOperand(MCInst &Inst, unsigned InsnS, uint64_t /*Address*/, const void * /*Decoder*/) { static_assert(B > 0, "field is empty"); Inst.addOperand(MCOperand::createImm( SignExtend32<B>(maskTrailingOnes<decltype(InsnS)>(B) & InsnS))); return MCDisassembler::Success; } template <unsigned B> static DecodeStatus DecodeFromCyclicRange(MCInst &Inst, unsigned InsnS, uint64_t /*Address*/, const void * /*Decoder*/) { static_assert(B > 0, "field is empty"); const unsigned max = (1u << B) - 1; Inst.addOperand( MCOperand::createImm(InsnS < max ? static_cast<int>(InsnS) : -1)); return MCDisassembler::Success; } static DecodeStatus DecodeStLImmInstruction(MCInst &Inst, uint64_t Insn, uint64_t Address, const void *Decoder) { unsigned SrcC, DstB, LImm; DstB = decodeBField(Insn); if (DstB != 62) { LLVM_DEBUG(dbgs() << "Decoding StLImm found non-limm register."); return MCDisassembler::Fail; } SrcC = decodeCField(Insn); DecodeGPR32RegisterClass(Inst, SrcC, Address, Decoder); LImm = (Insn >> 32); Inst.addOperand(MCOperand::createImm(LImm)); Inst.addOperand(MCOperand::createImm(0)); return MCDisassembler::Success; } static DecodeStatus DecodeLdLImmInstruction(MCInst &Inst, uint64_t Insn, uint64_t Address, const void *Decoder) { unsigned DstA, SrcB, LImm; LLVM_DEBUG(dbgs() << "Decoding LdLImm:\n"); SrcB = decodeBField(Insn); if (SrcB != 62) { LLVM_DEBUG(dbgs() << "Decoding LdLImm found non-limm register."); return MCDisassembler::Fail; } DstA = decodeAField(Insn); DecodeGPR32RegisterClass(Inst, DstA, Address, Decoder); LImm = (Insn >> 32); Inst.addOperand(MCOperand::createImm(LImm)); Inst.addOperand(MCOperand::createImm(0)); return MCDisassembler::Success; } static DecodeStatus DecodeLdRLImmInstruction(MCInst &Inst, uint64_t Insn, uint64_t Address, const void *Decoder) { unsigned DstA, SrcB; LLVM_DEBUG(dbgs() << "Decoding LdRLimm\n"); DstA = decodeAField(Insn); DecodeGPR32RegisterClass(Inst, DstA, Address, Decoder); SrcB = decodeBField(Insn); DecodeGPR32RegisterClass(Inst, SrcB, Address, Decoder); if (decodeCField(Insn) != 62) { LLVM_DEBUG(dbgs() << "Decoding LdRLimm found non-limm register."); return MCDisassembler::Fail; } Inst.addOperand(MCOperand::createImm((uint32_t)(Insn >> 32))); return MCDisassembler::Success; } static DecodeStatus DecodeMoveHRegInstruction(MCInst &Inst, uint64_t Insn, uint64_t Address, const void *Decoder) { LLVM_DEBUG(dbgs() << "Decoding MOV_S h-register\n"); using Field = decltype(Insn); Field h = fieldFromInstruction(Insn, 5, 3) | (fieldFromInstruction(Insn, 0, 2) << 3); Field g = fieldFromInstruction(Insn, 8, 3) | (fieldFromInstruction(Insn, 3, 2) << 3); auto DecodeRegisterOrImm = [&Inst, Address, Decoder](Field RegNum, Field Value) { if (30 == RegNum) { Inst.addOperand(MCOperand::createImm(Value)); return MCDisassembler::Success; } return DecodeGPR32RegisterClass(Inst, RegNum, Address, Decoder); }; if (MCDisassembler::Success != DecodeRegisterOrImm(g, 0)) return MCDisassembler::Fail; return DecodeRegisterOrImm(h, Insn >> 16u); } DecodeStatus ARCDisassembler::getInstruction(MCInst &Instr, uint64_t &Size, ArrayRef<uint8_t> Bytes, uint64_t Address, raw_ostream &cStream) const { MCDisassembler::DecodeStatus Result; if (Bytes.size() < 2) { Size = 0; return Fail; } uint8_t DecodeByte = (Bytes[1] & 0xF7) >> 3; // 0x00 -> 0x07 are 32-bit instructions. // 0x08 -> 0x1F are 16-bit instructions. if (DecodeByte < 0x08) { // 32-bit instruction. if (Bytes.size() < 4) { // Did we decode garbage? Size = 0; return Fail; } if (Bytes.size() >= 8) { // Attempt to decode 64-bit instruction. uint64_t Insn64; if (!readInstruction64(Bytes, Address, Size, Insn64)) return Fail; Result = decodeInstruction(DecoderTable64, Instr, Insn64, Address, this, STI); if (Success == Result) { LLVM_DEBUG(dbgs() << "Successfully decoded 64-bit instruction."); return Result; } LLVM_DEBUG(dbgs() << "Not a 64-bit instruction, falling back to 32-bit."); } uint32_t Insn32; if (!readInstruction32(Bytes, Address, Size, Insn32)) { return Fail; } // Calling the auto-generated decoder function. return decodeInstruction(DecoderTable32, Instr, Insn32, Address, this, STI); } else { if (Bytes.size() >= 6) { // Attempt to treat as instr. with limm data. uint64_t Insn48; if (!readInstruction48(Bytes, Address, Size, Insn48)) return Fail; Result = decodeInstruction(DecoderTable48, Instr, Insn48, Address, this, STI); if (Success == Result) { LLVM_DEBUG( dbgs() << "Successfully decoded 16-bit instruction with limm."); return Result; } LLVM_DEBUG( dbgs() << "Not a 16-bit instruction with limm, try without it."); } uint32_t Insn16; if (!readInstruction16(Bytes, Address, Size, Insn16)) return Fail; // Calling the auto-generated decoder function. return decodeInstruction(DecoderTable16, Instr, Insn16, Address, this, STI); } } static MCDisassembler *createARCDisassembler(const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx) { return new ARCDisassembler(STI, Ctx, T.createMCInstrInfo()); } extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARCDisassembler() { // Register the disassembler. TargetRegistry::RegisterMCDisassembler(getTheARCTarget(), createARCDisassembler); }
{ "pile_set_name": "Github" }
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" #import "IDECommandHandler-Protocol.h" #import "IDECommandHandlerVendor-Protocol.h" @class IDERefactoringSession, IDERefactoringWindowController, NSMutableDictionary; @interface IDERefactoringCommands : NSObject <IDECommandHandlerVendor, IDECommandHandler> { Class _selectionValidationClass; NSMutableDictionary *_transformationClasses; NSMutableDictionary *_viewControllerClasses; NSMutableDictionary *_inputValidatorClasses; id <IDESelectionSource> _selectionSource; IDERefactoringWindowController *_windowController; IDERefactoringSession *_session; } + (void)refactoringCommandCompleted; + (id)_refactoringForMainWindow; + (id)handlerForAction:(SEL)arg1 withSelectionSource:(id)arg2; + (id)_sharedHandler; @property(retain) IDERefactoringSession *session; // @synthesize session=_session; @property(retain) IDERefactoringWindowController *windowController; // @synthesize windowController=_windowController; @property(retain) id <IDESelectionSource> selectionSource; // @synthesize selectionSource=_selectionSource; - (void).cxx_destruct; - (BOOL)validateUserInterfaceItem:(id)arg1; - (void)contextMenu_refactorEncapsulate:(id)arg1; - (void)contextMenu_refactorMoveDown:(id)arg1; - (void)contextMenu_refactorMoveUp:(id)arg1; - (void)contextMenu_refactorCreateSuperclass:(id)arg1; - (void)contextMenu_refactorExtract:(id)arg1; - (void)contextMenu_refactorRename:(id)arg1; - (void)refactorEncapsulate:(id)arg1; - (void)refactorMoveDown:(id)arg1; - (void)refactorMoveUp:(id)arg1; - (void)refactorCreateSuperclass:(id)arg1; - (void)refactorExtract:(id)arg1; - (void)refactorRename:(id)arg1; - (void)refactor:(id)arg1 contextMenu:(BOOL)arg2; - (BOOL)_validateTransformation:(id)arg1 contextMenu:(BOOL)arg2 error:(id *)arg3; - (void)genericAlertDidEnd:(id)arg1 returnCode:(long long)arg2 contextInfo:(void *)arg3; - (id)init; @end
{ "pile_set_name": "Github" }
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of the License "Eclipse Public License v1.0" // which accompanies this distribution, and is available // at the URL "http://www.eclipse.org/legal/epl-v10.html". // // Initial Contributors: // Nokia Corporation - initial contribution. // // Contributors: // // Description: // eka\kernel\arm\cachel2.cpp // // Support for the following external cache controllers: // - L210 // - L220 // - PL310 // /* Errata status: * * General note that applies to all errata: * External cache configuration in bootstrap is implemented in baseport (usually HardwareInitialise * procedure). Baseport should ensure errata fixes are properly implemented in bootstrap. * * L210 Errata status: * * - Incorrect IDLE assertion on BUSY to IDLE transaction transition on master ports. * There is no Software work-around for this erratum. * * - BWABT event only asserted if abort response is received on the last access of buffered write * or eviction transaction. * There is no Software work-around for this erratum. * * - IDLE can be active while a transaction starts on a master port (HTRANSMx = NSEQ). * There is no Software work-around for this erratum. * * - Abort response can be lost on a nonbufferable write access with master port in 32-bit configuration. * There is no Software work-around for this erratum. * * - Evictions can cause write data from write buffer to be overwritten. * The work-around for this erratum is to use the L210 as a write-through cache only, which * is enforced in baseport. * * - Incorrect eviction buffer request deassertion can cause WAW hazard or outof-date data read. * The work-around for this erratum is to use the L210 as a write-through cache only, which * is enforced in baseport. * * - Read-after-write hazards can be incorrectly handled between write allocation linefills and * dirty data evictions in three master ports configuration. * The software work-around for this erratum is to change memory regions attributes so that * allocate on read miss only policy is used for all outer write-back regions. * Note: * Write allocate is supported only for systems using ARMv6 extensions only * Status: * Fix not implemented. * * - Starting a background maintenance operation while a line is sitting in the writeallocate buffer * can prevent that line from being allocated * The software work-around is to perform an explicit Cache Sync operation before initiating a * background clean or clean-and-invalidate cache maintenance operation. * Status: * Fix implemented unconditionally because Kernel is using background maintenance * operation only during soft restart and performance issue is minimal/nonexistant. * * - The Cache Sync operation does not guarantee that the Eviction Buffer is empty * From ARM Support: * To insure the error does not occur, you can do a Cache Sync operation followed by a SWP * to non-cacheable memory. * Status: * Fix implemented in Kernel when * __ARM_L210_ERRATA_CACHESYNC_DOESNT_FLUSH_EVICTION_BUFFER_FIXED * is not defined in variant.mmh * * L220 Errata status: * * - 484863: The Cache Sync operation does not guarantee that the Eviction Buffer is empty. * The software workaround is to do a dummy STR to Non-cacheable Normal Memory before launching * the Cache Sync operation. Baseport (in bootstrap) MUST ensure that memory mapping of * BTP_Uncached entry in BootTable is either: * - MEMORY_UNCACHED (memory type remapping on) or, * - CACHE_BUFC (memory type remapping off) * Status: * Fix implemented in Kernel when * __ARM_L220_ERRATUM_484863_FIXED * is not defined in variant.mmh * * PL310 Errata status: * * - 504326: Prefetching can be done on wrong address or wrong memory area. * Status: * No need for the fix in Kernel as it doesn't do prefetching. * When PL310 is configured in bootstrap, baseport should keep the Instruction * and Data Prefetch features disabled, as they are by default. * * - 539766: Non Secure Invalidate by Way maintenance operation does not work properly. * Description: * Invalidate by Way in non-secure world may corrupt secure cache lines. * Status: * Unconditionaly fixed. Kernal maintains only a single way in one go. * When intialising PL310, baseport should make sure to invalide only a single * way in one go. * * - 540921: Parity must be disabled in exclusive cache configuration. * Status: * No need for the fix in Kernel as PL310 is initialised by baseport. * When intialising PL310, baseport should make sure not to enable both * parity and exclusive mode. * * - 588369: Clean&Invalidate maintenance operations do not invalidate clean lines. * Status: * Fix implemented in Kernel when * __ARM_PL310_ERRATUM_588369_FIXED * is not defined in variant.mmh * CleanAndInvalidateByPA is replaced by CleanByPA and InvalidateByPA. * CleanAndInvalidateByIndexWay is made sure never to happen. * CleanAndInvalidateByWay is made sure never to happen. * Coherancy problem mentioned in the workaround is not relevant. * * - 588371: Potential data corruption when an AXI locked access is received while a * prefetch is treated. * Status: * No need for the fix in Kernel as PL310 SWP instruction is depricated since ARMv6. * * - 501023: Address Filtering register content cannot be read. * Status: * No need for the fix in Kernel it doesn't access access filtering registers. * * - 502117: Address Filtering registers may not have appropriate values out of reset. * Status: * No need for the fix in Kernel it doesn't access access filtering registers. * * - 588375: Potential deadlock when evictions or store buffer writes are issued by * different master ports. * Status: * Not fixed in Kernel as there is no software workaround for this erratum. * * - 727915: Background Clean & Invalidate by Way operation can cause data corruption * Status: * There was no need to fix anything as PL310 cache maintenance doesn't use any * _Maintain_ByWay operation. (It is only used in ExternalCache::AtomicSync on * L210 & L220.) */ #include <arm.h> #include "cache_maintenance.h" #include <nkern.h> #ifdef __HAS_EXTERNAL_CACHE__ //L2 Cache globals SCacheInfo ExternalCache::Info; TLinAddr ExternalCache::Base; #if defined(__ARM_PL310_CACHE__) #if defined(__SMP__) TSpinLock ExternalCache::iLock(TSpinLock::EOrderCacheMaintenance); #else // Any order will do here TSpinLock ExternalCache::iLock(TSpinLock::EOrderGenericIrqLow0); #endif #endif // defined(__ARM_PL310_CACHE__) #if defined (__ARM_L220_CACHE__) // These two macros that deal with disabling/restoring interrupts // when L220 accesses controll register. They are defined here to // improve readability of the code below. #define L220_COMMAND_PREAMBLE \ TInt irq = NKern::DisableAllInterrupts(); \ while (*ctrlReg & 1) __chill(); #define L220_COMMAND_POSTAMBLE \ NKern::RestoreInterrupts(irq); #else // defined (__ARM_L220_CACHE__) #define L220_COMMAND_PREAMBLE #define L220_COMMAND_POSTAMBLE #endif // else defined (__ARM_L220_CACHE__) #if defined(__ARM_PL310_CACHE__) // These three macros that deal with pl310 spin lock are // defined here to improve readability of the code below. #define PL310_SPIN_LOCK \ TInt lockCounter = KMaxCacheLinesPerSpinLock; \ TInt spinLockIrq = Lock(); #define PL310_SPIN_FLASH \ if (!--lockCounter) \ { \ lockCounter = KMaxCacheLinesPerSpinLock; \ FlashLock(spinLockIrq); \ } #define PL310_SPIN_UNLOCK \ Unlock(spinLockIrq); #else //defined(__ARM_PL310_CACHE__) #define PL310_SPIN_LOCK #define PL310_SPIN_FLASH #define PL310_SPIN_UNLOCK #endif // else defined(__ARM_PL310_CACHE__) #define CACHEL2FAULT() ExternalCacheFault(__LINE__) void ExternalCacheFault(TInt aLine) { Kern::Fault("ExternalCacheFault",aLine); } void ExternalCache::Init1() { TInt waySize = 0; // Number of bytes in a way Base = TheSuperPage().iArmL2CacheBase; TInt auxCtrl = *(TInt*)(Base+ARML2C_AuxiliaryControl); __KTRACE_OPT(KBOOT,Kern::Printf("ExternalCache::Init1 L2CacheBase=%x AuxCtrl reg=%x", Base, auxCtrl)); //Calculate the number of ways switch((auxCtrl & ARML2C_WaySize_Mask) >> ARML2C_WaySize_Shift) { case 0: waySize = 0x4000; break; case 1: waySize = 0x4000; break; case 2: waySize = 0x8000; break; case 3: waySize = 0x10000; break; case 4: waySize = 0x20000; break; #if defined (__ARM_L210_CACHE__) || defined (__ARM_L220_CACHE__) default: waySize = 0x40000; break; #elif defined(__ARM_PL310_CACHE__) case 5: waySize = 0x40000; break; case 6: waySize = 0x80000; break; default: waySize = 0x80000; break; #endif } #if defined (__ARM_L210_CACHE__) || defined (__ARM_L220_CACHE__) Info.iAssoc = (auxCtrl & ARML2C_Assoc_Mask)>> ARML2C_Assoc_Shift; if (Info.iAssoc > 8) Info.iAssoc = 8; #elif defined(__ARM_PL310_CACHE__) Info.iAssoc = auxCtrl & ARML2C_Assoc_Mask ? 16 : 8; #endif Info.iSize = (waySize * Info.iAssoc) >> 5; // >>5 as iSize is counted in lines Info.iLineLength=32; // It is always 32 Info.iLineLenLog2=5; Info.iInvalidateThreshold=Info.iSize*8; //if invalidate region >=8*CacheSize, will flush entire cache Info.iCleanThreshold=Info.iSize*4; //if clean region >=4*CacheSize, will clean entire cache Info.iCleanAndInvalidateThreshold=Info.iSize*4; //if flush region >=4*CacheSize, will flush entire cache #ifdef _DEBUG SCacheInfo& c=Info; __KTRACE_OPT(KBOOT,Kern::Printf("External Cache:")); __KTRACE_OPT(KBOOT,Kern::Printf("Size %04x LineLength %04x Assoc %04x",c.iSize,c.iLineLength,c.iAssoc)); __KTRACE_OPT(KBOOT,Kern::Printf("InvalidateThreshold %04x CleanThreshold %04x CleanAndInvalidateThreshold %04x",c.iInvalidateThreshold,c.iCleanThreshold,c.iCleanAndInvalidateThreshold)); __KTRACE_OPT(KBOOT,Kern::Printf("LineLenLog2 %02x PreemptBlock %02x",c.iLineLenLog2,c.iPreemptBlock)); #endif } void ExternalCache::Clean(TLinAddr aBase, TUint aSize) { __KTRACE_OPT(KMMU, Kern::Printf("ExternalCache::Clean base=%xH, size=%xH", aBase, aSize)); if (aSize>=Info.CleanThresholdBytes()) Maintain_All((TInt*)(Base+ARML2C_CleanByIndexWay)); else Maintain_Region(aBase, aSize, (TInt*)(Base+ARML2C_CleanLineByPA)); DrainBuffers(); } void ExternalCache::Invalidate(TLinAddr aBase, TUint aSize) { __KTRACE_OPT(KMMU,Kern::Printf("ExternalCache::Purge base=%xH, size=%xH", aBase, aSize)); #if defined(__ARM_PL310_CACHE__) && !defined(__ARM_PL310_ERRATUM_588369_FIXED) //Cannot Clean&Invalidate all cache, so do not bother checking the threshold Maintain_Region(aBase, aSize, (TInt*)(Base+ARML2C_InvalidateLineByPA)); #else // defined(__ARM_PL310_CACHE__) && !defined(__ARM_PL310_ERRATUM_588369_FIXED) if (aSize>=Info.InvalidateThresholdBytes()) { Maintain_All((TInt*)(Base+ARML2C_CleanInvalidateByIndexWay)); DrainBuffers(); } else { Maintain_Region(aBase, aSize, (TInt*)(Base+ARML2C_InvalidateLineByPA)); } #endif //else defined(__ARM_PL310_CACHE__) && !defined(__ARM_PL310_ERRATUM_588369_FIXED) } void ExternalCache::CleanAndInvalidate(TLinAddr aBase, TUint aSize) { __KTRACE_OPT(KMMU,Kern::Printf("ExternalCache::CleanAndInvalidate base=%xH, size=%xH", aBase, aSize)); #if defined(__ARM_PL310_CACHE__) && !defined(__ARM_PL310_ERRATUM_588369_FIXED) //Cannot Clean&Invalidate all cache, so do not bother checking the threshold Maintain_Region(aBase, aSize, (TInt*)(Base+ARML2C_CleanInvalidateLineByPA)); #else //defined(__ARM_PL310_CACHE__) && !defined(__ARM_PL310_ERRATUM_588369_FIXED) if (aSize>=Info.CleanAndInvalidateThresholdBytes()) Maintain_All((TInt*)(Base+ARML2C_CleanInvalidateByIndexWay)); else Maintain_Region(aBase, aSize, (TInt*)(Base+ARML2C_CleanInvalidateLineByPA)); #endif DrainBuffers(); } void ExternalCache::AtomicSync() { // This methos is called during reboot or power down sequence and therefore is not allowed // to do Kernel calls that may hold spin lock - such as Kern::Print or precondition checkings. // CHECK_PRECONDITIONS(MASK_INTERRUPTS_DISABLED,"ExternalCache::AtomicSync"); // __KTRACE_OPT(KMMU,Kern::Printf("ExternalCache::AtomicSync")); #if defined(__ARM_PL310_CACHE__) // Do not use maintain-by-way operations on PL310 (due to erratum 727915 for example) // Also, do not use ARML2C_CleanInvalidateByIndexWay (erratum 588369) // Do not hold spin lock as it is assumed this is the only running CPU. TInt indexNo = Info.iSize>>3; // This is the number of cache lines in each way. Assoc is always 8 in this cache volatile TInt* ctrlReg = (volatile TInt*)(Base+ARML2C_CleanByIndexWay); TInt way,index; for (way = 0 ; way <Info.iAssoc ; way++) { for (index = 0 ; index <indexNo ; index++) { *ctrlReg = (way<<ARML2C_WayShift) | (index<<ARML2C_IndexShift); //This will maintain a single cache line } } #else //defined(__ARM_PL310_CACHE__) #if defined (__ARM_L210_CACHE__) // Flush buffers before starting background clean+invalidate. // This is the fix for an erratum (see the top of the file). DrainBuffers(); #endif #if defined (__ARM_L220_CACHE__) { // Loop if there is ongoing background operation. volatile TInt* cacheSync = (volatile TInt*)(Base+ARML2C_CacheSync); while (*cacheSync & 1) __chill(); } #endif int wayShift; // Clean and invalidate cache way-after-the-way. Maintenance of multiple ways at // the same time is the subject of numerous errata. for (wayShift=1; wayShift < 0x100; wayShift<<=1)//8 loops (for 8 ways), with wayShift values 1,2,4,...,0x80 { volatile TInt* ctrlReg = (volatile TInt*)(Base+ARML2C_CleanInvalidateByWay); *ctrlReg = wayShift; while(*ctrlReg) __chill(); } DrainBuffers(); #endif return; } void ExternalCache::InvalidatePhysicalMemory(TPhysAddr aAddr, TUint aSize) { if (aSize == 0) return; volatile TInt* ctrlReg = (volatile TInt*)(Base+ARML2C_InvalidateLineByPA); TUint32 endAddr = aAddr+aSize; // (Exclusive) if (endAddr<aAddr) endAddr = 0xffffffff; aAddr &= ~(Info.iLineLength-1); // Align starting address to line length. PL310_SPIN_LOCK; lineLoop: L220_COMMAND_PREAMBLE; *ctrlReg = aAddr; //This will invalidate the line from the external cache L220_COMMAND_POSTAMBLE; PL310_SPIN_FLASH; aAddr+=Info.iLineLength; if (aAddr<endAddr) goto lineLoop; PL310_SPIN_UNLOCK; } void ExternalCache::CleanPhysicalMemory(TPhysAddr aAddr, TUint aSize) { if (aSize == 0) return; volatile TInt* ctrlReg = (volatile TInt*)(Base+ARML2C_CleanLineByPA); TUint32 endAddr = aAddr+aSize; // (Exclusive) if (endAddr<aAddr) endAddr = 0xffffffff; aAddr &= ~(Info.iLineLength-1); // Align starting address to line length. PL310_SPIN_LOCK; lineLoop: L220_COMMAND_PREAMBLE; *ctrlReg = aAddr; //This will clean the line from the external cache L220_COMMAND_POSTAMBLE; PL310_SPIN_FLASH; aAddr+=Info.iLineLength; if (aAddr<endAddr) goto lineLoop; PL310_SPIN_UNLOCK; DrainBuffers(); } void ExternalCache::CleanAndInvalidatePhysicalMemory(TPhysAddr aAddr, TUint aSize) { if (aSize == 0) return; TUint32 endAddr = aAddr+aSize; // (Exclusive) if (endAddr<aAddr) endAddr = 0xffffffff; aAddr &= ~(Info.iLineLength-1); // Align starting address to line length. PL310_SPIN_LOCK; #if defined(__ARM_PL310_CACHE__) && !defined(__ARM_PL310_ERRATUM_588369_FIXED) volatile TInt* cleanReg = (volatile TInt*)(Base+ARML2C_CleanLineByPA); volatile TInt* invalidateReg = (volatile TInt*)(Base+ARML2C_InvalidateLineByPA); lineLoop: TInt ret = NKern::DisableAllInterrupts(); *cleanReg = aAddr; *invalidateReg = aAddr; NKern::RestoreInterrupts(ret); #else // #idefined(__ARM_PL310_CACHE__) && !defined(__ARM_PL310_ERRATUM_588369_FIXED) volatile TInt* ctrlReg = (volatile TInt*)(Base+ARML2C_CleanInvalidateLineByPA); lineLoop: L220_COMMAND_PREAMBLE; *ctrlReg = aAddr; //This will clean&invalidate the line from the external cache L220_COMMAND_POSTAMBLE; #endif //else defined(__ARM_PL310_CACHE__) && !defined(__ARM_PL310_ERRATUM_588369_FIXED) PL310_SPIN_FLASH; aAddr+=Info.iLineLength; if (aAddr<endAddr) goto lineLoop; PL310_SPIN_UNLOCK; DrainBuffers(); } void ExternalCache::Maintain_Region(TLinAddr aBase, TUint aSize, TInt* aCtrlReg) { __KTRACE_OPT(KMMU,Kern::Printf("ExternalCache::Maintain_Region %08xH+%08xH, reg=%xH", aBase, aSize, aCtrlReg)); if (aSize == 0) return; volatile TInt* ctrlReg = aCtrlReg; TInt lineLength = Info.iLineLength; //Round down aBase to line length and recalculate aSize accordingly. TInt diff = aBase & (lineLength-1); aBase -= diff; //Ensure size doesn't overflow if ( ((TInt)(aSize)<0) && (((TInt)(aSize)+diff)>0) ) aSize = 0xffffffff; else aSize += diff; // Find the starting physical address. If VA is invalid, try the next page. findStartingPA: TPhysAddr physAddress = Epoc::LinearToPhysical(aBase); if (physAddress == KPhysAddrInvalid) { __KTRACE_OPT(KMMU,Kern::Printf("ExternalCache::Maintain_Region invalid VA:%xH", aBase)); diff = KPageSize - (aBase&KPageMask); aBase+=diff; if ((TInt)aSize>0 && ((TInt)aSize<=diff)) return; aSize-=diff; goto findStartingPA; } __KTRACE_OPT(KMMU,Kern::Printf("ExternalCache::Maintain_Region VA:%xH > PA:%xH", aBase, physAddress)); aBase &= ~KPageMask; //The rest of the function expects aBase to be page aligned. PL310_SPIN_LOCK; lineLoop: #if defined(__ARM_PL310_CACHE__) && !defined(__ARM_PL310_ERRATUM_588369_FIXED) if((TInt)aCtrlReg == Base+ARML2C_CleanInvalidateLineByPA) { // CleanInvalidateLineByPA is broken volatile TInt* cleanReg = (volatile TInt*)(Base+ARML2C_CleanLineByPA); volatile TInt* invalidateReg = (volatile TInt*)(Base+ARML2C_InvalidateLineByPA); TInt ret = NKern::DisableAllInterrupts(); *cleanReg = physAddress; *invalidateReg = physAddress; NKern::RestoreInterrupts(ret); } else *ctrlReg = physAddress; //This will clean, purge or flush the line #else L220_COMMAND_PREAMBLE; *ctrlReg = physAddress; //This will clean, purge or flush the line L220_COMMAND_POSTAMBLE; #endif PL310_SPIN_FLASH; if ((TInt)aSize>0 && ((TInt)aSize<=lineLength)) goto endOfRegion; aSize=aSize-lineLength; physAddress+=lineLength; if ((physAddress & KPageMask)) goto lineLoop; //Drop here when the end of the page is reached. endOfPage: aBase += KPageSize; physAddress = Epoc::LinearToPhysical(aBase); if (physAddress == KPhysAddrInvalid) { __KTRACE_OPT(KMMU,Kern::Printf("ExternalCache::Maintain_Region Invalid VA %xH", aBase)); if ((TInt)aSize>0 && ((TInt)aSize<=KPageSize)) goto endOfRegion; aSize-=KPageSize; goto endOfPage; } __KTRACE_OPT(KMMU,Kern::Printf("ExternalCache::Maintain_Region VA:%xH > PA:%xH", aBase, physAddress)); goto lineLoop; endOfRegion: PL310_SPIN_UNLOCK; return; } void ExternalCache::Maintain_All(TInt* aCtrlReg) { __KTRACE_OPT(KMMU,Kern::Printf("ExternalCache::Maintain_All %xH", aCtrlReg)); #if defined(__ARM_PL310_CACHE__) && !defined(__ARM_PL310_ERRATUM_588369_FIXED) //CleanAndInvalidateByIndexWay is broken __ASSERT_DEBUG((TInt)aCtrlReg != Base+ARML2C_CleanInvalidateByIndexWay, CACHEL2FAULT()); #endif TInt indexNo = Info.iSize>>3; // This is the number of cache lines in each way. Assoc is always 8 in this cache volatile TInt* ctrlReg = aCtrlReg; PL310_SPIN_LOCK; TInt way,index; for (way = 0 ; way <Info.iAssoc ; way++) { for (index = 0 ; index <indexNo ; index++) { L220_COMMAND_PREAMBLE; *ctrlReg = (way<<ARML2C_WayShift) | (index<<ARML2C_IndexShift); //this will maintain a single cache line L220_COMMAND_POSTAMBLE; PL310_SPIN_FLASH; } } PL310_SPIN_UNLOCK; } #if defined(__ARM_PL310_CACHE__) TInt ExternalCache::Lock() { return __SPIN_LOCK_IRQSAVE(iLock); } void ExternalCache::FlashLock(TInt aIrq) { __SPIN_FLASH_IRQRESTORE(iLock, aIrq); } void ExternalCache::Unlock(TInt aIrq) { __SPIN_UNLOCK_IRQRESTORE(iLock, aIrq); } #endif // defined(__ARM_PL310_CACHE__) #endif // defined (__HAS_EXTERNAL_CACHE__)
{ "pile_set_name": "Github" }
'x' '💕' 'a'x
{ "pile_set_name": "Github" }
/// Removes the unit (e.g. px, em, rem) from a value, returning the number only. /// @param {Number} $num - Number to strip unit from. /// @return {Number} The same number, sans unit. /// @access private @function strip-unit($num) { @return $num / ($num * 0 + 1); }
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 %s -emit-llvm -o - | grep llvm.global_ctors int __attribute__((constructor)) foo(void) { return 0; } void __attribute__((constructor)) bar(void) {}
{ "pile_set_name": "Github" }
import find from 'lodash/find'; import toArray from 'lodash/toArray'; import { GetterTree } from 'vuex'; import { Task, TaskMeta } from '@/model/task'; import { TaskType } from '@/model/task-type'; import { TaskState } from '@/store/tasks/state'; import { RotkehlchenState } from '@/store/types'; export type TaskGetters = { isTaskRunning: (type: TaskType) => boolean; metadata: (type: TaskType) => TaskMeta | undefined; hasRunningTasks: boolean; tasks: Task<TaskMeta>[]; }; type GettersDefinition<S = TaskState, G = TaskGetters> = { [P in keyof G]: (state: S, getters: G) => G[P]; }; export const getters: GetterTree<TaskState, RotkehlchenState> & GettersDefinition = { isTaskRunning: (state: TaskState) => (type: TaskType): boolean => { return !!find(state.tasks, item => item.type === type); }, metadata: (state: TaskState) => (type: TaskType): TaskMeta | undefined => { const task = find(state.tasks, item => item.type === type); if (task) { return task.meta; } return undefined; }, hasRunningTasks: (state: TaskState): boolean => { return Object.keys(state.tasks).length > 0; }, tasks: (state: TaskState): Task<TaskMeta>[] => { return toArray(state.tasks); } };
{ "pile_set_name": "Github" }
// Copyright 2016 DeepFabric, 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, // See the License for the specific language governing permissions and // limitations under the License. // +build freebsd openbsd netbsd dragonfly linux package storage import ( "bytes" "github.com/deepfabric/elasticell/pkg/pb/raftcmdpb" "github.com/deepfabric/elasticell/pkg/util" gonemo "github.com/deepfabric/go-nemo" "golang.org/x/net/context" ) var ( endScan = []byte("") ) type nemoHashEngine struct { limiter *util.Limiter db *gonemo.NEMO } func newNemoHashEngine(db *gonemo.NEMO, cfg *NemoCfg) HashEngine { return &nemoHashEngine{ limiter: util.NewLimiter(cfg.LimitConcurrencyWrite), db: db, } } func (e *nemoHashEngine) HSet(key, field, value []byte) (int64, error) { e.limiter.Wait(context.TODO()) n, err := e.db.HSet(key, field, value) e.limiter.Release() return int64(n), err } func (e *nemoHashEngine) HGet(key, field []byte) ([]byte, error) { return e.db.HGet(key, field) } func (e *nemoHashEngine) HDel(key []byte, fields ...[]byte) (int64, error) { e.limiter.Wait(context.TODO()) n, err := e.db.HDel(key, fields...) e.limiter.Release() return n, err } func (e *nemoHashEngine) HExists(key, field []byte) (bool, error) { return e.db.HExists(key, field) } func (e *nemoHashEngine) HKeys(key []byte) ([][]byte, error) { return e.db.HKeys(key) } func (e *nemoHashEngine) HVals(key []byte) ([][]byte, error) { return e.db.HVals(key) } func (e *nemoHashEngine) HScanGet(key, start []byte, count int) ([]*raftcmdpb.FVPair, error) { iter := e.db.HScan(key, start, endScan, true) var result []*raftcmdpb.FVPair for { if len(result) == count { break } if !iter.Valid() { break } field := iter.Field() value := iter.Value() if !bytes.Equal(start, field) { result = append(result, &raftcmdpb.FVPair{ Field: field, Value: value, }) } iter.Next() } iter.Free() return result, nil } func (e *nemoHashEngine) HGetAll(key []byte) ([]*raftcmdpb.FVPair, error) { fields, values, err := e.db.HGetall(key) if err != nil { return nil, err } if nil == fields || nil == values { return nil, nil } pairs := make([]*raftcmdpb.FVPair, len(fields)) for idx, field := range fields { pairs[idx] = &raftcmdpb.FVPair{ Field: field, Value: values[idx], } } return pairs, nil } func (e *nemoHashEngine) HLen(key []byte) (int64, error) { return e.db.HLen(key) } func (e *nemoHashEngine) HMGet(key []byte, fields ...[]byte) ([][]byte, []error) { e.limiter.Wait(context.TODO()) values, errors := e.db.HMGet(key, fields) e.limiter.Release() var errs []error if len(errors) > 0 { for _, err := range errors { if err != nil { errs = append(errs, err) } } } return values, errs } func (e *nemoHashEngine) HMSet(key []byte, fields, values [][]byte) error { e.limiter.Wait(context.TODO()) _, err := e.db.HMSet(key, fields, values) e.limiter.Release() return err } func (e *nemoHashEngine) HSetNX(key, field, value []byte) (int64, error) { e.limiter.Wait(context.TODO()) n, err := e.db.HSetnx(key, field, value) e.limiter.Release() return n, err } func (e *nemoHashEngine) HStrLen(key, field []byte) (int64, error) { return e.db.HStrlen(key, field) } func (e *nemoHashEngine) HIncrBy(key, field []byte, incrment int64) ([]byte, error) { e.limiter.Wait(context.TODO()) value, err := e.db.HIncrby(key, field, incrment) e.limiter.Release() return value, err }
{ "pile_set_name": "Github" }
package def.dom; import def.js.Object; public class Event extends def.js.Object { public java.lang.Boolean bubbles; public java.lang.Boolean cancelBubble; public java.lang.Boolean cancelable; public EventTarget currentTarget; public java.lang.Boolean defaultPrevented; public double eventPhase; public java.lang.Boolean isTrusted; public java.lang.Boolean returnValue; public Element srcElement; public EventTarget target; public double timeStamp; public java.lang.String type; native public void initEvent(java.lang.String eventTypeArg, java.lang.Boolean canBubbleArg, java.lang.Boolean cancelableArg); native public void preventDefault(); native public void stopImmediatePropagation(); native public void stopPropagation(); public double AT_TARGET; public double BUBBLING_PHASE; public double CAPTURING_PHASE; public static Event prototype; public Event(java.lang.String type, EventInit eventInitDict){} public Event(java.lang.String type){} protected Event(){} }
{ "pile_set_name": "Github" }
<?php /* * This file is part of the Predis package. * * (c) Daniele Alessandri <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Predis\Command; /** * Defines a command whose keys can be prefixed. * * @author Daniele Alessandri <[email protected]> */ interface PrefixableCommandInterface { /** * Prefixes all the keys found in the arguments of the command. * * @param string $prefix String used to prefix the keys. */ public function prefixKeys($prefix); }
{ "pile_set_name": "Github" }
<?php namespace SabreForRainLoop\CalDAV\Property; use SabreForRainLoop\DAV; use SabreForRainLoop\CalDAV; /** * schedule-calendar-transp property. * * This property is a representation of the schedule-calendar-transp property. * This property is defined in RFC6638 (caldav scheduling). * * Its values are either 'transparent' or 'opaque'. If it's transparent, it * means that this calendar will not be taken into consideration when a * different user queries for free-busy information. If it's 'opaque', it will. * * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License */ class ScheduleCalendarTransp extends DAV\Property { const TRANSPARENT = 'transparent'; const OPAQUE = 'opaque'; protected $value; /** * Creates the property * * @param string $value */ public function __construct($value) { if ($value !== self::TRANSPARENT && $value !== self::OPAQUE) { throw new \InvalidArgumentException('The value must either be specified as "transparent" or "opaque"'); } $this->value = $value; } /** * Returns the current value * * @return string */ public function getValue() { return $this->value; } /** * Serializes the property in a DOMDocument * * @param DAV\Server $server * @param \DOMElement $node * @return void */ public function serialize(DAV\Server $server,\DOMElement $node) { $doc = $node->ownerDocument; switch($this->value) { case self::TRANSPARENT : $xval = $doc->createElement('cal:transparent'); break; case self::OPAQUE : $xval = $doc->createElement('cal:opaque'); break; } $node->appendChild($xval); } /** * Unserializes the DOMElement back into a Property class. * * @param \DOMElement $node * @return ScheduleCalendarTransp */ static function unserialize(\DOMElement $node) { $value = null; foreach($node->childNodes as $childNode) { switch(DAV\XMLUtil::toClarkNotation($childNode)) { case '{' . CalDAV\Plugin::NS_CALDAV . '}opaque' : $value = self::OPAQUE; break; case '{' . CalDAV\Plugin::NS_CALDAV . '}transparent' : $value = self::TRANSPARENT; break; } } if (is_null($value)) return null; return new self($value); } }
{ "pile_set_name": "Github" }
# SPDX-License-Identifier: GPL-2.0-only # tools/power/acpi/Makefile.rules - ACPI tool Makefile # # Copyright (c) 2015, Intel Corporation # Author: Lv Zheng <[email protected]> # objdir := $(OUTPUT)tools/$(TOOL)/ toolobjs := $(addprefix $(objdir),$(TOOL_OBJS)) $(OUTPUT)$(TOOL): $(toolobjs) FORCE $(ECHO) " LD " $(subst $(OUTPUT),,$@) $(QUIET) $(LD) $(CFLAGS) $(LDFLAGS) $(toolobjs) -L$(OUTPUT) -o $@ $(ECHO) " STRIP " $(subst $(OUTPUT),,$@) $(QUIET) $(STRIPCMD) $@ $(KERNEL_INCLUDE): $(ECHO) " MKDIR " $(subst $(OUTPUT),,$@) $(QUIET) mkdir -p $(KERNEL_INCLUDE) $(ECHO) " CP " $(subst $(OUTPUT),,$@) $(QUIET) cp -rf $(srctree)/../../../include/acpi $(KERNEL_INCLUDE)/ $(objdir)%.o: %.c $(KERNEL_INCLUDE) $(ECHO) " CC " $(subst $(OUTPUT),,$@) $(QUIET) $(CC) -c $(CFLAGS) -o $@ $< all: $(OUTPUT)$(TOOL) clean: $(ECHO) " RMOBJ " $(subst $(OUTPUT),,$(objdir)) $(QUIET) find $(objdir) \( -not -type d \)\ -and \( -name '*~' -o -name '*.[oas]' \)\ -type f -print | xargs rm -f $(ECHO) " RM " $(TOOL) $(QUIET) rm -f $(OUTPUT)$(TOOL) $(ECHO) " RMINC " $(subst $(OUTPUT),,$(KERNEL_INCLUDE)) $(QUIET) rm -rf $(KERNEL_INCLUDE) install-tools: $(ECHO) " INST " $(TOOL) $(QUIET) $(INSTALL) -d $(DESTDIR)$(sbindir) $(QUIET) $(INSTALL_PROGRAM) $(OUTPUT)$(TOOL) $(DESTDIR)$(sbindir) uninstall-tools: $(ECHO) " UNINST " $(TOOL) $(QUIET) rm -f $(DESTDIR)$(sbindir)/$(TOOL) install: all install-tools $(EXTRA_INSTALL) uninstall: uninstall-tools $(EXTRA_UNINSTALL) .PHONY: FORCE
{ "pile_set_name": "Github" }
#if __IOS__ using System; using Foundation; using System.IO; namespace Windows.Storage { partial class ApplicationData { private static string GetLocalCacheFolder() { if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) { var url = NSFileManager.DefaultManager.GetUrls(NSSearchPathDirectory.CachesDirectory, NSSearchPathDomain.User)[0]; return url.Path; } else { var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var folder = Path.GetFullPath(Path.Combine(documents, "..", "Library", "Caches")); Directory.CreateDirectory(folder); return folder; } } private static string GetTemporaryFolder() => Path.GetTempPath(); private static string GetLocalFolder() { var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var folder = Path.GetFullPath(Path.Combine(documents, "..", "Library", "Data")); Directory.CreateDirectory(folder); return folder; } private static string GetRoamingFolder() => Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); private static string GetSharedLocalFolder() => Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); } } #endif
{ "pile_set_name": "Github" }
{ "_args": [ [ "asn1@~0.2.3", "C:\\Users\\Administrator\\Desktop\\react-learning\\node_modules\\sshpk" ] ], "_from": "asn1@>=0.2.3 <0.3.0", "_id": "[email protected]", "_inCache": true, "_installable": true, "_location": "/asn1", "_npmUser": { "email": "[email protected]", "name": "pfmooney" }, "_npmVersion": "1.4.28", "_phantomChildren": {}, "_requested": { "name": "asn1", "raw": "asn1@~0.2.3", "rawSpec": "~0.2.3", "scope": null, "spec": ">=0.2.3 <0.3.0", "type": "range" }, "_requiredBy": [ "/sshpk" ], "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", "_shasum": "dac8787713c9966849fc8180777ebe9c1ddf3b86", "_shrinkwrap": null, "_spec": "asn1@~0.2.3", "_where": "C:\\Users\\Administrator\\Desktop\\react-learning\\node_modules\\sshpk", "author": { "email": "[email protected]", "name": "Mark Cavage" }, "bugs": { "url": "https://github.com/mcavage/node-asn1/issues" }, "contributors": [ { "name": "David Gwynne", "email": "[email protected]" }, { "name": "Yunong Xiao", "email": "[email protected]" }, { "name": "Alex Wilson", "email": "[email protected]" } ], "dependencies": {}, "description": "Contains parsers and serializers for ASN.1 (currently BER only)", "devDependencies": { "tap": "0.4.8" }, "directories": {}, "dist": { "shasum": "dac8787713c9966849fc8180777ebe9c1ddf3b86", "tarball": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz" }, "homepage": "https://github.com/mcavage/node-asn1", "license": "MIT", "main": "lib/index.js", "maintainers": [ { "name": "mcavage", "email": "[email protected]" }, { "name": "pfmooney", "email": "[email protected]" } ], "name": "asn1", "optionalDependencies": {}, "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git://github.com/mcavage/node-asn1.git" }, "scripts": { "test": "tap ./tst" }, "version": "0.2.3" }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> <item android:drawable="@drawable/dk_stat_sys_download_anim0" android:duration="200" /> <item android:drawable="@drawable/dk_stat_sys_download_anim1" android:duration="200" /> <item android:drawable="@drawable/dk_stat_sys_download_anim2" android:duration="200" /> <item android:drawable="@drawable/dk_stat_sys_download_anim3" android:duration="200" /> <item android:drawable="@drawable/dk_stat_sys_download_anim4" android:duration="200" /> <item android:drawable="@drawable/dk_stat_sys_download_anim5" android:duration="200" /> </animation-list>
{ "pile_set_name": "Github" }
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright 2019 (c) fortiss (Author: Stefan Profanter) */ /* ** Main entry point. The fuzzer invokes this function with each ** fuzzed input. */ #include <base64.h> extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) { size_t retLen; unsigned char* ret = UA_base64(data, size, &retLen); if (retLen > 0) free(ret); return 0; }
{ "pile_set_name": "Github" }
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <DVTKit/DVTSearchFieldTextEditor.h> @interface DVTFindPatternFieldEditor : DVTSearchFieldTextEditor { } + (id)findPatternFieldEditorForWindow:(id)arg1; - (BOOL)readSelectionFromPasteboard:(id)arg1 type:(id)arg2; - (BOOL)writeSelectionToPasteboard:(id)arg1 type:(id)arg2; - (id)readablePasteboardTypes; - (id)writablePasteboardTypes; - (id)acceptableDragTypes; - (BOOL)usesFontPanel; - (void)setUsesFontPanel:(BOOL)arg1; - (BOOL)respondsToSelector:(SEL)arg1; - (id)initWithFrame:(struct CGRect)arg1; @end
{ "pile_set_name": "Github" }
--- Description: IsAdditionalPdpContextProfile MS-HAID: WWAN\_profile\_v3.element\_IsAdditionalPdpContextProfile MSHAttr: - PreferredSiteName:MSDN - PreferredLib:/library/windows/desktop title: IsAdditionalPdpContextProfile ms.topic: reference ms.date: 05/31/2018 --- # <span id="WWAN_profile_v3.element_IsAdditionalPdpContextProfile"></span>IsAdditionalPdpContextProfile The **IsAdditionalPdpContextProfile** element contains a **boolean** that is **true** if this is an "additional PDP (Packet Data Protocol) context" profile and **false**, otherwise. Default is **false**. An "additional PDP context" profile is a profile that does not get activated over the physical adapter default port, and setting this element to true ensures that this profile is not displayed inappropriately in the user interface. Note that if this element is set to true, then the following must also be true. - The [**IsDefault**](./schema-isdefault-mbnprofile-element.md) element must be unspecified or set to **false** for the profile to be valid. - The [**ConnectionMode**](./schema-connectionmode-mbnprofile-element.md) element must be unspecified or set to **manual** for the profile to be valid. ## Element hierarchy **<IsAdditionalPdpContextProfile>** ## Syntax ``` syntax <IsAdditionalPdpContextProfile> boolean </IsAdditionalPdpContextProfile> ``` ## <span id="Attributes_and_Elements"></span><span id="attributes_and_elements"></span><span id="ATTRIBUTES_AND_ELEMENTS"></span>Attributes and Elements ### <span id="attributes"></span><span id="ATTRIBUTES"></span>Attributes None. ### <span id="Child_Elements"></span><span id="child_elements"></span><span id="CHILD_ELEMENTS"></span>Child Elements None. ### <span id="parent_elements"></span><span id="PARENT_ELEMENTS"></span>Parent Elements This outermost (document) element may not be contained by any other elements. ## Requirements <table> <colgroup> <col style="width: 50%" /> <col style="width: 50%" /> </colgroup> <tbody> <tr class="odd"> <td><p>Namespace</p></td> <td><p>https://www.microsoft.com/networking/WWAN/profile/v3</p></td> </tr> </tbody> </table>    
{ "pile_set_name": "Github" }
/** * Copyright 2012 - CommonCrawl Foundation * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * **/ package org.commoncrawl.mapred.pipelineV3.domainmeta.fuzzydedupe; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.regex.Pattern; import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.OutputCollector; import org.apache.hadoop.mapred.Reducer; import org.apache.hadoop.mapred.Reporter; import org.commoncrawl.protocol.URLFPV2; import org.commoncrawl.util.GoogleURL; import org.commoncrawl.util.StringUtils; import org.commoncrawl.util.TextBytes; import org.commoncrawl.util.URLFPBloomFilter; import org.commoncrawl.util.URLUtils; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.JsonPrimitive; /** * * @author rana * */ public class CrossDomainDupesReducer implements Reducer<TextBytes, TextBytes, TextBytes, TextBytes> { enum Counters { } JsonParser parser = new JsonParser(); public static final int NUM_HASH_FUNCTIONS = 10; public static final int NUM_BITS = 11; public static final int NUM_ELEMENTS = 1 << 18; private URLFPBloomFilter filter = new URLFPBloomFilter(NUM_ELEMENTS, NUM_HASH_FUNCTIONS, NUM_BITS); String samples[] = new String[20]; Pattern knownValidDupesPatterns = Pattern.compile("/(wp-includes|xmlrpc.php)"); @Override public void close() throws IOException { } @Override public void configure(JobConf job) { } public double otherDomainToLocalDomainScore(double totalHits, double otherDomainHits) { return Math.log(otherDomainHits) / Math.log(totalHits); } @Override public void reduce(TextBytes key, Iterator<TextBytes> values, OutputCollector<TextBytes, TextBytes> output, Reporter reporter) throws IOException { filter.clear(); double crossDomainDupesCount = 0; double totalHitsCount = 0; double uniqueRootDomainsCount = 0; double uniqueIPs = 0; double validDupePatternMatches = 0; URLFPV2 rootFP = URLUtils.getURLFPV2FromHost(key.toString()); URLFPV2 fp = new URLFPV2(); int sampleCount = 0; ArrayList<Integer> ipAddresses = new ArrayList<Integer>(); JsonArray thisHostsDupes = new JsonArray(); DescriptiveStatistics lengthStats = new DescriptiveStatistics(); while (values.hasNext()) { JsonArray jsonArray = parser.parse(values.next().toString()).getAsJsonArray(); for (JsonElement elem : jsonArray) { totalHitsCount++; fp.setRootDomainHash(elem.getAsJsonObject().get("dh").getAsLong()); if (fp.getRootDomainHash() != rootFP.getRootDomainHash()) { crossDomainDupesCount++; fp.setDomainHash(fp.getRootDomainHash()); fp.setUrlHash(fp.getRootDomainHash()); // track length average .... lengthStats.addValue(elem.getAsJsonObject().get("length").getAsInt()); if (!filter.isPresent(fp)) { uniqueRootDomainsCount++; filter.add(fp); if (sampleCount < samples.length) { String url = elem.getAsJsonObject().get("url").getAsString(); GoogleURL urlObject = new GoogleURL(url); if (knownValidDupesPatterns.matcher(urlObject.getCanonicalURL()).find()) { validDupePatternMatches++; } samples[sampleCount++] = url; } } } else { thisHostsDupes.add(elem); } int ipAddress = elem.getAsJsonObject().get("ip").getAsInt(); fp.setRootDomainHash(ipAddress); fp.setDomainHash(ipAddress); fp.setUrlHash(ipAddress); if (!filter.isPresent(fp)) { uniqueIPs++; filter.add(fp); ipAddresses.add(ipAddress); } } } if (totalHitsCount > 15 && crossDomainDupesCount >= 2) { double otherDomainToLocalScore = otherDomainToLocalDomainScore(totalHitsCount, crossDomainDupesCount); double spamIPScore = spamHostScore(totalHitsCount, crossDomainDupesCount, uniqueIPs); if (otherDomainToLocalScore >= .50 || spamIPScore > .50) { JsonObject objectOut = new JsonObject(); objectOut.addProperty("ratio", (crossDomainDupesCount / totalHitsCount)); objectOut.addProperty("totalHits", totalHitsCount); objectOut.addProperty("crossDomainDupes", crossDomainDupesCount); objectOut.addProperty("uniqueRootDomains", uniqueRootDomainsCount); objectOut.addProperty("otherDomainToLocalScore", otherDomainToLocalScore); objectOut.addProperty("spamIPScore", spamIPScore); objectOut.addProperty("validDupeMatches", validDupePatternMatches); objectOut.addProperty("content-len-mean", lengthStats.getMean()); objectOut.addProperty("content-len-geo-mean", lengthStats.getGeometricMean()); for (int i = 0; i < sampleCount; ++i) { objectOut.addProperty("sample-" + i, samples[i]); } // compute path edit distance ... if (sampleCount > 1) { int sampleEditDistanceSize = Math.min(sampleCount, 5); DescriptiveStatistics stats = new DescriptiveStatistics(); for (int j = 0; j < sampleEditDistanceSize; ++j) { for (int k = 0; k < sampleEditDistanceSize; ++k) { if (k != j) { GoogleURL urlObjectA = new GoogleURL(samples[j]); GoogleURL urlObjectB = new GoogleURL(samples[k]); if (urlObjectA.getPath().length() < 100 && urlObjectB.getPath().length() < 100) { stats.addValue(StringUtils.getLevenshteinDistance(urlObjectA.getPath(), urlObjectB.getPath())); } } } } if (stats.getMean() != 0.0) { objectOut.addProperty("lev-distance-mean", stats.getMean()); objectOut.addProperty("lev-distance-geomean", stats.getGeometricMean()); } } JsonArray ipAddressArray = new JsonArray(); for (int j = 0; j < Math.min(1000, ipAddresses.size()); ++j) { ipAddressArray.add(new JsonPrimitive(ipAddresses.get(j))); } if (ipAddresses.size() != 0) { objectOut.add("ipList", ipAddressArray); } objectOut.add("thisHostDupes", thisHostsDupes); output.collect(key, new TextBytes(objectOut.toString())); } } } public double spamHostScore(double totalHits, double otherDomainHits, double uniqueIPAddresses) { double uniqueIPScore = 1 - (Math.log(uniqueIPAddresses) / Math.log(totalHits)); return (Math.log(Math.max(otherDomainHits, 2)) / Math.log(Math.max(totalHits, 2))) * uniqueIPScore; } }
{ "pile_set_name": "Github" }
# stolen wholesale from capistrano, thanks Jamis! class Git # Performs a clone on the remote machine, then checkout on the branch # you want to deploy. def initialize(opts={}) @configuration = opts end def configuration @configuration end def git res = configuration[:git_ssh_wrapper] ? "GIT_SSH=#{configuration[:git_ssh_wrapper]} git" : 'git' res = "sudo -u #{configuration[:user]} #{res}" if configuration[:user] res end def respository configuration[:repository] end def checkout(revision, destination) remote = origin args = [] args << "-o #{remote}" unless remote == 'origin' if depth = configuration[:git_shallow_clone] args << "--depth #{depth}" end execute = ["rm -rf #{destination}"] if args.empty? execute << "#{git} clone #{verbose} #{configuration[:repository]} #{destination}" else execute << "#{git} clone #{verbose} #{args.join(' ')} #{configuration[:repository]} #{destination}" end # checkout into a local branch rather than a detached HEAD execute << "cd #{destination} && #{git} checkout #{verbose} -b deploy #{revision}" if configuration[:git_enable_submodules] execute << "#{git} submodule #{verbose} init" execute << "#{git} submodule #{verbose} update" end execute.join(" && ") end # An expensive export. Performs a checkout as above, then # removes the repo. def export(revision, destination) checkout(revision, destination) << " && rm -Rf #{destination}/.git" end # Merges the changes to 'head' since the last fetch, for remote_cache # deployment strategy def sync(revision, destination) remote = origin execute = [] execute << "cd #{destination}" # Use git-config to setup a remote tracking branches. Could use # git-remote but it complains when a remote of the same name already # exists, git-config will just silenty overwrite the setting every # time. This could cause wierd-ness in the remote cache if the url # changes between calls, but as long as the repositories are all # based from each other it should still work fine. if remote != 'origin' execute << "#{git} config remote.#{remote}.url #{configuration[:repository]}" execute << "#{git} config remote.#{remote}.fetch +refs/heads/*:refs/remotes/#{remote}/*" end # since we're in a local branch already, just reset to specified revision rather than merge execute << "#{git} fetch #{verbose} #{remote} && #{git} reset #{verbose} --hard #{revision}" if configuration[:git_enable_submodules] execute << "#{git} submodule #{verbose} init" execute << "#{git} submodule #{verbose} update" end execute.join(" && ") end # Returns a string of diffs between two revisions def diff(from, to=nil) from << "..#{to}" if to scm :diff, from end # Returns a log of changes between the two revisions (inclusive). def log(from, to=nil) scm :log, "#{from}..#{to}" end # Getting the actual commit id, in case we were passed a tag # or partial sha or something - it will return the sha if you pass a sha, too def query_revision(reference) raise ArgumentError, "Deploying remote branches is no longer supported. Specify the remote branch as a local branch for the git repository you're deploying from (ie: '#{reference.gsub('origin/', '')}' rather than '#{reference}')." if reference =~ /^origin\// sha_hash = '[0-9a-f]{40}' return reference if reference =~ /^#{sha_hash}$/ # it's already a sha command = scm('ls-remote', configuration[:repository], reference) result = nil begin result = yield(command) rescue ChefDeployFailure => e raise obvious_error("Could not access the remote Git repository. If this is a private repository, please verify that the deploy key for your application has been added to your remote Git account.", e) end unless result =~ /^(#{sha_hash})\s+(\S+)/ raise "Unable to resolve reference for '#{reference}' on repository '#{configuration[:repository]}'." end newrev = $1 newref = $2 return newrev end def scm(*args) [git, *args].compact.join(" ") end def head configuration[:branch] || 'HEAD' end def origin configuration[:remote] || 'origin' end private # If verbose output is requested, return nil, otherwise return the # command-line switch for "quiet" ("-q"). def verbose nil#configuration[:scm_verbose] ? nil : "-q" end # Build an error string that stands out in a log file def obvious_error(message, e) "#{stars}\n#{message}\n#{stars}\n#{e.message}#{stars}" end def stars ("\n"+'*'*80)*2 end end
{ "pile_set_name": "Github" }
/* ZipEntry.java -- Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.util.zip; import java.util.Calendar; /** * This class represents a member of a zip archive. ZipFile and * ZipInputStream will give you instances of this class as information * about the members in an archive. On the other hand ZipOutputStream * needs an instance of this class to create a new member. * * @author Jochen Hoenicke */ public class ZipEntry implements ZipConstants, Cloneable { private static final byte KNOWN_SIZE = 1; private static final byte KNOWN_CSIZE = 2; private static final byte KNOWN_CRC = 4; private static final byte KNOWN_TIME = 8; private static final byte KNOWN_DOSTIME = 16; private static final byte KNOWN_EXTRA = 32; /** Immutable name of the entry */ private final String name; /** Uncompressed size */ private int size; /** Compressed size */ private long compressedSize = -1; /** CRC of uncompressed data */ private int crc; /** Comment or null if none */ private String comment = null; /** The compression method. Either DEFLATED or STORED, by default -1. */ private byte method = -1; /** Flags specifying what we know about this entry */ private byte known = 0; /** * The 32bit DOS encoded format for the time of this entry. Only valid if * KNOWN_DOSTIME is set in known. */ private int dostime; /** * The 64bit Java encoded millisecond time since the beginning of the epoch. * Only valid if KNOWN_TIME is set in known. */ private long time; /** Extra data */ private byte[] extra = null; int flags; /* used by ZipOutputStream */ int offset; /* used by ZipFile and ZipOutputStream */ /** * Compression method. This method doesn't compress at all. */ public static final int STORED = 0; /** * Compression method. This method uses the Deflater. */ public static final int DEFLATED = 8; /** * Creates a zip entry with the given name. * @param name the name. May include directory components separated * by '/'. * * @exception NullPointerException when name is null. * @exception IllegalArgumentException when name is bigger then 65535 chars. */ public ZipEntry(String name) { int length = name.length(); if (length > 65535) throw new IllegalArgumentException("name length is " + length); this.name = name; } /** * Creates a copy of the given zip entry. * @param e the entry to copy. */ public ZipEntry(ZipEntry e) { this(e, e.name); } ZipEntry(ZipEntry e, String name) { this.name = name; known = e.known; size = e.size; compressedSize = e.compressedSize; crc = e.crc; dostime = e.dostime; time = e.time; method = e.method; extra = e.extra; comment = e.comment; } final void setDOSTime(int dostime) { this.dostime = dostime; known |= KNOWN_DOSTIME; known &= ~KNOWN_TIME; } final int getDOSTime() { if ((known & KNOWN_DOSTIME) != 0) return dostime; else if ((known & KNOWN_TIME) != 0) { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(time); dostime = (cal.get(Calendar.YEAR) - 1980 & 0x7f) << 25 | (cal.get(Calendar.MONTH) + 1) << 21 | (cal.get(Calendar.DAY_OF_MONTH)) << 16 | (cal.get(Calendar.HOUR_OF_DAY)) << 11 | (cal.get(Calendar.MINUTE)) << 5 | (cal.get(Calendar.SECOND)) >> 1; known |= KNOWN_DOSTIME; return dostime; } else return 0; } /** * Creates a copy of this zip entry. */ public Object clone() { // JCL defines this as being the same as the copy constructor above, // except that value of the "extra" field is also copied. Take care // that in the case of a subclass we use clone() rather than the copy // constructor. ZipEntry clone; if (this.getClass() == ZipEntry.class) clone = new ZipEntry(this); else { try { clone = (ZipEntry) super.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(); } } if (extra != null) { clone.extra = new byte[extra.length]; System.arraycopy(extra, 0, clone.extra, 0, extra.length); } return clone; } /** * Returns the entry name. The path components in the entry are * always separated by slashes ('/'). */ public String getName() { return name; } /** * Sets the time of last modification of the entry. * @time the time of last modification of the entry. */ public void setTime(long time) { this.time = time; this.known |= KNOWN_TIME; this.known &= ~KNOWN_DOSTIME; } /** * Gets the time of last modification of the entry. * @return the time of last modification of the entry, or -1 if unknown. */ public long getTime() { // The extra bytes might contain the time (posix/unix extension) parseExtra(); if ((known & KNOWN_TIME) != 0) return time; else if ((known & KNOWN_DOSTIME) != 0) { int sec = 2 * (dostime & 0x1f); int min = (dostime >> 5) & 0x3f; int hrs = (dostime >> 11) & 0x1f; int day = (dostime >> 16) & 0x1f; int mon = ((dostime >> 21) & 0xf) - 1; int year = ((dostime >> 25) & 0x7f) + 1980; /* since 1900 */ try { Calendar cal = Calendar.getInstance(); cal.set(year, mon, day, hrs, min, sec); time = cal.getTimeInMillis(); known |= KNOWN_TIME; return time; } catch (RuntimeException ex) { /* Ignore illegal time stamp */ known &= ~KNOWN_TIME; return -1; } } else return -1; } /** * Sets the size of the uncompressed data. * @exception IllegalArgumentException if size is not in 0..0xffffffffL */ public void setSize(long size) { if ((size & 0xffffffff00000000L) != 0) throw new IllegalArgumentException(); this.size = (int) size; this.known |= KNOWN_SIZE; } /** * Gets the size of the uncompressed data. * @return the size or -1 if unknown. */ public long getSize() { return (known & KNOWN_SIZE) != 0 ? size & 0xffffffffL : -1L; } /** * Sets the size of the compressed data. */ public void setCompressedSize(long csize) { this.compressedSize = csize; } /** * Gets the size of the compressed data. * @return the size or -1 if unknown. */ public long getCompressedSize() { return compressedSize; } /** * Sets the crc of the uncompressed data. * @exception IllegalArgumentException if crc is not in 0..0xffffffffL */ public void setCrc(long crc) { if ((crc & 0xffffffff00000000L) != 0) throw new IllegalArgumentException(); this.crc = (int) crc; this.known |= KNOWN_CRC; } /** * Gets the crc of the uncompressed data. * @return the crc or -1 if unknown. */ public long getCrc() { return (known & KNOWN_CRC) != 0 ? crc & 0xffffffffL : -1L; } /** * Sets the compression method. Only DEFLATED and STORED are * supported. * @exception IllegalArgumentException if method is not supported. * @see ZipOutputStream#DEFLATED * @see ZipOutputStream#STORED */ public void setMethod(int method) { if (method != ZipOutputStream.STORED && method != ZipOutputStream.DEFLATED) throw new IllegalArgumentException(); this.method = (byte) method; } /** * Gets the compression method. * @return the compression method or -1 if unknown. */ public int getMethod() { return method; } /** * Sets the extra data. * @exception IllegalArgumentException if extra is longer than 0xffff bytes. */ public void setExtra(byte[] extra) { if (extra == null) { this.extra = null; return; } if (extra.length > 0xffff) throw new IllegalArgumentException(); this.extra = extra; } private void parseExtra() { // Already parsed? if ((known & KNOWN_EXTRA) != 0) return; if (extra == null) { known |= KNOWN_EXTRA; return; } try { int pos = 0; while (pos < extra.length) { int sig = (extra[pos++] & 0xff) | (extra[pos++] & 0xff) << 8; int len = (extra[pos++] & 0xff) | (extra[pos++] & 0xff) << 8; if (sig == 0x5455) { /* extended time stamp */ int flags = extra[pos]; if ((flags & 1) != 0) { long time = ((extra[pos+1] & 0xff) | (extra[pos+2] & 0xff) << 8 | (extra[pos+3] & 0xff) << 16 | (extra[pos+4] & 0xff) << 24); setTime(time*1000); } } pos += len; } } catch (ArrayIndexOutOfBoundsException ex) { /* be lenient */ } known |= KNOWN_EXTRA; return; } /** * Gets the extra data. * @return the extra data or null if not set. */ public byte[] getExtra() { return extra; } /** * Sets the entry comment. * @exception IllegalArgumentException if comment is longer than 0xffff. */ public void setComment(String comment) { if (comment != null && comment.length() > 0xffff) throw new IllegalArgumentException(); this.comment = comment; } /** * Gets the comment. * @return the comment or null if not set. */ public String getComment() { return comment; } /** * Gets true, if the entry is a directory. This is solely * determined by the name, a trailing slash '/' marks a directory. */ public boolean isDirectory() { int nlen = name.length(); return nlen > 0 && name.charAt(nlen - 1) == '/'; } /** * Gets the string representation of this ZipEntry. This is just * the name as returned by getName(). */ public String toString() { return name; } /** * Gets the hashCode of this ZipEntry. This is just the hashCode * of the name. Note that the equals method isn't changed, though. */ public int hashCode() { return name.hashCode(); } }
{ "pile_set_name": "Github" }
{{#each}} const {{this}}T = "{{this}}";{{/each}}
{ "pile_set_name": "Github" }
s<caret>ome t<caret>e<caret>xt s<selection><caret>o</selection>me other another <selection>li<caret>ne</selection>
{ "pile_set_name": "Github" }
--- adb/bugreport_test.cpp.orig 2019-08-13 02:10:58 UTC +++ adb/bugreport_test.cpp @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "bugreport.h" - #include <gmock/gmock.h> #include <gtest/gtest.h> @@ -24,6 +22,7 @@ #include "sysdeps.h" #include "adb_utils.h" +#include "bugreport.h" using ::testing::_; using ::testing::Action; @@ -40,6 +39,7 @@ using ::testing::internal::CaptureStdout; using ::testing::internal::GetCapturedStderr; using ::testing::internal::GetCapturedStdout; +#ifdef __linux__ // Empty function so tests don't need to be linked against file_sync_service.cpp, which requires // SELinux and its transitive dependencies... bool do_sync_pull(const std::vector<const char*>& srcs, const char* dst, bool copy_attrs, @@ -47,6 +47,7 @@ bool do_sync_pull(const std::vector<const char*>& srcs ADD_FAILURE() << "do_sync_pull() should have been mocked"; return false; } +#endif // Empty functions so tests don't need to be linked against commandline.cpp DefaultStandardStreamsCallback DEFAULT_STANDARD_STREAMS_CALLBACK(nullptr, nullptr);
{ "pile_set_name": "Github" }
var $export = require('./_export'); // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) $export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperties: require('./_object-dps')});
{ "pile_set_name": "Github" }
#define rmac_message 128 /*message window ID*/ #define rerror_str 128 /*errors str*/ #define kprefsize 16384 /* kbytes */ #define kminsize 10000 #define kStackNeeded 2048*1024 /*unsual stack requeriment? but allegro need*/ #define kHeapNeeded 8192*1024 /*it's a game OK*/
{ "pile_set_name": "Github" }
#!/usr/bin/python3 from sys import argv, stderr, exit from struct import pack, calcsize from yaml import load, dump from os.path import isfile # If LibYAML is available, use that, as recommended by the PyYAML wiki. try: from yaml import CLoader as Loader, CDumper as Dumper except ImportError: from yaml import Loader, Dumper # Globals format_version = 1 header_struct = "<BBB" patch_struct = "<B8sIIBBIBI" version_struct = "<III" subtype_struct = "<HHI" patch_types = { "FIRM": 0, "Memory": 1, "Userland": 2, "Sysmodule": 3 } firm_types = { "NATIVE_FIRM": 0, "TWL_FIRM": 1, "AGB_FIRM": 2 } consoles_dict = { "o3ds": 0, "n3ds": 1 } options_dict = { "keyx": 0b00000001, "emunand": 0b00000010, "save": 0b00000100 } # Shitty function to kill itself def die(string): print(string, file=stderr) exit(1) # Pad file to align it to x bytes def align(file, alignment): x = alignment - file.tell() % alignment if x < alignment: file.write(b'\0' * x) if len(argv) < 3: die("Usage: %s <info.yaml> <output.cake>" % argv[0]) try: info = load(open(argv[1]), Loader=Loader) except Exception as e: print(e) die("Failed to load the YAML file: %s" % argv[1]) if not "description" in info: die("Missing description in info") if not "patches" in info: die("Missing patches in info") # Open destination file cake = open(argv[2], "wb") # Write the description string cake.seek(calcsize(header_struct)) cake.write((info["description"] + '\0').encode()) align(cake, 4) # Align to 4 bytes # Know the starting positions of the patches array and the versions array patches_offset = cake.tell() versions_offset = cake.tell() + calcsize(patch_struct) * len(info["patches"]) # Write the main header cake.seek(0) cake.write(pack(header_struct, format_version, len(info["patches"]), patches_offset )) # We'll save all the known memory patches here memory_list = [] for patch_name in info["patches"]: patch = info["patches"][patch_name] # Read the code. # NOTE: Loading into memory due to being a lazy asshole, and I don't expect too big files. If it ends up being used for considerably big files, though, consider using mmap. try: patch_file = open(patch_name, "rb") except FileNotFoundError: die("Couldn't find patch file: %s" % patch_name) patch_code = patch_file.read() patch_size = patch_file.tell() patch_file.close() if not isinstance(patch, dict): die("Incompatible type for patch: %s" % patch_name) if not "type" in patch: die("Missing type in patch: %s" % patch_name) if not isinstance(patch["type"], str): die("Incompatible type for type in patch: %s" % patch_name) if not "versions" in patch: die("Missing versions in patch: %s" % patch_name) if not isinstance(patch["versions"], dict): die("Incompatible type for versions in patch: %s" % patch_name) # Figure out how many versions there are, and do some basic checks. if patch["type"] == "Userland": # Userland patches don't have console-specific versions version_count = len(patch["versions"]) else: # Memory and FIRM patches, and Sysmodules, however, do have console-specific versions. version_count = 0 for console in patch["versions"]: if not console in consoles_dict: die("Unknown console: %s" % console) if not isinstance(patch["versions"][console], dict): die("Incompatible type for console: %s" % console) version_count += len(patch["versions"][console]) # Figure out the type and subtype values type = None subtype = None if patch["type"] in firm_types: # We support using type: firm_type as a shorthand for type: firm and subtype: firm_type type = "FIRM" subtype = patch["type"] else: if not patch["type"] in patch_types: die("Unknown type in patch: %s" % patch_name) if not "subtype" in patch: die("Missing subtype in patch: %s" % patch_name) type = patch["type"] subtype = patch["subtype"] # Convert subtype into the appropiate value if type == "Userland": # Userland patches use the title ID if not isinstance(subtype, int): die("Incompatible subtype in patch: %s" % patch_name) else: # Most other patches have a bit more complicated structure. if not subtype in firm_types: die("Unknown subtype in patch: %s" % patch_name) memory_id = 0 memory_var = 0 memory_name = None # Fix the memory ID for Memory and FIRM patches if type == "FIRM" and "memory" in patch: # If a FIRM patch requires a memory patch, set the info for it right. if not isinstance(patch["memory"], dict): die("Incompatible type for memory in patch: %s" % patch_name) if not "patch" in patch["memory"]: die("Missing patch in memory in patch: %s" % patch_name) if not "variable" in patch["memory"]: die("Missing variable in memory in patch: %s" % patch_name) memory_name = patch["memory"]["patch"] # A FIRM patch also needs to know the location of the variable to write the Memory patch's location to if not isinstance(patch["memory"]["variable"], str): die("Incompatible type for variable in memory in patch: %s" % patch_name) memory_var = patch_code.find(patch["memory"]["variable"].encode()) if memory_var == -1: die("Coudn't find variable '%s' in patch: %s" % (patch["memory"]["variable"], patch_name)) elif type == "Memory": # Memory patches themselves are indexed by default memory_name = patch_name if memory_name: if not memory_name in memory_list: memory_list.append(memory_name) memory_id = memory_list.index(memory_name) + 1 # +1 because 0 means it has no ID. subtype = pack(subtype_struct, firm_types[subtype], memory_id, memory_var ) # Type is converted the same way in either case type = patch_types[type] # Get options options = 0 if "options" in patch: if not isinstance(patch["options"], list): die("Incompatible type for options in patch: %s" % patch_name) for option in patch["options"]: if not option in options_dict: die("Unrecognized option: %s" % option) options |= options_dict[option] # We will put the variables arrays behind the versions array. variables_offset = versions_offset + calcsize(version_struct) * version_count # Make the variables array variables = 0 variable_count = 0 if "variables" in patch: if not isinstance(patch["variables"], list): die("Incompatible type for variables in patch: %s" % patch_name) # Jump to the place where we will write the variables array cake.seek(variables_offset) variables = cake.tell() for variable in patch["variables"]: if not isinstance(variable, str): die("Incompatible type for variable in patch: %s" % patch_name) offset = patch_code.find(variable.encode()) if offset == -1: die("Coudn't find variable '%s' in patch: %s" % (variable, patch_name)) cake.write(pack("<I", offset)) variable_count += 1 # Save the location of the variable values for future use variables_offset = cake.tell() # Set the start of the versions array correctly versions = versions_offset # Process all different versions for version in patch["versions"]: if patch["type"] == "Userland": pass # Userland patches don't have console-specific versions # TODO: Implement this. else: # Memory and FIRM patches, and Sysmodules, however, do have console-specific versions. console = version for version in patch["versions"][console]: version_info = patch["versions"][console][version] identifier = consoles_dict[console] << 16 | version variables_info = None if isinstance(version_info, int): # We support writing the offset without any hassle if there's no variables to specify. memory_offset = version_info elif isinstance(version_info, list) and patch["type"] == "Memory": # We also support writing just the variables (FIRM patches require also specifying the offset) memory_offset = 0 variables_info = version_info elif isinstance(version_info, dict): if not "offset" in version_info: die("Missing offset in version: %s-%s-%x" % (patch_name, console, version)) if not isinstance(version_info["offset"], int): die("Incompatible type for offset in version: %s-%s-%x" % (patch_name, console, version)) if "variables" in version_info: if not isinstance(version_info["variables"], list): die("Incompatible type for variables in version: %s-%s-%x" % (patch_name, console, version)) variables_info = version_info["variables"] memory_offset = version_info["offset"] else: die("Incompatible type for version: %s-%s-%x" % (patch_name, console, version)) # Process the variables version_variables = 0 if "variables" in patch: if not variables_info: die("Missing variables in version: %s-%s-%x" % (patch_name, console, version)) if len(variables_info) != variable_count: die("Incorrect amount of variables in version: %s-%s-%x" % (patch_name, console, version)) version_variables = variables_offset cake.seek(variables_offset) for variable in variables_info: if not isinstance(variable, int): die("Incompatible type for variable in version: %s-%s-%x" % (patch_name, console, version)) cake.write(pack("<I", variable)) variables_offset = cake.tell() cake.seek(versions_offset) cake.write(pack(version_struct, identifier, memory_offset, version_variables )) versions_offset = cake.tell() # Skip over the variable arrays we put behind the versions array cake.seek(variables_offset) # Write the actual code to the file align(cake, 4) # Align to 4 bytes patch_offset = cake.tell() # The current location is the start of the patch cake.write(patch_code) # Set the current location for writing the next versions array. align(cake, 4) # Align to 4 bytes versions_offset = cake.tell() # Close the patch file patch_file.close() # Write the actual patch header. cake.seek(patches_offset) cake.write(pack(patch_struct, type, subtype, patch_offset, patch_size, options, version_count, versions, variable_count, variables )) patches_offset = cake.tell() cake.close()
{ "pile_set_name": "Github" }
// $Id: LinkLayers.cs,v 1.1.1.1 2007/07/03 10:15:18 tamirgal Exp $ /// <summary>************************************************************************ /// Copyright (C) 2001, Patrick Charles and Jonas Lehmann * /// Distributed under the Mozilla Public License * /// http://www.mozilla.org/NPL/MPL-1.1.txt * /// ************************************************************************* /// </summary> using System; namespace Tamir.IPLib.Packets { /// <summary> Link-layer type codes. /// <p> /// Taken from libpcap/bpf/net/bpf.h and pcap/net/bpf.h. /// <p> /// The link-layer type is used to determine what data-structure the /// IP protocol bits will be encapsulated inside of. /// <p> /// On a 10/100mbps network, packets are encapsulated inside of ethernet. /// 14-byte ethernet headers which contain MAC addresses and an ethernet type /// field. /// <p> /// On ethernet over ppp, the link-layer type is raw, and packets /// are not encapsulated in any ethernet header. /// <p> /// /// </summary> /// <author> Patrick Charles and Jonas Lehmann /// </author> /// <version> $Revision: 1.1.1.1 $ /// </version> /// <lastModifiedBy> $Author: tamirgal $ </lastModifiedBy> /// <lastModifiedAt> $Date: 2007/07/03 10:15:18 $ </lastModifiedAt> public struct LinkLayers_Fields{ /// <summary> no link-layer encapsulation </summary> public const int NULL = 0; /// <summary> Ethernet (10Mb) </summary> public const int EN10MB = 1; /// <summary> Experimental Ethernet (3Mb) </summary> public const int EN3MB = 2; /// <summary> Amateur Radio AX.25 </summary> public const int AX25 = 3; /// <summary> Proteon ProNET Token Ring </summary> public const int PRONET = 4; /// <summary> Chaos </summary> public const int CHAOS = 5; /// <summary> IEEE 802 Networks </summary> public const int IEEE802 = 6; /// <summary> ARCNET </summary> public const int ARCNET = 7; /// <summary> Serial Line IP </summary> public const int SLIP = 8; /// <summary> Point-to-point Protocol </summary> public const int PPP = 9; /// <summary> FDDI </summary> public const int FDDI = 10; /// <summary> LLC/SNAP encapsulated atm </summary> public const int ATM_RFC1483 = 11; /// <summary> raw IP </summary> public const int RAW = 12; /// <summary> BSD Slip.</summary> public const int SLIP_BSDOS = 15; /// <summary> BSD PPP.</summary> public const int PPP_BSDOS = 16; /// <summary> IP over ATM.</summary> public const int ATM_CLIP = 19; /// <summary> PPP over HDLC.</summary> public const int PPP_SERIAL = 50; /// <summary> Cisco HDLC.</summary> public const int CHDLC = 104; /// <summary> IEEE 802.11 wireless.</summary> public const int IEEE802_11 = 105; /// <summary> OpenBSD loopback.</summary> public const int LOOP = 108; /// <summary> Linux cooked sockets.</summary> public const int LINUX_SLL = 113; /// <summary> unknown link-layer type</summary> public const int UNKNOWN = - 1; } public interface LinkLayers { //UPGRADE_NOTE: Members of interface 'LinkLayers' were extracted into structure 'LinkLayers_Fields'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1045'" } }
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: c1f765b2bd3d2ad49b2677f6478a9ba3 folderAsset: yes timeCreated: 1466585494 licenseType: Pro DefaultImporter: userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
<?php class OutcomesResponse { /** * @var SimpleXMLElement */ protected $response; /** * @var string */ protected $codeMajor; /** * @var string */ protected $description; /** * @var string */ protected $messageRef; /** * @var string */ protected $messageType; /** * @param string $codemajor * @param string $description * @param string $messageref * @param string $messagetype */ public function __construct($codemajor, $description, $messageref, $messagetype) { $this->codeMajor = $codemajor; $this->description = $description; $this->messageRef = $messageref; $this->messageType = $messagetype; $this->response = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><imsx_POXEnvelopeResponse />'); $this->buildbasic(); $this->setStatusInfo(); $this->setBody(); } protected function buildbasic() { $this->response->addAttribute('xmlns', 'http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0'); } /** * * @return SimpleXMLElement */ protected function getHeaderInfo() { $header_info = $this->response->addChild('imsx_POXHeader')->addChild('imsx_POXResponseHeaderInfo'); $header_info->addChild('imsx_version', 'V1.0'); $header_info->addChild('imsx_messageIdentifier', (string) mt_rand()); return $header_info; } protected function setStatusInfo() { $header = $this->getHeaderInfo(); $status_info = $header->addChild('imsx_statusInfo'); $status_info->addchild('imsx_codeMajor', $this->codeMajor); $status_info->addChild('imsx_severity', 'status'); $status_info->addChild('imsx_description', $this->description); $status_info->addChild('imsx_messageRefIdentifier', $this->messageRef); } protected function setBody() { $this->response->addChild('imsx_POXBody') ->addChild($this->messageType); } /** * @return SimpleXMLElement */ public function getResponse() { return $this->response; } }
{ "pile_set_name": "Github" }