text
stringlengths
2
99k
meta
dict
<?xml version='1.0' encoding='utf-8'?> <section xmlns="https://code.dccouncil.us/schemas/dc-library" xmlns:codified="https://code.dccouncil.us/schemas/codified" xmlns:codify="https://code.dccouncil.us/schemas/codify" xmlns:xi="http://www.w3.org/2001/XInclude" containing-doc="D.C. Code"> <num>11-744</num> <heading>Judicial conference.</heading> <text>The chief judge of the District of Columbia Court of Appeals shall summon biennially or annually the active associate judges of the District of Columbia Court of Appeals and the active judges and magistrate judges of the Superior Court of the District of Columbia to a conference at a time and place that the chief judge designates, for the purpose of advising as to means of improving the administration of justice within the District of Columbia. The chief judge shall preside at such conference which shall be known as the Judicial Conference of the District of Columbia. Every judge and magistrate judge summoned shall attend, and, unless excused by the chief judge of the District of Columbia Court of Appeals, shall remain throughout the conference. The District of Columbia Court of Appeals shall provide by its rules for representation of and active participation by members of the District of Columbia Bar and other persons active in the legal profession at such conference.</text> <annotations> <annotation doc="Pub. L. 94-193" type="History">Dec. 31, 1975, 89 Stat. 1102, Pub. L. 94-193, ยง 1(a)</annotation> <annotation doc="Pub. L. 103-266" type="History">June 13, 1994, Pub. L. 103-266, ยง 1(b)(8), 108 Stat. 713</annotation> <annotation doc="Pub. L. 112-229" type="History">Dec. 12, 2012, 126 Stat. 1611, Pub. L. 112-229, ยง 2(a)</annotation> <annotation type="Effect of Amendments">The 2012 amendment by Pub. L. 112-229, in the first sentence, substituted โ€œbiennially or annuallyโ€ for โ€œannuallyโ€ and added โ€œand magistrate judgesโ€; and in the third sentence, substituted โ€œCourt of Appealsโ€ for โ€œCourts of Appealsโ€ and added โ€œand magistrate judgeโ€.</annotation> <annotation type="Prior Codifications">1973 Ed., ยงโ€‚11-744.</annotation> <annotation type="Prior Codifications">1981 Ed., ยงโ€‚11-744.</annotation> <annotation type="Cross References">Superior Court, family division, exclusive jurisdiction, see <cite path="ยง11-1101">ยง 11-1101</cite>.</annotation> <annotation type="Cross References">Court administration, chief judges, responsibilities, see <cite path="ยง11-1702">ยง 11-1702</cite>.</annotation> </annotations> </section>
{ "pile_set_name": "Github" }
package com.hzl.libyuvdemo.listener; /** * ไฝœ่€…๏ผš่ฏทๅซๆˆ‘็™พ็ฑณๅ†ฒๅˆบ on 2017/11/7 ไธŠๅˆ10:38 * ้‚ฎ็ฎฑ๏ผšmail@hezhilin.cc */ public interface CameraSurfaceListener { void startAutoFocus(float x, float y); void openCamera(); void releaseCamera(); int changeCamera(); }
{ "pile_set_name": "Github" }
๏ปฟ@{ ViewData["Title"] = "About"; } <div class="alert alert-info">Views/About/Index.cshtml</div>
{ "pile_set_name": "Github" }
#!/bin/sh [ -e /etc/config/ubootenv ] && exit 0 touch /etc/config/ubootenv . /lib/uboot-envtools.sh . /lib/functions.sh board=$(board_name) case "$board" in ocedo,panda) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x20000" "0x20000" ;; esac config_load ubootenv config_foreach ubootenv_add_app_config ubootenv exit 0
{ "pile_set_name": "Github" }
/* * Copyright (c) 2012, Codename One and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Codename One designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Codename One through http://www.codenameone.com/ if you * need additional information or have any questions. */ package com.codename1.media; import com.codename1.ui.events.ActionListener; import com.codename1.ui.util.EventDispatcher; import com.codename1.util.SuccessCallback; /** * An abstract base class for AsyncMedia. Most media returned from {@link MediaManager} will * be descendants of this class. * @author shannah * @since 7.0 */ public abstract class AbstractMedia implements AsyncMedia { private final EventDispatcher stateChangeListeners = new EventDispatcher(); private final EventDispatcher errorListeners = new EventDispatcher(); /** * Currently pending play request */ private PlayRequest pendingPlayRequest; /** * Currently pending pause request. */ private PauseRequest pendingPauseRequest; /** * {@inheritDoc } * */ @Override public State getState() { if (isPlaying()) { return State.Playing; } else { return State.Paused; } } /** * Fires a media state change event to the registered state change listeners. * @param newState The new state * @return The state change event. */ protected MediaStateChangeEvent fireMediaStateChange(State newState) { MediaStateChangeEvent evt = new MediaStateChangeEvent(this, getState(), newState); if (stateChangeListeners.hasListeners()) { stateChangeListeners.fireActionEvent(evt); } return evt; } /** * {@inheritDoc } * */ @Override public void addMediaStateChangeListener(ActionListener<MediaStateChangeEvent> l) { stateChangeListeners.addListener(l); } /** * {@inheritDoc } * */ @Override public void removeMediaStateChangeListener(ActionListener<MediaStateChangeEvent> l) { stateChangeListeners.removeListener(l); } /** * Fires a media error event to registered listeners. * @param ex The MediaException to deliver * @return The MediaErrorEvent object sent to listeners. * @see #addMediaErrorListener(com.codename1.ui.events.ActionListener) * @see #removeMediaErrorListener(com.codename1.ui.events.ActionListener) */ protected MediaErrorEvent fireMediaError(MediaException ex) { MediaErrorEvent evt = new MediaErrorEvent(this, ex); if (errorListeners.hasListeners()) { errorListeners.fireActionEvent(evt); } return evt; } /** * {@inheritDoc } * */ @Override public void addMediaErrorListener(ActionListener<MediaErrorEvent> l) { errorListeners.addListener(l); } /** * {@inheritDoc } * */ @Override public void removeMediaErrorListener(ActionListener<MediaErrorEvent> l) { errorListeners.removeListener(l); } /** * {@inheritDoc } * */ @Override public void addMediaCompletionHandler(Runnable onComplete) { MediaManager.addCompletionHandler(this, onComplete); } /** * {@inheritDoc } * */ @Override public PlayRequest playAsync() { return playAsync(new PlayRequest() { @Override public void complete(AsyncMedia value) { if (this == pendingPlayRequest) { pendingPlayRequest = null; } super.complete(value); } @Override public void error(Throwable t) { if (this == pendingPlayRequest) { pendingPlayRequest = null; } super.error(t); } }); } private PlayRequest playAsync(final PlayRequest out) { if (out.isDone()) { return out; } if (pendingPauseRequest != null) { pendingPauseRequest.ready(new SuccessCallback<AsyncMedia>() { @Override public void onSucess(AsyncMedia value) { if (!out.isDone()) { playAsync(out); } } }).except(new SuccessCallback<Throwable>() { @Override public void onSucess(Throwable value) { if (!out.isDone()) { playAsync(out); } } }); pendingPauseRequest = null; pendingPlayRequest = out; return out; } if (pendingPlayRequest != null && pendingPlayRequest != out) { pendingPlayRequest.ready(new SuccessCallback<AsyncMedia>() { @Override public void onSucess(AsyncMedia value) { if (!out.isDone()) { out.complete(value); } } }).except(new SuccessCallback<Throwable>() { @Override public void onSucess(Throwable value) { if (!out.isDone()) { out.error(value); } } }); return out; } else { pendingPlayRequest = out; } if (getState() == State.Playing) { out.complete(this); return out; } class StateChangeListener implements ActionListener<MediaStateChangeEvent> { ActionListener<MediaErrorEvent> onError; @Override public void actionPerformed(MediaStateChangeEvent evt) { if (!out.isDone()) { if (evt.getNewState() == State.Playing) { stateChangeListeners.removeListener(this); if (onError != null) { errorListeners.removeListener(onError); } out.complete(AbstractMedia.this); } } } }; final StateChangeListener onStateChange = new StateChangeListener(); ActionListener<MediaErrorEvent> onError = new ActionListener<MediaErrorEvent>() { @Override public void actionPerformed(MediaErrorEvent evt) { stateChangeListeners.removeListener(onStateChange); errorListeners.removeListener(this); if (!out.isDone()) { out.error(evt.getMediaException()); } } }; onStateChange.onError = onError; stateChangeListeners.addListener(onStateChange); errorListeners.addListener(onError); playImpl(); return out; } /** * {@inheritDoc } * */ @Override public PauseRequest pauseAsync() { return pauseAsync(new PauseRequest() { @Override public void complete(AsyncMedia value) { if (pendingPauseRequest == this) { pendingPauseRequest = null; } super.complete(value); } @Override public void error(Throwable t) { if (pendingPauseRequest == this) { pendingPauseRequest = null; } super.error(t); } }); } private PauseRequest pauseAsync(final PauseRequest out) { if (out.isDone()) { return out; } if (pendingPlayRequest != null) { pendingPlayRequest.ready(new SuccessCallback<AsyncMedia>() { @Override public void onSucess(AsyncMedia value) { if (!out.isDone()) { pauseAsync(out); } } }).except(new SuccessCallback<Throwable>() { @Override public void onSucess(Throwable value) { if (!out.isDone()) { pauseAsync(out); } } }); pendingPlayRequest = null; pendingPauseRequest = out; return out; } if (pendingPauseRequest != null && pendingPauseRequest != out) { pendingPauseRequest.ready(new SuccessCallback<AsyncMedia>() { @Override public void onSucess(AsyncMedia value) { if (!out.isDone()) { out.complete(value); } } }).except(new SuccessCallback<Throwable>() { @Override public void onSucess(Throwable value) { if (!out.isDone()) { out.error(value); } } }); return out; } else { pendingPauseRequest = out; } if (getState() == State.Paused) { out.complete(this); return out; } class StateChangeListener implements ActionListener<MediaStateChangeEvent> { ActionListener<MediaErrorEvent> onError; @Override public void actionPerformed(MediaStateChangeEvent evt) { if (!out.isDone()) { if (evt.getNewState() == State.Paused) { stateChangeListeners.removeListener(this); if (onError != null) { errorListeners.removeListener(onError); } out.complete(AbstractMedia.this); } } } }; final StateChangeListener onStateChange = new StateChangeListener(); ActionListener<MediaErrorEvent> onError = new ActionListener<MediaErrorEvent>() { @Override public void actionPerformed(MediaErrorEvent evt) { stateChangeListeners.removeListener(onStateChange); errorListeners.removeListener(this); if (!out.isDone()) { out.error(evt.getMediaException()); } } }; onStateChange.onError = onError; stateChangeListeners.addListener(onStateChange); errorListeners.addListener(onError); pauseImpl(); return out; } /** * Initiates a play request on the media. */ protected abstract void playImpl(); /** * Initiates a pause request on the media. */ protected abstract void pauseImpl(); /** * {@inheritDoc } */ @Override public final void play() { playAsync(); } /** * {@inheritDoc } */ @Override public final void pause() { pauseAsync(); } }
{ "pile_set_name": "Github" }
# PhotoShow and Docker To have PhotoShow running with Docker it's necessary to: * Build the PhotoShow image which will be used to run a container * Create a container based on image built More details about [Docker command line](https://docs.docker.com/engine/reference/commandline/cli/) ## Build Build PhotoShow image with the following command: ```bash sudo docker build -t photoshow . ``` ## Create and run a dedicated PhotoShow container When PhotoShow image has been built, the following command allows to create and run a dedicated PhotoShow container named `photoshow_1`: ```bash sudo docker run --name photoshow_1 -p 8080:80 -d -i -t photoshow ``` PhotoShow is now available on: http://localhost:8080 ### Stop container Previous PhotoShow container can be stopped with: ```bash docker stop photoshow_1 ``` ### Remove container Previous PhotoShow container can be removed with: ```bash docker rm photoshow_1 ``` ## Run container with host directory mapping It's also possible to run the container with a host directory mapping of `/opt/PhotoShow` container directory. This allows to store photos and PhotoShow data outside docker. Host directory path example: `/home/data/photoshow`. The host directory must have the two following sub directories: * `Photos` * Where photos will be read by Photoshow. * Folder and sub folders must have read permission set for everyone.<br/> Example: `sudo chmod -R +r /home/data/photoshow/Photos`. * `generated` * Where Photoshow will store its internal data. * Folder and sub folders must be owned by UID `33` which is user: `www-data` in container and owner permissions set to: `rwx`.<br/> Example: ```bash sudo chown -R 33 /home/data/photoshow/generated sudo chmod -R u+rwx /home/data/photoshow/generated ``` Once host directory is configured run: ```bash sudo docker run --name photoshow_2 -v "/home/data/photoshow:/opt/PhotoShow" -p 8080:80 -d -i -t photoshow ``` ## Logs If you want access to logs, a volume can be map to container directory: `/var/log`
{ "pile_set_name": "Github" }
๏ปฟusing DotVVM.Framework.ViewModel; namespace DotVVM.Samples.BasicSamples.ViewModels.FeatureSamples.PostBack { public class SuppressPostBackHandlerViewModel : DotvvmViewModelBase { public bool Condition { get; set; } = true; public int Counter { get; set; } public void ChangeCondition() { Condition = !Condition; } public void PostBack() { Counter++; } } }
{ "pile_set_name": "Github" }
<?php declare(strict_types=1); namespace PhpParser\Node\Expr; use PhpParser\Node\Expr; use PhpParser\Node\Name; class ConstFetch extends Expr { /** @var Name Constant name */ public $name; /** * Constructs a const fetch node. * * @param Name $name Constant name * @param array $attributes Additional attributes */ public function __construct(Name $name, array $attributes = []) { parent::__construct($attributes); $this->name = $name; } public function getSubNodeNames() : array { return ['name']; } public function getType() : string { return 'Expr_ConstFetch'; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>SchemeUserState</key> <dict> <key>NaughtyImageView.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>0</integer> </dict> </dict> </dict> </plist>
{ "pile_set_name": "Github" }
๏ปฟusing Caliburn.Micro; using Gemini.Modules.ToolBars.Models; namespace Gemini.Modules.ToolBars { public interface IToolBar : IObservableCollection<ToolBarItemBase> { } }
{ "pile_set_name": "Github" }
include_directories($ENV{VTUNE_AMPLIFIER_XE_2015_DIR}/include) add_library(vtune vtune.h vtune.cpp ../cpuEvents.h)
{ "pile_set_name": "Github" }
/* * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.runtime.core.internal.routing.forkjoin; import static org.mule.runtime.api.metadata.DataType.OBJECT; import org.mule.runtime.api.metadata.DataType; import org.mule.runtime.core.api.event.CoreEvent; import org.mule.runtime.core.internal.routing.ForkJoinStrategy; import java.util.List; import java.util.function.Function; /** * {@link ForkJoinStrategy} that: * <ul> * <li>Performs parallel execution of route pairs subject to {@code maxConcurrency}. * <li>Merges variables using a last-wins strategy. * <li>Waits for the completion of all routes, with an optional timeout. * <li>Emits the same the original input {@link CoreEvent} to the router. * <li>Will processor all routes, regardless of errors, and propagating a composite exception where there were one or more errors. * </ul> */ public class JoinOnlyForkJoinStrategyFactory extends AbstractForkJoinStrategyFactory { @Override protected Function<List<CoreEvent>, CoreEvent> createResultEvent(CoreEvent original, CoreEvent.Builder resultBuilder) { return list -> resultBuilder.build(); } @Override public DataType getResultDataType() { return OBJECT; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleDisplayName</key> <string>HBuilder Hello</string> <key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string> <key>CFBundleIcons</key> <dict> <key>CFBundlePrimaryIcon</key> <dict> <key>CFBundleIconFiles</key> <array> <string>icon80</string> <string>icon58</string> <string>icon29</string> <string>icon120</string> <string>icon114</string> <string>icon57</string> <string>icon87</string> <string>icon180</string> </array> </dict> </dict> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>${PRODUCT_NAME}</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>0.9.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string>tencentopenapi</string> <key>CFBundleURLSchemes</key> <array> <string>tencent1101318457</string> </array> </dict> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLName</key> <string>com.tencent</string> <key>CFBundleURLSchemes</key> <array> <string>wb801494298</string> </array> </dict> <dict> <key>CFBundleURLName</key> <string>alixpay</string> <key>CFBundleURLSchemes</key> <array> <string>alixpayhbilderhello</string> </array> </dict> <dict> <key>CFBundleURLName</key> <string>weixin</string> <key>CFBundleURLSchemes</key> <array> <string>wxbe7f03382358338d</string> </array> </dict> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLName</key> <string>com.weibo</string> <key>CFBundleURLSchemes</key> <array> <string>wb3721101999</string> </array> </dict> </array> <key>CFBundleVersion</key> <string>90</string> <key>LSRequiresIPhoneOS</key> <true/> <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> <key>NSLocationWhenInUseDescription</key> <string></string> <key>NSLocationWhenInUseUsageDescription</key> <string></string> <key>StatusBarBackground</key> <string>#FFFFFF</string> <key>UIBackgroundModes</key> <array> <string>remote-notification</string> </array> <key>UILaunchImages</key> <array> <dict> <key>UILaunchImageMinimumOSVersion</key> <string>8.0</string> <key>UILaunchImageName</key> <string>Default-Landscape-736h</string> <key>UILaunchImageOrientation</key> <string>Landscape</string> <key>UILaunchImageSize</key> <string>{414, 736}</string> </dict> <dict> <key>UILaunchImageMinimumOSVersion</key> <string>8.0</string> <key>UILaunchImageName</key> <string>Default-736h</string> <key>UILaunchImageOrientation</key> <string>Portrait</string> <key>UILaunchImageSize</key> <string>{414, 736}</string> </dict> <dict> <key>UILaunchImageMinimumOSVersion</key> <string>8.0</string> <key>UILaunchImageName</key> <string>Default-667h</string> <key>UILaunchImageOrientation</key> <string>Portrait</string> <key>UILaunchImageSize</key> <string>{375, 667}</string> </dict> <dict> <key>UILaunchImageMinimumOSVersion</key> <string>7.0</string> <key>UILaunchImageName</key> <string>Default</string> <key>UILaunchImageOrientation</key> <string>Portrait</string> <key>UILaunchImageSize</key> <string>{320, 480}</string> </dict> <dict> <key>UILaunchImageMinimumOSVersion</key> <string>7.0</string> <key>UILaunchImageName</key> <string>Default-568h</string> <key>UILaunchImageOrientation</key> <string>Portrait</string> <key>UILaunchImageSize</key> <string>{320, 568}</string> </dict> </array> <key>UIMainStoryboardFile</key> <string>Main_iPhone</string> <key>UIMainStoryboardFile~ipad</key> <string>Main_iPad</string> <key>UIStatusBarHidden</key> <false/> <key>UIStatusBarStyle</key> <string>UIStatusBarStyleDefault</string> <key>UIStatusBarTintParameters</key> <dict> <key>UINavigationBar</key> <dict> <key>Style</key> <string>UIBarStyleDefault</string> <key>Translucent</key> <false/> </dict> </dict> <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> </array> <key>UISupportedInterfaceOrientations~ipad</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> <key>amap</key> <dict> <key>appkey</key> <string>41c8f3ec724fc03639b804dd6d4d8917</string> </dict> <key>baidu</key> <dict> <key>appkey</key> <string>33sQNaF1czbLgyIgHGw9cpc1</string> </dict> <key>getui</key> <dict> <key>appid</key> <string>bBPiGM1VQ66mhMI3d9tG0A</string> <key>appkey</key> <string>uS09ESNrE46NQgnHmSYjL2</string> <key>appsecret</key> <string>nG809brIPr7aTF7o0VpZM1</string> </dict> <key>iFly</key> <dict> <key>appid</key> <string>533a8f35</string> </dict> <key>jpush</key> <dict> <key>APP_KEY</key> <string>9660e62478a510247c8711c</string> <key>APS_FOR_PRODUCTION</key> <string>0</string> <key>CHANNEL</key> <string>Public channel</string> </dict> <key>sinaweibo</key> <dict> <key>appSecret</key> <string>b8fa3ec4b7e47a152044d9e8265cf593</string> <key>appkey</key> <string>3662743235</string> <key>redirectURI</key> <string>http://www.dcloud.io/</string> </dict> <key>tencentweibo</key> <dict> <key>appSecret</key> <string>0b3ac9d885c09a1f45c0c08304291546</string> <key>appkey</key> <string>801494298</string> <key>redirectURI</key> <string>http://d.m3w.cn/helloh5p/</string> </dict> <key>umeng</key> <dict> <key>appkey</key> <string>51d6a5a856240b66f0005651</string> </dict> <key>weixinoauth</key> <dict> <key>appSecret</key> <string>3e4eaaefe9ab84cd9d2c1a14a5a2cc9d</string> <key>appid</key> <string>wxbe7f03382358338d</string> </dict> </dict> </plist>
{ "pile_set_name": "Github" }
// Empty config file to trick Styleguidist not to use the config file from ../.. // You don't need an empty config in your project.
{ "pile_set_name": "Github" }
# # Secret Labs' Regular Expression Engine # # convert re-style regular expression to sre pattern # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" # XXX: show string offset and offending character for all errors import sys from sre_constants import * try: from __pypy__ import newdict except ImportError: assert '__pypy__' not in sys.builtin_module_names newdict = lambda _ : {} SPECIAL_CHARS = ".\\[{()*+?^$|" REPEAT_CHARS = "*+?{" DIGITS = set("0123456789") OCTDIGITS = set("01234567") HEXDIGITS = set("0123456789abcdefABCDEF") WHITESPACE = set(" \t\n\r\v\f") ESCAPES = { r"\a": (LITERAL, ord("\a")), r"\b": (LITERAL, ord("\b")), r"\f": (LITERAL, ord("\f")), r"\n": (LITERAL, ord("\n")), r"\r": (LITERAL, ord("\r")), r"\t": (LITERAL, ord("\t")), r"\v": (LITERAL, ord("\v")), r"\\": (LITERAL, ord("\\")) } CATEGORIES = { r"\A": (AT, AT_BEGINNING_STRING), # start of string r"\b": (AT, AT_BOUNDARY), r"\B": (AT, AT_NON_BOUNDARY), r"\d": (IN, [(CATEGORY, CATEGORY_DIGIT)]), r"\D": (IN, [(CATEGORY, CATEGORY_NOT_DIGIT)]), r"\s": (IN, [(CATEGORY, CATEGORY_SPACE)]), r"\S": (IN, [(CATEGORY, CATEGORY_NOT_SPACE)]), r"\w": (IN, [(CATEGORY, CATEGORY_WORD)]), r"\W": (IN, [(CATEGORY, CATEGORY_NOT_WORD)]), r"\Z": (AT, AT_END_STRING), # end of string } FLAGS = { # standard flags "i": SRE_FLAG_IGNORECASE, "L": SRE_FLAG_LOCALE, "m": SRE_FLAG_MULTILINE, "s": SRE_FLAG_DOTALL, "x": SRE_FLAG_VERBOSE, # extensions "t": SRE_FLAG_TEMPLATE, "u": SRE_FLAG_UNICODE, } class Pattern: # master pattern object. keeps track of global attributes def __init__(self): self.flags = 0 self.open = [] self.groups = 1 self.groupdict = newdict("module") self.lookbehind = 0 def opengroup(self, name=None): gid = self.groups self.groups = gid + 1 if name is not None: ogid = self.groupdict.get(name, None) if ogid is not None: raise error, ("redefinition of group name %s as group %d; " "was group %d" % (repr(name), gid, ogid)) self.groupdict[name] = gid self.open.append(gid) return gid def closegroup(self, gid): self.open.remove(gid) def checkgroup(self, gid): return gid < self.groups and gid not in self.open class SubPattern: # a subpattern, in intermediate form def __init__(self, pattern, data=None): self.pattern = pattern if data is None: data = [] self.data = data self.width = None def dump(self, level=0): seqtypes = (tuple, list) for op, av in self.data: print level*" " + op, if op == IN: # member sublanguage print for op, a in av: print (level+1)*" " + op, a elif op == BRANCH: print for i, a in enumerate(av[1]): if i: print level*" " + "or" a.dump(level+1) elif op == GROUPREF_EXISTS: condgroup, item_yes, item_no = av print condgroup item_yes.dump(level+1) if item_no: print level*" " + "else" item_no.dump(level+1) elif isinstance(av, seqtypes): nl = 0 for a in av: if isinstance(a, SubPattern): if not nl: print a.dump(level+1) nl = 1 else: print a, nl = 0 if not nl: print else: print av def __repr__(self): return repr(self.data) def __len__(self): return len(self.data) def __delitem__(self, index): del self.data[index] def __getitem__(self, index): if isinstance(index, slice): return SubPattern(self.pattern, self.data[index]) return self.data[index] def __setitem__(self, index, code): self.data[index] = code def insert(self, index, code): self.data.insert(index, code) def append(self, code): self.data.append(code) def getwidth(self): # determine the width (min, max) for this subpattern if self.width: return self.width lo = hi = 0 UNITCODES = (ANY, RANGE, IN, LITERAL, NOT_LITERAL, CATEGORY) REPEATCODES = (MIN_REPEAT, MAX_REPEAT) for op, av in self.data: if op is BRANCH: i = MAXREPEAT - 1 j = 0 for av in av[1]: l, h = av.getwidth() i = min(i, l) j = max(j, h) lo = lo + i hi = hi + j elif op is CALL: i, j = av.getwidth() lo = lo + i hi = hi + j elif op is SUBPATTERN: i, j = av[1].getwidth() lo = lo + i hi = hi + j elif op in REPEATCODES: i, j = av[2].getwidth() lo = lo + i * av[0] hi = hi + j * av[1] elif op in UNITCODES: lo = lo + 1 hi = hi + 1 elif op == SUCCESS: break self.width = min(lo, MAXREPEAT - 1), min(hi, MAXREPEAT) return self.width class Tokenizer: def __init__(self, string): self.string = string self.index = 0 self.__next() def __next(self): if self.index >= len(self.string): self.next = None return char = self.string[self.index] if char[0] == "\\": try: c = self.string[self.index + 1] except IndexError: raise error, "bogus escape (end of line)" char = char + c self.index = self.index + len(char) self.next = char def match(self, char, skip=1): if char == self.next: if skip: self.__next() return 1 return 0 def get(self): this = self.next self.__next() return this def tell(self): return self.index, self.next def seek(self, index): self.index, self.next = index def isident(char): return "a" <= char <= "z" or "A" <= char <= "Z" or char == "_" def isdigit(char): return "0" <= char <= "9" def isname(name): # check that group name is a valid string if not isident(name[0]): return False for char in name[1:]: if not isident(char) and not isdigit(char): return False return True def _class_escape(source, escape): # handle escape code inside character class code = ESCAPES.get(escape) if code: return code code = CATEGORIES.get(escape) if code and code[0] == IN: return code try: c = escape[1:2] if c == "x": # hexadecimal escape (exactly two digits) while source.next in HEXDIGITS and len(escape) < 4: escape = escape + source.get() escape = escape[2:] if len(escape) != 2: raise error, "bogus escape: %s" % repr("\\" + escape) return LITERAL, int(escape, 16) & 0xff elif c in OCTDIGITS: # octal escape (up to three digits) while source.next in OCTDIGITS and len(escape) < 4: escape = escape + source.get() escape = escape[1:] return LITERAL, int(escape, 8) & 0xff elif c in DIGITS: raise error, "bogus escape: %s" % repr(escape) if len(escape) == 2: return LITERAL, ord(escape[1]) except ValueError: pass raise error, "bogus escape: %s" % repr(escape) def _escape(source, escape, state): # handle escape code in expression code = CATEGORIES.get(escape) if code: return code code = ESCAPES.get(escape) if code: return code try: c = escape[1:2] if c == "x": # hexadecimal escape while source.next in HEXDIGITS and len(escape) < 4: escape = escape + source.get() if len(escape) != 4: raise ValueError return LITERAL, int(escape[2:], 16) & 0xff elif c == "0": # octal escape while source.next in OCTDIGITS and len(escape) < 4: escape = escape + source.get() return LITERAL, int(escape[1:], 8) & 0xff elif c in DIGITS: # octal escape *or* decimal group reference (sigh) if source.next in DIGITS: escape = escape + source.get() if (escape[1] in OCTDIGITS and escape[2] in OCTDIGITS and source.next in OCTDIGITS): # got three octal digits; this is an octal escape escape = escape + source.get() return LITERAL, int(escape[1:], 8) & 0xff # not an octal escape, so this is a group reference group = int(escape[1:]) if group < state.groups: if not state.checkgroup(group): raise error, "cannot refer to open group" if state.lookbehind: import warnings warnings.warn('group references in lookbehind ' 'assertions are not supported', RuntimeWarning) return GROUPREF, group raise ValueError if len(escape) == 2: return LITERAL, ord(escape[1]) except ValueError: pass raise error, "bogus escape: %s" % repr(escape) def _parse_sub(source, state, nested=1): # parse an alternation: a|b|c items = [] itemsappend = items.append sourcematch = source.match while 1: itemsappend(_parse(source, state)) if sourcematch("|"): continue if not nested: break if not source.next or sourcematch(")", 0): break else: raise error, "pattern not properly closed" if len(items) == 1: return items[0] subpattern = SubPattern(state) subpatternappend = subpattern.append # check if all items share a common prefix while 1: prefix = None for item in items: if not item: break if prefix is None: prefix = item[0] elif item[0] != prefix: break else: # all subitems start with a common "prefix". # move it out of the branch for item in items: del item[0] subpatternappend(prefix) continue # check next one break # check if the branch can be replaced by a character set for item in items: if len(item) != 1 or item[0][0] != LITERAL: break else: # we can store this as a character set instead of a # branch (the compiler may optimize this even more) set = [] setappend = set.append for item in items: setappend(item[0]) subpatternappend((IN, set)) return subpattern subpattern.append((BRANCH, (None, items))) return subpattern def _parse_sub_cond(source, state, condgroup): item_yes = _parse(source, state) if source.match("|"): item_no = _parse(source, state) if source.match("|"): raise error, "conditional backref with more than two branches" else: item_no = None if source.next and not source.match(")", 0): raise error, "pattern not properly closed" subpattern = SubPattern(state) subpattern.append((GROUPREF_EXISTS, (condgroup, item_yes, item_no))) return subpattern _PATTERNENDERS = set("|)") _ASSERTCHARS = set("=!<") _LOOKBEHINDASSERTCHARS = set("=!") _REPEATCODES = set([MIN_REPEAT, MAX_REPEAT]) def _parse(source, state): # parse a simple pattern subpattern = SubPattern(state) # precompute constants into local variables subpatternappend = subpattern.append sourceget = source.get sourcematch = source.match _len = len PATTERNENDERS = _PATTERNENDERS ASSERTCHARS = _ASSERTCHARS LOOKBEHINDASSERTCHARS = _LOOKBEHINDASSERTCHARS REPEATCODES = _REPEATCODES while 1: if source.next in PATTERNENDERS: break # end of subpattern this = sourceget() if this is None: break # end of pattern if state.flags & SRE_FLAG_VERBOSE: # skip whitespace and comments if this in WHITESPACE: continue if this == "#": while 1: this = sourceget() if this in (None, "\n"): break continue if this and this[0] not in SPECIAL_CHARS: subpatternappend((LITERAL, ord(this))) elif this == "[": # character set set = [] setappend = set.append ## if sourcematch(":"): ## pass # handle character classes if sourcematch("^"): setappend((NEGATE, None)) # check remaining characters start = set[:] while 1: this = sourceget() if this == "]" and set != start: break elif this and this[0] == "\\": code1 = _class_escape(source, this) elif this: code1 = LITERAL, ord(this) else: raise error, "unexpected end of regular expression" if sourcematch("-"): # potential range this = sourceget() if this == "]": if code1[0] is IN: code1 = code1[1][0] setappend(code1) setappend((LITERAL, ord("-"))) break elif this: if this[0] == "\\": code2 = _class_escape(source, this) else: code2 = LITERAL, ord(this) if code1[0] != LITERAL or code2[0] != LITERAL: raise error, "bad character range" lo = code1[1] hi = code2[1] if hi < lo: raise error, "bad character range" setappend((RANGE, (lo, hi))) else: raise error, "unexpected end of regular expression" else: if code1[0] is IN: code1 = code1[1][0] setappend(code1) # XXX: <fl> should move set optimization to compiler! if _len(set)==1 and set[0][0] is LITERAL: subpatternappend(set[0]) # optimization elif _len(set)==2 and set[0][0] is NEGATE and set[1][0] is LITERAL: subpatternappend((NOT_LITERAL, set[1][1])) # optimization else: # XXX: <fl> should add charmap optimization here subpatternappend((IN, set)) elif this and this[0] in REPEAT_CHARS: # repeat previous item if this == "?": min, max = 0, 1 elif this == "*": min, max = 0, MAXREPEAT elif this == "+": min, max = 1, MAXREPEAT elif this == "{": if source.next == "}": subpatternappend((LITERAL, ord(this))) continue here = source.tell() min, max = 0, MAXREPEAT lo = hi = "" while source.next in DIGITS: lo = lo + source.get() if sourcematch(","): while source.next in DIGITS: hi = hi + sourceget() else: hi = lo if not sourcematch("}"): subpatternappend((LITERAL, ord(this))) source.seek(here) continue if lo: min = int(lo) if min >= MAXREPEAT: raise OverflowError("the repetition number is too large") if hi: max = int(hi) if max >= MAXREPEAT: raise OverflowError("the repetition number is too large") if max < min: raise error("bad repeat interval") else: raise error, "not supported" # figure out which item to repeat if subpattern: item = subpattern[-1:] else: item = None if not item or (_len(item) == 1 and item[0][0] == AT): raise error, "nothing to repeat" if item[0][0] in REPEATCODES: raise error, "multiple repeat" if sourcematch("?"): subpattern[-1] = (MIN_REPEAT, (min, max, item)) else: subpattern[-1] = (MAX_REPEAT, (min, max, item)) elif this == ".": subpatternappend((ANY, None)) elif this == "(": group = 1 name = None condgroup = None if sourcematch("?"): group = 0 # options if sourcematch("P"): # python extensions if sourcematch("<"): # named group: skip forward to end of name name = "" while 1: char = sourceget() if char is None: raise error, "unterminated name" if char == ">": break name = name + char group = 1 if not name: raise error("missing group name") if not isname(name): raise error("bad character in group name %r" % name) elif sourcematch("="): # named backreference name = "" while 1: char = sourceget() if char is None: raise error, "unterminated name" if char == ")": break name = name + char if not name: raise error("missing group name") if not isname(name): raise error("bad character in backref group name " "%r" % name) gid = state.groupdict.get(name) if gid is None: msg = "unknown group name: {0!r}".format(name) raise error(msg) if state.lookbehind: import warnings warnings.warn('group references in lookbehind ' 'assertions are not supported', RuntimeWarning) subpatternappend((GROUPREF, gid)) continue else: char = sourceget() if char is None: raise error, "unexpected end of pattern" raise error, "unknown specifier: ?P%s" % char elif sourcematch(":"): # non-capturing group group = 2 elif sourcematch("#"): # comment while 1: if source.next is None or source.next == ")": break sourceget() if not sourcematch(")"): raise error, "unbalanced parenthesis" continue elif source.next in ASSERTCHARS: # lookahead assertions char = sourceget() dir = 1 if char == "<": if source.next not in LOOKBEHINDASSERTCHARS: raise error, "syntax error" dir = -1 # lookbehind char = sourceget() state.lookbehind += 1 p = _parse_sub(source, state) if dir < 0: state.lookbehind -= 1 if not sourcematch(")"): raise error, "unbalanced parenthesis" if char == "=": subpatternappend((ASSERT, (dir, p))) else: subpatternappend((ASSERT_NOT, (dir, p))) continue elif sourcematch("("): # conditional backreference group condname = "" while 1: char = sourceget() if char is None: raise error, "unterminated name" if char == ")": break condname = condname + char group = 2 if not condname: raise error("missing group name") if isname(condname): condgroup = state.groupdict.get(condname) if condgroup is None: msg = "unknown group name: {0!r}".format(condname) raise error(msg) else: try: condgroup = int(condname) except ValueError: raise error, "bad character in group name" if state.lookbehind: import warnings warnings.warn('group references in lookbehind ' 'assertions are not supported', RuntimeWarning) else: # flags if not source.next in FLAGS: raise error, "unexpected end of pattern" while source.next in FLAGS: state.flags = state.flags | FLAGS[sourceget()] if group: # parse group contents if group == 2: # anonymous group group = None else: group = state.opengroup(name) if condgroup: p = _parse_sub_cond(source, state, condgroup) else: p = _parse_sub(source, state) if not sourcematch(")"): raise error, "unbalanced parenthesis" if group is not None: state.closegroup(group) subpatternappend((SUBPATTERN, (group, p))) else: while 1: char = sourceget() if char is None: raise error, "unexpected end of pattern" if char == ")": break raise error, "unknown extension" elif this == "^": subpatternappend((AT, AT_BEGINNING)) elif this == "$": subpattern.append((AT, AT_END)) elif this and this[0] == "\\": code = _escape(source, this, state) subpatternappend(code) else: raise error, "parser error" return subpattern def parse(str, flags=0, pattern=None): # parse 're' pattern into list of (opcode, argument) tuples source = Tokenizer(str) if pattern is None: pattern = Pattern() pattern.flags = flags pattern.str = str p = _parse_sub(source, pattern, 0) tail = source.get() if tail == ")": raise error, "unbalanced parenthesis" elif tail: raise error, "bogus characters at end of regular expression" if not (flags & SRE_FLAG_VERBOSE) and p.pattern.flags & SRE_FLAG_VERBOSE: # the VERBOSE flag was switched on inside the pattern. to be # on the safe side, we'll parse the whole thing again... return parse(str, p.pattern.flags) if flags & SRE_FLAG_DEBUG: p.dump() return p def parse_template(source, pattern): # parse 're' replacement string into list of literals and # group references s = Tokenizer(source) sget = s.get p = [] a = p.append def literal(literal, p=p, pappend=a): if p and p[-1][0] is LITERAL: p[-1] = LITERAL, p[-1][1] + literal else: pappend((LITERAL, literal)) sep = source[:0] if type(sep) is type(""): makechar = chr else: makechar = unichr while 1: this = sget() if this is None: break # end of replacement string if this and this[0] == "\\": # group c = this[1:2] if c == "g": name = "" if s.match("<"): while 1: char = sget() if char is None: raise error, "unterminated group name" if char == ">": break name = name + char if not name: raise error, "missing group name" try: index = int(name) if index < 0: raise error, "negative group number" except ValueError: if not isname(name): raise error, "bad character in group name" try: index = pattern.groupindex[name] except KeyError: msg = "unknown group name: {0!r}".format(name) raise IndexError(msg) a((MARK, index)) elif c == "0": if s.next in OCTDIGITS: this = this + sget() if s.next in OCTDIGITS: this = this + sget() literal(makechar(int(this[1:], 8) & 0xff)) elif c in DIGITS: isoctal = False if s.next in DIGITS: this = this + sget() if (c in OCTDIGITS and this[2] in OCTDIGITS and s.next in OCTDIGITS): this = this + sget() isoctal = True literal(makechar(int(this[1:], 8) & 0xff)) if not isoctal: a((MARK, int(this[1:]))) else: try: this = makechar(ESCAPES[this][1]) except KeyError: pass literal(this) else: literal(this) # convert template to groups and literals lists i = 0 groups = [] groupsappend = groups.append literals = [None] * len(p) for c, s in p: if c is MARK: groupsappend((i, s)) # literal[i] is already None else: literals[i] = s i = i + 1 return groups, literals def expand_template(template, match): g = match.group sep = match.string[:0] groups, literals = template literals = literals[:] try: for index, group in groups: literals[index] = s = g(group) if s is None: raise error, "unmatched group" except IndexError: raise error, "invalid group reference" return sep.join(literals)
{ "pile_set_name": "Github" }
/* * @test /nodynamiccopyright/ * @bug 6247324 * @compile/fail/ref=T6247324.out -XDrawDiagnostics -Xlint -Xlint:-path T6247324.java */ class Pair<X,Y> { private X x; private Y y; public Pair(X x, Y y){ this.x = x; this.y = y; } public X getX(){ return x; } @Seetharam // Undefined annotation... public Y getY(){ return y; } } public class T6247324{ public void myMethod(){ Pair<Integer, String> pair = new Pair<Integer, String>(0, "I am not sure"); int intValue = pair.getX(); String strValue = pair.getY(); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>application-identifier</key> <string>VQXC654T2W.com.imperiumlabs.geofirestore</string> <key>keychain-access-groups</key> <array> <string>VQXC654T2W.com.imperiumlabs.geofirestore</string> </array> </dict> </plist>
{ "pile_set_name": "Github" }
// // UIViewController+CYLTabBarControllerExtention.m // CYLTabBarController // // v1.16.0 Created by ๅพฎๅš@iOS็จ‹ๅบ็Šญ่ข ( http://weibo.com/luohanchenyilong/ ) on 16/2/26. // Copyright ยฉ 2016ๅนด https://github.com/ChenYilong .All rights reserved. // #import "UIViewController+CYLTabBarControllerExtention.h" #import "CYLTabBarController.h" #import <objc/runtime.h> @implementation UIViewController (CYLTabBarControllerExtention) #pragma mark - #pragma mark - public Methods - (UIViewController *)cyl_popSelectTabBarChildViewControllerAtIndex:(NSUInteger)index { UIViewController *viewController = [self cyl_getViewControllerInsteadOfNavigationController]; [viewController checkTabBarChildControllerValidityAtIndex:index]; [viewController.navigationController popToRootViewControllerAnimated:NO]; CYLTabBarController *tabBarController = [viewController cyl_tabBarController]; tabBarController.selectedIndex = index; UIViewController *selectedTabBarChildViewController = tabBarController.selectedViewController; return [selectedTabBarChildViewController cyl_getViewControllerInsteadOfNavigationController]; } - (void)cyl_popSelectTabBarChildViewControllerAtIndex:(NSUInteger)index completion:(CYLPopSelectTabBarChildViewControllerCompletion)completion { UIViewController *selectedTabBarChildViewController = [self cyl_popSelectTabBarChildViewControllerAtIndex:index]; dispatch_async(dispatch_get_main_queue(), ^{ !completion ?: completion(selectedTabBarChildViewController); }); } - (UIViewController *)cyl_popSelectTabBarChildViewControllerForClassType:(Class)classType { CYLTabBarController *tabBarController = [[self cyl_getViewControllerInsteadOfNavigationController] cyl_tabBarController]; NSArray *viewControllers = tabBarController.viewControllers; NSInteger atIndex = [self cyl_indexForClassType:classType inViewControllers:viewControllers]; return [self cyl_popSelectTabBarChildViewControllerAtIndex:atIndex]; } - (void)cyl_popSelectTabBarChildViewControllerForClassType:(Class)classType completion:(CYLPopSelectTabBarChildViewControllerCompletion)completion { UIViewController *selectedTabBarChildViewController = [self cyl_popSelectTabBarChildViewControllerForClassType:classType]; dispatch_async(dispatch_get_main_queue(), ^{ !completion ?: completion(selectedTabBarChildViewController); }); } - (void)cyl_pushOrPopToViewController:(UIViewController *)viewController animated:(BOOL)animated callback:(CYLPushOrPopCallback)callback { if (!callback) { [self.navigationController pushViewController:viewController animated:animated]; return; } void (^popSelectTabBarChildViewControllerCallback)(BOOL shouldPopSelectTabBarChildViewController, NSUInteger index) = ^(BOOL shouldPopSelectTabBarChildViewController, NSUInteger index) { if (shouldPopSelectTabBarChildViewController) { [self cyl_popSelectTabBarChildViewControllerAtIndex:index completion:^(__kindof UIViewController *selectedTabBarChildViewController) { [selectedTabBarChildViewController.navigationController pushViewController:viewController animated:animated]; }]; } else { [self.navigationController pushViewController:viewController animated:animated]; } }; NSArray<__kindof UIViewController *> *otherSameClassTypeViewControllersInCurrentNavigationControllerStack = [self cyl_getOtherSameClassTypeViewControllersInCurrentNavigationControllerStack:viewController]; CYLPushOrPopCompletionHandler completionHandler = ^(BOOL shouldPop, __kindof UIViewController *viewControllerPopTo, BOOL shouldPopSelectTabBarChildViewController, NSUInteger index ) { if (!otherSameClassTypeViewControllersInCurrentNavigationControllerStack || otherSameClassTypeViewControllersInCurrentNavigationControllerStack.count == 0) { shouldPop = NO; } dispatch_async(dispatch_get_main_queue(),^{ if (shouldPop) { [self.navigationController popToViewController:viewControllerPopTo animated:animated]; return; } popSelectTabBarChildViewControllerCallback(shouldPopSelectTabBarChildViewController, index); }); }; callback(otherSameClassTypeViewControllersInCurrentNavigationControllerStack, completionHandler); } - (void)cyl_pushViewController:(UIViewController *)viewController animated:(BOOL)animated { UIViewController *fromViewController = [self cyl_getViewControllerInsteadOfNavigationController]; NSArray *childViewControllers = fromViewController.navigationController.childViewControllers; if (childViewControllers.count > 0) { if ([[childViewControllers lastObject] isKindOfClass:[viewController class]]) { return; } } [fromViewController.navigationController pushViewController:viewController animated:animated]; } - (UIViewController *)cyl_getViewControllerInsteadOfNavigationController { BOOL isNavigationController = [[self class] isSubclassOfClass:[UINavigationController class]]; if (isNavigationController && ((UINavigationController *)self).viewControllers.count > 0) { return ((UINavigationController *)self).viewControllers[0]; } return self; } #pragma mark - public method - (BOOL)cyl_isPlusChildViewController { if (!CYLPlusChildViewController) { return NO; } return (self == CYLPlusChildViewController); } - (void)cyl_showTabBadgePoint { if (self.cyl_isPlusChildViewController) { return; } [self.cyl_tabButton cyl_showTabBadgePoint]; [[[self cyl_getViewControllerInsteadOfNavigationController] cyl_tabBarController].tabBar layoutIfNeeded]; } - (void)cyl_removeTabBadgePoint { if (self.cyl_isPlusChildViewController) { return; } [self.cyl_tabButton cyl_removeTabBadgePoint]; [[[self cyl_getViewControllerInsteadOfNavigationController] cyl_tabBarController].tabBar layoutIfNeeded]; } - (BOOL)cyl_isShowTabBadgePoint { if (self.cyl_isPlusChildViewController) { return NO; } return [self.cyl_tabButton cyl_isShowTabBadgePoint]; } - (void)cyl_setTabBadgePointView:(UIView *)tabBadgePointView { if (self.cyl_isPlusChildViewController) { return; } [self.cyl_tabButton cyl_setTabBadgePointView:tabBadgePointView]; } - (UIView *)cyl_tabBadgePointView { if (self.cyl_isPlusChildViewController) { return nil; } return [self.cyl_tabButton cyl_tabBadgePointView];; } - (void)cyl_setTabBadgePointViewOffset:(UIOffset)tabBadgePointViewOffset { if (self.cyl_isPlusChildViewController) { return; } return [self.cyl_tabButton cyl_setTabBadgePointViewOffset:tabBadgePointViewOffset]; } //offsetๅฆ‚ๆžœ้ƒฝๆ˜ฏๆ•ดๆ•ฐ๏ผŒๅˆ™ๅพ€ๅณไธ‹ๅ็งป - (UIOffset)cyl_tabBadgePointViewOffset { if (self.cyl_isPlusChildViewController) { return UIOffsetZero; } return [self.cyl_tabButton cyl_tabBadgePointViewOffset]; } - (BOOL)cyl_isEmbedInTabBarController { if (self.cyl_tabBarController == nil) { return NO; } if (self.cyl_isPlusChildViewController) { return NO; } BOOL isEmbedInTabBarController = NO; UIViewController *viewControllerInsteadIOfNavigationController = [self cyl_getViewControllerInsteadOfNavigationController]; for (NSInteger i = 0; i < self.cyl_tabBarController.viewControllers.count; i++) { UIViewController * vc = self.cyl_tabBarController.viewControllers[i]; if ([vc cyl_getViewControllerInsteadOfNavigationController] == viewControllerInsteadIOfNavigationController) { isEmbedInTabBarController = YES; [self cyl_setTabIndex:i]; break; } } return isEmbedInTabBarController; } - (void)cyl_setTabIndex:(NSInteger)tabIndex { objc_setAssociatedObject(self, @selector(cyl_tabIndex), @(tabIndex), OBJC_ASSOCIATION_RETAIN_NONATOMIC); } - (NSInteger)cyl_tabIndex { if (!self.cyl_isEmbedInTabBarController) { return NSNotFound; } id tabIndexObject = objc_getAssociatedObject(self, @selector(cyl_tabIndex)); NSInteger tabIndex = [tabIndexObject integerValue]; return tabIndex; } - (UIControl *)cyl_tabButton { if (!self.cyl_isEmbedInTabBarController) { return nil; } UITabBarItem *tabBarItem; UIControl *control; @try { tabBarItem = self.cyl_tabBarController.tabBar.items[self.cyl_tabIndex]; control = [tabBarItem cyl_tabButton]; } @catch (NSException *exception) {} return control; } - (NSString *)cyl_context { return objc_getAssociatedObject(self, @selector(cyl_context)); } - (void)cyl_setContext:(NSString *)cyl_context { objc_setAssociatedObject(self, @selector(cyl_context), cyl_context, OBJC_ASSOCIATION_COPY_NONATOMIC); } - (BOOL)cyl_plusViewControllerEverAdded { NSNumber *cyl_plusViewControllerEverAddedObject = objc_getAssociatedObject(self, @selector(cyl_plusViewControllerEverAdded)); return [cyl_plusViewControllerEverAddedObject boolValue]; } - (void)cyl_setPlusViewControllerEverAdded:(BOOL)cyl_plusViewControllerEverAdded { NSNumber *cyl_plusViewControllerEverAddedObject = [NSNumber numberWithBool:cyl_plusViewControllerEverAdded]; objc_setAssociatedObject(self, @selector(cyl_plusViewControllerEverAdded), cyl_plusViewControllerEverAddedObject, OBJC_ASSOCIATION_ASSIGN); } #pragma mark - #pragma mark - Private Methods - (NSArray<__kindof UIViewController *> *)cyl_getOtherSameClassTypeViewControllersInCurrentNavigationControllerStack:(UIViewController *)viewController { NSArray *currentNavigationControllerStack = [self.navigationController childViewControllers]; if (currentNavigationControllerStack.count < 2) { return nil; } NSMutableArray *mutableArray = [currentNavigationControllerStack mutableCopy]; [mutableArray removeObject:self]; currentNavigationControllerStack = [mutableArray copy]; __block NSMutableArray *mutableOtherViewControllersInNavigationControllerStack = [NSMutableArray arrayWithCapacity:currentNavigationControllerStack.count]; [currentNavigationControllerStack enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { UIViewController *otherViewController = obj; if ([otherViewController isKindOfClass:[viewController class]]) { [mutableOtherViewControllersInNavigationControllerStack addObject:otherViewController]; } }]; return [mutableOtherViewControllersInNavigationControllerStack copy]; } - (void)checkTabBarChildControllerValidityAtIndex:(NSUInteger)index { CYLTabBarController *tabBarController = [[self cyl_getViewControllerInsteadOfNavigationController] cyl_tabBarController]; @try { UIViewController *viewController; viewController = tabBarController.viewControllers[index]; UIButton *plusButton = CYLExternPlusButton; BOOL shouldConfigureSelectionStatus = (CYLPlusChildViewController) && ((index != CYLPlusButtonIndex) && (viewController != CYLPlusChildViewController)); if (shouldConfigureSelectionStatus) { plusButton.selected = NO; } } @catch (NSException *exception) { NSString *formatString = @"\n\n\ ------ BEGIN NSException Log ---------------------------------------------------------------------\n \ class name: %@ \n \ ------line: %@ \n \ ----reason: The Class Type or the index or its NavigationController you pass in method `-cyl_popSelectTabBarChildViewControllerAtIndex` or `-cyl_popSelectTabBarChildViewControllerForClassType` is not the item of CYLTabBarViewController \n \ ------ END ---------------------------------------------------------------------------------------\n\n"; NSString *reason = [NSString stringWithFormat:formatString, @(__PRETTY_FUNCTION__), @(__LINE__)]; @throw [NSException exceptionWithName:NSGenericException reason:reason userInfo:nil]; } } - (NSInteger)cyl_indexForClassType:(Class)classType inViewControllers:(NSArray *)viewControllers { __block NSInteger atIndex = NSNotFound; [viewControllers enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { UIViewController *obj_ = [obj cyl_getViewControllerInsteadOfNavigationController]; if ([obj_ isKindOfClass:classType]) { atIndex = idx; *stop = YES; return; } }]; return atIndex; } @end
{ "pile_set_name": "Github" }
export default { alias: { bbb: require.resolve('./bar.css'), } }
{ "pile_set_name": "Github" }
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" />
{ "pile_set_name": "Github" }
# Copyright 2017 FUJITSU LIMITED # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils from osc_lib.utils import columns as column_util from oslo_log import log as logging from neutronclient._i18n import _ from neutronclient.common import utils as nc_utils from neutronclient.osc import utils as osc_utils from neutronclient.osc.v2.vpnaas import utils as vpn_utils LOG = logging.getLogger(__name__) _attr_map = ( ('id', 'ID', column_util.LIST_BOTH), ('name', 'Name', column_util.LIST_BOTH), ('auth_algorithm', 'Authentication Algorithm', column_util.LIST_BOTH), ('encryption_algorithm', 'Encryption Algorithm', column_util.LIST_BOTH), ('ike_version', 'IKE Version', column_util.LIST_BOTH), ('pfs', 'Perfect Forward Secrecy (PFS)', column_util.LIST_BOTH), ('description', 'Description', column_util.LIST_LONG_ONLY), ('phase1_negotiation_mode', 'Phase1 Negotiation Mode', column_util.LIST_LONG_ONLY), ('tenant_id', 'Project', column_util.LIST_LONG_ONLY), ('lifetime', 'Lifetime', column_util.LIST_LONG_ONLY), ) def _convert_to_lowercase(string): return string.lower() def _get_common_parser(parser): parser.add_argument( '--description', metavar='<description>', help=_('Description of the IKE policy')) parser.add_argument( '--auth-algorithm', choices=['sha1', 'sha256', 'sha384', 'sha512'], type=_convert_to_lowercase, help=_('Authentication algorithm')) parser.add_argument( '--encryption-algorithm', choices=['aes-128', '3des', 'aes-192', 'aes-256'], type=_convert_to_lowercase, help=_('Encryption algorithm')) parser.add_argument( '--phase1-negotiation-mode', choices=['main', 'aggressive'], type=_convert_to_lowercase, help=_('IKE Phase1 negotiation mode')) parser.add_argument( '--ike-version', choices=['v1', 'v2'], type=_convert_to_lowercase, help=_('IKE version for the policy')) parser.add_argument( '--pfs', choices=['group5', 'group2', 'group14'], type=_convert_to_lowercase, help=_('Perfect Forward Secrecy')) parser.add_argument( '--lifetime', metavar="units=UNITS,value=VALUE", type=nc_utils.str2dict_type(optional_keys=['units', 'value']), help=vpn_utils.lifetime_help("IKE")) return parser def _get_common_attrs(client_manager, parsed_args, is_create=True): attrs = {} if is_create: if 'project' in parsed_args and parsed_args.project is not None: attrs['tenant_id'] = osc_utils.find_project( client_manager.identity, parsed_args.project, parsed_args.project_domain, ).id if parsed_args.description: attrs['description'] = parsed_args.description if parsed_args.auth_algorithm: attrs['auth_algorithm'] = parsed_args.auth_algorithm if parsed_args.encryption_algorithm: attrs['encryption_algorithm'] = parsed_args.encryption_algorithm if parsed_args.phase1_negotiation_mode: attrs['phase1_negotiation_mode'] = parsed_args.phase1_negotiation_mode if parsed_args.ike_version: attrs['ike_version'] = parsed_args.ike_version if parsed_args.pfs: attrs['pfs'] = parsed_args.pfs if parsed_args.lifetime: vpn_utils.validate_lifetime_dict(parsed_args.lifetime) attrs['lifetime'] = parsed_args.lifetime return attrs class CreateIKEPolicy(command.ShowOne): _description = _("Create an IKE policy") def get_parser(self, prog_name): parser = super(CreateIKEPolicy, self).get_parser(prog_name) _get_common_parser(parser) parser.add_argument( 'name', metavar='<name>', help=_('Name of the IKE policy')) osc_utils.add_project_owner_option_to_parser(parser) return parser def take_action(self, parsed_args): client = self.app.client_manager.neutronclient attrs = _get_common_attrs(self.app.client_manager, parsed_args) if parsed_args.name: attrs['name'] = str(parsed_args.name) obj = client.create_ikepolicy({'ikepolicy': attrs})['ikepolicy'] columns, display_columns = column_util.get_columns(obj, _attr_map) data = utils.get_dict_properties(obj, columns) return display_columns, data class DeleteIKEPolicy(command.Command): _description = _("Delete IKE policy (policies)") def get_parser(self, prog_name): parser = super(DeleteIKEPolicy, self).get_parser(prog_name) parser.add_argument( 'ikepolicy', metavar='<ike-policy>', nargs='+', help=_('IKE policy to delete (name or ID)')) return parser def take_action(self, parsed_args): client = self.app.client_manager.neutronclient result = 0 for ike in parsed_args.ikepolicy: try: ike_id = client.find_resource( 'ikepolicy', ike, cmd_resource='ikepolicy')['id'] client.delete_ikepolicy(ike_id) except Exception as e: result += 1 LOG.error(_("Failed to delete IKE policy with " "name or ID '%(ikepolicy)s': %(e)s"), {'ikepolicy': ike, 'e': e}) if result > 0: total = len(parsed_args.ikepolicy) msg = (_("%(result)s of %(total)s IKE policy failed " "to delete.") % {'result': result, 'total': total}) raise exceptions.CommandError(msg) class ListIKEPolicy(command.Lister): _description = _("List IKE policies that belong to a given project") def get_parser(self, prog_name): parser = super(ListIKEPolicy, self).get_parser(prog_name) parser.add_argument( '--long', action='store_true', help=_("List additional fields in output") ) return parser def take_action(self, parsed_args): client = self.app.client_manager.neutronclient obj = client.list_ikepolicies()['ikepolicies'] headers, columns = column_util.get_column_definitions( _attr_map, long_listing=parsed_args.long) return (headers, (utils.get_dict_properties(s, columns) for s in obj)) class SetIKEPolicy(command.Command): _description = _("Set IKE policy properties") def get_parser(self, prog_name): parser = super(SetIKEPolicy, self).get_parser(prog_name) _get_common_parser(parser) parser.add_argument( '--name', metavar='<name>', help=_('Name of the IKE policy')) parser.add_argument( 'ikepolicy', metavar='<ike-policy>', help=_('IKE policy to set (name or ID)')) return parser def take_action(self, parsed_args): client = self.app.client_manager.neutronclient attrs = _get_common_attrs(self.app.client_manager, parsed_args, is_create=False) if parsed_args.name: attrs['name'] = parsed_args.name ike_id = client.find_resource( 'ikepolicy', parsed_args.ikepolicy, cmd_resource='ikepolicy')['id'] try: client.update_ikepolicy(ike_id, {'ikepolicy': attrs}) except Exception as e: msg = (_("Failed to set IKE policy '%(ike)s': %(e)s") % {'ike': parsed_args.ikepolicy, 'e': e}) raise exceptions.CommandError(msg) class ShowIKEPolicy(command.ShowOne): _description = _("Display IKE policy details") def get_parser(self, prog_name): parser = super(ShowIKEPolicy, self).get_parser(prog_name) parser.add_argument( 'ikepolicy', metavar='<ike-policy>', help=_('IKE policy to display (name or ID)')) return parser def take_action(self, parsed_args): client = self.app.client_manager.neutronclient ike_id = client.find_resource( 'ikepolicy', parsed_args.ikepolicy, cmd_resource='ikepolicy')['id'] obj = client.show_ikepolicy(ike_id)['ikepolicy'] columns, display_columns = column_util.get_columns(obj, _attr_map) data = utils.get_dict_properties(obj, columns) return (display_columns, data)
{ "pile_set_name": "Github" }
// Copyright (c) 2013 The Go Authors. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd. // Package lintutil provides helpers for writing linter command lines. package lintutil // import "github.com/golangci/go-tools/lint/lintutil" import ( "errors" "flag" "fmt" "go/build" "go/token" "log" "os" "regexp" "runtime" "runtime/pprof" "strconv" "strings" "time" "github.com/golangci/go-tools/config" "github.com/golangci/go-tools/lint" "github.com/golangci/go-tools/lint/lintutil/format" "github.com/golangci/go-tools/version" "golang.org/x/tools/go/packages" ) func usage(name string, flags *flag.FlagSet) func() { return func() { fmt.Fprintf(os.Stderr, "Usage of %s:\n", name) fmt.Fprintf(os.Stderr, "\t%s [flags] # runs on package in current directory\n", name) fmt.Fprintf(os.Stderr, "\t%s [flags] packages\n", name) fmt.Fprintf(os.Stderr, "\t%s [flags] directory\n", name) fmt.Fprintf(os.Stderr, "\t%s [flags] files... # must be a single package\n", name) fmt.Fprintf(os.Stderr, "Flags:\n") flags.PrintDefaults() } } func parseIgnore(s string) ([]lint.Ignore, error) { var out []lint.Ignore if len(s) == 0 { return nil, nil } for _, part := range strings.Fields(s) { p := strings.Split(part, ":") if len(p) != 2 { return nil, errors.New("malformed ignore string") } path := p[0] checks := strings.Split(p[1], ",") out = append(out, &lint.GlobIgnore{Pattern: path, Checks: checks}) } return out, nil } type versionFlag int func (v *versionFlag) String() string { return fmt.Sprintf("1.%d", *v) } func (v *versionFlag) Set(s string) error { if len(s) < 3 { return errors.New("invalid Go version") } if s[0] != '1' { return errors.New("invalid Go version") } if s[1] != '.' { return errors.New("invalid Go version") } i, err := strconv.Atoi(s[2:]) *v = versionFlag(i) return err } func (v *versionFlag) Get() interface{} { return int(*v) } type list []string func (list *list) String() string { return `"` + strings.Join(*list, ",") + `"` } func (list *list) Set(s string) error { if s == "" { *list = nil return nil } *list = strings.Split(s, ",") return nil } func FlagSet(name string) *flag.FlagSet { flags := flag.NewFlagSet("", flag.ExitOnError) flags.Usage = usage(name, flags) flags.String("tags", "", "List of `build tags`") flags.String("ignore", "", "Deprecated: use linter directives instead") flags.Bool("tests", true, "Include tests") flags.Bool("version", false, "Print version and exit") flags.Bool("show-ignored", false, "Don't filter ignored problems") flags.String("f", "text", "Output `format` (valid choices are 'stylish', 'text' and 'json')") flags.Int("debug.max-concurrent-jobs", 0, "Number of jobs to run concurrently") flags.Bool("debug.print-stats", false, "Print debug statistics") flags.String("debug.cpuprofile", "", "Write CPU profile to `file`") flags.String("debug.memprofile", "", "Write memory profile to `file`") checks := list{"inherit"} fail := list{"all"} flags.Var(&checks, "checks", "Comma-separated list of `checks` to enable.") flags.Var(&fail, "fail", "Comma-separated list of `checks` that can cause a non-zero exit status.") tags := build.Default.ReleaseTags v := tags[len(tags)-1][2:] version := new(versionFlag) if err := version.Set(v); err != nil { panic(fmt.Sprintf("internal error: %s", err)) } flags.Var(version, "go", "Target Go `version` in the format '1.x'") return flags } func ProcessFlagSet(cs []lint.Checker, fs *flag.FlagSet) { tags := fs.Lookup("tags").Value.(flag.Getter).Get().(string) ignore := fs.Lookup("ignore").Value.(flag.Getter).Get().(string) tests := fs.Lookup("tests").Value.(flag.Getter).Get().(bool) goVersion := fs.Lookup("go").Value.(flag.Getter).Get().(int) formatter := fs.Lookup("f").Value.(flag.Getter).Get().(string) printVersion := fs.Lookup("version").Value.(flag.Getter).Get().(bool) showIgnored := fs.Lookup("show-ignored").Value.(flag.Getter).Get().(bool) maxConcurrentJobs := fs.Lookup("debug.max-concurrent-jobs").Value.(flag.Getter).Get().(int) printStats := fs.Lookup("debug.print-stats").Value.(flag.Getter).Get().(bool) cpuProfile := fs.Lookup("debug.cpuprofile").Value.(flag.Getter).Get().(string) memProfile := fs.Lookup("debug.memprofile").Value.(flag.Getter).Get().(string) cfg := config.Config{} cfg.Checks = *fs.Lookup("checks").Value.(*list) exit := func(code int) { if cpuProfile != "" { pprof.StopCPUProfile() } if memProfile != "" { f, err := os.Create(memProfile) if err != nil { panic(err) } runtime.GC() pprof.WriteHeapProfile(f) } os.Exit(code) } if cpuProfile != "" { f, err := os.Create(cpuProfile) if err != nil { log.Fatal(err) } pprof.StartCPUProfile(f) } if printVersion { version.Print() exit(0) } ps, err := Lint(cs, fs.Args(), &Options{ Tags: strings.Fields(tags), LintTests: tests, Ignores: ignore, GoVersion: goVersion, ReturnIgnored: showIgnored, Config: cfg, MaxConcurrentJobs: maxConcurrentJobs, PrintStats: printStats, }) if err != nil { fmt.Fprintln(os.Stderr, err) exit(1) } var f format.Formatter switch formatter { case "text": f = format.Text{W: os.Stdout} case "stylish": f = &format.Stylish{W: os.Stdout} case "json": f = format.JSON{W: os.Stdout} default: fmt.Fprintf(os.Stderr, "unsupported output format %q\n", formatter) exit(2) } var ( total int errors int warnings int ) fail := *fs.Lookup("fail").Value.(*list) var allChecks []string for _, p := range ps { allChecks = append(allChecks, p.Check) } shouldExit := lint.FilterChecks(allChecks, fail) total = len(ps) for _, p := range ps { if shouldExit[p.Check] { errors++ } else { p.Severity = lint.Warning warnings++ } f.Format(p) } if f, ok := f.(format.Statter); ok { f.Stats(total, errors, warnings) } if errors > 0 { exit(1) } } type Options struct { Config config.Config Tags []string LintTests bool Ignores string GoVersion int ReturnIgnored bool MaxConcurrentJobs int PrintStats bool } func Lint(cs []lint.Checker, paths []string, opt *Options) ([]lint.Problem, error) { stats := lint.PerfStats{ CheckerInits: map[string]time.Duration{}, } if opt == nil { opt = &Options{} } ignores, err := parseIgnore(opt.Ignores) if err != nil { return nil, err } conf := &packages.Config{ Mode: packages.LoadAllSyntax, Tests: opt.LintTests, BuildFlags: []string{ "-tags=" + strings.Join(opt.Tags, " "), }, } t := time.Now() if len(paths) == 0 { paths = []string{"."} } pkgs, err := packages.Load(conf, paths...) if err != nil { return nil, err } stats.PackageLoading = time.Since(t) var problems []lint.Problem workingPkgs := make([]*packages.Package, 0, len(pkgs)) for _, pkg := range pkgs { if pkg.IllTyped { problems = append(problems, compileErrors(pkg)...) } else { workingPkgs = append(workingPkgs, pkg) } } if len(workingPkgs) == 0 { return problems, nil } l := &lint.Linter{ Checkers: cs, Ignores: ignores, GoVersion: opt.GoVersion, ReturnIgnored: opt.ReturnIgnored, Config: opt.Config, MaxConcurrentJobs: opt.MaxConcurrentJobs, PrintStats: opt.PrintStats, } problems = append(problems, l.Lint(workingPkgs, &stats)...) return problems, nil } var posRe = regexp.MustCompile(`^(.+?):(\d+)(?::(\d+)?)?$`) func parsePos(pos string) token.Position { if pos == "-" || pos == "" { return token.Position{} } parts := posRe.FindStringSubmatch(pos) if parts == nil { panic(fmt.Sprintf("internal error: malformed position %q", pos)) } file := parts[1] line, _ := strconv.Atoi(parts[2]) col, _ := strconv.Atoi(parts[3]) return token.Position{ Filename: file, Line: line, Column: col, } } func compileErrors(pkg *packages.Package) []lint.Problem { if !pkg.IllTyped { return nil } if len(pkg.Errors) == 0 { // transitively ill-typed var ps []lint.Problem for _, imp := range pkg.Imports { ps = append(ps, compileErrors(imp)...) } return ps } var ps []lint.Problem for _, err := range pkg.Errors { p := lint.Problem{ Position: parsePos(err.Pos), Text: err.Msg, Checker: "compiler", Check: "compile", } ps = append(ps, p) } return ps } func ProcessArgs(name string, cs []lint.Checker, args []string) { flags := FlagSet(name) flags.Parse(args) ProcessFlagSet(cs, flags) }
{ "pile_set_name": "Github" }
_Z5func1v # Func Hash: 0 # Num Counters: 1 # Counter Values: 0 _Z5func2v # Func Hash: 0 # Num Counters: 1 # Counter Values: 0 _Z5func3v # Func Hash: 0 # Num Counters: 1 # Counter Values: 0 _Z5func4v # Func Hash: 0 # Num Counters: 1 # Counter Values: 0 main # Func Hash: 0 # Num Counters: 1 # Counter Values: 1 _Z5func5v # Func Hash: 0 # Num Counters: 1 # Counter Values: 0 _Z5func6v # Func Hash: 0 # Num Counters: 1 # Counter Values: 0
{ "pile_set_name": "Github" }
#include "resourceGui.h" #define IDR_MENUBAR1 70 #define IDM_MENU 71 #define IDR_ACCELERATOR1 72 #define IDB_ADD 100 #define IDB_EXTRACT 101 #define IDB_TEST 102 #define IDB_COPY 103 #define IDB_MOVE 104 #define IDB_DELETE 105 #define IDB_INFO 106 #define IDB_ADD2 150 #define IDB_EXTRACT2 151 #define IDB_TEST2 152 #define IDB_COPY2 153 #define IDB_MOVE2 154 #define IDB_DELETE2 155 #define IDB_INFO2 156 #define IDM_HASH_ALL 101 #define IDM_CRC32 102 #define IDM_CRC64 103 #define IDM_SHA1 104 #define IDM_SHA256 105 #define IDM_OPEN 540 #define IDM_OPEN_INSIDE 541 #define IDM_OPEN_OUTSIDE 542 #define IDM_FILE_VIEW 543 #define IDM_FILE_EDIT 544 #define IDM_RENAME 545 #define IDM_COPY_TO 546 #define IDM_MOVE_TO 547 #define IDM_DELETE 548 #define IDM_SPLIT 549 #define IDM_COMBINE 550 #define IDM_PROPERTIES 551 #define IDM_COMMENT 552 #define IDM_CRC 553 #define IDM_DIFF 554 #define IDM_CREATE_FOLDER 555 #define IDM_CREATE_FILE 556 // #define IDM_EXIT 557 #define IDM_LINK 558 #define IDM_SELECT_ALL 600 #define IDM_DESELECT_ALL 601 #define IDM_INVERT_SELECTION 602 #define IDM_SELECT 603 #define IDM_DESELECT 604 #define IDM_SELECT_BY_TYPE 605 #define IDM_DESELECT_BY_TYPE 606 #define IDM_VIEW_LARGE_ICONS 700 #define IDM_VIEW_SMALL_ICONS 701 #define IDM_VIEW_LIST 702 #define IDM_VIEW_DETAILS 703 #define IDM_VIEW_ARANGE_BY_NAME 710 #define IDM_VIEW_ARANGE_BY_TYPE 711 #define IDM_VIEW_ARANGE_BY_DATE 712 #define IDM_VIEW_ARANGE_BY_SIZE 713 #define IDM_VIEW_ARANGE_NO_SORT 730 #define IDM_VIEW_FLAT_VIEW 731 #define IDM_VIEW_TWO_PANELS 732 #define IDM_VIEW_TOOLBARS 733 #define IDM_OPEN_ROOT_FOLDER 734 #define IDM_OPEN_PARENT_FOLDER 735 #define IDM_FOLDERS_HISTORY 736 #define IDM_VIEW_REFRESH 737 #define IDM_VIEW_AUTO_REFRESH 738 // #define IDM_VIEW_SHOW_DELETED 739 // #define IDM_VIEW_SHOW_STREAMS 740 #define IDM_VIEW_ARCHIVE_TOOLBAR 750 #define IDM_VIEW_STANDARD_TOOLBAR 751 #define IDM_VIEW_TOOLBARS_LARGE_BUTTONS 752 #define IDM_VIEW_TOOLBARS_SHOW_BUTTONS_TEXT 753 #define IDS_BOOKMARK 801 #define IDM_OPTIONS 900 #define IDM_BENCHMARK 901 #define IDM_BENCHMARK2 902 #define IDM_HELP_CONTENTS 960 #define IDM_ABOUT 961 #define IDS_OPTIONS 2100 #define IDS_N_SELECTED_ITEMS 3002 #define IDS_FILE_EXIST 3008 #define IDS_WANT_UPDATE_MODIFIED_FILE 3009 #define IDS_CANNOT_UPDATE_FILE 3010 #define IDS_CANNOT_START_EDITOR 3011 #define IDS_VIRUS 3012 #define IDS_MESSAGE_UNSUPPORTED_OPERATION_FOR_LONG_PATH_FOLDER 3013 #define IDS_SELECT_ONE_FILE 3014 #define IDS_SELECT_FILES 3015 #define IDS_TOO_MANY_ITEMS 3016 #define IDS_COPY 6000 #define IDS_MOVE 6001 #define IDS_COPY_TO 6002 #define IDS_MOVE_TO 6003 #define IDS_COPYING 6004 #define IDS_MOVING 6005 #define IDS_RENAMING 6006 #define IDS_OPERATION_IS_NOT_SUPPORTED 6008 #define IDS_ERROR_RENAMING 6009 #define IDS_CONFIRM_FILE_COPY 6010 #define IDS_WANT_TO_COPY_FILES 6011 #define IDS_CONFIRM_FILE_DELETE 6100 #define IDS_CONFIRM_FOLDER_DELETE 6101 #define IDS_CONFIRM_ITEMS_DELETE 6102 #define IDS_WANT_TO_DELETE_FILE 6103 #define IDS_WANT_TO_DELETE_FOLDER 6104 #define IDS_WANT_TO_DELETE_ITEMS 6105 #define IDS_DELETING 6106 #define IDS_ERROR_DELETING 6107 #define IDS_ERROR_LONG_PATH_TO_RECYCLE 6108 #define IDS_CREATE_FOLDER 6300 #define IDS_CREATE_FILE 6301 #define IDS_CREATE_FOLDER_NAME 6302 #define IDS_CREATE_FILE_NAME 6303 #define IDS_CREATE_FOLDER_DEFAULT_NAME 6304 #define IDS_CREATE_FILE_DEFAULT_NAME 6305 #define IDS_CREATE_FOLDER_ERROR 6306 #define IDS_CREATE_FILE_ERROR 6307 #define IDS_COMMENT 6400 #define IDS_COMMENT2 6401 #define IDS_SELECT 6402 #define IDS_DESELECT 6403 #define IDS_SELECT_MASK 6404 #define IDS_PROPERTIES 6600 #define IDS_FOLDERS_HISTORY 6601 #define IDS_COMPUTER 7100 #define IDS_NETWORK 7101 #define IDS_DOCUMENTS 7102 #define IDS_SYSTEM 7103 #define IDS_ADD 7200 #define IDS_EXTRACT 7201 #define IDS_TEST 7202 #define IDS_BUTTON_COPY 7203 #define IDS_BUTTON_MOVE 7204 #define IDS_BUTTON_DELETE 7205 #define IDS_BUTTON_INFO 7206 #define IDS_SPLITTING 7303 #define IDS_SPLIT_CONFIRM_TITLE 7304 #define IDS_SPLIT_CONFIRM_MESSAGE 7305 #define IDS_SPLIT_VOL_MUST_BE_SMALLER 7306 #define IDS_COMBINE 7400 #define IDS_COMBINE_TO 7401 #define IDS_COMBINING 7402 #define IDS_COMBINE_SELECT_ONE_FILE 7403 #define IDS_COMBINE_CANT_DETECT_SPLIT_FILE 7404 #define IDS_COMBINE_CANT_FIND_MORE_THAN_ONE_PART 7405
{ "pile_set_name": "Github" }
module RPXNow class UserProxy def initialize(id) @id = id end def identifiers RPXNow.mappings(@id) end def map(identifier) RPXNow.map(identifier, @id) end def unmap(identifier) RPXNow.unmap(identifier, @id) end end end
{ "pile_set_name": "Github" }
package archive import ( "io" "os" "testing" "time" "github.com/cozy/cozy-stack/model/instance" "github.com/cozy/cozy-stack/model/vfs" "github.com/cozy/cozy-stack/pkg/config/config" "github.com/cozy/cozy-stack/pkg/consts" "github.com/cozy/cozy-stack/tests/testutils" "github.com/stretchr/testify/assert" ) var inst *instance.Instance func TestUnzip(t *testing.T) { fs := inst.VFS() dst, err := vfs.Mkdir(fs, "/destination", nil) assert.NoError(t, err) _, err = vfs.Mkdir(fs, "/destination/foo", nil) assert.NoError(t, err) fd, err := os.Open("../../tests/fixtures/logos.zip") assert.NoError(t, err) defer fd.Close() zip, err := vfs.NewFileDoc("logos.zip", consts.RootDirID, -1, nil, "application/zip", "application", time.Now(), false, false, nil) assert.NoError(t, err) file, err := fs.CreateFile(zip, nil) assert.NoError(t, err) _, err = io.Copy(file, fd) assert.NoError(t, err) assert.NoError(t, file.Close()) _, err = fs.OpenFile(zip) assert.NoError(t, err) err = unzip(fs, zip.ID(), dst.ID()) assert.NoError(t, err) blue, err := fs.FileByPath("/destination/blue.svg") assert.NoError(t, err) assert.Equal(t, int64(2029), blue.ByteSize) white, err := fs.FileByPath("/destination/white.svg") assert.NoError(t, err) assert.Equal(t, int64(2030), white.ByteSize) baz, err := fs.FileByPath("/destination/foo/bar/baz") assert.NoError(t, err) assert.Equal(t, int64(4), baz.ByteSize) } func TestZip(t *testing.T) { fs := inst.VFS() src, err := vfs.Mkdir(fs, "/src", nil) assert.NoError(t, err) dst, err := vfs.Mkdir(fs, "/dst", nil) assert.NoError(t, err) fd, err := os.Open("../../tests/fixtures/wet-cozy_20160910__M4Dz.jpg") assert.NoError(t, err) defer fd.Close() one, err := vfs.NewFileDoc("wet-cozy.jpg", src.ID(), -1, nil, "image/jpeg", "image", time.Now(), false, false, nil) assert.NoError(t, err) file, err := fs.CreateFile(one, nil) assert.NoError(t, err) _, err = io.Copy(file, fd) assert.NoError(t, err) assert.NoError(t, file.Close()) at := time.Date(2019, 6, 15, 1, 2, 3, 4, time.UTC) two, err := vfs.NewFileDoc("hello.txt", src.ID(), -1, nil, "text/plain", "text", at, false, false, nil) assert.NoError(t, err) file, err = fs.CreateFile(two, nil) assert.NoError(t, err) _, err = file.Write([]byte("world")) assert.NoError(t, err) assert.NoError(t, file.Close()) files := map[string]string{ "wet-cozy.jpg": one.ID(), "hello.txt": two.ID(), } err = createZip(fs, files, src.ID(), "archive.zip") assert.NoError(t, err) zipDoc, err := fs.FileByPath("/src/archive.zip") assert.NoError(t, err) err = unzip(fs, zipDoc.ID(), dst.ID()) assert.NoError(t, err) f, err := fs.FileByPath("/dst/wet-cozy.jpg") assert.NoError(t, err) assert.Equal(t, one.ByteSize, f.ByteSize) assert.Equal(t, one.MD5Sum, f.MD5Sum) // The zip archive has only a precision of a second for the modified field assert.Equal(t, one.UpdatedAt.Unix(), f.UpdatedAt.Unix()) f, err = fs.FileByPath("/dst/hello.txt") assert.NoError(t, err) assert.Equal(t, two.ByteSize, f.ByteSize) assert.Equal(t, two.MD5Sum, f.MD5Sum) // The zip archive has only a precision of a second for the modified field assert.Equal(t, two.UpdatedAt.Unix(), f.UpdatedAt.Unix()) } func TestMain(m *testing.M) { config.UseTestFile() setup := testutils.NewSetup(m, "unzip_test") inst = setup.GetTestInstance() os.Exit(setup.Run()) }
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- # Copyright (C) 2015 ZetaOps Inc. # # This file is licensed under the GNU General Public License v3 # (GPLv3). See LICENSE.txt for details. from ulakbus.services.ulakbus_service import UlakbusService import time import requests import io import json import hashlib import copy import base64 from boto.s3.connection import S3Connection as s3 from boto.s3.key import Key class RenderDocument(UlakbusService): """ The submitted template is rendered with the context data and the download link is sent back. If context data includes 'pdf', rendered document is converted to pdf. ::: Requirements ::: - template : It can be base64 encoded data or URL - context : Have to be a dict. - pdf : Rendered document is converted to pdf. ::: Response ::: - status : Status of request. - download_url : The URL of the rendered template ::: Client ::: # >>> curl localhost:11223/render/document -X POST -i -H "Content-Type: application/json" \ - d '{"template": "http://example.com/sample_template.odt", \ "context": {"name": "ali", "pdf":"1"}, "modify_date": "[hash_value_of_template]"}' --- The service will download the template and render with context data. Download rendred template and convert pdf file. # >>> curl localhost:11223/render/document -X POST -i -H "Content-Type: application/json" \ -d "{\"template\": \"`base64 -w 0 template.odt`\", \"context\": {\"name\": \"ali\"}, \ "modify_date": "[hash_value_of_template]"}" --- The service will decode the template and render with context data. The response is compatible with Zato-Wrapper. ::: On Success ::: {"status": "finished", "result": "http://example.com/sample_rendered.odt"} {"status": "finished", "result": "http://example.com/sample.pdf"} ::: On Fail ::: {"status": "Error!", "result": "None"} """ HAS_CHANNEL = True def handle(self): # Load the 3S configuration from ZATO. self.s3connect = False self.S3_PROXY_URL = self.user_config.zetaops.zetaops3s.S3_PROXY_URL self.S3_ACCESS_KEY = self.user_config.zetaops.zetaops3s.S3_ACCESS_KEY self.S3_SECRET_KEY = self.user_config.zetaops.zetaops3s.S3_SECRET_KEY self.S3_PUBLIC_URL = self.user_config.zetaops.zetaops3s.S3_PUBLIC_URL self.S3_PROXY_PORT = self.user_config.zetaops.zetaops3s.S3_PROXY_PORT self.S3_BUCKET_NAME = self.user_config.zetaops.zetaops3s.S3_BUCKET_NAME self.wants_pdf = self.request.payload.get('pdf', False) self.logger.info("WANTS PDF : {} ".format(self.wants_pdf)) self.document_cache = DocumentCache(payload=self.request.payload, kvdb_conn=self.kvdb.conn, wants_pdf=self.wants_pdf, logger=self.logger) cache_stat = self.document_cache.check_the_cache() if cache_stat is None: self.logger.info("STANDART RENDERING PROCESS STARTED") resp = self.standard_process(payload=self.request.payload) else: # `cache_stat` can be context_value or template_value. value = self.get_value_from_cache(cache_stat=cache_stat) # `value` is a dict. # if `value` is `template`. Use content of `template` on Redis. if value['mimetype'] == "template": self.logger.info("NO NEED TO DOWNLOAD TEMPLATE") new_payload = self.create_new_payload() resp = self.standard_process(payload=new_payload) else: self.logger.info("ACTIONS TO DO : ") if value['mimetype'] == "odt" and self.wants_pdf is True: self.logger.info("DOWNLOAD ODT and CONVERT to PDF") # Download odt and convert to PDF file_object = self.make_file_like_object(value['value'], download_token=1) pdf_resp = self.create_pdf(file_object) # ADD to cache PDF URL. self.document_cache.add_rendered_pdf_doc(pdf_url=pdf_resp['download_url']) value['value'] = pdf_resp['download_url'] resp = self.prepare_response('ok', value['value']) self.response.status_code = 200 self.response.payload = resp def create_new_payload(self): """ Create a new payload for no download the `template` Returns: dict: New payload. """ new_payload = copy.copy(self.request.payload) new_payload['template'] = self.document_cache.template['content'] return new_payload def get_value_from_cache(self, cache_stat): """ Get URL on returned value from `DocumentCache`. Args: cache_stat (dict): Redis value. Returns: dict: Formatted dict data. """ def check_is_none(url, cache_stat): """ Check url. If it's None, return `template`. Args: url (str): cache_stat (dict): Returns: str: URL dict: `template` value on Redis. """ url_val = cache_stat.get(url, None) if url_val is None: return self.document_cache.template else: return url_val pdf_value = check_is_none('pdf_url', cache_stat) odt_value = check_is_none('odt_url', cache_stat) # `odt_value` is equal `template`, return template. if odt_value is self.document_cache.template: return {"mimetype": "template", "value": odt_value} # That means `odt_value` is equal the URL. else: # Client wants pdf. if self.wants_pdf is True: # `pdf_value` is not equal to `template` if pdf_value is not self.document_cache.template: return {"mimetype": "pdf", "value": pdf_value} return {"mimetype": "odt", "value": odt_value} def standard_process(self, payload): """ It's a standard render process. The lead is shaped according to payload. Args: payload (dict) Returns: dict: Response. """ resp = self.render_document(payload=payload) self.document_cache.add_rendered_doc(odt_url=resp.data['download_url']) if self.wants_pdf: file_desc = self.make_file_like_object(resp.data['download_url'], download_token=1) pdf_resp = self.create_pdf(file_desc) self.document_cache.add_rendered_pdf_doc(pdf_url=pdf_resp['download_url']) self.logger.info("PDF RESPONSE : {}".format(pdf_resp['status'])) resp = self.prepare_response(pdf_resp['status'], pdf_resp['download_url']) else: resp = self.prepare_response('ok', resp.data['download_url']) return resp def render_document(self, payload): """ Render ODT template file with context data. Args: payload (dict): Context data is variable of Jinja. Returns: response : Response object. """ self.logger.info('{} :: DOCUMENT RENDER SERVICE CALLED '.format(time.ctime())) renderer = self.outgoing.plain_http.get('document.renderer') headers = {'X-App-Name': 'Zato', 'Content-Type': 'application/json'} resp = renderer.conn.send(self.cid, data=payload, headers=headers) return resp def create_pdf(self, file_desc): """ Process of ODF to PDF. It's uses DocsBox Service. Args: file_desc (File or BytesIO): File or file-like object. Returns: dict: Status of process and download_url of pdf file. """ self.logger.info('{} :: DOCSBOX SERVICE CALLED'.format(time.ctime())) # Get outgoing way. pdf_writer = self.outgoing.plain_http.get('docsbox.out') # Add to queue files = {'file': file_desc} result = pdf_writer.conn.post(self.cid, files=files) task_info = json.loads(result.text) task_id = task_info['id'].encode('utf-8') # Chect the queue for 3 seconds. task_queue_status = self.check_the_status(request_period=8, task_id=task_id) # Send back to client if task_queue_status['status'] == 'finished': pdf_file = self.download_pdf_file(task_queue_status['result_url']) # Save PDF file to S3 Server s3_url = self.save_document(pdf_file) task_queue_status['download_url'] = "{0}{1}".format(self.S3_PUBLIC_URL, s3_url) task_queue_status['status'] = 'ok' return task_queue_status else: return {"status": "error", "download_url": "None"} def check_the_status(self, request_period, task_id): """ Check the status of task_id according to given request_period Args: request_period (int): How many times in second. task_id (str): ID of task. Returns: dict: return queue stats of task id. """ pdf_writer_queue = self.outgoing.plain_http.get('docsbox.out.queue') start_time = time.time() now_time = 0.0 while True: params = {'task_id': '{}'.format(task_id)} queue_info = pdf_writer_queue.conn.get(self.cid, params) queue_info = json.loads(queue_info.text) if queue_info['status'] == 'finished': break now_time = time.time() if (now_time - start_time) >= request_period: break self.logger.info('ELAPSED TIME : {}'.format(now_time - start_time)) return queue_info def download_pdf_file(self, result_url): """ Download pdf file from DocsBox Service. It has own channel. Args: result_url (str): This will be downloaded. Returns: BytesIO: PDF file. """ # Get outgoing connection of zato. download_pdf = self.outgoing.plain_http.get('download_pdf') params = {"req_param": result_url} headers = {'Content-Type': 'multipart/form-data'} # Make request to download pdf file with params and headers. download_pdf_result = download_pdf.conn.get(self.cid, params=params, headers=headers) # Make a BytesIO object of DOCSBOX result_url. pdf_file = self.make_file_like_object(download_pdf_result._content, download_token=0) return pdf_file def s3_connect(self): """ Connect to 3S server. """ if self.s3connect: return conn = s3(aws_access_key_id=self.S3_ACCESS_KEY, aws_secret_access_key=self.S3_SECRET_KEY, proxy=self.S3_PROXY_URL, proxy_port=self.S3_PROXY_PORT, is_secure=False) self.bucket = conn.get_bucket(self.S3_BUCKET_NAME) self.s3connect = True def save_document(self, file_desc): """ Save document to 3S bucket. Args: file_desc (File or BytesIO): File or file-like object. Returns: str: Key of saved file. """ self.s3_connect() k = Key(self.bucket) k.set_contents_from_string(file_desc.getvalue()) self.bucket.set_acl('public-read', k.key) return k.key @staticmethod def make_file_like_object(data, download_token=1): """ Make the data file-like object. Args: data (bytes or str): If you send bytes, download_token must be 0. download_token (int): optional Returns: BytesIO: File-like object. """ if download_token == 1: resp = requests.get(data) data = resp.content file_desc = io.BytesIO(data) file_desc.seek(0) return file_desc @staticmethod def prepare_response(status, url): """ Prepare response for client. It's compatible with Zato-Wrapper. Args: status (str): Status of process. url (str): Download url of produced document. Returns: dict: Response for client. """ resp = {"status": status, "result": url} return resp class DocumentCache(object): """ Caching mechanism. Add and get request and template from redis. ::: Scenario 1 - If we have performed the request and modify_date of template on redis is equal the request modify_date send user the ODT or PDF URL. ::: Scenario 2 - If we have performed the request and modify_date isn't equal the redis value. send base64 content of template. Or, We have the template but context isn't equal the redis value, don't download the template. Send base64 content of template """ def __init__(self, payload, kvdb_conn, wants_pdf, logger): """ Args: payload (dict): received request. kvdb_conn (object) : redis connection object. wants_pdf (bool): """ self.kvdb_conn = kvdb_conn self.payload = payload self.wants_pdf = wants_pdf self.logger = logger self.context_key = self.key_from_context(context=self.payload['context']) self.template_key = self.key_from_template(template=self.payload['template']) self.context_value = None self.template_value = None self.template = None def key_from_context(self, context): """ Sort and hash the `payload` data. It's the key of redis. Args: context (dict): Jinja2 variables. Returns: str: Sorted and hashed data. """ key = "".join(["{}{}".format(k, v) for k, v in sorted(context.items())]) key = self.hashing(key.encode()) return key def key_from_template(self, template): """ Take the hash of the template. If template is base64 encoded data, before decode it. Args: template (str): base64 encoded bytes or url Returns: str: Key format for redis. Hashed template. """ if not template.startswith('http'): template = base64.b64decode(template) return self.hashing(template) def is_template_newest(self): """ Check the `modify_date` are equal? Returns: bool: """ if self.template_value is not None: return self.template_value['modify_date'] == self.payload['modify_date'] def context_and_template_compatible(self): """ Check `template` of `context_value` is equal to `template_key` Compare two entries on Redis. Returns: Bool: Is equal, returns True. None: """ if self.context_value is not None: return self.context_value['template'] == self.template_key def check_the_cache(self): """ Check the cache for the request processed before? Returns: dict: Template, context or None """ self.context_value = self.get_value(self.context_key) self.template_value = self.get_value(self.template_key) if self.is_template_newest(): self.template = self.template_value if self.template is not None: if self.context_value is not None and self.context_and_template_compatible(): return self.context_value return self.template def get_value(self, key): """ Get value of the `key` from redis. Args: key (str): Redis key. Returns: dict: Redis value or None. """ value = self.kvdb_conn.get(key) if value is not None: return json.loads(value) def set_value(self, key, value): """ Set key-value pair to Redis Args: key (str): value (object): This will dump with JSON. """ value = json.dumps(value) self.kvdb_conn.set(key, value) def add_rendered_doc(self, odt_url): """ Add rendered document url to Redis. Args: odt_url (str): S3 url of rendered ODT document. """ # Add first entry to Redis. This is `context`. context_value = {"template": self.template_key, "odt_url": odt_url, "pdf_url": None} self.set_value(self.context_key, context_value) self.logger.info("CONTEXT VALUE ADDED TO REDIS") # If template is empty, we need to add second entry to Redis. This is `template`. if self.template is None: template_content = self.payload['template'] if self.payload['template'].startswith('http'): self.logger.info("TEMPLATE IS DOWNLOADED and ADDED TO REDIS") file_desc = self.download_template(self.payload['template']) template_content = base64.b64encode(file_desc.getvalue()) template_value = {"modify_date": self.payload['modify_date'], "content": template_content} self.set_value(self.template_key, template_value) def add_rendered_pdf_doc(self, pdf_url): """ Update value of `context` key. Args: pdf_url (str): """ context_value = self.get_value(self.context_key) if context_value is not None: context_value['pdf_url'] = pdf_url self.set_value(self.context_key, context_value) @staticmethod def download_template(template_url): """ Args: template_url: (string) url of template file Returns: return downloaded file """ response = requests.get(template_url) file_desc = io.BytesIO(response.content) return file_desc @staticmethod def hashing(data): """ Returns hashed value of the param `data`. Args: data (str): Encoded bytes Returns: str: Hashed data. """ return hashlib.sha256(data).hexdigest()
{ "pile_set_name": "Github" }
# react-native-sms ## SendSMS Use this RN component to send an SMS with a callback (completed/cancelled/error). iOS and Android are both supported. Currently, only user-initiated sending of an SMS is supported. This means you can't use `react-native-sms` to send an SMS in the background-- this package displays the native SMS view (populated with any recipients/body you want), and gives a callback describing the status of the SMS (completed/cancelled/error). PRs are welcome! ## How to install 1. `npm install react-native-sms --save` ## Getting things set up The compiler needs to know how to find your sweet new module! `react-native link react-native-sms` ### Additional Android Setup Note: If using RN < v0.47, use react-native-sms <= v1.4.2 Just a few quick & easy things you need to set up in order to get SendSMS up and running! 1. Navigate to your MainActivity.java (`MyApp/android/app/src/main/java/some/other/directories/MainActivity.java`) At the top of the file ```Java import android.content.Intent; // <-- include if not already there import com.tkporter.sendsms.SendSMSPackage; ``` Inside MainActivity (place entire function if it's not there already) ```Java @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); //probably some other stuff here SendSMSPackage.getInstance().onActivityResult(requestCode, resultCode, data); } ``` Then head to your [MyApp]Application.java (`MyApp/android/app/src/main/java/so/many/dirs/MyAppApplication.java`) Make sure `import com.tkporter.sendsms.SendSMSPackage;` is there Then head down to `getPackages()`, it has to look similar to this ```Java protected List<ReactPackage> getPackages() { //some variables return Arrays.<ReactPackage>asList( //probably some items like `new BlahPackage(),` //just add into the list (don't forget commas!): SendSMSPackage.getInstance() ); } ``` Navigate to your `AndroidManifest.xml` (at `MyApp/android/app/src/main/AndroidManifest.xml`), and add this near the top with the other permssions ```XML <uses-permission android:name="android.permission.READ_SMS" /> ``` Ensure your launchMode for `.MainActivity` is ```XML android:launchMode="singleTask" ``` ## Using the module Once everything is all setup, it's pretty simple: ```JavaScript SendSMS.send(myOptionsObject, callback); ``` ### Object Properties |Key|Type|Platforms|Required?|Description| |-|-|-|-|-| | `body` | String | iOS/Android | No | The text that shows by default when the SMS is initiated | | `recipients` | Array (strings) | iOS/Android | No | Provides the phone number recipients to show by default | | `successTypes` | Array (strings) | Android | Yes | An array of types that would trigger a "completed" response when using android <br/><br/> Possible values: <br/><br/> `'all' 'inbox' 'sent' 'draft' 'outbox' 'failed' 'queued'` | | `allowAndroidSendWithoutReadPermission` | boolean | Android | No | By default, SMS will only be initiated on Android if the user accepts the `READ_SMS` permission (which is required to provide completion statuses to the callback). <br/><br/> Passing `true` here will allow the user to send a message even if they decline the `READ_SMS` permission, and will then provide generic callback values (all false) to your application. | |`attachment` | Object { url: string, iosType?: string, iosFilename?: string, androidType?: string } | iOS/Android | No | Pass a url to attach to the MMS message. <br/><br/>Currently known to work with images. ## Example: ```JavaScript import SendSMS from 'react-native-sms' //some stuff someFunction() { SendSMS.send({ body: 'The default body of the SMS!', recipients: ['0123456789', '9876543210'], successTypes: ['sent', 'queued'], allowAndroidSendWithoutReadPermission: true }, (completed, cancelled, error) => { console.log('SMS Callback: completed: ' + completed + ' cancelled: ' + cancelled + 'error: ' + error); }); } ``` ## Attachment example ```JavaScript import SendSMS from 'react-native-sms' import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource' someFunction() { const image = require('assets/your-image.jpg'); const metadata = resolveAssetSource(image); const url = metadata.uri; const attachment = { url: url, iosType: 'public.jpeg', iosFilename: 'Image.jpeg', androidType: 'image/*' }; SendSMS.send({ body: 'The default body of the SMS!', recipients: ['0123456789', '9876543210'], successTypes: ['sent', 'queued'], allowAndroidSendWithoutReadPermission: true, attachment: attachment }, (completed, cancelled, error) => { console.log('SMS Callback: completed: ' + completed + ' cancelled: ' + cancelled + 'error: ' + error); }); } ``` ## Troubleshooting: Having errors with import statements on Android? Something happened with linking Go to your `settings.gradle` (in `MyApp/android/settings.gradle`) and add: ``` include ':react-native-sms' project(':react-native-sms').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sms/android') ``` Then go to `MyApp/android/app/build.gradle` and add inside `dependencies { }`: ``` compile project(':react-native-sms') ```
{ "pile_set_name": "Github" }
๏ปฟ<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Itanium"> <Configuration>Debug</Configuration> <Platform>Itanium</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|x64"> <Configuration>Debug</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="ReleaseWithoutAsm|Itanium"> <Configuration>ReleaseWithoutAsm</Configuration> <Platform>Itanium</Platform> </ProjectConfiguration> <ProjectConfiguration Include="ReleaseWithoutAsm|Win32"> <Configuration>ReleaseWithoutAsm</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="ReleaseWithoutAsm|x64"> <Configuration>ReleaseWithoutAsm</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|Itanium"> <Configuration>Release</Configuration> <Platform>Itanium</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|x64"> <Configuration>Release</Configuration> <Platform>x64</Platform> </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}</ProjectGuid> <RootNamespace>testzlib</RootNamespace> <Keyword>Win32Proj</Keyword> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>MultiByte</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> <PlatformToolset>v110</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>MultiByte</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> <PlatformToolset>v110</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> <PlatformToolset>v110</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>MultiByte</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>MultiByte</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <WholeProgramOptimization>true</WholeProgramOptimization> <PlatformToolset>v110</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <WholeProgramOptimization>true</WholeProgramOptimization> <PlatformToolset>v110</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <PlatformToolset>v110</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup> <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion> <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\TestZlib$(Configuration)\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\TestZlib$(Configuration)\Tmp\</IntDir> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest> <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\TestZlib$(Configuration)\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\TestZlib$(Configuration)\Tmp\</IntDir> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">false</LinkIncremental> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">false</GenerateManifest> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\TestZlib$(Configuration)\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\TestZlib$(Configuration)\Tmp\</IntDir> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest> <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\TestZlib$(Configuration)\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\TestZlib$(Configuration)\Tmp\</IntDir> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest> <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\TestZlib$(Configuration)\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\TestZlib$(Configuration)\Tmp\</IntDir> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</LinkIncremental> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">false</GenerateManifest> <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\TestZlib$(Configuration)\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\TestZlib$(Configuration)\Tmp\</IntDir> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">false</GenerateManifest> <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">ia64\TestZlib$(Configuration)\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">ia64\TestZlib$(Configuration)\Tmp\</IntDir> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">false</LinkIncremental> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">false</GenerateManifest> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\TestZlib$(Configuration)\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\TestZlib$(Configuration)\Tmp\</IntDir> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\TestZlib$(Configuration)\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\TestZlib$(Configuration)\Tmp\</IntDir> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</LinkIncremental> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</GenerateManifest> <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" /> <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" /> <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" /> <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" /> <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" /> <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" /> <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" /> <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" /> <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" /> <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" /> <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <Optimization>Disabled</Optimization> <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>true</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <BufferSecurityCheck>false</BufferSecurityCheck> <PrecompiledHeader> </PrecompiledHeader> <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)testzlib.exe</OutputFile> <GenerateDebugInformation>true</GenerateDebugInformation> <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <RandomizedBaseAddress>false</RandomizedBaseAddress> <DataExecutionPrevention> </DataExecutionPrevention> <TargetMachine>MachineX86</TargetMachine> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'"> <ClCompile> <Optimization>MaxSpeed</Optimization> <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> <OmitFramePointers>true</OmitFramePointers> <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <BufferSecurityCheck>false</BufferSecurityCheck> <FunctionLevelLinking>true</FunctionLevelLinking> <PrecompiledHeader> </PrecompiledHeader> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <OutputFile>$(OutDir)testzlib.exe</OutputFile> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Console</SubSystem> <OptimizeReferences>true</OptimizeReferences> <EnableCOMDATFolding>true</EnableCOMDATFolding> <RandomizedBaseAddress>false</RandomizedBaseAddress> <DataExecutionPrevention> </DataExecutionPrevention> <TargetMachine>MachineX86</TargetMachine> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> <Optimization>MaxSpeed</Optimization> <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> <OmitFramePointers>true</OmitFramePointers> <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <BufferSecurityCheck>false</BufferSecurityCheck> <FunctionLevelLinking>true</FunctionLevelLinking> <PrecompiledHeader> </PrecompiledHeader> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)testzlib.exe</OutputFile> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Console</SubSystem> <OptimizeReferences>true</OptimizeReferences> <EnableCOMDATFolding>true</EnableCOMDATFolding> <RandomizedBaseAddress>false</RandomizedBaseAddress> <DataExecutionPrevention> </DataExecutionPrevention> <TargetMachine>MachineX86</TargetMachine> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ClCompile> <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <BufferSecurityCheck>false</BufferSecurityCheck> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> </ClCompile> <Link> <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'"> <Midl> <TargetEnvironment>Itanium</TargetEnvironment> </Midl> <ClCompile> <Optimization>Disabled</Optimization> <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>true</MinimalRebuild> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <BufferSecurityCheck>false</BufferSecurityCheck> <PrecompiledHeader> </PrecompiledHeader> <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <OutputFile>$(OutDir)testzlib.exe</OutputFile> <GenerateDebugInformation>true</GenerateDebugInformation> <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <TargetMachine>MachineIA64</TargetMachine> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'"> <ClCompile> <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <BufferSecurityCheck>false</BufferSecurityCheck> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> </ClCompile> <Link> <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'"> <Midl> <TargetEnvironment>Itanium</TargetEnvironment> </Midl> <ClCompile> <Optimization>MaxSpeed</Optimization> <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> <OmitFramePointers>true</OmitFramePointers> <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <BufferSecurityCheck>false</BufferSecurityCheck> <FunctionLevelLinking>true</FunctionLevelLinking> <PrecompiledHeader> </PrecompiledHeader> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <OutputFile>$(OutDir)testzlib.exe</OutputFile> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Console</SubSystem> <OptimizeReferences>true</OptimizeReferences> <EnableCOMDATFolding>true</EnableCOMDATFolding> <TargetMachine>MachineIA64</TargetMachine> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <BufferSecurityCheck>false</BufferSecurityCheck> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> </ClCompile> <Link> <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'"> <Midl> <TargetEnvironment>Itanium</TargetEnvironment> </Midl> <ClCompile> <Optimization>MaxSpeed</Optimization> <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> <OmitFramePointers>true</OmitFramePointers> <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <BasicRuntimeChecks>Default</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <BufferSecurityCheck>false</BufferSecurityCheck> <FunctionLevelLinking>true</FunctionLevelLinking> <PrecompiledHeader> </PrecompiledHeader> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <OutputFile>$(OutDir)testzlib.exe</OutputFile> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Console</SubSystem> <OptimizeReferences>true</OptimizeReferences> <EnableCOMDATFolding>true</EnableCOMDATFolding> <TargetMachine>MachineIA64</TargetMachine> </Link> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\..\..\adler32.c" /> <ClCompile Include="..\..\..\compress.c" /> <ClCompile Include="..\..\..\crc32.c" /> <ClCompile Include="..\..\..\deflate.c" /> <ClCompile Include="..\..\..\infback.c" /> <ClCompile Include="..\..\masmx64\inffas8664.c"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> </ClCompile> <ClCompile Include="..\..\..\inffast.c" /> <ClCompile Include="..\..\..\inflate.c" /> <ClCompile Include="..\..\..\inftrees.c" /> <ClCompile Include="..\..\testzlib\testzlib.c" /> <ClCompile Include="..\..\..\trees.c" /> <ClCompile Include="..\..\..\uncompr.c" /> <ClCompile Include="..\..\..\zutil.c" /> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> </Project>
{ "pile_set_name": "Github" }
{ "AEli": "ร†", "AElig": "ร†", "AM": "&", "AMP": "&", "Aacut": "ร", "Aacute": "ร", "Abreve": "ฤ‚", "Acir": "ร‚", "Acirc": "ร‚", "Acy": "ะ", "Afr": "๐”„", "Agrav": "ร€", "Agrave": "ร€", "Alpha": "ฮ‘", "Amacr": "ฤ€", "And": "โฉ“", "Aogon": "ฤ„", "Aopf": "๐”ธ", "ApplyFunction": "โก", "Arin": "ร…", "Aring": "ร…", "Ascr": "๐’œ", "Assign": "โ‰”", "Atild": "รƒ", "Atilde": "รƒ", "Aum": "ร„", "Auml": "ร„", "Backslash": "โˆ–", "Barv": "โซง", "Barwed": "โŒ†", "Bcy": "ะ‘", "Because": "โˆต", "Bernoullis": "โ„ฌ", "Beta": "ฮ’", "Bfr": "๐”…", "Bopf": "๐”น", "Breve": "ห˜", "Bscr": "โ„ฌ", "Bumpeq": "โ‰Ž", "CHcy": "ะง", "COP": "ยฉ", "COPY": "ยฉ", "Cacute": "ฤ†", "Cap": "โ‹’", "CapitalDifferentialD": "โ……", "Cayleys": "โ„ญ", "Ccaron": "ฤŒ", "Ccedi": "ร‡", "Ccedil": "ร‡", "Ccirc": "ฤˆ", "Cconint": "โˆฐ", "Cdot": "ฤŠ", "Cedilla": "ยธ", "CenterDot": "ยท", "Cfr": "โ„ญ", "Chi": "ฮง", "CircleDot": "โŠ™", "CircleMinus": "โŠ–", "CirclePlus": "โŠ•", "CircleTimes": "โŠ—", "ClockwiseContourIntegral": "โˆฒ", "CloseCurlyDoubleQuote": "โ€", "CloseCurlyQuote": "โ€™", "Colon": "โˆท", "Colone": "โฉด", "Congruent": "โ‰ก", "Conint": "โˆฏ", "ContourIntegral": "โˆฎ", "Copf": "โ„‚", "Coproduct": "โˆ", "CounterClockwiseContourIntegral": "โˆณ", "Cross": "โจฏ", "Cscr": "๐’ž", "Cup": "โ‹“", "CupCap": "โ‰", "DD": "โ……", "DDotrahd": "โค‘", "DJcy": "ะ‚", "DScy": "ะ…", "DZcy": "ะ", "Dagger": "โ€ก", "Darr": "โ†ก", "Dashv": "โซค", "Dcaron": "ฤŽ", "Dcy": "ะ”", "Del": "โˆ‡", "Delta": "ฮ”", "Dfr": "๐”‡", "DiacriticalAcute": "ยด", "DiacriticalDot": "ห™", "DiacriticalDoubleAcute": "ห", "DiacriticalGrave": "`", "DiacriticalTilde": "หœ", "Diamond": "โ‹„", "DifferentialD": "โ…†", "Dopf": "๐”ป", "Dot": "ยจ", "DotDot": "โƒœ", "DotEqual": "โ‰", "DoubleContourIntegral": "โˆฏ", "DoubleDot": "ยจ", "DoubleDownArrow": "โ‡“", "DoubleLeftArrow": "โ‡", "DoubleLeftRightArrow": "โ‡”", "DoubleLeftTee": "โซค", "DoubleLongLeftArrow": "โŸธ", "DoubleLongLeftRightArrow": "โŸบ", "DoubleLongRightArrow": "โŸน", "DoubleRightArrow": "โ‡’", "DoubleRightTee": "โŠจ", "DoubleUpArrow": "โ‡‘", "DoubleUpDownArrow": "โ‡•", "DoubleVerticalBar": "โˆฅ", "DownArrow": "โ†“", "DownArrowBar": "โค“", "DownArrowUpArrow": "โ‡ต", "DownBreve": "ฬ‘", "DownLeftRightVector": "โฅ", "DownLeftTeeVector": "โฅž", "DownLeftVector": "โ†ฝ", "DownLeftVectorBar": "โฅ–", "DownRightTeeVector": "โฅŸ", "DownRightVector": "โ‡", "DownRightVectorBar": "โฅ—", "DownTee": "โŠค", "DownTeeArrow": "โ†ง", "Downarrow": "โ‡“", "Dscr": "๐’Ÿ", "Dstrok": "ฤ", "ENG": "ลŠ", "ET": "ร", "ETH": "ร", "Eacut": "ร‰", "Eacute": "ร‰", "Ecaron": "ฤš", "Ecir": "รŠ", "Ecirc": "รŠ", "Ecy": "ะญ", "Edot": "ฤ–", "Efr": "๐”ˆ", "Egrav": "รˆ", "Egrave": "รˆ", "Element": "โˆˆ", "Emacr": "ฤ’", "EmptySmallSquare": "โ—ป", "EmptyVerySmallSquare": "โ–ซ", "Eogon": "ฤ˜", "Eopf": "๐”ผ", "Epsilon": "ฮ•", "Equal": "โฉต", "EqualTilde": "โ‰‚", "Equilibrium": "โ‡Œ", "Escr": "โ„ฐ", "Esim": "โฉณ", "Eta": "ฮ—", "Eum": "ร‹", "Euml": "ร‹", "Exists": "โˆƒ", "ExponentialE": "โ…‡", "Fcy": "ะค", "Ffr": "๐”‰", "FilledSmallSquare": "โ—ผ", "FilledVerySmallSquare": "โ–ช", "Fopf": "๐”ฝ", "ForAll": "โˆ€", "Fouriertrf": "โ„ฑ", "Fscr": "โ„ฑ", "GJcy": "ะƒ", "G": ">", "GT": ">", "Gamma": "ฮ“", "Gammad": "ฯœ", "Gbreve": "ฤž", "Gcedil": "ฤข", "Gcirc": "ฤœ", "Gcy": "ะ“", "Gdot": "ฤ ", "Gfr": "๐”Š", "Gg": "โ‹™", "Gopf": "๐”พ", "GreaterEqual": "โ‰ฅ", "GreaterEqualLess": "โ‹›", "GreaterFullEqual": "โ‰ง", "GreaterGreater": "โชข", "GreaterLess": "โ‰ท", "GreaterSlantEqual": "โฉพ", "GreaterTilde": "โ‰ณ", "Gscr": "๐’ข", "Gt": "โ‰ซ", "HARDcy": "ะช", "Hacek": "ห‡", "Hat": "^", "Hcirc": "ฤค", "Hfr": "โ„Œ", "HilbertSpace": "โ„‹", "Hopf": "โ„", "HorizontalLine": "โ”€", "Hscr": "โ„‹", "Hstrok": "ฤฆ", "HumpDownHump": "โ‰Ž", "HumpEqual": "โ‰", "IEcy": "ะ•", "IJlig": "ฤฒ", "IOcy": "ะ", "Iacut": "ร", "Iacute": "ร", "Icir": "รŽ", "Icirc": "รŽ", "Icy": "ะ˜", "Idot": "ฤฐ", "Ifr": "โ„‘", "Igrav": "รŒ", "Igrave": "รŒ", "Im": "โ„‘", "Imacr": "ฤช", "ImaginaryI": "โ…ˆ", "Implies": "โ‡’", "Int": "โˆฌ", "Integral": "โˆซ", "Intersection": "โ‹‚", "InvisibleComma": "โฃ", "InvisibleTimes": "โข", "Iogon": "ฤฎ", "Iopf": "๐•€", "Iota": "ฮ™", "Iscr": "โ„", "Itilde": "ฤจ", "Iukcy": "ะ†", "Ium": "ร", "Iuml": "ร", "Jcirc": "ฤด", "Jcy": "ะ™", "Jfr": "๐”", "Jopf": "๐•", "Jscr": "๐’ฅ", "Jsercy": "ะˆ", "Jukcy": "ะ„", "KHcy": "ะฅ", "KJcy": "ะŒ", "Kappa": "ฮš", "Kcedil": "ฤถ", "Kcy": "ะš", "Kfr": "๐”Ž", "Kopf": "๐•‚", "Kscr": "๐’ฆ", "LJcy": "ะ‰", "L": "<", "LT": "<", "Lacute": "ฤน", "Lambda": "ฮ›", "Lang": "โŸช", "Laplacetrf": "โ„’", "Larr": "โ†ž", "Lcaron": "ฤฝ", "Lcedil": "ฤป", "Lcy": "ะ›", "LeftAngleBracket": "โŸจ", "LeftArrow": "โ†", "LeftArrowBar": "โ‡ค", "LeftArrowRightArrow": "โ‡†", "LeftCeiling": "โŒˆ", "LeftDoubleBracket": "โŸฆ", "LeftDownTeeVector": "โฅก", "LeftDownVector": "โ‡ƒ", "LeftDownVectorBar": "โฅ™", "LeftFloor": "โŒŠ", "LeftRightArrow": "โ†”", "LeftRightVector": "โฅŽ", "LeftTee": "โŠฃ", "LeftTeeArrow": "โ†ค", "LeftTeeVector": "โฅš", "LeftTriangle": "โŠฒ", "LeftTriangleBar": "โง", "LeftTriangleEqual": "โŠด", "LeftUpDownVector": "โฅ‘", "LeftUpTeeVector": "โฅ ", "LeftUpVector": "โ†ฟ", "LeftUpVectorBar": "โฅ˜", "LeftVector": "โ†ผ", "LeftVectorBar": "โฅ’", "Leftarrow": "โ‡", "Leftrightarrow": "โ‡”", "LessEqualGreater": "โ‹š", "LessFullEqual": "โ‰ฆ", "LessGreater": "โ‰ถ", "LessLess": "โชก", "LessSlantEqual": "โฉฝ", "LessTilde": "โ‰ฒ", "Lfr": "๐”", "Ll": "โ‹˜", "Lleftarrow": "โ‡š", "Lmidot": "ฤฟ", "LongLeftArrow": "โŸต", "LongLeftRightArrow": "โŸท", "LongRightArrow": "โŸถ", "Longleftarrow": "โŸธ", "Longleftrightarrow": "โŸบ", "Longrightarrow": "โŸน", "Lopf": "๐•ƒ", "LowerLeftArrow": "โ†™", "LowerRightArrow": "โ†˜", "Lscr": "โ„’", "Lsh": "โ†ฐ", "Lstrok": "ล", "Lt": "โ‰ช", "Map": "โค…", "Mcy": "ะœ", "MediumSpace": "โŸ", "Mellintrf": "โ„ณ", "Mfr": "๐”", "MinusPlus": "โˆ“", "Mopf": "๐•„", "Mscr": "โ„ณ", "Mu": "ฮœ", "NJcy": "ะŠ", "Nacute": "ลƒ", "Ncaron": "ล‡", "Ncedil": "ล…", "Ncy": "ะ", "NegativeMediumSpace": "โ€‹", "NegativeThickSpace": "โ€‹", "NegativeThinSpace": "โ€‹", "NegativeVeryThinSpace": "โ€‹", "NestedGreaterGreater": "โ‰ซ", "NestedLessLess": "โ‰ช", "NewLine": "\n", "Nfr": "๐”‘", "NoBreak": "โ ", "NonBreakingSpace": "ย ", "Nopf": "โ„•", "Not": "โซฌ", "NotCongruent": "โ‰ข", "NotCupCap": "โ‰ญ", "NotDoubleVerticalBar": "โˆฆ", "NotElement": "โˆ‰", "NotEqual": "โ‰ ", "NotEqualTilde": "โ‰‚ฬธ", "NotExists": "โˆ„", "NotGreater": "โ‰ฏ", "NotGreaterEqual": "โ‰ฑ", "NotGreaterFullEqual": "โ‰งฬธ", "NotGreaterGreater": "โ‰ซฬธ", "NotGreaterLess": "โ‰น", "NotGreaterSlantEqual": "โฉพฬธ", "NotGreaterTilde": "โ‰ต", "NotHumpDownHump": "โ‰Žฬธ", "NotHumpEqual": "โ‰ฬธ", "NotLeftTriangle": "โ‹ช", "NotLeftTriangleBar": "โงฬธ", "NotLeftTriangleEqual": "โ‹ฌ", "NotLess": "โ‰ฎ", "NotLessEqual": "โ‰ฐ", "NotLessGreater": "โ‰ธ", "NotLessLess": "โ‰ชฬธ", "NotLessSlantEqual": "โฉฝฬธ", "NotLessTilde": "โ‰ด", "NotNestedGreaterGreater": "โชขฬธ", "NotNestedLessLess": "โชกฬธ", "NotPrecedes": "โŠ€", "NotPrecedesEqual": "โชฏฬธ", "NotPrecedesSlantEqual": "โ‹ ", "NotReverseElement": "โˆŒ", "NotRightTriangle": "โ‹ซ", "NotRightTriangleBar": "โงฬธ", "NotRightTriangleEqual": "โ‹ญ", "NotSquareSubset": "โŠฬธ", "NotSquareSubsetEqual": "โ‹ข", "NotSquareSuperset": "โАฬธ", "NotSquareSupersetEqual": "โ‹ฃ", "NotSubset": "โŠ‚โƒ’", "NotSubsetEqual": "โŠˆ", "NotSucceeds": "โЁ", "NotSucceedsEqual": "โชฐฬธ", "NotSucceedsSlantEqual": "โ‹ก", "NotSucceedsTilde": "โ‰ฟฬธ", "NotSuperset": "โŠƒโƒ’", "NotSupersetEqual": "โЉ", "NotTilde": "โ‰", "NotTildeEqual": "โ‰„", "NotTildeFullEqual": "โ‰‡", "NotTildeTilde": "โ‰‰", "NotVerticalBar": "โˆค", "Nscr": "๐’ฉ", "Ntild": "ร‘", "Ntilde": "ร‘", "Nu": "ฮ", "OElig": "ล’", "Oacut": "ร“", "Oacute": "ร“", "Ocir": "ร”", "Ocirc": "ร”", "Ocy": "ะž", "Odblac": "ล", "Ofr": "๐”’", "Ograv": "ร’", "Ograve": "ร’", "Omacr": "ลŒ", "Omega": "ฮฉ", "Omicron": "ฮŸ", "Oopf": "๐•†", "OpenCurlyDoubleQuote": "โ€œ", "OpenCurlyQuote": "โ€˜", "Or": "โฉ”", "Oscr": "๐’ช", "Oslas": "ร˜", "Oslash": "ร˜", "Otild": "ร•", "Otilde": "ร•", "Otimes": "โจท", "Oum": "ร–", "Ouml": "ร–", "OverBar": "โ€พ", "OverBrace": "โž", "OverBracket": "โŽด", "OverParenthesis": "โœ", "PartialD": "โˆ‚", "Pcy": "ะŸ", "Pfr": "๐”“", "Phi": "ฮฆ", "Pi": "ฮ ", "PlusMinus": "ยฑ", "Poincareplane": "โ„Œ", "Popf": "โ„™", "Pr": "โชป", "Precedes": "โ‰บ", "PrecedesEqual": "โชฏ", "PrecedesSlantEqual": "โ‰ผ", "PrecedesTilde": "โ‰พ", "Prime": "โ€ณ", "Product": "โˆ", "Proportion": "โˆท", "Proportional": "โˆ", "Pscr": "๐’ซ", "Psi": "ฮจ", "QUO": "\"", "QUOT": "\"", "Qfr": "๐””", "Qopf": "โ„š", "Qscr": "๐’ฌ", "RBarr": "โค", "RE": "ยฎ", "REG": "ยฎ", "Racute": "ล”", "Rang": "โŸซ", "Rarr": "โ† ", "Rarrtl": "โค–", "Rcaron": "ล˜", "Rcedil": "ล–", "Rcy": "ะ ", "Re": "โ„œ", "ReverseElement": "โˆ‹", "ReverseEquilibrium": "โ‡‹", "ReverseUpEquilibrium": "โฅฏ", "Rfr": "โ„œ", "Rho": "ฮก", "RightAngleBracket": "โŸฉ", "RightArrow": "โ†’", "RightArrowBar": "โ‡ฅ", "RightArrowLeftArrow": "โ‡„", "RightCeiling": "โŒ‰", "RightDoubleBracket": "โŸง", "RightDownTeeVector": "โฅ", "RightDownVector": "โ‡‚", "RightDownVectorBar": "โฅ•", "RightFloor": "โŒ‹", "RightTee": "โŠข", "RightTeeArrow": "โ†ฆ", "RightTeeVector": "โฅ›", "RightTriangle": "โŠณ", "RightTriangleBar": "โง", "RightTriangleEqual": "โŠต", "RightUpDownVector": "โฅ", "RightUpTeeVector": "โฅœ", "RightUpVector": "โ†พ", "RightUpVectorBar": "โฅ”", "RightVector": "โ‡€", "RightVectorBar": "โฅ“", "Rightarrow": "โ‡’", "Ropf": "โ„", "RoundImplies": "โฅฐ", "Rrightarrow": "โ‡›", "Rscr": "โ„›", "Rsh": "โ†ฑ", "RuleDelayed": "โงด", "SHCHcy": "ะฉ", "SHcy": "ะจ", "SOFTcy": "ะฌ", "Sacute": "ลš", "Sc": "โชผ", "Scaron": "ล ", "Scedil": "ลž", "Scirc": "ลœ", "Scy": "ะก", "Sfr": "๐”–", "ShortDownArrow": "โ†“", "ShortLeftArrow": "โ†", "ShortRightArrow": "โ†’", "ShortUpArrow": "โ†‘", "Sigma": "ฮฃ", "SmallCircle": "โˆ˜", "Sopf": "๐•Š", "Sqrt": "โˆš", "Square": "โ–ก", "SquareIntersection": "โŠ“", "SquareSubset": "โŠ", "SquareSubsetEqual": "โŠ‘", "SquareSuperset": "โА", "SquareSupersetEqual": "โŠ’", "SquareUnion": "โŠ”", "Sscr": "๐’ฎ", "Star": "โ‹†", "Sub": "โ‹", "Subset": "โ‹", "SubsetEqual": "โІ", "Succeeds": "โ‰ป", "SucceedsEqual": "โชฐ", "SucceedsSlantEqual": "โ‰ฝ", "SucceedsTilde": "โ‰ฟ", "SuchThat": "โˆ‹", "Sum": "โˆ‘", "Sup": "โ‹‘", "Superset": "โŠƒ", "SupersetEqual": "โЇ", "Supset": "โ‹‘", "THOR": "รž", "THORN": "รž", "TRADE": "โ„ข", "TSHcy": "ะ‹", "TScy": "ะฆ", "Tab": "\t", "Tau": "ฮค", "Tcaron": "ลค", "Tcedil": "ลข", "Tcy": "ะข", "Tfr": "๐”—", "Therefore": "โˆด", "Theta": "ฮ˜", "ThickSpace": "โŸโ€Š", "ThinSpace": "โ€‰", "Tilde": "โˆผ", "TildeEqual": "โ‰ƒ", "TildeFullEqual": "โ‰…", "TildeTilde": "โ‰ˆ", "Topf": "๐•‹", "TripleDot": "โƒ›", "Tscr": "๐’ฏ", "Tstrok": "ลฆ", "Uacut": "รš", "Uacute": "รš", "Uarr": "โ†Ÿ", "Uarrocir": "โฅ‰", "Ubrcy": "ะŽ", "Ubreve": "ลฌ", "Ucir": "ร›", "Ucirc": "ร›", "Ucy": "ะฃ", "Udblac": "ลฐ", "Ufr": "๐”˜", "Ugrav": "ร™", "Ugrave": "ร™", "Umacr": "ลช", "UnderBar": "_", "UnderBrace": "โŸ", "UnderBracket": "โŽต", "UnderParenthesis": "โ", "Union": "โ‹ƒ", "UnionPlus": "โŠŽ", "Uogon": "ลฒ", "Uopf": "๐•Œ", "UpArrow": "โ†‘", "UpArrowBar": "โค’", "UpArrowDownArrow": "โ‡…", "UpDownArrow": "โ†•", "UpEquilibrium": "โฅฎ", "UpTee": "โŠฅ", "UpTeeArrow": "โ†ฅ", "Uparrow": "โ‡‘", "Updownarrow": "โ‡•", "UpperLeftArrow": "โ†–", "UpperRightArrow": "โ†—", "Upsi": "ฯ’", "Upsilon": "ฮฅ", "Uring": "ลฎ", "Uscr": "๐’ฐ", "Utilde": "ลจ", "Uum": "รœ", "Uuml": "รœ", "VDash": "โŠซ", "Vbar": "โซซ", "Vcy": "ะ’", "Vdash": "โŠฉ", "Vdashl": "โซฆ", "Vee": "โ‹", "Verbar": "โ€–", "Vert": "โ€–", "VerticalBar": "โˆฃ", "VerticalLine": "|", "VerticalSeparator": "โ˜", "VerticalTilde": "โ‰€", "VeryThinSpace": "โ€Š", "Vfr": "๐”™", "Vopf": "๐•", "Vscr": "๐’ฑ", "Vvdash": "โŠช", "Wcirc": "ลด", "Wedge": "โ‹€", "Wfr": "๐”š", "Wopf": "๐•Ž", "Wscr": "๐’ฒ", "Xfr": "๐”›", "Xi": "ฮž", "Xopf": "๐•", "Xscr": "๐’ณ", "YAcy": "ะฏ", "YIcy": "ะ‡", "YUcy": "ะฎ", "Yacut": "ร", "Yacute": "ร", "Ycirc": "ลถ", "Ycy": "ะซ", "Yfr": "๐”œ", "Yopf": "๐•", "Yscr": "๐’ด", "Yuml": "ลธ", "ZHcy": "ะ–", "Zacute": "ลน", "Zcaron": "ลฝ", "Zcy": "ะ—", "Zdot": "ลป", "ZeroWidthSpace": "โ€‹", "Zeta": "ฮ–", "Zfr": "โ„จ", "Zopf": "โ„ค", "Zscr": "๐’ต", "aacut": "รก", "aacute": "รก", "abreve": "ฤƒ", "ac": "โˆพ", "acE": "โˆพฬณ", "acd": "โˆฟ", "acir": "รข", "acirc": "รข", "acut": "ยด", "acute": "ยด", "acy": "ะฐ", "aeli": "รฆ", "aelig": "รฆ", "af": "โก", "afr": "๐”ž", "agrav": "ร ", "agrave": "ร ", "alefsym": "โ„ต", "aleph": "โ„ต", "alpha": "ฮฑ", "amacr": "ฤ", "amalg": "โจฟ", "am": "&", "amp": "&", "and": "โˆง", "andand": "โฉ•", "andd": "โฉœ", "andslope": "โฉ˜", "andv": "โฉš", "ang": "โˆ ", "ange": "โฆค", "angle": "โˆ ", "angmsd": "โˆก", "angmsdaa": "โฆจ", "angmsdab": "โฆฉ", "angmsdac": "โฆช", "angmsdad": "โฆซ", "angmsdae": "โฆฌ", "angmsdaf": "โฆญ", "angmsdag": "โฆฎ", "angmsdah": "โฆฏ", "angrt": "โˆŸ", "angrtvb": "โŠพ", "angrtvbd": "โฆ", "angsph": "โˆข", "angst": "ร…", "angzarr": "โผ", "aogon": "ฤ…", "aopf": "๐•’", "ap": "โ‰ˆ", "apE": "โฉฐ", "apacir": "โฉฏ", "ape": "โ‰Š", "apid": "โ‰‹", "apos": "'", "approx": "โ‰ˆ", "approxeq": "โ‰Š", "arin": "รฅ", "aring": "รฅ", "ascr": "๐’ถ", "ast": "*", "asymp": "โ‰ˆ", "asympeq": "โ‰", "atild": "รฃ", "atilde": "รฃ", "aum": "รค", "auml": "รค", "awconint": "โˆณ", "awint": "โจ‘", "bNot": "โซญ", "backcong": "โ‰Œ", "backepsilon": "ฯถ", "backprime": "โ€ต", "backsim": "โˆฝ", "backsimeq": "โ‹", "barvee": "โŠฝ", "barwed": "โŒ…", "barwedge": "โŒ…", "bbrk": "โŽต", "bbrktbrk": "โŽถ", "bcong": "โ‰Œ", "bcy": "ะฑ", "bdquo": "โ€ž", "becaus": "โˆต", "because": "โˆต", "bemptyv": "โฆฐ", "bepsi": "ฯถ", "bernou": "โ„ฌ", "beta": "ฮฒ", "beth": "โ„ถ", "between": "โ‰ฌ", "bfr": "๐”Ÿ", "bigcap": "โ‹‚", "bigcirc": "โ—ฏ", "bigcup": "โ‹ƒ", "bigodot": "โจ€", "bigoplus": "โจ", "bigotimes": "โจ‚", "bigsqcup": "โจ†", "bigstar": "โ˜…", "bigtriangledown": "โ–ฝ", "bigtriangleup": "โ–ณ", "biguplus": "โจ„", "bigvee": "โ‹", "bigwedge": "โ‹€", "bkarow": "โค", "blacklozenge": "โงซ", "blacksquare": "โ–ช", "blacktriangle": "โ–ด", "blacktriangledown": "โ–พ", "blacktriangleleft": "โ—‚", "blacktriangleright": "โ–ธ", "blank": "โฃ", "blk12": "โ–’", "blk14": "โ–‘", "blk34": "โ–“", "block": "โ–ˆ", "bne": "=โƒฅ", "bnequiv": "โ‰กโƒฅ", "bnot": "โŒ", "bopf": "๐•“", "bot": "โŠฅ", "bottom": "โŠฅ", "bowtie": "โ‹ˆ", "boxDL": "โ•—", "boxDR": "โ•”", "boxDl": "โ•–", "boxDr": "โ•“", "boxH": "โ•", "boxHD": "โ•ฆ", "boxHU": "โ•ฉ", "boxHd": "โ•ค", "boxHu": "โ•ง", "boxUL": "โ•", "boxUR": "โ•š", "boxUl": "โ•œ", "boxUr": "โ•™", "boxV": "โ•‘", "boxVH": "โ•ฌ", "boxVL": "โ•ฃ", "boxVR": "โ• ", "boxVh": "โ•ซ", "boxVl": "โ•ข", "boxVr": "โ•Ÿ", "boxbox": "โง‰", "boxdL": "โ••", "boxdR": "โ•’", "boxdl": "โ”", "boxdr": "โ”Œ", "boxh": "โ”€", "boxhD": "โ•ฅ", "boxhU": "โ•จ", "boxhd": "โ”ฌ", "boxhu": "โ”ด", "boxminus": "โŠŸ", "boxplus": "โŠž", "boxtimes": "โŠ ", "boxuL": "โ•›", "boxuR": "โ•˜", "boxul": "โ”˜", "boxur": "โ””", "boxv": "โ”‚", "boxvH": "โ•ช", "boxvL": "โ•ก", "boxvR": "โ•ž", "boxvh": "โ”ผ", "boxvl": "โ”ค", "boxvr": "โ”œ", "bprime": "โ€ต", "breve": "ห˜", "brvba": "ยฆ", "brvbar": "ยฆ", "bscr": "๐’ท", "bsemi": "โ", "bsim": "โˆฝ", "bsime": "โ‹", "bsol": "\\", "bsolb": "โง…", "bsolhsub": "โŸˆ", "bull": "โ€ข", "bullet": "โ€ข", "bump": "โ‰Ž", "bumpE": "โชฎ", "bumpe": "โ‰", "bumpeq": "โ‰", "cacute": "ฤ‡", "cap": "โˆฉ", "capand": "โฉ„", "capbrcup": "โฉ‰", "capcap": "โฉ‹", "capcup": "โฉ‡", "capdot": "โฉ€", "caps": "โˆฉ๏ธ€", "caret": "โ", "caron": "ห‡", "ccaps": "โฉ", "ccaron": "ฤ", "ccedi": "รง", "ccedil": "รง", "ccirc": "ฤ‰", "ccups": "โฉŒ", "ccupssm": "โฉ", "cdot": "ฤ‹", "cedi": "ยธ", "cedil": "ยธ", "cemptyv": "โฆฒ", "cen": "ยข", "cent": "ยข", "centerdot": "ยท", "cfr": "๐” ", "chcy": "ั‡", "check": "โœ“", "checkmark": "โœ“", "chi": "ฯ‡", "cir": "โ—‹", "cirE": "โงƒ", "circ": "ห†", "circeq": "โ‰—", "circlearrowleft": "โ†บ", "circlearrowright": "โ†ป", "circledR": "ยฎ", "circledS": "โ“ˆ", "circledast": "โŠ›", "circledcirc": "โŠš", "circleddash": "โŠ", "cire": "โ‰—", "cirfnint": "โจ", "cirmid": "โซฏ", "cirscir": "โง‚", "clubs": "โ™ฃ", "clubsuit": "โ™ฃ", "colon": ":", "colone": "โ‰”", "coloneq": "โ‰”", "comma": ",", "commat": "@", "comp": "โˆ", "compfn": "โˆ˜", "complement": "โˆ", "complexes": "โ„‚", "cong": "โ‰…", "congdot": "โฉญ", "conint": "โˆฎ", "copf": "๐•”", "coprod": "โˆ", "cop": "ยฉ", "copy": "ยฉ", "copysr": "โ„—", "crarr": "โ†ต", "cross": "โœ—", "cscr": "๐’ธ", "csub": "โซ", "csube": "โซ‘", "csup": "โซ", "csupe": "โซ’", "ctdot": "โ‹ฏ", "cudarrl": "โคธ", "cudarrr": "โคต", "cuepr": "โ‹ž", "cuesc": "โ‹Ÿ", "cularr": "โ†ถ", "cularrp": "โคฝ", "cup": "โˆช", "cupbrcap": "โฉˆ", "cupcap": "โฉ†", "cupcup": "โฉŠ", "cupdot": "โŠ", "cupor": "โฉ…", "cups": "โˆช๏ธ€", "curarr": "โ†ท", "curarrm": "โคผ", "curlyeqprec": "โ‹ž", "curlyeqsucc": "โ‹Ÿ", "curlyvee": "โ‹Ž", "curlywedge": "โ‹", "curre": "ยค", "curren": "ยค", "curvearrowleft": "โ†ถ", "curvearrowright": "โ†ท", "cuvee": "โ‹Ž", "cuwed": "โ‹", "cwconint": "โˆฒ", "cwint": "โˆฑ", "cylcty": "โŒญ", "dArr": "โ‡“", "dHar": "โฅฅ", "dagger": "โ€ ", "daleth": "โ„ธ", "darr": "โ†“", "dash": "โ€", "dashv": "โŠฃ", "dbkarow": "โค", "dblac": "ห", "dcaron": "ฤ", "dcy": "ะด", "dd": "โ…†", "ddagger": "โ€ก", "ddarr": "โ‡Š", "ddotseq": "โฉท", "de": "ยฐ", "deg": "ยฐ", "delta": "ฮด", "demptyv": "โฆฑ", "dfisht": "โฅฟ", "dfr": "๐”ก", "dharl": "โ‡ƒ", "dharr": "โ‡‚", "diam": "โ‹„", "diamond": "โ‹„", "diamondsuit": "โ™ฆ", "diams": "โ™ฆ", "die": "ยจ", "digamma": "ฯ", "disin": "โ‹ฒ", "div": "รท", "divid": "รท", "divide": "รท", "divideontimes": "โ‹‡", "divonx": "โ‹‡", "djcy": "ั’", "dlcorn": "โŒž", "dlcrop": "โŒ", "dollar": "$", "dopf": "๐••", "dot": "ห™", "doteq": "โ‰", "doteqdot": "โ‰‘", "dotminus": "โˆธ", "dotplus": "โˆ”", "dotsquare": "โŠก", "doublebarwedge": "โŒ†", "downarrow": "โ†“", "downdownarrows": "โ‡Š", "downharpoonleft": "โ‡ƒ", "downharpoonright": "โ‡‚", "drbkarow": "โค", "drcorn": "โŒŸ", "drcrop": "โŒŒ", "dscr": "๐’น", "dscy": "ั•", "dsol": "โงถ", "dstrok": "ฤ‘", "dtdot": "โ‹ฑ", "dtri": "โ–ฟ", "dtrif": "โ–พ", "duarr": "โ‡ต", "duhar": "โฅฏ", "dwangle": "โฆฆ", "dzcy": "ัŸ", "dzigrarr": "โŸฟ", "eDDot": "โฉท", "eDot": "โ‰‘", "eacut": "รฉ", "eacute": "รฉ", "easter": "โฉฎ", "ecaron": "ฤ›", "ecir": "รช", "ecirc": "รช", "ecolon": "โ‰•", "ecy": "ั", "edot": "ฤ—", "ee": "โ…‡", "efDot": "โ‰’", "efr": "๐”ข", "eg": "โชš", "egrav": "รจ", "egrave": "รจ", "egs": "โช–", "egsdot": "โช˜", "el": "โช™", "elinters": "โง", "ell": "โ„“", "els": "โช•", "elsdot": "โช—", "emacr": "ฤ“", "empty": "โˆ…", "emptyset": "โˆ…", "emptyv": "โˆ…", "emsp13": "โ€„", "emsp14": "โ€…", "emsp": "โ€ƒ", "eng": "ล‹", "ensp": "โ€‚", "eogon": "ฤ™", "eopf": "๐•–", "epar": "โ‹•", "eparsl": "โงฃ", "eplus": "โฉฑ", "epsi": "ฮต", "epsilon": "ฮต", "epsiv": "ฯต", "eqcirc": "โ‰–", "eqcolon": "โ‰•", "eqsim": "โ‰‚", "eqslantgtr": "โช–", "eqslantless": "โช•", "equals": "=", "equest": "โ‰Ÿ", "equiv": "โ‰ก", "equivDD": "โฉธ", "eqvparsl": "โงฅ", "erDot": "โ‰“", "erarr": "โฅฑ", "escr": "โ„ฏ", "esdot": "โ‰", "esim": "โ‰‚", "eta": "ฮท", "et": "รฐ", "eth": "รฐ", "eum": "รซ", "euml": "รซ", "euro": "โ‚ฌ", "excl": "!", "exist": "โˆƒ", "expectation": "โ„ฐ", "exponentiale": "โ…‡", "fallingdotseq": "โ‰’", "fcy": "ั„", "female": "โ™€", "ffilig": "๏ฌƒ", "fflig": "๏ฌ€", "ffllig": "๏ฌ„", "ffr": "๐”ฃ", "filig": "๏ฌ", "fjlig": "fj", "flat": "โ™ญ", "fllig": "๏ฌ‚", "fltns": "โ–ฑ", "fnof": "ฦ’", "fopf": "๐•—", "forall": "โˆ€", "fork": "โ‹”", "forkv": "โซ™", "fpartint": "โจ", "frac1": "ยผ", "frac12": "ยฝ", "frac13": "โ…“", "frac14": "ยผ", "frac15": "โ…•", "frac16": "โ…™", "frac18": "โ…›", "frac23": "โ…”", "frac25": "โ…–", "frac3": "ยพ", "frac34": "ยพ", "frac35": "โ…—", "frac38": "โ…œ", "frac45": "โ…˜", "frac56": "โ…š", "frac58": "โ…", "frac78": "โ…ž", "frasl": "โ„", "frown": "โŒข", "fscr": "๐’ป", "gE": "โ‰ง", "gEl": "โชŒ", "gacute": "วต", "gamma": "ฮณ", "gammad": "ฯ", "gap": "โช†", "gbreve": "ฤŸ", "gcirc": "ฤ", "gcy": "ะณ", "gdot": "ฤก", "ge": "โ‰ฅ", "gel": "โ‹›", "geq": "โ‰ฅ", "geqq": "โ‰ง", "geqslant": "โฉพ", "ges": "โฉพ", "gescc": "โชฉ", "gesdot": "โช€", "gesdoto": "โช‚", "gesdotol": "โช„", "gesl": "โ‹›๏ธ€", "gesles": "โช”", "gfr": "๐”ค", "gg": "โ‰ซ", "ggg": "โ‹™", "gimel": "โ„ท", "gjcy": "ั“", "gl": "โ‰ท", "glE": "โช’", "gla": "โชฅ", "glj": "โชค", "gnE": "โ‰ฉ", "gnap": "โชŠ", "gnapprox": "โชŠ", "gne": "โชˆ", "gneq": "โชˆ", "gneqq": "โ‰ฉ", "gnsim": "โ‹ง", "gopf": "๐•˜", "grave": "`", "gscr": "โ„Š", "gsim": "โ‰ณ", "gsime": "โชŽ", "gsiml": "โช", "g": ">", "gt": ">", "gtcc": "โชง", "gtcir": "โฉบ", "gtdot": "โ‹—", "gtlPar": "โฆ•", "gtquest": "โฉผ", "gtrapprox": "โช†", "gtrarr": "โฅธ", "gtrdot": "โ‹—", "gtreqless": "โ‹›", "gtreqqless": "โชŒ", "gtrless": "โ‰ท", "gtrsim": "โ‰ณ", "gvertneqq": "โ‰ฉ๏ธ€", "gvnE": "โ‰ฉ๏ธ€", "hArr": "โ‡”", "hairsp": "โ€Š", "half": "ยฝ", "hamilt": "โ„‹", "hardcy": "ัŠ", "harr": "โ†”", "harrcir": "โฅˆ", "harrw": "โ†ญ", "hbar": "โ„", "hcirc": "ฤฅ", "hearts": "โ™ฅ", "heartsuit": "โ™ฅ", "hellip": "โ€ฆ", "hercon": "โŠน", "hfr": "๐”ฅ", "hksearow": "โคฅ", "hkswarow": "โคฆ", "hoarr": "โ‡ฟ", "homtht": "โˆป", "hookleftarrow": "โ†ฉ", "hookrightarrow": "โ†ช", "hopf": "๐•™", "horbar": "โ€•", "hscr": "๐’ฝ", "hslash": "โ„", "hstrok": "ฤง", "hybull": "โƒ", "hyphen": "โ€", "iacut": "รญ", "iacute": "รญ", "ic": "โฃ", "icir": "รฎ", "icirc": "รฎ", "icy": "ะธ", "iecy": "ะต", "iexc": "ยก", "iexcl": "ยก", "iff": "โ‡”", "ifr": "๐”ฆ", "igrav": "รฌ", "igrave": "รฌ", "ii": "โ…ˆ", "iiiint": "โจŒ", "iiint": "โˆญ", "iinfin": "โงœ", "iiota": "โ„ฉ", "ijlig": "ฤณ", "imacr": "ฤซ", "image": "โ„‘", "imagline": "โ„", "imagpart": "โ„‘", "imath": "ฤฑ", "imof": "โŠท", "imped": "ฦต", "in": "โˆˆ", "incare": "โ„…", "infin": "โˆž", "infintie": "โง", "inodot": "ฤฑ", "int": "โˆซ", "intcal": "โŠบ", "integers": "โ„ค", "intercal": "โŠบ", "intlarhk": "โจ—", "intprod": "โจผ", "iocy": "ั‘", "iogon": "ฤฏ", "iopf": "๐•š", "iota": "ฮน", "iprod": "โจผ", "iques": "ยฟ", "iquest": "ยฟ", "iscr": "๐’พ", "isin": "โˆˆ", "isinE": "โ‹น", "isindot": "โ‹ต", "isins": "โ‹ด", "isinsv": "โ‹ณ", "isinv": "โˆˆ", "it": "โข", "itilde": "ฤฉ", "iukcy": "ั–", "ium": "รฏ", "iuml": "รฏ", "jcirc": "ฤต", "jcy": "ะน", "jfr": "๐”ง", "jmath": "ศท", "jopf": "๐•›", "jscr": "๐’ฟ", "jsercy": "ั˜", "jukcy": "ั”", "kappa": "ฮบ", "kappav": "ฯฐ", "kcedil": "ฤท", "kcy": "ะบ", "kfr": "๐”จ", "kgreen": "ฤธ", "khcy": "ั…", "kjcy": "ัœ", "kopf": "๐•œ", "kscr": "๐“€", "lAarr": "โ‡š", "lArr": "โ‡", "lAtail": "โค›", "lBarr": "โคŽ", "lE": "โ‰ฆ", "lEg": "โช‹", "lHar": "โฅข", "lacute": "ฤบ", "laemptyv": "โฆด", "lagran": "โ„’", "lambda": "ฮป", "lang": "โŸจ", "langd": "โฆ‘", "langle": "โŸจ", "lap": "โช…", "laqu": "ยซ", "laquo": "ยซ", "larr": "โ†", "larrb": "โ‡ค", "larrbfs": "โคŸ", "larrfs": "โค", "larrhk": "โ†ฉ", "larrlp": "โ†ซ", "larrpl": "โคน", "larrsim": "โฅณ", "larrtl": "โ†ข", "lat": "โชซ", "latail": "โค™", "late": "โชญ", "lates": "โชญ๏ธ€", "lbarr": "โคŒ", "lbbrk": "โฒ", "lbrace": "{", "lbrack": "[", "lbrke": "โฆ‹", "lbrksld": "โฆ", "lbrkslu": "โฆ", "lcaron": "ฤพ", "lcedil": "ฤผ", "lceil": "โŒˆ", "lcub": "{", "lcy": "ะป", "ldca": "โคถ", "ldquo": "โ€œ", "ldquor": "โ€ž", "ldrdhar": "โฅง", "ldrushar": "โฅ‹", "ldsh": "โ†ฒ", "le": "โ‰ค", "leftarrow": "โ†", "leftarrowtail": "โ†ข", "leftharpoondown": "โ†ฝ", "leftharpoonup": "โ†ผ", "leftleftarrows": "โ‡‡", "leftrightarrow": "โ†”", "leftrightarrows": "โ‡†", "leftrightharpoons": "โ‡‹", "leftrightsquigarrow": "โ†ญ", "leftthreetimes": "โ‹‹", "leg": "โ‹š", "leq": "โ‰ค", "leqq": "โ‰ฆ", "leqslant": "โฉฝ", "les": "โฉฝ", "lescc": "โชจ", "lesdot": "โฉฟ", "lesdoto": "โช", "lesdotor": "โชƒ", "lesg": "โ‹š๏ธ€", "lesges": "โช“", "lessapprox": "โช…", "lessdot": "โ‹–", "lesseqgtr": "โ‹š", "lesseqqgtr": "โช‹", "lessgtr": "โ‰ถ", "lesssim": "โ‰ฒ", "lfisht": "โฅผ", "lfloor": "โŒŠ", "lfr": "๐”ฉ", "lg": "โ‰ถ", "lgE": "โช‘", "lhard": "โ†ฝ", "lharu": "โ†ผ", "lharul": "โฅช", "lhblk": "โ–„", "ljcy": "ั™", "ll": "โ‰ช", "llarr": "โ‡‡", "llcorner": "โŒž", "llhard": "โฅซ", "lltri": "โ—บ", "lmidot": "ล€", "lmoust": "โŽฐ", "lmoustache": "โŽฐ", "lnE": "โ‰จ", "lnap": "โช‰", "lnapprox": "โช‰", "lne": "โช‡", "lneq": "โช‡", "lneqq": "โ‰จ", "lnsim": "โ‹ฆ", "loang": "โŸฌ", "loarr": "โ‡ฝ", "lobrk": "โŸฆ", "longleftarrow": "โŸต", "longleftrightarrow": "โŸท", "longmapsto": "โŸผ", "longrightarrow": "โŸถ", "looparrowleft": "โ†ซ", "looparrowright": "โ†ฌ", "lopar": "โฆ…", "lopf": "๐•", "loplus": "โจญ", "lotimes": "โจด", "lowast": "โˆ—", "lowbar": "_", "loz": "โ—Š", "lozenge": "โ—Š", "lozf": "โงซ", "lpar": "(", "lparlt": "โฆ“", "lrarr": "โ‡†", "lrcorner": "โŒŸ", "lrhar": "โ‡‹", "lrhard": "โฅญ", "lrm": "โ€Ž", "lrtri": "โŠฟ", "lsaquo": "โ€น", "lscr": "๐“", "lsh": "โ†ฐ", "lsim": "โ‰ฒ", "lsime": "โช", "lsimg": "โช", "lsqb": "[", "lsquo": "โ€˜", "lsquor": "โ€š", "lstrok": "ล‚", "l": "<", "lt": "<", "ltcc": "โชฆ", "ltcir": "โฉน", "ltdot": "โ‹–", "lthree": "โ‹‹", "ltimes": "โ‹‰", "ltlarr": "โฅถ", "ltquest": "โฉป", "ltrPar": "โฆ–", "ltri": "โ—ƒ", "ltrie": "โŠด", "ltrif": "โ—‚", "lurdshar": "โฅŠ", "luruhar": "โฅฆ", "lvertneqq": "โ‰จ๏ธ€", "lvnE": "โ‰จ๏ธ€", "mDDot": "โˆบ", "mac": "ยฏ", "macr": "ยฏ", "male": "โ™‚", "malt": "โœ ", "maltese": "โœ ", "map": "โ†ฆ", "mapsto": "โ†ฆ", "mapstodown": "โ†ง", "mapstoleft": "โ†ค", "mapstoup": "โ†ฅ", "marker": "โ–ฎ", "mcomma": "โจฉ", "mcy": "ะผ", "mdash": "โ€”", "measuredangle": "โˆก", "mfr": "๐”ช", "mho": "โ„ง", "micr": "ยต", "micro": "ยต", "mid": "โˆฃ", "midast": "*", "midcir": "โซฐ", "middo": "ยท", "middot": "ยท", "minus": "โˆ’", "minusb": "โŠŸ", "minusd": "โˆธ", "minusdu": "โจช", "mlcp": "โซ›", "mldr": "โ€ฆ", "mnplus": "โˆ“", "models": "โŠง", "mopf": "๐•ž", "mp": "โˆ“", "mscr": "๐“‚", "mstpos": "โˆพ", "mu": "ฮผ", "multimap": "โŠธ", "mumap": "โŠธ", "nGg": "โ‹™ฬธ", "nGt": "โ‰ซโƒ’", "nGtv": "โ‰ซฬธ", "nLeftarrow": "โ‡", "nLeftrightarrow": "โ‡Ž", "nLl": "โ‹˜ฬธ", "nLt": "โ‰ชโƒ’", "nLtv": "โ‰ชฬธ", "nRightarrow": "โ‡", "nVDash": "โŠฏ", "nVdash": "โŠฎ", "nabla": "โˆ‡", "nacute": "ล„", "nang": "โˆ โƒ’", "nap": "โ‰‰", "napE": "โฉฐฬธ", "napid": "โ‰‹ฬธ", "napos": "ล‰", "napprox": "โ‰‰", "natur": "โ™ฎ", "natural": "โ™ฎ", "naturals": "โ„•", "nbs": "ย ", "nbsp": "ย ", "nbump": "โ‰Žฬธ", "nbumpe": "โ‰ฬธ", "ncap": "โฉƒ", "ncaron": "ลˆ", "ncedil": "ล†", "ncong": "โ‰‡", "ncongdot": "โฉญฬธ", "ncup": "โฉ‚", "ncy": "ะฝ", "ndash": "โ€“", "ne": "โ‰ ", "neArr": "โ‡—", "nearhk": "โคค", "nearr": "โ†—", "nearrow": "โ†—", "nedot": "โ‰ฬธ", "nequiv": "โ‰ข", "nesear": "โคจ", "nesim": "โ‰‚ฬธ", "nexist": "โˆ„", "nexists": "โˆ„", "nfr": "๐”ซ", "ngE": "โ‰งฬธ", "nge": "โ‰ฑ", "ngeq": "โ‰ฑ", "ngeqq": "โ‰งฬธ", "ngeqslant": "โฉพฬธ", "nges": "โฉพฬธ", "ngsim": "โ‰ต", "ngt": "โ‰ฏ", "ngtr": "โ‰ฏ", "nhArr": "โ‡Ž", "nharr": "โ†ฎ", "nhpar": "โซฒ", "ni": "โˆ‹", "nis": "โ‹ผ", "nisd": "โ‹บ", "niv": "โˆ‹", "njcy": "ัš", "nlArr": "โ‡", "nlE": "โ‰ฆฬธ", "nlarr": "โ†š", "nldr": "โ€ฅ", "nle": "โ‰ฐ", "nleftarrow": "โ†š", "nleftrightarrow": "โ†ฎ", "nleq": "โ‰ฐ", "nleqq": "โ‰ฆฬธ", "nleqslant": "โฉฝฬธ", "nles": "โฉฝฬธ", "nless": "โ‰ฎ", "nlsim": "โ‰ด", "nlt": "โ‰ฎ", "nltri": "โ‹ช", "nltrie": "โ‹ฌ", "nmid": "โˆค", "nopf": "๐•Ÿ", "no": "ยฌ", "not": "ยฌ", "notin": "โˆ‰", "notinE": "โ‹นฬธ", "notindot": "โ‹ตฬธ", "notinva": "โˆ‰", "notinvb": "โ‹ท", "notinvc": "โ‹ถ", "notni": "โˆŒ", "notniva": "โˆŒ", "notnivb": "โ‹พ", "notnivc": "โ‹ฝ", "npar": "โˆฆ", "nparallel": "โˆฆ", "nparsl": "โซฝโƒฅ", "npart": "โˆ‚ฬธ", "npolint": "โจ”", "npr": "โŠ€", "nprcue": "โ‹ ", "npre": "โชฏฬธ", "nprec": "โŠ€", "npreceq": "โชฏฬธ", "nrArr": "โ‡", "nrarr": "โ†›", "nrarrc": "โคณฬธ", "nrarrw": "โ†ฬธ", "nrightarrow": "โ†›", "nrtri": "โ‹ซ", "nrtrie": "โ‹ญ", "nsc": "โЁ", "nsccue": "โ‹ก", "nsce": "โชฐฬธ", "nscr": "๐“ƒ", "nshortmid": "โˆค", "nshortparallel": "โˆฆ", "nsim": "โ‰", "nsime": "โ‰„", "nsimeq": "โ‰„", "nsmid": "โˆค", "nspar": "โˆฆ", "nsqsube": "โ‹ข", "nsqsupe": "โ‹ฃ", "nsub": "โŠ„", "nsubE": "โซ…ฬธ", "nsube": "โŠˆ", "nsubset": "โŠ‚โƒ’", "nsubseteq": "โŠˆ", "nsubseteqq": "โซ…ฬธ", "nsucc": "โЁ", "nsucceq": "โชฐฬธ", "nsup": "โŠ…", "nsupE": "โซ†ฬธ", "nsupe": "โЉ", "nsupset": "โŠƒโƒ’", "nsupseteq": "โЉ", "nsupseteqq": "โซ†ฬธ", "ntgl": "โ‰น", "ntild": "รฑ", "ntilde": "รฑ", "ntlg": "โ‰ธ", "ntriangleleft": "โ‹ช", "ntrianglelefteq": "โ‹ฌ", "ntriangleright": "โ‹ซ", "ntrianglerighteq": "โ‹ญ", "nu": "ฮฝ", "num": "#", "numero": "โ„–", "numsp": "โ€‡", "nvDash": "โŠญ", "nvHarr": "โค„", "nvap": "โ‰โƒ’", "nvdash": "โŠฌ", "nvge": "โ‰ฅโƒ’", "nvgt": ">โƒ’", "nvinfin": "โงž", "nvlArr": "โค‚", "nvle": "โ‰คโƒ’", "nvlt": "<โƒ’", "nvltrie": "โŠดโƒ’", "nvrArr": "โคƒ", "nvrtrie": "โŠตโƒ’", "nvsim": "โˆผโƒ’", "nwArr": "โ‡–", "nwarhk": "โคฃ", "nwarr": "โ†–", "nwarrow": "โ†–", "nwnear": "โคง", "oS": "โ“ˆ", "oacut": "รณ", "oacute": "รณ", "oast": "โŠ›", "ocir": "รด", "ocirc": "รด", "ocy": "ะพ", "odash": "โŠ", "odblac": "ล‘", "odiv": "โจธ", "odot": "โŠ™", "odsold": "โฆผ", "oelig": "ล“", "ofcir": "โฆฟ", "ofr": "๐”ฌ", "ogon": "ห›", "ograv": "รฒ", "ograve": "รฒ", "ogt": "โง", "ohbar": "โฆต", "ohm": "ฮฉ", "oint": "โˆฎ", "olarr": "โ†บ", "olcir": "โฆพ", "olcross": "โฆป", "oline": "โ€พ", "olt": "โง€", "omacr": "ล", "omega": "ฯ‰", "omicron": "ฮฟ", "omid": "โฆถ", "ominus": "โŠ–", "oopf": "๐• ", "opar": "โฆท", "operp": "โฆน", "oplus": "โŠ•", "or": "โˆจ", "orarr": "โ†ป", "ord": "ยบ", "order": "โ„ด", "orderof": "โ„ด", "ordf": "ยช", "ordm": "ยบ", "origof": "โŠถ", "oror": "โฉ–", "orslope": "โฉ—", "orv": "โฉ›", "oscr": "โ„ด", "oslas": "รธ", "oslash": "รธ", "osol": "โŠ˜", "otild": "รต", "otilde": "รต", "otimes": "โŠ—", "otimesas": "โจถ", "oum": "รถ", "ouml": "รถ", "ovbar": "โŒฝ", "par": "ยถ", "para": "ยถ", "parallel": "โˆฅ", "parsim": "โซณ", "parsl": "โซฝ", "part": "โˆ‚", "pcy": "ะฟ", "percnt": "%", "period": ".", "permil": "โ€ฐ", "perp": "โŠฅ", "pertenk": "โ€ฑ", "pfr": "๐”ญ", "phi": "ฯ†", "phiv": "ฯ•", "phmmat": "โ„ณ", "phone": "โ˜Ž", "pi": "ฯ€", "pitchfork": "โ‹”", "piv": "ฯ–", "planck": "โ„", "planckh": "โ„Ž", "plankv": "โ„", "plus": "+", "plusacir": "โจฃ", "plusb": "โŠž", "pluscir": "โจข", "plusdo": "โˆ”", "plusdu": "โจฅ", "pluse": "โฉฒ", "plusm": "ยฑ", "plusmn": "ยฑ", "plussim": "โจฆ", "plustwo": "โจง", "pm": "ยฑ", "pointint": "โจ•", "popf": "๐•ก", "poun": "ยฃ", "pound": "ยฃ", "pr": "โ‰บ", "prE": "โชณ", "prap": "โชท", "prcue": "โ‰ผ", "pre": "โชฏ", "prec": "โ‰บ", "precapprox": "โชท", "preccurlyeq": "โ‰ผ", "preceq": "โชฏ", "precnapprox": "โชน", "precneqq": "โชต", "precnsim": "โ‹จ", "precsim": "โ‰พ", "prime": "โ€ฒ", "primes": "โ„™", "prnE": "โชต", "prnap": "โชน", "prnsim": "โ‹จ", "prod": "โˆ", "profalar": "โŒฎ", "profline": "โŒ’", "profsurf": "โŒ“", "prop": "โˆ", "propto": "โˆ", "prsim": "โ‰พ", "prurel": "โŠฐ", "pscr": "๐“…", "psi": "ฯˆ", "puncsp": "โ€ˆ", "qfr": "๐”ฎ", "qint": "โจŒ", "qopf": "๐•ข", "qprime": "โ—", "qscr": "๐“†", "quaternions": "โ„", "quatint": "โจ–", "quest": "?", "questeq": "โ‰Ÿ", "quo": "\"", "quot": "\"", "rAarr": "โ‡›", "rArr": "โ‡’", "rAtail": "โคœ", "rBarr": "โค", "rHar": "โฅค", "race": "โˆฝฬฑ", "racute": "ล•", "radic": "โˆš", "raemptyv": "โฆณ", "rang": "โŸฉ", "rangd": "โฆ’", "range": "โฆฅ", "rangle": "โŸฉ", "raqu": "ยป", "raquo": "ยป", "rarr": "โ†’", "rarrap": "โฅต", "rarrb": "โ‡ฅ", "rarrbfs": "โค ", "rarrc": "โคณ", "rarrfs": "โคž", "rarrhk": "โ†ช", "rarrlp": "โ†ฌ", "rarrpl": "โฅ…", "rarrsim": "โฅด", "rarrtl": "โ†ฃ", "rarrw": "โ†", "ratail": "โคš", "ratio": "โˆถ", "rationals": "โ„š", "rbarr": "โค", "rbbrk": "โณ", "rbrace": "}", "rbrack": "]", "rbrke": "โฆŒ", "rbrksld": "โฆŽ", "rbrkslu": "โฆ", "rcaron": "ล™", "rcedil": "ล—", "rceil": "โŒ‰", "rcub": "}", "rcy": "ั€", "rdca": "โคท", "rdldhar": "โฅฉ", "rdquo": "โ€", "rdquor": "โ€", "rdsh": "โ†ณ", "real": "โ„œ", "realine": "โ„›", "realpart": "โ„œ", "reals": "โ„", "rect": "โ–ญ", "re": "ยฎ", "reg": "ยฎ", "rfisht": "โฅฝ", "rfloor": "โŒ‹", "rfr": "๐”ฏ", "rhard": "โ‡", "rharu": "โ‡€", "rharul": "โฅฌ", "rho": "ฯ", "rhov": "ฯฑ", "rightarrow": "โ†’", "rightarrowtail": "โ†ฃ", "rightharpoondown": "โ‡", "rightharpoonup": "โ‡€", "rightleftarrows": "โ‡„", "rightleftharpoons": "โ‡Œ", "rightrightarrows": "โ‡‰", "rightsquigarrow": "โ†", "rightthreetimes": "โ‹Œ", "ring": "หš", "risingdotseq": "โ‰“", "rlarr": "โ‡„", "rlhar": "โ‡Œ", "rlm": "โ€", "rmoust": "โŽฑ", "rmoustache": "โŽฑ", "rnmid": "โซฎ", "roang": "โŸญ", "roarr": "โ‡พ", "robrk": "โŸง", "ropar": "โฆ†", "ropf": "๐•ฃ", "roplus": "โจฎ", "rotimes": "โจต", "rpar": ")", "rpargt": "โฆ”", "rppolint": "โจ’", "rrarr": "โ‡‰", "rsaquo": "โ€บ", "rscr": "๐“‡", "rsh": "โ†ฑ", "rsqb": "]", "rsquo": "โ€™", "rsquor": "โ€™", "rthree": "โ‹Œ", "rtimes": "โ‹Š", "rtri": "โ–น", "rtrie": "โŠต", "rtrif": "โ–ธ", "rtriltri": "โงŽ", "ruluhar": "โฅจ", "rx": "โ„ž", "sacute": "ล›", "sbquo": "โ€š", "sc": "โ‰ป", "scE": "โชด", "scap": "โชธ", "scaron": "ลก", "sccue": "โ‰ฝ", "sce": "โชฐ", "scedil": "ลŸ", "scirc": "ล", "scnE": "โชถ", "scnap": "โชบ", "scnsim": "โ‹ฉ", "scpolint": "โจ“", "scsim": "โ‰ฟ", "scy": "ั", "sdot": "โ‹…", "sdotb": "โŠก", "sdote": "โฉฆ", "seArr": "โ‡˜", "searhk": "โคฅ", "searr": "โ†˜", "searrow": "โ†˜", "sec": "ยง", "sect": "ยง", "semi": ";", "seswar": "โคฉ", "setminus": "โˆ–", "setmn": "โˆ–", "sext": "โœถ", "sfr": "๐”ฐ", "sfrown": "โŒข", "sharp": "โ™ฏ", "shchcy": "ั‰", "shcy": "ัˆ", "shortmid": "โˆฃ", "shortparallel": "โˆฅ", "sh": "ยญ", "shy": "ยญ", "sigma": "ฯƒ", "sigmaf": "ฯ‚", "sigmav": "ฯ‚", "sim": "โˆผ", "simdot": "โฉช", "sime": "โ‰ƒ", "simeq": "โ‰ƒ", "simg": "โชž", "simgE": "โช ", "siml": "โช", "simlE": "โชŸ", "simne": "โ‰†", "simplus": "โจค", "simrarr": "โฅฒ", "slarr": "โ†", "smallsetminus": "โˆ–", "smashp": "โจณ", "smeparsl": "โงค", "smid": "โˆฃ", "smile": "โŒฃ", "smt": "โชช", "smte": "โชฌ", "smtes": "โชฌ๏ธ€", "softcy": "ัŒ", "sol": "/", "solb": "โง„", "solbar": "โŒฟ", "sopf": "๐•ค", "spades": "โ™ ", "spadesuit": "โ™ ", "spar": "โˆฅ", "sqcap": "โŠ“", "sqcaps": "โŠ“๏ธ€", "sqcup": "โŠ”", "sqcups": "โŠ”๏ธ€", "sqsub": "โŠ", "sqsube": "โŠ‘", "sqsubset": "โŠ", "sqsubseteq": "โŠ‘", "sqsup": "โА", "sqsupe": "โŠ’", "sqsupset": "โА", "sqsupseteq": "โŠ’", "squ": "โ–ก", "square": "โ–ก", "squarf": "โ–ช", "squf": "โ–ช", "srarr": "โ†’", "sscr": "๐“ˆ", "ssetmn": "โˆ–", "ssmile": "โŒฃ", "sstarf": "โ‹†", "star": "โ˜†", "starf": "โ˜…", "straightepsilon": "ฯต", "straightphi": "ฯ•", "strns": "ยฏ", "sub": "โŠ‚", "subE": "โซ…", "subdot": "โชฝ", "sube": "โІ", "subedot": "โซƒ", "submult": "โซ", "subnE": "โซ‹", "subne": "โŠŠ", "subplus": "โชฟ", "subrarr": "โฅน", "subset": "โŠ‚", "subseteq": "โІ", "subseteqq": "โซ…", "subsetneq": "โŠŠ", "subsetneqq": "โซ‹", "subsim": "โซ‡", "subsub": "โซ•", "subsup": "โซ“", "succ": "โ‰ป", "succapprox": "โชธ", "succcurlyeq": "โ‰ฝ", "succeq": "โชฐ", "succnapprox": "โชบ", "succneqq": "โชถ", "succnsim": "โ‹ฉ", "succsim": "โ‰ฟ", "sum": "โˆ‘", "sung": "โ™ช", "sup": "โŠƒ", "sup1": "ยน", "sup2": "ยฒ", "sup3": "ยณ", "supE": "โซ†", "supdot": "โชพ", "supdsub": "โซ˜", "supe": "โЇ", "supedot": "โซ„", "suphsol": "โŸ‰", "suphsub": "โซ—", "suplarr": "โฅป", "supmult": "โซ‚", "supnE": "โซŒ", "supne": "โŠ‹", "supplus": "โซ€", "supset": "โŠƒ", "supseteq": "โЇ", "supseteqq": "โซ†", "supsetneq": "โŠ‹", "supsetneqq": "โซŒ", "supsim": "โซˆ", "supsub": "โซ”", "supsup": "โซ–", "swArr": "โ‡™", "swarhk": "โคฆ", "swarr": "โ†™", "swarrow": "โ†™", "swnwar": "โคช", "szli": "รŸ", "szlig": "รŸ", "target": "โŒ–", "tau": "ฯ„", "tbrk": "โŽด", "tcaron": "ลฅ", "tcedil": "ลฃ", "tcy": "ั‚", "tdot": "โƒ›", "telrec": "โŒ•", "tfr": "๐”ฑ", "there4": "โˆด", "therefore": "โˆด", "theta": "ฮธ", "thetasym": "ฯ‘", "thetav": "ฯ‘", "thickapprox": "โ‰ˆ", "thicksim": "โˆผ", "thinsp": "โ€‰", "thkap": "โ‰ˆ", "thksim": "โˆผ", "thor": "รพ", "thorn": "รพ", "tilde": "หœ", "time": "ร—", "times": "ร—", "timesb": "โŠ ", "timesbar": "โจฑ", "timesd": "โจฐ", "tint": "โˆญ", "toea": "โคจ", "top": "โŠค", "topbot": "โŒถ", "topcir": "โซฑ", "topf": "๐•ฅ", "topfork": "โซš", "tosa": "โคฉ", "tprime": "โ€ด", "trade": "โ„ข", "triangle": "โ–ต", "triangledown": "โ–ฟ", "triangleleft": "โ—ƒ", "trianglelefteq": "โŠด", "triangleq": "โ‰œ", "triangleright": "โ–น", "trianglerighteq": "โŠต", "tridot": "โ—ฌ", "trie": "โ‰œ", "triminus": "โจบ", "triplus": "โจน", "trisb": "โง", "tritime": "โจป", "trpezium": "โข", "tscr": "๐“‰", "tscy": "ั†", "tshcy": "ั›", "tstrok": "ลง", "twixt": "โ‰ฌ", "twoheadleftarrow": "โ†ž", "twoheadrightarrow": "โ† ", "uArr": "โ‡‘", "uHar": "โฅฃ", "uacut": "รบ", "uacute": "รบ", "uarr": "โ†‘", "ubrcy": "ัž", "ubreve": "ลญ", "ucir": "รป", "ucirc": "รป", "ucy": "ัƒ", "udarr": "โ‡…", "udblac": "ลฑ", "udhar": "โฅฎ", "ufisht": "โฅพ", "ufr": "๐”ฒ", "ugrav": "รน", "ugrave": "รน", "uharl": "โ†ฟ", "uharr": "โ†พ", "uhblk": "โ–€", "ulcorn": "โŒœ", "ulcorner": "โŒœ", "ulcrop": "โŒ", "ultri": "โ—ธ", "umacr": "ลซ", "um": "ยจ", "uml": "ยจ", "uogon": "ลณ", "uopf": "๐•ฆ", "uparrow": "โ†‘", "updownarrow": "โ†•", "upharpoonleft": "โ†ฟ", "upharpoonright": "โ†พ", "uplus": "โŠŽ", "upsi": "ฯ…", "upsih": "ฯ’", "upsilon": "ฯ…", "upuparrows": "โ‡ˆ", "urcorn": "โŒ", "urcorner": "โŒ", "urcrop": "โŒŽ", "uring": "ลฏ", "urtri": "โ—น", "uscr": "๐“Š", "utdot": "โ‹ฐ", "utilde": "ลฉ", "utri": "โ–ต", "utrif": "โ–ด", "uuarr": "โ‡ˆ", "uum": "รผ", "uuml": "รผ", "uwangle": "โฆง", "vArr": "โ‡•", "vBar": "โซจ", "vBarv": "โซฉ", "vDash": "โŠจ", "vangrt": "โฆœ", "varepsilon": "ฯต", "varkappa": "ฯฐ", "varnothing": "โˆ…", "varphi": "ฯ•", "varpi": "ฯ–", "varpropto": "โˆ", "varr": "โ†•", "varrho": "ฯฑ", "varsigma": "ฯ‚", "varsubsetneq": "โŠŠ๏ธ€", "varsubsetneqq": "โซ‹๏ธ€", "varsupsetneq": "โŠ‹๏ธ€", "varsupsetneqq": "โซŒ๏ธ€", "vartheta": "ฯ‘", "vartriangleleft": "โŠฒ", "vartriangleright": "โŠณ", "vcy": "ะฒ", "vdash": "โŠข", "vee": "โˆจ", "veebar": "โŠป", "veeeq": "โ‰š", "vellip": "โ‹ฎ", "verbar": "|", "vert": "|", "vfr": "๐”ณ", "vltri": "โŠฒ", "vnsub": "โŠ‚โƒ’", "vnsup": "โŠƒโƒ’", "vopf": "๐•ง", "vprop": "โˆ", "vrtri": "โŠณ", "vscr": "๐“‹", "vsubnE": "โซ‹๏ธ€", "vsubne": "โŠŠ๏ธ€", "vsupnE": "โซŒ๏ธ€", "vsupne": "โŠ‹๏ธ€", "vzigzag": "โฆš", "wcirc": "ลต", "wedbar": "โฉŸ", "wedge": "โˆง", "wedgeq": "โ‰™", "weierp": "โ„˜", "wfr": "๐”ด", "wopf": "๐•จ", "wp": "โ„˜", "wr": "โ‰€", "wreath": "โ‰€", "wscr": "๐“Œ", "xcap": "โ‹‚", "xcirc": "โ—ฏ", "xcup": "โ‹ƒ", "xdtri": "โ–ฝ", "xfr": "๐”ต", "xhArr": "โŸบ", "xharr": "โŸท", "xi": "ฮพ", "xlArr": "โŸธ", "xlarr": "โŸต", "xmap": "โŸผ", "xnis": "โ‹ป", "xodot": "โจ€", "xopf": "๐•ฉ", "xoplus": "โจ", "xotime": "โจ‚", "xrArr": "โŸน", "xrarr": "โŸถ", "xscr": "๐“", "xsqcup": "โจ†", "xuplus": "โจ„", "xutri": "โ–ณ", "xvee": "โ‹", "xwedge": "โ‹€", "yacut": "รฝ", "yacute": "รฝ", "yacy": "ั", "ycirc": "ลท", "ycy": "ั‹", "ye": "ยฅ", "yen": "ยฅ", "yfr": "๐”ถ", "yicy": "ั—", "yopf": "๐•ช", "yscr": "๐“Ž", "yucy": "ัŽ", "yum": "รฟ", "yuml": "รฟ", "zacute": "ลบ", "zcaron": "ลพ", "zcy": "ะท", "zdot": "ลผ", "zeetrf": "โ„จ", "zeta": "ฮถ", "zfr": "๐”ท", "zhcy": "ะถ", "zigrarr": "โ‡", "zopf": "๐•ซ", "zscr": "๐“", "zwj": "โ€", "zwnj": "โ€Œ" }
{ "pile_set_name": "Github" }
Copyright (c) 2007, Apostolos Syropoulos (<asyropoulos@yahoo.com), with Reserved Font Name Asana Math. Copyright (c) 2013, The MathJax Consortium, with Reserved Font Name Asana MathJax. This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL ----------------------------------------------------------- SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ----------------------------------------------------------- PREAMBLE The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. DEFINITIONS "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. "Reserved Font Name" refers to any names specified as such after the copyright statement(s). "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). "Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. PERMISSION & CONDITIONS Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. TERMINATION This license becomes null and void if any of the above conditions are not met. DISCLAIMER THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
{ "pile_set_name": "Github" }
/********************************************************************** * Copyright (c) 2013, 2014, 2015 Pieter Wuille, Gregory Maxwell * * Distributed under the MIT software license, see the accompanying * * file COPYING or http://www.opensource.org/licenses/mit-license.php.* **********************************************************************/ #ifndef _SECP256K1_ECMULT_GEN_IMPL_H_ #define _SECP256K1_ECMULT_GEN_IMPL_H_ #include "scalar.h" #include "group.h" #include "ecmult_gen.h" #include "hash_impl.h" #ifdef USE_ECMULT_STATIC_PRECOMPUTATION #include "ecmult_static_context.h" #endif static void secp256k1_ecmult_gen_context_init(secp256k1_ecmult_gen_context *ctx) { ctx->prec = NULL; } static void secp256k1_ecmult_gen_context_build(secp256k1_ecmult_gen_context *ctx, const secp256k1_callback* cb) { #ifndef USE_ECMULT_STATIC_PRECOMPUTATION secp256k1_ge prec[1024]; secp256k1_gej gj; secp256k1_gej nums_gej; int i, j; #endif if (ctx->prec != NULL) { return; } #ifndef USE_ECMULT_STATIC_PRECOMPUTATION ctx->prec = (secp256k1_ge_storage (*)[64][16])checked_malloc(cb, sizeof(*ctx->prec)); /* get the generator */ secp256k1_gej_set_ge(&gj, &secp256k1_ge_const_g); /* Construct a group element with no known corresponding scalar (nothing up my sleeve). */ { static const unsigned char nums_b32[33] = "The scalar for this x is unknown"; secp256k1_fe nums_x; secp256k1_ge nums_ge; int r; r = secp256k1_fe_set_b32(&nums_x, nums_b32); (void)r; VERIFY_CHECK(r); r = secp256k1_ge_set_xo_var(&nums_ge, &nums_x, 0); (void)r; VERIFY_CHECK(r); secp256k1_gej_set_ge(&nums_gej, &nums_ge); /* Add G to make the bits in x uniformly distributed. */ secp256k1_gej_add_ge_var(&nums_gej, &nums_gej, &secp256k1_ge_const_g, NULL); } /* compute prec. */ { secp256k1_gej precj[1024]; /* Jacobian versions of prec. */ secp256k1_gej gbase; secp256k1_gej numsbase; gbase = gj; /* 16^j * G */ numsbase = nums_gej; /* 2^j * nums. */ for (j = 0; j < 64; j++) { /* Set precj[j*16 .. j*16+15] to (numsbase, numsbase + gbase, ..., numsbase + 15*gbase). */ precj[j*16] = numsbase; for (i = 1; i < 16; i++) { secp256k1_gej_add_var(&precj[j*16 + i], &precj[j*16 + i - 1], &gbase, NULL); } /* Multiply gbase by 16. */ for (i = 0; i < 4; i++) { secp256k1_gej_double_var(&gbase, &gbase, NULL); } /* Multiply numbase by 2. */ secp256k1_gej_double_var(&numsbase, &numsbase, NULL); if (j == 62) { /* In the last iteration, numsbase is (1 - 2^j) * nums instead. */ secp256k1_gej_neg(&numsbase, &numsbase); secp256k1_gej_add_var(&numsbase, &numsbase, &nums_gej, NULL); } } secp256k1_ge_set_all_gej_var(prec, precj, 1024, cb); } for (j = 0; j < 64; j++) { for (i = 0; i < 16; i++) { secp256k1_ge_to_storage(&(*ctx->prec)[j][i], &prec[j*16 + i]); } } #else (void)cb; ctx->prec = (secp256k1_ge_storage (*)[64][16])secp256k1_ecmult_static_context; #endif secp256k1_ecmult_gen_blind(ctx, NULL); } static int secp256k1_ecmult_gen_context_is_built(const secp256k1_ecmult_gen_context* ctx) { return ctx->prec != NULL; } static void secp256k1_ecmult_gen_context_clone(secp256k1_ecmult_gen_context *dst, const secp256k1_ecmult_gen_context *src, const secp256k1_callback* cb) { if (src->prec == NULL) { dst->prec = NULL; } else { #ifndef USE_ECMULT_STATIC_PRECOMPUTATION dst->prec = (secp256k1_ge_storage (*)[64][16])checked_malloc(cb, sizeof(*dst->prec)); memcpy(dst->prec, src->prec, sizeof(*dst->prec)); #else (void)cb; dst->prec = src->prec; #endif dst->initial = src->initial; dst->blind = src->blind; } } static void secp256k1_ecmult_gen_context_clear(secp256k1_ecmult_gen_context *ctx) { #ifndef USE_ECMULT_STATIC_PRECOMPUTATION free(ctx->prec); #endif secp256k1_scalar_clear(&ctx->blind); secp256k1_gej_clear(&ctx->initial); ctx->prec = NULL; } static void secp256k1_ecmult_gen(const secp256k1_ecmult_gen_context *ctx, secp256k1_gej *r, const secp256k1_scalar *gn) { secp256k1_ge add; secp256k1_ge_storage adds; secp256k1_scalar gnb; int bits; int i, j; memset(&adds, 0, sizeof(adds)); *r = ctx->initial; /* Blind scalar/point multiplication by computing (n-b)G + bG instead of nG. */ secp256k1_scalar_add(&gnb, gn, &ctx->blind); add.infinity = 0; for (j = 0; j < 64; j++) { bits = secp256k1_scalar_get_bits(&gnb, j * 4, 4); for (i = 0; i < 16; i++) { /** This uses a conditional move to avoid any secret data in array indexes. * _Any_ use of secret indexes has been demonstrated to result in timing * sidechannels, even when the cache-line access patterns are uniform. * See also: * "A word of warning", CHES 2013 Rump Session, by Daniel J. Bernstein and Peter Schwabe * (https://cryptojedi.org/peter/data/chesrump-20130822.pdf) and * "Cache Attacks and Countermeasures: the Case of AES", RSA 2006, * by Dag Arne Osvik, Adi Shamir, and Eran Tromer * (http://www.tau.ac.il/~tromer/papers/cache.pdf) */ secp256k1_ge_storage_cmov(&adds, &(*ctx->prec)[j][i], i == bits); } secp256k1_ge_from_storage(&add, &adds); secp256k1_gej_add_ge(r, r, &add); } bits = 0; secp256k1_ge_clear(&add); secp256k1_scalar_clear(&gnb); } /* Setup blinding values for secp256k1_ecmult_gen. */ static void secp256k1_ecmult_gen_blind(secp256k1_ecmult_gen_context *ctx, const unsigned char *seed32) { secp256k1_scalar b; secp256k1_gej gb; secp256k1_fe s; unsigned char nonce32[32]; secp256k1_rfc6979_hmac_sha256_t rng; int retry; unsigned char keydata[64] = {0}; if (seed32 == NULL) { /* When seed is NULL, reset the initial point and blinding value. */ secp256k1_gej_set_ge(&ctx->initial, &secp256k1_ge_const_g); secp256k1_gej_neg(&ctx->initial, &ctx->initial); secp256k1_scalar_set_int(&ctx->blind, 1); } /* The prior blinding value (if not reset) is chained forward by including it in the hash. */ secp256k1_scalar_get_b32(nonce32, &ctx->blind); /** Using a CSPRNG allows a failure free interface, avoids needing large amounts of random data, * and guards against weak or adversarial seeds. This is a simpler and safer interface than * asking the caller for blinding values directly and expecting them to retry on failure. */ memcpy(keydata, nonce32, 32); if (seed32 != NULL) { memcpy(keydata + 32, seed32, 32); } secp256k1_rfc6979_hmac_sha256_initialize(&rng, keydata, seed32 ? 64 : 32); memset(keydata, 0, sizeof(keydata)); /* Retry for out of range results to achieve uniformity. */ do { secp256k1_rfc6979_hmac_sha256_generate(&rng, nonce32, 32); retry = !secp256k1_fe_set_b32(&s, nonce32); retry |= secp256k1_fe_is_zero(&s); } while (retry); /* This branch true is cryptographically unreachable. Requires sha256_hmac output > Fp. */ /* Randomize the projection to defend against multiplier sidechannels. */ secp256k1_gej_rescale(&ctx->initial, &s); secp256k1_fe_clear(&s); do { secp256k1_rfc6979_hmac_sha256_generate(&rng, nonce32, 32); secp256k1_scalar_set_b32(&b, nonce32, &retry); /* A blinding value of 0 works, but would undermine the projection hardening. */ retry |= secp256k1_scalar_is_zero(&b); } while (retry); /* This branch true is cryptographically unreachable. Requires sha256_hmac output > order. */ secp256k1_rfc6979_hmac_sha256_finalize(&rng); memset(nonce32, 0, 32); secp256k1_ecmult_gen(ctx, &gb, &b); secp256k1_scalar_negate(&b, &b); ctx->blind = b; ctx->initial = gb; secp256k1_scalar_clear(&b); secp256k1_gej_clear(&gb); } #endif
{ "pile_set_name": "Github" }
/** * Estonian translation for bootstrap-datepicker * Ando Roots <https://github.com/anroots> * Fixes by Illimar Tambek <<https://github.com/ragulka> */ ;(function($){ $.fn.datepicker.dates['et'] = { days: ["Pรผhapรคev", "Esmaspรคev", "Teisipรคev", "Kolmapรคev", "Neljapรคev", "Reede", "Laupรคev", "Pรผhapรคev"], daysShort: ["Pรผhap", "Esmasp", "Teisip", "Kolmap", "Neljap", "Reede", "Laup", "Pรผhap"], daysMin: ["P", "E", "T", "K", "N", "R", "L", "P"], months: ["Jaanuar", "Veebruar", "Mรคrts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember"], monthsShort: ["Jaan", "Veebr", "Mรคrts", "Apr", "Mai", "Juuni", "Juuli", "Aug", "Sept", "Okt", "Nov", "Dets"], today: "Tรคna", clear: "Tรผhjenda", weekStart: 1, format: "dd.mm.yyyy" }; }(jQuery));
{ "pile_set_name": "Github" }
# memmgr back ends: compile only one of these into a working library # (For now, let's use the mode that requires the image fit into memory. # This is the recommended mode for Win32 anyway.) set(systemdependent_SRCS jmemnobs.c) # library object files common to compression and decompression set(common_SRCS jaricom.c jcomapi.c jutils.c jerror.c jmemmgr.c ) # compression library object files set(compression_SRCS jcapimin.c jcapistd.c jcarith.c jctrans.c jcparam.c jdatadst.c jcinit.c jcmaster.c jcmarker.c jcmainct.c jcprepct.c jccoefct.c jccolor.c jcsample.c jchuff.c jcdctmgr.c jfdctfst.c jfdctflt.c jfdctint.c ) # decompression library object files set(decompression_SRCS jdapimin.c jdapistd.c jdarith.c jdtrans.c jdatasrc.c jdmaster.c jdinput.c jdmarker.c jdhuff.c jdmainct.c jdcoefct.c jdpostct.c jddctmgr.c jidctfst.c jidctflt.c jidctint.c jdsample.c jdcolor.c jquant1.c jquant2.c jdmerge.c ) list(APPEND BUILD_SRCS "${systemdependent_SRCS};${common_SRCS}") list(APPEND BUILD_SRCS "${compression_SRCS};${decompression_SRCS}") ####################################################################### FL_ADD_LIBRARY(fltk_jpeg STATIC "${BUILD_SRCS}") # install the jpeg headers install(FILES jconfig.h;jerror.h;jmorecfg.h;jpeglib.h DESTINATION ${FLTK_INCLUDEDIR}/FL/images ) ####################################################################### if(OPTION_BUILD_SHARED_LIBS) ####################################################################### FL_ADD_LIBRARY(fltk_jpeg SHARED "${BUILD_SRCS}") ####################################################################### endif(OPTION_BUILD_SHARED_LIBS) #######################################################################
{ "pile_set_name": "Github" }
#ifndef __falcon_utils__ #define __falcon_utils__ #define PRU0_CONTROL_REG 0x00022000 #define PRU1_CONTROL_REG 0x00024000 #ifndef RUNNING_ON_PRU1 #define PRU_CONTROL_REG PRU0_CONTROL_REG #define PRU_MEMORY_OFFSET 0 #define PRU_ARM_INTERRUPT PRU0_ARM_INTERRUPT #else #define PRU_CONTROL_REG PRU1_CONTROL_REG #define PRU_MEMORY_OFFSET 0x2000 #define PRU_ARM_INTERRUPT PRU1_ARM_INTERRUPT #endif /* needs two temporary registers that can be cleared out */ .macro RESET_PRU_CLOCK .mparam reg1, reg2 MOV reg2, PRU_CONTROL_REG LBBO &reg1, reg2, 0, 4 CLR reg1, 3 SBBO &reg1, reg2, 0, 4 SET reg1, 3 SBBO &reg1, reg2, 0, 4 LDI reg1, 0 SBBO reg1, reg2, 0xC, 4 .endm /* if size = 8, then the reg beyond the passed in will contain the stall count */ .macro GET_PRU_CLOCK .mparam reg, treg = tmp, size = 4 MOV treg, PRU_CONTROL_REG LBBO reg, treg, 0xC, size .endm /* Wait until the clock has incremented a given number of nanoseconds with 10 ns resolution. Based on the clock. User RESET_PRU_CLOCK to set to 0 first. */ .macro WAITNS .mparam ns, treg1, treg2 #ifdef SLOW_WAITNS waitloop: MOV treg1, PRU_CONTROL_REG LBBO treg2, treg1, 0xC, 4 // read the cycle counter MOV treg1, (ns)/5 QBGT waitloop, treg2, treg1 #else MOV treg1, PRU_CONTROL_REG waitloop: LBBO treg2, treg1, 0xC, 4 // read the cycle counter //MOV treg1, (ns)/5 QBGT waitloop, treg2, (ns)/5 #endif .endm /* Busy sleep for the given number of ns */ .macro SLEEPNS .mparam ns, treg, extra = 0 MOV treg, (ns/10) - 1 - extra sleeploop: SUB treg, treg, 1 QBNE sleeploop, treg, 0 .endm #endif
{ "pile_set_name": "Github" }
var a = 0; var global = "ran"; c();
{ "pile_set_name": "Github" }
// (C) Copyright Antony Polukhin 2013. // // Use, modification and distribution are subject to 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). // // See http://www.boost.org/libs/type_traits for most recent version including documentation. #ifndef AUTOBOOST_TT_IS_COPY_CONSTRUCTIBLE_HPP_INCLUDED #define AUTOBOOST_TT_IS_COPY_CONSTRUCTIBLE_HPP_INCLUDED #include <autoboost/config.hpp> #include <autoboost/type_traits/detail/yes_no_type.hpp> #include <autoboost/type_traits/is_base_and_derived.hpp> #include <autoboost/type_traits/add_reference.hpp> #include <autoboost/type_traits/is_rvalue_reference.hpp> #include <autoboost/utility/declval.hpp> #include <autoboost/noncopyable.hpp> // should be the last #include #include <autoboost/type_traits/detail/bool_trait_def.hpp> namespace autoboost { namespace detail{ template <bool DerivedFromNoncopyable, class T> struct is_copy_constructible_impl2 { // Intel compiler has problems with SFINAE for copy constructors and deleted functions: // // error: function *function_name* cannot be referenced -- it is a deleted function // static autoboost::type_traits::yes_type test(T1&, decltype(T1(autoboost::declval<T1&>()))* = 0); // ^ // // MSVC 12.0 (Visual 2013) has problems when the copy constructor has been deleted. See: // https://connect.microsoft.com/VisualStudio/feedback/details/800328/std-is-copy-constructible-is-broken #if !defined(AUTOBOOST_NO_CXX11_DELETED_FUNCTIONS) && !defined(AUTOBOOST_INTEL_CXX_VERSION) && !(defined(AUTOBOOST_MSVC) && _MSC_VER == 1800) #ifdef AUTOBOOST_NO_CXX11_DECLTYPE template <class T1> static autoboost::type_traits::yes_type test(T1&, autoboost::mpl::int_<sizeof(T1(autoboost::declval<T1&>()))>* = 0); #else template <class T1> static autoboost::type_traits::yes_type test(T1&, decltype(T1(autoboost::declval<T1&>()))* = 0); #endif static autoboost::type_traits::no_type test(...); #else template <class T1> static autoboost::type_traits::no_type test(T1&, typename T1::autoboost_move_no_copy_constructor_or_assign* = 0); static autoboost::type_traits::yes_type test(...); #endif // If you see errors like this: // // `'T::T(const T&)' is private` // `autoboost/type_traits/is_copy_constructible.hpp:68:5: error: within this context` // // then you are trying to call that macro for a structure defined like that: // // struct T { // ... // private: // T(const T &); // ... // }; // // To fix that you must modify your structure: // // // C++03 and C++11 version // struct T: private autoboost::noncopyable { // ... // private: // T(const T &); // ... // }; // // // C++11 version // struct T { // ... // private: // T(const T &) = delete; // ... // }; AUTOBOOST_STATIC_CONSTANT(bool, value = ( sizeof(test( autoboost::declval<AUTOBOOST_DEDUCED_TYPENAME autoboost::add_reference<T>::type>() )) == sizeof(autoboost::type_traits::yes_type) || autoboost::is_rvalue_reference<T>::value )); }; template <class T> struct is_copy_constructible_impl2<true, T> { AUTOBOOST_STATIC_CONSTANT(bool, value = false); }; template <class T> struct is_copy_constructible_impl { AUTOBOOST_STATIC_CONSTANT(bool, value = ( autoboost::detail::is_copy_constructible_impl2< autoboost::is_base_and_derived<autoboost::noncopyable, T>::value, T >::value )); }; } // namespace detail AUTOBOOST_TT_AUX_BOOL_TRAIT_DEF1(is_copy_constructible,T,::autoboost::detail::is_copy_constructible_impl<T>::value) AUTOBOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void,false) #ifndef AUTOBOOST_NO_CV_VOID_SPECIALIZATIONS AUTOBOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void const,false) AUTOBOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void const volatile,false) AUTOBOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void volatile,false) #endif } // namespace autoboost #include <autoboost/type_traits/detail/bool_trait_undef.hpp> #endif // AUTOBOOST_TT_IS_COPY_CONSTRUCTIBLE_HPP_INCLUDED
{ "pile_set_name": "Github" }
๏ปฟusing Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using NUnit.Framework; namespace MonoGame.Tests.Framework { /// <summary> /// Tests for enum compatibility with XNA(here is only XNA enum members, extensions are not included). /// </summary> class EnumConformingTest { #region MonoGame.Framework [Test] public void ContainmentTypeEnum() { Assert.AreEqual(0, (int)ContainmentType.Disjoint); Assert.AreEqual(1, (int)ContainmentType.Contains); Assert.AreEqual(2, (int)ContainmentType.Intersects); } [Test] public void CurveContinuityEnum() { Assert.AreEqual(0, (int)CurveContinuity.Smooth); Assert.AreEqual(1, (int)CurveContinuity.Step); } [Test] public void CurveLoopTypeEnum() { Assert.AreEqual(0, (int)CurveLoopType.Constant); Assert.AreEqual(1, (int)CurveLoopType.Cycle); Assert.AreEqual(2, (int)CurveLoopType.CycleOffset); Assert.AreEqual(3, (int)CurveLoopType.Oscillate); Assert.AreEqual(4, (int)CurveLoopType.Linear); } [Test] public void CurveTangentEnum() { Assert.AreEqual(0, (int)CurveTangent.Flat); Assert.AreEqual(1, (int)CurveTangent.Linear); Assert.AreEqual(2, (int)CurveTangent.Smooth); } [Test] public void DisplayOrientationEnum() { Assert.AreEqual(0, (int)DisplayOrientation.Default); Assert.AreEqual(1, (int)DisplayOrientation.LandscapeLeft); Assert.AreEqual(2, (int)DisplayOrientation.LandscapeRight); Assert.AreEqual(4, (int)DisplayOrientation.Portrait); } [Test] public void PlaneIntersectionTypeEnum() { Assert.AreEqual(0, (int)PlaneIntersectionType.Front); Assert.AreEqual(1, (int)PlaneIntersectionType.Back); Assert.AreEqual(2, (int)PlaneIntersectionType.Intersecting); } [Test] public void PlayerIndexEnum() { Assert.AreEqual(0, (int)PlayerIndex.One); Assert.AreEqual(1, (int)PlayerIndex.Two); Assert.AreEqual(2, (int)PlayerIndex.Three); Assert.AreEqual(3, (int)PlayerIndex.Four); } #endregion #region MonoGame.Framework.Graphics [Test] public void BlendEnum() { Assert.AreEqual(0, (int)Blend.One); Assert.AreEqual(1, (int)Blend.Zero); Assert.AreEqual(2, (int)Blend.SourceColor); Assert.AreEqual(3, (int)Blend.InverseSourceColor); Assert.AreEqual(4, (int)Blend.SourceAlpha); Assert.AreEqual(5, (int)Blend.InverseSourceAlpha); Assert.AreEqual(6, (int)Blend.DestinationColor); Assert.AreEqual(7, (int)Blend.InverseDestinationColor); Assert.AreEqual(8, (int)Blend.DestinationAlpha); Assert.AreEqual(9, (int)Blend.InverseDestinationAlpha); Assert.AreEqual(10, (int)Blend.BlendFactor); Assert.AreEqual(11, (int)Blend.InverseBlendFactor); Assert.AreEqual(12, (int)Blend.SourceAlphaSaturation); } [Test] public void BlendFunctionEnum() { Assert.AreEqual(0, (int)BlendFunction.Add); Assert.AreEqual(1, (int)BlendFunction.Subtract); Assert.AreEqual(2, (int)BlendFunction.ReverseSubtract); Assert.AreEqual(3, (int)BlendFunction.Min); Assert.AreEqual(4, (int)BlendFunction.Max); } [Test] public void BufferUsageEnum() { Assert.AreEqual(0, (int)BufferUsage.None); Assert.AreEqual(1, (int)BufferUsage.WriteOnly); } [Test] public void ClearOptionsEnum() { Assert.AreEqual(1, (int)ClearOptions.Target); Assert.AreEqual(2, (int)ClearOptions.DepthBuffer); Assert.AreEqual(4, (int)ClearOptions.Stencil); } [Test] public void ColorWriteChannelsEnum() { Assert.AreEqual(0, (int)ColorWriteChannels.None); Assert.AreEqual(1, (int)ColorWriteChannels.Red); Assert.AreEqual(2, (int)ColorWriteChannels.Green); Assert.AreEqual(4, (int)ColorWriteChannels.Blue); Assert.AreEqual(8, (int)ColorWriteChannels.Alpha); Assert.AreEqual(15, (int)ColorWriteChannels.All); } [Test] public void CompareFunctionEnum() { Assert.AreEqual(0, (int)CompareFunction.Always); Assert.AreEqual(1, (int)CompareFunction.Never); Assert.AreEqual(2, (int)CompareFunction.Less); Assert.AreEqual(3, (int)CompareFunction.LessEqual); Assert.AreEqual(4, (int)CompareFunction.Equal); Assert.AreEqual(5, (int)CompareFunction.GreaterEqual); Assert.AreEqual(6, (int)CompareFunction.Greater); Assert.AreEqual(7, (int)CompareFunction.NotEqual); } [Test] public void CubeMapFaceEnum() { Assert.AreEqual(0, (int)CubeMapFace.PositiveX); Assert.AreEqual(1, (int)CubeMapFace.NegativeX); Assert.AreEqual(2, (int)CubeMapFace.PositiveY); Assert.AreEqual(3, (int)CubeMapFace.NegativeY); Assert.AreEqual(4, (int)CubeMapFace.PositiveZ); Assert.AreEqual(5, (int)CubeMapFace.NegativeZ); } [Test] public void CullModeEnum() { Assert.AreEqual(0, (int)CullMode.None); Assert.AreEqual(1, (int)CullMode.CullClockwiseFace); Assert.AreEqual(2, (int)CullMode.CullCounterClockwiseFace); } [Test] public void DepthFormatEnum() { Assert.AreEqual(0, (int)DepthFormat.None); Assert.AreEqual(1, (int)DepthFormat.Depth16); Assert.AreEqual(2, (int)DepthFormat.Depth24); Assert.AreEqual(3, (int)DepthFormat.Depth24Stencil8); } [Test] public void EffectParameterClassEnum() { Assert.AreEqual(0, (int)EffectParameterClass.Scalar); Assert.AreEqual(1, (int)EffectParameterClass.Vector); Assert.AreEqual(2, (int)EffectParameterClass.Matrix); Assert.AreEqual(3, (int)EffectParameterClass.Object); Assert.AreEqual(4, (int)EffectParameterClass.Struct); } [Test] public void EffectParameterTypeEnum() { Assert.AreEqual(0, (int) EffectParameterType.Void); Assert.AreEqual(1, (int)EffectParameterType.Bool); Assert.AreEqual(2, (int)EffectParameterType.Int32); Assert.AreEqual(3, (int)EffectParameterType.Single); Assert.AreEqual(4, (int)EffectParameterType.String); Assert.AreEqual(5, (int)EffectParameterType.Texture); Assert.AreEqual(6, (int)EffectParameterType.Texture1D); Assert.AreEqual(7, (int)EffectParameterType.Texture2D); Assert.AreEqual(8, (int)EffectParameterType.Texture3D); Assert.AreEqual(9, (int)EffectParameterType.TextureCube); } [Test] public void FillModeEnum() { Assert.AreEqual(0, (int)FillMode.Solid); Assert.AreEqual(1, (int)FillMode.WireFrame); } [Test] public void GraphicsDeviceStatusEnum() { Assert.AreEqual(0, (int)GraphicsDeviceStatus.Normal); Assert.AreEqual(1, (int)GraphicsDeviceStatus.Lost); Assert.AreEqual(2, (int)GraphicsDeviceStatus.NotReset); } [Test] public void GraphicsProfileEnum() { Assert.AreEqual(0, (int)GraphicsProfile.Reach); Assert.AreEqual(1, (int)GraphicsProfile.HiDef); } [Test] public void IndexElementSizeEnum() { Assert.AreEqual(0, (int)IndexElementSize.SixteenBits); Assert.AreEqual(1, (int)IndexElementSize.ThirtyTwoBits); } [Test] public void PresentIntervalEnum() { Assert.AreEqual(0, (int)PresentInterval.Default); Assert.AreEqual(1, (int)PresentInterval.One); Assert.AreEqual(2, (int)PresentInterval.Two); Assert.AreEqual(3, (int)PresentInterval.Immediate); } [Test] public void PrimitiveTypeEnum() { Assert.AreEqual(0, (int)PrimitiveType.TriangleList); Assert.AreEqual(1, (int)PrimitiveType.TriangleStrip); Assert.AreEqual(2, (int)PrimitiveType.LineList); Assert.AreEqual(3, (int)PrimitiveType.LineStrip); } [Test] public void RenderTargetUsageEnum() { Assert.AreEqual(0, (int)RenderTargetUsage.DiscardContents); Assert.AreEqual(1, (int)RenderTargetUsage.PreserveContents); Assert.AreEqual(2, (int)RenderTargetUsage.PlatformContents); } [Test] public void SetDataOptionsEnum() { Assert.AreEqual(0, (int)SetDataOptions.None); Assert.AreEqual(1, (int)SetDataOptions.Discard); Assert.AreEqual(2, (int)SetDataOptions.NoOverwrite); } [Test] public void SpriteSortModeEnum() { Assert.AreEqual(0, (int)SpriteSortMode.Deferred); Assert.AreEqual(1, (int)SpriteSortMode.Immediate); Assert.AreEqual(2, (int)SpriteSortMode.Texture); Assert.AreEqual(3, (int)SpriteSortMode.BackToFront); Assert.AreEqual(4, (int)SpriteSortMode.FrontToBack); } [Test] public void StencilOperationEnum() { Assert.AreEqual(0, (int)StencilOperation.Keep); Assert.AreEqual(1, (int)StencilOperation.Zero); Assert.AreEqual(2, (int)StencilOperation.Replace); Assert.AreEqual(3, (int)StencilOperation.Increment); Assert.AreEqual(4, (int)StencilOperation.Decrement); Assert.AreEqual(5, (int)StencilOperation.IncrementSaturation); Assert.AreEqual(6, (int)StencilOperation.DecrementSaturation); Assert.AreEqual(7, (int)StencilOperation.Invert); } [Test] public void SurfaceFormateEnum() { Assert.AreEqual(0, (int)SurfaceFormat.Color); Assert.AreEqual(1, (int)SurfaceFormat.Bgr565); Assert.AreEqual(2, (int)SurfaceFormat.Bgra5551); Assert.AreEqual(3, (int)SurfaceFormat.Bgra4444); Assert.AreEqual(4, (int)SurfaceFormat.Dxt1); Assert.AreEqual(5, (int)SurfaceFormat.Dxt3); Assert.AreEqual(6, (int)SurfaceFormat.Dxt5); Assert.AreEqual(7, (int)SurfaceFormat.NormalizedByte2); Assert.AreEqual(8, (int)SurfaceFormat.NormalizedByte4); Assert.AreEqual(9, (int)SurfaceFormat.Rgba1010102); Assert.AreEqual(10, (int)SurfaceFormat.Rg32); Assert.AreEqual(11, (int)SurfaceFormat.Rgba64); Assert.AreEqual(12, (int)SurfaceFormat.Alpha8); Assert.AreEqual(13, (int)SurfaceFormat.Single); Assert.AreEqual(14, (int)SurfaceFormat.Vector2); Assert.AreEqual(15, (int)SurfaceFormat.Vector4); Assert.AreEqual(16, (int)SurfaceFormat.HalfSingle); Assert.AreEqual(17, (int)SurfaceFormat.HalfVector2); Assert.AreEqual(18, (int)SurfaceFormat.HalfVector4); Assert.AreEqual(19, (int)SurfaceFormat.HdrBlendable); } [Test] public void TextureAddressModeEnum() { Assert.AreEqual(0, (int)TextureAddressMode.Wrap); Assert.AreEqual(1, (int)TextureAddressMode.Clamp); Assert.AreEqual(2, (int)TextureAddressMode.Mirror); } [Test] public void TextureFilterEnum() { Assert.AreEqual(0, (int)TextureFilter.Linear); Assert.AreEqual(1, (int)TextureFilter.Point); Assert.AreEqual(2, (int)TextureFilter.Anisotropic); Assert.AreEqual(3, (int)TextureFilter.LinearMipPoint); Assert.AreEqual(4, (int)TextureFilter.PointMipLinear); Assert.AreEqual(5, (int)TextureFilter.MinLinearMagPointMipLinear); Assert.AreEqual(6, (int)TextureFilter.MinLinearMagPointMipPoint); Assert.AreEqual(7, (int)TextureFilter.MinPointMagLinearMipLinear); Assert.AreEqual(8, (int)TextureFilter.MinPointMagLinearMipPoint); } [Test] public void VertexElementFormatEnum() { Assert.AreEqual(0, (int)VertexElementFormat.Single); Assert.AreEqual(1, (int)VertexElementFormat.Vector2); Assert.AreEqual(2, (int)VertexElementFormat.Vector3); Assert.AreEqual(3, (int)VertexElementFormat.Vector4); Assert.AreEqual(4, (int)VertexElementFormat.Color); Assert.AreEqual(5, (int)VertexElementFormat.Byte4); Assert.AreEqual(6, (int)VertexElementFormat.Short2); Assert.AreEqual(7, (int)VertexElementFormat.Short4); Assert.AreEqual(8, (int)VertexElementFormat.NormalizedShort2); Assert.AreEqual(9, (int)VertexElementFormat.NormalizedShort4); Assert.AreEqual(10, (int)VertexElementFormat.HalfVector2); Assert.AreEqual(11, (int)VertexElementFormat.HalfVector4); } [Test] public void VertexElementUsageEnum() { Assert.AreEqual(0, (int)VertexElementUsage.Position); Assert.AreEqual(1, (int)VertexElementUsage.Color); Assert.AreEqual(2, (int)VertexElementUsage.TextureCoordinate); Assert.AreEqual(3, (int)VertexElementUsage.Normal); Assert.AreEqual(4, (int)VertexElementUsage.Binormal); Assert.AreEqual(5, (int)VertexElementUsage.Tangent); Assert.AreEqual(6, (int)VertexElementUsage.BlendIndices); Assert.AreEqual(7, (int)VertexElementUsage.BlendWeight); Assert.AreEqual(8, (int)VertexElementUsage.Depth); Assert.AreEqual(9, (int)VertexElementUsage.Fog); Assert.AreEqual(10, (int)VertexElementUsage.PointSize); Assert.AreEqual(11, (int)VertexElementUsage.Sample); Assert.AreEqual(12, (int)VertexElementUsage.TessellateFactor); } #endregion #region MonoGame.Framework.Input [Test] public void ButtonsEnum() { Assert.AreEqual(1, (int)Buttons.DPadUp); Assert.AreEqual(2, (int)Buttons.DPadDown); Assert.AreEqual(4, (int)Buttons.DPadLeft); Assert.AreEqual(8, (int)Buttons.DPadRight); Assert.AreEqual(16, (int)Buttons.Start); Assert.AreEqual(32, (int)Buttons.Back); Assert.AreEqual(64, (int)Buttons.LeftStick); Assert.AreEqual(128, (int)Buttons.RightStick); Assert.AreEqual(256, (int)Buttons.LeftShoulder); Assert.AreEqual(512, (int)Buttons.RightShoulder); Assert.AreEqual(2048, (int)Buttons.BigButton); Assert.AreEqual(4096, (int)Buttons.A); Assert.AreEqual(8192, (int)Buttons.B); Assert.AreEqual(16384, (int)Buttons.X); Assert.AreEqual(32768, (int)Buttons.Y); Assert.AreEqual(2097152, (int)Buttons.LeftThumbstickLeft); Assert.AreEqual(4194304, (int)Buttons.RightTrigger); Assert.AreEqual(8388608, (int)Buttons.LeftTrigger); Assert.AreEqual(16777216, (int)Buttons.RightThumbstickUp); Assert.AreEqual(33554432, (int)Buttons.RightThumbstickDown); Assert.AreEqual(67108864, (int)Buttons.RightThumbstickRight); Assert.AreEqual(134217728, (int)Buttons.RightThumbstickLeft); Assert.AreEqual(268435456, (int)Buttons.LeftThumbstickUp); Assert.AreEqual(536870912, (int)Buttons.LeftThumbstickDown); Assert.AreEqual(1073741824, (int)Buttons.LeftThumbstickRight); } [Test] public void ButtonStateEnum() { Assert.AreEqual(0, (int)ButtonState.Released); Assert.AreEqual(1, (int)ButtonState.Pressed); } [Test] public void GamePadTypeEnum() { Assert.AreEqual(0, (int)GamePadType.Unknown); Assert.AreEqual(1, (int)GamePadType.GamePad); Assert.AreEqual(2, (int)GamePadType.Wheel); Assert.AreEqual(3, (int)GamePadType.ArcadeStick); Assert.AreEqual(4, (int)GamePadType.FlightStick); Assert.AreEqual(5, (int)GamePadType.DancePad); Assert.AreEqual(6, (int)GamePadType.Guitar); Assert.AreEqual(7, (int)GamePadType.AlternateGuitar); Assert.AreEqual(8, (int)GamePadType.DrumKit); Assert.AreEqual(768, (int)GamePadType.BigButtonPad); } [Test] public void KeysEnum() { Assert.AreEqual(0, (int)Keys.None); Assert.AreEqual(8, (int)Keys.Back); Assert.AreEqual(9, (int)Keys.Tab); Assert.AreEqual(13, (int)Keys.Enter); Assert.AreEqual(19, (int)Keys.Pause); Assert.AreEqual(20, (int)Keys.CapsLock); Assert.AreEqual(21, (int)Keys.Kana); Assert.AreEqual(25, (int)Keys.Kanji); Assert.AreEqual(27, (int)Keys.Escape); Assert.AreEqual(28, (int)Keys.ImeConvert); Assert.AreEqual(29, (int)Keys.ImeNoConvert); Assert.AreEqual(32, (int)Keys.Space); Assert.AreEqual(33, (int)Keys.PageUp); Assert.AreEqual(34, (int)Keys.PageDown); Assert.AreEqual(35, (int)Keys.End); Assert.AreEqual(36, (int)Keys.Home); Assert.AreEqual(37, (int)Keys.Left); Assert.AreEqual(38, (int)Keys.Up); Assert.AreEqual(39, (int)Keys.Right); Assert.AreEqual(40, (int)Keys.Down); Assert.AreEqual(41, (int)Keys.Select); Assert.AreEqual(42, (int)Keys.Print); Assert.AreEqual(43, (int)Keys.Execute); Assert.AreEqual(44, (int)Keys.PrintScreen); Assert.AreEqual(45, (int)Keys.Insert); Assert.AreEqual(46, (int)Keys.Delete); Assert.AreEqual(47, (int)Keys.Help); Assert.AreEqual(48, (int)Keys.D0); Assert.AreEqual(49, (int)Keys.D1); Assert.AreEqual(50, (int)Keys.D2); Assert.AreEqual(51, (int)Keys.D3); Assert.AreEqual(52, (int)Keys.D4); Assert.AreEqual(53, (int)Keys.D5); Assert.AreEqual(54, (int)Keys.D6); Assert.AreEqual(55, (int)Keys.D7); Assert.AreEqual(56, (int)Keys.D8); Assert.AreEqual(57, (int)Keys.D9); Assert.AreEqual(65, (int)Keys.A); Assert.AreEqual(66, (int)Keys.B); Assert.AreEqual(67, (int)Keys.C); Assert.AreEqual(68, (int)Keys.D); Assert.AreEqual(69, (int)Keys.E); Assert.AreEqual(70, (int)Keys.F); Assert.AreEqual(71, (int)Keys.G); Assert.AreEqual(72, (int)Keys.H); Assert.AreEqual(73, (int)Keys.I); Assert.AreEqual(74, (int)Keys.J); Assert.AreEqual(75, (int)Keys.K); Assert.AreEqual(76, (int)Keys.L); Assert.AreEqual(77, (int)Keys.M); Assert.AreEqual(78, (int)Keys.N); Assert.AreEqual(79, (int)Keys.O); Assert.AreEqual(80, (int)Keys.P); Assert.AreEqual(81, (int)Keys.Q); Assert.AreEqual(82, (int)Keys.R); Assert.AreEqual(83, (int)Keys.S); Assert.AreEqual(84, (int)Keys.T); Assert.AreEqual(85, (int)Keys.U); Assert.AreEqual(86, (int)Keys.V); Assert.AreEqual(87, (int)Keys.W); Assert.AreEqual(88, (int)Keys.X); Assert.AreEqual(89, (int)Keys.Y); Assert.AreEqual(90, (int)Keys.Z); Assert.AreEqual(91, (int)Keys.LeftWindows); Assert.AreEqual(92, (int)Keys.RightWindows); Assert.AreEqual(93, (int)Keys.Apps); Assert.AreEqual(95, (int)Keys.Sleep); Assert.AreEqual(96, (int)Keys.NumPad0); Assert.AreEqual(97, (int)Keys.NumPad1); Assert.AreEqual(98, (int)Keys.NumPad2); Assert.AreEqual(99, (int)Keys.NumPad3); Assert.AreEqual(100, (int)Keys.NumPad4); Assert.AreEqual(101, (int)Keys.NumPad5); Assert.AreEqual(102, (int)Keys.NumPad6); Assert.AreEqual(103, (int)Keys.NumPad7); Assert.AreEqual(104, (int)Keys.NumPad8); Assert.AreEqual(105, (int)Keys.NumPad9); Assert.AreEqual(106, (int)Keys.Multiply); Assert.AreEqual(107, (int)Keys.Add); Assert.AreEqual(108, (int)Keys.Separator); Assert.AreEqual(109, (int)Keys.Subtract); Assert.AreEqual(110, (int)Keys.Decimal); Assert.AreEqual(111, (int)Keys.Divide); Assert.AreEqual(112, (int)Keys.F1); Assert.AreEqual(113, (int)Keys.F2); Assert.AreEqual(114, (int)Keys.F3); Assert.AreEqual(115, (int)Keys.F4); Assert.AreEqual(116, (int)Keys.F5); Assert.AreEqual(117, (int)Keys.F6); Assert.AreEqual(118, (int)Keys.F7); Assert.AreEqual(119, (int)Keys.F8); Assert.AreEqual(120, (int)Keys.F9); Assert.AreEqual(121, (int)Keys.F10); Assert.AreEqual(122, (int)Keys.F11); Assert.AreEqual(123, (int)Keys.F12); Assert.AreEqual(124, (int)Keys.F13); Assert.AreEqual(125, (int)Keys.F14); Assert.AreEqual(126, (int)Keys.F15); Assert.AreEqual(127, (int)Keys.F16); Assert.AreEqual(128, (int)Keys.F17); Assert.AreEqual(129, (int)Keys.F18); Assert.AreEqual(130, (int)Keys.F19); Assert.AreEqual(131, (int)Keys.F20); Assert.AreEqual(132, (int)Keys.F21); Assert.AreEqual(133, (int)Keys.F22); Assert.AreEqual(134, (int)Keys.F23); Assert.AreEqual(135, (int)Keys.F24); Assert.AreEqual(144, (int)Keys.NumLock); Assert.AreEqual(145, (int)Keys.Scroll); Assert.AreEqual(160, (int)Keys.LeftShift); Assert.AreEqual(161, (int)Keys.RightShift); Assert.AreEqual(162, (int)Keys.LeftControl); Assert.AreEqual(163, (int)Keys.RightControl); Assert.AreEqual(164, (int)Keys.LeftAlt); Assert.AreEqual(165, (int)Keys.RightAlt); Assert.AreEqual(166, (int)Keys.BrowserBack); Assert.AreEqual(167, (int)Keys.BrowserForward); Assert.AreEqual(168, (int)Keys.BrowserRefresh); Assert.AreEqual(169, (int)Keys.BrowserStop); Assert.AreEqual(170, (int)Keys.BrowserSearch); Assert.AreEqual(171, (int)Keys.BrowserFavorites); Assert.AreEqual(172, (int)Keys.BrowserHome); Assert.AreEqual(173, (int)Keys.VolumeMute); Assert.AreEqual(174, (int)Keys.VolumeDown); Assert.AreEqual(175, (int)Keys.VolumeUp); Assert.AreEqual(176, (int)Keys.MediaNextTrack); Assert.AreEqual(177, (int)Keys.MediaPreviousTrack); Assert.AreEqual(178, (int)Keys.MediaStop); Assert.AreEqual(179, (int)Keys.MediaPlayPause); Assert.AreEqual(180, (int)Keys.LaunchMail); Assert.AreEqual(181, (int)Keys.SelectMedia); Assert.AreEqual(182, (int)Keys.LaunchApplication1); Assert.AreEqual(183, (int)Keys.LaunchApplication2); Assert.AreEqual(186, (int)Keys.OemSemicolon); Assert.AreEqual(187, (int)Keys.OemPlus); Assert.AreEqual(188, (int)Keys.OemComma); Assert.AreEqual(189, (int)Keys.OemMinus); Assert.AreEqual(190, (int)Keys.OemPeriod); Assert.AreEqual(191, (int)Keys.OemQuestion); Assert.AreEqual(192, (int)Keys.OemTilde); Assert.AreEqual(202, (int)Keys.ChatPadGreen); Assert.AreEqual(203, (int)Keys.ChatPadOrange); Assert.AreEqual(219, (int)Keys.OemOpenBrackets); Assert.AreEqual(220, (int)Keys.OemPipe); Assert.AreEqual(221, (int)Keys.OemCloseBrackets); Assert.AreEqual(222, (int)Keys.OemQuotes); Assert.AreEqual(223, (int)Keys.Oem8); Assert.AreEqual(226, (int)Keys.OemBackslash); Assert.AreEqual(229, (int)Keys.ProcessKey); Assert.AreEqual(242, (int)Keys.OemCopy); Assert.AreEqual(243, (int)Keys.OemAuto); Assert.AreEqual(244, (int)Keys.OemEnlW); Assert.AreEqual(246, (int)Keys.Attn); Assert.AreEqual(247, (int)Keys.Crsel); Assert.AreEqual(248, (int)Keys.Exsel); Assert.AreEqual(249, (int)Keys.EraseEof); Assert.AreEqual(250, (int)Keys.Play); Assert.AreEqual(251, (int)Keys.Zoom); Assert.AreEqual(253, (int)Keys.Pa1); Assert.AreEqual(254, (int)Keys.OemClear); } #endregion } }
{ "pile_set_name": "Github" }
ITT Corp. met with financial advisers on Thursday to assess an unsolicited $6.5 billion bid from Hilton Hotels Corp., while some Wall Street analysts said the company's best defence might be to pursue an acquisition. Industry experts said ITT might be able to stave off the takeover if it made a large casino or hotel purchase. "ITT is a company with a lot of friends on Wall Street and a lot of investment bankers and there are a lot of players in the gaming industry who would like to trade up to a higher quality," said Thomas Ryan of Bankers Trust. Although ITT is widely expected to reject the offer, sources close to the company said no decision had been made and no acquisition talks were being held. ITT's board will consider the bid at a regularly-scheduled board meeting next Tuesday. ITT declined to comment. On Monday, Hilton offered to buy ITT in a stock and cash transaction that values the company at $55 per share. The offer also includes the assumption of $4 billion in debt. The stock of New York-based ITT, which soared most of the week on views Hilton would be forced to raise the bid, fell 75 cents to $56.875. On Friday, ITT's financial advisers are expected to pore over Hilton's official bid documents that are to be filed with the Securities and Exchange Commission. An acquisition "certainly would be in keeping with the company's history. (ITT Chairman Rand Araskog) has either got to be a buyer or he's got to let the company go," said Gerry Shapiro, managing director at KPMG Peat Marwick. Industry experts said a sizable acquisition by ITT would thwart Hilton's takeover plan by making the purchase price too costly. In a telephone conference call with reporters earlier this week, Hilton Chief Executive Officer Stephen Bollenbach vowed the Beverly Hills, Calif.-based company would only pursue transactions that added to earnings. Industry experts speculated that one of the most attractive acquisition candidates would be Harrah's Entertainment Inc. which has long been considered ripe to participate in industry consolidation. A spokesman for Harrah's declined to comment. An acquisition would also further solidify Araskog's role at the company he has run since 1979. He ran the ITT conglomerate and then took over the hotel, entertainment and gambling portion of the company when it split into three pieces in 1995. "I think Rand Araskog doesn't want to give up his job.," said Forum Capital Markets analyst Philip Platek, who also speculated that ITT could buy a gambling or lodging company.
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 41bfa96dabb64a14ca84d2eca0fc80b7 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
{ "default_locale": "en_US", "description": "It is the description of fake extension 2.", "name": "Fake Extension 2" }
{ "pile_set_name": "Github" }
/* * libjingle * Copyright 2011 Google Inc. * * 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. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef TALK_MEDIA_BASE_RTPUTILS_H_ #define TALK_MEDIA_BASE_RTPUTILS_H_ #include "talk/base/byteorder.h" namespace cricket { const size_t kMinRtpPacketLen = 12; const size_t kMaxRtpPacketLen = 2048; const size_t kMinRtcpPacketLen = 4; struct RtpHeader { int payload_type; int seq_num; uint32 timestamp; uint32 ssrc; }; enum RtcpTypes { kRtcpTypeSR = 200, // Sender report payload type. kRtcpTypeRR = 201, // Receiver report payload type. kRtcpTypeSDES = 202, // SDES payload type. kRtcpTypeBye = 203, // BYE payload type. kRtcpTypeApp = 204, // APP payload type. kRtcpTypeRTPFB = 205, // Transport layer Feedback message payload type. kRtcpTypePSFB = 206, // Payload-specific Feedback message payload type. }; bool GetRtpPayloadType(const void* data, size_t len, int* value); bool GetRtpSeqNum(const void* data, size_t len, int* value); bool GetRtpTimestamp(const void* data, size_t len, uint32* value); bool GetRtpSsrc(const void* data, size_t len, uint32* value); bool GetRtpHeaderLen(const void* data, size_t len, size_t* value); bool GetRtcpType(const void* data, size_t len, int* value); bool GetRtcpSsrc(const void* data, size_t len, uint32* value); bool GetRtpHeader(const void* data, size_t len, RtpHeader* header); // Assumes marker bit is 0. bool SetRtpHeaderFlags( void* data, size_t len, bool padding, bool extension, int csrc_count); bool SetRtpPayloadType(void* data, size_t len, int value); bool SetRtpSeqNum(void* data, size_t len, int value); bool SetRtpTimestamp(void* data, size_t len, uint32 value); bool SetRtpSsrc(void* data, size_t len, uint32 value); // Assumes version 2, no padding, no extensions, no csrcs. bool SetRtpHeader(void* data, size_t len, const RtpHeader& header); } // namespace cricket #endif // TALK_MEDIA_BASE_RTPUTILS_H_
{ "pile_set_name": "Github" }
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import from __future__ import division from __future__ import print_function import bisect import glob import io import os import re import app.log class OsDictionary: def __init__(self): path = '/usr/share/dict/words' try: self.file = io.open(path, 'r') self.fileLength = self.file.seek(0, 2) # Seek to end of file. self.pageSize = 1024 * 8 # Arbitrary. # Add one to pick up any partial page at the end. self.filePages = self.fileLength // self.pageSize + 1 except IOError: self.file = None self.cache = {} self.knownOffsets = [] def check(self, word): if self.file is None: return False word = word.lower() r = self.cache.get(word) if r is not None: return r high = self.filePages low = 0 leash = 20 # Way more than should be necessary. try: while True: if not leash: # There's likely a bug in this function if we hit this. app.log.info('spelling leash', word) return False leash -= 1 page = low + (high - low) // 2 self.file.seek(page * self.pageSize) # Add 100 to catch any words that straddle a page. size = min(self.pageSize + 100, self.fileLength - page * self.pageSize) if not size: self.cache[word] = False return False chunk = self.file.read(size) chunk = chunk[chunk.find('\n'):chunk.rfind('\n')] if not chunk: self.cache[word] = False return False words = chunk.split() if word < words[0].lower(): high = page continue if word > words[-1].lower(): low = page continue lowerWords = [i.lower() for i in words] index = bisect.bisect_left(lowerWords, word) if lowerWords[index] == word: self.cache[word] = True return True self.cache[word] = False return False except IOError: return False class Dictionary: def __init__(self, dictionaryList, pathPrefs): self.osDictionary = OsDictionary() self.pathPrefs = pathPrefs self.grammarWords = {} self.loadWords(os.path.dirname(__file__)) self.loadWords(os.path.expanduser("~/.ci_edit/dictionaries")) words = set() for i in dictionaryList: words.update(self.grammarWords.get(i, set())) self.baseWords = words self.pathWords = set() def setUpWordsForPath(self, path): self.pathWords = set() # app.log.info(repr(self.pathPrefs)) for k,v in self.pathPrefs.items(): if k in path: for i in v: self.pathWords.update(self.grammarWords.get(i, set())) def loadWords(self, dirPath): dirPath = os.path.join(dirPath, 'dictionary.') for path in glob.iglob(dirPath + '*.words'): if os.path.isfile(path): grammarName = path[len(dirPath):-len('.words')] with io.open(path, 'r') as f: lines = f.readlines() index = 0 while not len(lines[index]) or lines[index][0] == '#': index += 1 app.log.startup(len(lines) - index, "words from", path) # TODO(dschuyler): Word contractions are hacked by storing # the components of the contraction. So didn, doesn, and isn # are considered 'words'. self.grammarWords[grammarName] = set([ p for l in lines[index:] for w in l.split() for p in w.split("'") ]) def isCorrect(self, word, grammarName): if len(word) <= 1: return True words = self.baseWords lowerWord = word.lower() if word in words or lowerWord in words: return True if lowerWord in self.grammarWords.get(grammarName, set()): return True if lowerWord.startswith('sub') and lowerWord[3:] in words: return True if lowerWord.startswith('un') and lowerWord[2:] in words: return True if lowerWord in self.pathWords: return True if 1: if len(word) == 2 and word[1] == 's' and word[0].isupper(): # Upper case, with an 's' for plurality (e.g. PDFs). return True if 0: if len(re.sub('[A-Z]', '', word)) == 0: # All upper case. return True if 0: # TODO(dschuyler): This is an experiment. Considering a py specific # word list instead. if grammarName == 'py': # Handle run together (undelineated) words. if len(re.sub('[a-z]+', '', word)) == 0: for i in range(len(word), 0, -1): if word[:i] in words and word[i:] in words: return True if 1: # Experimental. # Fallback to the OS dictionary. return self.osDictionary.check(word) #app.log.info(grammarName, word) return False
{ "pile_set_name": "Github" }
<?php /** * Used to set up and fix common variables and include * the Multisite procedural and class library. * * Allows for some configuration in wp-config.php (see ms-default-constants.php) * * @package ClassicPress * @subpackage Multisite * @since WP-3.0.0 */ /** * Objects representing the current network and current site. * * These may be populated through a custom `sunrise.php`. If not, then this * file will attempt to populate them based on the current request. * * @global WP_Network $current_site The current network. * @global object $current_blog The current site. * @global string $domain Deprecated. The domain of the site found on load. * Use `get_site()->domain` instead. * @global string $path Deprecated. The path of the site found on load. * Use `get_site()->path` instead. * @global int $site_id Deprecated. The ID of the network found on load. * Use `get_current_network_id()` instead. * @global bool $public Deprecated. Whether the site found on load is public. * Use `get_site()->public` instead. * * @since WP-3.0.0 */ global $current_site, $current_blog, $domain, $path, $site_id, $public; /** WP_Network class */ require_once( ABSPATH . WPINC . '/class-wp-network.php' ); /** WP_Site class */ require_once( ABSPATH . WPINC . '/class-wp-site.php' ); /** Multisite loader */ require_once( ABSPATH . WPINC . '/ms-load.php' ); /** Default Multisite constants */ require_once( ABSPATH . WPINC . '/ms-default-constants.php' ); if ( defined( 'SUNRISE' ) ) { include_once( WP_CONTENT_DIR . '/sunrise.php' ); } /** Check for and define SUBDOMAIN_INSTALL and the deprecated VHOST constant. */ ms_subdomain_constants(); // This block will process a request if the current network or current site objects // have not been populated in the global scope through something like `sunrise.php`. if ( !isset( $current_site ) || !isset( $current_blog ) ) { $domain = strtolower( stripslashes( $_SERVER['HTTP_HOST'] ) ); if ( substr( $domain, -3 ) == ':80' ) { $domain = substr( $domain, 0, -3 ); $_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -3 ); } elseif ( substr( $domain, -4 ) == ':443' ) { $domain = substr( $domain, 0, -4 ); $_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -4 ); } $path = stripslashes( $_SERVER['REQUEST_URI'] ); if ( is_admin() ) { $path = preg_replace( '#(.*)/wp-admin/.*#', '$1/', $path ); } list( $path ) = explode( '?', $path ); $bootstrap_result = ms_load_current_site_and_network( $domain, $path, is_subdomain_install() ); if ( true === $bootstrap_result ) { // `$current_blog` and `$current_site are now populated. } elseif ( false === $bootstrap_result ) { ms_not_installed( $domain, $path ); } else { header( 'Location: ' . $bootstrap_result ); exit; } unset( $bootstrap_result ); $blog_id = $current_blog->blog_id; $public = $current_blog->public; if ( empty( $current_blog->site_id ) ) { // This dates to [MU134] and shouldn't be relevant anymore, // but it could be possible for arguments passed to insert_blog() etc. $current_blog->site_id = 1; } $site_id = $current_blog->site_id; wp_load_core_site_options( $site_id ); } $wpdb->set_prefix( $table_prefix, false ); // $table_prefix can be set in sunrise.php $wpdb->set_blog_id( $current_blog->blog_id, $current_blog->site_id ); $table_prefix = $wpdb->get_blog_prefix(); $_wp_switched_stack = array(); $switched = false; // need to init cache again after blog_id is set wp_start_object_cache(); if ( ! $current_site instanceof WP_Network ) { $current_site = new WP_Network( $current_site ); } if ( ! $current_blog instanceof WP_Site ) { $current_blog = new WP_Site( $current_blog ); } // Define upload directory constants ms_upload_constants(); /** * Fires after the current site and network have been detected and loaded * in multisite's bootstrap. * * @since WP-4.6.0 */ do_action( 'ms_loaded' );
{ "pile_set_name": "Github" }
Signature-Version: 1.0 SHA1-Digest-Manifest: 2F3/2bP8W1C6jPs/WMzQA9zH0t8= Created-By: 1.6.0 (IBM Corporation) SHA1-Digest-Manifest-Main-Attributes: 4gIfTP5y3EzwI5ecyebQLugBMgo= Name: epl-v10.html SHA1-Digest: /iY8aEvT0IMpNnSjB0FpTUhvUGc= Name: asl-v20.txt SHA1-Digest: f16Q6xxWp4CWPk9xW6xYHqbOlpk= Name: META-INF/eclipse.inf SHA1-Digest: QdryQvJlVywlE0MGLuwYCkmkyWk= Name: license.html SHA1-Digest: leexLIIUuWA4wkAPsn1Q3CxJw/0= Name: feature.properties SHA1-Digest: F+SAdwj3UMmS5PBOKuGZIzneLmU= Name: about.html SHA1-Digest: WrZ/OOBqBC2SqXiHdQDjnLJPa48= Name: feature.xml SHA1-Digest: 8Z4EHk8mPwEwaKWPKb/OKdIVlTk=
{ "pile_set_name": "Github" }
/* * @Author: xuebingsi * @Date: 2019-04-01 13:37:17 * @Last Modified by: zhibinm * @Last Modified time: 2019-04-01 13:37:19 */ .login-bg{ /*background: #eeeeee url() 0 0 no-repeat;*/ background:url(../images/bg.png) no-repeat center; background-size: cover; overflow: hidden; } .login{ margin: 120px auto 0 auto; min-height: 420px; max-width: 420px; padding: 40px; background-color: #ffffff; margin-left: auto; margin-right: auto; border-radius: 4px; /* overflow-x: hidden; */ box-sizing: border-box; } .login a.logo{ display: block; height: 58px; width: 167px; margin: 0 auto 30px auto; background-size: 167px 42px; } .login .message { margin: 10px 0 0 -58px; padding: 18px 10px 18px 60px; background: #189F92; position: relative; color: #fff; font-size: 16px; } .login #darkbannerwrap { background: url(../images/aiwrap.png); width: 18px; height: 10px; margin: 0 0 20px -58px; position: relative; } .login input[type=text], .login input[type=file], .login input[type=password], .login input[type=email], select { border: 1px solid #DCDEE0; vertical-align: middle; border-radius: 3px; height: 50px; padding: 0px 16px; font-size: 14px; color: #555555; outline:none; width:100%; box-sizing: border-box; } .login input[type=text]:focus, .login input[type=file]:focus, .login input[type=password]:focus, .login input[type=email]:focus, select:focus { border: 1px solid #27A9E3; } .login input[type=submit], .login input[type=button]{ display: inline-block; vertical-align: middle; padding: 12px 24px; margin: 0px; font-size: 18px; line-height: 24px; text-align: center; white-space: nowrap; vertical-align: middle; cursor: pointer; color: #ffffff; background-color: #189F92; border-radius: 3px; border: none; -webkit-appearance: none; outline:none; width:100%; } .login hr { background: #fff url() 0 0 no-repeat; } .login hr.hr15 { height: 15px; border: none; margin: 0px; padding: 0px; width: 100%; } .login hr.hr20 { height: 20px; border: none; margin: 0px; padding: 0px; width: 100%; }
{ "pile_set_name": "Github" }
* 1 ้™ธๆตท็ฉบ่ป่ปๅฎ˜ไน‹ไปปๅฎ˜๏ผŒไพๆœฌๆขไพ‹ไน‹่ฆๅฎšใ€‚้™ธๆตท็ฉบ่ปไน‹ๅฎ˜็ง‘ๅŠๅฃซๅฎ˜ไน‹ไปปๅฎ˜๏ผŒ็”ฑ่กŒๆ”ฟ้™ขๅฎšไน‹ใ€‚้™ธๆตท็ฉบ่ป่ปๅฎ˜ๅŠๅฃซๅฎ˜ไน‹ๅฎ˜้šŽ่ˆ‡ไฟธ็ตฆๅฆ‚้™„่กจใ€‚ * 2 ้™ธๆตท็ฉบ่ป่ปๅฎ˜ไน‹ไปปๅฎ˜๏ผŒๅˆ†็‚บๅˆไปปใ€ๆ™‰ไปปใ€่ฝ‰ไปปใ€ๆ•˜ไปปใ€‚ * 3 ้™ธๆตท็ฉบ่ป่ปๅฎ˜ไน‹ๅˆไปป่‡ชๅฐ‘ๅฐ‰ๅง‹๏ผŒไปฅๅ…ทๆœ‰ๅทฆๅˆ—่ณ‡ๆ ผไน‹ไธ€่€…ไปปไน‹๏ผšไธ€ใ€้™ธๆตท็ฉบ่ป่ปๅฎ˜ๅญธๆ ก้คŠๆˆๆ•™่‚ฒ็•ขๆฅญ๏ผŒไธฆ่ฆ‹็ฟ’ๆœŸๆปฟๆˆ็ธพๅˆๆ ผ่€…ใ€‚ไบŒใ€็ถ“ๅœ‹้˜ฒ้ƒจๆ ธๅ‡†ๅœจๅœ‹ๅค–ๅ—่ปๅฎ˜้คŠๆˆๆ•™่‚ฒ็•ขๆฅญ๏ผŒๅ›žๅœ‹่ฆ‹็ฟ’ๆœŸๆปฟๆˆ็ธพๅˆๆ ผ่€…ใ€‚ไธ‰ใ€ๅœ‹ๅ…งๅค–ๅ„ๅคงๅญธ็•ขๆฅญๆˆ–็›ธ็•ถๆ–ผๅคงๅญธไน‹ๅฐˆ็ง‘ๅญธๆ ก็•ขๆฅญ๏ผŒๅ…ทๆœ‰่ป่ทๅฐˆ้•ทไธฆๆœ็พๅฝน่€…ใ€‚ๅ››ใ€้™ธๆตท็ฉบ่ปๅ‡†ๅฐ‰๏ผŒๆ›พๅ—่ปๅฎ˜ๅ€™่ฃœๆ•™่‚ฒๆˆ็ธพๅˆๆ ผ๏ผŒ็ฒๅพ—่ป่ทๅฐˆ้•ท่€…ใ€‚ * 4 ้™ธๆตท็ฉบ่ป่ปๅฎ˜ไน‹ๆ™‰ไปป๏ผŒๅฟ…้ ˆ้€้šŽ้žๆ™‰๏ผŒไธฆๆ‡‰ไพ็…งๅทฆๅˆ—ไน‹่ฆๅฎš๏ผšไธ€ใ€ๆ™‰ไปปๅฟ…้ ˆ่€ƒ็ธพๅˆๆ ผ๏ผŒๅœๅนดๅฑ†ๆปฟ๏ผŒ่€Œๆœ‰ไธŠ้šŽๅฎ˜้กๆ™‚ใ€‚ไบŒใ€ๅ„้šŽๅฟ…้ ˆ็ถ“้Žไน‹ๅฏฆ่ทๅนด่ณ‡๏ผŒ็จฑ็‚บๅœๅนด๏ผŒๅ…ถๅœๅนดๅฆ‚ๅทฆ๏ผšๅฐ‘ๅฐ‰ไบŒๅนดไธญๅฐ‰ไธ‰ๅนดไธŠๅฐ‰ๅ››ๅนดๅฐ‘ๆ กๅ››ๅนดไธŠๆ กไปฅไธŠไธ่จ‚ๅœๅนดๅณๅˆ—ๅœๅนด๏ผŒไพ่ฃœๅ……ไธŠไน‹้œ€่ฆ๏ผŒๅพ—ไปฅๅ‘ฝไปคๆธ›็ธฎไน‹ใ€‚ไธ‰ใ€ไธŠๅฐ‰ๆ™‰ๅฐ‘ๆ ก๏ผŒ้™คไพๅณๅˆ—ๅ„ๆฌพๆ‰€ๅฎšๅค–๏ผŒไธฆ้ ˆๆ–ผๅฐ‰ๅฎ˜็ญ‰ๅ…งๅฎŒๆˆๆ‰€่ฆไน‹็ถ“ๆญท๏ผŒไธ”ๅ—ๅฌ้›†ๆ•™่‚ฒ็•ขๆฅญๅŠ็ถ“ๆ™‰็ญ‰่€ƒ่ฉฆๆˆ็ธพๅˆๆ ผ่€…ใ€‚ๅ››ใ€ไธŠๆ กๆ™‰ๅฐ‘ๅฐ‡๏ผŒ้™คไพๅณๅˆ—็ฌฌไธ€ๆฌพๆ‰€ๅฎšๅค–๏ผŒไธฆ้ ˆๆ–ผๆ กๅฎ˜็ญ‰ๅ…งๅฎŒๆˆๆ‰€่ฆไน‹็ถ“ๆญท๏ผŒไธ”ๅ—ๆทฑ้€ ๆ•™่‚ฒ็•ขๆฅญ่€…ใ€‚ไบ”ใ€ไธญๅฐ‡ๅฟ…้ ˆๅปบๆœ‰ๆฎŠๅ‹›ๅง‹ๅพ—ๆ™‰ไปปไบŒ็ดšไธŠๅฐ‡๏ผŒๅ†ๅปบๆฎŠๅ‹›ๅง‹ๅพ—ๆ™‰ไปปไธ€็ดšไธŠๅฐ‡ใ€‚ * 5 ้™ธๆตท็ฉบ่ปไธŠๆ กไปฅไธ‹่ปๅฎ˜ไน‹่ฝ‰ไปป๏ผŒๆ‡‰ๅ—ไป–่ป็จฎๆˆ–ไป–ๅ…ตๆฅญ็ง‘ๆ•™่‚ฒ่€ƒ้ฉ—ๅˆๆ ผๅพŒ๏ผŒๅ‡†่ฝ‰ไปป่ˆ‡ๅŽŸๅฎ˜็›ธ็•ถ้šŽไน‹ๅฎ˜ใ€‚่ฝ‰ไปปๅพŒๅณๅ–ชๅคฑๅ…ถๅŽŸๆœ‰ไน‹ๅฎ˜๏ผŒ้ž็ถ“ๆ ธๅ‡†ไธๅพ—ๅ›žไปปใ€‚ * 6 ้™ธๆตท็ฉบ่ป่ปๅฎ˜ไน‹ๆ•˜ไปป๏ผŒไปฅๅˆๆ–ผๆœฌๆขไพ‹็ฌฌไธ‰ๆข็ฌฌไธ€ๆฌพ่‡ณ็ฌฌไธ‰ๆฌพไน‹ไธ€่€…๏ผŒไพๅฎ˜้กๆˆ–่ฃœๅ……ไธŠไน‹้œ€่ฆ๏ผŒๆ ธๅ…ถ็ถ“ๆญทๆ•˜ไปป็›ธ็•ถ้šŽไน‹ๅฎ˜ใ€‚ * 7 ๅˆๆ–ผๆœฌๆขไพ‹่ฆๅฎšไน‹ๅฅณๅญ๏ผŒๅพ—ไบˆไปปๅฎ˜ใ€‚ * 8 ้™ธๆตท็ฉบ่ป่ปๅฎ˜ๆ–ผ่ปไบ‹ไธŠๆœ‰็‰นๆฎŠๅ‹›็ธพ่€…๏ผŒๅพ—็‰นไปคๆ™‰ไปป๏ผŒไธๅ—็ฌฌๅ››ๆข็ฌฌไธ‰ๆฌพ็ฌฌๅ››ๆฌพ่ฆๅฎšไน‹้™ๅˆถใ€‚ * 9 ้™ธๆตท็ฉบ่ป่ปๅฎ˜ๅฐๅœ‹ๅฎถ่‘—ๆœ‰ๅ‹›็ธพ๏ผŒๅ…ถ่บซๅพŒ้ ˆ่ฟฝๆ™‰ๆˆ–่ฟฝ่ดˆๅฎ˜้šŽ่€…๏ผŒไธๅ—็ฌฌๅ››ๆข่ฆๅฎšไน‹้™ๅˆถใ€‚ * 10 ้™ธๆตท็ฉบ่ป่ปๅฎ˜ๆœ‰ๅทฆๅˆ—ๆƒ…ๅฝขไน‹ไธ€่€…ๅ…ๅฎ˜๏ผšไธ€ใ€ๅ› ็ฝช่™•ๅˆ‘ไธฆๅ—ๆœ‰่คซๅฅชๅ…ฌๆฌŠไน‹ๅฎฃๅ‘Š่€…ใ€‚ไบŒใ€ๅ› ๆกˆ้€š็ท่€…ใ€‚ไธ‰ใ€ๅ–ชๅคฑๅœ‹็ฑ่€…ใ€‚ๅ‰้ …ๅ…ๅฎ˜ๅŽŸๅ› ็ต‚ๆญขๅพŒ๏ผŒๅพ—ๆ ธไบˆๅพฉๅฎ˜ใ€‚ * 11 ้™ธๆตท็ฉบ่ปๅฐ‘ๅฐ‰ไปฅไธŠ่ปๅฎ˜ไน‹ไปปๅฎ˜๏ผŒ็”ฑๅœ‹้˜ฒ้ƒจๅฏฉๅฎš๏ผŒๅ‘ˆ่กŒๆ”ฟ้™ข่ฝ‰ๅ‘ˆ็ธฝ็ตฑไปปไน‹ใ€‚ * 12 ไปปๅฎ˜ๆ™‚ๆœŸ๏ผŒ้™ค็‰นไปคๅค–๏ผŒๅ‡ๆ–ผๆฏๅนดไธ€ๆœˆไธ€ๆ—ฅๅฎšๆœŸ่กŒไน‹ใ€‚ * 13 ๆœฌๆขไพ‹ๆ–ฝ่กŒ็ดฐๅ‰‡็”ฑ่กŒๆ”ฟ้™ขๅฎšไน‹ใ€‚ * 14 ๆœฌๆขไพ‹่‡ชๅ…ฌๅธƒๆ—ฅๆ–ฝ่กŒใ€‚
{ "pile_set_name": "Github" }
define( ({ label: "Dosyalarฤฑ Seรง..." }) );
{ "pile_set_name": "Github" }
{ "resourceType": "List", "fhir_comments": [ " this is all valid " ], "id": "val1", "_id": { "fhir_comments": [ " another comment " ] }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <p>This is some narrative</p>\n </div>" }, "status": "current", "mode": "changes" }
{ "pile_set_name": "Github" }
// Boost.Geometry Index // // Spatial query predicates // // Copyright (c) 2011-2015 Adam Wulkiewicz, Lodz, Poland. // // Use, modification and distribution is subject to 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_GEOMETRY_INDEX_PREDICATES_HPP #define BOOST_GEOMETRY_INDEX_PREDICATES_HPP #include <boost/geometry/index/detail/predicates.hpp> #include <boost/geometry/index/detail/tuples.hpp> /*! \defgroup predicates Predicates (boost::geometry::index::) */ namespace boost { namespace geometry { namespace index { /*! \brief Generate \c contains() predicate. Generate a predicate defining Value and Geometry relationship. Value will be returned by the query if <tt>bg::within(Geometry, Indexable)</tt> returns true. \par Example \verbatim bgi::query(spatial_index, bgi::contains(box), std::back_inserter(result)); \endverbatim \ingroup predicates \tparam Geometry The Geometry type. \param g The Geometry object. */ template <typename Geometry> inline detail::predicates::spatial_predicate<Geometry, detail::predicates::contains_tag, false> contains(Geometry const& g) { return detail::predicates::spatial_predicate < Geometry, detail::predicates::contains_tag, false >(g); } /*! \brief Generate \c covered_by() predicate. Generate a predicate defining Value and Geometry relationship. Value will be returned by the query if <tt>bg::covered_by(Indexable, Geometry)</tt> returns true. \par Example \verbatim bgi::query(spatial_index, bgi::covered_by(box), std::back_inserter(result)); \endverbatim \ingroup predicates \tparam Geometry The Geometry type. \param g The Geometry object. */ template <typename Geometry> inline detail::predicates::spatial_predicate<Geometry, detail::predicates::covered_by_tag, false> covered_by(Geometry const& g) { return detail::predicates::spatial_predicate < Geometry, detail::predicates::covered_by_tag, false >(g); } /*! \brief Generate \c covers() predicate. Generate a predicate defining Value and Geometry relationship. Value will be returned by the query if <tt>bg::covered_by(Geometry, Indexable)</tt> returns true. \par Example \verbatim bgi::query(spatial_index, bgi::covers(box), std::back_inserter(result)); \endverbatim \ingroup predicates \tparam Geometry The Geometry type. \param g The Geometry object. */ template <typename Geometry> inline detail::predicates::spatial_predicate<Geometry, detail::predicates::covers_tag, false> covers(Geometry const& g) { return detail::predicates::spatial_predicate < Geometry, detail::predicates::covers_tag, false >(g); } /*! \brief Generate \c disjoint() predicate. Generate a predicate defining Value and Geometry relationship. Value will be returned by the query if <tt>bg::disjoint(Indexable, Geometry)</tt> returns true. \par Example \verbatim bgi::query(spatial_index, bgi::disjoint(box), std::back_inserter(result)); \endverbatim \ingroup predicates \tparam Geometry The Geometry type. \param g The Geometry object. */ template <typename Geometry> inline detail::predicates::spatial_predicate<Geometry, detail::predicates::disjoint_tag, false> disjoint(Geometry const& g) { return detail::predicates::spatial_predicate < Geometry, detail::predicates::disjoint_tag, false >(g); } /*! \brief Generate \c intersects() predicate. Generate a predicate defining Value and Geometry relationship. Value will be returned by the query if <tt>bg::intersects(Indexable, Geometry)</tt> returns true. \par Example \verbatim bgi::query(spatial_index, bgi::intersects(box), std::back_inserter(result)); bgi::query(spatial_index, bgi::intersects(ring), std::back_inserter(result)); bgi::query(spatial_index, bgi::intersects(polygon), std::back_inserter(result)); \endverbatim \ingroup predicates \tparam Geometry The Geometry type. \param g The Geometry object. */ template <typename Geometry> inline detail::predicates::spatial_predicate<Geometry, detail::predicates::intersects_tag, false> intersects(Geometry const& g) { return detail::predicates::spatial_predicate < Geometry, detail::predicates::intersects_tag, false >(g); } /*! \brief Generate \c overlaps() predicate. Generate a predicate defining Value and Geometry relationship. Value will be returned by the query if <tt>bg::overlaps(Indexable, Geometry)</tt> returns true. \par Example \verbatim bgi::query(spatial_index, bgi::overlaps(box), std::back_inserter(result)); \endverbatim \ingroup predicates \tparam Geometry The Geometry type. \param g The Geometry object. */ template <typename Geometry> inline detail::predicates::spatial_predicate<Geometry, detail::predicates::overlaps_tag, false> overlaps(Geometry const& g) { return detail::predicates::spatial_predicate < Geometry, detail::predicates::overlaps_tag, false >(g); } #ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL /*! \brief Generate \c touches() predicate. Generate a predicate defining Value and Geometry relationship. Value will be returned by the query if <tt>bg::touches(Indexable, Geometry)</tt> returns true. \ingroup predicates \tparam Geometry The Geometry type. \param g The Geometry object. */ template <typename Geometry> inline detail::predicates::spatial_predicate<Geometry, detail::predicates::touches_tag, false> touches(Geometry const& g) { return detail::predicates::spatial_predicate < Geometry, detail::predicates::touches_tag, false >(g); } #endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL /*! \brief Generate \c within() predicate. Generate a predicate defining Value and Geometry relationship. Value will be returned by the query if <tt>bg::within(Indexable, Geometry)</tt> returns true. \par Example \verbatim bgi::query(spatial_index, bgi::within(box), std::back_inserter(result)); \endverbatim \ingroup predicates \tparam Geometry The Geometry type. \param g The Geometry object. */ template <typename Geometry> inline detail::predicates::spatial_predicate<Geometry, detail::predicates::within_tag, false> within(Geometry const& g) { return detail::predicates::spatial_predicate < Geometry, detail::predicates::within_tag, false >(g); } /*! \brief Generate satisfies() predicate. A wrapper around user-defined UnaryPredicate checking if Value should be returned by spatial query. \par Example \verbatim bool is_red(Value const& v) { return v.is_red(); } struct is_red_o { template <typename Value> bool operator()(Value const& v) { return v.is_red(); } } // ... rt.query(index::intersects(box) && index::satisfies(is_red), std::back_inserter(result)); rt.query(index::intersects(box) && index::satisfies(is_red_o()), std::back_inserter(result)); #ifndef BOOST_NO_CXX11_LAMBDAS rt.query(index::intersects(box) && index::satisfies([](Value const& v) { return v.is_red(); }), std::back_inserter(result)); #endif \endverbatim \ingroup predicates \tparam UnaryPredicate A type of unary predicate function or function object. \param pred The unary predicate function or function object. */ template <typename UnaryPredicate> inline detail::predicates::satisfies<UnaryPredicate, false> satisfies(UnaryPredicate const& pred) { return detail::predicates::satisfies<UnaryPredicate, false>(pred); } /*! \brief Generate nearest() predicate. When nearest predicate is passed to the query, k-nearest neighbour search will be performed. \c nearest() predicate takes a \c Geometry from which distances to \c Values are calculated and the maximum number of \c Values that should be returned. Internally boost::geometry::comparable_distance() is used to perform the calculation. \par Example \verbatim bgi::query(spatial_index, bgi::nearest(pt, 5), std::back_inserter(result)); bgi::query(spatial_index, bgi::nearest(pt, 5) && bgi::intersects(box), std::back_inserter(result)); bgi::query(spatial_index, bgi::nearest(box, 5), std::back_inserter(result)); \endverbatim \warning Only one \c nearest() predicate may be used in a query. \ingroup predicates \param geometry The geometry from which distance is calculated. \param k The maximum number of values to return. */ template <typename Geometry> inline detail::predicates::nearest<Geometry> nearest(Geometry const& geometry, unsigned k) { return detail::predicates::nearest<Geometry>(geometry, k); } #ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL /*! \brief Generate path() predicate. When path predicate is passed to the query, the returned values are k values along the path closest to its begin. \c path() predicate takes a \c Segment or a \c Linestring defining the path and the maximum number of \c Values that should be returned. \par Example \verbatim bgi::query(spatial_index, bgi::path(segment, 5), std::back_inserter(result)); bgi::query(spatial_index, bgi::path(linestring, 5) && bgi::intersects(box), std::back_inserter(result)); \endverbatim \warning Only one distance predicate (\c nearest() or \c path()) may be used in a query. \ingroup predicates \param linestring The path along which distance is calculated. \param k The maximum number of values to return. */ template <typename SegmentOrLinestring> inline detail::predicates::path<SegmentOrLinestring> path(SegmentOrLinestring const& linestring, unsigned k) { return detail::predicates::path<SegmentOrLinestring>(linestring, k); } #endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL namespace detail { namespace predicates { // operator! generators template <typename Fun, bool Negated> inline satisfies<Fun, !Negated> operator!(satisfies<Fun, Negated> const& p) { return satisfies<Fun, !Negated>(p); } template <typename Geometry, typename Tag, bool Negated> inline spatial_predicate<Geometry, Tag, !Negated> operator!(spatial_predicate<Geometry, Tag, Negated> const& p) { return spatial_predicate<Geometry, Tag, !Negated>(p.geometry); } // operator&& generators template <typename Pred1, typename Pred2> inline boost::tuples::cons< Pred1, boost::tuples::cons<Pred2, boost::tuples::null_type> > operator&&(Pred1 const& p1, Pred2 const& p2) { /*typedef typename boost::mpl::if_c<is_predicate<Pred1>::value, Pred1, Pred1 const&>::type stored1; typedef typename boost::mpl::if_c<is_predicate<Pred2>::value, Pred2, Pred2 const&>::type stored2;*/ namespace bt = boost::tuples; return bt::cons< Pred1, bt::cons<Pred2, bt::null_type> > ( p1, bt::cons<Pred2, bt::null_type>(p2, bt::null_type()) ); } template <typename Head, typename Tail, typename Pred> inline typename tuples::push_back< boost::tuples::cons<Head, Tail>, Pred >::type operator&&(boost::tuples::cons<Head, Tail> const& t, Pred const& p) { //typedef typename boost::mpl::if_c<is_predicate<Pred>::value, Pred, Pred const&>::type stored; namespace bt = boost::tuples; return tuples::push_back< bt::cons<Head, Tail>, Pred >::apply(t, p); } }} // namespace detail::predicates }}} // namespace boost::geometry::index #endif // BOOST_GEOMETRY_INDEX_PREDICATES_HPP
{ "pile_set_name": "Github" }
๏ปฟusing System; using System.Management.Automation; using Microsoft.VisualStudio.Shell; namespace PowerShellTools.Module { public abstract class PoshToolsCmdlet : Cmdlet { private static Package _package; public static void Initialize(Package package) { _package = package; } protected Package GetPackage() { if (_package == null) { throw new Exception("Package was not set!"); } return _package; } } }
{ "pile_set_name": "Github" }
package com.blankj.utildebug.base.view; import android.animation.ValueAnimator; import android.content.Context; import android.os.SystemClock; import android.support.annotation.Nullable; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; import android.widget.LinearLayout; import com.blankj.utilcode.util.SizeUtils; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.List; /** * <pre> * author: blankj * blog : http://blankj.com * time : 2019/09/10 * desc : * </pre> */ public class SwipeRightMenu extends LinearLayout { private static final AccelerateInterpolator OPEN_INTERPOLATOR = new AccelerateInterpolator(0.5f); private static final DecelerateInterpolator CLOSE_INTERPOLATOR = new DecelerateInterpolator(0.5f); private static boolean isTouching; private static WeakReference<SwipeRightMenu> swipeMenuOpened; private View mContentView; private List<MenuBean> mMenus = new ArrayList<>(); private int mMenusWidth = 0; public SwipeRightMenu(Context context) { this(context, null); } public SwipeRightMenu(Context context, @Nullable AttributeSet attrs) { super(context, attrs); setOrientation(HORIZONTAL); post(new Runnable() { @Override public void run() { initView(); } }); } private void initView() { int childCount = getChildCount(); if (childCount <= 1) { throw new IllegalArgumentException("no menus"); } mContentView = getChildAt(0); for (int i = 1; i < childCount; i++) { MenuBean bean = new MenuBean(getChildAt(i)); mMenus.add(bean); if (i == 1) { bean.setCloseMargin(0); } else { bean.setCloseMargin(-mMenus.get(i - 2).getWidth()); } mMenusWidth += bean.getWidth(); } for (int i = 0; i < mMenus.size(); i++) { mMenus.get(i).setOpenMargin(0); } } private static final int STATE_DOWN = 0; private static final int STATE_MOVE = 1; private static final int STATE_STOP = 2; private static final int SLIDE_INIT = 0; private static final int SLIDE_HORIZONTAL = 1; private static final int SLIDE_VERTICAL = 2; private static final int MIN_DISTANCE_MOVE = SizeUtils.dp2px(4); private static final int THRESHOLD_DISTANCE = SizeUtils.dp2px(20); private static final int ANIM_TIMING = 350; private int mState; private int mDownX; private int mDownY; private int mLastX; private int mLastY; private int slideDirection; private boolean isTouchPointInView(View view, int x, int y) { if (view == null) { return false; } int[] location = new int[2]; view.getLocationOnScreen(location); int left = location[0]; int top = location[1]; int right = left + view.getMeasuredWidth(); int bottom = top + view.getMeasuredHeight(); return y >= top && y <= bottom && x >= left && x <= right; } public boolean isOpen() { return swipeMenuOpened != null; } @Override public boolean dispatchTouchEvent(MotionEvent event) { int x = (int) event.getRawX(); int y = (int) event.getRawY(); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if (isTouching) { return false; } isTouching = true; close(this); mDownX = x; mDownY = y; mLastX = x; mLastY = y; mState = STATE_DOWN; slideDirection = SLIDE_INIT; super.dispatchTouchEvent(event); break; case MotionEvent.ACTION_MOVE: if (mState == STATE_DOWN && Math.abs(x - mDownX) < MIN_DISTANCE_MOVE && Math.abs(y - mDownY) < MIN_DISTANCE_MOVE) { break; } if (slideDirection == SLIDE_INIT) { if (Math.abs(x - mDownX) > Math.abs(y - mDownY)) { slideDirection = SLIDE_HORIZONTAL; cancelChildViewTouch(); requestDisallowInterceptTouchEvent(true);// ่ฎฉ็ˆถ view ไธ่ฆๆ‹ฆๆˆช } else { slideDirection = SLIDE_VERTICAL; } } if (slideDirection == SLIDE_VERTICAL) { return super.dispatchTouchEvent(event); } scrollTo(Math.max(Math.min(getScrollX() - x + mLastX, mMenusWidth), 0), 0); float percent = getScrollX() / (float) mMenusWidth; updateLeftMarginByPercent(percent); mLastX = x; mLastY = y; mState = STATE_MOVE; break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: try { if (event.getAction() == MotionEvent.ACTION_UP) { if (mState == STATE_DOWN) { if (isOpen()) { if (isTouchPointInView(mContentView, x, y)) { close(true); final long now = SystemClock.uptimeMillis(); final MotionEvent cancelEvent = MotionEvent.obtain(now, now, MotionEvent.ACTION_CANCEL, 0.0f, 0.0f, 0); super.dispatchTouchEvent(cancelEvent); return true; } } super.dispatchTouchEvent(event); close(true); return true; } } else { super.dispatchTouchEvent(event); } if (swipeMenuOpened != null && swipeMenuOpened.get() == this) {// ๅฆ‚ๆžœไน‹ๅ‰ๆ˜ฏๅฑ•ๅผ€็Šถๆ€ if (getScrollX() < mMenusWidth - THRESHOLD_DISTANCE) {// ่ถ…่ฟ‡้˜ˆๅ€ผๅˆ™ๅ…ณ้—ญ close(true); } else {// ๅฆๅˆ™่ฟ˜ๆ˜ฏๆ‰“ๅผ€ open(true); } } else { if (getScrollX() > THRESHOLD_DISTANCE) {// ๅฆ‚ๆžœๆ˜ฏๅ…ณ้—ญ open(true);// ่ถ…่ฟ‡้˜ˆๅ€ผๅˆ™ๆ‰“ๅผ€ } else { close(true);// ๅฆๅˆ™่ฟ˜ๆ˜ฏๅ…ณ้—ญ } } } finally { isTouching = false; mState = STATE_STOP; } break; default: break; } return true; } private void updateLeftMarginByPercent(float percent) { for (MenuBean menu : mMenus) { menu.getParams().leftMargin = (int) (menu.getCloseMargin() + percent * (menu.getOpenMargin() - menu.getCloseMargin())); menu.getView().requestLayout(); } } private void close(boolean isAnim) { swipeMenuOpened = null; if (isAnim) { ValueAnimator anim = ValueAnimator.ofInt(getScrollX(), 0); anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { scrollTo((int) animation.getAnimatedValue(), 0); } }); anim.setInterpolator(CLOSE_INTERPOLATOR); anim.setDuration(ANIM_TIMING).start(); for (final MenuBean menu : mMenus) { ValueAnimator menuAnim = ValueAnimator.ofInt(menu.getParams().leftMargin, menu.getCloseMargin()); menuAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { menu.getParams().leftMargin = (int) animation.getAnimatedValue(); menu.getView().requestLayout(); } }); menuAnim.setInterpolator(CLOSE_INTERPOLATOR); menuAnim.setDuration(ANIM_TIMING).start(); } } else { scrollTo(0, 0); for (final MenuBean menu : mMenus) { menu.getParams().leftMargin = menu.getCloseMargin(); menu.getView().requestLayout(); } } } private void open(boolean isAnim) { swipeMenuOpened = new WeakReference<>(this); if (isAnim) { ValueAnimator anim = ValueAnimator.ofInt(getScrollX(), mMenusWidth); anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { scrollTo((int) animation.getAnimatedValue(), 0); } }); anim.setInterpolator(OPEN_INTERPOLATOR); anim.setDuration(ANIM_TIMING).start(); for (final MenuBean menu : mMenus) { ValueAnimator menuAnim = ValueAnimator.ofInt(menu.getParams().leftMargin, menu.getOpenMargin()); menuAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { menu.getParams().leftMargin = (int) animation.getAnimatedValue(); menu.getView().requestLayout(); } }); menuAnim.setInterpolator(OPEN_INTERPOLATOR); menuAnim.setDuration(ANIM_TIMING).start(); } } else { scrollTo(mMenusWidth, 0); for (final MenuBean menu : mMenus) { menu.getParams().leftMargin = menu.getOpenMargin(); menu.getView().requestLayout(); } } } public void close(SwipeRightMenu exclude) { if (swipeMenuOpened != null) { final SwipeRightMenu swipeMenu = swipeMenuOpened.get(); if (swipeMenu != exclude) { swipeMenu.close(true); } } } private void cancelChildViewTouch() { final long now = SystemClock.uptimeMillis(); final MotionEvent cancelEvent = MotionEvent.obtain(now, now, MotionEvent.ACTION_CANCEL, 0.0f, 0.0f, 0); final int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { getChildAt(i).dispatchTouchEvent(cancelEvent); } cancelEvent.recycle(); } private static class MenuBean { private View mView; private LinearLayout.LayoutParams mParams; private int mWidth; private int mCloseMargin; private int mOpenMargin; public MenuBean(View view) { mView = view; mParams = (LayoutParams) view.getLayoutParams(); mWidth = view.getWidth(); } public View getView() { return mView; } public LayoutParams getParams() { return mParams; } public int getWidth() { return mWidth; } public int getCloseMargin() { return mCloseMargin; } public int getOpenMargin() { return mOpenMargin; } public void setCloseMargin(int closeMargin) { mCloseMargin = closeMargin; } public void setOpenMargin(int openMargin) { mOpenMargin = openMargin; } } }
{ "pile_set_name": "Github" }
// Copyright (C) 2007 Davis E. King (davis@dlib.net) // License: Boost Software License See LICENSE.txt for the full license. #ifndef DLIB_TUPLe_H_ #define DLIB_TUPLe_H_ #include "../enable_if.h" #include "../algs.h" #include "../serialize.h" #include "tuple_abstract.h" // ---------------------------------------------------------------------------------------- #define DLIB_TUPLE_GLOBAL_HELPERS(N) \ DLIB_TUPLE_GH(N##0) DLIB_TUPLE_GH(N##1) DLIB_TUPLE_GH(N##2) DLIB_TUPLE_GH(N##3) \ DLIB_TUPLE_GH(N##4) DLIB_TUPLE_GH(N##5) DLIB_TUPLE_GH(N##6) DLIB_TUPLE_GH(N##7) #define DLIB_TUPLE_GH(N) DLIB_TUPLE_GET_INDEX(N) DLIB_TUPLE_GET_ITEM(N) DLIB_TUPLE_GET_HELPER_STRUCT(N) #define DLIB_TUPLE_MEMBER_GET(N) \ DLIB_TUPLE_MG(N##0) DLIB_TUPLE_MG(N##1) DLIB_TUPLE_MG(N##2) DLIB_TUPLE_MG(N##3) \ DLIB_TUPLE_MG(N##4) DLIB_TUPLE_MG(N##5) DLIB_TUPLE_MG(N##6) DLIB_TUPLE_MG(N##7) #define DLIB_TUPLE_GET_INDEX(N) \ template <class Q, class T> const typename enable_if<is_same_type<typename T::type##N,Q>, long>::type get_index (const T&) {return N;} #define DLIB_TUPLE_GET_ITEM(N) \ template <class Q,class T> const typename enable_if<is_same_type<typename T::type##N,Q>,Q>::type& get_item_const (const T& t) {return t.v##N;}\ template <class Q,class T> typename enable_if<is_same_type<typename T::type##N,Q>,Q>::type& get_item ( T& t) {return t.v##N;} #define DLIB_TUPLE_GET_HELPER_STRUCT(N) \ template <class T> struct get_helper<N,T> \ { \ typedef typename T::type##N type; \ static const type& get(const T& t) { return t.v##N; } \ static type& get( T& t) { return t.v##N; } \ }; #define DLIB_TUPLE_TEMPLATE_LIST(N) \ class T##N##0 = null_type, class T##N##1 = null_type, class T##N##2 = null_type, class T##N##3 = null_type, \ class T##N##4 = null_type, class T##N##5 = null_type, class T##N##6 = null_type, class T##N##7 = null_type #define DLIB_TUPLE_VARIABLE_LIST(N) \ T##N##0 v##N##0; T##N##1 v##N##1; T##N##2 v##N##2; T##N##3 v##N##3; \ T##N##4 v##N##4; T##N##5 v##N##5; T##N##6 v##N##6; T##N##7 v##N##7; \ typedef T##N##0 type##N##0; typedef T##N##1 type##N##1; typedef T##N##2 type##N##2; \ typedef T##N##3 type##N##3; typedef T##N##4 type##N##4; typedef T##N##5 type##N##5; \ typedef T##N##6 type##N##6; typedef T##N##7 type##N##7; // ---------------------------------------------------------------------------------------- namespace dlib { struct null_type{}; // provide default serialization for the null_type inline void serialize ( const null_type& , std::ostream& ){} inline void deserialize ( null_type& , std::istream& ){} // ---------------------------------------------------------------------------------------- namespace tuple_helpers { template <long idx, class T> struct get_helper; // use these preprocessor macros to declare all the global stuff used by the // tuple member functions. DLIB_TUPLE_GLOBAL_HELPERS(0) DLIB_TUPLE_GLOBAL_HELPERS(01) DLIB_TUPLE_GLOBAL_HELPERS(02) DLIB_TUPLE_GLOBAL_HELPERS(03) // ------------------------------------------------------------------------------------ // use templates to recursively enumerate everything in the tuple that isn't a null_type template < typename T, typename F, long i = 0, typename enabled = void > struct for_each { static void go( T& a, F& funct ) { funct(a.template get<i>()); for_each<T,F,i+1>::go(a,funct); } static bool go( T& a, F& funct, long idx ) /*! ensures - returns true if the function was applied to the given index - returns false if the index is invalid so the function wasn't applied to anything !*/ { if (idx == i) { funct(a.template get<i>()); return true; } else { return for_each<T,F,i+1>::go(a,funct,idx); } } }; template <bool v1, bool v2> struct template_or { const static bool value = true; }; template <> struct template_or<false,false> { const static bool value = false; }; // the base case of the recursion template < typename T, typename F, long i > struct for_each<T,F,i,typename enable_if<template_or<i == T::max_fields , is_same_type<null_type,typename T::template get_type<i>::type >::value> >::type > { static void go( T&, F& ) { } static bool go( T&, F&, long ) { return false; } }; // ------------------------------------------------------------------------------------ // use templates to recursively enumerate everything in the tuple that isn't a null_type template < typename T, long i = 0, typename enabled = void > struct tuple_swap { static void go( T& a, T& b ) { exchange(a.template get<i>(), b.template get<i>()); tuple_swap<T,i+1>::go(a,b); } }; template <typename T, long i> struct at_base_case { }; // the base case of the recursion template < typename T, long i > struct tuple_swap<T,i,typename enable_if<template_or<i == T::max_fields, is_same_type<null_type,typename T::template get_type<i>::type >::value > >::type > { static void go( T&, T& ) { } }; // ------------------------------------------------------------------------------------ struct tuple_serialize { tuple_serialize (std::ostream& out_) : out(out_){} std::ostream& out; template <typename T> void operator() ( T& a ) const { serialize(a,out); } }; // ------------------------------------------------------------------------------------ struct tuple_deserialize { tuple_deserialize (std::istream& in_) : in(in_){} std::istream& in; template <typename T> void operator() ( T& a ) const { deserialize(a,in); } }; } // ---------------------------------------------------------------------------------------- // use these preprocessor macros to declare 4*8 template arguments (below we count them in octal) template < DLIB_TUPLE_TEMPLATE_LIST(0), // args 00-07 DLIB_TUPLE_TEMPLATE_LIST(01), // args 010-017 DLIB_TUPLE_TEMPLATE_LIST(02), // args 020-027 DLIB_TUPLE_TEMPLATE_LIST(03) // args 030-037 > class tuple { public: // use these macros to declare 8*4 member variables DLIB_TUPLE_VARIABLE_LIST(0) DLIB_TUPLE_VARIABLE_LIST(01) DLIB_TUPLE_VARIABLE_LIST(02) DLIB_TUPLE_VARIABLE_LIST(03) const static long max_fields = 4*8; template < long idx > struct get_type { typedef typename tuple_helpers::get_helper<idx,tuple>::type type; }; template < long idx > const typename tuple_helpers::get_helper<idx,tuple>::type& get ( ) const { return tuple_helpers::get_helper<idx,tuple>::get(*this); } template < long idx > typename tuple_helpers::get_helper<idx,tuple>::type& get ( ) { return tuple_helpers::get_helper<idx,tuple>::get(*this); } template < class Q> long index ( ) const { return tuple_helpers::get_index<Q>(*this); } template <class Q> const Q& get ( ) const {return tuple_helpers::get_item_const<Q>(*this);} template <class Q> Q& get ( ) {return tuple_helpers::get_item<Q>(*this);} template <typename F> void for_index ( F& funct, long idx ) { // do this #ifdef stuff to avoid getting a warning about valid_idx not being // used when ENABLE_ASSERTS isn't defined. #ifdef ENABLE_ASSERTS const bool valid_idx = tuple_helpers::for_each<tuple,F>::go(*this,funct,idx); #else tuple_helpers::for_each<tuple,F>::go(*this,funct,idx); #endif DLIB_ASSERT(valid_idx, "\tvoid tuple::for_index()" << "\n\tYou have attempted to call for_index() with an index out of the valid range" << "\n\tidx: " << idx << "\n\tthis: " << this ); } template <typename F> void for_index ( F& funct, long idx ) const { // do this #ifdef stuff to avoid getting a warning about valid_idx not being // used when ENABLE_ASSERTS isn't defined. #ifdef ENABLE_ASSERTS const bool valid_idx = tuple_helpers::for_each<const tuple,F>::go(*this,funct,idx); #else tuple_helpers::for_each<const tuple,F>::go(*this,funct,idx); #endif DLIB_ASSERT(valid_idx, "\tvoid tuple::for_index()" << "\n\tYou have attempted to call for_index() with an index out of the valid range" << "\n\tidx: " << idx << "\n\tthis: " << this ); } template <typename F> void for_index ( const F& funct, long idx ) { // do this #ifdef stuff to avoid getting a warning about valid_idx not being // used when ENABLE_ASSERTS isn't defined. #ifdef ENABLE_ASSERTS const bool valid_idx = tuple_helpers::for_each<tuple,const F>::go(*this,funct,idx); #else tuple_helpers::for_each<tuple,const F>::go(*this,funct,idx); #endif DLIB_ASSERT(valid_idx, "\tvoid tuple::for_index()" << "\n\tYou have attempted to call for_index() with an index out of the valid range" << "\n\tidx: " << idx << "\n\tthis: " << this ); } template <typename F> void for_index ( const F& funct, long idx ) const { // do this #ifdef stuff to avoid getting a warning about valid_idx not being // used when ENABLE_ASSERTS isn't defined. #ifdef ENABLE_ASSERTS const bool valid_idx = tuple_helpers::for_each<const tuple,const F>::go(*this,funct,idx); #else tuple_helpers::for_each<const tuple,const F>::go(*this,funct,idx); #endif DLIB_ASSERT(valid_idx, "\tvoid tuple::for_index()" << "\n\tYou have attempted to call for_index() with an index out of the valid range" << "\n\tidx: " << idx << "\n\tthis: " << this ); } template <typename F> void for_each ( F& funct ) { tuple_helpers::for_each<tuple,F>::go(*this,funct); } template <typename F> void for_each ( F& funct ) const { tuple_helpers::for_each<const tuple,F>::go(*this,funct); } template <typename F> void for_each ( const F& funct ) const { tuple_helpers::for_each<const tuple,const F>::go(*this,funct); } template <typename F> void for_each ( const F& funct ) { tuple_helpers::for_each<tuple,const F>::go(*this,funct); } inline friend void serialize ( tuple& item, std::ostream& out ) { try { item.for_each(tuple_helpers::tuple_serialize(out)); } catch (serialization_error& e) { throw serialization_error(e.info + "\n while serializing an object of type dlib::tuple<>"); } } inline friend void deserialize ( tuple& item, std::istream& in ) { try { item.for_each(tuple_helpers::tuple_deserialize(in)); } catch (serialization_error& e) { throw serialization_error(e.info + "\n while deserializing an object of type dlib::tuple<>"); } } inline friend void swap ( tuple& a, tuple& b ) { tuple_helpers::tuple_swap<tuple>::go(a,b); } inline void swap( tuple& item ) { tuple_helpers::tuple_swap<tuple>::go(item,*this); } }; // ---------------------------------------------------------------------------------------- } #endif // DLIB_TUPLe_H_
{ "pile_set_name": "Github" }
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:src="http://nwalsh.com/xmlns/litprog/fragment" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="5.0" xml:id="slidy.user.css"> <refmeta> <refentrytitle>slidy.user.css</refentrytitle> <refmiscinfo class="other" otherclass="datatype">filename</refmiscinfo> </refmeta> <refnamediv> <refname>slidy.user.css</refname> <refpurpose>Specifies the name of the Slidy user CSS file</refpurpose> </refnamediv> <refsynopsisdiv> <src:fragment xml:id="slidy.user.css.frag"> <xsl:param name="slidy.user.css">styles/w3c-blue.css</xsl:param> </src:fragment> </refsynopsisdiv> <refsection><info><title>Description</title></info> <para>This parameter specifies the name of the Slidy user CSS file.</para> </refsection> </refentry>
{ "pile_set_name": "Github" }
.class public Lcom/sina/weibo/sdk/utils/SecurityHelper; .super Ljava/lang/Object; # direct methods .method public constructor <init>()V .locals 0 invoke-direct {p0}, Ljava/lang/Object;-><init>()V return-void .end method .method public static checkResponseAppLegal(Landroid/content/Context;Lcom/sina/weibo/sdk/WeiboAppManager$WeiboInfo;Landroid/content/Intent;)Z .locals 3 const/4 v0, 0x1 if-eqz p1, :cond_1 invoke-virtual {p1}, Lcom/sina/weibo/sdk/WeiboAppManager$WeiboInfo;->getSupportApi()I move-result v1 const/16 v2, 0x2870 if-gt v1, v2, :cond_1 :cond_0 :goto_0 return v0 :cond_1 if-eqz p1, :cond_0 if-eqz p2, :cond_3 const-string v1, "_weibo_appPackage" invoke-virtual {p2, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String; move-result-object v1 :goto_1 if-eqz v1, :cond_2 const-string v2, "_weibo_transaction" invoke-virtual {p2, v2}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String; move-result-object v2 if-eqz v2, :cond_2 invoke-static {p0, v1}, Lcom/sina/weibo/sdk/ApiUtils;->validateWeiboSign(Landroid/content/Context;Ljava/lang/String;)Z move-result v1 if-nez v1, :cond_0 :cond_2 const/4 v0, 0x0 goto :goto_0 :cond_3 const/4 v1, 0x0 goto :goto_1 .end method .method public static containSign([Landroid/content/pm/Signature;Ljava/lang/String;)Z .locals 4 const/4 v0, 0x0 if-eqz p0, :cond_0 if-nez p1, :cond_1 :cond_0 :goto_0 return v0 :cond_1 array-length v2, p0 move v1, v0 :goto_1 if-ge v1, v2, :cond_0 aget-object v3, p0, v1 invoke-virtual {v3}, Landroid/content/pm/Signature;->toByteArray()[B move-result-object v3 invoke-static {v3}, Lcom/sina/weibo/sdk/utils/MD5;->hexdigest([B)Ljava/lang/String; move-result-object v3 invoke-virtual {p1, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v3 if-eqz v3, :cond_2 const/4 v0, 0x1 goto :goto_0 :cond_2 add-int/lit8 v1, v1, 0x1 goto :goto_1 .end method .method public static validateAppSignatureForIntent(Landroid/content/Context;Landroid/content/Intent;)Z .locals 4 const/4 v0, 0x0 invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager; move-result-object v1 if-nez v1, :cond_1 :cond_0 :goto_0 return v0 :cond_1 invoke-virtual {v1, p1, v0}, Landroid/content/pm/PackageManager;->resolveActivity(Landroid/content/Intent;I)Landroid/content/pm/ResolveInfo; move-result-object v2 if-eqz v2, :cond_0 iget-object v2, v2, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo; iget-object v2, v2, Landroid/content/pm/ActivityInfo;->packageName:Ljava/lang/String; const/16 v3, 0x40 :try_start_0 invoke-virtual {v1, v2, v3}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo; move-result-object v1 iget-object v1, v1, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature; const-string v2, "18da2bf10352443a00a5e046d9fca6bd" invoke-static {v1, v2}, Lcom/sina/weibo/sdk/utils/SecurityHelper;->containSign([Landroid/content/pm/Signature;Ljava/lang/String;)Z :try_end_0 .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1 move-result v0 goto :goto_0 :catch_0 move-exception v1 invoke-virtual {v1}, Landroid/content/pm/PackageManager$NameNotFoundException;->printStackTrace()V goto :goto_0 :catch_1 move-exception v1 invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V goto :goto_0 .end method
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 25 2017 03:49:04). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import "IPropertySizeController.h" @interface TPropertyLogicalSizeController : IPropertySizeController { } - (void)initCommon; @end
{ "pile_set_name": "Github" }
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # # Copyright (c) 2013-2017 Oracle and/or its affiliates. All rights reserved. # # The contents of this file are subject to the terms of either the GNU # General Public License Version 2 only ("GPL") or the Common Development # and Distribution License("CDDL") (collectively, the "License"). You # may not use this file except in compliance with the License. You can # obtain a copy of the License at # https://oss.oracle.com/licenses/CDDL+GPL-1.1 # or LICENSE.txt. See the License for the specific # language governing permissions and limitations under the License. # # When distributing the software, include this License Header Notice in each # file and include the License file at LICENSE.txt. # # GPL Classpath Exception: # Oracle designates this particular file as subject to the "Classpath" # exception as provided by Oracle in the GPL Version 2 section of the License # file that accompanied this code. # # Modifications: # If applicable, add the following below the License Header, with the fields # enclosed by brackets [] replaced by your own identifying information: # "Portions Copyright [year] [name of copyright owner]" # # Contributor(s): # If you wish your version of this file to be governed by only the CDDL or # only the GPL Version 2, indicate your decision by adding "[Contributor] # elects to include this software in this distribution under the [CDDL or GPL # Version 2] license." If you don't indicate a single choice of license, a # recipient has the option to distribute your version of this file under # either the CDDL, the GPL Version 2 or to extend the choice of license to # its licensees as provided above. However, if you add GPL Version 2 code # and therefore, elected the GPL Version 2 license, then the option applies # only if the new code is made subject to such option by the copyright # holder. # # # Description of test case here if desired. # # # Options to wscompile target for this test suite. debug=false keep=false verbose=false # the name of the generated war file: warfilename=fromwsdl_mime_simple_rpclit wsdlname=${basedir}/config/Catalog.wsdl client.binding=custom-client.xml, client-schema-binding.xml server.binding=custom-server.xml, server-schema-binding.xml
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout>
{ "pile_set_name": "Github" }
const getTableProperty = (DataTypes) => { const fields = { // ID ไธป้”ฎ id: { type: DataTypes.INTEGER, primaryKey: true, allowNull: false, autoIncrement: true, }, // ้™ๆ€่ต„ๆบ็š„่ฏทๆฑ‚่ทฏๅพ„ sourceUrl: { type: DataTypes.TEXT, allowNull: true, field: 'sourceUrl' }, // ้™ๆ€่ต„ๆบ็š„็ฑปๅž‹ elementType: { type: DataTypes.STRING(20), allowNull: true, field: 'elementType' }, // ่ต„ๆบๅŠ ่ฝฝ็Šถๆ€ status: { type: DataTypes.STRING(1), allowNull: true, field: 'status' } } const fieldIndex = { // ๅฆ‚ๆžœไธบ true ๅˆ™่กจ็š„ๅ็งฐๅ’Œ model ็›ธๅŒ๏ผŒๅณ user // ไธบ false MySQLๅˆ›ๅปบ็š„่กจๅ็งฐไผšๆ˜ฏๅคๆ•ฐ users // ๅฆ‚ๆžœๆŒ‡ๅฎš็š„่กจๅ็งฐๆœฌๅฐฑๆ˜ฏๅคๆ•ฐๅฝขๅผๅˆ™ไธๅ˜ freezeTableName: true, indexes: [ { name: "userIdIndex", method: "BTREE", fields: [ { attribute: "userId" } ] }, { name: "customerKeyIndex", method: "BTREE", fields: [ { attribute: "customerKey" } ] }, { name: "createdAtIndex", method: "BTREE", fields: [ { attribute: "createdAt" } ] }, { name: "happenTimeIndex", method: "BTREE", fields: [ { attribute: "happenTime" } ] }, { name: "happenDateIndex", method: "BTREE", fields: [ { attribute: "happenDate" } ] } ] } return {fields, fieldIndex} } module.exports = getTableProperty
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <AppKit/NSTextField.h> @interface GKResizingLabel : NSTextField { } - (struct CGSize)intrinsicContentSize; - (void)resizeWithOldSuperviewSize:(struct CGSize)arg1; @end
{ "pile_set_name": "Github" }
// SERVER-7343: allow $within without a geo index. t = db.geo_withinquery; t.drop(); num = 0; for ( x=0; x<=20; x++ ){ for ( y=0; y<=20; y++ ){ o = { _id : num++ , loc : [ x , y ] } t.save( o ) } } assert.eq(21 * 21 - 1, t.find({ $and: [ {loc: {$ne:[0,0]}}, {loc: {$within: {$box: [[0,0], [100,100]]}}}, ]}).itcount(), "UHOH!")
{ "pile_set_name": "Github" }
/* * File: demo_table.css * CVS: $Id$ * Description: CSS descriptions for DataTables demo pages * Author: Allan Jardine * Created: Tue May 12 06:47:22 BST 2009 * Modified: $Date$ by $Author$ * Language: CSS * Project: DataTables * * Copyright 2009 Allan Jardine. All Rights Reserved. * * *************************************************************************** * DESCRIPTION * * The styles given here are suitable for the demos that are used with the standard DataTables * distribution (see www.datatables.net). You will most likely wish to modify these styles to * meet the layout requirements of your site. * * Common issues: * 'full_numbers' pagination - I use an extra selector on the body tag to ensure that there is * no conflict between the two pagination types. If you want to use full_numbers pagination * ensure that you either have "example_alt_pagination" as a body class name, or better yet, * modify that selector. * Note that the path used for Images is relative. All images are by default located in * ../images/ - relative to this CSS file. */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DataTables features */ .dataTables_wrapper { position: relative; clear: both; /*zoom: 1;*/ /* Feeling sorry for IE */ transform: scale(1); /*For firefox. Also zoom affects positioning differently in different browsers.*/ } .dataTables_processing { position: absolute; top: 50%; left: 50%; width: 250px; height: 30px; margin-left: -125px; margin-top: -15px; padding: 14px 0 2px 0; border: 1px solid #ddd; text-align: center; color: #999; font-size: 14px; background-color: white; } .dataTables_length { width: 40%; float: left; } .dataTables_filter { width: 50%; float: right; text-align: right; } .dataTables_info { width: 60%; float: left; } .dataTables_paginate { float: right; text-align: right; } /* Pagination nested */ .paginate_disabled_previous, .paginate_enabled_previous, .paginate_disabled_next, .paginate_enabled_next { height: 19px; float: left; cursor: pointer; cursor: hand; color: #111 !important; } .paginate_disabled_previous:hover, .paginate_enabled_previous:hover, .paginate_disabled_next:hover, .paginate_enabled_next:hover { text-decoration: none !important; } .paginate_disabled_previous:active, .paginate_enabled_previous:active, .paginate_disabled_next:active, .paginate_enabled_next:active { outline: none; } .paginate_disabled_previous, .paginate_disabled_next { color: #666 !important; } .paginate_disabled_previous, .paginate_enabled_previous { padding-left: 23px; } .paginate_disabled_next, .paginate_enabled_next { padding-right: 23px; margin-left: 10px; } .paginate_disabled_previous { background: url('../images/back_disabled.png') no-repeat top left; } .paginate_enabled_previous { background: url('../images/back_enabled.png') no-repeat top left; } .paginate_enabled_previous:hover { background: url('../images/back_enabled_hover.png') no-repeat top left; } .paginate_disabled_next { background: url('../images/forward_disabled.png') no-repeat top right; } .paginate_enabled_next { background: url('../images/forward_enabled.png') no-repeat top right; } .paginate_enabled_next:hover { background: url('../images/forward_enabled_hover.png') no-repeat top right; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DataTables display */ table.display { margin: 0 auto; clear: both; width: 100%; /* Note Firefox 3.5 and before have a bug with border-collapse * ( https://bugzilla.mozilla.org/show%5Fbug.cgi?id=155955 ) * border-spacing: 0; is one possible option. Conditional-css.com is * useful for this kind of thing * * Further note IE 6/7 has problems when calculating widths with border width. * It subtracts one px relative to the other browsers from the first column, and * adds one to the end... * * If you want that effect I'd suggest setting a border-top/left on th/td's and * then filling in the gaps with other borders. */ } table.display thead th { padding: 3px 18px 3px 10px; border-bottom: 1px solid black; font-weight: bold; cursor: pointer; cursor: hand; } table.display tfoot th { padding: 3px 18px 3px 10px; border-top: 1px solid black; font-weight: bold; } table.display tr.heading2 td { border-bottom: 1px solid #aaa; } table.display td { padding: 3px 10px; } table.display td.center { text-align: center; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DataTables sorting */ .sorting_asc { background: url('../images/sort_asc.png') no-repeat center right; } .sorting_desc { background: url('../images/sort_desc.png') no-repeat center right; } .sorting { background: url('../images/sort_both.png') no-repeat center right; } .sorting_asc_disabled { background: url('../images/sort_asc_disabled.png') no-repeat center right; } .sorting_desc_disabled { background: url('../images/sort_desc_disabled.png') no-repeat center right; } th:active { outline: none; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DataTables row classes */ table.display tr.odd.gradeA { background-color: #ddffdd; } table.display tr.even.gradeA { background-color: #eeffee; } table.display tr.odd.gradeC { background-color: #ddddff; } table.display tr.even.gradeC { background-color: #eeeeff; } table.display tr.odd.gradeX { background-color: #ffdddd; } table.display tr.even.gradeX { background-color: #ffeeee; } table.display tr.odd.gradeU { background-color: #ddd; } table.display tr.even.gradeU { background-color: #eee; } tr.odd { background-color: white; } tr.even { background-color: white; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Misc */ .dataTables_scroll { clear: both; } .dataTables_scrollBody { margin-top: -1px; } .top, .bottom { padding: 15px; background-color: #F5F5F5; border: 1px solid #CCCCCC; } .top .dataTables_info { float: none; } .clear { clear: both; } .dataTables_empty { text-align: center; } tfoot input { margin: 0.5em 0; width: 100%; color: #444; } tfoot input.search_init { color: #999; } td.group { background-color: #d1cfd0; border-bottom: 2px solid #A19B9E; border-top: 2px solid #A19B9E; } td.details { background-color: #d1cfd0; border: 2px solid #A19B9E; } .example_alt_pagination div.dataTables_info { width: 40%; } .paging_full_numbers { width: 400px; height: 22px; line-height: 22px; } .paging_full_numbers a:active { outline: none } .paging_full_numbers a:hover { text-decoration: none; } .paging_full_numbers a.paginate_button, .paging_full_numbers a.paginate_active { border: 1px solid #aaa; -webkit-border-radius: 5px; border-radius : 5px; /*-moz-border-radius: 5px;*/ padding: 2px 5px; margin: 0 3px; cursor: pointer; cursor: hand; color: #333 !important; } .paging_full_numbers a.paginate_button { background-color: #ddd; } .paging_full_numbers a.paginate_button:hover { background-color: #ccc; text-decoration: none !important; } .paging_full_numbers a.paginate_active { background-color: #99B3FF; } table.display tr.even.row_selected td { background-color: #B0BED9; } table.display tr.odd.row_selected td { background-color: #9FAFD1; } /* * Sorting classes for columns */ /* For the standard odd/even */ tr.odd td.sorting_1 { background-color: #D3D6FF; } tr.odd td.sorting_2 { background-color: #DADCFF; } tr.odd td.sorting_3 { background-color: #E0E2FF; } tr.even td.sorting_1 { background-color: #EAEBFF; } tr.even td.sorting_2 { background-color: #F2F3FF; } tr.even td.sorting_3 { background-color: #F9F9FF; } /* For the Conditional-CSS grading rows */ /* Colour calculations (based off the main row colours) Level 1: dd > c4 ee > d5 Level 2: dd > d1 ee > e2 */ tr.odd.gradeA td.sorting_1 { background-color: #c4ffc4; } tr.odd.gradeA td.sorting_2 { background-color: #d1ffd1; } tr.odd.gradeA td.sorting_3 { background-color: #d1ffd1; } tr.even.gradeA td.sorting_1 { background-color: #d5ffd5; } tr.even.gradeA td.sorting_2 { background-color: #e2ffe2; } tr.even.gradeA td.sorting_3 { background-color: #e2ffe2; } tr.odd.gradeC td.sorting_1 { background-color: #c4c4ff; } tr.odd.gradeC td.sorting_2 { background-color: #d1d1ff; } tr.odd.gradeC td.sorting_3 { background-color: #d1d1ff; } tr.even.gradeC td.sorting_1 { background-color: #d5d5ff; } tr.even.gradeC td.sorting_2 { background-color: #e2e2ff; } tr.even.gradeC td.sorting_3 { background-color: #e2e2ff; } tr.odd.gradeX td.sorting_1 { background-color: #ffc4c4; } tr.odd.gradeX td.sorting_2 { background-color: #ffd1d1; } tr.odd.gradeX td.sorting_3 { background-color: #ffd1d1; } tr.even.gradeX td.sorting_1 { background-color: #ffd5d5; } tr.even.gradeX td.sorting_2 { background-color: #ffe2e2; } tr.even.gradeX td.sorting_3 { background-color: #ffe2e2; } tr.odd.gradeU td.sorting_1 { background-color: #c4c4c4; } tr.odd.gradeU td.sorting_2 { background-color: #d1d1d1; } tr.odd.gradeU td.sorting_3 { background-color: #d1d1d1; } tr.even.gradeU td.sorting_1 { background-color: #d5d5d5; } tr.even.gradeU td.sorting_2 { background-color: #e2e2e2; } tr.even.gradeU td.sorting_3 { background-color: #e2e2e2; } /* * Row highlighting example */ .ex_highlight #example tbody tr.even:hover, #example tbody tr.even td.highlighted { background-color: #ECFFB3; } .ex_highlight #example tbody tr.odd:hover, #example tbody tr.odd td.highlighted { background-color: #E6FF99; } .ex_highlight_row #example tr.even:hover { background-color: #ECFFB3; } .ex_highlight_row #example tr.even:hover td.sorting_1 { background-color: #DDFF75; } .ex_highlight_row #example tr.even:hover td.sorting_2 { background-color: #E7FF9E; } .ex_highlight_row #example tr.even:hover td.sorting_3 { background-color: #E2FF89; } .ex_highlight_row #example tr.odd:hover { background-color: #E6FF99; } .ex_highlight_row #example tr.odd:hover td.sorting_1 { background-color: #D6FF5C; } .ex_highlight_row #example tr.odd:hover td.sorting_2 { background-color: #E0FF84; } .ex_highlight_row #example tr.odd:hover td.sorting_3 { background-color: #DBFF70; } /* * KeyTable */ table.KeyTable td { border: 3px solid transparent; } table.KeyTable td.focus { border: 3px solid #3366FF; } table.display tr.gradeA { background-color: #eeffee; } table.display tr.gradeC { background-color: #ddddff; } table.display tr.gradeX { background-color: #ffdddd; } table.display tr.gradeU { background-color: #ddd; } div.box { height: 100px; padding: 10px; overflow: auto; border: 1px solid #8080FF; background-color: #E5E5FF; }
{ "pile_set_name": "Github" }
// Package example defines datastructure and services. package main import ( "context" "fmt" ) type Args struct { A int B int } type Reply struct { C int } type Arith int func (t *Arith) Mul(ctx context.Context, args *Args, reply *Reply) error { reply.C = args.A * args.B fmt.Printf("call: %d * %d = %d\n", args.A, args.B, reply.C) return nil } func (t *Arith) Add(ctx context.Context, args *Args, reply *Reply) error { reply.C = args.A + args.B fmt.Printf("call: %d + %d = %d\n", args.A, args.B, reply.C) return nil } func (t *Arith) Say(ctx context.Context, args *string, reply *string) error { *reply = "hello " + *args return nil }
{ "pile_set_name": "Github" }
v 1.0.7 Bug fixes: - Fixed a bug where units in a group would not arrive, due to calculations not ignoring the Y-axis. v 1.0.6 Bug Fixes: - Fixed a bug where Unit avoidance checks for stationary units caused division by zero. Improvements: - Added extension method for IGroupings to ClearFormation. v 1.0.5 Improvements: - Added a field on SteerForSeparation component to allow units to ignore other units based on attributes. ๏ปฟv 1.0.4 Bug Fixes: - Fixed an issue with Quick Starts not showing properly. v 1.0.3 Changes: - Update for Apex Path 2.4 Bug Fixes: - All vector field types now use clearance. It is however recommended to only use the Funnel field as it has the best overall performance. - A few fixes for situations where the model unit is destroyed prematurely. It is not really a supported scenario however. v 1.0.2 Changes: - Update for Apex Path 2.3 Bug Fixes: -Fixed a bug where the model unit would sometimes not arrive properly. v 1.0.1.1 Bug Fixes: -Fixed bug when selecting nothing and issuing a move order. v 1.0.1 Bug Fixes: -Fixed two bugs related to the latest release of Apex Path 2.1 v. 1.0 Initial Release
{ "pile_set_name": "Github" }
/* * * Copyright 2015, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. 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 * OWNER 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. * */ /* Package grpclog defines logging for grpc. */ package grpclog // import "google.golang.org/grpc/grpclog" import ( "log" "os" ) // Use golang's standard logger by default. // Access is not mutex-protected: do not modify except in init() // functions. var logger Logger = log.New(os.Stderr, "", log.LstdFlags) // Logger mimics golang's standard Logger as an interface. type Logger interface { Fatal(args ...interface{}) Fatalf(format string, args ...interface{}) Fatalln(args ...interface{}) Print(args ...interface{}) Printf(format string, args ...interface{}) Println(args ...interface{}) } // SetLogger sets the logger that is used in grpc. Call only from // init() functions. func SetLogger(l Logger) { logger = l } // Fatal is equivalent to Print() followed by a call to os.Exit() with a non-zero exit code. func Fatal(args ...interface{}) { logger.Fatal(args...) } // Fatalf is equivalent to Printf() followed by a call to os.Exit() with a non-zero exit code. func Fatalf(format string, args ...interface{}) { logger.Fatalf(format, args...) } // Fatalln is equivalent to Println() followed by a call to os.Exit()) with a non-zero exit code. func Fatalln(args ...interface{}) { logger.Fatalln(args...) } // Print prints to the logger. Arguments are handled in the manner of fmt.Print. func Print(args ...interface{}) { logger.Print(args...) } // Printf prints to the logger. Arguments are handled in the manner of fmt.Printf. func Printf(format string, args ...interface{}) { logger.Printf(format, args...) } // Println prints to the logger. Arguments are handled in the manner of fmt.Println. func Println(args ...interface{}) { logger.Println(args...) }
{ "pile_set_name": "Github" }
Title: Qt 5.0 Alpha Date: 2012-04-05 08:37 Author: lovenemesis Category: Development Tags: Qt Slug: qt-50-alpha ่ทจๅนณๅฐ GUI ๅผ€ๅ‘ๆก†ๆžถ Qt ๅ‘ๅธƒ 5.0 Alpha ็‰ˆๆœฌใ€‚ Qt 5.0 ๅผ•ๅ…ฅไบ†ๅฆ‚ไธ‹ๅ˜ๅŒ–๏ผš **ๆ‰€ๆœ‰ๅนณๅฐ่ฟ็งป่‡ณ Qt ๅนณๅฐๆŠฝ่ฑกๅฑ‚(QPA)** QPA ๅŽŸๅ…ˆๅœจ Qt 4.8 ๆ—ถๅผ•ๅ…ฅไฝœไธบ Qt Embedded ็š„ๆ›ฟไปฃๅ“๏ผŒ็Žฐๅœจๅฐ†ๅบ”็”จๅœจๅ…จ้ƒจๅนณๅฐไธŠใ€‚่ฟ™ๅฐ†ๆ–นไพฟๅฐ†ๅ„ไธชๅนณๅฐ็›ธๅ…ณ็š„ไปฃ็ ๆŠฝ่ฑกๅŒ–๏ผŒๆ–นไพฟ Qt ้ขๅ‘ไธๅŒๅนณๅฐ็š„็งปๆค๏ผŒๆฏ”ๅฆ‚ QNX ๅ’Œ Android ใ€‚ **้‡ๆ–ฐๆž„ๅปบ็š„ๅ›พๅฝขๅฑ‚** - ็›ธๆฏ” Qt4 ่Žทๅพ—ไบ†ๆ•ˆ็އไธŠ็š„ๆๅ‡ใ€‚ - Qt Quick ๅฐ†ไฝฟ็”จๅŸบไบŽ OpenGL ็š„ Scenegraph๏ผŒไพ่ต–ไบŽ OpenGL ES 2.0ใ€‚ - ๅผ•ๅ…ฅ QOpenGL ็ฑป๏ผŒๆ›ฟไปฃ QGL ็ฑปใ€‚ - ไปŽ QPainter ไธญ็งป้™คๅนณๅฐ็›ธๅ…ณ็š„ X11 ๅ’Œ CoreGraphics ๅŽ็ซฏใ€‚ **ๅ†…้ƒจๆจกๅ—ๅŒ–่ฎพ่ฎก** ๅฐฝ็ฎกไฝฟ็”จ Qt 5 ็š„ๅบ”็”จ็จ‹ๅบๅผ€ๅ‘่€…็œ‹ไธๅˆฐ๏ผŒไฝ†ๆ˜ฏ Qt 5.0 ๅ†…้ƒจ้‡ๆ–ฐ่ฟ›่กŒไบ†ๆจกๅ—ๅŒ–่ฎพ่ฎกใ€‚ ็›ฎๅ‰ๆ•ด็†ๅ‡บไธ€ไธช็งฐไธบ Qt Essential ็š„็ฑป้›†ๅˆ๏ผŒๅŒ…ๅซๅŸบๆœฌๅŠŸ่ƒฝ(Qt 3D, Qt Core, Qt GUI, Qt JS Backend, Qt Location, Qt Multimedia, Qt Network, Qt Qml, Qt Quick, Qt SQL, Qt Test ๅ’Œ Qt WebKit)ใ€‚ๆ›ดๅคš็š„ๅŠŸ่ƒฝๆˆ–่€…ๅนณๅฐ่ฎพๅค‡็›ธๅ…ณ้ƒจๅˆ†ๅฐ†้€š่ฟ‡ๆจกๅ—ๆ–นๅผๆŒ‰้œ€ๆไพ›ใ€‚ ๆญคไธพๅ…่ฎธไบ†ไธๅŒๆจกๅ—ไน‹้—ด็š„็‹ฌ็ซ‹่ฟ›ๆญฅ๏ผŒๆ–นไพฟไบ†็ฌฌไธ‰ๆ–นๅผ€ๅ‘่€…ๅฏน Qt ็š„่ดก็Œฎใ€‚ **ๅฐ† QWidget ๅˆ†็ฆปๅ‡บๆˆไธบ็‹ฌ็ซ‹็š„ๅบ“** QWidget ่ขซๅˆ†็ฆปๅ‡บๆˆไธบๅ•็‹ฌ็š„ไธ€ไธชๅบ“๏ผŒไธ€ๆ–น้ขไฟ่ฏไพ็„ถๆƒณ่ฆไฝฟ็”จ่ฏฅ็ฑป็š„็”จๆˆทๆไพ›ๅ…ผๅฎนๆ€ง๏ผŒๅฆไธ€ๆ–น้ขไนŸๆ˜ฏๅœจ้ผ“ๅŠฑ็”จๆˆท่ฝฌๅ‘ไฝฟ็”จ QML ๅ’Œ Qt Quick ๆ–นๅผ็š„ๅ›พๅฝข่ฝฏไปถๅผ€ๅ‘ใ€‚ **ๅ…ถไป–ๆ”น่ฟ›** - Qt Core ๆ”นๅ–„ไบ† JSON ่งฃๆžๅ™จๅนถๆไพ›ไบ†ๆ–ฐ็š„ Perl ๆญฃๅˆ™ๅผ•ๆ“Žใ€‚ - ๆ”นๅ–„ไบ†ๅฏน C++11 ๆ”ฏๆŒใ€‚ - ๆ–ฐ็š„ Qt Quick ไฝฟ็”จ Google V8 ๅผ•ๆ“Žใ€‚ - ๅผ•ๅ…ฅๆ”ฏๆŒ 3D ๆ˜พ็คบ็š„ Qt 3D ๆจกๅ—ๅ’Œๆไพ›ไฝ็ฝฎ็›ธๅ…ณๆœๅŠก็š„ Qt Location ๆจกๅ—ใ€‚ - Qt WebKit ๅฐ†ไฝฟ็”จๆฅ่‡ช WebKit ไธŠๆธธ็š„ๆœ€ๆ–ฐ็‰ˆๆœฌ๏ผŒๆไพ›ๆ›ดๅฅฝ็š„ HTML5 ๅ…ผๅฎนๆ€งใ€‚ๆณจๆ„็›ฎๅ‰ๆš‚ๆ—ถ็ฆ็”จๅ…ถๅœจ Win ๅนณๅฐไธŠ็š„็ผ–่ฏ‘๏ผŒๅฐ†ไผšๅœจ Beta ้‡ๆ–ฐๅฏ็”จใ€‚ [Qt 4.X ่‡ณ Qt 5.X ่ฟ็งปๆŒ‡ๅ—](http://wiki.qt-project.org/Transition_from_Qt_4.x_to_Qt5) [ๆบไปฃ็ ๅŒ…ไธ‹่ฝฝ](http://releases.qt-project.org/qt5.0/alpha/) [ๅฎ˜ๆ–นๅ‘ๅธƒๅšๅฎข](http://labs.qt.nokia.com/2012/04/03/qt-5-alpha/) *ๆถˆๆฏๆฅๆบ๏ผš*[Phoronix](http://www.phoronix.com/scan.php?page=news_item&px=MTA4MjM)
{ "pile_set_name": "Github" }
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.example.android.sunshine.utilities; import android.content.ContentValues; import android.content.Context; import com.example.android.sunshine.data.SunshinePreferences; import com.example.android.sunshine.data.WeatherContract; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.net.HttpURLConnection; /** * Utility functions to handle OpenWeatherMap JSON data. */ public final class OpenWeatherJsonUtils { /* Location information */ private static final String OWM_CITY = "city"; private static final String OWM_COORD = "coord"; /* Location coordinate */ private static final String OWM_LATITUDE = "lat"; private static final String OWM_LONGITUDE = "lon"; /* Weather information. Each day's forecast info is an element of the "list" array */ private static final String OWM_LIST = "list"; private static final String OWM_PRESSURE = "pressure"; private static final String OWM_HUMIDITY = "humidity"; private static final String OWM_WINDSPEED = "speed"; private static final String OWM_WIND_DIRECTION = "deg"; /* All temperatures are children of the "temp" object */ private static final String OWM_TEMPERATURE = "temp"; /* Max temperature for the day */ private static final String OWM_MAX = "max"; private static final String OWM_MIN = "min"; private static final String OWM_WEATHER = "weather"; private static final String OWM_WEATHER_ID = "id"; private static final String OWM_MESSAGE_CODE = "cod"; /** * This method parses JSON from a web response and returns an array of Strings * describing the weather over various days from the forecast. * <p/> * Later on, we'll be parsing the JSON into structured data within the * getFullWeatherDataFromJson function, leveraging the data we have stored in the JSON. For * now, we just convert the JSON into human-readable strings. * * @param forecastJsonStr JSON response from server * * @return Array of Strings describing weather data * * @throws JSONException If JSON data cannot be properly parsed */ public static String[] getSimpleWeatherStringsFromJson(Context context, String forecastJsonStr) throws JSONException { String[] parsedWeatherData; JSONObject forecastJson = new JSONObject(forecastJsonStr); /* Is there an error? */ if (forecastJson.has(OWM_MESSAGE_CODE)) { int errorCode = forecastJson.getInt(OWM_MESSAGE_CODE); switch (errorCode) { case HttpURLConnection.HTTP_OK: break; case HttpURLConnection.HTTP_NOT_FOUND: /* Location invalid */ return null; default: /* Server probably down */ return null; } } JSONArray weatherArray = forecastJson.getJSONArray(OWM_LIST); parsedWeatherData = new String[weatherArray.length()]; long startDay = SunshineDateUtils.getNormalizedUtcDateForToday(); for (int i = 0; i < weatherArray.length(); i++) { String date; String highAndLow; /* These are the values that will be collected */ long dateTimeMillis; double high; double low; int weatherId; String description; /* Get the JSON object representing the day */ JSONObject dayForecast = weatherArray.getJSONObject(i); /* * We ignore all the datetime values embedded in the JSON and assume that * the values are returned in-order by day (which is not guaranteed to be correct). */ dateTimeMillis = startDay + SunshineDateUtils.DAY_IN_MILLIS * i; date = SunshineDateUtils.getFriendlyDateString(context, dateTimeMillis, false); /* * Description is in a child array called "weather", which is 1 element long. * That element also contains a weather code. */ JSONObject weatherObject = dayForecast.getJSONArray(OWM_WEATHER).getJSONObject(0); weatherId = weatherObject.getInt(OWM_WEATHER_ID); description = SunshineWeatherUtils.getStringForWeatherCondition(context, weatherId); /* * Temperatures are sent by Open Weather Map in a child object called "temp". * * Editor's Note: Try not to name variables "temp" when working with temperature. * It confuses everybody. Temp could easily mean any number of things, including * temperature, temporary and is just a bad variable name. */ JSONObject temperatureObject = dayForecast.getJSONObject(OWM_TEMPERATURE); high = temperatureObject.getDouble(OWM_MAX); low = temperatureObject.getDouble(OWM_MIN); highAndLow = SunshineWeatherUtils.formatHighLows(context, high, low); parsedWeatherData[i] = date + " - " + description + " - " + highAndLow; } return parsedWeatherData; } /** * This method parses JSON from a web response and returns an array of Strings * describing the weather over various days from the forecast. * <p/> * Later on, we'll be parsing the JSON into structured data within the * getFullWeatherDataFromJson function, leveraging the data we have stored in the JSON. For * now, we just convert the JSON into human-readable strings. * * @param forecastJsonStr JSON response from server * * @return Array of Strings describing weather data * * @throws JSONException If JSON data cannot be properly parsed */ public static ContentValues[] getWeatherContentValuesFromJson(Context context, String forecastJsonStr) throws JSONException { JSONObject forecastJson = new JSONObject(forecastJsonStr); /* Is there an error? */ if (forecastJson.has(OWM_MESSAGE_CODE)) { int errorCode = forecastJson.getInt(OWM_MESSAGE_CODE); switch (errorCode) { case HttpURLConnection.HTTP_OK: break; case HttpURLConnection.HTTP_NOT_FOUND: /* Location invalid */ return null; default: /* Server probably down */ return null; } } JSONArray jsonWeatherArray = forecastJson.getJSONArray(OWM_LIST); JSONObject cityJson = forecastJson.getJSONObject(OWM_CITY); JSONObject cityCoord = cityJson.getJSONObject(OWM_COORD); double cityLatitude = cityCoord.getDouble(OWM_LATITUDE); double cityLongitude = cityCoord.getDouble(OWM_LONGITUDE); SunshinePreferences.setLocationDetails(context, cityLatitude, cityLongitude); ContentValues[] weatherContentValues = new ContentValues[jsonWeatherArray.length()]; /* * OWM returns daily forecasts based upon the local time of the city that is being asked * for, which means that we need to know the GMT offset to translate this data properly. * Since this data is also sent in-order and the first day is always the current day, we're * going to take advantage of that to get a nice normalized UTC date for all of our weather. */ // long now = System.currentTimeMillis(); // long normalizedUtcStartDay = SunshineDateUtils.normalizeDate(now); long normalizedUtcStartDay = SunshineDateUtils.getNormalizedUtcDateForToday(); for (int i = 0; i < jsonWeatherArray.length(); i++) { long dateTimeMillis; double pressure; int humidity; double windSpeed; double windDirection; double high; double low; int weatherId; /* Get the JSON object representing the day */ JSONObject dayForecast = jsonWeatherArray.getJSONObject(i); /* * We ignore all the datetime values embedded in the JSON and assume that * the values are returned in-order by day (which is not guaranteed to be correct). */ dateTimeMillis = normalizedUtcStartDay + SunshineDateUtils.DAY_IN_MILLIS * i; pressure = dayForecast.getDouble(OWM_PRESSURE); humidity = dayForecast.getInt(OWM_HUMIDITY); windSpeed = dayForecast.getDouble(OWM_WINDSPEED); windDirection = dayForecast.getDouble(OWM_WIND_DIRECTION); /* * Description is in a child array called "weather", which is 1 element long. * That element also contains a weather code. */ JSONObject weatherObject = dayForecast.getJSONArray(OWM_WEATHER).getJSONObject(0); weatherId = weatherObject.getInt(OWM_WEATHER_ID); /* * Temperatures are sent by Open Weather Map in a child object called "temp". * * Editor's Note: Try not to name variables "temp" when working with temperature. * It confuses everybody. Temp could easily mean any number of things, including * temperature, temporary variable, temporary folder, temporary employee, or many * others, and is just a bad variable name. */ JSONObject temperatureObject = dayForecast.getJSONObject(OWM_TEMPERATURE); high = temperatureObject.getDouble(OWM_MAX); low = temperatureObject.getDouble(OWM_MIN); ContentValues weatherValues = new ContentValues(); weatherValues.put(WeatherContract.WeatherEntry.COLUMN_DATE, dateTimeMillis); weatherValues.put(WeatherContract.WeatherEntry.COLUMN_HUMIDITY, humidity); weatherValues.put(WeatherContract.WeatherEntry.COLUMN_PRESSURE, pressure); weatherValues.put(WeatherContract.WeatherEntry.COLUMN_WIND_SPEED, windSpeed); weatherValues.put(WeatherContract.WeatherEntry.COLUMN_DEGREES, windDirection); weatherValues.put(WeatherContract.WeatherEntry.COLUMN_MAX_TEMP, high); weatherValues.put(WeatherContract.WeatherEntry.COLUMN_MIN_TEMP, low); weatherValues.put(WeatherContract.WeatherEntry.COLUMN_WEATHER_ID, weatherId); weatherContentValues[i] = weatherValues; } return weatherContentValues; } }
{ "pile_set_name": "Github" }
use std::path::Path; use std::fs::symlink_metadata; use std::os::unix::fs::{MetadataExt, PermissionsExt}; use libmount::{BindMount, Tmpfs}; use config::volumes::SnapshotInfo; use file_util::Dir; use container::mount::{unmount}; use container::util::{copy_dir}; pub fn make_snapshot(src: &Path, dest: &Path, info: &SnapshotInfo) -> Result<(), String> { let tmp = Path::new("/tmp/mnt"); try_msg!(Dir::new(&tmp).recursive(true).create(), "Error creating temporary mountpoint: {err}"); let stat = try_msg!(symlink_metadata(&dest), "Error getting mountpoint metadata: {err}"); let mode = stat.permissions().mode(); let (uid, gid) = (stat.uid(), stat.gid()); BindMount::new(&src, &tmp).mount().map_err(|e| e.to_string())?; Tmpfs::new(&dest) .size_bytes(info.size) .mode(mode) .uid(uid) .gid(gid) .mount().map_err(|e| format!("{}", e))?; try_msg!(copy_dir(&tmp, dest, info.owner_uid, info.owner_gid), "Error copying directory: {err}"); unmount(tmp)?; Ok(()) }
{ "pile_set_name": "Github" }
const { expect } = require('chai'); describe('User (model)', () => { before(async () => { await User.create({ email: 'test@test.test', password: 'test', name: 'test', }); }); describe('#find()', () => { it('should return 1 user', async () => { const users = await User.find(); expect(users).to.have.lengthOf(1); }); }); });
{ "pile_set_name": "Github" }
# /* ************************************************************************** # * * # * (C) Copyright Paul Mensonides 2002. # * 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) # * * # ************************************************************************** */ # # /* See http://www.boost.org for most recent version. */ # # ifndef BOOST_PREPROCESSOR_SEQ_TO_TUPLE_HPP # define BOOST_PREPROCESSOR_SEQ_TO_TUPLE_HPP # # include <boost/preprocessor/config/config.hpp> # include <boost/preprocessor/seq/enum.hpp> # # /* BOOST_PP_SEQ_TO_TUPLE */ # # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG() # define BOOST_PP_SEQ_TO_TUPLE(seq) (BOOST_PP_SEQ_ENUM(seq)) # else # define BOOST_PP_SEQ_TO_TUPLE(seq) BOOST_PP_SEQ_TO_TUPLE_I(seq) # define BOOST_PP_SEQ_TO_TUPLE_I(seq) (BOOST_PP_SEQ_ENUM(seq)) # endif # # endif
{ "pile_set_name": "Github" }
# RUN: llvm-mc -triple=hexagon -filetype=obj -o - %s | llvm-objdump -d - | FileCheck %s # Hexagon Programmer's Reference Manual 11.10.2 XTYPE/BIT # Count leading # CHECK: 11 c0 54 88 r17 = clb(r21:20) # CHECK: 51 c0 54 88 r17 = cl0(r21:20) # CHECK: 91 c0 54 88 r17 = cl1(r21:20) # CHECK: 11 c0 74 88 r17 = normamt(r21:20) # CHECK: 51 d7 74 88 r17 = add(clb(r21:20), #23) # CHECK: 11 d7 35 8c r17 = add(clb(r21), #23) # CHECK: 91 c0 15 8c r17 = clb(r21) # CHECK: b1 c0 15 8c r17 = cl0(r21) # CHECK: d1 c0 15 8c r17 = cl1(r21) # CHECK: f1 c0 15 8c r17 = normamt(r21) # Count population # CHECK: 71 c0 74 88 r17 = popcount(r21:20) # Count trailing # CHECK: 51 c0 f4 88 r17 = ct0(r21:20) # CHECK: 91 c0 f4 88 r17 = ct1(r21:20) # CHECK: 91 c0 55 8c r17 = ct0(r21) # CHECK: b1 c0 55 8c r17 = ct1(r21) # Extract bitfield # CHECK: f0 df 54 81 r17:16 = extractu(r21:20, #31, #23) # CHECK: f0 df 54 8a r17:16 = extract(r21:20, #31, #23) # CHECK: f1 df 55 8d r17 = extractu(r21, #31, #23) # CHECK: f1 df d5 8d r17 = extract(r21, #31, #23) # CHECK: 10 de 14 c1 r17:16 = extractu(r21:20, r31:30) # CHECK: 90 de d4 c1 r17:16 = extract(r21:20, r31:30) # CHECK: 11 de 15 c9 r17 = extractu(r21, r31:30) # CHECK: 51 de 15 c9 r17 = extract(r21, r31:30) # Insert bitfield # CHECK: f0 df 54 83 r17:16 = insert(r21:20, #31, #23) # CHECK: f1 df 55 8f r17 = insert(r21, #31, #23) # CHECK: 11 de 15 c8 r17 = insert(r21, r31:30) # CHECK: 10 de 14 ca r17:16 = insert(r21:20, r31:30) # Interleave/deinterleave # CHECK: 90 c0 d4 80 r17:16 = deinterleave(r21:20) # CHECK: b0 c0 d4 80 r17:16 = interleave(r21:20) # Linear feedback-shift iteration # CHECK: d0 de 94 c1 r17:16 = lfs(r21:20, r31:30) # Masked parity # CHECK: 11 de 14 d0 r17 = parity(r21:20, r31:30) # CHECK: 11 df f5 d5 r17 = parity(r21, r31) # Bit reverse # CHECK: d0 c0 d4 80 r17:16 = brev(r21:20) # CHECK: d1 c0 55 8c r17 = brev(r21) # Set/clear/toggle bit # CHECK: 11 df d5 8c r17 = setbit(r21, #31) # CHECK: 31 df d5 8c r17 = clrbit(r21, #31) # CHECK: 51 df d5 8c r17 = togglebit(r21, #31) # CHECK: 11 df 95 c6 r17 = setbit(r21, r31) # CHECK: 51 df 95 c6 r17 = clrbit(r21, r31) # CHECK: 91 df 95 c6 r17 = togglebit(r21, r31) # Split bitfield # CHECK: 90 df d5 88 r17:16 = bitsplit(r21, #31) # CHECK: 10 df 35 d4 r17:16 = bitsplit(r21, r31) # Table index # CHECK: f1 cd 15 87 r17 = tableidxb(r21, #7, #13):raw # CHECK: f1 cd 55 87 r17 = tableidxh(r21, #7, #13):raw # CHECK: f1 cd 95 87 r17 = tableidxw(r21, #7, #13):raw # CHECK: f1 cd d5 87 r17 = tableidxd(r21, #7, #13):raw
{ "pile_set_name": "Github" }
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin dragonfly freebsd linux netbsd openbsd solaris package unix_test import ( "fmt" "testing" "golang.org/x/sys/unix" ) func testSetGetenv(t *testing.T, key, value string) { err := unix.Setenv(key, value) if err != nil { t.Fatalf("Setenv failed to set %q: %v", value, err) } newvalue, found := unix.Getenv(key) if !found { t.Fatalf("Getenv failed to find %v variable (want value %q)", key, value) } if newvalue != value { t.Fatalf("Getenv(%v) = %q; want %q", key, newvalue, value) } } func TestEnv(t *testing.T) { testSetGetenv(t, "TESTENV", "AVALUE") // make sure TESTENV gets set to "", not deleted testSetGetenv(t, "TESTENV", "") } func TestItoa(t *testing.T) { // Make most negative integer: 0x8000... i := 1 for i<<1 != 0 { i <<= 1 } if i >= 0 { t.Fatal("bad math") } s := unix.Itoa(i) f := fmt.Sprint(i) if s != f { t.Fatalf("itoa(%d) = %s, want %s", i, s, f) } }
{ "pile_set_name": "Github" }
// // IJSImageGaussanView.h // IJSImageEditSDK // // Created by shan on 2017/7/26. // Copyright ยฉ 2017ๅนด shanshen. All rights reserved. // #import <UIKit/UIKit.h> /** * ้ซ˜ๆ–ฏUI */ @interface IJSImageGaussanView : UIView @property (nonatomic, weak) UIImage *originImage; // ๅŽŸๅ›พ @property (nonatomic, weak) UIImage *gaussanViewGaussanImage; // ๆๅ‰็ป˜ๅˆถๅฅฝ้ซ˜ๆ–ฏๅ›พ /** * ๆ’ค้”€็ป˜็”ป */ - (void)cleanLastDrawPath; /** * ๆธ…้™คๆ‰€ๆœ‰็š„็ป˜็”ป */ - (void)cleanAllDrawPath; @property (nonatomic, copy) void (^gaussanViewDidTap)(void); // ๅ•ๅ‡ป็š„ๅ›ž่ฐƒ @property (nonatomic, copy) void (^gaussanViewdrawingCallBack)(BOOL isDrawing); // ๆญฃๅœจ็ป˜ๅˆถ็š„ๅ›ž่ฐƒ @property (nonatomic, copy) void (^gaussanViewEndDrawCallBack)(BOOL isEndDraw); // ็ป“ๆŸ็ป˜ๅˆถ /** * ๅฎŒๆˆ็ป˜ๅˆถ */ - (void)didFinishHandleWithCompletionBlock:(void (^)(UIImage *image, NSError *error, NSDictionary *userInfo))completionBlock; @end
{ "pile_set_name": "Github" }
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>WebCryptoSha2Hash | blockstack.js 21.1.1 Library Reference</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"> </head> <body> <link rel="stylesheet" href="../assets/css/custom-style.css"> <header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base=".."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="../index.html" class="title">blockstack.js 21.1.1 Library Reference</a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="tsd-filter-inherited" checked /> <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label> <input type="checkbox" id="tsd-filter-only-exported" /> <label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="../globals.html">Globals</a> </li> <li> <a href="webcryptosha2hash.html">WebCryptoSha2Hash</a> </li> </ul> <h1>Class WebCryptoSha2Hash</h1> </div> </div> </header> <div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <span class="target">WebCryptoSha2Hash</span> </li> </ul> </section> <section class="tsd-panel"> <h3>Implements</h3> <ul class="tsd-hierarchy"> <li><a href="../interfaces/sha2hash.html" class="tsd-signature-type">Sha2Hash</a></li> </ul> </section> <section class="tsd-panel-group tsd-index-group"> <h2>Index</h2> <section class="tsd-panel tsd-index-panel"> <div class="tsd-index-content"> <section class="tsd-index-section "> <h3>Constructors</h3> <ul class="tsd-index-list"> <li class="tsd-kind-constructor tsd-parent-kind-class"><a href="webcryptosha2hash.html#constructor" class="tsd-kind-icon">constructor</a></li> </ul> </section> <section class="tsd-index-section "> <h3>Properties</h3> <ul class="tsd-index-list"> <li class="tsd-kind-property tsd-parent-kind-class"><a href="webcryptosha2hash.html#subtlecrypto" class="tsd-kind-icon">subtle<wbr>Crypto</a></li> </ul> </section> <section class="tsd-index-section "> <h3>Methods</h3> <ul class="tsd-index-list"> <li class="tsd-kind-method tsd-parent-kind-class"><a href="webcryptosha2hash.html#digest" class="tsd-kind-icon">digest</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Constructors</h2> <section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class"> <a name="constructor" class="tsd-anchor"></a> <h3>constructor</h3> <ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">new <wbr>Web<wbr>Crypto<wbr>Sha2<wbr>Hash<span class="tsd-signature-symbol">(</span>subtleCrypto<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">SubtleCrypto</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="webcryptosha2hash.html" class="tsd-signature-type">WebCryptoSha2Hash</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/encryption/sha2Hash.ts#L32">src/encryption/sha2Hash.ts:32</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>subtleCrypto: <span class="tsd-signature-type">SubtleCrypto</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="webcryptosha2hash.html" class="tsd-signature-type">WebCryptoSha2Hash</a></h4> </li> </ul> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Properties</h2> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <a name="subtlecrypto" class="tsd-anchor"></a> <h3>subtle<wbr>Crypto</h3> <div class="tsd-signature tsd-kind-icon">subtle<wbr>Crypto<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SubtleCrypto</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/encryption/sha2Hash.ts#L32">src/encryption/sha2Hash.ts:32</a></li> </ul> </aside> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Methods</h2> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="digest" class="tsd-anchor"></a> <h3>digest</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">digest<span class="tsd-signature-symbol">(</span>data<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Buffer</span>, algorithm<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/blockstack/blockstack.js/blob/master/src/encryption/sha2Hash.ts#L38">src/encryption/sha2Hash.ts:38</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>data: <span class="tsd-signature-type">Buffer</span></h5> </li> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> algorithm: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> =&nbsp;&quot;sha256&quot;</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">&gt;</span></h4> </li> </ul> </section> </section> </div> <div class="col-4 col-menu menu-sticky-wrap menu-highlight"> <nav class="tsd-navigation primary"> <ul> <li class="globals "> <a href="../globals.html"><em>Globals</em></a> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> </ul> <ul class="current"> <li class="current tsd-kind-class"> <a href="webcryptosha2hash.html" class="tsd-kind-icon">Web<wbr>Crypto<wbr>Sha2<wbr>Hash</a> <ul> <li class=" tsd-kind-constructor tsd-parent-kind-class"> <a href="webcryptosha2hash.html#constructor" class="tsd-kind-icon">constructor</a> </li> <li class=" tsd-kind-property tsd-parent-kind-class"> <a href="webcryptosha2hash.html#subtlecrypto" class="tsd-kind-icon">subtle<wbr>Crypto</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="webcryptosha2hash.html#digest" class="tsd-kind-icon">digest</a> </li> </ul> </li> </ul> <ul class="after-current"> </ul> </nav> </div> </div> </div> <footer class="with-border-bottom"> <div class="container"> <h2>Legend</h2> <div class="tsd-legend-group"> <ul class="tsd-legend"> <li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li> <li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li> <li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li> <li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li> <li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li> <li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li> <li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li> <li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li> <li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li> <li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li> <li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li> <li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li> <li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li> <li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li> <li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li> <li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li> <li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li> </ul> </div> </div> </footer> <div class="container tsd-generator"> <p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p> </div> <div class="overlay"></div> <script src="../assets/js/main.js"></script> <script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script> </body> </html>
{ "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. package v1beta1 import ( "context" "time" v1beta1 "k8s.io/api/networking/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) // IngressesGetter has a method to return a IngressInterface. // A group's client should implement this interface. type IngressesGetter interface { Ingresses(namespace string) IngressInterface } // IngressInterface has methods to work with Ingress resources. type IngressInterface interface { Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (*v1beta1.Ingress, error) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Ingress, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) IngressExpansion } // ingresses implements IngressInterface type ingresses struct { client rest.Interface ns string } // newIngresses returns a Ingresses func newIngresses(c *NetworkingV1beta1Client, namespace string) *ingresses { return &ingresses{ client: c.RESTClient(), ns: namespace, } } // Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. func (c *ingresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Get(). Namespace(c.ns). Resource("ingresses"). Name(name). VersionedParams(&options, scheme.ParameterCodec). Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Ingresses that match those selectors. func (c *ingresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } result = &v1beta1.IngressList{} err = c.client.Get(). Namespace(c.ns). Resource("ingresses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested ingresses. func (c *ingresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("ingresses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). Watch(ctx) } // Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. func (c *ingresses) Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Post(). Namespace(c.ns). Resource("ingresses"). VersionedParams(&opts, scheme.ParameterCodec). Body(ingress). Do(ctx). Into(result) return } // Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. func (c *ingresses) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Put(). Namespace(c.ns). Resource("ingresses"). Name(ingress.Name). VersionedParams(&opts, scheme.ParameterCodec). Body(ingress). Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *ingresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Put(). Namespace(c.ns). Resource("ingresses"). Name(ingress.Name). SubResource("status"). VersionedParams(&opts, scheme.ParameterCodec). Body(ingress). Do(ctx). Into(result) return } // Delete takes name of the ingress and deletes it. Returns an error if one occurs. func (c *ingresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("ingresses"). Name(name). Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. func (c *ingresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration if listOpts.TimeoutSeconds != nil { timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("ingresses"). VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). Body(&opts). Do(ctx). Error() } // Patch applies the patch and returns the patched ingress. func (c *ingresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Patch(pt). Namespace(c.ns). Resource("ingresses"). Name(name). SubResource(subresources...). VersionedParams(&opts, scheme.ParameterCodec). Body(data). Do(ctx). Into(result) return }
{ "pile_set_name": "Github" }
# amcheck extension comment = 'functions for verifying relation integrity' default_version = '1.2' module_pathname = '$libdir/amcheck' relocatable = true
{ "pile_set_name": "Github" }
/* * Vieb - Vim Inspired Electron Browser * Copyright (C) 2020 Jelmer van Arnhem * * 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 <https://www.gnu.org/licenses/>. */ @font-face {font-family: RobotoMono;src: url("./font/RobotoMono-Regular.ttf");} body {color: #eee;width: 90vw;font: 14px RobotoMono, monospace;background: #333;padding: 0;margin: auto;} h1 {font-size: 2em;margin: 1em 0;padding: 0;} #list {display: flex;flex-direction: column-reverse;margin: 2em 0;} .notification {border: .1em solid #222;background: #444;margin: 1em 0;padding: 1em;} .date {color: #aaa;} .permission {color: #aaa;} .error {color: #f33;} .warning {color: #fd0;} .info {color: #0cf;}
{ "pile_set_name": "Github" }
## ## This file is part of qpOASES. ## ## qpOASES -- An Implementation of the Online Active Set Strategy. ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, ## Christian Kirches et al. All rights reserved. ## ## qpOASES is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public ## License as published by the Free Software Foundation; either ## version 2.1 of the License, or (at your option) any later version. ## ## qpOASES is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ## See the GNU Lesser General Public License for more details. ## ## You should have received a copy of the GNU Lesser General Public ## License along with qpOASES; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## ## ## Filename: testing/cpp/Makefile ## Author: Hans Joachim Ferreau ## Version: 3.2 ## Date: 2007-2015 ## include ../../make.mk ## ## flags ## IFLAGS = -I. \ -I${IDIR} QPOASES_TEST_EXES = \ ${BINDIR}/test_bench${EXE} \ ${BINDIR}/test_matrices${EXE} \ ${BINDIR}/test_matrices2${EXE} \ ${BINDIR}/test_matrices3${EXE} \ ${BINDIR}/test_indexlist${EXE} \ ${BINDIR}/test_example1${EXE} \ ${BINDIR}/test_example1a${EXE} \ ${BINDIR}/test_example1b${EXE} \ ${BINDIR}/test_example2${EXE} \ ${BINDIR}/test_example4${EXE} \ ${BINDIR}/test_example5${EXE} \ ${BINDIR}/test_example6${EXE} \ ${BINDIR}/test_example7${EXE} \ ${BINDIR}/test_exampleLP${EXE} \ ${BINDIR}/test_qrecipe${EXE} \ ${BINDIR}/test_qrecipeSchur${EXE} \ ${BINDIR}/test_infeasible1${EXE} \ ${BINDIR}/test_hs268${EXE} \ ${BINDIR}/test_gradientShift${EXE} \ ${BINDIR}/test_runAllOqpExamples${EXE} \ ${BINDIR}/test_sebastien1${EXE} \ ${BINDIR}/test_vanBarelsUnboundedQP${EXE} \ ${BINDIR}/test_janick1${EXE} \ ${BINDIR}/test_janick2${EXE} \ ${BINDIR}/test_constraintProduct1${EXE} \ ${BINDIR}/test_constraintProduct2${EXE} \ ${BINDIR}/test_guessedWS1${EXE} \ ${BINDIR}/test_externalChol1${EXE} ## ## targets ## all: ${QPOASES_TEST_EXES} runTests: ${QPOASES_TEST_EXES} @cd .. && ./runUnitTests && ./checkForMemoryLeaks && cd cpp ${BINDIR}/%${EXE}: %.${OBJEXT} ${LINK_DEPENDS} @${ECHO} "Creating" $@ @${CPP} ${DEF_TARGET} ${CPPFLAGS} $< ${QPOASES_LINK} ${LINK_LIBRARIES} ${BINDIR}/test_matrices2${EXE}: test_matrices2.${OBJEXT} test_qrecipe_data.hpp ${LINK_DEPENDS} @${ECHO} "Creating" $@ @${CPP} ${DEF_TARGET} ${CPPFLAGS} $< ${QPOASES_LINK} ${LINK_LIBRARIES} ${BINDIR}/test_matrices3${EXE}: test_matrices3.${OBJEXT} test_qrecipe_data.hpp ${LINK_DEPENDS} @${ECHO} "Creating" $@ @${CPP} ${DEF_TARGET} ${CPPFLAGS} $< ${QPOASES_LINK} ${LINK_LIBRARIES} ${BINDIR}/test_qrecipe${EXE}: test_qrecipe.${OBJEXT} test_qrecipe_data.hpp ${LINK_DEPENDS} @${ECHO} "Creating" $@ @${CPP} ${DEF_TARGET} ${CPPFLAGS} $< ${QPOASES_LINK} ${LINK_LIBRARIES} ${BINDIR}/test_qrecipeSchur${EXE}: test_qrecipeSchur.${OBJEXT} test_qrecipe_data.hpp ${LINK_DEPENDS} @${ECHO} "Creating" $@ @${CPP} ${DEF_TARGET} ${CPPFLAGS} $< ${QPOASES_LINK} ${LINK_LIBRARIES} clean: @${ECHO} "Cleaning up (testing/cpp)" @${RM} -f *.${OBJEXT} ${QPOASES_TEST_EXES} clobber: clean ${LINK_DEPENDS}: @cd ../..; ${MAKE} -s src test_matrices2.${OBJEXT}: test_matrices2.cpp test_qrecipe_data.hpp @${ECHO} "Creating" $@ @${CPP} ${DEF_TARGET} ${IFLAGS} ${CPPFLAGS} -c $< test_matrices3.${OBJEXT}: test_matrices3.cpp test_qrecipe_data.hpp @${ECHO} "Creating" $@ @${CPP} ${DEF_TARGET} ${IFLAGS} ${CPPFLAGS} -c $< test_qrecipe.${OBJEXT}: test_qrecipe.cpp test_qrecipe_data.hpp @${ECHO} "Creating" $@ @${CPP} ${DEF_TARGET} ${IFLAGS} ${CPPFLAGS} -c $< test_qrecipeSchur.${OBJEXT}: test_qrecipeSchur.cpp test_qrecipe_data.hpp @${ECHO} "Creating" $@ @${CPP} ${DEF_TARGET} ${IFLAGS} ${CPPFLAGS} -c $< %.${OBJEXT}: %.cpp @${ECHO} "Creating" $@ @${CPP} ${DEF_TARGET} ${IFLAGS} ${CPPFLAGS} -c $< ## ## end of file ##
{ "pile_set_name": "Github" }
/* This samples shows the creation of a multi-level directory which has the same name for each of the directory level. Before this date multi-level directory with same name on each level will only create the first level Example:: dir = new Directory("../testfiles/dir_test/dir_test/dir_test/dir_test/dir_test") dir.Create() The above example will only create the directory ``"../testfiles/dir_test/"`` neglecting all the sub level directory with the same name **dir_test** This issue has been resolve in the following commit https://github.com/simple-lang/simple/commit/f45af071ee49ef37d80e88b141adae1e82a1cac0 :copyright: 2018-2019, Azeez Adewale :license: MIT License Copyright (c) 2018 simple :author: Azeez Adewale <azeezadewale98@gmail.com> :date: March 23 2019 :filename: create_directory.sim */ from simple.core.Object from simple.util.Console from simple.io.Directory block main() dir = new Directory("../testfiles/dir_test/dir_test/dir_test/dir_test/dir_test") stdout.Println(dir) dir.Create()
{ "pile_set_name": "Github" }
/** * @author Yosuke ota * See LICENSE file in root directory for full license. */ 'use strict' // ----------------------------------------------------------------------------- // Requirements // ----------------------------------------------------------------------------- const htmlComments = require('../utils/html-comments') // ------------------------------------------------------------------------------ // Helpers // ------------------------------------------------------------------------------ /** * Normalize options. * @param {number|"tab"|undefined} type The type of indentation. * @returns { { indentChar: string, indentSize: number, indentText: string } } Normalized options. */ function parseOptions(type) { const ret = { indentChar: ' ', indentSize: 2, indentText: '' } if (Number.isSafeInteger(type)) { ret.indentSize = Number(type) } else if (type === 'tab') { ret.indentChar = '\t' ret.indentSize = 1 } ret.indentText = ret.indentChar.repeat(ret.indentSize) return ret } /** * @param {string} s * @param {string} [unitChar] */ function toDisplay(s, unitChar) { if (s.length === 0 && unitChar) { return `0 ${toUnit(unitChar)}s` } const char = s[0] if (char === ' ' || char === '\t') { if (s.split('').every((c) => c === char)) { return `${s.length} ${toUnit(char)}${s.length === 1 ? '' : 's'}` } } return JSON.stringify(s) } /** @param {string} char */ function toUnit(char) { if (char === '\t') { return 'tab' } if (char === ' ') { return 'space' } return JSON.stringify(char) } // ------------------------------------------------------------------------------ // Rule Definition // ------------------------------------------------------------------------------ module.exports = { meta: { type: 'layout', docs: { description: 'enforce consistent indentation in HTML comments', categories: undefined, url: 'https://eslint.vuejs.org/rules/html-comment-indent.html' }, fixable: 'whitespace', schema: [ { anyOf: [{ type: 'integer', minimum: 0 }, { enum: ['tab'] }] } ], messages: { unexpectedBaseIndentation: 'Expected base point indentation of {{expected}}, but found {{actual}}.', missingBaseIndentation: 'Expected base point indentation of {{expected}}, but not found.', unexpectedIndentationCharacter: 'Expected {{expected}} character, but found {{actual}} character.', unexpectedIndentation: 'Expected indentation of {{expected}} but found {{actual}}.', unexpectedRelativeIndentation: 'Expected relative indentation of {{expected}} but found {{actual}}.' } }, /** @param {RuleContext} context */ create(context) { const options = parseOptions(context.options[0]) const sourceCode = context.getSourceCode() return htmlComments.defineVisitor( context, null, (comment) => { const baseIndentText = getLineIndentText(comment.open.loc.start.line) let endLine if (comment.value) { const startLine = comment.value.loc.start.line endLine = comment.value.loc.end.line const checkStartLine = comment.open.loc.end.line === startLine ? startLine + 1 : startLine for (let line = checkStartLine; line <= endLine; line++) { validateIndentForLine(line, baseIndentText, 1) } } else { endLine = comment.open.loc.end.line } if (endLine < comment.close.loc.start.line) { // `-->` validateIndentForLine(comment.close.loc.start.line, baseIndentText, 0) } }, { includeDirectives: true } ) /** * Checks whether the given line is a blank line. * @param {number} line The number of line. Begins with 1. * @returns {boolean} `true` if the given line is a blank line */ function isEmptyLine(line) { const lineText = sourceCode.getLines()[line - 1] return !lineText.trim() } /** * Get the actual indentation of the given line. * @param {number} line The number of line. Begins with 1. * @returns {string} The actual indentation text */ function getLineIndentText(line) { const lineText = sourceCode.getLines()[line - 1] const charIndex = lineText.search(/\S/) // already checked // if (charIndex < 0) { // return lineText // } return lineText.slice(0, charIndex) } /** * Define the function which fixes the problem. * @param {number} line The number of line. * @param {string} actualIndentText The actual indentation text. * @param {string} expectedIndentText The expected indentation text. * @returns { (fixer: RuleFixer) => Fix } The defined function. */ function defineFix(line, actualIndentText, expectedIndentText) { return (fixer) => { const start = sourceCode.getIndexFromLoc({ line, column: 0 }) return fixer.replaceTextRange( [start, start + actualIndentText.length], expectedIndentText ) } } /** * Validate the indentation of a line. * @param {number} line The number of line. Begins with 1. * @param {string} baseIndentText The expected base indentation text. * @param {number} offset The number of the indentation offset. */ function validateIndentForLine(line, baseIndentText, offset) { if (isEmptyLine(line)) { return } const actualIndentText = getLineIndentText(line) const expectedOffsetIndentText = options.indentText.repeat(offset) const expectedIndentText = baseIndentText + expectedOffsetIndentText // validate base indent if ( baseIndentText && (actualIndentText.length < baseIndentText.length || !actualIndentText.startsWith(baseIndentText)) ) { context.report({ loc: { start: { line, column: 0 }, end: { line, column: actualIndentText.length } }, messageId: actualIndentText ? 'unexpectedBaseIndentation' : 'missingBaseIndentation', data: { expected: toDisplay(baseIndentText), actual: toDisplay(actualIndentText.slice(0, baseIndentText.length)) }, fix: defineFix(line, actualIndentText, expectedIndentText) }) return } const actualOffsetIndentText = actualIndentText.slice( baseIndentText.length ) // validate indent charctor for (let i = 0; i < actualOffsetIndentText.length; ++i) { if (actualOffsetIndentText[i] !== options.indentChar) { context.report({ loc: { start: { line, column: baseIndentText.length + i }, end: { line, column: baseIndentText.length + i + 1 } }, messageId: 'unexpectedIndentationCharacter', data: { expected: toUnit(options.indentChar), actual: toUnit(actualOffsetIndentText[i]) }, fix: defineFix(line, actualIndentText, expectedIndentText) }) return } } // validate indent length if (actualOffsetIndentText.length !== expectedOffsetIndentText.length) { context.report({ loc: { start: { line, column: baseIndentText.length }, end: { line, column: actualIndentText.length } }, messageId: baseIndentText ? 'unexpectedRelativeIndentation' : 'unexpectedIndentation', data: { expected: toDisplay(expectedOffsetIndentText, options.indentChar), actual: toDisplay(actualOffsetIndentText, options.indentChar) }, fix: defineFix(line, actualIndentText, expectedIndentText) }) } } } }
{ "pile_set_name": "Github" }
// Copyright 2009 The Closure Library Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS-IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * @fileoverview Wrapper on a Flash object embedded in the HTML page. * This class contains routines for writing the HTML to create the Flash object * using a goog.ui.Component approach. Tested on Firefox 1.5, 2 and 3, IE6, 7, * Konqueror, Chrome and Safari. * * Based on http://go/flashobject.js * * Based on the following compatibility test suite: * http://www.bobbyvandersluis.com/flashembed/testsuite/ * * TODO(user): take a look at swfobject, and maybe use it instead of the current * flash embedding method. * * Examples of usage: * * <pre> * var url = goog.html.TrustedResourceUrl.fromConstant( * goog.string.Const.from('https://hostname/flash.swf')) * var flash = new goog.ui.media.FlashObject(url); * flash.setFlashVar('myvar', 'foo'); * flash.render(goog.dom.getElement('parent')); * </pre> * * TODO(user, jessan): create a goog.ui.media.BrowserInterfaceFlashObject that * subclasses goog.ui.media.FlashObject to provide all the goodness of * http://go/browserinterface.as * */ goog.provide('goog.ui.media.FlashObject'); goog.provide('goog.ui.media.FlashObject.ScriptAccessLevel'); goog.provide('goog.ui.media.FlashObject.Wmodes'); goog.require('goog.asserts'); goog.require('goog.dom.TagName'); goog.require('goog.dom.safe'); goog.require('goog.events.Event'); goog.require('goog.events.EventHandler'); goog.require('goog.events.EventType'); goog.require('goog.html.SafeUrl'); goog.require('goog.html.TrustedResourceUrl'); goog.require('goog.html.flash'); goog.require('goog.html.legacyconversions'); goog.require('goog.log'); goog.require('goog.object'); goog.require('goog.string'); goog.require('goog.structs.Map'); goog.require('goog.style'); goog.require('goog.ui.Component'); goog.require('goog.userAgent'); goog.require('goog.userAgent.flash'); /** * A very simple flash wrapper, that allows you to create flash object * programmatically, instead of embedding your own HTML. It extends * {@link goog.ui.Component}, which makes it very easy to be embedded on the * page. * * @param {string|!goog.html.TrustedResourceUrl} flashUrl The Flash SWF URL. * If possible pass a TrustedResourceUrl. string is supported * for backwards-compatibility only, uses goog.html.legacyconversions, * and will be sanitized with goog.html.SafeUrl.sanitize() before being * used. * @param {goog.dom.DomHelper=} opt_domHelper An optional DomHelper. * @extends {goog.ui.Component} * @constructor */ goog.ui.media.FlashObject = function(flashUrl, opt_domHelper) { goog.ui.Component.call(this, opt_domHelper); var trustedResourceUrl; if (flashUrl instanceof goog.html.TrustedResourceUrl) { trustedResourceUrl = flashUrl; } else { var flashUrlSanitized = goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(flashUrl)); trustedResourceUrl = goog.html.legacyconversions .trustedResourceUrlFromString(flashUrlSanitized); } /** * The URL of the flash movie to be embedded. * * @type {!goog.html.TrustedResourceUrl} * @private */ this.flashUrl_ = trustedResourceUrl; /** * An event handler used to handle events consistently between browsers. * @type {goog.events.EventHandler<!goog.ui.media.FlashObject>} * @private */ this.eventHandler_ = new goog.events.EventHandler(this); /** * A map of variables to be passed to the flash movie. * * @type {goog.structs.Map} * @private */ this.flashVars_ = new goog.structs.Map(); }; goog.inherits(goog.ui.media.FlashObject, goog.ui.Component); /** * Different states of loaded-ness in which the SWF itself can be * * Talked about at: * http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12059&sliceId=1 * * @enum {number} * @private */ goog.ui.media.FlashObject.SwfReadyStates_ = { LOADING: 0, UNINITIALIZED: 1, LOADED: 2, INTERACTIVE: 3, COMPLETE: 4 }; /** * IE specific ready states. * * @see https://msdn.microsoft.com/en-us/library/ms534359(v=vs.85).aspx * @enum {string} * @private */ goog.ui.media.FlashObject.IeSwfReadyStates_ = { LOADING: 'loading', UNINITIALIZED: 'uninitialized', LOADED: 'loaded', INTERACTIVE: 'interactive', COMPLETE: 'complete' }; /** * The different modes for displaying a SWF. Note that different wmodes * can result in different bugs in different browsers and also that * both OPAQUE and TRANSPARENT will result in a performance hit. * * @enum {string} */ goog.ui.media.FlashObject.Wmodes = { /** * Allows for z-ordering of the SWF. */ OPAQUE: 'opaque', /** * Allows for z-ordering of the SWF and plays the SWF with a transparent BG. */ TRANSPARENT: 'transparent', /** * The default wmode. Does not allow for z-ordering of the SWF. */ WINDOW: 'window' }; /** * The different levels of allowScriptAccess. * * Talked about at: * http://kb2.adobe.com/cps/164/tn_16494.html * * @enum {string} */ goog.ui.media.FlashObject.ScriptAccessLevel = { /* * The flash object can always communicate with its container page. */ ALWAYS: 'always', /* * The flash object can only communicate with its container page if they are * hosted in the same domain. */ SAME_DOMAIN: 'sameDomain', /* * The flash can not communicate with its container page. */ NEVER: 'never' }; /** * The component CSS namespace. * * @type {string} */ goog.ui.media.FlashObject.CSS_CLASS = goog.getCssName('goog-ui-media-flash'); /** * The flash object CSS class. * * @type {string} */ goog.ui.media.FlashObject.FLASH_CSS_CLASS = goog.getCssName('goog-ui-media-flash-object'); /** * A logger used for debugging. * * @type {goog.log.Logger} * @private */ goog.ui.media.FlashObject.prototype.logger_ = goog.log.getLogger('goog.ui.media.FlashObject'); /** * The wmode for the SWF. * * @type {goog.ui.media.FlashObject.Wmodes} * @private */ goog.ui.media.FlashObject.prototype.wmode_ = goog.ui.media.FlashObject.Wmodes.WINDOW; /** * The minimum required flash version. * * @type {?string} * @private */ goog.ui.media.FlashObject.prototype.requiredVersion_; /** * The flash movie width. * * @type {string} * @private */ goog.ui.media.FlashObject.prototype.width_; /** * The flash movie height. * * @type {string} * @private */ goog.ui.media.FlashObject.prototype.height_; /** * The flash movie background color. * * @type {string} * @private */ goog.ui.media.FlashObject.prototype.backgroundColor_ = '#000000'; /** * The flash movie allowScriptAccess setting. * * @type {string} * @private */ goog.ui.media.FlashObject.prototype.allowScriptAccess_ = goog.ui.media.FlashObject.ScriptAccessLevel.SAME_DOMAIN; /** * Sets the flash movie Wmode. * * @param {goog.ui.media.FlashObject.Wmodes} wmode the flash movie Wmode. * @return {!goog.ui.media.FlashObject} The flash object instance for chaining. */ goog.ui.media.FlashObject.prototype.setWmode = function(wmode) { this.wmode_ = wmode; return this; }; /** * @return {string} Returns the flash movie wmode. */ goog.ui.media.FlashObject.prototype.getWmode = function() { return this.wmode_; }; /** * Adds flash variables. * * @param {goog.structs.Map|Object} map A key-value map of variables. * @return {!goog.ui.media.FlashObject} The flash object instance for chaining. */ goog.ui.media.FlashObject.prototype.addFlashVars = function(map) { this.flashVars_.addAll(map); return this; }; /** * Sets a flash variable. * * @param {string} key The name of the flash variable. * @param {string} value The value of the flash variable. * @return {!goog.ui.media.FlashObject} The flash object instance for chaining. */ goog.ui.media.FlashObject.prototype.setFlashVar = function(key, value) { this.flashVars_.set(key, value); return this; }; /** * Sets flash variables. You can either pass a Map of key->value pairs or you * can pass a key, value pair to set a specific variable. * * TODO(user, martino): Get rid of this method. * * @deprecated Use {@link #addFlashVars} or {@link #setFlashVar} instead. * @param {goog.structs.Map|Object|string} flashVar A map of variables (given * as a goog.structs.Map or an Object literal) or a key to the optional * {@code opt_value}. * @param {string=} opt_value The optional value for the flashVar key. * @return {!goog.ui.media.FlashObject} The flash object instance for chaining. */ goog.ui.media.FlashObject.prototype.setFlashVars = function(flashVar, opt_value) { if (flashVar instanceof goog.structs.Map || goog.typeOf(flashVar) == 'object') { this.addFlashVars(/**@type {!goog.structs.Map|!Object}*/(flashVar)); } else { goog.asserts.assert(goog.isString(flashVar) && goog.isDef(opt_value), 'Invalid argument(s)'); this.setFlashVar(/**@type {string}*/(flashVar), /**@type {string}*/(opt_value)); } return this; }; /** * @return {goog.structs.Map} The current flash variables. */ goog.ui.media.FlashObject.prototype.getFlashVars = function() { return this.flashVars_; }; /** * Sets the background color of the movie. * * @param {string} color The new color to be set. * @return {!goog.ui.media.FlashObject} The flash object instance for chaining. */ goog.ui.media.FlashObject.prototype.setBackgroundColor = function(color) { this.backgroundColor_ = color; return this; }; /** * @return {string} The background color of the movie. */ goog.ui.media.FlashObject.prototype.getBackgroundColor = function() { return this.backgroundColor_; }; /** * Sets the allowScriptAccess setting of the movie. * * @param {string} value The new value to be set. * @return {!goog.ui.media.FlashObject} The flash object instance for chaining. */ goog.ui.media.FlashObject.prototype.setAllowScriptAccess = function(value) { this.allowScriptAccess_ = value; return this; }; /** * @return {string} The allowScriptAccess setting color of the movie. */ goog.ui.media.FlashObject.prototype.getAllowScriptAccess = function() { return this.allowScriptAccess_; }; /** * Sets the width and height of the movie. * * @param {number|string} width The width of the movie. * @param {number|string} height The height of the movie. * @return {!goog.ui.media.FlashObject} The flash object instance for chaining. */ goog.ui.media.FlashObject.prototype.setSize = function(width, height) { this.width_ = goog.isString(width) ? width : Math.round(width) + 'px'; this.height_ = goog.isString(height) ? height : Math.round(height) + 'px'; if (this.getElement()) { goog.style.setSize(this.getFlashElement(), this.width_, this.height_); } return this; }; /** * @return {?string} The flash required version. */ goog.ui.media.FlashObject.prototype.getRequiredVersion = function() { return this.requiredVersion_; }; /** * Sets the minimum flash required version. * * @param {?string} version The minimum required version for this movie to work, * or null if you want to unset it. * @return {!goog.ui.media.FlashObject} The flash object instance for chaining. */ goog.ui.media.FlashObject.prototype.setRequiredVersion = function(version) { this.requiredVersion_ = version; return this; }; /** * Returns whether this SWF has a minimum required flash version. * * @return {boolean} Whether a required version was set or not. */ goog.ui.media.FlashObject.prototype.hasRequiredVersion = function() { return this.requiredVersion_ != null; }; /** * Writes the Flash embedding {@code HTMLObjectElement} to this components root * element and adds listeners for all events to handle them consistently. * @override */ goog.ui.media.FlashObject.prototype.enterDocument = function() { goog.ui.media.FlashObject.superClass_.enterDocument.call(this); // The SWF tag must be written after this component's element is appended to // the DOM. Otherwise Flash's ExternalInterface is broken in IE. goog.dom.safe.setInnerHtml( /** @type {!Element} */ (this.getElement()), this.createSwfTag_()); if (this.width_ && this.height_) { this.setSize(this.width_, this.height_); } // Sinks all the events on the bubble phase. // // Flash plugins propagates events from/to the plugin to the browser // inconsistently: // // 1) FF2 + linux: the flash plugin will stop the propagation of all events // from the plugin to the browser. // 2) FF3 + mac: the flash plugin will propagate events on the <embed> object // but that will get propagated to its parents. // 3) Safari 3.1.1 + mac: the flash plugin will propagate the event to the // <object> tag that event will propagate to its parents. // 4) IE7 + windows: the flash plugin will eat all events, not propagating // anything to the javascript. // 5) Chrome + windows: the flash plugin will eat all events, not propagating // anything to the javascript. // // To overcome this inconsistency, all events from/to the plugin are sinked, // since you can't assume that the events will be propagated. // // NOTE(user): we only sink events on the bubbling phase, since there are no // inexpensive/scalable way to stop events on the capturing phase unless we // added an event listener on the document for each flash object. this.eventHandler_.listen( this.getElement(), goog.object.getValues(goog.events.EventType), goog.events.Event.stopPropagation); }; /** * Creates the DOM structure. * * @override */ goog.ui.media.FlashObject.prototype.createDom = function() { if (this.hasRequiredVersion() && !goog.userAgent.flash.isVersion( /** @type {string} */ (this.getRequiredVersion()))) { goog.log.warning(this.logger_, 'Required flash version not found:' + this.getRequiredVersion()); throw Error(goog.ui.Component.Error.NOT_SUPPORTED); } var element = this.getDomHelper().createElement(goog.dom.TagName.DIV); element.className = goog.ui.media.FlashObject.CSS_CLASS; this.setElementInternal(element); }; /** * Creates the HTML to embed the flash object. * * @return {!goog.html.SafeHtml} Browser appropriate HTML to add the SWF to the * DOM. * @private */ goog.ui.media.FlashObject.prototype.createSwfTag_ = function() { var keys = this.flashVars_.getKeys(); var values = this.flashVars_.getValues(); var flashVars = []; for (var i = 0; i < keys.length; i++) { var key = goog.string.urlEncode(keys[i]); var value = goog.string.urlEncode(values[i]); flashVars.push(key + '=' + value); } var flashVarsString = flashVars.join('&'); if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(11)) { return this.createSwfTagOldIe_(flashVarsString); } else { return this.createSwfTagModern_(flashVarsString); } }; /** * Creates the HTML to embed the flash object for IE>=11 and other browsers. * * @param {string} flashVars The value of the FlashVars attribute. * @return {!goog.html.SafeHtml} Browser appropriate HTML to add the SWF to the * DOM. * @private */ goog.ui.media.FlashObject.prototype.createSwfTagModern_ = function(flashVars) { return goog.html.flash.createEmbed( this.flashUrl_, { 'AllowScriptAccess': this.allowScriptAccess_, 'allowFullScreen': 'true', 'allowNetworking': 'all', 'bgcolor': this.backgroundColor_, 'class': goog.ui.media.FlashObject.FLASH_CSS_CLASS, 'FlashVars': flashVars, 'id': this.getId(), 'name': this.getId(), 'quality': 'high', 'SeamlessTabbing': 'false', 'wmode': this.wmode_ }); }; /** * Creates the HTML to embed the flash object for IE<11. * * @param {string} flashVars The value of the FlashVars attribute. * @return {!goog.html.SafeHtml} Browser appropriate HTML to add the SWF to the * DOM. * @private */ goog.ui.media.FlashObject.prototype.createSwfTagOldIe_ = function(flashVars) { return goog.html.flash.createObjectForOldIe( this.flashUrl_, { 'allowFullScreen': 'true', 'AllowScriptAccess': this.allowScriptAccess_, 'allowNetworking': 'all', 'bgcolor': this.backgroundColor_, 'FlashVars': flashVars, 'quality': 'high', 'SeamlessTabbing': 'false', 'wmode': this.wmode_ }, { 'class': goog.ui.media.FlashObject.FLASH_CSS_CLASS, 'id': this.getId(), 'name': this.getId() }); }; /** * @return {HTMLObjectElement} The flash element or null if the element can't * be found. */ goog.ui.media.FlashObject.prototype.getFlashElement = function() { return /** @type {HTMLObjectElement} */(this.getElement() ? this.getElement().firstChild : null); }; /** @override */ goog.ui.media.FlashObject.prototype.disposeInternal = function() { goog.ui.media.FlashObject.superClass_.disposeInternal.call(this); this.flashVars_ = null; this.eventHandler_.dispose(); this.eventHandler_ = null; }; /** * @return {boolean} whether the SWF has finished loading or not. */ goog.ui.media.FlashObject.prototype.isLoaded = function() { if (!this.isInDocument() || !this.getElement()) { return false; } // IE has different readyState values for elements. if (goog.userAgent.EDGE_OR_IE && this.getFlashElement().readyState && this.getFlashElement().readyState == goog.ui.media.FlashObject.IeSwfReadyStates_.COMPLETE) { return true; } if (this.getFlashElement().readyState && this.getFlashElement().readyState == goog.ui.media.FlashObject.SwfReadyStates_.COMPLETE) { return true; } // Use "in" operator to check for PercentLoaded because IE8 throws when // accessing directly. See: // https://github.com/google/closure-library/pull/373. if ('PercentLoaded' in this.getFlashElement() && this.getFlashElement().PercentLoaded() == 100) { return true; } return false; };
{ "pile_set_name": "Github" }
/* * Copyright 2013 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: Alex Deucher */ #include <drm/drmP.h> #include "radeon.h" #include "radeon_asic.h" #include "r600d.h" u32 r600_gpu_check_soft_reset(struct radeon_device *rdev); /* * DMA * Starting with R600, the GPU has an asynchronous * DMA engine. The programming model is very similar * to the 3D engine (ring buffer, IBs, etc.), but the * DMA controller has it's own packet format that is * different form the PM4 format used by the 3D engine. * It supports copying data, writing embedded data, * solid fills, and a number of other things. It also * has support for tiling/detiling of buffers. */ /** * r600_dma_get_rptr - get the current read pointer * * @rdev: radeon_device pointer * @ring: radeon ring pointer * * Get the current rptr from the hardware (r6xx+). */ uint32_t r600_dma_get_rptr(struct radeon_device *rdev, struct radeon_ring *ring) { u32 rptr; if (rdev->wb.enabled) rptr = rdev->wb.wb[ring->rptr_offs/4]; else rptr = RREG32(DMA_RB_RPTR); return (rptr & 0x3fffc) >> 2; } /** * r600_dma_get_wptr - get the current write pointer * * @rdev: radeon_device pointer * @ring: radeon ring pointer * * Get the current wptr from the hardware (r6xx+). */ uint32_t r600_dma_get_wptr(struct radeon_device *rdev, struct radeon_ring *ring) { return (RREG32(DMA_RB_WPTR) & 0x3fffc) >> 2; } /** * r600_dma_set_wptr - commit the write pointer * * @rdev: radeon_device pointer * @ring: radeon ring pointer * * Write the wptr back to the hardware (r6xx+). */ void r600_dma_set_wptr(struct radeon_device *rdev, struct radeon_ring *ring) { WREG32(DMA_RB_WPTR, (ring->wptr << 2) & 0x3fffc); } /** * r600_dma_stop - stop the async dma engine * * @rdev: radeon_device pointer * * Stop the async dma engine (r6xx-evergreen). */ void r600_dma_stop(struct radeon_device *rdev) { u32 rb_cntl = RREG32(DMA_RB_CNTL); if (rdev->asic->copy.copy_ring_index == R600_RING_TYPE_DMA_INDEX) radeon_ttm_set_active_vram_size(rdev, rdev->mc.visible_vram_size); rb_cntl &= ~DMA_RB_ENABLE; WREG32(DMA_RB_CNTL, rb_cntl); rdev->ring[R600_RING_TYPE_DMA_INDEX].ready = false; } /** * r600_dma_resume - setup and start the async dma engine * * @rdev: radeon_device pointer * * Set up the DMA ring buffer and enable it. (r6xx-evergreen). * Returns 0 for success, error for failure. */ int r600_dma_resume(struct radeon_device *rdev) { struct radeon_ring *ring = &rdev->ring[R600_RING_TYPE_DMA_INDEX]; u32 rb_cntl, dma_cntl, ib_cntl; u32 rb_bufsz; int r; WREG32(DMA_SEM_INCOMPLETE_TIMER_CNTL, 0); WREG32(DMA_SEM_WAIT_FAIL_TIMER_CNTL, 0); /* Set ring buffer size in dwords */ rb_bufsz = order_base_2(ring->ring_size / 4); rb_cntl = rb_bufsz << 1; #ifdef __BIG_ENDIAN rb_cntl |= DMA_RB_SWAP_ENABLE | DMA_RPTR_WRITEBACK_SWAP_ENABLE; #endif WREG32(DMA_RB_CNTL, rb_cntl); /* Initialize the ring buffer's read and write pointers */ WREG32(DMA_RB_RPTR, 0); WREG32(DMA_RB_WPTR, 0); /* set the wb address whether it's enabled or not */ WREG32(DMA_RB_RPTR_ADDR_HI, upper_32_bits(rdev->wb.gpu_addr + R600_WB_DMA_RPTR_OFFSET) & 0xFF); WREG32(DMA_RB_RPTR_ADDR_LO, ((rdev->wb.gpu_addr + R600_WB_DMA_RPTR_OFFSET) & 0xFFFFFFFC)); if (rdev->wb.enabled) rb_cntl |= DMA_RPTR_WRITEBACK_ENABLE; WREG32(DMA_RB_BASE, ring->gpu_addr >> 8); /* enable DMA IBs */ ib_cntl = DMA_IB_ENABLE; #ifdef __BIG_ENDIAN ib_cntl |= DMA_IB_SWAP_ENABLE; #endif WREG32(DMA_IB_CNTL, ib_cntl); dma_cntl = RREG32(DMA_CNTL); dma_cntl &= ~CTXEMPTY_INT_ENABLE; WREG32(DMA_CNTL, dma_cntl); if (rdev->family >= CHIP_RV770) WREG32(DMA_MODE, 1); ring->wptr = 0; WREG32(DMA_RB_WPTR, ring->wptr << 2); WREG32(DMA_RB_CNTL, rb_cntl | DMA_RB_ENABLE); ring->ready = true; r = radeon_ring_test(rdev, R600_RING_TYPE_DMA_INDEX, ring); if (r) { ring->ready = false; return r; } if (rdev->asic->copy.copy_ring_index == R600_RING_TYPE_DMA_INDEX) radeon_ttm_set_active_vram_size(rdev, rdev->mc.real_vram_size); return 0; } /** * r600_dma_fini - tear down the async dma engine * * @rdev: radeon_device pointer * * Stop the async dma engine and free the ring (r6xx-evergreen). */ void r600_dma_fini(struct radeon_device *rdev) { r600_dma_stop(rdev); radeon_ring_fini(rdev, &rdev->ring[R600_RING_TYPE_DMA_INDEX]); } /** * r600_dma_is_lockup - Check if the DMA engine is locked up * * @rdev: radeon_device pointer * @ring: radeon_ring structure holding ring information * * Check if the async DMA engine is locked up. * Returns true if the engine appears to be locked up, false if not. */ bool r600_dma_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring) { u32 reset_mask = r600_gpu_check_soft_reset(rdev); if (!(reset_mask & RADEON_RESET_DMA)) { radeon_ring_lockup_update(rdev, ring); return false; } return radeon_ring_test_lockup(rdev, ring); } /** * r600_dma_ring_test - simple async dma engine test * * @rdev: radeon_device pointer * @ring: radeon_ring structure holding ring information * * Test the DMA engine by writing using it to write an * value to memory. (r6xx-SI). * Returns 0 for success, error for failure. */ int r600_dma_ring_test(struct radeon_device *rdev, struct radeon_ring *ring) { unsigned i; int r; unsigned index; u32 tmp; u64 gpu_addr; if (ring->idx == R600_RING_TYPE_DMA_INDEX) index = R600_WB_DMA_RING_TEST_OFFSET; else index = CAYMAN_WB_DMA1_RING_TEST_OFFSET; gpu_addr = rdev->wb.gpu_addr + index; tmp = 0xCAFEDEAD; rdev->wb.wb[index/4] = cpu_to_le32(tmp); r = radeon_ring_lock(rdev, ring, 4); if (r) { DRM_ERROR("radeon: dma failed to lock ring %d (%d).\n", ring->idx, r); return r; } radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_WRITE, 0, 0, 1)); radeon_ring_write(ring, lower_32_bits(gpu_addr)); radeon_ring_write(ring, upper_32_bits(gpu_addr) & 0xff); radeon_ring_write(ring, 0xDEADBEEF); radeon_ring_unlock_commit(rdev, ring, false); for (i = 0; i < rdev->usec_timeout; i++) { tmp = le32_to_cpu(rdev->wb.wb[index/4]); if (tmp == 0xDEADBEEF) break; DRM_UDELAY(1); } if (i < rdev->usec_timeout) { DRM_INFO("ring test on %d succeeded in %d usecs\n", ring->idx, i); } else { DRM_ERROR("radeon: ring %d test failed (0x%08X)\n", ring->idx, tmp); r = -EINVAL; } return r; } /** * r600_dma_fence_ring_emit - emit a fence on the DMA ring * * @rdev: radeon_device pointer * @fence: radeon fence object * * Add a DMA fence packet to the ring to write * the fence seq number and DMA trap packet to generate * an interrupt if needed (r6xx-r7xx). */ void r600_dma_fence_ring_emit(struct radeon_device *rdev, struct radeon_fence *fence) { struct radeon_ring *ring = &rdev->ring[fence->ring]; u64 addr = rdev->fence_drv[fence->ring].gpu_addr; /* write the fence */ radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_FENCE, 0, 0, 0)); radeon_ring_write(ring, addr & 0xfffffffc); radeon_ring_write(ring, (upper_32_bits(addr) & 0xff)); radeon_ring_write(ring, lower_32_bits(fence->seq)); /* generate an interrupt */ radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_TRAP, 0, 0, 0)); } /** * r600_dma_semaphore_ring_emit - emit a semaphore on the dma ring * * @rdev: radeon_device pointer * @ring: radeon_ring structure holding ring information * @semaphore: radeon semaphore object * @emit_wait: wait or signal semaphore * * Add a DMA semaphore packet to the ring wait on or signal * other rings (r6xx-SI). */ bool r600_dma_semaphore_ring_emit(struct radeon_device *rdev, struct radeon_ring *ring, struct radeon_semaphore *semaphore, bool emit_wait) { u64 addr = semaphore->gpu_addr; u32 s = emit_wait ? 0 : 1; radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_SEMAPHORE, 0, s, 0)); radeon_ring_write(ring, addr & 0xfffffffc); radeon_ring_write(ring, upper_32_bits(addr) & 0xff); return true; } /** * r600_dma_ib_test - test an IB on the DMA engine * * @rdev: radeon_device pointer * @ring: radeon_ring structure holding ring information * * Test a simple IB in the DMA ring (r6xx-SI). * Returns 0 on success, error on failure. */ int r600_dma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) { struct radeon_ib ib; unsigned i; unsigned index; int r; u32 tmp = 0; u64 gpu_addr; if (ring->idx == R600_RING_TYPE_DMA_INDEX) index = R600_WB_DMA_RING_TEST_OFFSET; else index = CAYMAN_WB_DMA1_RING_TEST_OFFSET; gpu_addr = rdev->wb.gpu_addr + index; r = radeon_ib_get(rdev, ring->idx, &ib, NULL, 256); if (r) { DRM_ERROR("radeon: failed to get ib (%d).\n", r); return r; } ib.ptr[0] = DMA_PACKET(DMA_PACKET_WRITE, 0, 0, 1); ib.ptr[1] = lower_32_bits(gpu_addr); ib.ptr[2] = upper_32_bits(gpu_addr) & 0xff; ib.ptr[3] = 0xDEADBEEF; ib.length_dw = 4; r = radeon_ib_schedule(rdev, &ib, NULL, false); if (r) { radeon_ib_free(rdev, &ib); DRM_ERROR("radeon: failed to schedule ib (%d).\n", r); return r; } r = radeon_fence_wait_timeout(ib.fence, false, usecs_to_jiffies( RADEON_USEC_IB_TEST_TIMEOUT)); if (r < 0) { DRM_ERROR("radeon: fence wait failed (%d).\n", r); return r; } else if (r == 0) { DRM_ERROR("radeon: fence wait timed out.\n"); return -ETIMEDOUT; } r = 0; for (i = 0; i < rdev->usec_timeout; i++) { tmp = le32_to_cpu(rdev->wb.wb[index/4]); if (tmp == 0xDEADBEEF) break; DRM_UDELAY(1); } if (i < rdev->usec_timeout) { DRM_INFO("ib test on ring %d succeeded in %u usecs\n", ib.fence->ring, i); } else { DRM_ERROR("radeon: ib test failed (0x%08X)\n", tmp); r = -EINVAL; } radeon_ib_free(rdev, &ib); return r; } /** * r600_dma_ring_ib_execute - Schedule an IB on the DMA engine * * @rdev: radeon_device pointer * @ib: IB object to schedule * * Schedule an IB in the DMA ring (r6xx-r7xx). */ void r600_dma_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib) { struct radeon_ring *ring = &rdev->ring[ib->ring]; if (rdev->wb.enabled) { u32 next_rptr = ring->wptr + 4; while ((next_rptr & 7) != 5) next_rptr++; next_rptr += 3; radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_WRITE, 0, 0, 1)); radeon_ring_write(ring, ring->next_rptr_gpu_addr & 0xfffffffc); radeon_ring_write(ring, upper_32_bits(ring->next_rptr_gpu_addr) & 0xff); radeon_ring_write(ring, next_rptr); } /* The indirect buffer packet must end on an 8 DW boundary in the DMA ring. * Pad as necessary with NOPs. */ while ((ring->wptr & 7) != 5) radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_NOP, 0, 0, 0)); radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_INDIRECT_BUFFER, 0, 0, 0)); radeon_ring_write(ring, (ib->gpu_addr & 0xFFFFFFE0)); radeon_ring_write(ring, (ib->length_dw << 16) | (upper_32_bits(ib->gpu_addr) & 0xFF)); } /** * r600_copy_dma - copy pages using the DMA engine * * @rdev: radeon_device pointer * @src_offset: src GPU address * @dst_offset: dst GPU address * @num_gpu_pages: number of GPU pages to xfer * @resv: reservation object to sync to * * Copy GPU paging using the DMA engine (r6xx). * Used by the radeon ttm implementation to move pages if * registered as the asic copy callback. */ struct radeon_fence *r600_copy_dma(struct radeon_device *rdev, uint64_t src_offset, uint64_t dst_offset, unsigned num_gpu_pages, struct reservation_object *resv) { struct radeon_fence *fence; struct radeon_sync sync; int ring_index = rdev->asic->copy.dma_ring_index; struct radeon_ring *ring = &rdev->ring[ring_index]; u32 size_in_dw, cur_size_in_dw; int i, num_loops; int r = 0; radeon_sync_create(&sync); size_in_dw = (num_gpu_pages << RADEON_GPU_PAGE_SHIFT) / 4; num_loops = DIV_ROUND_UP(size_in_dw, 0xFFFE); r = radeon_ring_lock(rdev, ring, num_loops * 4 + 8); if (r) { DRM_ERROR("radeon: moving bo (%d).\n", r); radeon_sync_free(rdev, &sync, NULL); return ERR_PTR(r); } radeon_sync_resv(rdev, &sync, resv, false); radeon_sync_rings(rdev, &sync, ring->idx); for (i = 0; i < num_loops; i++) { cur_size_in_dw = size_in_dw; if (cur_size_in_dw > 0xFFFE) cur_size_in_dw = 0xFFFE; size_in_dw -= cur_size_in_dw; radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_COPY, 0, 0, cur_size_in_dw)); radeon_ring_write(ring, dst_offset & 0xfffffffc); radeon_ring_write(ring, src_offset & 0xfffffffc); radeon_ring_write(ring, (((upper_32_bits(dst_offset) & 0xff) << 16) | (upper_32_bits(src_offset) & 0xff))); src_offset += cur_size_in_dw * 4; dst_offset += cur_size_in_dw * 4; } r = radeon_fence_emit(rdev, &fence, ring->idx); if (r) { radeon_ring_unlock_undo(rdev, ring); radeon_sync_free(rdev, &sync, NULL); return ERR_PTR(r); } radeon_ring_unlock_commit(rdev, ring, false); radeon_sync_free(rdev, &sync, fence); return fence; }
{ "pile_set_name": "Github" }
--- layout: page title: Fakes - Sinon.JS breadcrumb: fakes --- ### Introduction `fake` was introduced with Sinon with v5. It simplifies and merges concepts from [`spies`][spies] and [`stubs`][stubs]. In Sinon, a `fake` is a `Function` that records arguments, return value, the value of `this` and exception thrown (if any) for all of its calls. It can be created with or without behavior; it can wrap an existing function. A fake is immutable: once created, the behavior will not change. Unlike [`sinon.spy`][spies] and [`sinon.stub`][stubs] methods, the `sinon.fake` API knows only how to create fakes, and doesn't concern itself with plugging them into the system under test. To plug the fakes into the system under test, you can use the [`sinon.replace*`](../sandbox#sandboxreplaceobject-property-replacement) methods. ### Creating a fake ```js // create a basic fake, with no behavior var fake = sinon.fake(); fake(); console.log(fake.callCount); // 1 ``` ### Fakes with behavior Fakes can be created with behavior, which cannot be changed once the fake has been created. #### `sinon.fake.returns(value);` Creates a fake that returns the `value` argument ```js var fake = sinon.fake.returns('apple pie'); fake(); // apple pie ``` #### `sinon.fake.throws(value);` Creates a fake that throws an `Error` with the provided value as the `message` property. If an `Error` is passed as the `value` argument, then that will be the thrown value. If any other value is passed, then that will be used for the `message` property of the thrown `Error`. ```js var fake = sinon.fake.throws(new Error('not apple pie')); fake(); // Error: not apple pie ``` #### `sinon.fake.resolves(value);` Creates a fake that returns a resolved `Promise` for the passed value. #### `sinon.fake.rejects(value);` Creates a fake that returns a rejected `Promise` for the passed value. If an `Error` is passed as the `value` argument, then that will be the value of the promise. If any other value is passed, then that will be used for the `message` property of the `Error` returned by the promise. #### `sinon.fake.yields(callback[, value1, ..., valueN]);` `fake` expects the last argument to be a callback and will invoke it with the given arguments. ```js var fake = sinon.fake.yields('hello world'); fake(console.log); // hello world ``` #### `sinon.fake.yieldsAsync(callback[, value1, ..., valueN]);` `fake` expects the last argument to be a callback and will invoke it asynchronously with the given arguments. ```js var fake = sinon.fake.yieldsAsync('hello world'); fake(console.log); // hello world ``` #### `sinon.fake(func);` Wraps an existing `Function` to record all interactions, while leaving it up to the `func` to provide the behavior. This is useful when complex behavior not covered by the `sinon.fake.*` methods is required or when wrapping an existing function or method. ### Instance properties #### `f.callback` This property is a convenience to easily get a reference to the last callback passed in the last to the fake. ```js var f = sinon.fake(); var cb1 = function () {}; var cb2 = function () {}; f(1, 2, 3, cb1); f(1, 2, 3, cb2); f.callback === cb2; // true ``` The same convenience has been added to [spy calls](../spy-call): ```js f.getCall(1).callback === cb2; // true // f.lastCall.callback === cb2; // true ``` #### `f.lastArg` This property is a convenient way to get a reference to the last argument passed in the last call to the fake. ```js var f = sinon.fake(); var date1 = new Date(); var date2 = new Date(); f(1, 2, date1); f(1, 2, date2); f.lastArg === date2; // true ``` The same convenience has been added to [spy calls](../spy-call): ```js f.getCall(0).lastArg === date1; // true f.getCall(1).lastArg === date2; // true f.lastCall.lastArg === date2; // true ``` ### Adding the fake to the system under test Unlike `sinon.spy` and `sinon.stub`, `sinon.fake` only knows about creating fakes, not about replacing properties in the system under test. To replace a property, you can use the [`sinon.replace`](../sandbox/#sandboxreplaceobject-property-replacement) method. ```js var fake = sinon.fake.returns('42'); sinon.replace(console, 'log', fake); console.log('apple pie'); // 42 ``` When you want to restore the replaced properties, simply call the `sinon.restore` method. ```js // restores all replaced properties set by sinon methods (replace, spy, stub) sinon.restore(); ``` [spies]: ../spies [stubs]: ../stubs
{ "pile_set_name": "Github" }
/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2008 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * params.c: Parameter Status handling routines * */ #include "config.h" #include <stdlib.h> #include <string.h> #include "utils/elog.h" #include "pool.h" #include "parser/parser.h" #include "utils/palloc.h" #include "utils/memutils.h" #define MAX_PARAM_ITEMS 128 /* * initialize parameter structure */ int pool_init_params(ParamStatus *params) { MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); params->num = 0; params->names = palloc(MAX_PARAM_ITEMS*sizeof(char *)); params->values = palloc(MAX_PARAM_ITEMS*sizeof(char *)); MemoryContextSwitchTo(oldContext); return 0; } /* * discard parameter structure */ void pool_discard_params(ParamStatus *params) { int i; for (i=0;i<params->num;i++) { pfree(params->names[i]); pfree(params->values[i]); } if(params->names) pfree(params->names); if(params->values) pfree(params->values); params->num = 0; params->names = NULL; params->values = NULL; } /* * find param value by name. if found, its value is returned * also, pos is set * if not found, NULL is returned */ char *pool_find_name(ParamStatus *params, char *name, int *pos) { int i; for (i=0;i<params->num;i++) { if (!strcmp(name, params->names[i])) { *pos = i; return params->values[i]; } } return NULL; } /* * return name and value by index. */ int pool_get_param(ParamStatus *params, int index, char **name, char **value) { if (index < 0 || index >= params->num) return -1; *name = params->names[index]; *value = params->values[index]; return 0; } /* * add or replace name/value pair */ int pool_add_param(ParamStatus *params, char *name, char *value) { int pos; MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); if (pool_find_name(params, name, &pos)) { /* name already exists */ if (strlen(params->values[pos]) < strlen(value)) { params->values[pos] = repalloc(params->values[pos], strlen(value) + 1); } strcpy(params->values[pos], value); } else { int num; /* add name/value pair */ if (params->num >= MAX_PARAM_ITEMS) { ereport(ERROR, (errmsg("add parameter failed"), errdetail("no more room for num"))); } num = params->num; params->names[num] = pstrdup(name); params->values[num] = pstrdup(value); params->num++; } parser_set_param(name, value); MemoryContextSwitchTo(oldContext); return 0; } void pool_param_debug_print(ParamStatus *params) { int i; for (i=0;i<params->num;i++) { ereport(DEBUG2, (errmsg("No.%d: name: %s value: %s", i, params->names[i], params->values[i]))); } }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>React Observable Hooks</title> </head> <body> <div id="app"></div> </body> </html>
{ "pile_set_name": "Github" }
(* Result: OK $Log: constant_fold.sml,v $ Revision 1.3 1997/05/28 11:53:33 jont [Bug #30090] Remove uses of MLWorks.IO * Revision 1.2 1996/05/01 17:10:49 jont * Fixing up after changes to toplevel visible string and io stuff * * Revision 1.1 1993/11/25 13:41:32 matthew * Initial revision * Copyright 2013 Ravenbrook Limited <http://www.ravenbrook.com/>. All rights reserved. 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. 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. *) (* Test that side-effecting expressions aren't removed by the optimizer in this context *) exception Test; val result = (((raise Test) - (raise Test)) handle Test => 10) = 10 andalso (((raise Test) * 0) handle Test => 10) = 10 andalso ((0 * (raise Test)) handle Test => 10) = 10 andalso (((raise Test) div (raise Test)) handle Test => 10) = 10 andalso (((raise Test) mod 1) handle Test => 10) = 10 andalso ((0 mod (raise Test)) handle Test => 10) = 10 andalso (((raise Test) mod 0) handle Test => 10 | Mod => 0) = 10 andalso not (((raise Test) = (raise Test)) handle Test => false) andalso (((raise Test) <> (raise Test)) handle Test => true) val _ = if result then print"Pass\n" else print"Fail\n"
{ "pile_set_name": "Github" }
Release process =============== Note: this is intended for core committers. * Update CHANGES.md with everything interesting since the last update. * Update version numbers using the three-part x.y.z notation everywhere: * The header in CHANGES.md (this is where the site looks for the latest version number) * ``"version"`` attribute in package.json * Two places in docs/conf.py (``version`` and ``release``) * Commit the version changes and tag the commit with the plain version number (no "v." or anything like that) * Push the commit and the tags to master (``git push && git push --tags``) Pushing the tag triggers the update process which can be monitored at http://highlightjs.org/api/release/ When something didn't work *and* it's fixable in code (version numbers mismatch, last minute patches, etc), simply make another release incrementing the third (revision) part of the version number.
{ "pile_set_name": "Github" }
02/11/06 -------- First stab at Views integration with VotingAPI. Configuring it is a little ugly -- mainly useful for custom modules that want to expose a vote-based default_view without coding all the table/field/filter stuff for Views. 04/21/06 -------- Expose public votingapi_add_vote and votingapi_delete_vote functions to allow modules to override normal behavior. This makes it possible to implement anonymous voting, though future explicit support is coming. 04/22/06 -------- There is now a working infrastructure for modules to expose their own 'voting actions' without requiring user customization. 04/23/06 -------- Major enhancements to the actions subsystem, the addition of an experimental widgets library, and the (beginnings) of major enhancements to views integration. Using the latest CVS version of Views.module, it's now possible to display a particular vote result (say, the number of people who've voted) without using esoteric combinations of filters. 04/29/06 -------- A new setting has been introduced -- vote result calculation can be deferred until cron-time. This can be useful on heavy-load sites where MANY votes are being cast and complex, db-intensive calculations are used to weight the results. 05/01/06 -------- The action loading and caching infrastructure has been made much more robust, and CRUD functions are in place for reading and writing actions. voting_actions.module has now been added to facilitate direct user manipulation of action criteria, etc. It's the part that's still heavily under development. In many installations, it'll be unecessary. The votingapi_delete_vote() function no longer automatically recalculates. Modules using it should call recalculate manually after explicitly removing a vote. Those needing a consistent, stable VotingAPI should probably still stick with the 4.7 branch. This version will be branched as soon as the issues are ironed out. 06/07/06 -------- Foundation laid for a move to discrete hooks rather than a single _votingapi function. Because each of the $ops for the function needed a wildly different set of parameters, implementing a single function was an exercise in frustration for module developers. Right now, each location that called *_votingapi() ALSO calls hook_votingapi_*(). the raw *_votingapi() function will be depricated, and likely removed from a future version. 07/05/07 -------- First run at a Drupal 6 compatible version (after an ill-fated accidental checkin on the D5 branch). Once this works, work will start on v2.0. The plan is to add anonymous voting support and cleaner function signatures by passing in full vote objects rather than long param lists. It's uncertain whether 1.x will be released for Drupal 6 directly, or whether I'll just get the 2.0 version out for it, since modules will already need to be updated. 04/09/08 -------- Several important bug fixes for the D6 version of VotingAPI. #223517, #232233, #232236, and #235174 fixed thanks to patches posted by quicksketch and sammys. Also checked in an initial stub file for views2 integration, removing the old hook_init() code since Views2 handles pulling the .inc files in itself. 06/05/08 -------- Views integration rewritten from scratch - many old limitations and snafus are now gone, thankfully. Several default views will be included in the final release. Calculation of vote results no longer loads all votes into memory: modules that implement custom result algorithms must do their own SQL. This saves tremendous amounts of RAM on sites with large numbers of votes on a single content object. 06/24/08 -------- Views integration code seriously reworked (again) to use Views 2 'relationships' rather than custom field handlers. Downside: for the VotingAPI fields, sorts, and filters to appear, a relationship must first be added to it. Upside: using hook_votingapi_views_content_types(), modules that cast votes on non-node content can tell VotingAPI to add its relationship to other tables too (like users, comments, etc). This should make it much, much easier to build displays of vote-aware content that lives in non-node base tables. 09/19/08 -------- Updated for compatibility with Views RC2, added the ability to filter Views relationships to votes cast by the current user, and added three default views to demonstrate the Views integration. Also added basic Simpletests, fixed a bug that manifested when modules cast votes with minimal information (nothing but a content id and a value, for example). Finally, added the ability to auto-generate dummy votes for testing purposes. This feature is only visible if Devel Generate module is installed and activated. 06/20/09 -------- Changed hook_votingapi_content_types() to hook_votingapi_relationships(), since it only deals with Views relationships. Added extra documentation to API.txt and fixed assorted ugly bugs. Moved a bunch of API docs to votingapi.api.php so API.module can generate pretty docs for the hooks. Nodes and comments now have pre-configured relationships available, any other entity types need a hook_votingapi_relationships() implementation. Added votingapi_metadata() to gather metadata about defined value_types, tags, and aggregate functions. Modified the views relationship handler to use that function rather than querying the tables directly. 01/26/10 -------- Drupal 7 port approaches completion. Changed the content_type and content_id indicators to entity_type and entity_id, to avoid confusion between VotingAPI 'content types' and Drupal 'node types'. Added Drush support for generating, flushing, and recalculating voting data.
{ "pile_set_name": "Github" }
package migrations import ( "database/sql" "encoding/json" "io/ioutil" "os" "path" "github.com/OpenBazaar/jsonpb" "github.com/OpenBazaar/openbazaar-go/pb" _ "github.com/mutecomm/go-sqlcipher" ) type Migration009 struct{} type Migration009_price struct { CurrencyCode string `json:"currencyCode"` Amount uint64 `json:"amount"` } type Migration009_thumbnail struct { Tiny string `json:"tiny"` Small string `json:"small"` Medium string `json:"medium"` } type Migration009_listingDataBeforeMigration struct { Hash string `json:"hash"` Slug string `json:"slug"` Title string `json:"title"` Categories []string `json:"categories"` NSFW bool `json:"nsfw"` CoinType string `json:"coinType"` ContractType string `json:"contractType"` Description string `json:"description"` Thumbnail Migration009_thumbnail `json:"thumbnail"` Price Migration009_price `json:"price"` ShipsTo []string `json:"shipsTo"` FreeShipping []string `json:"freeShipping"` Language string `json:"language"` AverageRating float32 `json:"averageRating"` RatingCount uint32 `json:"ratingCount"` ModeratorIDs []string `json:"moderators"` } type Migration009_listingDataAfterMigration struct { Hash string `json:"hash"` Slug string `json:"slug"` Title string `json:"title"` Categories []string `json:"categories"` NSFW bool `json:"nsfw"` CoinType string `json:"coinType"` ContractType string `json:"contractType"` Description string `json:"description"` Thumbnail Migration009_thumbnail `json:"thumbnail"` Price Migration009_price `json:"price"` ShipsTo []string `json:"shipsTo"` FreeShipping []string `json:"freeShipping"` Language string `json:"language"` AverageRating float32 `json:"averageRating"` RatingCount uint32 `json:"ratingCount"` ModeratorIDs []string `json:"moderators"` // Adding AcceptedCurrencies AcceptedCurrencies []string `json:"acceptedCurrencies"` } type Migration009_listing struct { Listing Migration009_listing_listing `json:"listing"` } type Migration009_listing_listing struct { Metadata Migration009_listing_listing_metadata `json:"metadata"` } type Migration009_listing_listing_metadata struct { AcceptedCurrencies []string `json:"acceptedCurrencies"` } const ( Migration009CreatePreviousCasesTable = "create table cases (caseID text primary key not null, buyerContract blob, vendorContract blob, buyerValidationErrors blob, vendorValidationErrors blob, buyerPayoutAddress text, vendorPayoutAddress text, buyerOutpoints blob, vendorOutpoints blob, state integer, read integer, timestamp integer, buyerOpened integer, claim text, disputeResolution blob, lastDisputeExpiryNotifiedAt integer not null default 0);" Migration009CreatePreviousSalesTable = "create table sales (orderID text primary key not null, contract blob, state integer, read integer, timestamp integer, total integer, thumbnail text, buyerID text, buyerHandle text, title text, shippingName text, shippingAddress text, paymentAddr text, funded integer, transactions blob, needsSync integer, lastDisputeTimeoutNotifiedAt integer not null default 0);" Migration009CreatePreviousSalesIndex = "create index index_sales on sales (paymentAddr, timestamp);" Migration009CreatePreviousPurchasesTable = "create table purchases (orderID text primary key not null, contract blob, state integer, read integer, timestamp integer, total integer, thumbnail text, vendorID text, vendorHandle text, title text, shippingName text, shippingAddress text, paymentAddr text, funded integer, transactions blob, lastDisputeTimeoutNotifiedAt integer not null default 0, lastDisputeExpiryNotifiedAt integer not null default 0, disputedAt integer not null default 0);" ) func (Migration009) Up(repoPath string, dbPassword string, testnet bool) (err error) { db, err := OpenDB(repoPath, dbPassword, testnet) if err != nil { return err } // Update DB schema err = withTransaction(db, func(tx *sql.Tx) error { for _, stmt := range []string{ "ALTER TABLE cases ADD COLUMN coinType text NOT NULL DEFAULT '';", "ALTER TABLE sales ADD COLUMN coinType text NOT NULL DEFAULT '';", "ALTER TABLE purchases ADD COLUMN coinType text NOT NULL DEFAULT '';", "ALTER TABLE cases ADD COLUMN paymentCoin text NOT NULL DEFAULT '';", "ALTER TABLE sales ADD COLUMN paymentCoin text NOT NULL DEFAULT '';", "ALTER TABLE purchases ADD COLUMN paymentCoin text NOT NULL DEFAULT '';", } { _, err := tx.Exec(stmt) if err != nil { return err } } return nil }) if err != nil { return err } // Update repover now that the schema is changed err = writeRepoVer(repoPath, 10) if err != nil { return err } // Update DB data on a best effort basis err = migration009UpdateTablesCoins(db, "cases", "caseID", "COALESCE(buyerContract, vendorContract) AS contract") if err != nil { return err } err = migration009UpdateTablesCoins(db, "sales", "orderID", "contract") if err != nil { return err } err = migration009UpdateTablesCoins(db, "purchases", "orderID", "contract") if err != nil { return err } err = migration009MigrateListingsIndexUp(repoPath) if err != nil { return err } return nil } func (Migration009) Down(repoPath string, dbPassword string, testnet bool) error { db, err := OpenDB(repoPath, dbPassword, testnet) if err != nil { return err } err = withTransaction(db, func(tx *sql.Tx) error { for _, stmt := range []string{ "ALTER TABLE cases RENAME TO temp_cases;", Migration009CreatePreviousCasesTable, "INSERT INTO cases SELECT caseID, buyerContract, vendorContract, buyerValidationErrors, vendorValidationErrors, buyerPayoutAddress, vendorPayoutAddress, buyerOutpoints, vendorOutpoints, state, read, timestamp, buyerOpened, claim, disputeResolution, lastDisputeExpiryNotifiedAt FROM temp_cases;", "DROP TABLE temp_cases;", "ALTER TABLE sales RENAME TO temp_sales;", Migration009CreatePreviousSalesTable, Migration009CreatePreviousSalesIndex, "INSERT INTO sales SELECT orderID, contract, state, read, timestamp, total, thumbnail, buyerID, buyerHandle, title, shippingName, shippingAddress, paymentAddr, funded, transactions, needsSync, lastDisputeTimeoutNotifiedAt FROM temp_sales;", "DROP TABLE temp_sales;", "ALTER TABLE purchases RENAME TO temp_purchases;", Migration009CreatePreviousPurchasesTable, "INSERT INTO purchases SELECT orderID, contract, state, read, timestamp, total, thumbnail, vendorID, vendorHandle, title, shippingName, shippingAddress, paymentAddr, funded, transactions, lastDisputeTimeoutNotifiedAt, lastDisputeExpiryNotifiedAt, disputedAt FROM temp_purchases;", "DROP TABLE temp_purchases;", } { _, err := tx.Exec(stmt) if err != nil { return err } } return nil }) if err != nil { return err } err = writeRepoVer(repoPath, 9) if err != nil { return err } err = migration009MigrateListingsIndexDown(repoPath) if err != nil { return err } return nil } func migration009UpdateTablesCoins(db *sql.DB, table string, idColumn string, contractColumn string) error { type coinset struct { paymentCoin string coinType string } // Get all records for table and store the coinset for each entry rows, err := db.Query("SELECT " + idColumn + ", " + contractColumn + " FROM " + table + ";") if err != nil { return err } defer rows.Close() coinsToSet := map[string]coinset{} for rows.Next() { var orderID, marshaledContract string err = rows.Scan(&orderID, &marshaledContract) if err != nil { return err } if marshaledContract == "" { continue } contract := &pb.RicardianContract{} if err := jsonpb.UnmarshalString(marshaledContract, contract); err != nil { return err } coinsToSet[orderID] = coinset{ coinType: coinTypeForContract(contract), paymentCoin: paymentCoinForContract(contract), } } // Update each row with the coins err = withTransaction(db, func(tx *sql.Tx) error { for id, coins := range coinsToSet { _, err := tx.Exec( "UPDATE "+table+" SET coinType = ?, paymentCoin = ? WHERE "+idColumn+" = ?", coins.coinType, coins.paymentCoin, id) if err != nil { return err } } return nil }) return err } func paymentCoinForContract(contract *pb.RicardianContract) string { paymentCoin := contract.BuyerOrder.Payment.Coin if paymentCoin != "" { return paymentCoin } if len(contract.VendorListings[0].Metadata.AcceptedCurrencies) > 0 { paymentCoin = contract.VendorListings[0].Metadata.AcceptedCurrencies[0] } return paymentCoin } func coinTypeForContract(contract *pb.RicardianContract) string { coinType := "" if len(contract.VendorListings) > 0 { coinType = contract.VendorListings[0].Metadata.CryptoCurrencyCode } return coinType } func migration009MigrateListingsIndexUp(repoPath string) error { listingsFilePath := path.Join(repoPath, "root", "listings.json") if _, err := os.Stat(listingsFilePath); os.IsNotExist(err) { return nil } var ( err error paymentCoin string listingJSON []byte listingsJSON []byte listingRecord Migration009_listing listingRecords []Migration009_listingDataBeforeMigration migratedRecords []Migration009_listingDataAfterMigration ) listingsJSON, err = ioutil.ReadFile(listingsFilePath) if err != nil { return err } if err = json.Unmarshal(listingsJSON, &listingRecords); err != nil { return err } for _, listing := range listingRecords { if paymentCoin == "" { listingFilePath := path.Join(repoPath, "root", "listings", listing.Slug+".json") listingJSON, err = ioutil.ReadFile(listingFilePath) if err != nil { return err } if err = json.Unmarshal(listingJSON, &listingRecord); err != nil { return err } paymentCoin = listingRecord.Listing.Metadata.AcceptedCurrencies[0] } migratedRecords = append(migratedRecords, Migration009_listingDataAfterMigration{ Hash: listing.Hash, Slug: listing.Slug, Title: listing.Title, Categories: listing.Categories, NSFW: listing.NSFW, ContractType: listing.ContractType, Description: listing.Description, Thumbnail: listing.Thumbnail, Price: listing.Price, ShipsTo: listing.ShipsTo, FreeShipping: listing.FreeShipping, Language: listing.Language, AverageRating: listing.AverageRating, RatingCount: listing.RatingCount, CoinType: listing.CoinType, AcceptedCurrencies: []string{paymentCoin}, }) } if listingsJSON, err = json.MarshalIndent(migratedRecords, "", " "); err != nil { return err } err = ioutil.WriteFile(listingsFilePath, listingsJSON, os.ModePerm) if err != nil { return err } return nil } func migration009MigrateListingsIndexDown(repoPath string) error { listingsFilePath := path.Join(repoPath, "root", "listings.json") if _, err := os.Stat(listingsFilePath); os.IsNotExist(err) { return nil } var ( err error listingsJSON []byte listingRecords []Migration009_listingDataAfterMigration migratedRecords []Migration009_listingDataBeforeMigration ) listingsJSON, err = ioutil.ReadFile(listingsFilePath) if err != nil { return err } if err = json.Unmarshal(listingsJSON, &listingRecords); err != nil { return err } for _, listing := range listingRecords { migratedRecords = append(migratedRecords, Migration009_listingDataBeforeMigration{ Hash: listing.Hash, Slug: listing.Slug, Title: listing.Title, Categories: listing.Categories, NSFW: listing.NSFW, ContractType: listing.ContractType, Description: listing.Description, Thumbnail: listing.Thumbnail, Price: listing.Price, ShipsTo: listing.ShipsTo, FreeShipping: listing.FreeShipping, Language: listing.Language, AverageRating: listing.AverageRating, RatingCount: listing.RatingCount, CoinType: listing.CoinType, }) } if listingsJSON, err = json.MarshalIndent(migratedRecords, "", " "); err != nil { return err } err = ioutil.WriteFile(listingsFilePath, listingsJSON, os.ModePerm) if err != nil { return err } return nil }
{ "pile_set_name": "Github" }
{ "desc": "Huawei E398", "type": "qmi" }
{ "pile_set_name": "Github" }
// Copyright 2016 Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package uuid import ( "sync" ) var ( nodeMu sync.Mutex ifname string // name of interface being used nodeID [6]byte // hardware for version 1 UUIDs zeroID [6]byte // nodeID with only 0's ) // NodeInterface returns the name of the interface from which the NodeID was // derived. The interface "user" is returned if the NodeID was set by // SetNodeID. func NodeInterface() string { defer nodeMu.Unlock() nodeMu.Lock() return ifname } // SetNodeInterface selects the hardware address to be used for Version 1 UUIDs. // If name is "" then the first usable interface found will be used or a random // Node ID will be generated. If a named interface cannot be found then false // is returned. // // SetNodeInterface never fails when name is "". func SetNodeInterface(name string) bool { defer nodeMu.Unlock() nodeMu.Lock() return setNodeInterface(name) } func setNodeInterface(name string) bool { iname, addr := getHardwareInterface(name) // null implementation for js if iname != "" && addr != nil { ifname = iname copy(nodeID[:], addr) return true } // We found no interfaces with a valid hardware address. If name // does not specify a specific interface generate a random Node ID // (section 4.1.6) if name == "" { ifname = "random" randomBits(nodeID[:]) return true } return false } // NodeID returns a slice of a copy of the current Node ID, setting the Node ID // if not already set. func NodeID() []byte { defer nodeMu.Unlock() nodeMu.Lock() if nodeID == zeroID { setNodeInterface("") } nid := nodeID return nid[:] } // SetNodeID sets the Node ID to be used for Version 1 UUIDs. The first 6 bytes // of id are used. If id is less than 6 bytes then false is returned and the // Node ID is not set. func SetNodeID(id []byte) bool { if len(id) < 6 { return false } defer nodeMu.Unlock() nodeMu.Lock() copy(nodeID[:], id) ifname = "user" return true } // NodeID returns the 6 byte node id encoded in uuid. It returns nil if uuid is // not valid. The NodeID is only well defined for version 1 and 2 UUIDs. func (uuid UUID) NodeID() []byte { var node [6]byte copy(node[:], uuid[10:]) return node[:] }
{ "pile_set_name": "Github" }
.. _cli/cloud: Cloud management ================
{ "pile_set_name": "Github" }
# Spring ์›น MVC ๊ฐ•์˜ ์ •๋ฆฌ > [๋ฐฑ๊ธฐ์„ ์˜ Spring ์›น MVC](https://www.inflearn.com/course/%EC%9B%B9-mvc/)๋ฅผ ์ •๋ฆฌํ•œ ์ž๋ฃŒ์ž…๋‹ˆ๋‹ค. # ์„œ๋ธ”๋ฆฟ * ์ž๋ฐ” ์—”ํ„ฐํ”„๋ผ์ด์ฆˆ ์—๋””์…˜์€ ์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ฐœ๋ฐœ์šฉ ์ŠคํŒฉ๊ณผ API ์ œ๊ณต * ์š”์ฒญ ๋‹น ์“ฐ๋ ˆ๋“œ(๋งŒ๋“ค๊ฑฐ๋‚˜, ํ’€์—์„œ ๊ฐ€์ ธ์˜ด) ์‚ฌ์šฉ * ๊ทธ ์ค‘์— ๊ฐ€์žฅ ์ค‘์š”ํ•œ ํด๋ž˜์Šค์ค‘ ํ•˜๋‚˜๊ฐ€ HttpServlet ## ์„œ๋ธ”๋ฆฟ์˜ ์žฅ์ (CGI ์—๋น„ํ•ด) * ๋น ๋ฅด๋‹ค * ํ”Œ๋žซํผ ๋…๋ฆฝ์  * ๋ณด์•ˆ * ์ด์‹์„ฑ ## ์„œ๋ธ”๋ฆฟ ์—”์ง„ ๋˜๋Š” ์„œ๋ธ”๋ฆฟ ์ปจํ…Œ์ด๋„ˆ(ํ†ฐ์บฃ, ์ œํ‹ฐ, ์–ธ๋”ํ† ) * ์„ธ์…˜ ๊ด€๋ฆฌ * ๋„คํŠธ์›Œํฌ ๊ธฐ๋ฐ˜ ์„œ๋น„์Šค * MIME ๊ธฐ๋ฐ˜ ๋ฉ”์‹œ์ง€ ์ธ์ฝ”๋”ฉ ๋””์ฝ”๋”ฉ * ์„œ๋ธ”๋ฆฟ ์ƒ๋ช…์ฃผ๊ธฐ ๊ด€๋ฆฌ ## ์„œ๋ธ”๋ฆฟ ์ƒ๋ช…์ฃผ๊ธฐ * ์„œ๋ธ”๋ฆฟ ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ์„œ๋ธ”๋ฆฟ ์ธ์Šคํ„ด์Šค์˜ init() ๋ฉ”์„œ๋“œ๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ์ดˆ๊ธฐํ™” ํ•œ๋‹ค. * ์ตœ์ดˆ ์š”์ฒญ์„ ๋ฐ›์•˜์„ ๋•Œ ํ•œ๋ฒˆ ์ดˆ๊ธฐํ™” ํ•˜๊ณ  ๋‚˜๋ฉด ๊ทธ ๋‹ค์Œ ์š”์ฒญ๋ถ€ํ„ฐ๋Š” ์ด ๊ณผ์ •์„ ์ƒ๋žตํ•ด๋„๋œ๋‹ค. * ์„œ๋ธ”๋ฆฟ ์ดˆ๊ธฐํ™” ๋œ ๋‹ค์Œ๋ถ€ํ„ฐ๋Š” ํด๋ผ์ด์–ธํŠธ์˜ ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค. ๊ฐ ์š”์ฒญ์€ ๋ณ„๋„์˜ ์Šค๋ ˆ๋“œ๋กœ ์ฒ˜๋ฆฌํ•˜๊ณ  ์ด ๋•Œ ์„œ๋ธ”๋ฆฟ ์ธ์Šคํ„ด์Šค์˜ service()๋ฉ”์„œ๋“œ๋ฅผ ํ˜ธ์ถฃํ•œ๋‹ค. * ์ด ์•ˆ์—์„œ HTTP ์š”์ฒญ์„ ๋ฐ›๊ณ  ํด๋ผ์ด์–ธํŠธ๋กœ ๋ณด๋‚ผ ๋•Œ HTTP ์‘๋‹ต์„ ๋งŒ๋“ ๋‹ค * service()๋Š” ๋ณดํ†ต HTTP Method์— ๋”ฐ๋ผ doGet(), doPost() ๋“ฑ์œผ๋กœ ์ฒ˜๋ฆฌ๋ฅผ ์œ„์ž„ํ•œ๋‹ค. * ์„œ๋ธ”๋ฆฟ ์ปจํ…Œ์ด๋„ˆ์˜ ํŒ๋‹จ์— ๋”ฐ๋ผ ํ•ด๋‹น ์„œ๋ธ”๋ฆฟ ๋ฉ”๋ชจ๋ฆฌ์—์„œ ๋‚ด๋ ค์™€ ํ•  ์‹œ์ ์— destroy()๋ฅผ ํ˜ธ์ถœํ•œ๋‹ค. ## ์„œ๋ธ”๋ฆฟ ๋ฆฌ์Šค๋„ˆ์™€ ์„œ๋ธ”๋ฆฟ ํ•„ํ„ฐ ### ์„œ๋ธ”๋ฆฟ ๋ฆฌ์Šค๋„ˆ * ์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ๋ฐœ์ƒํ•˜๋Š” ์ฃผ์š” ์ด๋ฒคํŠธ๋ฅผ ๊ฐ์ง€ํ•˜๊ณ  ๊ฐ ์ด๋ฒคํŠธ์— ํŠน๋ณ„ํ•œ ์ž‘์—…์ด ํ•„์š”ํ•œ ๊ฒฝ์šฐ์— ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. * ์„œ๋ธ”๋ฆฟ ์ปจํ…์Šค์˜ ์ˆ˜์ค€์˜ ์ด๋ฒคํŠธ * ์ปจํ…์ŠคํŠธ ๋ผ์ดํ”„์‚ฌ์ดํด ์ด๋ฒคํŠธ * ์ปจํ…์ŠคํŠธ ์• ํŠธ๋ฆฌ๋ทฐํŠธ ๋ณ€๊ฒฝ ์ด๋ฒคํŠธ * ์„ธ์…˜ ์ˆ˜์ค€์˜ ์ด๋ฒคํŠธ * ์„ธ์…˜ ๋ผ์ดํ”„์‚ฌ์ดํด ์ด๋ฒคํŠธ * ์„ธ์…˜ ์—ํŠธ๋ฆฌ๋ทฐํŠธ ๋ณ€๊ฒฝ ์ด๋ฒคํŠธ ### ์„œ๋ธ”๋ฆฟ ํ•„ํ„ฐ * ๋“ค์–ด์˜จ ์š”์ฒญ์„ ์„œ๋ธ”๋ฆฟ์œผ๋กœ ๋ณด๋‚ด๊ณ , ๋˜ ์„œ๋ธ”๋ฆฟ์ด ์ž‘์„ฑํ•œ ์‘๋‹ต์„ ํด๋ผ์ด์–ธํŠธ๋กœ ๋ณด๋‚ด๊ธฐ ์ „์— ํŠน๋ณ„ํ•œ ์ฒ˜๋ฆฌ๊ธฐ๊ฐ€ ํ•„์š”ํ•œ ๊ฒฝ์šฐ์— ์‚ฌ์šฉ ํ•  ์ˆ˜ ์žˆ๋‹ค. * ์ฒด์ธ ํ˜•ํƒœ์˜ ๊ตฌ์กฐ # DispatherServlet ## DispatherServlet ๋™์ž‘ ์›๋ฆฌ ### DispatherServlet ์ดˆ๊ธฐํ™” * ์•„๋ž˜์˜ ํŠน๋ณ„ํ•œ ํƒ€์ž…์˜ ๋นˆ์„ ์ฐพ๊ฑฐ๋‚˜, ๊ธฐ๋ณธ ์ „๋žต์— ํ•ด๋‹นํ•˜๋Š” ๋นˆ์„ ๋“ฑ๋กํ•œ๋‹ค. * HandlerMapping(ํ•ธ๋“ค๋Ÿฌ๋ฅผ ์ฐพ์•„์ฃผ๋Š” ์ธํ„ฐํŽ˜์ด์Šค), HanlderAdpater(ํ•ธ๋“ค๋Ÿฌ๋ฅผ ์‹คํ–‰ํ•˜๋Š” ์ธํ„ฐํŽ˜์ด์Šค), HanlderExceptionResolver, ViewResolver, .... ### DispatherServlet ๋™์ž‘ ์ˆœ์„œ 1. ์š”์ฒญ์„ ๋ถ„์„ํ•œ๋‹ค. (๋กœ์ผ€์ผ, ํ…Œ๋งˆ, ๋ฉ€ํ‹ฐํŒŒํฌ ๋“ฑ๋“ฑ) 2. (ํ•ธ๋“ค๋Ÿฌ ๋งคํ•‘์—๊ฒŒ ์œ„์ž„ํ•˜์—ฌ) ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•  ํ•ธ๋“ค๋Ÿฌ๋ฅผ ์ฐพ๋Š”๋‹ค. 3. (๋“ฑ๋ก๋˜์–ด ์žˆ๋Š” ํ•ธ๋“ค๋Ÿฌ ์–ด๋ށํ„ฐ์ค‘) ํ•ด๋‹น ํ•ธ๋“ค๋Ÿฌ๋ฅผ ์‹คํ•ผ ํ•  ์ˆ˜ ์žˆ๋Š” "ํ•ธ๋“ค๋Ÿฌ ์–ด๋ށํ„ฐ"๋ฅผ ์ฐพ๋Š”๋‹ค. 4. ์ฐพ์•„๋‚ธ "ํ•ธ๋“ค๋Ÿฌ ์–ด๋ށํ„ฐ"๋ฅผ ์‚ฌ์šฉํ•ด์„œ ํ•ธ๋“ค๋Ÿฌ์˜ ์‘๋‹ต์„ ์ฒ˜๋ฆฌํ•œ๋‹ค. 5. (๋ถ€๊ฐ€์ ์œผ๋กœ) ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค๋ฉด, ์˜ˆ์™ธ ์ฒ˜๋ฆฌ ํ•ธ๋“ค๋Ÿฌ์— ์š”์ฒญ ์ฒ˜๋ฆฌ๋ฅผ ์œ„์ž„ํ•œ๋‹ค. 6. ํ•ธ๋“ค๋Ÿฌ์˜ ๋ฆฌํ„ด๊ฐ’์„ ๋ณด๊ณ  ์–ด๋–ป๊ฒŒ ์ฒ˜๋ฆฌํ• ์ง€๋ฅผ ํŒ๋‹จํ•œ๋‹ค. * ๋ทฐ ์ด๋ฆ„์— ํ•ด๋‹นํ•˜๋Š” ๋ทฐ๋ฅผ ์ฐพ์•„ ๋ชจ๋ธ ๋ฐ์ดํ„ฐ๋ฅผ ๋ Œ๋”๋ง ํ•œ๋‹ค. * `@ResponseBody`๊ฐ€ ์žˆ๋‹ค๋ฉด Convter๋ฅผ ์ด์šฉํ•ด์„œ ์‘๋‹ต ๋ณธ๋ฌธ์„ ๋งŒ๋“ ๋‹ค. 7. ์ตœ์ข…์ ์œผ๋กœ ์‘๋‹ต์„ ๋ณด๋‚ธ๋‹ค. ## DispatherServlet ๊ตฌ์„ฑ ์š”์†Œ * DispatcherSerlvet์˜ ๊ธฐ๋ณธ ์ „๋žต * DispachersServlet.propertes ์„ค์ •์„ ๋”ฐ๋ผ๊ฐ„๋‹ค. * MutilpartResolver * ํŒŒ์ผ ์—…๋กœ๋“œ ์š”์ฒญ ์ฒ˜๋ฆฌ์— ํ•„์š”ํ•œ ์ธํ„ฐํŽ˜์ด์Šค * HttpServletRequest๋ฅผ MutilpartHttpServletRequest๋กœ ๋ณ€ํ™˜ํ•ด์ฃผ์–ด ์š”์ฒญ์ด ๋‹ด๊ณ  ์žˆ๋Š” Fild์„ ๊บผ๋‚ผ์ˆ˜ ์žˆ๋Š” API ์ œ๊ณต * LocaleReslver * ํด๋ผ์ด์–ธํŠธ์˜ ์œ„์น˜ ์ •๋ณด๋ฅผ ํŒŒ์•…ํ•˜๋Š” ์ธํ„ฐํŽ˜์ด์Šค * ๊ธฐ๋ณธ ์ „๋žต์€ ์š”์ฒญ accept-language๋ฅผ ๋ณด๊ณ  ํŒ๋‹จ. * HanderMapping * ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•  ํ•ธ๋“ค๋Ÿฌ๋ฅผ ์ฐพ๋Š” ์ธํ„ฐํŽ˜์ด์Šค * HandlerAdapter * HandlerMapping์ด ์ฐพ์•„๋‚ธ ํ•ธ๋“ค๋Ÿฌ๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š” ์ธํ„ฐํŽ˜์ด์Šค * ์Šคํ”„๋ง MVC ํ™•์žฅ๋ ฅ์˜ ํ•ต์‹ฌ * HanderAdapter * HanlderMapping์ด ์ฐพ์•„๋‚ธ "ํ•ธ๋“ค๋Ÿฌ" ์ฒ˜๋ฆฌํ•˜๋Š” ์ธํ„ฐํŽ˜์ด์Šค * ViewResolver * ๋ทฐ ์ด๋ฆ„์— ํ•ด๋‹นํ•˜๋Š” ๋ทฐ๋ฅผ ์ฐพ์•„๋‚ด๋Š” ์ธํ„ฐํŽ˜์ด์Šค * FlashMapManager * FlashMap ์ธ์Šคํ„ด์Šค๋ฅผ ๊ฐ€์ ธ์˜ค๊ณ  ์ €์žฅํ•˜๋Š” ์ธํ„ฐํŽ˜์ด์Šค * FlashMap์€ ์ฃผ๋กœ ๋ฆฌ๋‹ค์ด๋ ‰์…˜์„ ์‚ฌ์šฉํ•  ๋•Œ ์š”์ฒญ ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ๋ฐ์ดํ„ฐ๋ฅผ ์ „๋‹ฌํ•˜๊ณ  ์ •๋ฆฌํ•  ๋•Œ ์‚ฌ์šฉํ•œ๋‹ค. * redirect:/events # MVC ์„ค์ • * `WebMvcConfigurationSupport.class` * `WebMvcAutoConfiguration.class` * ์„ค์ •์„ ๊ธฐ๋ณธ ์„ค์ •์ด๋‹ค ## ์Šคํ”„๋ง ๋ถ€ํŠธ MVC ์„ค์ • * ์Šคํ”„๋ง ๋ถ€ํŠธ์˜ **์ฃผ๊ด€**์ด ์ ์šฉ๋œ ์ž๋™ ์„ค์ •์ด ๋™์ž‘ํ•œ๋‹ค. * JSP ๋ณด๋‹ค Thymeleaf ์„ ํ˜ธ * JSON ์ง€์› * ์ •์  ๋ฆฌ์†Œ์Šค ์ง€์› (+ ์›ฐ์ปด ํŽ˜์ด์ง€, ํŒŒ๋น„์ฝ˜ ๋“ฑ ์ง€์›) * resourceHanderMapping์„ ๊ธฐ๋ณธ์œผ๋กœ ์ œ๊ณต * ์Šคํ”„๋ง MVC ์ปค์Šคํ„ฐ๋งˆ์ด์ง• * application.properties * @Configuration + Implements WebMvcConfigurer: ์Šคํ”„๋ง ๋ถ€ํŠธ์˜ ์Šคํ”„๋ง MVC ์ž๋™์„ค์ • + ์ถ”๊ฐ€ ์„ค์ • * @Configuration + @EnableWebMvc + Imlements WebMvcConfigurer: ์Šคํ”„๋ง ๋ถ€ํŠธ์˜ ์Šคํ”„๋ง MVC ์ž๋™์„ค์ • ์‚ฌ์šฉํ•˜์ง€ ์•Š์Œ. ## WebMvcConfigurer ์„ค์ • ### Formatter ```java public class PersonFormatter implements Formatter<Person> { @Override public Person parse(String name, Locale locale) { return new Person(name, name); } @Override public String print(Person person, Locale locale) { return person.toString(); } } @Configuration public class WebConfig implements WebMvcConfigurer { @Override public void addFormatters(FormatterRegistry registry) { registry.addFormatter(new PersonFormatter()); } } @RestController @RequestMapping("/sample") public class SampleApi { @GetMapping("/{name}") public Person sample(@PathVariable("name") Person person) { return person; } } ``` * Formatter๋ฅผ ๋“ฑ๋กํ•˜๋ฉด `PathVariable` ์–ด๋…ธํ…Œ์ด์…˜์œผ๋กœ ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค. ### handlerIntercepter * preHandle์„ ํ†ตํ•ด์„œ ์ „์ฒ˜๋ฆฌ ๊ฐ€๋Šฅ * postHandler์„ ํ†ตํ•ด ํ›„์ฒ˜๋ฆฌ ๊ฐ€๋Šฅ * afterComplection ์™„์ „ํžˆ ๋๋‚œ ์ดํ›„ ```java @Configuration public class WebConfig implements WebMvcConfigurer { @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new SimpleInterceptor()).order(0); registry.addInterceptor(new SecondeInterceptor()).order(1); } } public class SimpleInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { System.out.println("pre handler 1"); return true; } @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { System.out.println("post handler 1"); } @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { System.out.println("after completion 1"); } } /** * preHandle 1 -> ์š”์ฒญ ์ „์ฒ˜๋ฆฌ * preHandle 2 -> ์š”์ฒญ ์ „์ฒ˜๋ฆฌ * postHandler 2-> ์š”์ฒญ ํ›„์ฒ˜๋ฆฌ * postHandler 1-> ์š”์ฒญ ํ›„์ฒ˜๋ฆฌ * ๋ทฐ ๋žœ๋”๋ง * afterCompletion 2 -> * afterCompletion 1 -> */ @GetMapping("/{name}") public Person sample(@PathVariable("name") Person person) { return person; } ``` * **postHandler, afterCompletion ์ˆœ์„œ๋Š” preHandle์™€ ๋ฐ˜๋Œ€์ด๋‹ค.** * `new SimpleInterceptor()).order(0)` ์šฐ์„ ์ˆœ์œ„๋ฅผ ์„ค์ •์„ ํ†ตํ•ด์„œ ์กฐ์ ˆํ•  ์ˆ˜ ์žˆ๋‹ค. (๋‚ฎ์„ ์ˆ˜๋ก ์šฐ์„ ์ˆœ์œ„๊ฐ€ ๋†’๋‹ค. ์Œ์ˆ˜๋„ ๊ฐ€๋Šฅํ•˜๋‹ค) boolean preHandle(request, response, handler) * ํ•ธ๋“ค๋Ÿฌ ์‹คํ–‰ํ•˜๊ธฐ ์ „์— ํ˜ธ์ถœ ๋จ * **ํ•ธ๋“ค๋Ÿฌ**์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์„œ๋ธ”๋ฆฟ ํ•„ํ„ฐ์— ๋น„ํ•ด ๋ณด๋‹ค ์„ธ๋ฐ€ํ•œ ๋กœ์ง์„ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ๋‹ค. * ๋ฆฌํ„ด๊ฐ’์œผ๋กœ ๊ณ„์† ๋‹ค์Œ ์ธํ„ฐ์…‰ํ„ฐ ๋˜๋Š” ํ•ธ๋“ค๋Ÿฌ๋กœ ์š”์ฒญ,์‘๋‹ต์„ ์ „๋‹ฌํ• ์ง€(true) ์‘๋‹ต ์ฒ˜๋ฆฌ๊ฐ€ ์ด๊ณณ์—์„œ ๋๋‚ฌ๋Š”์ง€(false) ์•Œ๋ฆฐ๋‹ค. void postHandle(request, response, modelAndView) * ํ•ธ๋“ค๋Ÿฌ ์‹คํ–‰์ด ๋๋‚˜๊ณ  ์•„์ง ๋ทฐ๋ฅผ ๋žœ๋”๋ง ํ•˜๊ธฐ ์ด์ „์— ํ˜ธ์ถœ ๋จ * **๋ทฐ**์— ์ „๋‹ฌํ•  ์ถ”๊ฐ€์ ์ด๊ฑฐ๋‚˜ ์—ฌ๋Ÿฌ ํ•ธ๋“ค๋Ÿฌ์— ๊ณตํ†ต์ ์ธ ๋ชจ๋ธ ์ •๋ณด๋ฅผ ๋‹ด๋Š”๋ฐ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ๋‹ค. * ์ด ๋ฉ”์†Œ๋“œ๋Š” ์ธํ„ฐ์…‰ํ„ฐ ์—ญ์ˆœ์œผ๋กœ ํ˜ธ์ถœ๋œ๋‹ค. * ๋น„๋™๊ธฐ์ ์ธ ์š”์ฒญ ์ฒ˜๋ฆฌ ์‹œ์—๋Š” ํ˜ธ์ถœ๋˜์ง€ ์•Š๋Š”๋‹ค. void afterCompletion(request, response, handler, ex) * ์š”์ฒญ ์ฒ˜๋ฆฌ๊ฐ€ ์™„์ „ํžˆ ๋๋‚œ ๋’ค(๋ทฐ ๋žœ๋”๋ง ๋๋‚œ ๋’ค)์— ํ˜ธ์ถœ ๋จ * preHandler์—์„œ true๋ฅผ ๋ฆฌํ„ดํ•œ ๊ฒฝ์šฐ์—๋งŒ ํ˜ธ์ถœ ๋จ * ์ด ๋ฉ”์†Œ๋“œ๋Š” ์ธํ„ฐ์…‰ํ„ฐ ์—ญ์ˆœ์œผ๋กœ ํ˜ธ์ถœ๋œ๋‹ค. * ๋น„๋™๊ธฐ์ ์ธ ์š”์ฒญ ์ฒ˜๋ฆฌ ์‹œ์—๋Š” ํ˜ธ์ถœ๋˜์ง€ ์•Š๋Š”๋‹ค. vs ์„œ๋ธ”๋ฆฟ ํ•„ํ„ฐ * ์„œ๋ธ”๋ฆฟ ๋ณด๋‹ค ๊ตฌ์ฒด์ ์ธ ์ฒ˜๋ฆฌ๊ฐ€ ๊ฐ€๋Šฅํ•˜๋‹ค. * ์„œ๋ธ”๋ฆฟ์€ ๋ณด๋‹ค ์ผ๋ฐ˜์ ์ธ ์šฉ๋„์˜ ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•˜๋Š”๋ฐ ์‚ฌ์šฉํ•˜๋Š”๊ฒŒ ์ข‹๋‹ค. ๋ฐ˜๋Œ€๋กœ ์Šคํ”„๋ง์— ํŠนํ™”๋œ ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•ด์•ผ ํ•  ๋•Œ๋Š” `handlerIntercepter`์œผ๋กœ ์ฒ˜๋ฆฌํ•œ๋‹ค ### ResourceHanlder ์ด๋ฏธ์ง€, ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ, CSS, HTML ํŒŒ์ผ๊ณผ ๊ฐ™์€ ์ •์ ์ธ ๋ฆฌ์†Œ์Šค๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š” ํ•ธ๋“ค๋Ÿฌ ๋“ฑ๋กํ•˜๋Š” ๋ฐฉ๋ฒ• * Default Servlet * ์„œ๋ธ”๋ฆฟ ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ๊ธฐ๋ณธ์œผ๋กœ ์ œ๊ณตํ•˜๋Š” ์„œ๋ธ”๋ฆฟ์œผ๋กœ ์ •์ ์ธ ๋ฆฌ์†Œ์Šค๋ฅผ ์ฒ˜๋ฆฌํ•  ๋•Œ ์‚ฌ์šฉํ•œ๋‹ค * ์Šคํ”„๋ง MVC ๋ฆฌ์†Œ์Šค ํ•ธ๋“ค๋Ÿฌ ๋งคํ•‘ ๋“ฑ๋ก * ๊ฐ€์žฅ ๋‚ฎ์€ ์šฐ์„  ์ˆœ์œ„๋กœ ๋“ฑ๋ก * ์šฐ๋ฆฌ๊ฐ€ ์ง์ ‘๋งŒ๋“  ํ•ธ๋“ค๋Ÿฌ๊ฐ€ ์šฐ์„ ์ˆœ์œ„๊ฐ€ ๋” ๋†’์•„์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์šฐ์„ ์ˆœ์œ„๊ฐ€ ๋‚ฎ์•„์•ผํ•œ๋‹ค. * ํ•ธ๋œฐ๋Ÿฌ ๋งคํ•‘์ด "/" ์ดํ•˜ ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•˜๋„๋ก ํ•˜๊ณ  * ์ตœ์ •์ ์œผ๋กœ ๋ฆฌ์Šค์Šค ํ•ธ๋“ค๋Ÿฌ๊ฐ€ ์ฒ˜๋ฆฌํ•˜๋„๋ก ํ•œ๋‹ค. * ๋ฆฌ์†Œ์Šค ํ•ธ๋“ค๋Ÿฌ ์„ค์ • * ์–ด๋–ค ์š”์ฒญ ํŒจํ„ด์„ ์ง€์›ํ•  ๊ฒƒ์ธ๊ฐ€? * ์–ด๋””์„œ ๋ฆฌ์†Œ์Šค๋ฅผ ์ฐพ์„ ๊ฒƒ์ธ๊ฐ€? ### Http Message Converter * ์š”์ฒญ ๋ณธ๋ฌธ์—์„œ ๋ฉ”์‹œ์ง€๋ฅผ ์ฝ์–ด๋“ค์ด๊ฑฐ๋‚˜(@RequestBody), ์‘๋‹ต ๋ณธ๋ฌธ์— ๋ฉ”์‹œ์ง€๋ฅผ ์ž‘์„ฑํ•  ๋•Œ(@ResponseBody) ์‚ฌ์šฉํ•œ๋‹ค. ```java // ์ด๋ ‡๊ฒŒ ๋“ฑ๋กํ•˜๊ฒŒ ๋œ ๊ฒฝ์šฐ ์Šคํ”„๋ง ๋ถ€ํŠธ์—์„œ ์ง€์ •ํ•˜๋Š” WebMvcAutoConfiguration ๊ธฐ๋ณธ ์„ค์ •์—์„œ ๋“ฑ๋กํ•œ http message converter๋ฅผ ๋ฎ์–ด ์”Œ์–ด์„œ ๊ธฐ์กด์— ์žˆ๋Š” ์ปจ๋ฒ„ํ„ฐ๋ฅผ ์‚ญ์ œํ•˜๊ณ  ์ถ”๊ฐ€ํ•œ๊ฒƒ์œผ๋กœ ๋ฎ์–ด ์”Œ์–ด์ง„๋‹ค. ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ๊ฒƒ์ด ์ข‹์•„ ๋ณด์ธ๋‹ค. @Override public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { } // ์ด๋ ‡๊ฒŒ ๋“ฑ๋กํ•˜๋ฉด ๊ธฐ์กด์— ์žˆ๋Š” ๋ฉ”์‹œ์ง€ ์ปจ๋ฒ„ํ„ฐ์— ์ถ”๊ฐ€๋งŒ ํ•˜๋Š” ํ˜•์‹์ด๋ผ์„œ ์•ˆ์ „ํ•˜๋‹ค. @Override public void extendMessageConverters(List<HttpMessageConverter<?>> converters) { } ``` #### ๊ธฐ๋ณธ HTTP ๋ฉ”์‹œ์ง€ ์ปจ๋ฒ„ํ„ฐ * ๋ฐ”์ดํŠธ ๋ฐฐ์—ด ์ปจ๋ฒ„ํ„ฐ * ๋ฌธ์ž์—ด ์ปจ๋ฒ„ํ„ฐ * Resource ์ปจ๋ฒ„ํ„ฐ * Form ์ปจ๋ฒ„ํ„ฐ (ํผ ๋ฐ์ดํ„ฐ to/from MultiValueMap<String, String>) * (JAXB2 ์ปจ๋ฒ„ํ„ฐ) * (Jackson2 ์ปจ๋ฒ„ํ„ฐ) * (Jackson ์ปจ๋ฒ„ํ„ฐ) * (Gson ์ปจ๋ฒ„ํ„ฐ) * (Atom ์ปจ๋ฒ„ํ„ฐ) * (RSS ์ปจ๋ฒ„ํ„ฐ) #### ์„ค์ • ๋ฐฉ๋ฒ• * ๊ธฐ๋ณธ์œผ๋กœ ๋“ฑ๋กํ•ด์ฃผ๋Š” ์ปจ๋ฒ„ํ„ฐ์— ์ƒˆ๋กœ์šด ์ปจ๋ฒ„ํ„ฐ ์ถ”๊ฐ€ํ•˜๊ธฐ: extendMessageConverters * ๊ธฐ๋ณธ์œผ๋กœ ๋“ฑ๋กํ•ด์ฃผ๋Š” ์ปจ๋ฒ„ํ„ฐ๋Š” ๋‹ค ๋ฌด์‹œํ•˜๊ณ  ์ƒˆ๋กœ ์ปจ๋ฒ„ํ„ฐ ์„ค์ •ํ•˜๊ธฐ: configureMessageConverters * ์˜์กด์„ฑ ์ถ”๊ฐ€๋กœ ์ปจ๋ฒ„ํ„ฐ ๋“ฑ๋กํ•˜๊ธฐ (๊ฐ€์žฅ ์ผ๋ฐ˜์ ์ด๋‹ค.) * ๋ฉ”์ด๋ธ ๋˜๋Š” ๊ทธ๋ž˜๋“ค ์„ค์ •์— ์˜์กด์„ฑ์„ ์ถ”๊ฐ€ํ•˜๋ฉด ๊ทธ์— ๋”ฐ๋ฅธ ์ปจ๋ฒ„ํ„ฐ๊ฐ€ ์ž๋™์œผ๋กœ ๋“ฑ๋ก ๋œ๋‹ค. * WebMvcConfigurationSupport ๊ธฐ๋ณธ ์„ค์ •์„ ๋”ฐ๋ผ ๊ฐ„๋‹ค. * HttpMessageConverter๋กœ @Bean์„ ๋“ฑ๋กํ•œ๋‹ค(๊ตณ์ด ์ปค์Šคํ…€ ํ•ด์•ผ ํ•œ๋‹ค๋ฉด ์ด๊ฒŒ ์ œ์ผ ์ข‹์•„ ๋ณด์ธ๋‹ค.) ### ๊ทธ๋ฐ–์— WebMvcConfigurer ์„ค์ • * CROS ์„ค์ • * ๋ฆฌํ„ด ๊ฐ’ ํ•ธ๋“ค๋Ÿฌ ์„ค์ • : ์Šคํ”„๋ง MVC๊ฐ€ ์ œ๊ณตํ•˜๋Š” ๊ธฐ๋ณธ ๋ฆฌํ„ด ๊ฐ’ ํ•ธ๋“ค๋Ÿฌ ์ด์™ธ์— ๋ฆฌํ„ด ํ•ธ๋“ค๋Ÿฌ๋ฅผ ์ถ”๊ฐ€ ํ•  ์ˆ˜ ์žˆ๋‹ค. * ์•„ํ๋จผํŠธ ๋ฆฌ์กธ๋ฒ„ ์„ค์ • : ์Šคํ”„๋ง MVC๊ฐ€ ์ œ๊ณตํ•˜๋Š” ๊ธฐ๋ณธ ์•„๊ทœ๋จผํŠธ ๋ฆฌ์กธ๋ฒ„ ์ด์™ธ์— ์ปค์Šคํ…€ํ•œ ์•„๊ทœ๋จผํŠธ ๋ฆฌ์กธ๋ฒ„๋ฅผ ์ถ”๊ฐ€ํ•˜๊ณ  ์‹ถ์„ ๋•Œ ์„ค์ •ํ•œ๋‹ค. * ๋ทฐ ๋ฆฌ์กธ๋ฒ„ ์„ค์ • : ํ•ธ๋“ค๋Ÿฌ์—์„œ ๋ฆฌํ„ดํ•˜๋Š” ๋ทฐ ์—๋Œ€ํ•œ ๋ฆฌ์กธ๋ฒ„์ด๋‹ค. ํƒ€์ž„๋ฆฌํ”„, JSP ๋“ฑ ๋‹ค์–‘ํ•˜๊ฒŒ ์žˆ๋‹ค. * Content Negotiation ์„ค์ • : ์š”์ฒญ ๋ณธ๋ฌธ ๋˜๋Š” ์‘๋‹ต ๋ณธ๋ฌธ์„ ์–ด๋–ค (MIME) ํƒ€์ž…์œผ๋กœ ๋ณด๋‚ด์•ผ ํ•˜๋Š”์ง€ ๊ฒฐ์ •ํ•˜๋Š” ์ „๋žต์„ ์„ค์ •ํ•œ๋‹ค ### MVC ์„ค์ • ๋งˆ๋ฌด๋ฆฌ > ์ถœ์ฒ˜ ๋ฐฐ๊ธฐ์„ ๋‹˜ ์Šคํ”„๋ง ์›น MVC ๊ณต๊ฐœ ์ž๋ฃŒ @EnableWebMvc - ์• ๋…ธํ…Œ์ด์…˜ ๊ธฐ๋ฐ˜์˜ ์Šคํ”„๋ง MVC ์„ค์ • ๊ฐ„ํŽธํ™” - WebMvcConfigurer๊ฐ€ ์ œ๊ณตํ•˜๋Š” ๋ฉ”์†Œ๋“œ๋ฅผ ๊ตฌํ˜„ํ•˜์—ฌ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•ํ•  ์ˆ˜ ์žˆ๋‹ค. ์Šคํ”„๋ง ๋ถ€ํŠธ - ์Šคํ”„๋ง ๋ถ€ํŠธ ์ž๋™ ์„ค์ •์„ ํ†ตํ•ด ๋‹ค์–‘ํ•œ ์Šคํ”„๋ง MVC ๊ธฐ๋Šฅ์„ ์•„๋ฌด๋Ÿฐ ์„ค์ • ํŒŒ์ผ์„ ๋งŒ๋“ค์ง€ ์•Š์•„๋„ ์ œ๊ณตํ•œ๋‹ค. - WebMvcConfigurer๊ฐ€ ์ œ๊ณตํ•˜๋Š” ๋ฉ”์†Œ๋“œ๋ฅผ ๊ตฌํ˜„ํ•˜์—ฌ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•ํ•  ์ˆ˜ ์žˆ๋‹ค. - @EnableWebMvc๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์Šคํ”„๋ง ๋ถ€ํŠธ ์ž๋™ ์„ค์ •์„ ์‚ฌ์šฉํ•˜์ง€ ๋ชปํ•œ๋‹ค. ์Šคํ”„๋ง MVC ์„ค์ • ๋ฐฉ๋ฒ• - ์Šคํ”„๋ง ๋ถ€ํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ์—๋Š” application.properties ๋ถ€ํ„ฐ ์‹œ์ž‘. - WebMvcConfigurer๋กœ ์‹œ์ž‘ - @Bean์œผ๋กœ MVC ๊ตฌ์„ฑ ์š”์†Œ ์ง์ ‘ ๋“ฑ๋ก # MVC ํ™œ์šฉ ## แ„‹แ…ญแ„Žแ…ฅแ†ผ แ„†แ…ขแ†ธแ„‘แ…ตแ†ผแ„’แ…กแ„€แ…ต 6แ„‡แ…ฎ แ„แ…ฅแ„‰แ…ณแ„แ…ฅแ†ท แ„‹แ…ขแ„‚แ…ฉแ„แ…ฆแ„‹แ…ตแ„‰แ…งแ†ซ > ์ถœ์ฒ˜ : ๋ฐฑ๊ธฐ์„ ์˜ ์Šคํ”„๋ง ์›น MVC @RequestMapping ์• ๋…ธํ…Œ์ด์…˜์„ ๋ฉ”ํƒ€ ์• ๋…ธํ…Œ์ด์…˜์œผ๋กœ ์‚ฌ์šฉํ•˜๊ธฐ * @GetMapping ๊ฐ™์€ ์ปค์Šคํ…€ํ•œ ์• ๋…ธํ…Œ์ด์…˜์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค. ๋ฉ”ํƒ€(Meta) ์• ๋…ธํ…Œ์ด์…˜ * ์• ๋…ธํ…Œ์ด์…˜์— ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ์• ๋…ธํ…Œ์ด์…˜ * ์Šคํ”„๋ง์ด ์ œ๊ณตํ•˜๋Š” ๋Œ€๋ถ€๋ถ„์˜ ์• ๋…ธํ…Œ์ด์…˜์€ ๋ฉ”ํƒ€ ์• ๋…ธํ…Œ์ด์…˜์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ์กฐํ•ฉ(Composed) ์• ๋…ธํ…Œ์ด์…˜ * ํ•œ๊ฐœ ํ˜น์€ ์—ฌ๋Ÿฌ ๋ฉ”ํƒ€ ์• ๋…ธํ…Œ์ด์…˜์„ ์กฐํ•ฉํ•ด์„œ ๋งŒ๋“  ์• ๋…ธํ…Œ์ด์…˜ * ์ฝ”๋“œ๋ฅผ ๊ฐ„๊ฒฐํ•˜๊ฒŒ ์ค„์ผ ์ˆ˜ ์žˆ๋‹ค. * ๋ณด๋‹ค ๊ตฌ์ฒด์ ์ธ ์˜๋ฏธ๋ฅผ ๋ถ€์—ฌํ•  ์ˆ˜ ์žˆ๋‹ค. @Retention * ํ•ด๋‹น ์• ๋…ธํ…Œ์ด์…˜ ์ •๋ณด๋ฅผ ์–ธ์ œ๊นŒ์ง€ ์œ ์ง€ํ•  ๊ฒƒ์ธ๊ฐ€. * Source: ์†Œ์Šค ์ฝ”๋“œ๊นŒ์ง€๋งŒ ์œ ์ง€. ์ฆ‰, ์ปดํŒŒ์ผ ํ•˜๋ฉด ํ•ด๋‹น ์• ๋…ธํ…Œ์ด์…˜ ์ •๋ณด๋Š” ์‚ฌ๋ผ์ง„๋‹ค๋Š” ์ด์•ผ๊ธฐ. * Class: ์ปดํŒŒ์ธ ํ•œ .class ํŒŒ์ผ์—๋„ ์œ ์ง€. ์ฆ‰ ๋Ÿฐํƒ€์ž„ ์‹œ, ํด๋ž˜์Šค๋ฅผ ๋ฉ”๋ชจ๋ฆฌ๋กœ ์ฝ์–ด์˜ค๋ฉด ํ•ด๋‹น ์ •๋ณด๋Š” ์‚ฌ๋ผ์ง„๋‹ค. * Runtime: ํด๋ž˜์Šค๋ฅผ ๋ฉ”๋ชจ๋ฆฌ์— ์ฝ์–ด์™”์„ ๋•Œ๊นŒ์ง€ ์œ ์ง€! ์ฝ”๋“œ์—์„œ ์ด ์ •๋ณด๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ ํŠน์ • ๋กœ์ง์„ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋‹ค. @Target * ํ•ด๋‹น ์• ๋…ธํ…Œ์ด์…˜์„ ์–ด๋””์— ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ๊ฒฐ์ •ํ•œ๋‹ค. @Documented * ํ•ด๋‹น ์• ๋…ธํ…Œ์ด์…˜์„ ์‚ฌ์šฉํ•œ ์ฝ”๋“œ์˜ ๋ฌธ์„œ์— ๊ทธ ์• ๋…ธํ…Œ์ด์…˜์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ํ‘œ๊ธฐํ• ์ง€ ๊ฒฐ์ •ํ•œ๋‹ค. ๋ฉ”ํƒ€ ์• ๋…ธํ…Œ์ด์…˜ * https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans-meta-annotations * https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/annotation/AliasFor.html ## แ„’แ…ขแ†ซแ„ƒแ…ณแ†ฏแ„…แ…ฅ แ„†แ…ฆแ„‰แ…ฉแ„ƒแ…ณ 6แ„‡แ…ฎ @Validated > ์ถœ์ฒ˜ : ๋ฐฑ๊ธฐ์„ ์˜ ์Šคํ”„๋ง ์›น MVC * ์Šคํ”„๋ง MVC ํ•ธ๋“ค๋Ÿฌ ๋ฉ”์†Œ๋“œ ์•„๊ทœ๋จผํŠธ์— ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ validation group์ด๋ผ๋Š” ํžŒํŠธ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. * @Valid ์• ๋…ธํ…Œ์ด์…˜์—๋Š” ๊ทธ๋ฃน์„ ์ง€์ •ํ•  ๋ฐฉ๋ฒ•์ด ์—†๋‹ค. * @Validated๋Š” ์Šคํ”„๋ง์ด ์ œ๊ณตํ•˜๋Š” ์• ๋…ธํ…Œ์ด์…˜์œผ๋กœ ๊ทธ๋ฃน ํด๋ž˜์Šค๋ฅผ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋‹ค. ## ํ•ธ๋“ค๋Ÿฌ ๋ฉ”์†Œ๋“œ 12๋ถ€: Flash Attributes > ์ถœ์ฒ˜ : ๋ฐฑ๊ธฐ์„ ์˜ ์Šคํ”„๋ง ์›น MVC ์ฃผ๋กœ ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ์‹œ์— ๋ฐ์ดํ„ฐ๋ฅผ ์ „๋‹ฌํ•  ๋•Œ ์‚ฌ์šฉํ•œ๋‹ค. * ๋ฐ์ดํ„ฐ๊ฐ€ URI์— ๋…ธ์ถœ๋˜์ง€ ์•Š๋Š”๋‹ค. * ์ž„์˜์˜ ๊ฐ์ฒด๋ฅผ ์ €์žฅํ•  ์ˆ˜ ์žˆ๋‹ค. * ๋ณดํ†ต HTTP ์„ธ์…˜์„ ์‚ฌ์šฉํ•œ๋‹ค. ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ ํ•˜๊ธฐ ์ „์— ๋ฐ์ดํ„ฐ๋ฅผ HTTP ์„ธ์…˜์— ์ €์žฅํ•˜๊ณ  ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ ์š”์ฒญ์„ ์ฒ˜๋ฆฌ ํ•œ ๋‹ค์Œ ๊ทธ ์ฆ‰์‹œ ์ œ๊ฑฐํ•œ๋‹ค. RedirectAttributes๋ฅผ ํ†ตํ•ด ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ## ํ•ธ๋“ค๋Ÿฌ ๋ฉ”์†Œ๋“œ 15๋ถ€: @RequestBody & HttpEntity > ์ถœ์ฒ˜ : ๋ฐฑ๊ธฐ์„ ์˜ ์Šคํ”„๋ง ์›น MVC @RequestBody * ์š”์ฒญ ๋ณธ๋ฌธ(body)์— ๋“ค์–ด์žˆ๋Š” ๋ฐ์ดํ„ฐ๋ฅผ HttpMessageConveter๋ฅผ ํ†ตํ•ด ๋ณ€ํ™˜ํ•œ ๊ฐ์ฒด๋กœ ๋ฐ›์•„์˜ฌ ์ˆ˜ ์žˆ๋‹ค. * @Valid ๋˜๋Š” @Validated๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๊ฐ’์„ ๊ฒ€์ฆ ํ•  ์ˆ˜ ์žˆ๋‹ค. * BindingResult ์•„๊ทœ๋จผํŠธ๋ฅผ ์‚ฌ์šฉํ•ด ์ฝ”๋“œ๋กœ ๋ฐ”์ธ๋”ฉ ๋˜๋Š” ๊ฒ€์ฆ ์—๋Ÿฌ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. HttpMessageConverter * ์Šคํ”„๋ง MVC ์„ค์ • (WebMvcConfigurer)์—์„œ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋‹ค. * configureMessageConverters: ๊ธฐ๋ณธ ๋ฉ”์‹œ์ง€ ์ปจ๋ฒ„ํ„ฐ ๋Œ€์ฒด * extendMessageConverters: ๋ฉ”์‹œ์ง€ ์ปจ๋ฒ„ํ„ฐ์— ์ถ”๊ฐ€ * ๊ธฐ๋ณธ ์ปจ๋ฒ„ํ„ฐ * WebMvcConfigurationSupport.addDefaultHttpMessageConverters HttpEntity * @RequestBody์™€ ๋น„์Šทํ•˜์ง€๋งŒ ์ถ”๊ฐ€์ ์œผ๋กœ ์š”์ฒญ ํ—ค๋” ์ •๋ณด๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ## ๋ชจ๋ธ: @ModelAttribute ๋˜ ๋‹ค๋ฅธ ์‚ฌ์šฉ๋ฒ• > ์ถœ์ฒ˜ : ๋ฐฑ๊ธฐ์„ ์˜ ์Šคํ”„๋ง ์›น MVC @ModelAttribute์˜ ๋‹ค๋ฅธ ์šฉ๋ฒ• * @RequestMapping์„ ์‚ฌ์šฉํ•œ ํ•ธ๋“ค๋Ÿฌ ๋ฉ”์†Œ๋“œ์˜ ์•„๊ทœ๋จผํŠธ์— ์‚ฌ์šฉํ•˜๊ธฐ (์ด๋ฏธ ์‚ดํŽด ๋ดค์Šต๋‹ˆ๋‹ค.) * @Controller ๋˜๋Š” @ControllerAdvice (์ด ์• ๋…ธํ…Œ์ด์…˜์€ ๋’ค์—์„œ ๋‹ค๋ฃน๋‹ˆ๋‹ค.)๋ฅผ ์‚ฌ์šฉํ•œ ํด๋ž˜์Šค์—์„œ ๋ชจ๋ธ ์ •๋ณด๋ฅผ ์ดˆ๊ธฐํ™” ํ•  ๋•Œ ์‚ฌ์šฉํ•œ๋‹ค. * @RequestMapping๊ณผ ๊ฐ™์ด ์‚ฌ์šฉํ•˜๋ฉด ํ•ด๋‹น ๋ฉ”์†Œ๋“œ์—์„œ ๋ฆฌํ„ดํ•˜๋Š” ๊ฐ์ฒด๋ฅผ ๋ชจ๋ธ์— ๋„ฃ์–ด ์ค€๋‹ค. RequestToViewNameTranslator ## ์˜ˆ์™ธ ์ฒ˜๋ฆฌ ํ•ธ๋“ค๋Ÿฌ: @ExceptionHandler > ์ถœ์ฒ˜ : ๋ฐฑ๊ธฐ์„ ์˜ ์Šคํ”„๋ง ์›น MVC ํŠน์ • ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒํ•œ ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•˜๋Š” ํ•ธ๋“ค๋Ÿฌ ์ •์˜ * ์ง€์›ํ•˜๋Š” ๋ฉ”์†Œ๋“œ ์•„๊ทœ๋จผํŠธ (ํ•ด๋‹น ์˜ˆ์™ธ ๊ฐ์ฒด, ํ•ธ๋“ค๋Ÿฌ ๊ฐ์ฒด, ...) * ์ง€์›ํ•˜๋Š” ๋ฆฌํ„ด ๊ฐ’ * REST API์˜ ๊ฒฝ์šฐ ์‘๋‹ต ๋ณธ๋ฌธ์— ์—๋Ÿฌ์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ๋‹ด์•„์ฃผ๊ณ , ์ƒํƒœ ์ฝ”๋“œ๋ฅผ ์„ค์ •ํ•˜๋ ค๋ฉด ResponseEntity๋ฅผ ์ฃผ๋กœ ์‚ฌ์šฉํ•œ๋‹ค. ์ฐธ๊ณ  * [Spring Document](https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-ann-exceptionhandler) ## ์ „์—ญ ์ปจํŠธ๋กค๋Ÿฌ: @(Rest)ControllerAdvice > ์ถœ์ฒ˜ : ๋ฐฑ๊ธฐ์„ ์˜ ์Šคํ”„๋ง ์›น MVC ์˜ˆ์™ธ ์ฒ˜๋ฆฌ, ๋ฐ”์ธ๋”ฉ ์„ค์ •, ๋ชจ๋ธ ๊ฐ์ฒด๋ฅผ ๋ชจ๋“  ์ปจํŠธ๋กค๋Ÿฌ ์ „๋ฐ˜์— ๊ฑธ์ณ ์ ์šฉํ•˜๊ณ  ์‹ถ์€ ๊ฒฝ์šฐ์— ์‚ฌ์šฉํ•œ๋‹ค. * @ExceptionHandler * @InitBinder * @ModelAttributes ์ ์šฉํ•  ๋ฒ”์œ„๋ฅผ ์ง€์ •ํ•  ์ˆ˜๋„ ์žˆ๋‹ค. * ํŠน์ • ์• ๋…ธํ…Œ์ด์…˜์„ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ์ปจํŠธ๋กค๋Ÿฌ์—๋งŒ ์ ์šฉํ•˜๊ธฐ * ํŠน์ • ํŒจํ‚ค์ง€ ์ดํ•˜์˜ ์ปจํŠธ๋กค๋Ÿฌ์—๋งŒ ์ ์šฉํ•˜๊ธฐ * ํŠน์ • ํด๋ž˜์Šค ํƒ€์ž…์—๋งŒ ์ ์šฉํ•˜๊ธฐ ์ฐธ๊ณ  * [Spring Document](https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-ann-controller-advice)
{ "pile_set_name": "Github" }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Lock\Tests\Store; use Symfony\Component\Lock\Store\RedisStore; /** * @author Jรฉrรฉmy Derussรฉ <jeremy@derusse.com> */ abstract class AbstractRedisStoreTest extends AbstractExpiringStoreTest { /** * {@inheritdoc} */ protected function getClockDelay() { return 250000; } /** * Return a RedisConnection. * * @return \Redis|\RedisArray|\RedisCluster|\Predis\Client */ abstract protected function getRedisConnection(); /** * {@inheritdoc} */ public function getStore() { return new RedisStore($this->getRedisConnection()); } }
{ "pile_set_name": "Github" }
// Code generated by goa v3.2.4, DO NOT EDIT. // // divider HTTP server types // // Command: // $ goa gen goa.design/examples/error/design -o // $(GOPATH)/src/goa.design/examples/error package server import ( divider "goa.design/examples/error/gen/divider" goa "goa.design/goa/v3/pkg" ) // IntegerDivideHasRemainderResponseBody is the type of the "divider" service // "integer_divide" endpoint HTTP response body for the "has_remainder" error. type IntegerDivideHasRemainderResponseBody struct { // Name is the name of this class of errors. Name string `form:"name" json:"name" xml:"name"` // ID is a unique identifier for this particular occurrence of the problem. ID string `form:"id" json:"id" xml:"id"` // Message is a human-readable explanation specific to this occurrence of the // problem. Message string `form:"message" json:"message" xml:"message"` // Is the error temporary? Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` // Is the error a timeout? Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` // Is the error a server-side fault? Fault bool `form:"fault" json:"fault" xml:"fault"` } // IntegerDivideDivByZeroResponseBody is the type of the "divider" service // "integer_divide" endpoint HTTP response body for the "div_by_zero" error. type IntegerDivideDivByZeroResponseBody struct { // Name is the name of this class of errors. Name string `form:"name" json:"name" xml:"name"` // ID is a unique identifier for this particular occurrence of the problem. ID string `form:"id" json:"id" xml:"id"` // Message is a human-readable explanation specific to this occurrence of the // problem. Message string `form:"message" json:"message" xml:"message"` // Is the error temporary? Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` // Is the error a timeout? Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` // Is the error a server-side fault? Fault bool `form:"fault" json:"fault" xml:"fault"` } // IntegerDivideTimeoutResponseBody is the type of the "divider" service // "integer_divide" endpoint HTTP response body for the "timeout" error. type IntegerDivideTimeoutResponseBody struct { // Name is the name of this class of errors. Name string `form:"name" json:"name" xml:"name"` // ID is a unique identifier for this particular occurrence of the problem. ID string `form:"id" json:"id" xml:"id"` // Message is a human-readable explanation specific to this occurrence of the // problem. Message string `form:"message" json:"message" xml:"message"` // Is the error temporary? Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` // Is the error a timeout? Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` // Is the error a server-side fault? Fault bool `form:"fault" json:"fault" xml:"fault"` } // DivideDivByZeroResponseBody is the type of the "divider" service "divide" // endpoint HTTP response body for the "div_by_zero" error. type DivideDivByZeroResponseBody struct { // Name is the name of this class of errors. Name string `form:"name" json:"name" xml:"name"` // ID is a unique identifier for this particular occurrence of the problem. ID string `form:"id" json:"id" xml:"id"` // Message is a human-readable explanation specific to this occurrence of the // problem. Message string `form:"message" json:"message" xml:"message"` // Is the error temporary? Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` // Is the error a timeout? Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` // Is the error a server-side fault? Fault bool `form:"fault" json:"fault" xml:"fault"` } // DivideTimeoutResponseBody is the type of the "divider" service "divide" // endpoint HTTP response body for the "timeout" error. type DivideTimeoutResponseBody struct { // Name is the name of this class of errors. Name string `form:"name" json:"name" xml:"name"` // ID is a unique identifier for this particular occurrence of the problem. ID string `form:"id" json:"id" xml:"id"` // Message is a human-readable explanation specific to this occurrence of the // problem. Message string `form:"message" json:"message" xml:"message"` // Is the error temporary? Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` // Is the error a timeout? Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` // Is the error a server-side fault? Fault bool `form:"fault" json:"fault" xml:"fault"` } // NewIntegerDivideHasRemainderResponseBody builds the HTTP response body from // the result of the "integer_divide" endpoint of the "divider" service. func NewIntegerDivideHasRemainderResponseBody(res *goa.ServiceError) *IntegerDivideHasRemainderResponseBody { body := &IntegerDivideHasRemainderResponseBody{ Name: res.Name, ID: res.ID, Message: res.Message, Temporary: res.Temporary, Timeout: res.Timeout, Fault: res.Fault, } return body } // NewIntegerDivideDivByZeroResponseBody builds the HTTP response body from the // result of the "integer_divide" endpoint of the "divider" service. func NewIntegerDivideDivByZeroResponseBody(res *goa.ServiceError) *IntegerDivideDivByZeroResponseBody { body := &IntegerDivideDivByZeroResponseBody{ Name: res.Name, ID: res.ID, Message: res.Message, Temporary: res.Temporary, Timeout: res.Timeout, Fault: res.Fault, } return body } // NewIntegerDivideTimeoutResponseBody builds the HTTP response body from the // result of the "integer_divide" endpoint of the "divider" service. func NewIntegerDivideTimeoutResponseBody(res *goa.ServiceError) *IntegerDivideTimeoutResponseBody { body := &IntegerDivideTimeoutResponseBody{ Name: res.Name, ID: res.ID, Message: res.Message, Temporary: res.Temporary, Timeout: res.Timeout, Fault: res.Fault, } return body } // NewDivideDivByZeroResponseBody builds the HTTP response body from the result // of the "divide" endpoint of the "divider" service. func NewDivideDivByZeroResponseBody(res *goa.ServiceError) *DivideDivByZeroResponseBody { body := &DivideDivByZeroResponseBody{ Name: res.Name, ID: res.ID, Message: res.Message, Temporary: res.Temporary, Timeout: res.Timeout, Fault: res.Fault, } return body } // NewDivideTimeoutResponseBody builds the HTTP response body from the result // of the "divide" endpoint of the "divider" service. func NewDivideTimeoutResponseBody(res *goa.ServiceError) *DivideTimeoutResponseBody { body := &DivideTimeoutResponseBody{ Name: res.Name, ID: res.ID, Message: res.Message, Temporary: res.Temporary, Timeout: res.Timeout, Fault: res.Fault, } return body } // NewIntegerDivideIntOperands builds a divider service integer_divide endpoint // payload. func NewIntegerDivideIntOperands(a int, b int) *divider.IntOperands { v := &divider.IntOperands{} v.A = a v.B = b return v } // NewDivideFloatOperands builds a divider service divide endpoint payload. func NewDivideFloatOperands(a float64, b float64) *divider.FloatOperands { v := &divider.FloatOperands{} v.A = a v.B = b return v }
{ "pile_set_name": "Github" }
Format layout {{ content }}
{ "pile_set_name": "Github" }
/* RestoreSettingsVS4V06EXP.S for Nintendont (Kernel) Copyright (C) 2015 FIX94 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 version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <asm.h> .set VS4_BACKUP, 0xD3003500 RestoreSettingsVS: lis r3, VS4_BACKUP@h ori r3, r3, VS4_BACKUP@l lwz r4, -0xEE4(r13) lwz r5, -0xE40(r13) li r6, 0x2B memcpy: subic. r6, r6, 1 lbzx r0, r3, r6 stbx r0, r4, r6 stbx r0, r5, r6 bne memcpy blr
{ "pile_set_name": "Github" }
[Language] LanguageSupport0=0009 [OperatingSystem] OSSupport=0000000000010010 [Data] CurrentMedia=CD-ROM CurrentComponentDef=Default.cdf ProductName=Executor set_mifserial= DevEnvironment=GNU C AppExe= set_dlldebug=No EmailAddresss= Instructions=Instructions.txt set_testmode=No set_mif=No SummaryText= Department= HomeURL= Author= Type=Database Application InstallRoot=D:\My Installations\Executor Win32 Version=2.1pr11 InstallationGUID=18397a85-64ea-11d1-962e-00609734111f set_level=Level 3 CurrentFileGroupDef=Default.fdf Notes=Notes.txt set_maxerr=50 set_args= set_miffile=Status.mif set_dllcmdline= Copyright= set_warnaserr=No CurrentPlatform= Category= set_preproc= CurrentLanguage=English CompanyName=ARDI Description=Description.txt set_maxwarn=50 set_crc=Yes [MediaInfo] mediadata0=Default/Media\Default mediadata1=CD-ROM/Media\CD-ROM [General] Type=INSTALLMAIN Version=1.00.000
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.nifi.toolkit.encryptconfig import org.apache.log4j.LogManager import org.apache.log4j.PropertyConfigurator import org.slf4j.Logger import org.slf4j.LoggerFactory class EncryptConfigLogger { private static final Logger logger = LoggerFactory.getLogger(EncryptConfigLogger.class) /** * Configures the logger. * * The nifi-toolkit module uses log4j, which will be configured to append all * log output to the system STDERR. The log level can be specified using the verboseEnabled * argument. A value of <code>true</code> will set the log level to DEBUG, a value of * <code>false</code> will set the log level to INFO. * * @param verboseEnabled flag to indicate if verbose mode is enabled, which sets the log level to DEBUG */ static configureLogger(boolean verboseEnabled) { Properties log4jProps = null URL log4jPropsPath = EncryptConfigLogger.class.getResource("/log4j.properties") if (log4jPropsPath) { try { log4jPropsPath.withReader { reader -> log4jProps = new Properties() log4jProps.load(reader) } } catch (IOException e) { // do nothing, we will fallback to hardcoded defaults below } } if (!log4jProps) { log4jProps = defaultProperties() } // For encrypt-config, log output should go to System.err as System.out is used for tool output in decrypt mode log4jProps.put("log4j.appender.console.Target", "System.err") if (verboseEnabled) { // Override the log level for this package. For this to work as intended, this class must belong // to the same package (or a parent package) of all the encrypt-config classes log4jProps.put("log4j.logger." + EncryptConfigLogger.class.package.name, "DEBUG") } LogManager.resetConfiguration() PropertyConfigurator.configure(log4jProps) if (verboseEnabled) { logger.debug("Verbose mode is enabled (goes to stderr by default).") } } /** * A copy of the settings in /src/main/resources/log4j.properties, in case that is not on the classpath at runtime * @return Properties containing the default properties for Log4j */ static Properties defaultProperties() { Properties defaultProperties = new Properties() defaultProperties.setProperty("log4j.rootLogger", "INFO,console") defaultProperties.setProperty("log4j.appender.console", "org.apache.log4j.ConsoleAppender") defaultProperties.setProperty("log4j.appender.console.Target", "System.err") defaultProperties.setProperty("log4j.appender.console.layout", "org.apache.log4j.PatternLayout") defaultProperties.setProperty("log4j.appender.console.layout.ConversionPattern", "%d{yyyy-mm-dd HH:mm:ss} %p %c{1}: %m%n") return defaultProperties } }
{ "pile_set_name": "Github" }
tessedit_create_boxfile 1
{ "pile_set_name": "Github" }