text
stringlengths 2
100k
| meta
dict |
---|---|
package com.huawei.networkit.grs.local;
import android.text.TextUtils;
import com.huawei.networkit.grs.GrsBaseInfo;
import com.huawei.networkit.grs.common.Logger;
import com.huawei.networkit.grs.local.model.ApplicationBean;
import com.huawei.networkit.grs.local.model.CountryGroup;
import com.huawei.networkit.grs.local.model.Service;
import com.huawei.networkit.grs.local.model.Serving;
import com.huawei.networkit.grs.utils.ContextUtil;
import com.huawei.networkit.grs.utils.Io;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONObject;
public abstract class AbstractLocalManager {
private static final String REGEX_PATTERN = "^grs_sdk_global_route_config_[a-zA-Z]+\\.json$";
private static final String TAG = "AbstractLocalManager";
ApplicationBean appGrs;
Map<String, String> country2GroupMap = new ConcurrentHashMap(16);
List<CountryGroup> countryGroups;
boolean readLocalConfigOk = false;
Map<String, String> serviceHashMap = new ConcurrentHashMap(16);
public abstract int parseAppBean(String str);
public abstract int parseCountryGroups(String str);
public abstract List<CountryGroup> parseCustomCountry(JSONArray jSONArray, JSONObject jSONObject);
public abstract int parseServices(String str);
/* access modifiers changed from: package-private */
public int loadLocalConfig(String appConfigName) {
int loadSuccessFlag = -1;
if (loadAppLocalConfig(Io.getConfigContent(appConfigName)) == 0) {
Logger.i(TAG, "load APP_CONFIG_FILE success.");
loadSuccessFlag = 0;
}
try {
String[] files = ContextUtil.getContext().getAssets().list("");
if (files != null && files.length > 0) {
for (String file : files) {
if (Pattern.matches(REGEX_PATTERN, file) && loadSdkLocalConfig(Io.getConfigContent(file)) == 0) {
Logger.i(TAG, "load SDK_CONFIG_FILE sucess.");
loadSuccessFlag = 0;
}
}
}
} catch (IOException e) {
Logger.w(TAG, "list assets files fail,please check if according to our standard config json files.");
}
return loadSuccessFlag;
}
private int loadAppLocalConfig(String configContent) {
if (TextUtils.isEmpty(configContent)) {
Logger.w(TAG, "getConfigMgr configContent is null.");
return -1;
}
int result = parseCountryGroups(configContent);
if (result != 0) {
return result;
}
int result2 = parseAppBean(configContent);
if (result2 != 0) {
return result2;
}
return parseServices(configContent);
}
private int loadSdkLocalConfig(String configContent) {
int result;
if (TextUtils.isEmpty(configContent)) {
Logger.w(TAG, "getConfigMgr configContent is null.");
return -1;
}
List<CountryGroup> list = this.countryGroups;
if ((list == null || list.isEmpty()) && (result = parseCountryGroups(configContent)) != 0) {
return result;
}
return parseServices(configContent);
}
public boolean updateCountryGroupMap(GrsBaseInfo grsBaseInfo) {
if (this.countryGroups == null) {
Logger.w(TAG, "updateCountryGroupMap return null because {null == countryGroups}");
return false;
}
this.country2GroupMap.put(Route.NO_ROUTEBY_COUNTRY, Route.NO_ROUTE_COUNTRYGROUPID);
for (CountryGroup countryGroup : this.countryGroups) {
if (countryGroup.getCountries().contains(grsBaseInfo.getIssueCountry())) {
this.country2GroupMap.put(grsBaseInfo.getIssueCountry(), countryGroup.getId());
}
if (countryGroup.getCountries().contains(grsBaseInfo.getRegCountry())) {
this.country2GroupMap.put(grsBaseInfo.getRegCountry(), countryGroup.getId());
}
if (countryGroup.getCountries().contains(grsBaseInfo.getSerCountry())) {
this.country2GroupMap.put(grsBaseInfo.getSerCountry(), countryGroup.getId());
}
}
return true;
}
private Map<String, String> createPrivateCountryGroupMap(List<CountryGroup> customCountryGroup, GrsBaseInfo grsBaseInfo) {
Map<String, String> localCountry2GroupMap = new ConcurrentHashMap<>(16);
localCountry2GroupMap.put(Route.NO_ROUTEBY_COUNTRY, Route.NO_ROUTE_COUNTRYGROUPID);
for (CountryGroup countryGroup : customCountryGroup) {
if (countryGroup.getCountries().contains(grsBaseInfo.getIssueCountry())) {
localCountry2GroupMap.put(grsBaseInfo.getIssueCountry(), countryGroup.getId());
}
if (countryGroup.getCountries().contains(grsBaseInfo.getRegCountry())) {
localCountry2GroupMap.put(grsBaseInfo.getRegCountry(), countryGroup.getId());
}
if (countryGroup.getCountries().contains(grsBaseInfo.getSerCountry())) {
localCountry2GroupMap.put(grsBaseInfo.getSerCountry(), countryGroup.getId());
}
}
return localCountry2GroupMap;
}
public String getUrlFromLocal(GrsBaseInfo grsBaseInfo, String serviceName, String key) {
Map<String, String> addresses = getServicesUrlsFromLocal(grsBaseInfo, serviceName);
if (addresses != null) {
return addresses.get(key);
}
Logger.w(TAG, "addresses not found by routeby in local config{%s}", serviceName);
return null;
}
public Map<String, String> getServicesUrlsFromLocal(GrsBaseInfo grsBaseInfo, String serviceName) {
Serving serving;
if (!this.readLocalConfigOk) {
return null;
}
Service service = this.appGrs.getService(serviceName);
if (service == null) {
Logger.w(TAG, "service not found in local config{%s}", service);
return null;
}
String country = Route.getRouteCountry(service.getRouteBy(), grsBaseInfo);
if (country == null) {
Logger.w(TAG, "country not found by routeby in local config{%s}", service.getRouteBy());
return null;
}
List<CountryGroup> customCountryGroup = service.getCountryGroups();
if (customCountryGroup == null || customCountryGroup.size() == 0) {
serving = service.getServing(this.country2GroupMap.get(country));
} else {
serving = service.getServing(createPrivateCountryGroupMap(customCountryGroup, grsBaseInfo).get(country));
}
if (serving == null) {
return null;
}
return serving.getAddresses();
}
}
| {
"pile_set_name": "Github"
} |
1、作用域public、private、protected以及不写时的区别?
2、定义float f = 3.4,是否正确,如果错误,怎么修改?
3、
父类:
package test;
public class FatherClass {
public FatherClass() {
System.out.println("FatherClass Create");
}
}
子类:
package test;
import test.FatherClass;
public class ChildClass extends FatherClass {
public ChildClass() {
System.out.println("ChildClass Create");
}
public static void main(String[] args) {
FatherClass fc = new FatherClass();
ChildClass cc = new ChildClass();
}
}
输出结果:
FatherClass Create
FatherClass Create
ChildClass Create
4、JSP有哪些内置对象?作用分别是什么?
5、谈一谈Servlet的生命周期?
6、写一段JDBC连ORACLE的程序,并实现数据查询。
7、描述ORACLE中的锁定机制和读取机制。
8、请描述Struts - Oracle中大数据量下的分页解决方案。
9、你在项目中用到了XML的哪些方面?如何实现的?
10、EJB2.0有哪些内容?分别用在什么场合?EJB2.0和EJB1.1的区别?
11、MVC的各个部分都能用哪些技术来实现?如何实现?请详细描述Struts架构,Struts怎样在各个子模块中进行切换?
12、你在项目中用到了哪些设计模式?分别用在什么场合?
面试问题
你觉得自己的J2EE水平怎样?
你的技术在以前的公司里处于一个怎样的水平呢?
通过以前做过的项目,你都学到了些什么?
以后的职业规划是什么?
你还有什么要问的吗? | {
"pile_set_name": "Github"
} |
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
| {
"pile_set_name": "Github"
} |
<html lang="en">
<head>
<title>Oups !</title>
<style>html{font:12px sans-serif;}</style>
<link rel="stylesheet" href="../css/a11y-en_errors-only.css">
</head>
<body>
<h1>How am I encoded, buddy?</h1>
</body>
</html>
| {
"pile_set_name": "Github"
} |
var BlockStream = require("dropper")
var blockSizes = [16, 25, 1024]
, writeSizes = [4, 8, 15, 16, 17, 64, 100]
, writeCounts = [1, 10, 100]
, tap = require("tap")
writeCounts.forEach(function (writeCount) {
blockSizes.forEach(function (blockSize) {
writeSizes.forEach(function (writeSize) {
tap.test("writeSize=" + writeSize +
" blockSize="+blockSize +
" writeCount="+writeCount, function (t) {
var f = new BlockStream(blockSize, {nopad: true })
var actualChunks = 0
var actualBytes = 0
var timeouts = 0
f.on("data", function (c) {
timeouts ++
actualChunks ++
actualBytes += c.length
// make sure that no data gets corrupted, and basic sanity
var before = c.toString()
// simulate a slow write operation
setTimeout(function () {
timeouts --
var after = c.toString()
t.equal(after, before, "should not change data")
// now corrupt it, to find leaks.
for (var i = 0; i < c.length; i ++) {
c[i] = "x".charCodeAt(0)
}
}, 100)
})
f.on("end", function () {
// round up to the nearest block size
var expectChunks = Math.ceil(writeSize * writeCount * 2 / blockSize)
var expectBytes = writeSize * writeCount * 2
t.equal(actualBytes, expectBytes,
"bytes=" + expectBytes + " writeSize=" + writeSize)
t.equal(actualChunks, expectChunks,
"chunks=" + expectChunks + " writeSize=" + writeSize)
// wait for all the timeout checks to finish, then end the test
setTimeout(function WAIT () {
if (timeouts > 0) return setTimeout(WAIT)
t.end()
}, 100)
})
for (var i = 0; i < writeCount; i ++) {
var a = new Buffer(writeSize);
for (var j = 0; j < writeSize; j ++) a[j] = "a".charCodeAt(0)
var b = new Buffer(writeSize);
for (var j = 0; j < writeSize; j ++) b[j] = "b".charCodeAt(0)
f.write(a)
f.write(b)
}
f.end()
})
}) }) })
| {
"pile_set_name": "Github"
} |
# -*-mode: tcl; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: WmDefault.csc,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
#
proc tixPref:SetScheme-Color:WmDefault {args} {
global tixOption
package require wm_default
if {![info exists ::wm_default::wm]} {
wm_default::setup
wm_default::addoptions
}
set tixOption(bg) $::wm_default::background
set tixOption(fg) $::wm_default::foreground
# was "#808080"
set tixOption(dark1_bg) $::wm_default::disabledbackground
set tixOption(inactive_bg) $::wm_default::disabledbackground
set tixOption(inactive_fg) black; # unused
# light1 was used for listbox widgets and trough colors
set tixOption(light1_bg) $::wm_default::scrollbars
set tixOption(light1_fg) white; #unused
# text is now used for listbox widgets
set tixOption(list_bg) $::wm_default::textbackground
set tixOption(active_bg) $::wm_default::activebackground
set tixOption(active_fg) $::wm_default::activeforeground
set tixOption(disabled_fg) $::wm_default::disabledforeground
# new
set tixOption(disabled_bg) $::wm_default::disabledtextbackground
set tixOption(textbackground) $::wm_default::textbackground
set tixOption(input1_fg) $::wm_default::textforeground
set tixOption(select_fg) $::wm_default::selectforeground
set tixOption(select_bg) $::wm_default::selectbackground
set tixOption(selector) $::wm_default::selectcolor
set pri $tixOption(prioLevel)
# Try to give the subwidget (hlist) the highlightThickness
foreach pref {*TixDirTree *TixDirList *TixTree \
*TixScrolledListBox \
*TixScrolledTList *TixScrolledText} {
option add $pref.highlightThickness 0 $pri
}
# necessary:
option add *TixBalloon*background white $pri
option add *TixBalloon*foreground black $pri
option add *TixBalloon.background black $pri
# necessary: but should be restricted
# was - option add *Label.anchor w $pri
option add *TixBalloon*Label.anchor w $pri
option add *TixComboBox*Label.anchor w $pri
option add *TixFileEntry*Label.anchor w $pri
option add *TixLabelEntry*Label.anchor w $pri
option add *TixOptionMenu*Label.anchor w $pri
option add *TixComboBox*background $tixOption(background) $pri
option add *TixFileEntry*Entry.borderWidth 0 $pri
option add *TixFileEntry.frame.background $tixOption(textbackground) $pri
option add *TixFileEntry*Entry.highlightBackground $::wm_default::highlightbackground $pri
option add *TixOptionMenu*menubutton.relief raised $pri
option add *TixOptionMenu*menubutton.borderWidth $::wm_default::borderwidth $pri
option add *TixResizeHandle*background $tixOption(disabledbackground) $pri
option add *handleActiveBg $::wm_default::selectbackground $pri
# These may already have been covered by wm_default
option add *TixControl*entry.insertBackground $tixOption(textforeground) $pri
option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $pri
option add *TixDirTree*hlist.disabledBackground $tixOption(disabled_bg) $pri
option add *TixDirTree*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixDirTree*f1.relief sunken $pri
option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $pri
option add *TixDirList*hlist.disabledBackground $tixOption(disabled_bg) $pri
option add *TixDirList*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixDirList*f1.relief sunken $pri
option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $pri
option add *TixScrolledHList*hlist.disabledBackground $tixOption(disabled_bg) $pri
option add *TixScrolledHList*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixScrolledHList*f1.relief sunken $pri
option add *TixTree*hlist.background $tixOption(textbackground) $pri
option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $pri
option add *TixTree*hlist.disabledBackground $tixOption(disabled_bg) $pri
option add *TixTree*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixTree*f1.relief sunken $pri
option add *TixFileEntry.background $tixOption(background) $pri
option add *TixHList.activeBackground $tixOption(light1_bg) $pri
option add *TixHList.disabledBackground $tixOption(disabled_bg) $pri
option add *TixLabelEntry*entry.background $tixOption(textbackground) $pri
option add *TixLabelEntry*entry.foreground $tixOption(textforeground) $pri
option add *TixLabelEntry*entry.insertBackground $tixOption(textforeground) $pri
option add *TixMultiView*Listbox.borderWidth 0 $pri
option add *TixMultiView*Listbox.highlightThickness 0 $pri
option add *TixMultiView*Scrollbar.relief sunken $pri
option add *TixMultiView*Scrollbar.width 15 $pri
option add *TixMultiView*f1.borderWidth 2 $pri
option add *TixMultiView*f1.relief sunken $pri
option add *TixMultiView*f1.highlightThickness 2 $pri
option add *TixNoteBook.Background $tixOption(background) $pri
option add *TixNoteBook.nbframe.Background $tixOption(background) $pri
option add *TixNoteBook.nbframe.backPageColor $tixOption(background) $pri
option add *TixNoteBook.nbframe.inactiveBackground $tixOption(disabledbackground) $pri
option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $pri
# option add *TixPanedWindow.seperatorBg $tixOption(disabledbackground) $pri
# option add *TixPanedWindow.handleBg $tixOption(disabledbackground) $pri
option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $pri
option add *TixScrolledTList*tlist.background $tixOption(textbackground) $pri
option add *TixScrolledListBox*listbox.background $tixOption(textbackground) $pri
option add *TixScrolledWindow.frame.background $tixOption(list_bg) $pri
option add *TixTree*hlist.highlightBackground $tixOption(background) $pri
option add *TixTree*hlist.background $tixOption(textbackground) $pri
option add *TixTree*hlist.borderWidth $::wm_default::borderwidth $pri
option add *TixComboBox*Entry.highlightBackground $tixOption(background) $pri
option add *TixComboBox*Entry.background $tixOption(textbackground) $pri
option add *TixComboBox*Entry.foreground $tixOption(textforeground) $pri
option add *TixComboBox*Entry.insertBackground $tixOption(textforeground) $pri
}
proc tixPref:SetScheme-Mono:Gray {} {
global tixOption
package require wm_default
if {![info exists ::wm_default::wm]} {
wm_default::setup
wm_default::addoptions
}
set tixOption(background) lightgray
set tixOption(foreground) black
set tixOption(dark1_bg) gray70
set tixOption(inactive_bg) lightgray
set tixOption(inactive_fg) black
set tixOption(light1_bg) gray90
set tixOption(light1_fg) white
set tixOption(active_bg) gray90
set tixOption(active_fg) $tixOption(foreground)
set tixOption(disabled_fg) gray55
set tixOption(textbackground) $tixOption(light1_bg)
set tixOption(select_fg) white
set tixOption(select_bg) black
set tixOption(selector) black
set pri $tixOption(prioLevel)
# Override what you want with optional arguments to wm_default::adoptions
# necessary:
option add *TixBalloon*background white $pri
option add *TixBalloon*foreground black $pri
option add *TixBalloon.background black $pri
# necessary: but should be restricted
# was - option add *Label.anchor w $pri
option add *TixBalloon*Label.anchor w $pri
option add *TixComboBox*Label.anchor w $pri
option add *TixFileEntry*Label.anchor w $pri
option add *TixLabelEntry*Label.anchor w $pri
# option add *TixDirTree*hlist.highlightBackground $tixOption(background) $pri
# option add *TixDirTree*hlist.background $tixOption(light1_bg) $pri
# option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $pri
# option add *TixDirTree*hlist.disabledBackground $tixOption(disabled_bg) $pri
# option add *TixDirTree*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixDirTree*f1.relief sunken $pri
# option add *TixDirList*hlist.highlightBackground $tixOption(background) $pri
# option add *TixDirList*hlist.background $tixOption(light1_bg) $pri
# option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $pri
# option add *TixDirList*hlist.disabledBackground $tixOption(disabled_bg) $pri
# option add *TixDirList*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixDirList*f1.relief sunken $pri
# option add *TixScrolledHList*hlist.highlightBackground $tixOption(background) $pri
# option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $pri
# option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $pri
# option add *TixScrolledHList*hlist.disabledBackground $tixOption(disabled_bg) $pri
# option add *TixScrolledHList*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixScrolledHList*f1.relief sunken $pri
# option add *TixTree*hlist.highlightBackground $tixOption(background) $pri
# option add *TixTree*hlist.background $tixOption(light1_bg) $pri
# option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $pri
# option add *TixTree*hlist.disabledBackground $tixOption(disabled_bg) $pri
# option add *TixTree*f1.borderWidth $::wm_default::borderwidth $pri
option add *TixTree*f1.relief sunken $pri
# option add *TixHList.background $tixOption(light1_bg) $pri
# option add *TixHList.activeBackground $tixOption(light1_bg) $pri
# option add *TixHList.disabledBackground $tixOption(light1_bg) $pri
# option add *TixMultiView*Listbox.borderWidth 0 $pri
# option add *TixMultiView*Listbox.highlightThickness 0 $pri
option add *TixMultiView*Scrollbar.relief sunken $pri
# option add *TixMultiView*f1.borderWidth 2 $pri
option add *TixMultiView*f1.relief sunken $pri
# option add *TixMultiView*f1.highlightThickness 2 $pri
# option add *TixMDIMenuBar*menubar.relief raised $pri
# option add *TixMDIMenuBar*menubar.borderWidth 2 $pri
# option add *TixMDIMenuBar*Menubutton.padY 2 $pri
# option add *TixNoteBook.Background $tixOption(background) $pri
# option add *TixNoteBook.nbframe.Background $tixOption(background) $pri
# option add *TixNoteBook.nbframe.backPageColor $tixOption(background) $pri
# option add *TixNoteBook.nbframe.inactiveBackground $tixOption(inactive_bg) $pri
# option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $pri
# option add *TixPanedWindow.seperatorBg $tixOption(disabledbackground) $pri
# option add *TixPanedWindow.handleBg $tixOption(disabledbackground) $pri
# option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $pri
# option add *TixScrolledHList*hlist.highlightBackground $tixOption(background) $pri
# option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $pri
# option add *TixScrolledTList*tlist.highlightBackground $tixOption(background) $pri
# option add *TixScrolledTList*tlist.background $tixOption(light1_bg) $pri
# option add *TixScrolledListBox*listbox.highlightBackground $tixOption(background) $pri
# option add *TixScrolledWindow.frame.background $tixOption(light1_bg) $pri
# option add *TixTree*hlist.highlightBackground $tixOption(background) $pri
# option add *TixTree*hlist.background $tixOption(light1_bg) $pri
# option add *TixTree*hlist.borderWidth $::wm_default::borderwidth $pri
# These were missing
# option add *TixMenu*Menu.selectColor $NIMLook(foreground) $pri
# option add *TixMDIMenuBar*Menubutton.padY 2 $pri
# option add *TixMDIMenuBar*menubar.borderWidth 2 $pri
# option add *TixMDIMenuBar*menubar.relief raised $pri
# option add *TixMultiView*Listbox.borderWidth 0 $pri
# option add *TixMultiView*Listbox.highlightThickness 0 $pri
# option add *TixMultiView*Scrollbar.relief sunken $pri
# option add *TixMultiView*f1.borderWidth 2 $pri
# option add *TixMultiView*f1.highlightThickness 2 $pri
option add *TixMultiView*f1.relief sunken $pri
}
# Leave the standard widgets alone
if {0} {
option add *Background $tixOption(background) $pri
option add *background $tixOption(background) $pri
option add *Foreground $tixOption(foreground) $pri
option add *foreground $tixOption(foreground) $pri
option add *activeBackground $tixOption(active_bg) $pri
option add *activeForeground $tixOption(active_fg) $pri
option add *HighlightBackground $tixOption(background) $pri
option add *selectBackground $tixOption(select_bg) $pri
option add *selectForeground $tixOption(select_fg) $pri
option add *selectBorderWidth 0 $pri
option add *Menu.selectColor $tixOption(foreground) $pri
option add *TixMenu.selectColor $tixOption(foreground) $pri
option add *Menubutton.padY 5 $pri
option add *Button.borderWidth 2 $pri
option add *Button.anchor c $pri
option add *Checkbutton.selectColor $tixOption(selector) $pri
option add *Radiobutton.selectColor $tixOption(selector) $pri
option add *Entry.relief sunken $pri
option add *Entry.highlightBackground $tixOption(background) $pri
option add *Entry.background $tixOption(textbackground) $pri
option add *Entry.foreground $tixOption(textforeground) $pri
option add *Entry.insertBackground $tixOption(textforeground) $pri
option add *Label.anchor w $pri
option add *Label.borderWidth 0 $pri
option add *Listbox.background $tixOption(textbackground) $pri
option add *Listbox.relief sunken $pri
option add *Scale.foreground $tixOption(foreground) $pri
option add *Scale.activeForeground $tixOption(background) $pri
option add *Scale.background $tixOption(background) $pri
option add *Scale.sliderForeground $tixOption(background) $pri
option add *Scale.sliderBackground $tixOption(light1_bg) $pri
option add *Scrollbar.relief sunken $pri
option add *Scrollbar.borderWidth $::wm_default::borderwidth $pri
option add *Scrollbar.width 15 $pri
option add *Text.background $tixOption(textbackground) $pri
option add *Text.relief sunken $pri
}
| {
"pile_set_name": "Github"
} |
;<?php exit() ?>
; SVN FILE: $Id$
;/**
; * Test App Ini Based Acl Config File
; *
; *
; * PHP 5
; *
; * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
; * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
; *
; * Licensed under The MIT License
; * Redistributions of files must retain the above copyright notice.
; *
; * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
; * @link http://cakephp.org CakePHP(tm) Project
; * @package Cake.Test.TestApp.Config
; * @since CakePHP(tm) v 0.10.0.1076
; * @license http://www.opensource.org/licenses/mit-license.php MIT License
; */
;-------------------------------------
;Users
;-------------------------------------
[admin]
groups = administrators
allow =
deny = ads
[paul]
groups = users
allow =
deny =
[jenny]
groups = users
allow = ads
deny = images, files
[nobody]
groups = anonymous
allow =
deny =
;-------------------------------------
;Groups
;-------------------------------------
[administrators]
deny =
allow = posts, comments, images, files, stats, ads
[users]
allow = posts, comments, images, files
deny = stats, ads
[anonymous]
allow =
deny = posts, comments, images, files, stats, ads
| {
"pile_set_name": "Github"
} |
package org.simple.clinic.registration.pin
import org.simple.clinic.user.OngoingRegistrationEntry
sealed class RegistrationPinEffect
data class ProceedToConfirmPin(val entry: OngoingRegistrationEntry): RegistrationPinEffect()
| {
"pile_set_name": "Github"
} |
#ifndef HEADER_CURL_POP3_H
#define HEADER_CURL_POP3_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2009 - 2015, Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
#include "pingpong.h"
#include "curl_sasl.h"
/****************************************************************************
* POP3 unique setup
***************************************************************************/
typedef enum {
POP3_STOP, /* do nothing state, stops the state machine */
POP3_SERVERGREET, /* waiting for the initial greeting immediately after
a connect */
POP3_CAPA,
POP3_STARTTLS,
POP3_UPGRADETLS, /* asynchronously upgrade the connection to SSL/TLS
(multi mode only) */
POP3_AUTH,
POP3_APOP,
POP3_USER,
POP3_PASS,
POP3_COMMAND,
POP3_QUIT,
POP3_LAST /* never used */
} pop3state;
/* This POP3 struct is used in the Curl_easy. All POP3 data that is
connection-oriented must be in pop3_conn to properly deal with the fact that
perhaps the Curl_easy is changed between the times the connection is
used. */
struct POP3 {
curl_pp_transfer transfer;
char *id; /* Message ID */
char *custom; /* Custom Request */
};
/* pop3_conn is used for struct connection-oriented data in the connectdata
struct */
struct pop3_conn {
struct pingpong pp;
pop3state state; /* Always use pop3.c:state() to change state! */
bool ssldone; /* Is connect() over SSL done? */
size_t eob; /* Number of bytes of the EOB (End Of Body) that
have been received so far */
size_t strip; /* Number of bytes from the start to ignore as
non-body */
struct SASL sasl; /* SASL-related storage */
unsigned int authtypes; /* Accepted authentication types */
unsigned int preftype; /* Preferred authentication type */
char *apoptimestamp; /* APOP timestamp from the server greeting */
bool tls_supported; /* StartTLS capability supported by server */
};
extern const struct Curl_handler Curl_handler_pop3;
extern const struct Curl_handler Curl_handler_pop3s;
/* Authentication type flags */
#define POP3_TYPE_CLEARTEXT (1 << 0)
#define POP3_TYPE_APOP (1 << 1)
#define POP3_TYPE_SASL (1 << 2)
/* Authentication type values */
#define POP3_TYPE_NONE 0
#define POP3_TYPE_ANY ~0U
/* This is the 5-bytes End-Of-Body marker for POP3 */
#define POP3_EOB "\x0d\x0a\x2e\x0d\x0a"
#define POP3_EOB_LEN 5
/* This function scans the body after the end-of-body and writes everything
* until the end is found */
CURLcode Curl_pop3_write(struct connectdata *conn, char *str, size_t nread);
#endif /* HEADER_CURL_POP3_H */
| {
"pile_set_name": "Github"
} |
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<shelfDocument>
<!-- This file contains definitions of shelves, toolbars, and tools.
It should not be hand-edited when it is being used by the application.
Note, that two definitions of the same element are not allowed in
a single file. -->
<tool name="$HDA_DEFAULT_TOOL" label="$HDA_LABEL" icon="$HDA_ICON">
<toolMenuContext name="viewer">
<contextNetType>SOP</contextNetType>
</toolMenuContext>
<toolMenuContext name="network">
<contextOpType>$HDA_TABLE_AND_NAME</contextOpType>
</toolMenuContext>
<toolSubmenu>GameDev/Export</toolSubmenu>
<script scriptType="python"><![CDATA[import soptoolutils
soptoolutils.genericTool(kwargs, '$HDA_NAME')]]></script>
</tool>
</shelfDocument>
| {
"pile_set_name": "Github"
} |
import { theme } from 'styled-tools';
import styled, { css } from '../styled';
import { Box } from '../primitives';
import { ColumnsProps } from './Columns';
export const getWrapProperties = (props: any) => {
const { isOneLine, minBreakpoint } = props;
if (isOneLine) {
if (minBreakpoint !== 'tablet' && minBreakpoint !== 'mobile') {
return css`
@media (max-width: ${theme('fannypack.layout.tabletBreakpoint')}px) {
flex-wrap: wrap;
}
`;
}
if (minBreakpoint !== 'mobile') {
return css`
@media (max-width: ${theme('fannypack.layout.mobileBreakpoint')}px) {
flex-wrap: wrap;
}
`;
}
return null;
} else {
return css`
flex-wrap: wrap;
`;
}
};
export const Columns = styled(Box)<ColumnsProps>`
display: flex;
${props =>
!props.isGapless &&
css`
margin-left: -${theme('fannypack.layout.gapFactor')}rem;
margin-right: -${theme('fannypack.layout.gapFactor')}rem;
margin-top: -${theme('fannypack.layout.gapFactor')}rem;
&:last-child {
margin-bottom: -${theme('fannypack.layout.gapFactor')}rem;
}
`};
${getWrapProperties};
& {
${theme('fannypack.Columns.base')};
}
`;
export default Columns;
| {
"pile_set_name": "Github"
} |
## DESCRIPTION
## Piedmont College
## MATH 1113 Online Test 3
## Function composition and inverses from graphs
## ENDDESCRIPTION
## DBsubject(Algebra)
## DBchapter(Inverse functions)
## DBsection(Finding the inverse function)
## Institution(Piedmont)
## Author(Doug Torrance)
## Level(2)
## MO(1)
## KEYWORDS('function composition', 'inverse functions')
DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"parserRadioButtons.pl",
"PGchoicemacros.pl",
"PGgraphmacros.pl",
);
TEXT(beginproblem());
sub lagrange_polynomial {
my ($xref, $yref) = @_;
my $f = sub {
my $x = shift;
my @xvals = @$xref;
my @yvals = @$yref;
my $result = 0;
my $n = scalar(@xvals);
for (my $j = 0; $j < $n; $j++) {
$term = 1;
for (my $i = 0; $i < $n; $i++) {
if ($i != $j) {
$term *= ($x - $xvals[$i]) /
($xvals[$j] - $xvals[$i]);
}
}
$result += $yvals[$j] * $term;
}
$result;
};
$f;
}
@x = [1, 2, 3, 4];
@y1 = map(random(1, 4), 1..4);
$step = random(-1, 1);
@y2 = map($_ + $step, 1..4);
if (random(0, 1) == 1) {
@y2 = reverse(@y2);
}
$rule1 = lagrange_polynomial(@x, ~~@y1);
$rule2 = lagrange_polynomial(@x, ~~@y2);
$gr = init_graph(-1,-1,5, 6,
axes=>[0,0],
grid=>[6, 7],
size=>[500, 500]
);
$fn1 = new Fun($rule1, $gr);
$fn2 = new Fun($rule2, $gr);
$fn2->color("red");
$a_x = random(1, 4);
$a_ans = &$rule2(&$rule1($a_x));
$a = RadioButtons([0, 1, 2, 3, 4, 5], $a_ans, noindex => 1);
$b_ans = random(0, 4);
$b_x = &$rule2($b_ans);
$b = RadioButtons([0, 1, 2, 3, 4, 5], $b_ans, noindex => 1);
BEGIN_TEXT
Suppose \(y=f(x)\) is the blue curve and \(y = g(x)\) the red line in the figure below.
$PAR
$BCENTER
\{image(insertGraph($gr), width=>500, height=>500)\}
$ECENTER
$PAR
(a) Find \((g\circ f)($a_x)\).
$BR
\{$a->buttons()\}
$PAR
(b) Find \(g^{-1}($b_x)\).
$BR
\{$b->buttons()\}
END_TEXT
ANS($a->cmp);
ANS($b->cmp);
ENDDOCUMENT(); | {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{018D47FA-82CD-4057-B3D2-5E21E48A3AF7}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>My03_01_DuplicationInArray</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="FindDuplication.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project> | {
"pile_set_name": "Github"
} |
// Copyright 2009 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 !gccgo
#include "textflag.h"
//
// System call support for AMD64, DragonFly
//
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.
TEXT ·Syscall(SB),NOSPLIT,$0-64
JMP syscall·Syscall(SB)
TEXT ·Syscall6(SB),NOSPLIT,$0-88
JMP syscall·Syscall6(SB)
TEXT ·Syscall9(SB),NOSPLIT,$0-112
JMP syscall·Syscall9(SB)
TEXT ·RawSyscall(SB),NOSPLIT,$0-64
JMP syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
JMP syscall·RawSyscall6(SB)
| {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of PHPExifTool.
*
* (c) 2012 Romain Neutron <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPExiftool\Driver\Tag\NikonCustom;
use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;
/**
* @ExclusionPolicy("all")
*/
class InitialZoomLiveView extends AbstractTag
{
protected $Id = '4.4';
protected $Name = 'InitialZoomLiveView';
protected $FullName = 'NikonCustom::SettingsD3';
protected $GroupName = 'NikonCustom';
protected $g0 = 'MakerNotes';
protected $g1 = 'NikonCustom';
protected $g2 = 'Camera';
protected $Type = 'int8u';
protected $Writable = true;
protected $Description = 'Initial Zoom Live View';
protected $flag_Permanent = true;
protected $Values = array(
0 => array(
'Id' => 0,
'Label' => 'Low Magnification',
),
16 => array(
'Id' => 16,
'Label' => 'Medium Magnification',
),
32 => array(
'Id' => 32,
'Label' => 'High Magnification',
),
);
}
| {
"pile_set_name": "Github"
} |
#include <AP_HAL/AP_HAL.h>
#if HAL_RCINPUT_WITH_AP_RADIO
#include "AP_Radio.h"
#include "AP_Radio_backend.h"
#include "AP_Radio_cypress.h"
#include "AP_Radio_cc2500.h"
#include "AP_Radio_bk2425.h"
extern const AP_HAL::HAL& hal;
// table of user settable parameters
const AP_Param::GroupInfo AP_Radio::var_info[] = {
// @Param: _TYPE
// @DisplayName: Set type of direct attached radio
// @Description: This enables support for direct attached radio receivers
// @Values: 0:None,1:CYRF6936,2:CC2500,3:BK2425
// @User: Advanced
AP_GROUPINFO("_TYPE", 1, AP_Radio, radio_type, 0),
// @Param: _PROT
// @DisplayName: protocol
// @Description: Select air protocol
// @Values: 0:Auto,1:DSM2,2:DSMX
// @User: Advanced
AP_GROUPINFO("_PROT", 2, AP_Radio, protocol, PROTOCOL_AUTO),
// @Param: _DEBUG
// @DisplayName: debug level
// @Description: radio debug level
// @Range: 0 4
// @User: Advanced
AP_GROUPINFO("_DEBUG", 3, AP_Radio, debug_level, 0),
// @Param: _DISCRC
// @DisplayName: disable receive CRC
// @Description: disable receive CRC (for debug)
// @Values: 0:NotDisabled,1:Disabled
// @User: Advanced
AP_GROUPINFO("_DISCRC", 4, AP_Radio, disable_crc, 0),
// @Param: _SIGCH
// @DisplayName: RSSI signal strength
// @Description: Channel to show receive RSSI signal strength, or zero for disabled
// @Range: 0 16
// @User: Advanced
AP_GROUPINFO("_SIGCH", 5, AP_Radio, rssi_chan, 0),
// @Param: _PPSCH
// @DisplayName: Packet rate channel
// @Description: Channel to show received packet-per-second rate, or zero for disabled
// @Range: 0 16
// @User: Advanced
AP_GROUPINFO("_PPSCH", 6, AP_Radio, pps_chan, 0),
// @Param: _TELEM
// @DisplayName: Enable telemetry
// @Description: If this is non-zero then telemetry packets will be sent over DSM
// @Values: 0:Disabled,1:Enabled
// @User: Advanced
AP_GROUPINFO("_TELEM", 7, AP_Radio, telem_enable, 0),
// @Param: _TXPOW
// @DisplayName: Telemetry Transmit power
// @Description: Set telemetry transmit power. This is the power level (from 1 to 8) for telemetry packets sent from the RX to the TX
// @Range: 1 8
// @User: Advanced
AP_GROUPINFO("_TXPOW", 8, AP_Radio, transmit_power, 8),
// @Param: _FCCTST
// @DisplayName: Put radio into FCC test mode
// @Description: If this is enabled then the radio will continuously transmit as required for FCC testing. The transmit channel is set by the value of the parameter. The radio will not work for RC input while this is enabled
// @Values: 0:Disabled,1:MinChannel,2:MidChannel,3:MaxChannel,4:MinChannelCW,5:MidChannelCW,6:MaxChannelCW
// @User: Advanced
AP_GROUPINFO("_FCCTST", 9, AP_Radio, fcc_test, 0),
// @Param: _STKMD
// @DisplayName: Stick input mode
// @Description: This selects between different stick input modes. The default is mode2, which has throttle on the left stick and pitch on the right stick. You can instead set mode1, which has throttle on the right stick and pitch on the left stick.
// @Values: 1:Mode1,2:Mode2
// @User: Advanced
AP_GROUPINFO("_STKMD", 10, AP_Radio, stick_mode, 2),
// @Param: _TESTCH
// @DisplayName: Set radio to factory test channel
// @Description: This sets the radio to a fixed test channel for factory testing. Using a fixed channel avoids the need for binding in factory testing.
// @Values: 0:Disabled,1:TestChan1,2:TestChan2,3:TestChan3,4:TestChan4,5:TestChan5,6:TestChan6,7:TestChan7,8:TestChan8
// @User: Advanced
AP_GROUPINFO("_TESTCH", 11, AP_Radio, factory_test, 0),
// @Param: _TSIGCH
// @DisplayName: RSSI value channel for telemetry data on transmitter
// @Description: Channel to show telemetry RSSI value as received by TX
// @Range: 0 16
// @User: Advanced
AP_GROUPINFO("_TSIGCH", 12, AP_Radio, tx_rssi_chan, 0),
// @Param: _TPPSCH
// @DisplayName: Telemetry PPS channel
// @Description: Channel to show telemetry packets-per-second value, as received at TX
// @Range: 0 16
// @User: Advanced
AP_GROUPINFO("_TPPSCH", 13, AP_Radio, tx_pps_chan, 0),
// @Param: _TXMAX
// @DisplayName: Transmitter transmit power
// @Description: Set transmitter maximum transmit power (from 1 to 8)
// @Range: 1 8
// @User: Advanced
AP_GROUPINFO("_TXMAX", 14, AP_Radio, tx_max_power, 8),
// @Param: _BZOFS
// @DisplayName: Transmitter buzzer adjustment
// @Description: Set transmitter buzzer note adjustment (adjust frequency up)
// @Range: 0 40
// @User: Advanced
AP_GROUPINFO("_BZOFS", 15, AP_Radio, tx_buzzer_adjust, 25),
// @Param: _ABTIME
// @DisplayName: Auto-bind time
// @Description: When non-zero this sets the time with no transmitter packets before we start looking for auto-bind packets.
// @Range: 0 120
// @User: Advanced
AP_GROUPINFO("_ABTIME", 16, AP_Radio, auto_bind_time, 0),
// @Param: _ABLVL
// @DisplayName: Auto-bind level
// @Description: This sets the minimum RSSI of an auto-bind packet for it to be accepted. This should be set so that auto-bind will only happen at short range to minimise the change of an auto-bind happening accidentially
// @Range: 0 31
// @User: Advanced
AP_GROUPINFO("_ABLVL", 17, AP_Radio, auto_bind_rssi, 0),
AP_GROUPEND
};
AP_Radio *AP_Radio::_singleton;
// constructor
AP_Radio::AP_Radio(void)
{
AP_Param::setup_object_defaults(this, var_info);
if (_singleton != nullptr) {
AP_HAL::panic("Multiple AP_Radio declarations");
}
_singleton = this;
}
bool AP_Radio::init(void)
{
switch (radio_type) {
#if (not defined AP_RADIO_CYRF6936 || AP_RADIO_CYRF6936)
case RADIO_TYPE_CYRF6936:
driver = new AP_Radio_cypress(*this);
break;
#endif
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
#if (not defined AP_RADIO_CC2500 || AP_RADIO_CC2500)
case RADIO_TYPE_CC2500:
driver = new AP_Radio_cc2500(*this);
break;
#endif
#endif
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_SKYVIPER_F412
#if (not defined AP_RADIO_BK2425 || AP_RADIO_BK2425)
case RADIO_TYPE_BK2425:
driver = new AP_Radio_beken(*this);
break;
#endif
#endif
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_SKYVIPER_F412
case RADIO_TYPE_AUTO:
// auto-detect between cc2500 and beken radios
#if (not defined AP_RADIO_CC2500 || AP_RADIO_CC2500)
if (AP_Radio_cc2500::probe()) {
driver = new AP_Radio_cc2500(*this);
}
#endif
#if (not defined AP_RADIO_BK2425 || AP_RADIO_BK2425)
if (driver == nullptr) {
driver = new AP_Radio_beken(*this);
}
#endif
break;
#endif
default:
break;
}
if (!driver) {
return false;
}
return driver->init();
}
bool AP_Radio::reset(void)
{
if (!driver) {
return false;
}
return driver->reset();
}
bool AP_Radio::send(const uint8_t *pkt, uint16_t len)
{
if (!driver) {
return false;
}
return driver->send(pkt, len);
}
void AP_Radio::start_recv_bind(void)
{
if (!driver) {
return;
}
return driver->start_recv_bind();
}
const AP_Radio::stats &AP_Radio::get_stats(void)
{
return driver->get_stats();
}
uint8_t AP_Radio::num_channels(void)
{
if (!driver) {
return 0;
}
return driver->num_channels();
}
uint16_t AP_Radio::read(uint8_t chan)
{
if (!driver) {
return 0;
}
return driver->read(chan);
}
uint32_t AP_Radio::last_recv_us(void)
{
if (!driver) {
return 0;
}
return driver->last_recv_us();
}
// handle a data96 mavlink packet for fw upload
void AP_Radio::handle_data_packet(mavlink_channel_t chan, const mavlink_data96_t &m)
{
if (driver) {
driver->handle_data_packet(chan, m);
}
}
// play a tune on the TX
void AP_Radio::play_tune(const char *tune_str)
{
mavlink_data96_t pkt {};
uint8_t len = MIN(strlen(tune_str), 92);
pkt.len = len;
pkt.type = 43;
memcpy(&pkt.data[0], tune_str, len);
handle_data_packet(MAVLINK_COMM_0, pkt);
}
// update status, should be called from main thread
void AP_Radio::update(void)
{
if (driver) {
driver->update();
}
}
// get transmitter firmware version
uint32_t AP_Radio::get_tx_version(void)
{
if (driver) {
return driver->get_tx_version();
}
return 0;
}
// set the 2.4GHz wifi channel used by companion computer, so it can be avoided
void AP_Radio::set_wifi_channel(uint8_t channel)
{
if (driver) {
driver->set_wifi_channel(channel);
}
}
// change TX mode, toggling between mode1 and mode2
void AP_Radio::change_txmode(void)
{
if (stick_mode == 2) {
stick_mode.set_and_save_ifchanged(1);
} else {
stick_mode.set_and_save_ifchanged(2);
}
}
#endif // HAL_RCINPUT_WITH_AP_RADIO
| {
"pile_set_name": "Github"
} |
package org.intermine.bio.dataconversion;
/*
* Copyright (C) 2002-2020 FlyMine
*
* This code may be freely distributed and modified under the
* terms of the GNU Lesser General Public Licence. This should
* be distributed with the code. See the LICENSE file for more
* information or http://www.gnu.org/copyleft/lesser.html.
*
*/
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.apache.tools.ant.BuildException;
import org.intermine.metadata.TypeUtil;
import org.intermine.model.InterMineObject;
import org.intermine.model.bio.Chromosome;
import org.intermine.model.bio.DataSet;
import org.intermine.model.bio.DataSource;
import org.intermine.model.bio.Location;
import org.intermine.model.bio.Organism;
import org.intermine.model.bio.SequenceAlteration;
import org.intermine.objectstore.ObjectStoreException;
import org.intermine.objectstore.ObjectStoreWriter;
import org.intermine.objectstore.proxy.ProxyReference;
import org.intermine.task.FileDirectDataLoaderTask;
import org.intermine.util.FormattedTextParser;
/**
* Loader for VCF files
*
* @author Julie Sullivan
*/
public class VcfLoaderTask extends FileDirectDataLoaderTask
{
private String dataSetName = null;
private String dataSourceName = null;
private String taxonId = null;
private Organism org = null;
private DataSet dataset = null;
private DataSource datasource = null;
private Map<String, ProxyReference> chromosomes = new HashMap<String, ProxyReference>();
//Set this if we want to do some testing...
private File[] files = null;
private static final String NAMESPACE = "org.intermine.model.bio";
/**
* Sets the taxon ID for features in this file.
*
* @param vcfTaxonId a single taxon Id
*/
public void setVcfTaxonId(String vcfTaxonId) {
taxonId = vcfTaxonId;
}
/**
* Sets the data source, e.g. Ensembl
*
* @param dataSourceName Name of data source (organisation)
*/
public void setVcfDataSourceName(String dataSourceName) {
this.dataSourceName = dataSourceName;
}
/**
* Sets the data set, e.g. "Ensembl SNP data set"
*
* @param dataSetName name of data set being loaded
*/
public void setVcfDataSetName(String dataSetName) {
this.dataSetName = dataSetName;
}
/**
* Process and load the SNP file.
*/
@Override
public void process() {
try {
ObjectStoreWriter osw = getIntegrationWriter();
if (!osw.isInTransaction()) {
osw.beginTransaction();
}
super.process();
if (!osw.isInTransaction()) {
osw.commitTransaction();
}
getDirectDataLoader().close();
} catch (ObjectStoreException e) {
throw new BuildException("failed to store object", e);
}
}
@Override
public void execute() {
// don't configure dynamic attributes if this is a unit test!
if (getProject() != null) {
configureDynamicAttributes(this);
}
if (files != null) {
// setFiles() is used only for testing
for (int i = 0; i < files.length; i++) {
processFile(files[i]);
}
try {
getDirectDataLoader().close();
} catch (ObjectStoreException e) {
throw new BuildException("Failed closing DirectDataLoader", e);
}
} else {
// this will call processFile() for each file
super.execute();
}
}
/**
*
* {@inheritDoc}
*/
public void processFile(File file) {
FileReader fileReader;
try {
fileReader = new FileReader(file);
BufferedReader reader = new BufferedReader(fileReader);
Iterator lineIter = FormattedTextParser.parseTabDelimitedReader(reader);
while (lineIter.hasNext()) {
String[] line = (String[]) lineIter.next();
processRecord(line);
}
} catch (FileNotFoundException e) {
throw new BuildException("problem reading file - file not found: " + file, e);
} catch (IOException e) {
throw new BuildException("error while closing FileReader for: " + file, e);
} catch (ObjectStoreException e) {
throw new BuildException("error while creating objects: " + file, e);
}
}
private void processRecord(String[] line)
throws ObjectStoreException {
String chromosomeIdentifier = line[0];
ProxyReference chromosome = getChromosome(chromosomeIdentifier);
String start = line[1];
String identifier = line[2];
String referenceSeq = line[3];
String variantSeq = line[4];
// String qual = line[5];
// String filter = line[6];
String info = line[7];
// create SNV by default?
String type = "SequenceAlteration";
// dbSNP_138;TSA=insertion
String[] infoColumn = info.split(";");
// TSA=insertion
if (infoColumn != null && infoColumn.length > 1 && StringUtils.isNotEmpty(infoColumn[1])) {
String[] tsaString = infoColumn[1].split("=");
if (infoColumn != null && infoColumn.length > 1
&& StringUtils.isNotEmpty(infoColumn[1])) {
type = tsaString[1];
}
}
String className = TypeUtil.generateClassName(NAMESPACE, type);
Class<? extends InterMineObject> imClass;
Class<?> c;
try {
c = Class.forName(className);
if (InterMineObject.class.isAssignableFrom(c)) {
imClass = (Class<? extends InterMineObject>) c;
} else {
throw new RuntimeException("Feature className must be a valid class in the "
+ "model that inherits from InterMineObject, but was: " + className);
}
} catch (ClassNotFoundException e1) {
throw new BuildException("unknown class: " + className
+ " while creating new SequenceAlteration object");
}
SequenceAlteration snp
= (SequenceAlteration) getDirectDataLoader().createObject(imClass);
if (identifier != null) {
snp.setPrimaryIdentifier(identifier);
}
if (variantSeq != null) {
snp.setVariantSequence(variantSeq);
}
if (referenceSeq != null) {
snp.setReferenceSequence(referenceSeq);
}
snp.setType(type);
snp.setLength(1);
snp.proxyChromosome(chromosome);
setLocation(snp, start, chromosome);
snp.setOrganism(getOrganism());
getDirectDataLoader().store(snp);
}
private ProxyReference getChromosome(String identifier) throws ObjectStoreException {
ProxyReference chromosomeRef = chromosomes.get(identifier);
if (chromosomeRef == null) {
Chromosome chromosome = getDirectDataLoader().createObject(
org.intermine.model.bio.Chromosome.class);
chromosome.setPrimaryIdentifier(identifier);
chromosome.setOrganism(getOrganism());
getDirectDataLoader().store(chromosome);
chromosomeRef = new ProxyReference(getIntegrationWriter().getObjectStore(),
chromosome.getId(), Chromosome.class);
chromosomes.put(identifier, chromosomeRef);
}
return chromosomeRef;
}
private Location setLocation(SequenceAlteration snp, String pos, ProxyReference chromosomeRef)
throws ObjectStoreException {
// SNPs are always size = 1
final int length = 1;
Location location = getDirectDataLoader().createObject(
org.intermine.model.bio.Location.class);
int start = new Integer(pos);
int end = start + length;
if (start < end) {
location.setStart(start);
location.setEnd(end);
} else {
location.setStart(end);
location.setEnd(start);
}
location.setStrand("0");
location.proxyLocatedOn(chromosomeRef);
location.setFeature(snp);
getDirectDataLoader().store(location);
return location;
}
/**
* Get and store() the Organism object to reference when creating new objects.
* @throws ObjectStoreException if there is a problem
* @return the new Organism
*/
protected Organism getOrganism() throws ObjectStoreException {
if (org == null) {
org = getDirectDataLoader().createObject(Organism.class);
if (taxonId == null) {
throw new RuntimeException("Taxon ID not found. Please set a valid taxon Id"
+ " in your project XML file");
}
org.setTaxonId(taxonId);
getDirectDataLoader().store(org);
}
return org;
}
/**
* Get and store() the DataSet object to reference when creating new objects.
* @throws ObjectStoreException if there is a problem
* @return the new DataSet
*/
protected DataSet getDataSet() throws ObjectStoreException {
if (dataset == null) {
dataset = getDirectDataLoader().createObject(DataSet.class);
dataset.setName(dataSetName);
dataset.setDataSource(getDataSource());
getDirectDataLoader().store(dataset);
}
return dataset;
}
/**
* Get and store() the DataSource object to reference when creating new objects.
* @throws ObjectStoreException if there is a problem
* @return the new DataSource
*/
protected DataSource getDataSource() throws ObjectStoreException {
if (datasource == null) {
datasource = getDirectDataLoader().createObject(DataSource.class);
datasource.setName(dataSourceName);
getDirectDataLoader().store(datasource);
}
return datasource;
}
/**
* Directly set the array of files to read from. Use this for testing with junit.
* @param files the File objects
*/
protected void setFileArray(File[] files) {
this.files = files;
}
}
| {
"pile_set_name": "Github"
} |
#
# (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, [email protected].
#
# Copyright (C) 2007 Sergey Kubushyn <[email protected]>
#
# See file CREDITS for list of people who contributed to this
# project.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(SOC).o
COBJS-y += cpu.o misc.o timer.o psc.o pinmux.o
COBJS-$(CONFIG_DA850_LOWLEVEL) += da850_lowlevel.o
COBJS-$(CONFIG_SOC_DM355) += dm355.o
COBJS-$(CONFIG_SOC_DM365) += dm365.o
COBJS-$(CONFIG_SOC_DM644X) += dm644x.o
COBJS-$(CONFIG_SOC_DM646X) += dm646x.o
COBJS-$(CONFIG_SOC_DA850) += da850_pinmux.o
COBJS-$(CONFIG_DRIVER_TI_EMAC) += lxt972.o dp83848.o et1011c.o ksz8873.o
ifdef CONFIG_SPL_BUILD
COBJS-y += spl.o
COBJS-$(CONFIG_SOC_DM365) += dm365_lowlevel.o
COBJS-$(CONFIG_SOC_DA8XX) += da850_lowlevel.o
endif
SOBJS = reset.o
ifndef CONFIG_SKIP_LOWLEVEL_INIT
SOBJS += lowlevel_init.o
endif
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS-y) $(SOBJS))
START := $(addprefix $(obj),$(START))
all: $(obj).depend $(LIB)
$(LIB): $(OBJS)
$(call cmd_link_o_target, $(OBJS))
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################
| {
"pile_set_name": "Github"
} |
## Unreleased
## v2.3.0
- [New] expose createDynamicImportTransform and getImportSource (#75)
- [Docs] Document noInterop option (#70)
## v2.2.0
- [Refactor] remove dependency on babel-plugin-syntax-dynamic-import
- [Dev Deps] update `airbnb-js-shims`, `babel-preset-airbnb`, `eslint`
## v2.1.0
- [New] add `noInterop` option (#57)
- [Docs] Fix typo "correct" -> "correctly" in readme (#55)
- [Dev Deps] update `airbnb-js-shims`, `babel-eslint`, `babel-preset-airbnb`, `eslint`, `eslint-config-airbnb-base`, `eslint-plugin-import`, `safe-publish-latest`
## v2.0.0
- [Breaking] always return a module namespace object (#52, #47)
- [Breaking] remove `.default` on entry points (#27)
- [Docs] removed $ before npm command (#35)
- [Docs] Improve README.md with a code example (#41)
- [Dev Deps] update `airbnb-js-shims`, `babel-core`, `babel-eslint`, `eslint`, `eslint-plugin-import`
- [Tests] switch from mocha to tape, so we can support older nodes
## v1.2.0
- [New] support comments (#37)
- [Refactor] Use template and types from the babel object (#32)
- [Tests] on `node` `v9`; pin included builds to LTS
- [Dev Deps] update `eslint`, `eslint-config-airbnb-base`, `mocha`, `rimraf`
## v1.1.0
- Visit Import nodes instead of CallExpressions (#30)
- [Deps] update `babel-template`, `babel-types`
- [Dev Deps] update `airbnb-js-shims`, `babel-cli`, `babel-core`, `babel-preset-airbnb`, `babel-register`, `chai`, `eslint`, `eslint-config-airbnb-base`, `eslint-plugin-import`, `mocha`
- [Tests] on `node` `v8`
- [Tests] use `nvm install-latest-npm` so newer npm doesn’t break older node
## v1.0.2
- [Fix] Ensure it works with the ES2015 preset too (#12, #16)
- [Deps] update `babel-template`, `babel-types`
- [Dev Deps] update `babel-cli`, `babel-core`, `babel-eslint`, `babel-register`, `eslint`, `eslint-config-airbnb-base`, `mocha`
## v1.0.1
- [Fix] Move `in-publish` to devDeps (#11)
- [Fix] ensure dynamic `import()` input is properly stringified (#2)
- [Fix] async timing of dynamic import to match spec (#3)
- [Fix] Remove spaces in template strings and update Babel (#10)
- [Deps] update `babel-template`, `babel-types`
- [Deps] update `babel-types` (#4, #5, #6)
- [Dev Deps] update `babel-cli`, `babel-core`, `babel-eslint`, `babel-register`, `eslint`, `eslint-config-airbnb-base`, `eslint-plugin-import`, `mocha`, `rimraf`
## v1.0.0
- Initial full release.
| {
"pile_set_name": "Github"
} |
package io.getquill
import akka.stream.scaladsl.Source
import akka.{ Done, NotUsed }
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraSession
import io.getquill.util.ContextLogger
import scala.concurrent.ExecutionContext
class CassandraLagomStreamContext[N <: NamingStrategy](
naming: N,
session: CassandraSession
)
extends CassandraLagomSessionContext[N](naming, session) {
override type Result[T] = Source[T, NotUsed]
override type RunQuerySingleResult[T] = T
override type RunQueryResult[T] = T
override type RunActionResult = Done
override type RunBatchActionResult = Done
private val logger = ContextLogger(this.getClass)
def executeQuery[T](cql: String, prepare: Prepare = identityPrepare, extractor: Extractor[T] = identityExtractor)(implicit executionContext: ExecutionContext): Result[RunQueryResult[T]] = {
val statement = prepareAsyncAndGetStatement(cql, prepare, logger)
val resultSource = statement.map(st => session.select(st).map(extractor))
Source.fromFutureSource(resultSource)
.mapMaterializedValue(_ => NotUsed)
}
def executeQuerySingle[T](cql: String, prepare: Prepare = identityPrepare, extractor: Extractor[T] = identityExtractor)(implicit executionContext: ExecutionContext): Result[RunQuerySingleResult[T]] = {
executeQuery(cql, prepare, extractor).take(1)
}
def executeAction[T](cql: String, prepare: Prepare = identityPrepare)(implicit executionContext: ExecutionContext): Result[RunActionResult] = {
val statement = prepareAsyncAndGetStatement(cql, prepare, logger)
Source.fromFuture(statement).mapAsync(1) { st =>
session.executeWrite(st)
}
}
def executeBatchAction(groups: List[BatchGroup])(implicit executionContext: ExecutionContext): Result[RunBatchActionResult] = {
val sourceList = groups.flatMap {
case BatchGroup(cql, prepares) =>
prepares.map(executeAction(cql, _))
}
Source(sourceList).flatMapConcat(identity)
}
}
| {
"pile_set_name": "Github"
} |
.panel {
overflow: hidden;
text-align: left;
}
.panel-header,
.panel-body {
border-width: 1px;
border-style: solid;
}
.panel-header {
padding: 5px;
position: relative;
}
.panel-title {
background: url('images/blank.gif') no-repeat;
}
.panel-header-noborder {
border-width: 0 0 1px 0;
}
.panel-body {
overflow: auto;
border-top-width: 0px;
}
.panel-body-noheader {
border-top-width: 1px;
}
.panel-body-noborder {
border-width: 0px;
}
.panel-with-icon {
padding-left: 18px;
}
.panel-icon,
.panel-tool {
position: absolute;
top: 50%;
margin-top: -8px;
height: 16px;
overflow: hidden;
}
.panel-icon {
left: 5px;
width: 16px;
}
.panel-tool {
right: 5px;
width: auto;
}
.panel-tool a {
display: inline-block;
width: 16px;
height: 16px;
opacity: 0.6;
filter: alpha(opacity=60);
margin: 0 0 0 2px;
vertical-align: top;
}
.panel-tool a:hover {
opacity: 1;
filter: alpha(opacity=100);
background-color: #e6e6e6;
-moz-border-radius: 3px 3px 3px 3px;
-webkit-border-radius: 3px 3px 3px 3px;
border-radius: 3px 3px 3px 3px;
}
.panel-loading {
padding: 11px 0px 10px 30px;
}
.panel-noscroll {
overflow: hidden;
}
.panel-fit,
.panel-fit body {
height: 100%;
margin: 0;
padding: 0;
border: 0;
overflow: hidden;
}
.panel-loading {
background: url('images/loading.gif') no-repeat 10px 10px;
}
.panel-tool-close {
background: url('images/panel_tools.png') no-repeat -16px 0px;
}
.panel-tool-min {
background: url('images/panel_tools.png') no-repeat 0px 0px;
}
.panel-tool-max {
background: url('images/panel_tools.png') no-repeat 0px -16px;
}
.panel-tool-restore {
background: url('images/panel_tools.png') no-repeat -16px -16px;
}
.panel-tool-collapse {
background: url('images/panel_tools.png') no-repeat -32px 0;
}
.panel-tool-expand {
background: url('images/panel_tools.png') no-repeat -32px -16px;
}
.panel-header,
.panel-body {
border-color: #D4D4D4;
}
.panel-header {
background-color: #F2F2F2;
background: -webkit-linear-gradient(top, #ffffff 0, #F2F2F2 100%);
background: -moz-linear-gradient(top, #ffffff 0, #F2F2F2 100%);
background: -o-linear-gradient(top, #ffffff 0, #F2F2F2 100%);
background: linear-gradient(to bottom, #ffffff 0, #F2F2F2 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#F2F2F2, GradientType=0);
}
.panel-body {
background-color: #ffffff;
color: #333;
font-size: 12px;
}
.panel-title {
font-size: 12px;
font-weight: bold;
color: #777;
height: 16px;
line-height: 16px;
}
.accordion {
overflow: hidden;
border-width: 1px;
border-style: solid;
}
.accordion .accordion-header {
border-width: 0 0 1px;
cursor: pointer;
}
.accordion .accordion-body {
border-width: 0 0 1px;
}
.accordion-noborder {
border-width: 0;
}
.accordion-noborder .accordion-header {
border-width: 0 0 1px;
}
.accordion-noborder .accordion-body {
border-width: 0 0 1px;
}
.accordion-collapse {
background: url('images/accordion_arrows.png') no-repeat 0 0;
}
.accordion-expand {
background: url('images/accordion_arrows.png') no-repeat -16px 0;
}
.accordion {
background: #ffffff;
border-color: #D4D4D4;
}
.accordion .accordion-header {
background: #F2F2F2;
filter: none;
}
.accordion .accordion-header-selected {
background: #0081c2;
}
.accordion .accordion-header-selected .panel-title {
color: #fff;
}
.window {
overflow: hidden;
padding: 5px;
border-width: 1px;
border-style: solid;
}
.window .window-header {
background: transparent;
padding: 0px 0px 6px 0px;
}
.window .window-body {
border-width: 1px;
border-style: solid;
border-top-width: 0px;
}
.window .window-body-noheader {
border-top-width: 1px;
}
.window .window-header .panel-icon,
.window .window-header .panel-tool {
top: 50%;
margin-top: -11px;
}
.window .window-header .panel-icon {
left: 1px;
}
.window .window-header .panel-tool {
right: 1px;
}
.window .window-header .panel-with-icon {
padding-left: 18px;
}
.window-proxy {
position: absolute;
overflow: hidden;
}
.window-proxy-mask {
position: absolute;
filter: alpha(opacity=5);
opacity: 0.05;
}
.window-mask {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
filter: alpha(opacity=40);
opacity: 0.40;
font-size: 1px;
*zoom: 1;
overflow: hidden;
}
.window,
.window-shadow {
position: absolute;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
.window-shadow {
background: #ccc;
-moz-box-shadow: 2px 2px 3px #cccccc;
-webkit-box-shadow: 2px 2px 3px #cccccc;
box-shadow: 2px 2px 3px #cccccc;
filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2, MakeShadow=false, ShadowOpacity=0.2);
}
.window,
.window .window-body {
border-color: #D4D4D4;
}
.window {
background-color: #F2F2F2;
background: -webkit-linear-gradient(top, #ffffff 0, #F2F2F2 20%);
background: -moz-linear-gradient(top, #ffffff 0, #F2F2F2 20%);
background: -o-linear-gradient(top, #ffffff 0, #F2F2F2 20%);
background: linear-gradient(to bottom, #ffffff 0, #F2F2F2 20%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#F2F2F2, GradientType=0);
}
.window-proxy {
border: 1px dashed #D4D4D4;
}
.window-proxy-mask,
.window-mask {
background: #ccc;
}
.dialog-content {
overflow: auto;
}
.dialog-toolbar {
padding: 2px 5px;
}
.dialog-tool-separator {
float: left;
height: 24px;
border-left: 1px solid #ccc;
border-right: 1px solid #fff;
margin: 2px 1px;
}
.dialog-button {
padding: 5px;
text-align: right;
}
.dialog-button .l-btn {
margin-left: 5px;
}
.dialog-toolbar,
.dialog-button {
background: #F5F5F5;
}
.dialog-toolbar {
border-bottom: 1px solid #e6e6e6;
}
.dialog-button {
border-top: 1px solid #e6e6e6;
}
.combo {
display: inline-block;
white-space: nowrap;
margin: 0;
padding: 0;
border-width: 1px;
border-style: solid;
overflow: hidden;
vertical-align: middle;
}
.combo .combo-text {
font-size: 12px;
border: 0px;
line-height: 20px;
height: 20px;
margin: 0;
padding: 0px 2px;
*margin-top: -1px;
*height: 18px;
*line-height: 18px;
_height: 18px;
_line-height: 18px;
vertical-align: baseline;
}
.combo-arrow {
width: 18px;
height: 20px;
overflow: hidden;
display: inline-block;
vertical-align: top;
cursor: pointer;
opacity: 0.6;
filter: alpha(opacity=60);
}
.combo-arrow-hover {
opacity: 1.0;
filter: alpha(opacity=100);
}
.combo-panel {
overflow: auto;
}
.combo-arrow {
background: url('images/combo_arrow.png') no-repeat center center;
}
.combo,
.combo-panel {
background-color: #ffffff;
}
.combo {
border-color: #D4D4D4;
background-color: #ffffff;
}
.combo-arrow {
background-color: #F2F2F2;
}
.combo-arrow-hover {
background-color: #e6e6e6;
}
.combobox-item {
padding: 2px;
font-size: 12px;
padding: 3px;
padding-right: 0px;
}
.combobox-item-hover {
background-color: #e6e6e6;
color: #00438a;
}
.combobox-item-selected {
background-color: #0081c2;
color: #fff;
}
.layout {
position: relative;
overflow: hidden;
margin: 0;
padding: 0;
z-index: 0;
}
.layout-panel {
position: absolute;
overflow: hidden;
}
.layout-panel-east,
.layout-panel-west {
z-index: 2;
}
.layout-panel-north,
.layout-panel-south {
z-index: 3;
}
.layout-expand {
position: absolute;
padding: 0px;
font-size: 1px;
cursor: pointer;
z-index: 1;
}
.layout-expand .panel-header,
.layout-expand .panel-body {
background: transparent;
filter: none;
overflow: hidden;
}
.layout-expand .panel-header {
border-bottom-width: 0px;
}
.layout-split-proxy-h,
.layout-split-proxy-v {
position: absolute;
font-size: 1px;
display: none;
z-index: 5;
}
.layout-split-proxy-h {
width: 5px;
cursor: e-resize;
}
.layout-split-proxy-v {
height: 5px;
cursor: n-resize;
}
.layout-mask {
position: absolute;
background: #fafafa;
filter: alpha(opacity=10);
opacity: 0.10;
z-index: 4;
}
.layout-button-up {
background: url('images/layout_arrows.png') no-repeat -16px -16px;
}
.layout-button-down {
background: url('images/layout_arrows.png') no-repeat -16px 0;
}
.layout-button-left {
background: url('images/layout_arrows.png') no-repeat 0 0;
}
.layout-button-right {
background: url('images/layout_arrows.png') no-repeat 0 -16px;
}
.layout-split-proxy-h,
.layout-split-proxy-v {
background-color: #bbb;
}
.layout-split-north {
border-bottom: 5px solid #eee;
}
.layout-split-south {
border-top: 5px solid #eee;
}
.layout-split-east {
border-left: 5px solid #eee;
}
.layout-split-west {
border-right: 5px solid #eee;
}
.layout-expand {
background-color: #F2F2F2;
}
.layout-expand-over {
background-color: #F2F2F2;
}
.tabs-container {
overflow: hidden;
}
.tabs-header {
border-width: 1px;
border-style: solid;
border-bottom-width: 0;
position: relative;
padding: 0;
padding-top: 2px;
overflow: hidden;
}
.tabs-header-plain {
border: 0;
background: transparent;
}
.tabs-scroller-left,
.tabs-scroller-right {
position: absolute;
top: auto;
bottom: 0;
width: 18px;
height: 28px !important;
height: 30px;
font-size: 1px;
display: none;
cursor: pointer;
border-width: 1px;
border-style: solid;
}
.tabs-scroller-left {
left: 0;
}
.tabs-scroller-right {
right: 0;
}
.tabs-header-plain .tabs-scroller-left,
.tabs-header-plain .tabs-scroller-right {
height: 25px !important;
height: 27px;
}
.tabs-tool {
position: absolute;
bottom: 0;
padding: 1px;
overflow: hidden;
border-width: 1px;
border-style: solid;
}
.tabs-header-plain .tabs-tool {
padding: 0 1px;
}
.tabs-wrap {
position: relative;
left: 0;
overflow: hidden;
width: 100%;
margin: 0;
padding: 0;
}
.tabs-scrolling {
margin-left: 18px;
margin-right: 18px;
}
.tabs-disabled {
opacity: 0.3;
filter: alpha(opacity=30);
}
.tabs {
list-style-type: none;
height: 26px;
margin: 0px;
padding: 0px;
padding-left: 4px;
width: 5000px;
border-style: solid;
border-width: 0 0 1px 0;
}
.tabs li {
float: left;
display: inline-block;
margin: 0 4px -1px 0;
padding: 0;
position: relative;
border: 0;
}
.tabs li a.tabs-inner {
display: inline-block;
text-decoration: none;
margin: 0;
padding: 0 10px;
height: 25px;
line-height: 25px;
text-align: center;
white-space: nowrap;
border-width: 1px;
border-style: solid;
-moz-border-radius: 5px 5px 0 0;
-webkit-border-radius: 5px 5px 0 0;
border-radius: 5px 5px 0 0;
}
.tabs li.tabs-selected a.tabs-inner {
font-weight: bold;
outline: none;
}
.tabs li.tabs-selected a:hover.tabs-inner {
cursor: default;
pointer: default;
}
.tabs li a.tabs-close,
.tabs-p-tool {
position: absolute;
font-size: 1px;
display: block;
height: 12px;
padding: 0;
top: 50%;
margin-top: -6px;
overflow: hidden;
}
.tabs li a.tabs-close {
width: 12px;
right: 5px;
opacity: 0.6;
filter: alpha(opacity=60);
}
.tabs-p-tool {
right: 16px;
}
.tabs-p-tool a {
display: inline-block;
font-size: 1px;
width: 12px;
height: 12px;
margin: 0;
opacity: 0.6;
filter: alpha(opacity=60);
}
.tabs li a:hover.tabs-close,
.tabs-p-tool a:hover {
opacity: 1;
filter: alpha(opacity=100);
cursor: hand;
cursor: pointer;
}
.tabs-with-icon {
padding-left: 18px;
}
.tabs-icon {
position: absolute;
width: 16px;
height: 16px;
left: 10px;
top: 50%;
margin-top: -8px;
}
.tabs-title {
font-size: 12px;
}
.tabs-closable {
padding-right: 8px;
}
.tabs-panels {
margin: 0px;
padding: 0px;
border-width: 1px;
border-style: solid;
border-top-width: 0;
overflow: hidden;
}
.tabs-header-bottom {
border-width: 0 1px 1px 1px;
padding: 0 0 2px 0;
}
.tabs-header-bottom .tabs {
border-width: 1px 0 0 0;
}
.tabs-header-bottom .tabs li {
margin: -1px 4px 0 0;
}
.tabs-header-bottom .tabs li a.tabs-inner {
-moz-border-radius: 0 0 5px 5px;
-webkit-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
}
.tabs-header-bottom .tabs-tool {
top: 0;
}
.tabs-header-bottom .tabs-scroller-left,
.tabs-header-bottom .tabs-scroller-right {
top: 0;
bottom: auto;
}
.tabs-panels-top {
border-width: 1px 1px 0 1px;
}
.tabs-header-left {
float: left;
border-width: 1px 0 1px 1px;
padding: 0;
}
.tabs-header-right {
float: right;
border-width: 1px 1px 1px 0;
padding: 0;
}
.tabs-header-left .tabs-wrap,
.tabs-header-right .tabs-wrap {
height: 100%;
}
.tabs-header-left .tabs {
height: 100%;
padding: 4px 0 0 4px;
border-width: 0 1px 0 0;
}
.tabs-header-right .tabs {
height: 100%;
padding: 4px 4px 0 0;
border-width: 0 0 0 1px;
}
.tabs-header-left .tabs li,
.tabs-header-right .tabs li {
display: block;
width: 100%;
position: relative;
}
.tabs-header-left .tabs li {
left: auto;
right: 0;
margin: 0 -1px 4px 0;
float: right;
}
.tabs-header-right .tabs li {
left: 0;
right: auto;
margin: 0 0 4px -1px;
float: left;
}
.tabs-header-left .tabs li a.tabs-inner {
display: block;
text-align: left;
-moz-border-radius: 5px 0 0 5px;
-webkit-border-radius: 5px 0 0 5px;
border-radius: 5px 0 0 5px;
}
.tabs-header-right .tabs li a.tabs-inner {
display: block;
text-align: left;
-moz-border-radius: 0 5px 5px 0;
-webkit-border-radius: 0 5px 5px 0;
border-radius: 0 5px 5px 0;
}
.tabs-panels-right {
float: right;
border-width: 1px 1px 1px 0;
}
.tabs-panels-left {
float: left;
border-width: 1px 0 1px 1px;
}
.tabs-header-noborder,
.tabs-panels-noborder {
border: 0px;
}
.tabs-header-plain {
border: 0px;
background: transparent;
}
.tabs-scroller-left {
background: #F2F2F2 url('images/tabs_icons.png') no-repeat 1px center;
}
.tabs-scroller-right {
background: #F2F2F2 url('images/tabs_icons.png') no-repeat -15px center;
}
.tabs li a.tabs-close {
background: url('images/tabs_icons.png') no-repeat -34px center;
}
.tabs li a.tabs-inner:hover {
background: #e6e6e6;
color: #00438a;
filter: none;
}
.tabs li.tabs-selected a.tabs-inner {
background-color: #ffffff;
color: #777;
background: -webkit-linear-gradient(top, #ffffff 0, #ffffff 100%);
background: -moz-linear-gradient(top, #ffffff 0, #ffffff 100%);
background: -o-linear-gradient(top, #ffffff 0, #ffffff 100%);
background: linear-gradient(to bottom, #ffffff 0, #ffffff 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#ffffff, GradientType=0);
}
.tabs-header-bottom .tabs li.tabs-selected a.tabs-inner {
background: -webkit-linear-gradient(top, #ffffff 0, #ffffff 100%);
background: -moz-linear-gradient(top, #ffffff 0, #ffffff 100%);
background: -o-linear-gradient(top, #ffffff 0, #ffffff 100%);
background: linear-gradient(to bottom, #ffffff 0, #ffffff 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#ffffff, GradientType=0);
}
.tabs-header-left .tabs li.tabs-selected a.tabs-inner {
background: -webkit-linear-gradient(left, #ffffff 0, #ffffff 100%);
background: -moz-linear-gradient(left, #ffffff 0, #ffffff 100%);
background: -o-linear-gradient(left, #ffffff 0, #ffffff 100%);
background: linear-gradient(to right, #ffffff 0, #ffffff 100%);
background-repeat: repeat-y;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#ffffff, GradientType=1);
}
.tabs-header-right .tabs li.tabs-selected a.tabs-inner {
background: -webkit-linear-gradient(left, #ffffff 0, #ffffff 100%);
background: -moz-linear-gradient(left, #ffffff 0, #ffffff 100%);
background: -o-linear-gradient(left, #ffffff 0, #ffffff 100%);
background: linear-gradient(to right, #ffffff 0, #ffffff 100%);
background-repeat: repeat-y;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#ffffff, GradientType=1);
}
.tabs li a.tabs-inner {
color: #777;
background-color: #F2F2F2;
background: -webkit-linear-gradient(top, #ffffff 0, #F2F2F2 100%);
background: -moz-linear-gradient(top, #ffffff 0, #F2F2F2 100%);
background: -o-linear-gradient(top, #ffffff 0, #F2F2F2 100%);
background: linear-gradient(to bottom, #ffffff 0, #F2F2F2 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#F2F2F2, GradientType=0);
}
.tabs-header,
.tabs-tool {
background-color: #F2F2F2;
}
.tabs-header-plain {
background: transparent;
}
.tabs-header,
.tabs-scroller-left,
.tabs-scroller-right,
.tabs-tool,
.tabs,
.tabs-panels,
.tabs li a.tabs-inner,
.tabs li.tabs-selected a.tabs-inner,
.tabs-header-bottom .tabs li.tabs-selected a.tabs-inner,
.tabs-header-left .tabs li.tabs-selected a.tabs-inner,
.tabs-header-right .tabs li.tabs-selected a.tabs-inner {
border-color: #D4D4D4;
}
.tabs-p-tool a:hover,
.tabs li a:hover.tabs-close,
.tabs-scroller-over {
background-color: #e6e6e6;
}
.tabs li.tabs-selected a.tabs-inner {
border-bottom: 1px solid #ffffff;
}
.tabs-header-bottom .tabs li.tabs-selected a.tabs-inner {
border-top: 1px solid #ffffff;
}
.tabs-header-left .tabs li.tabs-selected a.tabs-inner {
border-right: 1px solid #ffffff;
}
.tabs-header-right .tabs li.tabs-selected a.tabs-inner {
border-left: 1px solid #ffffff;
}
a.l-btn {
background-position: right 0;
text-decoration: none;
display: inline-block;
zoom: 1;
height: 24px;
padding-right: 18px;
cursor: pointer;
outline: none;
}
a.l-btn-plain {
padding-right: 5px;
border: 0;
padding: 1px 6px 1px 1px;
}
a.l-btn-disabled {
color: #ccc;
opacity: 0.5;
filter: alpha(opacity=50);
cursor: default;
}
a.l-btn span.l-btn-left {
display: inline-block;
background-position: 0 -48px;
padding: 4px 0px 4px 18px;
line-height: 16px;
height: 16px;
}
a.l-btn-plain span.l-btn-left {
padding-left: 5px;
}
a.l-btn span span.l-btn-text {
display: inline-block;
vertical-align: baseline;
width: auto;
height: 16px;
line-height: 16px;
font-size: 12px;
padding: 0;
margin: 0;
}
a.l-btn span span.l-btn-icon-left {
padding: 0 0 0 20px;
background-position: left center;
}
a.l-btn span span.l-btn-icon-right {
padding: 0 20px 0 0;
background-position: right center;
}
a.l-btn span span span.l-btn-empty {
display: inline-block;
margin: 0;
padding: 0;
width: 16px;
}
a:hover.l-btn {
background-position: right -24px;
outline: none;
text-decoration: none;
}
a:hover.l-btn span.l-btn-left {
background-position: 0 bottom;
}
a:hover.l-btn-plain {
padding: 0 5px 0 0;
}
a:hover.l-btn-disabled {
background-position: right 0;
}
a:hover.l-btn-disabled span.l-btn-left {
background-position: 0 -48px;
}
a.l-btn .l-btn-focus {
outline: #0000FF dotted thin;
}
a.l-btn {
color: #444;
background-image: url('images/linkbutton_bg.png');
background-repeat: no-repeat;
background: #f5f5f5;
background-repeat: repeat-x;
border: 1px solid #bbb;
background: -webkit-linear-gradient(top, #ffffff 0, #e6e6e6 100%);
background: -moz-linear-gradient(top, #ffffff 0, #e6e6e6 100%);
background: -o-linear-gradient(top, #ffffff 0, #e6e6e6 100%);
background: linear-gradient(to bottom, #ffffff 0, #e6e6e6 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#e6e6e6, GradientType=0);
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
a.l-btn span.l-btn-left {
background-image: url('images/linkbutton_bg.png');
background-repeat: no-repeat;
background-image: none;
}
a:hover.l-btn {
background: #e6e6e6;
color: #00438a;
border: 1px solid #ddd;
filter: none;
}
a.l-btn-plain,
a.l-btn-plain span.l-btn-left {
background: transparent;
border: 0;
filter: none;
}
a:hover.l-btn-plain {
background: #e6e6e6;
color: #00438a;
border: 1px solid #ddd;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
a.l-btn-disabled,
a:hover.l-btn-disabled {
color: #444;
filter: alpha(opacity=50);
background: #f5f5f5;
color: #444;
background: -webkit-linear-gradient(top, #ffffff 0, #e6e6e6 100%);
background: -moz-linear-gradient(top, #ffffff 0, #e6e6e6 100%);
background: -o-linear-gradient(top, #ffffff 0, #e6e6e6 100%);
background: linear-gradient(to bottom, #ffffff 0, #e6e6e6 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#e6e6e6, GradientType=0);
filter: alpha(opacity=50) progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#e6e6e6, GradientType=0);
}
a.l-btn-plain-disabled,
a:hover.l-btn-plain-disabled {
background: transparent;
filter: alpha(opacity=50);
}
a.l-btn-selected,
a:hover.l-btn-selected {
background-position: right -24px;
background: #ddd;
filter: none;
}
a.l-btn-selected span.l-btn-left,
a:hover.l-btn-selected span.l-btn-left {
background-position: 0 bottom;
background-image: none;
}
a.l-btn-plain-selected,
a:hover.l-btn-plain-selected {
background: #ddd;
}
.datagrid .panel-body {
overflow: hidden;
position: relative;
}
.datagrid-view {
position: relative;
overflow: hidden;
}
.datagrid-view1,
.datagrid-view2 {
position: absolute;
overflow: hidden;
top: 0;
}
.datagrid-view1 {
left: 0;
}
.datagrid-view2 {
right: 0;
}
.datagrid-mask {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0.3;
filter: alpha(opacity=30);
display: none;
}
.datagrid-mask-msg {
position: absolute;
top: 50%;
margin-top: -20px;
padding: 12px 5px 10px 30px;
width: auto;
height: 16px;
border-width: 2px;
border-style: solid;
display: none;
}
.datagrid-sort-icon {
padding: 0;
}
.datagrid-toolbar {
height: auto;
padding: 1px 2px;
border-width: 0 0 1px 0;
border-style: solid;
}
.datagrid-btn-separator {
float: left;
height: 24px;
border-left: 1px solid #ccc;
border-right: 1px solid #fff;
margin: 2px 1px;
}
.datagrid .datagrid-pager {
margin: 0;
border-width: 1px 0 0 0;
border-style: solid;
}
.datagrid .datagrid-pager-top {
border-width: 0 0 1px 0;
}
.datagrid-header {
overflow: hidden;
cursor: default;
border-width: 0 0 1px 0;
border-style: solid;
}
.datagrid-header-inner {
float: left;
width: 10000px;
}
.datagrid-header-row,
.datagrid-row {
height: 25px;
}
.datagrid-header td,
.datagrid-body td,
.datagrid-footer td {
border-width: 0 1px 1px 0;
border-style: dotted;
margin: 0;
padding: 0;
}
.datagrid-cell,
.datagrid-cell-group,
.datagrid-header-rownumber,
.datagrid-cell-rownumber {
margin: 0;
padding: 0 4px;
white-space: nowrap;
word-wrap: normal;
overflow: hidden;
height: 18px;
line-height: 18px;
font-weight: normal;
font-size: 12px;
}
.datagrid-header .datagrid-cell {
height: auto;
}
.datagrid-header .datagrid-cell span {
font-size: 12px;
}
.datagrid-cell-group {
text-align: center;
}
.datagrid-header-rownumber,
.datagrid-cell-rownumber {
width: 25px;
text-align: center;
margin: 0;
padding: 0;
}
.datagrid-body {
margin: 0;
padding: 0;
overflow: auto;
zoom: 1;
}
.datagrid-view1 .datagrid-body-inner {
padding-bottom: 20px;
}
.datagrid-view1 .datagrid-body {
overflow: hidden;
}
.datagrid-footer {
overflow: hidden;
}
.datagrid-footer-inner {
border-width: 1px 0 0 0;
border-style: solid;
width: 10000px;
float: left;
}
.datagrid-row-editing .datagrid-cell {
height: auto;
}
.datagrid-header-check,
.datagrid-cell-check {
padding: 0;
width: 27px;
height: 18px;
font-size: 1px;
text-align: center;
overflow: hidden;
}
.datagrid-header-check input,
.datagrid-cell-check input {
margin: 0;
padding: 0;
width: 15px;
height: 18px;
}
.datagrid-resize-proxy {
position: absolute;
width: 1px;
height: 10000px;
top: 0;
cursor: e-resize;
display: none;
}
.datagrid-body .datagrid-editable {
margin: 0;
padding: 0;
}
.datagrid-body .datagrid-editable table {
width: 100%;
height: 100%;
}
.datagrid-body .datagrid-editable td {
border: 0;
margin: 0;
padding: 0;
}
.datagrid-body .datagrid-editable .datagrid-editable-input {
margin: 0;
padding: 2px;
border-width: 1px;
border-style: solid;
}
.datagrid-sort-desc .datagrid-sort-icon {
padding: 0 13px 0 0;
background: url('images/datagrid_icons.png') no-repeat -16px center;
}
.datagrid-sort-asc .datagrid-sort-icon {
padding: 0 13px 0 0;
background: url('images/datagrid_icons.png') no-repeat 0px center;
}
.datagrid-row-collapse {
background: url('images/datagrid_icons.png') no-repeat -48px center;
}
.datagrid-row-expand {
background: url('images/datagrid_icons.png') no-repeat -32px center;
}
.datagrid-mask-msg {
background: #ffffff url('images/loading.gif') no-repeat scroll 5px center;
}
.datagrid-header,
.datagrid-td-rownumber {
background-color: #F2F2F2;
background: -webkit-linear-gradient(top, #ffffff 0, #F2F2F2 100%);
background: -moz-linear-gradient(top, #ffffff 0, #F2F2F2 100%);
background: -o-linear-gradient(top, #ffffff 0, #F2F2F2 100%);
background: linear-gradient(to bottom, #ffffff 0, #F2F2F2 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#F2F2F2, GradientType=0);
}
.datagrid-cell-rownumber {
color: #333;
}
.datagrid-resize-proxy {
background: #bbb;
}
.datagrid-mask {
background: #ccc;
}
.datagrid-mask-msg {
border-color: #D4D4D4;
}
.datagrid-toolbar,
.datagrid-pager {
background: #F5F5F5;
}
.datagrid-header,
.datagrid-toolbar,
.datagrid-pager,
.datagrid-footer-inner {
border-color: #e6e6e6;
}
.datagrid-header td,
.datagrid-body td,
.datagrid-footer td {
border-color: #ccc;
}
.datagrid-htable,
.datagrid-btable,
.datagrid-ftable {
color: #333;
}
.datagrid-row-alt {
background: #F5F5F5;
}
.datagrid-row-over,
.datagrid-header td.datagrid-header-over {
background: #e6e6e6;
color: #00438a;
cursor: default;
}
.datagrid-row-selected {
background: #0081c2;
color: #fff;
}
.datagrid-body .datagrid-editable .datagrid-editable-input {
border-color: #D4D4D4;
}
.propertygrid .datagrid-view1 .datagrid-body td {
padding-bottom: 1px;
border-width: 0 1px 0 0;
}
.propertygrid .datagrid-group {
height: 21px;
overflow: hidden;
border-width: 0 0 1px 0;
border-style: solid;
}
.propertygrid .datagrid-group span {
font-weight: bold;
}
.propertygrid .datagrid-view1 .datagrid-body td {
border-color: #e6e6e6;
}
.propertygrid .datagrid-view1 .datagrid-group {
border-color: #F2F2F2;
}
.propertygrid .datagrid-view2 .datagrid-group {
border-color: #e6e6e6;
}
.propertygrid .datagrid-group,
.propertygrid .datagrid-view1 .datagrid-body,
.propertygrid .datagrid-view1 .datagrid-row-over,
.propertygrid .datagrid-view1 .datagrid-row-selected {
background: #F2F2F2;
}
.pagination {
zoom: 1;
}
.pagination table {
float: left;
height: 30px;
}
.pagination td {
border: 0;
}
.pagination-btn-separator {
float: left;
height: 24px;
border-left: 1px solid #ccc;
border-right: 1px solid #fff;
margin: 3px 1px;
}
.pagination .pagination-num {
border-width: 1px;
border-style: solid;
margin: 0 2px;
padding: 2px;
width: 2em;
height: auto;
}
.pagination-page-list {
margin: 0px 6px;
padding: 1px 2px;
width: auto;
height: auto;
border-width: 1px;
border-style: solid;
}
.pagination-info {
float: right;
margin: 0 6px 0 0;
padding: 0;
height: 30px;
line-height: 30px;
font-size: 12px;
}
.pagination span {
font-size: 12px;
}
.pagination-first {
background: url('images/pagination_icons.png') no-repeat 0 0;
}
.pagination-prev {
background: url('images/pagination_icons.png') no-repeat -16px 0;
}
.pagination-next {
background: url('images/pagination_icons.png') no-repeat -32px 0;
}
.pagination-last {
background: url('images/pagination_icons.png') no-repeat -48px 0;
}
.pagination-load {
background: url('images/pagination_icons.png') no-repeat -64px 0;
}
.pagination-loading {
background: url('images/loading.gif') no-repeat;
}
.pagination-page-list,
.pagination .pagination-num {
border-color: #D4D4D4;
}
.calendar {
border-width: 1px;
border-style: solid;
padding: 1px;
overflow: hidden;
}
.calendar table {
border-collapse: separate;
font-size: 12px;
width: 100%;
height: 100%;
}
.calendar table td,
.calendar table th {
font-size: 12px;
}
.calendar-noborder {
border: 0;
}
.calendar-header {
position: relative;
height: 22px;
}
.calendar-title {
text-align: center;
height: 22px;
}
.calendar-title span {
position: relative;
display: inline-block;
top: 2px;
padding: 0 3px;
height: 18px;
line-height: 18px;
font-size: 12px;
cursor: pointer;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
.calendar-prevmonth,
.calendar-nextmonth,
.calendar-prevyear,
.calendar-nextyear {
position: absolute;
top: 50%;
margin-top: -7px;
width: 14px;
height: 14px;
cursor: pointer;
font-size: 1px;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
.calendar-prevmonth {
left: 20px;
background: url('images/calendar_arrows.png') no-repeat -18px -2px;
}
.calendar-nextmonth {
right: 20px;
background: url('images/calendar_arrows.png') no-repeat -34px -2px;
}
.calendar-prevyear {
left: 3px;
background: url('images/calendar_arrows.png') no-repeat -1px -2px;
}
.calendar-nextyear {
right: 3px;
background: url('images/calendar_arrows.png') no-repeat -49px -2px;
}
.calendar-body {
position: relative;
}
.calendar-body th,
.calendar-body td {
text-align: center;
}
.calendar-day {
border: 0;
padding: 1px;
cursor: pointer;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
.calendar-other-month {
opacity: 0.3;
filter: alpha(opacity=30);
}
.calendar-menu {
position: absolute;
top: 0;
left: 0;
width: 180px;
height: 150px;
padding: 5px;
font-size: 12px;
display: none;
overflow: hidden;
}
.calendar-menu-year-inner {
text-align: center;
padding-bottom: 5px;
}
.calendar-menu-year {
width: 40px;
text-align: center;
border-width: 1px;
border-style: solid;
margin: 0;
padding: 2px;
font-weight: bold;
font-size: 12px;
}
.calendar-menu-prev,
.calendar-menu-next {
display: inline-block;
width: 21px;
height: 21px;
vertical-align: top;
cursor: pointer;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
.calendar-menu-prev {
margin-right: 10px;
background: url('images/calendar_arrows.png') no-repeat 2px 2px;
}
.calendar-menu-next {
margin-left: 10px;
background: url('images/calendar_arrows.png') no-repeat -45px 2px;
}
.calendar-menu-month {
text-align: center;
cursor: pointer;
font-weight: bold;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
.calendar-body th,
.calendar-menu-month {
color: #808080;
}
.calendar-day {
color: #333;
}
.calendar-sunday {
color: #CC2222;
}
.calendar-saturday {
color: #00ee00;
}
.calendar-today {
color: #0000ff;
}
.calendar-menu-year {
border-color: #D4D4D4;
}
.calendar {
border-color: #D4D4D4;
}
.calendar-header {
background: #F2F2F2;
}
.calendar-body,
.calendar-menu {
background: #ffffff;
}
.calendar-body th {
background: #F5F5F5;
}
.calendar-hover,
.calendar-nav-hover,
.calendar-menu-hover {
background-color: #e6e6e6;
color: #00438a;
}
.calendar-hover {
border: 1px solid #ddd;
padding: 0;
}
.calendar-selected {
background-color: #0081c2;
color: #fff;
border: 1px solid #0070a9;
padding: 0;
}
.datebox-calendar-inner {
height: 180px;
}
.datebox-button {
height: 18px;
padding: 2px 5px;
text-align: center;
}
.datebox-button a {
font-size: 12px;
}
.datebox-current,
.datebox-close,
.datebox-ok {
text-decoration: none;
font-weight: bold;
opacity: 0.6;
filter: alpha(opacity=60);
}
.datebox-current,
.datebox-close {
float: left;
}
.datebox-close {
float: right;
}
.datebox-button-hover {
opacity: 1.0;
filter: alpha(opacity=100);
}
.datebox .combo-arrow {
background-image: url('images/datebox_arrow.png');
background-position: center center;
}
.datebox-button {
background-color: #F5F5F5;
}
.datebox-current,
.datebox-close,
.datebox-ok {
color: #444;
}
.spinner {
display: inline-block;
white-space: nowrap;
margin: 0;
padding: 0;
border-width: 1px;
border-style: solid;
overflow: hidden;
vertical-align: middle;
}
.spinner .spinner-text {
font-size: 12px;
border: 0px;
line-height: 20px;
height: 20px;
margin: 0;
padding: 0 2px;
*margin-top: -1px;
*height: 18px;
*line-height: 18px;
_height: 18px;
_line-height: 18px;
vertical-align: baseline;
}
.spinner-arrow {
display: inline-block;
overflow: hidden;
vertical-align: top;
margin: 0;
padding: 0;
}
.spinner-arrow-up,
.spinner-arrow-down {
opacity: 0.6;
filter: alpha(opacity=60);
display: block;
font-size: 1px;
width: 18px;
height: 10px;
}
.spinner-arrow-hover {
opacity: 1.0;
filter: alpha(opacity=100);
}
.spinner-arrow-up {
background: url('images/spinner_arrows.png') no-repeat 1px center;
}
.spinner-arrow-down {
background: url('images/spinner_arrows.png') no-repeat -15px center;
}
.spinner {
border-color: #D4D4D4;
}
.spinner-arrow {
background-color: #F2F2F2;
}
.spinner-arrow-hover {
background-color: #e6e6e6;
}
.progressbar {
border-width: 1px;
border-style: solid;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
overflow: hidden;
}
.progressbar-text {
text-align: center;
position: absolute;
}
.progressbar-value {
position: relative;
overflow: hidden;
width: 0;
-moz-border-radius: 5px 0 0 5px;
-webkit-border-radius: 5px 0 0 5px;
border-radius: 5px 0 0 5px;
}
.progressbar {
border-color: #D4D4D4;
}
.progressbar-text {
color: #333;
font-size: 12px;
}
.progressbar-value .progressbar-text {
background-color: #0081c2;
color: #fff;
}
.searchbox {
display: inline-block;
white-space: nowrap;
margin: 0;
padding: 0;
border-width: 1px;
border-style: solid;
overflow: hidden;
}
.searchbox .searchbox-text {
font-size: 12px;
border: 0;
margin: 0;
padding: 0;
line-height: 20px;
height: 20px;
*margin-top: -1px;
*height: 18px;
*line-height: 18px;
_height: 18px;
_line-height: 18px;
vertical-align: baseline;
}
.searchbox .searchbox-prompt {
font-size: 12px;
color: #ccc;
}
.searchbox-button {
width: 18px;
height: 20px;
overflow: hidden;
display: inline-block;
vertical-align: top;
cursor: pointer;
opacity: 0.6;
filter: alpha(opacity=60);
}
.searchbox-button-hover {
opacity: 1.0;
filter: alpha(opacity=100);
}
.searchbox a.l-btn-plain {
height: 20px;
border: 0;
padding: 0 6px 0 0;
vertical-align: top;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
opacity: 0.6;
filter: alpha(opacity=60);
}
.searchbox a.l-btn .l-btn-left {
padding: 2px 0 2px 4px;
}
.searchbox a.l-btn-plain:hover {
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
border: 0;
padding: 0 6px 0 0;
opacity: 1.0;
filter: alpha(opacity=100);
}
.searchbox a.m-btn-plain-active {
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
}
.searchbox-button {
background: url('images/searchbox_button.png') no-repeat center center;
}
.searchbox {
border-color: #D4D4D4;
background-color: #fff;
}
.searchbox a.l-btn-plain {
background: #F2F2F2;
}
.slider-disabled {
opacity: 0.5;
filter: alpha(opacity=50);
}
.slider-h {
height: 22px;
}
.slider-v {
width: 22px;
}
.slider-inner {
position: relative;
height: 6px;
top: 7px;
border-width: 1px;
border-style: solid;
border-radius: 5px;
}
.slider-handle {
position: absolute;
display: block;
outline: none;
width: 20px;
height: 20px;
top: -7px;
margin-left: -10px;
}
.slider-tip {
position: absolute;
display: inline-block;
line-height: 12px;
font-size: 12px;
white-space: nowrap;
top: -22px;
}
.slider-rule {
position: relative;
top: 15px;
}
.slider-rule span {
position: absolute;
display: inline-block;
font-size: 0;
height: 5px;
border-width: 0 0 0 1px;
border-style: solid;
}
.slider-rulelabel {
position: relative;
top: 20px;
}
.slider-rulelabel span {
position: absolute;
display: inline-block;
font-size: 12px;
}
.slider-v .slider-inner {
width: 6px;
left: 7px;
top: 0;
float: left;
}
.slider-v .slider-handle {
left: 3px;
margin-top: -10px;
}
.slider-v .slider-tip {
left: -10px;
margin-top: -6px;
}
.slider-v .slider-rule {
float: left;
top: 0;
left: 16px;
}
.slider-v .slider-rule span {
width: 5px;
height: 'auto';
border-left: 0;
border-width: 1px 0 0 0;
border-style: solid;
}
.slider-v .slider-rulelabel {
float: left;
top: 0;
left: 23px;
}
.slider-handle {
background: url('images/slider_handle.png') no-repeat;
}
.slider-inner {
border-color: #D4D4D4;
background: #F2F2F2;
}
.slider-rule span {
border-color: #D4D4D4;
}
.slider-rulelabel span {
color: #333;
}
.menu {
position: absolute;
margin: 0;
padding: 2px;
border-width: 1px;
border-style: solid;
overflow: hidden;
}
.menu-item {
position: relative;
margin: 0;
padding: 0;
overflow: hidden;
white-space: nowrap;
cursor: pointer;
border-width: 1px;
border-style: solid;
}
.menu-text {
height: 20px;
line-height: 20px;
float: left;
padding-left: 28px;
}
.menu-icon {
position: absolute;
width: 16px;
height: 16px;
left: 2px;
top: 50%;
margin-top: -8px;
}
.menu-rightarrow {
position: absolute;
width: 16px;
height: 16px;
right: 0;
top: 50%;
margin-top: -8px;
}
.menu-line {
position: absolute;
left: 26px;
top: 0;
height: 2000px;
font-size: 1px;
}
.menu-sep {
margin: 3px 0px 3px 25px;
font-size: 1px;
}
.menu-active {
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
.menu-item-disabled {
opacity: 0.5;
filter: alpha(opacity=50);
cursor: default;
}
.menu-text,
.menu-text span {
font-size: 12px;
}
.menu-shadow {
position: absolute;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
background: #ccc;
-moz-box-shadow: 2px 2px 3px #cccccc;
-webkit-box-shadow: 2px 2px 3px #cccccc;
box-shadow: 2px 2px 3px #cccccc;
filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2, MakeShadow=false, ShadowOpacity=0.2);
}
.menu-rightarrow {
background: url('images/menu_arrows.png') no-repeat -32px center;
}
.menu-line {
border-left: 1px solid #ccc;
border-right: 1px solid #fff;
}
.menu-sep {
border-top: 1px solid #ccc;
border-bottom: 1px solid #fff;
}
.menu {
background-color: #fff;
border-color: #e6e6e6;
color: #333;
}
.menu-content {
background: #ffffff;
}
.menu-item {
border-color: transparent;
_border-color: #fff;
}
.menu-active {
border-color: #ddd;
color: #00438a;
background: #e6e6e6;
}
.menu-active-disabled {
border-color: transparent;
background: transparent;
color: #333;
}
.m-btn-downarrow {
display: inline-block;
width: 16px;
height: 16px;
line-height: 16px;
font-size: 12px;
_vertical-align: middle;
}
a.m-btn-active {
background-position: bottom right;
}
a.m-btn-active span.l-btn-left {
background-position: bottom left;
}
a.m-btn-plain-active {
background: transparent;
padding: 0 5px 0 0;
border-width: 1px;
border-style: solid;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
.m-btn-downarrow {
background: url('images/menu_arrows.png') no-repeat 2px center;
}
a.m-btn-plain-active {
border-color: #ddd;
background-color: #e6e6e6;
color: #00438a;
}
.s-btn-downarrow {
display: inline-block;
margin: 0 0 0 4px;
padding: 0 0 0 1px;
width: 14px;
height: 16px;
line-height: 16px;
border-width: 0;
border-style: solid;
font-size: 12px;
_vertical-align: middle;
}
a.s-btn-active {
background-position: bottom right;
}
a.s-btn-active span.l-btn-left {
background-position: bottom left;
}
a.s-btn-plain-active {
background: transparent;
padding: 0 5px 0 0;
border-width: 1px;
border-style: solid;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
.s-btn-downarrow {
background: url('images/menu_arrows.png') no-repeat 2px center;
border-color: #bbb;
}
a:hover.l-btn .s-btn-downarrow,
a.s-btn-active .s-btn-downarrow,
a.s-btn-plain-active .s-btn-downarrow {
background-position: 1px center;
padding: 0;
border-width: 0 0 0 1px;
}
a.s-btn-plain-active {
border-color: #ddd;
background-color: #e6e6e6;
color: #00438a;
}
.messager-body {
padding: 10px;
overflow: hidden;
}
.messager-button {
text-align: center;
padding-top: 10px;
}
.messager-icon {
float: left;
width: 32px;
height: 32px;
margin: 0 10px 10px 0;
}
.messager-error {
background: url('images/messager_icons.png') no-repeat scroll -64px 0;
}
.messager-info {
background: url('images/messager_icons.png') no-repeat scroll 0 0;
}
.messager-question {
background: url('images/messager_icons.png') no-repeat scroll -32px 0;
}
.messager-warning {
background: url('images/messager_icons.png') no-repeat scroll -96px 0;
}
.messager-progress {
padding: 10px;
}
.messager-p-msg {
margin-bottom: 5px;
}
.messager-body .messager-input {
width: 100%;
padding: 1px 0;
border: 1px solid #D4D4D4;
}
.tree {
margin: 0;
padding: 0;
list-style-type: none;
}
.tree li {
white-space: nowrap;
}
.tree li ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.tree-node {
height: 18px;
white-space: nowrap;
cursor: pointer;
}
.tree-hit {
cursor: pointer;
}
.tree-expanded,
.tree-collapsed,
.tree-folder,
.tree-file,
.tree-checkbox,
.tree-indent {
display: inline-block;
width: 16px;
height: 18px;
vertical-align: top;
overflow: hidden;
}
.tree-expanded {
background: url('images/tree_icons.png') no-repeat -18px 0px;
}
.tree-expanded-hover {
background: url('images/tree_icons.png') no-repeat -50px 0px;
}
.tree-collapsed {
background: url('images/tree_icons.png') no-repeat 0px 0px;
}
.tree-collapsed-hover {
background: url('images/tree_icons.png') no-repeat -32px 0px;
}
.tree-lines .tree-expanded,
.tree-lines .tree-root-first .tree-expanded {
background: url('images/tree_icons.png') no-repeat -144px 0;
}
.tree-lines .tree-collapsed,
.tree-lines .tree-root-first .tree-collapsed {
background: url('images/tree_icons.png') no-repeat -128px 0;
}
.tree-lines .tree-node-last .tree-expanded,
.tree-lines .tree-root-one .tree-expanded {
background: url('images/tree_icons.png') no-repeat -80px 0;
}
.tree-lines .tree-node-last .tree-collapsed,
.tree-lines .tree-root-one .tree-collapsed {
background: url('images/tree_icons.png') no-repeat -64px 0;
}
.tree-line {
background: url('images/tree_icons.png') no-repeat -176px 0;
}
.tree-join {
background: url('images/tree_icons.png') no-repeat -192px 0;
}
.tree-joinbottom {
background: url('images/tree_icons.png') no-repeat -160px 0;
}
.tree-folder {
background: url('images/tree_icons.png') no-repeat -208px 0;
}
.tree-folder-open {
background: url('images/tree_icons.png') no-repeat -224px 0;
}
.tree-file {
background: url('images/tree_icons.png') no-repeat -240px 0;
}
.tree-loading {
background: url('images/loading.gif') no-repeat center center;
}
.tree-checkbox0 {
background: url('images/tree_icons.png') no-repeat -208px -18px;
}
.tree-checkbox1 {
background: url('images/tree_icons.png') no-repeat -224px -18px;
}
.tree-checkbox2 {
background: url('images/tree_icons.png') no-repeat -240px -18px;
}
.tree-title {
font-size: 12px;
display: inline-block;
text-decoration: none;
vertical-align: top;
white-space: nowrap;
padding: 0 2px;
height: 18px;
line-height: 18px;
}
.tree-node-proxy {
font-size: 12px;
line-height: 20px;
padding: 0 2px 0 20px;
border-width: 1px;
border-style: solid;
z-index: 9900000;
}
.tree-dnd-icon {
display: inline-block;
position: absolute;
width: 16px;
height: 18px;
left: 2px;
top: 50%;
margin-top: -9px;
}
.tree-dnd-yes {
background: url('images/tree_icons.png') no-repeat -256px 0;
}
.tree-dnd-no {
background: url('images/tree_icons.png') no-repeat -256px -18px;
}
.tree-node-top {
border-top: 1px dotted red;
}
.tree-node-bottom {
border-bottom: 1px dotted red;
}
.tree-node-append .tree-title {
border: 1px dotted red;
}
.tree-editor {
border: 1px solid #ccc;
font-size: 12px;
height: 14px !important;
height: 18px;
line-height: 14px;
padding: 1px 2px;
width: 80px;
position: absolute;
top: 0;
}
.tree-node-proxy {
background-color: #ffffff;
color: #333;
border-color: #D4D4D4;
}
.tree-node-hover {
background: #e6e6e6;
color: #00438a;
}
.tree-node-selected {
background: #0081c2;
color: #fff;
}
.validatebox-invalid {
background-image: url('images/validatebox_warning.png');
background-repeat: no-repeat;
background-position: right center;
border-color: #ffa8a8;
background-color: #fff3f3;
color: #000;
}
.tooltip {
position: absolute;
display: none;
z-index: 9900000;
outline: none;
padding: 5px;
border-width: 1px;
border-style: solid;
border-radius: 5px;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
.tooltip-content {
font-size: 12px;
}
.tooltip-arrow-outer,
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
line-height: 0;
font-size: 0;
border-style: solid;
border-width: 6px;
border-color: transparent;
_border-color: tomato;
_filter: chroma(color=tomato);
}
.tooltip-right .tooltip-arrow-outer {
left: 0;
top: 50%;
margin: -6px 0 0 -13px;
}
.tooltip-right .tooltip-arrow {
left: 0;
top: 50%;
margin: -6px 0 0 -12px;
}
.tooltip-left .tooltip-arrow-outer {
right: 0;
top: 50%;
margin: -6px -13px 0 0;
}
.tooltip-left .tooltip-arrow {
right: 0;
top: 50%;
margin: -6px -12px 0 0;
}
.tooltip-top .tooltip-arrow-outer {
bottom: 0;
left: 50%;
margin: 0 0 -13px -6px;
}
.tooltip-top .tooltip-arrow {
bottom: 0;
left: 50%;
margin: 0 0 -12px -6px;
}
.tooltip-bottom .tooltip-arrow-outer {
top: 0;
left: 50%;
margin: -13px 0 0 -6px;
}
.tooltip-bottom .tooltip-arrow {
top: 0;
left: 50%;
margin: -12px 0 0 -6px;
}
.tooltip {
background-color: #ffffff;
border-color: #D4D4D4;
color: #333;
}
.tooltip-right .tooltip-arrow-outer {
border-right-color: #D4D4D4;
}
.tooltip-right .tooltip-arrow {
border-right-color: #ffffff;
}
.tooltip-left .tooltip-arrow-outer {
border-left-color: #D4D4D4;
}
.tooltip-left .tooltip-arrow {
border-left-color: #ffffff;
}
.tooltip-top .tooltip-arrow-outer {
border-top-color: #D4D4D4;
}
.tooltip-top .tooltip-arrow {
border-top-color: #ffffff;
}
.tooltip-bottom .tooltip-arrow-outer {
border-bottom-color: #D4D4D4;
}
.tooltip-bottom .tooltip-arrow {
border-bottom-color: #ffffff;
}
.tabs-panels {
border-color: transparent;
}
.tabs li a.tabs-inner {
border-color: transparent;
background: transparent;
filter: none;
color: #0088CC;
}
.menu-active {
background-color: #0081C2;
border-color: #0081C2;
color: #fff;
}
.menu-active-disabled {
border-color: transparent;
background: transparent;
color: #333;
}
| {
"pile_set_name": "Github"
} |
import pytest
from thefuck.rules.git_flag_after_filename import match, get_new_command
from thefuck.types import Command
command1 = Command('git log README.md -p',
"fatal: bad flag '-p' used after filename")
command2 = Command('git log README.md -p CONTRIBUTING.md',
"fatal: bad flag '-p' used after filename")
command3 = Command('git log -p README.md --name-only',
"fatal: bad flag '--name-only' used after filename")
command4 = Command('git log README.md -p',
"fatal: option '-p' must come before non-option arguments")
command5 = Command('git log README.md -p CONTRIBUTING.md',
"fatal: option '-p' must come before non-option arguments")
command6 = Command('git log -p README.md --name-only',
"fatal: option '--name-only' must come before non-option arguments")
@pytest.mark.parametrize('command', [
command1, command2, command3, command4, command5, command6])
def test_match(command):
assert match(command)
@pytest.mark.parametrize('command', [
Command('git log README.md', ''),
Command('git log -p README.md', '')])
def test_not_match(command):
assert not match(command)
@pytest.mark.parametrize('command, result', [
(command1, "git log -p README.md"),
(command2, "git log -p README.md CONTRIBUTING.md"),
(command3, "git log -p --name-only README.md"),
(command4, "git log -p README.md"),
(command5, "git log -p README.md CONTRIBUTING.md"),
(command6, "git log -p --name-only README.md")])
def test_get_new_command(command, result):
assert get_new_command(command) == result
| {
"pile_set_name": "Github"
} |
/*
* SonarQube
* Copyright (C) 2009-2020 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program 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 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
package org.sonar.db.rule;
import java.util.List;
import java.util.Set;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.ResultHandler;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.rules.RuleQuery;
import org.sonar.db.es.RuleExtensionId;
public interface RuleMapper {
List<RuleDto> selectAll(@Param("organizationUuid") String organizationUuid);
List<RuleDefinitionDto> selectAllDefinitions();
void selectEnabled(ResultHandler<RuleDefinitionDto> resultHandler);
RuleDto selectByUuid(@Param("organizationUuid") String organizationUuid, @Param("uuid") String uuid);
RuleDefinitionDto selectDefinitionByUuid(String uuid);
List<RuleDto> selectByUuids(@Param("organizationUuid") String organizationUuid, @Param("uuids") List<String> uuids);
List<RuleDefinitionDto> selectDefinitionByUuids(@Param("uuids") List<String> uuids);
RuleDto selectByKey(@Param("organizationUuid") String organizationUuid, @Param("ruleKey") RuleKey ruleKey);
RuleDefinitionDto selectDefinitionByKey(RuleKey ruleKey);
RuleMetadataDto selectMetadataByKey(@Param("ruleKey") RuleKey ruleKey, @Param("organizationUuid") String organizationUuid);
List<RuleDto> selectByKeys(@Param("organizationUuid") String organizationUuid, @Param("ruleKeys") List<RuleKey> keys);
List<RuleDefinitionDto> selectDefinitionByKeys(@Param("ruleKeys") List<RuleKey> keys);
void scrollIndexingRules(ResultHandler<RuleForIndexingDto> handler);
List<RuleForIndexingDto> selectIndexingRulesByUuids(@Param("ruleUuids") List<String> ruleUuids);
void scrollIndexingRuleExtensions(ResultHandler<RuleExtensionForIndexingDto> handler);
List<RuleExtensionForIndexingDto> selectIndexingRuleExtensionsByIds(@Param("ruleExtensionIds") List<RuleExtensionId> ruleExtensionIds);
List<RuleDto> selectByQuery(@Param("organizationUuid") String organizationUuid, @Param("query") RuleQuery ruleQuery);
List<RuleDto> selectByTypeAndLanguages(@Param("organizationUuid") String organizationUuid, @Param("types") List<Integer> types, @Param("languages") List<String> languages);
void insertDefinition(RuleDefinitionDto ruleDefinitionDto);
void updateDefinition(RuleDefinitionDto ruleDefinitionDto);
int countMetadata(RuleMetadataDto ruleMetadataDto);
void insertMetadata(RuleMetadataDto ruleMetadataDto);
void updateMetadata(RuleMetadataDto ruleMetadataDto);
List<RuleParamDto> selectParamsByRuleUuids(@Param("ruleUuids") List<String> ruleUuids);
List<RuleParamDto> selectParamsByRuleKey(RuleKey ruleKey);
List<RuleParamDto> selectParamsByRuleKeys(@Param("ruleKeys") List<RuleKey> ruleKeys);
void insertParameter(RuleParamDto param);
void updateParameter(RuleParamDto param);
void deleteParameter(String paramUuid);
Set<DeprecatedRuleKeyDto> selectAllDeprecatedRuleKeys();
void deleteDeprecatedRuleKeys(@Param("uuids") List<String> uuids);
void insertDeprecatedRuleKey(DeprecatedRuleKeyDto deprecatedRuleKeyDto);
}
| {
"pile_set_name": "Github"
} |
require('../../modules/core.object.classof');
module.exports = require('../../modules/$.core').Object.classof; | {
"pile_set_name": "Github"
} |
export default {
Editor: class {
on() {}
}
}
| {
"pile_set_name": "Github"
} |
from .api import (
get_level as get_level,
set_level as set_level,
add_message as add_message,
debug as debug,
error as error,
success as success,
get_messages as get_messages,
MessageFailure as MessageFailure,
info as info,
warning as warning,
)
from .constants import (
DEBUG as DEBUG,
DEFAULT_LEVELS as DEFAULT_LEVELS,
DEFAULT_TAGS as DEFAULT_TAGS,
ERROR as ERROR,
INFO as INFO,
SUCCESS as SUCCESS,
WARNING as WARNING,
)
default_app_config: str = ...
| {
"pile_set_name": "Github"
} |
/* lapack/double/dlasr.f -- translated by f2c (version 20090411).
You must link the resulting object file with libf2c:
on Microsoft Windows system, link with libf2c.lib;
on Linux or Unix systems, link with .../path/to/libf2c.a -lm
or, if you install libf2c.a in a standard place, with -lf2c -lm
-- in that order, at the end of the command line, as in
cc *.o -lf2c -lm
Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
http://www.netlib.org/f2c/libf2c.zip
*/
#ifdef __cplusplus
extern "C" {
#endif
#include "v3p_netlib.h"
/*< SUBROUTINE DLASR( SIDE, PIVOT, DIRECT, M, N, C, S, A, LDA ) >*/
/* Subroutine */ int dlasr_(char *side, char *pivot, char *direct, integer *m,
integer *n, doublereal *c__, doublereal *s, doublereal *a, integer *
lda, ftnlen side_len, ftnlen pivot_len, ftnlen direct_len)
{
/* System generated locals */
integer a_dim1, a_offset, i__1, i__2;
/* Local variables */
integer i__, j, info;
doublereal temp;
extern logical lsame_(const char *, const char *, ftnlen, ftnlen);
doublereal ctemp, stemp;
extern /* Subroutine */ int xerbla_(char *, integer *, ftnlen);
/* -- LAPACK auxiliary routine (version 3.2) -- */
/* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
/* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
/* November 2006 */
/* .. Scalar Arguments .. */
/*< CHARACTER DIRECT, PIVOT, SIDE >*/
/*< INTEGER LDA, M, N >*/
/* .. */
/* .. Array Arguments .. */
/*< DOUBLE PRECISION A( LDA, * ), C( * ), S( * ) >*/
/* .. */
/* Purpose */
/* ======= */
/* DLASR applies a sequence of plane rotations to a real matrix A, */
/* from either the left or the right. */
/* When SIDE = 'L', the transformation takes the form */
/* A := P*A */
/* and when SIDE = 'R', the transformation takes the form */
/* A := A*P**T */
/* where P is an orthogonal matrix consisting of a sequence of z plane */
/* rotations, with z = M when SIDE = 'L' and z = N when SIDE = 'R', */
/* and P**T is the transpose of P. */
/* When DIRECT = 'F' (Forward sequence), then */
/* P = P(z-1) * ... * P(2) * P(1) */
/* and when DIRECT = 'B' (Backward sequence), then */
/* P = P(1) * P(2) * ... * P(z-1) */
/* where P(k) is a plane rotation matrix defined by the 2-by-2 rotation */
/* R(k) = ( c(k) s(k) ) */
/* = ( -s(k) c(k) ). */
/* When PIVOT = 'V' (Variable pivot), the rotation is performed */
/* for the plane (k,k+1), i.e., P(k) has the form */
/* P(k) = ( 1 ) */
/* ( ... ) */
/* ( 1 ) */
/* ( c(k) s(k) ) */
/* ( -s(k) c(k) ) */
/* ( 1 ) */
/* ( ... ) */
/* ( 1 ) */
/* where R(k) appears as a rank-2 modification to the identity matrix in */
/* rows and columns k and k+1. */
/* When PIVOT = 'T' (Top pivot), the rotation is performed for the */
/* plane (1,k+1), so P(k) has the form */
/* P(k) = ( c(k) s(k) ) */
/* ( 1 ) */
/* ( ... ) */
/* ( 1 ) */
/* ( -s(k) c(k) ) */
/* ( 1 ) */
/* ( ... ) */
/* ( 1 ) */
/* where R(k) appears in rows and columns 1 and k+1. */
/* Similarly, when PIVOT = 'B' (Bottom pivot), the rotation is */
/* performed for the plane (k,z), giving P(k) the form */
/* P(k) = ( 1 ) */
/* ( ... ) */
/* ( 1 ) */
/* ( c(k) s(k) ) */
/* ( 1 ) */
/* ( ... ) */
/* ( 1 ) */
/* ( -s(k) c(k) ) */
/* where R(k) appears in rows and columns k and z. The rotations are */
/* performed without ever forming P(k) explicitly. */
/* Arguments */
/* ========= */
/* SIDE (input) CHARACTER*1 */
/* Specifies whether the plane rotation matrix P is applied to */
/* A on the left or the right. */
/* = 'L': Left, compute A := P*A */
/* = 'R': Right, compute A:= A*P**T */
/* PIVOT (input) CHARACTER*1 */
/* Specifies the plane for which P(k) is a plane rotation */
/* matrix. */
/* = 'V': Variable pivot, the plane (k,k+1) */
/* = 'T': Top pivot, the plane (1,k+1) */
/* = 'B': Bottom pivot, the plane (k,z) */
/* DIRECT (input) CHARACTER*1 */
/* Specifies whether P is a forward or backward sequence of */
/* plane rotations. */
/* = 'F': Forward, P = P(z-1)*...*P(2)*P(1) */
/* = 'B': Backward, P = P(1)*P(2)*...*P(z-1) */
/* M (input) INTEGER */
/* The number of rows of the matrix A. If m <= 1, an immediate */
/* return is effected. */
/* N (input) INTEGER */
/* The number of columns of the matrix A. If n <= 1, an */
/* immediate return is effected. */
/* C (input) DOUBLE PRECISION array, dimension */
/* (M-1) if SIDE = 'L' */
/* (N-1) if SIDE = 'R' */
/* The cosines c(k) of the plane rotations. */
/* S (input) DOUBLE PRECISION array, dimension */
/* (M-1) if SIDE = 'L' */
/* (N-1) if SIDE = 'R' */
/* The sines s(k) of the plane rotations. The 2-by-2 plane */
/* rotation part of the matrix P(k), R(k), has the form */
/* R(k) = ( c(k) s(k) ) */
/* ( -s(k) c(k) ). */
/* A (input/output) DOUBLE PRECISION array, dimension (LDA,N) */
/* The M-by-N matrix A. On exit, A is overwritten by P*A if */
/* SIDE = 'R' or by A*P**T if SIDE = 'L'. */
/* LDA (input) INTEGER */
/* The leading dimension of the array A. LDA >= max(1,M). */
/* ===================================================================== */
/* .. Parameters .. */
/*< DOUBLE PRECISION ONE, ZERO >*/
/*< PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 ) >*/
/* .. */
/* .. Local Scalars .. */
/*< INTEGER I, INFO, J >*/
/*< DOUBLE PRECISION CTEMP, STEMP, TEMP >*/
/* .. */
/* .. External Functions .. */
/*< LOGICAL LSAME >*/
/*< EXTERNAL LSAME >*/
/* .. */
/* .. External Subroutines .. */
/*< EXTERNAL XERBLA >*/
/* .. */
/* .. Intrinsic Functions .. */
/*< INTRINSIC MAX >*/
/* .. */
/* .. Executable Statements .. */
/* Test the input parameters */
/*< INFO = 0 >*/
/* Parameter adjustments */
--c__;
--s;
a_dim1 = *lda;
a_offset = 1 + a_dim1;
a -= a_offset;
/* Function Body */
info = 0;
/*< IF( .NOT.( LSAME( SIDE, 'L' ) .OR. LSAME( SIDE, 'R' ) ) ) THEN >*/
if (! (lsame_(side, "L", (ftnlen)1, (ftnlen)1) || lsame_(side, "R", (
ftnlen)1, (ftnlen)1))) {
/*< INFO = 1 >*/
info = 1;
/*< >*/
} else if (! (lsame_(pivot, "V", (ftnlen)1, (ftnlen)1) || lsame_(pivot,
"T", (ftnlen)1, (ftnlen)1) || lsame_(pivot, "B", (ftnlen)1, (
ftnlen)1))) {
/*< INFO = 2 >*/
info = 2;
/*< >*/
} else if (! (lsame_(direct, "F", (ftnlen)1, (ftnlen)1) || lsame_(direct,
"B", (ftnlen)1, (ftnlen)1))) {
/*< INFO = 3 >*/
info = 3;
/*< ELSE IF( M.LT.0 ) THEN >*/
} else if (*m < 0) {
/*< INFO = 4 >*/
info = 4;
/*< ELSE IF( N.LT.0 ) THEN >*/
} else if (*n < 0) {
/*< INFO = 5 >*/
info = 5;
/*< ELSE IF( LDA.LT.MAX( 1, M ) ) THEN >*/
} else if (*lda < max(1,*m)) {
/*< INFO = 9 >*/
info = 9;
/*< END IF >*/
}
/*< IF( INFO.NE.0 ) THEN >*/
if (info != 0) {
/*< CALL XERBLA( 'DLASR ', INFO ) >*/
xerbla_("DLASR ", &info, (ftnlen)6);
/*< RETURN >*/
return 0;
/*< END IF >*/
}
/* Quick return if possible */
/*< >*/
if (*m == 0 || *n == 0) {
return 0;
}
/*< IF( LSAME( SIDE, 'L' ) ) THEN >*/
if (lsame_(side, "L", (ftnlen)1, (ftnlen)1)) {
/* Form P * A */
/*< IF( LSAME( PIVOT, 'V' ) ) THEN >*/
if (lsame_(pivot, "V", (ftnlen)1, (ftnlen)1)) {
/*< IF( LSAME( DIRECT, 'F' ) ) THEN >*/
if (lsame_(direct, "F", (ftnlen)1, (ftnlen)1)) {
/*< DO 20 J = 1, M - 1 >*/
i__1 = *m - 1;
for (j = 1; j <= i__1; ++j) {
/*< CTEMP = C( J ) >*/
ctemp = c__[j];
/*< STEMP = S( J ) >*/
stemp = s[j];
/*< IF( ( CTEMP.NE.ONE ) .OR. ( STEMP.NE.ZERO ) ) THEN >*/
if (ctemp != 1. || stemp != 0.) {
/*< DO 10 I = 1, N >*/
i__2 = *n;
for (i__ = 1; i__ <= i__2; ++i__) {
/*< TEMP = A( J+1, I ) >*/
temp = a[j + 1 + i__ * a_dim1];
/*< A( J+1, I ) = CTEMP*TEMP - STEMP*A( J, I ) >*/
a[j + 1 + i__ * a_dim1] = ctemp * temp - stemp *
a[j + i__ * a_dim1];
/*< A( J, I ) = STEMP*TEMP + CTEMP*A( J, I ) >*/
a[j + i__ * a_dim1] = stemp * temp + ctemp * a[j
+ i__ * a_dim1];
/*< 10 CONTINUE >*/
/* L10: */
}
/*< END IF >*/
}
/*< 20 CONTINUE >*/
/* L20: */
}
/*< ELSE IF( LSAME( DIRECT, 'B' ) ) THEN >*/
} else if (lsame_(direct, "B", (ftnlen)1, (ftnlen)1)) {
/*< DO 40 J = M - 1, 1, -1 >*/
for (j = *m - 1; j >= 1; --j) {
/*< CTEMP = C( J ) >*/
ctemp = c__[j];
/*< STEMP = S( J ) >*/
stemp = s[j];
/*< IF( ( CTEMP.NE.ONE ) .OR. ( STEMP.NE.ZERO ) ) THEN >*/
if (ctemp != 1. || stemp != 0.) {
/*< DO 30 I = 1, N >*/
i__1 = *n;
for (i__ = 1; i__ <= i__1; ++i__) {
/*< TEMP = A( J+1, I ) >*/
temp = a[j + 1 + i__ * a_dim1];
/*< A( J+1, I ) = CTEMP*TEMP - STEMP*A( J, I ) >*/
a[j + 1 + i__ * a_dim1] = ctemp * temp - stemp *
a[j + i__ * a_dim1];
/*< A( J, I ) = STEMP*TEMP + CTEMP*A( J, I ) >*/
a[j + i__ * a_dim1] = stemp * temp + ctemp * a[j
+ i__ * a_dim1];
/*< 30 CONTINUE >*/
/* L30: */
}
/*< END IF >*/
}
/*< 40 CONTINUE >*/
/* L40: */
}
/*< END IF >*/
}
/*< ELSE IF( LSAME( PIVOT, 'T' ) ) THEN >*/
} else if (lsame_(pivot, "T", (ftnlen)1, (ftnlen)1)) {
/*< IF( LSAME( DIRECT, 'F' ) ) THEN >*/
if (lsame_(direct, "F", (ftnlen)1, (ftnlen)1)) {
/*< DO 60 J = 2, M >*/
i__1 = *m;
for (j = 2; j <= i__1; ++j) {
/*< CTEMP = C( J-1 ) >*/
ctemp = c__[j - 1];
/*< STEMP = S( J-1 ) >*/
stemp = s[j - 1];
/*< IF( ( CTEMP.NE.ONE ) .OR. ( STEMP.NE.ZERO ) ) THEN >*/
if (ctemp != 1. || stemp != 0.) {
/*< DO 50 I = 1, N >*/
i__2 = *n;
for (i__ = 1; i__ <= i__2; ++i__) {
/*< TEMP = A( J, I ) >*/
temp = a[j + i__ * a_dim1];
/*< A( J, I ) = CTEMP*TEMP - STEMP*A( 1, I ) >*/
a[j + i__ * a_dim1] = ctemp * temp - stemp * a[
i__ * a_dim1 + 1];
/*< A( 1, I ) = STEMP*TEMP + CTEMP*A( 1, I ) >*/
a[i__ * a_dim1 + 1] = stemp * temp + ctemp * a[
i__ * a_dim1 + 1];
/*< 50 CONTINUE >*/
/* L50: */
}
/*< END IF >*/
}
/*< 60 CONTINUE >*/
/* L60: */
}
/*< ELSE IF( LSAME( DIRECT, 'B' ) ) THEN >*/
} else if (lsame_(direct, "B", (ftnlen)1, (ftnlen)1)) {
/*< DO 80 J = M, 2, -1 >*/
for (j = *m; j >= 2; --j) {
/*< CTEMP = C( J-1 ) >*/
ctemp = c__[j - 1];
/*< STEMP = S( J-1 ) >*/
stemp = s[j - 1];
/*< IF( ( CTEMP.NE.ONE ) .OR. ( STEMP.NE.ZERO ) ) THEN >*/
if (ctemp != 1. || stemp != 0.) {
/*< DO 70 I = 1, N >*/
i__1 = *n;
for (i__ = 1; i__ <= i__1; ++i__) {
/*< TEMP = A( J, I ) >*/
temp = a[j + i__ * a_dim1];
/*< A( J, I ) = CTEMP*TEMP - STEMP*A( 1, I ) >*/
a[j + i__ * a_dim1] = ctemp * temp - stemp * a[
i__ * a_dim1 + 1];
/*< A( 1, I ) = STEMP*TEMP + CTEMP*A( 1, I ) >*/
a[i__ * a_dim1 + 1] = stemp * temp + ctemp * a[
i__ * a_dim1 + 1];
/*< 70 CONTINUE >*/
/* L70: */
}
/*< END IF >*/
}
/*< 80 CONTINUE >*/
/* L80: */
}
/*< END IF >*/
}
/*< ELSE IF( LSAME( PIVOT, 'B' ) ) THEN >*/
} else if (lsame_(pivot, "B", (ftnlen)1, (ftnlen)1)) {
/*< IF( LSAME( DIRECT, 'F' ) ) THEN >*/
if (lsame_(direct, "F", (ftnlen)1, (ftnlen)1)) {
/*< DO 100 J = 1, M - 1 >*/
i__1 = *m - 1;
for (j = 1; j <= i__1; ++j) {
/*< CTEMP = C( J ) >*/
ctemp = c__[j];
/*< STEMP = S( J ) >*/
stemp = s[j];
/*< IF( ( CTEMP.NE.ONE ) .OR. ( STEMP.NE.ZERO ) ) THEN >*/
if (ctemp != 1. || stemp != 0.) {
/*< DO 90 I = 1, N >*/
i__2 = *n;
for (i__ = 1; i__ <= i__2; ++i__) {
/*< TEMP = A( J, I ) >*/
temp = a[j + i__ * a_dim1];
/*< A( J, I ) = STEMP*A( M, I ) + CTEMP*TEMP >*/
a[j + i__ * a_dim1] = stemp * a[*m + i__ * a_dim1]
+ ctemp * temp;
/*< A( M, I ) = CTEMP*A( M, I ) - STEMP*TEMP >*/
a[*m + i__ * a_dim1] = ctemp * a[*m + i__ *
a_dim1] - stemp * temp;
/*< 90 CONTINUE >*/
/* L90: */
}
/*< END IF >*/
}
/*< 100 CONTINUE >*/
/* L100: */
}
/*< ELSE IF( LSAME( DIRECT, 'B' ) ) THEN >*/
} else if (lsame_(direct, "B", (ftnlen)1, (ftnlen)1)) {
/*< DO 120 J = M - 1, 1, -1 >*/
for (j = *m - 1; j >= 1; --j) {
/*< CTEMP = C( J ) >*/
ctemp = c__[j];
/*< STEMP = S( J ) >*/
stemp = s[j];
/*< IF( ( CTEMP.NE.ONE ) .OR. ( STEMP.NE.ZERO ) ) THEN >*/
if (ctemp != 1. || stemp != 0.) {
/*< DO 110 I = 1, N >*/
i__1 = *n;
for (i__ = 1; i__ <= i__1; ++i__) {
/*< TEMP = A( J, I ) >*/
temp = a[j + i__ * a_dim1];
/*< A( J, I ) = STEMP*A( M, I ) + CTEMP*TEMP >*/
a[j + i__ * a_dim1] = stemp * a[*m + i__ * a_dim1]
+ ctemp * temp;
/*< A( M, I ) = CTEMP*A( M, I ) - STEMP*TEMP >*/
a[*m + i__ * a_dim1] = ctemp * a[*m + i__ *
a_dim1] - stemp * temp;
/*< 110 CONTINUE >*/
/* L110: */
}
/*< END IF >*/
}
/*< 120 CONTINUE >*/
/* L120: */
}
/*< END IF >*/
}
/*< END IF >*/
}
/*< ELSE IF( LSAME( SIDE, 'R' ) ) THEN >*/
} else if (lsame_(side, "R", (ftnlen)1, (ftnlen)1)) {
/* Form A * P' */
/*< IF( LSAME( PIVOT, 'V' ) ) THEN >*/
if (lsame_(pivot, "V", (ftnlen)1, (ftnlen)1)) {
/*< IF( LSAME( DIRECT, 'F' ) ) THEN >*/
if (lsame_(direct, "F", (ftnlen)1, (ftnlen)1)) {
/*< DO 140 J = 1, N - 1 >*/
i__1 = *n - 1;
for (j = 1; j <= i__1; ++j) {
/*< CTEMP = C( J ) >*/
ctemp = c__[j];
/*< STEMP = S( J ) >*/
stemp = s[j];
/*< IF( ( CTEMP.NE.ONE ) .OR. ( STEMP.NE.ZERO ) ) THEN >*/
if (ctemp != 1. || stemp != 0.) {
/*< DO 130 I = 1, M >*/
i__2 = *m;
for (i__ = 1; i__ <= i__2; ++i__) {
/*< TEMP = A( I, J+1 ) >*/
temp = a[i__ + (j + 1) * a_dim1];
/*< A( I, J+1 ) = CTEMP*TEMP - STEMP*A( I, J ) >*/
a[i__ + (j + 1) * a_dim1] = ctemp * temp - stemp *
a[i__ + j * a_dim1];
/*< A( I, J ) = STEMP*TEMP + CTEMP*A( I, J ) >*/
a[i__ + j * a_dim1] = stemp * temp + ctemp * a[
i__ + j * a_dim1];
/*< 130 CONTINUE >*/
/* L130: */
}
/*< END IF >*/
}
/*< 140 CONTINUE >*/
/* L140: */
}
/*< ELSE IF( LSAME( DIRECT, 'B' ) ) THEN >*/
} else if (lsame_(direct, "B", (ftnlen)1, (ftnlen)1)) {
/*< DO 160 J = N - 1, 1, -1 >*/
for (j = *n - 1; j >= 1; --j) {
/*< CTEMP = C( J ) >*/
ctemp = c__[j];
/*< STEMP = S( J ) >*/
stemp = s[j];
/*< IF( ( CTEMP.NE.ONE ) .OR. ( STEMP.NE.ZERO ) ) THEN >*/
if (ctemp != 1. || stemp != 0.) {
/*< DO 150 I = 1, M >*/
i__1 = *m;
for (i__ = 1; i__ <= i__1; ++i__) {
/*< TEMP = A( I, J+1 ) >*/
temp = a[i__ + (j + 1) * a_dim1];
/*< A( I, J+1 ) = CTEMP*TEMP - STEMP*A( I, J ) >*/
a[i__ + (j + 1) * a_dim1] = ctemp * temp - stemp *
a[i__ + j * a_dim1];
/*< A( I, J ) = STEMP*TEMP + CTEMP*A( I, J ) >*/
a[i__ + j * a_dim1] = stemp * temp + ctemp * a[
i__ + j * a_dim1];
/*< 150 CONTINUE >*/
/* L150: */
}
/*< END IF >*/
}
/*< 160 CONTINUE >*/
/* L160: */
}
/*< END IF >*/
}
/*< ELSE IF( LSAME( PIVOT, 'T' ) ) THEN >*/
} else if (lsame_(pivot, "T", (ftnlen)1, (ftnlen)1)) {
/*< IF( LSAME( DIRECT, 'F' ) ) THEN >*/
if (lsame_(direct, "F", (ftnlen)1, (ftnlen)1)) {
/*< DO 180 J = 2, N >*/
i__1 = *n;
for (j = 2; j <= i__1; ++j) {
/*< CTEMP = C( J-1 ) >*/
ctemp = c__[j - 1];
/*< STEMP = S( J-1 ) >*/
stemp = s[j - 1];
/*< IF( ( CTEMP.NE.ONE ) .OR. ( STEMP.NE.ZERO ) ) THEN >*/
if (ctemp != 1. || stemp != 0.) {
/*< DO 170 I = 1, M >*/
i__2 = *m;
for (i__ = 1; i__ <= i__2; ++i__) {
/*< TEMP = A( I, J ) >*/
temp = a[i__ + j * a_dim1];
/*< A( I, J ) = CTEMP*TEMP - STEMP*A( I, 1 ) >*/
a[i__ + j * a_dim1] = ctemp * temp - stemp * a[
i__ + a_dim1];
/*< A( I, 1 ) = STEMP*TEMP + CTEMP*A( I, 1 ) >*/
a[i__ + a_dim1] = stemp * temp + ctemp * a[i__ +
a_dim1];
/*< 170 CONTINUE >*/
/* L170: */
}
/*< END IF >*/
}
/*< 180 CONTINUE >*/
/* L180: */
}
/*< ELSE IF( LSAME( DIRECT, 'B' ) ) THEN >*/
} else if (lsame_(direct, "B", (ftnlen)1, (ftnlen)1)) {
/*< DO 200 J = N, 2, -1 >*/
for (j = *n; j >= 2; --j) {
/*< CTEMP = C( J-1 ) >*/
ctemp = c__[j - 1];
/*< STEMP = S( J-1 ) >*/
stemp = s[j - 1];
/*< IF( ( CTEMP.NE.ONE ) .OR. ( STEMP.NE.ZERO ) ) THEN >*/
if (ctemp != 1. || stemp != 0.) {
/*< DO 190 I = 1, M >*/
i__1 = *m;
for (i__ = 1; i__ <= i__1; ++i__) {
/*< TEMP = A( I, J ) >*/
temp = a[i__ + j * a_dim1];
/*< A( I, J ) = CTEMP*TEMP - STEMP*A( I, 1 ) >*/
a[i__ + j * a_dim1] = ctemp * temp - stemp * a[
i__ + a_dim1];
/*< A( I, 1 ) = STEMP*TEMP + CTEMP*A( I, 1 ) >*/
a[i__ + a_dim1] = stemp * temp + ctemp * a[i__ +
a_dim1];
/*< 190 CONTINUE >*/
/* L190: */
}
/*< END IF >*/
}
/*< 200 CONTINUE >*/
/* L200: */
}
/*< END IF >*/
}
/*< ELSE IF( LSAME( PIVOT, 'B' ) ) THEN >*/
} else if (lsame_(pivot, "B", (ftnlen)1, (ftnlen)1)) {
/*< IF( LSAME( DIRECT, 'F' ) ) THEN >*/
if (lsame_(direct, "F", (ftnlen)1, (ftnlen)1)) {
/*< DO 220 J = 1, N - 1 >*/
i__1 = *n - 1;
for (j = 1; j <= i__1; ++j) {
/*< CTEMP = C( J ) >*/
ctemp = c__[j];
/*< STEMP = S( J ) >*/
stemp = s[j];
/*< IF( ( CTEMP.NE.ONE ) .OR. ( STEMP.NE.ZERO ) ) THEN >*/
if (ctemp != 1. || stemp != 0.) {
/*< DO 210 I = 1, M >*/
i__2 = *m;
for (i__ = 1; i__ <= i__2; ++i__) {
/*< TEMP = A( I, J ) >*/
temp = a[i__ + j * a_dim1];
/*< A( I, J ) = STEMP*A( I, N ) + CTEMP*TEMP >*/
a[i__ + j * a_dim1] = stemp * a[i__ + *n * a_dim1]
+ ctemp * temp;
/*< A( I, N ) = CTEMP*A( I, N ) - STEMP*TEMP >*/
a[i__ + *n * a_dim1] = ctemp * a[i__ + *n *
a_dim1] - stemp * temp;
/*< 210 CONTINUE >*/
/* L210: */
}
/*< END IF >*/
}
/*< 220 CONTINUE >*/
/* L220: */
}
/*< ELSE IF( LSAME( DIRECT, 'B' ) ) THEN >*/
} else if (lsame_(direct, "B", (ftnlen)1, (ftnlen)1)) {
/*< DO 240 J = N - 1, 1, -1 >*/
for (j = *n - 1; j >= 1; --j) {
/*< CTEMP = C( J ) >*/
ctemp = c__[j];
/*< STEMP = S( J ) >*/
stemp = s[j];
/*< IF( ( CTEMP.NE.ONE ) .OR. ( STEMP.NE.ZERO ) ) THEN >*/
if (ctemp != 1. || stemp != 0.) {
/*< DO 230 I = 1, M >*/
i__1 = *m;
for (i__ = 1; i__ <= i__1; ++i__) {
/*< TEMP = A( I, J ) >*/
temp = a[i__ + j * a_dim1];
/*< A( I, J ) = STEMP*A( I, N ) + CTEMP*TEMP >*/
a[i__ + j * a_dim1] = stemp * a[i__ + *n * a_dim1]
+ ctemp * temp;
/*< A( I, N ) = CTEMP*A( I, N ) - STEMP*TEMP >*/
a[i__ + *n * a_dim1] = ctemp * a[i__ + *n *
a_dim1] - stemp * temp;
/*< 230 CONTINUE >*/
/* L230: */
}
/*< END IF >*/
}
/*< 240 CONTINUE >*/
/* L240: */
}
/*< END IF >*/
}
/*< END IF >*/
}
/*< END IF >*/
}
/*< RETURN >*/
return 0;
/* End of DLASR */
/*< END >*/
} /* dlasr_ */
#ifdef __cplusplus
}
#endif
| {
"pile_set_name": "Github"
} |
const _ = require('underscore');
const files = require('../fs/files');
const buildmessage = require('../utils/buildmessage.js');
const utils = require('../utils/utils.js');
const runLog = require('./run-log.js');
const release = require('../packaging/release.js');
const Console = require('../console/console.js').Console;
const Proxy = require('./run-proxy.js').Proxy;
const Selenium = require('./run-selenium.js').Selenium;
const AppRunner = require('./run-app.js').AppRunner;
const MongoRunner = require('./run-mongo.js').MongoRunner;
const Updater = require('./run-updater.js').Updater;
class Runner {
constructor({
appHost,
appPort,
banner,
disableOplog,
cordovaRunner,
mongoUrl,
onFailure,
oplogUrl,
projectContext,
proxyHost,
proxyPort,
quiet,
rootUrl,
selenium,
seleniumBrowser,
noReleaseCheck,
...optionsForAppRunner
}) {
const self = this;
self.projectContext = projectContext;
if (typeof proxyPort === 'undefined') {
throw new Error('no proxyPort?');
}
const listenPort = proxyPort;
const mongoPort = parseInt(listenPort, 10) + 1;
self.specifiedAppPort = appPort;
self.regenerateAppPort();
self.stopped = false;
self.noReleaseCheck = noReleaseCheck;
self.quiet = quiet;
self.banner = banner || files.convertToOSPath(
files.prettyPath(self.projectContext.projectDir)
);
if (rootUrl) {
self.rootUrl = rootUrl;
} else {
self.rootUrl = utils.formatUrl({
protocol: 'http',
hostname: proxyHost || "localhost",
port: listenPort,
});
}
self.proxy = new Proxy({
listenPort,
listenHost: proxyHost,
proxyToPort: self.appPort,
proxyToHost: appHost,
onFailure
});
buildmessage.capture(function () {
self.projectContext.resolveConstraints();
});
const packageMap = self.projectContext.packageMap;
const hasMongoDevServerPackage =
packageMap && packageMap.getInfo('mongo-dev-server') != null;
self.mongoRunner = null;
if (mongoUrl) {
oplogUrl = disableOplog ? null : oplogUrl;
} else if (hasMongoDevServerPackage
|| process.env.METEOR_TEST_FAKE_MONGOD_CONTROL_PORT) {
// The mongo-dev-server package is required to start Mongo, but
// tests using fake-mongod are exempted.
self.mongoRunner = new MongoRunner({
projectLocalDir: self.projectContext.projectLocalDir,
port: mongoPort,
onFailure,
// For testing mongod failover, run with 3 mongod if the env var is
// set. Note that data is not preserved from one run to the next.
multiple: !!process.env.METEOR_TEST_MULTIPLE_MONGOD_REPLSET
});
mongoUrl = self.mongoRunner.mongoUrl();
oplogUrl = disableOplog ? null : self.mongoRunner.oplogUrl();
} else {
// Don't start a mongodb server.
// Set monogUrl to a specific value to prevent MongoDB connections
// and to allow a check for printing a message if `mongo-dev-server`
// is added while the app is running.
// The check and message is printed by the `mongo-dev-server` package.
mongoUrl = 'no-mongo-server';
}
self.updater = new Updater();
self.appRunner = new AppRunner({
...optionsForAppRunner,
projectContext: self.projectContext,
port: self.appPort,
listenHost: appHost,
mongoUrl,
oplogUrl,
rootUrl: self.rootUrl,
proxy: self.proxy,
noRestartBanner: self.quiet,
cordovaRunner: cordovaRunner
});
self.selenium = null;
if (selenium) {
self.selenium = new Selenium({
runner: self,
browser: seleniumBrowser
});
}
}
// XXX leave a pidfile and check if we are already running
start() {
const self = this;
self.proxy.start();
// print the banner only once we've successfully bound the port
if (! self.quiet && ! self.stopped) {
runLog.log("[[[[[ " + self.banner + " ]]]]]\n");
runLog.log("Started proxy.", { arrow: true });
}
var unblockAppRunner = self.appRunner.makeBeforeStartPromise();
function startMongo(tries = 3) {
self._startMongoAsync().then(
ok => unblockAppRunner(),
error => {
--tries;
const left = tries + (tries === 1 ? " try" : " tries");
Console.error(
`Error starting Mongo (${left} left): ${error.message}`
);
if (tries > 0) {
self.mongoRunner.stop();
setTimeout(() => startMongo(tries), 1000);
} else {
self.mongoRunner._fail();
}
}
);
}
startMongo();
if (!self.noReleaseCheck && ! self.stopped) {
self.updater.start();
}
if (! self.stopped) {
buildmessage.enterJob({ title: "starting your app" }, function () {
self.appRunner.start();
});
if (! self.quiet && ! self.stopped) {
runLog.log("Started your app.", { arrow: true });
}
}
if (! self.stopped && ! self.quiet) {
runLog.log("");
if (process.env.UNIX_SOCKET_PATH) {
runLog.log(
`App running; UNIX domain socket: ${process.env.UNIX_SOCKET_PATH}`,
{ arrow: true }
);
} else {
runLog.log("App running at: " + self.rootUrl, { arrow: true });
}
if (process.platform === "win32") {
runLog.log(" Type Control-C twice to stop.");
runLog.log("");
}
}
if (self.selenium && ! self.stopped) {
buildmessage.enterJob({ title: "starting Selenium" }, function () {
self.selenium.start();
});
if (! self.quiet && ! self.stopped) {
runLog.log("Started Selenium.", { arrow: true });
}
}
// XXX It'd be nice to (cosmetically) handle failure better. Right
// now we overwrite the "starting foo..." message with the
// error. It'd be better to overwrite it with "failed to start
// foo" and then print the error.
}
async _startMongoAsync() {
if (! this.stopped && this.mongoRunner) {
this.mongoRunner.start();
if (! this.stopped && ! this.quiet) {
runLog.log("Started MongoDB.", { arrow: true });
}
}
}
// Idempotent
stop() {
const self = this;
if (self.stopped) {
return;
}
self.stopped = true;
self.proxy.stop();
self.updater.stop();
self.mongoRunner && self.mongoRunner.stop();
self.appRunner.stop();
self.selenium && self.selenium.stop();
// XXX does calling this 'finish' still make sense now that runLog is a
// singleton?
runLog.finish();
}
// Call this whenever you want to regenerate the app's port (if it is not
// explicitly specified by the user).
//
// Rationale: if we randomly chose a port that's in use and the app failed to
// listen on it, we should try a different port when we restart the app!
regenerateAppPort() {
const self = this;
if (self.specifiedAppPort) {
self.appPort = self.specifiedAppPort;
} else {
self.appPort = require('../utils/utils.js').randomPort();
}
if (self.proxy) {
self.proxy.proxyToPort = self.appPort;
}
if (self.appRunner) {
self.appRunner.port = self.appPort;
}
}
}
// Run the app and all of its associated processes. Runs (and does not
// return) until an unrecoverable failure happens. Logs to
// stdout. Returns a suggested exit code.
//
// If 'once' is set, run the app process exactly once and pass through
// its exit code. Return an exit code of 255 if the app process was
// killed by a signal and 254 if the app process could not start
// (build failure, invalid program name, database couldn't start, and
// so on).
//
// If the 'once' option is not set, the default, restart the app
// process if it crashes or if source files change. (Non-app
// processes, such as the database, are always restarted as
// necessary.) The function will only return if there is an
// unrecoverable error, which generally means an error that could not
// be fixed by source code changes (such as the database refusing to
// run), but also currently includes Meteor version mismatches. So the
// exit code will always be 254 because in all other cases we'll
// persevere.
//
// Options:
//
// - proxyPort: the port to connect to to access the application (we will
// run a proxy here that proxies to the actual app process). required
// - buildOptions: 'buildOptions' argument to bundler.bundle()
// - settingsFile: path to file containing deploy-time settings
// - once: see above
// - banner: replace the application path that is normally printed on
// startup with an arbitrary string (eg, 'Tests')
// - rootUrl: tell the app that traffic at this URL will be routed to
// it at '/' (used by the app to construct absolute URLs)
// - disableOplog: don't use oplog tailing
// - mongoUrl: don't start a mongo process; instead use the mongo at
// this mongo URL
// - oplogUrl: URL of the mongo oplog to use. if mongoUrl isn't
// set (we're starting a mongo) a default will be provided, but can
// be overridden. if mongoUrl is set, you must set this or you don't
// get oplog tailing.
// - recordPackageUsage: (default true) if set to false, don't send
// information about packages used by this app to the package stats
// server.
exports.run = function (options) {
var runOptions = _.clone(options);
var once = runOptions.once;
var promise = new Promise(function (resolve) {
runOptions.onFailure = function () {
// Ensure that runner stops now. You might think this is unnecessary
// because the runner is stopped immediately after promise.await(), but if
// the failure happens while runner.start() is still running, we want the
// rest of start to stop, and it's not like resolve() magically makes
// us jump to a promise.await() that hasn't happened yet!.
runner.stop();
resolve({ outcome: 'failure' });
};
runOptions.onRunEnd = function (result) {
if (once ||
result.outcome === "conflicting-versions" ||
result.outcome === "wrong-release" ||
result.outcome === "outdated-cordova-platforms" ||
result.outcome === "outdated-cordova-plugins" ||
(result.outcome === "terminated" &&
result.signal === undefined && result.code === undefined)) {
resolve(result);
return false; // stop restarting
}
runner.regenerateAppPort();
return true; // restart it
};
});
runOptions.watchForChanges = ! once;
runOptions.quiet = false;
// Ensure process.env.NODE_ENV matches the build mode, with the following precedence:
// 1. Passed in build mode (if development or production)
// 2. Existing process.env.NODE_ENV (if it's valid)
// 3. Default to development (in both cases) otherwise
// NOTE: because this code only runs when using `meteor run` or `meteor test[-packages`,
// We *don't* end up defaulting NODE_ENV in this way when bundling/deploying.
// In those cases, it will default to "production" in packages/meteor/*_env.js
// We *override* NODE_ENV if build mode is one of these values
let buildMode = runOptions.buildOptions.buildMode;
if (buildMode === "development" || buildMode === "production") {
process.env.NODE_ENV = buildMode;
}
let nodeEnv = process.env.NODE_ENV;
// We *never* override buildMode (it can be "test")
if (!buildMode) {
if (nodeEnv === "development" || nodeEnv === "production") {
runOptions.buildOptions.buildMode = nodeEnv;
} else {
runOptions.buildOptions.buildMode = "development";
}
}
if (!nodeEnv) {
process.env.NODE_ENV = "development";
}
var runner = new Runner(runOptions);
runner.start();
var result = promise.await();
runner.stop();
if (result.outcome === "conflicting-versions") {
Console.error(
"The constraint solver could not find a set of package versions to",
"use that would satisfy the constraints of .meteor/versions and",
".meteor/packages. This could be caused by conflicts in",
".meteor/versions, conflicts in .meteor/packages, and/or",
"inconsistent changes to the dependencies in local packages.");
return 254;
}
if (result.outcome === "outdated-cordova-plugins") {
Console.error("Your app's Cordova plugins have changed.");
Console.error("Restart meteor to use the new set of plugins.");
return 254;
}
if (result.outcome === "outdated-cordova-platforms") {
Console.error("Your app's platforms have changed.");
Console.error("Restart meteor to use the new set of platforms.");
return 254;
}
if (result.outcome === "wrong-release") {
if (once) {
// We lost a race where the user ran 'meteor update' and 'meteor
// run --once' simultaneously.
throw new Error("wrong release?");
}
// If the user did not specify a --release on the command line,
// and simultaneously runs `meteor update` during this run, just
// exit and let them restart the run. (We can do something fancy
// like allowing this to work if the tools version didn't change,
// or even springboarding if the tools version does change, but
// this (which prevents weird errors) is a start.)
var from = release.current.getDisplayName();
var to = result.displayReleaseNeeded;
Console.error(
"Your app has been updated to " + to + " from " + from + ".",
"Restart meteor to use the new release.");
return 254;
}
if (result.outcome === "failure" ||
(result.outcome === "terminated" &&
result.signal === undefined && result.code === undefined)) {
// Fatal problem with something other than the app process. An
// explanation should already have been logged.
return 254;
}
if (once && result.outcome === "bundle-fail") {
Console.arrowError("Build failed:\n\n" +
result.errors.formatMessages());
return 254;
}
if (once && result.outcome === "terminated") {
if (result.signal) {
Console.error("Killed (" + result.signal + ")");
return 255;
} else if (typeof result.code === "number") {
// We used to print 'Your application is exiting' here, but that
// seems unnecessarily chatty? once mode is otherwise silent
return result.code;
} else {
// If there is neither a code nor a signal, it means that we
// failed to start the process. We logged the reason. Probably a
// bad program name.
return 254;
}
}
throw new Error("unexpected outcome " + result.outcome);
};
| {
"pile_set_name": "Github"
} |
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee180e88926">
<name type="corporate">
<namePart>United States Government Printing Office</namePart>
<role>
<roleTerm type="text" authority="marcrelator">printer</roleTerm>
<roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
<role>
<roleTerm type="text" authority="marcrelator">distributor</roleTerm>
<roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
<namePart>United States</namePart>
<namePart>United States Court of Appeals for the Eighth Circuit</namePart>
<role>
<roleTerm type="text" authority="marcrelator">author</roleTerm>
<roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
<description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
<languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
<collectionCode>USCOURTS</collectionCode>
<category>Judicial Publications</category>
<branch>judicial</branch>
<dateIngested>2011-10-14</dateIngested>
</extension>
<originInfo>
<publisher>Administrative Office of the United States Courts</publisher>
<dateIssued encoding="w3cdtf">2010-01-14</dateIssued>
<issuance>monographic</issuance>
</originInfo>
<physicalDescription>
<note type="source content type">deposited</note>
<digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 2.11</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-ca8-08-02389</identifier>
<identifier type="local">P0b002ee180e88926</identifier>
<recordInfo>
<recordContentSource authority="marcorg">DGPO</recordContentSource>
<recordCreationDate encoding="w3cdtf">2011-10-14</recordCreationDate>
<recordChangeDate encoding="w3cdtf">2011-10-14</recordChangeDate>
<recordIdentifier source="DGPO">USCOURTS-ca8-08-02389</recordIdentifier>
<recordOrigin>machine generated</recordOrigin>
<languageOfCataloging>
<languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
<docClass>USCOURTS</docClass>
<accessId>USCOURTS-ca8-08-02389</accessId>
<courtType>Appellate</courtType>
<courtCode>ca8</courtCode>
<courtCircuit>8th</courtCircuit>
<courtSortOrder>1080</courtSortOrder>
<caseNumber>08-02389</caseNumber>
<party firstName="Juan" fullName="Juan C. Polanco" lastName="Polanco" middleName="C." role="Appellant"></party>
<party fullName="United States of America" lastName="United States of America" role="Appellee"></party>
</extension>
<titleInfo>
<title>United States v. Juan Polanco</title>
<partNumber>08-02389</partNumber>
</titleInfo>
<location>
<url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-ca8-08-02389/content-detail.html</url>
</location>
<classification authority="sudocs">JU 2.11</classification>
<identifier type="preferred citation">08-02389;08-2389</identifier>
<name type="corporate">
<namePart>United States Court of Appeals for the Eighth Circuit</namePart>
<namePart>8th Circuit</namePart>
<namePart></namePart>
<affiliation>U.S. Courts</affiliation>
<role>
<roleTerm authority="marcrelator" type="text">author</roleTerm>
<roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
<displayForm>Juan C. Polanco</displayForm>
<namePart type="family">Polanco</namePart>
<namePart type="given">Juan</namePart>
<namePart type="termsOfAddress"></namePart>
<description>Appellant</description>
</name>
<name type="personal">
<displayForm>United States of America</displayForm>
<namePart type="family">United States of America</namePart>
<namePart type="given"></namePart>
<namePart type="termsOfAddress"></namePart>
<description>Appellee</description>
</name>
<extension>
<docClass>USCOURTS</docClass>
<accessId>USCOURTS-ca8-08-02389</accessId>
<courtType>Appellate</courtType>
<courtCode>ca8</courtCode>
<courtCircuit>8th</courtCircuit>
<courtSortOrder>1080</courtSortOrder>
<caseNumber>08-02389</caseNumber>
<party firstName="Juan" fullName="Juan C. Polanco" lastName="Polanco" middleName="C." role="Appellant"></party>
<party fullName="United States of America" lastName="United States of America" role="Appellee"></party>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-ca8-08-02389-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ca8-08-02389/USCOURTS-ca8-08-02389-0/mods.xml">
<titleInfo>
<title>United States v. Juan Polanco</title>
<subTitle>PER CURIAM OPINION FILED - THE COURT: DIANA E. MURPHY, STEVEN M. COLLOTON and BOBBY E. SHEPHERD (UNPUBLISHED) [3624321] [08-2389]</subTitle>
<partNumber>0</partNumber>
</titleInfo>
<originInfo>
<dateIssued>2010-01-14</dateIssued>
</originInfo>
<relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ca8-08-02389-0.pdf" type="otherFormat">
<identifier type="FDsys Unique ID">D09002ee180e96df2</identifier>
</relatedItem>
<identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ca8-08-02389/USCOURTS-ca8-08-02389-0</identifier>
<identifier type="former granule identifier">ca8-08-02389_0.pdf</identifier>
<location>
<url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ca8-08-02389/USCOURTS-ca8-08-02389-0/content-detail.html</url>
<url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ca8-08-02389/pdf/USCOURTS-ca8-08-02389-0.pdf</url>
</location>
<extension>
<searchTitle>USCOURTS 08-02389; United States v. Juan Polanco; </searchTitle>
<courtName>United States Court of Appeals for the Eighth Circuit</courtName>
<accessId>USCOURTS-ca8-08-02389-0</accessId>
<sequenceNumber>0</sequenceNumber>
<dateIssued>2010-01-14</dateIssued>
<docketText>PER CURIAM OPINION FILED - THE COURT: DIANA E. MURPHY, STEVEN M. COLLOTON and BOBBY E. SHEPHERD (UNPUBLISHED) [3624321] [08-2389]</docketText>
</extension>
</relatedItem>
</mods> | {
"pile_set_name": "Github"
} |
/*
* Copyright © 2012 Intel Corporation
*
* 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 (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Authors:
* Ben Widawsky <[email protected]>
*
*/
#include <linux/device.h>
#include <linux/module.h>
#include <linux/stat.h>
#include <linux/sysfs.h>
#include "intel_drv.h"
#include "i915_drv.h"
static inline struct drm_i915_private *kdev_minor_to_i915(struct device *kdev)
{
struct drm_minor *minor = dev_get_drvdata(kdev);
return to_i915(minor->dev);
}
#ifdef CONFIG_PM
static u32 calc_residency(struct drm_i915_private *dev_priv,
i915_reg_t reg)
{
u64 raw_time; /* 32b value may overflow during fixed point math */
u64 units = 128ULL, div = 100000ULL;
u32 ret;
if (!intel_enable_rc6())
return 0;
intel_runtime_pm_get(dev_priv);
/* On VLV and CHV, residency time is in CZ units rather than 1.28us */
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
units = 1;
div = dev_priv->czclk_freq;
if (I915_READ(VLV_COUNTER_CONTROL) & VLV_COUNT_RANGE_HIGH)
units <<= 8;
} else if (IS_BROXTON(dev_priv)) {
units = 1;
div = 1200; /* 833.33ns */
}
raw_time = I915_READ(reg) * units;
ret = DIV_ROUND_UP_ULL(raw_time, div);
intel_runtime_pm_put(dev_priv);
return ret;
}
static ssize_t
show_rc6_mask(struct device *kdev, struct device_attribute *attr, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%x\n", intel_enable_rc6());
}
static ssize_t
show_rc6_ms(struct device *kdev, struct device_attribute *attr, char *buf)
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
u32 rc6_residency = calc_residency(dev_priv, GEN6_GT_GFX_RC6);
return snprintf(buf, PAGE_SIZE, "%u\n", rc6_residency);
}
static ssize_t
show_rc6p_ms(struct device *kdev, struct device_attribute *attr, char *buf)
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
u32 rc6p_residency = calc_residency(dev_priv, GEN6_GT_GFX_RC6p);
return snprintf(buf, PAGE_SIZE, "%u\n", rc6p_residency);
}
static ssize_t
show_rc6pp_ms(struct device *kdev, struct device_attribute *attr, char *buf)
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
u32 rc6pp_residency = calc_residency(dev_priv, GEN6_GT_GFX_RC6pp);
return snprintf(buf, PAGE_SIZE, "%u\n", rc6pp_residency);
}
static ssize_t
show_media_rc6_ms(struct device *kdev, struct device_attribute *attr, char *buf)
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
u32 rc6_residency = calc_residency(dev_priv, VLV_GT_MEDIA_RC6);
return snprintf(buf, PAGE_SIZE, "%u\n", rc6_residency);
}
static DEVICE_ATTR(rc6_enable, S_IRUGO, show_rc6_mask, NULL);
static DEVICE_ATTR(rc6_residency_ms, S_IRUGO, show_rc6_ms, NULL);
static DEVICE_ATTR(rc6p_residency_ms, S_IRUGO, show_rc6p_ms, NULL);
static DEVICE_ATTR(rc6pp_residency_ms, S_IRUGO, show_rc6pp_ms, NULL);
static DEVICE_ATTR(media_rc6_residency_ms, S_IRUGO, show_media_rc6_ms, NULL);
static struct attribute *rc6_attrs[] = {
&dev_attr_rc6_enable.attr,
&dev_attr_rc6_residency_ms.attr,
NULL
};
static struct attribute_group rc6_attr_group = {
.name = power_group_name,
.attrs = rc6_attrs
};
static struct attribute *rc6p_attrs[] = {
&dev_attr_rc6p_residency_ms.attr,
&dev_attr_rc6pp_residency_ms.attr,
NULL
};
static struct attribute_group rc6p_attr_group = {
.name = power_group_name,
.attrs = rc6p_attrs
};
static struct attribute *media_rc6_attrs[] = {
&dev_attr_media_rc6_residency_ms.attr,
NULL
};
static struct attribute_group media_rc6_attr_group = {
.name = power_group_name,
.attrs = media_rc6_attrs
};
#endif
static int l3_access_valid(struct drm_i915_private *dev_priv, loff_t offset)
{
if (!HAS_L3_DPF(dev_priv))
return -EPERM;
if (offset % 4 != 0)
return -EINVAL;
if (offset >= GEN7_L3LOG_SIZE)
return -ENXIO;
return 0;
}
static ssize_t
i915_l3_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *attr, char *buf,
loff_t offset, size_t count)
{
struct device *kdev = kobj_to_dev(kobj);
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
struct drm_device *dev = &dev_priv->drm;
int slice = (int)(uintptr_t)attr->private;
int ret;
count = round_down(count, 4);
ret = l3_access_valid(dev_priv, offset);
if (ret)
return ret;
count = min_t(size_t, GEN7_L3LOG_SIZE - offset, count);
ret = i915_mutex_lock_interruptible(dev);
if (ret)
return ret;
if (dev_priv->l3_parity.remap_info[slice])
memcpy(buf,
dev_priv->l3_parity.remap_info[slice] + (offset/4),
count);
else
memset(buf, 0, count);
mutex_unlock(&dev->struct_mutex);
return count;
}
static ssize_t
i915_l3_write(struct file *filp, struct kobject *kobj,
struct bin_attribute *attr, char *buf,
loff_t offset, size_t count)
{
struct device *kdev = kobj_to_dev(kobj);
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
struct drm_device *dev = &dev_priv->drm;
struct i915_gem_context *ctx;
u32 *temp = NULL; /* Just here to make handling failures easy */
int slice = (int)(uintptr_t)attr->private;
int ret;
if (!HAS_HW_CONTEXTS(dev_priv))
return -ENXIO;
ret = l3_access_valid(dev_priv, offset);
if (ret)
return ret;
ret = i915_mutex_lock_interruptible(dev);
if (ret)
return ret;
if (!dev_priv->l3_parity.remap_info[slice]) {
temp = kzalloc(GEN7_L3LOG_SIZE, GFP_KERNEL);
if (!temp) {
mutex_unlock(&dev->struct_mutex);
return -ENOMEM;
}
}
/* TODO: Ideally we really want a GPU reset here to make sure errors
* aren't propagated. Since I cannot find a stable way to reset the GPU
* at this point it is left as a TODO.
*/
if (temp)
dev_priv->l3_parity.remap_info[slice] = temp;
memcpy(dev_priv->l3_parity.remap_info[slice] + (offset/4), buf, count);
/* NB: We defer the remapping until we switch to the context */
list_for_each_entry(ctx, &dev_priv->context_list, link)
ctx->remap_slice |= (1<<slice);
mutex_unlock(&dev->struct_mutex);
return count;
}
static struct bin_attribute dpf_attrs = {
.attr = {.name = "l3_parity", .mode = (S_IRUSR | S_IWUSR)},
.size = GEN7_L3LOG_SIZE,
.read = i915_l3_read,
.write = i915_l3_write,
.mmap = NULL,
.private = (void *)0
};
static struct bin_attribute dpf_attrs_1 = {
.attr = {.name = "l3_parity_slice_1", .mode = (S_IRUSR | S_IWUSR)},
.size = GEN7_L3LOG_SIZE,
.read = i915_l3_read,
.write = i915_l3_write,
.mmap = NULL,
.private = (void *)1
};
static ssize_t gt_act_freq_mhz_show(struct device *kdev,
struct device_attribute *attr, char *buf)
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
int ret;
intel_runtime_pm_get(dev_priv);
mutex_lock(&dev_priv->rps.hw_lock);
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
u32 freq;
freq = vlv_punit_read(dev_priv, PUNIT_REG_GPU_FREQ_STS);
ret = intel_gpu_freq(dev_priv, (freq >> 8) & 0xff);
} else {
u32 rpstat = I915_READ(GEN6_RPSTAT1);
if (IS_GEN9(dev_priv))
ret = (rpstat & GEN9_CAGF_MASK) >> GEN9_CAGF_SHIFT;
else if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
ret = (rpstat & HSW_CAGF_MASK) >> HSW_CAGF_SHIFT;
else
ret = (rpstat & GEN6_CAGF_MASK) >> GEN6_CAGF_SHIFT;
ret = intel_gpu_freq(dev_priv, ret);
}
mutex_unlock(&dev_priv->rps.hw_lock);
intel_runtime_pm_put(dev_priv);
return snprintf(buf, PAGE_SIZE, "%d\n", ret);
}
static ssize_t gt_cur_freq_mhz_show(struct device *kdev,
struct device_attribute *attr, char *buf)
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
return snprintf(buf, PAGE_SIZE, "%d\n",
intel_gpu_freq(dev_priv,
dev_priv->rps.cur_freq));
}
static ssize_t gt_boost_freq_mhz_show(struct device *kdev, struct device_attribute *attr, char *buf)
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
return snprintf(buf, PAGE_SIZE, "%d\n",
intel_gpu_freq(dev_priv,
dev_priv->rps.boost_freq));
}
static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
u32 val;
ssize_t ret;
ret = kstrtou32(buf, 0, &val);
if (ret)
return ret;
/* Validate against (static) hardware limits */
val = intel_freq_opcode(dev_priv, val);
if (val < dev_priv->rps.min_freq || val > dev_priv->rps.max_freq)
return -EINVAL;
mutex_lock(&dev_priv->rps.hw_lock);
dev_priv->rps.boost_freq = val;
mutex_unlock(&dev_priv->rps.hw_lock);
return count;
}
static ssize_t vlv_rpe_freq_mhz_show(struct device *kdev,
struct device_attribute *attr, char *buf)
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
return snprintf(buf, PAGE_SIZE, "%d\n",
intel_gpu_freq(dev_priv,
dev_priv->rps.efficient_freq));
}
static ssize_t gt_max_freq_mhz_show(struct device *kdev, struct device_attribute *attr, char *buf)
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
return snprintf(buf, PAGE_SIZE, "%d\n",
intel_gpu_freq(dev_priv,
dev_priv->rps.max_freq_softlimit));
}
static ssize_t gt_max_freq_mhz_store(struct device *kdev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
u32 val;
ssize_t ret;
ret = kstrtou32(buf, 0, &val);
if (ret)
return ret;
intel_runtime_pm_get(dev_priv);
mutex_lock(&dev_priv->rps.hw_lock);
val = intel_freq_opcode(dev_priv, val);
if (val < dev_priv->rps.min_freq ||
val > dev_priv->rps.max_freq ||
val < dev_priv->rps.min_freq_softlimit) {
mutex_unlock(&dev_priv->rps.hw_lock);
intel_runtime_pm_put(dev_priv);
return -EINVAL;
}
if (val > dev_priv->rps.rp0_freq)
DRM_DEBUG("User requested overclocking to %d\n",
intel_gpu_freq(dev_priv, val));
dev_priv->rps.max_freq_softlimit = val;
val = clamp_t(int, dev_priv->rps.cur_freq,
dev_priv->rps.min_freq_softlimit,
dev_priv->rps.max_freq_softlimit);
/* We still need *_set_rps to process the new max_delay and
* update the interrupt limits and PMINTRMSK even though
* frequency request may be unchanged. */
intel_set_rps(dev_priv, val);
mutex_unlock(&dev_priv->rps.hw_lock);
intel_runtime_pm_put(dev_priv);
return count;
}
static ssize_t gt_min_freq_mhz_show(struct device *kdev, struct device_attribute *attr, char *buf)
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
return snprintf(buf, PAGE_SIZE, "%d\n",
intel_gpu_freq(dev_priv,
dev_priv->rps.min_freq_softlimit));
}
static ssize_t gt_min_freq_mhz_store(struct device *kdev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
u32 val;
ssize_t ret;
ret = kstrtou32(buf, 0, &val);
if (ret)
return ret;
intel_runtime_pm_get(dev_priv);
mutex_lock(&dev_priv->rps.hw_lock);
val = intel_freq_opcode(dev_priv, val);
if (val < dev_priv->rps.min_freq ||
val > dev_priv->rps.max_freq ||
val > dev_priv->rps.max_freq_softlimit) {
mutex_unlock(&dev_priv->rps.hw_lock);
intel_runtime_pm_put(dev_priv);
return -EINVAL;
}
dev_priv->rps.min_freq_softlimit = val;
val = clamp_t(int, dev_priv->rps.cur_freq,
dev_priv->rps.min_freq_softlimit,
dev_priv->rps.max_freq_softlimit);
/* We still need *_set_rps to process the new min_delay and
* update the interrupt limits and PMINTRMSK even though
* frequency request may be unchanged. */
intel_set_rps(dev_priv, val);
mutex_unlock(&dev_priv->rps.hw_lock);
intel_runtime_pm_put(dev_priv);
return count;
}
static DEVICE_ATTR(gt_act_freq_mhz, S_IRUGO, gt_act_freq_mhz_show, NULL);
static DEVICE_ATTR(gt_cur_freq_mhz, S_IRUGO, gt_cur_freq_mhz_show, NULL);
static DEVICE_ATTR(gt_boost_freq_mhz, S_IRUGO | S_IWUSR, gt_boost_freq_mhz_show, gt_boost_freq_mhz_store);
static DEVICE_ATTR(gt_max_freq_mhz, S_IRUGO | S_IWUSR, gt_max_freq_mhz_show, gt_max_freq_mhz_store);
static DEVICE_ATTR(gt_min_freq_mhz, S_IRUGO | S_IWUSR, gt_min_freq_mhz_show, gt_min_freq_mhz_store);
static DEVICE_ATTR(vlv_rpe_freq_mhz, S_IRUGO, vlv_rpe_freq_mhz_show, NULL);
static ssize_t gt_rp_mhz_show(struct device *kdev, struct device_attribute *attr, char *buf);
static DEVICE_ATTR(gt_RP0_freq_mhz, S_IRUGO, gt_rp_mhz_show, NULL);
static DEVICE_ATTR(gt_RP1_freq_mhz, S_IRUGO, gt_rp_mhz_show, NULL);
static DEVICE_ATTR(gt_RPn_freq_mhz, S_IRUGO, gt_rp_mhz_show, NULL);
/* For now we have a static number of RP states */
static ssize_t gt_rp_mhz_show(struct device *kdev, struct device_attribute *attr, char *buf)
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
u32 val;
if (attr == &dev_attr_gt_RP0_freq_mhz)
val = intel_gpu_freq(dev_priv, dev_priv->rps.rp0_freq);
else if (attr == &dev_attr_gt_RP1_freq_mhz)
val = intel_gpu_freq(dev_priv, dev_priv->rps.rp1_freq);
else if (attr == &dev_attr_gt_RPn_freq_mhz)
val = intel_gpu_freq(dev_priv, dev_priv->rps.min_freq);
else
BUG();
return snprintf(buf, PAGE_SIZE, "%d\n", val);
}
static const struct attribute *gen6_attrs[] = {
&dev_attr_gt_act_freq_mhz.attr,
&dev_attr_gt_cur_freq_mhz.attr,
&dev_attr_gt_boost_freq_mhz.attr,
&dev_attr_gt_max_freq_mhz.attr,
&dev_attr_gt_min_freq_mhz.attr,
&dev_attr_gt_RP0_freq_mhz.attr,
&dev_attr_gt_RP1_freq_mhz.attr,
&dev_attr_gt_RPn_freq_mhz.attr,
NULL,
};
static const struct attribute *vlv_attrs[] = {
&dev_attr_gt_act_freq_mhz.attr,
&dev_attr_gt_cur_freq_mhz.attr,
&dev_attr_gt_boost_freq_mhz.attr,
&dev_attr_gt_max_freq_mhz.attr,
&dev_attr_gt_min_freq_mhz.attr,
&dev_attr_gt_RP0_freq_mhz.attr,
&dev_attr_gt_RP1_freq_mhz.attr,
&dev_attr_gt_RPn_freq_mhz.attr,
&dev_attr_vlv_rpe_freq_mhz.attr,
NULL,
};
static ssize_t error_state_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *attr, char *buf,
loff_t off, size_t count)
{
struct device *kdev = kobj_to_dev(kobj);
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
struct drm_device *dev = &dev_priv->drm;
struct i915_error_state_file_priv error_priv;
struct drm_i915_error_state_buf error_str;
ssize_t ret_count = 0;
int ret;
memset(&error_priv, 0, sizeof(error_priv));
ret = i915_error_state_buf_init(&error_str, to_i915(dev), count, off);
if (ret)
return ret;
error_priv.dev = dev;
i915_error_state_get(dev, &error_priv);
ret = i915_error_state_to_str(&error_str, &error_priv);
if (ret)
goto out;
ret_count = count < error_str.bytes ? count : error_str.bytes;
memcpy(buf, error_str.buf, ret_count);
out:
i915_error_state_put(&error_priv);
i915_error_state_buf_release(&error_str);
return ret ?: ret_count;
}
static ssize_t error_state_write(struct file *file, struct kobject *kobj,
struct bin_attribute *attr, char *buf,
loff_t off, size_t count)
{
struct device *kdev = kobj_to_dev(kobj);
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
DRM_DEBUG_DRIVER("Resetting error state\n");
i915_destroy_error_state(&dev_priv->drm);
return count;
}
static struct bin_attribute error_state_attr = {
.attr.name = "error",
.attr.mode = S_IRUSR | S_IWUSR,
.size = 0,
.read = error_state_read,
.write = error_state_write,
};
void i915_setup_sysfs(struct drm_i915_private *dev_priv)
{
struct device *kdev = dev_priv->drm.primary->kdev;
int ret;
#ifdef CONFIG_PM
if (HAS_RC6(dev_priv)) {
ret = sysfs_merge_group(&kdev->kobj,
&rc6_attr_group);
if (ret)
DRM_ERROR("RC6 residency sysfs setup failed\n");
}
if (HAS_RC6p(dev_priv)) {
ret = sysfs_merge_group(&kdev->kobj,
&rc6p_attr_group);
if (ret)
DRM_ERROR("RC6p residency sysfs setup failed\n");
}
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
ret = sysfs_merge_group(&kdev->kobj,
&media_rc6_attr_group);
if (ret)
DRM_ERROR("Media RC6 residency sysfs setup failed\n");
}
#endif
if (HAS_L3_DPF(dev_priv)) {
ret = device_create_bin_file(kdev, &dpf_attrs);
if (ret)
DRM_ERROR("l3 parity sysfs setup failed\n");
if (NUM_L3_SLICES(dev_priv) > 1) {
ret = device_create_bin_file(kdev,
&dpf_attrs_1);
if (ret)
DRM_ERROR("l3 parity slice 1 setup failed\n");
}
}
ret = 0;
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
ret = sysfs_create_files(&kdev->kobj, vlv_attrs);
else if (INTEL_GEN(dev_priv) >= 6)
ret = sysfs_create_files(&kdev->kobj, gen6_attrs);
if (ret)
DRM_ERROR("RPS sysfs setup failed\n");
ret = sysfs_create_bin_file(&kdev->kobj,
&error_state_attr);
if (ret)
DRM_ERROR("error_state sysfs setup failed\n");
}
void i915_teardown_sysfs(struct drm_i915_private *dev_priv)
{
struct device *kdev = dev_priv->drm.primary->kdev;
sysfs_remove_bin_file(&kdev->kobj, &error_state_attr);
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
sysfs_remove_files(&kdev->kobj, vlv_attrs);
else
sysfs_remove_files(&kdev->kobj, gen6_attrs);
device_remove_bin_file(kdev, &dpf_attrs_1);
device_remove_bin_file(kdev, &dpf_attrs);
#ifdef CONFIG_PM
sysfs_unmerge_group(&kdev->kobj, &rc6_attr_group);
sysfs_unmerge_group(&kdev->kobj, &rc6p_attr_group);
#endif
}
| {
"pile_set_name": "Github"
} |
apiVersion: v1
name: chihaya
home: https://chihaya.io
version: 0.1.0
description: A Helm chart for running the Chihaya BitTorrent tracker on Kubernetes.
sources:
- https://github.com/chihaya/chihaya
maintainers:
- name: Jimmy Zelinskie
email: [email protected]
| {
"pile_set_name": "Github"
} |
<?php declare(strict_types=1);
namespace PhpParser\Builder;
use PhpParser;
use PhpParser\BuilderHelpers;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\NullableType;
use PhpParser\Node\Stmt;
class Property implements PhpParser\Builder
{
protected $name;
protected $flags = 0;
protected $default = null;
protected $attributes = [];
/** @var null|Identifier|Name|NullableType */
protected $type;
/**
* Creates a property builder.
*
* @param string $name Name of the property
*/
public function __construct(string $name) {
$this->name = $name;
}
/**
* Makes the property public.
*
* @return $this The builder instance (for fluid interface)
*/
public function makePublic() {
$this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC);
return $this;
}
/**
* Makes the property protected.
*
* @return $this The builder instance (for fluid interface)
*/
public function makeProtected() {
$this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED);
return $this;
}
/**
* Makes the property private.
*
* @return $this The builder instance (for fluid interface)
*/
public function makePrivate() {
$this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE);
return $this;
}
/**
* Makes the property static.
*
* @return $this The builder instance (for fluid interface)
*/
public function makeStatic() {
$this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_STATIC);
return $this;
}
/**
* Sets default value for the property.
*
* @param mixed $value Default value to use
*
* @return $this The builder instance (for fluid interface)
*/
public function setDefault($value) {
$this->default = BuilderHelpers::normalizeValue($value);
return $this;
}
/**
* Sets doc comment for the property.
*
* @param PhpParser\Comment\Doc|string $docComment Doc comment to set
*
* @return $this The builder instance (for fluid interface)
*/
public function setDocComment($docComment) {
$this->attributes = [
'comments' => [BuilderHelpers::normalizeDocComment($docComment)]
];
return $this;
}
/**
* Sets the property type for PHP 7.4+.
*
* @param string|Name|NullableType|Identifier $type
*
* @return $this
*/
public function setType($type) {
$this->type = BuilderHelpers::normalizeType($type);
return $this;
}
/**
* Returns the built class node.
*
* @return Stmt\Property The built property node
*/
public function getNode() : PhpParser\Node {
return new Stmt\Property(
$this->flags !== 0 ? $this->flags : Stmt\Class_::MODIFIER_PUBLIC,
[
new Stmt\PropertyProperty($this->name, $this->default)
],
$this->attributes,
$this->type
);
}
}
| {
"pile_set_name": "Github"
} |
# Stubs for Python 2.7 md5 stdlib module
from hashlib import md5 as md5, md5 as new
blocksize: int
digest_size: int
| {
"pile_set_name": "Github"
} |
{{define "Next/author-articles.html"}}
<!DOCTYPE html>
<html>
<head>
{{template "head/head" .}}
{{template "head/3rdstatistic" .}}
</head>
<body>
<div class="main">
{{template "Next/header" .}}
<div id="pjax">
{{if .pjax}}{{noescape "<!---- pjax {#pjax} start ---->"}}{{end}}
<div class="wrapper">
<h2 class="page__articles">
{{.Author.Name}}
<span id="authorCount" class="ft__fade">0</span> <span class="ft__fade ft__13">{{.I18n.Article2}}</span>
</h2>
{{template "Next/article-list" .}}
</div>
{{template "Next/side" .}}
{{if .pjax}}{{noescape "<!---- pjax {#pjax} end ---->"}}{{end}}
</div>
{{template "Next/footer" .}}
</div>
{{if .pjax}}{{noescape "<!---- pjax {#pjax} start ---->"}}{{end}}
<script>
increase({{.Author.ArticleCount}}, 1000, 'authorCount', 0)
</script>
{{if .pjax}}{{noescape "<!---- pjax {#pjax} end ---->"}}{{end}}
</body>
</html>
{{end}} | {
"pile_set_name": "Github"
} |
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
| {
"pile_set_name": "Github"
} |
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
// Hinnant & John Maddock 2000.
// 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 BOOST_TT_IS_MEMBER_FUNCTION_POINTER_CXX_03_HPP_INCLUDED
#define BOOST_TT_IS_MEMBER_FUNCTION_POINTER_CXX_03_HPP_INCLUDED
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
//
// Note: we use the "workaround" version for MSVC because it works for
// __stdcall etc function types, where as the partial specialisation
// version does not do so.
//
# include <boost/type_traits/detail/is_mem_fun_pointer_impl.hpp>
# include <boost/type_traits/remove_cv.hpp>
# include <boost/type_traits/integral_constant.hpp>
#else
# include <boost/type_traits/is_reference.hpp>
# include <boost/type_traits/is_array.hpp>
# include <boost/type_traits/detail/yes_no_type.hpp>
# include <boost/type_traits/detail/is_mem_fun_pointer_tester.hpp>
#endif
namespace boost {
#if defined( __CODEGEARC__ )
template <class T> struct is_member_function_pointer : public integral_constant<bool, __is_member_function_pointer( T )> {};
#elif !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
template <class T> struct is_member_function_pointer
: public ::boost::integral_constant<bool, ::boost::type_traits::is_mem_fun_pointer_impl<typename remove_cv<T>::type>::value>{};
#else
namespace detail {
#ifndef __BORLANDC__
template <bool>
struct is_mem_fun_pointer_select
{
template <class T> struct result_ : public false_type{};
};
template <>
struct is_mem_fun_pointer_select<false>
{
template <typename T> struct result_
{
#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
#pragma warning(push)
#pragma warning(disable:6334)
#endif
static T* make_t;
typedef result_<T> self_type;
BOOST_STATIC_CONSTANT(
bool, value = (
1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(self_type::make_t))
));
#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
#pragma warning(pop)
#endif
};
};
template <typename T>
struct is_member_function_pointer_impl
: public is_mem_fun_pointer_select<
::boost::is_reference<T>::value || ::boost::is_array<T>::value>::template result_<T>{};
template <typename T>
struct is_member_function_pointer_impl<T&> : public false_type{};
#else // Borland C++
template <typename T>
struct is_member_function_pointer_impl
{
static T* m_t;
BOOST_STATIC_CONSTANT(
bool, value =
(1 == sizeof(type_traits::is_mem_fun_pointer_tester(m_t))) );
};
template <typename T>
struct is_member_function_pointer_impl<T&>
{
BOOST_STATIC_CONSTANT(bool, value = false);
};
#endif
template<> struct is_member_function_pointer_impl<void> : public false_type{};
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
template<> struct is_member_function_pointer_impl<void const> : public false_type{};
template<> struct is_member_function_pointer_impl<void const volatile> : public false_type{};
template<> struct is_member_function_pointer_impl<void volatile> : public false_type{};
#endif
} // namespace detail
template <class T>
struct is_member_function_pointer
: public integral_constant<bool, ::boost::detail::is_member_function_pointer_impl<T>::value>{};
#endif
} // namespace boost
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
| {
"pile_set_name": "Github"
} |
/**
* Copyright (c) 2014 - 2018, Nordic Semiconductor ASA
*
* 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, except as embedded into a Nordic
* Semiconductor ASA integrated circuit in a product or a software update for
* such product, must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* 4. This software, with or without modification, must only be used with a
* Nordic Semiconductor ASA integrated circuit.
*
* 5. Any software provided in binary form under this license must not be reverse
* engineered, decompiled, modified and/or disassembled.
*
* THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef NRF_LPCOMP_H_
#define NRF_LPCOMP_H_
#include <nrfx.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup nrf_lpcomp_hal LPCOMP HAL
* @{
* @ingroup nrf_lpcomp
* @brief Hardware access layer for managing the Low Power Comparator (LPCOMP) peripheral.
*/
/**
* @enum nrf_lpcomp_ref_t
* @brief LPCOMP reference selection.
*/
typedef enum
{
#if (LPCOMP_REFSEL_RESOLUTION == 8) || defined(__NRFX_DOXYGEN__)
NRF_LPCOMP_REF_SUPPLY_1_8 = LPCOMP_REFSEL_REFSEL_SupplyOneEighthPrescaling, /**< Use supply with a 1/8 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_2_8 = LPCOMP_REFSEL_REFSEL_SupplyTwoEighthsPrescaling, /**< Use supply with a 2/8 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_3_8 = LPCOMP_REFSEL_REFSEL_SupplyThreeEighthsPrescaling, /**< Use supply with a 3/8 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_4_8 = LPCOMP_REFSEL_REFSEL_SupplyFourEighthsPrescaling, /**< Use supply with a 4/8 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_5_8 = LPCOMP_REFSEL_REFSEL_SupplyFiveEighthsPrescaling, /**< Use supply with a 5/8 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_6_8 = LPCOMP_REFSEL_REFSEL_SupplySixEighthsPrescaling, /**< Use supply with a 6/8 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_7_8 = LPCOMP_REFSEL_REFSEL_SupplySevenEighthsPrescaling, /**< Use supply with a 7/8 prescaler as reference. */
#elif (LPCOMP_REFSEL_RESOLUTION == 16) || defined(__NRFX_DOXYGEN__)
NRF_LPCOMP_REF_SUPPLY_1_8 = LPCOMP_REFSEL_REFSEL_Ref1_8Vdd, /**< Use supply with a 1/8 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_2_8 = LPCOMP_REFSEL_REFSEL_Ref2_8Vdd, /**< Use supply with a 2/8 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_3_8 = LPCOMP_REFSEL_REFSEL_Ref3_8Vdd, /**< Use supply with a 3/8 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_4_8 = LPCOMP_REFSEL_REFSEL_Ref4_8Vdd, /**< Use supply with a 4/8 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_5_8 = LPCOMP_REFSEL_REFSEL_Ref5_8Vdd, /**< Use supply with a 5/8 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_6_8 = LPCOMP_REFSEL_REFSEL_Ref6_8Vdd, /**< Use supply with a 6/8 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_7_8 = LPCOMP_REFSEL_REFSEL_Ref7_8Vdd, /**< Use supply with a 7/8 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_1_16 = LPCOMP_REFSEL_REFSEL_Ref1_16Vdd, /**< Use supply with a 1/16 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_3_16 = LPCOMP_REFSEL_REFSEL_Ref3_16Vdd, /**< Use supply with a 3/16 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_5_16 = LPCOMP_REFSEL_REFSEL_Ref5_16Vdd, /**< Use supply with a 5/16 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_7_16 = LPCOMP_REFSEL_REFSEL_Ref7_16Vdd, /**< Use supply with a 7/16 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_9_16 = LPCOMP_REFSEL_REFSEL_Ref9_16Vdd, /**< Use supply with a 9/16 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_11_16 = LPCOMP_REFSEL_REFSEL_Ref11_16Vdd, /**< Use supply with a 11/16 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_13_16 = LPCOMP_REFSEL_REFSEL_Ref13_16Vdd, /**< Use supply with a 13/16 prescaler as reference. */
NRF_LPCOMP_REF_SUPPLY_15_16 = LPCOMP_REFSEL_REFSEL_Ref15_16Vdd, /**< Use supply with a 15/16 prescaler as reference. */
#endif
NRF_LPCOMP_REF_EXT_REF0 = LPCOMP_REFSEL_REFSEL_ARef |
(LPCOMP_EXTREFSEL_EXTREFSEL_AnalogReference0 << 16), /**< External reference 0. */
NRF_LPCOMP_CONFIG_REF_EXT_REF1 = LPCOMP_REFSEL_REFSEL_ARef |
(LPCOMP_EXTREFSEL_EXTREFSEL_AnalogReference1 << 16), /**< External reference 1. */
} nrf_lpcomp_ref_t;
/**
* @enum nrf_lpcomp_input_t
* @brief LPCOMP input selection.
*/
typedef enum
{
NRF_LPCOMP_INPUT_0 = LPCOMP_PSEL_PSEL_AnalogInput0, /**< Input 0. */
NRF_LPCOMP_INPUT_1 = LPCOMP_PSEL_PSEL_AnalogInput1, /**< Input 1. */
NRF_LPCOMP_INPUT_2 = LPCOMP_PSEL_PSEL_AnalogInput2, /**< Input 2. */
NRF_LPCOMP_INPUT_3 = LPCOMP_PSEL_PSEL_AnalogInput3, /**< Input 3. */
NRF_LPCOMP_INPUT_4 = LPCOMP_PSEL_PSEL_AnalogInput4, /**< Input 4. */
NRF_LPCOMP_INPUT_5 = LPCOMP_PSEL_PSEL_AnalogInput5, /**< Input 5. */
NRF_LPCOMP_INPUT_6 = LPCOMP_PSEL_PSEL_AnalogInput6, /**< Input 6. */
NRF_LPCOMP_INPUT_7 = LPCOMP_PSEL_PSEL_AnalogInput7 /**< Input 7. */
} nrf_lpcomp_input_t;
/**
* @enum nrf_lpcomp_detect_t
* @brief LPCOMP detection type selection.
*/
typedef enum
{
NRF_LPCOMP_DETECT_CROSS = LPCOMP_ANADETECT_ANADETECT_Cross, /**< Generate ANADETEC on crossing, both upwards and downwards crossing. */
NRF_LPCOMP_DETECT_UP = LPCOMP_ANADETECT_ANADETECT_Up, /**< Generate ANADETEC on upwards crossing only. */
NRF_LPCOMP_DETECT_DOWN = LPCOMP_ANADETECT_ANADETECT_Down /**< Generate ANADETEC on downwards crossing only. */
} nrf_lpcomp_detect_t;
/**
* @enum nrf_lpcomp_task_t
* @brief LPCOMP tasks.
*/
typedef enum /*lint -save -e30 -esym(628,__INTADDR__) */
{
NRF_LPCOMP_TASK_START = offsetof(NRF_LPCOMP_Type, TASKS_START), /**< LPCOMP start sampling task. */
NRF_LPCOMP_TASK_STOP = offsetof(NRF_LPCOMP_Type, TASKS_STOP), /**< LPCOMP stop sampling task. */
NRF_LPCOMP_TASK_SAMPLE = offsetof(NRF_LPCOMP_Type, TASKS_SAMPLE) /**< Sample comparator value. */
} nrf_lpcomp_task_t; /*lint -restore*/
/**
* @enum nrf_lpcomp_event_t
* @brief LPCOMP events.
*/
typedef enum /*lint -save -e30 -esym(628,__INTADDR__) */
{
NRF_LPCOMP_EVENT_READY = offsetof(NRF_LPCOMP_Type, EVENTS_READY), /**< LPCOMP is ready and output is valid. */
NRF_LPCOMP_EVENT_DOWN = offsetof(NRF_LPCOMP_Type, EVENTS_DOWN), /**< Input voltage crossed the threshold going down. */
NRF_LPCOMP_EVENT_UP = offsetof(NRF_LPCOMP_Type, EVENTS_UP), /**< Input voltage crossed the threshold going up. */
NRF_LPCOMP_EVENT_CROSS = offsetof(NRF_LPCOMP_Type, EVENTS_CROSS) /**< Input voltage crossed the threshold in any direction. */
} nrf_lpcomp_event_t; /*lint -restore*/
/**
* @enum nrf_lpcomp_short_mask_t
* @brief LPCOMP shorts masks.
*/
typedef enum
{
NRF_LPCOMP_SHORT_CROSS_STOP_MASK = LPCOMP_SHORTS_CROSS_STOP_Msk, /*!< Short between CROSS event and STOP task. */
NRF_LPCOMP_SHORT_UP_STOP_MASK = LPCOMP_SHORTS_UP_STOP_Msk, /*!< Short between UP event and STOP task. */
NRF_LPCOMP_SHORT_DOWN_STOP_MASK = LPCOMP_SHORTS_DOWN_STOP_Msk, /*!< Short between DOWN event and STOP task. */
NRF_LPCOMP_SHORT_READY_STOP_MASK = LPCOMP_SHORTS_READY_STOP_Msk, /*!< Short between READY event and STOP task. */
NRF_LPCOMP_SHORT_READY_SAMPLE_MASK = LPCOMP_SHORTS_READY_SAMPLE_Msk /*!< Short between READY event and SAMPLE task. */
} nrf_lpcomp_short_mask_t;
#ifdef LPCOMP_FEATURE_HYST_PRESENT
/**
* @enum nrf_lpcomp_hysteresis_t
* @brief LPCOMP hysteresis.
*/
typedef enum
{
NRF_LPCOMP_HYST_NOHYST = LPCOMP_HYST_HYST_NoHyst, /**< Comparator hysteresis disabled. */
NRF_LPCOMP_HYST_50mV = LPCOMP_HYST_HYST_Hyst50mV /**< Comparator hysteresis enabled (typ. 50 mV). */
}nrf_lpcomp_hysteresis_t;
#endif // LPCOMP_FEATURE_HYST_PRESENT
/** @brief LPCOMP configuration. */
typedef struct
{
nrf_lpcomp_ref_t reference; /**< LPCOMP reference. */
nrf_lpcomp_detect_t detection; /**< LPCOMP detection type. */
#ifdef LPCOMP_FEATURE_HYST_PRESENT
nrf_lpcomp_hysteresis_t hyst; /**< LPCOMP hysteresis. */
#endif // LPCOMP_FEATURE_HYST_PRESENT
} nrf_lpcomp_config_t;
/** Default LPCOMP configuration. */
#define NRF_LPCOMP_CONFIG_DEFAULT { NRF_LPCOMP_REF_SUPPLY_FOUR_EIGHT, NRF_LPCOMP_DETECT_DOWN }
/**
* @brief Function for configuring LPCOMP.
*
* This function powers on LPCOMP and configures it. LPCOMP is in DISABLE state after configuration,
* so it must be enabled before using it. All shorts are inactive, events are cleared, and LPCOMP is stopped.
*
* @param[in] p_config Configuration.
*/
__STATIC_INLINE void nrf_lpcomp_configure(const nrf_lpcomp_config_t * p_config)
{
NRF_LPCOMP->TASKS_STOP = 1;
NRF_LPCOMP->ENABLE = LPCOMP_ENABLE_ENABLE_Disabled << LPCOMP_ENABLE_ENABLE_Pos;
NRF_LPCOMP->REFSEL =
(p_config->reference << LPCOMP_REFSEL_REFSEL_Pos) & LPCOMP_REFSEL_REFSEL_Msk;
//If external source is choosen extract analog reference index.
if ((p_config->reference & LPCOMP_REFSEL_REFSEL_ARef)==LPCOMP_REFSEL_REFSEL_ARef)
{
uint32_t extref = p_config->reference >> 16;
NRF_LPCOMP->EXTREFSEL = (extref << LPCOMP_EXTREFSEL_EXTREFSEL_Pos) & LPCOMP_EXTREFSEL_EXTREFSEL_Msk;
}
NRF_LPCOMP->ANADETECT =
(p_config->detection << LPCOMP_ANADETECT_ANADETECT_Pos) & LPCOMP_ANADETECT_ANADETECT_Msk;
#ifdef LPCOMP_FEATURE_HYST_PRESENT
NRF_LPCOMP->HYST = ((p_config->hyst) << LPCOMP_HYST_HYST_Pos) & LPCOMP_HYST_HYST_Msk;
#endif //LPCOMP_FEATURE_HYST_PRESENT
NRF_LPCOMP->SHORTS = 0;
NRF_LPCOMP->INTENCLR = LPCOMP_INTENCLR_CROSS_Msk | LPCOMP_INTENCLR_UP_Msk |
LPCOMP_INTENCLR_DOWN_Msk | LPCOMP_INTENCLR_READY_Msk;
}
/**
* @brief Function for selecting the LPCOMP input.
*
* This function selects the active input of LPCOMP.
*
* @param[in] input Input to be selected.
*/
__STATIC_INLINE void nrf_lpcomp_input_select(nrf_lpcomp_input_t input)
{
uint32_t lpcomp_enable_state = NRF_LPCOMP->ENABLE;
NRF_LPCOMP->ENABLE = LPCOMP_ENABLE_ENABLE_Disabled << LPCOMP_ENABLE_ENABLE_Pos;
NRF_LPCOMP->PSEL =
((uint32_t)input << LPCOMP_PSEL_PSEL_Pos) | (NRF_LPCOMP->PSEL & ~LPCOMP_PSEL_PSEL_Msk);
NRF_LPCOMP->ENABLE = lpcomp_enable_state;
}
/**
* @brief Function for enabling the Low Power Comparator.
*
* This function enables LPCOMP.
*
*/
__STATIC_INLINE void nrf_lpcomp_enable(void)
{
NRF_LPCOMP->ENABLE = LPCOMP_ENABLE_ENABLE_Enabled << LPCOMP_ENABLE_ENABLE_Pos;
NRF_LPCOMP->EVENTS_READY = 0;
NRF_LPCOMP->EVENTS_DOWN = 0;
NRF_LPCOMP->EVENTS_UP = 0;
NRF_LPCOMP->EVENTS_CROSS = 0;
}
/**
* @brief Function for disabling the Low Power Comparator.
*
* This function disables LPCOMP.
*
*/
__STATIC_INLINE void nrf_lpcomp_disable(void)
{
NRF_LPCOMP->ENABLE = LPCOMP_ENABLE_ENABLE_Disabled << LPCOMP_ENABLE_ENABLE_Pos;
}
/**
* @brief Function for getting the last LPCOMP compare result.
*
* @return The last compare result. If 0 then VIN+ < VIN-, if 1 then the opposite.
*/
__STATIC_INLINE uint32_t nrf_lpcomp_result_get(void)
{
return (uint32_t)NRF_LPCOMP->RESULT;
}
/**
* @brief Function for enabling interrupts from LPCOMP.
*
* @param[in] lpcomp_int_mask Mask of interrupts to be enabled.
*
* @sa nrf_lpcomp_int_disable()
* @sa nrf_lpcomp_int_enable_check()
*/
__STATIC_INLINE void nrf_lpcomp_int_enable(uint32_t lpcomp_int_mask)
{
NRF_LPCOMP->INTENSET = lpcomp_int_mask;
}
/**
* @brief Function for disabling interrupts from LPCOMP.
*
* @param[in] lpcomp_int_mask Mask of interrupts to be disabled.
*
* @sa nrf_lpcomp_int_enable()
* @sa nrf_lpcomp_int_enable_check()
*/
__STATIC_INLINE void nrf_lpcomp_int_disable(uint32_t lpcomp_int_mask)
{
NRF_LPCOMP->INTENCLR = lpcomp_int_mask;
}
/**
* @brief Function for getting the enabled interrupts of LPCOMP.
*
* @param[in] lpcomp_int_mask Mask of interrupts to be checked.
*
* @retval true If any of interrupts of the specified mask are enabled.
*
* @sa nrf_lpcomp_int_enable()
* @sa nrf_lpcomp_int_disable()
*/
__STATIC_INLINE bool nrf_lpcomp_int_enable_check(uint32_t lpcomp_int_mask)
{
return (NRF_LPCOMP->INTENSET & lpcomp_int_mask); // when read this register will return the value of INTEN.
}
/**
* @brief Function for getting the address of a specific LPCOMP task register.
*
* @param[in] lpcomp_task LPCOMP task.
*
* @return The address of the specified LPCOMP task.
*/
__STATIC_INLINE uint32_t * nrf_lpcomp_task_address_get(nrf_lpcomp_task_t lpcomp_task)
{
return (uint32_t *)((uint8_t *)NRF_LPCOMP + lpcomp_task);
}
/**
* @brief Function for getting the address of a specific LPCOMP event register.
*
* @param[in] lpcomp_event LPCOMP event.
*
* @return The address of the specified LPCOMP event.
*/
__STATIC_INLINE uint32_t * nrf_lpcomp_event_address_get(nrf_lpcomp_event_t lpcomp_event)
{
return (uint32_t *)((uint8_t *)NRF_LPCOMP + lpcomp_event);
}
/**
* @brief Function for setting LPCOMP shorts.
*
* @param[in] lpcomp_short_mask LPCOMP shorts by mask.
*
*/
__STATIC_INLINE void nrf_lpcomp_shorts_enable(uint32_t lpcomp_short_mask)
{
NRF_LPCOMP->SHORTS |= lpcomp_short_mask;
}
/**
* @brief Function for clearing LPCOMP shorts by mask.
*
* @param[in] lpcomp_short_mask LPCOMP shorts to be cleared.
*
*/
__STATIC_INLINE void nrf_lpcomp_shorts_disable(uint32_t lpcomp_short_mask)
{
NRF_LPCOMP->SHORTS &= ~lpcomp_short_mask;
}
/**
* @brief Function for setting a specific LPCOMP task.
*
* @param[in] lpcomp_task LPCOMP task to be set.
*
*/
__STATIC_INLINE void nrf_lpcomp_task_trigger(nrf_lpcomp_task_t lpcomp_task)
{
*( (volatile uint32_t *)( (uint8_t *)NRF_LPCOMP + lpcomp_task) ) = 1;
}
/**
* @brief Function for clearing a specific LPCOMP event.
*
* @param[in] lpcomp_event LPCOMP event to be cleared.
*
*/
__STATIC_INLINE void nrf_lpcomp_event_clear(nrf_lpcomp_event_t lpcomp_event)
{
*( (volatile uint32_t *)( (uint8_t *)NRF_LPCOMP + lpcomp_event) ) = 0;
#if __CORTEX_M == 0x04
volatile uint32_t dummy = *((volatile uint32_t *)((uint8_t *)NRF_LPCOMP + lpcomp_event));
(void)dummy;
#endif
}
/**
* @brief Function for getting the state of a specific LPCOMP event.
*
* @retval true If the specified LPCOMP event is active.
*
*/
__STATIC_INLINE bool nrf_lpcomp_event_check(nrf_lpcomp_event_t lpcomp_event)
{
return (bool) (*(volatile uint32_t *)( (uint8_t *)NRF_LPCOMP + lpcomp_event));
}
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* NRF_LPCOMP_H_ */
| {
"pile_set_name": "Github"
} |
changelog:
- type: HELM
description: Add new helm value to disable the validation admission webhook
issueLink: https://github.com/solo-io/gloo/issues/3016 | {
"pile_set_name": "Github"
} |
//===- SystemZConstantPoolValue.h - SystemZ constant-pool value -*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCONSTANTPOOLVALUE_H
#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCONSTANTPOOLVALUE_H
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/Support/ErrorHandling.h"
namespace llvm {
class GlobalValue;
namespace SystemZCP {
enum SystemZCPModifier {
TLSGD,
TLSLDM,
DTPOFF,
NTPOFF
};
} // end namespace SystemZCP
/// A SystemZ-specific constant pool value. At present, the only
/// defined constant pool values are module IDs or offsets of
/// thread-local variables (written x@TLSGD, x@TLSLDM, x@DTPOFF,
/// or x@NTPOFF).
class SystemZConstantPoolValue : public MachineConstantPoolValue {
const GlobalValue *GV;
SystemZCP::SystemZCPModifier Modifier;
protected:
SystemZConstantPoolValue(const GlobalValue *GV,
SystemZCP::SystemZCPModifier Modifier);
public:
static SystemZConstantPoolValue *
Create(const GlobalValue *GV, SystemZCP::SystemZCPModifier Modifier);
// Override MachineConstantPoolValue.
int getExistingMachineCPValue(MachineConstantPool *CP,
unsigned Alignment) override;
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override;
void print(raw_ostream &O) const override;
// Access SystemZ-specific fields.
const GlobalValue *getGlobalValue() const { return GV; }
SystemZCP::SystemZCPModifier getModifier() const { return Modifier; }
};
} // end namespace llvm
#endif
| {
"pile_set_name": "Github"
} |
%%
%% This is file `ot1lcmtt.fd',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% slifonts.fdd (with options: `lcmtt,fd')
%%
%% This is a generated file.
%%
%% The source is maintained by the LaTeX Project team and bug
%% reports for it can be opened at http://latex-project.org/bugs.html
%% (but please observe conditions on bug reports sent to that address!)
%%
%%
%% Copyright 1993-2015
%% The LaTeX3 Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file was generated from file(s) of the LaTeX base system.
%% --------------------------------------------------------------
%%
%% It may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This file may only be distributed together with a copy of the LaTeX
%% base system. You may however distribute the LaTeX base system without
%% such generated files.
%%
%% The list of all files belonging to the LaTeX base distribution is
%% given in the file `manifest.txt'. See also `legal.txt' for additional
%% information.
%%
%% In particular, permission is granted to customize the declarations in
%% this file to serve the needs of your installation.
%%
%% However, NO PERMISSION is granted to distribute a modified version
%% of this file under its original name.
%%
\ProvidesFile{ot1lcmtt.fd}
[1998/06/12 v2.2e Standard LaTeX slide font definitions]
\DeclareFontFamily{OT1}{lcmtt}{\hyphenchar\font\m@ne}
\DeclareFontShape{OT1}{lcmtt}{m}{n}{%
<13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
cmtt8%
}{}
\DeclareFontShape{OT1}{lcmtt}{m}{In}{%
<13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
icmtt8%
}{}
\DeclareFontShape{OT1}{lcmtt}{m}{it}{%
<13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
cmitt10%
}{}
\DeclareFontShape{OT1}{lcmtt}{m}{ui}{%
<->sub*cmtt/m/it}{}
\DeclareFontShape{OT1}{lcmtt}{bx}{ui}{%
<->sub*cmtt/m/it}{}
\endinput
%%
%% End of file `ot1lcmtt.fd'.
| {
"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.camel.component.mina;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.Test;
public class MinaVMTextlineProtocolTest extends BaseMinaTest {
@Test
public void testMinaRoute() throws Exception {
MockEndpoint endpoint = getMockEndpoint("mock:result");
Object body = "Hello there!";
endpoint.expectedBodiesReceived(body);
template.sendBodyAndHeader(String.format("mina:vm://localhost:%1$s?textline=true&sync=false", getPort()), body,
"cheese", 123);
assertMockEndpointsSatisfied();
}
@Override
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
from(String.format("mina:vm://localhost:%1$s?textline=true&sync=false", getPort()))
.to("log:before?showAll=true")
.to("mock:result")
.to("log:after?showAll=true");
}
};
}
}
| {
"pile_set_name": "Github"
} |
subroutine smd_input(rtdb)
c
implicit none
#include "errquit.fh"
c
#include "stdio.fh"
#include "mafdecls.fh"
#include "inp.fh"
#include "rtdb.fh"
c
integer rtdb
c
character*32 tag
character*32 pname
character*255 token
character*80 mtoken(10)
integer itoken(10)
double precision ftoken(10)
integer ip,np
c
pname = "smd_input: "
c
c write(luout,*) "in ",pname
c
call inp_set_field(0)
c
c start parsing input
c ------------------
if (.not.inp_a(token))
+ call errquit(pname//'no input available',0, INPUT_ERR)
if (.not.inp_compare(.false.,token,'smd'))
+ call errquit('smd_input: no input available',0, INPUT_ERR)
goto 2
1 continue
if (.not.inp_read()) call errquit('smd_input: premature EOF',0,
& INPUT_ERR)
2 continue
if(.not.inp_a(token)) goto 1
c
c charges
c ----------
if(inp_compare(.false.,'charge',token)) then
call smd_input_charge(rtdb)
goto 2
endif
c
c velocities
c ----------
if(inp_compare(.false.,'veloc',token)) then
call smd_input_veloc(rtdb)
goto 2
endif
c
c coordinates
c ----------
if(inp_compare(.false.,'coord',token)) then
call smd_input_coord(rtdb)
goto 2
endif
cc if(inp_compare(.false.,'coord',token)) then
c np = 1
c do ip = 1,np
c if(.not.inp_a(mtoken(ip))) then
c call errquit(pname//token,0,
c & INPUT_ERR)
c end if
c end do
c tag="smd:coordfile"
c if (.not.rtdb_cput(rtdb,tag,1,mtoken(1)))
c > call errquit(pname//'failed to store'//tag,0,
c > RTDB_ERR)
c goto 2
c endif
c
c parameters
c ----------
if(inp_compare(.false.,'param',token)) then
np = 1
do ip = 1,np
if(.not.inp_a(mtoken(ip))) then
call errquit(pname//token,0,
& INPUT_ERR)
end if
end do
tag="smd:paramfile"
if (.not.rtdb_cput(rtdb,tag,1,mtoken(1)))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c kvec
c -----
if(inp_compare(.false.,'kvec',token)) then
np = 3
do ip = 1,np
if(.not.inp_i(itoken(ip))) then
call errquit(pname//token,0,
& INPUT_ERR)
end if
end do
tag="smd:kvec"
if (.not.rtdb_put(rtdb,tag,mt_int,3,itoken(1)))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c lat_a
c -----
if(inp_compare(.false.,'lat_a',token)) then
np = 3
do ip = 1,np
if(.not.inp_f(ftoken(ip))) then
call errquit(pname//token,0,
& INPUT_ERR)
end if
end do
tag="smd:lat_a"
if (.not.rtdb_put(rtdb,tag,mt_dbl,3,ftoken(1)))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c lat_b
c -----
if(inp_compare(.false.,'lat_b',token)) then
np = 3
do ip = 1,np
if(.not.inp_f(ftoken(ip))) then
call errquit(pname//token,0,
& INPUT_ERR)
end if
end do
tag="smd:lat_b"
if (.not.rtdb_put(rtdb,tag,mt_dbl,3,ftoken(1)))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c lat_c
c -----
if(inp_compare(.false.,'lat_c',token)) then
np = 3
do ip = 1,np
if(.not.inp_f(ftoken(ip))) then
call errquit(pname//token,0,
& INPUT_ERR)
end if
end do
tag="smd:lat_c"
if (.not.rtdb_put(rtdb,tag,mt_dbl,3,ftoken(1)))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c ndata
c -----
if(inp_compare(.false.,'ndata',token)) then
np = 1
do ip = 1,np
if(.not.inp_i(itoken(ip))) then
call errquit(pname//token,0,
& INPUT_ERR)
end if
end do
tag="smd:ndata"
if (.not.rtdb_put(rtdb,tag,mt_int,np,itoken(1)))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c nequil
c -----
if(inp_compare(.false.,'nequil',token)) then
np = 1
do ip = 1,np
if(.not.inp_i(itoken(ip))) then
call errquit(pname//token,0,
& INPUT_ERR)
end if
end do
tag="smd:nequil"
if (.not.rtdb_put(rtdb,tag,mt_int,np,itoken(1)))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c nprint
c -----
if(inp_compare(.false.,'nprint',token)) then
np = 1
do ip = 1,np
if(.not.inp_i(itoken(ip))) then
call errquit(pname//token,0,
& INPUT_ERR)
end if
end do
tag="smd:nprint"
if (.not.rtdb_put(rtdb,tag,mt_int,np,itoken(1)))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c step
c -----
if(inp_compare(.false.,'step',token)) then
np = 1
do ip = 1,np
if(.not.inp_f(ftoken(ip))) then
call errquit(pname//token,0,
& INPUT_ERR)
end if
end do
tag="smd:step"
if (.not.rtdb_put(rtdb,tag,mt_dbl,np,ftoken(1)))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c rcut
c ----
if(inp_compare(.false.,'rcut',token)) then
np = 1
do ip = 1,np
if(.not.inp_f(ftoken(ip))) then
call errquit(pname//token,0,
& INPUT_ERR)
end if
end do
tag="smd:rcut"
if (.not.rtdb_put(rtdb,tag,mt_dbl,np,ftoken(1)))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c temp
c -----
if(inp_compare(.false.,'temp',token)) then
np = 1
do ip = 1,np
if(.not.inp_f(ftoken(ip))) then
call errquit(pname//token,0,
& INPUT_ERR)
end if
end do
tag="smd:temp_target"
if (.not.rtdb_put(rtdb,tag,mt_dbl,np,ftoken(1)))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c ewald
c -----
if(inp_compare(.false.,'ewald',token)) then
np = 1
do ip = 1,np
if(.not.inp_f(ftoken(ip))) then
call errquit(pname//token,0,
& INPUT_ERR)
end if
end do
tag="smd:ewald"
if (.not.rtdb_put(rtdb,tag,mt_dbl,np,ftoken(1)))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c verlet
c ------
if(inp_compare(.false.,'verlet',token)) then
np = 1
do ip = 1,np
if(.not.inp_f(ftoken(ip))) then
call errquit(pname//token,0,
& INPUT_ERR)
end if
end do
tag="smd:verlet"
if (.not.rtdb_put(rtdb,tag,mt_dbl,np,ftoken(1)))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c print level
c -------------------
if (inp_compare(.false.,'print', token)) then
call util_print_input(rtdb, "smd")
go to 2
end if
c
if (token.eq.'end') then
c write(luout,*) "out of ",pname
c write(*,*) "RTDB after smd"
c if(.not.rtdb_print(rtdb,.true.))
c > call errquit(pname//'failed to print rtdb',0,
c > RTDB_ERR)
return
endif
c
if(.not.rtdb_print(rtdb,.true.))
> call errquit(pname//'failed to print rtdb',0,
> RTDB_ERR)
write(luout,*)' unrecognized token in smd input:',
+ token(1:inp_strlen(token))
call errquit(pname//'failed ',0,
> RTDB_ERR)
return
998 call errquit(pname//'no token found '//token,0,
> RTDB_ERR)
999 call errquit(pname//'failed to store '//tag,0,
> RTDB_ERR)
end
subroutine smd_input_coord(rtdb)
c
implicit none
#include "errquit.fh"
#include "stdio.fh"
#include "mafdecls.fh"
#include "inp.fh"
#include "rtdb.fh"
c
integer rtdb
c
character*32 tag
character*32 pname
character*255 token
integer ip,np
c
pname = "smd_input_coord"
c
write(luout,*) "in ",pname
c
np = inp_n_field()
c
if(np.eq.1) goto 200
c
call inp_set_field(1)
c
c start parsing input
c ------------------
2 continue
if(inp_cur_field().eq.np) return
if (.not.inp_a(token))
+ call errquit(pname,0, INPUT_ERR)
c
c input files
c -----------
if(inp_compare(.false.,'input',token) ) then
if(.not.inp_a(token))
> call errquit(pname//' input ',0,INPUT_ERR)
tag="smd:coord:input"
if (.not.rtdb_cput(rtdb,tag,1,token))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c output files
c -----------
if(inp_compare(.false.,'output',token) ) then
if(.not.inp_a(token))
> call errquit(pname//' input ',0,INPUT_ERR)
tag="smd:coord:output"
if (.not.rtdb_cput(rtdb,tag,1,token))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
200 continue
write(luout,*) "out ",pname
return
end
subroutine smd_input_veloc(rtdb)
c
implicit none
#include "errquit.fh"
#include "stdio.fh"
#include "mafdecls.fh"
#include "inp.fh"
#include "rtdb.fh"
c
integer rtdb
c
character*32 tag
character*32 pname
character*255 token
integer ip,np
c
pname = "smd_input_vel"
c
write(luout,*) "in ",pname
c
np = inp_n_field()
c
if(np.eq.1) goto 200
c
call inp_set_field(1)
c
c start parsing input
c ------------------
2 continue
if(inp_cur_field().eq.np) return
if (.not.inp_a(token))
+ call errquit(pname,0, INPUT_ERR)
c
c input files
c -----------
if(inp_compare(.false.,'input',token) ) then
if(.not.inp_a(token))
> call errquit(pname//' input ',0,INPUT_ERR)
tag="smd:veloc:input"
if (.not.rtdb_cput(rtdb,tag,1,token))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c output files
c -----------
if(inp_compare(.false.,'output',token) ) then
if(.not.inp_a(token))
> call errquit(pname//' input ',0,INPUT_ERR)
tag="smd:veloc:output"
if (.not.rtdb_cput(rtdb,tag,1,token))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
200 continue
write(luout,*) "out ",pname
return
end
subroutine smd_input_charge(rtdb)
c
implicit none
#include "errquit.fh"
#include "stdio.fh"
#include "mafdecls.fh"
#include "inp.fh"
#include "rtdb.fh"
c
integer rtdb
c
character*32 tag
character*32 pname
character*255 token
integer ip,np
c
pname = "smd_input_charge"
c
write(luout,*) "in ",pname
c
np = inp_n_field()
c
if(np.eq.1) goto 200
c
call inp_set_field(1)
c
c start parsing input
c ------------------
2 continue
if(inp_cur_field().eq.np) return
if (.not.inp_a(token))
+ call errquit(pname,0, INPUT_ERR)
c
c input files
c -----------
if(inp_compare(.false.,'input',token) ) then
if(.not.inp_a(token))
> call errquit(pname//' input ',0,INPUT_ERR)
tag="smd:charge:input"
if (.not.rtdb_cput(rtdb,tag,1,token))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
c
c output files
c -----------
if(inp_compare(.false.,'output',token) ) then
if(.not.inp_a(token))
> call errquit(pname//' input ',0,INPUT_ERR)
tag="smd:charge:output"
if (.not.rtdb_cput(rtdb,tag,1,token))
> call errquit(pname//'failed to store'//tag,0,
> RTDB_ERR)
goto 2
endif
200 continue
write(luout,*) "out ",pname
return
end
c $Id$
| {
"pile_set_name": "Github"
} |
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
<OutputType>Exe</OutputType>
<StartupObject>Google.Protobuf.Examples.AddressBook.Program</StartupObject>
<IsPackable>False</IsPackable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Google.Protobuf\Google.Protobuf.csproj" />
</ItemGroup>
</Project>
| {
"pile_set_name": "Github"
} |
/*
* This file is part of Sponge, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.test.myranks;
import org.spongepowered.api.registry.AdditionalCatalogRegistryModule;
import org.spongepowered.api.registry.util.RegisterCatalog;
import org.spongepowered.test.myranks.api.Rank;
import org.spongepowered.test.myranks.api.Ranks;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
public class RankRegistryModule implements AdditionalCatalogRegistryModule<Rank> {
@RegisterCatalog(Ranks.class)
private final Map<String, Rank> rankMap = new HashMap<>();
@Override
public void registerDefaults() {
register(new RankImpl("user", "User"));
register(new RankImpl("staff", "Staff"));
}
private void register(Rank rank) {
this.rankMap.put(rank.getId(), rank);
}
@Override
public void registerAdditionalCatalog(Rank extraCatalog) {
if (!this.rankMap.containsKey(extraCatalog.getId())) {
register(extraCatalog);
}
}
@Override
public Optional<Rank> getById(String id) {
return Optional.ofNullable(this.rankMap.get(id));
}
@Override
public Collection<Rank> getAll() {
return Collections.unmodifiableCollection(this.rankMap.values());
}
}
| {
"pile_set_name": "Github"
} |
/* Copyright © 2017 VMware, Inc. All Rights Reserved.
SPDX-License-Identifier: BSD-2-Clause
Generated by: https://github.com/swagger-api/swagger-codegen.git */
package monitoring
type IpfixCollector struct {
// IP address for the IPFIX collector
CollectorIpAddress string `json:"collector_ip_address"`
// Port for the IPFIX collector
CollectorPort int32 `json:"collector_port,omitempty"`
}
| {
"pile_set_name": "Github"
} |
using System;
using Prism.Ioc;
using Unity;
namespace Prism.Unity
{
/// <summary>
/// Base application class that uses <see cref="UnityContainerExtension"/> as it's container.
/// </summary>
public abstract class PrismApplication : PrismApplicationBase
{
/// <summary>
/// Create a new <see cref="UnityContainerExtension"/> used by Prism.
/// </summary>
/// <returns>A new <see cref="UnityContainerExtension"/>.</returns>
protected override IContainerExtension CreateContainerExtension()
{
return new UnityContainerExtension();
}
/// <summary>
/// Registers the <see cref="Type"/>s of the Exceptions that are not considered
/// root exceptions by the <see cref="ExceptionExtensions"/>.
/// </summary>
protected override void RegisterFrameworkExceptionTypes()
{
ExceptionExtensions.RegisterFrameworkExceptionType(typeof(ResolutionFailedException));
}
}
}
| {
"pile_set_name": "Github"
} |
# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj | \
# RUN: not llvm-dwarfdump -verify - | FileCheck %s
# CHECK: Name Index @ 0x0: Name table entries [1, 1] are not covered by the hash table.
# CHECK: Name Index @ 0x0: Name table entries [4, 4] are not covered by the hash table.
.section .debug_str,"MS",@progbits,1
.Lstring_foo:
.asciz "foo"
.Lstring_bar:
.asciz "bar"
.Lstring_baz:
.asciz "baz"
.Lstring_barfuz:
.asciz "barfuz"
.Lstring_producer:
.asciz "Hand-written dwarf"
.section .debug_abbrev,"",@progbits
.Lsection_abbrev:
.byte 1 # Abbreviation Code
.byte 17 # DW_TAG_compile_unit
.byte 1 # DW_CHILDREN_yes
.byte 37 # DW_AT_producer
.byte 14 # DW_FORM_strp
.byte 19 # DW_AT_language
.byte 5 # DW_FORM_data2
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 2 # Abbreviation Code
.byte 46 # DW_TAG_subprogram
.byte 0 # DW_CHILDREN_no
.byte 3 # DW_AT_name
.byte 14 # DW_FORM_strp
.byte 63 # DW_AT_external
.byte 25 # DW_FORM_flag_present
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 0 # EOM(3)
.section .debug_info,"",@progbits
.Lcu_begin0:
.long .Lcu_end0-.Lcu_start0 # Length of Unit
.Lcu_start0:
.short 4 # DWARF version number
.long .Lsection_abbrev # Offset Into Abbrev. Section
.byte 8 # Address Size (in bytes)
.byte 1 # Abbrev [1] DW_TAG_compile_unit
.long .Lstring_producer # DW_AT_producer
.short 12 # DW_AT_language
.Ldie_foo:
.byte 2 # Abbrev [2] DW_TAG_subprogram
.long .Lstring_foo # DW_AT_name
# DW_AT_external
.Ldie_bar:
.byte 2 # Abbrev [2] DW_TAG_subprogram
.long .Lstring_bar # DW_AT_name
# DW_AT_external
.Ldie_baz:
.byte 2 # Abbrev [2] DW_TAG_subprogram
.long .Lstring_baz # DW_AT_name
# DW_AT_external
.Ldie_barfuz:
.byte 2 # Abbrev [2] DW_TAG_subprogram
.long .Lstring_barfuz # DW_AT_name
# DW_AT_external
.byte 0 # End Of Children Mark
.Lcu_end0:
.section .debug_names,"",@progbits
.long .Lnames_end0-.Lnames_start0 # Header: contribution length
.Lnames_start0:
.short 5 # Header: version
.short 0 # Header: padding
.long 1 # Header: compilation unit count
.long 0 # Header: local type unit count
.long 0 # Header: foreign type unit count
.long 2 # Header: bucket count
.long 4 # Header: name count
.long .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
.long 0 # Header: augmentation length
.long .Lcu_begin0 # Compilation unit 0
.long 2 # Bucket 0
.long 3 # Bucket 1
.long 193491849 # Hash in no Bucket
.long 193487034 # Hash in Bucket 0
.long 4086570991 # Hash in Bucket 1
.long 193487042 # Hash in no Bucket
.long .Lstring_foo # String in no Bucket
.long .Lstring_bar # String in Bucket 0
.long .Lstring_barfuz # String in Bucket 1
.long .Lstring_baz # String in no Bucket
.long .Lnames0-.Lnames_entries0 # Offset in no Bucket
.long .Lnames1-.Lnames_entries0 # Offset in Bucket 0
.long .Lnames2-.Lnames_entries0 # Offset in Bucket 1
.long .Lnames3-.Lnames_entries0 # Offset in no Bucket
.Lnames_abbrev_start0:
.byte 46 # Abbrev code
.byte 46 # DW_TAG_subprogram
.byte 3 # DW_IDX_die_offset
.byte 19 # DW_FORM_ref4
.byte 0 # End of abbrev
.byte 0 # End of abbrev
.byte 0 # End of abbrev list
.Lnames_abbrev_end0:
.Lnames_entries0:
.Lnames0:
.byte 46 # Abbrev code
.long .Ldie_foo-.Lcu_begin0 # DW_IDX_die_offset
.long 0 # End of list: foo
.Lnames1:
.byte 46 # Abbrev code
.long .Ldie_bar-.Lcu_begin0 # DW_IDX_die_offset
.long 0 # End of list: bar
.Lnames2:
.byte 46 # Abbrev code
.long .Ldie_baz-.Lcu_begin0 # DW_IDX_die_offset
.long 0 # End of list: baz
.Lnames3:
.byte 46 # Abbrev code
.long .Ldie_barfuz-.Lcu_begin0# DW_IDX_die_offset
.long 0 # End of list: barfuz
.p2align 2
.Lnames_end0:
| {
"pile_set_name": "Github"
} |
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
#ident "$Id$"
/*
COPYING CONDITIONS NOTICE:
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation, and provided that the
following conditions are met:
* Redistributions of source code must retain this COPYING
CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
PATENT MARKING NOTICE (below), and the PATENT RIGHTS
GRANT (below).
* Redistributions in binary form must reproduce this COPYING
CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
PATENT MARKING NOTICE (below), and the PATENT RIGHTS
GRANT (below) in the documentation and/or other materials
provided with the distribution.
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.
COPYRIGHT NOTICE:
TokuDB, Tokutek Fractal Tree Indexing Library.
Copyright (C) 2007-2013 Tokutek, Inc.
DISCLAIMER:
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.
UNIVERSITY PATENT NOTICE:
The technology is licensed by the Massachusetts Institute of
Technology, Rutgers State University of New Jersey, and the Research
Foundation of State University of New York at Stony Brook under
United States of America Serial No. 11/760379 and to the patents
and/or patent applications resulting from it.
PATENT MARKING NOTICE:
This software is covered by US Patent No. 8,185,551.
This software is covered by US Patent No. 8,489,638.
PATENT RIGHTS GRANT:
"THIS IMPLEMENTATION" means the copyrightable works distributed by
Tokutek as part of the Fractal Tree project.
"PATENT CLAIMS" means the claims of patents that are owned or
licensable by Tokutek, both currently or in the future; and that in
the absence of this license would be infringed by THIS
IMPLEMENTATION or by using or running THIS IMPLEMENTATION.
"PATENT CHALLENGE" shall mean a challenge to the validity,
patentability, enforceability and/or non-infringement of any of the
PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS.
Tokutek hereby grants to you, for the term and geographical scope of
the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to
make, have made, use, offer to sell, sell, import, transfer, and
otherwise run, modify, and propagate the contents of THIS
IMPLEMENTATION, where such license applies only to the PATENT
CLAIMS. This grant does not include claims that would be infringed
only as a consequence of further modifications of THIS
IMPLEMENTATION. If you or your agent or licensee institute or order
or agree to the institution of patent litigation against any entity
(including a cross-claim or counterclaim in a lawsuit) alleging that
THIS IMPLEMENTATION constitutes direct or contributory patent
infringement, or inducement of patent infringement, then any rights
granted to you under this License shall terminate as of the date
such litigation is filed. If you or your agent or exclusive
licensee institute or order or agree to the institution of a PATENT
CHALLENGE, then Tokutek may terminate any rights granted to you
under this License.
*/
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#if !defined(TOKUTXN_STATE_H)
#define TOKUTXN_STATE_H
// this is a separate file so that the hotindexing tests can see the txn states
enum tokutxn_state {
TOKUTXN_LIVE, // initial txn state
TOKUTXN_PREPARING, // txn is preparing (or prepared)
TOKUTXN_COMMITTING, // txn in the process of committing
TOKUTXN_ABORTING, // txn in the process of aborting
TOKUTXN_RETIRED, // txn no longer exists
};
typedef enum tokutxn_state TOKUTXN_STATE;
#endif
| {
"pile_set_name": "Github"
} |
<?php
namespace Concrete\Core\Form\Control;
interface FormViewInterface extends ViewInterface
{
/**
* Whether the form control is required in the current form
* @return bool
*/
public function isRequired();
/**
* Returns the label for the current form control.
* @return string
*/
public function getLabel();
/**
* Sets the label for the current form control.
* @param $label
*/
public function setLabel($label);
/**
* Returns true if the current form control supports labeling.
* @return bool
*/
public function supportsLabel();
/**
* Returns the ID of the current form control – may return null if the form
* control doesn't need it.
* @return string|null
*/
public function getControlID();
}
| {
"pile_set_name": "Github"
} |
version https://git-lfs.github.com/spec/v1
oid sha256:8d0d21a173c315a7e8c13433a99295be1271a2c4339515c32509a3121e8ec0d4
size 1212600
| {
"pile_set_name": "Github"
} |
# hostent.m4 serial 3
dnl Copyright (C) 2008, 2010-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_HOSTENT],
[
dnl Where are gethostent(), sethostent(), endhostent(), gethostbyname(),
dnl gethostbyaddr() defined?
dnl - On Solaris < 11.4, they are in libnsl. Ignore libxnet.
dnl - On Haiku, they are in libnetwork.
dnl - On BeOS, they are in libnet.
dnl - On native Windows, they are in ws2_32.dll.
dnl - Otherwise they are in libc.
AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
HOSTENT_LIB=
gl_saved_libs="$LIBS"
AC_SEARCH_LIBS([gethostbyname], [nsl network net],
[if test "$ac_cv_search_gethostbyname" != "none required"; then
HOSTENT_LIB="$ac_cv_search_gethostbyname"
fi])
LIBS="$gl_saved_libs"
if test -z "$HOSTENT_LIB"; then
AC_CHECK_FUNCS([gethostbyname], , [
AC_CACHE_CHECK([for gethostbyname in winsock2.h and -lws2_32],
[gl_cv_w32_gethostbyname],
[gl_cv_w32_gethostbyname=no
gl_save_LIBS="$LIBS"
LIBS="$LIBS -lws2_32"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#include <stddef.h>
]],
[[gethostbyname(NULL);]])],
[gl_cv_w32_gethostbyname=yes])
LIBS="$gl_save_LIBS"
])
if test "$gl_cv_w32_gethostbyname" = "yes"; then
HOSTENT_LIB="-lws2_32"
fi
])
fi
AC_SUBST([HOSTENT_LIB])
])
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2017, The OctNet authors
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the <organization> 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 OCTNET AUTHORS 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.
#include "octnet/cpu/pool.h"
#include "octnet/cpu/cpu.h"
#include <cstdio>
#include <cstdlib>
template <int level>
void octree_pool2x2x2_struct_cpu(const octree* in, octree* out) {
const int n_blocks = octree_num_blocks(in);
#pragma omp parallel for
for(int grid_idx = 0; grid_idx < n_blocks; ++grid_idx) {
ot_tree_t* in_tree = octree_get_tree(in, grid_idx);
ot_tree_t* out_tree = octree_get_tree(out, grid_idx);
if(level == 0) {
if(tree_isset_bit(in_tree, 0) && tree_cnt1(in_tree, 1, 9) == 0) {
tree_unset_bit(out_tree, 0);
}
}
if(level == 1) {
if(tree_isset_bit(in_tree, 0)) {
for(int bit_idx_l1 = 1; bit_idx_l1 < 9; ++bit_idx_l1) {
int bit_idx_l2 = tree_child_bit_idx(bit_idx_l1);
if(tree_isset_bit(in_tree, bit_idx_l1) && tree_cnt1(in_tree, bit_idx_l2, bit_idx_l2+8) == 0) {
tree_unset_bit(out_tree, bit_idx_l1);
}
}
}
}
if(level == 2) {
if(tree_isset_bit(in_tree, 0)) {
for(int bit_idx_l1 = 1; bit_idx_l1 < 9; ++bit_idx_l1) {
if(tree_isset_bit(in_tree, bit_idx_l1)) {
int bit_idx_l2 = tree_child_bit_idx(bit_idx_l1);
for(int idx = 0; idx < 8; ++idx) {
tree_unset_bit(out_tree, bit_idx_l2);
bit_idx_l2++;
}
}
}
}
}
}
}
template <int pool_fcn>
void octree_pool2x2x2_data_cpu(const octree* in, octree* out) {
const int n_blocks = octree_num_blocks(in);
const ot_size_t feature_size = in->feature_size;
#pragma omp parallel for
for(int grid_idx = 0; grid_idx < n_blocks; ++grid_idx) {
ot_tree_t* out_tree = octree_get_tree(out, grid_idx);
// ot_data_t* out_data = out->data_ptrs[grid_idx];
ot_data_t* out_data = octree_get_data(out, grid_idx);
ot_tree_t* in_tree = octree_get_tree(in, grid_idx);
// ot_data_t* in_data = in->data_ptrs[grid_idx];
ot_data_t* in_data = octree_get_data(in, grid_idx);
if(tree_isset_bit(in_tree, 0)) {
if(!tree_isset_bit(out_tree, 0)) {
octree_pool2x2x2<pool_fcn>(in_data, feature_size, out_data);
}
else {
for(int bit_idx_l1 = 1; bit_idx_l1 < 9; ++bit_idx_l1) {
int out_data_idx_l1 = tree_data_idx(out_tree, bit_idx_l1, feature_size);
if(tree_isset_bit(in_tree, bit_idx_l1)) {
if(!tree_isset_bit(out_tree, bit_idx_l1)) {
int in_data_idx = tree_data_idx(in_tree, tree_child_bit_idx(bit_idx_l1), feature_size);
octree_pool2x2x2<pool_fcn>(in_data + in_data_idx, feature_size, out_data + out_data_idx_l1);
}
else {
for(int idx_l2 = 0; idx_l2 < 8; ++idx_l2) {
int bit_idx_l2 = tree_child_bit_idx(bit_idx_l1) + idx_l2;
int out_data_idx_l2 = tree_data_idx(out_tree, bit_idx_l2, feature_size);
if(tree_isset_bit(in_tree, bit_idx_l2)) {
if(!tree_isset_bit(out_tree, bit_idx_l2)) {
int in_data_idx = tree_data_idx(in_tree, tree_child_bit_idx(bit_idx_l2), feature_size);
octree_pool2x2x2<pool_fcn>(in_data + in_data_idx, feature_size, out_data + out_data_idx_l2);
}
else {
int bit_idx_l3 = tree_child_bit_idx(bit_idx_l2);
int out_data_idx_l3 = tree_data_idx(out_tree, bit_idx_l3, feature_size);
int in_data_idx_l3 = tree_data_idx(in_tree, bit_idx_l3, feature_size);
octree_cpy_leaf(in_data + in_data_idx_l3, 8*feature_size, out_data + out_data_idx_l3);
}
}
else {
int in_data_idx = tree_data_idx(in_tree, bit_idx_l2, feature_size);
octree_cpy_leaf(in_data + in_data_idx, feature_size, out_data + out_data_idx_l2);
}
}
}
}
else {
int in_data_idx = tree_data_idx(in_tree, bit_idx_l1, feature_size);
octree_cpy_leaf(in_data + in_data_idx, feature_size, out_data + out_data_idx_l1);
}
}
}
}
else {
octree_cpy_leaf(in_data, feature_size, out_data);
}
}
}
template <int pool_fcn>
void octree_pool2x2x2_cpu(const octree* in, bool level_0, bool level_1, bool level_2, octree* out) {
octree_resize_cpu(in->n, in->grid_depth, in->grid_height, in->grid_width, in->feature_size, 0, out);
octree_cpy_trees_cpu_cpu(in, out);
if(level_0) {
octree_pool2x2x2_struct_cpu<0>(in, out);
}
if(level_1) {
octree_pool2x2x2_struct_cpu<1>(in, out);
}
if(level_2) {
octree_pool2x2x2_struct_cpu<2>(in, out);
}
octree_upd_n_leafs_cpu(out);
octree_resize_as_cpu(out, out);
octree_upd_prefix_leafs_cpu(out);
octree_pool2x2x2_data_cpu<pool_fcn>(in, out);
}
void octree_pool2x2x2_avg_cpu(const octree* in, bool level_0, bool level_1, bool level_2, octree* out) {
octree_pool2x2x2_cpu<REDUCE_AVG>(in, level_0, level_1, level_2, out);
}
void octree_pool2x2x2_max_cpu(const octree* in, bool level_0, bool level_1, bool level_2, octree* out) {
octree_pool2x2x2_cpu<REDUCE_MAX>(in, level_0, level_1, level_2, out);
}
template <int pool_fcn>
void octree_pool2x2x2_bwd_cpu(const octree* in, const octree* grad_out, octree* grad_in) {
octree_resize_as_cpu(in, grad_in);
octree_cpy_trees_cpu_cpu(in, grad_in);
octree_cpy_prefix_leafs_cpu_cpu(in, grad_in);
int n_blocks = octree_num_blocks(in);
ot_size_t feature_size = in->feature_size;
#pragma omp parallel for
for(int grid_idx = 0; grid_idx < n_blocks; ++grid_idx) {
ot_tree_t* out_tree = octree_get_tree(grad_out, grid_idx);
// ot_data_t* grad_out_data = grad_out->data_ptrs[grid_idx];
ot_data_t* grad_out_data = octree_get_data(grad_out, grid_idx);
ot_tree_t* in_tree = octree_get_tree(in, grid_idx);
// ot_data_t* in_data = in->data_ptrs[grid_idx];
ot_data_t* in_data = octree_get_data(in, grid_idx);
// ot_data_t* grad_in_data = grad_in->data_ptrs[grid_idx];
ot_data_t* grad_in_data = octree_get_data(grad_in, grid_idx);
if(tree_isset_bit(in_tree, 0)) {
if(!tree_isset_bit(out_tree, 0)) {
octree_pool2x2x2_bwd<pool_fcn>(in_data, grad_out_data, feature_size, grad_in_data);
}
else {
for(int bit_idx_l1 = 1; bit_idx_l1 < 9; ++bit_idx_l1) {
int out_data_idx_l1 = tree_data_idx(out_tree, bit_idx_l1, feature_size);
if(tree_isset_bit(in_tree, bit_idx_l1)) {
if(!tree_isset_bit(out_tree, bit_idx_l1)) {
int in_data_idx = tree_data_idx(in_tree, tree_child_bit_idx(bit_idx_l1), feature_size);
octree_pool2x2x2_bwd<pool_fcn>(in_data + in_data_idx, grad_out_data + out_data_idx_l1, feature_size, grad_in_data + in_data_idx);
}
else {
for(int idx_l2 = 0; idx_l2 < 8; ++idx_l2) {
int bit_idx_l2 = tree_child_bit_idx(bit_idx_l1) + idx_l2;
int out_data_idx_l2 = tree_data_idx(out_tree, bit_idx_l2, feature_size);
if(tree_isset_bit(in_tree, bit_idx_l2)) {
if(!tree_isset_bit(out_tree, bit_idx_l2)) {
int in_data_idx = tree_data_idx(in_tree, tree_child_bit_idx(bit_idx_l2), feature_size);
octree_pool2x2x2_bwd<pool_fcn>(in_data + in_data_idx, grad_out_data + out_data_idx_l2, feature_size, grad_in_data + in_data_idx);
}
else {
int bit_idx_l3 = tree_child_bit_idx(bit_idx_l2);
int out_data_idx_l3 = tree_data_idx(out_tree, bit_idx_l3, feature_size);
int in_data_idx_l3 = tree_data_idx(in_tree, bit_idx_l3, feature_size);
octree_cpy_leaf(grad_out_data + out_data_idx_l3, 8*feature_size, grad_in_data + in_data_idx_l3);
}
}
else {
int in_data_idx = tree_data_idx(in_tree, bit_idx_l2, feature_size);
octree_cpy_leaf(grad_out_data + out_data_idx_l2, feature_size, grad_in_data + in_data_idx);
}
}
}
}
else {
int in_data_idx = tree_data_idx(in_tree, bit_idx_l1, feature_size);
octree_cpy_leaf(grad_out_data + out_data_idx_l1, feature_size, grad_in_data + in_data_idx);
}
}
}
}
else {
octree_cpy_leaf(grad_out_data, feature_size, grad_in_data);
}
}
}
void octree_pool2x2x2_avg_bwd_cpu(const octree* in, const octree* grad_out, octree* grad_in) {
octree_pool2x2x2_bwd_cpu<REDUCE_AVG>(in, grad_out, grad_in);
}
void octree_pool2x2x2_max_bwd_cpu(const octree* in, const octree* grad_out, octree* grad_in) {
octree_pool2x2x2_bwd_cpu<REDUCE_MAX>(in, grad_out, grad_in);
}
| {
"pile_set_name": "Github"
} |
cheats = 65
cheat0_desc = "Enable Code (This <u>Must</u> Be On)"
cheat0_code = "F109BA54 1000"
cheat0_enable = false
cheat1_desc = "Hi-Res Enable Code"
cheat1_code = "F109BA90 2400"
cheat1_enable = false
cheat2_desc = "Activator 1 P1"
cheat2_code = "D0112344 0000"
cheat2_enable = false
cheat3_desc = "Activator 2 P1"
cheat3_code = "D0112345 0000"
cheat3_enable = false
cheat4_desc = "Dual Activator P1"
cheat4_code = "D1112344 0000"
cheat4_enable = false
cheat5_desc = "Infinite Shield For Artanis In Battle Of Braxis Level"
cheat5_code = "800FD1CB 0052+80365AE2 0052"
cheat5_enable = false
cheat6_desc = "Team 1"
cheat6_code = "810B1D46 FFFF"
cheat6_enable = false
cheat7_desc = "Team 2"
cheat7_code = "810B1D4A FFFF"
cheat7_enable = false
cheat8_desc = "Team 3"
cheat8_code = "810B1D4E FFFF"
cheat8_enable = false
cheat9_desc = "Team 4"
cheat9_code = "810B1D52 FFFF"
cheat9_enable = false
cheat10_desc = "Team 5"
cheat10_code = "810B1D56 FFFF"
cheat10_enable = false
cheat11_desc = "Team 6"
cheat11_code = "810B1D5A FFFF"
cheat11_enable = false
cheat12_desc = "Team 7"
cheat12_code = "810B1D5E FFFF"
cheat12_enable = false
cheat13_desc = "Team 8"
cheat13_code = "810B1D62 FFFF"
cheat13_enable = false
cheat14_desc = "Team 9"
cheat14_code = "810B1D66 FFFF"
cheat14_enable = false
cheat15_desc = "Team 10"
cheat15_code = "810B1D6A FFFF"
cheat15_enable = false
cheat16_desc = "Team 11"
cheat16_code = "810B1D6E FFFF"
cheat16_enable = false
cheat17_desc = "Team 12"
cheat17_code = "810B1D72 FFFF"
cheat17_enable = false
cheat18_desc = "Team 1"
cheat18_code = "810B1D44 3B9A+810B1D46 C9FF"
cheat18_enable = false
cheat19_desc = "Team 2"
cheat19_code = "810B1D48 3B9A+810B1D4A C9FF"
cheat19_enable = false
cheat20_desc = "Team 3"
cheat20_code = "810B1D4C 3B9A+810B1D4E C9FF"
cheat20_enable = false
cheat21_desc = "Team 4"
cheat21_code = "810B1D50 3B9A+810B1D52 C9FF"
cheat21_enable = false
cheat22_desc = "Team 5"
cheat22_code = "810B1D54 3B9A+810B1D56 C9FF"
cheat22_enable = false
cheat23_desc = "Team 6"
cheat23_code = "810B1D58 3B9A+810B1D5A C9FF"
cheat23_enable = false
cheat24_desc = "Team 7"
cheat24_code = "810B1D5C 3B9A+810B1D5E C9FF"
cheat24_enable = false
cheat25_desc = "Team 8"
cheat25_code = "810B1D60 3B9A+810B1D62 C9FF"
cheat25_enable = false
cheat26_desc = "Team 9"
cheat26_code = "810B1D64 3B9A+810B1D66 C9FF"
cheat26_enable = false
cheat27_desc = "Team 10"
cheat27_code = "810B1D68 3B9A+810B1D6A C9FF"
cheat27_enable = false
cheat28_desc = "Team 11"
cheat28_code = "810B1D6C 3B9A+810B1D6E C9FF"
cheat28_enable = false
cheat29_desc = "Team 12"
cheat29_code = "810B1D70 3B9A+810B1D72 C9FF"
cheat29_enable = false
cheat30_desc = "Team 1"
cheat30_code = "810B1D76 FFFF"
cheat30_enable = false
cheat31_desc = "Team 2"
cheat31_code = "810B1D7A FFFF"
cheat31_enable = false
cheat32_desc = "Team 3"
cheat32_code = "810B1D7E FFFF"
cheat32_enable = false
cheat33_desc = "Team 4"
cheat33_code = "810B1D82 FFFF"
cheat33_enable = false
cheat34_desc = "Team 5"
cheat34_code = "810B1D86 FFFF"
cheat34_enable = false
cheat35_desc = "Team 6"
cheat35_code = "810B1D8A FFFF"
cheat35_enable = false
cheat36_desc = "Team 7"
cheat36_code = "810B1D8E FFFF"
cheat36_enable = false
cheat37_desc = "Team 8"
cheat37_code = "810B1D92 FFFF"
cheat37_enable = false
cheat38_desc = "Team 9"
cheat38_code = "810B1D96 FFFF"
cheat38_enable = false
cheat39_desc = "Team 10"
cheat39_code = "810B1D9A FFFF"
cheat39_enable = false
cheat40_desc = "Team 11"
cheat40_code = "810B1D9E FFFF"
cheat40_enable = false
cheat41_desc = "Team 12"
cheat41_code = "810B1DA2 FFFF"
cheat41_enable = false
cheat42_desc = "Team 1"
cheat42_code = "810B1D74 3B9A+810B1D76 C9FF"
cheat42_enable = false
cheat43_desc = "Team 2"
cheat43_code = "810B1D78 3B9A+810B1D7A C9FF"
cheat43_enable = false
cheat44_desc = "Team 3"
cheat44_code = "810B1D7C 3B9A+810B1D7E C9FF"
cheat44_enable = false
cheat45_desc = "Team 4"
cheat45_code = "810B1D80 3B9A+810B1D82 C9FF"
cheat45_enable = false
cheat46_desc = "Team 5"
cheat46_code = "810B1D84 3B9A+810B1D86 C9FF"
cheat46_enable = false
cheat47_desc = "Team 6"
cheat47_code = "810B1D88 3B9A+810B1D8A C9FF"
cheat47_enable = false
cheat48_desc = "Team 6"
cheat48_code = "810B1D8C 3B9A+810B1D8E C9FF"
cheat48_enable = false
cheat49_desc = "Team 7"
cheat49_code = "810B1D90 3B9A+810B1D92 C9FF"
cheat49_enable = false
cheat50_desc = "Team 8"
cheat50_code = "810B1D94 3B9A+810B1D96 C9FF"
cheat50_enable = false
cheat51_desc = "Team 9"
cheat51_code = "810B1D98 3B9A+810B1D9A C9FF"
cheat51_enable = false
cheat52_desc = "Team 10"
cheat52_code = "810B1D9C 3B9A+810B1D9E C9FF"
cheat52_enable = false
cheat53_desc = "Team 11"
cheat53_code = "810B1DA0 3B9A+810B1DA2 C9FF"
cheat53_enable = false
cheat54_desc = "Team 12"
cheat54_code = "810B1DA4 3B9A+810B1DA6 C9FF"
cheat54_enable = false
cheat55_desc = "Terran Episode I"
cheat55_code = "800D13C4 000C"
cheat55_enable = false
cheat56_desc = "Zerg Episode II"
cheat56_code = "800D13C5 000A"
cheat56_enable = false
cheat57_desc = "Protoss Episode III"
cheat57_code = "800D13C6 000A"
cheat57_enable = false
cheat58_desc = "Protoss Episode IV"
cheat58_code = "800D13C7 000A"
cheat58_enable = false
cheat59_desc = "Terran Episode V"
cheat59_code = "800D13C8 000A"
cheat59_enable = false
cheat60_desc = "Zerg Episode VI"
cheat60_code = "800D13C9 000A"
cheat60_enable = false
cheat61_desc = "Infinite Minerals (Both Players - Almost All Modes/Missions)"
cheat61_code = "D00A49E3 0000+810B1D46 FFFF+D00A49E3 0001+810B1D4A FFFF+D00A49E3 0002+810B1D4E FFFF+D00A49E3 0003+810B1D52 FFFF+D00A49E3 0004+810B1D56 FFFF+D00A49E3 0005+810B1D5A FFFF+D00A49E3 0006+810B1D5E FFFF+D00A49E3 0007+810B1D62 FFFF+D00A49E3 0008+810B1D66 FFFF+D00A49E3 0009+810B1D6A FFFF+D00A49E3 000A+810B1D6E FFFF+D00A49E3 000B+810B1D72 FFFF"
cheat61_enable = false
cheat62_desc = "Infinite Vespene Gas (Both Players - Almost All Modes/Missions)"
cheat62_code = "D00A49E3 0000+810B1D76 FFFF+D00A49E3 0001+810B1D7A FFFF+D00A49E3 0002+810B1D7E FFFF+D00A49E3 0003+810B1D82 FFFF+D00A49E3 0004+810B1D86 FFFF+D00A49E3 0005+810B1D8A FFFF+D00A49E3 0006+810B1D8E FFFF+D00A49E3 0007+810B1D92 FFFF+D00A49E3 0008+810B1D96 FFFF+D00A49E3 0009+810B1D9A FFFF+D00A49E3 000A+810B1D9E FFFF+D00A49E3 000B+810B1DA2 FFFF"
cheat62_enable = false
cheat63_desc = "Have All Ten Marines (1st Terran Mission)"
cheat63_code = "800B5202 000A"
cheat63_enable = false
cheat64_desc = "Always Play Episode Modifier"
cheat64_code = "810DD922 0000"
cheat64_enable = false | {
"pile_set_name": "Github"
} |
# install_check.pl
do 'adsl-client-lib.pl';
# is_installed(mode)
# For mode 1, returns 2 if the server is installed and configured for use by
# Webmin, 1 if installed but not configured, or 0 otherwise.
# For mode 0, returns 1 if installed, 0 if not
sub is_installed
{
return 0 if (!&get_pppoe_version(\$dummy));
local $conf = &get_config();
return 0 if ($config{'conf_style'} == 0 && !$conf);
return $_[0] ? 2 : 1;
}
| {
"pile_set_name": "Github"
} |
S3 - Global Grants
==================
Scan buckets that allow for global access in their
ACLs and delete the associated ACL permissions.
.. code-block:: yaml
policies:
- name: s3-global-access
resource: s3
filters:
- type: global-grants
actions:
- type: delete-global-grants
grantees:
- "http://acs.amazonaws.com/groups/global/AllUsers"
- "http://acs.amazonaws.com/groups/global/AuthenticatedUsers"
| {
"pile_set_name": "Github"
} |
/*
* simple simple testsuite program
* Copyright © 2007—2016 Sam Hocevar <[email protected]>
* All Rights Reserved
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What the Fuck You Want
* to Public License, Version 2, as published by Sam Hocevar. See
* http://www.wtfpl.net/ for more details.
*/
#include "config.h"
#if !defined(__KERNEL__)
# include <stdio.h>
# include <stdlib.h>
#endif
#include "caca.h"
#define TEST(x) \
do \
{ \
tests++; \
if((x)) \
passed++; \
else \
fprintf(stderr, "test #%i failed: %s\n", (tests), #x); \
} \
while(0)
int main(int argc, char *argv[])
{
caca_canvas_t *cv;
int tests = 0, passed = 0;
cv = caca_create_canvas(0, 0);
caca_put_char(cv, 0, 0, 'x');
TEST(caca_get_char(cv, 0, 0) != 'x');
caca_rotate_180(cv);
caca_set_canvas_size(cv, 1, 1);
TEST(caca_get_char(cv, 0, 0) != 'x');
TEST(caca_get_char(cv, 0, 0) == ' ');
caca_put_char(cv, 0, 0, 'y');
TEST(caca_get_char(cv, 0, 0) == 'y');
caca_set_canvas_size(cv, 1000, 1000);
TEST(caca_get_canvas_width(cv) == 1000);
caca_put_char(cv, 999, 999, 'z');
TEST(caca_get_char(cv, 999, 999) == 'z');
caca_free_canvas(cv);
fprintf(stderr, "%i tests, %i errors\n", tests, tests - passed);
return 0;
}
| {
"pile_set_name": "Github"
} |
Sending Messages
================
Quick Reference for Sending a Message
-------------------------------------
Sending a message is very straightforward. You create a Transport, use it to
create the Mailer, then you use the Mailer to send the message.
To send a Message:
* Create a Transport from one of the provided Transports --
``Swift_SmtpTransport``, ``Swift_SendmailTransport``, ``Swift_MailTransport``
or one of the aggregate Transports.
* Create an instance of the ``Swift_Mailer`` class, using the Transport as
it's constructor parameter.
* Create a Message.
* Send the message via the ``send()`` method on the Mailer object.
.. caution::
The ``Swift_SmtpTransport`` and ``Swift_SendmailTransport`` transports use
``proc_*`` PHP functions, which might not be available on your PHP
installation. You can easily check if that's the case by running the
following PHP script: ``<?php echo function_exists('proc_open') ? "Yep,
that will work" : "Sorry, that won't work";``
When using ``send()`` the message will be sent just like it would be sent if you
used your mail client. An integer is returned which includes the number of
successful recipients. If none of the recipients could be sent to then zero will
be returned, which equates to a boolean ``false``. If you set two ``To:``
recipients and three ``Bcc:`` recipients in the message and all of the
recipients are delivered to successfully then the value 5 will be returned.
.. code-block:: php
require_once 'lib/swift_required.php';
// Create the Transport
$transport = Swift_SmtpTransport::newInstance('smtp.example.org', 25)
->setUsername('your username')
->setPassword('your password')
;
/*
You could alternatively use a different transport such as Sendmail or Mail:
// Sendmail
$transport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -bs');
// Mail
$transport = Swift_MailTransport::newInstance();
*/
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
// Create a message
$message = Swift_Message::newInstance('Wonderful Subject')
->setFrom(array('[email protected]' => 'John Doe'))
->setTo(array('[email protected]', '[email protected]' => 'A name'))
->setBody('Here is the message itself')
;
// Send the message
$result = $mailer->send($message);
Transport Types
~~~~~~~~~~~~~~~
A Transport is the component which actually does the sending. You need to
provide a Transport object to the Mailer class and there are several possible
options.
Typically you will not need to know how a Transport works under-the-surface,
you will only need to know how to create an instance of one, and which one to
use for your environment.
The SMTP Transport
..................
The SMTP Transport sends messages over the (standardized) Simple Message
Transfer Protocol. It can deal with encryption and authentication.
The SMTP Transport, ``Swift_SmtpTransport`` is without doubt the most commonly
used Transport because it will work on 99% of web servers (I just made that
number up, but you get the idea). All the server needs is the ability to
connect to a remote (or even local) SMTP server on the correct port number
(usually 25).
SMTP servers often require users to authenticate with a username and password
before any mail can be sent to other domains. This is easily achieved using
Swift Mailer with the SMTP Transport.
SMTP is a protocol -- in other words it's a "way" of communicating a job
to be done (i.e. sending a message). The SMTP protocol is the fundamental
basis on which messages are delivered all over the internet 7 days a week, 365
days a year. For this reason it's the most "direct" method of sending messages
you can use and it's the one that will give you the most power and feedback
(such as delivery failures) when using Swift Mailer.
Because SMTP is generally run as a remote service (i.e. you connect to it over
the network/internet) it's extremely portable from server-to-server. You can
easily store the SMTP server address and port number in a configuration file
within your application and adjust the settings accordingly if the code is
moved or if the SMTP server is changed.
Some SMTP servers -- Google for example -- use encryption for security reasons.
Swift Mailer supports using both SSL and TLS encryption settings.
Using the SMTP Transport
^^^^^^^^^^^^^^^^^^^^^^^^
The SMTP Transport is easy to use. Most configuration options can be set with
the constructor.
To use the SMTP Transport you need to know which SMTP server your code needs
to connect to. Ask your web host if you're not sure. Lots of people ask me who
to connect to -- I really can't answer that since it's a setting that's
extremely specific to your hosting environment.
To use the SMTP Transport:
* Call ``Swift_SmtpTransport::newInstance()`` with the SMTP server name and
optionally with a port number (defaults to 25).
* Use the returned object to create the Mailer.
A connection to the SMTP server will be established upon the first call to
``send()``.
.. code-block:: php
require_once 'lib/swift_required.php';
// Create the Transport
$transport = Swift_SmtpTransport::newInstance('smtp.example.org', 25);
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
/*
It's also possible to use multiple method calls
$transport = Swift_SmtpTransport::newInstance()
->setHost('smtp.example.org')
->setPort(25)
;
*/
Encrypted SMTP
^^^^^^^^^^^^^^
You can use SSL or TLS encryption with the SMTP Transport by specifying it as
a parameter or with a method call.
To use encryption with the SMTP Transport:
* Pass the encryption setting as a third parameter to
``Swift_SmtpTransport::newInstance()``; or
* Call the ``setEncryption()`` method on the Transport.
A connection to the SMTP server will be established upon the first call to
``send()``. The connection will be initiated with the correct encryption
settings.
.. note::
For SSL or TLS encryption to work your PHP installation must have
appropriate OpenSSL transports wrappers. You can check if "tls" and/or
"ssl" are present in your PHP installation by using the PHP function
``stream_get_transports()``
.. code-block:: php
require_once 'lib/swift_required.php';
// Create the Transport
$transport = Swift_SmtpTransport::newInstance('smtp.example.org', 587, 'ssl');
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
/*
It's also possible to use multiple method calls
$transport = Swift_SmtpTransport::newInstance()
->setHost('smtp.example.org')
->setPort(587)
->setEncryption('ssl')
;
*/
SMTP with a Username and Password
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Some servers require authentication. You can provide a username and password
with ``setUsername()`` and ``setPassword()`` methods.
To use a username and password with the SMTP Transport:
* Create the Transport with ``Swift_SmtpTransport::newInstance()``.
* Call the ``setUsername()`` and ``setPassword()`` methods on the Transport.
Your username and password will be used to authenticate upon first connect
when ``send()`` are first used on the Mailer.
If authentication fails, an Exception of type ``Swift_TransportException`` will
be thrown.
.. note::
If you need to know early whether or not authentication has failed and an
Exception is going to be thrown, call the ``start()`` method on the
created Transport.
.. code-block:: php
require_once 'lib/swift_required.php';
// Create the Transport the call setUsername() and setPassword()
$transport = Swift_SmtpTransport::newInstance('smtp.example.org', 25)
->setUsername('username')
->setPassword('password')
;
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
The Sendmail Transport
......................
The Sendmail Transport sends messages by communicating with a locally
installed MTA -- such as ``sendmail``.
The Sendmail Transport, ``Swift_SendmailTransport`` does not directly connect to
any remote services. It is designed for Linux servers that have ``sendmail``
installed. The Transport starts a local ``sendmail`` process and sends messages
to it. Usually the ``sendmail`` process will respond quickly as it spools your
messages to disk before sending them.
The Transport is named the Sendmail Transport for historical reasons
(``sendmail`` was the "standard" UNIX tool for sending e-mail for years). It
will send messages using other transfer agents such as Exim or Postfix despite
its name, provided they have the relevant sendmail wrappers so that they can be
started with the correct command-line flags.
It's a common misconception that because the Sendmail Transport returns a
result very quickly it must therefore deliver messages to recipients quickly
-- this is not true. It's not slow by any means, but it's certainly not
faster than SMTP when it comes to getting messages to the intended recipients.
This is because sendmail itself sends the messages over SMTP once they have
been quickly spooled to disk.
The Sendmail Transport has the potential to be just as smart of the SMTP
Transport when it comes to notifying Swift Mailer about which recipients were
rejected, but in reality the majority of locally installed ``sendmail``
instances are not configured well enough to provide any useful feedback. As such
Swift Mailer may report successful deliveries where they did in fact fail before
they even left your server.
You can run the Sendmail Transport in two different modes specified by command
line flags:
* "``-bs``" runs in SMTP mode so theoretically it will act like the SMTP
Transport
* "``-t``" runs in piped mode with no feedback, but theoretically faster,
though not advised
You can think of the Sendmail Transport as a sort of asynchronous SMTP Transport
-- though if you have problems with delivery failures you should try using the
SMTP Transport instead. Swift Mailer isn't doing the work here, it's simply
passing the work to somebody else (i.e. ``sendmail``).
Using the Sendmail Transport
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To use the Sendmail Transport you simply need to call
``Swift_SendmailTransport::newInstance()`` with the command as a parameter.
To use the Sendmail Transport you need to know where ``sendmail`` or another MTA
exists on the server. Swift Mailer uses a default value of
``/usr/sbin/sendmail``, which should work on most systems.
You specify the entire command as a parameter (i.e. including the command line
flags). Swift Mailer supports operational modes of "``-bs``" (default) and
"``-t``".
.. note::
If you run sendmail in "``-t``" mode you will get no feedback as to whether
or not sending has succeeded. Use "``-bs``" unless you have a reason not to.
To use the Sendmail Transport:
* Call ``Swift_SendmailTransport::newInstance()`` with the command, including
the correct command line flags. The default is to use ``/usr/sbin/sendmail
-bs`` if this is not specified.
* Use the returned object to create the Mailer.
A sendmail process will be started upon the first call to ``send()``. If the
process cannot be started successfully an Exception of type
``Swift_TransportException`` will be thrown.
.. code-block:: php
require_once 'lib/swift_required.php';
// Create the Transport
$transport = Swift_SendmailTransport::newInstance('/usr/sbin/exim -bs');
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
The Mail Transport
..................
The Mail Transport sends messages by delegating to PHP's internal
``mail()`` function.
In my experience -- and others' -- the ``mail()`` function is not particularly
predictable, or helpful.
Quite notably, the ``mail()`` function behaves entirely differently between
Linux and Windows servers. On linux it uses ``sendmail``, but on Windows it uses
SMTP.
In order for the ``mail()`` function to even work at all ``php.ini`` needs to be
configured correctly, specifying the location of sendmail or of an SMTP server.
The problem with ``mail()`` is that it "tries" to simplify things to the point
that it actually makes things more complex due to poor interface design. The
developers of Swift Mailer have gone to a lot of effort to make the Mail
Transport work with a reasonable degree of consistency.
Serious drawbacks when using this Transport are:
* Unpredictable message headers
* Lack of feedback regarding delivery failures
* Lack of support for several plugins that require real-time delivery feedback
It's a last resort, and we say that with a passion!
Using the Mail Transport
^^^^^^^^^^^^^^^^^^^^^^^^
To use the Mail Transport you simply need to call
``Swift_MailTransport::newInstance()``. It's unlikely you'll need to configure
the Transport.
To use the Mail Transport:
* Call ``Swift_MailTransport::newInstance()``.
* Use the returned object to create the Mailer.
Messages will be sent using the ``mail()`` function.
.. note::
The ``mail()`` function can take a ``$additional_parameters`` parameter.
Swift Mailer sets this to "``-f%s``" by default, where the "%s" is
substituted with the address of the sender (via a ``sprintf()``) at send
time. You may override this default by passing an argument to
``newInstance()``.
.. code-block:: php
require_once 'lib/swift_required.php';
// Create the Transport
$transport = Swift_MailTransport::newInstance();
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
Available Methods for Sending Messages
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Mailer class offers two methods for sending Messages -- ``send()``.
Each behaves in a slightly different way.
When a message is sent in Swift Mailer, the Mailer class communicates with
whichever Transport class you have chosen to use.
Each recipient in the message should either be accepted or rejected by the
Transport. For example, if the domain name on the email address is not
reachable the SMTP Transport may reject the address because it cannot process
it. Whichever method you use -- ``send()`` -- Swift Mailer will return
an integer indicating the number of accepted recipients.
.. note::
It's possible to find out which recipients were rejected -- we'll cover that
later in this chapter.
Using the ``send()`` Method
...........................
The ``send()`` method of the ``Swift_Mailer`` class sends a message using
exactly the same logic as your Desktop mail client would use. Just pass it a
Message and get a result.
To send a Message with ``send()``:
* Create a Transport from one of the provided Transports --
``Swift_SmtpTransport``, ``Swift_SendmailTransport``,
``Swift_MailTransport`` or one of the aggregate Transports.
* Create an instance of the ``Swift_Mailer`` class, using the Transport as
it's constructor parameter.
* Create a Message.
* Send the message via the ``send()`` method on the Mailer object.
The message will be sent just like it would be sent if you used your mail
client. An integer is returned which includes the number of successful
recipients. If none of the recipients could be sent to then zero will be
returned, which equates to a boolean ``false``. If you set two
``To:`` recipients and three ``Bcc:`` recipients in the message and all of the
recipients are delivered to successfully then the value 5 will be returned.
.. code-block:: php
require_once 'lib/swift_required.php';
// Create the Transport
$transport = Swift_SmtpTransport::newInstance('localhost', 25);
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
// Create a message
$message = Swift_Message::newInstance('Wonderful Subject')
->setFrom(array('[email protected]' => 'John Doe'))
->setTo(array('[email protected]', '[email protected]' => 'A name'))
->setBody('Here is the message itself')
;
// Send the message
$numSent = $mailer->send($message);
printf("Sent %d messages\n", $numSent);
/* Note that often that only the boolean equivalent of the
return value is of concern (zero indicates FALSE)
if ($mailer->send($message))
{
echo "Sent\n";
}
else
{
echo "Failed\n";
}
*/
Sending Emails in Batch
.......................
If you want to send a separate message to each recipient so that only their
own address shows up in the ``To:`` field, follow the following recipe:
* Create a Transport from one of the provided Transports --
``Swift_SmtpTransport``, ``Swift_SendmailTransport``,
``Swift_MailTransport`` or one of the aggregate Transports.
* Create an instance of the ``Swift_Mailer`` class, using the Transport as
it's constructor parameter.
* Create a Message.
* Iterate over the recipients and send message via the ``send()`` method on
the Mailer object.
Each recipient of the messages receives a different copy with only their own
email address on the ``To:`` field.
Make sure to add only valid email addresses as recipients. If you try to add an
invalid email address with ``setTo()``, ``setCc()`` or ``setBcc()``, Swift
Mailer will throw a ``Swift_RfcComplianceException``.
If you add recipients automatically based on a data source that may contain
invalid email addresses, you can prevent possible exceptions by validating the
addresses using ``Swift_Validate::email($email)`` and only adding addresses
that validate. Another way would be to wrap your ``setTo()``, ``setCc()`` and
``setBcc()`` calls in a try-catch block and handle the
``Swift_RfcComplianceException`` in the catch block.
Handling invalid addresses properly is especially important when sending emails
in large batches since a single invalid address might cause an unhandled
exception and stop the execution or your script early.
.. note::
In the following example, two emails are sent. One to each of
``[email protected]`` and ``[email protected]``. These recipients will
not be aware of each other.
.. code-block:: php
require_once 'lib/swift_required.php';
// Create the Transport
$transport = Swift_SmtpTransport::newInstance('localhost', 25);
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
// Create a message
$message = Swift_Message::newInstance('Wonderful Subject')
->setFrom(array('[email protected]' => 'John Doe'))
->setBody('Here is the message itself')
;
// Send the message
$failedRecipients = array();
$numSent = 0;
$to = array('[email protected]', '[email protected]' => 'A name');
foreach ($to as $address => $name)
{
if (is_int($address)) {
$message->setTo($name);
} else {
$message->setTo(array($address => $name));
}
$numSent += $mailer->send($message, $failedRecipients);
}
printf("Sent %d messages\n", $numSent);
Finding out Rejected Addresses
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It's possible to get a list of addresses that were rejected by the Transport
by using a by-reference parameter to ``send()``.
As Swift Mailer attempts to send the message to each address given to it, if a
recipient is rejected it will be added to the array. You can pass an existing
array, otherwise one will be created by-reference.
Collecting the list of recipients that were rejected can be useful in
circumstances where you need to "prune" a mailing list for example when some
addresses cannot be delivered to.
Getting Failures By-reference
.............................
Collecting delivery failures by-reference with the ``send()`` method is as
simple as passing a variable name to the method call.
To get failed recipients by-reference:
* Pass a by-reference variable name to the ``send()`` method of the Mailer
class.
If the Transport rejects any of the recipients, the culprit addresses will be
added to the array provided by-reference.
.. note::
If the variable name does not yet exist, it will be initialized as an
empty array and then failures will be added to that array. If the variable
already exists it will be type-cast to an array and failures will be added
to it.
.. code-block:: php
$mailer = Swift_Mailer::newInstance( ... );
$message = Swift_Message::newInstance( ... )
->setFrom( ... )
->setTo(array(
'[email protected]' => 'Receiver Name',
'[email protected]' => 'A name',
'[email protected]' => 'Other Name'
))
->setBody( ... )
;
// Pass a variable name to the send() method
if (!$mailer->send($message, $failures))
{
echo "Failures:";
print_r($failures);
}
/*
Failures:
Array (
0 => [email protected],
1 => [email protected]
)
*/
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_COOKIES_COOKIE_UTIL_H_
#define NET_COOKIES_COOKIE_UTIL_H_
#include <string>
#include "base/time/time.h"
#include "net/base/net_export.h"
class GURL;
namespace net {
namespace cookie_util {
// Returns the effective TLD+1 for a given host. This only makes sense for http
// and https schemes. For other schemes, the host will be returned unchanged
// (minus any leading period).
NET_EXPORT std::string GetEffectiveDomain(const std::string& scheme,
const std::string& host);
// Determine the actual cookie domain based on the domain string passed
// (if any) and the URL from which the cookie came.
// On success returns true, and sets cookie_domain to either a
// -host cookie domain (ex: "google.com")
// -domain cookie domain (ex: ".google.com")
NET_EXPORT bool GetCookieDomainWithString(const GURL& url,
const std::string& domain_string,
std::string* result);
// Returns true if a domain string represents a host-only cookie,
// i.e. it doesn't begin with a leading '.' character.
NET_EXPORT bool DomainIsHostOnly(const std::string& domain_string);
// Parses the string with the cookie time (very forgivingly).
NET_EXPORT base::Time ParseCookieTime(const std::string& time_string);
// Convenience for converting a cookie origin (domain and https pair) to a URL.
NET_EXPORT GURL CookieOriginToURL(const std::string& domain, bool is_https);
} // namspace cookie_util
} // namespace net
#endif // NET_COOKIES_COOKIE_UTIL_H_
| {
"pile_set_name": "Github"
} |
export { default } from '@ember-data/serializer/json';
| {
"pile_set_name": "Github"
} |
// this file gets run BEFORE `npm i` so you CAN NOT use npm packages here
const { join } = require('path')
const fs = require('fs')
const packageJSON = join(__dirname, '../../package.json')
const p = JSON.parse(fs.readFileSync(packageJSON))
p.name = 'deltachat-desktop-dev'
p.productName = 'DeltaChat-DevBuild'
p.version = p.version + '-DevBuild'
fs.writeFileSync(packageJSON, JSON.stringify(p, null, 1))
const appConfig = join(__dirname, '../../src/main/application-config.ts')
const fileContent = fs
.readFileSync(appConfig, 'utf-8')
.replace(
"const appConfig = applicationConfig('DeltaChat')",
"const appConfig = applicationConfig('DeltaChatDev')"
)
fs.writeFileSync(appConfig, fileContent)
const electronBuilderConfig = join(
__dirname,
'../../build/gen-electron-builder-config.js'
)
fs.writeFileSync(
electronBuilderConfig,
fs
.readFileSync(electronBuilderConfig, 'utf-8')
.replace(
"build['appId'] = 'chat.delta.desktop.electron'",
"build['appId'] = 'chat.delta.desktop.electron.dev'"
)
)
| {
"pile_set_name": "Github"
} |
12
0 1 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 1 0 1 0 0 0 1 1 0
0 0 0 0 0 0 0 0 1 0 0 1
0 0 1 0 0 0 0 1 1 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0
| {
"pile_set_name": "Github"
} |
# vim:ft=automake
# All paths should be given relative to the root
#
EXTRA_DIST += \
certs/1024/client-cert.pem \
certs/1024/client-key.pem \
certs/1024/dh1024.pem \
certs/1024/dsa1024.pem
EXTRA_DIST += \
certs/1024/client-cert.der \
certs/1024/client-key.der \
certs/1024/dh1024.der \
certs/1024/dsa1024.der \
certs/1024/rsa1024.der
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include gen_approx_french | {
"pile_set_name": "Github"
} |
<hkobject name="#0939" class="hkbStateMachineStateInfo" signature="0xed7f9d0">
<hkparam name="variableBindingSet">null</hkparam>
<hkparam name="listeners" numelements="0"></hkparam>
<hkparam name="enterNotifyEvents">#1045</hkparam>
<hkparam name="exitNotifyEvents">#1044</hkparam>
<hkparam name="transitions">#1043</hkparam>
<!-- MOD_CODE ~zcbe~ OPEN -->
<hkparam name="generator">#zcbe$32</hkparam>
<!-- ORIGINAL -->
<hkparam name="generator">#0940</hkparam>
<!-- CLOSE -->
<hkparam name="name">MRh_1HM_Attack</hkparam>
<hkparam name="stateId">18</hkparam>
<hkparam name="probability">1.000000</hkparam>
<hkparam name="enable">true</hkparam>
</hkobject>
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="1.2.10" />
<package id="NUnit" version="2.5.10.11092" />
</packages> | {
"pile_set_name": "Github"
} |
use std::fs;
use std::path::Path;
pub fn main() {
for f in fs::read_dir("/").unwrap() {
let f = f.unwrap();
println!("{}", Path::new(&f.file_name()).display());
}
}
| {
"pile_set_name": "Github"
} |
[1 of 5] Processing p
[1 of 1] Compiling A[sig] ( p/A.hsig, nothing )
[2 of 5] Processing q
[1 of 1] Compiling A[sig] ( q/A.hsig, nothing )
[3 of 5] Processing r
[1 of 1] Compiling A[sig] ( r/A.hsig, nothing )
[4 of 5] Processing i
Instantiating i
[1 of 1] Compiling A ( i/A.hs, bkp48.out/i/A.o )
[5 of 5] Processing m
Instantiating m
[1 of 3] Including r[A=i:A]
Instantiating r[A=i:A]
[1 of 2] Including p[A=i:A]
Instantiating p[A=i:A]
[1 of 1] Compiling A[sig] ( p/A.hsig, bkp48.out/p/p-CtJxD03mJqIIVJzOga8l4X/A.o )
[2 of 2] Including q[A=i:A]
Instantiating q[A=i:A]
[1 of 1] Compiling A[sig] ( q/A.hsig, bkp48.out/q/q-CtJxD03mJqIIVJzOga8l4X/A.o )
[1 of 1] Compiling A[sig] ( r/A.hsig, bkp48.out/r/r-CtJxD03mJqIIVJzOga8l4X/A.o )
[2 of 3] Including p[A=i:A]
[3 of 3] Including q[A=i:A]
| {
"pile_set_name": "Github"
} |
// javac BigDecTest.java
// java BigDecTest
import java.math.BigDecimal;
public class BigDecTest
{
public static void main(String[] args) {
int i;
BigDecimal x, y, r;
// remainder
x = new BigDecimal("9.785496E-2");
y = new BigDecimal("-5.9219189762E-2");
r = x.remainder(y);
System.out.println( r.toString() );
// 0.038635770238
x = new BigDecimal("1.23693014661017964112E-5");
y = new BigDecimal("-6.9318042E-7");
r = x.remainder(y);
System.out.println( r.toPlainString() );
// 0.0000005852343261017964112
// divide
x = new BigDecimal("6.9609119610E-78");
y = new BigDecimal("4E-48");
r = x.divide(y, 40, 6); // ROUND_HALF_EVEN
System.out.println( r.toString() );
// 1.7402279902E-30
x = new BigDecimal("5.383458817E-83");
y = new BigDecimal("8E-54");
r = x.divide(y, 40, 6);
System.out.println( r.toString() );
// 6.7293235212E-30
// compareTo
x = new BigDecimal("0.04");
y = new BigDecimal("0.079393068");
i = x.compareTo(y);
System.out.println(i);
// -1
x = new BigDecimal("7.88749578569876987785987658649E-10");
y = new BigDecimal("4.2545098709E-6");
i = x.compareTo(y);
System.out.println(i);
// -1
}
}
| {
"pile_set_name": "Github"
} |
#include "catch.hpp"
#include <osmium/geom/mercator_projection.hpp>
TEST_CASE("Mercator projection") {
const osmium::geom::MercatorProjection projection;
REQUIRE(3857 == projection.epsg());
REQUIRE("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs" == projection.proj_string());
}
TEST_CASE("Low level mercator functions") {
const osmium::geom::Coordinates c1{17.839, -3.249};
const osmium::geom::Coordinates r1 = osmium::geom::mercator_to_lonlat(osmium::geom::lonlat_to_mercator(c1));
REQUIRE(r1.x == Approx(c1.x).epsilon(0.000001));
REQUIRE(r1.y == Approx(c1.y).epsilon(0.000001));
const osmium::geom::Coordinates c2{-89.2, 15.915};
const osmium::geom::Coordinates r2 = osmium::geom::mercator_to_lonlat(osmium::geom::lonlat_to_mercator(c2));
REQUIRE(r2.x == Approx(c2.x).epsilon(0.000001));
REQUIRE(r2.y == Approx(c2.y).epsilon(0.000001));
const osmium::geom::Coordinates c3{180.0, 85.0};
const osmium::geom::Coordinates r3 = osmium::geom::mercator_to_lonlat(osmium::geom::lonlat_to_mercator(c3));
REQUIRE(r3.x == Approx(c3.x).epsilon(0.000001));
REQUIRE(r3.y == Approx(c3.y).epsilon(0.000001));
}
TEST_CASE("Mercator bounds") {
const osmium::Location mmax{180.0, osmium::geom::MERCATOR_MAX_LAT};
const osmium::geom::Coordinates c = osmium::geom::lonlat_to_mercator(mmax);
REQUIRE(c.x == Approx(c.y).epsilon(0.001));
REQUIRE(osmium::geom::detail::y_to_lat(osmium::geom::detail::lon_to_x(180.0)) == Approx(osmium::geom::MERCATOR_MAX_LAT).epsilon(0.0000001));
}
| {
"pile_set_name": "Github"
} |
/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package meta
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
)
type ListMetaAccessor interface {
GetListMeta() List
}
// List lets you work with list metadata from any of the versioned or
// internal API objects. Attempting to set or retrieve a field on an object that does
// not support that field will be a no-op and return a default value.
type List metav1.ListInterface
// Type exposes the type and APIVersion of versioned or internal API objects.
type Type metav1.Type
// MetadataAccessor lets you work with object and list metadata from any of the versioned or
// internal API objects. Attempting to set or retrieve a field on an object that does
// not support that field (Name, UID, Namespace on lists) will be a no-op and return
// a default value.
//
// MetadataAccessor exposes Interface in a way that can be used with multiple objects.
type MetadataAccessor interface {
APIVersion(obj runtime.Object) (string, error)
SetAPIVersion(obj runtime.Object, version string) error
Kind(obj runtime.Object) (string, error)
SetKind(obj runtime.Object, kind string) error
Namespace(obj runtime.Object) (string, error)
SetNamespace(obj runtime.Object, namespace string) error
Name(obj runtime.Object) (string, error)
SetName(obj runtime.Object, name string) error
GenerateName(obj runtime.Object) (string, error)
SetGenerateName(obj runtime.Object, name string) error
UID(obj runtime.Object) (types.UID, error)
SetUID(obj runtime.Object, uid types.UID) error
SelfLink(obj runtime.Object) (string, error)
SetSelfLink(obj runtime.Object, selfLink string) error
Labels(obj runtime.Object) (map[string]string, error)
SetLabels(obj runtime.Object, labels map[string]string) error
Annotations(obj runtime.Object) (map[string]string, error)
SetAnnotations(obj runtime.Object, annotations map[string]string) error
Continue(obj runtime.Object) (string, error)
SetContinue(obj runtime.Object, c string) error
runtime.ResourceVersioner
}
type RESTScopeName string
const (
RESTScopeNameNamespace RESTScopeName = "namespace"
RESTScopeNameRoot RESTScopeName = "root"
)
// RESTScope contains the information needed to deal with REST resources that are in a resource hierarchy
type RESTScope interface {
// Name of the scope
Name() RESTScopeName
}
// RESTMapping contains the information needed to deal with objects of a specific
// resource and kind in a RESTful manner.
type RESTMapping struct {
// Resource is the GroupVersionResource (location) for this endpoint
Resource schema.GroupVersionResource
// GroupVersionKind is the GroupVersionKind (data format) to submit to this endpoint
GroupVersionKind schema.GroupVersionKind
// Scope contains the information needed to deal with REST Resources that are in a resource hierarchy
Scope RESTScope
}
// RESTMapper allows clients to map resources to kind, and map kind and version
// to interfaces for manipulating those objects. It is primarily intended for
// consumers of Kubernetes compatible REST APIs as defined in docs/devel/api-conventions.md.
//
// The Kubernetes API provides versioned resources and object kinds which are scoped
// to API groups. In other words, kinds and resources should not be assumed to be
// unique across groups.
//
// TODO: split into sub-interfaces
type RESTMapper interface {
// KindFor takes a partial resource and returns the single match. Returns an error if there are multiple matches
KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
// KindsFor takes a partial resource and returns the list of potential kinds in priority order
KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
// ResourceFor takes a partial resource and returns the single match. Returns an error if there are multiple matches
ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
// ResourcesFor takes a partial resource and returns the list of potential resource in priority order
ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)
// RESTMapping identifies a preferred resource mapping for the provided group kind.
RESTMapping(gk schema.GroupKind, versions ...string) (*RESTMapping, error)
// RESTMappings returns all resource mappings for the provided group kind if no
// version search is provided. Otherwise identifies a preferred resource mapping for
// the provided version(s).
RESTMappings(gk schema.GroupKind, versions ...string) ([]*RESTMapping, error)
ResourceSingularizer(resource string) (singular string, err error)
}
| {
"pile_set_name": "Github"
} |
/*
* Harbour class/OOP test
*
* Copyright 2006 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file LICENSE.txt. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA (or visit https://www.gnu.org/licenses/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
#include "rt_main.ch"
/* Don't change the position of this #include. */
#include "rt_vars.ch"
#include "hbclass.ch"
MEMVAR objHolder, cDtorResult
PROCEDURE Main_CLASS()
LOCAL oValue, aRef
PRIVATE objHolder, cDtorResult
#ifdef __HARBOUR__
/* Test destructors */
HBTEST cDtorResult := "" IS ""
HBTEST objHolder := NIL IS NIL
oValue := DTORCLASS():NEW( 0 )
HBTEST oValue:type IS 0
HBTEST oValue := NIL IS NIL
HBTEST objHolder IS NIL
HBTEST cDtorResult IS "No references to self."
HBTEST cDtorResult := "" IS ""
HBTEST objHolder := NIL IS NIL
oValue := DTORCLASS():NEW( 1 )
HBTEST oValue:type IS 1
HBTEST oValue := NIL IS NIL
HBTEST objHolder IS NIL
HBTEST cDtorResult IS "Reference to self in instance variable."
HBTEST cDtorResult := "" IS ""
HBTEST objHolder := NIL IS NIL
oValue := DTORCLASS():NEW( 2 )
HBTEST oValue:type IS 2
HBTEST oValue := NIL IS "E 45 BASE 1301 Object destructor failure (Reference to freed block) OS:0 #:0 "
HBTEST objHolder IS NIL
HBTEST cDtorResult IS "Reference to self in class variable."
HBTEST cDtorResult := "" IS ""
HBTEST objHolder := NIL IS NIL
oValue := DTORCLASS():NEW( 3 )
HBTEST oValue:type IS 3
HBTEST oValue := NIL IS "E 45 BASE 1301 Object destructor failure (Reference to freed block) OS:0 #:0 "
HBTEST ValType( objHolder ) IS "A"
HBTEST Len( objHolder ) IS 0
HBTEST cDtorResult IS "Reference to self in private memvar."
/* Tests with cross references and releasing by Garbage Collector */
HBTEST cDtorResult := "" IS ""
HBTEST objHolder := NIL IS NIL
oValue := DTORCLASS():NEW( 0 )
HBTEST oValue:type IS 0
/* create cross reference */
aRef := { oValue, NIL }; aRef[ 2 ] := aRef; aRef := NIL
HBTEST oValue := NIL IS NIL
HBTEST objHolder IS NIL
HBTEST cDtorResult IS ""
HBTEST hb_gcAll() IS NIL
HBTEST objHolder IS NIL
HBTEST cDtorResult IS "No references to self."
HBTEST cDtorResult := "" IS ""
HBTEST objHolder := NIL IS NIL
oValue := DTORCLASS():NEW( 1 )
HBTEST oValue:type IS 1
/* create cross reference */
aRef := { oValue, NIL }; aRef[ 2 ] := aRef; aRef := NIL
HBTEST oValue := NIL IS NIL
HBTEST objHolder IS NIL
HBTEST cDtorResult IS ""
HBTEST hb_gcAll() IS NIL
HBTEST objHolder IS NIL
HBTEST cDtorResult IS "Reference to self in instance variable."
HBTEST cDtorResult := "" IS ""
HBTEST objHolder := NIL IS NIL
oValue := DTORCLASS():NEW( 2 )
HBTEST oValue:type IS 2
/* create cross reference */
aRef := { oValue, NIL }; aRef[ 2 ] := aRef; aRef := NIL
HBTEST oValue := NIL IS NIL
HBTEST objHolder IS NIL
HBTEST cDtorResult IS ""
HBTEST hb_gcAll() IS "E 45 BASE 1302 Object destructor failure (Reference to freed block) OS:0 #:0 "
HBTEST objHolder IS NIL
HBTEST cDtorResult IS "Reference to self in class variable."
HBTEST cDtorResult := "" IS ""
HBTEST objHolder := NIL IS NIL
oValue := DTORCLASS():NEW( 3 )
HBTEST oValue:type IS 3
/* create cross reference */
aRef := { oValue, NIL }; aRef[ 2 ] := aRef; aRef := NIL
HBTEST oValue := NIL IS NIL
HBTEST objHolder IS NIL
HBTEST cDtorResult IS ""
HBTEST hb_gcAll() IS "E 45 BASE 1302 Object destructor failure (Reference to freed block) OS:0 #:0 "
HBTEST ValType( objHolder ) IS "A"
HBTEST Len( objHolder ) IS 0
HBTEST cDtorResult IS "Reference to self in private memvar."
/* Test instance area allocating and casting */
oValue := IVARSCLASS4():new()
HBTEST oValue:x1 IS "(x1)"
HBTEST oValue:y1 IS "(y1)"
HBTEST oValue:z1 IS "(z1)"
HBTEST oValue:x2 IS "(x2)"
HBTEST oValue:y2 IS "(y2)"
HBTEST oValue:z2 IS "(z2)"
HBTEST oValue:x3 IS "(x3)"
HBTEST oValue:y3 IS "(y3)"
HBTEST oValue:z3 IS "(z3)"
HBTEST oValue:x4 IS "(x4)"
HBTEST oValue:y4 IS "(y4)"
HBTEST oValue:z4 IS "(z4)"
HBTEST INSTANCE_DATA( oValue ) IS "[12]: (x1) (y1) (z1) (x2) (y2) (z2) (x3) (y3) (z3) (x4) (y4) (z4)"
HBTEST __cls_CntClsData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntClsData( oValue:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntShrData( oValue:classH ) IS 0
/* simple assignment... */
HBTEST oValue:x1 := " X1 " IS " X1 "
HBTEST oValue:y1 := " Y1 " IS " Y1 "
HBTEST oValue:z1 := " Z1 " IS " Z1 "
HBTEST oValue:x2 := " X2 " IS " X2 "
HBTEST oValue:y2 := " Y2 " IS " Y2 "
HBTEST oValue:z2 := " Z2 " IS " Z2 "
HBTEST oValue:x3 := " X3 " IS " X3 "
HBTEST oValue:y3 := " Y3 " IS " Y3 "
HBTEST oValue:z3 := " Z3 " IS " Z3 "
HBTEST oValue:x4 := " X4 " IS " X4 "
HBTEST oValue:y4 := " Y4 " IS " Y4 "
HBTEST oValue:z4 := " Z4 " IS " Z4 "
HBTEST oValue:x1 IS " X1 "
HBTEST oValue:y1 IS " Y1 "
HBTEST oValue:z1 IS " Z1 "
HBTEST oValue:x2 IS " X2 "
HBTEST oValue:y2 IS " Y2 "
HBTEST oValue:z2 IS " Z2 "
HBTEST oValue:x3 IS " X3 "
HBTEST oValue:y3 IS " Y3 "
HBTEST oValue:z3 IS " Z3 "
HBTEST oValue:x4 IS " X4 "
HBTEST oValue:y4 IS " Y4 "
HBTEST oValue:z4 IS " Z4 "
HBTEST INSTANCE_DATA( oValue ) IS "[12]: X1 Y1 Z1 X2 Y2 Z2 X3 Y3 Z3 X4 Y4 Z4 "
HBTEST __cls_CntClsData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntClsData( oValue:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntShrData( oValue:classH ) IS 0
/* Setting IVARSCLASS1 instance variables... */
HBTEST oValue:IVARSCLASS1:x1 := "[X1]" IS "[X1]"
HBTEST oValue:IVARSCLASS1:y1 := "[Y1]" IS "[Y1]"
HBTEST oValue:IVARSCLASS1:z1 := "[Z1]" IS "[Z1]"
HBTEST oValue:x1 IS "[X1]"
HBTEST oValue:y1 IS "[Y1]"
HBTEST oValue:z1 IS "[Z1]"
HBTEST oValue:x2 IS " X2 "
HBTEST oValue:y2 IS " Y2 "
HBTEST oValue:z2 IS " Z2 "
HBTEST oValue:x3 IS " X3 "
HBTEST oValue:y3 IS " Y3 "
HBTEST oValue:z3 IS " Z3 "
HBTEST oValue:x4 IS " X4 "
HBTEST oValue:y4 IS " Y4 "
HBTEST oValue:z4 IS " Z4 "
HBTEST INSTANCE_DATA( oValue ) IS "[12]: [X1] [Y1] [Z1] X2 Y2 Z2 X3 Y3 Z3 X4 Y4 Z4 "
HBTEST __cls_CntClsData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntClsData( oValue:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntShrData( oValue:classH ) IS 0
/* Setting IVARSCLASS2 instance variables... */
HBTEST oValue:IVARSCLASS2:x2 := "[X2]" IS "[X2]"
HBTEST oValue:IVARSCLASS2:y2 := "[Y2]" IS "[Y2]"
HBTEST oValue:IVARSCLASS2:z2 := "[Z2]" IS "[Z2]"
HBTEST oValue:x1 IS "[X1]"
HBTEST oValue:y1 IS "[Y1]"
HBTEST oValue:z1 IS "[Z1]"
HBTEST oValue:x2 IS "[X2]"
HBTEST oValue:y2 IS "[Y2]"
HBTEST oValue:z2 IS "[Z2]"
HBTEST oValue:x3 IS " X3 "
HBTEST oValue:y3 IS " Y3 "
HBTEST oValue:z3 IS " Z3 "
HBTEST oValue:x4 IS " X4 "
HBTEST oValue:y4 IS " Y4 "
HBTEST oValue:z4 IS " Z4 "
HBTEST INSTANCE_DATA( oValue ) IS "[12]: [X1] [Y1] [Z1] [X2] [Y2] [Z2] X3 Y3 Z3 X4 Y4 Z4 "
HBTEST __cls_CntClsData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntClsData( oValue:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntShrData( oValue:classH ) IS 0
/* Setting IVARSCLASS3 instance variables... */
HBTEST oValue:IVARSCLASS3:x3 := "[X3]" IS "[X3]"
HBTEST oValue:IVARSCLASS3:y3 := "[Y3]" IS "[Y3]"
HBTEST oValue:IVARSCLASS3:z3 := "[Z3]" IS "[Z3]"
HBTEST oValue:x1 IS "[X1]"
HBTEST oValue:y1 IS "[Y1]"
HBTEST oValue:z1 IS "[Z1]"
HBTEST oValue:x2 IS "[X2]"
HBTEST oValue:y2 IS "[Y2]"
HBTEST oValue:z2 IS "[Z2]"
HBTEST oValue:x3 IS "[X3]"
HBTEST oValue:y3 IS "[Y3]"
HBTEST oValue:z3 IS "[Z3]"
HBTEST oValue:x4 IS " X4 "
HBTEST oValue:y4 IS " Y4 "
HBTEST oValue:z4 IS " Z4 "
HBTEST INSTANCE_DATA( oValue ) IS "[12]: [X1] [Y1] [Z1] [X2] [Y2] [Z2] [X3] [Y3] [Z3] X4 Y4 Z4 "
HBTEST __cls_CntClsData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntClsData( oValue:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntShrData( oValue:classH ) IS 0
/* Setting IVARSCLASS4 instance variables... */
HBTEST oValue:IVARSCLASS4:x4 := "[X4]" IS "[X4]"
HBTEST oValue:IVARSCLASS4:y4 := "[Y4]" IS "[Y4]"
HBTEST oValue:IVARSCLASS4:z4 := "[Z4]" IS "[Z4]"
HBTEST oValue:x1 IS "[X1]"
HBTEST oValue:y1 IS "[Y1]"
HBTEST oValue:z1 IS "[Z1]"
HBTEST oValue:x2 IS "[X2]"
HBTEST oValue:y2 IS "[Y2]"
HBTEST oValue:z2 IS "[Z2]"
HBTEST oValue:x3 IS "[X3]"
HBTEST oValue:y3 IS "[Y3]"
HBTEST oValue:z3 IS "[Z3]"
HBTEST oValue:x4 IS "[X4]"
HBTEST oValue:y4 IS "[Y4]"
HBTEST oValue:z4 IS "[Z4]"
HBTEST INSTANCE_DATA( oValue ) IS "[12]: [X1] [Y1] [Z1] [X2] [Y2] [Z2] [X3] [Y3] [Z3] [X4] [Y4] [Z4]"
HBTEST __cls_CntClsData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntClsData( oValue:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntShrData( oValue:classH ) IS 0
/* Setting IVARSCLASS3:IVARSCLASS1 instance variables... */
HBTEST oValue:IVARSCLASS3:IVARSCLASS1:x1 := "<X1>" IS "<X1>"
HBTEST oValue:IVARSCLASS3:IVARSCLASS1:y1 := "<Y1>" IS "<Y1>"
HBTEST oValue:IVARSCLASS3:IVARSCLASS1:z1 := "<Z1>" IS "<Z1>"
HBTEST oValue:x1 IS "<X1>"
HBTEST oValue:y1 IS "<Y1>"
HBTEST oValue:z1 IS "<Z1>"
HBTEST oValue:x2 IS "[X2]"
HBTEST oValue:y2 IS "[Y2]"
HBTEST oValue:z2 IS "[Z2]"
HBTEST oValue:x3 IS "[X3]"
HBTEST oValue:y3 IS "[Y3]"
HBTEST oValue:z3 IS "[Z3]"
HBTEST oValue:x4 IS "[X4]"
HBTEST oValue:y4 IS "[Y4]"
HBTEST oValue:z4 IS "[Z4]"
HBTEST INSTANCE_DATA( oValue ) IS "[12]: <X1> <Y1> <Z1> [X2] [Y2] [Z2] [X3] [Y3] [Z3] [X4] [Y4] [Z4]"
HBTEST __cls_CntClsData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntClsData( oValue:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntShrData( oValue:classH ) IS 0
/* Setting IVARSCLASS3:IVARSCLASS2 instance variables... */
HBTEST oValue:IVARSCLASS3:IVARSCLASS2:x2 := "<X2>" IS "<X2>"
HBTEST oValue:IVARSCLASS3:IVARSCLASS2:y2 := "<Y2>" IS "<Y2>"
HBTEST oValue:IVARSCLASS3:IVARSCLASS2:z2 := "<Z2>" IS "<Z2>"
HBTEST oValue:x1 IS "<X1>"
HBTEST oValue:y1 IS "<Y1>"
HBTEST oValue:z1 IS "<Z1>"
HBTEST oValue:x2 IS "<X2>"
HBTEST oValue:y2 IS "<Y2>"
HBTEST oValue:z2 IS "<Z2>"
HBTEST oValue:x3 IS "[X3]"
HBTEST oValue:y3 IS "[Y3]"
HBTEST oValue:z3 IS "[Z3]"
HBTEST oValue:x4 IS "[X4]"
HBTEST oValue:y4 IS "[Y4]"
HBTEST oValue:z4 IS "[Z4]"
HBTEST INSTANCE_DATA( oValue ) IS "[12]: <X1> <Y1> <Z1> <X2> <Y2> <Z2> [X3] [Y3] [Z3] [X4] [Y4] [Z4]"
HBTEST __cls_CntClsData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntClsData( oValue:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntShrData( oValue:classH ) IS 0
/* Setting SUPER instance variables... */
HBTEST oValue:super:x1 := "{X1}" IS "{X1}"
HBTEST oValue:super:y1 := "{Y1}" IS "{Y1}"
HBTEST oValue:super:z1 := "{Z1}" IS "{Z1}"
HBTEST oValue:super:x2 := "{X2}" IS "{X2}"
HBTEST oValue:super:y2 := "{Y2}" IS "{Y2}"
HBTEST oValue:super:z2 := "{Z2}" IS "{Z2}"
HBTEST oValue:super:x3 := "{X3}" IS "{X3}"
HBTEST oValue:super:y3 := "{Y3}" IS "{Y3}"
HBTEST oValue:super:z3 := "{Z3}" IS "{Z3}"
HBTEST oValue:x1 IS "{X1}"
HBTEST oValue:y1 IS "{Y1}"
HBTEST oValue:z1 IS "{Z1}"
HBTEST oValue:x2 IS "{X2}"
HBTEST oValue:y2 IS "{Y2}"
HBTEST oValue:z2 IS "{Z2}"
HBTEST oValue:x3 IS "{X3}"
HBTEST oValue:y3 IS "{Y3}"
HBTEST oValue:z3 IS "{Z3}"
HBTEST oValue:x4 IS "[X4]"
HBTEST oValue:y4 IS "[Y4]"
HBTEST oValue:z4 IS "[Z4]"
HBTEST INSTANCE_DATA( oValue ) IS "[12]: {X1} {Y1} {Z1} {X2} {Y2} {Z2} {X3} {Y3} {Z3} [X4] [Y4] [Z4]"
HBTEST __cls_CntClsData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntClsData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntClsData( oValue:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS1:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS2:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS3:classH ) IS 0
HBTEST __cls_CntShrData( oValue:IVARSCLASS4:classH ) IS 0
HBTEST __cls_CntShrData( oValue:classH ) IS 0
/* Test class variables allocating and casting */
oValue := CVARSCLASS4():new()
HBTEST oValue:x1 IS "(x1)"
HBTEST oValue:y1 IS "(y1)"
HBTEST oValue:z1 IS "(z1)"
HBTEST oValue:x2 IS "(x2)"
HBTEST oValue:y2 IS "(y2)"
HBTEST oValue:z2 IS "(z2)"
HBTEST oValue:x3 IS "(x3)"
HBTEST oValue:y3 IS "(y3)"
HBTEST oValue:z3 IS "(z3)"
HBTEST oValue:x4 IS "(x4)"
HBTEST oValue:y4 IS "(y4)"
HBTEST oValue:z4 IS "(z4)"
HBTEST oValue:CVARSCLASS1:x1 IS "(x1)"
HBTEST oValue:CVARSCLASS1:y1 IS "(y1)"
HBTEST oValue:CVARSCLASS1:z1 IS "(z1)"
HBTEST oValue:CVARSCLASS2:x1 IS "(x1)"
HBTEST oValue:CVARSCLASS2:y1 IS "(y1)"
HBTEST oValue:CVARSCLASS2:z1 IS "(z1)"
HBTEST oValue:CVARSCLASS2:x2 IS "(x2)"
HBTEST oValue:CVARSCLASS2:y2 IS "(y2)"
HBTEST oValue:CVARSCLASS2:z2 IS "(z2)"
HBTEST oValue:CVARSCLASS3:x1 IS "(x1)"
HBTEST oValue:CVARSCLASS3:y1 IS "(y1)"
HBTEST oValue:CVARSCLASS3:z1 IS "(z1)"
HBTEST oValue:CVARSCLASS3:x2 IS "(x2)"
HBTEST oValue:CVARSCLASS3:y2 IS "(y2)"
HBTEST oValue:CVARSCLASS3:z2 IS "(z2)"
HBTEST oValue:CVARSCLASS3:x3 IS "(x3)"
HBTEST oValue:CVARSCLASS3:y3 IS "(y3)"
HBTEST oValue:CVARSCLASS3:z3 IS "(z3)"
HBTEST oValue:CVARSCLASS4:x1 IS "(x1)"
HBTEST oValue:CVARSCLASS4:y1 IS "(y1)"
HBTEST oValue:CVARSCLASS4:z1 IS "(z1)"
HBTEST oValue:CVARSCLASS4:x2 IS "(x2)"
HBTEST oValue:CVARSCLASS4:y2 IS "(y2)"
HBTEST oValue:CVARSCLASS4:z2 IS "(z2)"
HBTEST oValue:CVARSCLASS4:x3 IS "(x3)"
HBTEST oValue:CVARSCLASS4:y3 IS "(y3)"
HBTEST oValue:CVARSCLASS4:z3 IS "(z3)"
HBTEST oValue:CVARSCLASS4:x4 IS "(x4)"
HBTEST oValue:CVARSCLASS4:y4 IS "(y4)"
HBTEST oValue:CVARSCLASS4:z4 IS "(z4)"
HBTEST INSTANCE_DATA( oValue ) IS "[0]:"
HBTEST __cls_CntClsData( oValue:CVARSCLASS1:classH ) IS 3
HBTEST __cls_CntClsData( oValue:CVARSCLASS2:classH ) IS 6
HBTEST __cls_CntClsData( oValue:CVARSCLASS3:classH ) IS 9
HBTEST __cls_CntClsData( oValue:CVARSCLASS4:classH ) IS 12
HBTEST __cls_CntClsData( oValue:classH ) IS 12
HBTEST __cls_CntShrData( oValue:CVARSCLASS1:classH ) IS 0
HBTEST __cls_CntShrData( oValue:CVARSCLASS2:classH ) IS 0
HBTEST __cls_CntShrData( oValue:CVARSCLASS3:classH ) IS 0
HBTEST __cls_CntShrData( oValue:CVARSCLASS4:classH ) IS 0
HBTEST __cls_CntShrData( oValue:classH ) IS 0
/* simple assignment... */
HBTEST oValue:x1 := " X1 " IS " X1 "
HBTEST oValue:y1 := " Y1 " IS " Y1 "
HBTEST oValue:z1 := " Z1 " IS " Z1 "
HBTEST oValue:x2 := " X2 " IS " X2 "
HBTEST oValue:y2 := " Y2 " IS " Y2 "
HBTEST oValue:z2 := " Z2 " IS " Z2 "
HBTEST oValue:x3 := " X3 " IS " X3 "
HBTEST oValue:y3 := " Y3 " IS " Y3 "
HBTEST oValue:z3 := " Z3 " IS " Z3 "
HBTEST oValue:x4 := " X4 " IS " X4 "
HBTEST oValue:y4 := " Y4 " IS " Y4 "
HBTEST oValue:z4 := " Z4 " IS " Z4 "
HBTEST oValue:x1 IS " X1 "
HBTEST oValue:y1 IS " Y1 "
HBTEST oValue:z1 IS " Z1 "
HBTEST oValue:x2 IS " X2 "
HBTEST oValue:y2 IS " Y2 "
HBTEST oValue:z2 IS " Z2 "
HBTEST oValue:x3 IS " X3 "
HBTEST oValue:y3 IS " Y3 "
HBTEST oValue:z3 IS " Z3 "
HBTEST oValue:x4 IS " X4 "
HBTEST oValue:y4 IS " Y4 "
HBTEST oValue:z4 IS " Z4 "
HBTEST oValue:CVARSCLASS1:x1 IS "(x1)"
HBTEST oValue:CVARSCLASS1:y1 IS "(y1)"
HBTEST oValue:CVARSCLASS1:z1 IS "(z1)"
HBTEST oValue:CVARSCLASS2:x1 IS "(x1)"
HBTEST oValue:CVARSCLASS2:y1 IS "(y1)"
HBTEST oValue:CVARSCLASS2:z1 IS "(z1)"
HBTEST oValue:CVARSCLASS2:x2 IS "(x2)"
HBTEST oValue:CVARSCLASS2:y2 IS "(y2)"
HBTEST oValue:CVARSCLASS2:z2 IS "(z2)"
HBTEST oValue:CVARSCLASS3:x1 IS "(x1)"
HBTEST oValue:CVARSCLASS3:y1 IS "(y1)"
HBTEST oValue:CVARSCLASS3:z1 IS "(z1)"
HBTEST oValue:CVARSCLASS3:x2 IS "(x2)"
HBTEST oValue:CVARSCLASS3:y2 IS "(y2)"
HBTEST oValue:CVARSCLASS3:z2 IS "(z2)"
HBTEST oValue:CVARSCLASS3:x3 IS "(x3)"
HBTEST oValue:CVARSCLASS3:y3 IS "(y3)"
HBTEST oValue:CVARSCLASS3:z3 IS "(z3)"
HBTEST oValue:CVARSCLASS4:x1 IS " X1 "
HBTEST oValue:CVARSCLASS4:y1 IS " Y1 "
HBTEST oValue:CVARSCLASS4:z1 IS " Z1 "
HBTEST oValue:CVARSCLASS4:x2 IS " X2 "
HBTEST oValue:CVARSCLASS4:y2 IS " Y2 "
HBTEST oValue:CVARSCLASS4:z2 IS " Z2 "
HBTEST oValue:CVARSCLASS4:x3 IS " X3 "
HBTEST oValue:CVARSCLASS4:y3 IS " Y3 "
HBTEST oValue:CVARSCLASS4:z3 IS " Z3 "
HBTEST oValue:CVARSCLASS4:x4 IS " X4 "
HBTEST oValue:CVARSCLASS4:y4 IS " Y4 "
HBTEST oValue:CVARSCLASS4:z4 IS " Z4 "
HBTEST __cls_CntClsData( oValue:CVARSCLASS1:classH ) IS 3
HBTEST __cls_CntClsData( oValue:CVARSCLASS2:classH ) IS 6
HBTEST __cls_CntClsData( oValue:CVARSCLASS3:classH ) IS 9
HBTEST __cls_CntClsData( oValue:CVARSCLASS4:classH ) IS 12
HBTEST __cls_CntClsData( oValue:classH ) IS 12
HBTEST __cls_CntShrData( oValue:CVARSCLASS1:classH ) IS 0
HBTEST __cls_CntShrData( oValue:CVARSCLASS2:classH ) IS 0
HBTEST __cls_CntShrData( oValue:CVARSCLASS3:classH ) IS 0
HBTEST __cls_CntShrData( oValue:CVARSCLASS4:classH ) IS 0
HBTEST __cls_CntShrData( oValue:classH ) IS 0
/* Setting CVARSCLASS1 class variables... */
HBTEST oValue:CVARSCLASS1:x1 := "[X1]" IS "[X1]"
HBTEST oValue:CVARSCLASS1:y1 := "[Y1]" IS "[Y1]"
HBTEST oValue:CVARSCLASS1:z1 := "[Z1]" IS "[Z1]"
HBTEST oValue:x1 IS " X1 "
HBTEST oValue:y1 IS " Y1 "
HBTEST oValue:z1 IS " Z1 "
HBTEST oValue:x2 IS " X2 "
HBTEST oValue:y2 IS " Y2 "
HBTEST oValue:z2 IS " Z2 "
HBTEST oValue:x3 IS " X3 "
HBTEST oValue:y3 IS " Y3 "
HBTEST oValue:z3 IS " Z3 "
HBTEST oValue:x4 IS " X4 "
HBTEST oValue:y4 IS " Y4 "
HBTEST oValue:z4 IS " Z4 "
HBTEST oValue:CVARSCLASS1:x1 IS "[X1]"
HBTEST oValue:CVARSCLASS1:y1 IS "[Y1]"
HBTEST oValue:CVARSCLASS1:z1 IS "[Z1]"
HBTEST oValue:CVARSCLASS2:x1 IS "(x1)"
HBTEST oValue:CVARSCLASS2:y1 IS "(y1)"
HBTEST oValue:CVARSCLASS2:z1 IS "(z1)"
HBTEST oValue:CVARSCLASS2:x2 IS "(x2)"
HBTEST oValue:CVARSCLASS2:y2 IS "(y2)"
HBTEST oValue:CVARSCLASS2:z2 IS "(z2)"
HBTEST oValue:CVARSCLASS3:x1 IS "(x1)"
HBTEST oValue:CVARSCLASS3:y1 IS "(y1)"
HBTEST oValue:CVARSCLASS3:z1 IS "(z1)"
HBTEST oValue:CVARSCLASS3:x2 IS "(x2)"
HBTEST oValue:CVARSCLASS3:y2 IS "(y2)"
HBTEST oValue:CVARSCLASS3:z2 IS "(z2)"
HBTEST oValue:CVARSCLASS3:x3 IS "(x3)"
HBTEST oValue:CVARSCLASS3:y3 IS "(y3)"
HBTEST oValue:CVARSCLASS3:z3 IS "(z3)"
HBTEST oValue:CVARSCLASS4:x1 IS " X1 "
HBTEST oValue:CVARSCLASS4:y1 IS " Y1 "
HBTEST oValue:CVARSCLASS4:z1 IS " Z1 "
HBTEST oValue:CVARSCLASS4:x2 IS " X2 "
HBTEST oValue:CVARSCLASS4:y2 IS " Y2 "
HBTEST oValue:CVARSCLASS4:z2 IS " Z2 "
HBTEST oValue:CVARSCLASS4:x3 IS " X3 "
HBTEST oValue:CVARSCLASS4:y3 IS " Y3 "
HBTEST oValue:CVARSCLASS4:z3 IS " Z3 "
HBTEST oValue:CVARSCLASS4:x4 IS " X4 "
HBTEST oValue:CVARSCLASS4:y4 IS " Y4 "
HBTEST oValue:CVARSCLASS4:z4 IS " Z4 "
HBTEST INSTANCE_DATA( oValue ) IS "[0]:"
HBTEST __cls_CntClsData( oValue:CVARSCLASS1:classH ) IS 3
HBTEST __cls_CntClsData( oValue:CVARSCLASS2:classH ) IS 6
HBTEST __cls_CntClsData( oValue:CVARSCLASS3:classH ) IS 9
HBTEST __cls_CntClsData( oValue:CVARSCLASS4:classH ) IS 12
HBTEST __cls_CntClsData( oValue:classH ) IS 12
HBTEST __cls_CntShrData( oValue:CVARSCLASS1:classH ) IS 0
HBTEST __cls_CntShrData( oValue:CVARSCLASS2:classH ) IS 0
HBTEST __cls_CntShrData( oValue:CVARSCLASS3:classH ) IS 0
HBTEST __cls_CntShrData( oValue:CVARSCLASS4:classH ) IS 0
HBTEST __cls_CntShrData( oValue:classH ) IS 0
/* Setting CVARSCLASS2 class variables... */
HBTEST oValue:CVARSCLASS2:x1 := "{X1}" IS "{X1}"
HBTEST oValue:CVARSCLASS2:y1 := "{Y1}" IS "{Y1}"
HBTEST oValue:CVARSCLASS2:z1 := "{Z1}" IS "{Z1}"
HBTEST oValue:CVARSCLASS2:x2 := "{X2}" IS "{X2}"
HBTEST oValue:CVARSCLASS2:y2 := "{Y2}" IS "{Y2}"
HBTEST oValue:CVARSCLASS2:z2 := "{Z2}" IS "{Z2}"
HBTEST oValue:x1 IS " X1 "
HBTEST oValue:y1 IS " Y1 "
HBTEST oValue:z1 IS " Z1 "
HBTEST oValue:x2 IS " X2 "
HBTEST oValue:y2 IS " Y2 "
HBTEST oValue:z2 IS " Z2 "
HBTEST oValue:x3 IS " X3 "
HBTEST oValue:y3 IS " Y3 "
HBTEST oValue:z3 IS " Z3 "
HBTEST oValue:x4 IS " X4 "
HBTEST oValue:y4 IS " Y4 "
HBTEST oValue:z4 IS " Z4 "
HBTEST oValue:CVARSCLASS1:x1 IS "[X1]"
HBTEST oValue:CVARSCLASS1:y1 IS "[Y1]"
HBTEST oValue:CVARSCLASS1:z1 IS "[Z1]"
HBTEST oValue:CVARSCLASS2:x1 IS "{X1}"
HBTEST oValue:CVARSCLASS2:y1 IS "{Y1}"
HBTEST oValue:CVARSCLASS2:z1 IS "{Z1}"
HBTEST oValue:CVARSCLASS2:x2 IS "{X2}"
HBTEST oValue:CVARSCLASS2:y2 IS "{Y2}"
HBTEST oValue:CVARSCLASS2:z2 IS "{Z2}"
HBTEST oValue:CVARSCLASS3:x1 IS "(x1)"
HBTEST oValue:CVARSCLASS3:y1 IS "(y1)"
HBTEST oValue:CVARSCLASS3:z1 IS "(z1)"
HBTEST oValue:CVARSCLASS3:x2 IS "(x2)"
HBTEST oValue:CVARSCLASS3:y2 IS "(y2)"
HBTEST oValue:CVARSCLASS3:z2 IS "(z2)"
HBTEST oValue:CVARSCLASS3:x3 IS "(x3)"
HBTEST oValue:CVARSCLASS3:y3 IS "(y3)"
HBTEST oValue:CVARSCLASS3:z3 IS "(z3)"
HBTEST oValue:CVARSCLASS4:x1 IS " X1 "
HBTEST oValue:CVARSCLASS4:y1 IS " Y1 "
HBTEST oValue:CVARSCLASS4:z1 IS " Z1 "
HBTEST oValue:CVARSCLASS4:x2 IS " X2 "
HBTEST oValue:CVARSCLASS4:y2 IS " Y2 "
HBTEST oValue:CVARSCLASS4:z2 IS " Z2 "
HBTEST oValue:CVARSCLASS4:x3 IS " X3 "
HBTEST oValue:CVARSCLASS4:y3 IS " Y3 "
HBTEST oValue:CVARSCLASS4:z3 IS " Z3 "
HBTEST oValue:CVARSCLASS4:x4 IS " X4 "
HBTEST oValue:CVARSCLASS4:y4 IS " Y4 "
HBTEST oValue:CVARSCLASS4:z4 IS " Z4 "
HBTEST INSTANCE_DATA( oValue ) IS "[0]:"
HBTEST __cls_CntClsData( oValue:CVARSCLASS1:classH ) IS 3
HBTEST __cls_CntClsData( oValue:CVARSCLASS2:classH ) IS 6
HBTEST __cls_CntClsData( oValue:CVARSCLASS3:classH ) IS 9
HBTEST __cls_CntClsData( oValue:CVARSCLASS4:classH ) IS 12
HBTEST __cls_CntClsData( oValue:classH ) IS 12
HBTEST __cls_CntShrData( oValue:CVARSCLASS1:classH ) IS 0
HBTEST __cls_CntShrData( oValue:CVARSCLASS2:classH ) IS 0
HBTEST __cls_CntShrData( oValue:CVARSCLASS3:classH ) IS 0
HBTEST __cls_CntShrData( oValue:CVARSCLASS4:classH ) IS 0
HBTEST __cls_CntShrData( oValue:classH ) IS 0
/* Setting CVARSCLASS3 class variables... */
HBTEST oValue:CVARSCLASS3:x1 := "<X1>" IS "<X1>"
HBTEST oValue:CVARSCLASS3:y1 := "<Y1>" IS "<Y1>"
HBTEST oValue:CVARSCLASS3:z1 := "<Z1>" IS "<Z1>"
HBTEST oValue:CVARSCLASS3:x2 := "<X2>" IS "<X2>"
HBTEST oValue:CVARSCLASS3:y2 := "<Y2>" IS "<Y2>"
HBTEST oValue:CVARSCLASS3:z2 := "<Z2>" IS "<Z2>"
HBTEST oValue:CVARSCLASS3:x3 := "<X3>" IS "<X3>"
HBTEST oValue:CVARSCLASS3:y3 := "<Y3>" IS "<Y3>"
HBTEST oValue:CVARSCLASS3:z3 := "<Z3>" IS "<Z3>"
HBTEST oValue:x1 IS " X1 "
HBTEST oValue:y1 IS " Y1 "
HBTEST oValue:z1 IS " Z1 "
HBTEST oValue:x2 IS " X2 "
HBTEST oValue:y2 IS " Y2 "
HBTEST oValue:z2 IS " Z2 "
HBTEST oValue:x3 IS " X3 "
HBTEST oValue:y3 IS " Y3 "
HBTEST oValue:z3 IS " Z3 "
HBTEST oValue:x4 IS " X4 "
HBTEST oValue:y4 IS " Y4 "
HBTEST oValue:z4 IS " Z4 "
HBTEST oValue:CVARSCLASS1:x1 IS "[X1]"
HBTEST oValue:CVARSCLASS1:y1 IS "[Y1]"
HBTEST oValue:CVARSCLASS1:z1 IS "[Z1]"
HBTEST oValue:CVARSCLASS2:x1 IS "{X1}"
HBTEST oValue:CVARSCLASS2:y1 IS "{Y1}"
HBTEST oValue:CVARSCLASS2:z1 IS "{Z1}"
HBTEST oValue:CVARSCLASS2:x2 IS "{X2}"
HBTEST oValue:CVARSCLASS2:y2 IS "{Y2}"
HBTEST oValue:CVARSCLASS2:z2 IS "{Z2}"
HBTEST oValue:CVARSCLASS3:x1 IS "<X1>"
HBTEST oValue:CVARSCLASS3:y1 IS "<Y1>"
HBTEST oValue:CVARSCLASS3:z1 IS "<Z1>"
HBTEST oValue:CVARSCLASS3:x2 IS "<X2>"
HBTEST oValue:CVARSCLASS3:y2 IS "<Y2>"
HBTEST oValue:CVARSCLASS3:z2 IS "<Z2>"
HBTEST oValue:CVARSCLASS3:x3 IS "<X3>"
HBTEST oValue:CVARSCLASS3:y3 IS "<Y3>"
HBTEST oValue:CVARSCLASS3:z3 IS "<Z3>"
HBTEST oValue:CVARSCLASS4:x1 IS " X1 "
HBTEST oValue:CVARSCLASS4:y1 IS " Y1 "
HBTEST oValue:CVARSCLASS4:z1 IS " Z1 "
HBTEST oValue:CVARSCLASS4:x2 IS " X2 "
HBTEST oValue:CVARSCLASS4:y2 IS " Y2 "
HBTEST oValue:CVARSCLASS4:z2 IS " Z2 "
HBTEST oValue:CVARSCLASS4:x3 IS " X3 "
HBTEST oValue:CVARSCLASS4:y3 IS " Y3 "
HBTEST oValue:CVARSCLASS4:z3 IS " Z3 "
HBTEST oValue:CVARSCLASS4:x4 IS " X4 "
HBTEST oValue:CVARSCLASS4:y4 IS " Y4 "
HBTEST oValue:CVARSCLASS4:z4 IS " Z4 "
HBTEST INSTANCE_DATA( oValue ) IS "[0]:"
HBTEST __cls_CntClsData( oValue:CVARSCLASS1:classH ) IS 3
HBTEST __cls_CntClsData( oValue:CVARSCLASS2:classH ) IS 6
HBTEST __cls_CntClsData( oValue:CVARSCLASS3:classH ) IS 9
HBTEST __cls_CntClsData( oValue:CVARSCLASS4:classH ) IS 12
HBTEST __cls_CntClsData( oValue:classH ) IS 12
HBTEST __cls_CntShrData( oValue:CVARSCLASS1:classH ) IS 0
HBTEST __cls_CntShrData( oValue:CVARSCLASS2:classH ) IS 0
HBTEST __cls_CntShrData( oValue:CVARSCLASS3:classH ) IS 0
HBTEST __cls_CntShrData( oValue:CVARSCLASS4:classH ) IS 0
HBTEST __cls_CntShrData( oValue:classH ) IS 0
/* Test shared class variables allocating and casting */
oValue := SVARSCLASS4():new()
HBTEST oValue:x1 IS "(x1)"
HBTEST oValue:y1 IS "(y1)"
HBTEST oValue:z1 IS "(z1)"
HBTEST oValue:x2 IS "(x2)"
HBTEST oValue:y2 IS "(y2)"
HBTEST oValue:z2 IS "(z2)"
HBTEST oValue:x3 IS "(x3)"
HBTEST oValue:y3 IS "(y3)"
HBTEST oValue:z3 IS "(z3)"
HBTEST oValue:x4 IS "(x4)"
HBTEST oValue:y4 IS "(y4)"
HBTEST oValue:z4 IS "(z4)"
HBTEST oValue:SVARSCLASS1:x1 IS "(x1)"
HBTEST oValue:SVARSCLASS1:y1 IS "(y1)"
HBTEST oValue:SVARSCLASS1:z1 IS "(z1)"
HBTEST oValue:SVARSCLASS2:x1 IS "(x1)"
HBTEST oValue:SVARSCLASS2:y1 IS "(y1)"
HBTEST oValue:SVARSCLASS2:z1 IS "(z1)"
HBTEST oValue:SVARSCLASS2:x2 IS "(x2)"
HBTEST oValue:SVARSCLASS2:y2 IS "(y2)"
HBTEST oValue:SVARSCLASS2:z2 IS "(z2)"
HBTEST oValue:SVARSCLASS3:x1 IS "(x1)"
HBTEST oValue:SVARSCLASS3:y1 IS "(y1)"
HBTEST oValue:SVARSCLASS3:z1 IS "(z1)"
HBTEST oValue:SVARSCLASS3:x2 IS "(x2)"
HBTEST oValue:SVARSCLASS3:y2 IS "(y2)"
HBTEST oValue:SVARSCLASS3:z2 IS "(z2)"
HBTEST oValue:SVARSCLASS3:x3 IS "(x3)"
HBTEST oValue:SVARSCLASS3:y3 IS "(y3)"
HBTEST oValue:SVARSCLASS3:z3 IS "(z3)"
HBTEST oValue:SVARSCLASS4:x1 IS "(x1)"
HBTEST oValue:SVARSCLASS4:y1 IS "(y1)"
HBTEST oValue:SVARSCLASS4:z1 IS "(z1)"
HBTEST oValue:SVARSCLASS4:x2 IS "(x2)"
HBTEST oValue:SVARSCLASS4:y2 IS "(y2)"
HBTEST oValue:SVARSCLASS4:z2 IS "(z2)"
HBTEST oValue:SVARSCLASS4:x3 IS "(x3)"
HBTEST oValue:SVARSCLASS4:y3 IS "(y3)"
HBTEST oValue:SVARSCLASS4:z3 IS "(z3)"
HBTEST oValue:SVARSCLASS4:x4 IS "(x4)"
HBTEST oValue:SVARSCLASS4:y4 IS "(y4)"
HBTEST oValue:SVARSCLASS4:z4 IS "(z4)"
HBTEST INSTANCE_DATA( oValue ) IS "[0]:"
HBTEST __cls_CntClsData( oValue:SVARSCLASS1:classH ) IS 0
HBTEST __cls_CntClsData( oValue:SVARSCLASS2:classH ) IS 0
HBTEST __cls_CntClsData( oValue:SVARSCLASS3:classH ) IS 0
HBTEST __cls_CntClsData( oValue:SVARSCLASS4:classH ) IS 0
HBTEST __cls_CntClsData( oValue:classH ) IS 0
HBTEST __cls_CntShrData( oValue:SVARSCLASS1:classH ) IS 3
HBTEST __cls_CntShrData( oValue:SVARSCLASS2:classH ) IS 3
HBTEST __cls_CntShrData( oValue:SVARSCLASS3:classH ) IS 3
HBTEST __cls_CntShrData( oValue:SVARSCLASS4:classH ) IS 3
HBTEST __cls_CntShrData( oValue:classH ) IS 3
/* simple assignment... */
HBTEST oValue:x1 := " X1 " IS " X1 "
HBTEST oValue:y1 := " Y1 " IS " Y1 "
HBTEST oValue:z1 := " Z1 " IS " Z1 "
HBTEST oValue:x2 := " X2 " IS " X2 "
HBTEST oValue:y2 := " Y2 " IS " Y2 "
HBTEST oValue:z2 := " Z2 " IS " Z2 "
HBTEST oValue:x3 := " X3 " IS " X3 "
HBTEST oValue:y3 := " Y3 " IS " Y3 "
HBTEST oValue:z3 := " Z3 " IS " Z3 "
HBTEST oValue:x4 := " X4 " IS " X4 "
HBTEST oValue:y4 := " Y4 " IS " Y4 "
HBTEST oValue:z4 := " Z4 " IS " Z4 "
HBTEST oValue:x1 IS " X1 "
HBTEST oValue:y1 IS " Y1 "
HBTEST oValue:z1 IS " Z1 "
HBTEST oValue:x2 IS " X2 "
HBTEST oValue:y2 IS " Y2 "
HBTEST oValue:z2 IS " Z2 "
HBTEST oValue:x3 IS " X3 "
HBTEST oValue:y3 IS " Y3 "
HBTEST oValue:z3 IS " Z3 "
HBTEST oValue:x4 IS " X4 "
HBTEST oValue:y4 IS " Y4 "
HBTEST oValue:z4 IS " Z4 "
HBTEST oValue:SVARSCLASS1:x1 IS " X1 "
HBTEST oValue:SVARSCLASS1:y1 IS " Y1 "
HBTEST oValue:SVARSCLASS1:z1 IS " Z1 "
HBTEST oValue:SVARSCLASS2:x1 IS " X1 "
HBTEST oValue:SVARSCLASS2:y1 IS " Y1 "
HBTEST oValue:SVARSCLASS2:z1 IS " Z1 "
HBTEST oValue:SVARSCLASS2:x2 IS " X2 "
HBTEST oValue:SVARSCLASS2:y2 IS " Y2 "
HBTEST oValue:SVARSCLASS2:z2 IS " Z2 "
HBTEST oValue:SVARSCLASS3:x1 IS " X1 "
HBTEST oValue:SVARSCLASS3:y1 IS " Y1 "
HBTEST oValue:SVARSCLASS3:z1 IS " Z1 "
HBTEST oValue:SVARSCLASS3:x2 IS " X2 "
HBTEST oValue:SVARSCLASS3:y2 IS " Y2 "
HBTEST oValue:SVARSCLASS3:z2 IS " Z2 "
HBTEST oValue:SVARSCLASS3:x3 IS " X3 "
HBTEST oValue:SVARSCLASS3:y3 IS " Y3 "
HBTEST oValue:SVARSCLASS3:z3 IS " Z3 "
HBTEST oValue:SVARSCLASS4:x1 IS " X1 "
HBTEST oValue:SVARSCLASS4:y1 IS " Y1 "
HBTEST oValue:SVARSCLASS4:z1 IS " Z1 "
HBTEST oValue:SVARSCLASS4:x2 IS " X2 "
HBTEST oValue:SVARSCLASS4:y2 IS " Y2 "
HBTEST oValue:SVARSCLASS4:z2 IS " Z2 "
HBTEST oValue:SVARSCLASS4:x3 IS " X3 "
HBTEST oValue:SVARSCLASS4:y3 IS " Y3 "
HBTEST oValue:SVARSCLASS4:z3 IS " Z3 "
HBTEST oValue:SVARSCLASS4:x4 IS " X4 "
HBTEST oValue:SVARSCLASS4:y4 IS " Y4 "
HBTEST oValue:SVARSCLASS4:z4 IS " Z4 "
HBTEST __cls_CntClsData( oValue:SVARSCLASS1:classH ) IS 0
HBTEST __cls_CntClsData( oValue:SVARSCLASS2:classH ) IS 0
HBTEST __cls_CntClsData( oValue:SVARSCLASS3:classH ) IS 0
HBTEST __cls_CntClsData( oValue:SVARSCLASS4:classH ) IS 0
HBTEST __cls_CntClsData( oValue:classH ) IS 0
HBTEST __cls_CntShrData( oValue:SVARSCLASS1:classH ) IS 3
HBTEST __cls_CntShrData( oValue:SVARSCLASS2:classH ) IS 3
HBTEST __cls_CntShrData( oValue:SVARSCLASS3:classH ) IS 3
HBTEST __cls_CntShrData( oValue:SVARSCLASS4:classH ) IS 3
HBTEST __cls_CntShrData( oValue:classH ) IS 3
HBTEST INSTANCE_DATA( oValue ) IS "[0]:"
/* Setting SVARSCLASS1 class variables... */
HBTEST oValue:SVARSCLASS1:x1 := "[X1]" IS "[X1]"
HBTEST oValue:SVARSCLASS1:y1 := "[Y1]" IS "[Y1]"
HBTEST oValue:SVARSCLASS1:z1 := "[Z1]" IS "[Z1]"
HBTEST oValue:x1 IS "[X1]"
HBTEST oValue:y1 IS "[Y1]"
HBTEST oValue:z1 IS "[Z1]"
HBTEST oValue:x2 IS " X2 "
HBTEST oValue:y2 IS " Y2 "
HBTEST oValue:z2 IS " Z2 "
HBTEST oValue:x3 IS " X3 "
HBTEST oValue:y3 IS " Y3 "
HBTEST oValue:z3 IS " Z3 "
HBTEST oValue:x4 IS " X4 "
HBTEST oValue:y4 IS " Y4 "
HBTEST oValue:z4 IS " Z4 "
HBTEST oValue:SVARSCLASS1:x1 IS "[X1]"
HBTEST oValue:SVARSCLASS1:y1 IS "[Y1]"
HBTEST oValue:SVARSCLASS1:z1 IS "[Z1]"
HBTEST oValue:SVARSCLASS2:x1 IS "[X1]"
HBTEST oValue:SVARSCLASS2:y1 IS "[Y1]"
HBTEST oValue:SVARSCLASS2:z1 IS "[Z1]"
HBTEST oValue:SVARSCLASS2:x2 IS " X2 "
HBTEST oValue:SVARSCLASS2:y2 IS " Y2 "
HBTEST oValue:SVARSCLASS2:z2 IS " Z2 "
HBTEST oValue:SVARSCLASS3:x1 IS "[X1]"
HBTEST oValue:SVARSCLASS3:y1 IS "[Y1]"
HBTEST oValue:SVARSCLASS3:z1 IS "[Z1]"
HBTEST oValue:SVARSCLASS3:x2 IS " X2 "
HBTEST oValue:SVARSCLASS3:y2 IS " Y2 "
HBTEST oValue:SVARSCLASS3:z2 IS " Z2 "
HBTEST oValue:SVARSCLASS3:x3 IS " X3 "
HBTEST oValue:SVARSCLASS3:y3 IS " Y3 "
HBTEST oValue:SVARSCLASS3:z3 IS " Z3 "
HBTEST oValue:SVARSCLASS4:x1 IS "[X1]"
HBTEST oValue:SVARSCLASS4:y1 IS "[Y1]"
HBTEST oValue:SVARSCLASS4:z1 IS "[Z1]"
HBTEST oValue:SVARSCLASS4:x2 IS " X2 "
HBTEST oValue:SVARSCLASS4:y2 IS " Y2 "
HBTEST oValue:SVARSCLASS4:z2 IS " Z2 "
HBTEST oValue:SVARSCLASS4:x3 IS " X3 "
HBTEST oValue:SVARSCLASS4:y3 IS " Y3 "
HBTEST oValue:SVARSCLASS4:z3 IS " Z3 "
HBTEST oValue:SVARSCLASS4:x4 IS " X4 "
HBTEST oValue:SVARSCLASS4:y4 IS " Y4 "
HBTEST oValue:SVARSCLASS4:z4 IS " Z4 "
HBTEST __cls_CntClsData( oValue:SVARSCLASS1:classH ) IS 0
HBTEST __cls_CntClsData( oValue:SVARSCLASS2:classH ) IS 0
HBTEST __cls_CntClsData( oValue:SVARSCLASS3:classH ) IS 0
HBTEST __cls_CntClsData( oValue:SVARSCLASS4:classH ) IS 0
HBTEST __cls_CntClsData( oValue:classH ) IS 0
HBTEST __cls_CntShrData( oValue:SVARSCLASS1:classH ) IS 3
HBTEST __cls_CntShrData( oValue:SVARSCLASS2:classH ) IS 3
HBTEST __cls_CntShrData( oValue:SVARSCLASS3:classH ) IS 3
HBTEST __cls_CntShrData( oValue:SVARSCLASS4:classH ) IS 3
HBTEST __cls_CntShrData( oValue:classH ) IS 3
HBTEST INSTANCE_DATA( oValue ) IS "[0]:"
/* Setting SVARSCLASS2 class variables... */
HBTEST oValue:SVARSCLASS2:x1 := "{X1}" IS "{X1}"
HBTEST oValue:SVARSCLASS2:y1 := "{Y1}" IS "{Y1}"
HBTEST oValue:SVARSCLASS2:z1 := "{Z1}" IS "{Z1}"
HBTEST oValue:SVARSCLASS2:x2 := "{X2}" IS "{X2}"
HBTEST oValue:SVARSCLASS2:y2 := "{Y2}" IS "{Y2}"
HBTEST oValue:SVARSCLASS2:z2 := "{Z2}" IS "{Z2}"
HBTEST oValue:x1 IS "{X1}"
HBTEST oValue:y1 IS "{Y1}"
HBTEST oValue:z1 IS "{Z1}"
HBTEST oValue:x2 IS "{X2}"
HBTEST oValue:y2 IS "{Y2}"
HBTEST oValue:z2 IS "{Z2}"
HBTEST oValue:x3 IS " X3 "
HBTEST oValue:y3 IS " Y3 "
HBTEST oValue:z3 IS " Z3 "
HBTEST oValue:x4 IS " X4 "
HBTEST oValue:y4 IS " Y4 "
HBTEST oValue:z4 IS " Z4 "
HBTEST oValue:SVARSCLASS1:x1 IS "{X1}"
HBTEST oValue:SVARSCLASS1:y1 IS "{Y1}"
HBTEST oValue:SVARSCLASS1:z1 IS "{Z1}"
HBTEST oValue:SVARSCLASS2:x1 IS "{X1}"
HBTEST oValue:SVARSCLASS2:y1 IS "{Y1}"
HBTEST oValue:SVARSCLASS2:z1 IS "{Z1}"
HBTEST oValue:SVARSCLASS2:x2 IS "{X2}"
HBTEST oValue:SVARSCLASS2:y2 IS "{Y2}"
HBTEST oValue:SVARSCLASS2:z2 IS "{Z2}"
HBTEST oValue:SVARSCLASS3:x1 IS "{X1}"
HBTEST oValue:SVARSCLASS3:y1 IS "{Y1}"
HBTEST oValue:SVARSCLASS3:z1 IS "{Z1}"
HBTEST oValue:SVARSCLASS3:x2 IS "{X2}"
HBTEST oValue:SVARSCLASS3:y2 IS "{Y2}"
HBTEST oValue:SVARSCLASS3:z2 IS "{Z2}"
HBTEST oValue:SVARSCLASS3:x3 IS " X3 "
HBTEST oValue:SVARSCLASS3:y3 IS " Y3 "
HBTEST oValue:SVARSCLASS3:z3 IS " Z3 "
HBTEST oValue:SVARSCLASS4:x1 IS "{X1}"
HBTEST oValue:SVARSCLASS4:y1 IS "{Y1}"
HBTEST oValue:SVARSCLASS4:z1 IS "{Z1}"
HBTEST oValue:SVARSCLASS4:x2 IS "{X2}"
HBTEST oValue:SVARSCLASS4:y2 IS "{Y2}"
HBTEST oValue:SVARSCLASS4:z2 IS "{Z2}"
HBTEST oValue:SVARSCLASS4:x3 IS " X3 "
HBTEST oValue:SVARSCLASS4:y3 IS " Y3 "
HBTEST oValue:SVARSCLASS4:z3 IS " Z3 "
HBTEST oValue:SVARSCLASS4:x4 IS " X4 "
HBTEST oValue:SVARSCLASS4:y4 IS " Y4 "
HBTEST oValue:SVARSCLASS4:z4 IS " Z4 "
HBTEST __cls_CntClsData( oValue:SVARSCLASS1:classH ) IS 0
HBTEST __cls_CntClsData( oValue:SVARSCLASS2:classH ) IS 0
HBTEST __cls_CntClsData( oValue:SVARSCLASS3:classH ) IS 0
HBTEST __cls_CntClsData( oValue:SVARSCLASS4:classH ) IS 0
HBTEST __cls_CntClsData( oValue:classH ) IS 0
HBTEST __cls_CntShrData( oValue:SVARSCLASS1:classH ) IS 3
HBTEST __cls_CntShrData( oValue:SVARSCLASS2:classH ) IS 3
HBTEST __cls_CntShrData( oValue:SVARSCLASS3:classH ) IS 3
HBTEST __cls_CntShrData( oValue:SVARSCLASS4:classH ) IS 3
HBTEST __cls_CntShrData( oValue:classH ) IS 3
HBTEST INSTANCE_DATA( oValue ) IS "[0]:"
/* Setting SVARSCLASS3 class variables... */
HBTEST oValue:SVARSCLASS3:x1 := "<X1>" IS "<X1>"
HBTEST oValue:SVARSCLASS3:y1 := "<Y1>" IS "<Y1>"
HBTEST oValue:SVARSCLASS3:z1 := "<Z1>" IS "<Z1>"
HBTEST oValue:SVARSCLASS3:x2 := "<X2>" IS "<X2>"
HBTEST oValue:SVARSCLASS3:y2 := "<Y2>" IS "<Y2>"
HBTEST oValue:SVARSCLASS3:z2 := "<Z2>" IS "<Z2>"
HBTEST oValue:SVARSCLASS3:x3 := "<X3>" IS "<X3>"
HBTEST oValue:SVARSCLASS3:y3 := "<Y3>" IS "<Y3>"
HBTEST oValue:SVARSCLASS3:z3 := "<Z3>" IS "<Z3>"
HBTEST oValue:x1 IS "<X1>"
HBTEST oValue:y1 IS "<Y1>"
HBTEST oValue:z1 IS "<Z1>"
HBTEST oValue:x2 IS "<X2>"
HBTEST oValue:y2 IS "<Y2>"
HBTEST oValue:z2 IS "<Z2>"
HBTEST oValue:x3 IS "<X3>"
HBTEST oValue:y3 IS "<Y3>"
HBTEST oValue:z3 IS "<Z3>"
HBTEST oValue:x4 IS " X4 "
HBTEST oValue:y4 IS " Y4 "
HBTEST oValue:z4 IS " Z4 "
HBTEST oValue:SVARSCLASS1:x1 IS "<X1>"
HBTEST oValue:SVARSCLASS1:y1 IS "<Y1>"
HBTEST oValue:SVARSCLASS1:z1 IS "<Z1>"
HBTEST oValue:SVARSCLASS2:x1 IS "<X1>"
HBTEST oValue:SVARSCLASS2:y1 IS "<Y1>"
HBTEST oValue:SVARSCLASS2:z1 IS "<Z1>"
HBTEST oValue:SVARSCLASS2:x2 IS "<X2>"
HBTEST oValue:SVARSCLASS2:y2 IS "<Y2>"
HBTEST oValue:SVARSCLASS2:z2 IS "<Z2>"
HBTEST oValue:SVARSCLASS3:x1 IS "<X1>"
HBTEST oValue:SVARSCLASS3:y1 IS "<Y1>"
HBTEST oValue:SVARSCLASS3:z1 IS "<Z1>"
HBTEST oValue:SVARSCLASS3:x2 IS "<X2>"
HBTEST oValue:SVARSCLASS3:y2 IS "<Y2>"
HBTEST oValue:SVARSCLASS3:z2 IS "<Z2>"
HBTEST oValue:SVARSCLASS3:x3 IS "<X3>"
HBTEST oValue:SVARSCLASS3:y3 IS "<Y3>"
HBTEST oValue:SVARSCLASS3:z3 IS "<Z3>"
HBTEST oValue:SVARSCLASS4:x1 IS "<X1>"
HBTEST oValue:SVARSCLASS4:y1 IS "<Y1>"
HBTEST oValue:SVARSCLASS4:z1 IS "<Z1>"
HBTEST oValue:SVARSCLASS4:x2 IS "<X2>"
HBTEST oValue:SVARSCLASS4:y2 IS "<Y2>"
HBTEST oValue:SVARSCLASS4:z2 IS "<Z2>"
HBTEST oValue:SVARSCLASS4:x3 IS "<X3>"
HBTEST oValue:SVARSCLASS4:y3 IS "<Y3>"
HBTEST oValue:SVARSCLASS4:z3 IS "<Z3>"
HBTEST oValue:SVARSCLASS4:x4 IS " X4 "
HBTEST oValue:SVARSCLASS4:y4 IS " Y4 "
HBTEST oValue:SVARSCLASS4:z4 IS " Z4 "
HBTEST __cls_CntClsData( oValue:SVARSCLASS1:classH ) IS 0
HBTEST __cls_CntClsData( oValue:SVARSCLASS2:classH ) IS 0
HBTEST __cls_CntClsData( oValue:SVARSCLASS3:classH ) IS 0
HBTEST __cls_CntClsData( oValue:SVARSCLASS4:classH ) IS 0
HBTEST __cls_CntClsData( oValue:classH ) IS 0
HBTEST __cls_CntShrData( oValue:SVARSCLASS1:classH ) IS 3
HBTEST __cls_CntShrData( oValue:SVARSCLASS2:classH ) IS 3
HBTEST __cls_CntShrData( oValue:SVARSCLASS3:classH ) IS 3
HBTEST __cls_CntShrData( oValue:SVARSCLASS4:classH ) IS 3
HBTEST __cls_CntShrData( oValue:classH ) IS 3
HBTEST INSTANCE_DATA( oValue ) IS "[0]:"
/* Test non virtual hidden messages */
oValue := NVCLASS4():new()
HBTEST oValue:m1() IS "NVCLASS1:M1 (a1) (b1) (c3) (d3) (e3) (f3) (ex1)|" + ;
"NVCLASS1:X (a1) (b1) (c3) (d3) (e3) (f3) (ex1)|" + ;
"NVCLASS3:Y (a3) (b3) (c3) (d3) (e3) (f3) (HI3)|" + ;
"NVCLASS3:Z (a3) (b3) (c3) (d3) (e3) (f3) (HI3)"
HBTEST oValue:m2() IS "NVCLASS2:M2 (a2) (b2) (c3) (d3) (e3) (f3) (ex1)|" + ;
"NVCLASS2:X (a2) (b2) (c3) (d3) (e3) (f3) (ex1)|" + ;
"NVCLASS3:Y (a3) (b3) (c3) (d3) (e3) (f3) (HI3)|" + ;
"NVCLASS3:Z (a3) (b3) (c3) (d3) (e3) (f3) (HI3)"
HBTEST oValue:m3() IS "NVCLASS3:M3 (a3) (b3) (c3) (d3) (e3) (f3) (HI3)|" + ;
"NVCLASS3:X (a3) (b3) (c3) (d3) (e3) (f3) (HI3)|" + ;
"NVCLASS3:Y (a3) (b3) (c3) (d3) (e3) (f3) (HI3)|" + ;
"NVCLASS3:Z (a3) (b3) (c3) (d3) (e3) (f3) (HI3)"
/* Test super casting */
HBTEST oValue:classname() IS "NVCLASS4"
HBTEST oValue:super:classname() IS "NVCLASS3"
HBTEST oValue:super:super:classname() IS "NVCLASS1"
HBTEST oValue:super:super:super:classname() IS "HBOBJECT"
HBTEST oValue:super:super:super:super:classname() IS "E 13 BASE 1004 Message not found (NVCLASS4:SUPER) OS:0 #:0 A:1:O:NVCLASS4 Object F:S"
#endif
RETURN
#ifdef __HARBOUR__
STATIC FUNCTION INSTANCE_DATA( oValue )
LOCAL cData, i
cData := "[" + hb_ntos( Len( oValue ) ) + "]:"
FOR i := 1 TO Len( oValue )
DO CASE
CASE HB_ISSTRING( oValue[ i ] )
cData += " " + oValue[ i ]
CASE oValue[ i ] == NIL
cData += " NIL"
OTHERWISE
cData += " ..."
ENDCASE
NEXT
RETURN cData
CREATE CLASS DTORCLASS
EXPORTED:
VAR type
VAR var1
CLASS VAR var2
METHOD init
DESTRUCTOR dtor
ENDCLASS
METHOD INIT( type ) CLASS DTORCLASS
::type := type
RETURN Self
METHOD PROCEDURE DTOR CLASS DTORCLASS
DO CASE
CASE ::Type == 1
cDtorResult += "Reference to self in instance variable."
::var1 := self
CASE ::Type == 2
cDtorResult += "Reference to self in class variable."
::var2 := self
CASE ::Type == 3
cDtorResult += "Reference to self in private memvar."
objHolder := self
OTHERWISE
cDtorResult += "No references to self."
ENDCASE
RETURN
CREATE CLASS IVARSCLASS1
EXPORTED:
VAR x1 INIT "(x1)"
VAR y1 INIT "(y1)"
VAR z1 INIT "(z1)"
ENDCLASS
CREATE CLASS IVARSCLASS2 INHERIT IVARSCLASS1
EXPORTED:
VAR x2 INIT "(x2)"
VAR y2 INIT "(y2)"
VAR z2 INIT "(z2)"
ENDCLASS
CREATE CLASS IVARSCLASS3 INHERIT IVARSCLASS1, IVARSCLASS2
EXPORTED:
VAR x3 INIT "(x3)"
VAR y3 INIT "(y3)"
VAR z3 INIT "(z3)"
ENDCLASS
CREATE CLASS IVARSCLASS4 INHERIT IVARSCLASS3, IVARSCLASS2
EXPORTED:
VAR x4 INIT "(x4)"
VAR y4 INIT "(y4)"
VAR z4 INIT "(z4)"
ENDCLASS
CREATE CLASS CVARSCLASS1
EXPORTED:
CLASS VAR x1 INIT "(x1)"
CLASS VAR y1 INIT "(y1)"
CLASS VAR z1 INIT "(z1)"
ENDCLASS
CREATE CLASS CVARSCLASS2 INHERIT CVARSCLASS1
EXPORTED:
CLASS VAR x2 INIT "(x2)"
CLASS VAR y2 INIT "(y2)"
CLASS VAR z2 INIT "(z2)"
ENDCLASS
CREATE CLASS CVARSCLASS3 INHERIT CVARSCLASS1, CVARSCLASS2
EXPORTED:
CLASS VAR x3 INIT "(x3)"
CLASS VAR y3 INIT "(y3)"
CLASS VAR z3 INIT "(z3)"
ENDCLASS
CREATE CLASS CVARSCLASS4 INHERIT CVARSCLASS3, CVARSCLASS2
EXPORTED:
CLASS VAR x4 INIT "(x4)"
CLASS VAR y4 INIT "(y4)"
CLASS VAR z4 INIT "(z4)"
ENDCLASS
CREATE CLASS SVARSCLASS1
EXPORTED:
CLASS VAR x1 INIT "(x1)" SHARED
CLASS VAR y1 INIT "(y1)" SHARED
CLASS VAR z1 INIT "(z1)" SHARED
ENDCLASS
CREATE CLASS SVARSCLASS2 INHERIT SVARSCLASS1
EXPORTED:
CLASS VAR x2 INIT "(x2)" SHARED
CLASS VAR y2 INIT "(y2)" SHARED
CLASS VAR z2 INIT "(z2)" SHARED
ENDCLASS
CREATE CLASS SVARSCLASS3 INHERIT SVARSCLASS1, SVARSCLASS2
EXPORTED:
CLASS VAR x3 INIT "(x3)" SHARED
CLASS VAR y3 INIT "(y3)" SHARED
CLASS VAR z3 INIT "(z3)" SHARED
ENDCLASS
CREATE CLASS SVARSCLASS4 INHERIT SVARSCLASS3, SVARSCLASS2
EXPORTED:
CLASS VAR x4 INIT "(x4)" SHARED
CLASS VAR y4 INIT "(y4)" SHARED
CLASS VAR z4 INIT "(z4)" SHARED
ENDCLASS
CREATE CLASS NVCLASS1
HIDDEN:
VAR a init "(a1)"
CLASS VAR b init "(b1)"
METHOD x
PROTECTED:
VAR c init "(c1)"
CLASS VAR d init "(d1)"
METHOD y
EXPORTED:
VAR e init "(e1)"
CLASS VAR f init "(f1)"
VAR v init "(ex1)"
METHOD z
METHOD m1
ENDCLASS
METHOD m1 CLASS NVCLASS1
RETURN "NVCLASS1:M1 " + ;
hb_CStr( ::a ) + " " + ;
hb_CStr( ::b ) + " " + ;
hb_CStr( ::c ) + " " + ;
hb_CStr( ::d ) + " " + ;
hb_CStr( ::e ) + " " + ;
hb_CStr( ::f ) + " " + ;
hb_CStr( ::v ) + "|" + ;
::x() + "|" + ;
::y() + "|" + ;
::z()
METHOD x CLASS NVCLASS1
RETURN "NVCLASS1:X " + ;
hb_CStr( ::a ) + " " + ;
hb_CStr( ::b ) + " " + ;
hb_CStr( ::c ) + " " + ;
hb_CStr( ::d ) + " " + ;
hb_CStr( ::e ) + " " + ;
hb_CStr( ::f ) + " " + ;
hb_CStr( ::v )
METHOD y CLASS NVCLASS1
RETURN "NVCLASS1:Y " + ;
hb_CStr( ::a ) + " " + ;
hb_CStr( ::b ) + " " + ;
hb_CStr( ::c ) + " " + ;
hb_CStr( ::d ) + " " + ;
hb_CStr( ::e ) + " " + ;
hb_CStr( ::f ) + " " + ;
hb_CStr( ::v )
METHOD z CLASS NVCLASS1
RETURN "NVCLASS1:Z " + ;
hb_CStr( ::a ) + " " + ;
hb_CStr( ::b ) + " " + ;
hb_CStr( ::c ) + " " + ;
hb_CStr( ::d ) + " " + ;
hb_CStr( ::e ) + " " + ;
hb_CStr( ::f ) + " " + ;
hb_CStr( ::v )
CREATE CLASS NVCLASS2
HIDDEN:
VAR a init "(a2)"
CLASS VAR b init "(b2)"
METHOD x
PROTECTED:
VAR c init "(c2)"
CLASS VAR d init "(d2)"
METHOD y
EXPORTED:
VAR e init "(e2)"
CLASS VAR f init "(f2)"
METHOD z
METHOD m2
ENDCLASS
METHOD m2 CLASS NVCLASS2
RETURN "NVCLASS2:M2 " + ;
hb_CStr( ::a ) + " " + ;
hb_CStr( ::b ) + " " + ;
hb_CStr( ::c ) + " " + ;
hb_CStr( ::d ) + " " + ;
hb_CStr( ::e ) + " " + ;
hb_CStr( ::f ) + " " + ;
hb_CStr( ::v ) + "|" + ;
::x() + "|" + ;
::y() + "|" + ;
::z()
METHOD x CLASS NVCLASS2
RETURN "NVCLASS2:X " + ;
hb_CStr( ::a ) + " " + ;
hb_CStr( ::b ) + " " + ;
hb_CStr( ::c ) + " " + ;
hb_CStr( ::d ) + " " + ;
hb_CStr( ::e ) + " " + ;
hb_CStr( ::f ) + " " + ;
hb_CStr( ::v )
METHOD y CLASS NVCLASS2
RETURN "NVCLASS2:Y " + ;
hb_CStr( ::a ) + " " + ;
hb_CStr( ::b ) + " " + ;
hb_CStr( ::c ) + " " + ;
hb_CStr( ::d ) + " " + ;
hb_CStr( ::e ) + " " + ;
hb_CStr( ::f ) + " " + ;
hb_CStr( ::v )
METHOD z CLASS NVCLASS2
RETURN "NVCLASS2:Z " + ;
hb_CStr( ::a ) + " " + ;
hb_CStr( ::b ) + " " + ;
hb_CStr( ::c ) + " " + ;
hb_CStr( ::d ) + " " + ;
hb_CStr( ::e ) + " " + ;
hb_CStr( ::f ) + " " + ;
hb_CStr( ::v )
CREATE CLASS NVCLASS3 INHERIT NVCLASS1, NVCLASS2
HIDDEN:
VAR a init "(a3)"
CLASS VAR b init "(b3)"
METHOD x
VAR v init "(HI3)"
PROTECTED:
VAR c init "(c3)"
CLASS VAR d init "(d3)"
METHOD y
EXPORTED:
VAR e init "(e3)"
CLASS VAR f init "(f3)"
METHOD z
METHOD m3
ENDCLASS
METHOD m3 CLASS NVCLASS3
RETURN "NVCLASS3:M3 " + ;
hb_CStr( ::a ) + " " + ;
hb_CStr( ::b ) + " " + ;
hb_CStr( ::c ) + " " + ;
hb_CStr( ::d ) + " " + ;
hb_CStr( ::e ) + " " + ;
hb_CStr( ::f ) + " " + ;
hb_CStr( ::v ) + "|" + ;
::x() + "|" + ;
::y() + "|" + ;
::z()
METHOD x CLASS NVCLASS3
RETURN "NVCLASS3:X " + ;
hb_CStr( ::a ) + " " + ;
hb_CStr( ::b ) + " " + ;
hb_CStr( ::c ) + " " + ;
hb_CStr( ::d ) + " " + ;
hb_CStr( ::e ) + " " + ;
hb_CStr( ::f ) + " " + ;
hb_CStr( ::v )
METHOD y CLASS NVCLASS3
RETURN "NVCLASS3:Y " + ;
hb_CStr( ::a ) + " " + ;
hb_CStr( ::b ) + " " + ;
hb_CStr( ::c ) + " " + ;
hb_CStr( ::d ) + " " + ;
hb_CStr( ::e ) + " " + ;
hb_CStr( ::f ) + " " + ;
hb_CStr( ::v )
METHOD z CLASS NVCLASS3
RETURN "NVCLASS3:Z " + ;
hb_CStr( ::a ) + " " + ;
hb_CStr( ::b ) + " " + ;
hb_CStr( ::c ) + " " + ;
hb_CStr( ::d ) + " " + ;
hb_CStr( ::e ) + " " + ;
hb_CStr( ::f ) + " " + ;
hb_CStr( ::v )
CREATE CLASS NVCLASS4 INHERIT NVCLASS3
METHOD m4
ENDCLASS
METHOD m4 CLASS NVCLASS4
RETURN "NVCLASS4:M4 " + ;
hb_CStr( ::a ) + " " + ;
hb_CStr( ::b ) + " " + ;
hb_CStr( ::c ) + " " + ;
hb_CStr( ::d ) + " " + ;
hb_CStr( ::e ) + " " + ;
hb_CStr( ::f ) + " " + ;
hb_CStr( ::v ) + "|" + ;
::x() + "|" + ;
::y() + "|" + ;
::z()
#endif
/* Don't change the position of this #include. */
#include "rt_init.ch"
| {
"pile_set_name": "Github"
} |
//---------------------------------------------------------------------------//
// Copyright (c) 2013 Kyle Lutz <[email protected]>
//
// 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://boostorg.github.com/compute for more information.
//---------------------------------------------------------------------------//
#ifndef BOOST_COMPUTE_ALGORITHM_COUNT_HPP
#define BOOST_COMPUTE_ALGORITHM_COUNT_HPP
#include <boost/compute/lambda.hpp>
#include <boost/compute/system.hpp>
#include <boost/compute/command_queue.hpp>
#include <boost/compute/algorithm/count_if.hpp>
#include <boost/compute/type_traits/vector_size.hpp>
namespace boost {
namespace compute {
/// Returns the number of occurrences of \p value in the range
/// [\p first, \p last).
///
/// \see count_if()
template<class InputIterator, class T>
inline size_t count(InputIterator first,
InputIterator last,
const T &value,
command_queue &queue = system::default_queue())
{
typedef typename std::iterator_traits<InputIterator>::value_type value_type;
using ::boost::compute::_1;
using ::boost::compute::lambda::all;
if(vector_size<value_type>::value == 1){
return ::boost::compute::count_if(first,
last,
_1 == value,
queue);
}
else {
return ::boost::compute::count_if(first,
last,
all(_1 == value),
queue);
}
}
} // end compute namespace
} // end boost namespace
#endif // BOOST_COMPUTE_ALGORITHM_COUNT_HPP
| {
"pile_set_name": "Github"
} |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
namespace Microsoft.MixedReality.Toolkit.Diagnostics
{
/// <summary>
/// The interface contract that defines the Diagnostics system in the Mixed Reality Toolkit
/// </summary>
public interface IMixedRealityDiagnosticsSystem : IMixedRealityEventSystem, IMixedRealityEventSource
{
/// <summary>
/// Typed representation of the ConfigurationProfile property.
/// </summary>
MixedRealityDiagnosticsProfile DiagnosticsSystemProfile { get; }
/// <summary>
/// Enable / disable diagnostic display.
/// </summary>
/// <remarks>
/// When set to true, visibility settings for individual diagnostics are honored. When set to false,
/// all visualizations are hidden.
/// </remarks>
bool ShowDiagnostics { get; set; }
/// <summary>
/// Enable / disable the profiler display.
/// </summary>
bool ShowProfiler { get; set; }
/// <summary>
/// Show or hide the frame info (per frame stats).
/// </summary>
bool ShowFrameInfo { get; set; }
/// <summary>
/// Show or hide the memory stats (used, peak, and limit).
/// </summary>
bool ShowMemoryStats { get; set; }
/// <summary>
/// The amount of time, in seconds, to collect frames for frame rate calculation.
/// </summary>
float FrameSampleRate { get; }
}
}
| {
"pile_set_name": "Github"
} |
--TEST--
Memory-map file test (read-write, expanding)
--FILE--
<?php
/**
* A test function
*
* @engine qb
* @param uint8[*] $a
* @local uint32 $i
*
* @return void
*
*/
function test_function(&$a) {
$a[0] = 'A';
$a[1] = 'G';
$a[2] = 'N';
$a[3] = 'E';
$a[4] = 'S';
echo $a, "\n";
}
$path = __FILE__ . ".dat";
@unlink($path);
$handle = fopen($path, "w+");
test_function($handle);
fclose($handle);
$contents = file_get_contents($path);
echo "Length: ", strlen($contents), "\n";
echo "Contents: ", $contents, "\n";
unlink($path);
?>
--EXPECT--
[65, 71, 78, 69, 83]
Length: 5
Contents: AGNES
| {
"pile_set_name": "Github"
} |
----------------------------------------------------------------
-- ZLib for Ada thick binding. --
-- --
-- Copyright (C) 2002-2004 Dmitriy Anisimkov --
-- --
-- Open source license information is in the zlib.ads file. --
----------------------------------------------------------------
-- $Id: zlib.adb,v 1.31 2004/09/06 06:53:19 vagul Exp $
with Ada.Exceptions;
with Ada.Unchecked_Conversion;
with Ada.Unchecked_Deallocation;
with Interfaces.C.Strings;
with ZLib.Thin;
package body ZLib is
use type Thin.Int;
type Z_Stream is new Thin.Z_Stream;
type Return_Code_Enum is
(OK,
STREAM_END,
NEED_DICT,
ERRNO,
STREAM_ERROR,
DATA_ERROR,
MEM_ERROR,
BUF_ERROR,
VERSION_ERROR);
type Flate_Step_Function is access
function (Strm : in Thin.Z_Streamp; Flush : in Thin.Int) return Thin.Int;
pragma Convention (C, Flate_Step_Function);
type Flate_End_Function is access
function (Ctrm : in Thin.Z_Streamp) return Thin.Int;
pragma Convention (C, Flate_End_Function);
type Flate_Type is record
Step : Flate_Step_Function;
Done : Flate_End_Function;
end record;
subtype Footer_Array is Stream_Element_Array (1 .. 8);
Simple_GZip_Header : constant Stream_Element_Array (1 .. 10)
:= (16#1f#, 16#8b#, -- Magic header
16#08#, -- Z_DEFLATED
16#00#, -- Flags
16#00#, 16#00#, 16#00#, 16#00#, -- Time
16#00#, -- XFlags
16#03# -- OS code
);
-- The simplest gzip header is not for informational, but just for
-- gzip format compatibility.
-- Note that some code below is using assumption
-- Simple_GZip_Header'Last > Footer_Array'Last, so do not make
-- Simple_GZip_Header'Last <= Footer_Array'Last.
Return_Code : constant array (Thin.Int range <>) of Return_Code_Enum
:= (0 => OK,
1 => STREAM_END,
2 => NEED_DICT,
-1 => ERRNO,
-2 => STREAM_ERROR,
-3 => DATA_ERROR,
-4 => MEM_ERROR,
-5 => BUF_ERROR,
-6 => VERSION_ERROR);
Flate : constant array (Boolean) of Flate_Type
:= (True => (Step => Thin.Deflate'Access,
Done => Thin.DeflateEnd'Access),
False => (Step => Thin.Inflate'Access,
Done => Thin.InflateEnd'Access));
Flush_Finish : constant array (Boolean) of Flush_Mode
:= (True => Finish, False => No_Flush);
procedure Raise_Error (Stream : in Z_Stream);
pragma Inline (Raise_Error);
procedure Raise_Error (Message : in String);
pragma Inline (Raise_Error);
procedure Check_Error (Stream : in Z_Stream; Code : in Thin.Int);
procedure Free is new Ada.Unchecked_Deallocation
(Z_Stream, Z_Stream_Access);
function To_Thin_Access is new Ada.Unchecked_Conversion
(Z_Stream_Access, Thin.Z_Streamp);
procedure Translate_GZip
(Filter : in out Filter_Type;
In_Data : in Ada.Streams.Stream_Element_Array;
In_Last : out Ada.Streams.Stream_Element_Offset;
Out_Data : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Flush : in Flush_Mode);
-- Separate translate routine for make gzip header.
procedure Translate_Auto
(Filter : in out Filter_Type;
In_Data : in Ada.Streams.Stream_Element_Array;
In_Last : out Ada.Streams.Stream_Element_Offset;
Out_Data : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Flush : in Flush_Mode);
-- translate routine without additional headers.
-----------------
-- Check_Error --
-----------------
procedure Check_Error (Stream : in Z_Stream; Code : in Thin.Int) is
use type Thin.Int;
begin
if Code /= Thin.Z_OK then
Raise_Error
(Return_Code_Enum'Image (Return_Code (Code))
& ": " & Last_Error_Message (Stream));
end if;
end Check_Error;
-----------
-- Close --
-----------
procedure Close
(Filter : in out Filter_Type;
Ignore_Error : in Boolean := False)
is
Code : Thin.Int;
begin
if not Ignore_Error and then not Is_Open (Filter) then
raise Status_Error;
end if;
Code := Flate (Filter.Compression).Done (To_Thin_Access (Filter.Strm));
if Ignore_Error or else Code = Thin.Z_OK then
Free (Filter.Strm);
else
declare
Error_Message : constant String
:= Last_Error_Message (Filter.Strm.all);
begin
Free (Filter.Strm);
Ada.Exceptions.Raise_Exception
(ZLib_Error'Identity,
Return_Code_Enum'Image (Return_Code (Code))
& ": " & Error_Message);
end;
end if;
end Close;
-----------
-- CRC32 --
-----------
function CRC32
(CRC : in Unsigned_32;
Data : in Ada.Streams.Stream_Element_Array)
return Unsigned_32
is
use Thin;
begin
return Unsigned_32 (crc32 (ULong (CRC),
Data'Address,
Data'Length));
end CRC32;
procedure CRC32
(CRC : in out Unsigned_32;
Data : in Ada.Streams.Stream_Element_Array) is
begin
CRC := CRC32 (CRC, Data);
end CRC32;
------------------
-- Deflate_Init --
------------------
procedure Deflate_Init
(Filter : in out Filter_Type;
Level : in Compression_Level := Default_Compression;
Strategy : in Strategy_Type := Default_Strategy;
Method : in Compression_Method := Deflated;
Window_Bits : in Window_Bits_Type := Default_Window_Bits;
Memory_Level : in Memory_Level_Type := Default_Memory_Level;
Header : in Header_Type := Default)
is
use type Thin.Int;
Win_Bits : Thin.Int := Thin.Int (Window_Bits);
begin
if Is_Open (Filter) then
raise Status_Error;
end if;
-- We allow ZLib to make header only in case of default header type.
-- Otherwise we would either do header by ourselfs, or do not do
-- header at all.
if Header = None or else Header = GZip then
Win_Bits := -Win_Bits;
end if;
-- For the GZip CRC calculation and make headers.
if Header = GZip then
Filter.CRC := 0;
Filter.Offset := Simple_GZip_Header'First;
else
Filter.Offset := Simple_GZip_Header'Last + 1;
end if;
Filter.Strm := new Z_Stream;
Filter.Compression := True;
Filter.Stream_End := False;
Filter.Header := Header;
if Thin.Deflate_Init
(To_Thin_Access (Filter.Strm),
Level => Thin.Int (Level),
method => Thin.Int (Method),
windowBits => Win_Bits,
memLevel => Thin.Int (Memory_Level),
strategy => Thin.Int (Strategy)) /= Thin.Z_OK
then
Raise_Error (Filter.Strm.all);
end if;
end Deflate_Init;
-----------
-- Flush --
-----------
procedure Flush
(Filter : in out Filter_Type;
Out_Data : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Flush : in Flush_Mode)
is
No_Data : Stream_Element_Array := (1 .. 0 => 0);
Last : Stream_Element_Offset;
begin
Translate (Filter, No_Data, Last, Out_Data, Out_Last, Flush);
end Flush;
-----------------------
-- Generic_Translate --
-----------------------
procedure Generic_Translate
(Filter : in out ZLib.Filter_Type;
In_Buffer_Size : in Integer := Default_Buffer_Size;
Out_Buffer_Size : in Integer := Default_Buffer_Size)
is
In_Buffer : Stream_Element_Array
(1 .. Stream_Element_Offset (In_Buffer_Size));
Out_Buffer : Stream_Element_Array
(1 .. Stream_Element_Offset (Out_Buffer_Size));
Last : Stream_Element_Offset;
In_Last : Stream_Element_Offset;
In_First : Stream_Element_Offset;
Out_Last : Stream_Element_Offset;
begin
Main : loop
Data_In (In_Buffer, Last);
In_First := In_Buffer'First;
loop
Translate
(Filter => Filter,
In_Data => In_Buffer (In_First .. Last),
In_Last => In_Last,
Out_Data => Out_Buffer,
Out_Last => Out_Last,
Flush => Flush_Finish (Last < In_Buffer'First));
if Out_Buffer'First <= Out_Last then
Data_Out (Out_Buffer (Out_Buffer'First .. Out_Last));
end if;
exit Main when Stream_End (Filter);
-- The end of in buffer.
exit when In_Last = Last;
In_First := In_Last + 1;
end loop;
end loop Main;
end Generic_Translate;
------------------
-- Inflate_Init --
------------------
procedure Inflate_Init
(Filter : in out Filter_Type;
Window_Bits : in Window_Bits_Type := Default_Window_Bits;
Header : in Header_Type := Default)
is
use type Thin.Int;
Win_Bits : Thin.Int := Thin.Int (Window_Bits);
procedure Check_Version;
-- Check the latest header types compatibility.
procedure Check_Version is
begin
if Version <= "1.1.4" then
Raise_Error
("Inflate header type " & Header_Type'Image (Header)
& " incompatible with ZLib version " & Version);
end if;
end Check_Version;
begin
if Is_Open (Filter) then
raise Status_Error;
end if;
case Header is
when None =>
Check_Version;
-- Inflate data without headers determined
-- by negative Win_Bits.
Win_Bits := -Win_Bits;
when GZip =>
Check_Version;
-- Inflate gzip data defined by flag 16.
Win_Bits := Win_Bits + 16;
when Auto =>
Check_Version;
-- Inflate with automatic detection
-- of gzip or native header defined by flag 32.
Win_Bits := Win_Bits + 32;
when Default => null;
end case;
Filter.Strm := new Z_Stream;
Filter.Compression := False;
Filter.Stream_End := False;
Filter.Header := Header;
if Thin.Inflate_Init
(To_Thin_Access (Filter.Strm), Win_Bits) /= Thin.Z_OK
then
Raise_Error (Filter.Strm.all);
end if;
end Inflate_Init;
-------------
-- Is_Open --
-------------
function Is_Open (Filter : in Filter_Type) return Boolean is
begin
return Filter.Strm /= null;
end Is_Open;
-----------------
-- Raise_Error --
-----------------
procedure Raise_Error (Message : in String) is
begin
Ada.Exceptions.Raise_Exception (ZLib_Error'Identity, Message);
end Raise_Error;
procedure Raise_Error (Stream : in Z_Stream) is
begin
Raise_Error (Last_Error_Message (Stream));
end Raise_Error;
----------
-- Read --
----------
procedure Read
(Filter : in out Filter_Type;
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset;
Flush : in Flush_Mode := No_Flush)
is
In_Last : Stream_Element_Offset;
Item_First : Ada.Streams.Stream_Element_Offset := Item'First;
V_Flush : Flush_Mode := Flush;
begin
pragma Assert (Rest_First in Buffer'First .. Buffer'Last + 1);
pragma Assert (Rest_Last in Buffer'First - 1 .. Buffer'Last);
loop
if Rest_Last = Buffer'First - 1 then
V_Flush := Finish;
elsif Rest_First > Rest_Last then
Read (Buffer, Rest_Last);
Rest_First := Buffer'First;
if Rest_Last < Buffer'First then
V_Flush := Finish;
end if;
end if;
Translate
(Filter => Filter,
In_Data => Buffer (Rest_First .. Rest_Last),
In_Last => In_Last,
Out_Data => Item (Item_First .. Item'Last),
Out_Last => Last,
Flush => V_Flush);
Rest_First := In_Last + 1;
exit when Stream_End (Filter)
or else Last = Item'Last
or else (Last >= Item'First and then Allow_Read_Some);
Item_First := Last + 1;
end loop;
end Read;
----------------
-- Stream_End --
----------------
function Stream_End (Filter : in Filter_Type) return Boolean is
begin
if Filter.Header = GZip and Filter.Compression then
return Filter.Stream_End
and then Filter.Offset = Footer_Array'Last + 1;
else
return Filter.Stream_End;
end if;
end Stream_End;
--------------
-- Total_In --
--------------
function Total_In (Filter : in Filter_Type) return Count is
begin
return Count (Thin.Total_In (To_Thin_Access (Filter.Strm).all));
end Total_In;
---------------
-- Total_Out --
---------------
function Total_Out (Filter : in Filter_Type) return Count is
begin
return Count (Thin.Total_Out (To_Thin_Access (Filter.Strm).all));
end Total_Out;
---------------
-- Translate --
---------------
procedure Translate
(Filter : in out Filter_Type;
In_Data : in Ada.Streams.Stream_Element_Array;
In_Last : out Ada.Streams.Stream_Element_Offset;
Out_Data : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Flush : in Flush_Mode) is
begin
if Filter.Header = GZip and then Filter.Compression then
Translate_GZip
(Filter => Filter,
In_Data => In_Data,
In_Last => In_Last,
Out_Data => Out_Data,
Out_Last => Out_Last,
Flush => Flush);
else
Translate_Auto
(Filter => Filter,
In_Data => In_Data,
In_Last => In_Last,
Out_Data => Out_Data,
Out_Last => Out_Last,
Flush => Flush);
end if;
end Translate;
--------------------
-- Translate_Auto --
--------------------
procedure Translate_Auto
(Filter : in out Filter_Type;
In_Data : in Ada.Streams.Stream_Element_Array;
In_Last : out Ada.Streams.Stream_Element_Offset;
Out_Data : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Flush : in Flush_Mode)
is
use type Thin.Int;
Code : Thin.Int;
begin
if not Is_Open (Filter) then
raise Status_Error;
end if;
if Out_Data'Length = 0 and then In_Data'Length = 0 then
raise Constraint_Error;
end if;
Set_Out (Filter.Strm.all, Out_Data'Address, Out_Data'Length);
Set_In (Filter.Strm.all, In_Data'Address, In_Data'Length);
Code := Flate (Filter.Compression).Step
(To_Thin_Access (Filter.Strm),
Thin.Int (Flush));
if Code = Thin.Z_STREAM_END then
Filter.Stream_End := True;
else
Check_Error (Filter.Strm.all, Code);
end if;
In_Last := In_Data'Last
- Stream_Element_Offset (Avail_In (Filter.Strm.all));
Out_Last := Out_Data'Last
- Stream_Element_Offset (Avail_Out (Filter.Strm.all));
end Translate_Auto;
--------------------
-- Translate_GZip --
--------------------
procedure Translate_GZip
(Filter : in out Filter_Type;
In_Data : in Ada.Streams.Stream_Element_Array;
In_Last : out Ada.Streams.Stream_Element_Offset;
Out_Data : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Flush : in Flush_Mode)
is
Out_First : Stream_Element_Offset;
procedure Add_Data (Data : in Stream_Element_Array);
-- Add data to stream from the Filter.Offset till necessary,
-- used for add gzip headr/footer.
procedure Put_32
(Item : in out Stream_Element_Array;
Data : in Unsigned_32);
pragma Inline (Put_32);
--------------
-- Add_Data --
--------------
procedure Add_Data (Data : in Stream_Element_Array) is
Data_First : Stream_Element_Offset renames Filter.Offset;
Data_Last : Stream_Element_Offset;
Data_Len : Stream_Element_Offset; -- -1
Out_Len : Stream_Element_Offset; -- -1
begin
Out_First := Out_Last + 1;
if Data_First > Data'Last then
return;
end if;
Data_Len := Data'Last - Data_First;
Out_Len := Out_Data'Last - Out_First;
if Data_Len <= Out_Len then
Out_Last := Out_First + Data_Len;
Data_Last := Data'Last;
else
Out_Last := Out_Data'Last;
Data_Last := Data_First + Out_Len;
end if;
Out_Data (Out_First .. Out_Last) := Data (Data_First .. Data_Last);
Data_First := Data_Last + 1;
Out_First := Out_Last + 1;
end Add_Data;
------------
-- Put_32 --
------------
procedure Put_32
(Item : in out Stream_Element_Array;
Data : in Unsigned_32)
is
D : Unsigned_32 := Data;
begin
for J in Item'First .. Item'First + 3 loop
Item (J) := Stream_Element (D and 16#FF#);
D := Shift_Right (D, 8);
end loop;
end Put_32;
begin
Out_Last := Out_Data'First - 1;
if not Filter.Stream_End then
Add_Data (Simple_GZip_Header);
Translate_Auto
(Filter => Filter,
In_Data => In_Data,
In_Last => In_Last,
Out_Data => Out_Data (Out_First .. Out_Data'Last),
Out_Last => Out_Last,
Flush => Flush);
CRC32 (Filter.CRC, In_Data (In_Data'First .. In_Last));
end if;
if Filter.Stream_End and then Out_Last <= Out_Data'Last then
-- This detection method would work only when
-- Simple_GZip_Header'Last > Footer_Array'Last
if Filter.Offset = Simple_GZip_Header'Last + 1 then
Filter.Offset := Footer_Array'First;
end if;
declare
Footer : Footer_Array;
begin
Put_32 (Footer, Filter.CRC);
Put_32 (Footer (Footer'First + 4 .. Footer'Last),
Unsigned_32 (Total_In (Filter)));
Add_Data (Footer);
end;
end if;
end Translate_GZip;
-------------
-- Version --
-------------
function Version return String is
begin
return Interfaces.C.Strings.Value (Thin.zlibVersion);
end Version;
-----------
-- Write --
-----------
procedure Write
(Filter : in out Filter_Type;
Item : in Ada.Streams.Stream_Element_Array;
Flush : in Flush_Mode := No_Flush)
is
Buffer : Stream_Element_Array (1 .. Buffer_Size);
In_Last : Stream_Element_Offset;
Out_Last : Stream_Element_Offset;
In_First : Stream_Element_Offset := Item'First;
begin
if Item'Length = 0 and Flush = No_Flush then
return;
end if;
loop
Translate
(Filter => Filter,
In_Data => Item (In_First .. Item'Last),
In_Last => In_Last,
Out_Data => Buffer,
Out_Last => Out_Last,
Flush => Flush);
if Out_Last >= Buffer'First then
Write (Buffer (1 .. Out_Last));
end if;
exit when In_Last = Item'Last or Stream_End (Filter);
In_First := In_Last + 1;
end loop;
end Write;
end ZLib;
| {
"pile_set_name": "Github"
} |
/*
Copyright 2005-2015 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. Threading Building Blocks is free software;
you can redistribute it and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. Threading Building Blocks 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 Threading Building Blocks; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
As a special exception, you may use this file as part of a free software library without
restriction. Specifically, if other files instantiate templates or use macros or inline
functions from this file, or you compile this file and link it with other files to produce
an executable, this file does not by itself cause the resulting executable to be covered
by the GNU General Public License. This exception does not however invalidate any other
reasons why the executable file might be covered by the GNU General Public License.
*/
_scalable_calloc
_scalable_free
_scalable_malloc
_scalable_realloc
_scalable_posix_memalign
_scalable_aligned_malloc
_scalable_aligned_realloc
_scalable_aligned_free
_scalable_msize
_scalable_allocation_mode
_scalable_allocation_command
___TBB_malloc_safer_aligned_msize
___TBB_malloc_safer_aligned_realloc
___TBB_malloc_safer_free
___TBB_malloc_safer_msize
___TBB_malloc_safer_realloc
___TBB_malloc_free_definite_size
/* memory pool stuff */
__ZN3rml11pool_createElPKNS_13MemPoolPolicyE
__ZN3rml14pool_create_v1ElPKNS_13MemPoolPolicyEPPNS_10MemoryPoolE
__ZN3rml10pool_resetEPNS_10MemoryPoolE
__ZN3rml12pool_destroyEPNS_10MemoryPoolE
__ZN3rml11pool_mallocEPNS_10MemoryPoolEm
__ZN3rml9pool_freeEPNS_10MemoryPoolEPv
__ZN3rml12pool_reallocEPNS_10MemoryPoolEPvm
__ZN3rml20pool_aligned_reallocEPNS_10MemoryPoolEPvmm
__ZN3rml19pool_aligned_mallocEPNS_10MemoryPoolEmm
__ZN3rml13pool_identifyEPv
| {
"pile_set_name": "Github"
} |
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S8.6_A2_T1;
* @section: 8.6, 11.3.1;
* @assertion: Do not crash with postincrement custom property;
* @description: Try to implement postincrement for custom property;
*/
var __map={foo:"bar"};
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
__map.foo++;
if (!isNaN(__map.foo)) {
$ERROR('#1: var __map={foo:"bar"}; __map.foo++; __map.foo === Not-a-Number. Actual: ' + (__map.foo));
}
//
//////////////////////////////////////////////////////////////////////////////
| {
"pile_set_name": "Github"
} |
Такой иероглиф обозначает «полный». Символ добавлен в Юникод чтобы обеспечить совместимость с японскими наборами эмоджи для сотовых телефонов.
| {
"pile_set_name": "Github"
} |
// <snippetlinqexamples26>
using (ServiceContext svcContext = new ServiceContext(_serviceProxy))
{
var query_startswith1 = from c in svcContext.ContactSet
where c.FirstName.StartsWith("Bri")
select new
{
c.FirstName,
c.LastName
};
foreach (var c in query_startswith1)
{
System.Console.WriteLine(c.FirstName + " " + c.LastName);
}
}
// </snippetlinqexamples26> | {
"pile_set_name": "Github"
} |
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package proto
import (
"bytes"
"encoding"
"fmt"
"io"
"math"
"sort"
"strings"
"google.golang.org/protobuf/encoding/prototext"
"google.golang.org/protobuf/encoding/protowire"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/reflect/protoregistry"
)
const wrapTextMarshalV2 = false
// TextMarshaler is a configurable text format marshaler.
type TextMarshaler struct {
Compact bool // use compact text format (one line)
ExpandAny bool // expand google.protobuf.Any messages of known types
}
// Marshal writes the proto text format of m to w.
func (tm *TextMarshaler) Marshal(w io.Writer, m Message) error {
b, err := tm.marshal(m)
if len(b) > 0 {
if _, err := w.Write(b); err != nil {
return err
}
}
return err
}
// Text returns a proto text formatted string of m.
func (tm *TextMarshaler) Text(m Message) string {
b, _ := tm.marshal(m)
return string(b)
}
func (tm *TextMarshaler) marshal(m Message) ([]byte, error) {
mr := MessageReflect(m)
if mr == nil || !mr.IsValid() {
return []byte("<nil>"), nil
}
if wrapTextMarshalV2 {
if m, ok := m.(encoding.TextMarshaler); ok {
return m.MarshalText()
}
opts := prototext.MarshalOptions{
AllowPartial: true,
EmitUnknown: true,
}
if !tm.Compact {
opts.Indent = " "
}
if !tm.ExpandAny {
opts.Resolver = (*protoregistry.Types)(nil)
}
return opts.Marshal(mr.Interface())
} else {
w := &textWriter{
compact: tm.Compact,
expandAny: tm.ExpandAny,
complete: true,
}
if m, ok := m.(encoding.TextMarshaler); ok {
b, err := m.MarshalText()
if err != nil {
return nil, err
}
w.Write(b)
return w.buf, nil
}
err := w.writeMessage(mr)
return w.buf, err
}
}
var (
defaultTextMarshaler = TextMarshaler{}
compactTextMarshaler = TextMarshaler{Compact: true}
)
// MarshalText writes the proto text format of m to w.
func MarshalText(w io.Writer, m Message) error { return defaultTextMarshaler.Marshal(w, m) }
// MarshalTextString returns a proto text formatted string of m.
func MarshalTextString(m Message) string { return defaultTextMarshaler.Text(m) }
// CompactText writes the compact proto text format of m to w.
func CompactText(w io.Writer, m Message) error { return compactTextMarshaler.Marshal(w, m) }
// CompactTextString returns a compact proto text formatted string of m.
func CompactTextString(m Message) string { return compactTextMarshaler.Text(m) }
var (
newline = []byte("\n")
endBraceNewline = []byte("}\n")
posInf = []byte("inf")
negInf = []byte("-inf")
nan = []byte("nan")
)
// textWriter is an io.Writer that tracks its indentation level.
type textWriter struct {
compact bool // same as TextMarshaler.Compact
expandAny bool // same as TextMarshaler.ExpandAny
complete bool // whether the current position is a complete line
indent int // indentation level; never negative
buf []byte
}
func (w *textWriter) Write(p []byte) (n int, _ error) {
newlines := bytes.Count(p, newline)
if newlines == 0 {
if !w.compact && w.complete {
w.writeIndent()
}
w.buf = append(w.buf, p...)
w.complete = false
return len(p), nil
}
frags := bytes.SplitN(p, newline, newlines+1)
if w.compact {
for i, frag := range frags {
if i > 0 {
w.buf = append(w.buf, ' ')
n++
}
w.buf = append(w.buf, frag...)
n += len(frag)
}
return n, nil
}
for i, frag := range frags {
if w.complete {
w.writeIndent()
}
w.buf = append(w.buf, frag...)
n += len(frag)
if i+1 < len(frags) {
w.buf = append(w.buf, '\n')
n++
}
}
w.complete = len(frags[len(frags)-1]) == 0
return n, nil
}
func (w *textWriter) WriteByte(c byte) error {
if w.compact && c == '\n' {
c = ' '
}
if !w.compact && w.complete {
w.writeIndent()
}
w.buf = append(w.buf, c)
w.complete = c == '\n'
return nil
}
func (w *textWriter) writeName(fd protoreflect.FieldDescriptor) {
if !w.compact && w.complete {
w.writeIndent()
}
w.complete = false
if fd.Kind() != protoreflect.GroupKind {
w.buf = append(w.buf, fd.Name()...)
w.WriteByte(':')
} else {
// Use message type name for group field name.
w.buf = append(w.buf, fd.Message().Name()...)
}
if !w.compact {
w.WriteByte(' ')
}
}
func requiresQuotes(u string) bool {
// When type URL contains any characters except [0-9A-Za-z./\-]*, it must be quoted.
for _, ch := range u {
switch {
case ch == '.' || ch == '/' || ch == '_':
continue
case '0' <= ch && ch <= '9':
continue
case 'A' <= ch && ch <= 'Z':
continue
case 'a' <= ch && ch <= 'z':
continue
default:
return true
}
}
return false
}
// writeProto3Any writes an expanded google.protobuf.Any message.
//
// It returns (false, nil) if sv value can't be unmarshaled (e.g. because
// required messages are not linked in).
//
// It returns (true, error) when sv was written in expanded format or an error
// was encountered.
func (w *textWriter) writeProto3Any(m protoreflect.Message) (bool, error) {
md := m.Descriptor()
fdURL := md.Fields().ByName("type_url")
fdVal := md.Fields().ByName("value")
url := m.Get(fdURL).String()
mt, err := protoregistry.GlobalTypes.FindMessageByURL(url)
if err != nil {
return false, nil
}
b := m.Get(fdVal).Bytes()
m2 := mt.New()
if err := proto.Unmarshal(b, m2.Interface()); err != nil {
return false, nil
}
w.Write([]byte("["))
if requiresQuotes(url) {
w.writeQuotedString(url)
} else {
w.Write([]byte(url))
}
if w.compact {
w.Write([]byte("]:<"))
} else {
w.Write([]byte("]: <\n"))
w.indent++
}
if err := w.writeMessage(m2); err != nil {
return true, err
}
if w.compact {
w.Write([]byte("> "))
} else {
w.indent--
w.Write([]byte(">\n"))
}
return true, nil
}
func (w *textWriter) writeMessage(m protoreflect.Message) error {
md := m.Descriptor()
if w.expandAny && md.FullName() == "google.protobuf.Any" {
if canExpand, err := w.writeProto3Any(m); canExpand {
return err
}
}
fds := md.Fields()
for i := 0; i < fds.Len(); {
fd := fds.Get(i)
if od := fd.ContainingOneof(); od != nil {
fd = m.WhichOneof(od)
i += od.Fields().Len()
} else {
i++
}
if fd == nil || !m.Has(fd) {
continue
}
switch {
case fd.IsList():
lv := m.Get(fd).List()
for j := 0; j < lv.Len(); j++ {
w.writeName(fd)
v := lv.Get(j)
if err := w.writeSingularValue(v, fd); err != nil {
return err
}
w.WriteByte('\n')
}
case fd.IsMap():
kfd := fd.MapKey()
vfd := fd.MapValue()
mv := m.Get(fd).Map()
type entry struct{ key, val protoreflect.Value }
var entries []entry
mv.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool {
entries = append(entries, entry{k.Value(), v})
return true
})
sort.Slice(entries, func(i, j int) bool {
switch kfd.Kind() {
case protoreflect.BoolKind:
return !entries[i].key.Bool() && entries[j].key.Bool()
case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind, protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
return entries[i].key.Int() < entries[j].key.Int()
case protoreflect.Uint32Kind, protoreflect.Fixed32Kind, protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
return entries[i].key.Uint() < entries[j].key.Uint()
case protoreflect.StringKind:
return entries[i].key.String() < entries[j].key.String()
default:
panic("invalid kind")
}
})
for _, entry := range entries {
w.writeName(fd)
w.WriteByte('<')
if !w.compact {
w.WriteByte('\n')
}
w.indent++
w.writeName(kfd)
if err := w.writeSingularValue(entry.key, kfd); err != nil {
return err
}
w.WriteByte('\n')
w.writeName(vfd)
if err := w.writeSingularValue(entry.val, vfd); err != nil {
return err
}
w.WriteByte('\n')
w.indent--
w.WriteByte('>')
w.WriteByte('\n')
}
default:
w.writeName(fd)
if err := w.writeSingularValue(m.Get(fd), fd); err != nil {
return err
}
w.WriteByte('\n')
}
}
if b := m.GetUnknown(); len(b) > 0 {
w.writeUnknownFields(b)
}
return w.writeExtensions(m)
}
func (w *textWriter) writeSingularValue(v protoreflect.Value, fd protoreflect.FieldDescriptor) error {
switch fd.Kind() {
case protoreflect.FloatKind, protoreflect.DoubleKind:
switch vf := v.Float(); {
case math.IsInf(vf, +1):
w.Write(posInf)
case math.IsInf(vf, -1):
w.Write(negInf)
case math.IsNaN(vf):
w.Write(nan)
default:
fmt.Fprint(w, v.Interface())
}
case protoreflect.StringKind:
// NOTE: This does not validate UTF-8 for historical reasons.
w.writeQuotedString(string(v.String()))
case protoreflect.BytesKind:
w.writeQuotedString(string(v.Bytes()))
case protoreflect.MessageKind, protoreflect.GroupKind:
var bra, ket byte = '<', '>'
if fd.Kind() == protoreflect.GroupKind {
bra, ket = '{', '}'
}
w.WriteByte(bra)
if !w.compact {
w.WriteByte('\n')
}
w.indent++
m := v.Message()
if m2, ok := m.Interface().(encoding.TextMarshaler); ok {
b, err := m2.MarshalText()
if err != nil {
return err
}
w.Write(b)
} else {
w.writeMessage(m)
}
w.indent--
w.WriteByte(ket)
case protoreflect.EnumKind:
if ev := fd.Enum().Values().ByNumber(v.Enum()); ev != nil {
fmt.Fprint(w, ev.Name())
} else {
fmt.Fprint(w, v.Enum())
}
default:
fmt.Fprint(w, v.Interface())
}
return nil
}
// writeQuotedString writes a quoted string in the protocol buffer text format.
func (w *textWriter) writeQuotedString(s string) {
w.WriteByte('"')
for i := 0; i < len(s); i++ {
switch c := s[i]; c {
case '\n':
w.buf = append(w.buf, `\n`...)
case '\r':
w.buf = append(w.buf, `\r`...)
case '\t':
w.buf = append(w.buf, `\t`...)
case '"':
w.buf = append(w.buf, `\"`...)
case '\\':
w.buf = append(w.buf, `\\`...)
default:
if isPrint := c >= 0x20 && c < 0x7f; isPrint {
w.buf = append(w.buf, c)
} else {
w.buf = append(w.buf, fmt.Sprintf(`\%03o`, c)...)
}
}
}
w.WriteByte('"')
}
func (w *textWriter) writeUnknownFields(b []byte) {
if !w.compact {
fmt.Fprintf(w, "/* %d unknown bytes */\n", len(b))
}
for len(b) > 0 {
num, wtyp, n := protowire.ConsumeTag(b)
if n < 0 {
return
}
b = b[n:]
if wtyp == protowire.EndGroupType {
w.indent--
w.Write(endBraceNewline)
continue
}
fmt.Fprint(w, num)
if wtyp != protowire.StartGroupType {
w.WriteByte(':')
}
if !w.compact || wtyp == protowire.StartGroupType {
w.WriteByte(' ')
}
switch wtyp {
case protowire.VarintType:
v, n := protowire.ConsumeVarint(b)
if n < 0 {
return
}
b = b[n:]
fmt.Fprint(w, v)
case protowire.Fixed32Type:
v, n := protowire.ConsumeFixed32(b)
if n < 0 {
return
}
b = b[n:]
fmt.Fprint(w, v)
case protowire.Fixed64Type:
v, n := protowire.ConsumeFixed64(b)
if n < 0 {
return
}
b = b[n:]
fmt.Fprint(w, v)
case protowire.BytesType:
v, n := protowire.ConsumeBytes(b)
if n < 0 {
return
}
b = b[n:]
fmt.Fprintf(w, "%q", v)
case protowire.StartGroupType:
w.WriteByte('{')
w.indent++
default:
fmt.Fprintf(w, "/* unknown wire type %d */", wtyp)
}
w.WriteByte('\n')
}
}
// writeExtensions writes all the extensions in m.
func (w *textWriter) writeExtensions(m protoreflect.Message) error {
md := m.Descriptor()
if md.ExtensionRanges().Len() == 0 {
return nil
}
type ext struct {
desc protoreflect.FieldDescriptor
val protoreflect.Value
}
var exts []ext
m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {
if fd.IsExtension() {
exts = append(exts, ext{fd, v})
}
return true
})
sort.Slice(exts, func(i, j int) bool {
return exts[i].desc.Number() < exts[j].desc.Number()
})
for _, ext := range exts {
// For message set, use the name of the message as the extension name.
name := string(ext.desc.FullName())
if isMessageSet(ext.desc.ContainingMessage()) {
name = strings.TrimSuffix(name, ".message_set_extension")
}
if !ext.desc.IsList() {
if err := w.writeSingularExtension(name, ext.val, ext.desc); err != nil {
return err
}
} else {
lv := ext.val.List()
for i := 0; i < lv.Len(); i++ {
if err := w.writeSingularExtension(name, lv.Get(i), ext.desc); err != nil {
return err
}
}
}
}
return nil
}
func (w *textWriter) writeSingularExtension(name string, v protoreflect.Value, fd protoreflect.FieldDescriptor) error {
fmt.Fprintf(w, "[%s]:", name)
if !w.compact {
w.WriteByte(' ')
}
if err := w.writeSingularValue(v, fd); err != nil {
return err
}
w.WriteByte('\n')
return nil
}
func (w *textWriter) writeIndent() {
if !w.complete {
return
}
for i := 0; i < w.indent*2; i++ {
w.buf = append(w.buf, ' ')
}
w.complete = false
}
| {
"pile_set_name": "Github"
} |
#include <linux/kernel.h>
#include <asm/system.h>
typedef unsigned int instr;
#define MAJOR_OP 0xfc000000
#define LDA_OP 0x20000000
#define STQ_OP 0xb4000000
#define BR_OP 0xc0000000
#define STK_ALLOC_1 0x23de8000 /* lda $30,-X($30) */
#define STK_ALLOC_1M 0xffff8000
#define STK_ALLOC_2 0x43c0153e /* subq $30,X,$30 */
#define STK_ALLOC_2M 0xffe01fff
#define MEM_REG 0x03e00000
#define MEM_BASE 0x001f0000
#define MEM_OFF 0x0000ffff
#define MEM_OFF_SIGN 0x00008000
#define BASE_SP 0x001e0000
#define STK_ALLOC_MATCH(INSTR) \
(((INSTR) & STK_ALLOC_1M) == STK_ALLOC_1 \
|| ((INSTR) & STK_ALLOC_2M) == STK_ALLOC_2)
#define STK_PUSH_MATCH(INSTR) \
(((INSTR) & (MAJOR_OP | MEM_BASE | MEM_OFF_SIGN)) == (STQ_OP | BASE_SP))
#define MEM_OP_OFFSET(INSTR) \
(((long)((INSTR) & MEM_OFF) << 48) >> 48)
#define MEM_OP_REG(INSTR) \
(((INSTR) & MEM_REG) >> 22)
/* Branches, jumps, PAL calls, and illegal opcodes end a basic block. */
#define BB_END(INSTR) \
(((instr)(INSTR) >= BR_OP) | ((instr)(INSTR) < LDA_OP) | \
((((instr)(INSTR) ^ 0x60000000) < 0x20000000) & \
(((instr)(INSTR) & 0x0c000000) != 0)))
#define IS_KERNEL_TEXT(PC) ((unsigned long)(PC) > START_ADDR)
static char reg_name[][4] = {
"v0 ", "t0 ", "t1 ", "t2 ", "t3 ", "t4 ", "t5 ", "t6 ", "t7 ",
"s0 ", "s1 ", "s2 ", "s3 ", "s4 ", "s5 ", "s6 ", "a0 ", "a1 ",
"a2 ", "a3 ", "a4 ", "a5 ", "t8 ", "t9 ", "t10", "t11", "ra ",
"pv ", "at ", "gp ", "sp ", "0"
};
static instr *
display_stored_regs(instr * pro_pc, unsigned char * sp)
{
instr * ret_pc = 0;
int reg;
unsigned long value;
printk("Prologue [<%p>], Frame %p:\n", pro_pc, sp);
while (!BB_END(*pro_pc))
if (STK_PUSH_MATCH(*pro_pc)) {
reg = (*pro_pc & MEM_REG) >> 21;
value = *(unsigned long *)(sp + (*pro_pc & MEM_OFF));
if (reg == 26)
ret_pc = (instr *)value;
printk("\t\t%s / 0x%016lx\n", reg_name[reg], value);
}
return ret_pc;
}
static instr *
seek_prologue(instr * pc)
{
while (!STK_ALLOC_MATCH(*pc))
--pc;
while (!BB_END(*(pc - 1)))
--pc;
return pc;
}
static long
stack_increment(instr * prologue_pc)
{
while (!STK_ALLOC_MATCH(*prologue_pc))
++prologue_pc;
/* Count the bytes allocated. */
if ((*prologue_pc & STK_ALLOC_1M) == STK_ALLOC_1M)
return -(((long)(*prologue_pc) << 48) >> 48);
else
return (*prologue_pc >> 13) & 0xff;
}
void
stacktrace(void)
{
instr * ret_pc;
instr * prologue = (instr *)stacktrace;
register unsigned char * sp __asm__ ("$30");
printk("\tstack trace:\n");
do {
ret_pc = display_stored_regs(prologue, sp);
sp += stack_increment(prologue);
prologue = seek_prologue(ret_pc);
} while (IS_KERNEL_TEXT(ret_pc));
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright(c) 2008 - 2009 Atheros Corporation. All rights reserved.
*
* Derived from Intel e1000 driver
* Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _ATL1C_H_
#define _ATL1C_H_
#include <linux/interrupt.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/udp.h>
#include <linux/mii.h>
#include <linux/io.h>
#include <linux/vmalloc.h>
#include <linux/pagemap.h>
#include <linux/tcp.h>
#include <linux/ethtool.h>
#include <linux/if_vlan.h>
#include <linux/workqueue.h>
#include <net/checksum.h>
#include <net/ip6_checksum.h>
#include "atl1c_hw.h"
/* Wake Up Filter Control */
#define AT_WUFC_LNKC 0x00000001 /* Link Status Change Wakeup Enable */
#define AT_WUFC_MAG 0x00000002 /* Magic Packet Wakeup Enable */
#define AT_WUFC_EX 0x00000004 /* Directed Exact Wakeup Enable */
#define AT_WUFC_MC 0x00000008 /* Multicast Wakeup Enable */
#define AT_WUFC_BC 0x00000010 /* Broadcast Wakeup Enable */
#define AT_VLAN_TO_TAG(_vlan, _tag) \
_tag = ((((_vlan) >> 8) & 0xFF) |\
(((_vlan) & 0xFF) << 8))
#define AT_TAG_TO_VLAN(_tag, _vlan) \
_vlan = ((((_tag) >> 8) & 0xFF) |\
(((_tag) & 0xFF) << 8))
#define SPEED_0 0xffff
#define HALF_DUPLEX 1
#define FULL_DUPLEX 2
#define AT_RX_BUF_SIZE (ETH_FRAME_LEN + VLAN_HLEN + ETH_FCS_LEN)
#define MAX_JUMBO_FRAME_SIZE (6*1024)
#define AT_MAX_RECEIVE_QUEUE 4
#define AT_DEF_RECEIVE_QUEUE 1
#define AT_MAX_TRANSMIT_QUEUE 2
#define AT_DMA_HI_ADDR_MASK 0xffffffff00000000ULL
#define AT_DMA_LO_ADDR_MASK 0x00000000ffffffffULL
#define AT_TX_WATCHDOG (5 * HZ)
#define AT_MAX_INT_WORK 5
#define AT_TWSI_EEPROM_TIMEOUT 100
#define AT_HW_MAX_IDLE_DELAY 10
#define AT_SUSPEND_LINK_TIMEOUT 100
#define AT_ASPM_L0S_TIMER 6
#define AT_ASPM_L1_TIMER 12
#define AT_LCKDET_TIMER 12
#define ATL1C_PCIE_L0S_L1_DISABLE 0x01
#define ATL1C_PCIE_PHY_RESET 0x02
#define ATL1C_ASPM_L0s_ENABLE 0x0001
#define ATL1C_ASPM_L1_ENABLE 0x0002
#define AT_REGS_LEN (74 * sizeof(u32))
#define AT_EEPROM_LEN 512
#define ATL1C_GET_DESC(R, i, type) (&(((type *)((R)->desc))[i]))
#define ATL1C_RFD_DESC(R, i) ATL1C_GET_DESC(R, i, struct atl1c_rx_free_desc)
#define ATL1C_TPD_DESC(R, i) ATL1C_GET_DESC(R, i, struct atl1c_tpd_desc)
#define ATL1C_RRD_DESC(R, i) ATL1C_GET_DESC(R, i, struct atl1c_recv_ret_status)
/* tpd word 1 bit 0:7 General Checksum task offload */
#define TPD_L4HDR_OFFSET_MASK 0x00FF
#define TPD_L4HDR_OFFSET_SHIFT 0
/* tpd word 1 bit 0:7 Large Send task offload (IPv4/IPV6) */
#define TPD_TCPHDR_OFFSET_MASK 0x00FF
#define TPD_TCPHDR_OFFSET_SHIFT 0
/* tpd word 1 bit 0:7 Custom Checksum task offload */
#define TPD_PLOADOFFSET_MASK 0x00FF
#define TPD_PLOADOFFSET_SHIFT 0
/* tpd word 1 bit 8:17 */
#define TPD_CCSUM_EN_MASK 0x0001
#define TPD_CCSUM_EN_SHIFT 8
#define TPD_IP_CSUM_MASK 0x0001
#define TPD_IP_CSUM_SHIFT 9
#define TPD_TCP_CSUM_MASK 0x0001
#define TPD_TCP_CSUM_SHIFT 10
#define TPD_UDP_CSUM_MASK 0x0001
#define TPD_UDP_CSUM_SHIFT 11
#define TPD_LSO_EN_MASK 0x0001 /* TCP Large Send Offload */
#define TPD_LSO_EN_SHIFT 12
#define TPD_LSO_VER_MASK 0x0001
#define TPD_LSO_VER_SHIFT 13 /* 0 : ipv4; 1 : ipv4/ipv6 */
#define TPD_CON_VTAG_MASK 0x0001
#define TPD_CON_VTAG_SHIFT 14
#define TPD_INS_VTAG_MASK 0x0001
#define TPD_INS_VTAG_SHIFT 15
#define TPD_IPV4_PACKET_MASK 0x0001 /* valid when LSO VER is 1 */
#define TPD_IPV4_PACKET_SHIFT 16
#define TPD_ETH_TYPE_MASK 0x0001
#define TPD_ETH_TYPE_SHIFT 17 /* 0 : 802.3 frame; 1 : Ethernet */
/* tpd word 18:25 Custom Checksum task offload */
#define TPD_CCSUM_OFFSET_MASK 0x00FF
#define TPD_CCSUM_OFFSET_SHIFT 18
#define TPD_CCSUM_EPAD_MASK 0x0001
#define TPD_CCSUM_EPAD_SHIFT 30
/* tpd word 18:30 Large Send task offload (IPv4/IPV6) */
#define TPD_MSS_MASK 0x1FFF
#define TPD_MSS_SHIFT 18
#define TPD_EOP_MASK 0x0001
#define TPD_EOP_SHIFT 31
struct atl1c_tpd_desc {
__le16 buffer_len; /* include 4-byte CRC */
__le16 vlan_tag;
__le32 word1;
__le64 buffer_addr;
};
struct atl1c_tpd_ext_desc {
u32 reservd_0;
__le32 word1;
__le32 pkt_len;
u32 reservd_1;
};
/* rrs word 0 bit 0:31 */
#define RRS_RX_CSUM_MASK 0xFFFF
#define RRS_RX_CSUM_SHIFT 0
#define RRS_RX_RFD_CNT_MASK 0x000F
#define RRS_RX_RFD_CNT_SHIFT 16
#define RRS_RX_RFD_INDEX_MASK 0x0FFF
#define RRS_RX_RFD_INDEX_SHIFT 20
/* rrs flag bit 0:16 */
#define RRS_HEAD_LEN_MASK 0x00FF
#define RRS_HEAD_LEN_SHIFT 0
#define RRS_HDS_TYPE_MASK 0x0003
#define RRS_HDS_TYPE_SHIFT 8
#define RRS_CPU_NUM_MASK 0x0003
#define RRS_CPU_NUM_SHIFT 10
#define RRS_HASH_FLG_MASK 0x000F
#define RRS_HASH_FLG_SHIFT 12
#define RRS_HDS_TYPE_HEAD 1
#define RRS_HDS_TYPE_DATA 2
#define RRS_IS_NO_HDS_TYPE(flag) \
((((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK) == 0)
#define RRS_IS_HDS_HEAD(flag) \
((((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK) == \
RRS_HDS_TYPE_HEAD)
#define RRS_IS_HDS_DATA(flag) \
((((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK) == \
RRS_HDS_TYPE_DATA)
/* rrs word 3 bit 0:31 */
#define RRS_PKT_SIZE_MASK 0x3FFF
#define RRS_PKT_SIZE_SHIFT 0
#define RRS_ERR_L4_CSUM_MASK 0x0001
#define RRS_ERR_L4_CSUM_SHIFT 14
#define RRS_ERR_IP_CSUM_MASK 0x0001
#define RRS_ERR_IP_CSUM_SHIFT 15
#define RRS_VLAN_INS_MASK 0x0001
#define RRS_VLAN_INS_SHIFT 16
#define RRS_PROT_ID_MASK 0x0007
#define RRS_PROT_ID_SHIFT 17
#define RRS_RX_ERR_SUM_MASK 0x0001
#define RRS_RX_ERR_SUM_SHIFT 20
#define RRS_RX_ERR_CRC_MASK 0x0001
#define RRS_RX_ERR_CRC_SHIFT 21
#define RRS_RX_ERR_FAE_MASK 0x0001
#define RRS_RX_ERR_FAE_SHIFT 22
#define RRS_RX_ERR_TRUNC_MASK 0x0001
#define RRS_RX_ERR_TRUNC_SHIFT 23
#define RRS_RX_ERR_RUNC_MASK 0x0001
#define RRS_RX_ERR_RUNC_SHIFT 24
#define RRS_RX_ERR_ICMP_MASK 0x0001
#define RRS_RX_ERR_ICMP_SHIFT 25
#define RRS_PACKET_BCAST_MASK 0x0001
#define RRS_PACKET_BCAST_SHIFT 26
#define RRS_PACKET_MCAST_MASK 0x0001
#define RRS_PACKET_MCAST_SHIFT 27
#define RRS_PACKET_TYPE_MASK 0x0001
#define RRS_PACKET_TYPE_SHIFT 28
#define RRS_FIFO_FULL_MASK 0x0001
#define RRS_FIFO_FULL_SHIFT 29
#define RRS_802_3_LEN_ERR_MASK 0x0001
#define RRS_802_3_LEN_ERR_SHIFT 30
#define RRS_RXD_UPDATED_MASK 0x0001
#define RRS_RXD_UPDATED_SHIFT 31
#define RRS_ERR_L4_CSUM 0x00004000
#define RRS_ERR_IP_CSUM 0x00008000
#define RRS_VLAN_INS 0x00010000
#define RRS_RX_ERR_SUM 0x00100000
#define RRS_RX_ERR_CRC 0x00200000
#define RRS_802_3_LEN_ERR 0x40000000
#define RRS_RXD_UPDATED 0x80000000
#define RRS_PACKET_TYPE_802_3 1
#define RRS_PACKET_TYPE_ETH 0
#define RRS_PACKET_IS_ETH(word) \
((((word) >> RRS_PACKET_TYPE_SHIFT) & RRS_PACKET_TYPE_MASK) == \
RRS_PACKET_TYPE_ETH)
#define RRS_RXD_IS_VALID(word) \
((((word) >> RRS_RXD_UPDATED_SHIFT) & RRS_RXD_UPDATED_MASK) == 1)
#define RRS_PACKET_PROT_IS_IPV4_ONLY(word) \
((((word) >> RRS_PROT_ID_SHIFT) & RRS_PROT_ID_MASK) == 1)
#define RRS_PACKET_PROT_IS_IPV6_ONLY(word) \
((((word) >> RRS_PROT_ID_SHIFT) & RRS_PROT_ID_MASK) == 6)
struct atl1c_recv_ret_status {
__le32 word0;
__le32 rss_hash;
__le16 vlan_tag;
__le16 flag;
__le32 word3;
};
/* RFD descriptor */
struct atl1c_rx_free_desc {
__le64 buffer_addr;
};
/* DMA Order Settings */
enum atl1c_dma_order {
atl1c_dma_ord_in = 1,
atl1c_dma_ord_enh = 2,
atl1c_dma_ord_out = 4
};
enum atl1c_dma_rcb {
atl1c_rcb_64 = 0,
atl1c_rcb_128 = 1
};
enum atl1c_mac_speed {
atl1c_mac_speed_0 = 0,
atl1c_mac_speed_10_100 = 1,
atl1c_mac_speed_1000 = 2
};
enum atl1c_dma_req_block {
atl1c_dma_req_128 = 0,
atl1c_dma_req_256 = 1,
atl1c_dma_req_512 = 2,
atl1c_dma_req_1024 = 3,
atl1c_dma_req_2048 = 4,
atl1c_dma_req_4096 = 5
};
enum atl1c_nic_type {
athr_l1c = 0,
athr_l2c = 1,
athr_l2c_b,
athr_l2c_b2,
athr_l1d,
athr_l1d_2,
};
enum atl1c_trans_queue {
atl1c_trans_normal = 0,
atl1c_trans_high = 1
};
struct atl1c_hw_stats {
/* rx */
unsigned long rx_ok; /* The number of good packet received. */
unsigned long rx_bcast; /* The number of good broadcast packet received. */
unsigned long rx_mcast; /* The number of good multicast packet received. */
unsigned long rx_pause; /* The number of Pause packet received. */
unsigned long rx_ctrl; /* The number of Control packet received other than Pause frame. */
unsigned long rx_fcs_err; /* The number of packets with bad FCS. */
unsigned long rx_len_err; /* The number of packets with mismatch of length field and actual size. */
unsigned long rx_byte_cnt; /* The number of bytes of good packet received. FCS is NOT included. */
unsigned long rx_runt; /* The number of packets received that are less than 64 byte long and with good FCS. */
unsigned long rx_frag; /* The number of packets received that are less than 64 byte long and with bad FCS. */
unsigned long rx_sz_64; /* The number of good and bad packets received that are 64 byte long. */
unsigned long rx_sz_65_127; /* The number of good and bad packets received that are between 65 and 127-byte long. */
unsigned long rx_sz_128_255; /* The number of good and bad packets received that are between 128 and 255-byte long. */
unsigned long rx_sz_256_511; /* The number of good and bad packets received that are between 256 and 511-byte long. */
unsigned long rx_sz_512_1023; /* The number of good and bad packets received that are between 512 and 1023-byte long. */
unsigned long rx_sz_1024_1518; /* The number of good and bad packets received that are between 1024 and 1518-byte long. */
unsigned long rx_sz_1519_max; /* The number of good and bad packets received that are between 1519-byte and MTU. */
unsigned long rx_sz_ov; /* The number of good and bad packets received that are more than MTU size truncated by Selene. */
unsigned long rx_rxf_ov; /* The number of frame dropped due to occurrence of RX FIFO overflow. */
unsigned long rx_rrd_ov; /* The number of frame dropped due to occurrence of RRD overflow. */
unsigned long rx_align_err; /* Alignment Error */
unsigned long rx_bcast_byte_cnt; /* The byte count of broadcast packet received, excluding FCS. */
unsigned long rx_mcast_byte_cnt; /* The byte count of multicast packet received, excluding FCS. */
unsigned long rx_err_addr; /* The number of packets dropped due to address filtering. */
/* tx */
unsigned long tx_ok; /* The number of good packet transmitted. */
unsigned long tx_bcast; /* The number of good broadcast packet transmitted. */
unsigned long tx_mcast; /* The number of good multicast packet transmitted. */
unsigned long tx_pause; /* The number of Pause packet transmitted. */
unsigned long tx_exc_defer; /* The number of packets transmitted with excessive deferral. */
unsigned long tx_ctrl; /* The number of packets transmitted is a control frame, excluding Pause frame. */
unsigned long tx_defer; /* The number of packets transmitted that is deferred. */
unsigned long tx_byte_cnt; /* The number of bytes of data transmitted. FCS is NOT included. */
unsigned long tx_sz_64; /* The number of good and bad packets transmitted that are 64 byte long. */
unsigned long tx_sz_65_127; /* The number of good and bad packets transmitted that are between 65 and 127-byte long. */
unsigned long tx_sz_128_255; /* The number of good and bad packets transmitted that are between 128 and 255-byte long. */
unsigned long tx_sz_256_511; /* The number of good and bad packets transmitted that are between 256 and 511-byte long. */
unsigned long tx_sz_512_1023; /* The number of good and bad packets transmitted that are between 512 and 1023-byte long. */
unsigned long tx_sz_1024_1518; /* The number of good and bad packets transmitted that are between 1024 and 1518-byte long. */
unsigned long tx_sz_1519_max; /* The number of good and bad packets transmitted that are between 1519-byte and MTU. */
unsigned long tx_1_col; /* The number of packets subsequently transmitted successfully with a single prior collision. */
unsigned long tx_2_col; /* The number of packets subsequently transmitted successfully with multiple prior collisions. */
unsigned long tx_late_col; /* The number of packets transmitted with late collisions. */
unsigned long tx_abort_col; /* The number of transmit packets aborted due to excessive collisions. */
unsigned long tx_underrun; /* The number of transmit packets aborted due to transmit FIFO underrun, or TRD FIFO underrun */
unsigned long tx_rd_eop; /* The number of times that read beyond the EOP into the next frame area when TRD was not written timely */
unsigned long tx_len_err; /* The number of transmit packets with length field does NOT match the actual frame size. */
unsigned long tx_trunc; /* The number of transmit packets truncated due to size exceeding MTU. */
unsigned long tx_bcast_byte; /* The byte count of broadcast packet transmitted, excluding FCS. */
unsigned long tx_mcast_byte; /* The byte count of multicast packet transmitted, excluding FCS. */
};
struct atl1c_hw {
u8 __iomem *hw_addr; /* inner register address */
struct atl1c_adapter *adapter;
enum atl1c_nic_type nic_type;
enum atl1c_dma_order dma_order;
enum atl1c_dma_rcb rcb_value;
enum atl1c_dma_req_block dmar_block;
u16 device_id;
u16 vendor_id;
u16 subsystem_id;
u16 subsystem_vendor_id;
u8 revision_id;
u16 phy_id1;
u16 phy_id2;
u32 intr_mask;
u8 preamble_len;
u16 max_frame_size;
u16 min_frame_size;
enum atl1c_mac_speed mac_speed;
bool mac_duplex;
bool hibernate;
u16 media_type;
#define MEDIA_TYPE_AUTO_SENSOR 0
#define MEDIA_TYPE_100M_FULL 1
#define MEDIA_TYPE_100M_HALF 2
#define MEDIA_TYPE_10M_FULL 3
#define MEDIA_TYPE_10M_HALF 4
u16 autoneg_advertised;
u16 mii_autoneg_adv_reg;
u16 mii_1000t_ctrl_reg;
u16 tx_imt; /* TX Interrupt Moderator timer ( 2us resolution) */
u16 rx_imt; /* RX Interrupt Moderator timer ( 2us resolution) */
u16 ict; /* Interrupt Clear timer (2us resolution) */
u16 ctrl_flags;
#define ATL1C_INTR_CLEAR_ON_READ 0x0001
#define ATL1C_INTR_MODRT_ENABLE 0x0002
#define ATL1C_CMB_ENABLE 0x0004
#define ATL1C_SMB_ENABLE 0x0010
#define ATL1C_TXQ_MODE_ENHANCE 0x0020
#define ATL1C_RX_IPV6_CHKSUM 0x0040
#define ATL1C_ASPM_L0S_SUPPORT 0x0080
#define ATL1C_ASPM_L1_SUPPORT 0x0100
#define ATL1C_ASPM_CTRL_MON 0x0200
#define ATL1C_HIB_DISABLE 0x0400
#define ATL1C_APS_MODE_ENABLE 0x0800
#define ATL1C_LINK_EXT_SYNC 0x1000
#define ATL1C_CLK_GATING_EN 0x2000
#define ATL1C_FPGA_VERSION 0x8000
u16 link_cap_flags;
#define ATL1C_LINK_CAP_1000M 0x0001
u32 smb_timer;
u16 rrd_thresh; /* Threshold of number of RRD produced to trigger
interrupt request */
u16 tpd_thresh;
u8 tpd_burst; /* Number of TPD to prefetch in cache-aligned burst. */
u8 rfd_burst;
u32 base_cpu;
u32 indirect_tab;
u8 mac_addr[ETH_ALEN];
u8 perm_mac_addr[ETH_ALEN];
bool phy_configured;
bool re_autoneg;
bool emi_ca;
bool msi_lnkpatch; /* link patch for specific platforms */
};
/*
* atl1c_ring_header represents a single, contiguous block of DMA space
* mapped for the three descriptor rings (tpd, rfd, rrd) described below
*/
struct atl1c_ring_header {
void *desc; /* virtual address */
dma_addr_t dma; /* physical address*/
unsigned int size; /* length in bytes */
};
/*
* atl1c_buffer is wrapper around a pointer to a socket buffer
* so a DMA handle can be stored along with the skb
*/
struct atl1c_buffer {
struct sk_buff *skb; /* socket buffer */
u16 length; /* rx buffer length */
u16 flags; /* information of buffer */
#define ATL1C_BUFFER_FREE 0x0001
#define ATL1C_BUFFER_BUSY 0x0002
#define ATL1C_BUFFER_STATE_MASK 0x0003
#define ATL1C_PCIMAP_SINGLE 0x0004
#define ATL1C_PCIMAP_PAGE 0x0008
#define ATL1C_PCIMAP_TYPE_MASK 0x000C
#define ATL1C_PCIMAP_TODEVICE 0x0010
#define ATL1C_PCIMAP_FROMDEVICE 0x0020
#define ATL1C_PCIMAP_DIRECTION_MASK 0x0030
dma_addr_t dma;
};
#define ATL1C_SET_BUFFER_STATE(buff, state) do { \
((buff)->flags) &= ~ATL1C_BUFFER_STATE_MASK; \
((buff)->flags) |= (state); \
} while (0)
#define ATL1C_SET_PCIMAP_TYPE(buff, type, direction) do { \
((buff)->flags) &= ~ATL1C_PCIMAP_TYPE_MASK; \
((buff)->flags) |= (type); \
((buff)->flags) &= ~ATL1C_PCIMAP_DIRECTION_MASK; \
((buff)->flags) |= (direction); \
} while (0)
/* transimit packet descriptor (tpd) ring */
struct atl1c_tpd_ring {
void *desc; /* descriptor ring virtual address */
dma_addr_t dma; /* descriptor ring physical address */
u16 size; /* descriptor ring length in bytes */
u16 count; /* number of descriptors in the ring */
u16 next_to_use;
atomic_t next_to_clean;
struct atl1c_buffer *buffer_info;
};
/* receive free descriptor (rfd) ring */
struct atl1c_rfd_ring {
void *desc; /* descriptor ring virtual address */
dma_addr_t dma; /* descriptor ring physical address */
u16 size; /* descriptor ring length in bytes */
u16 count; /* number of descriptors in the ring */
u16 next_to_use;
u16 next_to_clean;
struct atl1c_buffer *buffer_info;
};
/* receive return descriptor (rrd) ring */
struct atl1c_rrd_ring {
void *desc; /* descriptor ring virtual address */
dma_addr_t dma; /* descriptor ring physical address */
u16 size; /* descriptor ring length in bytes */
u16 count; /* number of descriptors in the ring */
u16 next_to_use;
u16 next_to_clean;
};
/* board specific private data structure */
struct atl1c_adapter {
struct net_device *netdev;
struct pci_dev *pdev;
struct napi_struct napi;
struct page *rx_page;
unsigned int rx_page_offset;
unsigned int rx_frag_size;
struct atl1c_hw hw;
struct atl1c_hw_stats hw_stats;
struct mii_if_info mii; /* MII interface info */
u16 rx_buffer_len;
unsigned long flags;
#define __AT_TESTING 0x0001
#define __AT_RESETTING 0x0002
#define __AT_DOWN 0x0003
unsigned long work_event;
#define ATL1C_WORK_EVENT_RESET 0
#define ATL1C_WORK_EVENT_LINK_CHANGE 1
u32 msg_enable;
bool have_msi;
u32 wol;
u16 link_speed;
u16 link_duplex;
spinlock_t mdio_lock;
atomic_t irq_sem;
struct work_struct common_task;
struct timer_list watchdog_timer;
struct timer_list phy_config_timer;
/* All Descriptor memory */
struct atl1c_ring_header ring_header;
struct atl1c_tpd_ring tpd_ring[AT_MAX_TRANSMIT_QUEUE];
struct atl1c_rfd_ring rfd_ring;
struct atl1c_rrd_ring rrd_ring;
u32 bd_number; /* board number;*/
};
#define AT_WRITE_REG(a, reg, value) ( \
writel((value), ((a)->hw_addr + reg)))
#define AT_WRITE_FLUSH(a) (\
readl((a)->hw_addr))
#define AT_READ_REG(a, reg, pdata) do { \
if (unlikely((a)->hibernate)) { \
readl((a)->hw_addr + reg); \
*(u32 *)pdata = readl((a)->hw_addr + reg); \
} else { \
*(u32 *)pdata = readl((a)->hw_addr + reg); \
} \
} while (0)
#define AT_WRITE_REGB(a, reg, value) (\
writeb((value), ((a)->hw_addr + reg)))
#define AT_READ_REGB(a, reg) (\
readb((a)->hw_addr + reg))
#define AT_WRITE_REGW(a, reg, value) (\
writew((value), ((a)->hw_addr + reg)))
#define AT_READ_REGW(a, reg, pdata) do { \
if (unlikely((a)->hibernate)) { \
readw((a)->hw_addr + reg); \
*(u16 *)pdata = readw((a)->hw_addr + reg); \
} else { \
*(u16 *)pdata = readw((a)->hw_addr + reg); \
} \
} while (0)
#define AT_WRITE_REG_ARRAY(a, reg, offset, value) ( \
writel((value), (((a)->hw_addr + reg) + ((offset) << 2))))
#define AT_READ_REG_ARRAY(a, reg, offset) ( \
readl(((a)->hw_addr + reg) + ((offset) << 2)))
extern char atl1c_driver_name[];
extern char atl1c_driver_version[];
void atl1c_reinit_locked(struct atl1c_adapter *adapter);
s32 atl1c_reset_hw(struct atl1c_hw *hw);
void atl1c_set_ethtool_ops(struct net_device *netdev);
#endif /* _ATL1C_H_ */
| {
"pile_set_name": "Github"
} |
/*! \file SafeRegionAnalysis.h
\author Gregory Diamos <[email protected]>
\date Friday May 4, 2012
\brief The header file for the SafeRegionAnalysis class.
*/
#pragma once
// Ocelot Incudes
#include <ocelot/analysis/interface/Analysis.h>
#include <ocelot/ir/interface/ControlFlowGraph.h>
// Standard Library Includes
#include <list>
#include <unordered_map>
namespace analysis
{
/*! \brief A class for tracking program regions that can be safely vectorized */
class SafeRegionAnalysis: public KernelAnalysis
{
public:
typedef ir::ControlFlowGraph CFG;
typedef CFG::const_iterator const_iterator;
typedef CFG::iterator iterator;
class SafeRegion
{
public:
typedef std::list<SafeRegion> SafeRegionList;
public:
SafeRegion(SafeRegion* parent = nullptr);
public:
bool isLeaf() const;
public:
SafeRegion* parent;
SafeRegionList children;
iterator block; // If this is a leaf node, the block
public:
bool doesNotDependOnSideEffects;
};
typedef std::unordered_map<const_iterator, SafeRegion*> SafeRegionMap;
public:
/*! \brief Create the analysis */
SafeRegionAnalysis();
/*! \brief Computes an up to date set of regions */
void analyze(ir::IRKernel& kernel);
public:
/*! \brief Get the region of the specified block */
const SafeRegion* getRegion(const_iterator block) const;
/*! \brief Get the root of the program */
const SafeRegion* getRoot() const;
private:
SafeRegion _root;
SafeRegionMap _regions;
};
}
| {
"pile_set_name": "Github"
} |
<?php
namespace Modules\Edu\Entities;
use App\Traits\Module;
use App\User;
use Illuminate\Database\Eloquent\Model;
/**
* 签到
* @package Modules\Edu\Entities
*/
class Sign extends Model
{
use Module;
protected $table = "edu_sign";
protected $fillable = ['content', 'mood', 'site_id', 'user_id'];
/**
* 用户今日是否签到
* @param User $user
* @return bool
*/
public static function todayIsSign(User $user)
{
return (bool) self::whereDate('created_at', now())->where('user_id', $user['id'])->first();
}
public function user()
{
return $this->belongsTo(User::class);
}
}
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2019 The Brave Authors. All rights reserved.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// you can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef BRAVE_BROWSER_UI_WEBUI_BRAVE_NEW_TAB_MESSAGE_HANDLER_H_
#define BRAVE_BROWSER_UI_WEBUI_BRAVE_NEW_TAB_MESSAGE_HANDLER_H_
#include <string>
#include "brave/browser/tor/tor_launcher_service_observer.h"
#include "components/prefs/pref_change_registrar.h"
#include "content/public/browser/web_ui_message_handler.h"
class Profile;
namespace content {
class WebUIDataSource;
}
namespace tor {
class TorProfileService;
} // namespace tor
// Handles messages to and from the New Tab Page javascript
class BraveNewTabMessageHandler : public content::WebUIMessageHandler,
public tor::TorLauncherServiceObserver {
public:
explicit BraveNewTabMessageHandler(Profile* profile);
~BraveNewTabMessageHandler() override;
static BraveNewTabMessageHandler* Create(
content::WebUIDataSource* html_source, Profile* profile);
private:
// WebUIMessageHandler implementation.
void RegisterMessages() override;
void OnJavascriptAllowed() override;
void OnJavascriptDisallowed() override;
void HandleGetPreferences(const base::ListValue* args);
void HandleGetStats(const base::ListValue* args);
void HandleGetPrivateProperties(const base::ListValue* args);
void HandleGetTorProperties(const base::ListValue* args);
void HandleSaveNewTabPagePref(const base::ListValue* args);
void HandleToggleAlternativeSearchEngineProvider(
const base::ListValue* args);
void HandleRegisterNewTabPageView(const base::ListValue* args);
void HandleGetBrandedWallpaperData(const base::ListValue* args);
void HandleGetDefaultSuperReferralTopSitesData(const base::ListValue* args);
void OnStatsChanged();
void OnPreferencesChanged();
void OnPrivatePropertiesChanged();
// tor::TorLauncherServiceObserver:
void OnTorCircuitEstablished(bool result) override;
void OnTorInitializing(const std::string& percentage) override;
PrefChangeRegistrar pref_change_registrar_;
// Weak pointer.
Profile* profile_;
tor::TorProfileService* tor_profile_service_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(BraveNewTabMessageHandler);
};
#endif // BRAVE_BROWSER_UI_WEBUI_BRAVE_NEW_TAB_MESSAGE_HANDLER_H_
| {
"pile_set_name": "Github"
} |
require_relative 'test_helper'
class BrowserifyProcessorTest < ActiveSupport::TestCase
def stub_engine_config(hash)
@processor.config = (@processor.config || {}).merge(hash)
end
setup do
@processor = BrowserifyRails::BrowserifyProcessor.new
@processor.file = "empty_module.js"
end
test "should run command without options if none provided" do
stub_engine_config({commandline_options: nil})
assert_equal "", @processor.send(:options)
end
test "should run command without options if empty array provided" do
stub_engine_config({commandline_options: []})
assert_equal "", @processor.send(:options)
end
test "should convert options provided as an array to string" do
stub_engine_config({commandline_options: ["-d", "-i test1.js"]})
assert_equal "-d -i test1.js", @processor.send(:options)
end
test "should allow providing options as a string" do
stub_engine_config({commandline_options: "-d -i test2.js"})
assert_equal "-d -i test2.js", @processor.send(:options)
end
test "should remove duplicate options when provided as an array" do
stub_engine_config({commandline_options: ["-d", "-i test3.js", "-d"]})
assert_equal "-d -i test3.js", @processor.send(:options)
end
test "should allow command line options to be a function" do
stub_engine_config({commandline_options: -> file { ["-d", "-i #{file}"] }})
assert_equal "-d -i empty_module.js", @processor.send(:options)
end
test "should add -d option if current env is in source_maps_env list" do
stub_engine_config({
commandline_options: ["-i test4.js"],
source_map_environments: [Rails.env]
})
assert_equal "-d -i test4.js", @processor.send(:options)
end
test "env should have NODE_ENV set to Rails.application.config.browserify_rails.node_env" do
Rails.application.config.browserify_rails.node_env = "staging"
assert_equal "staging", @processor.send(:env)["NODE_ENV"]
end
test "env should have NODE_ENV default to Rails.env" do
Rails.application.config.browserify_rails.node_env = nil
assert_equal Rails.env, @processor.send(:env)["NODE_ENV"]
end
test "env should have NODE_PATH set to Rails.application.config.assets.paths" do
node_env = @processor.send(:env)["NODE_PATH"]
Rails.application.config.assets.paths.each do |path|
assert_equal true, node_env.include?(path)
end
end
end
| {
"pile_set_name": "Github"
} |
package org.zstack.storage.primary.local;
import org.springframework.beans.factory.annotation.Autowire;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.transaction.annotation.Transactional;
import org.zstack.core.db.DatabaseFacade;
import org.zstack.core.db.Q;
import org.zstack.core.db.SQL;
import org.zstack.core.db.SQLBatch;
import org.zstack.header.storage.primary.PrimaryStorageCapacityUpdaterRunnable;
import org.zstack.header.storage.primary.PrimaryStorageCapacityVO;
import org.zstack.storage.primary.PrimaryStorageCapacityUpdater;
import org.zstack.storage.primary.local.LocalStorageKvmBackend.AgentResponse;
import org.zstack.utils.Utils;
import org.zstack.utils.logging.CLogger;
import javax.persistence.LockModeType;
import javax.persistence.TypedQuery;
import java.util.List;
/**
* Created by frank on 11/10/2015.
*/
@Configurable(preConstruction = true, autowire = Autowire.BY_TYPE)
public class LocalStorageCapacityUpdater {
private static CLogger logger = Utils.getLogger(LocalStorageCapacityUpdater.class);
@Autowired
private DatabaseFacade dbf;
private void updateLocalStorageRef(AgentResponse rsp, LocalStorageHostRefVO ref) {
if (ref.getAvailablePhysicalCapacity() == rsp.getAvailableCapacity()
&& ref.getTotalPhysicalCapacity() == rsp.getTotalCapacity()) {
return;
}
long originalPhysicalTotal = ref.getTotalPhysicalCapacity();
long originalPhysicalAvailable = ref.getAvailablePhysicalCapacity();
ref.setTotalPhysicalCapacity(rsp.getTotalCapacity());
ref.setAvailablePhysicalCapacity(rsp.getAvailableCapacity());
dbf.getEntityManager().merge(ref);
if (logger.isTraceEnabled()) {
logger.trace(String.format("[Local Storage Capacity] changed the physical capacity of the host[uuid:%s] of " +
"the local primary storage[uuid:%s] as:\n" +
"physical total: %s --> %s\n" +
"physical available: %s --> %s\n",
ref.getHostUuid(), ref.getPrimaryStorageUuid(), originalPhysicalTotal, ref.getTotalPhysicalCapacity(),
originalPhysicalAvailable, ref.getAvailablePhysicalCapacity()));
}
}
public void updatePhysicalCapacityByKvmAgentResponse(String psUuid, String hostUuid, AgentResponse rsp) {
new SQLBatch() {
@Override
protected void scripts() {
LocalStorageHostRefVO ref = Q.New(LocalStorageHostRefVO.class).eq(LocalStorageHostRefVO_.primaryStorageUuid, psUuid)
.eq(LocalStorageHostRefVO_.hostUuid, hostUuid).find();
if (ref == null) {
return;
}
final long totalChange = rsp.getTotalCapacity() - ref.getTotalPhysicalCapacity();
final long availChange = rsp.getAvailableCapacity() - ref.getAvailablePhysicalCapacity();
new PrimaryStorageCapacityUpdater(psUuid).run(new PrimaryStorageCapacityUpdaterRunnable() {
@Override
public PrimaryStorageCapacityVO call(PrimaryStorageCapacityVO cap) {
cap.setTotalPhysicalCapacity(cap.getTotalPhysicalCapacity() + totalChange);
cap.setAvailablePhysicalCapacity(cap.getAvailablePhysicalCapacity() + availChange);
return cap;
}
});
updateLocalStorageRef(rsp, ref);
}
}.execute();
}
}
| {
"pile_set_name": "Github"
} |
/*
* This file is part of the HyperGraphDB source distribution. This is copyrighted
* software. For permitted uses, licensing options and redistribution, please see
* the LicensingInformation file at the root level of the distribution.
*
* Copyright (c) 2005-2010 Kobrix Software, Inc. All rights reserved.
*/
package org.hypergraphdb.peer.workflow;
import java.util.UUID;
import org.hypergraphdb.peer.HyperGraphPeer;
public interface TaskFactory
{
TaskActivity<?> newTask(HyperGraphPeer thisPeer, UUID taskId, Object msg);
}
| {
"pile_set_name": "Github"
} |
//
// KSYCtrlView.swift
// KSYLiveDemo_Swift
//
// Created by iVermisseDich on 17/1/10.
// Copyright © 2017年 com.ksyun. All rights reserved.
//
import UIKit
class KSYCtrlView: KSYUIView {
var btnFlash: UIButton?
var btnCameraToggle: UIButton?
var btnQuit: UIButton?
var btnStream: UIButton?
var btnCapture: UIButton?
var lblStat: KSYStateLableView?
var lblNetwork: UILabel?
//背景音乐
//图像和美颜相关
//声音相关: 混音 / 混响 / 耳返等
//其他功能: 比如截屏
var menuBtns: [UIButton]?
//返回菜单页面
var backBtn: UIButton?
private
var _curSubMenuView: KSYUIView?
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
init(menuNames: [String]) {
super.init()
btnFlash = addButton(title: "闪光灯")
btnCameraToggle = addButton(title: "前后摄像头")
btnQuit = addButton(title: "退出")
lblNetwork = addLabel(title: "")
btnStream = addButton(title: "推流")
btnCapture = addButton(title: "采集")
lblStat = KSYStateLableView()
addSubview(lblStat!)
// format
lblNetwork?.textAlignment = .center
// add menu
var btnArray = Array<UIButton>()
for name: String in menuNames {
btnArray.append(addButton(title: name))
}
menuBtns = btnArray
backBtn = addButton(title: "菜单", action: #selector(onBack(sender:)))
backBtn?.isHidden = true
_curSubMenuView = nil
}
override func layoutUI() {
super.layoutUI()
if width < height {
yPos = gap * 5 // skip status
}
putRow(subV: [btnQuit!, btnFlash!, btnCameraToggle!, backBtn!])
putRow(subV: menuBtns!)
hideMenuBtn(bHide: !backBtn!.isHidden)
yPos -= btnH
let freeHgt = height - yPos - btnH - gap
lblStat?.frame = CGRect.init(x: gap, y: yPos, width: winWdt - gap * 2, height: freeHgt)
yPos += freeHgt
// put at bottom
putRow3(subV0: btnCapture!, and: lblNetwork!, and: btnStream!)
if let _ = _curSubMenuView {
_curSubMenuView!.frame = lblStat!.frame
_curSubMenuView!.layoutUI()
}
}
func hideMenuBtn(bHide: Bool) {
backBtn!.isHidden = !bHide // 返回
// hide menu
for btn in menuBtns! {
btn.isHidden = bHide
}
}
func onBack(sender: UIButton) {
if let _ = _curSubMenuView {
_curSubMenuView?.isHidden = true
}
hideMenuBtn(bHide: false)
}
func showSubMenuView(view: KSYUIView) {
_curSubMenuView = view
hideMenuBtn(bHide: true)
view.isHidden = false
view.frame = lblStat!.frame
view.layoutUI()
}
}
| {
"pile_set_name": "Github"
} |
//
// XMLYFMUITests.m
// XMLYFMUITests
//
// Created by East_wu on 16/8/8.
// Copyright © 2016年 East_wu. All rights reserved.
//
#import <XCTest/XCTest.h>
@interface XMLYFMUITests : XCTestCase
@end
@implementation XMLYFMUITests
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
self.continueAfterFailure = NO;
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
[[[XCUIApplication alloc] init] launch];
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample {
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
@end
| {
"pile_set_name": "Github"
} |
import React, { Component } from 'react'
const HIT_TEST_OPTIONS = {
segments: true,
stroke: true,
fill: true,
tolerance: 12,
}
export default function withDeleteTool(WrappedComponent) {
return class extends Component {
mouseDown = (e) => {
this.props.deselectItem()
const hit = e.tool.view._project.hitTest(e.point, HIT_TEST_OPTIONS)
if (hit && hit.item && !hit.item.locked) {
this.props.removeItem(hit.item)
this.props.deselectItem()
}
}
render() {
return (
<WrappedComponent
{...this.props}
deleteToolMouseDown={this.mouseDown}
/>
)
}
}
}
| {
"pile_set_name": "Github"
} |
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_DRIVER', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
//
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];
| {
"pile_set_name": "Github"
} |
<!---
THIS IS AN AUTOGENERATED FILE. EDIT PACKAGES/BOUNDLESS-INPUT/INDEX.JS INSTEAD.
-->
# Input
Input abstracts away the cross-platform differences of placeholder styling and behaviors, for example: Internet Explorer dismisses native placeholders on input focus and other platforms do not. This component ensures that text input controls will feel and behave similarly on more devices.
## Component Instance Methods
When using `Input` in your project, you may call the following methods on a rendered instance of the component. Use [`refs`](https://facebook.github.io/react/docs/refs-and-the-dom.html) to get the instance.
- __getValue()__
returns the current value of the input field
- __setValue(string)__
programmatically set the input value; useful for clearing out the input in "uncontrolled" mode -- note that digging into the internals and setting the `refs.field.value = ''` directly will not trigger events and messes up the internal state of the component
## Installation
```bash
npm i boundless-input --save
```
Then use it like:
```jsx
/** @jsx createElement */
import { createElement, PureComponent } from 'react';
import Input from 'boundless-input';
export default class InputDemo extends PureComponent {
state = {
input: '',
}
handleChange = (e) => this.setState({ input: e.target.value })
render() {
return (
<div className='spread'>
<div>
<h5>hidePlaceholderOnFocus="false"</h5>
<Input
hidePlaceholderOnFocus={false}
inputProps={{
placeholder: 'Start typing and I disappear!',
}} />
</div>
<div style={{ marginLeft: '1em' }}>
<h5>hidePlaceholderOnFocus="true"</h5>
<Input
hidePlaceholderOnFocus={true}
inputProps={{
placeholder: 'Focus on me and I disappear!',
}} />
</div>
<div style={{ marginLeft: '1em' }}>
<h5>"controlled" input</h5>
<Input
hidePlaceholderOnFocus={true}
inputProps={{
placeholder: 'Focus on me and I disappear!',
onChange: this.handleChange,
value: this.state.input,
}} />
</div>
</div>
);
}
}
```
Input can also just be directly used from the main [Boundless library](https://www.npmjs.com/package/boundless). This is recommended when you're getting started to avoid maintaining the package versions of several components:
```bash
npm i boundless --save
```
the ES6 `import` statement then becomes like:
```js
import { Input } from 'boundless';
```
## Props
> Note: only top-level props are in the README, for the full list check out the [website](https://boundless.js.org/Input).
### Required Props
There are no required props.
### Optional Props
- __`*`__ · any [React-supported attribute](https://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes)
Expects | Default Value
--- | ---
`any` | `n/a`
- __`component`__ · overrides the HTML container tag
Expects | Default Value
--- | ---
`string` | `'div'`
- __`hidePlaceholderOnFocus`__ · triggers the placeholder to disappear when the input field is focused, reappears when the user has tabbed away or focus is moved
Expects | Default Value
--- | ---
`bool` | `true`
- __`inputProps`__
Expects | Default Value
--- | ---
`object` | `{ type: 'text' }`
## Reference Styles
### Stylus
You can see what variables are available to override in [variables.styl](https://github.com/enigma-io/boundless/blob/master/variables.styl).
```stylus
// Redefine any variables as desired, e.g:
color-accent = royalblue
// Bring in the component styles; they will be autoconfigured based on the above
@require "node_modules/boundless-input/style"
```
### CSS
If desired, a precompiled plain CSS stylesheet is available for customization at `/build/style.css`, based on Boundless's [default variables](https://github.com/enigma-io/boundless/blob/master/variables.styl).
| {
"pile_set_name": "Github"
} |
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import React from 'react'
import { Menu } from 'semantic-ui-react'
function Sidebar ({ style, ...props }) {
return (
<Menu
inverted vertical borderless attached
style={{ flex: '0 0 auto', width: 'auto', ...style }}
{...props}
/>
)
}
export default Sidebar
| {
"pile_set_name": "Github"
} |
using System.Windows;
using ControlzEx;
namespace MaterialDesignThemes.Wpf
{
/// <summary>
/// Icon from the Material Design Icons project, <see cref="https://materialdesignicons.com/"/>.
/// </summary>
public class PackIcon : PackIconBase<PackIconKind>
{
static PackIcon()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PackIcon), new FrameworkPropertyMetadata(typeof(PackIcon)));
}
public PackIcon() : base(PackIconDataFactory.Create) { }
}
}
| {
"pile_set_name": "Github"
} |
{
"ID": 0,
"Name": "GlassE",
"Top": "4, 14",
"Bottom": "4, 14",
"Sides": "4, 14",
"Transitions": 2,
"HasTransitionTextures": false,
"TransitionTiles": [
"0, 14",
"0, 14",
"0, 14"
],
"ReleasesResource": true,
"ResourceToRelease": "Glass",
"StartingHealth": 1.0,
"ProbabilityOfRelease": 1.0,
"CanRamp": false,
"IsBuildable": true,
"ParticleType": "stone_particle",
"EmitsLight": false,
"MinSpawnHeight": -999.0,
"MaxSpawnHeight": 999.0,
"SpawnProbability": 1.0,
"Rarity": 1.0,
"SpawnClusters": false,
"IsSoil": false,
"IsSurface": false,
"IsInvincible": false,
"Tint": "255, 255, 255, 255",
"SpawnOnSurface": false,
"IsTransparent": true,
"ExplosionSoundResource": "Audio\\oscar\\sfx_env_voxel_metal_destroy",
"HitSoundResources": [
"Audio\\oscar\\sfx_ic_dwarf_pick_stone_1",
"Audio\\oscar\\sfx_ic_dwarf_pick_stone_2",
"Audio\\oscar\\sfx_ic_dwarf_pick_stone_3"
],
"MinimapColor": "255,255,255,255"
} | {
"pile_set_name": "Github"
} |
// Copyright 2018 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 !go1.12
package socket
import (
"syscall"
"unsafe"
)
func getsockopt(s uintptr, level, name int, b []byte) (int, error) {
l := uint32(len(b))
_, _, errno := syscall.Syscall6(syscall.SYS_GETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(unsafe.Pointer(&l)), 0)
return int(l), errnoErr(errno)
}
func setsockopt(s uintptr, level, name int, b []byte) error {
_, _, errno := syscall.Syscall6(syscall.SYS_SETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), 0)
return errnoErr(errno)
}
func recvmsg(s uintptr, h *msghdr, flags int) (int, error) {
n, _, errno := syscall.Syscall(syscall.SYS_RECVMSG, s, uintptr(unsafe.Pointer(h)), uintptr(flags))
return int(n), errnoErr(errno)
}
func sendmsg(s uintptr, h *msghdr, flags int) (int, error) {
n, _, errno := syscall.Syscall(syscall.SYS_SENDMSG, s, uintptr(unsafe.Pointer(h)), uintptr(flags))
return int(n), errnoErr(errno)
}
| {
"pile_set_name": "Github"
} |
{% set version = "1.0.22" %}
package:
name: ipaddress
version: {{ version }}
source:
url: https://pypi.io/packages/source/i/ipaddress/ipaddress-{{ version }}.tar.gz
sha256: b146c751ea45cad6188dd6cf2d9b757f6f4f8d6ffb96a023e6f2e26eea02a72c
build:
number: 1
noarch: python
script: python -m pip install --no-deps --ignore-installed .
requirements:
build:
- python <=3.3
- pip
run:
- python <=3.3
test:
imports:
- ipaddress
about:
home: https://github.com/phihag/ipaddress
license: PSF 2
license_file: LICENSE
summary: 'IPv4/IPv6 manipulation library'
extra:
recipe-maintainers:
- jakirkham
- ocefpaf
| {
"pile_set_name": "Github"
} |
// compile
// Copyright 2012 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.
// Issue 4399: 8g would print "gins LEAQ nil *A".
package main
type A struct{ a int }
func main() {
println(((*A)(nil)).a)
}
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.