text
stringlengths 2
99.9k
| meta
dict |
---|---|
/* Generated by RuntimeBrowser
Image: /System/Library/PrivateFrameworks/OfficeImport.framework/OfficeImport
*/
@interface CMDiagramPointContinuousArrowMapper : CMDiagramPointMapper {
bool mIsArrow;
}
- (void)mapAt:(id)arg1 withState:(id)arg2;
- (void)setIsArrow:(bool)arg1;
@end
| {
"pile_set_name": "Github"
} |
from pylab import imread, subplot, imshow, title, gray, figure, show, NullLocator
from numpy import mean, cov, dot, linalg, size, argsort
def princomp(A, numpc=0):
# computing eigenvalues and eigenvectors of covariance matrix
M = (A-mean(A.T,axis=1)).T # subtract the mean (along columns)
[latent,coeff] = linalg.eig(cov(M))
p = size(coeff,axis=1)
idx = argsort(latent) # sorting the eigenvalues
idx = idx[::-1] # in ascending order
# sorting eigenvectors according to the sorted eigenvalues
coeff = coeff[:,idx]
latent = latent[idx] # sorting eigenvalues
if numpc < p and numpc >= 0:
coeff = coeff[:,range(numpc)] # cutting some PCs if needed
score = dot(coeff.T,M) # projection of the data in the new space
return coeff,score,latent
A = imread('../data/shakira.png') # load an image
A = mean(A,2) # to get a 2-D array
full_pc = size(A,axis=1) # numbers of all the principal components
i = 1
dist = []
for numpc in range(0,full_pc+10,10): # 0 10 20 ... full_pc
coeff, score, latent = princomp(A,numpc)
Ar = dot(coeff,score).T+mean(A,axis=0) # image reconstruction
# difference in Frobenius norm
dist.append(linalg.norm(A-Ar,'fro'))
# showing the pics reconstructed with less than 50 PCs
print "trying %s principal components with a distance of: %f"%(numpc,dist[-1])
if numpc <= 50:
ax = subplot(2,3,i,frame_on=False)
ax.xaxis.set_major_locator(NullLocator()) # remove ticks
ax.yaxis.set_major_locator(NullLocator())
i += 1
imshow(Ar)
title('PCs # '+str(numpc))
gray()
figure()
imshow(A)
title('numpc FULL')
gray()
show()
| {
"pile_set_name": "Github"
} |
# Linux Minidump to Core
On Linux, Chromium can use Breakpad to generate minidump files for crashes. It
is possible to convert the minidump files to core files, and examine the core
file in gdb, cgdb, or Qtcreator. In the examples below cgdb is assumed but any
gdb based debugger can be used.
[TOC]
## Creating the core file
Use `minidump-2-core` to convert the minidump file to a core file. On Linux, one
can build the minidump-2-core target in a Chromium checkout, or alternatively,
build it in a Google Breakpad checkout.
```shell
$ ninja -C out/Release minidump-2-core
$ ./out/Release/minidump-2-core foo.dmp > foo.core
```
## Retrieving Chrome binaries
If the minidump is from a public build then Googlers can find Google Chrome
Linux binaries and debugging symbols via https://goto.google.com/chromesymbols.
Otherwise, use the locally built chrome files. Google Chrome uses the
_debug link_ method to specify the debugging file. Either way be sure to put
`chrome` and `chrome.debug` (the stripped debug information) in the same
directory as the core file so that the debuggers can find them.
For Chrome OS release binaries look for `debug-*.tgz` files on
GoldenEye.
## Loading the core file into gdb/cgdb
The recommended syntax for loading a core file into gdb/cgdb is as follows,
specifying both the executable and the core file:
```shell
$ cgdb chrome foo.core
```
If the executable is not available then the core file can be loaded on its own
but debugging options will be limited:
```shell
$ cgdb -c foo.core
```
## Loading the core file into Qtcreator
Qtcreator is a full GUI wrapper for gdb and it can also load Chrome's core
files. From Qtcreator select the Debug menu, Start Debugging, Load Core File...
and then enter the paths to the core file and executable. Qtcreator has windows
to display the call stack, locals, registers, etc. For more information on
debugging with Qtcreator see
[Getting Started Debugging on Linux.](https://www.youtube.com/watch?v=xTmAknUbpB0)
## Source debugging
If you have a Chromium repo that is synchronized to exactly (or even
approximately) when the Chrome build was created then you can tell
`gdb/cgdb/Qtcreator` to load source code. Since all source paths in Chrome are
relative to the out/Release directory you just need to add that directory to
your debugger search path, by adding a line similar to this to `~/.gdbinit`:
```
(gdb) directory /usr/local/chromium/src/out/Release/
```
## Notes
* Since the core file is created from a minidump, it is incomplete and the
debugger may not know values for variables in memory. Minidump files contain
thread stacks so local variables and function parameters should be
available, subject to the limitations of optimized builds.
* For gdb's `add-symbol-file` command to work, the file must have debugging
symbols.
* In case of separate debug files,
[the gdb manual](https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html)
explains how gdb looks for them.
* If the stack trace involve system libraries, the Advanced module loading
steps shown below need to be repeated for each library.
## Advanced module loading
If gdb doesn't find shared objects that are needed you can force it to load
them. In gdb, the `add-symbol-file` command takes a filename and an address. To
figure out the address, look near the end of `foo.dmp`, which contains a copy of
`/proc/pid/maps` from the process that crashed.
One quick way to do this is with `grep`. For instance, if the executable is
`/path/to/chrome`, one can simply run:
```shell
$ grep -a /path/to/chrome$ foo.dmp
7fe749a90000-7fe74d28f000 r-xp 00000000 08:07 289158 /path/to/chrome
7fe74d290000-7fe74d4b7000 r--p 037ff000 08:07 289158 /path/to/chrome
7fe74d4b7000-7fe74d4e0000 rw-p 03a26000 08:07 289158 /path/to/chrome
```
In this case, `7fe749a90000` is the base address for `/path/to/chrome`, but gdb
takes the start address of the file's text section. To calculate this, one will
need a copy of `/path/to/chrome`, and run:
```shell
$ objdump -x /path/to/chrome | grep '\.text' | head -n 1 | tr -s ' ' | \
cut -d' ' -f 7
005282c0
```
Now add the two addresses: `7fe749a90000 + 005282c0 = 7fe749fb82c0` and in gdb, run:
```
(gdb) add-symbol-file /path/to/chrome 0x7fe749fb82c0
```
Then use gdb as normal.
## Other resources
For more discussion on this process see
[Debugging a Minidump].
This page discusses the same process in the context of Chrome OS and many of the
concepts and techniques overlap.
[Debugging a Minidump](
https://www.chromium.org/chromium-os/packages/crash-reporting/debugging-a-minidump)
| {
"pile_set_name": "Github"
} |
diff -up qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/WebCore/WebCore.pri.webkit_debuginfo qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/WebCore/WebCore.pri
--- qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/WebCore/WebCore.pri.webkit_debuginfo 2013-06-07 00:16:55.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/WebCore/WebCore.pri 2013-07-11 14:04:19.937056249 -0500
@@ -5,6 +5,12 @@ include(features.pri)
# Uncomment this to enable Texture Mapper.
# CONFIG += texmap
+#
+equals(QT_ARCH, s390)|equals(QT_ARCH, arm)|equals(QT_ARCH, mips)|equals(QT_ARCH, i386)|equals(QT_ARCH, i686)|equals(QT_ARCH, x86_64)|equals(QT_ARCH, powerpc64)|equals(QT_ARCH, powerpc) {
+ message("WebCore workaround for QtWebkit: do not build with -g, but with -g1")
+ QMAKE_CXXFLAGS_RELEASE -= -g
+ QMAKE_CXXFLAGS_RELEASE += -g1
+}
QT *= network
| {
"pile_set_name": "Github"
} |
# Status Audio BT One (wired)
See [usage instructions](https://github.com/jaakkopasanen/AutoEq#usage) for more options and info.
### Parametric EQs
In case of using parametric equalizer, apply preamp of **-5.0dB** and build filters manually
with these parameters. The first 5 filters can be used independently.
When using independent subset of filters, apply preamp of **-5.0dB**.
| Type | Fc | Q | Gain |
|:--------|:---------|:-----|:--------|
| Peaking | 595 Hz | 1.93 | 0.4 dB |
| Peaking | 597 Hz | 2.11 | -6.5 dB |
| Peaking | 2334 Hz | 2.08 | 3.0 dB |
| Peaking | 8505 Hz | 1.36 | 3.8 dB |
| Peaking | 13030 Hz | 1.48 | 2.9 dB |
| Peaking | 17 Hz | 1.66 | 3.2 dB |
| Peaking | 99 Hz | 0.85 | -2.3 dB |
| Peaking | 290 Hz | 2.9 | 2.3 dB |
| Peaking | 5213 Hz | 3.44 | 2.5 dB |
| Peaking | 6351 Hz | 6.18 | -3.3 dB |
### Fixed Band EQs
In case of using fixed band (also called graphic) equalizer, apply preamp of **-5.1dB**
(if available) and set gains manually with these parameters.
| Type | Fc | Q | Gain |
|:--------|:---------|:-----|:--------|
| Peaking | 31 Hz | 1.41 | 1.0 dB |
| Peaking | 62 Hz | 1.41 | -1.3 dB |
| Peaking | 125 Hz | 1.41 | -2.6 dB |
| Peaking | 250 Hz | 1.41 | 2.6 dB |
| Peaking | 500 Hz | 1.41 | -4.9 dB |
| Peaking | 1000 Hz | 1.41 | -1.2 dB |
| Peaking | 2000 Hz | 1.41 | 2.4 dB |
| Peaking | 4000 Hz | 1.41 | 0.5 dB |
| Peaking | 8000 Hz | 1.41 | 4.3 dB |
| Peaking | 16000 Hz | 1.41 | 2.3 dB |
### Graphs
.png) | {
"pile_set_name": "Github"
} |
export * from './Suggestions/Suggestions';
export * from './Suggestions/Suggestions.types';
export * from './Suggestions/SuggestionsItem';
export * from './Suggestions/SuggestionsItem.types';
export * from './Suggestions/SuggestionsController';
export * from './AutoFill/BaseAutoFill';
export * from './AutoFill/BaseAutoFill.types';
export * from './BasePicker';
export * from './BasePicker.types';
export * from './PickerItem.types';
export * from './PeoplePicker/PeoplePicker';
export * from './PeoplePicker/PeoplePickerItems/PeoplePickerItem.types';
export * from './PeoplePicker/PeoplePickerItems/PeoplePickerItem';
export * from './PeoplePicker/PeoplePickerItems/PeoplePickerItemSuggestion';
export * from './TagPicker/TagPicker';
export * from './TagPicker/TagPicker.types';
export * from './TagPicker/TagItem';
export * from './TagPicker/TagItemSuggestion';
| {
"pile_set_name": "Github"
} |
# =========== 缓存监控 ===========
缓存列表=Cache list
键名列表=Key list
缓存内容=Cache content
清理全部缓存=Clear all caches
清理全部缓存,包括属性文件的配置=Clear all caches, including configuration of properties files
缓存名称=Cache name
缓存键名=Cache key
清理缓存=Clear cache
确认要清理该缓存吗?=Are you sure you want to clear up the cache?
缓存列表刷新完成=The cache list refresh is complete
# =========== 服务器监控 ===========
属性=Property
值=Value
核心数=Core number
最大功率=Maximum power
实时频率=Current frequency
使用率=Used rate
内存=Memory
总内存=The total memory
剩余内存=Remaining memory
已用内存=Used memory
堆/非堆=Heap/non-heap
执行垃圾回收任务=Perform garbage collection task
堆=Heap
非堆=Non-heap
初始大小=Initial size
最大内存=Maximum memory
已用内存=Used memory
可用内存=Available memory
服务器信息=Server information
服务器名称=Server name
操作系统=Operating system
版本=Version
服务器IP=Server IP
系统架构=System architecture
Java虚拟机信息=JVM information
Java名称=Java name
Java版本=Java version
供应商=Vendor
启动时间=Start time
运行时长=Running time
安装路径=Install path
启动参数=Start parameter
平台参数=Platform parameter
当前工作路径=Current working path
日志存放路径=Log storage path
上传文件路径=Upload file path
磁盘状态=Disk status
盘符路径=Disk path
文件系统=File system
盘符类型=Disk type
总大小=Total size
可用大小=Available size
已用大小=Used size
已用百分比=Percent used
执行垃圾回收任务=Perform garbage collection tasks
发起执行垃圾回收任务成功=Initiated garbage collection task successfully
| {
"pile_set_name": "Github"
} |
// -*- mode:doc; -*-
// vim: set syntax=asciidoc:
== General Buildroot usage
include::make-tips.txt[]
include::rebuilding-packages.txt[]
=== Offline builds
If you intend to do an offline build and just want to download
all sources that you previously selected in the configurator
('menuconfig', 'nconfig', 'xconfig' or 'gconfig'), then issue:
--------------------
$ make source
--------------------
You can now disconnect or copy the content of your +dl+
directory to the build-host.
=== Building out-of-tree
As default, everything built by Buildroot is stored in the directory
+output+ in the Buildroot tree.
Buildroot also supports building out of tree with a syntax similar to
the Linux kernel. To use it, add +O=<directory>+ to the make command
line:
--------------------
$ make O=/tmp/build
--------------------
Or:
--------------------
$ cd /tmp/build; make O=$PWD -C path/to/buildroot
--------------------
All the output files will be located under +/tmp/build+. If the +O+
path does not exist, Buildroot will create it.
*Note:* the +O+ path can be either an absolute or a relative path, but if it's
passed as a relative path, it is important to note that it is interpreted
relative to the main Buildroot source directory, *not* the current working
directory.
When using out-of-tree builds, the Buildroot +.config+ and temporary
files are also stored in the output directory. This means that you can
safely run multiple builds in parallel using the same source tree as
long as they use unique output directories.
For ease of use, Buildroot generates a Makefile wrapper in the output
directory - so after the first run, you no longer need to pass +O=<...>+
and +-C <...>+, simply run (in the output directory):
--------------------
$ make <target>
--------------------
[[env-vars]]
=== Environment variables
Buildroot also honors some environment variables, when they are passed
to +make+ or set in the environment:
* +HOSTCXX+, the host C++ compiler to use
* +HOSTCC+, the host C compiler to use
* +UCLIBC_CONFIG_FILE=<path/to/.config>+, path to
the uClibc configuration file, used to compile uClibc, if an
internal toolchain is being built.
+
Note that the uClibc configuration file can also be set from the
configuration interface, so through the Buildroot +.config+ file; this
is the recommended way of setting it.
+
* +BUSYBOX_CONFIG_FILE=<path/to/.config>+, path to
the BusyBox configuration file.
+
Note that the BusyBox configuration file can also be set from the
configuration interface, so through the Buildroot +.config+ file; this
is the recommended way of setting it.
+
* +BR2_CCACHE_DIR+ to override the directory where
Buildroot stores the cached files when using ccache.
+
* +BR2_DL_DIR+ to override the directory in which
Buildroot stores/retrieves downloaded files
+
Note that the Buildroot download directory can also be set from the
configuration interface, so through the Buildroot +.config+ file. See
xref:download-location[] for more details on how you can set the download
directory.
* +BR2_GRAPH_ALT+, if set and non-empty, to use an alternate color-scheme in
build-time graphs
* +BR2_GRAPH_OUT+ to set the filetype of generated graphs, either +pdf+ (the
default), or +png+.
* +BR2_GRAPH_DEPS_OPTS+ to pass extra options to the dependency graph; see
xref:graph-depends[] for the accepted options
* +BR2_GRAPH_DOT_OPTS+ is passed verbatim as options to the +dot+ utility to
draw the dependency graph.
An example that uses config files located in the toplevel directory and
in your $HOME:
--------------------
$ make UCLIBC_CONFIG_FILE=uClibc.config BUSYBOX_CONFIG_FILE=$HOME/bb.config
--------------------
If you want to use a compiler other than the default +gcc+
or +g+++ for building helper-binaries on your host, then do
--------------------
$ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD
--------------------
=== Dealing efficiently with filesystem images
Filesystem images can get pretty big, depending on the filesystem you choose,
the number of packages, whether you provisioned free space... Yet, some
locations in the filesystems images may just be _empty_ (e.g. a long run of
'zeroes'); such a file is called a _sparse_ file.
Most tools can handle sparse files efficiently, and will only store or write
those parts of a sparse file that are not empty.
For example:
* +tar+ accepts the +-S+ option to tell it to only store non-zero blocks
of sparse files:
** +tar cf archive.tar -S [files...]+ will efficiently store sparse files
in a tarball
** +tar xf archive.tar -S+ will efficiently store sparse files extracted
from a tarball
* +cp+ accepts the +--sparse=WHEN+ option (+WHEN+ is one of +auto+,
+never+ or +always+):
** +cp --sparse=always source.file dest.file+ will make +dest.file+ a
sparse file if +source.file+ has long runs of zeroes
Other tools may have similar options. Please consult their respective man
pages.
You can use sparse files if you need to store the filesystem images (e.g.
to transfer from one machine to another), or if you need to send them (e.g.
to the Q&A team).
Note however that flashing a filesystem image to a device while using the
sparse mode of +dd+ may result in a broken filesystem (e.g. the block bitmap
of an ext2 filesystem may be corrupted; or, if you have sparse files in
your filesystem, those parts may not be all-zeroes when read back). You
should only use sparse files when handling files on the build machine, not
when transferring them to an actual device that will be used on the target.
=== Graphing the dependencies between packages
[[graph-depends]]
One of Buildroot's jobs is to know the dependencies between packages,
and make sure they are built in the right order. These dependencies
can sometimes be quite complicated, and for a given system, it is
often not easy to understand why such or such package was brought into
the build by Buildroot.
In order to help understanding the dependencies, and therefore better
understand what is the role of the different components in your
embedded Linux system, Buildroot is capable of generating dependency
graphs.
To generate a dependency graph of the full system you have compiled,
simply run:
------------------------
make graph-depends
------------------------
You will find the generated graph in
+output/graphs/graph-depends.pdf+.
If your system is quite large, the dependency graph may be too complex
and difficult to read. It is therefore possible to generate the
dependency graph just for a given package:
------------------------
make <pkg>-graph-depends
------------------------
You will find the generated graph in
+output/graph/<pkg>-graph-depends.pdf+.
Note that the dependency graphs are generated using the +dot+ tool
from the _Graphviz_ project, which you must have installed on your
system to use this feature. In most distributions, it is available as
the +graphviz+ package.
By default, the dependency graphs are generated in the PDF
format. However, by passing the +BR2_GRAPH_OUT+ environment variable, you
can switch to other output formats, such as PNG, PostScript or
SVG. All formats supported by the +-T+ option of the +dot+ tool are
supported.
--------------------------------
BR2_GRAPH_OUT=svg make graph-depends
--------------------------------
The +graph-depends+ behaviour can be controlled by setting options in the
+BR2_GRAPH_DEPS_OPTS+ environment variable. The accepted options are:
* +--depth N+, +-d N+, to limit the dependency depth to +N+ levels. The
default, +0+, means no limit.
* +--stop-on PKG+, +-s PKG+, to stop the graph on the package +PKG+.
+PKG+ can be an actual package name, a glob, the keyword 'virtual'
(to stop on virtual packages), or the keyword 'host' (to stop on
host packages). The package is still present on the graph, but its
dependencies are not.
* +--exclude PKG+, +-x PKG+, like +--stop-on+, but also omits +PKG+ from
the graph.
* +--transitive+, +--no-transitive+, to draw (or not) the transitive
dependencies. The default is to not draw transitive dependencies.
* +--colours R,T,H+, the comma-separated list of colours to draw the
root package (+R+), the target packages (+T+) and the host packages
(+H+). Defaults to: +lightblue,grey,gainsboro+
--------------------------------
BR2_GRAPH_DEPS_OPTS='-d 3 --no-transitive --colours=red,green,blue' make graph-depends
--------------------------------
=== Graphing the build duration
[[graph-duration]]
When the build of a system takes a long time, it is sometimes useful
to be able to understand which packages are the longest to build, to
see if anything can be done to speed up the build. In order to help
such build time analysis, Buildroot collects the build time of each
step of each package, and allows to generate graphs from this data.
To generate the build time graph after a build, run:
----------------
make graph-build
----------------
This will generate a set of files in +output/graphs+ :
* +build.hist-build.pdf+, a histogram of the build time for each
package, ordered in the build order.
* +build.hist-duration.pdf+, a histogram of the build time for each
package, ordered by duration (longest first)
* +build.hist-name.pdf+, a histogram of the build time for each
package, order by package name.
* +build.pie-packages.pdf+, a pie chart of the build time per package
* +build.pie-steps.pdf+, a pie chart of the global time spent in each
step of the packages build process.
This +graph-build+ target requires the Python Matplotlib and Numpy
libraries to be installed (+python-matplotlib+ and +python-numpy+ on
most distributions), and also the +argparse+ module if you're using a
Python version older than 2.7 (+python-argparse+ on most
distributions).
By default, the output format for the graph is PDF, but a different
format can be selected using the +BR2_GRAPH_OUT+ environment variable. The
only other format supported is PNG:
----------------
BR2_GRAPH_OUT=png make graph-build
----------------
=== Graphing the filesystem size contribution of packages
When your target system grows, it is sometimes useful to understand
how much each Buildroot package is contributing to the overall root
filesystem size. To help with such an analysis, Buildroot collects
data about files installed by each package and using this data,
generates a graph and CSV files detailing the size contribution of
the different packages.
To generate these data after a build, run:
----------------
make graph-size
----------------
This will generate:
* +output/graphs/graph-size.pdf+, a pie chart of the contribution of
each package to the overall root filesystem size
* +output/graphs/package-size-stats.csv+, a CSV file giving the size
contribution of each package to the overall root filesystem size
* +output/graphs/file-size-stats.csv+, a CSV file giving the size
contribution of each installed file to the package it belongs, and
to the overall filesystem size.
This +graph-size+ target requires the Python Matplotlib library to be
installed (+python-matplotlib+ on most distributions), and also the
+argparse+ module if you're using a Python version older than 2.7
(+python-argparse+ on most distributions).
Just like for the duration graph, a +BR2_GRAPH_OUT+ environment is
supported to adjust the output file format. See xref:graph-depends[]
for details about this environment variable.
.Note
The collected filesystem size data is only meaningful after a complete
clean rebuild. Be sure to run +make clean all+ before using +make
graph-size+.
To compare the root filesystem size of two different Buildroot compilations,
for example after adjusting the configuration or when switching to another
Buildroot release, use the +size-stats-compare+ script. It takes two
+file-size-stats.csv+ files (produced by +make graph-size+) as input.
Refer to the help text of this script for more details:
----------------
utils/size-stats-compare -h
----------------
include::eclipse-integration.txt[]
include::advanced.txt[]
| {
"pile_set_name": "Github"
} |
-----BEGIN ENCRYPTED PRIVATE KEY-----
MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIPdiqWIn1vvgCAggA
MBQGCCqGSIb3DQMHBAiynzaBbdk2NASCAoCQTiraFGsSnahi7LJ/rvvBHMKF30M9
5Zl5XeRlNej+JP5d3O8T4vEV3i4Sg9HjYN9GyWylxXmUHMxqq+6HMEaQ2cY1P9Q8
d2STHc2Tt0vQhlZ2iP2z7sL8II+6Ei3hhST10cvgtqD+H+uyWAWmq+6a99Pzitpl
6Mj0QdW+X3iF57iBkBdCOVjjRqgLKEjTJQkAFdyFcYhC+xtPmOMapaBvyiKM2vvf
mBJQtBz1VeTrwsxYJFIwSmqOCuX13X2qTm+rzkyHwtQHwxHvO8dJWUJ+wGjdE9JK
DuZ9h3O34TPXufPsa68VizM5v8ArjpyPJtwqx7LIBQuj9m8X+G9fzm+9HFcwFHy3
+XPwfgmJHbf2iEO6thsICsLshtMjJgLrqQSBBA+XEpkFLmOhlxwxgVKFk30w3xd6
q2b+TCWaDvSCSZE3DyPuCkDw2gDvC3YD6I5qjd243e2mxrfnyX4F4jMTrt9v+uDJ
LeXo7vKn+PU0nhqDr7MkbuoO7seum77XFtTAEJBVBqYx9pekVT+vnINXpQqx0VPP
R0Do4rVt9c2McLeGb3I4/Aa8Z6LhdN/6fS9Hb6DTzzNFbzui5dHjBeMAxLDPESqW
1mGR98yZkVeFq2nRYbzmb/67lACfATz4XsvwwrM5useFWryxIPFxICUZ+FfONY+S
TYlXJMqXWDj8siZt8V9lHtV2kfyaTyN4CutTGGRGBTYrPFIJf+s2oOYPboBUcoWu
G01PQF0hXaxNQYfqIx8kzyLuvW7sqfQ/AKFF6yAkmq3qvcsCgNDgE7HTIlUMlxuw
5/RGmGQZ1xzjhVKUqKB1+rNtth/bAEOtOStea6nogH/oek6DRsB3FrPP
-----END ENCRYPTED PRIVATE KEY-----
| {
"pile_set_name": "Github"
} |
<?php
namespace Biz\MoneyCard\Service\Impl;
use Biz\BaseService;
use Biz\MoneyCard\Dao\MoneyCardBatchDao;
use Biz\MoneyCard\Dao\MoneyCardDao;
use Biz\MoneyCard\Service\MoneyCardService;
use AppBundle\Common\ArrayToolkit;
class MoneyCardServiceImpl extends BaseService implements MoneyCardService
{
public function getMoneyCard($id, $lock = false)
{
return $this->getMoneyCardDao()->get($id, array('lock' => $lock));
}
public function getMoneyCardByIds($ids)
{
return $this->getMoneyCardDao()->getMoneyCardByIds($ids);
}
public function getMoneyCardByPassword($password)
{
return $this->getMoneyCardDao()->getMoneyCardByPassword($password);
}
public function getBatch($id)
{
return $this->getMoneyCardBatchDao()->get($id);
}
public function searchMoneyCards(array $conditions, array $oderBy, $start, $limit)
{
return $this->getMoneyCardDao()->search($conditions, $oderBy, $start, $limit);
}
public function countMoneyCards(array $conditions)
{
return $this->getMoneyCardDao()->count($conditions);
}
public function searchBatches(array $conditions, array $oderBy, $start, $limit)
{
return $this->getMoneyCardBatchDao()->search($conditions, $oderBy, $start, $limit);
}
public function countBatches(array $conditions)
{
return $this->getMoneyCardBatchDao()->count($conditions);
}
public function createMoneyCard(array $moneyCardData)
{
$batch = ArrayToolkit::parts($moneyCardData, array(
'money',
'coin',
'cardPrefix',
'cardLength',
'number',
'note',
'deadline',
'batchName',
));
if (isset($batch['money'])) {
$batch['money'] = (int) $batch['money'];
}
if (isset($batch['coin'])) {
$batch['coin'] = (int) $batch['coin'];
}
if (isset($batch['cardLength'])) {
$batch['cardLength'] = (int) $batch['cardLength'];
}
if (isset($batch['number'])) {
$batch['number'] = (int) $batch['number'];
}
if (isset($batch['money']) && $batch['money'] <= 0) {
throw $this->createServiceException('ERROR! Money Value Less Than Zero!');
}
if (isset($batch['coin']) && $batch['coin'] <= 0) {
throw $this->createServiceException('ERROR! Coin Value Less Than Zero!');
}
if (isset($batch['cardLength']) && $batch['cardLength'] <= 0) {
throw $this->createServiceException('ERROR! CardLength Less Than Zero!');
}
if (isset($batch['number']) && $batch['number'] <= 0) {
throw $this->createServiceException('ERROR! Card Number Less Than Zero!');
}
$batch['rechargedNumber'] = 0;
$batch['userId'] = $this->getCurrentUser()->id;
$batch['createdTime'] = time();
$batch['deadline'] = date('Y-m-d', strtotime($batch['deadline']));
$moneyCardIds = $this->makeRands($batch['cardLength'], $batch['number'], $batch['cardPrefix'], $moneyCardData['passwordLength']);
if (!$this->getMoneyCardDao()->isCardIdAvailable(array_keys($moneyCardIds))) {
throw $this->createServiceException('卡号有重复,生成失败,请重新生成!');
}
$token = $this->getTokenService()->makeToken('money_card', array(
'duration' => strtotime($batch['deadline']) + 24 * 60 * 60 - time(),
));
$batch['token'] = $token['token'];
$batch = $this->getMoneyCardBatchDao()->create($batch);
foreach ($moneyCardIds as $cardid => $cardPassword) {
$this->getMoneyCardDao()->create(
array(
'cardId' => $cardid,
'password' => $cardPassword,
'deadline' => date('Y-m-d', strtotime($moneyCardData['deadline'])),
'cardStatus' => 'normal',
'batchId' => $batch['id'],
)
);
}
$this->getLogService()->info('money_card', 'batch_create', "创建新批次充值卡,卡号前缀为({$batch['cardPrefix']}),批次为({$batch['id']})");
return $batch;
}
public function lockMoneyCard($id)
{
$moneyCard = $this->getMoneyCard($id);
if (empty($moneyCard)) {
throw $this->createServiceException('充值卡不存在,作废失败!');
}
if ($moneyCard['cardStatus'] == 'normal' || $moneyCard['cardStatus'] == 'receive') {
if ($moneyCard['cardStatus'] == 'receive') {
$card = $this->getCardService()->getCardByCardIdAndCardType($moneyCard['id'], 'moneyCard');
$batch = $this->getBatch($moneyCard['batchId']);
$this->getCardService()->updateCardByCardIdAndCardType($moneyCard['id'], 'moneyCard', array('status' => 'invalid'));
$message = "您的一张价值为{$batch['coin']}{$this->getSettingService()->get('coin.coin_name', '虚拟币')}的学习卡已经被管理员作废,详情请联系管理员。";
$this->getNotificationService()->notify($card['userId'], 'default', $message);
}
$moneyCard = $this->getMoneyCardDao()->update($moneyCard['id'], array('cardStatus' => 'invalid'));
$this->getLogService()->info('money_card', 'lock', "作废了卡号为{$moneyCard['cardId']}的充值卡");
} else {
throw $this->createServiceException('不能作废已使用状态的充值卡!');
}
return $moneyCard;
}
public function unlockMoneyCard($id)
{
$moneyCard = $this->getMoneyCard($id);
if (empty($moneyCard)) {
throw $this->createServiceException('充值卡不存在,作废失败!');
}
$batch = $this->getBatch($moneyCard['batchId']);
if ($batch['batchStatus'] == 'invalid') {
throw $this->createServiceException('批次刚刚被别人作废,在批次被作废的情况下,不能启用批次下的充值卡!');
}
if ($moneyCard['cardStatus'] == 'invalid') {
$card = $this->getCardService()->getCardByCardIdAndCardType($moneyCard['id'], 'moneyCard');
if (!empty($card)) {
$this->getCardService()->updateCardByCardIdAndCardType($moneyCard['id'], 'moneyCard', array('status' => 'receive'));
$this->updateMoneyCard($card['cardId'], array('cardStatus' => 'receive'));
$message = "您的一张价值为{$batch['coin']}{$this->getSettingService()->get('coin.coin_name', '虚拟币')}的学习卡已经被管理员启用。";
$this->getNotificationService()->notify($card['userId'], 'default', $message);
} else {
$moneyCard = $this->getMoneyCardDao()->update($moneyCard['id'], array('cardStatus' => 'normal'));
}
$this->getLogService()->info('money_card', 'unlock', "启用了卡号为{$moneyCard['cardId']}的充值卡");
} else {
throw $this->createServiceException("只能启用作废状态的充值卡!{$moneyCard['cardStatus']}--{$moneyCard['rechargeUserId']}");
}
return $moneyCard;
}
public function deleteMoneyCard($id)
{
$moneyCard = $this->getMoneyCard($id);
$batch = $this->getBatch($moneyCard['batchId']);
$this->getMoneyCardDao()->delete($id);
$card = $this->getCardService()->getCardByCardIdAndCardType($moneyCard['id'], 'moneyCard');
if (!empty($card)) {
$this->getCardService()->updateCardByCardIdAndCardType($moneyCard['id'], 'moneyCard', array('status' => 'deleted'));
$message = "您的一张价值为{$batch['coin']}{$this->getSettingService()->get('coin.coin_name', '虚拟币')}的学习卡已经被管理员删除,详情请联系管理员。";
$this->getNotificationService()->notify($card['userId'], 'default', $message);
}
$this->getLogService()->info('money_card', 'delete', "删除了卡号为{$moneyCard['cardId']}的充值卡");
}
public function lockBatch($id)
{
$batch = $this->getBatch($id);
if (empty($batch)) {
throw $this->createServiceException('批次不存在,作废失败!');
}
$this->getMoneyCardDao()->updateBatchByCardStatus(
array(
'batchId' => $batch['id'],
'cardStatus' => 'normal',
),
array('cardStatus' => 'invalid')
);
$moneyCards = $this->searchMoneyCards(
array(
'batchId' => $batch['id'],
'cardStatus' => 'receive',
),
array('id' => 'ASC'),
0,
1000
);
foreach ($moneyCards as $moneyCard) {
$card = $this->getCardService()->getCardByCardIdAndCardType($moneyCard['id'], 'moneyCard');
if (!empty($card)) {
$this->getCardService()->updateCardByCardIdAndCardType($moneyCard['id'], 'moneyCard', array('status' => 'invalid'));
$message = "您的一张价值为{$batch['coin']}{$this->getSettingService()->get('coin.coin_name', '虚拟币')}的学习卡已经被管理员作废,详情请联系管理员。";
$this->getNotificationService()->notify($card['userId'], 'default', $message);
}
}
$this->getMoneyCardDao()->updateBatchByCardStatus(
array(
'batchId' => $batch['id'],
'cardStatus' => 'receive',
),
array('cardStatus' => 'invalid')
);
$batch = $this->updateBatch($batch['id'], array('batchStatus' => 'invalid'));
$this->getLogService()->info('money_card', 'batch_lock', "作废了批次为{$batch['id']}的充值卡");
return $batch;
}
public function unlockBatch($id)
{
$batch = $this->getBatch($id);
if (empty($batch)) {
throw $this->createServiceException('批次不存在,作废失败!');
}
$moneyCards = $this->searchMoneyCards(
array(
'batchId' => $batch['id'],
'cardStatus' => 'invalid',
),
array('id' => 'ASC'),
0,
1000
);
$this->getMoneyCardDao()->updateBatchByCardStatus(
array(
'batchId' => $batch['id'],
'cardStatus' => 'invalid',
'rechargeUserId' => 0,
),
array('cardStatus' => 'normal')
);
foreach ($moneyCards as $moneyCard) {
$card = $this->getCardService()->getCardByCardIdAndCardType($moneyCard['id'], 'moneyCard');
if (!empty($card) && $card['status'] == 'invalid') {
$this->getCardService()->updateCardByCardIdAndCardType($moneyCard['id'], 'moneyCard', array('status' => 'receive'));
$this->updateMoneyCard($card['cardId'], array('cardStatus' => 'receive'));
$message = "您的一张价值为{$batch['coin']}{$this->getSettingService()->get('coin.coin_name', '虚拟币')}的学习卡已经被管理员启用。";
$this->getNotificationService()->notify($card['userId'], 'default', $message);
}
}
$batch = $this->updateBatch($batch['id'], array('batchStatus' => 'normal'));
$this->getLogService()->info('money_card', 'batch_unlock', "启用了批次为{$batch['id']}的充值卡");
return $batch;
}
public function deleteBatch($id)
{
$batch = $this->getBatch($id);
if (empty($batch)) {
throw $this->createServiceException(sprintf('学习卡批次不存在或已被删除'));
}
$moneyCards = $this->getMoneyCardDao()->search(array('batchId' => $id), array('id' => 'ASC'), 0, 1000);
$this->getMoneyCardBatchDao()->delete($id);
$this->getMoneyCardDao()->deleteMoneyCardsByBatchId($id);
foreach ($moneyCards as $moneyCard) {
$card = $this->getCardService()->getCardByCardIdAndCardType($moneyCard['id'], 'moneyCard');
if (!empty($card)) {
$this->getCardService()->updateCardByCardIdAndCardType($moneyCard['id'], 'moneyCard', array('status' => 'deleted'));
$message = "您的一张价值为{$batch['coin']}{$this->getSettingService()->get('coin.coin_name', '虚拟币')}的学习卡已经被管理员删除,详情请联系管理员。";
$this->getNotificationService()->notify($card['userId'], 'default', $message);
}
}
$this->getLogService()->info('money_card', 'batch_delete', "删除了批次为{$id}的充值卡");
}
protected function makeRands($median, $number, $cardPrefix, $passwordLength)
{
if ($median <= 3) {
throw new \RuntimeException('Bad median');
}
$cardIds = array();
$i = 0;
while (true) {
$id = '';
for ($j = 0; $j < (int) $median - 3; ++$j) {
$id .= mt_rand(0, 9);
}
$tmpId = $cardPrefix.$id;
$id = $this->blendCrc32($tmpId);
if (!isset($cardIds[$id])) {
$tmpPassword = $this->makePassword($passwordLength);
$cardIds[$id] = $tmpPassword;
$this->tmpPasswords[$tmpPassword] = true;
++$i;
}
if ($i >= $number) {
break;
}
}
return $cardIds;
}
public function uuid($uuidLength, $prefix = '', $needSplit = false)
{
$chars = md5(uniqid(mt_rand(), true));
if ($needSplit) {
$uuid = '';
$uuid .= substr($chars, 0, 8).'-';
$uuid .= substr($chars, 8, 4).'-';
$uuid .= substr($chars, 12, 4).'-';
$uuid .= substr($chars, 16, 4).'-';
$uuid .= substr($chars, 20, 12);
} else {
$uuid = substr($chars, 0, $uuidLength);
}
return $prefix.$uuid;
}
public function blendCrc32($word)
{
return $word.substr(crc32($word), 0, 3);
}
public function checkCrc32($word)
{
return substr(crc32(substr($word, 0, -3)), 0, 3) == substr($word, -3, 3);
}
private $tmpPasswords = array();
protected function makePassword($length)
{
while (true) {
$uuid = $this->uuid($length - 3);
$password = $this->blendCrc32($uuid);
$moneyCard = $this->getMoneyCardByPassword($password);
if (($moneyCard == null) && (!isset($this->tmpPasswords[$password]))) {
break;
}
}
return $password;
}
public function updateBatch($id, $fields)
{
return $this->getMoneyCardBatchDao()->update($id, $fields);
}
public function updateMoneyCard($id, $fields)
{
return $this->getMoneyCardDao()->update($id, $fields);
}
public function useMoneyCard($id, $fields)
{
try {
$this->beginTransaction();
$moneyCard = $this->getMoneyCard($id, true);
if ($moneyCard['cardStatus'] == 'recharged') {
$this->rollback();
return $moneyCard;
}
$moneyCard = $this->updateMoneyCard($id, $fields);
$batch = $this->getBatch((int) $moneyCard['batchId']);
$flow = array(
'userId' => $fields['rechargeUserId'],
'amount' => $batch['coin'],
'name' => '学习卡'.$moneyCard['cardId'].'充值'.$batch['coin'],
'orderSn' => '',
'category' => 'inflow',
'note' => '',
);
$this->getCashService()->inflowByCoin($flow);
$batch['rechargedNumber'] += 1;
$this->updateBatch($batch['id'], $batch);
$card = $this->getCardService()->getCardByCardIdAndCardType($moneyCard['id'], 'moneyCard');
if (!empty($card)) {
$this->getCardService()->updateCardByCardIdAndCardType($moneyCard['id'], 'moneyCard', array(
'status' => 'used',
'useTime' => $moneyCard['rechargeTime'],
));
} else {
$this->getCardService()->addCard(array(
'cardId' => $moneyCard['id'],
'cardType' => 'moneyCard',
'status' => 'used',
'deadline' => strtotime($moneyCard['deadline']),
'useTime' => $moneyCard['rechargeTime'],
'userId' => $moneyCard['rechargeUserId'],
'createdTime' => time(),
));
}
$this->commit();
} catch (\Exception $e) {
$this->rollback();
throw $e;
}
return $moneyCard;
}
public function receiveMoneyCard($token, $userId)
{
$token = $this->getTokenService()->verifyToken('money_card', $token);
if (!$token) {
return array(
'code' => 'failed',
'message' => '无效的链接',
);
}
try {
$this->biz['db']->beginTransaction();
$batch = $this->getMoneyCardBatchDao()->getBatchByToken($token['token'], array('lock' => 1));
if (empty($batch)) {
$this->biz['db']->commit();
return array(
'code' => 'failed',
'message' => '该链接不存在或已被删除',
);
}
if ($batch['batchStatus'] == 'invalid') {
$this->biz['db']->commit();
return array(
'code' => 'failed',
'message' => '该学习卡已经作废',
);
}
if (!empty($userId)) {
$conditions = array(
'rechargeUserId' => $userId,
'batchId' => $batch['id'],
);
$moneyCard = $this->getMoneyCardDao()->search($conditions, array('id' => 'DESC'), 0, 1);
if (!empty($moneyCard)) {
$this->biz['db']->commit();
return array(
'code' => 'failed',
'message' => '您已经领取该批学习卡',
);
}
}
$conditions = array(
'rechargeUserId' => 0,
'cardStatus' => 'normal',
'batchId' => $batch['id'],
);
$moneyCards = $this->getMoneyCardDao()->search($conditions, array('id' => 'ASC'), 0, 1);
if (empty($moneyCards)) {
$this->biz['db']->commit();
return array(
'code' => 'failed',
'message' => '该批学习卡已经被领完',
);
}
$moneyCard = $this->getMoneyCardDao()->get($moneyCards[0]['id']);
if (!empty($moneyCard) && !empty($userId)) {
$moneyCard = $this->getMoneyCardDao()->update($moneyCard['id'], array(
'rechargeUserId' => $userId,
'cardStatus' => 'receive',
'receiveTime' => time(),
));
if (empty($moneyCard)) {
$this->biz['db']->commit();
return array(
'code' => 'failed',
'message' => '学习卡领取失败',
);
}
$this->getCardService()->addCard(array(
'cardId' => $moneyCard['id'],
'cardType' => 'moneyCard',
'deadline' => strtotime($moneyCard['deadline']),
'userId' => $userId,
));
$message = "您有一张价值为{$batch['coin']}{$this->getSettingService()->get('coin.coin_name', '虚拟币')}的充值卡领取成功";
$this->getNotificationService()->notify($userId, 'default', $message);
$this->dispatchEvent('moneyCard.receive', $batch);
}
$this->biz['db']->commit();
return array(
'id' => $moneyCard['id'],
'code' => 'success',
'message' => '领取成功,请在卡包中查看',
);
} catch (\Exception $e) {
$this->biz['db']->rollback();
throw $e;
}
}
/**
* @return MoneyCardDao
*/
protected function getMoneyCardDao()
{
return $this->createDao('MoneyCard:MoneyCardDao');
}
protected function getCardService()
{
return $this->createService('Card:CardService');
}
/**
* @return MoneyCardBatchDao
*/
protected function getMoneyCardBatchDao()
{
return $this->createDao('MoneyCard:MoneyCardBatchDao');
}
protected function getLogService()
{
return $this->createService('System:LogService');
}
protected function getCashService()
{
return $this->createService('Cash:CashService');
}
private function getTokenService()
{
return $this->createService('User:TokenService');
}
private function getSettingService()
{
return $this->createService('System:SettingService');
}
private function getNotificationService()
{
return $this->createService('User:NotificationService');
}
}
| {
"pile_set_name": "Github"
} |
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
The presented view controller for the Cross Dissolve demo.
*/
@import UIKit;
@interface AAPLCrossDissolveSecondViewController : UIViewController
@end
| {
"pile_set_name": "Github"
} |
//
// error_code.hpp
// ~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef ASIO_ERROR_CODE_HPP
#define ASIO_ERROR_CODE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#if defined(ASIO_HAS_STD_SYSTEM_ERROR)
# include <system_error>
#else // defined(ASIO_HAS_STD_SYSTEM_ERROR)
# include <string>
# include "asio/detail/noncopyable.hpp"
# if !defined(ASIO_NO_IOSTREAM)
# include <iosfwd>
# endif // !defined(ASIO_NO_IOSTREAM)
#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)
#include "asio/detail/push_options.hpp"
// Newer gcc needs some variables marked as used (used in error.hpp and ssl/error.hpp)
#if defined(__GNUC__)
# define ASIO_USED_VARIABLE __attribute__((used))
#else
# define ASIO_USED_VARIABLE
#endif // defined(__GNUC__)
namespace asio {
#if defined(ASIO_HAS_STD_SYSTEM_ERROR)
typedef std::error_category error_category;
#else // defined(ASIO_HAS_STD_SYSTEM_ERROR)
/// Base class for all error categories.
class error_category : private noncopyable
{
public:
/// Destructor.
virtual ~error_category()
{
}
/// Returns a string naming the error gategory.
virtual const char* name() const = 0;
/// Returns a string describing the error denoted by @c value.
virtual std::string message(int value) const = 0;
/// Equality operator to compare two error categories.
bool operator==(const error_category& rhs) const
{
return this == &rhs;
}
/// Inequality operator to compare two error categories.
bool operator!=(const error_category& rhs) const
{
return !(*this == rhs);
}
};
#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)
/// Returns the error category used for the system errors produced by asio.
extern ASIO_DECL const error_category& system_category();
#if defined(ASIO_HAS_STD_SYSTEM_ERROR)
typedef std::error_code error_code;
#else // defined(ASIO_HAS_STD_SYSTEM_ERROR)
/// Class to represent an error code value.
class error_code
{
public:
/// Default constructor.
error_code()
: value_(0),
category_(&system_category())
{
}
/// Construct with specific error code and category.
error_code(int v, const error_category& c)
: value_(v),
category_(&c)
{
}
/// Construct from an error code enum.
template <typename ErrorEnum>
error_code(ErrorEnum e)
{
*this = make_error_code(e);
}
/// Get the error value.
int value() const
{
return value_;
}
/// Get the error category.
const error_category& category() const
{
return *category_;
}
/// Get the message associated with the error.
std::string message() const
{
return category_->message(value_);
}
struct unspecified_bool_type_t
{
};
typedef void (*unspecified_bool_type)(unspecified_bool_type_t);
static void unspecified_bool_true(unspecified_bool_type_t) {}
/// Operator returns non-null if there is a non-success error code.
operator unspecified_bool_type() const
{
if (value_ == 0)
return 0;
else
return &error_code::unspecified_bool_true;
}
/// Operator to test if the error represents success.
bool operator!() const
{
return value_ == 0;
}
/// Equality operator to compare two error objects.
friend bool operator==(const error_code& e1, const error_code& e2)
{
return e1.value_ == e2.value_ && e1.category_ == e2.category_;
}
/// Inequality operator to compare two error objects.
friend bool operator!=(const error_code& e1, const error_code& e2)
{
return e1.value_ != e2.value_ || e1.category_ != e2.category_;
}
private:
// The value associated with the error code.
int value_;
// The category associated with the error code.
const error_category* category_;
};
# if !defined(ASIO_NO_IOSTREAM)
/// Output an error code.
template <typename Elem, typename Traits>
std::basic_ostream<Elem, Traits>& operator<<(
std::basic_ostream<Elem, Traits>& os, const error_code& ec)
{
os << ec.category().name() << ':' << ec.value();
return os;
}
# endif // !defined(ASIO_NO_IOSTREAM)
#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)
} // namespace asio
#include "asio/detail/pop_options.hpp"
#if defined(ASIO_HEADER_ONLY)
# include "asio/impl/error_code.ipp"
#endif // defined(ASIO_HEADER_ONLY)
#endif // ASIO_ERROR_CODE_HPP
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.mybatis.querydsl;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.PathMetadata;
import com.querydsl.sql.ColumnMetadata;
import com.querydsl.sql.Configuration;
import com.querydsl.sql.RelationalPath;
import com.querydsl.sql.SQLSerializer;
import com.querydsl.sql.SchemaAndTable;
/**
* .
*
* @author JARVIS SONG
* @since 2.0.2
*/
public class MybatisSQLSerializer extends SQLSerializer {
public MybatisSQLSerializer(Configuration conf) {
super(conf);
}
public MybatisSQLSerializer(Configuration conf, boolean dml) {
super(conf, dml);
}
@Override
public Void visit(Path<?> path, Void context) {
if (this.dml) {
if (path.equals(this.entity) && path instanceof RelationalPath<?>) {
SchemaAndTable schemaAndTable = this.getSchemaAndTable((RelationalPath<?>) path);
boolean precededByDot;
if (this.dmlWithSchema && this.templates.isPrintSchema()) {
this.appendSchemaName(schemaAndTable.getSchema());
this.append(".");
precededByDot = true;
}
else {
precededByDot = false;
}
this.appendTableName(schemaAndTable.getTable(), precededByDot);
return null;
}
else if (this.entity.equals(path.getMetadata().getParent()) && this.skipParent) {
this.appendAsColumnName(path, false);
return null;
}
}
final PathMetadata metadata = path.getMetadata();
boolean precededByDot;
if (metadata.getParent() != null && (!this.skipParent || this.dml)) {
this.visit(metadata.getParent(), context);
this.append(".");
precededByDot = true;
}
else {
precededByDot = false;
}
this.appendAsColumnName(path, precededByDot);
return null;
}
protected void appendAsColumnName(Path<?> path, boolean precededByDot) {
String column = ColumnMetadata.getName(path);
if (path.getMetadata().getParent() instanceof RelationalPath) {
RelationalPath<?> parent = (RelationalPath<?>) path.getMetadata().getParent();
column = this.configuration.getColumnOverride(parent.getSchemaAndTable(), column);
}
this.append(this.templates.quoteIdentifier(column, precededByDot));
}
}
| {
"pile_set_name": "Github"
} |
/*
* USB Compaq iPAQ driver
*
* Copyright (C) 2001 - 2002
* Ganesh Varadarajan <[email protected]>
*
* 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.
*
* (12/12/2002) ganesh
* Added support for practically all devices supported by ActiveSync
* on Windows. Thanks to Wes Cilldhaire <[email protected]>.
*
* (26/11/2002) ganesh
* Added insmod options to specify product and vendor id.
* Use modprobe ipaq vendor=0xfoo product=0xbar
*
* (26/7/2002) ganesh
* Fixed up broken error handling in ipaq_open. Retry the "kickstart"
* packet much harder - this drastically reduces connection failures.
*
* (30/4/2002) ganesh
* Added support for the Casio EM500. Completely untested. Thanks
* to info from Nathan <[email protected]>
*
* (19/3/2002) ganesh
* Don't submit urbs while holding spinlocks. Not strictly necessary
* in 2.5.x.
*
* (8/3/2002) ganesh
* The ipaq sometimes emits a '\0' before the CLIENT string. At this
* point of time, the ppp ldisc is not yet attached to the tty, so
* n_tty echoes "^ " to the ipaq, which messes up the chat. In 2.5.6-pre2
* this causes a panic because echo_char() tries to sleep in interrupt
* context.
* The fix is to tell the upper layers that this is a raw device so that
* echoing is suppressed. Thanks to Lyle Lindholm for a detailed bug
* report.
*
* (25/2/2002) ganesh
* Added support for the HP Jornada 548 and 568. Completely untested.
* Thanks to info from Heath Robinson and Arieh Davidoff.
*/
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <asm/uaccess.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include "ipaq.h"
#define KP_RETRIES 100
/*
* Version Information
*/
#define DRIVER_VERSION "v0.5"
#define DRIVER_AUTHOR "Ganesh Varadarajan <[email protected]>"
#define DRIVER_DESC "USB PocketPC PDA driver"
static __u16 product, vendor;
static int debug;
static int connect_retries = KP_RETRIES;
static int initial_wait;
/* Function prototypes for an ipaq */
static int ipaq_open (struct usb_serial_port *port, struct file *filp);
static void ipaq_close (struct usb_serial_port *port, struct file *filp);
static int ipaq_startup (struct usb_serial *serial);
static void ipaq_shutdown (struct usb_serial *serial);
static int ipaq_write(struct usb_serial_port *port, const unsigned char *buf,
int count);
static int ipaq_write_bulk(struct usb_serial_port *port, const unsigned char *buf,
int count);
static void ipaq_write_gather(struct usb_serial_port *port);
static void ipaq_read_bulk_callback (struct urb *urb);
static void ipaq_write_bulk_callback(struct urb *urb);
static int ipaq_write_room(struct usb_serial_port *port);
static int ipaq_chars_in_buffer(struct usb_serial_port *port);
static void ipaq_destroy_lists(struct usb_serial_port *port);
static struct usb_device_id ipaq_id_table [] = {
/* The first entry is a placeholder for the insmod-specified device */
{ USB_DEVICE(0x049F, 0x0003) },
{ USB_DEVICE(0x0104, 0x00BE) }, /* Socket USB Sync */
{ USB_DEVICE(0x03F0, 0x1016) }, /* HP USB Sync */
{ USB_DEVICE(0x03F0, 0x1116) }, /* HP USB Sync 1611 */
{ USB_DEVICE(0x03F0, 0x1216) }, /* HP USB Sync 1612 */
{ USB_DEVICE(0x03F0, 0x2016) }, /* HP USB Sync 1620 */
{ USB_DEVICE(0x03F0, 0x2116) }, /* HP USB Sync 1621 */
{ USB_DEVICE(0x03F0, 0x2216) }, /* HP USB Sync 1622 */
{ USB_DEVICE(0x03F0, 0x3016) }, /* HP USB Sync 1630 */
{ USB_DEVICE(0x03F0, 0x3116) }, /* HP USB Sync 1631 */
{ USB_DEVICE(0x03F0, 0x3216) }, /* HP USB Sync 1632 */
{ USB_DEVICE(0x03F0, 0x4016) }, /* HP USB Sync 1640 */
{ USB_DEVICE(0x03F0, 0x4116) }, /* HP USB Sync 1641 */
{ USB_DEVICE(0x03F0, 0x4216) }, /* HP USB Sync 1642 */
{ USB_DEVICE(0x03F0, 0x5016) }, /* HP USB Sync 1650 */
{ USB_DEVICE(0x03F0, 0x5116) }, /* HP USB Sync 1651 */
{ USB_DEVICE(0x03F0, 0x5216) }, /* HP USB Sync 1652 */
{ USB_DEVICE(0x0409, 0x00D5) }, /* NEC USB Sync */
{ USB_DEVICE(0x0409, 0x00D6) }, /* NEC USB Sync */
{ USB_DEVICE(0x0409, 0x00D7) }, /* NEC USB Sync */
{ USB_DEVICE(0x0409, 0x8024) }, /* NEC USB Sync */
{ USB_DEVICE(0x0409, 0x8025) }, /* NEC USB Sync */
{ USB_DEVICE(0x043E, 0x9C01) }, /* LGE USB Sync */
{ USB_DEVICE(0x045E, 0x00CE) }, /* Microsoft USB Sync */
{ USB_DEVICE(0x045E, 0x0400) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0401) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0402) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0403) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0404) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0405) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0406) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0407) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0408) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0409) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x040A) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x040B) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x040C) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x040D) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x040E) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x040F) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0410) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0411) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0412) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0413) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0414) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0415) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0416) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0417) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0432) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0433) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0434) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0435) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0436) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0437) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0438) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0439) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x043A) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x043B) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x043C) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x043D) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x043E) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x043F) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0440) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0441) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0442) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0443) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0444) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0445) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0446) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0447) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0448) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0449) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x044A) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x044B) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x044C) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x044D) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x044E) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x044F) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0450) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0451) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0452) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0453) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0454) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0455) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0456) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0457) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0458) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0459) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x045A) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x045B) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x045C) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x045D) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x045E) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x045F) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0460) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0461) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0462) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0463) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0464) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0465) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0466) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0467) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0468) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0469) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x046A) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x046B) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x046C) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x046D) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x046E) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x046F) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0470) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0471) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0472) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0473) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0474) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0475) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0476) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0477) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0478) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x0479) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x047A) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x047B) }, /* Windows Powered Pocket PC 2003 */
{ USB_DEVICE(0x045E, 0x04C8) }, /* Windows Powered Smartphone 2002 */
{ USB_DEVICE(0x045E, 0x04C9) }, /* Windows Powered Smartphone 2002 */
{ USB_DEVICE(0x045E, 0x04CA) }, /* Windows Powered Smartphone 2002 */
{ USB_DEVICE(0x045E, 0x04CB) }, /* Windows Powered Smartphone 2002 */
{ USB_DEVICE(0x045E, 0x04CC) }, /* Windows Powered Smartphone 2002 */
{ USB_DEVICE(0x045E, 0x04CD) }, /* Windows Powered Smartphone 2002 */
{ USB_DEVICE(0x045E, 0x04CE) }, /* Windows Powered Smartphone 2002 */
{ USB_DEVICE(0x045E, 0x04D7) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04D8) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04D9) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04DA) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04DB) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04DC) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04DD) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04DE) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04DF) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04E0) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04E1) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04E2) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04E3) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04E4) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04E5) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04E6) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04E7) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04E8) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04E9) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x045E, 0x04EA) }, /* Windows Powered Smartphone 2003 */
{ USB_DEVICE(0x049F, 0x0003) }, /* Compaq iPAQ USB Sync */
{ USB_DEVICE(0x049F, 0x0032) }, /* Compaq iPAQ USB Sync */
{ USB_DEVICE(0x04A4, 0x0014) }, /* Hitachi USB Sync */
{ USB_DEVICE(0x04AD, 0x0301) }, /* USB Sync 0301 */
{ USB_DEVICE(0x04AD, 0x0302) }, /* USB Sync 0302 */
{ USB_DEVICE(0x04AD, 0x0303) }, /* USB Sync 0303 */
{ USB_DEVICE(0x04AD, 0x0306) }, /* GPS Pocket PC USB Sync */
{ USB_DEVICE(0x04B7, 0x0531) }, /* MyGuide 7000 XL USB Sync */
{ USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */
{ USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */
{ USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */
{ USB_DEVICE(0x04DD, 0x9102) }, /* SHARP WS003SH USB Modem */
{ USB_DEVICE(0x04DD, 0x9121) }, /* SHARP WS004SH USB Modem */
{ USB_DEVICE(0x04DD, 0x9123) }, /* SHARP WS007SH USB Modem */
{ USB_DEVICE(0x04DD, 0x9151) }, /* SHARP S01SH USB Modem */
{ USB_DEVICE(0x04E8, 0x5F00) }, /* Samsung NEXiO USB Sync */
{ USB_DEVICE(0x04E8, 0x5F01) }, /* Samsung NEXiO USB Sync */
{ USB_DEVICE(0x04E8, 0x5F02) }, /* Samsung NEXiO USB Sync */
{ USB_DEVICE(0x04E8, 0x5F03) }, /* Samsung NEXiO USB Sync */
{ USB_DEVICE(0x04E8, 0x5F04) }, /* Samsung NEXiO USB Sync */
{ USB_DEVICE(0x04E8, 0x6611) }, /* Samsung MITs USB Sync */
{ USB_DEVICE(0x04E8, 0x6613) }, /* Samsung MITs USB Sync */
{ USB_DEVICE(0x04E8, 0x6615) }, /* Samsung MITs USB Sync */
{ USB_DEVICE(0x04E8, 0x6617) }, /* Samsung MITs USB Sync */
{ USB_DEVICE(0x04E8, 0x6619) }, /* Samsung MITs USB Sync */
{ USB_DEVICE(0x04E8, 0x661B) }, /* Samsung MITs USB Sync */
{ USB_DEVICE(0x04E8, 0x662E) }, /* Samsung MITs USB Sync */
{ USB_DEVICE(0x04E8, 0x6630) }, /* Samsung MITs USB Sync */
{ USB_DEVICE(0x04E8, 0x6632) }, /* Samsung MITs USB Sync */
{ USB_DEVICE(0x04f1, 0x3011) }, /* JVC USB Sync */
{ USB_DEVICE(0x04F1, 0x3012) }, /* JVC USB Sync */
{ USB_DEVICE(0x0502, 0x1631) }, /* c10 Series */
{ USB_DEVICE(0x0502, 0x1632) }, /* c20 Series */
{ USB_DEVICE(0x0502, 0x16E1) }, /* Acer n10 Handheld USB Sync */
{ USB_DEVICE(0x0502, 0x16E2) }, /* Acer n20 Handheld USB Sync */
{ USB_DEVICE(0x0502, 0x16E3) }, /* Acer n30 Handheld USB Sync */
{ USB_DEVICE(0x0536, 0x01A0) }, /* HHP PDT */
{ USB_DEVICE(0x0543, 0x0ED9) }, /* ViewSonic Color Pocket PC V35 */
{ USB_DEVICE(0x0543, 0x1527) }, /* ViewSonic Color Pocket PC V36 */
{ USB_DEVICE(0x0543, 0x1529) }, /* ViewSonic Color Pocket PC V37 */
{ USB_DEVICE(0x0543, 0x152B) }, /* ViewSonic Color Pocket PC V38 */
{ USB_DEVICE(0x0543, 0x152E) }, /* ViewSonic Pocket PC */
{ USB_DEVICE(0x0543, 0x1921) }, /* ViewSonic Communicator Pocket PC */
{ USB_DEVICE(0x0543, 0x1922) }, /* ViewSonic Smartphone */
{ USB_DEVICE(0x0543, 0x1923) }, /* ViewSonic Pocket PC V30 */
{ USB_DEVICE(0x05E0, 0x2000) }, /* Symbol USB Sync */
{ USB_DEVICE(0x05E0, 0x2001) }, /* Symbol USB Sync 0x2001 */
{ USB_DEVICE(0x05E0, 0x2002) }, /* Symbol USB Sync 0x2002 */
{ USB_DEVICE(0x05E0, 0x2003) }, /* Symbol USB Sync 0x2003 */
{ USB_DEVICE(0x05E0, 0x2004) }, /* Symbol USB Sync 0x2004 */
{ USB_DEVICE(0x05E0, 0x2005) }, /* Symbol USB Sync 0x2005 */
{ USB_DEVICE(0x05E0, 0x2006) }, /* Symbol USB Sync 0x2006 */
{ USB_DEVICE(0x05E0, 0x2007) }, /* Symbol USB Sync 0x2007 */
{ USB_DEVICE(0x05E0, 0x2008) }, /* Symbol USB Sync 0x2008 */
{ USB_DEVICE(0x05E0, 0x2009) }, /* Symbol USB Sync 0x2009 */
{ USB_DEVICE(0x05E0, 0x200A) }, /* Symbol USB Sync 0x200A */
{ USB_DEVICE(0x067E, 0x1001) }, /* Intermec Mobile Computer */
{ USB_DEVICE(0x07CF, 0x2001) }, /* CASIO USB Sync 2001 */
{ USB_DEVICE(0x07CF, 0x2002) }, /* CASIO USB Sync 2002 */
{ USB_DEVICE(0x07CF, 0x2003) }, /* CASIO USB Sync 2003 */
{ USB_DEVICE(0x0930, 0x0700) }, /* TOSHIBA USB Sync 0700 */
{ USB_DEVICE(0x0930, 0x0705) }, /* TOSHIBA Pocket PC e310 */
{ USB_DEVICE(0x0930, 0x0706) }, /* TOSHIBA Pocket PC e740 */
{ USB_DEVICE(0x0930, 0x0707) }, /* TOSHIBA Pocket PC e330 Series */
{ USB_DEVICE(0x0930, 0x0708) }, /* TOSHIBA Pocket PC e350 Series */
{ USB_DEVICE(0x0930, 0x0709) }, /* TOSHIBA Pocket PC e750 Series */
{ USB_DEVICE(0x0930, 0x070A) }, /* TOSHIBA Pocket PC e400 Series */
{ USB_DEVICE(0x0930, 0x070B) }, /* TOSHIBA Pocket PC e800 Series */
{ USB_DEVICE(0x094B, 0x0001) }, /* Linkup Systems USB Sync */
{ USB_DEVICE(0x0960, 0x0065) }, /* BCOM USB Sync 0065 */
{ USB_DEVICE(0x0960, 0x0066) }, /* BCOM USB Sync 0066 */
{ USB_DEVICE(0x0960, 0x0067) }, /* BCOM USB Sync 0067 */
{ USB_DEVICE(0x0961, 0x0010) }, /* Portatec USB Sync */
{ USB_DEVICE(0x099E, 0x0052) }, /* Trimble GeoExplorer */
{ USB_DEVICE(0x099E, 0x4000) }, /* TDS Data Collector */
{ USB_DEVICE(0x0B05, 0x4200) }, /* ASUS USB Sync */
{ USB_DEVICE(0x0B05, 0x4201) }, /* ASUS USB Sync */
{ USB_DEVICE(0x0B05, 0x4202) }, /* ASUS USB Sync */
{ USB_DEVICE(0x0B05, 0x420F) }, /* ASUS USB Sync */
{ USB_DEVICE(0x0B05, 0x9200) }, /* ASUS USB Sync */
{ USB_DEVICE(0x0B05, 0x9202) }, /* ASUS USB Sync */
{ USB_DEVICE(0x0BB4, 0x00CE) }, /* HTC USB Sync */
{ USB_DEVICE(0x0BB4, 0x00CF) }, /* HTC USB Modem */
{ USB_DEVICE(0x0BB4, 0x0A01) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A02) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A03) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A04) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A05) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A06) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A07) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A08) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A09) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A0A) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A0B) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A0C) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A0D) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A0E) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A0F) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A10) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A11) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A12) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A13) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A14) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A15) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A16) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A17) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A18) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A19) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A1A) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A1B) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A1C) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A1D) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A1E) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A1F) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A20) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A21) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A22) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A23) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A24) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A25) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A26) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A27) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A28) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A29) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A2A) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A2B) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A2C) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A2D) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A2E) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A2F) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A30) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A31) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A32) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A33) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A34) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A35) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A36) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A37) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A38) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A39) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A3A) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A3B) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A3C) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A3D) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A3E) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A3F) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A40) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A41) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A42) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A43) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A44) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A45) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A46) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A47) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A48) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A49) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A4A) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A4B) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A4C) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A4D) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A4E) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A4F) }, /* PocketPC USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A50) }, /* HTC SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A51) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A52) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A53) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A54) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A55) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A56) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A57) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A58) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A59) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A5A) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A5B) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A5C) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A5D) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A5E) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A5F) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A60) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A61) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A62) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A63) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A64) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A65) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A66) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A67) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A68) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A69) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A6A) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A6B) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A6C) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A6D) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A6E) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A6F) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A70) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A71) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A72) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A73) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A74) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A75) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A76) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A77) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A78) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A79) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A7A) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A7B) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A7C) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A7D) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A7E) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A7F) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A80) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A81) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A82) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A83) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A84) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A85) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A86) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A87) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A88) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A89) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A8A) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A8B) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A8C) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A8D) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A8E) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A8F) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A90) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A91) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A92) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A93) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A94) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A95) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A96) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A97) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A98) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A99) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A9A) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A9B) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A9C) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A9D) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A9E) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0A9F) }, /* SmartPhone USB Sync */
{ USB_DEVICE(0x0BB4, 0x0BCE) }, /* "High Tech Computer Corp" */
{ USB_DEVICE(0x0BF8, 0x1001) }, /* Fujitsu Siemens Computers USB Sync */
{ USB_DEVICE(0x0C44, 0x03A2) }, /* Motorola iDEN Smartphone */
{ USB_DEVICE(0x0C8E, 0x6000) }, /* Cesscom Luxian Series */
{ USB_DEVICE(0x0CAD, 0x9001) }, /* Motorola PowerPad Pocket PC Device */
{ USB_DEVICE(0x0F4E, 0x0200) }, /* Freedom Scientific USB Sync */
{ USB_DEVICE(0x0F98, 0x0201) }, /* Cyberbank USB Sync */
{ USB_DEVICE(0x0FB8, 0x3001) }, /* Wistron USB Sync */
{ USB_DEVICE(0x0FB8, 0x3002) }, /* Wistron USB Sync */
{ USB_DEVICE(0x0FB8, 0x3003) }, /* Wistron USB Sync */
{ USB_DEVICE(0x0FB8, 0x4001) }, /* Wistron USB Sync */
{ USB_DEVICE(0x1066, 0x00CE) }, /* E-TEN USB Sync */
{ USB_DEVICE(0x1066, 0x0300) }, /* E-TEN P3XX Pocket PC */
{ USB_DEVICE(0x1066, 0x0500) }, /* E-TEN P5XX Pocket PC */
{ USB_DEVICE(0x1066, 0x0600) }, /* E-TEN P6XX Pocket PC */
{ USB_DEVICE(0x1066, 0x0700) }, /* E-TEN P7XX Pocket PC */
{ USB_DEVICE(0x1114, 0x0001) }, /* Psion Teklogix Sync 753x */
{ USB_DEVICE(0x1114, 0x0004) }, /* Psion Teklogix Sync netBookPro */
{ USB_DEVICE(0x1114, 0x0006) }, /* Psion Teklogix Sync 7525 */
{ USB_DEVICE(0x1182, 0x1388) }, /* VES USB Sync */
{ USB_DEVICE(0x11D9, 0x1002) }, /* Rugged Pocket PC 2003 */
{ USB_DEVICE(0x11D9, 0x1003) }, /* Rugged Pocket PC 2003 */
{ USB_DEVICE(0x1231, 0xCE01) }, /* USB Sync 03 */
{ USB_DEVICE(0x1231, 0xCE02) }, /* USB Sync 03 */
{ USB_DEVICE(0x1690, 0x0601) }, /* Askey USB Sync */
{ USB_DEVICE(0x22B8, 0x4204) }, /* Motorola MPx200 Smartphone */
{ USB_DEVICE(0x22B8, 0x4214) }, /* Motorola MPc GSM */
{ USB_DEVICE(0x22B8, 0x4224) }, /* Motorola MPx220 Smartphone */
{ USB_DEVICE(0x22B8, 0x4234) }, /* Motorola MPc CDMA */
{ USB_DEVICE(0x22B8, 0x4244) }, /* Motorola MPx100 Smartphone */
{ USB_DEVICE(0x3340, 0x011C) }, /* Mio DigiWalker PPC StrongARM */
{ USB_DEVICE(0x3340, 0x0326) }, /* Mio DigiWalker 338 */
{ USB_DEVICE(0x3340, 0x0426) }, /* Mio DigiWalker 338 */
{ USB_DEVICE(0x3340, 0x043A) }, /* Mio DigiWalker USB Sync */
{ USB_DEVICE(0x3340, 0x051C) }, /* MiTAC USB Sync 528 */
{ USB_DEVICE(0x3340, 0x053A) }, /* Mio DigiWalker SmartPhone USB Sync */
{ USB_DEVICE(0x3340, 0x071C) }, /* MiTAC USB Sync */
{ USB_DEVICE(0x3340, 0x0B1C) }, /* Generic PPC StrongARM */
{ USB_DEVICE(0x3340, 0x0E3A) }, /* Generic PPC USB Sync */
{ USB_DEVICE(0x3340, 0x0F1C) }, /* Itautec USB Sync */
{ USB_DEVICE(0x3340, 0x0F3A) }, /* Generic SmartPhone USB Sync */
{ USB_DEVICE(0x3340, 0x1326) }, /* Itautec USB Sync */
{ USB_DEVICE(0x3340, 0x191C) }, /* YAKUMO USB Sync */
{ USB_DEVICE(0x3340, 0x2326) }, /* Vobis USB Sync */
{ USB_DEVICE(0x3340, 0x3326) }, /* MEDION Winodws Moble USB Sync */
{ USB_DEVICE(0x3708, 0x20CE) }, /* Legend USB Sync */
{ USB_DEVICE(0x3708, 0x21CE) }, /* Lenovo USB Sync */
{ USB_DEVICE(0x4113, 0x0210) }, /* Mobile Media Technology USB Sync */
{ USB_DEVICE(0x4113, 0x0211) }, /* Mobile Media Technology USB Sync */
{ USB_DEVICE(0x4113, 0x0400) }, /* Mobile Media Technology USB Sync */
{ USB_DEVICE(0x4113, 0x0410) }, /* Mobile Media Technology USB Sync */
{ USB_DEVICE(0x413C, 0x4001) }, /* Dell Axim USB Sync */
{ USB_DEVICE(0x413C, 0x4002) }, /* Dell Axim USB Sync */
{ USB_DEVICE(0x413C, 0x4003) }, /* Dell Axim USB Sync */
{ USB_DEVICE(0x413C, 0x4004) }, /* Dell Axim USB Sync */
{ USB_DEVICE(0x413C, 0x4005) }, /* Dell Axim USB Sync */
{ USB_DEVICE(0x413C, 0x4006) }, /* Dell Axim USB Sync */
{ USB_DEVICE(0x413C, 0x4007) }, /* Dell Axim USB Sync */
{ USB_DEVICE(0x413C, 0x4008) }, /* Dell Axim USB Sync */
{ USB_DEVICE(0x413C, 0x4009) }, /* Dell Axim USB Sync */
{ USB_DEVICE(0x4505, 0x0010) }, /* Smartphone */
{ USB_DEVICE(0x5E04, 0xCE00) }, /* SAGEM Wireless Assistant */
{ USB_DEVICE(0x0BB4, 0x00CF) }, /* HTC smartphone modems */
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE (usb, ipaq_id_table);
static struct usb_driver ipaq_driver = {
.name = "ipaq",
.probe = usb_serial_probe,
.disconnect = usb_serial_disconnect,
.id_table = ipaq_id_table,
.no_dynamic_id = 1,
};
/* All of the device info needed for the Compaq iPAQ */
static struct usb_serial_driver ipaq_device = {
.driver = {
.owner = THIS_MODULE,
.name = "ipaq",
},
.description = "PocketPC PDA",
.usb_driver = &ipaq_driver,
.id_table = ipaq_id_table,
.num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = 1,
.num_bulk_out = 1,
.num_ports = 1,
.open = ipaq_open,
.close = ipaq_close,
.attach = ipaq_startup,
.shutdown = ipaq_shutdown,
.write = ipaq_write,
.write_room = ipaq_write_room,
.chars_in_buffer = ipaq_chars_in_buffer,
.read_bulk_callback = ipaq_read_bulk_callback,
.write_bulk_callback = ipaq_write_bulk_callback,
};
static spinlock_t write_list_lock;
static int bytes_in;
static int bytes_out;
static int ipaq_open(struct usb_serial_port *port, struct file *filp)
{
struct usb_serial *serial = port->serial;
struct ipaq_private *priv;
struct ipaq_packet *pkt;
int i, result = 0;
int retries = connect_retries;
dbg("%s - port %d", __FUNCTION__, port->number);
bytes_in = 0;
bytes_out = 0;
priv = kmalloc(sizeof(struct ipaq_private), GFP_KERNEL);
if (priv == NULL) {
err("%s - Out of memory", __FUNCTION__);
return -ENOMEM;
}
usb_set_serial_port_data(port, priv);
priv->active = 0;
priv->queue_len = 0;
priv->free_len = 0;
INIT_LIST_HEAD(&priv->queue);
INIT_LIST_HEAD(&priv->freelist);
for (i = 0; i < URBDATA_QUEUE_MAX / PACKET_SIZE; i++) {
pkt = kmalloc(sizeof(struct ipaq_packet), GFP_KERNEL);
if (pkt == NULL) {
goto enomem;
}
pkt->data = kmalloc(PACKET_SIZE, GFP_KERNEL);
if (pkt->data == NULL) {
kfree(pkt);
goto enomem;
}
pkt->len = 0;
pkt->written = 0;
INIT_LIST_HEAD(&pkt->list);
list_add(&pkt->list, &priv->freelist);
priv->free_len += PACKET_SIZE;
}
/*
* Force low latency on. This will immediately push data to the line
* discipline instead of queueing.
*/
port->tty->low_latency = 1;
port->tty->raw = 1;
port->tty->real_raw = 1;
/*
* Lose the small buffers usbserial provides. Make larger ones.
*/
kfree(port->bulk_in_buffer);
kfree(port->bulk_out_buffer);
port->bulk_in_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL);
if (port->bulk_in_buffer == NULL) {
goto enomem;
}
port->bulk_out_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL);
if (port->bulk_out_buffer == NULL) {
kfree(port->bulk_in_buffer);
goto enomem;
}
port->read_urb->transfer_buffer = port->bulk_in_buffer;
port->write_urb->transfer_buffer = port->bulk_out_buffer;
port->read_urb->transfer_buffer_length = URBDATA_SIZE;
port->bulk_out_size = port->write_urb->transfer_buffer_length = URBDATA_SIZE;
msleep(1000*initial_wait);
/*
* Send out control message observed in win98 sniffs. Not sure what
* it does, but from empirical observations, it seems that the device
* will start the chat sequence once one of these messages gets
* through. Since this has a reasonably high failure rate, we retry
* several times.
*/
while (retries--) {
result = usb_control_msg(serial->dev,
usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21,
0x1, 0, NULL, 0, 100);
if (!result)
break;
msleep(1000);
}
if (!retries && result) {
err("%s - failed doing control urb, error %d", __FUNCTION__,
result);
goto error;
}
/* Start reading from the device */
usb_fill_bulk_urb(port->read_urb, serial->dev,
usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
ipaq_read_bulk_callback, port);
result = usb_submit_urb(port->read_urb, GFP_KERNEL);
if (result) {
err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
goto error;
}
return 0;
enomem:
result = -ENOMEM;
err("%s - Out of memory", __FUNCTION__);
error:
ipaq_destroy_lists(port);
kfree(priv);
return result;
}
static void ipaq_close(struct usb_serial_port *port, struct file *filp)
{
struct ipaq_private *priv = usb_get_serial_port_data(port);
dbg("%s - port %d", __FUNCTION__, port->number);
/*
* shut down bulk read and write
*/
usb_kill_urb(port->write_urb);
usb_kill_urb(port->read_urb);
ipaq_destroy_lists(port);
kfree(priv);
usb_set_serial_port_data(port, NULL);
/* Uncomment the following line if you want to see some statistics in your syslog */
/* info ("Bytes In = %d Bytes Out = %d", bytes_in, bytes_out); */
}
static void ipaq_read_bulk_callback(struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
int result;
int status = urb->status;
dbg("%s - port %d", __FUNCTION__, port->number);
if (status) {
dbg("%s - nonzero read bulk status received: %d",
__FUNCTION__, status);
return;
}
usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
tty = port->tty;
if (tty && urb->actual_length) {
tty_buffer_request_room(tty, urb->actual_length);
tty_insert_flip_string(tty, data, urb->actual_length);
tty_flip_buffer_push(tty);
bytes_in += urb->actual_length;
}
/* Continue trying to always read */
usb_fill_bulk_urb(port->read_urb, port->serial->dev,
usb_rcvbulkpipe(port->serial->dev, port->bulk_in_endpointAddress),
port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
ipaq_read_bulk_callback, port);
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result)
err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
return;
}
static int ipaq_write(struct usb_serial_port *port, const unsigned char *buf,
int count)
{
const unsigned char *current_position = buf;
int bytes_sent = 0;
int transfer_size;
dbg("%s - port %d", __FUNCTION__, port->number);
while (count > 0) {
transfer_size = min(count, PACKET_SIZE);
if (ipaq_write_bulk(port, current_position, transfer_size)) {
break;
}
current_position += transfer_size;
bytes_sent += transfer_size;
count -= transfer_size;
bytes_out += transfer_size;
}
return bytes_sent;
}
static int ipaq_write_bulk(struct usb_serial_port *port, const unsigned char *buf,
int count)
{
struct ipaq_private *priv = usb_get_serial_port_data(port);
struct ipaq_packet *pkt = NULL;
int result = 0;
unsigned long flags;
if (priv->free_len <= 0) {
dbg("%s - we're stuffed", __FUNCTION__);
return -EAGAIN;
}
spin_lock_irqsave(&write_list_lock, flags);
if (!list_empty(&priv->freelist)) {
pkt = list_entry(priv->freelist.next, struct ipaq_packet, list);
list_del(&pkt->list);
priv->free_len -= PACKET_SIZE;
}
spin_unlock_irqrestore(&write_list_lock, flags);
if (pkt == NULL) {
dbg("%s - we're stuffed", __FUNCTION__);
return -EAGAIN;
}
memcpy(pkt->data, buf, count);
usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, pkt->data);
pkt->len = count;
pkt->written = 0;
spin_lock_irqsave(&write_list_lock, flags);
list_add_tail(&pkt->list, &priv->queue);
priv->queue_len += count;
if (priv->active == 0) {
priv->active = 1;
ipaq_write_gather(port);
spin_unlock_irqrestore(&write_list_lock, flags);
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) {
err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
}
} else {
spin_unlock_irqrestore(&write_list_lock, flags);
}
return result;
}
static void ipaq_write_gather(struct usb_serial_port *port)
{
struct ipaq_private *priv = usb_get_serial_port_data(port);
struct usb_serial *serial = port->serial;
int count, room;
struct ipaq_packet *pkt, *tmp;
struct urb *urb = port->write_urb;
room = URBDATA_SIZE;
list_for_each_entry_safe(pkt, tmp, &priv->queue, list) {
count = min(room, (int)(pkt->len - pkt->written));
memcpy(urb->transfer_buffer + (URBDATA_SIZE - room),
pkt->data + pkt->written, count);
room -= count;
pkt->written += count;
priv->queue_len -= count;
if (pkt->written == pkt->len) {
list_move(&pkt->list, &priv->freelist);
priv->free_len += PACKET_SIZE;
}
if (room == 0) {
break;
}
}
count = URBDATA_SIZE - room;
usb_fill_bulk_urb(port->write_urb, serial->dev,
usb_sndbulkpipe(serial->dev, port->bulk_out_endpointAddress),
port->write_urb->transfer_buffer, count, ipaq_write_bulk_callback,
port);
return;
}
static void ipaq_write_bulk_callback(struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct ipaq_private *priv = usb_get_serial_port_data(port);
unsigned long flags;
int result;
int status = urb->status;
dbg("%s - port %d", __FUNCTION__, port->number);
if (status) {
dbg("%s - nonzero write bulk status received: %d",
__FUNCTION__, status);
return;
}
spin_lock_irqsave(&write_list_lock, flags);
if (!list_empty(&priv->queue)) {
ipaq_write_gather(port);
spin_unlock_irqrestore(&write_list_lock, flags);
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) {
err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
}
} else {
priv->active = 0;
spin_unlock_irqrestore(&write_list_lock, flags);
}
usb_serial_port_softint(port);
}
static int ipaq_write_room(struct usb_serial_port *port)
{
struct ipaq_private *priv = usb_get_serial_port_data(port);
dbg("%s - freelen %d", __FUNCTION__, priv->free_len);
return priv->free_len;
}
static int ipaq_chars_in_buffer(struct usb_serial_port *port)
{
struct ipaq_private *priv = usb_get_serial_port_data(port);
dbg("%s - queuelen %d", __FUNCTION__, priv->queue_len);
return priv->queue_len;
}
static void ipaq_destroy_lists(struct usb_serial_port *port)
{
struct ipaq_private *priv = usb_get_serial_port_data(port);
struct ipaq_packet *pkt, *tmp;
list_for_each_entry_safe(pkt, tmp, &priv->queue, list) {
kfree(pkt->data);
kfree(pkt);
}
list_for_each_entry_safe(pkt, tmp, &priv->freelist, list) {
kfree(pkt->data);
kfree(pkt);
}
}
static int ipaq_startup(struct usb_serial *serial)
{
dbg("%s", __FUNCTION__);
if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
err("active config #%d != 1 ??",
serial->dev->actconfig->desc.bConfigurationValue);
return -ENODEV;
}
return usb_reset_configuration (serial->dev);
}
static void ipaq_shutdown(struct usb_serial *serial)
{
dbg("%s", __FUNCTION__);
}
static int __init ipaq_init(void)
{
int retval;
spin_lock_init(&write_list_lock);
retval = usb_serial_register(&ipaq_device);
if (retval)
goto failed_usb_serial_register;
info(DRIVER_DESC " " DRIVER_VERSION);
if (vendor) {
ipaq_id_table[0].idVendor = vendor;
ipaq_id_table[0].idProduct = product;
}
retval = usb_register(&ipaq_driver);
if (retval)
goto failed_usb_register;
return 0;
failed_usb_register:
usb_serial_deregister(&ipaq_device);
failed_usb_serial_register:
return retval;
}
static void __exit ipaq_exit(void)
{
usb_deregister(&ipaq_driver);
usb_serial_deregister(&ipaq_device);
}
module_init(ipaq_init);
module_exit(ipaq_exit);
MODULE_AUTHOR( DRIVER_AUTHOR );
MODULE_DESCRIPTION( DRIVER_DESC );
MODULE_LICENSE("GPL");
module_param(debug, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(debug, "Debug enabled or not");
module_param(vendor, ushort, 0);
MODULE_PARM_DESC(vendor, "User specified USB idVendor");
module_param(product, ushort, 0);
MODULE_PARM_DESC(product, "User specified USB idProduct");
module_param(connect_retries, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(connect_retries, "Maximum number of connect retries (one second each)");
module_param(initial_wait, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(initial_wait, "Time to wait before attempting a connection (in seconds)");
| {
"pile_set_name": "Github"
} |
{% extends "base.html" %}
{% comment %}
# richard -- video index system
# Copyright (C) 2012, 2013 richard contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}
{% load md %}
{% load url from future %}
{% load video_summary %}
{% block title %}{{ settings.SITE_TITLE }} - {{ category.title|truncatechars:60 }}{% endblock %}
{% block additional_head %}
{{ block.super }}
<link rel="alternate" type="application/rss+xml" href="{% url 'videos-category-videos-feed' category_id=category.pk slug=category.slug %}" />
{% endblock %}
{% block content %}
<ul class="nav nav-pills pull-right">
<li class="{% if view == 'videos' %}active{% endif %}"><a href="{% url 'videos-category' category_id=category.pk slug=category.slug %}">Videos</a></li>
<li class="{% if view == 'files' %}active{% endif %}"><a href="{% url 'videos-category-files' category_id=category.pk slug=category.slug %}">Files</a></li>
<li><a href="{% url 'videos-category-videos-feed' category_id=category.pk slug=category.slug %}">RSS Feed</a></li>
</ul>
<div>
<h1>{{ category.title }}
{% if user.is_staff %}
<small>
<a href="{% url 'admin:videos_category_change' category.id %}"><i class="icon-edit"></i> edit</a>
</small>
{% endif %}
</h1>
<div class="well">
<dl class="dl-horizontal">
{% if category.url %}
<dt>URL:</dt>
<dd> <a href="{{ category.url }}">{{ category.url }}</a></dd>
{% endif %}
<dt>Description:</dt>
<dd>
{% if category.description %}
{{ category.description|md|safe }}
{% else %}
No description.
{% endif %}
</dd>
{% if category.start_date %}
<dt>Date:</dt>
<dd>
{{ category.start_date|date:"DATE_FORMAT" }}
</dd>
{% endif %}
<dt>Number of videos:</dt>
<dd>
{{ videos|length }}
</dd>
{% if settings.API %}
<dt>Metadata</dt>
<dd>
<a href="{% url 'category-api-view' category.slug %}">JSON</a>
</dd>
{% endif %}
</dl>
</div>
</div>
{% if view == 'videos' %}
<div id="video-summary-content">
{% for v in videos %}
{% video_summary v %}
{% endfor %}
</div>
{% elif view == 'files' %}
<table class="table">
<tr><th>Title</th><th>Files</th></tr>
{% for v in videos %}
<tr>
<td>
<strong><a href="{{ v.get_absolute_url }}">{{ v.title }}</a></strong>
{% if v.speakers.all %}
—
{% for s in v.speakers.all %}
{{ s.name }}
{% if not forloop.last %}, {% endif %}
{% endfor %}
{% endif %}
</td>
<td>
{% if v.get_download_formats %}
{% for format in v.get_download_formats %}
<a href="{{ format.url }}">{{ format.display }}</a>
{% endfor %}
{% else %}
No downloadable files.
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% endblock %}
| {
"pile_set_name": "Github"
} |
#
# Речі
item.Ring.0.name=Перстень шахтаря
#
# GUI
button.baubles=Baubles
button.normal=Звич.
#
# Keybinding
keybind.baublesinventory=Інвертар Baubles
| {
"pile_set_name": "Github"
} |
// (C) Copyright John Maddock 2005.
// 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.lslboost.org/LICENSE_1_0.txt)
//
// The aim of this header is just to include <functional> but to do
// so in a way that does not result in recursive inclusion of
// the Boost TR1 components if lslboost/tr1/tr1/functional is in the
// include search path. We have to do this to avoid circular
// dependencies:
//
#ifndef BOOST_CONFIG_FUNCTIONAL
# define BOOST_CONFIG_FUNCTIONAL
# ifndef BOOST_TR1_NO_RECURSION
# define BOOST_TR1_NO_RECURSION
# define BOOST_CONFIG_NO_FUNCTIONAL_RECURSION
# endif
# include <functional>
# ifdef BOOST_CONFIG_NO_FUNCTIONAL_RECURSION
# undef BOOST_TR1_NO_RECURSION
# undef BOOST_CONFIG_NO_FUNCTIONAL_RECURSION
# endif
#endif
| {
"pile_set_name": "Github"
} |
;===- ./tools/lli/LLVMBuild.txt --------------------------------*- Conf -*--===;
;
; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
; See https://llvm.org/LICENSE.txt for license information.
; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
;
;===------------------------------------------------------------------------===;
;
; This is an LLVMBuild description file for the components in this subdirectory.
;
; For more information on the LLVMBuild system, please see:
;
; http://llvm.org/docs/LLVMBuild.html
;
;===------------------------------------------------------------------------===;
[common]
subdirectories = ChildTarget
[component_0]
type = Tool
name = lli
parent = Tools
required_libraries =
AsmParser
BitReader
IRReader
Instrumentation
Interpreter
MCJIT
Native
NativeCodeGen
SelectionDAG
TransformUtils
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2002-2020 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.kernel.impl.index.schema;
import java.io.IOException;
import java.io.UncheckedIOException;
import org.neo4j.index.internal.gbptree.GBPTree;
import org.neo4j.index.internal.gbptree.Seeker;
import org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer;
import org.neo4j.kernel.api.index.IndexSample;
import org.neo4j.kernel.api.index.NonUniqueIndexSampler;
/**
* {@link NonUniqueIndexSampler} which performs a full scans of a {@link GBPTree} in {@link #sample(PageCursorTracer)}.
*
* @param <KEY> type of keys in tree.
* @param <VALUE> type of values in tree.
*/
class FullScanNonUniqueIndexSampler<KEY extends NativeIndexKey<KEY>, VALUE extends NativeIndexValue>
extends NonUniqueIndexSampler.Adapter
{
private final GBPTree<KEY,VALUE> gbpTree;
private final IndexLayout<KEY,VALUE> layout;
FullScanNonUniqueIndexSampler( GBPTree<KEY,VALUE> gbpTree, IndexLayout<KEY,VALUE> layout )
{
this.gbpTree = gbpTree;
this.layout = layout;
}
@Override
public IndexSample sample( PageCursorTracer cursorTracer )
{
KEY lowest = layout.newKey();
lowest.initialize( Long.MIN_VALUE );
lowest.initValuesAsLowest();
KEY highest = layout.newKey();
highest.initialize( Long.MAX_VALUE );
highest.initValuesAsHighest();
KEY prev = layout.newKey();
try ( Seeker<KEY,VALUE> seek = gbpTree.seek( lowest, highest, cursorTracer ) )
{
long sampledValues = 0;
long uniqueValues = 0;
// Get the first one so that prev gets initialized
if ( seek.next() )
{
prev = layout.copyKey( seek.key(), prev );
sampledValues++;
uniqueValues++;
// Then do the rest
while ( seek.next() )
{
if ( layout.compareValue( prev, seek.key() ) != 0 )
{
uniqueValues++;
layout.copyKey( seek.key(), prev );
}
// else this is a duplicate of the previous one
sampledValues++;
}
}
return new IndexSample( sampledValues, uniqueValues, sampledValues );
}
catch ( IOException e )
{
throw new UncheckedIOException( e );
}
}
@Override
public IndexSample sample( int numDocs, PageCursorTracer cursorTracer )
{
throw new UnsupportedOperationException();
}
}
| {
"pile_set_name": "Github"
} |
/* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************/
#include "config.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include "macros.h"
#include "const.h"
#include "gvplugin_render.h"
#include "gvplugin_device.h"
#include "gvio.h"
#include "memory.h"
typedef enum { FORMAT_VML, FORMAT_VMLZ, } format_type;
unsigned int graphHeight,graphWidth;
#ifndef HAVE_STRCASECMP
extern int strcasecmp(const char *s1, const char *s2);
#endif
/* this is a direct copy fromlib/common/labels.c */
static int xml_isentity(char *s)
{
s++; /* already known to be '&' */
if (*s == '#') {
s++;
if (*s == 'x' || *s == 'X') {
s++;
while ((*s >= '0' && *s <= '9')
|| (*s >= 'a' && *s <= 'f')
|| (*s >= 'A' && *s <= 'F'))
s++;
} else {
while (*s >= '0' && *s <= '9')
s++;
}
} else {
while ((*s >= 'a' && *s <= 'z')
|| (*s >= 'A' && *s <= 'Z'))
s++;
}
if (*s == ';')
return 1;
return 0;
}
static void vml_bzptarray(GVJ_t * job, pointf * A, int n)
{
int i;
char *c;
c = "m "; /* first point */
for (i = 0; i < n; i++) {
/* integers only in path! */
gvprintf(job, "%s%.0f,%.0f ", c, A[i].x, graphHeight-A[i].y);
if (i == 0)
c = "c "; /* second point */
else
c = ""; /* remaining points */
}
gvputs(job, "\"");
}
static void vml_print_color(GVJ_t * job, gvcolor_t color)
{
switch (color.type) {
case COLOR_STRING:
gvputs(job, color.u.string);
break;
case RGBA_BYTE:
if (color.u.rgba[3] == 0) /* transparent */
gvputs(job, "none");
else
gvprintf(job, "#%02x%02x%02x",
color.u.rgba[0], color.u.rgba[1], color.u.rgba[2]);
break;
default:
assert(0); /* internal error */
}
}
static void vml_grstroke(GVJ_t * job, int filled)
{
obj_state_t *obj = job->obj;
gvputs(job, "<v:stroke color=\"");
vml_print_color(job, obj->pencolor);
if (obj->penwidth != PENWIDTH_NORMAL)
gvprintf(job, "\" weight=\"%.0fpt", obj->penwidth);
if (obj->pen == PEN_DASHED) {
gvputs(job, "\" dashstyle=\"dash");
} else if (obj->pen == PEN_DOTTED) {
gvputs(job, "\" dashstyle=\"dot");
}
gvputs(job, "\" />");
}
static void vml_grfill(GVJ_t * job, int filled)
{
obj_state_t *obj = job->obj;
if (filled){
gvputs(job, " filled=\"true\" fillcolor=\"");
vml_print_color(job, obj->fillcolor);
gvputs(job, "\" ");
}else{
gvputs(job, " filled=\"false\" ");
}
}
/* html_string is a modified version of xml_string */
char *html_string(char *s)
{
static char *buf = NULL;
static int bufsize = 0;
char *p, *sub, *prev = NULL;
int len, pos = 0;
int temp,cnt,remaining=0;
char workstr[16];
uint64_t charnum=0;
unsigned char byte;
unsigned char mask;
if (!buf) {
bufsize = 64;
buf = gmalloc(bufsize);
}
p = buf;
while (s && *s) {
if (pos > (bufsize - 8)) {
bufsize *= 2;
buf = grealloc(buf, bufsize);
p = buf + pos;
}
/* escape '&' only if not part of a legal entity sequence */
if (*s == '&' && !(xml_isentity(s))) {
sub = "&";
len = 5;
}
/* '<' '>' are safe to substitute even if string is already UTF-8 coded
* since UTF-8 strings won't contain '<' or '>' */
else if (*s == '<') {
sub = "<";
len = 4;
}
else if (*s == '>') {
sub = ">";
len = 4;
}
else if (*s == '-') { /* can't be used in xml comment strings */
sub = "-";
len = 5;
}
else if (*s == ' ' && prev && *prev == ' ') {
/* substitute 2nd and subsequent spaces with required_spaces */
sub = " "; /* inkscape doesn't recognise */
len = 6;
}
else if (*s == '"') {
sub = """;
len = 6;
}
else if (*s == '\'') {
sub = "'";
len = 5;
}
else if ((unsigned char)*s > 127) {
byte=(unsigned char)*s;
cnt=0;
for (mask=127; mask < byte; mask=mask >>1){
cnt++;
byte=byte & mask;
}
if (cnt>1){
charnum=byte;
remaining=cnt-1;
}else{
charnum=charnum<<6;
charnum+=byte;
remaining--;
}
if (remaining>0){
s++;
continue;
}
/* we will build the html value right-to-left
* (least significant-to-most) */
workstr[15]=';';
sub=&workstr[14];
len=3; /* &# + ; */
do {
temp=charnum%10;
*(sub--)=(char)((int)'0'+ temp);
charnum/=10;
len++;
if (len>12){ /* 12 is arbitrary, but clearly in error */
fprintf(stderr, "Error during conversion to \"UTF-8\". Quiting.\n");
exit(1);
}
} while (charnum>0);
*(sub--)='#';
*(sub)='&';
}
else {
sub = s;
len = 1;
}
while (len--) {
*p++ = *sub++;
pos++;
}
prev = s;
s++;
}
*p = '\0';
return buf;
}
static void vml_comment(GVJ_t * job, char *str)
{
gvputs(job, " <!-- ");
gvputs(job, html_string(str));
gvputs(job, " -->\n");
}
static void vml_begin_job(GVJ_t * job)
{
gvputs(job, "<HTML>\n");
gvputs(job, "\n<!-- Generated by ");
gvputs(job, html_string(job->common->info[0]));
gvputs(job, " version ");
gvputs(job, html_string(job->common->info[1]));
gvputs(job, " (");
gvputs(job, html_string(job->common->info[2]));
gvputs(job, ")\n-->\n");
}
static void vml_begin_graph(GVJ_t * job)
{
obj_state_t *obj = job->obj;
char *name;
graphHeight =(int)(job->bb.UR.y - job->bb.LL.y);
graphWidth =(int)(job->bb.UR.x - job->bb.LL.x);
gvputs(job, "<HEAD>");
gvputs(job, "<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n");
name = agnameof(obj->u.g);
if (name[0]) {
gvputs(job, "<TITLE>");
gvputs(job, html_string(name));
gvputs(job, "</TITLE>");
}
gvprintf(job, "<!-- Pages: %d -->\n", job->pagesArraySize.x * job->pagesArraySize.y);
/* the next chunk and all the "DIV" stuff is not required,
* but it helps with non-IE browsers */
gvputs(job, " <SCRIPT LANGUAGE='Javascript'>\n");
gvputs(job, " function browsercheck()\n");
gvputs(job, " {\n");
gvputs(job, " var ua = window.navigator.userAgent\n");
gvputs(job, " var msie = ua.indexOf ( 'MSIE ' )\n");
gvputs(job, " var ievers;\n");
gvputs(job, " var item;\n");
gvputs(job, " var VMLyes=new Array('_VML1_','_VML2_');\n");
gvputs(job, " var VMLno=new Array('_notVML1_','_notVML2_');\n");
gvputs(job, " if ( msie > 0 ){ // If Internet Explorer, return version number\n");
gvputs(job, " ievers= parseInt (ua.substring (msie+5, ua.indexOf ('.', msie )))\n");
gvputs(job, " }\n");
gvputs(job, " if (ievers>=5){\n");
gvputs(job, " for (x in VMLyes){\n");
gvputs(job, " item = document.getElementById(VMLyes[x]);\n");
gvputs(job, " if (item) {\n");
gvputs(job, " item.style.visibility='visible';\n");
gvputs(job, " }\n");
gvputs(job, " }\n");
gvputs(job, " for (x in VMLno){\n");
gvputs(job, " item = document.getElementById(VMLno[x]);\n");
gvputs(job, " if (item) {\n");
gvputs(job, " item.style.visibility='hidden';\n");
gvputs(job, " }\n");
gvputs(job, " }\n");
gvputs(job, " }else{\n");
gvputs(job, " for (x in VMLyes){\n");
gvputs(job, " item = document.getElementById(VMLyes[x]);\n");
gvputs(job, " if (item) {\n");
gvputs(job, " item.style.visibility='hidden';\n");
gvputs(job, " }\n");
gvputs(job, " }\n");
gvputs(job, " for (x in VMLno){\n");
gvputs(job, " item = document.getElementById(VMLno[x]);\n");
gvputs(job, " if (item) {\n");
gvputs(job, " item.style.visibility='visible';\n");
gvputs(job, " }\n");
gvputs(job, " }\n");
gvputs(job, " }\n");
gvputs(job, " }\n");
gvputs(job, " </SCRIPT>\n");
gvputs(job, "</HEAD>");
gvputs(job, "<BODY onload='browsercheck();'>\n");
/* add 10pt pad to the bottom of the graph */
gvputs(job, "<DIV id='_VML1_' style=\"position:relative; display:inline; visibility:hidden");
gvprintf(job, " width: %dpt; height: %dpt\">\n", graphWidth, 10+graphHeight);
gvputs(job, "<STYLE>\n");
gvputs(job, "v\\:* { behavior: url(#default#VML);display:inline-block}\n");
gvputs(job, "</STYLE>\n");
gvputs(job, "<xml:namespace ns=\"urn:schemas-microsoft-com:vml\" prefix=\"v\" />\n");
gvputs(job, " <v:group style=\"position:relative; ");
gvprintf(job, " width: %dpt; height: %dpt\"", graphWidth, graphHeight);
gvprintf(job, " coordorigin=\"0,0\" coordsize=\"%d,%d\" >", graphWidth, graphHeight);
}
static void vml_end_graph(GVJ_t * job)
{
gvputs(job, "</v:group>\n");
gvputs(job, "</DIV>\n");
/* add 10pt pad to the bottom of the graph */
gvputs(job, "<DIV id='_VML2_' style=\"position:relative;visibility:hidden\">\n");
gvputs(job, "<!-- insert any other html content here -->\n");
gvputs(job, "</DIV>\n");
gvputs(job, "<DIV id='_notVML1_' style=\"position:relative;\">\n");
gvputs(job, "<!-- this should only display on NON-IE browsers -->\n");
gvputs(job, "<H2>Sorry, this diagram will only display correctly on Internet Explorer 5 (and up) browsers.</H2>\n");
gvputs(job, "</DIV>\n");
gvputs(job, "<DIV id='_notVML2_' style=\"position:relative;\">\n");
gvputs(job, "<!-- insert any other NON-IE html content here -->\n");
gvputs(job, "</DIV>\n");
gvputs(job, "</BODY>\n</HTML>\n");
}
static void
vml_begin_anchor(GVJ_t * job, char *href, char *tooltip, char *target, char *id)
{
gvputs(job, "<a");
if (href && href[0])
gvprintf(job, " href=\"%s\"", html_string(href));
if (tooltip && tooltip[0])
gvprintf(job, " title=\"%s\"", html_string(tooltip));
if (target && target[0])
gvprintf(job, " target=\"%s\"", html_string(target));
gvputs(job, ">\n");
}
static void vml_end_anchor(GVJ_t * job)
{
gvputs(job, "</a>\n");
}
static void vml_textspan(GVJ_t * job, pointf p, textspan_t * span)
{
pointf p1,p2;
obj_state_t *obj = job->obj;
PostscriptAlias *pA;
switch (span->just) {
case 'l':
p1.x=p.x;
break;
case 'r':
p1.x=p.x-span->size.x;
break;
default:
case 'n':
p1.x=p.x-(span->size.x/2);
break;
}
p2.x=p1.x+span->size.x;
if (span->size.y < span->font->size){
span->size.y = 1 + (1.1*span->font->size);
}
p1.x-=8; /* vml textbox margin fudge factor */
p2.x+=8; /* vml textbox margin fudge factor */
p2.y=graphHeight-(p.y);
p1.y=(p2.y-span->size.y);
/* text "y" was too high
* Graphviz uses "baseline", VML seems to use bottom of descenders - so we fudge a little
* (heuristics - based on eyeballs) */
if (span->font->size <12.){ /* see graphs/directed/arrows.gv */
p1.y+=1.4+span->font->size/5; /* adjust by approx. descender */
p2.y+=1.4+span->font->size/5; /* adjust by approx. descender */
}else{
p1.y+=2+span->font->size/5; /* adjust by approx. descender */
p2.y+=2+span->font->size/5; /* adjust by approx. descender */
}
gvprintf(job, "<v:rect style=\"position:absolute; ");
gvprintf(job, " left: %.2f; top: %.2f;", p1.x, p1.y);
gvprintf(job, " width: %.2f; height: %.2f\"", p2.x-p1.x, p2.y-p1.y);
gvputs(job, " stroked=\"false\" filled=\"false\">\n");
gvputs(job, "<v:textbox inset=\"0,0,0,0\" style=\"position:absolute; v-text-wrapping:'false';padding:'0';");
pA = span->font->postscript_alias;
if (pA) {
gvprintf(job, "font-family: '%s';", pA->family);
if (pA->weight)
gvprintf(job, "font-weight: %s;", pA->weight);
if (pA->stretch)
gvprintf(job, "font-stretch: %s;", pA->stretch);
if (pA->style)
gvprintf(job, "font-style: %s;", pA->style);
}
else {
gvprintf(job, "font-family: \'%s\';", span->font->name);
}
gvprintf(job, " font-size: %.2fpt;", span->font->size);
switch (obj->pencolor.type) {
case COLOR_STRING:
if (strcasecmp(obj->pencolor.u.string, "black"))
gvprintf(job, "color:%s;", obj->pencolor.u.string);
break;
case RGBA_BYTE:
gvprintf(job, "color:#%02x%02x%02x;",
obj->pencolor.u.rgba[0], obj->pencolor.u.rgba[1], obj->pencolor.u.rgba[2]);
break;
default:
assert(0); /* internal error */
}
gvputs(job, "\"><center>");
gvputs(job, html_string(span->str));
gvputs(job, "</center></v:textbox>\n");
gvputs(job, "</v:rect>\n");
}
static void vml_ellipse(GVJ_t * job, pointf * A, int filled)
{
double dx, dy, left, right, top, bottom;
/* A[] contains 2 points: the center and corner. */
gvputs(job, " <v:oval style=\"position:absolute;");
dx=A[1].x-A[0].x;
dy=A[1].y-A[0].y;
top=graphHeight-(A[0].y+dy);
bottom=top+dy+dy;
left=A[0].x - dx;
right=A[1].x;
gvprintf(job, " left: %.2f; top: %.2f;",left, top);
gvprintf(job, " width: %.2f; height: %.2f\"", 2*dx, 2*dy);
vml_grfill(job, filled);
gvputs(job, " >");
vml_grstroke(job, filled);
gvputs(job, "</v:oval>\n");
}
static void
vml_bezier(GVJ_t * job, pointf * A, int n, int arrow_at_start,
int arrow_at_end, int filled)
{
gvputs(job, " <v:shape style=\"position:absolute; ");
gvprintf(job, " width: %d; height: %d\"", graphWidth, graphHeight);
vml_grfill(job, filled);
gvputs(job, " >");
vml_grstroke(job, filled);
gvputs(job, "<v:path v=\"");
vml_bzptarray(job, A, n);
gvputs(job, "/></v:shape>\n");
}
static void vml_polygon(GVJ_t * job, pointf * A, int n, int filled)
{
int i;
double px,py;
gvputs(job, " <v:shape style=\"position:absolute; ");
gvprintf(job, " width: %d; height: %d\"", graphWidth, graphHeight);
vml_grfill(job, filled);
gvputs(job, " >");
vml_grstroke(job, filled);
gvputs(job, "<v:path v=\"");
for (i = 0; i < n; i++)
{
px=A[i].x;
py= (graphHeight-A[i].y);
if (i==0){
gvputs(job, "m ");
}
/* integers only in path */
gvprintf(job, "%.0f %.0f ", px, py);
if (i==0) gvputs(job, "l ");
if (i==n-1) gvputs(job, "x e \"/>");
}
gvputs(job, "</v:shape>\n");
}
static void vml_polyline(GVJ_t * job, pointf * A, int n)
{
int i;
gvputs(job, " <v:shape style=\"position:absolute; ");
gvprintf(job, " width: %d; height: %d\" filled=\"false\">", graphWidth, graphHeight);
gvputs(job, "<v:path v=\"");
for (i = 0; i < n; i++)
{
if (i==0) gvputs(job, " m ");
gvprintf(job, "%.0f,%.0f ", A[i].x, graphHeight-A[i].y);
if (i==0) gvputs(job, " l ");
if (i==n-1) gvputs(job, " e "); /* no x here for polyline */
}
gvputs(job, "\"/>");
vml_grstroke(job, 0); /* no fill here for polyline */
gvputs(job, "</v:shape>\n");
}
/* color names from
http://msdn.microsoft.com/en-us/library/bb250525(VS.85).aspx#t.color
*/
/* NB. List must be LANG_C sorted */
static char *vml_knowncolors[] = {
"aqua", "black", "blue", "fuchsia",
"gray", "green", "lime", "maroon",
"navy", "olive", "purple", "red",
"silver", "teal", "white", "yellow"
};
gvrender_engine_t vml_engine = {
vml_begin_job,
0, /* vml_end_job */
vml_begin_graph,
vml_end_graph,
0, /* vml_begin_layer */
0, /* vml_end_layer */
0, /* vml_begin_page */
0, /* vml_end_page */
0, /* vml_begin_cluster */
0, /* vml_end_cluster */
0, /* vml_begin_nodes */
0, /* vml_end_nodes */
0, /* vml_begin_edges */
0, /* vml_end_edges */
0, /* vml_begin_node */
0, /* vml_end_node */
0, /* vml_begin_edge */
0, /* vml_end_edge */
vml_begin_anchor,
vml_end_anchor,
0, /* vml_begin_label */
0, /* vml_end_label */
vml_textspan,
0, /* vml_resolve_color */
vml_ellipse,
vml_polygon,
vml_bezier,
vml_polyline,
vml_comment,
0, /* vml_library_shape */
};
gvrender_features_t render_features_vml = {
GVRENDER_Y_GOES_DOWN
| GVRENDER_DOES_TRANSFORM
| GVRENDER_DOES_LABELS
| GVRENDER_DOES_MAPS
| GVRENDER_DOES_TARGETS
| GVRENDER_DOES_TOOLTIPS, /* flags */
0., /* default pad - graph units */
vml_knowncolors, /* knowncolors */
sizeof(vml_knowncolors) / sizeof(char *), /* sizeof knowncolors */
RGBA_BYTE, /* color_type */
};
gvdevice_features_t device_features_vml = {
GVDEVICE_DOES_TRUECOLOR, /* flags */
{0.,0.}, /* default margin - points */
{0.,0.}, /* default page width, height - points */
{96.,96.}, /* default dpi */
};
gvdevice_features_t device_features_vmlz = {
GVDEVICE_DOES_TRUECOLOR
| GVDEVICE_COMPRESSED_FORMAT, /* flags */
{0.,0.}, /* default margin - points */
{0.,0.}, /* default page width, height - points */
{96.,96.}, /* default dpi */
};
gvplugin_installed_t gvrender_vml_types[] = {
{FORMAT_VML, "vml", 1, &vml_engine, &render_features_vml},
{0, NULL, 0, NULL, NULL}
};
gvplugin_installed_t gvdevice_vml_types[] = {
{FORMAT_VML, "vml:vml", 1, NULL, &device_features_vml},
#if HAVE_LIBZ
{FORMAT_VMLZ, "vmlz:vml", 1, NULL, &device_features_vmlz},
#endif
{0, NULL, 0, NULL, NULL}
};
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env perl
# modules
use Getopt::Long;
use Tie::File;
my $separator = "\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/";
# command line options
my $opt_help = 0;
# Parse command line
$opt_help=1 unless GetOptions ( 'help' => \$opt_help, );
sub show_help ()
{
print <<ZZZ;
format-files.pl [files] : Formats source files
options:
--help Show this help
ZZZ
}
sub process ($)
{
my ($filename)=@_;
my $lr = 0;
my $lc = 0;
my $li = 0;
my $ls = 0;
my $lss= 0;
# process doxygen /** ... */ comments
tie @lines, 'Tie::File', $filename or die ("Error opening file $filename!\n");
for (my $i = 0; $i < scalar @lines; $i++)
{
my $fline = $lines[$i];
if ($fline =~ m/^(\s*)\/\*\*/)
{
# delete lines with /**
splice @lines, $i, 1;
$i--; $lr++;
# loop until finding */
for (my $j = $i; $j < scalar @lines ; $j++)
{
$fline = $lines[$j];
# stop if */
last if ($fline =~ m/^(\s*)\*\//);
# correct * to ///
if ($fline =~ m/^(\s*)\*(\s*)[^\s]/)
{
$lines[$j] =~ s/^(\s*)\*/\1\/\/\//;
$lc++;
}
# delete lines with * only
if ($fline =~ m/^(\s*)\*(\s*)$/)
{
splice @lines, $j, 1;
$j--; $lr++;
}
}
}
# delete lines with */
if ($lines[$i] =~ m/^(\s*)\*\//)
{
splice @lines, $i, 1;
$i--; $lr++;
}
}
untie @lines;
# correct indentations
tie @lines, 'Tie::File', $filename or die ("Error opening file $filename!\n");
foreach ( @lines )
{
if (($_ =~ m/^\s[^\s]/) or ($_ =~ m/^\s\s\s[^\s]/) or ($_ =~ m/^\s\s\s\s\s[^\s]/) or ($_ =~ m/^\s\s\s\s\s\s\s[^\s]/) ) { $li++; }
s/^\s([^\s])/\1/;
s/^\s\s\s([^\s])/ \1/;
s/^\s\s\s\s\s([^\s])/ \1/;
s/^\s\s\s\s\s\s\s([^\s])/ \1/;
}
untie @lines;
# remove trailing spaces
tie @lines, 'Tie::File', $filename or die ("Error opening file $filename!\n");
foreach ( @lines )
{
if ($_ =~ m/\s+$/) { $ls++; }
s/\s+$//;
}
untie @lines;
# correct separator lines
tie @lines, 'Tie::File', $filename or die ("Error opening file $filename!\n");
foreach ( @lines )
{
if (($_ =~ m/^\/\/\/\/(\/*)$/) and ($_ !~ m/^$separator$/) )
{
s/^\/\/\/\/(\/*)$/$separator/;
$lss++;
}
}
untie @lines;
# convert tabs to spaces
tie @lines, 'Tie::File', $filename or die ("Error opening file $filename!\n");
foreach ( @lines )
{
s/\t/ /;
}
untie @lines;
my $nc = $lc + $li + $ls + $lr + $lss;
print "$filename changed $nc lines ( $li indentations, $ls trail spaces, $lss separators, $lc comments changes and $lr removed )\n" unless ($nc eq 0 )
}
#==========================================================================
unless ($opt_help eq 0)
{
show_help();
exit(0);
}
foreach $file (@ARGV)
{
if (( -e $file ) and ( -r $file ))
{
process ("$file");
}
else
{
print "$file either does not exist or is not readable\n";
exit(1);
}
}
| {
"pile_set_name": "Github"
} |
/* This file is part of Clementine.
Copyright 2010, David Sansome <[email protected]>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine 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 Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GLOBALSHORTCUTGRABBER_H
#define GLOBALSHORTCUTGRABBER_H
#include <QDialog>
class MacMonitorWrapper;
class Ui_GlobalShortcutGrabber;
#ifdef __OBJC__
@class NSEvent;
#else
class NSEvent;
#endif
class GlobalShortcutGrabber : public QDialog {
Q_OBJECT
public:
GlobalShortcutGrabber(QWidget* parent = nullptr);
~GlobalShortcutGrabber();
QKeySequence GetKey(const QString& name);
protected:
bool event(QEvent*);
void showEvent(QShowEvent*);
void hideEvent(QHideEvent*);
void grabKeyboard();
void releaseKeyboard();
private:
void UpdateText();
void SetupMacEventHandler();
void TeardownMacEventHandler();
bool HandleMacEvent(NSEvent*);
Ui_GlobalShortcutGrabber* ui_;
QKeySequence ret_;
QList<int> modifier_keys_;
MacMonitorWrapper* wrapper_;
};
#endif // GLOBALSHORTCUTGRABBER_H
| {
"pile_set_name": "Github"
} |
#!/bin/bash
git ls-files -s $@ | grep -v "^16000" | cut -f2- | \
xargs -n1 git blame --line-porcelain HEAD | sed -nr 's,^author (.*),\1,p' | \
sort | uniq -c | sort -nr
| {
"pile_set_name": "Github"
} |
<ReducedOrderModel>
<ans2>
<mean>15.0</mean>
<approx_variance>54.9333333333</approx_variance>
<impacts>
<approx_tot_variance>54.9333333333</approx_tot_variance>
<variables>x2
<impact_param>0.899676375405</impact_param>
</variables>
<variables>x3
<impact_param>0.0987055016181</impact_param>
</variables>
<variables>x1
<impact_param>0.00161812297735</impact_param>
</variables>
<variables>x1,x2
<impact_param>-2.06954194882e-15</impact_param>
</variables>
<variables>x1,x2,x3
<impact_param>1.55215646161e-15</impact_param>
</variables>
<variables>x1,x3
<impact_param>0.0</impact_param>
</variables>
<variables>x2,x3
<impact_param>-1.55215646161e-15</impact_param>
</variables>
</impacts>
<numRuns>69</numRuns>
</ans2>
<ans>
<mean>5.5</mean>
<approx_variance>1.75</approx_variance>
<impacts>
<approx_tot_variance>1.75</approx_tot_variance>
<variables>x2
<impact_param>0.761904761905</impact_param>
</variables>
<variables>x3
<impact_param>0.190476190476</impact_param>
</variables>
<variables>x1
<impact_param>0.047619047619</impact_param>
</variables>
<variables>x1,x2
<impact_param>0.0</impact_param>
</variables>
<variables>x1,x2,x3
<impact_param>0.0</impact_param>
</variables>
<variables>x1,x3
<impact_param>0.0</impact_param>
</variables>
<variables>x2,x3
<impact_param>0.0</impact_param>
</variables>
</impacts>
<numRuns>69</numRuns>
</ans>
</ReducedOrderModel>
| {
"pile_set_name": "Github"
} |
/*******************************************************************************
* Copyright (c) 2012 Luaj.org. All rights reserved.
*
* 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.luaj.vm2.ast;
/** Base class for syntax elements of the parse tree that appear in source files.
* The LuaParser class will fill these values out during parsing for use in
* syntax highlighting, for example.
*/
public class SyntaxElement {
/** The line number on which the element begins. */
public int beginLine;
/** The column at which the element begins. */
public short beginColumn;
/** The line number on which the element ends. */
public int endLine;
/** The column at which the element ends. */
public short endColumn;
}
| {
"pile_set_name": "Github"
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TimeIntervalsScrollViewer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TimeIntervalsScrollViewer")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a6ce41ad-8de3-4fda-9ed2-b8be58d52c0c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"pile_set_name": "Github"
} |
{
"language": "en-US",
"messages": [
{
"id": "Hello {From}!\n",
"key": "Hello %s!\n",
"message": "Hello {From}!\n",
"translation": "",
"placeholders": [
{
"id": "From",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "r.Header.Get(\"From\")"
}
],
"position": "golang.org/x/text/cmd/gotext/examples/extract_http/pkg/pkg.go:22:11"
},
{
"id": "Do you like your browser ({User_Agent})?\n",
"key": "Do you like your browser (%s)?\n",
"message": "Do you like your browser ({User_Agent})?\n",
"translation": "",
"placeholders": [
{
"id": "User_Agent",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "r.Header.Get(\"User-Agent\")"
}
],
"position": "golang.org/x/text/cmd/gotext/examples/extract_http/pkg/pkg.go:24:11"
}
]
} | {
"pile_set_name": "Github"
} |
#import <Foundation/Foundation.h>
@class MSCrashes;
@class MSErrorReport;
@class MSErrorAttachmentLog;
@protocol MSCrashesDelegate <NSObject>
@optional
/**
* Callback method that will be called before processing errors.
*
* @param crashes The instance of MSCrashes.
* @param errorReport The errorReport that will be sent.
*
* @discussion Crashes will send logs to the server or discard/delete logs based on this method's return value.
*/
- (BOOL)crashes:(MSCrashes *)crashes shouldProcessErrorReport:(MSErrorReport *)errorReport;
/**
* Callback method that will be called before each error will be send to the server.
*
* @param crashes The instance of MSCrashes.
* @param errorReport The errorReport that will be sent.
*
* @discussion Use this callback to display custom UI while crashes are sent to the server.
*/
- (void)crashes:(MSCrashes *)crashes willSendErrorReport:(MSErrorReport *)errorReport;
/**
* Callback method that will be called in case the SDK was unable to send an error report to the server.
*
* @param crashes The instance of MSCrashes.
* @param errorReport The errorReport that Mobile Center sent.
*
* @discussion Use this method to hide your custom UI.
*/
- (void)crashes:(MSCrashes *)crashes didSucceedSendingErrorReport:(MSErrorReport *)errorReport;
/**
* Callback method that will be called in case the SDK was unable to send an error report to the server.
*
* @param crashes The instance of MSCrashes.
* @param errorReport The errorReport that Mobile Center tried to send.
* @param error The error that occurred.
*/
- (void)crashes:(MSCrashes *)crashes didFailSendingErrorReport:(MSErrorReport *)errorReport withError:(NSError *)error;
/**
* Method to get the attachments associated to an error report.
*
* @param crashes The instance of MSCrashes.
* @param errorReport The errorReport associated with the returned attachments.
*
* @return The attachements associated with the given error report or nil if the error report doesn't have any
* attachments.
*
* @discussion Implement this method if you want attachments to the given error report.
*/
- (NSArray<MSErrorAttachmentLog *> *)attachmentsWithCrashes:(MSCrashes *)crashes
forErrorReport:(MSErrorReport *)errorReport;
@end
| {
"pile_set_name": "Github"
} |
/*
Copyright 2014 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package network
// TODO: Consider making this value configurable.
const DefaultInterfaceName = "eth0"
| {
"pile_set_name": "Github"
} |
/***************************************************************************\
|* Copyright (c) 1994 Microsoft Corporation *|
|* Developed for Microsoft by TriplePoint, Inc. Beaverton, Oregon *|
|* *|
|* This file is part of the HT Communications DSU41 WAN Miniport Driver. *|
\***************************************************************************/
#include "version.h"
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Module Name:
debug.c
Abstract:
This module contains code to support driver debugging.
Author:
Larry Hattery - TriplePoint, Inc. ([email protected]) Jun-94
Environment:
Development only.
Revision History:
---------------------------------------------------------------------------*/
#include <ndis.h>
#if DBG
VOID
DbgPrintData(
IN PUCHAR Data,
IN UINT NumBytes,
IN ULONG Offset
)
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Routine Description:
Dumps data to the debug display formated in hex and ascii for easy viewing.
Used for debug output only. It is not compiled into the retail version.
Arguments:
Data Buffer of data to be displayed
NumBytes Number of bytes to display
Offset Beginning offset to be displayed before each line
Return Value:
None
---------------------------------------------------------------------------*/
{
UINT i,j;
for (i = 0; i < NumBytes; i += 16)
{
DbgPrint("%04lx: ", i + Offset);
/*
// Output the hex bytes
*/
for (j = i; j < (i+16); j++)
{
if (j < NumBytes)
{
DbgPrint("%02x ",(UINT)((UCHAR)*(Data+j)));
}
else
{
DbgPrint(" ");
}
}
DbgPrint(" ");
/*
// Output the ASCII bytes
*/
for (j = i; j < (i+16); j++)
{
if (j < NumBytes)
{
char c = *(Data+j);
if (c < ' ' || c > 'Z')
{
c = '.';
}
DbgPrint("%c", (UINT)c);
}
else
{
DbgPrint(" ");
}
}
DbgPrint("\n");
}
}
#endif
| {
"pile_set_name": "Github"
} |
#include "CRenderer.hpp"
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
//#include <iostream.h>
#include <gl/glut.h>
#include <gl/gl.h>
#include "glext.h"
#define _USE_MATH_DEFINES
#include <math.h>
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB = 0;
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
/* GL_ATI_texture_float */
#define GL_RGBA_FLOAT32_ATI 0x8814
#define GL_RGB_FLOAT32_ATI 0x8815
#define GL_ALPHA_FLOAT32_ATI 0x8816
#define GL_INTENSITY_FLOAT32_ATI 0x8817
#define GL_LUMINANCE_FLOAT32_ATI 0x8818
#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
#define GL_RGBA_FLOAT16_ATI 0x881A
#define GL_RGB_FLOAT16_ATI 0x881B
#define GL_ALPHA_FLOAT16_ATI 0x881C
#define GL_INTENSITY_FLOAT16_ATI 0x881D
#define GL_LUMINANCE_FLOAT16_ATI 0x881E
#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
typedef int intptrARB;
typedef unsigned int sizeiptrARB;
typedef void (APIENTRY * glBindBufferARBPROC) (GLenum target, GLuint buffer);
typedef void (APIENTRY * glDeleteBuffersARBPROC) (GLsizei n, const GLuint *buffers);
typedef void (APIENTRY * glGenBuffersARBPROC) (GLsizei n, GLuint *buffers);
typedef GLboolean (APIENTRY * glIsBufferARBPROC) (GLuint buffer);
typedef void (APIENTRY * glBufferDataARBPROC) (GLenum target, sizeiptrARB size, const void *data, GLenum usage);
typedef void (APIENTRY * glBufferSubDataARBPROC) (GLenum target, intptrARB offset, sizeiptrARB size, const void *data);
typedef void (APIENTRY * glGetBufferSubDataARBPROC) (GLenum target, intptrARB offset, sizeiptrARB size, void *data);
typedef void * (APIENTRY * glMapBufferARBPROC) (GLenum target, GLenum access);
typedef GLboolean (APIENTRY * glUnmapBufferARBPROC) (GLenum target);
typedef void (APIENTRY * glGetBufferParameterivARBPROC) (GLenum target, GLenum pname, int *params);
typedef void (APIENTRY * glGetBufferPointervARBPROC) (GLenum target, GLenum pname, void **params);
extern glBindBufferARBPROC glBindBufferARB;
extern glDeleteBuffersARBPROC glDeleteBuffersARB;
extern glGenBuffersARBPROC glGenBuffersARB;
extern glIsBufferARBPROC glIsBufferARB;
extern glBufferDataARBPROC glBufferDataARB;
extern glBufferSubDataARBPROC glBufferSubDataARB;
extern glGetBufferSubDataARBPROC glGetBufferSubDataARB;
extern glMapBufferARBPROC glMapBufferARB;
extern glUnmapBufferARBPROC glUnmapBufferARB;
extern glGetBufferParameterivARBPROC glGetBufferParameterivARB;
extern glGetBufferPointervARBPROC glGetBufferPointervARB;
glBindBufferARBPROC glBindBufferARB = 0;
glDeleteBuffersARBPROC glDeleteBuffersARB = 0;
glGenBuffersARBPROC glGenBuffersARB = 0;
glIsBufferARBPROC glIsBufferARB = 0;
glBufferDataARBPROC glBufferDataARB = 0;
glBufferSubDataARBPROC glBufferSubDataARB = 0;
glGetBufferSubDataARBPROC glGetBufferSubDataARB = 0;
glMapBufferARBPROC glMapBufferARB = 0;
glUnmapBufferARBPROC glUnmapBufferARB = 0;
glGetBufferParameterivARBPROC glGetBufferParameterivARB = 0;
glGetBufferPointervARBPROC glGetBufferPointervARB = 0;
#define LandSize 128
BYTE LandH[LandSize][LandSize];
unsigned int VBO_ID;
unsigned int IBO_ID;
int nInd, nVert;
extern float CamX;
extern float CamY;
extern float CamZ;
CGprofile fpProfile = CG_PROFILE_FP40;
CGprofile vpProfile = CG_PROFILE_VP40;
#define WaterImages 16
#define WaterTexSize 256
struct TVertexV1C {
float XYZ[3];
DWORD RGBA;
void Set(float X, float Y, float Z, DWORD aRGBA = 0) {
XYZ[0] = X; XYZ[1] = Y; XYZ[2] = Z;
}
};
float GetTime() {
return glutGet(GLenum(GLUT_ELAPSED_TIME)) * .001f;
}
void LoadRaw(char *RawFN, void *Data, int SizeBytes) {
FILE *F = fopen(RawFN,"rb");
fread(Data, SizeBytes, 1, F);
fclose(F);
}
int make_tex(BYTE *pBuf, int texSize, int Wrap = 1, int nChan = 3) {
GLuint ID; glGenTextures(1, &ID);
glBindTexture(GL_TEXTURE_2D, ID);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, (Wrap? GL_REPEAT : GL_CLAMP_TO_EDGE));
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, (Wrap? GL_REPEAT : GL_CLAMP_TO_EDGE));
// SGIS_generate_mipmap extension must exist
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexImage2D( GL_TEXTURE_2D, 0, nChan==3?GL_RGB8:GL_RGBA8, texSize, texSize, 0,
nChan==3?GL_RGB:GL_RGBA, GL_UNSIGNED_BYTE, pBuf);
return ID;
}
int load_tex(char *string, int texSize, int Wrap = 1, int nChan = 3) {
BYTE *pBuf = new BYTE[texSize*texSize*nChan];
LoadRaw(string, pBuf, texSize*texSize*nChan);
GLuint ID = make_tex(pBuf, texSize, Wrap, nChan);
delete[] pBuf;
return ID;
}
int load_texlist(char *stringmask, GLuint *IDS, int Count, int texSize, int Wrap = 1) {
for (int i = 0; i < Count; i++) {
char FN[80]; sprintf(FN, stringmask, i);
IDS[i] = load_tex(FN, texSize, Wrap);
}
return 1;
}
int BuildFreshel_tex(int texSize) {
float refractionIndexRatio = 1.3333333f; // Water refraction koef
float FreshelK0 = pow(1.0-refractionIndexRatio, 2.0) / pow(1.0+refractionIndexRatio, 2.0);
BYTE *pBuf = new BYTE[texSize*texSize*3];
BYTE *pB = pBuf;
for (int j = 0; j < texSize; j++) {
float L = float(j)/texSize;
for (int i = 0; i < texSize; i++) {
float CosT = float(i)/texSize;
float K = (FreshelK0+(1-FreshelK0)*pow((1-CosT),5))*L;
pB[0] = pB[1] = pB[2] = int(K*255.0f);
pB+=3;
}
}
GLuint ID = make_tex(pBuf, texSize, 0);
delete[] pBuf;
return ID;
}
int load_cubemap(const char *string, int texSize) {
GLenum CubeSides[6] = {
GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB
};
char CN[6][5] = {{"posx"}, {"negx"}, {"negy"}, {"posy"}, {"posz"}, {"negz"}};
GLuint CubeMapID; glGenTextures(1, &CubeMapID);
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, CubeMapID);
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
BYTE *pBuf = new BYTE[texSize*texSize*3];
for (int i = 0; i < 6; i++) {
char buff[1024];
sprintf(buff, string, CN[i]);
LoadRaw(buff, pBuf, texSize*texSize*3);
// SGIS_generate_mipmap extension must exist
glTexImage2D( CubeSides[i], 0, GL_RGB8, texSize, texSize, 0, GL_RGB, GL_UNSIGNED_BYTE, pBuf);
}
delete[] pBuf;
return CubeMapID;
}
inline void EnableTexGenScreen() {
float mtxTex[16] = {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, 1.0
};
glTexGeni (GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni (GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni (GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni (GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGenfv(GL_S, GL_OBJECT_PLANE, mtxTex);
glTexGenfv(GL_T, GL_OBJECT_PLANE, mtxTex+4);
glTexGenfv(GL_R, GL_OBJECT_PLANE, mtxTex+8);
glTexGenfv(GL_Q, GL_OBJECT_PLANE, mtxTex+12);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_GEN_R);
glEnable(GL_TEXTURE_GEN_Q);
}
inline void DisableTexGenScreen() {
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_TEXTURE_GEN_R);
glDisable(GL_TEXTURE_GEN_Q);
}
void SetScreenPrjMatrix() {
//Use convertion to homogenies coord
float mtxMView[16];
float mtxPrj[16];
glGetFloatv(GL_MODELVIEW_MATRIX, mtxMView);
glGetFloatv(GL_PROJECTION_MATRIX, mtxPrj);
float ScaleMtx[16] = {0.5, 0.0, 0.0, 0.0,
0.0, 0.5, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.5, 0.5, 0.0, 1.0
};
glLoadMatrixf(ScaleMtx);
glMultMatrixf(mtxPrj);
glMultMatrixf(mtxMView);
}
static void CheckCgError(CGcontext Context = 0)
{
CGerror err = cgGetError();
if (err != CG_NO_ERROR) {
printf("CG error: %s \n", cgGetErrorString(err));
printf("%s \n", cgGetLastListing(Context));
}
}
// ***************************************************************************
// ** Name: InitResources
// ** Desc: Initialize all resources that we need
// ***************************************************************************
void CRenderer::Initialize()
{
m_LightPos[0] = 0.0;
m_LightPos[1] = 1.0;
m_LightPos[2] = 0.0;
// Create cgContext.
Context = cgCreateContext();
CheckCgError();
//fragmentProfile = CG_PROFILE_ARBFP1;
//fragmentProfile = cgGetProfile("fp40");
//fragmentProfile = CG_PROFILE_FP40;
fragmentProgram = cgCreateProgramFromFile(Context,
CG_SOURCE, "fpWaterDM.cg", fpProfile, NULL, NULL);
CheckCgError(Context);
cgGLLoadProgram(fragmentProgram);
CheckCgError(Context);
for(int k = 0; k < 10; k++) {
char S[4]; sprintf(S, "c%i", k);
fpVars.c[k] = cgGetNamedParameter(fragmentProgram, S);
}
fpVars.dXYMap = cgGetNamedParameter(fragmentProgram, "dXYMap");
fpVars.dXYMap1 = cgGetNamedParameter(fragmentProgram, "dXYMap1");
fpVars.EnvCMap = cgGetNamedParameter(fragmentProgram, "EnvCMap");
fpVars.FoamMap = cgGetNamedParameter(fragmentProgram, "FoamMap");
CheckCgError(Context);
// VBO ext must exists
glBindBufferARB = (glBindBufferARBPROC) wglGetProcAddress("glBindBufferARB");
glDeleteBuffersARB = (glDeleteBuffersARBPROC) wglGetProcAddress("glDeleteBuffersARB");
glGenBuffersARB = (glGenBuffersARBPROC) wglGetProcAddress("glGenBuffersARB");
glIsBufferARB = (glIsBufferARBPROC) wglGetProcAddress("glIsBufferARB");
glBufferDataARB = (glBufferDataARBPROC) wglGetProcAddress("glBufferDataARB");
glBufferSubDataARB = (glBufferSubDataARBPROC) wglGetProcAddress("glBufferSubDataARB");
glGetBufferSubDataARB = (glGetBufferSubDataARBPROC) wglGetProcAddress("glGetBufferSubDataARB");
glMapBufferARB = (glMapBufferARBPROC) wglGetProcAddress("glMapBufferARB");
glUnmapBufferARB = (glUnmapBufferARBPROC) wglGetProcAddress("glUnmapBufferARB");
glGetBufferParameterivARB = (glGetBufferParameterivARBPROC) wglGetProcAddress("glGetBufferParameterivARB");
glGetBufferPointervARB = (glGetBufferPointervARBPROC) wglGetProcAddress("glGetBufferPointervARB");
CheckCgError();
vertexProgram = cgCreateProgramFromFile(Context,
CG_SOURCE,
"vpWaterDM.cg",
vpProfile, NULL,
NULL//(const char **)CharArray //NULL
);
CheckCgError(Context);
if(vertexProgram != NULL){
cgGLLoadProgram(vertexProgram);
CheckCgError();
}
vpVars.VOfs = cgGetNamedParameter(vertexProgram, "VOfs");
vpVars.CPos = cgGetNamedParameter(vertexProgram, "CPos");
vpVars.Gabarites = cgGetNamedParameter(vertexProgram, "Gabarites");
vpVars.HMap0 = cgGetNamedParameter(vertexProgram, "HMap0");
vpVars.HMap1 = cgGetNamedParameter(vertexProgram, "HMap1");
CreateNoiseTexture();
// Create texture surface
glGenTextures(1, &m_TextureID);
glBindTexture(GL_TEXTURE_2D, m_TextureID);
glEnable(GL_TEXTURE_2D);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
// SGIS_generate_mipmap extension must exist
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexImage2D(GL_TEXTURE_2D,0, GL_LUMINANCE, TEXTUREWIDTH, TEXTUREWIDTH, 0, GL_LUMINANCE, GL_FLOAT, m_pfNoiseTextureMap);
glDisable(GL_TEXTURE_2D);
// Freshel Texture
FreshelID = BuildFreshel_tex(128);
Cube0ID = load_cubemap("Data/Terrain_%s.raw", 512);
// load_texlist("Data/WaterNoise%02iDOT3.raw", NMapID, 16, 256);
NoiseID = load_tex("Data/Noise.raw", 256);
LoadRaw("Data/Land_H.raw", LandH, sizeof(LandH));
LandCID = load_tex("Data/Land_C.raw", 512);
glGenTextures(1, &WaterReflID);
glBindTexture(GL_TEXTURE_2D, WaterReflID);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress("glActiveTextureARB");
#if 1
if (1) { //GL.NV_vertex_program3
GLint vtex_units;
glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, &vtex_units);
printf("VS3.0: Vertex texture units: %d\n", vtex_units);
FoamID = load_tex("Data/FoamNV40.raw", WaterTexSize, 1, 4);
float *BMap = new float[WaterTexSize*WaterTexSize];
BYTE *BMap1 = new BYTE[WaterTexSize*WaterTexSize];
BYTE *BMap2 = new BYTE[WaterTexSize*WaterTexSize];
float *pBuf = new float[WaterTexSize*WaterTexSize*4];
float *pBuf2 = new float[WaterTexSize*WaterTexSize*4];
float *pBuf4 = new float[WaterTexSize*WaterTexSize*4];
{ // 8 step interpolation between animation frames
for(int l = 0; l < WaterImages*8; l++) {
// Load Water maps, scale H to 0..1
// To do quadric /\ waves distorsion
char LoadFN[256];
if ((l%8)==0) {
if (l==0) {
sprintf(LoadFN, "Data/HMaps/WaterH" "%02i" ".raw", l/8);
LoadRaw(LoadFN, BMap1, WaterTexSize*WaterTexSize);
}
else { // Copy previous
memcpy(BMap1, BMap2, WaterTexSize*WaterTexSize);
}
}
{// Interpolate intermediate map
int l1= (l/8+1)&(WaterImages-1);
if ((l%8)==0) {
sprintf(LoadFN, "Data/HMaps/WaterH" "%02i" ".raw", l1);
LoadRaw(LoadFN, BMap2, WaterTexSize*WaterTexSize);
}
float R = float((l&7))/8.0f;
for (int y = 0; y < WaterTexSize; y++) {
for (int x = 0; x < WaterTexSize; x++) {
int PixAddr = y*WaterTexSize+x;
float t = float(BMap1[PixAddr])*(1-R)+float(BMap2[PixAddr])*R;
float H = pow((t/255.0f),1.7f);
if (H < 0) H = 0; if(H > 1.0f) H = 1.0f;
BMap[PixAddr] = H;
}
}
}
float *pB = pBuf;
// float MinV = 1.0f, MaxV = 0;
int Mask = WaterTexSize-1;
for (int y = 0; y < WaterTexSize; y++)
for (int x = 0; x < WaterTexSize; x++) {
float V = BMap[y*WaterTexSize+x];
// SetMinMax(V, MinV, MaxV);
pB[0] = V;
pB[1] = BMap[y*WaterTexSize+((x+1) & Mask)]-BMap[y*WaterTexSize+((x-1) & Mask)];
pB[2] = BMap[x+((y+1) & Mask)*WaterTexSize]-BMap[x+((y-1) & Mask)*WaterTexSize];
pB[1] = pB[1]*0.5*0.5+0.5;
pB[2] = pB[2]*0.5*0.5+0.5;
pB+=3;
}
pB = pBuf;
glGenTextures(1, &WaterReflDMID[l]);
glBindTexture(GL_TEXTURE_2D, WaterReflDMID[l]);
// if (GL.SGIS_generate_mipmap) glTexParameteri(GL_TEXTURE_2D,GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
int SZ = WaterTexSize;
for (y = 0; y < SZ; y++) {
for (int x = 0; x < SZ; x++) {
pBuf2[(y*SZ + x)*4+0] = pBuf[(y*SZ + x)*3+0];
}
}
float *pBuf3 = new float[(SZ/2)*(SZ/2)*4], *pB3 = pBuf3;
{
for (int k = 0; k < 10; k++) {
for (y = 0; y < SZ; y++) {
for (int x = 0; x < SZ; x++) {
//pBuf2[(y*SZ + x)*4+0] = pBuf[(y*SZ + x)*4+0];
pBuf2[(y*SZ + x)*4+1] = pBuf2[(y*SZ + (x+1)%SZ)*4+0];
pBuf2[(y*SZ + x)*4+2] = pBuf2[(((y+1)%SZ)*SZ + x)*4+0];
pBuf2[(y*SZ + x)*4+3] = pBuf2[(((y+1)%SZ)*SZ + (x+1)%SZ)*4+0];
}
}
// Load 2x downscaled - save memory 4x times
if (k > 0) {
glTexImage2D(GL_TEXTURE_2D, k-1, GL_RGBA_FLOAT32_ATI/*GL_LUMINANCE_FLOAT32_ATI*/,
SZ, SZ, 0, /*GL_LUMINANCE*/GL_RGBA, GL_FLOAT, pBuf2);
}
SZ/=2; int SZ2 = SZ*2;
if (SZ < 1) break;
for (int y = 0; y < SZ; y++) {
for (int x = 0; x < SZ; x++) {
float F = pBuf2[((y*2)*SZ2+x*2)*4+0];
F += pBuf2[((y*2)*SZ2+x*2+1)*4+0];
F += pBuf2[((y*2+1)*SZ2+x*2)*4+0];
F += pBuf2[((y*2+1)*SZ2+x*2+1)*4+0];
F/=4;
pBuf3[(y*SZ+x)*4+0] = F;
}
}
float *t = pBuf2; pBuf2 = pBuf3; pBuf3 = t;
}
}
pBuf3 = pB3; delete[] pB3;
glGenTextures(1, &WaterRefldXYID[l]);
glBindTexture(GL_TEXTURE_2D, WaterRefldXYID[l]);
glTexParameteri(GL_TEXTURE_2D,GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
{
for (int y = 0; y < WaterTexSize; y++) {
for (int x = 0; x < WaterTexSize; x++) {
int ii = (y*WaterTexSize + x);
pBuf4[ii*4+0] = pBuf[ii*3+0];
pBuf4[ii*4+1] = pBuf[ii*3+1];
pBuf4[ii*4+2] = pBuf[ii*3+2];
pBuf4[ii*4+3] = 1.0f;
}
}
}
// Load texture - with rejecting A-channel
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB_FLOAT16_ATI,
WaterTexSize, WaterTexSize, 0, GL_RGBA, GL_FLOAT, pBuf4);
}
}
delete [] pBuf;
delete [] pBuf2;
delete [] pBuf4;
delete [] BMap;
delete [] BMap1;
delete [] BMap2;
// Create radial grid ring
{
TVertexV1C *pVB = new TVertexV1C[512*384];
int *pIB = new int[(512+1)*(384+1)*6];
nVert = 0;
int j;
for(j = 0; j < 512; j++) {
float R0 = 1;//(SQR(j*RScale))*MaxR;
for (int i = 0; i < 384; i++) {
float A = (i*M_PI*2.0f)/384.0f;
float dX = cos(A), dY = sin(A); nVert++;
pVB[j*384+i].Set(R0*dX, R0*dY, j); //glVertex3fv(A.Get());
}
}
nInd = 0;
for (int i = 0; i < 384+1; i++) {
for(j = 0; j < 512-1; j++) {
int Ind[4] = {j*384+(i%384), (j+1)*384+(i%384), (j+1)*384+((i+1)%384), (j)*384+((i+1)%384)};
pIB[nInd++] = Ind[0]; pIB[nInd++] = Ind[1]; pIB[nInd++] = Ind[2];
pIB[nInd++] = Ind[0]; pIB[nInd++] = Ind[2]; pIB[nInd++] = Ind[3];
}
}
glGenBuffersARB(1, &VBO_ID);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, VBO_ID);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(TVertexV1C)*nVert, pVB, GL_STATIC_DRAW_ARB);
glGenBuffersARB(1, &IBO_ID);
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, IBO_ID);
glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, sizeof(int)*nInd, pIB, GL_STATIC_DRAW_ARB);
}
}
#endif
}
#define GridSize 128
#define FarR (4*4000.0)
void CRenderer::RenderSky() {
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, Cube0ID);
glEnable(GL_TEXTURE_CUBE_MAP_ARB);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_EXT);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_EXT);
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_EXT);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_GEN_R);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glMatrixMode(GL_TEXTURE);
glPushMatrix();
glLoadIdentity();
//glRotatef(-90.0, 1.0, 1.0, 0);
//glScalef(-1.0, -1.0, -1.0);
//glScalef(+1,+1,-1);
glRotatef(-rRotationX, 0, 1, 0);
glRotatef(-rRotationY, 1, 0, 0);
glRotatef(180, 0, 0, 1);
//glRotatef(-90.0, 1.0, 0.0, 0);
//glRotatef(-rRotationY, 1, 0, 0);
glutSolidSphere(FarR, 10, 10);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_TEXTURE_GEN_R);
glDisable(GL_TEXTURE_CUBE_MAP_ARB);
}
void CRenderer::RenderSea() {
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
float Time = GetTime();
int Frame0 = int(0.13*Time*128) & (128-1);
int Frame1 = int(0.19*Time*128+127) & (128-1);
float MaxR = 36000/8, RScale = 1.0f/512.0f;
float Weather = 0.5;
float _S = (1-Weather)*0.5 + 0.25;
float H = 2.5*_S; //H *= 3;
H*=1.5;
float TexScale = 0.0025*(1.0+(0.5-abs(Weather-0.5))*4);//*2.5;
glPushMatrix();
glTranslatef(CamX, CamY, 0);// Move grid Center
cgGLEnableProfile(vpProfile);
cgGLEnableProfile(fpProfile);
//cgGLBindProgram(fragmentProgram);
cgGLBindProgram(vertexProgram);
cgGLSetParameter4f(vpVars.VOfs, CamX, CamY, pow(RScale, 4)*MaxR, 0);
cgGLSetParameter4f(vpVars.CPos, CamX*0, CamY*0, CamZ, 0);
cgGLSetParameter4f(vpVars.Gabarites, TexScale, 256.0f/2.0f, H, 1.0/TexScale);
cgGLSetTextureParameter(vpVars.HMap0, WaterReflDMID[Frame0]);
cgGLEnableTextureParameter(vpVars.HMap0);
cgGLSetTextureParameter(vpVars.HMap1, WaterReflDMID[Frame1]);
cgGLEnableTextureParameter(vpVars.HMap1);
CheckCgError();
cgGLBindProgram(fragmentProgram);
cgGLSetTextureParameter(fpVars.dXYMap, WaterRefldXYID[Frame0]);
cgGLEnableTextureParameter(fpVars.dXYMap);
cgGLSetTextureParameter(fpVars.dXYMap1, WaterRefldXYID[Frame1]);
cgGLEnableTextureParameter(fpVars.dXYMap1);
cgGLSetTextureParameter(fpVars.EnvCMap, Cube0ID);
cgGLEnableTextureParameter(fpVars.EnvCMap);
cgGLSetTextureParameter(fpVars.FoamMap, FoamID);
cgGLEnableTextureParameter(fpVars.FoamMap);
cgGLSetParameter4f(fpVars.c[0], 0.2*0.15,1*0.15,0.85*0.15,0.15); //diffuse+Ambient in w
cgGLSetParameter4f(fpVars.c[2], +0.9,-0.2, +0.1,0); //Sun direction
float cMaxIntensity = 0.8, cMinIntensity = 0.05, FreshelCosClamp=-0.1;
float Wavy = 2.125;// Wavy = 1 Normal, < 1 Wild
float FoamB = +0.50+2*0.15, FoamKx = 0.8/(1-FoamB);
cgGLSetParameter4f(fpVars.c[3], cMinIntensity, cMaxIntensity-cMinIntensity, FreshelCosClamp, Wavy*2);
cgGLSetParameter4f(fpVars.c[9], FoamKx, -FoamB*FoamKx, 0, 0);
CheckCgError();
//glDisable(GL_TEXTURE_2D);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, VBO_ID);
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, IBO_ID);
glVertexPointer(3, GL_FLOAT, sizeof(TVertexV1C), 0/*CylinderS*/);
glEnableClientState(GL_VERTEX_ARRAY);
glColor3f(1,0,0);
glDrawElements(GL_TRIANGLES, nInd, GL_UNSIGNED_INT, 0);
glDisableClientState(GL_VERTEX_ARRAY);
cgGLDisableProfile(vpProfile);
cgGLDisableProfile(fpProfile);
cgGLDisableTextureParameter(vpVars.HMap0);
cgGLDisableTextureParameter(vpVars.HMap1);
cgGLDisableTextureParameter(fpVars.dXYMap);
cgGLDisableTextureParameter(fpVars.dXYMap1);
cgGLDisableTextureParameter(fpVars.EnvCMap);
cgGLDisableTextureParameter(fpVars.FoamMap);
glPopMatrix();
glDisable(GL_BLEND);
}
void CRenderer::RenderIsland() {
//return;
GLfloat s1_vector[4] = {1.0f/LandSize/4.0f, 0.0, 0.0, 0.0};
GLfloat t1_vector[4] = {0.0, 0.0, 1.0f/LandSize/4.0f,0.0};
glTexGeni (GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni (GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGenfv(GL_S, GL_OBJECT_PLANE, s1_vector);
glTexGenfv(GL_T, GL_OBJECT_PLANE, t1_vector);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, LandCID);
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, NoiseID);
GLfloat s2_vector[4] = {11.0f/LandSize/4.0f, 0.0, 0.0, 0.0};
GLfloat t2_vector[4] = {0.0, 0.0, 11.0f/LandSize/4.0f,0.0};
glTexGeni (GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni (GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGenfv(GL_S, GL_OBJECT_PLANE, s2_vector);
glTexGenfv(GL_T, GL_OBJECT_PLANE, t2_vector);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
// Render Landscape
for (int y = 0; y < LandSize-1; y++) {
glBegin(GL_TRIANGLE_STRIP);
for (int x = 0; x < LandSize-1; x++) {
glVertex3f(x*4, y*4, LandH[y][x]-6.0f);
glVertex3f(x*4, y*4+4, LandH[y+1][x]-6.0f);
}
glEnd();
}
glDisable(GL_TEXTURE_2D);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glActiveTextureARB(GL_TEXTURE0_ARB);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
}
void CRenderer::Render(int Reflection) {
if (!Reflection) RenderSky();
if (!Reflection)RenderSea();
if (!Reflection) RenderIsland();
}
void CRenderer::CreateNoiseTexture()
{
for(int i = 0; i < TEXTUREWIDTH; i++)
for(int j = 0; j < TEXTUREWIDTH; j++)
m_pfNoiseTextureMap[i][j] = (PRNGenerator(i*TEXTUREWIDTH + j) + 1.0) / 2;
}
float CRenderer::PRNGenerator(int x)
{
x = (x << 13) ^ x;
int Prime1 = 15731;
int Prime2 = 789221;
int Prime3 = 1376312589;
return (1.0 - ((x * (x*x*Prime1 + Prime2) + Prime3) & 0x7fffffff) / 1073741824.0);
}
| {
"pile_set_name": "Github"
} |
{
"CVE_data_meta": {
"ASSIGNER": "[email protected]",
"ID": "CVE-2008-0594",
"STATE": "PUBLIC"
},
"affects": {
"vendor": {
"vendor_data": [
{
"product": {
"product_data": [
{
"product_name": "n/a",
"version": {
"version_data": [
{
"version_value": "n/a"
}
]
}
}
]
},
"vendor_name": "n/a"
}
]
}
},
"data_format": "MITRE",
"data_type": "CVE",
"data_version": "4.0",
"description": {
"description_data": [
{
"lang": "eng",
"value": "Mozilla Firefox before 2.0.0.12 does not always display a web forgery warning dialog if the entire contents of a web page are in a DIV tag that uses absolute positioning, which makes it easier for remote attackers to conduct phishing attacks."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "n/a"
}
]
}
]
},
"references": {
"reference_data": [
{
"name": "USN-576-1",
"refsource": "UBUNTU",
"url": "http://www.ubuntu.com/usn/usn-576-1"
},
{
"name": "http://browser.netscape.com/releasenotes/",
"refsource": "CONFIRM",
"url": "http://browser.netscape.com/releasenotes/"
},
{
"name": "28939",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/28939"
},
{
"name": "DSA-1506",
"refsource": "DEBIAN",
"url": "http://www.debian.org/security/2008/dsa-1506"
},
{
"name": "30620",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/30620"
},
{
"name": "28865",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/28865"
},
{
"name": "ADV-2008-0453",
"refsource": "VUPEN",
"url": "http://www.vupen.com/english/advisories/2008/0453/references"
},
{
"name": "28877",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/28877"
},
{
"name": "28879",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/28879"
},
{
"name": "29567",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/29567"
},
{
"name": "28958",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/28958"
},
{
"name": "http://support.novell.com/techcenter/psdb/6251b18e050302ebe7fe74294b55c818.html",
"refsource": "CONFIRM",
"url": "http://support.novell.com/techcenter/psdb/6251b18e050302ebe7fe74294b55c818.html"
},
{
"name": "30327",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/30327"
},
{
"name": "238492",
"refsource": "SUNALERT",
"url": "http://sunsolve.sun.com/search/document.do?assetkey=1-26-238492-1"
},
{
"name": "DSA-1489",
"refsource": "DEBIAN",
"url": "http://www.debian.org/security/2008/dsa-1489"
},
{
"name": "20080212 FLEA-2008-0001-1 firefox",
"refsource": "BUGTRAQ",
"url": "http://www.securityfocus.com/archive/1/488002/100/0/threaded"
},
{
"name": "20080209 rPSA-2008-0051-1 firefox",
"refsource": "BUGTRAQ",
"url": "http://www.securityfocus.com/archive/1/487826/100/0/threaded"
},
{
"name": "29086",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/29086"
},
{
"name": "28864",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/28864"
},
{
"name": "DSA-1485",
"refsource": "DEBIAN",
"url": "http://www.debian.org/security/2008/dsa-1485"
},
{
"name": "28924",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/28924"
},
{
"name": "27683",
"refsource": "BID",
"url": "http://www.securityfocus.com/bid/27683"
},
{
"name": "ADV-2008-1793",
"refsource": "VUPEN",
"url": "http://www.vupen.com/english/advisories/2008/1793/references"
},
{
"name": "SUSE-SA:2008:008",
"refsource": "SUSE",
"url": "http://lists.opensuse.org/opensuse-security-announce/2008-02/msg00006.html"
},
{
"name": "1019342",
"refsource": "SECTRACK",
"url": "http://www.securitytracker.com/id?1019342"
},
{
"name": "http://www.mozilla.org/security/announce/2008/mfsa2008-11.html",
"refsource": "CONFIRM",
"url": "http://www.mozilla.org/security/announce/2008/mfsa2008-11.html"
},
{
"name": "FEDORA-2008-1535",
"refsource": "FEDORA",
"url": "https://www.redhat.com/archives/fedora-package-announce/2008-February/msg00381.html"
},
{
"name": "http://wiki.rpath.com/Advisories:rPSA-2008-0051",
"refsource": "CONFIRM",
"url": "http://wiki.rpath.com/Advisories:rPSA-2008-0051"
},
{
"name": "DSA-1484",
"refsource": "DEBIAN",
"url": "http://www.debian.org/security/2008/dsa-1484"
},
{
"name": "ADV-2008-0627",
"refsource": "VUPEN",
"url": "http://www.vupen.com/english/advisories/2008/0627/references"
},
{
"name": "https://bugzilla.mozilla.org/show_bug.cgi?id=408164",
"refsource": "CONFIRM",
"url": "https://bugzilla.mozilla.org/show_bug.cgi?id=408164"
},
{
"name": "GLSA-200805-18",
"refsource": "GENTOO",
"url": "http://www.gentoo.org/security/en/glsa/glsa-200805-18.xml"
},
{
"name": "FEDORA-2008-1435",
"refsource": "FEDORA",
"url": "https://www.redhat.com/archives/fedora-package-announce/2008-February/msg00274.html"
},
{
"name": "MDVSA-2008:048",
"refsource": "MANDRIVA",
"url": "http://www.mandriva.com/security/advisories?name=MDVSA-2008:048"
}
]
}
} | {
"pile_set_name": "Github"
} |
{% extends "orga/schedule/base.html" %}
{% load compress %}
{% load i18n %}
{% load static %}
{% block scripts %}
{% compress js %}
<script defer src="{% static "vendored/moment-with-locales.js" %}"></script>
<script defer src="{% static "vendored/moment-timezone-with-data-2012-2022.js" %}"></script>
{% if debug %}
<script defer src="{% static "vendored/vue.js" %}"></script>
{% else %}
<script defer src="{% static "vendored/vue.min.js" %}"></script>
{% endif %}
<script defer src="{% static "vendored/vue-async-computed.js" %}"></script>
<script defer src="{% static "orga/js/schedule.js" %}"></script>
{% endcompress %}
{% endblock %}
{% block schedule_content %}
{% if schedule_version %}
<div class="alert alert-warning schedule-alert">
{% translate "You're currently viewing a released schedule version. Released versions cannot be edited directly." %}
</div>
{% endif %}
<div class="schedule-header">
<div id="schedule-choice">
<div class="input-group">
<form class="form-inline">
<div class="input-group">
<select name="version" id="version" class="form-control">
<option value="">{% translate "Current draft" %}</option>
{% for schedule in request.event.schedules.all %}
{% if schedule.version %}
<option value="{{ schedule.version }}" {% if schedule.version == schedule_version %}selected{% endif %}>{{ schedule.version }}</option>
{% endif %}
{% endfor %}
</select>
<button type="submit" class="btn btn-info">{% translate "Show" %}</button>
</div>
</form>
</div>
</div>
{% if not schedule_version %}
<a id="schedule-release" href="{{ request.event.orga_urls.release_schedule }}" class="btn btn-success"><i class="fa fa-plus"></i> {% translate "New release" %}</a>
{% else %}
<form method="post" action="{{ request.event.orga_urls.reset_schedule }}?{{ request.GET.urlencode }}">
{% csrf_token %}
<button type="submit" class="btn btn-info">{% translate "Reset to current version" %}</button>
</form>
{% endif %}
<details class="dropdown">
<summary class="btn btn-info" id="schedule-actions">
{% translate "Actions" %} <i class="fa fa-caret-down"></i>
</summary>
<ul class="dropdown-content dropdown-front dropdown-content-sw">
<li><a class="dropdown-item" href="{{ active_schedule.urls.public }}" target="_blank" rel="noopener">
<i class="fa fa-link"></i> {% translate "View in frontend" %}
</a></li>
{% if request.event.settings.show_schedule %}
<li><a class="dropdown-item" href="{{ request.event.orga_urls.toggle_schedule }}">
<i class="fa fa-eye"></i> {% translate "Hide schedule" %}
</a></li>
{% else %}
<li><a class="dropdown-item" href="{{ request.event.orga_urls.toggle_schedule }}">
<i class="fa fa-eye"></i> {% translate "Make schedule public" %}
</a></li>
{% endif %}
<li><a href="{{ request.event.orga_urls.submission_cards }}" class="dropdown-item">
<i class="fa fa-print"></i> {% translate "Print cards" %}
</a></li>
<li><a href="resend_mails" class="dropdown-item">
<i class="fa fa-envelope"></i> {% translate "Resend speaker notifications" %}
</a></li>
</ul>
</details>
</div>
{% if not request.event.rooms.count %}
<div class="alert alert-warning schedule-alert">
<span>
{% translate "You can start planning your schedule once you have configured some rooms for talks to take place in." %}
<a href="{{ request.event.orga_urls.new_room }}">{% translate "Configure rooms" %}</a>
</span>
</div>
{% else %}
<div id="fahrplan">
</div>
{% endif %}
{% endblock %}
| {
"pile_set_name": "Github"
} |
From 0e1a49c8907645d2e155f0d89d4d9895ac5112b5 Mon Sep 17 00:00:00 2001
From: Zhipeng Xie <[email protected]>
Date: Thu, 12 Dec 2019 17:30:55 +0800
Subject: [PATCH] Fix infinite loop in xmlStringLenDecodeEntities
When ctxt->instate == XML_PARSER_EOF,xmlParseStringEntityRef
return NULL which cause a infinite loop in xmlStringLenDecodeEntities
Found with libFuzzer.
Fixes CVE-2020-7595: xmlStringLenDecodeEntities in parser.c in libxml2
2.9.10 has an infinite loop in a certain end-of-file situation.
Signed-off-by: Zhipeng Xie <[email protected]>
Signed-off-by: Peter Korsgaard <[email protected]>
---
parser.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/parser.c b/parser.c
index d1c31963..a34bb6cd 100644
--- a/parser.c
+++ b/parser.c
@@ -2646,7 +2646,8 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
else
c = 0;
while ((c != 0) && (c != end) && /* non input consuming loop */
- (c != end2) && (c != end3)) {
+ (c != end2) && (c != end3) &&
+ (ctxt->instate != XML_PARSER_EOF)) {
if (c == 0) break;
if ((c == '&') && (str[1] == '#')) {
--
2.20.1
| {
"pile_set_name": "Github"
} |
function [sol,iter] = prox_l2(x, gamma, param)
%PROX_L2 Proximal operator with L2 norm
% Usage: sol=prox_l2(x, gamma)
% sol=prox_l2(x, gamma, param)
% [sol, iter]=prox_l2(x, gamma, param)
%
% Input parameters:
% x : Input signal.
% gamma : Regularization parameter.
% param : Structure of optional parameters.
% Output parameters:
% sol : Solution.
% iter : Number of iterations at convergence.
%
% PROX_L2(x, gamma, param) solves:
%
% sol = argmin_{z} 0.5*||x - z||_2^2 + gamma |A W Z - Y|2^2
%
%
% where w are some weights.
%
% param is a Matlab structure containing the following fields:
%
% param.weights : weights for a weighted L2-norm (default = 1)
%
% param.y : measurements (default: 0).
%
% param.A : Forward operator (default: Id).
%
% param.At : Adjoint operator (default: Id).
%
% param.tight : 1 if A is a tight frame or 0 if not (default = 1)
%
% param.nu : bound on the norm of the operator A (default: 1), i.e.
%
% ` ||A x||^2 <= nu ||x||^2
%
%
% param.tol : is stop criterion for the loop. The algorithm stops if
%
% ( n(t) - n(t-1) ) / n(t) < tol,
%
%
% where n(t) = f(x)+ 0.5 X-Z2^2 is the objective function at iteration t
% by default, tol=10e-4.
%
% param.maxit : max. nb. of iterations (default: 200).
%
% param.verbose : 0 no log, 1 a summary at convergence, 2 print main
% steps (default: 1)
%
% See also: proj_b2 prox_l1
%
% Url: http://unlocbox.sourceforge.net/doc/prox/prox_l2.php
% Copyright (C) 2012 LTS2-EPFL, by Nathanael Perraudin, Gilles Puy,
% David Shuman, Pierre Vandergheynst.
% This file is part of UnLocBoX version 1.1.70
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
% Author: Nathanael Perraudin
% Date: Nov 2012
%
% Optional input arguments
if nargin<3, param=struct; end
% Optional input arguments
if ~isfield(param, 'verbose'), param.verbose = 1; end
if ~isfield(param, 'tight'), param.tight = 1; end
if ~isfield(param, 'nu'), param.nu = 1; end
if ~isfield(param, 'tol'), param.tol = 1e-3; end
if ~isfield(param, 'maxit'), param.maxit = 200; end
if ~isfield(param, 'At'), param.At = @(x) x; end
if ~isfield(param, 'A'), param.A = @(x) x; end
if ~isfield(param, 'y'), param.y = zeros(size(x)); end
if ~isfield(param, 'weights'), param.weights = ones(size(x)); end
siz = size(x);
% test the parameters
gamma=test_gamma(gamma);
param.weights=test_weights(param.weights);
% Projection
if param.tight % TIGHT FRAME CASE
sol=(x+gamma*2*param.At(param.y).*param.weights)./(gamma*2*param.nu*param.weights.^2+1);
% Infos for log...
% L2 norm of the estimate
dummy = param.A(param.weights.*sol)-param.y;
norm_l2 = .5*norm(x(:) - sol(:), 2)^2 + gamma * norm(dummy(:))^2;
% stopping criterion
crit_L2 = 'REL_OB';
% number of iteration
iter_L2=0;
else % NON TIGHT FRAME
% Initializations
u_n=x;
sol=x;
tn=1;
prev_l2 = 0; iter_L2 = 0;
% stepsize
stepsize=1/(2*max(param.weights).^2*param.nu+1);
% gradient
grad= @(z) z-x+gamma*2*param.weights.*param.At(param.A(param.weights.*z)-param.y);
% Init
if param.verbose > 1
fprintf(' Proximal l2 operator:\n');
end
while 1
% L2 norm of the estimate
dummy = param.A(param.weights.*sol)-param.y;
norm_l2 = .5*norm(x(:) - sol(:), 2)^2 + gamma * norm(dummy(:))^2;
rel_l2 = abs(norm_l2-prev_l2)/norm_l2;
% Log
if param.verbose>1
fprintf(' Iter %i, ||A w x- y||_2^2 = %e, rel_l2 = %e\n', ...
iter_L2, norm_l2, rel_l2);
end
% Stopping criterion
if (rel_l2 < param.tol)
crit_L2 = 'REL_OB'; break;
elseif iter_L2 >= param.maxit
crit_L2 = 'MAX_IT'; break;
end
% FISTA algorithm
x_n=u_n-stepsize*grad(u_n);
tn1=(1+sqrt(1+4*tn^2))/2;
u_n=x_n+(tn-1)/tn1*(x_n-sol);
%updates
sol=x_n;
tn=tn1;
% Update
prev_l2 = norm_l2;
iter_L2 = iter_L2 + 1;
end
end
% Log after the projection onto the L2-ball
if param.verbose >= 1
fprintf([' prox_L2: ||A w x- y||_2^2 = %e,', ...
' %s, iter = %i\n'], norm_l2, crit_L2, iter_L2);
end
iter=iter_L2;
sol = reshape(sol,siz);
end
| {
"pile_set_name": "Github"
} |
import optparse
import sys
import time
import subprocess
import os
import sleekxmpp
class Responder(sleekxmpp.ClientXMPP):
def __init__(self, jid, password, room, room_password, nick):
sleekxmpp.ClientXMPP.__init__(self, jid, password)
self.room = room
self.room_password = room_password
self.nick = nick
self.finished = False
self.add_event_handler("session_start", self.start)
self.add_event_handler("message", self.message)
self.tests = {}
self.tests["not_authorized"] = ["'Not Authorized' received", False]
self.tests["help_received"] = ["Help received", False]
self.tests["register_received"] = ["Password changed", False]
self.tests["abc_received"] = ["Test message received", False]
def message(self, msg):
if msg['body'] == "Not Authorized" or msg['body'] == "Server may require plaintext authentication over an unencrypted stream":
self.tests["not_authorized"][1] = True
elif msg['body'].find("try using") != -1:
self.send_message(mto="[email protected]", mbody=".spectrum2 register client@localhost password #spectrum2_contactlist")
self.tests["help_received"][1] = True
elif msg['body'] == "You have successfully registered 3rd-party account. Spectrum 2 is now connecting to the 3rd-party network.":
self.tests["register_received"][1] = True
elif msg['body'] == "abc":
self.tests["abc_received"][1] = True
self.finished = True
def start(self, event):
self.plugin['xep_0045'].joinMUC(self.room, self.nick, password=self.room_password, wait=False)
class Client(sleekxmpp.ClientXMPP):
def __init__(self, jid, password, room, nick):
sleekxmpp.ClientXMPP.__init__(self, jid, password)
self.room = room
self.nick = nick
self.add_event_handler("session_start", self.start)
self.add_event_handler("message", self.message)
self.finished = False
self.tests = {}
def message(self, msg):
pass
#print "client", msg['body']
#if msg['body'] == "echo abc" and msg['from'] == self.room + "/responder":
#self.tests["echo1_received"][1] = True
#self.send_message(mto=self.room + "/responder", mbody="def", mtype='chat')
#elif msg['body'] == "echo def" and msg['from'] == self.room + "/responder":
#self.tests["echo2_received"][1] = True
#self.finished = True
def start(self, event):
self.getRoster()
self.sendPresence()
self.plugin['xep_0045'].joinMUC(self.room, self.nick, wait=True)
self.send_message(mto=self.room, mbody="abc", mtype='groupchat')
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2006-2010 - Frictional Games
*
* This file is part of HPL1 Engine.
*
* HPL1 Engine is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* HPL1 Engine 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 HPL1 Engine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "graphics/ParticleEmitter.h"
#include "system/LowLevelSystem.h"
#include "resources/Resources.h"
#include "graphics/Graphics.h"
#include "graphics/MaterialHandler.h"
#include "resources/ImageManager.h"
#include "resources/MaterialManager.h"
namespace hpl {
//////////////////////////////////////////////////////////////////////////
// DATA LOADER
//////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------
iParticleEmitterData::iParticleEmitterData(const tString &asName,cResources* apResources,
cGraphics *apGraphics)
{
msName = asName;
mpResources = apResources;
mpGraphics = apGraphics;
mfWarmUpTime =0;
mfWarmUpStepsPerSec = 20;
}
//-----------------------------------------------------------------------
iParticleEmitterData::~iParticleEmitterData()
{
for(int i=0;i<(int)mvMaterials.size();i++)
{
if(mvMaterials[i]) mpResources->GetMaterialManager()->Destroy(mvMaterials[i]);
}
}
//-----------------------------------------------------------------------
void iParticleEmitterData::AddMaterial(iMaterial *apMaterial)
{
mvMaterials.push_back(apMaterial);
}
//-----------------------------------------------------------------------
//////////////////////////////////////////////////////////////////////////
// CONSTRUCTORS
//////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------
iParticleEmitter::iParticleEmitter(tMaterialVec *avMaterials,
unsigned int alMaxParticles, cVector3f avSize,
cGraphics *apGraphics, cResources *apResources)
{
mpGraphics = apGraphics;
mpResources = apResources;
mvParticles.resize(alMaxParticles);
for(int i=0;i<(int)alMaxParticles;i++)
{
mvParticles[i] = hplNew( cParticle, () );
}
mlMaxParticles = alMaxParticles;
mlNumOfParticles =0;
mvMaterials = avMaterials;
//Update vars:
mbDying = false;
mfTime =0;
mfFrame =0;
mbUpdateGfx = true;
mbUpdateBV = true;
}
//-----------------------------------------------------------------------
iParticleEmitter::~iParticleEmitter()
{
for(int i=0;i<(int)mvParticles.size();i++){
hplDelete(mvParticles[i]);
}
}
//-----------------------------------------------------------------------
//////////////////////////////////////////////////////////////////////////
// PUBLIC METHODS
//////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------
void iParticleEmitter::Update(float afTimeStep)
{
UpdateMotion(afTimeStep);
mfTime++;
mbUpdateGfx = true;
mbUpdateBV = true;
}
//-----------------------------------------------------------------------
void iParticleEmitter::KillInstantly()
{
mlMaxParticles = 0;
mlNumOfParticles = 0;
mbDying = true;
}
//-----------------------------------------------------------------------
//////////////////////////////////////////////////////////////////////////
// PROTECTED METHODS
//////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------
cParticle* iParticleEmitter::CreateParticle()
{
if(mlNumOfParticles == mlMaxParticles) return NULL;
++mlNumOfParticles;
return mvParticles[mlNumOfParticles-1];
}
//-----------------------------------------------------------------------
void iParticleEmitter::SwapRemove(unsigned int alIndex)
{
if(alIndex < mlNumOfParticles-1)
{
cParticle* pTemp = mvParticles[alIndex];
mvParticles[alIndex] = mvParticles[mlNumOfParticles-1];
mvParticles[mlNumOfParticles-1] = pTemp;
}
mlNumOfParticles--;
}
//-----------------------------------------------------------------------
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#ifndef HERMES_VM_STACKFRAME_INLINE_H
#define HERMES_VM_STACKFRAME_INLINE_H
#include "hermes/VM/StackFrame.h"
namespace hermes {
namespace vm {
template <bool isConst>
inline Callable *StackFramePtrT<isConst>::getCalleeClosureUnsafe() const {
return vmcast<Callable>(getCalleeClosureOrCBRef());
}
template <bool isConst>
inline Handle<Callable> StackFramePtrT<isConst>::getCalleeClosureHandleUnsafe()
const {
return Handle<Callable>::vmcast(&getCalleeClosureOrCBRef());
}
template <bool isConst>
typename StackFramePtrT<isConst>::QualifiedCB *
StackFramePtrT<isConst>::getCalleeCodeBlock() const {
auto &ref = getCalleeClosureOrCBRef();
if (ref.isObject()) {
if (auto *func = dyn_vmcast<JSFunction>(ref))
return func->getCodeBlock();
else
return nullptr;
} else {
assert(
ref.isNativeValue() &&
"getCalleeClosureOrCBRef must be NativeValue or Object");
return ref.template getNativePointer<CodeBlock>();
}
}
template <bool isConst>
inline Callable *StackFramePtrT<isConst>::getCalleeClosure() const {
return dyn_vmcast<Callable>(getCalleeClosureOrCBRef());
}
template <bool isConst>
inline Handle<Environment> StackFramePtrT<isConst>::getDebugEnvironmentHandle()
const {
return getDebugEnvironmentRef().isUndefined()
? HandleRootOwner::makeNullHandle<Environment>()
: Handle<Environment>::vmcast_or_null(&getDebugEnvironmentRef());
}
template <bool isConst>
inline Environment *StackFramePtrT<isConst>::getDebugEnvironment() const {
return getDebugEnvironmentRef().isUndefined()
? nullptr
: vmcast_or_null<Environment>(getDebugEnvironmentRef());
}
} // namespace vm
} // namespace hermes
#endif // HERMES_VM_STACKFRAME_INLINE_H
| {
"pile_set_name": "Github"
} |
<?php
namespace Tests;
use Illuminate\Support\Facades\Hash;
use Illuminate\Contracts\Console\Kernel;
trait CreatesApplication
{
/**
* Creates the application.
*
* @return \Illuminate\Foundation\Application
*/
public function createApplication()
{
$app = require __DIR__.'/../bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();
Hash::driver('bcrypt')->setRounds(4);
return $app;
}
}
| {
"pile_set_name": "Github"
} |
/* global AFRAME */
AFRAME.registerComponent('menu', {
init: function () {
var el = this.el;
var menuBackGroundEl = document.createElement('a-entity');
menuBackGroundEl.setAttribute('geometry', {
primitive: 'box',
width: 0.6,
height: 0.40,
depth: 0.01
});
menuBackGroundEl.setAttribute('material', {
color: 'gray'
});
menuBackGroundEl.setAttribute('position', '0 0 -0.025');
el.appendChild(menuBackGroundEl);
}
});
| {
"pile_set_name": "Github"
} |
// Screen Readers
// -------------------------
.sr-only { .sr-only(); }
.sr-only-focusable { .sr-only-focusable(); }
| {
"pile_set_name": "Github"
} |
{
"name": "@expo-google-fonts/reem-kufi",
"version": "0.1.0",
"description": "Use the Reem Kufi font family from Google Fonts in your Expo app",
"main": "index.js",
"repository": "https://github.com/expo/google-fonts.git",
"homepage": "https://github.com/expo/google-fonts/tree/master/font-packages/reem-kufi#readme",
"author": "Expo Team <[email protected]>",
"license": "MIT",
"publishConfig": { "access": "public" }
}
| {
"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.geode.internal.cache.tier.sockets;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;
import java.net.SocketAddress;
import java.util.Map;
import org.apache.logging.log4j.Logger;
import org.apache.geode.annotations.Immutable;
import org.apache.geode.cache.UnsupportedVersionException;
import org.apache.geode.cache.VersionException;
import org.apache.geode.distributed.DistributedSystem;
import org.apache.geode.internal.cache.tier.Command;
import org.apache.geode.internal.cache.tier.CommunicationMode;
import org.apache.geode.internal.cache.tier.ServerSideHandshake;
import org.apache.geode.internal.security.SecurityService;
import org.apache.geode.internal.serialization.KnownVersion;
import org.apache.geode.internal.serialization.Versioning;
import org.apache.geode.internal.serialization.VersioningIO;
import org.apache.geode.logging.internal.log4j.api.LogService;
class ServerSideHandshakeFactory {
private static final Logger logger = LogService.getLogger();
@Immutable
static final KnownVersion currentServerVersion = KnownVersion.CURRENT;
ServerSideHandshake readHandshake(Socket socket, int timeout, CommunicationMode communicationMode,
DistributedSystem system, SecurityService securityService) throws Exception {
// Read the version byte from the socket
KnownVersion clientVersion = readClientVersion(socket, timeout, communicationMode.isWAN());
if (logger.isDebugEnabled()) {
logger.debug("Client version: {}", clientVersion);
}
if (clientVersion.isOlderThan(KnownVersion.GFE_57)) {
throw new UnsupportedVersionException("Unsupported version " + clientVersion
+ "Server's current version " + currentServerVersion);
}
return new ServerSideHandshakeImpl(socket, timeout, system, clientVersion, communicationMode,
securityService);
}
private KnownVersion readClientVersion(Socket socket, int timeout, boolean isWan)
throws IOException, VersionException {
int soTimeout = -1;
try {
soTimeout = socket.getSoTimeout();
socket.setSoTimeout(timeout);
InputStream is = socket.getInputStream();
short clientVersionOrdinal = VersioningIO.readOrdinalFromInputStream(is);
if (clientVersionOrdinal == -1) {
throw new EOFException(
"HandShakeReader: EOF reached before client version could be read");
}
final KnownVersion clientVersion = Versioning.getKnownVersionOrDefault(
Versioning.getVersion(clientVersionOrdinal), null);
final String message;
if (clientVersion == null) {
message = KnownVersion.unsupportedVersionMessage(clientVersionOrdinal);
} else {
final Map<Integer, Command> commands = CommandInitializer.getCommands(clientVersion);
if (commands == null) {
message = "Client version {} is not supported";
} else {
return clientVersion;
}
}
// Allows higher version of wan site to connect to server
if (isWan) {
return currentServerVersion;
} else {
SocketAddress sa = socket.getRemoteSocketAddress();
String sInfo = "";
if (sa != null) {
sInfo = " Client: " + sa.toString() + ".";
}
throw new UnsupportedVersionException(message + sInfo);
}
} finally {
if (soTimeout != -1) {
try {
socket.setSoTimeout(soTimeout);
} catch (IOException ignore) {
}
}
}
}
}
| {
"pile_set_name": "Github"
} |
<?php
namespace Fixtures\Prophecy;
class WithTypehintedVariadicArgument
{
function methodWithTypeHintedArgs(array ...$args)
{
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/item_anime"
android:title="@string/anime"/>
<item
android:id="@+id/item_book"
android:title="@string/book" />
<item
android:id="@+id/item_game"
android:title="@string/game" />
<item
android:id="@+id/item_music"
android:title="@string/music" />
<item
android:id="@+id/item_real"
android:title="@string/real" />
</menu> | {
"pile_set_name": "Github"
} |
[Implementation of instant messaging for the Lotus Sametime protocol.]
[ID:]
[Server name:]
[Client ID and version]
[Error display]
[Use message boxes]
[Use popups]
[Use system tray balloons]
[Get contacts from server]
[Upload contacts]
[Import from file...]
[Auto-add new contacts]
[Treat 'idle' as 'away']
[Encryption]
[40 or 128 bit]
[Meanwhile lib ver: 1.0.2]
[Disconnected]
[Send announcement]
[Message text:]
[Invert\nselection]
[I'm outa here.]
[Invitation rejected - already present.]
[Your invitation has been rejected.]
[Please join this meeting.]
[%s's conference]
[Leave conference]
[Start conference]
[No common encryption method. Try to enable encryption in protocol options.]
[SERVICE NOT IMPLEMENTED. %s]
[Client protocol version: %03d.%03d]
[Server protocol version: %03d.%03d]
[Protocol icon]
[%s connection]
[Sametime administrator message]
[Session announcement - from '%s']
[Unknown user status: %d]
[No server connection!]
[Send announcement...]
[Recipients]
[Failed to upload contacts - storage service unavailable.]
[Description]
[Group?]
[True]
[False]
[%s\n\nSametime error %S\n%s]
[Success]
[General failure]
[Request delayed]
[Request is invalid]
[Not logged in]
[Not authorized]
[Operation aborted]
[No element]
[User is not online]
[Invalid data]
[Not implemented]
[Not enough resources]
[Requested channel is not supported]
[Requested channel already exists]
[Requested service is not supported]
[Requested protocol is not supported]
[Version is not supported]
[User is invalid or not trusted]
[Already initialized]
[Not an owner]
[Invalid token]
[Token expired]
[Token mismatch]
[Port in use]
[Network error]
[Master channel error]
[Already subscribed]
[Not subscribed]
[Encryption method not supported]
[Encryption not initialized]
[Encryption too low]
[Invalid encrypted data]
[No common encryption method]
[Channel destroyed]
[Channel redirected]
[Incorrect entry]
[Version mismatch]
[Not enough buffers memory]
[Not in use]
[Not enough sockets]
[Hardware error]
[Host error]
[Host unreachable]
[Internet protocol error]
[Message is too large]
[Proxy error]
[Server full]
[Server not responding]
[Connection error]
[User removed]
[Sametime protocol error]
[User restricted]
[Incorrect Username/Password]
[Encryption mismatch]
[User unregistered]
[Login verification down or unavailable]
[User too idle]
[The guest name is currently being used]
[User exists]
[User relogin]
[Bad name]
[Registration error]
[Privilege error]
[Need email]
[DNS error]
[DNS fatal error]
[DNS not found]
[Connection broken]
[Connection aborted]
[Connection refused]
[Connection reset]
[Connection timed out]
[Connection closed]
[Login to two different servers concurrently (1)]
[Login to two different servers concurrently (2)]
[Already logged on, disconnected]
[Already logged on]
[Server misconfiguration]
[Server needs upgrade]
[Applet Logout]
[User is in Do Not Disturb mode]
[Already logged in elsewhere]
[Cannot register a reserved type]
[Requested type is already registered]
[Requested type is not registered]
[Resolve not completed]
[Resolve name not unique]
[Resolve name not resolvable]
[Operation succeeded]
[Operation failed]
[Request accepted but will be served later]
[Request is invalid due to invalid state or parameters]
[Not logged in to community]
[Unauthorized to perform an action or access a resource]
[Operation has been aborted]
[The element is non-existent]
[The user is non-existent]
[The data are invalid or corrupted]
[The requested feature is not implemented]
[Not enough resources to perform the operation]
[The requested channel is not supported]
[The requested channel already exists]
[The requested service is not supported]
[The requested protocol is not supported (1)]
[The requested protocol is not supported (2)]
[The version is not supported]
[Not an owner of the requested resource]
[Token has expired]
[Token IP mismatch]
[WK port is in use]
[Low-level network error occurred]
[No master channel exists]
[Already subscribed to object(s) or event(s)]
[Not subscribed to object(s) or event(s)]
[Encryption is not supported or failed unexpectedly]
[Encryption mechanism has not been initialized yet]
[The requested encryption level is unacceptably low]
[The encryption data passed are invalid or corrupted]
[There is no common encryption method]
[The channel is destroyed after a recommendation is made connect elsewhere]
[The channel has been redirected to another destination]
[Incorrect entry for server in cluster document]
[Versions don't match]
[Not enough resources for connection (buffers)]
[Not enough resources for connection (socket id)]
[Hardware error occurred]
[Network down]
[Host down]
[TCP/IP protocol error]
[The message is too large]
[Server is full]
[Server is not responding]
[Cannot connect]
[User has been removed from the server]
[Virtual Places protocol error]
[Cannot connect because user has been restricted]
[Incorrect login]
[User is unregistered]
[Verification service down]
[User has been idle for too long]
[The user is already signed on]
[The user has signed on again]
[The name cannot be used]
[The registration mode is not supported]
[User does not have appropriate privilege level]
[Email address must be used]
[Error in DNS]
[Fatal error in DNS]
[Server name not found]
[The connection has been broken]
[An established connection was aborted by the software in the host machine]
[The connection has been refused]
[The connection has been reset]
[The connection has timed out]
[The connection has been closed]
[Disconnected due to login in two Sametime servers concurrently (1)]
[Disconnected due to login in two Sametime servers concurrently (2)]
[Disconnected due to login from another computer.]
[Unable to log in because you are already logged on from another computer]
[Unable to log in because the server is either unreachable, or not configured properly.]
[Unable to log in to home Sametime server through the requested server, since your home server needs to be upgraded.]
[The applet was logged out with this reason. Perform relogin and you will return to the former state.]
[The user is not online]
[The user is in do not disturb mode]
[Cannot log in because already logged in with a different user name (Java only)]
[The requested type is already registered]
[The requested type is not registered]
[The resolve process was not completed, but a partial response is available]
[The name was found, but is not unique (request was for unique only)]
[The name is not resolvable due to its format, for example an Internet email address]
[Unknown error code]
| {
"pile_set_name": "Github"
} |
package org.pushingpixels.tools.apollo.svg
import java.awt.*
import java.awt.geom.*
import java.awt.image.BufferedImage
import java.io.*
import java.lang.ref.WeakReference
import java.util.Base64
import java.util.Stack
import javax.imageio.ImageIO
import javax.swing.plaf.UIResource
import org.pushingpixels.neon.api.icon.ResizableIcon
import org.pushingpixels.neon.api.icon.ResizableIcon.Factory
import org.pushingpixels.neon.api.icon.ResizableIconUIResource
/**
* This class has been automatically generated using <a
* href="https://github.com/kirill-grouchnikov/radiance">Photon SVG transcoder</a>.
*/
class outline_keyboard_arrow_down_24px private constructor(private var width: Int, private var height: Int)
: ResizableIcon {
@Suppress("UNUSED_VARIABLE") private var shape: Shape? = null
@Suppress("UNUSED_VARIABLE") private var generalPath: GeneralPath? = null
@Suppress("UNUSED_VARIABLE") private var paint: Paint? = null
@Suppress("UNUSED_VARIABLE") private var stroke: Stroke? = null
@Suppress("UNUSED_VARIABLE") private var clip: Shape? = null
private val transformsStack = Stack<AffineTransform>()
private fun _paint0(g : Graphics2D,origAlpha : Float) {
transformsStack.push(g.transform)
//
g.composite = AlphaComposite.getInstance(3, 1.0f * origAlpha)
transformsStack.push(g.transform)
g.transform(AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, -0.0f, -0.0f))
// _0
g.composite = AlphaComposite.getInstance(3, 1.0f * origAlpha)
transformsStack.push(g.transform)
g.transform(AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f))
// _0_0
g.composite = AlphaComposite.getInstance(3, 1.0f * origAlpha)
transformsStack.push(g.transform)
g.transform(AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f))
// _0_0_0
g.transform = transformsStack.pop()
g.composite = AlphaComposite.getInstance(3, 1.0f * origAlpha)
transformsStack.push(g.transform)
g.transform(AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f))
// _0_0_1
g.transform = transformsStack.pop()
g.transform = transformsStack.pop()
g.composite = AlphaComposite.getInstance(3, 1.0f * origAlpha)
transformsStack.push(g.transform)
g.transform(AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f))
// _0_1
g.composite = AlphaComposite.getInstance(3, 1.0f * origAlpha)
transformsStack.push(g.transform)
g.transform(AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f))
// _0_1_0
g.transform = transformsStack.pop()
g.composite = AlphaComposite.getInstance(3, 1.0f * origAlpha)
transformsStack.push(g.transform)
g.transform(AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f))
// _0_1_1
if (generalPath == null) {
generalPath = GeneralPath()
} else {
generalPath!!.reset()
}
generalPath!!.moveTo(7.41f, 8.59f)
generalPath!!.lineTo(12.0f, 13.17f)
generalPath!!.lineTo(16.59f, 8.59f)
generalPath!!.lineTo(18.0f, 10.0f)
generalPath!!.lineTo(12.0f, 16.0f)
generalPath!!.lineTo(6.0f, 10.0f)
generalPath!!.lineTo(7.41f, 8.59f)
generalPath!!.closePath()
shape = generalPath
paint = Color(0, 0, 0, 255)
g.paint = paint
g.fill(shape)
g.transform = transformsStack.pop()
g.transform = transformsStack.pop()
g.transform = transformsStack.pop()
g.transform = transformsStack.pop()
}
private fun innerPaint(g : Graphics2D) {
var origAlpha = 1.0f
val origComposite = g.composite
if (origComposite is AlphaComposite) {
if (origComposite.rule == AlphaComposite.SRC_OVER) {
origAlpha = origComposite.alpha
}
}
_paint0(g, origAlpha)
shape = null
generalPath = null
paint = null
stroke = null
clip = null
}
companion object {
/**
* Returns the X of the bounding box of the original SVG image.
*
* @return The X of the bounding box of the original SVG image.
*/
fun getOrigX(): Double {
return 6.0
}
/**
* Returns the Y of the bounding box of the original SVG image.
*
* @return The Y of the bounding box of the original SVG image.
*/
fun getOrigY(): Double {
return 8.59000015258789
}
/**
* Returns the width of the bounding box of the original SVG image.
*
* @return The width of the bounding box of the original SVG image.
*/
fun getOrigWidth(): Double {
return 12.0
}
/**
* Returns the height of the bounding box of the original SVG image.
*
* @return The height of the bounding box of the original SVG image.
*/
fun getOrigHeight(): Double {
return 7.409999847412109
}
/**
* Returns a new instance of this icon with specified dimensions.
*
* @param width Required width of the icon
* @param height Required height of the icon
* @return A new instance of this icon with specified dimensions.
*/
fun of(width: Int, height: Int): ResizableIcon {
return outline_keyboard_arrow_down_24px(width, height)
}
/**
* Returns a new [UIResource] instance of this icon with specified dimensions.
*
* @param width Required width of the icon
* @param height Required height of the icon
* @return A new [UIResource] instance of this icon with specified dimensions.
*/
fun uiResourceOf(width: Int, height: Int): ResizableIconUIResource {
return ResizableIconUIResource(outline_keyboard_arrow_down_24px(width, height))
}
/**
* Returns a factory that returns instances of this icon on demand.
*
* @return Factory that returns instances of this icon on demand.
*/
fun factory(): Factory {
return Factory { outline_keyboard_arrow_down_24px(getOrigWidth().toInt(), getOrigHeight().toInt()) }
}
}
override fun getIconHeight(): Int {
return width
}
override fun getIconWidth(): Int {
return height
}
override @Synchronized fun setDimension(newDimension: Dimension) {
width = newDimension.width
height = newDimension.height
}
override @Synchronized fun paintIcon(c: Component?, g: Graphics, x: Int, y: Int) {
val g2d = g.create() as Graphics2D
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON)
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC)
g2d.translate(x, y)
val coef1 = this.width.toDouble() / getOrigWidth()
val coef2 = this.height.toDouble() / getOrigHeight()
val coef = Math.min(coef1, coef2)
g2d.clipRect(0, 0, this.width, this.height)
g2d.scale(coef, coef)
g2d.translate(-getOrigX(), -getOrigY())
if (coef1 != coef2) {
if (coef1 < coef2) {
val extraDy = ((getOrigWidth() - getOrigHeight()) / 2.0).toInt()
g2d.translate(0, extraDy)
} else {
val extraDx = ((getOrigHeight() - getOrigWidth()) / 2.0).toInt()
g2d.translate(extraDx, 0)
}
}
val g2ForInner = g2d.create() as Graphics2D
innerPaint(g2ForInner)
g2ForInner.dispose()
g2d.dispose()
}
}
| {
"pile_set_name": "Github"
} |
package d2cof
import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
// CofLayer is a structure that represents a single layer in a COF file.
type CofLayer struct {
Type d2enum.CompositeType
Shadow byte
Selectable bool
Transparent bool
DrawEffect d2enum.DrawEffect
WeaponClass d2enum.WeaponClass
}
| {
"pile_set_name": "Github"
} |
var baseCopy = require('./baseCopy'),
keys = require('../object/keys');
/**
* The base implementation of `_.assign` without support for argument juggling,
* multiple sources, and `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssign(object, source) {
return source == null
? object
: baseCopy(source, keys(source), object);
}
module.exports = baseAssign;
| {
"pile_set_name": "Github"
} |
.noSketchSpace #padpage {
left: 50% !important;
width: 900px !important;
}
body {
overflow: hidden;
}
#sketchSpaceEditorUI,
.sketchSpace.maximized #sketchSpaceEditorUI,
#sketchSpaceEditorVdraggie,
.sketchSpace.maximized #sketchSpaceEditorVdraggie {
display: none;
}
.sketchSpace #sketchSpaceEditorUI {
display: block;
}
.sketchSpace #sketchSpaceEditorUI .editorui {
display: block;
position: absolute;
left: 0;
right: 50%;
top: 0;
bottom: 20pt;
margin-right: 10px;
}
.sketchSpace.maximized #padpage {
left: 8px !important;
right: 8px !important;
width: auto !important;
}
.sketchSpace.sketchSpaceMaximized #padpage {
display: none;
}
.sketchSpace.sketchSpaceMaximized #sketchSpaceEditorVdraggie,
.mazimized #sketchSpaceEditorVdraggie {
display: none;
}
.sketchSpace #padpage {
right: 0px;
width: 50%;
margin-left: 0;
left: auto;
bottom: 20pt;
}
.sketchSpace.sketchSpaceMaximized #sketchSpaceEditorUI .editorui {
left: 0 !important;
right: 0 !important;
width: auto !important;
}
.sketchSpace #sketchSpaceEditBar {
position: absolute;
left: 0;
top: 62px; /* 25 + 6 + 25 + 2 */
width: 100%;
height: 36px;
background: white;
}
.sketchSpace #sketchSpaceEditor {
position: absolute;
left: 0;
top: 98px; /* 25 + 6 + 25 + 6 + 35 + 1 */
bottom: 0;
width: 100%;
background: white;
}
.sketchSpace.sketchSpaceMaximized a.topbarmaximize {
background: url(/static/img/jun09/pad/maximize_maximized.png);
}
#sketchSpaceOptions {
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 20pt;
background: white;
overflow: auto;
border-top: 1px solid #C4C4C4;
border-right: 1px solid #C4C4C4;
padding: 0;
}
.optionsContainer {
vertical-align: middle;
height: 100%;
line-height: 20pt;
display: block;
padding-left: 4pt;
}
.optionsContainer-separator {
padding-left: 20pt;
}
.optionsContainer-option {
}
.optionsContainer-label,
.optionsContainer-child {
display: inline-block;
white-space: nowrap;
line-height: 1em;
}
.optionsContainer-label {
padding-right: 4pt;
}
.sketchSpace #sketchSpaceEditorVdraggie {
display: block;
background: url(/static/img/jun09/pad/vdraggie.gif) no-repeat top center;
cursor: W-resize;
bottom: 20pt;
position:absolute;
right:50%;
top:62px;
width:56px;
z-index: 10;
margin-right: -22px;
}
.editbar, .docbar, .topbar {
overflow: hidden;
} | {
"pile_set_name": "Github"
} |
/*************************************************************
*
* MathJax/jax/output/SVG/fonts/Gyre-Pagella/Alphabets/Regular/Main.js
*
* Copyright (c) 2013-2015 The MathJax Consortium
*
* 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.
*/
MathJax.OutputJax['SVG'].FONTDATA.FONTS['GyrePagellaMathJax_Alphabets'] = {
directory: 'Alphabets/Regular',
family: 'GyrePagellaMathJax_Alphabets',
id: 'GYREPAGELLAALPHABETS',
0x20: [0,0,250,0,0,''],
0xA0: [0,0,250,0,0,''],
0xE3F: [775,83,611,26,576,'576 228c0 -70 -35 -138 -94 -180c-35 -25 -81 -42 -134 -48v-83h-44v80h-6c-41 0 -83 3 -124 3c-36 0 -73 -1 -109 -3v23l26 10c14 5 22 28 22 65v474c0 79 -4 86 -51 90l-36 3v30l158 -3l120 2v84h44v-83h15c121 0 179 -48 179 -136c0 -52 -25 -95 -73 -128 c-28 -19 -51 -28 -100 -38c77 -6 111 -15 149 -43c38 -27 58 -68 58 -119zM473 208c0 86 -40 134 -125 150l-1 -312c81 19 126 76 126 162zM304 40v323c-10 1 -19 1 -29 1c-19 0 -28 0 -67 -2v-315c25 -6 48 -8 77 -8c6 0 12 0 19 1zM443 533c0 66 -30 102 -95 114l-1 -238 c63 17 96 60 96 124zM304 401l-1 251h-14c-32 0 -55 -2 -81 -8v-243c31 -2 44 -2 61 -2c12 0 24 1 35 2'],
0x2103: [709,20,1077,50,1038,'350 537c0 -80 -69 -148 -150 -148c-83 0 -150 67 -150 150s67 150 149 150c84 0 151 -68 151 -152zM310 537c0 62 -50 112 -111 112c-60 0 -109 -49 -109 -110s49 -110 110 -110c60 0 110 50 110 108zM1038 84l-28 -50c-69 -36 -144 -54 -227 -54 c-235 0 -393 146 -393 362c0 135 60 240 174 307c67 39 150 60 237 60c73 0 146 -13 231 -41c-14 -66 -18 -102 -19 -152h-31v72c0 39 -101 79 -199 79c-172 0 -286 -122 -286 -306c0 -197 130 -327 325 -327c76 0 145 20 207 60'],
0x2107: [689,20,500,30,477,'477 60l-20 -34c-4 -6 -69 -45 -149 -46c-129 -2 -278 111 -278 234c0 48 20 100 56 125c25 18 48 26 98 35c-80 62 -100 108 -100 167c0 89 64 148 175 148c68 0 113 -19 161 -67l29 -124h-31l-18 56c-11 34 -74 78 -126 78c-65 0 -118 -63 -118 -126 c0 -75 59 -138 130 -138c8 0 47 3 47 3l12 -53l-7 -6c-38 17 -57 22 -84 22c-83 0 -131 -63 -131 -154c0 -102 84 -156 211 -156c43 0 66 8 130 46'],
0x2109: [692,3,919,50,899,'350 537c0 -80 -69 -148 -150 -148c-83 0 -150 67 -150 150s67 150 149 150c84 0 151 -68 151 -152zM310 537c0 62 -50 112 -111 112c-60 0 -109 -49 -109 -110s49 -110 110 -110c60 0 110 50 110 108zM899 689c-11 -44 -16 -92 -16 -152h-35v65c0 23 -3 28 -27 34 c-31 8 -87 14 -135 14c-59 0 -77 -1 -107 -8v-267c44 -3 104 -4 158 -4c44 0 69 4 72 38l5 52h30l-3 -116l3 -111h-30s-1 37 -5 59c-7 33 -26 37 -70 37l-160 -3v-207c0 -79 5 -87 51 -90l48 -3v-30l-147 3l-146 -3v30l48 3c46 3 51 11 51 90v449c0 79 -5 87 -51 90l-48 3 v30l176 -3l216 3'],
0x2116: [692,20,1096,0,1050,'696 662l-44 -3c-46 -3 -51 -12 -51 -90v-552c0 -6 1 -14 2 -25c1 -7 1 -8 1 -12l-90 16l-373 572v-448c0 -78 5 -87 51 -90l44 -3v-30l-120 3l-116 -3v30l44 3c46 3 51 12 51 90v449c0 78 -5 87 -51 90l-44 3v30l120 -3l54 3l381 -579v456c0 78 -5 87 -51 90l-44 3v30 l116 -3l120 3v-30zM1050 289c0 -101 -88 -182 -200 -182c-105 0 -176 69 -176 171c0 107 79 181 196 181c105 0 180 -71 180 -170zM1050 0h-376v46h376v-46zM978 269c0 94 -54 166 -125 166c-69 0 -107 -47 -107 -132c0 -101 50 -172 124 -172c64 0 108 56 108 138'],
0x2117: [668,19,747,31,718,'718 324c0 -190 -154 -343 -344 -343s-343 153 -343 343s153 344 343 344s344 -154 344 -344zM678 324c0 168 -136 304 -304 304s-303 -136 -303 -304s135 -303 303 -303s304 135 304 303zM552 427c0 -67 -65 -118 -149 -118c-12 0 -21 0 -36 3l-8 29c18 -6 27 -7 40 -7 c48 0 81 33 81 78c0 48 -32 73 -91 73c-18 0 -34 -1 -51 -5v-277c0 -37 0 -42 23 -44l30 -1v-26c-29 2 -59 3 -88 3c-30 0 -59 -1 -89 -3v26l31 1c23 2 23 7 23 44v241c0 35 -1 43 -25 44l-28 2v25c36 -2 73 -2 109 -2c34 0 67 2 101 2c78 0 127 -34 127 -88'],
0x211E: [692,3,668,22,669,'669 -3c-24 2 -48 3 -72 3c-23 0 -45 -1 -68 -3l-41 54l-4 5l-73 -53l-20 28l73 52l-160 215c-16 22 -24 33 -46 57v16h29c116 0 189 58 189 150c0 85 -58 133 -162 133c-34 0 -64 -4 -98 -12v-522c0 -79 5 -87 51 -90l48 -3v-30l-147 3l-146 -3v30l48 3 c46 3 51 11 51 90v449c0 78 -5 87 -51 90l-41 3v30l173 -3c60 0 119 3 179 3c130 0 195 -54 195 -150c0 -58 -28 -108 -80 -145c-33 -23 -59 -34 -115 -48l161 -210l76 54l20 -27l-75 -54l45 -59c13 -17 29 -23 61 -26v-30'],
0x2120: [700,-320,938,40,898,'329 451c0 -76 -76 -131 -179 -131c-35 0 -70 7 -104 21c3 25 5 36 5 60c0 3 0 14 -1 24h26l5 -37c3 -20 46 -38 90 -38c56 0 96 32 96 75c0 19 -6 32 -20 43c-14 10 -33 16 -75 21c-58 7 -86 16 -106 32c-18 15 -26 34 -26 60c0 70 65 119 155 119c32 0 59 -6 108 -23 c-7 -31 -9 -48 -9 -79h-26l-4 33c-1 13 -7 20 -24 28c-16 7 -36 11 -58 11c-47 0 -80 -29 -80 -69c0 -37 23 -52 88 -60c68 -8 93 -16 114 -33c17 -14 25 -32 25 -57zM898 328l-89 2l-76 -2v24l21 1c18 2 23 23 23 42v214l-15 -26l-102 -193c-12 -21 -20 -43 -31 -64h-22 l-150 282v-213c0 -20 7 -41 25 -42l27 -1v-24l-71 2l-69 -2v24l28 1c18 1 25 22 25 42v229c0 20 -7 41 -25 42l-28 2v24c19 -2 38 -2 57 -2c20 0 40 0 60 2l148 -278l146 278c20 -2 39 -2 59 -2c18 0 37 0 55 2v-24l-26 -2c-18 -1 -23 -22 -23 -42v-229c0 -19 5 -41 23 -42 l30 -1v-24'],
0x2122: [692,-326,979,40,939,'381 691c-3 -30 -4 -60 -4 -90h-26l-3 44c0 8 -9 13 -18 13h-84c-1 -16 -1 -31 -1 -47v-216c0 -19 5 -41 23 -42l29 -1v-24l-87 2l-86 -2v24l30 1c18 1 23 23 23 42v216c0 16 -1 31 -2 47h-83c-10 0 -19 -5 -19 -13l-3 -44h-26c1 30 -1 60 -4 90l121 -1h91zM939 328 l-89 2l-76 -2v24l21 1c18 2 23 23 23 42v214l-15 -26l-102 -193c-12 -21 -20 -43 -31 -64h-22l-150 282v-213c0 -20 7 -41 25 -42l27 -1v-24l-71 2l-69 -2v24l28 1c18 1 25 22 25 42v229c0 20 -7 41 -25 42l-28 2v24c19 -2 38 -2 57 -2c20 0 40 0 60 2l148 -278l146 278 c20 -2 39 -2 59 -2c18 0 37 0 55 2v-24l-26 -2c-18 -1 -23 -22 -23 -42v-229c0 -19 5 -41 23 -42l30 -1v-24'],
0x2126: [709,3,839,38,801,'801 158c-6 -43 -7 -112 -7 -161c-21 0 -81 3 -119 3c-23 0 -98 0 -119 -3h-22v39c9 9 23 13 38 23c6 4 15 14 25 29c27 40 79 155 79 247c0 212 -79 332 -256 332s-257 -119 -257 -332c0 -92 52 -207 79 -247c10 -15 19 -25 25 -29c14 -10 29 -14 38 -23v-39h-22 c-21 3 -96 3 -119 3c-38 0 -98 -3 -119 -3c0 49 -1 118 -7 161h26l7 -52c4 -29 17 -37 36 -37h115c-63 53 -166 170 -166 302c0 207 139 338 364 338s363 -132 363 -338c0 -132 -103 -249 -166 -302h115c19 0 32 8 36 37l7 52h26'],
0x212A: [692,3,726,22,719,'719 -3c-22 2 -43 3 -65 3c-27 0 -53 -1 -80 -3l-348 335l-10 -7v-205c0 -79 5 -87 51 -90l48 -3v-30l-147 3l-146 -3v30l48 3c46 3 51 11 51 90v449c0 79 -5 87 -51 90l-48 3v30l146 -3l147 3v-30l-48 -3c-46 -3 -51 -11 -51 -90v-214l278 271c16 16 29 33 29 39v27 c30 -2 59 -3 89 -3c27 0 53 1 80 3v-30l-42 -2c-26 -1 -51 -14 -78 -38l-266 -240l330 -312c31 -29 47 -40 62 -41l21 -2v-30'],
0x212B: [939,3,778,15,756,'756 -3l-127 3l-139 -3v30l47 3c25 2 41 9 41 20c0 9 -4 22 -21 64l-46 115h-288l-28 -67c-21 -50 -35 -93 -35 -106c0 -16 13 -23 48 -26l37 -3v-30l-121 3c-36 0 -73 -1 -109 -3v30l37 3c22 2 41 20 54 49l221 502c38 85 49 119 49 119h32l242 -568 c35 -81 46 -100 72 -102l34 -3v-30zM493 269l-126 298l-127 -298h253zM493 839c0 -56 -45 -100 -100 -100c-56 0 -100 44 -100 101c0 55 45 99 102 99c53 0 98 -45 98 -100zM455 839c0 38 -25 64 -61 64c-38 0 -63 -25 -63 -63c0 -40 24 -65 62 -65c37 0 62 26 62 64'],
0x212E: [623,0,772,40,732,'732 302l-565 -8v-173c0 -3 2 -6 2 -6c56 -62 134 -97 217 -97c88 0 168 39 222 103h52c-64 -75 -165 -121 -274 -121c-185 0 -346 133 -346 312c0 178 161 311 346 311s346 -133 346 -311v-10zM605 330v172c0 3 -2 6 -2 6c-56 62 -134 97 -217 97s-161 -35 -217 -97 c0 0 -2 -3 -2 -6v-172c0 -5 4 -9 9 -9h420c5 0 9 4 9 9'],
0xFEFF: [0,0,0,0,0,'']
};
MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/Alphabets/Regular/Main.js");
| {
"pile_set_name": "Github"
} |
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import <objc/NSObject.h>
#import <SafariShared/WBSHistoryServiceDatabaseDelegate-Protocol.h>
@class NSString;
@protocol WBSHistoryServiceDatabaseDelegate;
@interface WBSHistoryServiceDatabaseDelegateWeakProxy : NSObject <WBSHistoryServiceDatabaseDelegate>
{
id <WBSHistoryServiceDatabaseDelegate> _delegate;
}
- (void).cxx_destruct;
- (void)handleEvent:(id)arg1 completionHandler:(CDUnknownBlockType)arg2;
- (void)reportSevereError:(id)arg1 completionHandler:(CDUnknownBlockType)arg2;
- (void)reportPermanentIDsForVisits:(id)arg1 completionHandler:(CDUnknownBlockType)arg2;
- (void)reportPermanentIDsForItems:(id)arg1 completionHandler:(CDUnknownBlockType)arg2;
- (id)initWithDelegate:(id)arg1;
- (id)init;
// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;
@end
| {
"pile_set_name": "Github"
} |
// CodeContracts
//
// Copyright (c) Microsoft Corporation
//
// All rights reserved.
//
// MIT License
//
// 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.
// File System.ServiceModel.Dispatcher.DuplexChannelBinder.IDuplexRequest.cs
// Automatically generated contract file.
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Diagnostics.Contracts;
using System;
// Disable the "this variable is not used" warning as every field would imply it.
#pragma warning disable 0414
// Disable the "this variable is never assigned to".
#pragma warning disable 0067
// Disable the "this event is never assigned to".
#pragma warning disable 0649
// Disable the "this variable is never used".
#pragma warning disable 0169
// Disable the "new keyword not required" warning.
#pragma warning disable 0109
// Disable the "extern without DllImport" warning.
#pragma warning disable 0626
// Disable the "could hide other member" warning, can happen on certain properties.
#pragma warning disable 0108
namespace System.ServiceModel.Dispatcher
{
internal partial class DuplexChannelBinder
{
private partial interface IDuplexRequest
{
#region Methods and constructors
void Abort();
void GotReply(System.ServiceModel.Channels.Message reply);
#endregion
}
}
}
| {
"pile_set_name": "Github"
} |
using System;
using System.Runtime.InteropServices;
public class TokenManipulator
{
[DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall,
ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr relen);
[DllImport("kernel32.dll", ExactSpelling = true)]
internal static extern IntPtr GetCurrentProcess();
[DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
internal static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr
phtok);
[DllImport("advapi32.dll", SetLastError = true)]
internal static extern bool LookupPrivilegeValue(string host, string name,
ref long pluid);
[StructLayout(LayoutKind.Sequential, Pack = 1)]
internal struct TokPriv1Luid
{
public int Count;
public long Luid;
public int Attr;
}
internal const int SE_PRIVILEGE_DISABLED = 0x00000000;
internal const int SE_PRIVILEGE_ENABLED = 0x00000002;
internal const int TOKEN_QUERY = 0x00000008;
internal const int TOKEN_ADJUST_PRIVILEGES = 0x00000020;
public const string SE_ASSIGNPRIMARYTOKEN_NAME = "SeAssignPrimaryTokenPrivilege";
public const string SE_AUDIT_NAME = "SeAuditPrivilege";
public const string SE_BACKUP_NAME = "SeBackupPrivilege";
public const string SE_CHANGE_NOTIFY_NAME = "SeChangeNotifyPrivilege";
public const string SE_CREATE_GLOBAL_NAME = "SeCreateGlobalPrivilege";
public const string SE_CREATE_PAGEFILE_NAME = "SeCreatePagefilePrivilege";
public const string SE_CREATE_PERMANENT_NAME = "SeCreatePermanentPrivilege";
public const string SE_CREATE_SYMBOLIC_LINK_NAME = "SeCreateSymbolicLinkPrivilege";
public const string SE_CREATE_TOKEN_NAME = "SeCreateTokenPrivilege";
public const string SE_DEBUG_NAME = "SeDebugPrivilege";
public const string SE_ENABLE_DELEGATION_NAME = "SeEnableDelegationPrivilege";
public const string SE_IMPERSONATE_NAME = "SeImpersonatePrivilege";
public const string SE_INC_BASE_PRIORITY_NAME = "SeIncreaseBasePriorityPrivilege";
public const string SE_INCREASE_QUOTA_NAME = "SeIncreaseQuotaPrivilege";
public const string SE_INC_WORKING_SET_NAME = "SeIncreaseWorkingSetPrivilege";
public const string SE_LOAD_DRIVER_NAME = "SeLoadDriverPrivilege";
public const string SE_LOCK_MEMORY_NAME = "SeLockMemoryPrivilege";
public const string SE_MACHINE_ACCOUNT_NAME = "SeMachineAccountPrivilege";
public const string SE_MANAGE_VOLUME_NAME = "SeManageVolumePrivilege";
public const string SE_PROF_SINGLE_PROCESS_NAME = "SeProfileSingleProcessPrivilege";
public const string SE_RELABEL_NAME = "SeRelabelPrivilege";
public const string SE_REMOTE_SHUTDOWN_NAME = "SeRemoteShutdownPrivilege";
public const string SE_RESTORE_NAME = "SeRestorePrivilege";
public const string SE_SECURITY_NAME = "SeSecurityPrivilege";
public const string SE_SHUTDOWN_NAME = "SeShutdownPrivilege";
public const string SE_SYNC_AGENT_NAME = "SeSyncAgentPrivilege";
public const string SE_SYSTEM_ENVIRONMENT_NAME = "SeSystemEnvironmentPrivilege";
public const string SE_SYSTEM_PROFILE_NAME = "SeSystemProfilePrivilege";
public const string SE_SYSTEMTIME_NAME = "SeSystemtimePrivilege";
public const string SE_TAKE_OWNERSHIP_NAME = "SeTakeOwnershipPrivilege";
public const string SE_TCB_NAME = "SeTcbPrivilege";
public const string SE_TIME_ZONE_NAME = "SeTimeZonePrivilege";
public const string SE_TRUSTED_CREDMAN_ACCESS_NAME = "SeTrustedCredManAccessPrivilege";
public const string SE_UNDOCK_NAME = "SeUndockPrivilege";
public const string SE_UNSOLICITED_INPUT_NAME = "SeUnsolicitedInputPrivilege";
public static bool AddPrivilege(string privilege)
{
try
{
bool retVal;
TokPriv1Luid tp;
IntPtr hproc = GetCurrentProcess();
IntPtr htok = IntPtr.Zero;
retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok);
tp.Count = 1;
tp.Luid = 0;
tp.Attr = SE_PRIVILEGE_ENABLED;
retVal = LookupPrivilegeValue(null, privilege, ref tp.Luid);
retVal = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero);
return retVal;
}
catch (Exception ex)
{
throw ex;
}
}
public static bool RemovePrivilege(string privilege)
{
try
{
bool retVal;
TokPriv1Luid tp;
IntPtr hproc = GetCurrentProcess();
IntPtr htok = IntPtr.Zero;
retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok);
tp.Count = 1;
tp.Luid = 0;
tp.Attr = SE_PRIVILEGE_DISABLED;
retVal = LookupPrivilegeValue(null, privilege, ref tp.Luid);
retVal = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero);
return retVal;
}
catch (Exception ex)
{
throw ex;
}
}
}
| {
"pile_set_name": "Github"
} |
# Commands covered: format
#
# This file contains a collection of tests for one or more of the Tcl
# built-in commands. Sourcing this file into Tcl runs the tests and
# generates output for errors. No output means no errors were found.
#
# Copyright (c) 1991-1994 The Regents of the University of California.
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
namespace import -force ::tcltest::*
}
# %u output depends on word length, so this test is not portable.
testConstraint longIs32bit [expr {int(0x80000000) < 0}]
testConstraint longIs64bit [expr {int(0x8000000000000000) < 0}]
testConstraint wideIs64bit \
[expr {(wide(0x80000000) > 0) && (wide(0x8000000000000000) < 0)}]
testConstraint wideBiggerThanInt [expr {wide(0x80000000) != int(0x80000000)}]
test format-1.1 {integer formatting} {
format "%*d %d %d %d" 6 34 16923 -12 -1
} { 34 16923 -12 -1}
test format-1.2 {integer formatting} {
format "%4d %4d %4d %4d %d %#x %#X" 6 34 16923 -12 -1 14 12
} { 6 34 16923 -12 -1 0xe 0XC}
test format-1.3 {integer formatting} longIs32bit {
format "%4u %4u %4u %4u %d %#o" 6 34 16923 -12 -1 0
} { 6 34 16923 4294967284 -1 0}
test format-1.3.1 {integer formatting} longIs64bit {
format "%4u %4u %4u %4u %d %#o" 6 34 16923 -12 -1 0
} { 6 34 16923 18446744073709551604 -1 0}
test format-1.4 {integer formatting} {
format "%-4d %-4i %-4d %-4ld" 6 34 16923 -12 -1
} {6 34 16923 -12 }
test format-1.5 {integer formatting} {
format "%04d %04d %04d %04i" 6 34 16923 -12 -1
} {0006 0034 16923 -012}
test format-1.6 {integer formatting} {
format "%00*d" 6 34
} {000034}
# Printing negative numbers in hex or octal format depends on word
# length, so these tests are not portable.
test format-1.7 {integer formatting} longIs32bit {
format "%4x %4x %4x %4x" 6 34 16923 -12 -1
} { 6 22 421b fffffff4}
test format-1.7.1 {integer formatting} longIs64bit {
format "%4x %4x %4x %4x" 6 34 16923 -12 -1
} { 6 22 421b fffffffffffffff4}
test format-1.8 {integer formatting} longIs32bit {
format "%#x %#X %#X %#x" 6 34 16923 -12 -1
} {0x6 0X22 0X421B 0xfffffff4}
test format-1.8.1 {integer formatting} longIs64bit {
format "%#x %#X %#X %#x" 6 34 16923 -12 -1
} {0x6 0X22 0X421B 0xfffffffffffffff4}
test format-1.9 {integer formatting} longIs32bit {
format "%#20x %#20x %#20x %#20x" 6 34 16923 -12 -1
} { 0x6 0x22 0x421b 0xfffffff4}
test format-1.9.1 {integer formatting} longIs64bit {
format "%#20x %#20x %#20x %#20x" 6 34 16923 -12 -1
} { 0x6 0x22 0x421b 0xfffffffffffffff4}
test format-1.10 {integer formatting} longIs32bit {
format "%-#20x %-#20x %-#20x %-#20x" 6 34 16923 -12 -1
} {0x6 0x22 0x421b 0xfffffff4 }
test format-1.10.1 {integer formatting} longIs64bit {
format "%-#20x %-#20x %-#20x %-#20x" 6 34 16923 -12 -1
} {0x6 0x22 0x421b 0xfffffffffffffff4 }
test format-1.11 {integer formatting} longIs32bit {
format "%-#20o %#-20o %#-20o %#-20o" 6 34 16923 -12 -1
} {06 042 041033 037777777764 }
test format-1.11.1 {integer formatting} longIs64bit {
format "%-#20o %#-20o %#-20o %#-20o" 6 34 16923 -12 -1
} {06 042 041033 01777777777777777777764}
test format-2.1 {string formatting} {
format "%s %s %c %s" abcd {This is a very long test string.} 120 x
} {abcd This is a very long test string. x x}
test format-2.2 {string formatting} {
format "%20s %20s %20c %20s" abcd {This is a very long test string.} 120 x
} { abcd This is a very long test string. x x}
test format-2.3 {string formatting} {
format "%.10s %.10s %c %.10s" abcd {This is a very long test string.} 120 x
} {abcd This is a x x}
test format-2.4 {string formatting} {
format "%s %s %% %c %s" abcd {This is a very long test string.} 120 x
} {abcd This is a very long test string. % x x}
test format-2.5 {string formatting, embedded nulls} {
format "%10s" abc\0def
} " abc\0def"
test format-2.6 {string formatting, international chars} {
format "%10s" abc\ufeffdef
} " abc\ufeffdef"
test format-2.7 {string formatting, international chars} {
format "%.5s" abc\ufeffdef
} "abc\ufeffd"
test format-2.8 {string formatting, international chars} {
format "foo\ufeffbar%s" baz
} "foo\ufeffbarbaz"
test format-2.9 {string formatting, width} {
format "a%5sa" f
} "a fa"
test format-2.10 {string formatting, width} {
format "a%-5sa" f
} "af a"
test format-2.11 {string formatting, width} {
format "a%2sa" foo
} "afooa"
test format-2.12 {string formatting, width} {
format "a%0sa" foo
} "afooa"
test format-2.13 {string formatting, precision} {
format "a%.2sa" foobarbaz
} "afoa"
test format-2.14 {string formatting, precision} {
format "a%.sa" foobarbaz
} "aa"
test format-2.15 {string formatting, precision} {
list [catch {format "a%.-2sa" foobarbaz} msg] $msg
} {1 {bad field specifier "-"}}
test format-2.16 {string formatting, width and precision} {
format "a%5.2sa" foobarbaz
} "a foa"
test format-2.17 {string formatting, width and precision} {
format "a%5.7sa" foobarbaz
} "afoobarba"
test format-3.1 {Tcl_FormatObjCmd: character formatting} {
format "|%c|%0c|%-1c|%1c|%-6c|%6c|%*c|%*c|" 65 65 65 65 65 65 3 65 -4 65
} "|A|A|A|A|A | A| A|A |"
test format-3.2 {Tcl_FormatObjCmd: international character formatting} {
format "|%c|%0c|%-1c|%1c|%-6c|%6c|%*c|%*c|" 0xa2 0x4e4e 0x25a 0xc3 0xff08 0 3 0x6575 -4 0x4e4f
} "|\ua2|\u4e4e|\u25a|\uc3|\uff08 | \0| \u6575|\u4e4f |"
test format-4.1 {e and f formats} {eformat} {
format "%e %e %e %e" 34.2e12 68.514 -.125 -16000. .000053
} {3.420000e+13 6.851400e+01 -1.250000e-01 -1.600000e+04}
test format-4.2 {e and f formats} {eformat} {
format "%20e %20e %20e %20e" 34.2e12 68.514 -.125 -16000. .000053
} { 3.420000e+13 6.851400e+01 -1.250000e-01 -1.600000e+04}
test format-4.3 {e and f formats} {eformat} {
format "%.1e %.1e %.1e %.1e" 34.2e12 68.514 -.126 -16000. .000053
} {3.4e+13 6.9e+01 -1.3e-01 -1.6e+04}
test format-4.4 {e and f formats} {eformat} {
format "%020e %020e %020e %020e" 34.2e12 68.514 -.126 -16000. .000053
} {000000003.420000e+13 000000006.851400e+01 -00000001.260000e-01 -00000001.600000e+04}
test format-4.5 {e and f formats} {eformat} {
format "%7.1e %7.1e %7.1e %7.1e" 34.2e12 68.514 -.126 -16000. .000053
} {3.4e+13 6.9e+01 -1.3e-01 -1.6e+04}
test format-4.6 {e and f formats} {
format "%f %f %f %f" 34.2e12 68.514 -.125 -16000. .000053
} {34200000000000.000000 68.514000 -0.125000 -16000.000000}
test format-4.7 {e and f formats} {
format "%.4f %.4f %.4f %.4f %.4f" 34.2e12 68.514 -.125 -16000. .000053
} {34200000000000.0000 68.5140 -0.1250 -16000.0000 0.0001}
test format-4.8 {e and f formats} {eformat} {
format "%.4e %.5e %.6e" -9.99996 -9.99996 9.99996
} {-1.0000e+01 -9.99996e+00 9.999960e+00}
test format-4.9 {e and f formats} {
format "%.4f %.5f %.6f" -9.99996 -9.99996 9.99996
} {-10.0000 -9.99996 9.999960}
test format-4.10 {e and f formats} {
format "%20f %-20f %020f" -9.99996 -9.99996 9.99996
} { -9.999960 -9.999960 0000000000009.999960}
test format-4.11 {e and f formats} {
format "%-020f %020f" -9.99996 -9.99996 9.99996
} {-9.999960 -000000000009.999960}
test format-4.12 {e and f formats} {eformat} {
format "%.0e %#.0e" -9.99996 -9.99996 9.99996
} {-1e+01 -1.e+01}
test format-4.13 {e and f formats} {
format "%.0f %#.0f" -9.99996 -9.99996 9.99996
} {-10 -10.}
test format-4.14 {e and f formats} {
format "%.4f %.5f %.6f" -9.99996 -9.99996 9.99996
} {-10.0000 -9.99996 9.999960}
test format-4.15 {e and f formats} {
format "%3.0f %3.0f %3.0f %3.0f" 1.0 1.1 1.01 1.001
} { 1 1 1 1}
test format-4.16 {e and f formats} {
format "%3.1f %3.1f %3.1f %3.1f" 0.0 0.1 0.01 0.001
} {0.0 0.1 0.0 0.0}
test format-5.1 {g-format} {eformat} {
format "%.3g" 12341.0
} {1.23e+04}
test format-5.2 {g-format} {eformat} {
format "%.3G" 1234.12345
} {1.23E+03}
test format-5.3 {g-format} {
format "%.3g" 123.412345
} {123}
test format-5.4 {g-format} {
format "%.3g" 12.3412345
} {12.3}
test format-5.5 {g-format} {
format "%.3g" 1.23412345
} {1.23}
test format-5.6 {g-format} {
format "%.3g" 1.23412345
} {1.23}
test format-5.7 {g-format} {
format "%.3g" .123412345
} {0.123}
test format-5.8 {g-format} {
format "%.3g" .012341
} {0.0123}
test format-5.9 {g-format} {
format "%.3g" .0012341
} {0.00123}
test format-5.10 {g-format} {
format "%.3g" .00012341
} {0.000123}
test format-5.11 {g-format} {eformat} {
format "%.3g" .00001234
} {1.23e-05}
test format-5.12 {g-format} {eformat} {
format "%.4g" 9999.6
} {1e+04}
test format-5.13 {g-format} {
format "%.4g" 999.96
} {1000}
test format-5.14 {g-format} {
format "%.3g" 1.0
} {1}
test format-5.15 {g-format} {
format "%.3g" .1
} {0.1}
test format-5.16 {g-format} {
format "%.3g" .01
} {0.01}
test format-5.17 {g-format} {
format "%.3g" .001
} {0.001}
test format-5.18 {g-format} {eformat} {
format "%.3g" .00001
} {1e-05}
test format-5.19 {g-format} {eformat} {
format "%#.3g" 1234.0
} {1.23e+03}
test format-5.20 {g-format} {eformat} {
format "%#.3G" 9999.5
} {1.00E+04}
test format-6.1 {floating-point zeroes} {eformat} {
format "%e %f %g" 0.0 0.0 0.0 0.0
} {0.000000e+00 0.000000 0}
test format-6.2 {floating-point zeroes} {eformat} {
format "%.4e %.4f %.4g" 0.0 0.0 0.0 0.0
} {0.0000e+00 0.0000 0}
test format-6.3 {floating-point zeroes} {eformat} {
format "%#.4e %#.4f %#.4g" 0.0 0.0 0.0 0.0
} {0.0000e+00 0.0000 0.000}
test format-6.4 {floating-point zeroes} {eformat} {
format "%.0e %.0f %.0g" 0.0 0.0 0.0 0.0
} {0e+00 0 0}
test format-6.5 {floating-point zeroes} {eformat} {
format "%#.0e %#.0f %#.0g" 0.0 0.0 0.0 0.0
} {0.e+00 0. 0.}
test format-6.6 {floating-point zeroes} {
format "%3.0f %3.0f %3.0f %3.0f" 0.0 0.0 0.0 0.0
} { 0 0 0 0}
test format-6.7 {floating-point zeroes} {
format "%3.0f %3.0f %3.0f %3.0f" 1.0 1.1 1.01 1.001
} { 1 1 1 1}
test format-6.8 {floating-point zeroes} {
format "%3.1f %3.1f %3.1f %3.1f" 0.0 0.1 0.01 0.001
} {0.0 0.1 0.0 0.0}
test format-7.1 {various syntax features} {
format "%*.*f" 12 3 12.345678901
} { 12.346}
test format-7.2 {various syntax features} {
format "%0*.*f" 12 3 12.345678901
} {00000012.346}
test format-7.3 {various syntax features} {
format "\*\t\\n"
} {* \n}
test format-8.1 {error conditions} {
catch format
} 1
test format-8.2 {error conditions} {
catch format msg
set msg
} {wrong # args: should be "format formatString ?arg arg ...?"}
test format-8.3 {error conditions} {
catch {format %*d}
} 1
test format-8.4 {error conditions} {
catch {format %*d} msg
set msg
} {not enough arguments for all format specifiers}
test format-8.5 {error conditions} {
catch {format %*.*f 12}
} 1
test format-8.6 {error conditions} {
catch {format %*.*f 12} msg
set msg
} {not enough arguments for all format specifiers}
test format-8.7 {error conditions} {
catch {format %*.*f 12 3}
} 1
test format-8.8 {error conditions} {
catch {format %*.*f 12 3} msg
set msg
} {not enough arguments for all format specifiers}
test format-8.9 {error conditions} {
list [catch {format %*d x 3} msg] $msg
} {1 {expected integer but got "x"}}
test format-8.10 {error conditions} {
list [catch {format %*.*f 2 xyz 3} msg] $msg
} {1 {expected integer but got "xyz"}}
test format-8.11 {error conditions} {
catch {format %d 2a}
} 1
test format-8.12 {error conditions} {
catch {format %d 2a} msg
set msg
} {expected integer but got "2a"}
test format-8.13 {error conditions} {
catch {format %c 2x}
} 1
test format-8.14 {error conditions} {
catch {format %c 2x} msg
set msg
} {expected integer but got "2x"}
test format-8.15 {error conditions} {
catch {format %f 2.1z}
} 1
test format-8.16 {error conditions} {
catch {format %f 2.1z} msg
set msg
} {expected floating-point number but got "2.1z"}
test format-8.17 {error conditions} {
catch {format ab%}
} 1
test format-8.18 {error conditions} {
catch {format ab% 12} msg
set msg
} {format string ended in middle of field specifier}
test format-8.19 {error conditions} {
catch {format %q x}
} 1
test format-8.20 {error conditions} {
catch {format %q x} msg
set msg
} {bad field specifier "q"}
test format-8.21 {error conditions} {
catch {format %d}
} 1
test format-8.22 {error conditions} {
catch {format %d} msg
set msg
} {not enough arguments for all format specifiers}
test format-8.23 {error conditions} {
catch {format "%d %d" 24 xyz} msg
set msg
} {expected integer but got "xyz"}
test format-9.1 {long result} {
set a {1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}
format {1111 2222 3333 4444 5555 6666 7777 8888 9999 aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn oooo pppp qqqq rrrr ssss tttt uuuu vvvv wwww xxxx yyyy zzzz AAAA BBBB CCCC DDDD EEEE FFFF GGGG %s %s} $a $a
} {1111 2222 3333 4444 5555 6666 7777 8888 9999 aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn oooo pppp qqqq rrrr ssss tttt uuuu vvvv wwww xxxx yyyy zzzz AAAA BBBB CCCC DDDD EEEE FFFF GGGG 1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}
test format-10.1 {"h" format specifier} {
format %hd 0xffff
} -1
test format-10.2 {"h" format specifier} {
format %hx 0x10fff
} fff
test format-10.3 {"h" format specifier} {
format %hd 0x10000
} 0
test format-10.4 {"h" format specifier} {
# Bug 1154163: This is minimal behaviour for %hx specifier!
format %hx 1
} 1
test format-10.5 {"h" format specifier} {
# Bug 1284178: Highly out-of-range values shouldn't cause errors
format %hu 0x100000000
} 0
test format-11.1 {XPG3 %$n specifiers} {
format {%2$d %1$d} 4 5
} {5 4}
test format-11.2 {XPG3 %$n specifiers} {
format {%2$d %1$d %1$d %3$d} 4 5 6
} {5 4 4 6}
test format-11.3 {XPG3 %$n specifiers} {
list [catch {format {%2$d %3$d} 4 5} msg] $msg
} {1 {"%n$" argument index out of range}}
test format-11.4 {XPG3 %$n specifiers} {
list [catch {format {%2$d %0$d} 4 5 6} msg] $msg
} {1 {"%n$" argument index out of range}}
test format-11.5 {XPG3 %$n specifiers} {
list [catch {format {%d %1$d} 4 5 6} msg] $msg
} {1 {cannot mix "%" and "%n$" conversion specifiers}}
test format-11.6 {XPG3 %$n specifiers} {
list [catch {format {%2$d %d} 4 5 6} msg] $msg
} {1 {cannot mix "%" and "%n$" conversion specifiers}}
test format-11.7 {XPG3 %$n specifiers} {
list [catch {format {%2$d %3d} 4 5 6} msg] $msg
} {1 {cannot mix "%" and "%n$" conversion specifiers}}
test format-11.8 {XPG3 %$n specifiers} {
format {%2$*d %3$d} 1 10 4
} { 4 4}
test format-11.9 {XPG3 %$n specifiers} {
format {%2$.*s %4$d} 1 5 abcdefghijklmnop 44
} {abcde 44}
test format-11.10 {XPG3 %$n specifiers} {
list [catch {format {%2$*d} 4} msg] $msg
} {1 {"%n$" argument index out of range}}
test format-11.11 {XPG3 %$n specifiers} {
list [catch {format {%2$*d} 4 5} msg] $msg
} {1 {"%n$" argument index out of range}}
test format-11.12 {XPG3 %$n specifiers} {
list [catch {format {%2$*d} 4 5 6} msg] $msg
} {0 { 6}}
test format-12.1 {negative width specifiers} {
format "%*d" -47 25
} {25 }
test format-13.1 {tcl_precision fuzzy comparison} {
catch {unset a}
catch {unset b}
catch {unset c}
catch {unset d}
set a 0.0000000000001
set b 0.00000000000001
set c 0.00000000000000001
set d [expr $a + $b + $c]
format {%0.10f %0.12f %0.15f %0.17f} $d $d $d $d
} {0.0000000000 0.000000000000 0.000000000000110 0.00000000000011001}
test format-13.2 {tcl_precision fuzzy comparison} {
catch {unset a}
catch {unset b}
catch {unset c}
catch {unset d}
set a 0.000000000001
set b 0.000000000000005
set c 0.0000000000000008
set d [expr $a + $b + $c]
format {%0.10f %0.12f %0.15f %0.17f} $d $d $d $d
} {0.0000000000 0.000000000001 0.000000000001006 0.00000000000100580}
test format-13.3 {tcl_precision fuzzy comparison} {
catch {unset a}
catch {unset b}
catch {unset c}
set a 0.00000000000099
set b 0.000000000000011
set c [expr $a + $b]
format {%0.10f %0.12f %0.15f %0.17f} $c $c $c $c
} {0.0000000000 0.000000000001 0.000000000001001 0.00000000000100100}
test format-13.4 {tcl_precision fuzzy comparison} {
catch {unset a}
catch {unset b}
catch {unset c}
set a 0.444444444444
set b 0.33333333333333
set c [expr $a + $b]
format {%0.10f %0.12f %0.15f %0.16f} $c $c $c $c
} {0.7777777778 0.777777777777 0.777777777777330 0.7777777777773300}
test format-13.5 {tcl_precision fuzzy comparison} {
catch {unset a}
catch {unset b}
catch {unset c}
set a 0.444444444444
set b 0.99999999999999
set c [expr $a + $b]
format {%0.10f %0.12f %0.15f} $c $c $c
} {1.4444444444 1.444444444444 1.444444444443990}
test format-14.1 {testing MAX_FLOAT_SIZE for 0 and 1} {
format {%s} ""
} {}
test format-14.2 {testing MAX_FLOAT_SIZE for 0 and 1} {
format {%s} "a"
} {a}
test format-15.1 {testing %0..s 0 padding for chars/strings} {
format %05s a
} {0000a}
test format-15.2 {testing %0..s 0 padding for chars/strings} {
format "% 5s" a
} { a}
test format-15.3 {testing %0..s 0 padding for chars/strings} {
format %5s a
} { a}
test format-15.4 {testing %0..s 0 padding for chars/strings} {
format %05c 61
} {0000=}
test format-15.5 {testing %d space padding for integers} {
format "(% 1d) (% 1d)" 10 -10
} {( 10) (-10)}
test format-15.6 {testing %d plus padding for integers} {
format "(%+1d) (%+1d)" 10 -10
} {(+10) (-10)}
set a "0123456789"
set b ""
for {set i 0} {$i < 290} {incr i} {
append b $a
}
for {set i 290} {$i < 400} {incr i} {
test format-16.[expr $i -289] {testing MAX_FLOAT_SIZE} {
format {%s} $b
} $b
append b "x"
}
test format-17.1 {testing %d with wide} {wideIs64bit wideBiggerThanInt} {
format %d 7810179016327718216
} 1819043144
test format-17.2 {testing %ld with wide} {wideIs64bit} {
format %ld 7810179016327718216
} 7810179016327718216
test format-17.3 {testing %ld with non-wide} {wideIs64bit} {
format %ld 42
} 42
test format-17.4 {testing %l with non-integer} {
format %lf 1
} 1.000000
test format-18.1 {do not demote existing numeric values} {
set a 0xaaaaaaaa
# Ensure $a and $b are separate objects
set b 0xaaaa
append b aaaa
set result [expr {$a == $b}]
format %08lx $b
lappend result [expr {$a == $b}]
set b 0xaaaa
append b aaaa
lappend result [expr {$a == $b}]
format %08x $b
lappend result [expr {$a == $b}]
} {1 1 1 1}
test format-18.2 {do not demote existing numeric values} {wideBiggerThanInt} {
set a [expr {0xaaaaaaaaaa + 1}]
set b 0xaaaaaaaaab
list [format %08x $a] [expr {$a == $b}]
} {aaaaaaab 1}
test format-19.1 {
regression test - tcl-core message by Brian Griffin on
26 0ctober 2004
} -body {
set x 0x8fedc654
list [expr { ~ $x }] [format %08x [expr { ~$x }]]
} -match regexp -result {-2414724693 f*701239ab}
test format-19.2 {Bug 1867855} {
format %llx 0
} 0
test format-19.3 {Bug 2830354} {
string length [format %340f 0]
} 340
# cleanup
catch {unset a}
catch {unset b}
catch {unset c}
catch {unset d}
::tcltest::cleanupTests
return
# Local Variables:
# mode: tcl
# End:
| {
"pile_set_name": "Github"
} |
/**
* @license
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BatchId, MutationBatchState, TargetId } from '../core/types';
import { FirestoreError } from '../util/error';
import { ClientId } from './shared_client_state';
/** The different states of a watch target. */
export type QueryTargetState = 'not-current' | 'current' | 'rejected';
/**
* An interface that describes the actions the SharedClientState class needs to
* perform on a cooperating synchronization engine.
*/
export interface SharedClientStateSyncer {
/** Applies a mutation state to an existing batch. */
applyBatchState(
batchId: BatchId,
state: MutationBatchState,
error?: FirestoreError
): Promise<void>;
/** Applies a query target change from a different tab. */
applyTargetState(
targetId: TargetId,
state: QueryTargetState,
error?: FirestoreError
): Promise<void>;
/** Adds or removes Watch targets for queries from different tabs. */
applyActiveTargetsChange(
added: TargetId[],
removed: TargetId[]
): Promise<void>;
/** Returns the IDs of the clients that are currently active. */
getActiveClients(): Promise<ClientId[]>;
}
| {
"pile_set_name": "Github"
} |
'use strict';
const coreWebsocket = require('./coreWebsocket');
const userObject = require('./userObject');
const coreUtils = require('./coreUtils');
const userHistoryModule = {};
// In static mode, the user object is not being sent to the client.
if (!coreUtils.getLocationObject().staticMode && userObject.publicObject) {
const websocket = coreWebsocket.copy((event) => event.data.startsWith('{"wa":'));
userObject.publicObject.history = (options) => new Promise((accept, reject) => {
websocket.send({ wa: 'userHistory', options }, (err, res) => {
if (err) reject(err);
else accept(res);
});
});
}
module.exports = userHistoryModule; | {
"pile_set_name": "Github"
} |
Shader "Hidden/Cluster"
{
Properties
{
_Color ("-", Color) = (1,1,1,1)
_MainTex ("-", 2D) = "white"{}
_NormalTex ("-", 2D) = "bump"{}
}
CGINCLUDE
// PRNG function
float nrand(float2 uv, float salt)
{
uv += float2(salt, 0);
return frac(sin(dot(uv, float2(12.9898, 78.233))) * 43758.5453);
}
// Quaternion multiplication
// http://mathworld.wolfram.com/Quaternion.html
float4 qmul(float4 q1, float4 q2)
{
return float4(
q2.xyz * q1.w + q1.xyz * q2.w + cross(q1.xyz, q2.xyz),
q1.w * q2.w - dot(q1.xyz, q2.xyz)
);
}
// Vector rotation with a quaternion
// http://mathworld.wolfram.com/Quaternion.html
float3 rotate_vector(float3 v, float4 r)
{
float4 r_c = r * float4(-1, -1, -1, 1);
return qmul(r, qmul(float4(v, 0), r_c)).xyz;
}
// Rotation around the Y axis.
float4 y_rotation(float r)
{
return float4(0, sin(r * 0.5), 0, cos(r * 0.5));
}
// Uniform random unit quaternion
// http://www.realtimerendering.com/resources/GraphicsGems/gemsiii/urot.c
float4 random_rotation(float2 uv)
{
float r = nrand(uv, 30);
float r1 = sqrt(1.0 - r);
float r2 = sqrt(r);
float t1 = UNITY_PI * 2 * nrand(uv, 40);
float t2 = UNITY_PI * 2 * nrand(uv, 50);
return float4(sin(t1) * r1, cos(t1) * r1, sin(t2) * r2, cos(t2) * r2);
}
ENDCG
SubShader
{
Tags { "RenderType"="Opaque" }
CGPROGRAM
#pragma surface surf Standard vertex:vert nolightmap
#pragma target 3.0
#include "SimplexNoise2D.cginc"
struct Input {
float2 uv_MainTex;
};
half _InstanceCount;
half _Throttle;
half _Transition;
float4 _TubeParams;
float _Scatter;
float2 _NoiseParams;
float _Scale;
half4 _Color;
half _Glossiness;
half _Metallic;
sampler2D _MainTex;
half _TexScale;
sampler2D _NormalTex;
half _NormalScale;
void vert(inout appdata_full v)
{
float uv = v.texcoord1.xy;
float v_phi = lerp(-1, 1, nrand(uv, 3)) * _TubeParams.x;
float phi = nrand(uv, 1) * UNITY_PI * 2 + v_phi * _Time.y;
float sin_phi, cos_phi;
sincos(phi, sin_phi, cos_phi);
float radius = lerp(_TubeParams.y, _TubeParams.z, nrand(uv, 0));
float height = (nrand(uv, 2) - 0.5) * _TubeParams.w;
float3 pos0 = float3(cos_phi * radius, height, sin_phi * radius);
float3 pos1 = float3(nrand(uv, 5), nrand(uv, 6), nrand(uv, 7));
pos1 = (pos1 - 0.5) * float3(_Scatter, _TubeParams.w, _Scatter);
float2 np = pos0.xy * _NoiseParams.x + _Time.y * _NoiseParams.y;
float scale = (1.0 + snoise(np)) * _Scale;
scale *= saturate((_Throttle - uv.x) * _InstanceCount);
float4 rot0 = y_rotation(-phi);
float4 rot1 = random_rotation(uv);
float3 pos = lerp(pos0, pos1, _Transition);
float4 rot = normalize(lerp(rot0, rot1, _Transition));
float2 uv_rand = float2(nrand(uv, 8), nrand(uv, 9));
v.vertex.xyz = rotate_vector(v.vertex.xyz * scale, rot) + pos;
v.normal = rotate_vector(v.normal, rot);
v.texcoord.xy = v.texcoord.xy * _TexScale + uv_rand;
}
void surf(Input IN, inout SurfaceOutputStandard o)
{
half4 tex_c = tex2D(_MainTex, IN.uv_MainTex);
half4 tex_n = tex2D(_NormalTex, IN.uv_MainTex);
o.Albedo = _Color.rgb * tex_c.rgb;
o.Metallic = _Metallic;
o.Smoothness = _Glossiness;
o.Normal = UnpackScaleNormal(tex_n, _NormalScale);
}
ENDCG
}
FallBack "Diffuse"
}
| {
"pile_set_name": "Github"
} |
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://oss.oracle.com/licenses/CDDL+GPL-1.1
* or LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package com.oracle.webservices.api.message;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Map;
import javax.xml.ws.handler.MessageContext;
/**
* A set of "properties" that can be accessed via strongly-typed fields
* as well as reflexibly through the property name.
*
* @author Kohsuke Kawaguchi
*/
public interface PropertySet {
/**
* Marks a field on {@link PropertySet} as a
* property of {@link MessageContext}.
*
* <p>
* To make the runtime processing easy, this annotation
* must be on a public field (since the property name
* can be set through {@link Map} anyway, you won't be
* losing abstraction by doing so.)
*
* <p>
* For similar reason, this annotation can be only placed
* on a reference type, not primitive type.
*
* @author Kohsuke Kawaguchi
*/
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD,ElementType.METHOD})
public @interface Property {
/**
* Name of the property.
*/
String[] value();
}
public boolean containsKey(Object key);
/**
* Gets the name of the property.
*
* @param key
* This field is typed as {@link Object} to follow the {@link Map#get(Object)}
* convention, but if anything but {@link String} is passed, this method
* just returns null.
*/
public Object get(Object key);
/**
* Sets a property.
*
* <h3>Implementation Note</h3>
* This method is slow. Code inside JAX-WS should define strongly-typed
* fields in this class and access them directly, instead of using this.
*
* @see Property
*/
public Object put(String key, Object value);
/**
* Checks if this {@link PropertySet} supports a property of the given name.
*/
public boolean supports(Object key);
public Object remove(Object key);
/**
* Creates a {@link Map} view of this {@link PropertySet}.
*
* <p>
* This map is partially live, in the sense that values you set to it
* will be reflected to {@link PropertySet}.
*
* <p>
* However, this map may not pick up changes made
* to {@link PropertySet} after the view is created.
*
* @deprecated use newer implementation {@link com.sun.xml.ws.api.PropertySet#asMap()} which produces
* readwrite {@link Map}
*
* @return
* always non-null valid instance.
*/
@Deprecated
public Map<String,Object> createMapView();
/**
* Creates a modifiable {@link Map} view of this {@link PropertySet}.
* <p/>
* Changes done on this {@link Map} or on {@link PropertySet} object work in both directions - values made to
* {@link Map} are reflected to {@link PropertySet} and changes done using getters/setters on {@link PropertySet}
* object are automatically reflected in this {@link Map}.
* <p/>
* If necessary, it also can hold other values (not present on {@link PropertySet}) -
* {@see PropertySet#mapAllowsAdditionalProperties}
*
* @return always non-null valid instance.
*/
public Map<String, Object> asMap();
}
| {
"pile_set_name": "Github"
} |
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
arch: powerpc
bsp: br_uid
build-type: bsp
cflags: []
copyrights:
- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
cppflags: []
enabled-by: true
family: gen83xx
includes: []
install: []
links:
- role: build-dependency
uid: ../../opto2
- role: build-dependency
uid: grp
source: []
type: build
| {
"pile_set_name": "Github"
} |
/*
* Sharp s921 driver
*
* Copyright (C) 2009 Mauro Carvalho Chehab
* Copyright (C) 2009 Douglas Landgraf <[email protected]>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation version 2.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#ifndef S921_H
#define S921_H
#include <linux/kconfig.h>
#include <linux/dvb/frontend.h>
struct s921_config {
/* the demodulator's i2c address */
u8 demod_address;
};
#if IS_REACHABLE(CONFIG_DVB_S921)
extern struct dvb_frontend *s921_attach(const struct s921_config *config,
struct i2c_adapter *i2c);
extern struct i2c_adapter *s921_get_tuner_i2c_adapter(struct dvb_frontend *);
#else
static inline struct dvb_frontend *s921_attach(
const struct s921_config *config, struct i2c_adapter *i2c)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
static inline struct i2c_adapter *
s921_get_tuner_i2c_adapter(struct dvb_frontend *fe)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
#endif
#endif /* S921_H */
| {
"pile_set_name": "Github"
} |
%% DO NOT EDIT this file manually; it is automatically
%% generated from LSR http://lsr.di.unimi.it
%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
%% and then run scripts/auxiliar/makelsr.py
%%
%% This file is in the public domain.
\version "2.21.2"
\header {
lsrtags = "chords"
texidoc = "
The separator between different parts of a chord name can be set to any
markup.
"
doctitle = "Changing chord separator"
} % begin verbatim
\chords {
c:7sus4
\set chordNameSeparator
= \markup { \typewriter | }
c:7sus4
}
| {
"pile_set_name": "Github"
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.Text;
using IronPython.Hosting;
namespace IronPython.EditorExtensions
{
public class PyErrorListCompilerSink : CompilerSink
{
private ITextBuffer textBuffer;
public List<ValidationError> Errors { get; private set; }
public PyErrorListCompilerSink(ITextBuffer textBuffer)
{
this.textBuffer = textBuffer;
this.Errors = new List<ValidationError>();
}
public override void AddError(string path, string message, string lineText, CodeSpan location, int errorCode, Severity severity)
{
// keep the error list under 100 items which is a reasonable number and avoids spending too much time on error processing
if (Errors.Count < 100)
{
int startIndex, endIndex;
if (location.StartLine > 0 && location.EndLine > 0)
{
// get the error bounds to create a span pointing to the error text so it can be navigated to later on by the Error List
startIndex = textBuffer.CurrentSnapshot.GetLineFromLineNumber(location.StartLine - 1).Start.Position + location.StartColumn;
endIndex = textBuffer.CurrentSnapshot.GetLineFromLineNumber(location.EndLine - 1).Start.Position + location.EndColumn;
if (startIndex < endIndex && endIndex < textBuffer.CurrentSnapshot.GetText().Length)
{
// add the error with all its necessary information
Errors.Add(new ValidationError(new Span(startIndex, endIndex - startIndex), message, GetSeverity(severity), ValidationErrorType.Syntactic));
if (Errors.Count == 100)
{
// add a friendly error telling the user the maximum number of errors has been reached
Errors.Add(new ValidationError(new Span(startIndex, endIndex - startIndex), "The maximum number of errors or warnings has been reached."));
}
}
}
}
}
private ValidationErrorSeverity GetSeverity(Severity severity)
{
switch (severity)
{
case Severity.Error:
return ValidationErrorSeverity.Error;
case Severity.Warning:
return ValidationErrorSeverity.Warning;
default:
return ValidationErrorSeverity.Message;
}
}
}
} | {
"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.ftpserver.ftplet;
/**
* A more specific type of reply that is sent when a file is attempted to
* rename. This reply is sent by the RNTO command.
*
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*
*/
public interface RenameFtpReply extends FtpReply {
/**
* Returns the file before the rename.
*
* @return the file before the rename. May return <code>null</code>, if
* the file information is not available.
*/
public FtpFile getFrom();
/**
* Returns the file after the rename.
*
* @return the file after the rename. May return <code>null</code>, if
* the file information is not available.
*/
public FtpFile getTo();
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2018 Vandolf Estrellado
~
~ 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.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/example_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/example_1"/>
<Button
android:id="@+id/example_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/example_2" />
<Button
android:id="@+id/example_3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/example_3" />
<Button
android:id="@+id/example_4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/example_4" />
<Button
android:id="@+id/example_5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/example_5" />
</LinearLayout>
</ScrollView>
| {
"pile_set_name": "Github"
} |
Package/eip197-mini-firmware = $(call Package/firmware-default,Inside Secure EIP197 mini firmware)
define Package/eip197-mini-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/inside-secure/eip197_minifw
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ifpp.bin \
$(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ipue.bin \
$(1)/lib/firmware/inside-secure/eip197_minifw
endef
$(eval $(call BuildPackage,eip197-mini-firmware))
| {
"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.flink.runtime.io.disk.iomanager;
import java.io.EOFException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;
import org.apache.flink.core.memory.MemorySegment;
import org.apache.flink.runtime.memory.AbstractPagedInputView;
/**
* A {@link org.apache.flink.core.memory.DataInputView} that is backed by a
* {@link BlockChannelReader}, making it effectively a data input
* stream. The view reads it data in blocks from the underlying channel. The view can only read data that
* has been written by a {@link ChannelWriterOutputView}, due to block formatting.
*/
public class ChannelReaderInputView extends AbstractChannelReaderInputView {
protected final BlockChannelReader<MemorySegment> reader; // the block reader that reads memory segments
protected int numRequestsRemaining; // the number of block requests remaining
private final int numSegments; // the number of memory segment the view works with
private final ArrayList<MemorySegment> freeMem; // memory gathered once the work is done
private boolean inLastBlock; // flag indicating whether the view is already in the last block
private boolean closed; // flag indicating whether the reader is closed
// --------------------------------------------------------------------------------------------
/**
* Creates a new channel reader that reads from the given channel until the last block
* (as marked by a {@link ChannelWriterOutputView}) is found.
*
* @param reader The reader that reads the data from disk back into memory.
* @param memory A list of memory segments that the reader uses for reading the data in. If the
* list contains more than one segment, the reader will asynchronously pre-fetch
* blocks ahead.
* @param waitForFirstBlock A flag indicating weather this constructor call should block
* until the first block has returned from the asynchronous I/O reader.
*
* @throws IOException Thrown, if the read requests for the first blocks fail to be
* served by the reader.
*/
public ChannelReaderInputView(
BlockChannelReader<MemorySegment> reader,
List<MemorySegment> memory,
boolean waitForFirstBlock) throws IOException {
this(reader, memory, -1, waitForFirstBlock);
}
/**
* Creates a new channel reader that reads from the given channel, expecting a specified
* number of blocks in the channel.
* <p>
* WARNING: The reader will lock if the number of blocks given here is actually lower than
* the actual number of blocks in the channel.
*
* @param reader The reader that reads the data from disk back into memory.
* @param memory A list of memory segments that the reader uses for reading the data in. If the
* list contains more than one segment, the reader will asynchronously pre-fetch
* blocks ahead.
* @param numBlocks The number of blocks this channel will read. If this value is
* given, the reader avoids issuing pre-fetch requests for blocks
* beyond the channel size.
* @param waitForFirstBlock A flag indicating weather this constructor call should block
* until the first block has returned from the asynchronous I/O reader.
*
* @throws IOException Thrown, if the read requests for the first blocks fail to be
* served by the reader.
*/
public ChannelReaderInputView(
BlockChannelReader<MemorySegment> reader,
List<MemorySegment> memory,
int numBlocks,
boolean waitForFirstBlock) throws IOException {
this(reader, memory, numBlocks, ChannelWriterOutputView.HEADER_LENGTH, waitForFirstBlock);
}
/**
* Non public constructor to allow subclasses to use this input view with different headers.
* <p>
* WARNING: The reader will lock if the number of blocks given here is actually lower than
* the actual number of blocks in the channel.
*
* @param reader The reader that reads the data from disk back into memory.
* @param memory A list of memory segments that the reader uses for reading the data in. If the
* list contains more than one segment, the reader will asynchronously pre-fetch
* blocks ahead.
* @param numBlocks The number of blocks this channel will read. If this value is
* given, the reader avoids issuing pre-fetch requests for blocks
* beyond the channel size.
* @param headerLen The length of the header assumed at the beginning of the block. Note that the
* {@link #nextSegment(org.apache.flink.core.memory.MemorySegment)} method assumes the default header length,
* so any subclass changing the header length should override that methods as well.
* @param waitForFirstBlock A flag indicating weather this constructor call should block
* until the first block has returned from the asynchronous I/O reader.
*
* @throws IOException
*/
ChannelReaderInputView(
BlockChannelReader<MemorySegment> reader,
List<MemorySegment> memory,
int numBlocks,
int headerLen,
boolean waitForFirstBlock) throws IOException {
super(headerLen);
if (reader == null || memory == null) {
throw new NullPointerException();
}
if (memory.isEmpty()) {
throw new IllegalArgumentException("Empty list of memory segments given.");
}
if (numBlocks < 1 && numBlocks != -1) {
throw new IllegalArgumentException("The number of blocks must be a positive number, or -1, if unknown.");
}
this.reader = reader;
this.numRequestsRemaining = numBlocks;
this.numSegments = memory.size();
this.freeMem = new ArrayList<MemorySegment>(this.numSegments);
for (int i = 0; i < memory.size(); i++) {
sendReadRequest(memory.get(i));
}
if (waitForFirstBlock) {
advance();
}
}
public void waitForFirstBlock() throws IOException
{
if (getCurrentSegment() == null) {
advance();
}
}
public boolean isClosed() {
return this.closed;
}
/**
* Closes this InputView, closing the underlying reader and returning all memory segments.
*
* @return A list containing all memory segments originally supplied to this view.
* @throws IOException Thrown, if the underlying reader could not be properly closed.
*/
@Override
public List<MemorySegment> close() throws IOException {
if (this.closed) {
throw new IllegalStateException("Already closed.");
}
this.closed = true;
// re-collect all memory segments
ArrayList<MemorySegment> list = this.freeMem;
final MemorySegment current = getCurrentSegment();
if (current != null) {
list.add(current);
}
clear();
// close the writer and gather all segments
final LinkedBlockingQueue<MemorySegment> queue = this.reader.getReturnQueue();
this.reader.close();
while (list.size() < this.numSegments) {
final MemorySegment m = queue.poll();
if (m == null) {
// we get null if the queue is empty. that should not be the case if the reader was properly closed.
throw new RuntimeException("Bug in ChannelReaderInputView: MemorySegments lost.");
}
list.add(m);
}
return list;
}
@Override
public FileIOChannel getChannel() {
return reader;
}
// --------------------------------------------------------------------------------------------
// Utilities
// --------------------------------------------------------------------------------------------
/**
* Gets the next segment from the asynchronous block reader. If more requests are to be issued, the method
* first sends a new request with the current memory segment. If no more requests are pending, the method
* adds the segment to the readers return queue, which thereby effectively collects all memory segments.
* Secondly, the method fetches the next non-consumed segment
* returned by the reader. If no further segments are available, this method thrown an {@link EOFException}.
*
* @param current The memory segment used for the next request.
* @return The memory segment to read from next.
*
* @throws EOFException Thrown, if no further segments are available.
* @throws IOException Thrown, if an I/O error occurred while reading
* @see AbstractPagedInputView#nextSegment(org.apache.flink.core.memory.MemorySegment)
*/
@Override
protected MemorySegment nextSegment(MemorySegment current) throws IOException {
// check if we are at our end
if (this.inLastBlock) {
throw new EOFException();
}
// send a request first. if we have only a single segment, this same segment will be the one obtained in
// the next lines
if (current != null) {
sendReadRequest(current);
}
// get the next segment
final MemorySegment seg = this.reader.getNextReturnedBlock();
// check the header
if (seg.getShort(0) != ChannelWriterOutputView.HEADER_MAGIC_NUMBER) {
throw new IOException("The current block does not belong to a ChannelWriterOutputView / " +
"ChannelReaderInputView: Wrong magic number.");
}
if ( (seg.getShort(ChannelWriterOutputView.HEADER_FLAGS_OFFSET) & ChannelWriterOutputView.FLAG_LAST_BLOCK) != 0) {
// last block
this.numRequestsRemaining = 0;
this.inLastBlock = true;
}
return seg;
}
@Override
protected int getLimitForSegment(MemorySegment segment) {
return segment.getInt(ChannelWriterOutputView.HEAD_BLOCK_LENGTH_OFFSET);
}
/**
* Sends a new read requests, if further requests remain. Otherwise, this method adds the segment
* directly to the readers return queue.
*
* @param seg The segment to use for the read request.
* @throws IOException Thrown, if the reader is in error.
*/
protected void sendReadRequest(MemorySegment seg) throws IOException {
if (this.numRequestsRemaining != 0) {
this.reader.readBlock(seg);
if (this.numRequestsRemaining != -1) {
this.numRequestsRemaining--;
}
} else {
// directly add it to the end of the return queue
this.freeMem.add(seg);
}
}
}
| {
"pile_set_name": "Github"
} |
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "AppDelegate.h"
#import "RCTBundleURLProvider.h"
#import "RCTRootView.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
[[RCTBundleURLProvider sharedSettings] setDefaults];
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"peckish"
initialProperties:nil
launchOptions:launchOptions];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}
@end
| {
"pile_set_name": "Github"
} |
{
"version": 8,
"metadata": {
"test": {
"height": 256
}
},
"center": [
13.418056,
52.499167
],
"zoom": 16,
"pitch": 30,
"sources": {
"mapbox": {
"type": "vector",
"maxzoom": 14,
"tiles": [
"local://tiles/{z}-{x}-{y}.mvt"
]
}
},
"glyphs": "local://glyphs/{fontstack}/{range}.pbf",
"layers": [
{
"id": "background",
"type": "background",
"paint": {
"background-color": "white"
}
},
{
"id": "road",
"type": "line",
"source": "mapbox",
"source-layer": "road",
"paint": {
"line-color": "#888",
"line-width": 1
}
},
{
"id": "text",
"type": "symbol",
"source": "mapbox",
"source-layer": "road_label",
"layout": {
"symbol-placement": "line",
"symbol-spacing": 60,
"text-rotation-alignment": "map",
"text-pitch-alignment": "viewport",
"text-field": "{class}",
"text-font": [
"Open Sans Semibold",
"Arial Unicode MS Bold"
]
},
"paint": {
"text-opacity": 1
}
}
]
}
| {
"pile_set_name": "Github"
} |
" Vim syntax file
" Language: Renderman Interface Bytestream
" Maintainer: Andrew Bromage <[email protected]>
" Last Change: 2003 May 11
"
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
syn case match
" Comments
syn match ribLineComment "#.*$"
syn match ribStructureComment "##.*$"
syn case ignore
syn match ribCommand /[A-Z][a-zA-Z]*/
syn case match
syn region ribString start=/"/ skip=/\\"/ end=/"/
syn match ribStructure "[A-Z][a-zA-Z]*Begin\>\|[A-Z][a-zA-Z]*End"
syn region ribSectionFold start="FrameBegin" end="FrameEnd" fold transparent keepend extend
syn region ribSectionFold start="WorldBegin" end="WorldEnd" fold transparent keepend extend
syn region ribSectionFold start="TransformBegin" end="TransformEnd" fold transparent keepend extend
syn region ribSectionFold start="AttributeBegin" end="AttributeEnd" fold transparent keepend extend
syn region ribSectionFold start="MotionBegin" end="MotionEnd" fold transparent keepend extend
syn region ribSectionFold start="SolidBegin" end="SolidEnd" fold transparent keepend extend
syn region ribSectionFold start="ObjectBegin" end="ObjectEnd" fold transparent keepend extend
syn sync fromstart
"integer number, or floating point number without a dot and with "f".
syn case ignore
syn match ribNumbers display transparent "[-]\=\<\d\|\.\d" contains=ribNumber,ribFloat
syn match ribNumber display contained "[-]\=\d\+\>"
"floating point number, with dot, optional exponent
syn match ribFloat display contained "[-]\=\d\+\.\d*\(e[-+]\=\d\+\)\="
"floating point number, starting with a dot, optional exponent
syn match ribFloat display contained "[-]\=\.\d\+\(e[-+]\=\d\+\)\=\>"
"floating point number, without dot, with exponent
syn match ribFloat display contained "[-]\=\d\+e[-+]\d\+\>"
syn case match
hi def link ribStructure Structure
hi def link ribCommand Statement
hi def link ribStructureComment SpecialComment
hi def link ribLineComment Comment
hi def link ribString String
hi def link ribNumber Number
hi def link ribFloat Float
let b:current_syntax = "rib"
" Options for vi: ts=8 sw=2 sts=2 nowrap noexpandtab ft=vim
| {
"pile_set_name": "Github"
} |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace Dnn.PersonaBar.Prompt.Components.Commands.Client
{
using System;
using Dnn.PersonaBar.Library.Prompt;
using Dnn.PersonaBar.Library.Prompt.Attributes;
using Dnn.PersonaBar.Library.Prompt.Models;
using DotNetNuke.Entities.Portals;
using DotNetNuke.Entities.Users;
using DotNetNuke.Services.Localization;
[ConsoleCommand("cls", Constants.GeneralCategory, "Prompt_Cls_Description")]
public class Cls : IConsoleCommand
{
public string LocalResourceFile => Constants.LocalResourcesFile;
public string ResultHtml => Localization.GetString("Prompt_Cls_ResultHtml", this.LocalResourceFile);
public string ValidationMessage
{
get
{
throw new NotImplementedException();
}
}
public void Initialize(string[] args, PortalSettings portalSettings, UserInfo userInfo, int activeTabId)
{
throw new NotImplementedException();
}
public bool IsValid()
{
throw new NotImplementedException();
}
public ConsoleResultModel Run()
{
throw new NotImplementedException();
}
}
}
| {
"pile_set_name": "Github"
} |
Feature: "init" command
In order to start versioning my spatial datasets
As a repository Owner
I want to create a new repository on a directory of my choice
@FileSystemReposOnly
Scenario: Create repository in the current empty directory
Given I am in an empty directory
When I run the command "init"
Then it should answer "Initialized empty Geogig repository in ${currentdir}/.geogig"
And the repository shall exist
@FileSystemReposOnly
Scenario: Create repository specifying initial configuration
Given I am in an empty directory
When I run the command "init --config foo.bar=baz"
Then the repository shall exist
When I run the command "config foo.bar"
Then it should answer "baz"
@FileSystemReposOnly
Scenario: Create repository specifying the target directory
Given I am in an empty directory
When I run the command "init roads"
Then it should answer "Initialized empty Geogig repository in ${currentdir}/roads/.geogig"
And if I change to the respository subdirectory "roads"
Then the repository shall exist
Scenario: Try to init a repository when already inside a repository
Given I have a repository
When I run the command "init"
Then the response should start with "Reinitialized existing Geogig repository"
And the repository shall exist
Scenario: Try to init a repository from inside a repository subdirectory
Given I have a repository
And I am inside a repository subdirectory "topp/shapes"
When I run the command "init"
Then the response should start with "Reinitialized existing Geogig repository in"
And the repository shall exist
Scenario: Init specifying repo URI
Given I am in an empty directory
When I run the command "init ${repoURI}"
Then the repository at "${repoURI}" shall exist
| {
"pile_set_name": "Github"
} |
# dummy
| {
"pile_set_name": "Github"
} |
---
version:
config: 1377123965
puppet: 2.7.14
time:
last_run: 1377125556
cron: 0.00089
exec: 9.780635
total: 23.5117989384918
config_retrieval: 8.06442093849182
mount: 0.002749
anchor: 0.009641
package: 1.831337
firewall: 0.007807
file: 1.729348
user: 0.02927
ssh_authorized_key: 0.017625
service: 0.734021
group: 0.013421
filebucket: 0.000633
resources: 0.000371
mailalias: 0.000335
augeas: 1.286514
events:
failure: 0
total: 1
success: 1
resources:
skipped: 6
scheduled: 0
failed: 0
total: 439
failed_to_restart: 0
out_of_sync: 1
restarted: 0
changed: 1
changes:
total: 1
| {
"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 policy
import (
"github.com/vmware/go-vmware-nsxt/common"
)
type RealizedServices struct {
// The server will populate this field when returing the resource. Ignored on PUT and POST.
Links []common.ResourceLink `json:"_links,omitempty"`
Schema string `json:"_schema,omitempty"`
Self *common.SelfResourceLink `json:"_self,omitempty"`
// The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected.
Revision int64 `json:"_revision"`
// Timestamp of resource creation
CreateTime int64 `json:"_create_time,omitempty"`
// ID of the user who created this resource
CreateUser string `json:"_create_user,omitempty"`
// Timestamp of last modification
LastModifiedTime int64 `json:"_last_modified_time,omitempty"`
// ID of the user who last modified this resource
LastModifiedUser string `json:"_last_modified_user,omitempty"`
// Indicates system owned resource
SystemOwned bool `json:"_system_owned,omitempty"`
// Description of this resource
Description string `json:"description,omitempty"`
// Defaults to ID if not set
DisplayName string `json:"display_name,omitempty"`
// Unique identifier of this resource
Id string `json:"id,omitempty"`
// The type of this resource.
ResourceType string `json:"resource_type,omitempty"`
// Opaque identifiers meaningful to the API user
Tags []common.Tag `json:"tags,omitempty"`
// Absolute path of this object
Path string `json:"path,omitempty"`
// Path relative from its parent
RelativePath string `json:"relative_path,omitempty"`
// Alarm info detail
Alarms []PolicyAlarmResource `json:"alarms,omitempty"`
// Desire state paths of this object
IntentReference []string `json:"intent_reference,omitempty"`
// Realization id of this object
RealizationSpecificIdentifier string `json:"realization_specific_identifier,omitempty"`
// Realization state of this object
State string `json:"state"`
// List of realized services
RealizedServices []RealizedService `json:"realized_services,omitempty"`
}
| {
"pile_set_name": "Github"
} |
{
"id": "louies-photo",
"name": "Louie's Photo",
"games": {
"nh": {
"sellPrice": {
"currency": "bells",
"value": 10
},
"buyPrices": [
{
"currency": "bells",
"value": 40
}
]
}
},
"category": "Photos"
} | {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2006 Michael Niedermayer <[email protected]>
* Copyright (c) 2008 Peter Ross
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_CHANNEL_LAYOUT_H
#define AVUTIL_CHANNEL_LAYOUT_H
#include <stdint.h>
/**
* @file
* audio channel layout utility functions
*/
/**
* @addtogroup lavu_audio
* @{
*/
/**
* @defgroup channel_masks Audio channel masks
*
* A channel layout is a 64-bits integer with a bit set for every channel.
* The number of bits set must be equal to the number of channels.
* The value 0 means that the channel layout is not known.
* @note this data structure is not powerful enough to handle channels
* combinations that have the same channel multiple times, such as
* dual-mono.
*
* @{
*/
#define AV_CH_FRONT_LEFT 0x00000001
#define AV_CH_FRONT_RIGHT 0x00000002
#define AV_CH_FRONT_CENTER 0x00000004
#define AV_CH_LOW_FREQUENCY 0x00000008
#define AV_CH_BACK_LEFT 0x00000010
#define AV_CH_BACK_RIGHT 0x00000020
#define AV_CH_FRONT_LEFT_OF_CENTER 0x00000040
#define AV_CH_FRONT_RIGHT_OF_CENTER 0x00000080
#define AV_CH_BACK_CENTER 0x00000100
#define AV_CH_SIDE_LEFT 0x00000200
#define AV_CH_SIDE_RIGHT 0x00000400
#define AV_CH_TOP_CENTER 0x00000800
#define AV_CH_TOP_FRONT_LEFT 0x00001000
#define AV_CH_TOP_FRONT_CENTER 0x00002000
#define AV_CH_TOP_FRONT_RIGHT 0x00004000
#define AV_CH_TOP_BACK_LEFT 0x00008000
#define AV_CH_TOP_BACK_CENTER 0x00010000
#define AV_CH_TOP_BACK_RIGHT 0x00020000
#define AV_CH_STEREO_LEFT 0x20000000 ///< Stereo downmix.
#define AV_CH_STEREO_RIGHT 0x40000000 ///< See AV_CH_STEREO_LEFT.
#define AV_CH_WIDE_LEFT 0x0000000080000000ULL
#define AV_CH_WIDE_RIGHT 0x0000000100000000ULL
#define AV_CH_SURROUND_DIRECT_LEFT 0x0000000200000000ULL
#define AV_CH_SURROUND_DIRECT_RIGHT 0x0000000400000000ULL
#define AV_CH_LOW_FREQUENCY_2 0x0000000800000000ULL
/** Channel mask value used for AVCodecContext.request_channel_layout
to indicate that the user requests the channel order of the decoder output
to be the native codec channel order. */
#define AV_CH_LAYOUT_NATIVE 0x8000000000000000ULL
/**
* @}
* @defgroup channel_mask_c Audio channel layouts
* @{
* */
#define AV_CH_LAYOUT_MONO (AV_CH_FRONT_CENTER)
#define AV_CH_LAYOUT_STEREO (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
#define AV_CH_LAYOUT_2POINT1 (AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY)
#define AV_CH_LAYOUT_2_1 (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER)
#define AV_CH_LAYOUT_SURROUND (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER)
#define AV_CH_LAYOUT_3POINT1 (AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY)
#define AV_CH_LAYOUT_4POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER)
#define AV_CH_LAYOUT_4POINT1 (AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY)
#define AV_CH_LAYOUT_2_2 (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
#define AV_CH_LAYOUT_QUAD (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
#define AV_CH_LAYOUT_5POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
#define AV_CH_LAYOUT_5POINT1 (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY)
#define AV_CH_LAYOUT_5POINT0_BACK (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
#define AV_CH_LAYOUT_5POINT1_BACK (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY)
#define AV_CH_LAYOUT_6POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER)
#define AV_CH_LAYOUT_6POINT0_FRONT (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
#define AV_CH_LAYOUT_HEXAGONAL (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER)
#define AV_CH_LAYOUT_6POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER)
#define AV_CH_LAYOUT_6POINT1_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER)
#define AV_CH_LAYOUT_6POINT1_FRONT (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY)
#define AV_CH_LAYOUT_7POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
#define AV_CH_LAYOUT_7POINT0_FRONT (AV_CH_LAYOUT_5POINT0|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
#define AV_CH_LAYOUT_7POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
#define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
#define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
#define AV_CH_LAYOUT_OCTAGONAL (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
#define AV_CH_LAYOUT_HEXADECAGONAL (AV_CH_LAYOUT_OCTAGONAL|AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
#define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
enum AVMatrixEncoding {
AV_MATRIX_ENCODING_NONE,
AV_MATRIX_ENCODING_DOLBY,
AV_MATRIX_ENCODING_DPLII,
AV_MATRIX_ENCODING_DPLIIX,
AV_MATRIX_ENCODING_DPLIIZ,
AV_MATRIX_ENCODING_DOLBYEX,
AV_MATRIX_ENCODING_DOLBYHEADPHONE,
AV_MATRIX_ENCODING_NB
};
/**
* Return a channel layout id that matches name, or 0 if no match is found.
*
* name can be one or several of the following notations,
* separated by '+' or '|':
* - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0,
* 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix);
* - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC,
* SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR);
* - a number of channels, in decimal, followed by 'c', yielding
* the default channel layout for that number of channels (@see
* av_get_default_channel_layout);
* - a channel layout mask, in hexadecimal starting with "0x" (see the
* AV_CH_* macros).
*
* Example: "stereo+FC" = "2c+FC" = "2c+1c" = "0x7"
*/
uint64_t av_get_channel_layout(const char *name);
/**
* Return a channel layout and the number of channels based on the specified name.
*
* This function is similar to (@see av_get_channel_layout), but can also parse
* unknown channel layout specifications.
*
* @param[in] name channel layout specification string
* @param[out] channel_layout parsed channel layout (0 if unknown)
* @param[out] nb_channels number of channels
*
* @return 0 on success, AVERROR(EINVAL) if the parsing fails.
*/
int av_get_extended_channel_layout(const char *name, uint64_t* channel_layout, int* nb_channels);
/**
* Return a description of a channel layout.
* If nb_channels is <= 0, it is guessed from the channel_layout.
*
* @param buf put here the string containing the channel layout
* @param buf_size size in bytes of the buffer
*/
void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout);
struct AVBPrint;
/**
* Append a description of a channel layout to a bprint buffer.
*/
void av_bprint_channel_layout(struct AVBPrint *bp, int nb_channels, uint64_t channel_layout);
/**
* Return the number of channels in the channel layout.
*/
int av_get_channel_layout_nb_channels(uint64_t channel_layout);
/**
* Return default channel layout for a given number of channels.
*/
int64_t av_get_default_channel_layout(int nb_channels);
/**
* Get the index of a channel in channel_layout.
*
* @param channel a channel layout describing exactly one channel which must be
* present in channel_layout.
*
* @return index of channel in channel_layout on success, a negative AVERROR
* on error.
*/
int av_get_channel_layout_channel_index(uint64_t channel_layout,
uint64_t channel);
/**
* Get the channel with the given index in channel_layout.
*/
uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index);
/**
* Get the name of a given channel.
*
* @return channel name on success, NULL on error.
*/
const char *av_get_channel_name(uint64_t channel);
/**
* Get the description of a given channel.
*
* @param channel a channel layout with a single channel
* @return channel description on success, NULL on error
*/
const char *av_get_channel_description(uint64_t channel);
/**
* Get the value and name of a standard channel layout.
*
* @param[in] index index in an internal list, starting at 0
* @param[out] layout channel layout mask
* @param[out] name name of the layout
* @return 0 if the layout exists,
* <0 if index is beyond the limits
*/
int av_get_standard_channel_layout(unsigned index, uint64_t *layout,
const char **name);
/**
* @}
* @}
*/
#endif /* AVUTIL_CHANNEL_LAYOUT_H */
| {
"pile_set_name": "Github"
} |
// Does the following transformations:
// `/foo/[id]/` => `/foo/:id`
// `/foo/[...id]/` => `/foo/*id`
// `/foo/[...]/` => `/foo/*`
export function getMatchPath(srcPagesPath: string): string | undefined {
if (srcPagesPath.includes(`[`) === false) return undefined
const startRegex = /\[/g
const endRegex = /\]/g
const splatRegex = /\[\.\.\./g
return srcPagesPath
.replace(splatRegex, `*`)
.replace(startRegex, `:`)
.replace(endRegex, ``)
.replace(/\/$/, ``)
}
| {
"pile_set_name": "Github"
} |
#include "pkgi_download.h"
#include "pkgi_dialog.h"
#include "pkgi.h"
#include "pkgi_utils.h"
#include "pkgi_sha256.h"
#include "pdb_data.h"
#include <sys/stat.h>
#include <sys/file.h>
#include <stdio.h>
#include <dirent.h>
#define PDB_HDR_FILENAME "\x00\x00\x00\xCB"
#define PDB_HDR_DATETIME "\x00\x00\x00\xCC"
#define PDB_HDR_URL "\x00\x00\x00\xCA"
#define PDB_HDR_ICON "\x00\x00\x00\x6A"
#define PDB_HDR_TITLE "\x00\x00\x00\x69"
#define PDB_HDR_SIZE "\x00\x00\x00\xCE"
#define PDB_HDR_CONTENT "\x00\x00\x00\xD9"
#define PDB_HDR_UNUSED "\x00\x00\x00\x00"
#define PDB_HDR_DLSIZE "\x00\x00\x00\xD0"
static char root[256];
static char resume_file[256];
static pkgi_http* http;
static const DbItem* db_item;
static int download_resume;
static uint64_t initial_offset; // where http download resumes
static uint64_t download_offset; // pkg absolute offset
static uint64_t download_size; // pkg total size (from http request)
static sha256_ctx sha;
static void* item_file; // current file handle
static char item_name[256]; // current file name
static char item_path[256]; // current file path
// temporary buffer for downloads
static uint8_t down[64 * 1024];
// pkg header
static uint64_t total_size;
// UI stuff
static char dialog_extra[256];
static char dialog_eta[256];
static uint32_t info_start;
static uint32_t info_update;
static uint32_t queue_task_id = 10000002;
static uint32_t install_task_id = 80000002;
uint32_t get_task_dir_id(const char* dir, uint32_t tid)
{
char path[128] = "";
int found = 0;
struct stat sb;
while (!found) {
pkgi_snprintf(path, sizeof(path), "%s/%d", dir, tid);
if ((stat(path, &sb) == 0) && S_ISDIR(sb.st_mode)) {
// there is already a directory with the ID, try again...
tid++;
} else {
found = 1;
}
}
return tid;
}
static void write_pdb_string(void* fp, const char* header, const char* pdbstr)
{
pkgi_write(fp, header, 4);
unsigned int pdbstr_len = pkgi_strlen(pdbstr) + 1;
pkgi_write(fp, (char*) &pdbstr_len, 4);
pkgi_write(fp, (char*) &pdbstr_len, 4);
pkgi_write(fp, pdbstr, pdbstr_len);
}
static int create_queue_pdb_files(void)
{
// Create files
char szPDBFile[256] = "";
char szIconFile[256] = "";
pkgi_snprintf(szPDBFile, sizeof(szPDBFile), PKGI_QUEUE_FOLDER "/%d/d0.pdb", queue_task_id);
pkgi_snprintf(szIconFile, sizeof(szIconFile), PKGI_QUEUE_FOLDER "/%d/ICON_FILE", queue_task_id);
// write - ICON_FILE
if (!pkgi_save(szIconFile, iconfile_data, iconfile_data_size))
{
LOG("Error saving %s", szIconFile);
return 0;
}
void *fpPDB = pkgi_create(szPDBFile);
if(!fpPDB)
{
LOG("Failed to create file %s", szPDBFile);
return 0;
}
// write - d0.pdb
//
pkgi_write(fpPDB, pkg_d0top_data, d0top_data_size);
// 000000CE - Download expected size (in bytes)
pkgi_write(fpPDB, PDB_HDR_SIZE "\x00\x00\x00\x08\x00\x00\x00\x08", 12);
pkgi_write(fpPDB, (char*) &total_size, 8);
// 000000CB - PKG file name
write_pdb_string(fpPDB, PDB_HDR_FILENAME, root);
// 000000CC - date/time
write_pdb_string(fpPDB, PDB_HDR_DATETIME, "Mon, 11 Dec 2017 11:45:10 GMT");
// 000000CA - PKG Link download URL
write_pdb_string(fpPDB, PDB_HDR_URL, db_item->url);
// 0000006A - Icon location / path (PNG w/o extension)
write_pdb_string(fpPDB, PDB_HDR_ICON, szIconFile);
// 00000069 - Display title
char title_str[256] = "";
pkgi_snprintf(title_str, sizeof(title_str), "\xE2\x98\x85 Download \x22%s\x22", db_item->name);
write_pdb_string(fpPDB, PDB_HDR_TITLE, title_str);
// 000000D9 - Content id
write_pdb_string(fpPDB, PDB_HDR_CONTENT, db_item->content);
pkgi_write(fpPDB, pkg_d0end_data, pkg_d0end_data_size);
pkgi_close(fpPDB);
return 1;
}
int create_install_pdb_files(const char *path, uint64_t size)
{
void *fp1;
void *fp2;
char temp_buffer[256];
pkgi_snprintf(temp_buffer, sizeof(temp_buffer), "%s/%s", path, "d0.pdb");
fp1 = pkgi_create(temp_buffer);
pkgi_snprintf(temp_buffer, sizeof(temp_buffer), "%s/%s", path, "d1.pdb");
fp2 = pkgi_create(temp_buffer);
if(!fp1 || !fp2) {
LOG("Failed to create file %s", temp_buffer);
return 0;
}
pkgi_write(fp1, install_data_pdb, install_data_pdb_size);
pkgi_write(fp2, install_data_pdb, install_data_pdb_size);
// 000000D0 - Downloaded size (in bytes)
pkgi_write(fp1, PDB_HDR_DLSIZE "\x00\x00\x00\x08\x00\x00\x00\x08", 12);
pkgi_write(fp1, (char*) &size, 8);
pkgi_write(fp2, PDB_HDR_DLSIZE "\x00\x00\x00\x08\x00\x00\x00\x08", 12);
pkgi_write(fp2, (char*) &size, 8);
// 000000CE - Package expected size (in bytes)
pkgi_write(fp1, PDB_HDR_SIZE "\x00\x00\x00\x08\x00\x00\x00\x08", 12);
pkgi_write(fp1, (char*) &size, 8);
pkgi_write(fp2, PDB_HDR_SIZE "\x00\x00\x00\x08\x00\x00\x00\x08", 12);
pkgi_write(fp2, (char*) &size, 8);
// 00000069 - Display title
pkgi_snprintf(temp_buffer, sizeof(temp_buffer), "\xE2\x98\x85 Install \x22%s\x22", db_item->name);
write_pdb_string(fp1, PDB_HDR_TITLE, temp_buffer);
write_pdb_string(fp2, PDB_HDR_TITLE, temp_buffer);
// 000000CB - PKG file name
write_pdb_string(fp1, PDB_HDR_FILENAME, root);
write_pdb_string(fp2, PDB_HDR_FILENAME, root);
// 00000000 - Icon location / path (PNG w/o extension)
pkgi_snprintf(temp_buffer, sizeof(temp_buffer), "%s/%s", path, "ICON_FILE");
write_pdb_string(fp2, PDB_HDR_UNUSED, temp_buffer);
// 0000006A - Icon location / path (PNG w/o extension)
write_pdb_string(fp1, PDB_HDR_ICON, temp_buffer);
write_pdb_string(fp2, PDB_HDR_ICON, temp_buffer);
pkgi_write(fp1, pkg_d0end_data, pkg_d0end_data_size);
pkgi_write(fp2, pkg_d0end_data, pkg_d0end_data_size);
pkgi_close(fp1);
pkgi_close(fp2);
pkgi_snprintf(temp_buffer, sizeof(temp_buffer), "%s/%s", path, "f0.pdb");
pkgi_save(temp_buffer, down, 0);
return 1;
}
static void calculate_eta(uint32_t speed)
{
uint64_t seconds = (download_size - download_offset) / speed;
if (seconds < 60)
{
pkgi_snprintf(dialog_eta, sizeof(dialog_eta), "ETA: %us", (uint32_t)seconds);
}
else if (seconds < 3600)
{
pkgi_snprintf(dialog_eta, sizeof(dialog_eta), "ETA: %um %02us", (uint32_t)(seconds / 60), (uint32_t)(seconds % 60));
}
else
{
uint32_t hours = (uint32_t)(seconds / 3600);
uint32_t minutes = (uint32_t)((seconds - hours * 3600) / 60);
pkgi_snprintf(dialog_eta, sizeof(dialog_eta), "ETA: %uh %02um", hours, minutes);
}
}
static void update_progress(void)
{
uint32_t info_now = pkgi_time_msec();
if (info_now >= info_update)
{
char text[256];
pkgi_snprintf(text, sizeof(text), "%s", item_name);
if (download_resume)
{
// if resuming download, then there is no "download speed"
dialog_extra[0] = 0;
}
else
{
// report download speed
uint32_t speed = (uint32_t)(((download_offset - initial_offset) * 1000) / (info_now - info_start));
if (speed > 10 * 1000 * 1024)
{
pkgi_snprintf(dialog_extra, sizeof(dialog_extra), "%u MB/s", speed / 1024 / 1024);
}
else if (speed > 1000)
{
pkgi_snprintf(dialog_extra, sizeof(dialog_extra), "%u KB/s", speed / 1024);
}
if (speed != 0)
{
// report ETA
calculate_eta(speed);
}
}
float percent;
if (download_resume)
{
// if resuming, then we may not know download size yet, use total_size from pkg header
percent = total_size ? (float)((double)download_offset / total_size) : 0.f;
}
else
{
// when downloading use content length from http response as download size
percent = download_size ? (float)((double)download_offset / download_size) : 0.f;
}
pkgi_dialog_update_progress(text, dialog_extra, dialog_eta, percent);
info_update = info_now + 500;
}
}
static int create_dummy_pkg(void)
{
char dst[256];
pkgi_snprintf(dst, sizeof(dst), PKGI_QUEUE_FOLDER "/%d/%s", queue_task_id, root);
LOG("Creating empty file '%s'...", dst);
if (!pkgi_save(dst, "PKGi PS3", 8))
return 0;
download_offset=0;
if (truncate(dst, download_size) != 0)
{
LOG("Error truncating (%s)", dst);
return 0;
}
LOG("(%s) %d bytes written", dst, download_size);
download_offset=download_size;
return 1;
}
static int queue_pkg_task(void)
{
char pszPKGDir[256];
initial_offset = 0;
LOG("requesting %s @ %llu", db_item->url, 0);
http = pkgi_http_get(db_item->url, db_item->content, 0);
if (!http)
{
pkgi_dialog_error("Could not send HTTP request");
return 0;
}
int64_t http_length;
if (!pkgi_http_response_length(http, &http_length))
{
pkgi_dialog_error("HTTP request failed");
return 0;
}
if (http_length < 0)
{
pkgi_dialog_error("HTTP response has unknown length");
return 0;
}
download_size = http_length;
total_size = download_size;
if (!pkgi_check_free_space(http_length))
{
pkgi_dialog_error("Not enough free space on HDD");
return 0;
}
queue_task_id = get_task_dir_id(PKGI_QUEUE_FOLDER, queue_task_id);
pkgi_snprintf(pszPKGDir, sizeof(pszPKGDir), PKGI_QUEUE_FOLDER "/%d", queue_task_id);
if(!pkgi_mkdirs(pszPKGDir))
{
pkgi_dialog_error("Could not create task directory on HDD.");
return 0;
}
LOG("http response length = %lld, total pkg size = %llu", http_length, download_size);
info_start = pkgi_time_msec();
info_update = pkgi_time_msec() + 500;
pkgi_dialog_set_progress_title("Saving background task...");
pkgi_strncpy(item_name, sizeof(item_name), root);
download_resume = 0;
if(!create_dummy_pkg())
{
pkgi_dialog_error("Could not create PKG file to HDD.");
return 0;
}
if(!create_queue_pdb_files())
{
pkgi_dialog_error("Could not create task files to HDD.");
return 0;
}
return 1;
}
static void download_start(void)
{
LOG("resuming pkg download from %llu offset", download_offset);
download_resume = 0;
info_update = pkgi_time_msec() + 1000;
pkgi_dialog_set_progress_title("Downloading...");
}
static int download_data(uint8_t* buffer, uint32_t size, int save)
{
if (pkgi_dialog_is_cancelled())
{
pkgi_save(resume_file, &sha, sizeof(sha));
return 0;
}
update_progress();
if (!http)
{
initial_offset = download_offset;
LOG("requesting %s @ %llu", db_item->url, download_offset);
http = pkgi_http_get(db_item->url, db_item->content, download_offset);
if (!http)
{
pkgi_dialog_error("Could not send HTTP request");
return 0;
}
int64_t http_length;
if (!pkgi_http_response_length(http, &http_length))
{
pkgi_dialog_error("HTTP request failed");
return 0;
}
if (http_length < 0)
{
pkgi_dialog_error("HTTP response has unknown length");
return 0;
}
download_size = http_length + download_offset;
total_size = download_size;
if (!pkgi_check_free_space(http_length))
{
return 0;
}
LOG("http response length = %lld, total pkg size = %llu", http_length, download_size);
info_start = pkgi_time_msec();
info_update = pkgi_time_msec() + 500;
}
int read = pkgi_http_read(http, buffer, size);
if (read < 0)
{
char error[256];
pkgi_snprintf(error, sizeof(error), "HTTP download error 0x%08x", read);
pkgi_dialog_error(error);
pkgi_save(resume_file, &sha, sizeof(sha));
return -1;
}
else if (read == 0)
{
pkgi_dialog_error("HTTP connection closed");
pkgi_save(resume_file, &sha, sizeof(sha));
return -1;
}
download_offset += read;
sha256_update(&sha, buffer, read);
if (save)
{
if (!pkgi_write(item_file, buffer, read))
{
char error[256];
pkgi_snprintf(error, sizeof(error), "failed to write to %s", item_path);
pkgi_dialog_error(error);
return -1;
}
}
return read;
}
// this includes creating of all the parent folders necessary to actually create file
static int create_file(void)
{
char folder[256];
pkgi_strncpy(folder, sizeof(folder), item_path);
char* last = pkgi_strrchr(folder, '/');
*last = 0;
if (!pkgi_mkdirs(folder))
{
char error[256];
pkgi_snprintf(error, sizeof(error), "cannot create folder %s", folder);
pkgi_dialog_error(error);
return 0;
}
LOG("creating %s file", item_name);
item_file = pkgi_create(item_path);
if (!item_file)
{
char error[256];
pkgi_snprintf(error, sizeof(error), "cannot create file %s", item_name);
pkgi_dialog_error(error);
return 0;
}
return 1;
}
static int resume_partial_file(void)
{
LOG("resuming %s file", item_name);
item_file = pkgi_append(item_path);
if (!item_file)
{
char error[256];
pkgi_snprintf(error, sizeof(error), "cannot resume file %s", item_name);
pkgi_dialog_error(error);
return 0;
}
return 1;
}
static int download_pkg_file(void)
{
LOG("downloading %s", root);
int result = 0;
pkgi_strncpy(item_name, sizeof(item_name), root);
pkgi_snprintf(item_path, sizeof(item_path), "%s/%s", pkgi_get_temp_folder(), root);
if (download_resume)
{
download_offset = pkgi_get_size(item_path);
if (!resume_partial_file()) goto bail;
download_start();
}
else
{
if (!create_file()) goto bail;
}
total_size = sizeof(down);//download_size;
// while (size > 0)
while (download_offset != total_size)
{
uint32_t read = (uint32_t)min64(sizeof(down), total_size - download_offset);
int size = download_data(down, read, 1);
if (size <= 0)
{
goto bail;
}
}
LOG("%s downloaded", item_path);
result = 1;
bail:
if (item_file != NULL)
{
pkgi_close(item_file);
item_file = NULL;
}
return result;
}
static int check_integrity(const uint8_t* digest)
{
if (!digest)
{
LOG("no integrity provided, skipping check");
return 1;
}
uint8_t check[SHA256_DIGEST_SIZE];
sha256_finish(&sha, check);
LOG("checking integrity of pkg");
if (!pkgi_memequ(digest, check, SHA256_DIGEST_SIZE))
{
LOG("pkg integrity is wrong, removing %s & resume data", item_path);
pkgi_rm(item_path);
pkgi_rm(resume_file);
pkgi_dialog_error("pkg integrity failed, try downloading again");
return 0;
}
LOG("pkg integrity check succeeded");
return 1;
}
static int create_rap(const char* contentid, const uint8_t* rap)
{
LOG("creating %s.rap", contentid);
pkgi_dialog_update_progress("Creating RAP file", NULL, NULL, 1.f);
char path[256];
pkgi_snprintf(path, sizeof(path), "%s/%s.rap", PKGI_RAP_FOLDER, contentid);
if (!pkgi_save(path, rap, PKGI_RAP_SIZE))
{
char error[256];
pkgi_snprintf(error, sizeof(error), "Cannot save %s.rap", contentid);
pkgi_dialog_error(error);
return 0;
}
LOG("RAP file created");
return 1;
}
static int create_rif(const char* contentid, const uint8_t* rap)
{
DIR *d;
struct dirent *dir;
char path[256];
char *lic_path = NULL;
d = opendir("/dev_hdd0/home/");
while ((dir = readdir(d)) != NULL)
{
if (pkgi_strstr(dir->d_name, ".") == NULL && pkgi_strstr(dir->d_name, "..") == NULL)
{
pkgi_snprintf(path, sizeof(path)-1, "%s%s%s", "/dev_hdd0/home/", dir->d_name, "/exdata/act.dat");
if (pkgi_get_size(path) > 0)
{
pkgi_snprintf(path, sizeof(path)-1, "%s%s%s", "/dev_hdd0/home/", dir->d_name, "/exdata/");
lic_path = path;
LOG("using folder '%s'", lic_path);
break;
}
}
}
closedir(d);
if (!lic_path)
{
LOG("Skipping %s.rif: no act.dat file found", contentid);
return 1;
}
LOG("creating %s.rif", contentid);
pkgi_dialog_update_progress("Creating RIF file", NULL, NULL, 1.f);
if (!rap2rif(rap, contentid, lic_path))
{
char error[256];
pkgi_snprintf(error, sizeof(error), "Cannot save %s.rif", contentid);
pkgi_dialog_error(error);
return 0;
}
LOG("RIF file created");
return 1;
}
int pkgi_download(const DbItem* item, const int background_dl)
{
int result = 0;
pkgi_snprintf(root, sizeof(root), "%.9s.pkg", item->content + 7);
LOG("package installation file: %s", root);
pkgi_snprintf(resume_file, sizeof(resume_file), "%s/%.9s.resume", pkgi_get_temp_folder(), item->content + 7);
if (pkgi_load(resume_file, &sha, sizeof(sha)) == sizeof(sha))
{
LOG("resume file exists, trying to resume");
pkgi_dialog_set_progress_title("Resuming...");
download_resume = 1;
}
else
{
LOG("cannot load resume file, starting download from scratch");
pkgi_dialog_set_progress_title(background_dl ? "Adding background task..." : "Downloading...");
download_resume = 0;
sha256_init(&sha);
}
http = NULL;
item_file = NULL;
download_size = 0;
download_offset = 0;
db_item = item;
dialog_extra[0] = 0;
dialog_eta[0] = 0;
info_start = pkgi_time_msec();
info_update = info_start + 1000;
if (item->rap)
{
if (!create_rap(item->content, item->rap)) goto finish;
if (!create_rif(item->content, item->rap)) goto finish;
}
if (background_dl)
{
if (!queue_pkg_task()) goto finish;
}
else
{
if (!download_pkg_file()) goto finish;
if (!check_integrity(item->digest)) goto finish;
}
pkgi_rm(resume_file);
result = 1;
finish:
if (http)
{
pkgi_http_close(http);
}
return result;
}
int pkgi_install(const char *titleid)
{
char pkg_path[256];
char filename[256];
pkgi_snprintf(pkg_path, sizeof(pkg_path), "%s/%s", pkgi_get_temp_folder(), root);
uint64_t fsize = pkgi_get_size(pkg_path);
install_task_id = get_task_dir_id(PKGI_INSTALL_FOLDER, install_task_id);
pkgi_snprintf(pkg_path, sizeof(pkg_path), PKGI_INSTALL_FOLDER "/%d", install_task_id);
if (!pkgi_mkdirs(pkg_path))
{
pkgi_dialog_error("Could not create install directory on HDD.");
return 0;
}
LOG("Creating .pdb files [%s]", titleid);
// write - ICON_FILE
pkgi_snprintf(filename, sizeof(filename), PKGI_INSTALL_FOLDER "/%d/ICON_FILE", install_task_id);
if (!pkgi_save(filename, iconfile_data, iconfile_data_size))
{
LOG("Error saving %s", filename);
return 0;
}
if (!create_install_pdb_files(pkg_path, fsize)) {
return 0;
}
pkgi_snprintf(filename, sizeof(filename), "%s/%s", pkg_path, root);
pkgi_snprintf(pkg_path, sizeof(pkg_path), "%s/%s", pkgi_get_temp_folder(), root);
LOG("move (%s) -> (%s)", pkg_path, filename);
int ret = rename(pkg_path, filename);
return (ret == 0);
}
| {
"pile_set_name": "Github"
} |
<template>
<div class="wrapper ${validationClass}">
<div>
<slot></slot>
</div>
<span repeat.for="r of validateResults" class="helper-text" data-error.bind="r.message"></span>
</div>
</template>
| {
"pile_set_name": "Github"
} |
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
description("Test to ensure correct handling of --> as a single line comment when at the beginning of a line");
shouldThrow("'should be a syntax error' -->");
shouldThrow("/**/ 1 -->");
shouldThrow("1 /**/ -->");
shouldBe("1/*\n*/-->", "1");
shouldBeUndefined("-->");
shouldBeUndefined("/**/-->");
shouldBeUndefined("/*\n*/-->");
| {
"pile_set_name": "Github"
} |
SAX.setDocumentLocator()
SAX.startDocument()
SAX.startElement(D:multistatus, xmlns:D='http://www.ietf.org/standards/dav/')
SAX.characters(
, 3)
SAX.startElement(D:response)
SAX.characters(
, 5)
SAX.startElement(D:prop)
SAX.characters(
, 7)
SAX.startElement(D:lockdiscovery)
SAX.characters(
, 9)
SAX.startElement(D:activelock)
SAX.characters(
, 11)
SAX.startElement(D:locktype)
SAX.characters(write, 5)
SAX.endElement(D:locktype)
SAX.characters(
, 11)
SAX.startElement(D:lockscope)
SAX.characters(exclusive, 9)
SAX.endElement(D:lockscope)
SAX.characters(
, 11)
SAX.startElement(D:addlocks)
SAX.characters(
, 13)
SAX.startElement(D:href)
SAX.characters(http://foo.com/doc/, 19)
SAX.endElement(D:href)
SAX.characters(
, 11)
SAX.endElement(D:addlocks)
SAX.characters(
, 11)
SAX.startElement(D:owner)
SAX.characters(Jane Smith, 10)
SAX.endElement(D:owner)
SAX.characters(
, 11)
SAX.startElement(D:timeout)
SAX.characters(Infinite, 8)
SAX.endElement(D:timeout)
SAX.characters(
, 11)
SAX.startElement(D:locktoken)
SAX.characters(
, 13)
SAX.startElement(D:href)
SAX.characters(iamuri:unique!!!!!, 18)
SAX.endElement(D:href)
SAX.characters(
, 11)
SAX.endElement(D:locktoken)
SAX.characters(
, 9)
SAX.endElement(D:activelock)
SAX.characters(
, 7)
SAX.endElement(D:lockdiscovery)
SAX.characters(
, 5)
SAX.endElement(D:prop)
SAX.characters(
, 5)
SAX.startElement(D:status)
SAX.characters(HTTP/1.1 200 OK, 15)
SAX.endElement(D:status)
SAX.characters(
, 3)
SAX.endElement(D:response)
SAX.characters(
, 1)
SAX.endElement(D:multistatus)
SAX.endDocument()
| {
"pile_set_name": "Github"
} |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_requisition_stock
#
# Translators:
# Martin Trigaux, 2019
# Bole <[email protected]>, 2019
# Tina Milas, 2019
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-04-27 09:21+0000\n"
"PO-Revision-Date: 2019-08-26 09:13+0000\n"
"Last-Translator: Tina Milas, 2019\n"
"Language-Team: Croatian (https://www.transifex.com/odoo/teams/41243/hr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: hr\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: purchase_requisition_stock
#: model:ir.model.fields,field_description:purchase_requisition_stock.field_purchase_requisition_line__move_dest_id
msgid "Downstream Move"
msgstr ""
#. module: purchase_requisition_stock
#: model:ir.model,name:purchase_requisition_stock.model_stock_warehouse_orderpoint
msgid "Minimum Inventory Rule"
msgstr "Pravilo minimalne zalihe"
#. module: purchase_requisition_stock
#: model:ir.model.fields,field_description:purchase_requisition_stock.field_purchase_requisition__picking_type_id
msgid "Operation Type"
msgstr "Vrsta operacije"
#. module: purchase_requisition_stock
#: model:ir.model,name:purchase_requisition_stock.model_purchase_order
msgid "Purchase Order"
msgstr "Nalog za nabavu"
#. module: purchase_requisition_stock
#: model:ir.model,name:purchase_requisition_stock.model_purchase_requisition
msgid "Purchase Requisition"
msgstr "Zahtjev za nabavom"
#. module: purchase_requisition_stock
#: model:ir.model,name:purchase_requisition_stock.model_purchase_requisition_line
msgid "Purchase Requisition Line"
msgstr "Stavka zahtjeva za nabavom"
#. module: purchase_requisition_stock
#: model:ir.model.fields,field_description:purchase_requisition_stock.field_stock_move__requisition_line_ids
msgid "Requisition Line"
msgstr ""
#. module: purchase_requisition_stock
#: model:ir.model,name:purchase_requisition_stock.model_stock_move
msgid "Stock Move"
msgstr "Skladišni prijenos"
#. module: purchase_requisition_stock
#: model:ir.model,name:purchase_requisition_stock.model_stock_rule
msgid "Stock Rule"
msgstr "Skladišno pravilo"
#. module: purchase_requisition_stock
#: model:ir.model.fields,field_description:purchase_requisition_stock.field_purchase_requisition__warehouse_id
msgid "Warehouse"
msgstr "Skladište"
| {
"pile_set_name": "Github"
} |
//
// MIT License
//
// Copyright (c) 2014 Bob McCune http://bobmccune.com/
// Copyright (c) 2014 TapHarmonic, LLC http://tapharmonic.com/
//
// 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.
//
@interface UIView (THAdditions)
@property (nonatomic, assign) CGFloat frameX;
@property (nonatomic, assign) CGFloat frameY;
@property (nonatomic, assign) CGFloat frameWidth;
@property (nonatomic, assign) CGFloat frameHeight;
@property (nonatomic, assign) CGPoint frameOrigin;
@property (nonatomic, assign) CGSize frameSize;
@property (nonatomic, assign) CGFloat boundsX;
@property (nonatomic, assign) CGFloat boundsY;
@property (nonatomic, assign) CGFloat boundsWidth;
@property (nonatomic, assign) CGFloat boundsHeight;
@property (nonatomic, assign) CGFloat centerX;
@property (nonatomic, assign) CGFloat centerY;
@end
| {
"pile_set_name": "Github"
} |
// NOTE: This file was generated by the ServiceGenerator.
// ----------------------------------------------------------------------------
// API:
// Cloud User Accounts API (clouduseraccounts/vm_alpha)
// Description:
// Creates and manages users and groups for accessing Google Compute Engine
// virtual machines.
// Documentation:
// https://cloud.google.com/compute/docs/access/user-accounts/api/latest/
#if GTLR_BUILT_AS_FRAMEWORK
#import "GTLR/GTLRQuery.h"
#else
#import "GTLRQuery.h"
#endif
#if GTLR_RUNTIME_VERSION != 3000
#error This file was generated by a different version of ServiceGenerator which is incompatible with this GTLR library source.
#endif
@class GTLRCloudUserAccounts_Group;
@class GTLRCloudUserAccounts_GroupsAddMemberRequest;
@class GTLRCloudUserAccounts_GroupsRemoveMemberRequest;
@class GTLRCloudUserAccounts_Policy;
@class GTLRCloudUserAccounts_PublicKey;
@class GTLRCloudUserAccounts_TestPermissionsRequest;
@class GTLRCloudUserAccounts_User;
NS_ASSUME_NONNULL_BEGIN
/**
* Parent class for other Cloud User Accounts query classes.
*/
@interface GTLRCloudUserAccountsQuery : GTLRQuery
/** Selector specifying which fields to include in a partial response. */
@property(copy, nullable) NSString *fields;
@end
/**
* Deletes the specified operation resource.
*
* Method: clouduseraccounts.globalAccountsOperations.delete
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
*/
@interface GTLRCloudUserAccountsQuery_GlobalAccountsOperationsDelete : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForGlobalAccountsOperationsDeleteWithproject:operation:]
/** Name of the Operations resource to delete. */
@property(copy, nullable) NSString *operation;
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/**
* Upon successful completion, the callback's object and error parameters will
* be nil. This query does not fetch an object.
*
* Deletes the specified operation resource.
*
* @param project Project ID for this request.
* @param operation Name of the Operations resource to delete.
*
* @returns GTLRCloudUserAccountsQuery_GlobalAccountsOperationsDelete
*/
+ (instancetype)queryWithProject:(NSString *)project
operation:(NSString *)operation;
@end
/**
* Retrieves the specified operation resource.
*
* Method: clouduseraccounts.globalAccountsOperations.get
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatformReadOnly
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccountsReadonly
*/
@interface GTLRCloudUserAccountsQuery_GlobalAccountsOperationsGet : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForGlobalAccountsOperationsGetWithproject:operation:]
/** Name of the Operations resource to return. */
@property(copy, nullable) NSString *operation;
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/**
* Fetches a @c GTLRCloudUserAccounts_Operation.
*
* Retrieves the specified operation resource.
*
* @param project Project ID for this request.
* @param operation Name of the Operations resource to return.
*
* @returns GTLRCloudUserAccountsQuery_GlobalAccountsOperationsGet
*/
+ (instancetype)queryWithProject:(NSString *)project
operation:(NSString *)operation;
@end
/**
* Retrieves the list of operation resources contained within the specified
* project.
*
* Method: clouduseraccounts.globalAccountsOperations.list
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatformReadOnly
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccountsReadonly
*/
@interface GTLRCloudUserAccountsQuery_GlobalAccountsOperationsList : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForGlobalAccountsOperationsListWithproject:]
/**
* Sets a filter expression for filtering listed resources, in the form
* filter={expression}. Your {expression} must be in the format: field_name
* comparison_string literal_string.
* The field_name is the name of the field you want to compare. Only atomic
* field types are supported (string, number, boolean). The comparison_string
* must be either eq (equals) or ne (not equals). The literal_string is the
* string value to filter to. The literal value must be valid for the type of
* field you are filtering by (string, number, boolean). For string fields, the
* literal value is interpreted as a regular expression using RE2 syntax. The
* literal value must match the entire field.
* For example, to filter for instances that do not have a name of
* example-instance, you would use filter=name ne example-instance.
* Compute Engine Beta API Only: If you use filtering in the Beta API, you can
* also filter on nested fields. For example, you could filter on instances
* that have set the scheduling.automaticRestart field to true. In particular,
* use filtering on nested fields to take advantage of instance labels to
* organize and filter results based on label values.
* The Beta API also supports filtering on multiple expressions by providing
* each separate expression within parentheses. For example,
* (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple
* expressions are treated as AND expressions, meaning that resources must
* match all expressions to pass the filters.
*/
@property(copy, nullable) NSString *filter;
/**
* The maximum number of results per page that should be returned. If the
* number of available results is larger than maxResults, Compute Engine
* returns a nextPageToken that can be used to get the next page of results in
* subsequent list requests.
*
* @note If not set, the documented server-side default will be 500 (from the
* range 0..500).
*/
@property(assign) NSUInteger maxResults;
/**
* Sorts list results by a certain order. By default, results are returned in
* alphanumerical order based on the resource name.
* You can also sort results in descending order based on the creation
* timestamp using orderBy="creationTimestamp desc". This sorts results based
* on the creationTimestamp field in reverse chronological order (newest result
* first). Use this to sort resources like operations so that the newest
* operation is returned first.
* Currently, only sorting by name or creationTimestamp desc is supported.
*/
@property(copy, nullable) NSString *orderBy;
/**
* Specifies a page token to use. Set pageToken to the nextPageToken returned
* by a previous list request to get the next page of results.
*/
@property(copy, nullable) NSString *pageToken;
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/**
* Fetches a @c GTLRCloudUserAccounts_OperationList.
*
* Retrieves the list of operation resources contained within the specified
* project.
*
* @param project Project ID for this request.
*
* @returns GTLRCloudUserAccountsQuery_GlobalAccountsOperationsList
*
* @note Automatic pagination will be done when @c shouldFetchNextPages is
* enabled. See @c shouldFetchNextPages on @c GTLRService for more
* information.
*/
+ (instancetype)queryWithProject:(NSString *)project;
@end
/**
* Adds users to the specified group.
*
* Method: clouduseraccounts.groups.addMember
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
*/
@interface GTLRCloudUserAccountsQuery_GroupsAddMember : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForGroupsAddMemberWithObject:project:groupName:]
/** Name of the group for this request. */
@property(copy, nullable) NSString *groupName;
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/**
* Fetches a @c GTLRCloudUserAccounts_Operation.
*
* Adds users to the specified group.
*
* @param object The @c GTLRCloudUserAccounts_GroupsAddMemberRequest to include
* in the query.
* @param project Project ID for this request.
* @param groupName Name of the group for this request.
*
* @returns GTLRCloudUserAccountsQuery_GroupsAddMember
*/
+ (instancetype)queryWithObject:(GTLRCloudUserAccounts_GroupsAddMemberRequest *)object
project:(NSString *)project
groupName:(NSString *)groupName;
@end
/**
* Deletes the specified Group resource.
*
* Method: clouduseraccounts.groups.delete
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
*/
@interface GTLRCloudUserAccountsQuery_GroupsDelete : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForGroupsDeleteWithproject:groupName:]
/** Name of the Group resource to delete. */
@property(copy, nullable) NSString *groupName;
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/**
* Fetches a @c GTLRCloudUserAccounts_Operation.
*
* Deletes the specified Group resource.
*
* @param project Project ID for this request.
* @param groupName Name of the Group resource to delete.
*
* @returns GTLRCloudUserAccountsQuery_GroupsDelete
*/
+ (instancetype)queryWithProject:(NSString *)project
groupName:(NSString *)groupName;
@end
/**
* Returns the specified Group resource.
*
* Method: clouduseraccounts.groups.get
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatformReadOnly
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccountsReadonly
*/
@interface GTLRCloudUserAccountsQuery_GroupsGet : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForGroupsGetWithproject:groupName:]
/** Name of the Group resource to return. */
@property(copy, nullable) NSString *groupName;
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/**
* Fetches a @c GTLRCloudUserAccounts_Group.
*
* Returns the specified Group resource.
*
* @param project Project ID for this request.
* @param groupName Name of the Group resource to return.
*
* @returns GTLRCloudUserAccountsQuery_GroupsGet
*/
+ (instancetype)queryWithProject:(NSString *)project
groupName:(NSString *)groupName;
@end
/**
* Gets the access control policy for a resource. May be empty if no such
* policy or resource exists.
*
* Method: clouduseraccounts.groups.getIamPolicy
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatformReadOnly
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccountsReadonly
*/
@interface GTLRCloudUserAccountsQuery_GroupsGetIamPolicy : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForGroupsGetIamPolicyWithproject:resource:]
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/** Name of the resource for this request. */
@property(copy, nullable) NSString *resource;
/**
* Fetches a @c GTLRCloudUserAccounts_Policy.
*
* Gets the access control policy for a resource. May be empty if no such
* policy or resource exists.
*
* @param project Project ID for this request.
* @param resource Name of the resource for this request.
*
* @returns GTLRCloudUserAccountsQuery_GroupsGetIamPolicy
*/
+ (instancetype)queryWithProject:(NSString *)project
resource:(NSString *)resource;
@end
/**
* Creates a Group resource in the specified project using the data included in
* the request.
*
* Method: clouduseraccounts.groups.insert
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
*/
@interface GTLRCloudUserAccountsQuery_GroupsInsert : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForGroupsInsertWithObject:project:]
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/**
* Fetches a @c GTLRCloudUserAccounts_Operation.
*
* Creates a Group resource in the specified project using the data included in
* the request.
*
* @param object The @c GTLRCloudUserAccounts_Group to include in the query.
* @param project Project ID for this request.
*
* @returns GTLRCloudUserAccountsQuery_GroupsInsert
*/
+ (instancetype)queryWithObject:(GTLRCloudUserAccounts_Group *)object
project:(NSString *)project;
@end
/**
* Retrieves the list of groups contained within the specified project.
*
* Method: clouduseraccounts.groups.list
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatformReadOnly
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccountsReadonly
*/
@interface GTLRCloudUserAccountsQuery_GroupsList : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForGroupsListWithproject:]
/**
* Sets a filter expression for filtering listed resources, in the form
* filter={expression}. Your {expression} must be in the format: field_name
* comparison_string literal_string.
* The field_name is the name of the field you want to compare. Only atomic
* field types are supported (string, number, boolean). The comparison_string
* must be either eq (equals) or ne (not equals). The literal_string is the
* string value to filter to. The literal value must be valid for the type of
* field you are filtering by (string, number, boolean). For string fields, the
* literal value is interpreted as a regular expression using RE2 syntax. The
* literal value must match the entire field.
* For example, to filter for instances that do not have a name of
* example-instance, you would use filter=name ne example-instance.
* Compute Engine Beta API Only: If you use filtering in the Beta API, you can
* also filter on nested fields. For example, you could filter on instances
* that have set the scheduling.automaticRestart field to true. In particular,
* use filtering on nested fields to take advantage of instance labels to
* organize and filter results based on label values.
* The Beta API also supports filtering on multiple expressions by providing
* each separate expression within parentheses. For example,
* (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple
* expressions are treated as AND expressions, meaning that resources must
* match all expressions to pass the filters.
*/
@property(copy, nullable) NSString *filter;
/**
* The maximum number of results per page that should be returned. If the
* number of available results is larger than maxResults, Compute Engine
* returns a nextPageToken that can be used to get the next page of results in
* subsequent list requests.
*
* @note If not set, the documented server-side default will be 500 (from the
* range 0..500).
*/
@property(assign) NSUInteger maxResults;
/**
* Sorts list results by a certain order. By default, results are returned in
* alphanumerical order based on the resource name.
* You can also sort results in descending order based on the creation
* timestamp using orderBy="creationTimestamp desc". This sorts results based
* on the creationTimestamp field in reverse chronological order (newest result
* first). Use this to sort resources like operations so that the newest
* operation is returned first.
* Currently, only sorting by name or creationTimestamp desc is supported.
*/
@property(copy, nullable) NSString *orderBy;
/**
* Specifies a page token to use. Set pageToken to the nextPageToken returned
* by a previous list request to get the next page of results.
*/
@property(copy, nullable) NSString *pageToken;
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/**
* Fetches a @c GTLRCloudUserAccounts_GroupList.
*
* Retrieves the list of groups contained within the specified project.
*
* @param project Project ID for this request.
*
* @returns GTLRCloudUserAccountsQuery_GroupsList
*
* @note Automatic pagination will be done when @c shouldFetchNextPages is
* enabled. See @c shouldFetchNextPages on @c GTLRService for more
* information.
*/
+ (instancetype)queryWithProject:(NSString *)project;
@end
/**
* Removes users from the specified group.
*
* Method: clouduseraccounts.groups.removeMember
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
*/
@interface GTLRCloudUserAccountsQuery_GroupsRemoveMember : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForGroupsRemoveMemberWithObject:project:groupName:]
/** Name of the group for this request. */
@property(copy, nullable) NSString *groupName;
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/**
* Fetches a @c GTLRCloudUserAccounts_Operation.
*
* Removes users from the specified group.
*
* @param object The @c GTLRCloudUserAccounts_GroupsRemoveMemberRequest to
* include in the query.
* @param project Project ID for this request.
* @param groupName Name of the group for this request.
*
* @returns GTLRCloudUserAccountsQuery_GroupsRemoveMember
*/
+ (instancetype)queryWithObject:(GTLRCloudUserAccounts_GroupsRemoveMemberRequest *)object
project:(NSString *)project
groupName:(NSString *)groupName;
@end
/**
* Sets the access control policy on the specified resource. Replaces any
* existing policy.
*
* Method: clouduseraccounts.groups.setIamPolicy
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatformReadOnly
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccountsReadonly
*/
@interface GTLRCloudUserAccountsQuery_GroupsSetIamPolicy : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForGroupsSetIamPolicyWithObject:project:resource:]
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/** Name of the resource for this request. */
@property(copy, nullable) NSString *resource;
/**
* Fetches a @c GTLRCloudUserAccounts_Policy.
*
* Sets the access control policy on the specified resource. Replaces any
* existing policy.
*
* @param object The @c GTLRCloudUserAccounts_Policy to include in the query.
* @param project Project ID for this request.
* @param resource Name of the resource for this request.
*
* @returns GTLRCloudUserAccountsQuery_GroupsSetIamPolicy
*/
+ (instancetype)queryWithObject:(GTLRCloudUserAccounts_Policy *)object
project:(NSString *)project
resource:(NSString *)resource;
@end
/**
* Returns permissions that a caller has on the specified resource.
*
* Method: clouduseraccounts.groups.testIamPermissions
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatformReadOnly
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccountsReadonly
*/
@interface GTLRCloudUserAccountsQuery_GroupsTestIamPermissions : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForGroupsTestIamPermissionsWithObject:project:resource:]
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/** Name of the resource for this request. */
@property(copy, nullable) NSString *resource;
/**
* Fetches a @c GTLRCloudUserAccounts_TestPermissionsResponse.
*
* Returns permissions that a caller has on the specified resource.
*
* @param object The @c GTLRCloudUserAccounts_TestPermissionsRequest to include
* in the query.
* @param project Project ID for this request.
* @param resource Name of the resource for this request.
*
* @returns GTLRCloudUserAccountsQuery_GroupsTestIamPermissions
*/
+ (instancetype)queryWithObject:(GTLRCloudUserAccounts_TestPermissionsRequest *)object
project:(NSString *)project
resource:(NSString *)resource;
@end
/**
* Returns a list of authorized public keys for a specific user account.
*
* Method: clouduseraccounts.linux.getAuthorizedKeysView
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatformReadOnly
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccountsReadonly
*/
@interface GTLRCloudUserAccountsQuery_LinuxGetAuthorizedKeysView : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForLinuxGetAuthorizedKeysViewWithproject:zoneProperty:user:instance:]
/** The fully-qualified URL of the virtual machine requesting the view. */
@property(copy, nullable) NSString *instance;
/** Whether the view was requested as part of a user-initiated login. */
@property(assign) BOOL login;
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/**
* The user account for which you want to get a list of authorized public keys.
*/
@property(copy, nullable) NSString *user;
/**
* Name of the zone for this request.
*
* Remapped to 'zoneProperty' to avoid NSObject's 'zone'.
*/
@property(copy, nullable) NSString *zoneProperty;
/**
* Fetches a @c GTLRCloudUserAccounts_LinuxGetAuthorizedKeysViewResponse.
*
* Returns a list of authorized public keys for a specific user account.
*
* @param project Project ID for this request.
* @param zoneProperty Name of the zone for this request.
* @param user The user account for which you want to get a list of authorized
* public keys.
* @param instance The fully-qualified URL of the virtual machine requesting
* the view.
*
* @returns GTLRCloudUserAccountsQuery_LinuxGetAuthorizedKeysView
*/
+ (instancetype)queryWithProject:(NSString *)project
zoneProperty:(NSString *)zoneProperty
user:(NSString *)user
instance:(NSString *)instance;
@end
/**
* Retrieves a list of user accounts for an instance within a specific project.
*
* Method: clouduseraccounts.linux.getLinuxAccountViews
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatformReadOnly
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccountsReadonly
*/
@interface GTLRCloudUserAccountsQuery_LinuxGetLinuxAccountViews : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForLinuxGetLinuxAccountViewsWithproject:zoneProperty:instance:]
/**
* Sets a filter expression for filtering listed resources, in the form
* filter={expression}. Your {expression} must be in the format: field_name
* comparison_string literal_string.
* The field_name is the name of the field you want to compare. Only atomic
* field types are supported (string, number, boolean). The comparison_string
* must be either eq (equals) or ne (not equals). The literal_string is the
* string value to filter to. The literal value must be valid for the type of
* field you are filtering by (string, number, boolean). For string fields, the
* literal value is interpreted as a regular expression using RE2 syntax. The
* literal value must match the entire field.
* For example, to filter for instances that do not have a name of
* example-instance, you would use filter=name ne example-instance.
* Compute Engine Beta API Only: If you use filtering in the Beta API, you can
* also filter on nested fields. For example, you could filter on instances
* that have set the scheduling.automaticRestart field to true. In particular,
* use filtering on nested fields to take advantage of instance labels to
* organize and filter results based on label values.
* The Beta API also supports filtering on multiple expressions by providing
* each separate expression within parentheses. For example,
* (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple
* expressions are treated as AND expressions, meaning that resources must
* match all expressions to pass the filters.
*/
@property(copy, nullable) NSString *filter;
/** The fully-qualified URL of the virtual machine requesting the views. */
@property(copy, nullable) NSString *instance;
/**
* The maximum number of results per page that should be returned. If the
* number of available results is larger than maxResults, Compute Engine
* returns a nextPageToken that can be used to get the next page of results in
* subsequent list requests.
*
* @note If not set, the documented server-side default will be 500 (from the
* range 0..500).
*/
@property(assign) NSUInteger maxResults;
/**
* Sorts list results by a certain order. By default, results are returned in
* alphanumerical order based on the resource name.
* You can also sort results in descending order based on the creation
* timestamp using orderBy="creationTimestamp desc". This sorts results based
* on the creationTimestamp field in reverse chronological order (newest result
* first). Use this to sort resources like operations so that the newest
* operation is returned first.
* Currently, only sorting by name or creationTimestamp desc is supported.
*/
@property(copy, nullable) NSString *orderBy;
/**
* Specifies a page token to use. Set pageToken to the nextPageToken returned
* by a previous list request to get the next page of results.
*/
@property(copy, nullable) NSString *pageToken;
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/**
* Name of the zone for this request.
*
* Remapped to 'zoneProperty' to avoid NSObject's 'zone'.
*/
@property(copy, nullable) NSString *zoneProperty;
/**
* Fetches a @c GTLRCloudUserAccounts_LinuxGetLinuxAccountViewsResponse.
*
* Retrieves a list of user accounts for an instance within a specific project.
*
* @param project Project ID for this request.
* @param zoneProperty Name of the zone for this request.
* @param instance The fully-qualified URL of the virtual machine requesting
* the views.
*
* @returns GTLRCloudUserAccountsQuery_LinuxGetLinuxAccountViews
*/
+ (instancetype)queryWithProject:(NSString *)project
zoneProperty:(NSString *)zoneProperty
instance:(NSString *)instance;
@end
/**
* Adds a public key to the specified User resource with the data included in
* the request.
*
* Method: clouduseraccounts.users.addPublicKey
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
*/
@interface GTLRCloudUserAccountsQuery_UsersAddPublicKey : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForUsersAddPublicKeyWithObject:project:user:]
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/** Name of the user for this request. */
@property(copy, nullable) NSString *user;
/**
* Fetches a @c GTLRCloudUserAccounts_Operation.
*
* Adds a public key to the specified User resource with the data included in
* the request.
*
* @param object The @c GTLRCloudUserAccounts_PublicKey to include in the
* query.
* @param project Project ID for this request.
* @param user Name of the user for this request.
*
* @returns GTLRCloudUserAccountsQuery_UsersAddPublicKey
*/
+ (instancetype)queryWithObject:(GTLRCloudUserAccounts_PublicKey *)object
project:(NSString *)project
user:(NSString *)user;
@end
/**
* Deletes the specified User resource.
*
* Method: clouduseraccounts.users.delete
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
*/
@interface GTLRCloudUserAccountsQuery_UsersDelete : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForUsersDeleteWithproject:user:]
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/** Name of the user resource to delete. */
@property(copy, nullable) NSString *user;
/**
* Fetches a @c GTLRCloudUserAccounts_Operation.
*
* Deletes the specified User resource.
*
* @param project Project ID for this request.
* @param user Name of the user resource to delete.
*
* @returns GTLRCloudUserAccountsQuery_UsersDelete
*/
+ (instancetype)queryWithProject:(NSString *)project
user:(NSString *)user;
@end
/**
* Returns the specified User resource.
*
* Method: clouduseraccounts.users.get
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatformReadOnly
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccountsReadonly
*/
@interface GTLRCloudUserAccountsQuery_UsersGet : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForUsersGetWithproject:user:]
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/** Name of the user resource to return. */
@property(copy, nullable) NSString *user;
/**
* Fetches a @c GTLRCloudUserAccounts_User.
*
* Returns the specified User resource.
*
* @param project Project ID for this request.
* @param user Name of the user resource to return.
*
* @returns GTLRCloudUserAccountsQuery_UsersGet
*/
+ (instancetype)queryWithProject:(NSString *)project
user:(NSString *)user;
@end
/**
* Gets the access control policy for a resource. May be empty if no such
* policy or resource exists.
*
* Method: clouduseraccounts.users.getIamPolicy
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatformReadOnly
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccountsReadonly
*/
@interface GTLRCloudUserAccountsQuery_UsersGetIamPolicy : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForUsersGetIamPolicyWithproject:resource:]
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/** Name of the resource for this request. */
@property(copy, nullable) NSString *resource;
/**
* Fetches a @c GTLRCloudUserAccounts_Policy.
*
* Gets the access control policy for a resource. May be empty if no such
* policy or resource exists.
*
* @param project Project ID for this request.
* @param resource Name of the resource for this request.
*
* @returns GTLRCloudUserAccountsQuery_UsersGetIamPolicy
*/
+ (instancetype)queryWithProject:(NSString *)project
resource:(NSString *)resource;
@end
/**
* Creates a User resource in the specified project using the data included in
* the request.
*
* Method: clouduseraccounts.users.insert
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
*/
@interface GTLRCloudUserAccountsQuery_UsersInsert : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForUsersInsertWithObject:project:]
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/**
* Fetches a @c GTLRCloudUserAccounts_Operation.
*
* Creates a User resource in the specified project using the data included in
* the request.
*
* @param object The @c GTLRCloudUserAccounts_User to include in the query.
* @param project Project ID for this request.
*
* @returns GTLRCloudUserAccountsQuery_UsersInsert
*/
+ (instancetype)queryWithObject:(GTLRCloudUserAccounts_User *)object
project:(NSString *)project;
@end
/**
* Retrieves a list of users contained within the specified project.
*
* Method: clouduseraccounts.users.list
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatformReadOnly
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccountsReadonly
*/
@interface GTLRCloudUserAccountsQuery_UsersList : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForUsersListWithproject:]
/**
* Sets a filter expression for filtering listed resources, in the form
* filter={expression}. Your {expression} must be in the format: field_name
* comparison_string literal_string.
* The field_name is the name of the field you want to compare. Only atomic
* field types are supported (string, number, boolean). The comparison_string
* must be either eq (equals) or ne (not equals). The literal_string is the
* string value to filter to. The literal value must be valid for the type of
* field you are filtering by (string, number, boolean). For string fields, the
* literal value is interpreted as a regular expression using RE2 syntax. The
* literal value must match the entire field.
* For example, to filter for instances that do not have a name of
* example-instance, you would use filter=name ne example-instance.
* Compute Engine Beta API Only: If you use filtering in the Beta API, you can
* also filter on nested fields. For example, you could filter on instances
* that have set the scheduling.automaticRestart field to true. In particular,
* use filtering on nested fields to take advantage of instance labels to
* organize and filter results based on label values.
* The Beta API also supports filtering on multiple expressions by providing
* each separate expression within parentheses. For example,
* (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple
* expressions are treated as AND expressions, meaning that resources must
* match all expressions to pass the filters.
*/
@property(copy, nullable) NSString *filter;
/**
* The maximum number of results per page that should be returned. If the
* number of available results is larger than maxResults, Compute Engine
* returns a nextPageToken that can be used to get the next page of results in
* subsequent list requests.
*
* @note If not set, the documented server-side default will be 500 (from the
* range 0..500).
*/
@property(assign) NSUInteger maxResults;
/**
* Sorts list results by a certain order. By default, results are returned in
* alphanumerical order based on the resource name.
* You can also sort results in descending order based on the creation
* timestamp using orderBy="creationTimestamp desc". This sorts results based
* on the creationTimestamp field in reverse chronological order (newest result
* first). Use this to sort resources like operations so that the newest
* operation is returned first.
* Currently, only sorting by name or creationTimestamp desc is supported.
*/
@property(copy, nullable) NSString *orderBy;
/**
* Specifies a page token to use. Set pageToken to the nextPageToken returned
* by a previous list request to get the next page of results.
*/
@property(copy, nullable) NSString *pageToken;
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/**
* Fetches a @c GTLRCloudUserAccounts_UserList.
*
* Retrieves a list of users contained within the specified project.
*
* @param project Project ID for this request.
*
* @returns GTLRCloudUserAccountsQuery_UsersList
*
* @note Automatic pagination will be done when @c shouldFetchNextPages is
* enabled. See @c shouldFetchNextPages on @c GTLRService for more
* information.
*/
+ (instancetype)queryWithProject:(NSString *)project;
@end
/**
* Removes the specified public key from the user.
*
* Method: clouduseraccounts.users.removePublicKey
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
*/
@interface GTLRCloudUserAccountsQuery_UsersRemovePublicKey : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForUsersRemovePublicKeyWithproject:user:fingerprint:]
/**
* The fingerprint of the public key to delete. Public keys are identified by
* their fingerprint, which is defined by RFC4716 to be the MD5 digest of the
* public key.
*/
@property(copy, nullable) NSString *fingerprint;
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/** Name of the user for this request. */
@property(copy, nullable) NSString *user;
/**
* Fetches a @c GTLRCloudUserAccounts_Operation.
*
* Removes the specified public key from the user.
*
* @param project Project ID for this request.
* @param user Name of the user for this request.
* @param fingerprint The fingerprint of the public key to delete. Public keys
* are identified by their fingerprint, which is defined by RFC4716 to be the
* MD5 digest of the public key.
*
* @returns GTLRCloudUserAccountsQuery_UsersRemovePublicKey
*/
+ (instancetype)queryWithProject:(NSString *)project
user:(NSString *)user
fingerprint:(NSString *)fingerprint;
@end
/**
* Sets the access control policy on the specified resource. Replaces any
* existing policy.
*
* Method: clouduseraccounts.users.setIamPolicy
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatformReadOnly
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccountsReadonly
*/
@interface GTLRCloudUserAccountsQuery_UsersSetIamPolicy : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForUsersSetIamPolicyWithObject:project:resource:]
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/** Name of the resource for this request. */
@property(copy, nullable) NSString *resource;
/**
* Fetches a @c GTLRCloudUserAccounts_Policy.
*
* Sets the access control policy on the specified resource. Replaces any
* existing policy.
*
* @param object The @c GTLRCloudUserAccounts_Policy to include in the query.
* @param project Project ID for this request.
* @param resource Name of the resource for this request.
*
* @returns GTLRCloudUserAccountsQuery_UsersSetIamPolicy
*/
+ (instancetype)queryWithObject:(GTLRCloudUserAccounts_Policy *)object
project:(NSString *)project
resource:(NSString *)resource;
@end
/**
* Returns permissions that a caller has on the specified resource.
*
* Method: clouduseraccounts.users.testIamPermissions
*
* Authorization scope(s):
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatform
* @c kGTLRAuthScopeCloudUserAccountsCloudPlatformReadOnly
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccounts
* @c kGTLRAuthScopeCloudUserAccountsCloudUseraccountsReadonly
*/
@interface GTLRCloudUserAccountsQuery_UsersTestIamPermissions : GTLRCloudUserAccountsQuery
// Previous library name was
// +[GTLQueryCloudUserAccounts queryForUsersTestIamPermissionsWithObject:project:resource:]
/** Project ID for this request. */
@property(copy, nullable) NSString *project;
/** Name of the resource for this request. */
@property(copy, nullable) NSString *resource;
/**
* Fetches a @c GTLRCloudUserAccounts_TestPermissionsResponse.
*
* Returns permissions that a caller has on the specified resource.
*
* @param object The @c GTLRCloudUserAccounts_TestPermissionsRequest to include
* in the query.
* @param project Project ID for this request.
* @param resource Name of the resource for this request.
*
* @returns GTLRCloudUserAccountsQuery_UsersTestIamPermissions
*/
+ (instancetype)queryWithObject:(GTLRCloudUserAccounts_TestPermissionsRequest *)object
project:(NSString *)project
resource:(NSString *)resource;
@end
NS_ASSUME_NONNULL_END
| {
"pile_set_name": "Github"
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace c08d04_DrawModes
{
partial class DrawModesNode
{
private const string vertexCode = @"#version 150 core
in vec3 inPosition;
in vec3 inColor;
uniform mat4 mvpMat;
out vec3 passColor;
void main(void) {
// transform vertex' position from model space to clip space.
gl_Position = mvpMat * vec4(inPosition, 1.0);
passColor = inColor;
gl_PointSize = 15;
}
";
private const string fragmentCode = @"#version 150
in vec3 passColor;
out vec4 outColor;
void main(void) {
outColor = vec4(passColor, 1.0);
}
";
private const string flatVertexCode = @"#version 150 core
in vec3 inPosition;
in vec3 inColor;
uniform mat4 mvpMat;
flat out vec3 passColor;
void main(void) {
// transform vertex' position from model space to clip space.
gl_Position = mvpMat * vec4(inPosition, 1.0);
passColor = inColor;
gl_PointSize = 15;
}
";
private const string flatFragmentCode = @"#version 150
flat in vec3 passColor;
out vec4 outColor;
void main(void) {
outColor = vec4(passColor, 1.0);
}
";
}
}
| {
"pile_set_name": "Github"
} |
# coding: utf-8
"""Utilities to manipulate JSON objects."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from datetime import datetime
import re
import warnings
from dateutil.parser import parse as _dateutil_parse
from dateutil.tz import tzlocal
from ipython_genutils import py3compat
from ipython_genutils.py3compat import string_types, iteritems
next_attr_name = '__next__' if py3compat.PY3 else 'next'
#-----------------------------------------------------------------------------
# Globals and constants
#-----------------------------------------------------------------------------
# timestamp formats
ISO8601 = "%Y-%m-%dT%H:%M:%S.%f"
ISO8601_PAT = re.compile(r"^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(\.\d{1,6})?(Z|([\+\-]\d{2}:?\d{2}))?$")
# holy crap, strptime is not threadsafe.
# Calling it once at import seems to help.
datetime.strptime("1", "%d")
#-----------------------------------------------------------------------------
# Classes and functions
#-----------------------------------------------------------------------------
def _ensure_tzinfo(dt):
"""Ensure a datetime object has tzinfo
If no tzinfo is present, add tzlocal
"""
if not dt.tzinfo:
# No more naïve datetime objects!
warnings.warn(u"Interpreting naive datetime as local %s. Please add timezone info to timestamps." % dt,
DeprecationWarning,
stacklevel=4)
dt = dt.replace(tzinfo=tzlocal())
return dt
def parse_date(s):
"""parse an ISO8601 date string
If it is None or not a valid ISO8601 timestamp,
it will be returned unmodified.
Otherwise, it will return a datetime object.
"""
if s is None:
return s
m = ISO8601_PAT.match(s)
if m:
dt = _dateutil_parse(s)
return _ensure_tzinfo(dt)
return s
def extract_dates(obj):
"""extract ISO8601 dates from unpacked JSON"""
if isinstance(obj, dict):
new_obj = {} # don't clobber
for k,v in iteritems(obj):
new_obj[k] = extract_dates(v)
obj = new_obj
elif isinstance(obj, (list, tuple)):
obj = [ extract_dates(o) for o in obj ]
elif isinstance(obj, string_types):
obj = parse_date(obj)
return obj
def squash_dates(obj):
"""squash datetime objects into ISO8601 strings"""
if isinstance(obj, dict):
obj = dict(obj) # don't clobber
for k,v in iteritems(obj):
obj[k] = squash_dates(v)
elif isinstance(obj, (list, tuple)):
obj = [ squash_dates(o) for o in obj ]
elif isinstance(obj, datetime):
obj = obj.isoformat()
return obj
def date_default(obj):
"""default function for packing datetime objects in JSON."""
if isinstance(obj, datetime):
obj = _ensure_tzinfo(obj)
return obj.isoformat().replace('+00:00', 'Z')
else:
raise TypeError("%r is not JSON serializable" % obj)
| {
"pile_set_name": "Github"
} |
# == Class cdh::hive::metastore
# Configures hive-metastore.
# See: http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH5/latest/CDH5-Installation-Guide/cdh5ig_hive_metastore_configure.html
#
# == Parameters
# $port - Port on which hive-metastore listens. Default: undef
#
class cdh::hive::metastore(
$port = undef,
)
{
Class['cdh::hive'] -> Class['cdh::hive::metastore']
package { 'hive-metastore':
ensure => 'installed',
}
# If the metastore will use MySQL for storage, then
# we need to make sure the Mysql/Mariadb JDBC .jar is
# in hive-metastore's classpath before it launches.
if $::cdh::hive::jdbc_protocol == 'mysql' {
include cdh::hive::metastore::mysql::jar
Class['cdh::hive::metastore::mysql::jar'] -> Service['hive-metastore']
}
service { 'hive-metastore':
ensure => 'running',
require => [
Package['hive-metastore'],
],
hasrestart => true,
hasstatus => true,
}
} | {
"pile_set_name": "Github"
} |
from __future__ import unicode_literals
from django_evolution.mutations import ChangeField
MUTATIONS = [
ChangeField('FileDiff', 'source_file', initial=None, max_length=1024),
ChangeField('FileDiff', 'dest_file', initial=None, max_length=1024)
]
| {
"pile_set_name": "Github"
} |
{
"images" : [
{
"filename" : "downTemplate.pdf",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
| {
"pile_set_name": "Github"
} |
// flow-typed signature: 2100b7bc43ae9aea674a9cd12db0d57c
// flow-typed version: <<STUB>>/eslint-plugin-jsx-a11y_v6.1.2/flow_v0.87.0
/**
* This is an autogenerated libdef stub for:
*
* 'eslint-plugin-jsx-a11y'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with the
* community by sending a pull request to:
* https://github.com/flowtype/flow-typed
*/
declare module 'eslint-plugin-jsx-a11y' {
declare module.exports: any;
}
/**
* We include stubs for each file inside this npm package in case you need to
* require those files directly. Feel free to delete any files that aren't
* needed.
*/
declare module 'eslint-plugin-jsx-a11y/__mocks__/genInteractives' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/IdentifierMock' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXAttributeMock' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXElementMock' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXExpressionContainerMock' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXSpreadAttributeMock' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXTextMock' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/LiteralMock' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/parserOptionsMapper' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/ruleOptionsMapperFactory' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/index-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/accessible-emoji-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/alt-text-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/anchor-has-content-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/anchor-is-valid-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-activedescendant-has-tabindex-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-props-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-proptypes-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-role-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-unsupported-elements-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/click-events-have-key-events-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/heading-has-content-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/html-has-lang-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/iframe-has-title-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/img-redundant-alt-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/interactive-supports-focus-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-associated-control-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-for-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/lang-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/media-has-caption-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/mouse-events-have-key-events-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-access-key-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-autofocus-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-distracting-elements-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-interactive-element-to-noninteractive-role-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-interactions-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-to-interactive-role-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-tabindex-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-onchange-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-redundant-roles-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-static-element-interactions-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/role-has-required-aria-props-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/role-supports-aria-props-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/scope-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/tabindex-no-positive-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/attributesComparator-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getComputedRole-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getExplicitRole-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getImplicitRole-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getSuggestion-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getTabIndex-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/hasAccessibleChild-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/input-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menu-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menuitem-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isAbstractRole-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isDisabledElement-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveElement-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveRole-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveElement-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveRole-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/mayContainChildComponent-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/mayHaveAccessibleLabel-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/parserOptionsMapper-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/schemas-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/index' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/accessible-emoji' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/alt-text' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/anchor-has-content' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/anchor-is-valid' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-activedescendant-has-tabindex' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-props' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-proptypes' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-role' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-unsupported-elements' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/click-events-have-key-events' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/heading-has-content' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/html-has-lang' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/iframe-has-title' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/img-redundant-alt' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/interactive-supports-focus' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/label-has-associated-control' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/label-has-for' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/lang' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/media-has-caption' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/mouse-events-have-key-events' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-access-key' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-autofocus' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-distracting-elements' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-interactive-element-to-noninteractive-role' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-interactions' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-to-interactive-role' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-tabindex' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-onchange' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-redundant-roles' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-static-element-interactions' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/role-has-required-aria-props' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/role-supports-aria-props' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/scope' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/tabindex-no-positive' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/attributesComparator' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getComputedRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getExplicitRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getImplicitRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getSuggestion' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getTabIndex' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/hasAccessibleChild' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/a' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/area' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/article' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/aside' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/body' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/button' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/datalist' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/details' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dialog' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dl' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/form' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h1' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h2' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h3' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h4' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h5' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h6' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/hr' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/img' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/index' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/input' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/li' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/link' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menu' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menuitem' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/meter' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/nav' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ol' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/option' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/output' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/progress' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/section' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/select' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tbody' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/textarea' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tfoot' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/thead' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ul' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isAbstractRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isDisabledElement' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveElement' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isPresentationRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/mayContainChildComponent' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/mayHaveAccessibleLabel' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/schemas' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/scripts/addRuleToIndex' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/doc' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/rule' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/scripts/create-rule' {
declare module.exports: any;
}
// Filename aliases
declare module 'eslint-plugin-jsx-a11y/__mocks__/genInteractives.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/genInteractives'>;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/IdentifierMock.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/IdentifierMock'>;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXAttributeMock.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXAttributeMock'>;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXElementMock.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXElementMock'>;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXExpressionContainerMock.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXExpressionContainerMock'>;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXSpreadAttributeMock.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXSpreadAttributeMock'>;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXTextMock.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXTextMock'>;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/LiteralMock.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/LiteralMock'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/parserOptionsMapper.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/__util__/parserOptionsMapper'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/ruleOptionsMapperFactory.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/__util__/ruleOptionsMapperFactory'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/index-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/index-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/accessible-emoji-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/accessible-emoji-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/alt-text-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/alt-text-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/anchor-has-content-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/anchor-has-content-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/anchor-is-valid-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/anchor-is-valid-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-activedescendant-has-tabindex-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-activedescendant-has-tabindex-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-props-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-props-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-proptypes-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-proptypes-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-role-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-role-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-unsupported-elements-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-unsupported-elements-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/click-events-have-key-events-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/click-events-have-key-events-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/heading-has-content-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/heading-has-content-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/html-has-lang-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/html-has-lang-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/iframe-has-title-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/iframe-has-title-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/img-redundant-alt-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/img-redundant-alt-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/interactive-supports-focus-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/interactive-supports-focus-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-associated-control-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-associated-control-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-for-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-for-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/lang-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/lang-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/media-has-caption-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/media-has-caption-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/mouse-events-have-key-events-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/mouse-events-have-key-events-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-access-key-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-access-key-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-autofocus-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-autofocus-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-distracting-elements-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-distracting-elements-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-interactive-element-to-noninteractive-role-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-interactive-element-to-noninteractive-role-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-interactions-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-interactions-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-to-interactive-role-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-to-interactive-role-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-tabindex-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-tabindex-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-onchange-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-onchange-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-redundant-roles-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-redundant-roles-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-static-element-interactions-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-static-element-interactions-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/role-has-required-aria-props-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/role-has-required-aria-props-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/role-supports-aria-props-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/role-supports-aria-props-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/scope-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/scope-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/tabindex-no-positive-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/tabindex-no-positive-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/attributesComparator-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/attributesComparator-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getComputedRole-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getComputedRole-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getExplicitRole-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getExplicitRole-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getImplicitRole-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getImplicitRole-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getSuggestion-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getSuggestion-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getTabIndex-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getTabIndex-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/hasAccessibleChild-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/hasAccessibleChild-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/input-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/input-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menu-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menu-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menuitem-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menuitem-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isAbstractRole-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isAbstractRole-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isDisabledElement-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isDisabledElement-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveElement-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveElement-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveRole-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveRole-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveElement-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveElement-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveRole-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveRole-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/mayContainChildComponent-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/mayContainChildComponent-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/mayHaveAccessibleLabel-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/mayHaveAccessibleLabel-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/parserOptionsMapper-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/parserOptionsMapper-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/schemas-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/schemas-test'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/index.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/index'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/accessible-emoji.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/accessible-emoji'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/alt-text.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/alt-text'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/anchor-has-content.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/anchor-has-content'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/anchor-is-valid.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/anchor-is-valid'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-activedescendant-has-tabindex.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/aria-activedescendant-has-tabindex'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-props.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/aria-props'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-proptypes.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/aria-proptypes'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-role.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/aria-role'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-unsupported-elements.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/aria-unsupported-elements'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/click-events-have-key-events.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/click-events-have-key-events'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/heading-has-content.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/heading-has-content'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/html-has-lang.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/html-has-lang'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/iframe-has-title.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/iframe-has-title'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/img-redundant-alt.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/img-redundant-alt'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/interactive-supports-focus.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/interactive-supports-focus'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/label-has-associated-control.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/label-has-associated-control'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/label-has-for.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/label-has-for'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/lang.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/lang'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/media-has-caption.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/media-has-caption'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/mouse-events-have-key-events.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/mouse-events-have-key-events'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-access-key.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-access-key'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-autofocus.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-autofocus'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-distracting-elements.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-distracting-elements'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-interactive-element-to-noninteractive-role.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-interactive-element-to-noninteractive-role'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-interactions.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-interactions'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-to-interactive-role.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-to-interactive-role'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-tabindex.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-tabindex'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-onchange.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-onchange'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-redundant-roles.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-redundant-roles'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-static-element-interactions.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-static-element-interactions'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/role-has-required-aria-props.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/role-has-required-aria-props'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/role-supports-aria-props.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/role-supports-aria-props'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/scope.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/scope'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/tabindex-no-positive.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/tabindex-no-positive'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/attributesComparator.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/attributesComparator'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getComputedRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getComputedRole'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getExplicitRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getExplicitRole'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getImplicitRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getImplicitRole'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getSuggestion.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getSuggestion'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getTabIndex.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getTabIndex'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/hasAccessibleChild.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/hasAccessibleChild'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/a.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/a'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/area.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/area'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/article.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/article'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/aside.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/aside'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/body.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/body'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/button.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/button'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/datalist.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/datalist'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/details.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/details'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dialog.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dialog'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dl.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dl'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/form.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/form'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h1.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h1'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h2.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h2'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h3.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h3'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h4.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h4'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h5.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h5'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h6.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h6'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/hr.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/hr'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/img.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/img'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/index.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/index'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/input.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/input'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/li.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/li'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/link.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/link'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menu.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menu'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menuitem.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menuitem'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/meter.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/meter'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/nav.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/nav'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ol.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ol'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/option.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/option'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/output.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/output'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/progress.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/progress'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/section.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/section'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/select.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/select'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tbody.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tbody'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/textarea.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/textarea'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tfoot.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tfoot'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/thead.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/thead'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ul.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ul'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isAbstractRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isAbstractRole'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isDisabledElement.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isDisabledElement'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveElement.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isInteractiveElement'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isInteractiveRole'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isPresentationRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isPresentationRole'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/mayContainChildComponent.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/mayContainChildComponent'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/mayHaveAccessibleLabel.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/mayHaveAccessibleLabel'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/schemas.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/schemas'>;
}
declare module 'eslint-plugin-jsx-a11y/scripts/addRuleToIndex.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/addRuleToIndex'>;
}
declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/doc.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/boilerplate/doc'>;
}
declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/rule.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/boilerplate/rule'>;
}
declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/boilerplate/test'>;
}
declare module 'eslint-plugin-jsx-a11y/scripts/create-rule.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/create-rule'>;
}
| {
"pile_set_name": "Github"
} |
/*
uvec2 v = <input>;
v.x += ((v.y<<4u)+0xA341316Cu)^(v.y+0x9E3779B9u)^((v.y>>5u)+0xC8013EA4u);
v.y += ((v.x<<4u)+0xAD90777Du)^(v.x+0x9E3779B9u)^((v.x>>5u)+0x7E95761Eu);
v.x += ((v.y<<4u)+0xA341316Cu)^(v.y+0x3C6EF372u)^((v.y>>5u)+0xC8013EA4u);
v.y += ((v.x<<4u)+0xAD90777Du)^(v.x+0x3C6EF372u)^((v.x>>5u)+0x7E95761Eu);
*/
let
plus = bool32_add;
bits = nat_to_bool32;
tea2 xy =
let v = float_to_bool32 xy;
in do
// two rounds of TEA hashing
v[X] := v[X] `plus` xor[
v[Y] `lshift` 4 `plus` bits 0xA341316C,
v[Y] `plus` bits 0x9E3779B9,
v[Y] `rshift` 5 `plus` bits 0xC8013EA4
];
v[Y] := v[Y] `plus` xor[
v[X] `lshift` 4 `plus` bits 0xAD90777D,
v[X] `plus` bits 0x9E3779B9,
v[X] `rshift` 5 `plus` bits 0x7E95761E
];
v[X] := v[X] `plus` xor[
v[Y] `lshift` 4 `plus` bits 0xA341316C,
v[Y] `plus` bits 0x3C6EF372,
v[Y] `rshift` 5 `plus` bits 0xC8013EA4
];
v[Y] := v[Y] `plus` xor[
v[X] `lshift` 4 `plus` bits 0xAD90777D,
v[X] `plus` bits 0x3C6EF372,
v[X] `rshift` 5 `plus` bits 0x7E95761E
];
// get rid of NaN and infinity
v := v `and` [bits 0x007FFFFF, // strip sign bit and exponent
bits 0x007FFFFF]
`or` [bits 0x3F800000, // set sign and exponent to 0
bits 0x3F800000]
`xor` (v `rshift` 12); // xor exponent and sign onto mantissa
// If v was normalized, then now 1 <= v < 2.
// If v was denormalized, then now 0 <= v < 1. This includes v==0.
in v >> bool32_to_float >> frac;
in
make_texture ([x,y,z,t]->let h=tea2[x,y];c=h[0]; in sRGB(c,c,c))
| {
"pile_set_name": "Github"
} |
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
} | {
"pile_set_name": "Github"
} |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 10
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &240909422
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 240909424}
- component: {fileID: 240909423}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &240909423
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 240909422}
m_Enabled: 1
serializedVersion: 8
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &240909424
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 240909422}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &1150609025
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1150609029}
- component: {fileID: 1150609028}
- component: {fileID: 1150609027}
- component: {fileID: 1150609026}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!64 &1150609026
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1150609025}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1150609027
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1150609025}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: ffa49803383b4a945b9aa73d1597d64a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1150609028
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1150609025}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1150609029
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1150609025}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2091204377
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 2091204381}
- component: {fileID: 2091204380}
- component: {fileID: 2091204379}
- component: {fileID: 2091204378}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &2091204378
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2091204377}
m_Enabled: 1
--- !u!124 &2091204379
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2091204377}
m_Enabled: 1
--- !u!20 &2091204380
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2091204377}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &2091204381
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2091204377}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
| {
"pile_set_name": "Github"
} |
package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.textreader.IText;
import com.earth2me.essentials.textreader.KeywordReplacer;
import com.earth2me.essentials.textreader.TextInput;
import com.earth2me.essentials.textreader.TextPager;
import org.bukkit.Server;
public class Commandrules extends EssentialsCommand
{
public Commandrules()
{
super("rules");
}
@Override
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
{
if (sender.isPlayer())
{
ess.getUser(sender.getPlayer()).setDisplayNick();
}
final IText input = new TextInput(sender, "rules", true, ess);
final IText output = new KeywordReplacer(input, sender, ess);
final TextPager pager = new TextPager(output);
pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, commandLabel, sender);
}
}
| {
"pile_set_name": "Github"
} |
# First generate the manifest for tests since it will not need the dependency on the CRT.
configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.exe.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/tests.exe.manifest @ONLY)
if(WITH_WINDOWS_BUNDLE_CRT)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
include(InstallRequiredSystemLibraries)
# Install the CRT to the blender.crt Sub folder.
install(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ./blender.crt COMPONENT Libraries)
# Generating the manifest is a relativly expensive operation since
# it is collecting an sha1 hash for every file required. so only do
# this work when the libs have either changed or the manifest does
# not exist yet.
string(SHA1 libshash "${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}")
set(manifest_trigger_file "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/crt_${libshash}")
if(NOT EXISTS ${manifest_trigger_file})
set(CRTLIBS "")
foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
get_filename_component(filename ${lib} NAME)
file(SHA1 "${lib}" sha1_file)
set(CRTLIBS "${CRTLIBS} <file name=\"${filename}\" hash=\"${sha1_file}\" hashalg=\"SHA1\" />\n")
endforeach()
configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.crt.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/blender.crt.manifest @ONLY)
file(TOUCH ${manifest_trigger_file})
endif()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/blender.crt.manifest DESTINATION ./blender.crt)
set(BUNDLECRT "<dependency><dependentAssembly><assemblyIdentity type=\"win32\" name=\"blender.crt\" version=\"1.0.0.0\" /></dependentAssembly></dependency>")
endif()
configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.exe.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/blender.exe.manifest @ONLY)
| {
"pile_set_name": "Github"
} |
@**
* Yobi, Project Hosting SW
*
* Copyright 2014 NAVER Corp.
* http://yobi.io
*
* @author Changsung Kim
*
* 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.
**@
@(id:String, voters:Collection[User])
<div id="@id" class="modal hide voters-dialog">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h5 class="nm">@Messages("issue.voters")</h5>
</div>
<div class="modal-body">
<ul class="unstyled">
@for(voter <- voters){
<li>
<a href="@routes.UserApp.userInfo(voter.loginId)" class="usf-group" target="_blank">
<span class="avatar-wrap mlarge">
<img src="@voter.avatarUrl" width="40" height="40">
</span>
<strong class="name">@voter.name</strong>
<span class="loginid"> <strong>@{"@"}</strong>@voter.loginId</span>
</a>
</li>
}
</ul>
</div>
<div class="modal-footer">
<button class="ybtn ybtn-info ybtn-small" data-dismiss="modal" aria-hidden="true">@Messages("button.close")</button>
</div>
</div>
| {
"pile_set_name": "Github"
} |
"""Tests for distutils.command.install_scripts."""
import os
import unittest
from distutils.command.install_scripts import install_scripts
from distutils.core import Distribution
from distutils.tests import support
from test.support import run_unittest
class InstallScriptsTestCase(support.TempdirManager,
support.LoggingSilencer,
unittest.TestCase):
def test_default_settings(self):
dist = Distribution()
dist.command_obj["build"] = support.DummyCommand(
build_scripts="/foo/bar")
dist.command_obj["install"] = support.DummyCommand(
install_scripts="/splat/funk",
force=1,
skip_build=1,
)
cmd = install_scripts(dist)
self.assertFalse(cmd.force)
self.assertFalse(cmd.skip_build)
self.assertIsNone(cmd.build_dir)
self.assertIsNone(cmd.install_dir)
cmd.finalize_options()
self.assertTrue(cmd.force)
self.assertTrue(cmd.skip_build)
self.assertEqual(cmd.build_dir, "/foo/bar")
self.assertEqual(cmd.install_dir, "/splat/funk")
def test_installation(self):
source = self.mkdtemp()
expected = []
def write_script(name, text):
expected.append(name)
f = open(os.path.join(source, name), "w")
try:
f.write(text)
finally:
f.close()
write_script("script1.py", ("#! /usr/bin/env python2.3\n"
"# bogus script w/ Python sh-bang\n"
"pass\n"))
write_script("script2.py", ("#!/usr/bin/python\n"
"# bogus script w/ Python sh-bang\n"
"pass\n"))
write_script("shell.sh", ("#!/bin/sh\n"
"# bogus shell script w/ sh-bang\n"
"exit 0\n"))
target = self.mkdtemp()
dist = Distribution()
dist.command_obj["build"] = support.DummyCommand(build_scripts=source)
dist.command_obj["install"] = support.DummyCommand(
install_scripts=target,
force=1,
skip_build=1,
)
cmd = install_scripts(dist)
cmd.finalize_options()
cmd.run()
installed = os.listdir(target)
for name in expected:
self.assertIn(name, installed)
def test_suite():
return unittest.makeSuite(InstallScriptsTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2014 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
* 82178 Puchheim
* Germany
* <[email protected]>
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <rtems/shellconfig.h>
#include "internal.h"
static void error(const char *s, int eno)
{
printf("%s: %s\n", s, strerror(eno));
}
static void print_cmd(const rtems_shell_cmd_t *shell_cmd)
{
if (rtems_shell_can_see_cmd(shell_cmd)) {
mode_t m = shell_cmd->mode;
printf(
"%c%c%c%c%c%c%c%c%c %5u %5u %s\n",
(m & S_IRUSR) != 0 ? 'r' : '-',
(m & S_IWUSR) != 0 ? 'w' : '-',
(m & S_IXUSR) != 0 ? 'x' : '-',
(m & S_IRGRP) != 0 ? 'r' : '-',
(m & S_IWGRP) != 0 ? 'w' : '-',
(m & S_IXGRP) != 0 ? 'x' : '-',
(m & S_IROTH) != 0 ? 'r' : '-',
(m & S_IWOTH) != 0 ? 'w' : '-',
(m & S_IXOTH) != 0 ? 'x' : '-',
(unsigned) shell_cmd->uid,
(unsigned) shell_cmd->gid,
shell_cmd->name
);
}
}
static int rtems_shell_main_cmdls(int argc, char **argv)
{
const rtems_shell_cmd_t *shell_cmd;
if (argc <= 1) {
shell_cmd = rtems_shell_first_cmd;
while (shell_cmd != NULL) {
print_cmd(shell_cmd);
shell_cmd = shell_cmd->next;
}
} else {
int i;
for (i = 1; i < argc; ++i) {
const char *cmd = argv[i];
shell_cmd = rtems_shell_lookup_cmd(cmd);
if (shell_cmd != NULL) {
print_cmd(shell_cmd);
} else {
error(cmd, ENOENT);
}
}
}
return 0;
}
rtems_shell_cmd_t rtems_shell_CMDLS_Command = {
.name = "cmdls",
.usage = "cmdls COMMAND...",
.topic = "misc",
.command = rtems_shell_main_cmdls
};
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2014 - 2020 Blazebit.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.blazebit.persistence.impl.function.datediff.millisecond;
/**
*
* @author Moritz Becker
* @since 1.2.0
*/
public class AccessMillisecondDiffFunction extends MillisecondDiffFunction {
public AccessMillisecondDiffFunction() {
super("DateDiff('s', ?1, ?2) * 1000");
}
} | {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.