text
stringlengths
2
100k
meta
dict
package archive // import "github.com/ory/dockertest/docker/pkg/archive" import ( "archive/tar" "errors" "io" "io/ioutil" "os" "path/filepath" "strings" "github.com/ory/dockertest/docker/pkg/system" "github.com/sirupsen/logrus" ) // Errors used or returned by this file. var ( ErrNotDirectory = errors.New("not a directory") ErrDirNotExists = errors.New("no such directory") ErrCannotCopyDir = errors.New("cannot copy directory") ErrInvalidCopySource = errors.New("invalid copy source content") ) // PreserveTrailingDotOrSeparator returns the given cleaned path (after // processing using any utility functions from the path or filepath stdlib // packages) and appends a trailing `/.` or `/` if its corresponding original // path (from before being processed by utility functions from the path or // filepath stdlib packages) ends with a trailing `/.` or `/`. If the cleaned // path already ends in a `.` path segment, then another is not added. If the // clean path already ends in the separator, then another is not added. func PreserveTrailingDotOrSeparator(cleanedPath string, originalPath string, sep byte) string { // Ensure paths are in platform semantics cleanedPath = strings.Replace(cleanedPath, "/", string(sep), -1) originalPath = strings.Replace(originalPath, "/", string(sep), -1) if !specifiesCurrentDir(cleanedPath) && specifiesCurrentDir(originalPath) { if !hasTrailingPathSeparator(cleanedPath, sep) { // Add a separator if it doesn't already end with one (a cleaned // path would only end in a separator if it is the root). cleanedPath += string(sep) } cleanedPath += "." } if !hasTrailingPathSeparator(cleanedPath, sep) && hasTrailingPathSeparator(originalPath, sep) { cleanedPath += string(sep) } return cleanedPath } // assertsDirectory returns whether the given path is // asserted to be a directory, i.e., the path ends with // a trailing '/' or `/.`, assuming a path separator of `/`. func assertsDirectory(path string, sep byte) bool { return hasTrailingPathSeparator(path, sep) || specifiesCurrentDir(path) } // hasTrailingPathSeparator returns whether the given // path ends with the system's path separator character. func hasTrailingPathSeparator(path string, sep byte) bool { return len(path) > 0 && path[len(path)-1] == sep } // specifiesCurrentDir returns whether the given path specifies // a "current directory", i.e., the last path segment is `.`. func specifiesCurrentDir(path string) bool { return filepath.Base(path) == "." } // SplitPathDirEntry splits the given path between its directory name and its // basename by first cleaning the path but preserves a trailing "." if the // original path specified the current directory. func SplitPathDirEntry(path string) (dir, base string) { cleanedPath := filepath.Clean(filepath.FromSlash(path)) if specifiesCurrentDir(path) { cleanedPath += string(os.PathSeparator) + "." } return filepath.Dir(cleanedPath), filepath.Base(cleanedPath) } // TarResource archives the resource described by the given CopyInfo to a Tar // archive. A non-nil error is returned if sourcePath does not exist or is // asserted to be a directory but exists as another type of file. // // This function acts as a convenient wrapper around TarWithOptions, which // requires a directory as the source path. TarResource accepts either a // directory or a file path and correctly sets the Tar options. func TarResource(sourceInfo CopyInfo) (content io.ReadCloser, err error) { return TarResourceRebase(sourceInfo.Path, sourceInfo.RebaseName) } // TarResourceRebase is like TarResource but renames the first path element of // items in the resulting tar archive to match the given rebaseName if not "". func TarResourceRebase(sourcePath, rebaseName string) (content io.ReadCloser, err error) { sourcePath = normalizePath(sourcePath) if _, err = os.Lstat(sourcePath); err != nil { // Catches the case where the source does not exist or is not a // directory if asserted to be a directory, as this also causes an // error. return } // Separate the source path between its directory and // the entry in that directory which we are archiving. sourceDir, sourceBase := SplitPathDirEntry(sourcePath) opts := TarResourceRebaseOpts(sourceBase, rebaseName) logrus.Debugf("copying %q from %q", sourceBase, sourceDir) return TarWithOptions(sourceDir, opts) } // TarResourceRebaseOpts does not preform the Tar, but instead just creates the rebase // parameters to be sent to TarWithOptions (the TarOptions struct) func TarResourceRebaseOpts(sourceBase string, rebaseName string) *TarOptions { filter := []string{sourceBase} return &TarOptions{ Compression: Uncompressed, IncludeFiles: filter, IncludeSourceDir: true, RebaseNames: map[string]string{ sourceBase: rebaseName, }, } } // CopyInfo holds basic info about the source // or destination path of a copy operation. type CopyInfo struct { Path string Exists bool IsDir bool RebaseName string } // CopyInfoSourcePath stats the given path to create a CopyInfo // struct representing that resource for the source of an archive copy // operation. The given path should be an absolute local path. A source path // has all symlinks evaluated that appear before the last path separator ("/" // on Unix). As it is to be a copy source, the path must exist. func CopyInfoSourcePath(path string, followLink bool) (CopyInfo, error) { // normalize the file path and then evaluate the symbol link // we will use the target file instead of the symbol link if // followLink is set path = normalizePath(path) resolvedPath, rebaseName, err := ResolveHostSourcePath(path, followLink) if err != nil { return CopyInfo{}, err } stat, err := os.Lstat(resolvedPath) if err != nil { return CopyInfo{}, err } return CopyInfo{ Path: resolvedPath, Exists: true, IsDir: stat.IsDir(), RebaseName: rebaseName, }, nil } // CopyInfoDestinationPath stats the given path to create a CopyInfo // struct representing that resource for the destination of an archive copy // operation. The given path should be an absolute local path. func CopyInfoDestinationPath(path string) (info CopyInfo, err error) { maxSymlinkIter := 10 // filepath.EvalSymlinks uses 255, but 10 already seems like a lot. path = normalizePath(path) originalPath := path stat, err := os.Lstat(path) if err == nil && stat.Mode()&os.ModeSymlink == 0 { // The path exists and is not a symlink. return CopyInfo{ Path: path, Exists: true, IsDir: stat.IsDir(), }, nil } // While the path is a symlink. for n := 0; err == nil && stat.Mode()&os.ModeSymlink != 0; n++ { if n > maxSymlinkIter { // Don't follow symlinks more than this arbitrary number of times. return CopyInfo{}, errors.New("too many symlinks in " + originalPath) } // The path is a symbolic link. We need to evaluate it so that the // destination of the copy operation is the link target and not the // link itself. This is notably different than CopyInfoSourcePath which // only evaluates symlinks before the last appearing path separator. // Also note that it is okay if the last path element is a broken // symlink as the copy operation should create the target. var linkTarget string linkTarget, err = os.Readlink(path) if err != nil { return CopyInfo{}, err } if !system.IsAbs(linkTarget) { // Join with the parent directory. dstParent, _ := SplitPathDirEntry(path) linkTarget = filepath.Join(dstParent, linkTarget) } path = linkTarget stat, err = os.Lstat(path) } if err != nil { // It's okay if the destination path doesn't exist. We can still // continue the copy operation if the parent directory exists. if !os.IsNotExist(err) { return CopyInfo{}, err } // Ensure destination parent dir exists. dstParent, _ := SplitPathDirEntry(path) parentDirStat, err := os.Stat(dstParent) if err != nil { return CopyInfo{}, err } if !parentDirStat.IsDir() { return CopyInfo{}, ErrNotDirectory } return CopyInfo{Path: path}, nil } // The path exists after resolving symlinks. return CopyInfo{ Path: path, Exists: true, IsDir: stat.IsDir(), }, nil } // PrepareArchiveCopy prepares the given srcContent archive, which should // contain the archived resource described by srcInfo, to the destination // described by dstInfo. Returns the possibly modified content archive along // with the path to the destination directory which it should be extracted to. func PrepareArchiveCopy(srcContent io.Reader, srcInfo, dstInfo CopyInfo) (dstDir string, content io.ReadCloser, err error) { // Ensure in platform semantics srcInfo.Path = normalizePath(srcInfo.Path) dstInfo.Path = normalizePath(dstInfo.Path) // Separate the destination path between its directory and base // components in case the source archive contents need to be rebased. dstDir, dstBase := SplitPathDirEntry(dstInfo.Path) _, srcBase := SplitPathDirEntry(srcInfo.Path) switch { case dstInfo.Exists && dstInfo.IsDir: // The destination exists as a directory. No alteration // to srcContent is needed as its contents can be // simply extracted to the destination directory. return dstInfo.Path, ioutil.NopCloser(srcContent), nil case dstInfo.Exists && srcInfo.IsDir: // The destination exists as some type of file and the source // content is a directory. This is an error condition since // you cannot copy a directory to an existing file location. return "", nil, ErrCannotCopyDir case dstInfo.Exists: // The destination exists as some type of file and the source content // is also a file. The source content entry will have to be renamed to // have a basename which matches the destination path's basename. if len(srcInfo.RebaseName) != 0 { srcBase = srcInfo.RebaseName } return dstDir, RebaseArchiveEntries(srcContent, srcBase, dstBase), nil case srcInfo.IsDir: // The destination does not exist and the source content is an archive // of a directory. The archive should be extracted to the parent of // the destination path instead, and when it is, the directory that is // created as a result should take the name of the destination path. // The source content entries will have to be renamed to have a // basename which matches the destination path's basename. if len(srcInfo.RebaseName) != 0 { srcBase = srcInfo.RebaseName } return dstDir, RebaseArchiveEntries(srcContent, srcBase, dstBase), nil case assertsDirectory(dstInfo.Path, os.PathSeparator): // The destination does not exist and is asserted to be created as a // directory, but the source content is not a directory. This is an // error condition since you cannot create a directory from a file // source. return "", nil, ErrDirNotExists default: // The last remaining case is when the destination does not exist, is // not asserted to be a directory, and the source content is not an // archive of a directory. It this case, the destination file will need // to be created when the archive is extracted and the source content // entry will have to be renamed to have a basename which matches the // destination path's basename. if len(srcInfo.RebaseName) != 0 { srcBase = srcInfo.RebaseName } return dstDir, RebaseArchiveEntries(srcContent, srcBase, dstBase), nil } } // RebaseArchiveEntries rewrites the given srcContent archive replacing // an occurrence of oldBase with newBase at the beginning of entry names. func RebaseArchiveEntries(srcContent io.Reader, oldBase, newBase string) io.ReadCloser { if oldBase == string(os.PathSeparator) { // If oldBase specifies the root directory, use an empty string as // oldBase instead so that newBase doesn't replace the path separator // that all paths will start with. oldBase = "" } rebased, w := io.Pipe() go func() { srcTar := tar.NewReader(srcContent) rebasedTar := tar.NewWriter(w) for { hdr, err := srcTar.Next() if err == io.EOF { // Signals end of archive. rebasedTar.Close() w.Close() return } if err != nil { w.CloseWithError(err) return } hdr.Name = strings.Replace(hdr.Name, oldBase, newBase, 1) if hdr.Typeflag == tar.TypeLink { hdr.Linkname = strings.Replace(hdr.Linkname, oldBase, newBase, 1) } if err = rebasedTar.WriteHeader(hdr); err != nil { w.CloseWithError(err) return } if _, err = io.Copy(rebasedTar, srcTar); err != nil { w.CloseWithError(err) return } } }() return rebased } // TODO @gupta-ak. These might have to be changed in the future to be // continuity driver aware as well to support LCOW. // CopyResource performs an archive copy from the given source path to the // given destination path. The source path MUST exist and the destination // path's parent directory must exist. func CopyResource(srcPath, dstPath string, followLink bool) error { var ( srcInfo CopyInfo err error ) // Ensure in platform semantics srcPath = normalizePath(srcPath) dstPath = normalizePath(dstPath) // Clean the source and destination paths. srcPath = PreserveTrailingDotOrSeparator(filepath.Clean(srcPath), srcPath, os.PathSeparator) dstPath = PreserveTrailingDotOrSeparator(filepath.Clean(dstPath), dstPath, os.PathSeparator) if srcInfo, err = CopyInfoSourcePath(srcPath, followLink); err != nil { return err } content, err := TarResource(srcInfo) if err != nil { return err } defer content.Close() return CopyTo(content, srcInfo, dstPath) } // CopyTo handles extracting the given content whose // entries should be sourced from srcInfo to dstPath. func CopyTo(content io.Reader, srcInfo CopyInfo, dstPath string) error { // The destination path need not exist, but CopyInfoDestinationPath will // ensure that at least the parent directory exists. dstInfo, err := CopyInfoDestinationPath(normalizePath(dstPath)) if err != nil { return err } dstDir, copyArchive, err := PrepareArchiveCopy(content, srcInfo, dstInfo) if err != nil { return err } defer copyArchive.Close() options := &TarOptions{ NoLchown: true, NoOverwriteDirNonDir: true, } return Untar(copyArchive, dstDir, options) } // ResolveHostSourcePath decides real path need to be copied with parameters such as // whether to follow symbol link or not, if followLink is true, resolvedPath will return // link target of any symbol link file, else it will only resolve symlink of directory // but return symbol link file itself without resolving. func ResolveHostSourcePath(path string, followLink bool) (resolvedPath, rebaseName string, err error) { if followLink { resolvedPath, err = filepath.EvalSymlinks(path) if err != nil { return } resolvedPath, rebaseName = GetRebaseName(path, resolvedPath) } else { dirPath, basePath := filepath.Split(path) // if not follow symbol link, then resolve symbol link of parent dir var resolvedDirPath string resolvedDirPath, err = filepath.EvalSymlinks(dirPath) if err != nil { return } // resolvedDirPath will have been cleaned (no trailing path separators) so // we can manually join it with the base path element. resolvedPath = resolvedDirPath + string(filepath.Separator) + basePath if hasTrailingPathSeparator(path, os.PathSeparator) && filepath.Base(path) != filepath.Base(resolvedPath) { rebaseName = filepath.Base(path) } } return resolvedPath, rebaseName, nil } // GetRebaseName normalizes and compares path and resolvedPath, // return completed resolved path and rebased file name func GetRebaseName(path, resolvedPath string) (string, string) { // linkTarget will have been cleaned (no trailing path separators and dot) so // we can manually join it with them var rebaseName string if specifiesCurrentDir(path) && !specifiesCurrentDir(resolvedPath) { resolvedPath += string(filepath.Separator) + "." } if hasTrailingPathSeparator(path, os.PathSeparator) && !hasTrailingPathSeparator(resolvedPath, os.PathSeparator) { resolvedPath += string(filepath.Separator) } if filepath.Base(path) != filepath.Base(resolvedPath) { // In the case where the path had a trailing separator and a symlink // evaluation has changed the last path component, we will need to // rebase the name in the archive that is being copied to match the // originally requested name. rebaseName = filepath.Base(path) } return resolvedPath, rebaseName }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package java.util.logging; /** * {@code Handler} that buffers requests in a circular buffer in memory. * <p> * Normally this {@code Handler} simply stores incoming {@code LogRecords} * into its memory buffer and discards earlier records. This buffering * is very cheap and avoids formatting costs. On certain trigger * conditions, the {@code MemoryHandler} will push out its current buffer * contents to a target {@code Handler}, which will typically publish * them to the outside world. * <p> * There are three main models for triggering a push of the buffer: * <ul> * <li> * An incoming {@code LogRecord} has a type that is greater than * a pre-defined level, the {@code pushLevel}. </li> * <li> * An external class calls the {@code push} method explicitly. </li> * <li> * A subclass overrides the {@code log} method and scans each incoming * {@code LogRecord} and calls {@code push} if a record matches some * desired criteria. </li> * </ul> * <p> * <b>Configuration:</b> * By default each {@code MemoryHandler} is initialized using the following * {@code LogManager} configuration properties where {@code <handler-name>} * refers to the fully-qualified class name of the handler. * If properties are not defined * (or have invalid values) then the specified default values are used. * If no default value is defined then a RuntimeException is thrown. * <ul> * <li> &lt;handler-name&gt;.level * specifies the level for the {@code Handler} * (defaults to {@code Level.ALL}). </li> * <li> &lt;handler-name&gt;.filter * specifies the name of a {@code Filter} class to use * (defaults to no {@code Filter}). </li> * <li> &lt;handler-name&gt;.size * defines the buffer size (defaults to 1000). </li> * <li> &lt;handler-name&gt;.push * defines the {@code pushLevel} (defaults to {@code level.SEVERE}). </li> * <li> &lt;handler-name&gt;.target * specifies the name of the target {@code Handler } class. * (no default). </li> * </ul> * <p> * For example, the properties for {@code MemoryHandler} would be: * <ul> * <li> java.util.logging.MemoryHandler.level=INFO </li> * <li> java.util.logging.MemoryHandler.formatter=java.util.logging.SimpleFormatter </li> * </ul> * <p> * For a custom handler, e.g. com.foo.MyHandler, the properties would be: * <ul> * <li> com.foo.MyHandler.level=INFO </li> * <li> com.foo.MyHandler.formatter=java.util.logging.SimpleFormatter </li> * </ul> * * @since 1.4 */ public class MemoryHandler extends Handler { private final static int DEFAULT_SIZE = 1000; private volatile Level pushLevel; private int size; private Handler target; private LogRecord buffer[]; int start, count; /** * Create a {@code MemoryHandler} and configure it based on * {@code LogManager} configuration properties. */ public MemoryHandler() { // configure with specific defaults for MemoryHandler super(Level.ALL, new SimpleFormatter(), null); LogManager manager = LogManager.getLogManager(); String cname = getClass().getName(); pushLevel = manager.getLevelProperty(cname +".push", Level.SEVERE); size = manager.getIntProperty(cname + ".size", DEFAULT_SIZE); if (size <= 0) { size = DEFAULT_SIZE; } String targetName = manager.getProperty(cname+".target"); if (targetName == null) { throw new RuntimeException("The handler " + cname + " does not specify a target"); } Class<?> clz; try { clz = ClassLoader.getSystemClassLoader().loadClass(targetName); @SuppressWarnings("deprecation") Object o = clz.newInstance(); target = (Handler) o; } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { throw new RuntimeException("MemoryHandler can't load handler target \"" + targetName + "\"" , e); } init(); } // Initialize. Size is a count of LogRecords. private void init() { buffer = new LogRecord[size]; start = 0; count = 0; } /** * Create a {@code MemoryHandler}. * <p> * The {@code MemoryHandler} is configured based on {@code LogManager} * properties (or their default values) except that the given {@code pushLevel} * argument and buffer size argument are used. * * @param target the Handler to which to publish output. * @param size the number of log records to buffer (must be greater than zero) * @param pushLevel message level to push on * * @throws IllegalArgumentException if {@code size is <= 0} */ public MemoryHandler(Handler target, int size, Level pushLevel) { // configure with specific defaults for MemoryHandler super(Level.ALL, new SimpleFormatter(), null); if (target == null || pushLevel == null) { throw new NullPointerException(); } if (size <= 0) { throw new IllegalArgumentException(); } this.target = target; this.pushLevel = pushLevel; this.size = size; init(); } /** * Store a {@code LogRecord} in an internal buffer. * <p> * If there is a {@code Filter}, its {@code isLoggable} * method is called to check if the given log record is loggable. * If not we return. Otherwise the given record is copied into * an internal circular buffer. Then the record's level property is * compared with the {@code pushLevel}. If the given level is * greater than or equal to the {@code pushLevel} then {@code push} * is called to write all buffered records to the target output * {@code Handler}. * * @param record description of the log event. A null record is * silently ignored and is not published */ @Override public synchronized void publish(LogRecord record) { if (!isLoggable(record)) { return; } int ix = (start+count)%buffer.length; buffer[ix] = record; if (count < buffer.length) { count++; } else { start++; start %= buffer.length; } if (record.getLevel().intValue() >= pushLevel.intValue()) { push(); } } /** * Push any buffered output to the target {@code Handler}. * <p> * The buffer is then cleared. */ public synchronized void push() { for (int i = 0; i < count; i++) { int ix = (start+i)%buffer.length; LogRecord record = buffer[ix]; target.publish(record); } // Empty the buffer. start = 0; count = 0; } /** * Causes a flush on the target {@code Handler}. * <p> * Note that the current contents of the {@code MemoryHandler} * buffer are <b>not</b> written out. That requires a "push". */ @Override public void flush() { target.flush(); } /** * Close the {@code Handler} and free all associated resources. * This will also close the target {@code Handler}. * * @exception SecurityException if a security manager exists and if * the caller does not have {@code LoggingPermission("control")}. */ @Override public void close() throws SecurityException { target.close(); setLevel(Level.OFF); } /** * Set the {@code pushLevel}. After a {@code LogRecord} is copied * into our internal buffer, if its level is greater than or equal to * the {@code pushLevel}, then {@code push} will be called. * * @param newLevel the new value of the {@code pushLevel} * @exception SecurityException if a security manager exists and if * the caller does not have {@code LoggingPermission("control")}. */ public synchronized void setPushLevel(Level newLevel) throws SecurityException { if (newLevel == null) { throw new NullPointerException(); } checkPermission(); pushLevel = newLevel; } /** * Get the {@code pushLevel}. * * @return the value of the {@code pushLevel} */ public Level getPushLevel() { return pushLevel; } /** * Check if this {@code Handler} would actually log a given * {@code LogRecord} into its internal buffer. * <p> * This method checks if the {@code LogRecord} has an appropriate level and * whether it satisfies any {@code Filter}. However it does <b>not</b> * check whether the {@code LogRecord} would result in a "push" of the * buffer contents. It will return false if the {@code LogRecord} is null. * * @param record a {@code LogRecord} * @return true if the {@code LogRecord} would be logged. * */ @Override public boolean isLoggable(LogRecord record) { return super.isLoggable(record); } }
{ "pile_set_name": "Github" }
defmodule Game.Session.SessionStats do @moduledoc """ Struct for session stats """ @doc """ Session stats - `commands`: Map of counts for command usage, The module is the key, value is the count """ defstruct commands: %{} end
{ "pile_set_name": "Github" }
/************************************************************ yymgetch.c This file can be freely modified for the generation of custom code. Copyright (c) 1999 Bumble-Bee Software Ltd. ************************************************************/ #include <stdio.h> #include <assert.h> #include "mlex.h" #ifdef YYPROTOTYPE int YYCDECL yymgetchar(yymlex_t YYFAR *yy) #else int YYCDECL yymgetchar(yy) yymlex_t YYFAR *yy; #endif { yyassert(yy != NULL); yyassert(yy->yymin != NULL); return getc(yy->yymin); }
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from datetime import datetime from astropy.time import Time from astropy import units as u __all__ = ['time_support'] __doctest_requires__ = {'time_support': ['matplotlib']} UNSUPPORTED_FORMATS = ('datetime', 'datetime64') YMDHMS_FORMATS = ('fits', 'iso', 'isot', 'yday') STR_FORMATS = YMDHMS_FORMATS + ('byear_str', 'jyear_str') def time_support(*, scale=None, format=None, simplify=True): """ Enable support for plotting `astropy.time.Time` instances in matplotlib. May be (optionally) used with a ``with`` statement. >>> import matplotlib.pyplot as plt >>> from astropy import units as u >>> from astropy import visualization >>> with visualization.time_support(): # doctest: +IGNORE_OUTPUT ... plt.figure() ... plt.plot(Time(['2016-03-22T12:30:31', '2016-03-22T12:30:38', '2016-03-22T12:34:40'])) ... plt.draw() Parameters ---------- scale : str, optional The time scale to use for the times on the axis. If not specified, the scale of the first Time object passed to Matplotlib is used. format : str, optional The time format to use for the times on the axis. If not specified, the format of the first Time object passed to Matplotlib is used. simplify : bool, optional If possible, simplify labels, e.g. by removing 00:00:00.000 times from ISO strings if all labels fall on that time. """ import matplotlib.units as units from matplotlib.ticker import MaxNLocator, ScalarFormatter from astropy.visualization.wcsaxes.utils import select_step_hour, select_step_scalar class AstropyTimeLocator(MaxNLocator): # Note: we default to AutoLocator since many time formats # can just use this. def __init__(self, converter, *args, **kwargs): kwargs['nbins'] = 4 super().__init__(*args, **kwargs) self._converter = converter def tick_values(self, vmin, vmax): # Where we put the ticks depends on the format we are using if self._converter.format in YMDHMS_FORMATS: # If we are here, we need to check what the range of values # is and decide how to find tick locations accordingly vrange = vmax - vmin if (self._converter.format != 'yday' and vrange > 31) or vrange > 366: # greater than a month # We need to be careful here since not all years and months have # the same length # Start off by converting the values from the range to # datetime objects, so that we can easily extract the year and # month. tmin = Time(vmin, scale=self._converter.scale, format='mjd').datetime tmax = Time(vmax, scale=self._converter.scale, format='mjd').datetime # Find the range of years ymin = tmin.year ymax = tmax.year if ymax > ymin + 1: # greater than a year # Find the step we want to use ystep = int(select_step_scalar(max(1, (ymax - ymin) / 3))) ymin = ystep * (ymin // ystep) # Generate the years for these steps times = [] for year in range(ymin, ymax + 1, ystep): times.append(datetime(year=year, month=1, day=1)) else: # greater than a month but less than a year mmin = tmin.month mmax = tmax.month + 12 * (ymax - ymin) mstep = int(select_step_scalar(max(1, (mmax - mmin) / 3))) mmin = mstep * max(1, mmin // mstep) # Generate the months for these steps times = [] for month in range(mmin, mmax + 1, mstep): times.append(datetime(year=ymin + month // 12, month=month % 12, day=1)) # Convert back to MJD values = Time(times, scale=self._converter.scale).mjd elif vrange > 1: # greater than a day self.set_params(steps=[1, 2, 5, 10]) values = super().tick_values(vmin, vmax) else: # Determine ideal step dv = (vmax - vmin) / 3 * 24 << u.hourangle # And round to nearest sensible value dv = select_step_hour(dv).to_value(u.hourangle) / 24 # Determine tick locations imin = np.ceil(vmin / dv) imax = np.floor(vmax / dv) values = np.arange(imin, imax + 1, dtype=np.int64) * dv else: values = super().tick_values(vmin, vmax) # Get rid of values outside of the input interval values = values[(values >= vmin) & (values <= vmax)] return values def __call__(self): vmin, vmax = self.axis.get_view_interval() return self.tick_values(vmin, vmax) class AstropyTimeFormatter(ScalarFormatter): def __init__(self, converter, *args, **kwargs): super().__init__(*args, **kwargs) self._converter = converter self.set_useOffset(False) self.set_scientific(False) def __call__(self, value, pos=None): # Needed for Matplotlib <3.1 if self._converter.format in STR_FORMATS: return self.format_ticks([value])[0] else: return super().__call__(value, pos=pos) def format_ticks(self, values): if len(values) == 0: return [] if self._converter.format in YMDHMS_FORMATS: times = Time(values, format='mjd', scale=self._converter.scale) formatted = getattr(times, self._converter.format) if self._converter.simplify: if self._converter.format in ('fits', 'iso', 'isot'): if all([x.endswith('00:00:00.000') for x in formatted]): split = ' ' if self._converter.format == 'iso' else 'T' formatted = [x.split(split)[0] for x in formatted] elif self._converter.format == 'yday': if all([x.endswith(':001:00:00:00.000') for x in formatted]): formatted = [x.split(':', 1)[0] for x in formatted] return formatted elif self._converter.format == 'byear_str': return Time(values, format='byear', scale=self._converter.scale).byear_str elif self._converter.format == 'jyear_str': return Time(values, format='jyear', scale=self._converter.scale).jyear_str else: return super().format_ticks(values) class MplTimeConverter(units.ConversionInterface): def __init__(self, scale=None, format=None, simplify=None): super().__init__() self.format = format self.scale = scale self.simplify = simplify # Keep track of original converter in case the context manager is # used in a nested way. self._original_converter = units.registry.get(Time) units.registry[Time] = self @property def format(self): return self._format @format.setter def format(self, value): if value in UNSUPPORTED_FORMATS: raise ValueError(f'time_support does not support format={value}') self._format = value def __enter__(self): return self def __exit__(self, type, value, tb): if self._original_converter is None: del units.registry[Time] else: units.registry[Time] = self._original_converter def default_units(self, x, axis): if isinstance(x, tuple): x = x[0] if self.format is None: self.format = x.format if self.scale is None: self.scale = x.scale return 'astropy_time' def convert(self, value, unit, axis): """ Convert a Time value to a scalar or array. """ # For Matplotlib < 2.2 if not isinstance(value, Time): return value scaled = getattr(value, self.scale) if self.format in YMDHMS_FORMATS: return scaled.mjd elif self.format == 'byear_str': return scaled.byear elif self.format == 'jyear_str': return scaled.jyear else: return getattr(scaled, self.format) def axisinfo(self, unit, axis): """ Return major and minor tick locators and formatters. """ majloc = AstropyTimeLocator(self) majfmt = AstropyTimeFormatter(self) return units.AxisInfo(majfmt=majfmt, majloc=majloc, label=f'Time ({self.scale})') return MplTimeConverter(scale=scale, format=format, simplify=simplify)
{ "pile_set_name": "Github" }
Pynche - The PYthonically Natural Color and Hue Editor Contact: Barry A. Warsaw Email: [email protected] Version: 1.3 Introduction Pynche is a color editor based largely on a similar program that I originally wrote back in 1987 for the Sunview window system. That editor was called ICE, the Interactive Color Editor. I'd always wanted to port this program to X but didn't feel like hacking X and C code to do it. Fast forward many years, to where Python + Tkinter provides such a nice programming environment, with enough power, that I finally buckled down and re-implemented it. I changed the name because these days, too many other systems have the acronym `ICE'. Pynche should work with any variant of Python after 1.5.2 (e.g. 2.0.1 and 2.1.1), using Tk 8.0.x. It's been tested on Solaris 2.6, Windows NT 4, and various Linux distros. You'll want to be sure to have at least Tk 8.0.3 for Windows. Also, Pynche is very colormap intensive, so it doesn't work very well on 8-bit graphics cards; 24bit+ graphics cards are so cheap these days, I'll probably never "fix" that. Pynche must find a text database of colors names in order to provide `nearest' color matching. Pynche is distributed with an rgb.txt file from the X11R6.4 distribution for this reason, along with other "Web related" database (see below). You can use a different file with the -d option. The file xlicense.txt contains the license only for rgb.txt and both files are in the X/ subdirectory. Pynche is pronounced: Pin'-chee Running Standalone On Unix, start it by running the `pynche' script. On Windows, run pynche.pyw to inhibit the console window. When run from the command line, the following options are recognized: --database file -d file Alternate location of the color database file. Without this option, the first valid file found will be used (see below). --initfile file -i file Alternate location of the persistent initialization file. See the section on Persistency below. --ignore -X Ignore the persistent initialization file when starting up. Pynche will still write the current option settings to the persistent init file when it quits. --help -h Print the help message. initialcolor a Tk color name or #rrggbb color spec to be used as the initially selected color. This overrides any color saved in the persistent init file. Since `#' needs to be escaped in many shells, it is optional in the spec (e.g. #45dd1f is the same as 45dd1f). Running as a Modal Dialog Pynche can be run as a modal dialog, inside another application, say as a general color chooser. In fact, Grail 0.6 uses Pynche and a future version of IDLE may as well. Pynche supports the API implemented by the Tkinter standard tkColorChooser module, with a few changes as described below. By importing pyColorChooser from the Pynche package, you can run pyColorChooser.askcolor() which will popup Pynche as a modal dialog, and return the selected color. There are some UI differences when running as a modal vs. standalone. When running as a modal, there is no "Quit" menu item under the "File" menu. Instead there are "Okay" and "Cancel" buttons. When "Okay" is hit, askcolor() returns the tuple ((r, g, b), "name") where r, g, and b are red, green, and blue color values respectively (in the range 0 to 255). "name" will be a color name from the color database if there is an exact match, otherwise it will be an X11 color spec of the form "#rrggbb". Note that this is different than tkColorChooser, which doesn't know anything about color names. askcolor() supports the following optional keyword arguments: color the color to set as the initial selected color master[*] the master window to use as the parent of the modal dialog. Without this argument, pyColorChooser will create its own Tkinter.Tk instance as the master. This may not be what you want. databasefile similar to the --database option, the value must be a file name initfile[*] similar to the --initfile option, the value must be a file name ignore[*] similar to the --ignore flag, the value is a boolean wantspec When this is true, the "name" field in the return tuple will always be a color spec of the form "#rrggbb". It will not return a color name even if there is a match; this is so pyColorChooser can exactly match the API of tkColorChooser. [*] these arguments must be specified the first time askcolor() is used and cannot be changed on subsequent calls. The Colorstrip Window The top part of the main Pynche window contains the "variation strips". Each strip contains a number of "color chips". The strips always indicate the currently selected color by a highlight rectangle around the selected color chip, with an arrow pointing to the chip. Each arrow has an associated number giving you the color value along the variation's axis. Each variation strip shows you the colors that are reachable from the selected color by varying just one axis of the color solid. For example, when the selected color is (in Red/Green/Blue notation) 127/127/127, the Red Variations strip shows you every color in the range 0/127/127 to 255/127/127. Similarly for the green and blue axes. You can select any color by clicking on its chip. This will update the highlight rectangle and the arrow, as well as other displays in Pynche. Click on "Update while dragging" if you want Pynche to update the selected color while you drag along any variation strip (this will be a bit slower). Click on "Hexadecimal" to display the arrow numbers in hex. There are also two shortcut buttons in this window, which auto-select Black (0/0/0) and White (255/255/255). The Proof Window In the lower left corner of the main window you see two larger color chips. The Selected chip shows you a larger version of the color selected in the variation strips, along with its X11 color specification. The Nearest chip shows you the closest color in the X11 database to the selected color, giving its X11 color specification, and below that, its X11 color name. When the Selected chip color exactly matches the Nearest chip color, you will see the color name appear below the color specification for the Selected chip. Clicking on the Nearest color chip selects that color. Color distance is calculated in the 3D space of the RGB color solid and if more than one color name is the same distance from the selected color, the first one found will be chosen. Note that there may be more than one X11 color name for the same RGB value. In that case, the first one found in the text database is designated the "primary" name, and this is shown under the Nearest chip. The other names are "aliases" and they are visible in the Color List Window (see below). Both the color specifications and color names are selectable for copying and pasting into another window. The Type-in Window At the lower right of the main window are three entry fields. Here you can type numeric values for any of the three color axes. Legal values are between 0 and 255, and these fields do not allow you to enter illegal values. You must hit Enter or Tab to select the new color. Click on "Update while typing" if you want Pynche to select the color on every keystroke (well, every one that produces a legal value!) Click on "Hexadecimal" to display and enter color values in hex. Other Views There are three secondary windows which are not displayed by default. You can bring these up via the "View" menu on the main Pynche window. The Text Window The "Text Window" allows you to see what effects various colors have on the standard Tk text widget elements. In the upper part of the window is a plain Tk text widget and here you can edit the text, select a region of text, etc. Below this is a button "Track color changes". When this is turned on, any colors selected in the other windows will change the text widget element specified in the radio buttons below. When this is turned off, text widget elements are not affected by color selection. You can choose which element gets changed by color selection by clicking on one of the radio buttons in the bottom part of this window. Text foreground and background affect the text in the upper part of the window. Selection foreground and background affect the colors of the primary selection which is what you see when you click the middle button (depending on window system) and drag it through some text. The Insertion is the insertion cursor in the text window, where new text will be inserted as you type. The insertion cursor only has a background. The Color List Window The "Color List" window shows every named color in the color name database (this window may take a while to come up). In the upper part of the window you see a scrolling list of all the color names in the database, in alphabetical order. Click on any color to select it. In the bottom part of the window is displayed any aliases for the selected color (those color names that have the same RGB value, but were found later in the text database). For example, find the color "Black" and you'll see that its aliases are "gray0" and "grey0". If the color has no aliases you'll see "<no aliases>" here. If you just want to see if a color has an alias, and do not want to select a color when you click on it, turn off "Update on Click". Note that the color list is always updated when a color is selected from the main window. There's no way to turn this feature off. If the selected color has no matching color name you'll see "<no matching color>" in the Aliases window. The Details Window The "Details" window gives you more control over color selection than just clicking on a color chip in the main window. The row of buttons along the top apply the specified increment and decrement amounts to the selected color. These delta amounts are applied to the variation strips specified by the check boxes labeled "Move Sliders". Thus if just Red and Green are selected, hitting -10 will subtract 10 from the color value along the red and green variation only. Note the message under the checkboxes; this indicates the primary color level being changed when more than one slider is tied together. For example, if Red and Green are selected, you will be changing the Yellow level of the selected color. The "At Boundary" behavior determines what happens when any color variation hits either the lower or upper boundaries (0 or 255) as a result of clicking on the top row buttons: Stop When the increment or decrement would send any of the tied variations out of bounds, the entire delta is discarded. Wrap Around When the increment or decrement would send any of the tied variations out of bounds, the out of bounds value is wrapped around to the other side. Thus if red were at 238 and +25 were clicked, red would have the value 7. Preserve Distance When the increment or decrement would send any of the tied variations out of bounds, all tied variations are wrapped as one, so as to preserve the distance between them. Thus if green and blue were tied, and green was at 238 while blue was at 223, and +25 were clicked, green would be at 15 and blue would be at 0. Squash When the increment or decrement would send any of the tied variations out of bounds, the out of bounds variation is set to the ceiling of 255 or floor of 0, as appropriate. In this way, all tied variations are squashed to one edge or the other. The top row buttons have the following keyboard accelerators: -25 == Shift Left Arrow -10 == Control Left Arrow -1 == Left Arrow +1 == Right Arrow +10 == Control Right Arrow +25 == Shift Right Arrow Keyboard Accelerators Alt-w in any secondary window dismisses the window. In the main window it exits Pynche (except when running as a modal). Alt-q in any window exits Pynche (except when running as a modal). Persistency Pynche remembers various settings of options and colors between invocations, storing these values in a `persistent initialization file'. The actual location of this file is specified by the --initfile option (see above), and defaults to ~/.pynche. When Pynche exits, it saves these values in the init file, and re-reads them when it starts up. There is no locking on this file, so if you run multiple instances of Pynche at a time, you may clobber the init file. The actual options stored include - the currently selected color - all settings of checkbox and radio button options in all windows - the contents of the text window, the current text selection and insertion point, and all current text widget element color settings. - the name of the color database file (but not its contents) You can inhibit Pynche from reading the init file by supplying the --ignore option on the command line. However, you cannot suppress the storing of the settings in the init file on Pynche exit. If you really want to do this, use /dev/null as the init file, using --initfile. Color Name Database Files Pynche uses a color name database file to calculate the nearest color to the selected color, and to display in the Color List view. Several files are distributed with Pynche, described below. By default, the X11 color name database file is selected. Other files: html40colors.txt -- the HTML 4.0 guaranteed color names websafe.txt -- the 216 "Web-safe" colors that Netscape and MSIE guarantee will not be dithered. These are specified in #rrggbb format for both values and names webcolors.txt -- The 140 color names that Tim Peters and his sister say NS and MSIE both understand (with some controversy over AliceBlue). namedcolors.txt -- an alternative set of Netscape colors. You can switch between files by choosing "Load palette..." from the "File" menu. This brings up a standard Tk file dialog. Choose the file you want and then click "Ok". If Pynche understands the format in this file, it will load the database and update the appropriate windows. If not, it will bring up an error dialog. To Do Here's a brief list of things I want to do (some mythical day): - Better support for resizing the top level windows - More output views, e.g. color solids - Have the notion of a `last color selected'; this may require a new output view - Support setting the font in the text view - Support distutils setup.py for installation I'm open to suggestions! Local Variables: indent-tabs-mode: nil End:
{ "pile_set_name": "Github" }
// Distributed under the terms of the MIT license // Test case submitted to project by https://github.com/practicalswift (practicalswift) // Test case found by fuzzing class A<S where h:a{protocol a class a{let g=A?{a{
{ "pile_set_name": "Github" }
/* * Copyright 2015 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * * 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.drools.compiler.reteoo; import com.thoughtworks.xstream.XStream; import org.drools.compiler.builder.impl.KnowledgeBuilderImpl; import org.drools.core.definitions.InternalKnowledgePackage; import org.drools.core.impl.InternalKnowledgeBase; import org.drools.core.impl.KnowledgeBaseFactory; import org.drools.core.reteoo.LeftTupleSink; import org.drools.core.reteoo.LeftTupleSource; import org.drools.core.reteoo.ObjectSink; import org.drools.core.reteoo.ObjectSource; import org.junit.Test; import org.kie.api.KieBase; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import static org.junit.Assert.assertEquals; import static org.kie.soup.xstream.XStreamUtils.createTrustingXStream; public class ReteooBuilderTest { private final boolean writeTree = false; /** Implementation specific subclasses must provide this. */ protected KieBase getKnowledgeBase() throws Exception { return KnowledgeBaseFactory.newKnowledgeBase(); } @Test public void testThreePatternsWithConstraints() throws Exception { //checkRuleBase( "ThreePatternsWithConstraints" ); } @Test public void testOneAndTwoOrs() throws Exception { //checkRuleBase( "OneAndTwoOrs" ); } @Test public void testOneAndTwoOrsPerson() throws Exception { //checkRuleBase( "OneAndTwoOrsPerson" ); } private void writeRuleBase(final InternalKnowledgeBase kBase, final String fileName) throws IOException { final XStream xstream = createTrustingXStream(); final PrintWriter out = new PrintWriter( new BufferedWriter( new FileWriter( "src/test/resources/org/drools/reteoo/" + fileName ) ) ); xstream.toXML( kBase, out ); } private void checkRuleBase(final String name) throws Exception { final KnowledgeBuilderImpl builder = new KnowledgeBuilderImpl(); builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "test_" + name + ".drl" ) ) ); InternalKnowledgePackage pkg = builder.getPackage("org.drools.compiler.test"); final InternalKnowledgeBase kBase = (InternalKnowledgeBase) getKnowledgeBase(); kBase.addPackage( pkg ); if ( this.writeTree ) { writeRuleBase( kBase, name ); } final XStream xstream = createTrustingXStream(); final InternalKnowledgeBase goodKBase = (InternalKnowledgeBase) xstream.fromXML( getClass().getResourceAsStream( name ) ); nodesEquals( goodKBase.getRete(), kBase.getRete() ); } private void nodesEquals(final Object object1, final Object object2) { assertEquals( object1 + " is not of the same type as " + object2, object1.getClass(), object2.getClass() ); assertEquals( object1 + " is not equal to " + object2, object1, object2 ); if ( object1 instanceof ObjectSource) { final ObjectSource source1 = (ObjectSource) object1; final ObjectSource source2 = (ObjectSource) object2; final ObjectSink[] list1 = source1.getObjectSinkPropagator().getSinks(); final ObjectSink[] list2 = source2.getObjectSinkPropagator().getSinks(); assertEquals( object1.getClass() + " nodes have different number of sinks", list1.length, list2.length ); for ( int i = 0, size = list1.length; i < size; i++ ) { nodesEquals( list1[i], list2[i] ); } } else if ( object1 instanceof LeftTupleSource) { final LeftTupleSource source1 = (LeftTupleSource) object1; final LeftTupleSource source2 = (LeftTupleSource) object2; final LeftTupleSink[] list1 = source1.getSinkPropagator().getSinks(); final LeftTupleSink[] list2 = source2.getSinkPropagator().getSinks(); assertEquals( object1.getClass() + " nodes have different number of sinks", list1.length, list2.length ); for ( int i = 0, size = list1.length; i < size; i++ ) { nodesEquals( list1[i], list2[i] ); } } } }
{ "pile_set_name": "Github" }
/*! * SAP UI development toolkit for HTML5 (SAPUI5/OpenUI5) * (c) Copyright 2009-2015 SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ sap.ui.define(['jquery.sap.global','sap/ui/core/Control','./library'],function(q,C,l){"use strict";var a=C.extend("sap.ui.unified.CalendarLegend",{metadata:{library:"sap.ui.unified",properties:{columnWidth:{type:"sap.ui.core.CSSSize",group:"Misc",defaultValue:'120px'}},aggregations:{items:{type:"sap.ui.unified.CalendarLegendItem",multiple:true,singularName:"item"}}}});a.prototype.onAfterRendering=function(){if(sap.ui.Device.browser.msie){if(sap.ui.Device.browser.version<10){q(".sapUiUnifiedLegendItem").css("width",this.getColumnWidth()+4+"px").css("display","inline-block");}}};return a;},true);
{ "pile_set_name": "Github" }
/* * FreeRTOS Kernel V10.0.1 * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. 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. * * http://www.FreeRTOS.org * http://aws.amazon.com/freertos * * 1 tab == 4 spaces! */ .global vRegTest1Implementation .global vRegTest2Implementation .extern ulRegTest1LoopCounter .extern ulRegTest2LoopCounter .text .arm /* This function is explained in the comments at the top of main-full.c. */ .type vRegTest1Implementation, %function vRegTest1Implementation: /* Fill each general purpose register with a known value. */ mov r0, #0xFF mov r1, #0x11 mov r2, #0x22 mov r3, #0x33 mov r4, #0x44 mov r5, #0x55 mov r6, #0x66 mov r7, #0x77 mov r8, #0x88 mov r9, #0x99 mov r10, #0xAA mov r11, #0xBB mov r12, #0xCC mov r14, #0xEE /* Fill each FPU register with a known value. */ vmov d0, r0, r1 vmov d1, r2, r3 vmov d2, r4, r5 vmov d3, r6, r7 vmov d4, r8, r9 vmov d5, r10, r11 vmov d6, r0, r1 vmov d7, r2, r3 vmov d8, r4, r5 vmov d9, r6, r7 vmov d10, r8, r9 vmov d11, r10, r11 vmov d12, r0, r1 vmov d13, r2, r3 vmov d14, r4, r5 vmov d15, r6, r7 /* Loop, checking each iteration that each register still contains the expected value. */ reg1_loop: /* Yield to increase test coverage */ svc 0 /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } vmov r0, r1, d0 cmp r0, #0xFF bne reg1_error_loopf cmp r1, #0x11 bne reg1_error_loopf vmov r0, r1, d1 cmp r0, #0x22 bne reg1_error_loopf cmp r1, #0x33 bne reg1_error_loopf vmov r0, r1, d2 cmp r0, #0x44 bne reg1_error_loopf cmp r1, #0x55 bne reg1_error_loopf vmov r0, r1, d3 cmp r0, #0x66 bne reg1_error_loopf cmp r1, #0x77 bne reg1_error_loopf vmov r0, r1, d4 cmp r0, #0x88 bne reg1_error_loopf cmp r1, #0x99 bne reg1_error_loopf vmov r0, r1, d5 cmp r0, #0xAA bne reg1_error_loopf cmp r1, #0xBB bne reg1_error_loopf vmov r0, r1, d6 cmp r0, #0xFF bne reg1_error_loopf cmp r1, #0x11 bne reg1_error_loopf vmov r0, r1, d7 cmp r0, #0x22 bne reg1_error_loopf cmp r1, #0x33 bne reg1_error_loopf vmov r0, r1, d8 cmp r0, #0x44 bne reg1_error_loopf cmp r1, #0x55 bne reg1_error_loopf vmov r0, r1, d9 cmp r0, #0x66 bne reg1_error_loopf cmp r1, #0x77 bne reg1_error_loopf vmov r0, r1, d10 cmp r0, #0x88 bne reg1_error_loopf cmp r1, #0x99 bne reg1_error_loopf vmov r0, r1, d11 cmp r0, #0xAA bne reg1_error_loopf cmp r1, #0xBB bne reg1_error_loopf vmov r0, r1, d12 cmp r0, #0xFF bne reg1_error_loopf cmp r1, #0x11 bne reg1_error_loopf vmov r0, r1, d13 cmp r0, #0x22 bne reg1_error_loopf cmp r1, #0x33 bne reg1_error_loopf vmov r0, r1, d14 cmp r0, #0x44 bne reg1_error_loopf cmp r1, #0x55 bne reg1_error_loopf vmov r0, r1, d15 cmp r0, #0x66 bne reg1_error_loopf cmp r1, #0x77 bne reg1_error_loopf /* Restore the registers that were clobbered by the test. */ pop {r0-r1} /* VFP register test passed. Jump to the core register test. */ b reg1_loopf_pass reg1_error_loopf: /* If this line is hit then a VFP register value was found to be incorrect. */ b reg1_error_loopf reg1_loopf_pass: /* Test each general purpose register to check that it still contains the expected known value, jumping to reg1_error_loop if any register contains an unexpected value. */ cmp r0, #0xFF bne reg1_error_loop cmp r1, #0x11 bne reg1_error_loop cmp r2, #0x22 bne reg1_error_loop cmp r3, #0x33 bne reg1_error_loop cmp r4, #0x44 bne reg1_error_loop cmp r5, #0x55 bne reg1_error_loop cmp r6, #0x66 bne reg1_error_loop cmp r7, #0x77 bne reg1_error_loop cmp r8, #0x88 bne reg1_error_loop cmp r9, #0x99 bne reg1_error_loop cmp r10, #0xAA bne reg1_error_loop cmp r11, #0xBB bne reg1_error_loop cmp r12, #0xCC bne reg1_error_loop cmp r14, #0xEE bne reg1_error_loop /* Everything passed, increment the loop counter. */ push { r0-r1 } ldr r0, =ulRegTest1LoopCounter ldr r1, [r0] adds r1, r1, #1 str r1, [r0] pop { r0-r1 } /* Start again. */ b reg1_loop reg1_error_loop: /* If this line is hit then there was an error in a core register value. The loop ensures the loop counter stops incrementing. */ b reg1_error_loop nop /*-----------------------------------------------------------*/ .type vRegTest2Implementation, %function vRegTest2Implementation: /* Put a known value in each register. */ mov r0, #0xFF000000 mov r1, #0x11000000 mov r2, #0x22000000 mov r3, #0x33000000 mov r4, #0x44000000 mov r5, #0x55000000 mov r6, #0x66000000 mov r7, #0x77000000 mov r8, #0x88000000 mov r9, #0x99000000 mov r10, #0xAA000000 mov r11, #0xBB000000 mov r12, #0xCC000000 mov r14, #0xEE000000 /* Likewise the floating point registers */ vmov d0, r0, r1 vmov d1, r2, r3 vmov d2, r4, r5 vmov d3, r6, r7 vmov d4, r8, r9 vmov d5, r10, r11 vmov d6, r0, r1 vmov d7, r2, r3 vmov d8, r4, r5 vmov d9, r6, r7 vmov d10, r8, r9 vmov d11, r10, r11 vmov d12, r0, r1 vmov d13, r2, r3 vmov d14, r4, r5 vmov d15, r6, r7 /* Loop, checking each iteration that each register still contains the expected value. */ reg2_loop: /* Check all the VFP registers still contain the values set above. First save registers that are clobbered by the test. */ push { r0-r1 } vmov r0, r1, d0 cmp r0, #0xFF000000 bne reg2_error_loopf cmp r1, #0x11000000 bne reg2_error_loopf vmov r0, r1, d1 cmp r0, #0x22000000 bne reg2_error_loopf cmp r1, #0x33000000 bne reg2_error_loopf vmov r0, r1, d2 cmp r0, #0x44000000 bne reg2_error_loopf cmp r1, #0x55000000 bne reg2_error_loopf vmov r0, r1, d3 cmp r0, #0x66000000 bne reg2_error_loopf cmp r1, #0x77000000 bne reg2_error_loopf vmov r0, r1, d4 cmp r0, #0x88000000 bne reg2_error_loopf cmp r1, #0x99000000 bne reg2_error_loopf vmov r0, r1, d5 cmp r0, #0xAA000000 bne reg2_error_loopf cmp r1, #0xBB000000 bne reg2_error_loopf vmov r0, r1, d6 cmp r0, #0xFF000000 bne reg2_error_loopf cmp r1, #0x11000000 bne reg2_error_loopf vmov r0, r1, d7 cmp r0, #0x22000000 bne reg2_error_loopf cmp r1, #0x33000000 bne reg2_error_loopf vmov r0, r1, d8 cmp r0, #0x44000000 bne reg2_error_loopf cmp r1, #0x55000000 bne reg2_error_loopf vmov r0, r1, d9 cmp r0, #0x66000000 bne reg2_error_loopf cmp r1, #0x77000000 bne reg2_error_loopf vmov r0, r1, d10 cmp r0, #0x88000000 bne reg2_error_loopf cmp r1, #0x99000000 bne reg2_error_loopf vmov r0, r1, d11 cmp r0, #0xAA000000 bne reg2_error_loopf cmp r1, #0xBB000000 bne reg2_error_loopf vmov r0, r1, d12 cmp r0, #0xFF000000 bne reg2_error_loopf cmp r1, #0x11000000 bne reg2_error_loopf vmov r0, r1, d13 cmp r0, #0x22000000 bne reg2_error_loopf cmp r1, #0x33000000 bne reg2_error_loopf vmov r0, r1, d14 cmp r0, #0x44000000 bne reg2_error_loopf cmp r1, #0x55000000 bne reg2_error_loopf vmov r0, r1, d15 cmp r0, #0x66000000 bne reg2_error_loopf cmp r1, #0x77000000 bne reg2_error_loopf /* Restore the registers that were clobbered by the test. */ pop {r0-r1} /* VFP register test passed. Jump to the core register test. */ b reg2_loopf_pass reg2_error_loopf: /* If this line is hit then a VFP register value was found to be incorrect. */ b reg2_error_loopf reg2_loopf_pass: cmp r0, #0xFF000000 bne reg2_error_loop cmp r1, #0x11000000 bne reg2_error_loop cmp r2, #0x22000000 bne reg2_error_loop cmp r3, #0x33000000 bne reg2_error_loop cmp r4, #0x44000000 bne reg2_error_loop cmp r5, #0x55000000 bne reg2_error_loop cmp r6, #0x66000000 bne reg2_error_loop cmp r7, #0x77000000 bne reg2_error_loop cmp r8, #0x88000000 bne reg2_error_loop cmp r9, #0x99000000 bne reg2_error_loop cmp r10, #0xAA000000 bne reg2_error_loop cmp r11, #0xBB000000 bne reg2_error_loop cmp r12, #0xCC000000 bne reg2_error_loop cmp r14, #0xEE000000 bne reg2_error_loop /* Everything passed, increment the loop counter. */ push { r0-r1 } ldr r0, =ulRegTest2LoopCounter ldr r1, [r0] adds r1, r1, #1 str r1, [r0] pop { r0-r1 } /* Start again. */ b reg2_loop reg2_error_loop: /* If this line is hit then there was an error in a core register value. The loop ensures the loop counter stops incrementing. */ b reg2_error_loop nop .end
{ "pile_set_name": "Github" }
package aws import ( "encoding/base64" "fmt" "log" "strings" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ecr" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) func dataSourceAwsEcrAuthorizationToken() *schema.Resource { return &schema.Resource{ Read: dataSourceAwsEcrAuthorizationTokenRead, Schema: map[string]*schema.Schema{ "registry_id": { Type: schema.TypeString, Optional: true, }, "authorization_token": { Type: schema.TypeString, Computed: true, Sensitive: true, }, "proxy_endpoint": { Type: schema.TypeString, Computed: true, }, "expires_at": { Type: schema.TypeString, Computed: true, }, "user_name": { Type: schema.TypeString, Computed: true, }, "password": { Type: schema.TypeString, Computed: true, Sensitive: true, }, }, } } func dataSourceAwsEcrAuthorizationTokenRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ecrconn params := &ecr.GetAuthorizationTokenInput{} if v, ok := d.GetOk("registry_id"); ok && len(v.(string)) > 0 { params.RegistryIds = []*string{aws.String(v.(string))} } log.Printf("[DEBUG] Getting ECR authorization token") out, err := conn.GetAuthorizationToken(params) if err != nil { return fmt.Errorf("error getting ECR authorization token: %s", err) } log.Printf("[DEBUG] Received ECR AuthorizationData %v", out.AuthorizationData) authorizationData := out.AuthorizationData[0] authorizationToken := aws.StringValue(authorizationData.AuthorizationToken) expiresAt := aws.TimeValue(authorizationData.ExpiresAt).Format(time.RFC3339) proxyEndpoint := aws.StringValue(authorizationData.ProxyEndpoint) authBytes, err := base64.URLEncoding.DecodeString(authorizationToken) if err != nil { d.SetId("") return fmt.Errorf("error decoding ECR authorization token: %s", err) } basicAuthorization := strings.Split(string(authBytes), ":") if len(basicAuthorization) != 2 { return fmt.Errorf("unknown ECR authorization token format") } userName := basicAuthorization[0] password := basicAuthorization[1] d.SetId(time.Now().UTC().String()) d.Set("authorization_token", authorizationToken) d.Set("proxy_endpoint", proxyEndpoint) d.Set("expires_at", expiresAt) d.Set("user_name", userName) d.Set("password", password) return nil }
{ "pile_set_name": "Github" }
// otlib // set to create pre-compiled header file! #include <stdafx.hpp>
{ "pile_set_name": "Github" }
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientauthentication import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name use in this package const GroupName = "client.authentication.k8s.io" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} // Kind takes an unqualified kind and returns a Group qualified GroupKind func Kind(kind string) schema.GroupKind { return SchemeGroupVersion.WithKind(kind).GroupKind() } // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() } var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &ExecCredential{}, ) return nil }
{ "pile_set_name": "Github" }
# Maintainer: acxz <akashpatel2008 at yahoo dot com> pkgname=rocm-debug-agent pkgver=3.7.0 pkgrel=1 pkgdesc="ROCr Debug Agent Library" arch=('x86_64') url="https://github.com/ROCm-Developer-Tools/rocr_debug_agent" license=('custom:NCSAOSL') depends=('hip-rocclr' 'rocm-dbgapi' 'glibc') makedepends=('cmake' 'git') options=(!staticlibs strip) source=("$pkgname-$pkgver.tar.gz::$url/archive/roc-$pkgver.tar.gz") sha256sums=('d0f442a2b224a734b0080c906f0fc3066a698e5cde9ff97ffeb485b36d2caba1') _dirname="$(basename "$url")-$(basename "${source[0]}" ".tar.gz")" build() { cmake -Wno-dev -S "$_dirname" \ -DCMAKE_INSTALL_PREFIX=/opt/rocm/rocr_debug_agent make } package() { make DESTDIR="$pkgdir" install }
{ "pile_set_name": "Github" }
<!DOCTYPE HTML> <title>Testcase, bug 462844</title> <div style="position: relative"> <div style="display:inline"> <div style="height: 100px"></div> <div style="background: aqua; height: 20px;"></div> <div style="display:block; position: absolute; top: auto; left: 0; background: yellow;">Should be just below aqua block</div> <div style="height: 100px"></div> </div> </div>
{ "pile_set_name": "Github" }
<div class="panel panel-default"> <div class="panel-heading"> <span class="glyphicon glyphicon-user"></span> <strong> 关于博主 </strong> </div> <div class="panel-body"> <div class="text-center"> <img id="img-ymz" src="~/content/images/ymz.jpg" alt="衣明志" class="img-circle" /> </div> <h3 class="text-center"> <a href="http://weibo.com/qihangnet"> @@衣明志 </a> </h3> <div> <a href="http://generpoint.com/" target="_blank">GenerPoint</a> 创始人,曾连任9年微软最有价值专家( <a href="http://mvp.microsoft.com/zh-cn/" target="_blank">MVP</a>), <a href="http://www.msdn.com/" target="_blank">MSDN</a> 特约讲师 </div> </div> </div>
{ "pile_set_name": "Github" }
/** * eCryptfs: Linux filesystem encryption layer * Copyright (c) 2015, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * 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. */ #include <linux/string.h> #include <linux/ecryptfs.h> #include <linux/mutex.h> #include <linux/types.h> #include <linux/slab.h> #include <linux/pagemap.h> #include <linux/random.h> #include "ecryptfs_kernel.h" static DEFINE_MUTEX(events_mutex); struct ecryptfs_events *events_ptr = NULL; static int handle; void ecryptfs_free_events(void) { mutex_lock(&events_mutex); if (events_ptr != NULL) { kfree(events_ptr); events_ptr = NULL; } mutex_unlock(&events_mutex); } /** * Register to ecryptfs events, by passing callback * functions to be called upon events occurence. * The function returns a handle to be passed * to unregister function. */ int ecryptfs_register_to_events(struct ecryptfs_events *ops) { int ret_value = 0; if (!ops) return -EINVAL; mutex_lock(&events_mutex); if (events_ptr != NULL) { ecryptfs_printk(KERN_ERR, "already registered!\n"); ret_value = -EPERM; goto out; } events_ptr = kzalloc(sizeof(struct ecryptfs_events), GFP_KERNEL); if (!events_ptr) { ecryptfs_printk(KERN_ERR, "malloc failure\n"); ret_value = -ENOMEM; goto out; } /* copy the callbacks */ events_ptr->open_cb = ops->open_cb; events_ptr->release_cb = ops->release_cb; events_ptr->encrypt_cb = ops->encrypt_cb; events_ptr->decrypt_cb = ops->decrypt_cb; events_ptr->is_cipher_supported_cb = ops->is_cipher_supported_cb; events_ptr->is_hw_crypt_cb = ops->is_hw_crypt_cb; events_ptr->get_salt_key_size_cb = ops->get_salt_key_size_cb; get_random_bytes(&handle, sizeof(handle)); ret_value = handle; out: mutex_unlock(&events_mutex); return ret_value; } /** * Unregister from ecryptfs events. */ int ecryptfs_unregister_from_events(int user_handle) { int ret_value = 0; mutex_lock(&events_mutex); if (!events_ptr) { ret_value = -EINVAL; goto out; } if (user_handle != handle) { ret_value = ECRYPTFS_INVALID_EVENTS_HANDLE; goto out; } kfree(events_ptr); events_ptr = NULL; out: mutex_unlock(&events_mutex); return ret_value; } /** * This function decides whether the passed file offset * belongs to ecryptfs metadata or not. * The caller must pass ecryptfs data, which was received in one * of the callback invocations. */ bool ecryptfs_is_page_in_metadata(void *data, pgoff_t offset) { struct ecryptfs_crypt_stat *stat = NULL; bool ret = true; if (!data) { ecryptfs_printk(KERN_ERR, "ecryptfs_is_page_in_metadata: invalid data parameter\n"); ret = false; goto end; } stat = (struct ecryptfs_crypt_stat *)data; if (stat->flags & ECRYPTFS_METADATA_IN_XATTR) { ret = false; goto end; } if (offset >= (stat->metadata_size/PAGE_CACHE_SIZE)) { ret = false; goto end; } end: return ret; } /** * Given two ecryptfs data, the function * decides whether they are equal. */ inline bool ecryptfs_is_data_equal(void *data1, void *data2) { /* pointer comparison*/ return data1 == data2; } /** * Given ecryptfs data, the function * returns appropriate key size. */ size_t ecryptfs_get_key_size(void *data) { struct ecryptfs_crypt_stat *stat = NULL; if (!data) return 0; stat = (struct ecryptfs_crypt_stat *)data; return stat->key_size; } /** * Given ecryptfs data, the function * returns appropriate salt size. * * !!! crypt_stat cipher name and mode must be initialized */ size_t ecryptfs_get_salt_size(void *data) { struct ecryptfs_crypt_stat *stat = NULL; unsigned char final[2*ECRYPTFS_MAX_CIPHER_NAME_SIZE+1]; if (!data) { ecryptfs_printk(KERN_ERR, "ecryptfs_get_salt_size: invalid data parameter\n"); return 0; } stat = (struct ecryptfs_crypt_stat *)data; return ecryptfs_get_salt_size_for_cipher( ecryptfs_get_full_cipher(stat->cipher, stat->cipher_mode, final, sizeof(final))); } /** * Given ecryptfs data, the function * returns appropriate cipher. */ const unsigned char *ecryptfs_get_cipher(void *data) { unsigned char final[2*ECRYPTFS_MAX_CIPHER_NAME_SIZE+1]; struct ecryptfs_crypt_stat *stat = NULL; if (!data) { ecryptfs_printk(KERN_ERR, "ecryptfs_get_cipher: invalid data parameter\n"); return NULL; } stat = (struct ecryptfs_crypt_stat *)data; return ecryptfs_get_full_cipher(stat->cipher, stat->cipher_mode, final, sizeof(final)); } /** * Given ecryptfs data, the function * returns file encryption key. */ const unsigned char *ecryptfs_get_key(void *data) { struct ecryptfs_crypt_stat *stat = NULL; if (!data) { ecryptfs_printk(KERN_ERR, "ecryptfs_get_key: invalid data parameter\n"); return NULL; } stat = (struct ecryptfs_crypt_stat *)data; return stat->key; } /** * Given ecryptfs data, the function * returns file encryption salt. */ const unsigned char *ecryptfs_get_salt(void *data) { struct ecryptfs_crypt_stat *stat = NULL; if (!data) { ecryptfs_printk(KERN_ERR, "ecryptfs_get_salt: invalid data parameter\n"); return NULL; } stat = (struct ecryptfs_crypt_stat *)data; return stat->key + ecryptfs_get_salt_size(data); } /** * Returns ecryptfs events pointer */ inline struct ecryptfs_events *get_events(void) { return events_ptr; } /** * If external crypto module requires salt in addition to key, * we store it as part of key array (if there is enough space) * Checks whether a salt key can fit into array allocated for * regular key */ bool ecryptfs_check_space_for_salt(const size_t key_size, const size_t salt_size) { if ((salt_size + key_size) > ECRYPTFS_MAX_KEY_BYTES) return false; return true; } /* * If there is salt that is used by external crypto module, it is stored * in the same array where regular key is. Salt is going to be used by * external crypto module only, so for all internal crypto operations salt * should be ignored. * * Get key size in cases where it is going to be used for data encryption * or for all other general purposes */ size_t ecryptfs_get_key_size_to_enc_data( struct ecryptfs_crypt_stat *crypt_stat) { if (!crypt_stat) return 0; return crypt_stat->key_size; } /* * If there is salt that is used by external crypto module, it is stored * in the same array where regular key is. Salt is going to be used by * external crypto module only, but we still need to save and restore it * (in encrypted form) as part of ecryptfs header along with the regular * key. * * Get key size in cases where it is going to be stored persistently * * !!! crypt_stat cipher name and mode must be initialized */ size_t ecryptfs_get_key_size_to_store_key( struct ecryptfs_crypt_stat *crypt_stat) { size_t salt_size = 0; if (!crypt_stat) return 0; salt_size = ecryptfs_get_salt_size(crypt_stat); if (!ecryptfs_check_space_for_salt(crypt_stat->key_size, salt_size)) { ecryptfs_printk(KERN_WARNING, "ecryptfs_get_key_size_to_store_key: not enough space for salt\n"); return crypt_stat->key_size; } return crypt_stat->key_size + salt_size; } /* * If there is salt that is used by external crypto module, it is stored * in the same array where regular key is. Salt is going to be used by * external crypto module only, but we still need to save and restore it * (in encrypted form) as part of ecryptfs header along with the regular * key. * * Get key size in cases where it is going to be restored from storage * * !!! crypt_stat cipher name and mode must be initialized */ size_t ecryptfs_get_key_size_to_restore_key(size_t stored_key_size, const char *cipher) { size_t salt_size = 0; if (!cipher) return 0; salt_size = ecryptfs_get_salt_size_for_cipher(cipher); if (salt_size >= stored_key_size) { ecryptfs_printk(KERN_WARNING, "ecryptfs_get_key_size_to_restore_key: salt %zu >= stred size %zu\n", salt_size, stored_key_size); return stored_key_size; } return stored_key_size - salt_size; } /** * Given cipher, the function returns appropriate salt size. */ size_t ecryptfs_get_salt_size_for_cipher(const char *cipher) { if (!get_events() || !(get_events()->get_salt_key_size_cb)) return 0; return get_events()->get_salt_key_size_cb(cipher); }
{ "pile_set_name": "Github" }
package com.nikoyuwono.toolbarpanel.sample; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.TextView; import com.nikoyuwono.toolbarpanel.ToolbarPanelLayout; public class SampleActivity extends Activity { private ToolbarPanelLayout toolbarPanelLayout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sample); toolbarPanelLayout = (ToolbarPanelLayout) findViewById( R.id.sliding_down_toolbar_layout); TextView openButton = (TextView) findViewById(R.id.open_button); TextView closeButton = (TextView) findViewById(R.id.close_button); openButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { toolbarPanelLayout.openPanel(); } }); closeButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { toolbarPanelLayout.closePanel(); } }); } }
{ "pile_set_name": "Github" }
class Build constructor: (@singool) -> description: 'Build Layout, JS and CSS' run: => @singool.build() module.exports = Build
{ "pile_set_name": "Github" }
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package text import ( "math" "math/bits" "strconv" "strings" "unicode/utf8" "google.golang.org/protobuf/internal/detrand" "google.golang.org/protobuf/internal/errors" ) // encType represents an encoding type. type encType uint8 const ( _ encType = (1 << iota) / 2 name scalar messageOpen messageClose ) // Encoder provides methods to write out textproto constructs and values. The user is // responsible for producing valid sequences of constructs and values. type Encoder struct { encoderState indent string newline string // set to "\n" if len(indent) > 0 delims [2]byte outputASCII bool } type encoderState struct { lastType encType indents []byte out []byte } // NewEncoder returns an Encoder. // // If indent is a non-empty string, it causes every entry in a List or Message // to be preceded by the indent and trailed by a newline. // // If delims is not the zero value, it controls the delimiter characters used // for messages (e.g., "{}" vs "<>"). // // If outputASCII is true, strings will be serialized in such a way that // multi-byte UTF-8 sequences are escaped. This property ensures that the // overall output is ASCII (as opposed to UTF-8). func NewEncoder(indent string, delims [2]byte, outputASCII bool) (*Encoder, error) { e := &Encoder{} if len(indent) > 0 { if strings.Trim(indent, " \t") != "" { return nil, errors.New("indent may only be composed of space and tab characters") } e.indent = indent e.newline = "\n" } switch delims { case [2]byte{0, 0}: e.delims = [2]byte{'{', '}'} case [2]byte{'{', '}'}, [2]byte{'<', '>'}: e.delims = delims default: return nil, errors.New("delimiters may only be \"{}\" or \"<>\"") } e.outputASCII = outputASCII return e, nil } // Bytes returns the content of the written bytes. func (e *Encoder) Bytes() []byte { return e.out } // StartMessage writes out the '{' or '<' symbol. func (e *Encoder) StartMessage() { e.prepareNext(messageOpen) e.out = append(e.out, e.delims[0]) } // EndMessage writes out the '}' or '>' symbol. func (e *Encoder) EndMessage() { e.prepareNext(messageClose) e.out = append(e.out, e.delims[1]) } // WriteName writes out the field name and the separator ':'. func (e *Encoder) WriteName(s string) { e.prepareNext(name) e.out = append(e.out, s...) e.out = append(e.out, ':') } // WriteBool writes out the given boolean value. func (e *Encoder) WriteBool(b bool) { if b { e.WriteLiteral("true") } else { e.WriteLiteral("false") } } // WriteString writes out the given string value. func (e *Encoder) WriteString(s string) { e.prepareNext(scalar) e.out = appendString(e.out, s, e.outputASCII) } func appendString(out []byte, in string, outputASCII bool) []byte { out = append(out, '"') i := indexNeedEscapeInString(in) in, out = in[i:], append(out, in[:i]...) for len(in) > 0 { switch r, n := utf8.DecodeRuneInString(in); { case r == utf8.RuneError && n == 1: // We do not report invalid UTF-8 because strings in the text format // are used to represent both the proto string and bytes type. r = rune(in[0]) fallthrough case r < ' ' || r == '"' || r == '\\': out = append(out, '\\') switch r { case '"', '\\': out = append(out, byte(r)) case '\n': out = append(out, 'n') case '\r': out = append(out, 'r') case '\t': out = append(out, 't') default: out = append(out, 'x') out = append(out, "00"[1+(bits.Len32(uint32(r))-1)/4:]...) out = strconv.AppendUint(out, uint64(r), 16) } in = in[n:] case outputASCII && r >= utf8.RuneSelf: out = append(out, '\\') if r <= math.MaxUint16 { out = append(out, 'u') out = append(out, "0000"[1+(bits.Len32(uint32(r))-1)/4:]...) out = strconv.AppendUint(out, uint64(r), 16) } else { out = append(out, 'U') out = append(out, "00000000"[1+(bits.Len32(uint32(r))-1)/4:]...) out = strconv.AppendUint(out, uint64(r), 16) } in = in[n:] default: i := indexNeedEscapeInString(in[n:]) in, out = in[n+i:], append(out, in[:n+i]...) } } out = append(out, '"') return out } // indexNeedEscapeInString returns the index of the character that needs // escaping. If no characters need escaping, this returns the input length. func indexNeedEscapeInString(s string) int { for i := 0; i < len(s); i++ { if c := s[i]; c < ' ' || c == '"' || c == '\'' || c == '\\' || c >= utf8.RuneSelf { return i } } return len(s) } // WriteFloat writes out the given float value for given bitSize. func (e *Encoder) WriteFloat(n float64, bitSize int) { e.prepareNext(scalar) e.out = appendFloat(e.out, n, bitSize) } func appendFloat(out []byte, n float64, bitSize int) []byte { switch { case math.IsNaN(n): return append(out, "nan"...) case math.IsInf(n, +1): return append(out, "inf"...) case math.IsInf(n, -1): return append(out, "-inf"...) default: return strconv.AppendFloat(out, n, 'g', -1, bitSize) } } // WriteInt writes out the given signed integer value. func (e *Encoder) WriteInt(n int64) { e.prepareNext(scalar) e.out = append(e.out, strconv.FormatInt(n, 10)...) } // WriteUint writes out the given unsigned integer value. func (e *Encoder) WriteUint(n uint64) { e.prepareNext(scalar) e.out = append(e.out, strconv.FormatUint(n, 10)...) } // WriteLiteral writes out the given string as a literal value without quotes. // This is used for writing enum literal strings. func (e *Encoder) WriteLiteral(s string) { e.prepareNext(scalar) e.out = append(e.out, s...) } // prepareNext adds possible space and indentation for the next value based // on last encType and indent option. It also updates e.lastType to next. func (e *Encoder) prepareNext(next encType) { defer func() { e.lastType = next }() // Single line. if len(e.indent) == 0 { // Add space after each field before the next one. if e.lastType&(scalar|messageClose) != 0 && next == name { e.out = append(e.out, ' ') // Add a random extra space to make output unstable. if detrand.Bool() { e.out = append(e.out, ' ') } } return } // Multi-line. switch { case e.lastType == name: e.out = append(e.out, ' ') // Add a random extra space after name: to make output unstable. if detrand.Bool() { e.out = append(e.out, ' ') } case e.lastType == messageOpen && next != messageClose: e.indents = append(e.indents, e.indent...) e.out = append(e.out, '\n') e.out = append(e.out, e.indents...) case e.lastType&(scalar|messageClose) != 0: if next == messageClose { e.indents = e.indents[:len(e.indents)-len(e.indent)] } e.out = append(e.out, '\n') e.out = append(e.out, e.indents...) } } // Snapshot returns the current snapshot for use in Reset. func (e *Encoder) Snapshot() encoderState { return e.encoderState } // Reset resets the Encoder to the given encoderState from a Snapshot. func (e *Encoder) Reset(es encoderState) { e.encoderState = es }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <title>Filter by zoom range | CARTO</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta charset="UTF-8"> <meta name="robots" content="noindex"> <script src="../../dist/carto-vl.js"></script> <script src="https://api.tiles.mapbox.com/mapbox-gl-js/v1.0.0/mapbox-gl.js"></script> <link href="https://api.tiles.mapbox.com/mapbox-gl-js/v1.0.0/mapbox-gl.css" rel="stylesheet" /> <link rel="stylesheet" type="text/css" href="../style.css"> </head> <body> <div id="map"></div> <aside class="toolbox"> <div class="box"> <header> <h1>Filter features by zoom</h1> </header> <section> <p class="description open-sans">Set the visibility of features with a zoom range filter</p> </section> <footer class="js-footer"></footer> </div> </aside> <div id="loader"> <div class="CDB-LoaderIcon CDB-LoaderIcon--big"> <svg class="CDB-LoaderIcon-spinner" viewBox="0 0 50 50"> <circle class="CDB-LoaderIcon-path" cx="25" cy="25" r="20" fill="none"></circle> </svg> </div> </div> <script> const map = new mapboxgl.Map({ container: 'map', style: carto.basemaps.darkmatter, center: [-123.1103, 49.2450], zoom: 12, scrollZoom: false }); const nav = new mapboxgl.NavigationControl({ showCompass: false }); map.addControl(nav, 'top-left'); map.addControl(new mapboxgl.FullscreenControl(), 'top-left'); carto.setDefaultAuth({ username: 'cartovl', apiKey: 'default_public' }); const source = new carto.source.Dataset('vancouver_trees'); const viz = new carto.Viz(` filter: ramp(zoomrange([12,13,14,15,16]), [$diameter > 40, $diameter > 30, $diameter > 20, $diameter > 10, true] ) width: 5 `); const layer = new carto.Layer('layer', source, viz); layer.addTo(map, 'watername_ocean'); layer.on('loaded', hideLoader); function hideLoader() { document.getElementById('loader').style.opacity = '0'; } </script> </body> </html>
{ "pile_set_name": "Github" }
# Tenko parser autogenerated test case - From: tests/testcases/assigns/to_keyword/autogen.md - Path: tests/testcases/assigns/to_keyword/gen/assign_to_paren-wrapped_keyword_var_inside_delete_in_param_default/static.md > :: assigns : to keyword : gen : assign to paren-wrapped keyword var inside delete in param default > > ::> static ## Input `````js (x = delete ((static) = f)) => {} ````` ## Output _Note: the whole output block is auto-generated. Manual changes will be overwritten!_ Below follow outputs in five parsing modes: sloppy, sloppy+annexb, strict script, module, module+annexb. Note that the output parts are auto-generated by the test runner to reflect actual result. ### Sloppy mode Parsed with script goal and as if the code did not start with strict mode header. ````` ast: { type: 'Program', loc:{start:{line:1,column:0},end:{line:1,column:33},source:''}, body: [ { type: 'ExpressionStatement', loc:{start:{line:1,column:0},end:{line:1,column:33},source:''}, expression: { type: 'ArrowFunctionExpression', loc:{start:{line:1,column:0},end:{line:1,column:33},source:''}, params: [ { type: 'AssignmentPattern', loc:{start:{line:1,column:1},end:{line:1,column:26},source:''}, left: { type: 'Identifier', loc:{start:{line:1,column:1},end:{line:1,column:2},source:''}, name: 'x' }, right: { type: 'UnaryExpression', loc:{start:{line:1,column:5},end:{line:1,column:26},source:''}, operator: 'delete', prefix: true, argument: { type: 'AssignmentExpression', loc:{start:{line:1,column:13},end:{line:1,column:25},source:''}, left: { type: 'Identifier', loc:{start:{line:1,column:14},end:{line:1,column:20},source:''}, name: 'static' }, operator: '=', right: { type: 'Identifier', loc:{start:{line:1,column:24},end:{line:1,column:25},source:''}, name: 'f' } } } } ], id: null, generator: false, async: false, expression: false, body: { type: 'BlockStatement', loc:{start:{line:1,column:31},end:{line:1,column:33},source:''}, body: [] } } } ] } tokens (17x): PUNC_PAREN_OPEN IDENT PUNC_EQ ID_delete PUNC_PAREN_OPEN PUNC_PAREN_OPEN ID_static PUNC_PAREN_CLOSE PUNC_EQ IDENT PUNC_PAREN_CLOSE PUNC_PAREN_CLOSE PUNC_EQ_GT PUNC_CURLY_OPEN PUNC_CURLY_CLOSE ASI ````` ### Strict mode Parsed with script goal but as if it was starting with `"use strict"` at the top. ````` throws: Parser error! Cannot use this name (`static`) as a variable name because: `static` is a reserved word in strict mode start@1:0, error@1:14 ╔══╦═════════════════ 1 ║ (x = delete ((static) = f)) => {} ║ ^^^^^^------- error ╚══╩═════════════════ ````` ### Module goal Parsed with the module goal. _Output same as strict mode._ ### Sloppy mode with AnnexB Parsed with script goal with AnnexB rules enabled and as if the code did not start with strict mode header. _Output same as sloppy mode._ ### Module goal with AnnexB Parsed with the module goal with AnnexB rules enabled. _Output same as strict mode._ ## AST Printer Printer output different from input [sloppy][annexb:no]: ````js (x = delete (static = f)) => {}; ```` Produces same AST
{ "pile_set_name": "Github" }
<template> <div :class="'slide-wrap ' + (touching ? 'touching' : '')" v-show="showWrap" v-swipe:start="slideStart" v-swipe:move="slideMove" v-swipe:end="slideEnd"> <overlay :show="mutableShow" :click="close" :opacity="opacity"></overlay> <transition name="side"> <div class="side" v-show="mutableShow"> <div class="panel" v-bind:style="{ transform: 'translate3d('+x+'px, 0, 0)' }"> <slot></slot> </div> </div> </transition> </div> </template> <script> import Overlay from '../overlay' export default { components: { Overlay }, props: { show: { type: Boolean, default: false } }, data () { return { mutableShow: false, width: 0, showWrap: false, touching: false, x: 0, opacity: 1 } }, watch: { mutableShow (v, ov) { if (v === true) { this.x = 0 this.showWrap = v } else { setTimeout(() => { this.showWrap = v }, 300) } } }, methods: { slideStart (point) { this.width = this.$el.querySelector('.side').getBoundingClientRect().width this.touching = true }, slideMove (point, diff, time) { if (diff.x > 0) { } else { this.x = -Math.pow(-diff.x, 0.9) this.opacity = (this.width - Math.abs(this.x)) / this.width } }, slideEnd (point, diff, time) { this.touching = false if (((this.x < 0) && Math.abs(this.x) > 80) || (Math.abs(this.x) > 20 && time < 200)) { this.mutableShow = false } else { this.x = 0 } this.opacity = 1 }, open () { this.mutableShow = true this.$emit('open', this) }, close () { this.mutableShow = false this.$emit('close', this) } }, mounted () { } } </script> <style lang="less" scoped> @import './side.less'; </style>
{ "pile_set_name": "Github" }
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_board.h +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_board.h @@ -1,6 +1,8 @@ #ifndef BCM63XX_BOARD_H_ #define BCM63XX_BOARD_H_ +#include <asm/bootinfo.h> + const char *board_get_name(void); void board_prom_init(void); @@ -9,4 +11,8 @@ void board_setup(void); int board_register_devices(void); +static inline bool bcm63xx_is_cfe_present(void) { + return fw_arg3 == 0x43464531; +} + #endif /* ! BCM63XX_BOARD_H_ */
{ "pile_set_name": "Github" }
//Illustration of set operations #include<iostream> #include<set> #include<vector> using namespace std; void display(set<int> s) { set<int>::iterator i; for(i = s.begin(); i != s.end(); i++) cout<<*i<<endl; cout<<endl; } int main() { set<int> s; s.insert(10); s.insert(20); s.insert(30); s.insert(15); display(s); s.erase(s.find(20)); vector<int> v; v.push_back(18); v.push_back(20); v.push_back(30); s.insert(v.begin(),v.end()); display(s); set<int> s1; s1.insert(s.begin(),s.end()); display(s1); getchar(); }
{ "pile_set_name": "Github" }
Markdown: Syntax ================ <ul id="ProjectSubmenu"> <li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li> <li><a href="/projects/markdown/basics" title="Markdown Basics">Basics</a></li> <li><a class="selected" title="Markdown Syntax Documentation">Syntax</a></li> <li><a href="/projects/markdown/license" title="Pricing and License Information">License</a></li> <li><a href="/projects/markdown/dingus" title="Online Markdown Web Form">Dingus</a></li> </ul> * [Overview](#overview) * [Philosophy](#philosophy) * [Inline HTML](#html) * [Automatic Escaping for Special Characters](#autoescape) * [Block Elements](#block) * [Paragraphs and Line Breaks](#p) * [Headers](#header) * [Blockquotes](#blockquote) * [Lists](#list) * [Code Blocks](#precode) * [Horizontal Rules](#hr) * [Span Elements](#span) * [Links](#link) * [Emphasis](#em) * [Code](#code) * [Images](#img) * [Miscellaneous](#misc) * [Backslash Escapes](#backslash) * [Automatic Links](#autolink) **Note:** This document is itself written using Markdown; you can [see the source for it by adding '.text' to the URL][src]. [src]: /projects/markdown/syntax.text * * * <h2 id="overview">Overview</h2> <h3 id="philosophy">Philosophy</h3> Markdown is intended to be as easy-to-read and easy-to-write as is feasible. Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it's been marked up with tags or formatting instructions. While Markdown's syntax has been influenced by several existing text-to-HTML filters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4], [Grutatext] [5], and [EtText] [6] -- the single biggest source of inspiration for Markdown's syntax is the format of plain text email. [1]: http://docutils.sourceforge.net/mirror/setext.html [2]: http://www.aaronsw.com/2002/atx/ [3]: http://textism.com/tools/textile/ [4]: http://docutils.sourceforge.net/rst.html [5]: http://www.triptico.com/software/grutatxt.html [6]: http://ettext.taint.org/doc/ To this end, Markdown's syntax is comprised entirely of punctuation characters, which punctuation characters have been carefully chosen so as to look like what they mean. E.g., asterisks around a word actually look like \*emphasis\*. Markdown lists look like, well, lists. Even blockquotes look like quoted passages of text, assuming you've ever used email. <h3 id="html">Inline HTML</h3> Markdown's syntax is intended for one purpose: to be used as a format for *writing* for the web. Markdown is not a replacement for HTML, or even close to it. Its syntax is very small, corresponding only to a very small subset of HTML tags. The idea is *not* to create a syntax that makes it easier to insert HTML tags. In my opinion, HTML tags are already easy to insert. The idea for Markdown is to make it easy to read, write, and edit prose. HTML is a *publishing* format; Markdown is a *writing* format. Thus, Markdown's formatting syntax only addresses issues that can be conveyed in plain text. For any markup that is not covered by Markdown's syntax, you simply use HTML itself. There's no need to preface it or delimit it to indicate that you're switching from Markdown to HTML; you just use the tags. The only restrictions are that block-level HTML elements -- e.g. `<div>`, `<table>`, `<pre>`, `<p>`, etc. -- must be separated from surrounding content by blank lines, and the start and end tags of the block should not be indented with tabs or spaces. Markdown is smart enough not to add extra (unwanted) `<p>` tags around HTML block-level tags. For example, to add an HTML table to a Markdown article: This is a regular paragraph. <table> <tr> <td>Foo</td> </tr> </table> This is another regular paragraph. Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an HTML block. Span-level HTML tags -- e.g. `<span>`, `<cite>`, or `<del>` -- can be used anywhere in a Markdown paragraph, list item, or header. If you want, you can even use HTML tags instead of Markdown formatting; e.g. if you'd prefer to use HTML `<a>` or `<img>` tags instead of Markdown's link or image syntax, go right ahead. Unlike block-level HTML tags, Markdown syntax *is* processed within span-level tags. <h3 id="autoescape">Automatic Escaping for Special Characters</h3> In HTML, there are two characters that demand special treatment: `<` and `&`. Left angle brackets are used to start tags; ampersands are used to denote HTML entities. If you want to use them as literal characters, you must escape them as entities, e.g. `&lt;`, and `&amp;`. Ampersands in particular are bedeviling for web writers. If you want to write about 'AT&T', you need to write '`AT&amp;T`'. You even need to escape ampersands within URLs. Thus, if you want to link to: http://images.google.com/images?num=30&q=larry+bird you need to encode the URL as: http://images.google.com/images?num=30&amp;q=larry+bird in your anchor tag `href` attribute. Needless to say, this is easy to forget, and is probably the single most common source of HTML validation errors in otherwise well-marked-up web sites. Markdown allows you to use these characters naturally, taking care of all the necessary escaping for you. If you use an ampersand as part of an HTML entity, it remains unchanged; otherwise it will be translated into `&amp;`. So, if you want to include a copyright symbol in your article, you can write: &copy; and Markdown will leave it alone. But if you write: AT&T Markdown will translate it to: AT&amp;T Similarly, because Markdown supports [inline HTML](#html), if you use angle brackets as delimiters for HTML tags, Markdown will treat them as such. But if you write: 4 < 5 Markdown will translate it to: 4 &lt; 5 However, inside Markdown code spans and blocks, angle brackets and ampersands are *always* encoded automatically. This makes it easy to use Markdown to write about HTML code. (As opposed to raw HTML, which is a terrible format for writing about HTML syntax, because every single `<` and `&` in your example code needs to be escaped.) * * * <h2 id="block">Block Elements</h2> <h3 id="p">Paragraphs and Line Breaks</h3> A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line -- a line containing nothing but spaces or tabs is considered blank.) Normal paragraphs should not be intended with spaces or tabs. The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard-wrapped" text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type's "Convert Line Breaks" option) which translate every line break character in a paragraph into a `<br />` tag. When you *do* want to insert a `<br />` break tag using Markdown, you end a line with two or more spaces, then type return. Yes, this takes a tad more effort to create a `<br />`, but a simplistic "every line break is a `<br />`" rule wouldn't work for Markdown. Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l] work best -- and look better -- when you format them with hard breaks. [bq]: #blockquote [l]: #list <h3 id="header">Headers</h3> Markdown supports two styles of headers, [Setext] [1] and [atx] [2]. Setext-style headers are "underlined" using equal signs (for first-level headers) and dashes (for second-level headers). For example: This is an H1 ============= This is an H2 ------------- Any number of underlining `=`'s or `-`'s will work. Atx-style headers use 1-6 hash characters at the start of the line, corresponding to header levels 1-6. For example: # This is an H1 ## This is an H2 ###### This is an H6 Optionally, you may "close" atx-style headers. This is purely cosmetic -- you can use this if you think it looks better. The closing hashes don't even need to match the number of hashes used to open the header. (The number of opening hashes determines the header level.) : # This is an H1 # ## This is an H2 ## ### This is an H3 ###### <h3 id="blockquote">Blockquotes</h3> Markdown uses email-style `>` characters for blockquoting. If you're familiar with quoting passages of text in an email message, then you know how to create a blockquote in Markdown. It looks best if you hard wrap the text and put a `>` before every line: > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. > > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse > id sem consectetuer libero luctus adipiscing. Markdown allows you to be lazy and only put the `>` before the first line of a hard-wrapped paragraph: > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by adding additional levels of `>`: > This is the first level of quoting. > > > This is nested blockquote. > > Back to the first level. Blockquotes can contain other Markdown elements, including headers, lists, and code blocks: > ## This is a header. > > 1. This is the first list item. > 2. This is the second list item. > > Here's some example code: > > return shell_exec("echo $input | $markdown_script"); Any decent text editor should make email-style quoting easy. For example, with BBEdit, you can make a selection and choose Increase Quote Level from the Text menu. <h3 id="list">Lists</h3> Markdown supports ordered (numbered) and unordered (bulleted) lists. Unordered lists use asterisks, pluses, and hyphens -- interchangably -- as list markers: * Red * Green * Blue is equivalent to: + Red + Green + Blue and: - Red - Green - Blue Ordered lists use numbers followed by periods: 1. Bird 2. McHale 3. Parish It's important to note that the actual numbers you use to mark the list have no effect on the HTML output Markdown produces. The HTML Markdown produces from the above list is: <ol> <li>Bird</li> <li>McHale</li> <li>Parish</li> </ol> If you instead wrote the list in Markdown like this: 1. Bird 1. McHale 1. Parish or even: 3. Bird 1. McHale 8. Parish you'd get the exact same HTML output. The point is, if you want to, you can use ordinal numbers in your ordered Markdown lists, so that the numbers in your source match the numbers in your published HTML. But if you want to be lazy, you don't have to. If you do use lazy list numbering, however, you should still start the list with the number 1. At some point in the future, Markdown may support starting ordered lists at an arbitrary number. List markers typically start at the left margin, but may be indented by up to three spaces. List markers must be followed by one or more spaces or a tab. To make lists look nice, you can wrap items with hanging indents: * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. But if you want to be lazy, you don't have to: * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. If list items are separated by blank lines, Markdown will wrap the items in `<p>` tags in the HTML output. For example, this input: * Bird * Magic will turn into: <ul> <li>Bird</li> <li>Magic</li> </ul> But this: * Bird * Magic will turn into: <ul> <li><p>Bird</p></li> <li><p>Magic</p></li> </ul> List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be intended by either 4 spaces or one tab: 1. This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit. 2. Suspendisse id sem consectetuer libero luctus adipiscing. It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy: * This is a list item with two paragraphs. This is the second paragraph in the list item. You're only required to indent the first line. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. * Another item in the same list. To put a blockquote within a list item, the blockquote's `>` delimiters need to be indented: * A list item with a blockquote: > This is a blockquote > inside a list item. To put a code block within a list item, the code block needs to be indented *twice* -- 8 spaces or two tabs: * A list item with a code block: <code goes here> It's worth noting that it's possible to trigger an ordered list by accident, by writing something like this: 1986. What a great season. In other words, a *number-period-space* sequence at the beginning of a line. To avoid this, you can backslash-escape the period: 1986\. What a great season. <h3 id="precode">Code Blocks</h3> Pre-formatted code blocks are used for writing about programming or markup source code. Rather than forming normal paragraphs, the lines of a code block are interpreted literally. Markdown wraps a code block in both `<pre>` and `<code>` tags. To produce a code block in Markdown, simply indent every line of the block by at least 4 spaces or 1 tab. For example, given this input: This is a normal paragraph: This is a code block. Markdown will generate: <p>This is a normal paragraph:</p> <pre><code>This is a code block. </code></pre> One level of indentation -- 4 spaces or 1 tab -- is removed from each line of the code block. For example, this: Here is an example of AppleScript: tell application "Foo" beep end tell will turn into: <p>Here is an example of AppleScript:</p> <pre><code>tell application "Foo" beep end tell </code></pre> A code block continues until it reaches a line that is not indented (or the end of the article). Within a code block, ampersands (`&`) and angle brackets (`<` and `>`) are automatically converted into HTML entities. This makes it very easy to include example HTML source code using Markdown -- just paste it and indent it, and Markdown will handle the hassle of encoding the ampersands and angle brackets. For example, this: <div class="footer"> &copy; 2004 Foo Corporation </div> will turn into: <pre><code>&lt;div class="footer"&gt; &amp;copy; 2004 Foo Corporation &lt;/div&gt; </code></pre> Regular Markdown syntax is not processed within code blocks. E.g., asterisks are just literal asterisks within a code block. This means it's also easy to use Markdown to write about Markdown's own syntax. <h3 id="hr">Horizontal Rules</h3> You can produce a horizontal rule tag (`<hr />`) by placing three or more hyphens, asterisks, or underscores on a line by themselves. If you wish, you may use spaces between the hyphens or asterisks. Each of the following lines will produce a horizontal rule: * * * *** ***** - - - --------------------------------------- _ _ _ * * * <h2 id="span">Span Elements</h2> <h3 id="link">Links</h3> Markdown supports two style of links: *inline* and *reference*. In both styles, the link text is delimited by [square brackets]. To create an inline link, use a set of regular parentheses immediately after the link text's closing square bracket. Inside the parentheses, put the URL where you want the link to point, along with an *optional* title for the link, surrounded in quotes. For example: This is [an example](http://example.com/ "Title") inline link. [This link](http://example.net/) has no title attribute. Will produce: <p>This is <a href="http://example.com/" title="Title"> an example</a> inline link.</p> <p><a href="http://example.net/">This link</a> has no title attribute.</p> If you're referring to a local resource on the same server, you can use relative paths: See my [About](/about/) page for details. Reference-style links use a second set of square brackets, inside which you place a label of your choosing to identify the link: This is [an example][id] reference-style link. You can optionally use a space to separate the sets of brackets: This is [an example] [id] reference-style link. Then, anywhere in the document, you define your link label like this, on a line by itself: [id]: http://example.com/ "Optional Title Here" That is: * Square brackets containing the link identifier (optionally indented from the left margin using up to three spaces); * followed by a colon; * followed by one or more spaces (or tabs); * followed by the URL for the link; * optionally followed by a title attribute for the link, enclosed in double or single quotes. The link URL may, optionally, be surrounded by angle brackets: [id]: <http://example.com/> "Optional Title Here" You can put the title attribute on the next line and use extra spaces or tabs for padding, which tends to look better with longer URLs: [id]: http://example.com/longish/path/to/resource/here "Optional Title Here" Link definitions are only used for creating links during Markdown processing, and are stripped from your document in the HTML output. Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are *not* case sensitive. E.g. these two links: [link text][a] [link text][A] are equivalent. The *implicit link name* shortcut allows you to omit the name of the link, in which case the link text itself is used as the name. Just use an empty set of square brackets -- e.g., to link the word "Google" to the google.com web site, you could simply write: [Google][] And then define the link: [Google]: http://google.com/ Because link names may contain spaces, this shortcut even works for multiple words in the link text: Visit [Daring Fireball][] for more information. And then define the link: [Daring Fireball]: http://daringfireball.net/ Link definitions can be placed anywhere in your Markdown document. I tend to put them immediately after each paragraph in which they're used, but if you want, you can put them all at the end of your document, sort of like footnotes. Here's an example of reference links in action: I get 10 times more traffic from [Google] [1] than from [Yahoo] [2] or [MSN] [3]. [1]: http://google.com/ "Google" [2]: http://search.yahoo.com/ "Yahoo Search" [3]: http://search.msn.com/ "MSN Search" Using the implicit link name shortcut, you could instead write: I get 10 times more traffic from [Google][] than from [Yahoo][] or [MSN][]. [google]: http://google.com/ "Google" [yahoo]: http://search.yahoo.com/ "Yahoo Search" [msn]: http://search.msn.com/ "MSN Search" Both of the above examples will produce the following HTML output: <p>I get 10 times more traffic from <a href="http://google.com/" title="Google">Google</a> than from <a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p> For comparison, here is the same paragraph written using Markdown's inline link style: I get 10 times more traffic from [Google](http://google.com/ "Google") than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or [MSN](http://search.msn.com/ "MSN Search"). The point of reference-style links is not that they're easier to write. The point is that with reference-style links, your document source is vastly more readable. Compare the above examples: using reference-style links, the paragraph itself is only 81 characters long; with inline-style links, it's 176 characters; and as raw HTML, it's 234 characters. In the raw HTML, there's more markup than there is text. With Markdown's reference-style links, a source document much more closely resembles the final output, as rendered in a browser. By allowing you to move the markup-related metadata out of the paragraph, you can add links without interrupting the narrative flow of your prose. <h3 id="em">Emphasis</h3> Markdown treats asterisks (`*`) and underscores (`_`) as indicators of emphasis. Text wrapped with one `*` or `_` will be wrapped with an HTML `<em>` tag; double `*`'s or `_`'s will be wrapped with an HTML `<strong>` tag. E.g., this input: *single asterisks* _single underscores_ **double asterisks** __double underscores__ will produce: <em>single asterisks</em> <em>single underscores</em> <strong>double asterisks</strong> <strong>double underscores</strong> You can use whichever style you prefer; the lone restriction is that the same character must be used to open and close an emphasis span. Emphasis can be used in the middle of a word: un*fucking*believable But if you surround an `*` or `_` with spaces, it'll be treated as a literal asterisk or underscore. To produce a literal asterisk or underscore at a position where it would otherwise be used as an emphasis delimiter, you can backslash escape it: \*this text is surrounded by literal asterisks\* <h3 id="code">Code</h3> To indicate a span of code, wrap it with backtick quotes (`` ` ``). Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example: Use the `printf()` function. will produce: <p>Use the <code>printf()</code> function.</p> To include a literal backtick character within a code span, you can use multiple backticks as the opening and closing delimiters: ``There is a literal backtick (`) here.`` which will produce this: <p><code>There is a literal backtick (`) here.</code></p> The backtick delimiters surrounding a code span may include spaces -- one after the opening, one before the closing. This allows you to place literal backtick characters at the beginning or end of a code span: A single backtick in a code span: `` ` `` A backtick-delimited string in a code span: `` `foo` `` will produce: <p>A single backtick in a code span: <code>`</code></p> <p>A backtick-delimited string in a code span: <code>`foo`</code></p> With a code span, ampersands and angle brackets are encoded as HTML entities automatically, which makes it easy to include example HTML tags. Markdown will turn this: Please don't use any `<blink>` tags. into: <p>Please don't use any <code>&lt;blink&gt;</code> tags.</p> You can write this: `&#8212;` is the decimal-encoded equivalent of `&mdash;`. to produce: <p><code>&amp;#8212;</code> is the decimal-encoded equivalent of <code>&amp;mdash;</code>.</p> <h3 id="img">Images</h3> Admittedly, it's fairly difficult to devise a "natural" syntax for placing images into a plain text document format. Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: *inline* and *reference*. Inline image syntax looks like this: ![Alt text](/path/to/img.jpg) ![Alt text](/path/to/img.jpg "Optional title") That is: * An exclamation mark: `!`; * followed by a set of square brackets, containing the `alt` attribute text for the image; * followed by a set of parentheses, containing the URL or path to the image, and an optional `title` attribute enclosed in double or single quotes. Reference-style image syntax looks like this: ![Alt text][id] Where "id" is the name of a defined image reference. Image references are defined using syntax identical to link references: [id]: url/to/image "Optional title attribute" As of this writing, Markdown has no syntax for specifying the dimensions of an image; if this is important to you, you can simply use regular HTML `<img>` tags. * * * <h2 id="misc">Miscellaneous</h2> <h3 id="autolink">Automatic Links</h3> Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this: <http://example.com/> Markdown will turn this into: <a href="http://example.com/">http://example.com/</a> Automatic links for email addresses work similarly, except that Markdown will also perform a bit of randomized decimal and hex entity-encoding to help obscure your address from address-harvesting spambots. For example, Markdown will turn this: <[email protected]> into something like this: <a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65; &#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111; &#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61; &#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a> which will render in a browser as a clickable link to "[email protected]". (This sort of entity-encoding trick will indeed fool many, if not most, address-harvesting bots, but it definitely won't fool all of them. It's better than nothing, but an address published in this way will probably eventually start receiving spam.) <h3 id="backslash">Backslash Escapes</h3> Markdown allows you to use backslash escapes to generate literal characters which would otherwise have special meaning in Markdown's formatting syntax. For example, if you wanted to surround a word with literal asterisks (instead of an HTML `<em>` tag), you can backslashes before the asterisks, like this: \*literal asterisks\* Markdown provides backslash escapes for the following characters: \ backslash ` backtick * asterisk _ underscore {} curly braces [] square brackets () parentheses # hash mark + plus sign - minus sign (hyphen) . dot ! exclamation mark
{ "pile_set_name": "Github" }
<?php /** * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/ * CC-BY License - http://creativecommons.org/licenses/by/3.0/ */ require_once( BX_DIRECTORY_PATH_MODULES . $aModule['path'] . '/classes/' . $aModule['class_prefix'] . 'Module.php'); bx_import('BxDolPageView'); $oSpy = new BxSpyModule($aModule); // ** init some needed variables ; global $_page; global $_page_cont; //-- Define activity type --//; $sActivityType = ''; if(isset($_GET['spy_type']) ) { switch($_GET['spy_type']) { case 'profiles_activity' : $sActivityType = 'profiles_activity'; break; case 'content_activity' : $sActivityType = 'content_activity'; break; } } $iIndex = 0; $sPageCaption = _t('_bx_spy_notifications'); $GLOBALS['oTopMenu']->setCurrentProfileID($oSpy->iMemberId); $_page['name_index'] = $iIndex; $_page['header'] = $sPageCaption ; $_page['header_text'] = $sPageCaption ; $_page['css_name'] = 'spy.css'; $_page_cont[$iIndex]['page_main_code'] = $oSpy->getActivityPage($oSpy->iMemberId, $sActivityType); PageCode($oSpy -> _oTemplate);
{ "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. using Xunit; namespace ManagedTests.DynamicCSharp.Conformance.dynamic.statements.Null.nullable01.nullable01 { // <Description>Nullable invocation of GetValueOrDefault</Description> // <RelatedBugs></RelatedBugs> // <Expects status=success></Expects> // <Code> public class A { [Fact] public static void DynamicCSharpRunTest() { Assert.Equal(0, MainMethod()); } public static int MainMethod() { int? x = null; dynamic y = 0; var val1 = x.GetValueOrDefault((int)y); var val2 = x.Equals((int)y) ? 1 : 0; return val1 + val2; } } } namespace ManagedTests.DynamicCSharp.Conformance.dynamic.statements.Null.null002.null002 { public class Test { [Fact] public static void DynamicCSharpRunTest() { Assert.Equal(0, MainMethod(null)); } public static int MainMethod(string[] args) { dynamic d = 1; Test t = null; try { int i = t.Foo(d); } //catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException ex) //{ // bool ret = ErrorVerifier.Verify(RuntimeErrorId.NullReferenceOnMemberException, ex.Message); // Used to be NullReferenceException // Better error message - Cannot perform runtime binding on a null reference // But hard to validate // if (ret) // return 0; //} // change from Microsoft.CSharp.RuntimeBinder.RuntimeBinderException to System.NullReferenceException catch (System.NullReferenceException) { return 0; } return 1; } public int Foo(dynamic d) { return 1; } } // </Code> } namespace ManagedTests.DynamicCSharp.Conformance.dynamic.statements.Null.null003.null003 { public class Test { [Fact] public static void DynamicCSharpRunTest() { Assert.Equal(0, MainMethod(null)); } public static int MainMethod(string[] args) { dynamic d = 1; dynamic t = default(Test); try { int i = t.Foo(d); } catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException ex) { bool ret = ErrorVerifier.Verify(RuntimeErrorId.NullReferenceOnMemberException, ex.Message); if (ret) return 0; } return 1; } public int Foo(dynamic d) { return 1; } } // </Code> } namespace ManagedTests.DynamicCSharp.Conformance.dynamic.statements.Null.null004.null004 { public class Test { [Fact] public static void DynamicCSharpRunTest() { Assert.Equal(0, MainMethod(null)); } public static int MainMethod(string[] args) { dynamic d = 1; dynamic t = new Test(); try { int i = t.Bar().Foo(d); } catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException ex) { bool ret = ErrorVerifier.Verify(ErrorMessageId.NoSuchMember, ex.Message, "Test", "Bar"); if (ret) return 0; } return 1; } public int Foo(dynamic d) { return 1; } } // </Code> } namespace ManagedTests.DynamicCSharp.Conformance.dynamic.statements.Null.void001.void001 { public class Test { [Fact] public static void DynamicCSharpRunTest() { Assert.Equal(0, MainMethod(null)); } public static int MainMethod(string[] args) { dynamic d = 1; dynamic t = new Test(); try { dynamic i = t.Bar().Foo(d); } catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException ex) { bool ret = ErrorVerifier.Verify(RuntimeErrorId.BindToVoidMethodButExpectResult, ex.Message); if (ret) return 0; } return 1; } public void Bar() { } } // </Code> }
{ "pile_set_name": "Github" }
// This file was procedurally generated from the following sources: // - src/dstr-binding/ary-ptrn-rest-init-obj.case // - src/dstr-binding/default/cls-decl-meth-static-dflt.template /*--- description: Rest element (nested object pattern) does not support initializer (static class expression method (default parameter)) esid: sec-runtime-semantics-bindingclassdeclarationevaluation features: [destructuring-binding, default-parameters] flags: [generated] negative: phase: parse type: SyntaxError info: | ClassDeclaration : class BindingIdentifier ClassTail 1. Let className be StringValue of BindingIdentifier. 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with argument className. [...] 14.5.14 Runtime Semantics: ClassDefinitionEvaluation 21. For each ClassElement m in order from methods a. If IsStatic of m is false, then b. Else, Let status be the result of performing PropertyDefinitionEvaluation for m with arguments F and false. [...] 14.3.8 Runtime Semantics: DefineMethod MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody } [...] 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody, scope, strict). If functionPrototype was passed as a parameter then pass its value as the functionPrototype optional argument of FunctionCreate. [...] 9.2.1 [[Call]] ( thisArgument, argumentsList) [...] 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList). [...] 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList ) 1. Let status be FunctionDeclarationInstantiation(F, argumentsList). [...] 9.2.12 FunctionDeclarationInstantiation(func, argumentsList) [...] 23. Let iteratorRecord be Record {[[iterator]]: CreateListIterator(argumentsList), [[done]]: false}. 24. If hasDuplicates is true, then [...] 25. Else, b. Let formalStatus be IteratorBindingInitialization for formals with iteratorRecord and env as arguments. [...] 13.3.3 Destructuring Binding Patterns ArrayBindingPattern[Yield] : [ Elisionopt BindingRestElement[?Yield]opt ] [ BindingElementList[?Yield] ] [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ] ---*/ $DONOTEVALUATE(); var callCount = 0; class C { static method([...{ x } = []] = []) { callCount = callCount + 1; } }; C.method(); assert.sameValue(callCount, 1, 'method invoked exactly once');
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html class="reftest-wait"> <head> <style type="text/css"> #a { background-color: green; margin-bottom: 40px; } #a div { display: none; height: 20px; margin-bottom: 20px; } #b { height: 20px; background-color: green; margin-top: 10px; } </style> <script type="text/javascript"> function test() { document.getElementsByTagName('div')[1].style.display = 'block'; document.documentElement.removeAttribute('class'); } document.addEventListener('MozReftestInvalidate', test); </script> </head> <body> <div id="a"> <div></div> </div> <div id="b"> </div> </body> </html>
{ "pile_set_name": "Github" }
/* * Copyright (C) by Argonne National Laboratory * See COPYRIGHT in top-level directory */ #include "mpiimpl.h" /* -- Begin Profiling Symbol Block for routine MPI_Attr_get */ #if defined(HAVE_PRAGMA_WEAK) #pragma weak MPI_Attr_get = PMPI_Attr_get #elif defined(HAVE_PRAGMA_HP_SEC_DEF) #pragma _HP_SECONDARY_DEF PMPI_Attr_get MPI_Attr_get #elif defined(HAVE_PRAGMA_CRI_DUP) #pragma _CRI duplicate MPI_Attr_get as PMPI_Attr_get #elif defined(HAVE_WEAK_ATTRIBUTE) int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag) __attribute__ ((weak, alias("PMPI_Attr_get"))); #endif /* -- End Profiling Symbol Block */ /* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build the MPI routines */ #ifndef MPICH_MPI_FROM_PMPI #undef MPI_Attr_get #define MPI_Attr_get PMPI_Attr_get #endif /*@ MPI_Attr_get - Retrieves attribute value by key Input Parameters: + comm - communicator to which attribute is attached (handle) - keyval - key value (integer) Output Parameters: + attribute_val - attribute value, unless 'flag' = false - flag - true if an attribute value was extracted; false if no attribute is associated with the key Notes: Attributes must be extracted from the same language as they were inserted in with 'MPI_ATTR_PUT'. The notes for C and Fortran below explain why. Notes for C: Even though the 'attribute_val' argument is declared as 'void *', it is really the address of a void pointer (i.e., a 'void **'). Using a 'void *', however, is more in keeping with C idiom and allows the pointer to be passed without additional casts. .N ThreadSafe .N Deprecated The replacement for this routine is 'MPI_Comm_get_attr'. .N Fortran The 'attribute_val' in Fortran is a pointer to a Fortran integer, not a pointer to a 'void *'. .N Errors .N MPI_SUCCESS .N MPI_ERR_COMM .N MPI_ERR_KEYVAL .seealso MPI_Attr_put, MPI_Keyval_create, MPI_Attr_delete, MPI_Comm_get_attr @*/ int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag) { int mpi_errno = MPI_SUCCESS; MPIR_Comm *comm_ptr = NULL; MPIR_FUNC_TERSE_STATE_DECL(MPID_STATE_MPI_ATTR_GET); MPIR_ERRTEST_INITIALIZED_ORDIE(); MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX); MPIR_FUNC_TERSE_ENTER(MPID_STATE_MPI_ATTR_GET); /* Validate parameters, especially handles needing to be converted */ #ifdef HAVE_ERROR_CHECKING { MPID_BEGIN_ERROR_CHECKS; { MPIR_ERRTEST_COMM(comm, mpi_errno); } MPID_END_ERROR_CHECKS; } #endif /* Convert MPI object handles to object pointers */ MPIR_Comm_get_ptr(comm, comm_ptr); /* Validate parameters and objects (post conversion) */ #ifdef HAVE_ERROR_CHECKING { MPID_BEGIN_ERROR_CHECKS; { /* Validate comm_ptr */ MPIR_Comm_valid_ptr(comm_ptr, mpi_errno, TRUE); /* If comm_ptr is not valid, it will be reset to null */ MPIR_ERRTEST_ARGNULL(attribute_val, "attribute_val", mpi_errno); MPIR_ERRTEST_ARGNULL(flag, "flag", mpi_errno); } MPID_END_ERROR_CHECKS; } #endif /* HAVE_ERROR_CHECKING */ /* ... body of routine ... */ mpi_errno = MPII_Comm_get_attr(comm, keyval, attribute_val, flag, MPIR_ATTR_PTR); if (mpi_errno != MPI_SUCCESS) goto fn_fail; /* ... end of body of routine ... */ fn_exit: MPIR_FUNC_TERSE_EXIT(MPID_STATE_MPI_ATTR_GET); MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX); return mpi_errno; fn_fail: /* --BEGIN ERROR HANDLING-- */ #ifdef HAVE_ERROR_CHECKING { mpi_errno = MPIR_Err_create_code(mpi_errno, MPIR_ERR_RECOVERABLE, __func__, __LINE__, MPI_ERR_OTHER, "**mpi_attr_get", "**mpi_attr_get %C %d %p %p", comm, keyval, attribute_val, flag); } #endif mpi_errno = MPIR_Err_return_comm(comm_ptr, __func__, mpi_errno); goto fn_exit; /* --END ERROR HANDLING-- */ }
{ "pile_set_name": "Github" }
package com.example; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. * This is used to schedule rendering of the component. */ @Override protected String getMainComponentName() { return "Example"; } }
{ "pile_set_name": "Github" }
/* * Copyright 2014 Red Hat Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: Ben Skeggs */ #include "conn.h" #include "outp.h" #include "priv.h" #include <subdev/gpio.h> #include <nvif/event.h> static int nvkm_connector_hpd(struct nvkm_notify *notify) { struct nvkm_connector *conn = container_of(notify, typeof(*conn), hpd); struct nvkm_disp *disp = conn->disp; struct nvkm_gpio *gpio = disp->engine.subdev.device->gpio; const struct nvkm_gpio_ntfy_rep *line = notify->data; struct nvif_notify_conn_rep_v0 rep; int index = conn->index; CONN_DBG(conn, "HPD: %d", line->mask); if (!nvkm_gpio_get(gpio, 0, DCB_GPIO_UNUSED, conn->hpd.index)) rep.mask = NVIF_NOTIFY_CONN_V0_UNPLUG; else rep.mask = NVIF_NOTIFY_CONN_V0_PLUG; rep.version = 0; nvkm_event_send(&disp->hpd, rep.mask, index, &rep, sizeof(rep)); return NVKM_NOTIFY_KEEP; } void nvkm_connector_fini(struct nvkm_connector *conn) { nvkm_notify_put(&conn->hpd); } void nvkm_connector_init(struct nvkm_connector *conn) { nvkm_notify_get(&conn->hpd); } void nvkm_connector_del(struct nvkm_connector **pconn) { struct nvkm_connector *conn = *pconn; if (conn) { nvkm_notify_fini(&conn->hpd); kfree(*pconn); *pconn = NULL; } } static void nvkm_connector_ctor(struct nvkm_disp *disp, int index, struct nvbios_connE *info, struct nvkm_connector *conn) { static const u8 hpd[] = { 0x07, 0x08, 0x51, 0x52, 0x5e, 0x5f, 0x60 }; struct nvkm_gpio *gpio = disp->engine.subdev.device->gpio; struct dcb_gpio_func func; int ret; conn->disp = disp; conn->index = index; conn->info = *info; CONN_DBG(conn, "type %02x loc %d hpd %02x dp %x di %x sr %x lcdid %x", info->type, info->location, info->hpd, info->dp, info->di, info->sr, info->lcdid); if ((info->hpd = ffs(info->hpd))) { if (--info->hpd >= ARRAY_SIZE(hpd)) { CONN_ERR(conn, "hpd %02x unknown", info->hpd); return; } info->hpd = hpd[info->hpd]; ret = nvkm_gpio_find(gpio, 0, info->hpd, DCB_GPIO_UNUSED, &func); if (ret) { CONN_ERR(conn, "func %02x lookup failed, %d", info->hpd, ret); return; } ret = nvkm_notify_init(NULL, &gpio->event, nvkm_connector_hpd, true, &(struct nvkm_gpio_ntfy_req) { .mask = NVKM_GPIO_TOGGLED, .line = func.line, }, sizeof(struct nvkm_gpio_ntfy_req), sizeof(struct nvkm_gpio_ntfy_rep), &conn->hpd); if (ret) { CONN_ERR(conn, "func %02x failed, %d", info->hpd, ret); } else { CONN_DBG(conn, "func %02x (HPD)", info->hpd); } } } int nvkm_connector_new(struct nvkm_disp *disp, int index, struct nvbios_connE *info, struct nvkm_connector **pconn) { if (!(*pconn = kzalloc(sizeof(**pconn), GFP_KERNEL))) return -ENOMEM; nvkm_connector_ctor(disp, index, info, *pconn); return 0; }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> <context:property-placeholder location="classpath*:dashboard-jdbc.properties"/> <context:property-placeholder location="classpath*:META-INF/spring/*.properties"/> <context:mbean-server/> <context:component-scan base-package="nl.bzk.brp.preview" /> <mvc:annotation-driven /> <context:spring-configured/> <!-- To enable @RequestMapping process on type level and method level --> <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" /> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /> <import resource="classpath*:datasource-beans.xml" /> <import resource="classpath*:/WEB-INF/spring/dashboard-servlet-context.xml" /> <import resource="classpath*:/WEB-INF/spring/rest-services-context.xml" /> <mvc:view-controller path="/" view-name="dashboard"/> <context:component-scan base-package="nl.bzk.brp.model"> <context:exclude-filter expression=".*_Roo_.*" type="regex"/> <context:exclude-filter expression="org.springframework.stereotype.Controller" type="annotation"/> </context:component-scan> <bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource"> <property name="driverClassName" value="${database.driverClassName}"/> <property name="url" value="${database.url}"/> <property name="username" value="${database.username}"/> <property name="password" value="${database.password}"/> <property name="testOnBorrow" value="true"/> <property name="testOnReturn" value="true"/> <property name="testWhileIdle" value="true"/> <property name="timeBetweenEvictionRunsMillis" value="1800000"/> <property name="numTestsPerEvictionRun" value="3"/> <property name="minEvictableIdleTimeMillis" value="1800000"/> <property name="validationQuery" value="SELECT version();"/> </bean> <bean class="org.springframework.orm.jpa.JpaTransactionManager" id="transactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory"/> </bean> <tx:annotation-driven mode="aspectj" transaction-manager="transactionManager"/> <bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="entityManagerFactory"> <property name="persistenceUnitName" value="persistenceUnit"/> <property name="dataSource" ref="dataSource"/> </bean> </beans>
{ "pile_set_name": "Github" }
/* * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.print.attribute.standard; import javax.print.attribute.Attribute; import javax.print.attribute.IntegerSyntax; import javax.print.attribute.PrintJobAttribute; /** * Class {@code JobImpressionsCompleted} is an integer valued printing attribute * class that specifies the number of impressions completed for the job so far. * For printing devices, the impressions completed includes interpreting, * marking, and stacking the output. * <p> * The {@code JobImpressionsCompleted} attribute describes the progress of the * job. This attribute is intended to be a counter. That is, the * {@code JobImpressionsCompleted} value for a job that has not started * processing must be 0. When the job's {@link JobState JobState} is * {@code PROCESSING} or {@code PROCESSING_STOPPED}, the * {@code JobImpressionsCompleted} value is intended to increase as the job is * processed; it indicates the amount of the job that has been processed at the * time the Print Job's attribute set is queried or at the time a print job * event is reported. When the job enters the {@code COMPLETED}, * {@code CANCELED}, or {@code ABORTED} states, the * {@code JobImpressionsCompleted} value is the final value for the job. * <p> * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The * category name returned by {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky * @see JobImpressions * @see JobImpressionsSupported * @see JobKOctetsProcessed * @see JobMediaSheetsCompleted */ public final class JobImpressionsCompleted extends IntegerSyntax implements PrintJobAttribute { /** * Use serialVersionUID from JDK 1.4 for interoperability. */ private static final long serialVersionUID = 6722648442432393294L; /** * Construct a new job impressions completed attribute with the given * integer value. * * @param value Integer value * @throws IllegalArgumentException if {@code value} is negative */ public JobImpressionsCompleted(int value) { super (value, 0, Integer.MAX_VALUE); } /** * Returns whether this job impressions completed attribute is equivalent tp * the passed in object. To be equivalent, all of the following conditions * must be true: * <ol type=1> * <li>{@code object} is not {@code null}. * <li>{@code object} is an instance of class * {@code JobImpressionsCompleted}. * <li>This job impressions completed attribute's value and * {@code object}'s value are equal. * </ol> * * @param object {@code Object} to compare to * @return {@code true} if {@code object} is equivalent to this job * impressions completed attribute, {@code false} otherwise */ public boolean equals(Object object) { return(super.equals (object) && object instanceof JobImpressionsCompleted); } /** * Get the printing attribute class which is to be used as the "category" * for this printing attribute value. * <p> * For class {@code JobImpressionsCompleted}, the category is class * {@code JobImpressionsCompleted} itself. * * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ public final Class<? extends Attribute> getCategory() { return JobImpressionsCompleted.class; } /** * Get the name of the category of which this attribute value is an * instance. * <p> * For class {@code JobImpressionsCompleted}, the category name is * {@code "job-impressions-completed"}. * * @return attribute category name */ public final String getName() { return "job-impressions-completed"; } }
{ "pile_set_name": "Github" }
import React, { Component } from 'react' import styles from './ActionMenu.styl' import {shell, clipboard} from 'electron' export default class StoryActionMenu extends Component { static propTypes = { onGoogle: React.PropTypes.func.isRequired, onReadability: React.PropTypes.func.isRequired, onCache: React.PropTypes.func.isRequired, item: React.PropTypes.object.isRequired } render () { return <div className={`${styles.container} unimportantHeaderElement`}> <i data-tip data-for='external-link' className='fa fa-external-link' onClick={this.openExternal.bind(this)} /> <i data-tip data-for='clipboard' className='fa fa-clipboard' onClick={this.copy.bind(this)} /> <i data-tip data-for='readablity' className='fa fa-book' onClick={this.props.onReadability} /> <i data-tip data-for='cache' className='fa fa-archive' onClick={this.props.onCache} /> <i data-tip data-for='google' className='fa fa-google' onClick={this.props.onGoogle} /> </div> } openExternal (e) { shell.openExternal(this.props.item.url) } copy (e) { clipboard.writeText(this.props.item.url) } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <data name="AddAGSLayer" xml:space="preserve"> <value>AGS Layer added to map :</value> </data> <data name="AddingServiceList" xml:space="preserve"> <value>adding to service list :</value> </data> <data name="Colon" xml:space="preserve"> <value>:</value> </data> <data name="DontNeedToAddService" xml:space="preserve"> <value>dont need to add service -</value> </data> <data name="ErrSpatRef" xml:space="preserve"> <value>Error occured while trying to set spatial reference</value> </data> <data name="Exiting" xml:space="preserve"> <value>... exiting</value> </data> <data name="FailedSpatRef" xml:space="preserve"> <value>Failed to set spatial reference: unable to create the spatial reference</value> </data> <data name="helpUrl" xml:space="preserve"> <value>https://github.com/Esri/geoportal-server/wiki/WMC-Client</value> </data> <data name="InvalidWMCDocument" xml:space="preserve"> <value>This does not appear to be a valid WMC document.</value> </data> <data name="NoLayers" xml:space="preserve"> <value>No layers can be found.</value> </data> <data name="UnrecognizedServiceType" xml:space="preserve"> <value>unrecognised service type -</value> </data> </root>
{ "pile_set_name": "Github" }
// Apart from this line, only executable lines should contain non-blank comments function f() { return; // 1 } console // 1 .log("hello"); label1: // 1 console.log(""); // 1 if ( // 1 false ) { throw e; // 1 } for( // 1 var i = 0; i < 3; i++) { // 1 continue; // 1 } for( // 1 var prop in obj // 1 ) { console.log("") // 1 } for( // 1 var a of b // 1 ) { console.log("") // 1 } do // 1 { console.log("") // 1 } while(false); while(false) { // 1 console.log("") // 1 } let let1; // 1 const const1 = 42; // 1 var x = 1; // 1 var y // 1 = 2; var obj = // 1 { prop1: 42 } switch // 1 (x) { case 1: console.log(1); // 1 case 2: console.log(2); // 1 break; // 1 default: break; // 1 } try { // 1 console.log(1); // 1 } catch(e) { console.log(1); // 1 } finally { console.log(1); // 1 } ; debugger; // 1 class Polygon { constructor(height, width) { this.height = height; // 1 } } import 'module1'; export { name1 };
{ "pile_set_name": "Github" }
// entity 0 { "classname" "worldspawn" // brush 0 { ( 460 212 4 ) ( 460 208 4 ) ( 452 212 4 ) tex_terrain/dummy 0 0 0 0.25 0.25 0 0 0 ( 476 256 4 ) ( 468 256 4 ) ( 476 256 0 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 ( 512 212 4 ) ( 512 212 0 ) ( 512 208 4 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 ( 452 208 0 ) ( 460 208 0 ) ( 452 212 0 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 ( 452 0 0 ) ( 452 0 4 ) ( 460 0 0 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 ( 448 208 0 ) ( 448 212 0 ) ( 448 208 4 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 } // brush 1 { ( 64 256 4 ) ( 64 204 4 ) ( 0 204 4 ) tex_terrain/dummy 0 0 0 0.25 -0.25 0 0 0 ( 0 204 4 ) ( 8 204 4 ) ( 8 204 0 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 ( 64 256 0 ) ( 8 204 0 ) ( 8 204 4 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 ( 0 256 0 ) ( 0 204 0 ) ( 64 204 0 ) tex_common/nodraw 0 0 0 0.25 -0.25 0 0 0 ( 12 256 0 ) ( 4 256 4 ) ( 4 256 0 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 ( 0 48 4 ) ( 0 44 0 ) ( 0 48 0 ) tex_common/nodraw 0 0 0 -0.25 0.25 0 0 0 } // brush 2 { ( 448 252 4 ) ( 256 -4 4 ) ( 256 252 4 ) tex_mattn/floor009 512 256 90 0.1 -0.1 0 0 0 ( 256 256 0 ) ( 448 256 64 ) ( 256 256 64 ) tex_common/nodraw 512 256 90 0.1 -0.1 0 128 0 ( 448 256 0 ) ( 256 0 0 ) ( 448 0 0 ) tex_common/nodraw 512 256 90 0.1 -0.1 0 128 0 ( 256 0 0 ) ( 448 0 64 ) ( 448 0 0 ) tex_common/nodraw 512 256 90 0.1 -0.1 0 128 0 ( 432 0 64 ) ( 432 256 0 ) ( 432 0 0 ) tex_mattn/floor011 0 256 90 0.1 0.1 0 0 0 ( 393 0 3 ) ( 393 256 3 ) ( 393 0 67 ) tex_mattn/floor011 0 256 90 0.1 0.1 0 0 0 } // brush 3 { ( 388 0 8 ) ( 388 256 8 ) ( 393 256 8 ) tex_streets/pavement001 0 0 90 0.25 -0.125 0 0 0 ( 384 256 4 ) ( 384 0 4 ) ( 384 0 0 ) tex_streets/pavement001 0 2048 0 0.25 0.125 0 0 0 ( 448 256 0 ) ( 256 0 0 ) ( 448 0 0 ) tex_common/nodraw 0 0 90 0.5 -0.25 0 128 0 ( 256 0 4 ) ( 448 0 68 ) ( 448 0 4 ) tex_common/nodraw 0 0 90 0.5 -0.25 0 128 0 ( 393 0 67 ) ( 393 256 3 ) ( 393 0 3 ) tex_streets/pavement001 0 0 0 0.25 -0.125 0 0 0 ( 384 0 4 ) ( 384 256 4 ) ( 388 256 8 ) tex_streets/pavement001 0 0 90 0.25 -0.125 0 0 0 ( -64 256 8 ) ( -64 256 -2 ) ( 64 256 8 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 } // brush 4 { ( 448 252 4 ) ( 256 -4 4 ) ( 256 252 4 ) tex_mattn/floor011 512 256 90 0.1 -0.1 0 0 0 ( 256 256 0 ) ( 448 256 64 ) ( 256 256 64 ) tex_common/nodraw 512 256 90 0.1 -0.1 0 128 0 ( 448 256 0 ) ( 256 0 0 ) ( 448 0 0 ) tex_common/nodraw 512 256 90 0.1 -0.1 0 128 0 ( 256 0 0 ) ( 448 0 64 ) ( 448 0 0 ) tex_common/nodraw 512 256 90 0.1 -0.1 0 128 0 ( 448 0 64 ) ( 448 256 0 ) ( 448 0 0 ) tex_mattn/floor011 0 256 90 0.1 0.1 0 0 0 ( 432 -4 3 ) ( 432 252 3 ) ( 432 -4 67 ) tex_mattn/floor011 0 296 90 0.1 0.1 0 0 0 } // brush 5 { ( 192 252 4 ) ( 192 -4 4 ) ( 0 252 4 ) tex_mattn/floor009 0 384 90 0.1 0.1 0 0 0 ( 192 192 64 ) ( 0 192 64 ) ( 192 192 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 0 0 0 ) ( 192 0 0 ) ( 0 256 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 0 64 0 ) ( 0 64 64 ) ( 192 64 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 16 0 0 ) ( 16 256 0 ) ( 16 0 64 ) tex_mattn/floor011 0 128 90 0.1 0.1 0 0 0 ( 55 0 67 ) ( 55 256 3 ) ( 55 0 3 ) tex_mattn/floor011 0 128 90 0.1 0.1 0 0 0 } // brush 6 { ( 64 196 4 ) ( 256 452 4 ) ( 256 196 4 ) tex_mattn/floor009 384 256 -90 0.1 -0.1 0 0 0 ( 16 192 4 ) ( 55 192 4 ) ( 55 192 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 64 192 0 ) ( 256 448 0 ) ( 64 448 0 ) tex_common/nodraw 0 64 -90 0.1 -0.1 0 128 0 ( 256 256 0 ) ( 64 256 64 ) ( 64 256 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 80 256 4 ) ( 16 192 4 ) ( 16 192 0 ) tex_mattn/floor011 0 256 90 0.1 -0.1 0 0 0 ( 119 256 0 ) ( 55 192 0 ) ( 55 192 4 ) tex_mattn/floor011 0 256 90 0.1 -0.1 0 0 0 } // brush 7 { ( 64 196 4 ) ( 256 452 4 ) ( 256 196 4 ) tex_mattn/floor011 134.19 242.1934 -135 0.1 -0.1 0 0 0 ( 8 204 4 ) ( 20 196 4 ) ( 20 196 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 64 192 0 ) ( 256 448 0 ) ( 64 448 0 ) tex_common/nodraw 0 64 -90 0.1 -0.1 0 128 0 ( 256 256 0 ) ( 64 256 64 ) ( 64 256 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 64 256 4 ) ( 8 204 4 ) ( 8 204 0 ) tex_mattn/floor011 0 128 90 0.1 0.1 0 0 0 ( 80 256 0 ) ( 20 196 0 ) ( 20 196 4 ) tex_mattn/floor011 0 296 90 0.1 -0.1 0 0 0 } // brush 8 { ( 384 444 2 ) ( 384 188 2 ) ( 256 444 2 ) tex_streets/park1v 8 256 0 0.25 0.25 0 0 0 ( 64 192 2 ) ( 64 192 0 ) ( 128 256 2 ) tex_streets/pavement001 512 0 0 0.125 0.125 0 0 0 ( 128 192 0 ) ( 128 192 2 ) ( 128 256 2 ) tex_streets/pavement001 512 496 0 0.125 0.125 0 0 0 ( 256 192 0 ) ( 384 192 0 ) ( 256 448 0 ) tex_common/nodraw 0 0 0 0.25 0.25 0 128 0 ( 64 192 0 ) ( 64 192 2 ) ( 128 192 2 ) tex_streets/pavement001 512 0 0 0.125 0.125 0 0 0 } // brush 9 { ( 55 255 8 ) ( 60 255 8 ) ( 60 0 8 ) tex_streets/pavement001 0 0 90 0.25 0.125 0 0 0 ( 64 0 4 ) ( 64 255 0 ) ( 64 0 0 ) tex_streets/pavement001 512 0 0 0.25 0.125 0 0 0 ( 55 0 0 ) ( 64 255 0 ) ( 55 255 0 ) tex_common/nodraw 0 0 90 0.5 0.25 0 128 0 ( 0 64 4 ) ( 0 64 68 ) ( 192 64 4 ) tex_common/nodraw 0 0 90 0.5 0.25 0 128 0 ( 55 0 8 ) ( 55 255 0 ) ( 55 255 8 ) tex_streets/pavement001 768 0 0 0.25 -0.125 0 0 0 ( 60 256 8 ) ( 64 256 4 ) ( 64 0 4 ) tex_streets/pavement001 0 0 90 0.25 0.125 0 0 0 ( 0 192 0 ) ( -128 192 8 ) ( -128 192 0 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 } // brush 10 { ( 63.75 192 8 ) ( 119 256 8 ) ( 124 256 8 ) tex_streets/pavement001 828.0774 196.1548 -135 0.25 -0.125 0 0 0 ( 128 256 4 ) ( 128 256 0 ) ( 64 192 4 ) tex_streets/pavement001 256 0 0 -0.25 0.125 0 0 0 ( 64 192 0 ) ( 119 256 0 ) ( 55 192 0 ) tex_common/nodraw 0 64 -90 0.5 -0.25 0 128 0 ( 119 256 8 ) ( 119 256 0 ) ( 128 256 0 ) tex_common/nodraw 0 0 90 0.5 0.25 0 128 0 ( 119 256 0 ) ( 119 256 8 ) ( 55 192 0 ) tex_streets/pavement001 0 0 180 0.25 0.125 0 0 0 ( -128 192 0 ) ( -128 192 8 ) ( 0 192 0 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 ( 64 192 4 ) ( 60 192 8 ) ( 124 256 8 ) tex_streets/pavement001 724.0774 196.1548 -135 0.25 -0.125 0 0 0 } // brush 11 { ( 0 36 4 ) ( 192 292 4 ) ( 192 36 4 ) tex_mattn/floor011 329.07 109.54 -130 0.1 -0.1 0 0 0 ( 192 192 0 ) ( 0 192 64 ) ( 192 192 64 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 0 32 0 ) ( 192 288 0 ) ( 0 288 0 ) tex_common/nodraw 0 64 -90 0.1 -0.1 0 128 0 ( 20 196 4 ) ( 8 204 4 ) ( 8 204 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 0 192 0 ) ( 8 204 0 ) ( 8 204 4 ) tex_mattn/floor011 0 64 90 0.1 -0.1 0 0 0 ( 16 192 4 ) ( 20 196 4 ) ( 20 196 0 ) tex_mattn/floor011 0 488 90 0.1 -0.1 0 0 0 } // brush 12 { ( 192 252 4 ) ( 192 -4 4 ) ( 0 252 4 ) tex_mattn/floor011 0 384 90 0.1 0.1 0 0 0 ( 192 192 64 ) ( 0 192 64 ) ( 192 192 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 0 0 0 ) ( 192 0 0 ) ( 0 256 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 0 64 0 ) ( 0 64 64 ) ( 192 64 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 0 0 0 ) ( 0 256 0 ) ( 0 0 64 ) tex_mattn/floor011 0 256 90 0.1 0.1 0 0 0 ( 16 -4 67 ) ( 16 252 3 ) ( 16 -4 3 ) tex_mattn/floor011 0 168 90 0.1 0.1 0 0 0 } // brush 13 { ( 4 44 4 ) ( 12 48 4 ) ( 12 44 4 ) tex_terrain/dummy 0 0 0 0.25 -0.25 0 0 0 ( 8 204 0 ) ( 0 192 0 ) ( 0 192 4 ) tex_common/nodraw 56 0 0 -0.25 0.25 0 0 0 ( 4 44 0 ) ( 12 48 0 ) ( 4 48 0 ) tex_common/nodraw 0 0 0 0.25 -0.25 0 0 0 ( 8 204 4 ) ( 0 204 4 ) ( 0 204 0 ) tex_common/nodraw 28 0 0 0.25 0.25 0 0 0 ( 0 192 4 ) ( 0 204 0 ) ( 0 204 4 ) tex_common/nodraw 0 0 0 -0.25 0.25 0 0 0 } // brush 14 { ( 320 252 2 ) ( 320 -4 2 ) ( 192 252 2 ) tex_streets/park1v 8 256 0 0.25 0.25 0 0 0 ( 320 192 64 ) ( 192 192 64 ) ( 320 192 0 ) tex_streets/pavement001 0 0 0 0.125 0.125 0 0 0 ( 128 256 62 ) ( 128 256 -2 ) ( 128 0 62 ) tex_streets/pavement001 0 496 0 0.125 0.125 0 0 0 ( 192 0 0 ) ( 320 0 0 ) ( 192 256 0 ) tex_common/nodraw 0 0 0 0.25 0.25 0 128 0 ( 192 64 0 ) ( 192 64 64 ) ( 320 64 0 ) tex_common/nodraw 0 0 0 0.25 0.25 0 128 0 ( 64 0 0 ) ( 64 256 0 ) ( 64 0 64 ) tex_streets/pavement001 0 0 0 0.125 0.125 0 0 0 } // brush 15 { ( 384 252 2 ) ( 384 -4 2 ) ( 256 252 2 ) tex_streets/2ln 512 0 0 0.25 0.25 0 0 0 ( 384 256 64 ) ( 256 256 64 ) ( 384 256 0 ) tex_streets/pavement001 512 0 0 0.125 0.125 0 0 0 ( 384 256 62 ) ( 384 256 -2 ) ( 384 0 62 ) tex_streets/pavement001 0 496 0 0.125 0.125 0 0 0 ( 256 0 0 ) ( 384 0 0 ) ( 256 256 0 ) tex_common/nodraw 256 0 0 0.25 0.25 0 128 0 ( 256 0 0 ) ( 256 0 64 ) ( 384 0 0 ) tex_common/nodraw 256 0 0 0.25 0.25 0 128 0 ( 128 0 0 ) ( 128 256 0 ) ( 128 0 64 ) tex_streets/pavement001 0 0 0 0.125 0.125 0 0 0 } // brush 16 { ( 192 220 4 ) ( 192 -36 4 ) ( 0 220 4 ) tex_mattn/floor011 364 0 130 0.1 0.1 0 0 0 ( 192 64 64 ) ( 0 64 64 ) ( 192 64 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 0 -32 0 ) ( 192 -32 0 ) ( 0 224 0 ) tex_common/nodraw 0 64 90 0.1 0.1 0 128 0 ( 8 52 0 ) ( 8 52 4 ) ( 20 60 4 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 8 52 4 ) ( 8 52 0 ) ( 0 64 0 ) tex_mattn/floor011 0 64 90 0.1 0.1 0 0 0 ( 20 60 0 ) ( 20 60 4 ) ( 16 64 4 ) tex_mattn/floor011 0 488 90 0.1 0.1 0 0 0 } // brush 17 { ( 0 52 4 ) ( 64 52 4 ) ( 64 0 4 ) tex_terrain/dummy 0 0 0 0.25 0.25 0 0 0 ( 8 52 0 ) ( 8 52 4 ) ( 0 52 4 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 ( 8 52 4 ) ( 8 52 0 ) ( 64 0 0 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 ( 64 52 0 ) ( 0 52 0 ) ( 0 0 0 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 ( 4 0 0 ) ( 4 0 4 ) ( 12 0 0 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 ( 0 208 0 ) ( 0 212 0 ) ( 0 208 4 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 } // brush 18 { ( 124 0 8 ) ( 119 0 8 ) ( 63.75 64 8 ) tex_streets/pavement001 104 284 135 0.25 0.125 0 0 0 ( 64 64 4 ) ( 128 0 0 ) ( 128 0 4 ) tex_streets/pavement001 256 0 0 0.25 0.125 0 0 0 ( 55 64 0 ) ( 119 0 0 ) ( 64 64 0 ) tex_common/nodraw 0 0 90 0.5 0.25 0 128 0 ( 128 0 0 ) ( 119 0 0 ) ( 119 0 8 ) tex_common/nodraw 0 0 90 0.5 0.25 0 128 0 ( 55 64 0 ) ( 119 0 8 ) ( 119 0 0 ) tex_streets/pavement001 0 0 0 0.25 -0.125 0 0 0 ( 0 64 0 ) ( -128 64 8 ) ( -128 64 0 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 ( 124 0 8 ) ( 60 64 8 ) ( 64 64 4 ) tex_streets/pavement001 0 284 135 0.25 0.125 0 0 0 } // brush 19 { ( 384 252 2 ) ( 384 -4 2 ) ( 256 252 2 ) tex_streets/park1v 8 256 0 0.25 0.25 0 0 0 ( 64 64 2 ) ( 64 64 0 ) ( 128 64 2 ) tex_streets/pavement001 512 0 0 0.125 0.125 0 0 0 ( 128 0 0 ) ( 128 0 2 ) ( 128 64 2 ) tex_streets/pavement001 0 496 0 0.125 0.125 0 0 0 ( 256 0 0 ) ( 384 0 0 ) ( 256 256 0 ) tex_common/nodraw 256 0 0 0.25 0.25 0 128 0 ( 64 64 0 ) ( 64 64 2 ) ( 128 0 2 ) tex_streets/pavement001 0 0 0 0.125 0.125 0 0 0 } // brush 20 { ( 12 212 4 ) ( 12 208 4 ) ( 4 212 4 ) tex_terrain/dummy 0 0 0 0.25 0.25 0 0 0 ( 0 64 4 ) ( 0 64 0 ) ( 8 52 0 ) tex_common/nodraw 56 0 0 0.25 0.25 0 0 0 ( 4 208 0 ) ( 12 208 0 ) ( 4 212 0 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 ( 0 52 0 ) ( 0 52 4 ) ( 8 52 4 ) tex_common/nodraw 28 0 0 0.25 0.25 0 0 0 ( 0 52 4 ) ( 0 52 0 ) ( 0 64 4 ) tex_common/nodraw 0 0 0 0.25 0.25 0 0 0 } // brush 21 { ( 256 60 4 ) ( 256 -196 4 ) ( 64 60 4 ) tex_mattn/floor009 384 256 90 0.1 0.1 0 0 0 ( 55 64 0 ) ( 55 64 4 ) ( 16 64 4 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 64 -192 0 ) ( 256 -192 0 ) ( 64 64 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 64 0 0 ) ( 64 0 64 ) ( 256 0 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 16 64 0 ) ( 16 64 4 ) ( 80 0 4 ) tex_mattn/floor011 0 256 90 0.1 0.1 0 0 0 ( 55 64 4 ) ( 55 64 0 ) ( 119 0 0 ) tex_mattn/floor011 0 256 90 0.1 0.1 0 0 0 } // brush 22 { ( 256 60 4 ) ( 256 -196 4 ) ( 64 60 4 ) tex_mattn/floor011 384 480 135 0.1 0.1 0 0 0 ( 20 60 0 ) ( 20 60 4 ) ( 8 52 4 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 64 -192 0 ) ( 256 -192 0 ) ( 64 64 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 64 0 0 ) ( 64 0 64 ) ( 256 0 0 ) tex_common/nodraw 0 0 90 0.1 0.1 0 128 0 ( 8 52 0 ) ( 8 52 4 ) ( 64 0 4 ) tex_mattn/floor011 0 128 90 0.1 0.1 0 0 0 ( 20 60 4 ) ( 20 60 0 ) ( 80 0 0 ) tex_mattn/floor011 0 296 90 0.1 0.1 0 0 0 } } // entity 1 { "classname" "light" "origin" "384 144 112" "color" "0.9 0.95 1" "light" "60" } // entity 2 { "classname" "light" "light" "180" "color" "0.8 0.9 1" "origin" "368 144 24" } // entity 3 { "classname" "func_group" // brush 0 { ( 398.464 142.464 -4 ) ( 398.464 142.464 4 ) ( 400 140.928 4 ) tex_material/metall002 14.50012 24 0 -0.256 0.5 134283008 0 0 ( 397.952 144 -5 ) ( 397.952 144 3 ) ( 397.952 141.952 3 ) tex_material/metall002 10.5 22 0 -0.256 0.5 134283008 0 0 ( 398.464 145.536 -4 ) ( 398.464 145.536 4 ) ( 396.928 144 4 ) tex_material/metall002 41.50024 24 0 0.256 0.5 134283008 0 0 ( 400 146.048 -4 ) ( 400 146.048 4 ) ( 397.952 146.048 4 ) tex_material/metall002 13.50092 24 0 0.2560001 0.5 134283008 0 0 ( 401.536 145.536 -4 ) ( 401.536 145.536 4 ) ( 400 147.072 4 ) tex_material/metall002 38.49976 24 0 -0.256 0.5 134283008 0 0 ( 402.048 144 -5 ) ( 402.048 144 3 ) ( 402.048 146.048 3 ) tex_material/metall002 10.5 22 0 -0.256 0.5 134283008 0 0 ( 401.536 142.464 -4 ) ( 401.536 142.464 4 ) ( 403.072 144 4 ) tex_material/metall002 1.500244 24 0 0.256 0.5 134283008 0 0 ( 400 141.952 -4 ) ( 400 141.952 4 ) ( 402.048 141.952 4 ) tex_material/metall002 13.50092 24 0 0.2560001 0.5 134283008 0 0 ( 397.952 146.048 48 ) ( 397.952 141.952 48 ) ( 402.048 141.952 48 ) tex_common/nodraw 10.49951 50.49908 -90 0.2560001 0.2560001 134283008 128 0 ( 401.024 141.952 64 ) ( 396.928 141.952 64 ) ( 396.928 146.048 64 ) tex_material/c_gray050 10.49951 18.49908 -90 0.2560001 0.2560001 134283008 128 0 } // brush 1 { ( 397 141 12 ) ( 397 141 20 ) ( 400 138 20 ) tex_material/metall002 60 16 0 -0.5 0.5 134283008 0 0 ( 396 144 12 ) ( 396 144 20 ) ( 396 140 20 ) tex_material/metall002 56 16 0 -0.5 0.5 134283008 0 0 ( 397 147 12 ) ( 397 147 20 ) ( 394 144 20 ) tex_material/metall002 60 16 0 0.5 0.5 134283008 0 0 ( 400 148 -4 ) ( 400 148 4 ) ( 396 148 4 ) tex_material/metall002 8 48 0 0.5 0.5 134283008 0 0 ( 403 147 12 ) ( 403 147 20 ) ( 400 150 20 ) tex_material/metall002 20 16 0 -0.5 0.5 134283008 0 0 ( 404 144 12 ) ( 404 144 20 ) ( 404 148 20 ) tex_material/metall002 56 16 0 -0.5 0.5 134283008 0 0 ( 403 141 12 ) ( 403 141 20 ) ( 406 144 20 ) tex_material/metall002 20 16 0 0.5 0.5 134283008 0 0 ( 401 140 4 ) ( 401 140 12 ) ( 405 140 12 ) tex_material/metall002 6 0 0 0.5 0.5 134283008 0 0 ( 545 218 4 ) ( 545 210 4 ) ( 605 210 4 ) tex_common/nodraw 56 58 -90 0.5 0.5 134283008 128 0 ( 550 160 48 ) ( 542 160 48 ) ( 542 224 48 ) tex_material/metall002 20 16 180 0.5 0.5 134217728 0 0 } // brush 2 { ( 408 138 116 ) ( 408 150 116 ) ( 400 150 116 ) tex_material/metall002 56 8 -90 0.5 0.5 134282752 0 0 ( 396 150 122 ) ( 404 150 122 ) ( 404 138 122 ) tex_material/metall002 56 8 -90 0.5 0.5 134282752 0 0 ( 396 138 122 ) ( 404 138 122 ) ( 404 138 70 ) tex_material/metall002 8 28 0 0.5 0.5 134282752 0 0 ( 404 150 122 ) ( 396 150 122 ) ( 396 150 70 ) tex_material/metall002 8 28 0 0.5 0.5 134282752 0 0 ( 380 150 120 ) ( 380 138 120 ) ( 396 138 116 ) tex_lights/neon003 23.99976 35.00073 90 0.25 -0.333333 134217728 1 1000 ( 380 138 120 ) ( 380 150 120 ) ( 380 150 122 ) tex_material/metall002 56 16 0 -0.5 0.5 134282752 0 0 ( 406 140 122 ) ( 406 140 116 ) ( 404 138 116 ) tex_material/metall002 28 16 0 0.5 0.5 134282752 0 0 ( 406 148 122 ) ( 406 148 116 ) ( 406 140 116 ) tex_material/metall002 56 16 0 -0.5 0.5 134282752 0 0 ( 406 148 116 ) ( 406 148 122 ) ( 404 150 122 ) tex_material/metall002 28 16 0 -0.5 0.5 134282752 0 0 } // brush 3 { ( 398.464 142.464 12 ) ( 398.464 142.464 20 ) ( 400 140.928 20 ) tex_material/metall002 14.50012 56 0 -0.256 0.5 134282752 0 0 ( 397.952 144 12 ) ( 397.952 144 20 ) ( 397.952 141.952 20 ) tex_material/metall002 10.5 56 0 -0.256 0.5 134282752 0 0 ( 398.464 145.536 12 ) ( 398.464 145.536 20 ) ( 396.928 144 20 ) tex_material/metall002 41.50024 56 0 0.256 0.5 134282752 0 0 ( 400 146.048 12 ) ( 400 146.048 20 ) ( 397.952 146.048 20 ) tex_material/metall002 13.50092 56 0 0.2560001 0.5 134282752 0 0 ( 401.536 145.536 12 ) ( 401.536 145.536 20 ) ( 400 147.072 20 ) tex_material/metall002 38.49976 56 0 -0.256 0.5 134282752 0 0 ( 402.048 144 12 ) ( 402.048 144 20 ) ( 402.048 146.048 20 ) tex_material/metall002 10.5 56 0 -0.256 0.5 134282752 0 0 ( 401.536 142.464 12 ) ( 401.536 142.464 20 ) ( 403.072 144 20 ) tex_material/metall002 1.500244 56 0 0.256 0.5 134282752 0 0 ( 400 141.952 12 ) ( 400 141.952 20 ) ( 402.048 141.952 20 ) tex_material/metall002 13.50092 56 0 0.2560001 0.5 134282752 0 0 ( 397.952 146.048 64 ) ( 397.952 141.952 64 ) ( 402.048 141.952 64 ) tex_common/nodraw 10.49951 50.49908 -90 0.2560001 0.2560001 134282752 128 0 ( 401.024 141.952 116 ) ( 396.928 141.952 116 ) ( 396.928 146.048 116 ) tex_common/nodraw 10.49951 50.49908 -90 0.2560001 0.2560001 134282752 128 0 } } // entity 4 { "classname" "info_alien_start" "origin" "80 144 28" }
{ "pile_set_name": "Github" }
/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation ([email protected]) ** ** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you have questions regarding the use of this file, please contact ** Nokia at [email protected]. ** $QT_END_LICENSE$ ** ****************************************************************************/ #include "qgl.h" #include "qgl_egl_p.h" #include "qglpixelbuffer.h" #include <qglscreen_qws.h> #include <qscreenproxy_qws.h> #include <private/qglwindowsurface_qws_p.h> #include <private/qbackingstore_p.h> #include <private/qfont_p.h> #include <private/qfontengine_p.h> #include <private/qgl_p.h> #include <private/qpaintengine_opengl_p.h> #include <qpixmap.h> #include <qtimer.h> #include <qapplication.h> #include <qstack.h> #include <qdesktopwidget.h> #include <qdebug.h> #include <qvarlengtharray.h> QT_BEGIN_NAMESPACE static QGLScreen *glScreenForDevice(QPaintDevice *device) { QScreen *screen = qt_screen; if (screen->classId() == QScreen::MultiClass) { int screenNumber; if (device && device->devType() == QInternal::Widget) screenNumber = qApp->desktop()->screenNumber(static_cast<QWidget *>(device)); else screenNumber = 0; screen = screen->subScreens()[screenNumber]; } while (screen->classId() == QScreen::ProxyClass || screen->classId() == QScreen::TransformedClass) { screen = static_cast<QProxyScreen *>(screen)->screen(); } if (screen->classId() == QScreen::GLClass) return static_cast<QGLScreen *>(screen); else return 0; } /***************************************************************************** QOpenGL debug facilities *****************************************************************************/ //#define DEBUG_OPENGL_REGION_UPDATE bool QGLFormat::hasOpenGLOverlays() { QGLScreen *glScreen = glScreenForDevice(0); if (glScreen) return (glScreen->options() & QGLScreen::Overlays); else return false; } void qt_egl_add_platform_config(QEglProperties& props, QPaintDevice *device) { // Find the QGLScreen for this paint device. QGLScreen *glScreen = glScreenForDevice(device); if (!glScreen) { qWarning("QGLContext::chooseContext(): The screen is not a QGLScreen"); return; } int devType = device->devType(); if (devType == QInternal::Image) props.setPixelFormat(static_cast<QImage *>(device)->format()); else props.setPixelFormat(glScreen->pixelFormat()); } static EGLSurface qt_egl_create_surface (QEglContext *context, QPaintDevice *device, const QEglProperties *properties = 0) { // Get the screen surface functions, which are used to create native ids. QGLScreen *glScreen = glScreenForDevice(device); if (!glScreen) return EGL_NO_SURFACE; QGLScreenSurfaceFunctions *funcs = glScreen->surfaceFunctions(); if (!funcs) return EGL_NO_SURFACE; // Create the native drawable for the paint device. int devType = device->devType(); EGLNativePixmapType pixmapDrawable = 0; EGLNativeWindowType windowDrawable = 0; bool ok; if (devType == QInternal::Pixmap) { ok = funcs->createNativePixmap(static_cast<QPixmap *>(device), &pixmapDrawable); } else if (devType == QInternal::Image) { ok = funcs->createNativeImage(static_cast<QImage *>(device), &pixmapDrawable); } else { ok = funcs->createNativeWindow(static_cast<QWidget *>(device), &windowDrawable); } if (!ok) { qWarning("QEglContext::createSurface(): Cannot create the native EGL drawable"); return EGL_NO_SURFACE; } // Create the EGL surface to draw into, based on the native drawable. const int *props; if (properties) props = properties->properties(); else props = 0; EGLSurface surf; if (devType == QInternal::Widget) { surf = eglCreateWindowSurface (context->display(), context->config(), windowDrawable, props); } else { surf = eglCreatePixmapSurface (context->display(), context->config(), pixmapDrawable, props); } if (surf == EGL_NO_SURFACE) qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError()); return surf; } bool QGLContext::chooseContext(const QGLContext* shareContext) { Q_D(QGLContext); // Validate the device. if (!device()) return false; int devType = device()->devType(); if (devType != QInternal::Pixmap && devType != QInternal::Image && devType != QInternal::Widget) { qWarning("QGLContext::chooseContext(): Cannot create QGLContext's for paint device type %d", devType); return false; } // Get the display and initialize it. d->eglContext = new QEglContext(); d->eglContext->setApi(QEgl::OpenGL); if (!d->eglContext->openDisplay(device())) { delete d->eglContext; d->eglContext = 0; return false; } // Construct the configuration we need for this surface. QEglProperties configProps; qt_egl_add_platform_config(configProps, device()); qt_egl_set_format(configProps, devType, d->glFormat); configProps.setRenderableType(QEgl::OpenGL); // Search for a matching configuration, reducing the complexity // each time until we get something that matches. if (!d->eglContext->chooseConfig(configProps)) { delete d->eglContext; d->eglContext = 0; return false; } // Inform the higher layers about the actual format properties. qt_egl_update_format(*(d->eglContext), d->glFormat); // Create a new context for the configuration. if (!d->eglContext->createContext (shareContext ? shareContext->d_func()->eglContext : 0)) { delete d->eglContext; d->eglContext = 0; return false; } d->sharing = d->eglContext->isSharing(); if (d->sharing && shareContext) const_cast<QGLContext *>(shareContext)->d_func()->sharing = true; #if defined(EGL_VERSION_1_1) if (d->glFormat.swapInterval() != -1 && devType == QInternal::Widget) eglSwapInterval(d->eglContext->display(), d->glFormat.swapInterval()); #endif // Create the EGL surface to draw into. We cannot use // QEglContext::createSurface() because it does not have // access to the QGLScreen. d->eglSurface = qt_egl_create_surface(d->eglContext, device()); if (d->eglSurface == EGL_NO_SURFACE) { delete d->eglContext; d->eglContext = 0; return false; } return true; } bool QGLWidget::event(QEvent *e) { return QWidget::event(e); } void QGLWidget::resizeEvent(QResizeEvent *) { Q_D(QGLWidget); if (!isValid()) return; makeCurrent(); if (!d->glcx->initialized()) glInit(); resizeGL(width(), height()); //handle overlay } const QGLContext* QGLWidget::overlayContext() const { return 0; } void QGLWidget::makeOverlayCurrent() { //handle overlay } void QGLWidget::updateOverlayGL() { //handle overlay } void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext, bool deleteOldContext) { Q_D(QGLWidget); if(context == 0) { qWarning("QGLWidget::setContext: Cannot set null context"); return; } if(d->glcx) d->glcx->doneCurrent(); QGLContext* oldcx = d->glcx; d->glcx = context; if(!d->glcx->isValid()) d->glcx->create(shareContext ? shareContext : oldcx); if(deleteOldContext) delete oldcx; } void QGLWidgetPrivate::init(QGLContext *context, const QGLWidget* shareWidget) { Q_Q(QGLWidget); QGLScreen *glScreen = glScreenForDevice(q); if (glScreen) { wsurf = static_cast<QWSGLWindowSurface*>(glScreen->createSurface(q)); q->setWindowSurface(wsurf); } initContext(context, shareWidget); if(q->isValid() && glcx->format().hasOverlay()) { //no overlay qWarning("QtOpenGL ES doesn't currently support overlays"); } } void QGLWidgetPrivate::cleanupColormaps() { } const QGLColormap & QGLWidget::colormap() const { return d_func()->cmap; } void QGLWidget::setColormap(const QGLColormap &) { } void QGLExtensions::init() { static bool init_done = false; if (init_done) return; init_done = true; // We need a context current to initialize the extensions, // but getting a valid EGLNativeWindowType this early can be // problematic under QWS. So use a pbuffer instead. // // Unfortunately OpenGL/ES 2.0 systems don't normally // support pbuffers, so we have no choice but to try // our luck with a window on those systems. #if defined(QT_OPENGL_ES_2) QGLWidget tmpWidget; tmpWidget.makeCurrent(); init_extensions(); tmpWidget.doneCurrent(); #else QGLPixelBuffer pbuffer(16, 16); pbuffer.makeCurrent(); init_extensions(); pbuffer.doneCurrent(); #endif } QT_END_NAMESPACE
{ "pile_set_name": "Github" }
Configuration Loaders --------------------- Loaders are in charge of loading configuration from various sources, like ``.ini`` files or *environment* variables. Loaders are ment to chained, so that prettyconf checks one by one for a given configuration variable. Prettyconf comes with some loaders already included in ``prettyconf.loaders``. .. seealso:: Some loaders include a ``var_format`` callable argument, see :ref:`variable-naming` to read more about it's purpose. Environment +++++++++++ .. autoclass:: prettyconf.loaders.Environment The ``Environment`` loader gets configuration from ``os.environ``. Since it is a common pattern to write env variables in caps, the loader accepts a ``var_format`` function to pre-format the variable name before the lookup occurs. By default it is ``str.upper()``. .. code-block:: python from prettyconf import config from prettyconf.loaders import Environment config.loaders = [Environment(var_format=str.upper)] config('debug') # will look for a `DEBUG` variable EnvFile +++++++ .. autoclass:: prettyconf.loaders.EnvFile The ``EnvFile`` loader gets configuration from ``.env`` file. If the file doesn't exist, this loader will be skipped without raising any errors. .. code-block:: text # .env file DEBUG=1 .. code-block:: python from prettyconf import config from prettyconf.loaders import EnvFile config.loaders = [EnvFile(file='.env', required=True, var_format=str.upper)] config('debug') # will look for a `DEBUG` variable .. note:: You might want to use dump-env_, a utility to create ``.env`` files. .. _`dump-env`: https://github.com/sobolevn/dump-env IniFile +++++++ .. autoclass:: prettyconf.loaders.IniFile The ``IniFile`` loader gets configuration from ``.ini`` or ``.cfg`` files. If the file doesn't exist, this loader will be skipped without raising any errors. CommandLine +++++++++++ .. autoclass:: prettyconf.loaders.CommandLine This loader lets you extract configuration variables from parsed CLI arguments. By default it works with `argparse`_ parsers. .. code-block:: python from prettyconf import Configuration, NOT_SET from prettyconf.loaders import CommandLine import argparse parser = argparse.ArgumentParser(description='Does something useful.') parser.add_argument('--debug', '-d', dest='debug', default=NOT_SET, help='set debug mode') config = Configuration(loaders=[CommandLine(parser=parser)]) print(config('debug', default=False, cast=config.boolean)) Something to notice here is the :py:const:`NOT_SET<prettyconf.loaders.NOT_SET>` value. CLI parsers often force you to put a default value so that they don't fail. In that case, to play nice with prettyconf, you must set one. But that would break the discoverability chain that prettyconf encourages. So by setting this special default value, you will allow prettyconf to keep the lookup going. The :py:func:`get_args<prettyconf.loaders.get_args>` function converts the argparse parser's values to a dict that ignores :py:const:`NOT_SET<prettyconf.loaders.NOT_SET>` values. .. _argparse: https://docs.python.org/3/library/argparse.html RecursiveSearch +++++++++++++++ .. autoclass:: prettyconf.loaders.RecursiveSearch This loader tries to find ``.env`` or ``*.ini|*.cfg`` files and load them with the :py:class:`EnvFile<prettyconf.loaders.EnvFile>` and :py:class:`IniFile<prettyconf.loaders.IniFile>` loaders respectively. It will start at the ``starting_path`` directory to look for configuration files. .. warning:: It is important to note that this loader uses the glob module internally to discover ``.env`` and ``*.ini|*.cfg`` files. This could be problematic if the project includes many files that are unrelated, like a ``pytest.ini`` file along side with a ``settings.ini``. An unexpected file could be found and be considered as the configuration to use. Consider the following file structure: .. code-block:: text project/ settings.ini app/ settings.py When instantiating your :py:class:`RecursiveSearch<prettyconf.loaders.RecursiveSearch>`, if you pass ``/absolute/path/to/project/app/`` as ``starting_path`` the loader will start looking for configuration files at ``project/app``. .. code-block:: python # Code example in project/app/settings.py import os from prettyconf import config from prettyconf.loaders import RecursiveSearch app_path = os.path.dirname(__file__) config.loaders = [RecursiveSearch(starting_path=app_path)] By default, the loader will try to look for configuration files until it finds valid configuration files **or** it reaches ``root_path``. The ``root_path`` is set to the root directory ``/`` initialy. Consider the following file structure: .. code-block:: text /projects/ any_settings.ini project/ app/ settings.py You can change this behaviour by setting any parent directory of the ``starting_path`` as the ``root_path`` when instantiating :py:class:`RecursiveSearch<prettyconf.loaders.RecursiveSearch>`: .. code-block:: python # Code example in project/app/settings.py import os from prettyconf import Configuration from prettyconf.loaders import RecursiveSearch app_path = os.path.dirname(__file__) project_path = os.path.realpath(os.path.join(app_path, '..')) rs = RecursiveSearch(starting_path=app_path, root_path=project_path) config = Configuration(loaders=[rs]) The example above will start looking for files at ``project/app/`` and will stop looking for configuration files at ``project/``, actually never looking at ``any_settings.ini`` and no configuration being loaded at all. The ``root_path`` must be a parent directory of ``starting_path``: .. code-block:: python # Code example in project/app/settings.py from prettyconf.loaders import RecursiveSearch # /baz is not parent of /foo/bar, so this raises an InvalidPath exception here rs = RecursiveSearch(starting_path="/foo/bar", root_path="/baz") AwsParameterStore +++++++++++++++++ .. autoclass:: prettyconf.loaders.AwsParameterStore The ``AwsParameterStore`` loader gets configuration from the AWS Parameter Store, part of AWS Systems Manager. The loader will be skipped if the parameter store is unreachable (connectivity, unavailability, access permissions). The loader respects parameter hierarchies, performing non-recursive discoveries. The loader accepts AWS access secrets and region when instantiated, otherwise, it will use system-wide defaults (if available). The AWS parameter store supports three parameter types: ``String``, ``StringList`` and ``SecureString``. All types are read as strings, however, decryption of ``SecureStrings`` is not handled by the loader. .. code-block:: python from prettyconf import config from prettyconf.loaders import AwsParameterStore config.loaders = [AwsParameterStore(path='/api')] config('debug') # will look for a parameter named "/api/debug" in the store
{ "pile_set_name": "Github" }
// Copyright 2004-present Facebook. All Rights Reserved. #pragma once #include <jni.h> namespace facebook { namespace react { jmethodID getLogMarkerMethod(); } // namespace react } // namespace facebook
{ "pile_set_name": "Github" }
*** Settings *** Resource ../../lib/browser/rs_browser.robot *** Variables *** ${COUNTER COMPONENT ID} counter ${COUNTER COMPONENT} css=[data-testid="${COUNTER COMPONENT ID}"] ${COUNTER INCREMENT} ${COUNTER COMPONENT} [data-ref="incrementButton"] *** Keywords *** Verify Counter Increment Exist [Arguments] ${should exist}=${TRUE} Run Keyword If ${should exist} == ${TRUE} Wait Until Keyword Succeeds ${TOTAL WAIT} ${RETRY EVERY} Element Should Be Visible ${COUNTER INCREMENT} Run Keyword If ${should exist} == ${FALSE} Wait Until Keyword Succeeds ${TOTAL WAIT} ${RETRY EVERY} Element Should Not Be Visible ${COUNTER INCREMENT} Verify Counter Increment Enabled [Arguments] ${should be enabled} Run Keyword If ${should be enabled} == ${TRUE} Wait Until Keyword Succeeds ${TOTAL WAIT} ${RETRY EVERY} Element Should Be Enabled ${COUNTER INCREMENT} Run Keyword If ${should be enabled} == ${FALSE} Wait Until Keyword Succeeds ${TOTAL WAIT} ${RETRY EVERY} Element Should Be Disabled ${COUNTER INCREMENT} Verify Counter Increment Label [Arguments] ${expected label} Wait Until Keyword Succeeds ${TOTAL WAIT} ${RETRY EVERY} Element Should Contain ${COUNTER INCREMENT} ${expected label} Click Counter Increment Wait Until Keyword Succeeds ${TOTAL WAIT} ${RETRY EVERY} Click Element ${COUNTER INCREMENT}
{ "pile_set_name": "Github" }
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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. """PyTorch BERT model.""" from __future__ import absolute_import, division, print_function, unicode_literals import copy import math import sys from io import open import torch from torch import nn from torch.nn import CrossEntropyLoss def gelu(x): """Implementation of the gelu activation function. For information: OpenAI GPT's gelu is slightly different (and gives slightly different results): 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3)))) Also see https://arxiv.org/abs/1606.08415 """ return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0))) ACT2FN = {"gelu": gelu, "relu": torch.nn.functional.relu} class BertConfig(object): """Configuration class to store the configuration of a `BertModel`. """ def __init__(self, vocab_size, # 字典字数 hidden_size=384, # 隐藏层维度也就是字向量维度 num_hidden_layers=6, # transformer block 的个数 num_attention_heads=12, # 注意力机制"头"的个数 intermediate_size=384*4, # feedforward层线性映射的维度 hidden_act="gelu", # 激活函数 hidden_dropout_prob=0.4, # dropout的概率 attention_probs_dropout_prob=0.4, max_position_embeddings=512*2, type_vocab_size=256, # 用来做next sentence预测, # 这里预留了256个分类, 其实我们目前用到的只有0和1 initializer_range=0.02 # 用来初始化模型参数的标准差 ): self.vocab_size = vocab_size self.hidden_size = hidden_size self.num_hidden_layers = num_hidden_layers self.num_attention_heads = num_attention_heads self.hidden_act = hidden_act self.intermediate_size = intermediate_size self.hidden_dropout_prob = hidden_dropout_prob self.attention_probs_dropout_prob = attention_probs_dropout_prob self.max_position_embeddings = max_position_embeddings self.type_vocab_size = type_vocab_size self.initializer_range = initializer_range class BertEmbeddings(nn.Module): """LayerNorm层, 见Transformer(一), 讲编码器(encoder)的第1部分""" """Construct the embeddings from word, position and token_type embeddings. """ def __init__(self, config): super(BertEmbeddings, self).__init__() self.word_embeddings = nn.Embedding(config.vocab_size, config.hidden_size, padding_idx=0) self.token_type_embeddings = nn.Embedding(config.type_vocab_size, config.hidden_size) # embedding矩阵初始化 nn.init.orthogonal_(self.word_embeddings.weight) nn.init.orthogonal_(self.token_type_embeddings.weight) # embedding矩阵进行归一化 epsilon = 1e-8 self.word_embeddings.weight.data = \ self.word_embeddings.weight.data.div(torch.norm(self.word_embeddings.weight, p=2, dim=1, keepdim=True).data + epsilon) self.token_type_embeddings.weight.data = \ self.token_type_embeddings.weight.data.div(torch.norm(self.token_type_embeddings.weight, p=2, dim=1, keepdim=True).data + epsilon) # self.LayerNorm is not snake-cased to stick with TensorFlow model variable name and be able to load # any TensorFlow checkpoint file self.LayerNorm = BertLayerNorm(config.hidden_size, eps=1e-12) self.dropout = nn.Dropout(config.hidden_dropout_prob) def forward(self, input_ids, positional_enc, token_type_ids=None): """ :param input_ids: 维度 [batch_size, sequence_length] :param positional_enc: 位置编码 [sequence_length, embedding_dimension] :param token_type_ids: BERT训练的时候, 第一句是0, 第二句是1 :return: 维度 [batch_size, sequence_length, embedding_dimension] """ # 字向量查表 words_embeddings = self.word_embeddings(input_ids) if token_type_ids is None: token_type_ids = torch.zeros_like(input_ids) token_type_embeddings = self.token_type_embeddings(token_type_ids) embeddings = words_embeddings + positional_enc + token_type_embeddings # embeddings: [batch_size, sequence_length, embedding_dimension] embeddings = self.LayerNorm(embeddings) embeddings = self.dropout(embeddings) return embeddings class BertSelfAttention(nn.Module): """自注意力机制层, 见Transformer(一), 讲编码器(encoder)的第2部分""" def __init__(self, config): super(BertSelfAttention, self).__init__() # 判断embedding dimension是否可以被num_attention_heads整除 if config.hidden_size % config.num_attention_heads != 0: raise ValueError( "The hidden size (%d) is not a multiple of the number of attention " "heads (%d)" % (config.hidden_size, config.num_attention_heads)) self.num_attention_heads = config.num_attention_heads self.attention_head_size = int(config.hidden_size / config.num_attention_heads) self.all_head_size = self.num_attention_heads * self.attention_head_size # Q, K, V线性映射 self.query = nn.Linear(config.hidden_size, self.all_head_size) self.key = nn.Linear(config.hidden_size, self.all_head_size) self.value = nn.Linear(config.hidden_size, self.all_head_size) self.dropout = nn.Dropout(config.attention_probs_dropout_prob) def transpose_for_scores(self, x): # 输入x为QKV中的一个, 维度: [batch_size, seq_length, embedding_dim] # 输出的维度经过reshape和转置: [batch_size, num_heads, seq_length, embedding_dim / num_heads] new_x_shape = x.size()[:-1] + (self.num_attention_heads, self.attention_head_size) x = x.view(*new_x_shape) return x.permute(0, 2, 1, 3) def forward(self, hidden_states, attention_mask, get_attention_matrices=False): # Q, K, V线性映射 # Q, K, V的维度为[batch_size, seq_length, num_heads * embedding_dim] mixed_query_layer = self.query(hidden_states) mixed_key_layer = self.key(hidden_states) mixed_value_layer = self.value(hidden_states) # 把QKV分割成num_heads份 # 把维度转换为[batch_size, num_heads, seq_length, embedding_dim / num_heads] query_layer = self.transpose_for_scores(mixed_query_layer) key_layer = self.transpose_for_scores(mixed_key_layer) value_layer = self.transpose_for_scores(mixed_value_layer) # Take the dot product between "query" and "key" to get the raw attention scores. # Q与K求点积 attention_scores = torch.matmul(query_layer, key_layer.transpose(-1, -2)) # attention_scores: [batch_size, num_heads, seq_length, seq_length] # 除以K的dimension, 开平方根以归一为标准正态分布 attention_scores = attention_scores / math.sqrt(self.attention_head_size) # Apply the attention mask is (precomputed for all layers in BertModel forward() function) attention_scores = attention_scores + attention_mask # attention_mask 注意力矩阵mask: [batch_size, 1, 1, seq_length] # 元素相加后, 会广播到维度: [batch_size, num_heads, seq_length, seq_length] # softmax归一化, 得到注意力矩阵 # Normalize the attention scores to probabilities. attention_probs_ = nn.Softmax(dim=-1)(attention_scores) # This is actually dropping out entire tokens to attend to, which might # seem a bit unusual, but is taken from the original Transformer paper. attention_probs = self.dropout(attention_probs_) # 用注意力矩阵加权V context_layer = torch.matmul(attention_probs, value_layer) # 把加权后的V reshape, 得到[batch_size, length, embedding_dimension] context_layer = context_layer.permute(0, 2, 1, 3).contiguous() new_context_layer_shape = context_layer.size()[:-2] + (self.all_head_size,) context_layer = context_layer.view(*new_context_layer_shape) # 输出attention矩阵用来可视化 if get_attention_matrices: return context_layer, attention_probs_ return context_layer, None class BertLayerNorm(nn.Module): """LayerNorm层, 见Transformer(一), 讲编码器(encoder)的第3部分""" def __init__(self, hidden_size, eps=1e-12): """Construct a layernorm module in the TF style (epsilon inside the square root). """ super(BertLayerNorm, self).__init__() self.weight = nn.Parameter(torch.ones(hidden_size)) self.bias = nn.Parameter(torch.zeros(hidden_size)) self.variance_epsilon = eps def forward(self, x): u = x.mean(-1, keepdim=True) s = (x - u).pow(2).mean(-1, keepdim=True) x = (x - u) / torch.sqrt(s + self.variance_epsilon) return self.weight * x + self.bias class BertSelfOutput(nn.Module): # 封装的LayerNorm和残差连接, 用于处理SelfAttention的输出 def __init__(self, config): super(BertSelfOutput, self).__init__() self.dense = nn.Linear(config.hidden_size, config.hidden_size) self.LayerNorm = BertLayerNorm(config.hidden_size, eps=1e-12) self.dropout = nn.Dropout(config.hidden_dropout_prob) def forward(self, hidden_states, input_tensor): hidden_states = self.dense(hidden_states) hidden_states = self.dropout(hidden_states) hidden_states = self.LayerNorm(hidden_states + input_tensor) return hidden_states class BertAttention(nn.Module): # 封装的多头注意力机制部分, 包括LayerNorm和残差连接 def __init__(self, config): super(BertAttention, self).__init__() self.self = BertSelfAttention(config) self.output = BertSelfOutput(config) def forward(self, input_tensor, attention_mask, get_attention_matrices=False): self_output, attention_matrices = self.self(input_tensor, attention_mask, get_attention_matrices=get_attention_matrices) attention_output = self.output(self_output, input_tensor) return attention_output, attention_matrices class BertIntermediate(nn.Module): # 封装的FeedForward层和激活层 def __init__(self, config): super(BertIntermediate, self).__init__() self.dense = nn.Linear(config.hidden_size, config.intermediate_size) self.intermediate_act_fn = ACT2FN[config.hidden_act] def forward(self, hidden_states): hidden_states = self.dense(hidden_states) hidden_states = self.intermediate_act_fn(hidden_states) return hidden_states class BertOutput(nn.Module): # 封装的LayerNorm和残差连接, 用于处理FeedForward层的输出 def __init__(self, config): super(BertOutput, self).__init__() self.dense = nn.Linear(config.intermediate_size, config.hidden_size) self.LayerNorm = BertLayerNorm(config.hidden_size, eps=1e-12) self.dropout = nn.Dropout(config.hidden_dropout_prob) def forward(self, hidden_states, input_tensor): hidden_states = self.dense(hidden_states) hidden_states = self.dropout(hidden_states) hidden_states = self.LayerNorm(hidden_states + input_tensor) return hidden_states class BertLayer(nn.Module): # 一个transformer block def __init__(self, config): super(BertLayer, self).__init__() self.attention = BertAttention(config) self.intermediate = BertIntermediate(config) self.output = BertOutput(config) def forward(self, hidden_states, attention_mask, get_attention_matrices=False): # Attention层(包括LayerNorm和残差连接) attention_output, attention_matrices = self.attention(hidden_states, attention_mask, get_attention_matrices=get_attention_matrices) # FeedForward层 intermediate_output = self.intermediate(attention_output) # LayerNorm与残差连接输出层 layer_output = self.output(intermediate_output, attention_output) return layer_output, attention_matrices class BertEncoder(nn.Module): # transformer blocks * N def __init__(self, config): super(BertEncoder, self).__init__() layer = BertLayer(config) # 复制N个transformer block self.layer = nn.ModuleList([copy.deepcopy(layer) for _ in range(config.num_hidden_layers)]) def forward(self, hidden_states, attention_mask, output_all_encoded_layers=True, get_attention_matrices=False): """ :param output_all_encoded_layers: 是否输出每一个transformer block的隐藏层计算结果 :param get_attention_matrices: 是否输出注意力矩阵, 可用于可视化 """ all_attention_matrices = [] all_encoder_layers = [] for layer_module in self.layer: hidden_states, attention_matrices = layer_module(hidden_states, attention_mask, get_attention_matrices=get_attention_matrices) if output_all_encoded_layers: all_encoder_layers.append(hidden_states) all_attention_matrices.append(attention_matrices) if not output_all_encoded_layers: all_encoder_layers.append(hidden_states) all_attention_matrices.append(attention_matrices) return all_encoder_layers, all_attention_matrices class BertPooler(nn.Module): """Pooler是把隐藏层(hidden state)中对应#CLS#的token的一条提取出来的功能""" def __init__(self, config): super(BertPooler, self).__init__() self.dense = nn.Linear(config.hidden_size, config.hidden_size) self.activation = nn.Tanh() def forward(self, hidden_states): # We "pool" the model by simply taking the hidden state corresponding # to the first token. first_token_tensor = hidden_states[:, 0] pooled_output = self.dense(first_token_tensor) pooled_output = self.activation(pooled_output) return pooled_output # 线性映射, 激活, LayerNorm class BertPredictionHeadTransform(nn.Module): def __init__(self, config): super(BertPredictionHeadTransform, self).__init__() self.dense = nn.Linear(config.hidden_size, config.hidden_size) self.transform_act_fn = ACT2FN[config.hidden_act] self.LayerNorm = BertLayerNorm(config.hidden_size, eps=1e-12) def forward(self, hidden_states): hidden_states = self.dense(hidden_states) hidden_states = self.transform_act_fn(hidden_states) hidden_states = self.LayerNorm(hidden_states) return hidden_states class BertLMPredictionHead(nn.Module): def __init__(self, config, bert_model_embedding_weights): super(BertLMPredictionHead, self).__init__() # 线性映射, 激活, LayerNorm self.transform = BertPredictionHeadTransform(config) # The output weights are the same as the input embeddings, but there is # an output-only bias for each token. self.decoder = nn.Linear(bert_model_embedding_weights.size(1), bert_model_embedding_weights.size(0), bias=False) """上面是创建一个线性映射层, 把transformer block输出的[batch_size, seq_len, embed_dim] 映射为[batch_size, seq_len, vocab_size], 也就是把最后一个维度映射成字典中字的数量, 获取MaskedLM的预测结果, 注意这里其实也可以直接矩阵成embedding矩阵的转置, 但一般情况下我们要随机初始化新的一层参数 """ self.decoder.weight = bert_model_embedding_weights self.bias = nn.Parameter(torch.zeros(bert_model_embedding_weights.size(0))) def forward(self, hidden_states): hidden_states = self.transform(hidden_states) hidden_states = self.decoder(hidden_states) + self.bias return hidden_states # BERT的训练中通过隐藏层输出Masked LM的预测和Next Sentence的预测 class BertPreTrainingHeads(nn.Module): """ BERT的训练中通过隐藏层输出Masked LM的预测和Next Sentence的预测 """ def __init__(self, config, bert_model_embedding_weights): super(BertPreTrainingHeads, self).__init__() self.predictions = BertLMPredictionHead(config, bert_model_embedding_weights) # 把transformer block输出的[batch_size, seq_len, embed_dim] # 映射为[batch_size, seq_len, vocab_size] # 用来进行MaskedLM的预测 self.seq_relationship = nn.Linear(config.hidden_size, 2) # 用来把pooled_output也就是对应#CLS#的那一条向量映射为2分类 # 用来进行Next Sentence的预测 def forward(self, sequence_output, pooled_output): prediction_scores = self.predictions(sequence_output) seq_relationship_score = self.seq_relationship(pooled_output) return prediction_scores, seq_relationship_score # 用来初始化模型参数 class BertPreTrainedModel(nn.Module): """ An abstract class to handle weights initialization and a simple interface for dowloading and loading pretrained models. 用来初始化模型参数 """ def __init__(self, config, *inputs, **kwargs): super(BertPreTrainedModel, self).__init__() if not isinstance(config, BertConfig): raise ValueError( "Parameter config in `{}(config)` should be an instance of class `BertConfig`. " "To create a model from a Google pretrained model use " "`model = {}.from_pretrained(PRETRAINED_MODEL_NAME)`".format( self.__class__.__name__, self.__class__.__name__ )) self.config = config def init_bert_weights(self, module): """ Initialize the weights. """ if isinstance(module, (nn.Linear)): # 初始线性映射层的参数为正态分布 module.weight.data.normal_(mean=0.0, std=self.config.initializer_range) elif isinstance(module, BertLayerNorm): # 初始化LayerNorm中的alpha为全1, beta为全0 module.bias.data.zero_() module.weight.data.fill_(1.0) if isinstance(module, nn.Linear) and module.bias is not None: # 初始化偏置为0 module.bias.data.zero_() class BertModel(BertPreTrainedModel): """BERT model ("Bidirectional Embedding Representations from a Transformer"). Params: config: a BertConfig class instance with the configuration to build a new model Inputs: `input_ids`: a torch.LongTensor of shape [batch_size, sequence_length] with the word token indices in the vocabulary(see the tokens preprocessing logic in the scripts `extract_features.py`, `run_classifier.py` and `run_squad.py`) `token_type_ids`: an optional torch.LongTensor of shape [batch_size, sequence_length] with the token types indices selected in [0, 1]. Type 0 corresponds to a `sentence A` and type 1 corresponds to a `sentence B` token (see BERT paper for more details). `attention_mask`: an optional torch.LongTensor of shape [batch_size, sequence_length] with indices selected in [0, 1]. It's a mask to be used if the input sequence length is smaller than the max input sequence length in the current batch. It's the mask that we typically use for attention when a batch has varying length sentences. `output_all_encoded_layers`: boolean which controls the content of the `encoded_layers` output as described below. Default: `True`. Outputs: Tuple of (encoded_layers, pooled_output) `encoded_layers`: controled by `output_all_encoded_layers` argument: - `output_all_encoded_layers=True`: outputs a list of the full sequences of encoded-hidden-states at the end of each attention block (i.e. 12 full sequences for BERT-base, 24 for BERT-large), each encoded-hidden-state is a torch.FloatTensor of size [batch_size, sequence_length, hidden_size], - `output_all_encoded_layers=False`: outputs only the full sequence of hidden-states corresponding to the last attention block of shape [batch_size, sequence_length, hidden_size], `pooled_output`: a torch.FloatTensor of size [batch_size, hidden_size] which is the output of a classifier pretrained on top of the hidden state associated to the first character of the input (`CLS`) to train on the Next-Sentence task (see BERT's paper). Example usage: ```python # Already been converted into WordPiece token ids input_ids = torch.LongTensor([[31, 51, 99], [15, 5, 0]]) input_mask = torch.LongTensor([[1, 1, 1], [1, 1, 0]]) token_type_ids = torch.LongTensor([[0, 0, 1], [0, 1, 0]]) config = modeling.BertConfig(vocab_size_or_config_json_file=32000, hidden_size=768, num_hidden_layers=12, num_attention_heads=12, intermediate_size=3072) model = modeling.BertModel(config=config) all_encoder_layers, pooled_output = model(input_ids, token_type_ids, input_mask) ``` """ def __init__(self, config): super(BertModel, self).__init__(config) self.embeddings = BertEmbeddings(config) self.encoder = BertEncoder(config) self.pooler = BertPooler(config) self.apply(self.init_bert_weights) def forward(self, input_ids, positional_enc, token_type_ids=None, attention_mask=None, output_all_encoded_layers=True, get_attention_matrices=False): if attention_mask is None: # torch.LongTensor # attention_mask = torch.ones_like(input_ids) attention_mask = (input_ids > 0) # attention_mask [batch_size, length] if token_type_ids is None: token_type_ids = torch.zeros_like(input_ids) # We create a 3D attention mask from a 2D tensor mask. # Sizes are [batch_size, 1, 1, to_seq_length] # So we can broadcast to [batch_size, num_heads, from_seq_length, to_seq_length] # this attention mask is more simple than the triangular masking of causal attention # used in OpenAI GPT, we just need to prepare the broadcast dimension here. extended_attention_mask = attention_mask.unsqueeze(1).unsqueeze(2) # 注意力矩阵mask: [batch_size, 1, 1, seq_length] # Since attention_mask is 1.0 for positions we want to attend and 0.0 for # masked positions, this operation will create a tensor which is 0.0 for # positions we want to attend and -10000.0 for masked positions. # Since we are adding it to the raw scores before the softmax, this is # effectively the same as removing these entirely. extended_attention_mask = extended_attention_mask.to(dtype=next(self.parameters()).dtype) # fp16 compatibility extended_attention_mask = (1.0 - extended_attention_mask) * -10000.0 # 给注意力矩阵里padding的无效区域加一个很大的负数的偏置, 为了使softmax之后这些无效区域仍然为0, 不参与后续计算 # embedding层 embedding_output = self.embeddings(input_ids, positional_enc, token_type_ids) # 经过所有定义的transformer block之后的输出 encoded_layers, all_attention_matrices = self.encoder(embedding_output, extended_attention_mask, output_all_encoded_layers=output_all_encoded_layers, get_attention_matrices=get_attention_matrices) # 可输出所有层的注意力矩阵用于可视化 if get_attention_matrices: return all_attention_matrices # [-1]为最后一个transformer block的隐藏层的计算结果 sequence_output = encoded_layers[-1] # pooled_output为隐藏层中#CLS#对应的token的一条向量 pooled_output = self.pooler(sequence_output) if not output_all_encoded_layers: encoded_layers = encoded_layers[-1] return encoded_layers, pooled_output class BertForPreTraining(BertPreTrainedModel): """BERT model with pre-training heads. This module comprises the BERT model followed by the two pre-training heads: - the masked language modeling head, and - the next sentence classification head. Params: config: a BertConfig class instance with the configuration to build a new model. Inputs: `input_ids`: a torch.LongTensor of shape [batch_size, sequence_length] with the word token indices in the vocabulary(see the tokens preprocessing logic in the scripts `extract_features.py`, `run_classifier.py` and `run_squad.py`) `token_type_ids`: an optional torch.LongTensor of shape [batch_size, sequence_length] with the token types indices selected in [0, 1]. Type 0 corresponds to a `sentence A` and type 1 corresponds to a `sentence B` token (see BERT paper for more details). `attention_mask`: an optional torch.LongTensor of shape [batch_size, sequence_length] with indices selected in [0, 1]. It's a mask to be used if the input sequence length is smaller than the max input sequence length in the current batch. It's the mask that we typically use for attention when a batch has varying length sentences. `masked_lm_labels`: optional masked language modeling labels: torch.LongTensor of shape [batch_size, sequence_length] with indices selected in [-1, 0, ..., vocab_size]. All labels set to -1 are ignored (masked), the loss is only computed for the labels set in [0, ..., vocab_size] `next_sentence_label`: optional next sentence classification loss: torch.LongTensor of shape [batch_size] with indices selected in [0, 1]. 0 => next sentence is the continuation, 1 => next sentence is a random sentence. Outputs: if `masked_lm_labels` and `next_sentence_label` are not `None`: Outputs the total_loss which is the sum of the masked language modeling loss and the next sentence classification loss. if `masked_lm_labels` or `next_sentence_label` is `None`: Outputs a tuple comprising - the masked language modeling logits of shape [batch_size, sequence_length, vocab_size], and - the next sentence classification logits of shape [batch_size, 2]. Example usage: ```python # Already been converted into WordPiece token ids input_ids = torch.LongTensor([[31, 51, 99], [15, 5, 0]]) input_mask = torch.LongTensor([[1, 1, 1], [1, 1, 0]]) token_type_ids = torch.LongTensor([[0, 0, 1], [0, 1, 0]]) config = BertConfig(vocab_size_or_config_json_file=32000, hidden_size=768, num_hidden_layers=12, num_attention_heads=12, intermediate_size=3072) model = BertForPreTraining(config) masked_lm_logits_scores, seq_relationship_logits = model(input_ids, token_type_ids, input_mask) ``` """ def __init__(self, config): super(BertForPreTraining, self).__init__(config) self.bert = BertModel(config) self.cls = BertPreTrainingHeads(config, self.bert.embeddings.word_embeddings.weight) self.apply(self.init_bert_weights) self.vocab_size = config.vocab_size self.next_loss_func = CrossEntropyLoss() self.mlm_loss_func = CrossEntropyLoss(ignore_index=0) def compute_loss(self, predictions, labels, num_class=2, ignore_index=-100): loss_func = CrossEntropyLoss(ignore_index=ignore_index) return loss_func(predictions.view(-1, num_class), labels.view(-1)) def forward(self, input_ids, positional_enc, token_type_ids=None, attention_mask=None, masked_lm_labels=None, next_sentence_label=None): sequence_output, pooled_output = self.bert(input_ids, positional_enc, token_type_ids, attention_mask, output_all_encoded_layers=False) mlm_preds, next_sen_preds = self.cls(sequence_output, pooled_output) return mlm_preds, next_sen_preds
{ "pile_set_name": "Github" }
/* * Copyright (c) 2004 Lubos Lunak <[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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <QCommandLineParser> #include <QApplication> #include <kconfig.h> #include <KLocalizedString> #include <kwindowsystem.h> #include "rulebooksettings.h" #include "rulesdialog.h" #include "../../rules.h" #include <QByteArray> #include <QDBusConnection> #include <QDBusMessage> #include <QDBusPendingCallWatcher> #include <QDBusPendingReply> #include <QUuid> Q_DECLARE_METATYPE(NET::WindowType) namespace KWin { static Rules *findRule(const QVector<Rules *> &rules, const QVariantMap &data, bool whole_app) { QByteArray wmclass_class = data.value("resourceClass").toByteArray().toLower(); QByteArray wmclass_name = data.value("resourceName").toByteArray().toLower(); QByteArray role = data.value("role").toByteArray().toLower(); NET::WindowType type = data.value("type").value<NET::WindowType>(); QString title = data.value("caption").toString(); QByteArray machine = data.value("clientMachine").toByteArray(); Rules* best_match = nullptr; int match_quality = 0; for (const auto rule : rules) { // try to find an exact match, i.e. not a generic rule int quality = 0; bool generic = true; if (rule->wmclassmatch != Rules::ExactMatch) continue; // too generic if (!rule->matchWMClass(wmclass_class, wmclass_name)) continue; // from now on, it matches the app - now try to match for a specific window if (rule->wmclasscomplete) { quality += 1; generic = false; // this can be considered specific enough (old X apps) } if (!whole_app) { if (rule->windowrolematch != Rules::UnimportantMatch) { quality += rule->windowrolematch == Rules::ExactMatch ? 5 : 1; generic = false; } if (rule->titlematch != Rules::UnimportantMatch) { quality += rule->titlematch == Rules::ExactMatch ? 3 : 1; generic = false; } if (rule->types != NET::AllTypesMask) { int bits = 0; for (unsigned int bit = 1; bit < 1U << 31; bit <<= 1) if (rule->types & bit) ++bits; if (bits == 1) quality += 2; } if (generic) // ignore generic rules, use only the ones that are for this window continue; } else { if (rule->types == NET::AllTypesMask) quality += 2; } if (!rule->matchType(type) || !rule->matchRole(role) || !rule->matchTitle(title) || !rule->matchClientMachine(machine, data.value("localhost").toBool())) continue; if (quality > match_quality) { best_match = rule; match_quality = quality; } } if (best_match != nullptr) return best_match; Rules* ret = new Rules; if (whole_app) { ret->description = i18n("Application settings for %1", QString::fromLatin1(wmclass_class)); // TODO maybe exclude some types? If yes, then also exclude them above // when searching. ret->types = NET::AllTypesMask; ret->titlematch = Rules::UnimportantMatch; ret->clientmachine = machine; // set, but make unimportant ret->clientmachinematch = Rules::UnimportantMatch; ret->windowrolematch = Rules::UnimportantMatch; if (wmclass_name == wmclass_class) { ret->wmclasscomplete = false; ret->wmclass = wmclass_class; ret->wmclassmatch = Rules::ExactMatch; } else { // WM_CLASS components differ - perhaps the app got -name argument ret->wmclasscomplete = true; ret->wmclass = wmclass_name + ' ' + wmclass_class; ret->wmclassmatch = Rules::ExactMatch; } return ret; } ret->description = i18n("Window settings for %1", QString::fromLatin1(wmclass_class)); if (type == NET::Unknown) ret->types = NET::NormalMask; else ret->types = NET::WindowTypeMask( 1 << type); // convert type to its mask ret->title = title; // set, but make unimportant ret->titlematch = Rules::UnimportantMatch; ret->clientmachine = machine; // set, but make unimportant ret->clientmachinematch = Rules::UnimportantMatch; if (!role.isEmpty() && role != "unknown" && role != "unnamed") { // Qt sets this if not specified ret->windowrole = role; ret->windowrolematch = Rules::ExactMatch; if (wmclass_name == wmclass_class) { ret->wmclasscomplete = false; ret->wmclass = wmclass_class; ret->wmclassmatch = Rules::ExactMatch; } else { // WM_CLASS components differ - perhaps the app got -name argument ret->wmclasscomplete = true; ret->wmclass = wmclass_name + ' ' + wmclass_class; ret->wmclassmatch = Rules::ExactMatch; } } else { // no role set if (wmclass_name != wmclass_class) { ret->wmclasscomplete = true; ret->wmclass = wmclass_name + ' ' + wmclass_class; ret->wmclassmatch = Rules::ExactMatch; } else { // This is a window that has no role set, and both components of WM_CLASS // match (possibly only differing in case), which most likely means either // the application doesn't give a damn about distinguishing its various // windows, or it's an app that uses role for that, but this window // lacks it for some reason. Use non-complete WM_CLASS matching, also // include window title in the matching, and pray it causes many more positive // matches than negative matches. ret->titlematch = Rules::ExactMatch; ret->wmclasscomplete = false; ret->wmclass = wmclass_class; ret->wmclassmatch = Rules::ExactMatch; } } return ret; } static void edit(const QVariantMap &data, bool whole_app) { RuleBookSettings settings(KConfig::NoGlobals); QVector<Rules *> rules = settings.rules(); Rules *orig_rule = findRule(rules, data, whole_app); RulesDialog dlg; if (whole_app) dlg.setWindowTitle(i18nc("Window caption for the application wide rules dialog", "Edit Application-Specific Settings")); // dlg.edit() creates new Rules instance if edited Rules* edited_rule = dlg.edit(orig_rule, data, true); if (edited_rule == nullptr || edited_rule->isEmpty()) { rules.removeAll(orig_rule); delete orig_rule; if (orig_rule != edited_rule) delete edited_rule; } else if (edited_rule != orig_rule) { int pos = rules.indexOf(orig_rule); if (pos != -1) rules[ pos ] = edited_rule; else rules.prepend(edited_rule); delete orig_rule; } settings.setRules(rules); settings.save(); // Send signal to all kwin instances QDBusMessage message = QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); QDBusConnection::sessionBus().send(message); qApp->quit(); } } // namespace int main(int argc, char* argv[]) { QApplication app(argc, argv); app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); app.setApplicationDisplayName(i18n("KWin")); app.setApplicationName("kwin_rules_dialog"); app.setApplicationVersion("1.0"); bool whole_app = false; QUuid uuid; { QCommandLineParser parser; parser.setApplicationDescription(i18n("KWin helper utility")); parser.addOption(QCommandLineOption("uuid", i18n("KWin id of the window for special window settings."), "uuid")); parser.addOption(QCommandLineOption("whole-app", i18n("Whether the settings should affect all windows of the application."))); parser.process(app); uuid = QUuid::fromString(parser.value("uuid")); whole_app = parser.isSet("whole-app"); } if (uuid.isNull()) { printf("%s\n", qPrintable(i18n("This helper utility is not supposed to be called directly."))); return 1; } QDBusMessage message = QDBusMessage::createMethodCall(QStringLiteral("org.kde.KWin"), QStringLiteral("/KWin"), QStringLiteral("org.kde.KWin"), QStringLiteral("getWindowInfo")); message.setArguments({uuid.toString()}); QDBusPendingReply<QVariantMap> async = QDBusConnection::sessionBus().asyncCall(message); QDBusPendingCallWatcher *callWatcher = new QDBusPendingCallWatcher(async, &app); QObject::connect(callWatcher, &QDBusPendingCallWatcher::finished, &app, [&whole_app] (QDBusPendingCallWatcher *self) { QDBusPendingReply<QVariantMap> reply = *self; self->deleteLater(); if (!reply.isValid() || reply.value().isEmpty()) { qApp->quit(); return; } KWin::edit(reply.value(), whole_app); } ); return app.exec(); }
{ "pile_set_name": "Github" }
1270 1565596821906 httpcache-v1 Method: POST URL: https://www.notion.so/api/v3/getRecordValues Body:+110 { "requests": [ { "id": "1ffeb517-3152-4568-acf5-425070e8ec9b", "table": "block" } ] } Response:+1070 { "results": [ { "role": "comment_only", "value": { "alive": true, "content": [ "1c202c7a-fb90-4dd4-9694-d08332f38975", "791311b5-199c-4764-a2ca-6ba2909a3098", "6daff036-0e35-4408-acb4-95f2dec10b71", "497db9e4-ff95-4bb2-9b51-c3bbf0d2ab50", "53ec1eb7-ca3d-4cb3-bb8f-975508490251" ], "created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "created_time": 1550443843169, "format": { "page_full_width": true, "page_small_text": true }, "id": "1ffeb517-3152-4568-acf5-425070e8ec9b", "ignore_block_count": true, "last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "last_edited_time": 1550443843169, "parent_id": "ffa90cd3-3eea-424c-8f80-34de4ba10bac", "parent_table": "block", "properties": { "title": [ [ "Define a color state list" ] ] }, "type": "page", "version": 3 } } ] } 23873 1565596821907 httpcache-v1 Method: POST URL: https://www.notion.so/api/v3/loadPageChunk Body:+152 { "chunkNumber": 0, "cursor": { "stack": [] }, "limit": 50, "pageId": "1ffeb517-3152-4568-acf5-425070e8ec9b", "verticalColumns": false } Response:+23632 { "cursor": { "stack": [] }, "recordMap": { "block": { "1c202c7a-fb90-4dd4-9694-d08332f38975": { "role": "comment_only", "value": { "alive": true, "created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "created_time": 1550443843166, "id": "1c202c7a-fb90-4dd4-9694-d08332f38975", "ignore_block_count": true, "last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "last_edited_time": 1550443843166, "parent_id": "1ffeb517-3152-4568-acf5-425070e8ec9b", "parent_table": "block", "properties": { "title": [ [ "Color state lists can be used as colors, but will change depending on the state of the view they are used for." ] ] }, "type": "text", "version": 1 } }, "1ffeb517-3152-4568-acf5-425070e8ec9b": { "role": "comment_only", "value": { "alive": true, "content": [ "1c202c7a-fb90-4dd4-9694-d08332f38975", "791311b5-199c-4764-a2ca-6ba2909a3098", "6daff036-0e35-4408-acb4-95f2dec10b71", "497db9e4-ff95-4bb2-9b51-c3bbf0d2ab50", "53ec1eb7-ca3d-4cb3-bb8f-975508490251" ], "created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "created_time": 1550443843169, "format": { "page_full_width": true, "page_small_text": true }, "id": "1ffeb517-3152-4568-acf5-425070e8ec9b", "ignore_block_count": true, "last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "last_edited_time": 1550443843169, "parent_id": "ffa90cd3-3eea-424c-8f80-34de4ba10bac", "parent_table": "block", "properties": { "title": [ [ "Define a color state list" ] ] }, "type": "page", "version": 3 } }, "497db9e4-ff95-4bb2-9b51-c3bbf0d2ab50": { "role": "comment_only", "value": { "alive": true, "created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "created_time": 1550443843169, "id": "497db9e4-ff95-4bb2-9b51-c3bbf0d2ab50", "ignore_block_count": true, "last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "last_edited_time": 1550443843169, "parent_id": "1ffeb517-3152-4568-acf5-425070e8ec9b", "parent_table": "block", "properties": { "title": [ [ "Items are evaluated in the order they are defined, and the first item whose specified states match the current state of the view is used. So it’s a good practice to specify a catch-all at the end, without any state selectors specified." ] ] }, "type": "text", "version": 1 } }, "53ec1eb7-ca3d-4cb3-bb8f-975508490251": { "role": "comment_only", "value": { "alive": true, "created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "created_time": 1550443843169, "id": "53ec1eb7-ca3d-4cb3-bb8f-975508490251", "ignore_block_count": true, "last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "last_edited_time": 1550443843169, "parent_id": "1ffeb517-3152-4568-acf5-425070e8ec9b", "parent_table": "block", "properties": { "title": [ [ "Each item can either use a color literal, or reference a color defined somewhere else." ] ] }, "type": "text", "version": 1 } }, "6daff036-0e35-4408-acb4-95f2dec10b71": { "role": "comment_only", "value": { "alive": true, "created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "created_time": 1550443843169, "id": "6daff036-0e35-4408-acb4-95f2dec10b71", "ignore_block_count": true, "last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "last_edited_time": 1550443843169, "parent_id": "1ffeb517-3152-4568-acf5-425070e8ec9b", "parent_table": "block", "properties": { "language": [ [ "Plain Text" ] ], "title": [ [ "\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cselector xmlns:android=\"http://schemas.android.com/apk/res/android\"\u003e\n \u003citem android:color=\"#888888\" android:state_enabled=\"false\"/\u003e\n \u003citem android:color=\"@color/lightGray\" android:state_selected=\"false\"/\u003e\n \u003citem android:color=\"@android:color/white\" /\u003e\n\u003c/selector\u003e" ] ] }, "type": "code", "version": 1 } }, "791311b5-199c-4764-a2ca-6ba2909a3098": { "role": "comment_only", "value": { "alive": true, "created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "created_time": 1550443843168, "id": "791311b5-199c-4764-a2ca-6ba2909a3098", "ignore_block_count": true, "last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "last_edited_time": 1550443843168, "parent_id": "1ffeb517-3152-4568-acf5-425070e8ec9b", "parent_table": "block", "properties": { "title": [ [ "To define one, create a resource file in " ], [ "res/color/foo.xml", [ [ "c" ] ] ] ] }, "type": "text", "version": 1 } }, "f90b0a6b-6483-43e2-8dc5-ed6e8f5c0780": { "role": "comment_only", "value": { "alive": true, "content": [ "27fdf592-c1e2-48bf-ad9e-f2f466767a20", "354073c9-7040-4528-8c35-dbbbf7992ed5", "40c765e7-6562-4ee9-8ed0-8024e3def515", "b9098913-7e61-4386-8d02-ca92ab88b324", "f23a5cf1-4ba4-434a-b57a-4f6b72fa1dfd", "4b7449f0-077a-4e41-841b-d5c551629808", "f7aa3cbf-18e0-4aee-8ec1-725bd9ccb0bc", "b12b5220-f26c-4aeb-8130-af5506f0f546", "ffa90cd3-3eea-424c-8f80-34de4ba10bac", "3cf74dd2-01e2-497e-a2e0-ef450e2751fd", "60c44f62-2826-4f4e-b62c-62999d7b5b08", "b504a8f4-8c84-4c2e-8acd-bca678ce8ae8", "58b149d4-6a66-400d-bae4-6d84bc9e8211", "b81f95e2-9af4-43b2-ae8a-eacf3d61b9e0", "dad79538-df78-4fb3-ab61-93449f54b92e", "e5da3f10-048a-4ac6-8dfe-d0f8b834b9b8", "09fb42bc-c08a-479e-85ec-dcd14413d8e1", "9cd3cdb2-fb8b-4bc2-916b-a38f0022b43b", "a2530ba9-8b01-4c7b-ad00-037bf9f232a2", "20f73399-dea2-4d47-bee6-68060ec883f9", "3061cbb2-214c-4375-b975-440c3b41e566", "577ee794-a9c3-4ded-8824-6307ea4044f3", "e851dd0d-078a-4cf4-b0e2-4fb9a34577ba", "daef7c65-a1e3-4cb4-a562-7e81aabc337c", "edbd8f8d-6b57-43d2-9269-0b0cf3e6165c", "ae4c3948-e722-49ba-a5df-65778b9c1e91", "b698fa46-dece-4676-a681-eecc1a3388d2", "7519d0d9-ef43-40c7-bea1-eb520af1f62f", "f2b20dc9-ee75-45ae-b0ee-88e0ced263c9", "2d6f6857-e53d-4b60-b433-e156d81c55e5", "1096b9a5-3f3a-425e-ac66-0adc4166be45", "6190cb6e-dc43-458e-9fc6-34c0e0c69fa6", "b33bd62e-4631-43c5-a9ae-ac47eadfb3e0", "e5dfd590-a7f4-4ea2-b744-e87d7d45fabf", "e5dbc80b-9ce3-4932-9808-0a7fbefb59b3", "2bfda67f-291e-4f52-a037-53bdbbc944bc", "7145866f-7d62-48b0-a57b-66c494eb5a9f", "3ffccc71-cbb9-4ebc-8ff8-78efb3575845", "3fe483f2-e060-41f7-9bc7-8fa4711fa6bb", "826a2947-547d-46b5-8714-0282f94a1967", "45ae2e3d-3201-45c2-9924-4c3dd873a5c3", "1ef1aff9-7d3c-456d-abfd-937eb8756547", "6a6fe5f1-6362-47c6-bac7-61c76a0a464d", "fad6acf8-b0d5-4770-85ab-bd87a2e5410d", "f505a59f-f887-4749-88d5-2d8b5be7947f", "621f346c-f9c6-4d5c-8e6e-6106d643fcce", "6a7c57a2-8f24-43b5-974d-d38ab99fdee8", "80a93a9d-a581-423a-8907-8a480a93f52d", "6ffff372-f722-4664-9978-ad7101e6d3c6", "cf2c473f-5e00-4648-971f-43398123cc33", "1930100d-c8dd-4c8d-ab3f-7ad60a4616a4", "6349c926-1894-426b-9bd7-9ce6b6ce8b2f", "f5d212d3-d5ba-4aa5-b670-a737a4d6a212", "19ac457b-73f1-4fa2-960e-88f42ddbee76", "42ecfc4e-4f11-4487-8d7a-15abe78a4672", "3d7c457d-2120-4fab-9620-ddd6e746e8ef", "c170b80b-c39f-46ce-b311-2debae2f2082", "14ad6c73-b15c-4c75-8f07-1c859944f790", "16002345-cebc-40e9-8de5-7cc0659be0f3", "331f90f3-9311-486a-8bcd-c5e4e171ee84", "2e2716b4-5b9a-4670-8a00-377992b3a547", "9cbb47b7-a65c-4cc4-865d-1a66536aefa1", "7bedcd95-c04f-4865-a298-247d34206277", "8abb0bb2-e8f7-4eec-bab7-3a47c7c1bffd", "5186a864-9440-434b-b19a-c32d326a3fef", "e8b25d81-c867-4e20-8829-1264867cb1b8", "e3584a94-a9f0-4362-8875-ecc7887d08a7", "47b7faa3-6e5d-420d-8798-507e43f9639f", "9c91430d-940a-46b8-894c-258836f7d0f4", "f16ce3be-cc8a-428d-aa92-06106c08bb78", "322f7adc-aa8e-4dd0-90bc-e3822856448b", "6f9a7fa3-564a-46a2-a9f0-375a21c8e251", "c5099681-f7f6-42fc-90d3-a6a0ee90f908", "92a41c6c-4c93-4fb6-a347-2f5cf0a7d2db", "199c82a7-fe1c-4163-8405-c17464a5f76c", "9491365b-e249-4a75-ac25-cc1cc02f408f", "22af4132-01f0-4467-9bea-e645f470fd96", "ca11d4e6-9cd7-4136-9232-859b2e1467de", "c78edde1-b73e-43d7-ab97-ddf82241f21f", "a50a635e-1226-4210-baec-32b24d8676e4", "7822bd2e-1f30-4ca7-9aec-dc44e8b70697", "91c05e15-76e6-4d60-ba05-c776f6f8fda9", "b608fb79-1b53-486d-8fde-90d4b61fc2f1", "862b5ddf-f996-490c-9d71-0fcfa7309bad", "095bece4-4a5b-4544-a96a-9b32ab97785f", "4ed76ccc-0516-40c8-97cc-501741884fac", "09da8235-6e71-43ae-825b-1e3ee72d1ad9", "6068a6db-1477-454d-9131-f7d2eef506e8", "32904bc0-ceb7-4a01-b5ef-8a0bf7941852", "6838a528-7474-4647-bef7-4cf6c1e816b5", "3be0ee0d-3f99-4321-870f-1c84f52188a9", "761f15e8-3ef3-4bb0-bef6-598eb45647a6", "d1699fdd-2bda-4161-96bb-2b2502fb6e0a", "db56e9e4-397a-4b38-a33f-a2324e683304", "d75c0cae-6a9d-433a-91d1-96901cb34d26", "95044da4-c747-4fa5-b31f-4fb3ed5adb6c", "4521a76c-21a4-4542-8b83-322d8ffd692c", "5472d135-1ceb-48a7-856f-747de64f3e6b", "c1066830-e268-4ff2-9f0f-37841d485046", "963e797e-dea4-4392-8454-e58d4d898886", "016f7476-6abd-4773-ada7-0c01bafd51ea", "44d0c151-0367-453d-9879-ef7e4d456c6c", "7a899cd4-cc0a-4ef1-b758-42cf9f5b48b9", "8011ec06-ee27-49a4-bcbc-493592df26b0", "574bb08c-f784-4dcb-b2e1-98fb6ef32949", "e1987a71-9e13-4ebe-855e-e347fd6cc937", "9b6546ec-87e7-4f0d-97af-9dd8a76e52a2", "669038f0-8cb0-496b-9673-04b1042e0e5c", "8dc4486d-cab9-46ba-a583-6946731415e6", "03c9507a-d4bc-4e38-a41b-437f05849261", "1e659fc3-474d-4557-a94d-835ee0c85264", "d6acfbca-5bf9-4a01-93a6-9c974a46400e", "2ea54c48-49ac-4fde-be2b-e43bbc4bbf66", "830c8731-8c33-4c19-ae58-4b8ff19d4cc7", "2d77e910-ecf3-4151-95e5-d2476592ed5f", "b4ea2393-6248-4273-be5c-b3ff2586a146", "41515ac4-ab76-4fea-b463-e1a26b6f69bb", "e8c3ea27-aa2b-44ad-a95b-4ea00469fc83", "f752bf5b-91bd-44d1-8388-898770ff7adb", "4d9ab42a-8f21-4c13-9db4-9eecf9315a5d", "0cd1dd2f-b110-4916-a707-6a988d46c973", "a52e40c1-3556-4e99-a114-0488389ebe90", "d5074d5e-8d31-43ae-8069-c4edd1cc1ddb", "c88c7b1a-46a1-4423-b1b9-859c4b025b3d", "4748d604-7768-48d9-86be-1ce724d425ce", "ded10fc3-bae1-4c26-8166-2d92cbfe0f49", "68e828c6-f314-441c-b64a-ba28f0d1cc35", "f337f4f5-1ff3-4215-a0a8-1980b7c8d662", "a4053bc6-4f68-4f49-baf6-41ba500ed7c7", "94542bbc-752e-48c7-ac75-9b3e818d84eb", "3ce1e736-2768-4f19-9c41-5c91c15b7dfb", "51bc39d7-7e67-4f75-bc6d-697297d52287", "f8d5ea25-5e82-4f79-924b-0049690bfc32", "77f833e9-2996-4ded-b5af-7e17de12e8bf", "038616cc-b67b-4c1f-a9ad-af80ec2fb110", "97ef53c0-5293-453a-aff1-0439da147a44", "c5f8b539-4640-4ad9-85bc-1c855ef9dfde", "839cd454-9096-4e4d-9665-a3fb54dd4705", "c47838e4-3cab-4329-a3c4-d1afd70fdcb9", "56e44bd4-0e66-480f-b26a-730a862f5652", "24941973-4747-4d43-8317-8aad489543af", "d61fb0ab-dd90-4099-b2ec-024f6a2c279f", "3d365296-5561-464b-9301-04d4f320fea9", "7948e7ab-b399-4557-8504-4f81f50dc8ec", "8f925deb-b6fa-4c08-9646-5c7646eb4b89", "65a401f2-544a-4a8a-ab65-a3071f51031e", "dc81327b-cb66-4261-865d-bb7d14306f11", "e624cc34-7c87-4335-9bb5-d350a02910f5", "f6365667-18d0-4273-9222-c5586157da7d", "905db9f7-4839-45af-b211-113a4a6999aa", "96cf5a86-7732-431c-be7c-7c753d92a46a", "0af82c96-4dd6-4720-a409-bf67041be6e0", "710dbb9e-bd86-4ba2-a18a-5401a3046ece", "677b8f26-3ed2-4974-8569-2df0f1293a73", "3c934d65-d622-4b05-a0d0-bb5e84d75218", "8dcd9530-0e0f-4f14-b111-afc50cc08324", "2d086d76-fb34-4b13-bbc7-3d5dc05ef97d", "a23d145a-771f-4f05-b84c-07d16a56a6aa", "b240a8de-0f36-4239-9c95-bc79a5dddd40", "8e556e15-f5fd-43fa-bf95-98cee5a7bc8f", "82f1624b-f3af-4c45-a893-f8bca5957cf0", "deb49da5-8f12-4105-b9da-710ff265582f", "524569ba-6a1f-44a4-8a5d-5439de5b2a40", "ac526877-fd57-46f4-b83b-972b1c58fad6", "47e0b249-e53b-4f62-a257-6d0813594d72", "acd0006b-0353-4ba6-8a0b-87336f61c97d", "9d26f612-3468-4d2c-a80b-ad718b6e877e", "4cad6e5b-3f30-4564-8735-751ca7db042c", "b4034989-a291-40b9-9713-ee02a8ac0da2", "3360b9ba-8b02-41c9-bd93-6f6a02109330", "f15f4120-70ca-4a10-be77-f9d582fb8790", "f1c95c46-1481-4241-a8ee-571b2f83a310", "8090fbc5-84d0-4f94-b1f9-ed8020f780d3", "c6e1394e-9cad-4673-bd57-f2405d39c2cf", "27c2cc4b-0924-448f-ab99-7a67b399c2ab", "cf75254e-e8e2-41e2-81e9-77d30e203cb5", "db5df703-aa7a-4910-b457-cd3a922a981e", "c8ac0909-a19f-471e-a271-487222887abd", "fe8b6a8a-2e2d-43a0-a149-73689c84f390", "10d74f61-cdd5-494d-8c51-8312b3ba8de8", "fdb69422-5411-4296-b9d8-962b4d7831c2", "110fdb13-f9c4-46fc-9fa4-10ffd91c395f", "7fd7fa0a-adbb-469e-be55-da9a0c015ed8", "705eba44-ab0e-462d-9b8d-1773c364e997", "8678671e-3d0f-4498-ba9e-00f1a91c2dec", "d0f4d361-3ebe-433f-8d61-aa782fae1629", "509e8fc8-6805-42af-92e1-71d6eabd0266", "da4ebfb0-d0f7-4d87-b12a-91812d2c6a04", "9a1c0f18-5ce2-448f-a802-d53af20a31c1", "d392164c-cafa-46be-8893-b28c2272b578", "56de8949-916b-48d9-b3ed-5e5600fc9ca2", "8fb3ee5c-576a-4bf5-ba7e-b2edb63764dc", "cf617cc7-abc9-4c02-b109-8817de9e1fe8", "32623ca4-06d3-4b9b-9941-e741eb577347", "f44828a7-258c-4f49-a93d-61c1a597943f", "cc215dc0-9705-46ac-9ab1-1396de51bf7c", "71e5a001-12f9-41d1-aa62-8c79dd517256", "0240c422-4914-40ff-84e3-4f91c035951c", "1ed90bad-9ded-4cad-879b-073029c2669a", "82649e41-2072-452a-afc0-98a8e55e8d07", "b08308eb-a210-4991-8937-c9bbd18c4d9c", "7747dd70-20a4-4759-b346-990b9ab27c0c", "64e3b499-cbcc-4659-bb34-dbd1bb2f2e94", "4f2bdf6e-5f2e-4181-9559-dd8fc0fd7782", "124ec7ef-0d81-4d96-af62-32ba7e181dc2", "5ae01620-6217-429c-a6ee-f3c90a1813fe", "cea43ac2-635b-47f0-8e22-31dd43944c2b", "80ed906b-d3d8-4eff-a382-f3ccfe770fbd", "a6284cb9-0ec4-4644-ac38-9df2c430d565", "0e61b3b3-d822-42b9-b2db-e1147a055864", "e10e6b37-8c81-449f-8b06-953d9e7232e3", "742574bd-3734-45df-81cb-664bc6fc3d9b", "f3a57f3d-21ee-498d-99ee-965ce6b883a4", "73695f31-fd69-4514-b8d6-d72c6cdbb87c", "ad0c3fdb-eee5-4ba0-bc81-169b78ed8365", "fd7264ef-c538-432f-848b-1d838ced284a", "ba1fc3a4-bf86-41a3-98d4-3ca0974b9be8", "9fe092dc-5c09-4876-b941-b37ae675d813", "b0ec8c0c-dd90-4b58-b356-37134394c78d", "015b7891-f102-4c8f-b06d-9269dd58b44d", "3bbdbd66-d299-4cba-8c12-51c8786d3091", "2baf451b-0056-4891-8d40-684b89573e1b", "73f8cadc-ec5d-4f49-a839-67d47b03c77f", "f0b1f166-bf21-4323-a98c-97cb5ce7179b", "5430b2ef-658c-4221-aa29-4325b466d13f", "c80231fa-3653-43c4-83ec-af2060de32e6", "30d7bc46-2e9e-48f7-935c-807f4d3a3874", "187a4b2d-7c67-4c5a-b15d-04a9f83933c2", "021946e3-c36d-4a13-b45d-198da0ecadfc", "b3067692-7417-4b7d-8599-72f2c733f340", "58505de6-57ea-4156-83ec-21d3e032fcee", "90bf0114-63fa-4f8f-beac-8c8844a22459", "5f4ad035-8ade-4422-a698-42777d881b04", "1214e547-4439-466c-b7cf-0dfce91ca8a9", "6f41ff49-d3e3-4067-8644-4ed8b7416461", "114e231f-0e4f-4f0c-b594-af8e235bb7ba", "85d3184b-facb-42d7-9fa2-68a756ba59ff", "242333a5-01c6-4a03-a125-aa9fe7a1566c", "21c58509-8ad4-4956-93ec-9e01f51f7731", "a57c3cbd-cbcb-4b79-bbd2-bc492cc4c6de", "e74c5ca7-a98f-4cee-8a20-402df5f04c12", "20896cc4-7e6c-4191-90ca-0fcbaf782a1a", "ac2e3135-2507-45a0-9eb5-eb87267b5aa3", "f8a97bdd-4988-408e-b26b-09909b8984f4", "ca128910-13b5-4ca4-bb5d-59b2a0923021", "608881e1-3112-44fb-8163-a0e1375bdab0", "011dfad9-c5b2-433c-8550-1f442912c6b3", "e64074c1-1af7-4c9b-b712-3fc5e62da994", "5bc3338f-922a-47ff-aae1-08fb7b8dde43", "19cb62d2-9b26-4a60-aab3-cc40a4aef43a", "9d27e5e1-c938-4f26-a90d-25a7b894cc4a", "c4ce4396-9c90-4cec-9485-46cea79f4295", "af0972ed-d3b8-4ac2-90ab-75ce1bb915d6", "71277395-eef6-428b-9609-e3637eda9594", "e659044e-5803-4435-846f-2c49eb9f27ef", "1132475f-3f52-4abc-8b7e-1d1ad503adaa", "cbfdead0-07e3-4ff0-960c-65310ce08197", "c2583e33-3aa5-444b-9369-d1257f91d902", "b3f557a3-b586-4969-9586-4e7548d1c510", "174f69df-274c-48fb-87c1-579d48cbd326", "786f5a33-fe08-45e1-b4a3-d87fee25c003", "25357792-eaea-49a7-a61f-3c39c0385ebe", "03d85aeb-9a2e-46de-8eee-c72d3db4f4ec", "eaf84068-3115-4f77-a190-8dda88806b57", "2bfa597a-3cc4-4bc0-88a4-357178faaf9e", "45431a02-f4a1-43f5-b9cb-bde2609e996c", "9dcef566-3377-416f-9a07-00a81f06c66d", "0a7e7d49-fbc6-48a3-b125-26138aebe090", "358395f1-b91c-4d7b-8673-1b3e1c3879f5" ], "created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "created_time": 1550443475316, "format": { "page_full_width": true, "page_small_text": true }, "id": "f90b0a6b-6483-43e2-8dc5-ed6e8f5c0780", "last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "last_edited_time": 1553725920000, "parent_id": "c74c72f4-6ba6-4002-83c5-0fe2e400a3bc", "parent_table": "block", "permissions": [ { "allow_search_engine_indexing": false, "role": "comment_only", "type": "public_permission" } ], "properties": { "title": [ [ "Essential Android" ] ] }, "type": "page", "version": 361 } }, "ffa90cd3-3eea-424c-8f80-34de4ba10bac": { "role": "comment_only", "value": { "alive": true, "content": [ "5c84555e-4102-4faf-a322-a54aa3c3c2e0", "750ce75e-1a2e-476e-b158-ebb3afddd70d", "dc2caa3f-1ebd-4c07-87c7-18de3fa6b06c", "54353005-7e0c-4a86-9987-eb3c01be5887", "281faf08-939d-44ee-84f0-dc01e5d57704", "dd649b43-c72b-46d3-a29d-1f1eda25f14e", "05610b90-c034-40c4-9eb3-c0a7d291360d", "1ffeb517-3152-4568-acf5-425070e8ec9b", "e08ee73c-daba-431a-bc50-9f41df577456", "12f5074e-dd63-4750-8d76-9cd32c8d07a2", "4a0c7b42-0238-404f-bcb9-40f47dcfa946", "ecd679ba-9bef-43d7-ba8c-79bf7a32fd66", "76a9a483-ab16-462e-b63d-a4540a6b42f9", "0de96bef-b16c-4919-93d0-4551470a748e", "983eff9b-2b31-4a6d-8152-6bee1951632a", "b092d17b-226b-4805-8b61-f24faeb8ed58", "07efb6e8-067a-4baf-96ec-506b326b9ee1" ], "created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "created_time": 1550443800000, "format": { "page_full_width": true, "page_small_text": true }, "id": "ffa90cd3-3eea-424c-8f80-34de4ba10bac", "last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a", "last_edited_time": 1550444580000, "parent_id": "f90b0a6b-6483-43e2-8dc5-ed6e8f5c0780", "parent_table": "block", "permissions": [ { "role": "editor", "type": "user_permission", "user_id": "bb760e2d-d679-4b64-b2a9-03005b21870a" } ], "properties": { "title": [ [ "Resources" ] ] }, "type": "page", "version": 37 } } }, "notion_user": { "bb760e2d-d679-4b64-b2a9-03005b21870a": { "role": "reader", "value": { "clipper_onboarding_completed": true, "email": "[email protected]", "family_name": "Kowalczyk", "given_name": "Krzysztof", "id": "bb760e2d-d679-4b64-b2a9-03005b21870a", "mobile_onboarding_completed": true, "onboarding_completed": true, "profile_photo": "https://s3-us-west-2.amazonaws.com/public.notion-static.com/2dcaa66c-7674-4ff6-9924-601785b63561/head-bw-640x960.png", "version": 179 } } }, "space": {} } }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]--> <!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]--> <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> <!--[if (gte IE 9)|!(IE)]><!--> <html lang="en" xmlns="http://www.w3.org/1999/html"> <!--<![endif]--> <head> <!-- Basic Page Needs ================================================== --> <meta charset="utf-8" /> <title>icon-file-alt: Font Awesome Icons</title> <meta name="description" content="Font Awesome, the iconic font designed for Bootstrap"> <meta name="author" content="Dave Gandy"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!--<meta name="viewport" content="initial-scale=1; maximum-scale=1">--> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <!-- CSS ================================================== --> <link rel="stylesheet" href="../../assets/css/site.css"> <link rel="stylesheet" href="../../assets/css/pygments.css"> <link rel="stylesheet" href="../../assets/font-awesome/css/font-awesome.css"> <!--[if IE 7]> <link rel="stylesheet" href="../../assets/font-awesome/css/font-awesome-ie7.css"> <![endif]--> <!-- Le fav and touch icons --> <link rel="shortcut icon" href="../../assets/ico/favicon.ico"> <script type="text/javascript" src="//use.typekit.net/wnc7ioh.js"></script> <script type="text/javascript">try{Typekit.load();}catch(e){}</script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-30136587-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </head> <body data-spy="scroll" data-target=".navbar"> <div class="wrapper"> <!-- necessary for sticky footer. wrap all content except footer --> <div class="navbar navbar-inverse navbar-static-top hidden-print"> <div class="navbar-inner"> <div class="container"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <a class="brand" href="../../"><i class="icon-flag"></i> Font Awesome</a> <div class="nav-collapse collapse"> <ul class="nav"> <li class="hidden-tablet "><a href="../../">Home</a></li> <li><a href="../../get-started/">Get Started</a></li> <li class="dropdown-split-left"><a href="../../icons/">Icons</a></li> <li class="dropdown dropdown-split-right hidden-phone"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-caret-down"></i> </a> <ul class="dropdown-menu pull-right"> <li><a href="../../icons/"><i class="icon-flag icon-fixed-width"></i>&nbsp; Icons</a></li> <li class="divider"></li> <li><a href="../../icons/#new"><i class="icon-shield icon-fixed-width"></i>&nbsp; New Icons in 3.2.1</a></li> <li><a href="../../icons/#web-application"><i class="icon-camera-retro icon-fixed-width"></i>&nbsp; Web Application Icons</a></li> <li><a href="../../icons/#currency"><i class="icon-won icon-fixed-width"></i>&nbsp; Currency Icons</a></li> <li><a href="../../icons/#text-editor"><i class="icon-file-text-alt icon-fixed-width"></i>&nbsp; Text Editor Icons</a></li> <li><a href="../../icons/#directional"><i class="icon-hand-right icon-fixed-width"></i>&nbsp; Directional Icons</a></li> <li><a href="../../icons/#video-player"><i class="icon-play-sign icon-fixed-width"></i>&nbsp; Video Player Icons</a></li> <li><a href="../../icons/#brand"><i class="icon-github icon-fixed-width"></i>&nbsp; Brand Icons</a></li> <li><a href="../../icons/#medical"><i class="icon-medkit icon-fixed-width"></i>&nbsp; Medical Icons</a></li> </ul> </li> <li class="dropdown-split-left"><a href="../../examples/">Examples</a></li> <li class="dropdown dropdown-split-right hidden-phone"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-caret-down"></i> </a> <ul class="dropdown-menu pull-right"> <li><a href="../../examples/">Examples</a></li> <li class="divider"></li> <li><a href="../../examples/#new-styles">New Styles</a></li> <li><a href="../../examples/#inline-icons">Inline Icons</a></li> <li><a href="../../examples/#larger-icons">Larger Icons</a></li> <li><a href="../../examples/#bordered-pulled">Bordered & Pulled</a></li> <li><a href="../../examples/#buttons">Buttons</a></li> <li><a href="../../examples/#button-groups">Button Groups</a></li> <li><a href="../../examples/#button-dropdowns">Button Dropdowns</a></li> <li><a href="../../examples/#bulleted-lists">Bulleted Lists</a></li> <li><a href="../../examples/#navigation">Navigation</a></li> <li><a href="../../examples/#form-inputs">Form Inputs</a></li> <li><a href="../../examples/#animated-spinner">Animated Spinner</a></li> <li><a href="../../examples/#rotated-flipped">Rotated &amp; Flipped</a></li> <li><a href="../../examples/#stacked">Stacked</a></li> <li><a href="../../examples/#custom">Custom CSS</a></li> </ul> </li> <li><a href="../../whats-new/"> <span class="hidden-tablet">What's </span>New</a> </li> <li><a href="../../community/">Community</a></li> <li><a href="../../license/">License</a></li> </ul> <ul class="nav pull-right"> <li><a href="http://blog.fontawesome.io">Blog</a></li> </ul> </div> </div> </div> </div> <div class="jumbotron jumbotron-icon"> <div class="container"> <div class="info-icons"> <i class="icon-file-alt icon-6"></i>&nbsp;&nbsp; <span class="hidden-phone"> <i class="icon-file-alt icon-5"></i>&nbsp;&nbsp; <span class="hidden-tablet"><i class="icon-file-alt icon-4"></i>&nbsp;&nbsp;</span> <i class="icon-file-alt icon-3"></i>&nbsp;&nbsp; <i class="icon-file-alt icon-2"></i>&nbsp; </span> <i class="icon-file-alt icon-1"></i> </div> <h1 class="info-class"> icon-file-alt <small> <i class="icon-file-alt"></i> &middot; Unicode: <span class="upper">f016</span> &middot; Created: v1.0 &middot; Categories: Text Editor Icons </small> </h1> </div> </div> <div class="container"> <section> <div class="row-fluid"> <div class="span9"> <p>After you get <a href="../../integration/">up and running</a>, you can place Font Awesome icons just about anywhere with the <code>&lt;i&gt;</code> tag:</p> <div class="well well-transparent"> <div style="font-size: 24px; line-height: 1.5em;"> <i class="icon-file-alt"></i> icon-file-alt </div> </div> <div class="highlight"><pre><code class="html"><span class="nt">&lt;i</span> <span class="na">class=</span><span class="s">&quot;icon-file-alt&quot;</span><span class="nt">&gt;&lt;/i&gt;</span> icon-file-alt </code></pre></div> <br> <div class="lead"><i class="icon-info-sign"></i> Looking for more? Check out the <a href="../../examples/">examples</a>.</div> </div> <div class="span3"> <div class="info-ad"><div id="carbonads-container"><div class="carbonad"><div id="azcarbon"></div><script type="text/javascript">var z = document.createElement("script"); z.type = "text/javascript"; z.async = true; z.src = "http://engine.carbonads.com/z/32291/azcarbon_2_1_0_VERT"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(z, s);</script></div></div> </div> </div> </div> </section> </div> <div class="push"><!-- necessary for sticky footer --></div> </div> <footer class="footer hidden-print"> <div class="container text-center"> <div> <i class="icon-flag"></i> Font Awesome 3.2.1 <span class="hidden-phone">&middot;</span><br class="visible-phone"> Created and Maintained by <a href="http://twitter.com/davegandy">Dave Gandy</a> </div> <div> Font Awesome licensed under <a href="http://scripts.sil.org/OFL">SIL OFL 1.1</a> <span class="hidden-phone">&middot;</span><br class="visible-phone"> Code licensed under <a href="http://opensource.org/licenses/mit-license.html">MIT License</a> <span class="hidden-phone hidden-tablet">&middot;</span><br class="visible-phone visible-tablet"> Documentation licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a> </div> <div> Thanks to <a href="http://maxcdn.com"><i class="icon-maxcdn"></i> MaxCDN</a> for providing the excellent <a href="http://www.bootstrapcdn.com/#tab_fontawesome">BootstrapCDN for Font Awesome</a> </div> <div class="project"> <a href="https://github.com/FortAwesome/Font-Awesome">GitHub Project</a> &middot; <a href="https://github.com/FortAwesome/Font-Awesome/issues">Issues</a> </div> </div> </footer> <script src="http://platform.twitter.com/widgets.js"></script> <script src="../../assets/js/jquery-1.7.1.min.js"></script> <script src="../../assets/js/ZeroClipboard-1.1.7.min.js"></script> <script src="../../assets/js/bootstrap-2.3.1.min.js"></script> <script src="../../assets/js/site.js"></script> </body> </html>
{ "pile_set_name": "Github" }
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. This is a project to develop and build Hadoop (HDFS and MAPREDUCE) smoke and system tests. System property "tests" can be set to select individual tests from the available MapReduce jobs. To set the property, include the following option in the command line (with your chosen jobs): -Dtests="teragen,terasort" The default number of terasort rows (1000) can be changed with the system property "terasort_rows": -Dterasort_rows=50
{ "pile_set_name": "Github" }
[net] batch=64 subdivisions=8 height=416 width=416 channels=3 momentum=0.9 decay=0.0005 angle=0 saturation = 1.5 exposure = 1.5 hue=.1 learning_rate=0.0001 max_batches = 45000 policy=steps steps=100,25000,35000 scales=10,.1,.1 [convolutional] batch_normalize=1 filters=32 size=3 stride=1 pad=1 activation=leaky [maxpool] size=2 stride=2 [convolutional] batch_normalize=1 filters=64 size=3 stride=1 pad=1 activation=leaky [maxpool] size=2 stride=2 [convolutional] batch_normalize=1 filters=128 size=3 stride=1 pad=1 activation=leaky [convolutional] batch_normalize=1 filters=64 size=1 stride=1 pad=1 activation=leaky [convolutional] batch_normalize=1 filters=128 size=3 stride=1 pad=1 activation=leaky [maxpool] size=2 stride=2 [convolutional] batch_normalize=1 filters=256 size=3 stride=1 pad=1 activation=leaky [convolutional] batch_normalize=1 filters=128 size=1 stride=1 pad=1 activation=leaky [convolutional] batch_normalize=1 filters=256 size=3 stride=1 pad=1 activation=leaky [maxpool] size=2 stride=2 [convolutional] batch_normalize=1 filters=512 size=3 stride=1 pad=1 activation=leaky [convolutional] batch_normalize=1 filters=256 size=1 stride=1 pad=1 activation=leaky [convolutional] batch_normalize=1 filters=512 size=3 stride=1 pad=1 activation=leaky [convolutional] batch_normalize=1 filters=256 size=1 stride=1 pad=1 activation=leaky [convolutional] batch_normalize=1 filters=512 size=3 stride=1 pad=1 activation=leaky [maxpool] size=2 stride=2 [convolutional] batch_normalize=1 filters=1024 size=3 stride=1 pad=1 activation=leaky [convolutional] batch_normalize=1 filters=512 size=1 stride=1 pad=1 activation=leaky [convolutional] batch_normalize=1 filters=1024 size=3 stride=1 pad=1 activation=leaky [convolutional] batch_normalize=1 filters=512 size=1 stride=1 pad=1 activation=leaky [convolutional] batch_normalize=1 filters=1024 size=3 stride=1 pad=1 activation=leaky ####### [convolutional] batch_normalize=1 size=3 stride=1 pad=1 filters=1024 activation=leaky [convolutional] batch_normalize=1 size=3 stride=1 pad=1 filters=1024 activation=leaky [route] layers=-9 [reorg] stride=2 [route] layers=-1,-3 [convolutional] batch_normalize=1 size=3 stride=1 pad=1 filters=1024 activation=leaky [convolutional] size=1 stride=1 pad=1 filters=125 activation=linear [region] anchors = 1.08,1.19, 3.42,4.41, 6.63,11.38, 9.42,5.11, 16.62,10.52 bias_match=1 classes=20 coords=4 num=5 softmax=1 jitter=.2 rescore=1 object_scale=5 noobject_scale=1 class_scale=1 coord_scale=1 absolute=1 thresh = .6 random=0
{ "pile_set_name": "Github" }
--- title: "Walkthrough: Creating a Custom Directive Processor | Microsoft Docs" ms.date: 11/15/2016 ms.prod: visual-studio-dev14 ms.technology: vs-ide-modeling ms.topic: conceptual helpviewer_keywords: - "text templates, custom directive processors" - "walkthroughs [text templates], directive processor" ms.assetid: b8f35a36-14e1-4467-8f5f-e01402af14d5 caps.latest.revision: 76 author: jillre ms.author: jillfra manager: jillfra --- # Walkthrough: Creating a Custom Directive Processor [!INCLUDE[vs2017banner](../includes/vs2017banner.md)] Directive processors* work by adding code to the *generated transformation class*. If you call a *directive* from a *text template*, the rest of the code that you write in your text template can rely on the functionality that the directive provides. You can write your own custom directive processors. This enables you to customize your text templates. To create a custom directive processor, you create a class that inherits from either <xref:Microsoft.VisualStudio.TextTemplating.DirectiveProcessor> or <xref:Microsoft.VisualStudio.TextTemplating.RequiresProvidesDirectiveProcessor>. Tasks that are illustrated in this walkthrough include the following: - Creating a custom directive processor - Registering the directive processor - Testing the directive processor ## Prerequisites To complete this walkthrough, you will need: - Visual Studio 2010 - Visual Studio 2010 SDK ## Creating a Custom Directive Processor In this walkthrough, you create a custom directive processor. You add a custom directive that reads an XML file, stores it in an <xref:System.Xml.XmlDocument> variable, and exposes it through a property. In the section "Testing the Directive Processor," you use this property in a text template to access the XML file. The call to your custom directive looks like the following: `<#@ CoolDirective Processor="CustomDirectiveProcessor" FileName="<Your Path>DocFile.xml" #>` The custom directive processor adds the variable and the property to the generated transformation class. The directive that you write uses the <xref:System.CodeDom> classes to create the code that the engine adds to the generated transformation class. The <xref:System.CodeDom> classes create code in either Visual C# or [!INCLUDE[vbprvb](../includes/vbprvb-md.md)], depending on the language specified in the `language` parameter of the `template` directive. The language of the directive processor and the language of the text template that is accessing the directive processor do not have to match. The code that the directive creates looks like the following: ```csharp private System.Xml.XmlDocument document0Value; public virtual System.Xml.XmlDocument Document0 { get { if ((this.document0Value == null)) { this.document0Value = XmlReaderHelper.ReadXml(<FileNameParameterValue>); } return this.document0Value; } } ``` ```vb Private document0Value As System.Xml.XmlDocument Public Overridable ReadOnly Property Document0() As System.Xml.XmlDocument Get If (Me.document0Value Is Nothing) Then Me.document0Value = XmlReaderHelper.ReadXml(<FileNameParameterValue>) End If Return Me.document0Value End Get End Property ``` #### To create a custom directive processor 1. In Visual Studio, create a C# or a Visual Basic class library project named CustomDP. > [!NOTE] > If you want to install the directive processor on more than one computer, it is better to use a [!INCLUDE[vsprvs](../includes/vsprvs-md.md)] Extension (VSIX) project and include a .pkgdef file in the extension. For more information, see [Deploying a Custom Directive Processor](../modeling/deploying-a-custom-directive-processor.md). 2. Add references to these assemblies: - **Microsoft.VisualStudio.TextTemplating.\*.0** - **Microsoft.VisualStudio.TextTemplating.Interfaces.\*.0** 3. Replace the code in **Class1** with the following code. This code defines a CustomDirectiveProcessor class that inherits from the <xref:Microsoft.VisualStudio.TextTemplating.DirectiveProcessor> class and implements the necessary methods. ```csharp using System; using System.CodeDom; using System.CodeDom.Compiler; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml; using System.Xml.Serialization; using Microsoft.VisualStudio.TextTemplating; namespace CustomDP { public class CustomDirectiveProcessor : DirectiveProcessor { //this buffer stores the code that is added to the //generated transformation class after all the processing is done //--------------------------------------------------------------------- private StringBuilder codeBuffer; //Using a Code Dom Provider creates code for the //generated transformation class in either Visual Basic or C#. //If you want your directive processor to support only one language, you //can hard code the code you add to the generated transformation class. //In that case, you do not need this field. //-------------------------------------------------------------------------- private CodeDomProvider codeDomProvider; //this stores the full contents of the text template that is being processed //-------------------------------------------------------------------------- private String templateContents; //These are the errors that occur during processing. The engine passes //the errors to the host, and the host can decide how to display them, //for example the host can display the errors in the UI //or write them to a file. //--------------------------------------------------------------------- private CompilerErrorCollection errorsValue; public new CompilerErrorCollection Errors { get { return errorsValue; } } //Each time this directive processor is called, it creates a new property. //We count how many times we are called, and append "n" to each new //property name. The property names are therefore unique. //----------------------------------------------------------------------------- private int directiveCount = 0; public override void Initialize(ITextTemplatingEngineHost host) { //we do not need to do any initialization work } public override void StartProcessingRun(CodeDomProvider languageProvider, String templateContents, CompilerErrorCollection errors) { //the engine has passed us the language of the text template //we will use that language to generate code later //---------------------------------------------------------- this.codeDomProvider = languageProvider; this.templateContents = templateContents; this.errorsValue = errors; this.codeBuffer = new StringBuilder(); } //Before calling the ProcessDirective method for a directive, the //engine calls this function to see whether the directive is supported. //Notice that one directive processor might support many directives. //--------------------------------------------------------------------- public override bool IsDirectiveSupported(string directiveName) { if (string.Compare(directiveName, "CoolDirective", StringComparison.OrdinalIgnoreCase) == 0) { return true; } if (string.Compare(directiveName, "SuperCoolDirective", StringComparison.OrdinalIgnoreCase) == 0) { return true; } return false; } public override void ProcessDirective(string directiveName, IDictionary<string, string> arguments) { if (string.Compare(directiveName, "CoolDirective", StringComparison.OrdinalIgnoreCase) == 0) { string fileName; if (!arguments.TryGetValue("FileName", out fileName)) { throw new DirectiveProcessorException("Required argument 'FileName' not specified."); } if (string.IsNullOrEmpty(fileName)) { throw new DirectiveProcessorException("Argument 'FileName' is null or empty."); } //Now we add code to the generated transformation class. //This directive supports either Visual Basic or C#, so we must use the //System.CodeDom to create the code. //If a directive supports only one language, you can hard code the code. //-------------------------------------------------------------------------- CodeMemberField documentField = new CodeMemberField(); documentField.Name = "document" + directiveCount + "Value"; documentField.Type = new CodeTypeReference(typeof(XmlDocument)); documentField.Attributes = MemberAttributes.Private; CodeMemberProperty documentProperty = new CodeMemberProperty(); documentProperty.Name = "Document" + directiveCount; documentProperty.Type = new CodeTypeReference(typeof(XmlDocument)); documentProperty.Attributes = MemberAttributes.Public; documentProperty.HasSet = false; documentProperty.HasGet = true; CodeExpression fieldName = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), documentField.Name); CodeExpression booleanTest = new CodeBinaryOperatorExpression(fieldName, CodeBinaryOperatorType.IdentityEquality, new CodePrimitiveExpression(null)); CodeExpression rightSide = new CodeMethodInvokeExpression(new CodeTypeReferenceExpression("XmlReaderHelper"), "ReadXml", new CodePrimitiveExpression(fileName)); CodeStatement[] thenSteps = new CodeStatement[] { new CodeAssignStatement(fieldName, rightSide) }; CodeConditionStatement ifThen = new CodeConditionStatement(booleanTest, thenSteps); documentProperty.GetStatements.Add(ifThen); CodeStatement s = new CodeMethodReturnStatement(fieldName); documentProperty.GetStatements.Add(s); CodeGeneratorOptions options = new CodeGeneratorOptions(); options.BlankLinesBetweenMembers = true; options.IndentString = " "; options.VerbatimOrder = true; options.BracingStyle = "C"; using (StringWriter writer = new StringWriter(codeBuffer, CultureInfo.InvariantCulture)) { codeDomProvider.GenerateCodeFromMember(documentField, writer, options); codeDomProvider.GenerateCodeFromMember(documentProperty, writer, options); } }//end CoolDirective //One directive processor can contain many directives. //If you want to support more directives, the code goes here... //----------------------------------------------------------------- if (string.Compare(directiveName, "supercooldirective", StringComparison.OrdinalIgnoreCase) == 0) { //code for SuperCoolDirective goes here... }//end SuperCoolDirective //Track how many times the processor has been called. //----------------------------------------------------------------- directiveCount++; }//end ProcessDirective public override void FinishProcessingRun() { this.codeDomProvider = null; //important: do not do this: //the get methods below are called after this method //and the get methods can access this field //----------------------------------------------------------------- //this.codeBuffer = null; } public override string GetPreInitializationCodeForProcessingRun() { //Use this method to add code to the start of the //Initialize() method of the generated transformation class. //We do not need any pre-initialization, so we will just return "". //----------------------------------------------------------------- //GetPreInitializationCodeForProcessingRun runs before the //Initialize() method of the base class. //----------------------------------------------------------------- return String.Empty; } public override string GetPostInitializationCodeForProcessingRun() { //Use this method to add code to the end of the //Initialize() method of the generated transformation class. //We do not need any post-initialization, so we will just return "". //------------------------------------------------------------------ //GetPostInitializationCodeForProcessingRun runs after the //Initialize() method of the base class. //----------------------------------------------------------------- return String.Empty; } public override string GetClassCodeForProcessingRun() { //Return the code to add to the generated transformation class. //----------------------------------------------------------------- return codeBuffer.ToString(); } public override string[] GetReferencesForProcessingRun() { //This returns the references that we want to use when //compiling the generated transformation class. //----------------------------------------------------------------- //We need a reference to this assembly to be able to call //XmlReaderHelper.ReadXml from the generated transformation class. //----------------------------------------------------------------- return new string[] { "System.Xml", this.GetType().Assembly.Location }; } public override string[] GetImportsForProcessingRun() { //This returns the imports or using statements that we want to //add to the generated transformation class. //----------------------------------------------------------------- //We need CustomDP to be able to call XmlReaderHelper.ReadXml //from the generated transformation class. //----------------------------------------------------------------- return new string[] { "System.Xml", "CustomDP" }; } }//end class CustomDirectiveProcessor //------------------------------------------------------------------------- // the code that we are adding to the generated transformation class // will call this method //------------------------------------------------------------------------- public static class XmlReaderHelper { public static XmlDocument ReadXml(string fileName) { XmlDocument d = new XmlDocument(); using (XmlTextReader reader = new XmlTextReader(fileName)) { try { d.Load(reader); } catch (System.Xml.XmlException e) { throw new DirectiveProcessorException("Unable to read the XML file.", e); } } return d; } }//end class XmlReaderHelper }//end namespace CustomDP ``` ```vb Imports System Imports System.CodeDom Imports System.CodeDom.Compiler Imports System.Collections.Generic Imports System.Globalization Imports System.IO Imports System.Text Imports System.Xml Imports System.Xml.Serialization Imports Microsoft.VisualStudio.TextTemplating Namespace CustomDP Public Class CustomDirectiveProcessor Inherits DirectiveProcessor 'this buffer stores the code that is added to the 'generated transformation class after all the processing is done '--------------------------------------------------------------- Private codeBuffer As StringBuilder 'Using a Code Dom Provider creates code for the 'generated transformation class in either Visual Basic or C#. 'If you want your directive processor to support only one language, you 'can hard code the code you add to the generated transformation class. 'In that case, you do not need this field. '-------------------------------------------------------------------------- Private codeDomProvider As CodeDomProvider 'this stores the full contents of the text template that is being processed '-------------------------------------------------------------------------- Private templateContents As String 'These are the errors that occur during processing. The engine passes 'the errors to the host, and the host can decide how to display them, 'for example the host can display the errors in the UI 'or write them to a file. '--------------------------------------------------------------------- Private errorsValue As CompilerErrorCollection Public Shadows ReadOnly Property Errors() As CompilerErrorCollection Get Return errorsValue End Get End Property 'Each time this directive processor is called, it creates a new property. 'We count how many times we are called, and append "n" to each new 'property name. The property names are therefore unique. '-------------------------------------------------------------------------- Private directiveCount As Integer = 0 Public Overrides Sub Initialize(ByVal host As ITextTemplatingEngineHost) 'we do not need to do any initialization work End Sub Public Overrides Sub StartProcessingRun(ByVal languageProvider As CodeDomProvider, ByVal templateContents As String, ByVal errors As CompilerErrorCollection) 'the engine has passed us the language of the text template 'we will use that language to generate code later '---------------------------------------------------------- Me.codeDomProvider = languageProvider Me.templateContents = templateContents Me.errorsValue = errors Me.codeBuffer = New StringBuilder() End Sub 'Before calling the ProcessDirective method for a directive, the 'engine calls this function to see whether the directive is supported. 'Notice that one directive processor might support many directives. '--------------------------------------------------------------------- Public Overrides Function IsDirectiveSupported(ByVal directiveName As String) As Boolean If String.Compare(directiveName, "CoolDirective", StringComparison.OrdinalIgnoreCase) = 0 Then Return True End If If String.Compare(directiveName, "SuperCoolDirective", StringComparison.OrdinalIgnoreCase) = 0 Then Return True End If Return False End Function Public Overrides Sub ProcessDirective(ByVal directiveName As String, ByVal arguments As IDictionary(Of String, String)) If String.Compare(directiveName, "CoolDirective", StringComparison.OrdinalIgnoreCase) = 0 Then Dim fileName As String If Not (arguments.TryGetValue("FileName", fileName)) Then Throw New DirectiveProcessorException("Required argument 'FileName' not specified.") End If If String.IsNullOrEmpty(fileName) Then Throw New DirectiveProcessorException("Argument 'FileName' is null or empty.") End If 'Now we add code to the generated transformation class. 'This directive supports either Visual Basic or C#, so we must use the 'System.CodeDom to create the code. 'If a directive supports only one language, you can hard code the code. '-------------------------------------------------------------------------- Dim documentField As CodeMemberField = New CodeMemberField() documentField.Name = "document" & directiveCount & "Value" documentField.Type = New CodeTypeReference(GetType(XmlDocument)) documentField.Attributes = MemberAttributes.Private Dim documentProperty As CodeMemberProperty = New CodeMemberProperty() documentProperty.Name = "Document" & directiveCount documentProperty.Type = New CodeTypeReference(GetType(XmlDocument)) documentProperty.Attributes = MemberAttributes.Public documentProperty.HasSet = False documentProperty.HasGet = True Dim fieldName As CodeExpression = New CodeFieldReferenceExpression(New CodeThisReferenceExpression(), documentField.Name) Dim booleanTest As CodeExpression = New CodeBinaryOperatorExpression(fieldName, CodeBinaryOperatorType.IdentityEquality, New CodePrimitiveExpression(Nothing)) Dim rightSide As CodeExpression = New CodeMethodInvokeExpression(New CodeTypeReferenceExpression("XmlReaderHelper"), "ReadXml", New CodePrimitiveExpression(fileName)) Dim thenSteps As CodeStatement() = New CodeStatement() {New CodeAssignStatement(fieldName, rightSide)} Dim ifThen As CodeConditionStatement = New CodeConditionStatement(booleanTest, thenSteps) documentProperty.GetStatements.Add(ifThen) Dim s As CodeStatement = New CodeMethodReturnStatement(fieldName) documentProperty.GetStatements.Add(s) Dim options As CodeGeneratorOptions = New CodeGeneratorOptions() options.BlankLinesBetweenMembers = True options.IndentString = " " options.VerbatimOrder = True options.BracingStyle = "VB" Using writer As StringWriter = New StringWriter(codeBuffer, CultureInfo.InvariantCulture) codeDomProvider.GenerateCodeFromMember(documentField, writer, options) codeDomProvider.GenerateCodeFromMember(documentProperty, writer, options) End Using End If 'CoolDirective 'One directive processor can contain many directives. 'If you want to support more directives, the code goes here... '----------------------------------------------------------------- If String.Compare(directiveName, "supercooldirective", StringComparison.OrdinalIgnoreCase) = 0 Then 'code for SuperCoolDirective goes here End If 'SuperCoolDirective 'Track how many times the processor has been called. '----------------------------------------------------------------- directiveCount += 1 End Sub 'ProcessDirective Public Overrides Sub FinishProcessingRun() Me.codeDomProvider = Nothing 'important: do not do this: 'the get methods below are called after this method 'and the get methods can access this field '----------------------------------------------------------------- 'Me.codeBuffer = Nothing End Sub Public Overrides Function GetPreInitializationCodeForProcessingRun() As String 'Use this method to add code to the start of the 'Initialize() method of the generated transformation class. 'We do not need any pre-initialization, so we will just return "". '----------------------------------------------------------------- 'GetPreInitializationCodeForProcessingRun runs before the 'Initialize() method of the base class. '----------------------------------------------------------------- Return String.Empty End Function Public Overrides Function GetPostInitializationCodeForProcessingRun() As String 'Use this method to add code to the end of the 'Initialize() method of the generated transformation class. 'We do not need any post-initialization, so we will just return "". '------------------------------------------------------------------ 'GetPostInitializationCodeForProcessingRun runs after the 'Initialize() method of the base class. '----------------------------------------------------------------- Return String.Empty End Function Public Overrides Function GetClassCodeForProcessingRun() As String 'Return the code to add to the generated transformation class. '----------------------------------------------------------------- Return codeBuffer.ToString() End Function Public Overrides Function GetReferencesForProcessingRun() As String() 'This returns the references that we want to use when 'compiling the generated transformation class. '----------------------------------------------------------------- 'We need a reference to this assembly to be able to call 'XmlReaderHelper.ReadXml from the generated transformation class. '----------------------------------------------------------------- Return New String() {"System.Xml", Me.GetType().Assembly.Location} End Function Public Overrides Function GetImportsForProcessingRun() As String() 'This returns the imports or using statements that we want to 'add to the generated transformation class. '----------------------------------------------------------------- 'We need CustomDP to be able to call XmlReaderHelper.ReadXml 'from the generated transformation class. '----------------------------------------------------------------- Return New String() {"System.Xml", "CustomDP"} End Function End Class 'CustomDirectiveProcessor '-------------------------------------------------------------------------- ' the code that we are adding to the generated transformation class ' will call this method '-------------------------------------------------------------------------- Public Class XmlReaderHelper Public Shared Function ReadXml(ByVal fileName As String) As XmlDocument Dim d As XmlDocument = New XmlDocument() Using reader As XmlTextReader = New XmlTextReader(fileName) Try d.Load(reader) Catch e As System.Xml.XmlException Throw New DirectiveProcessorException("Unable to read the XML file.", e) End Try End Using Return d End Function End Class 'XmlReaderHelper End Namespace ``` 4. For [!INCLUDE[vbprvb](../includes/vbprvb-md.md)] only, open the **Project** menu, and click **CustomDP Properties**. On the **Application** tab, in **Root namespace**, delete the default value, `CustomDP`. 5. On the **File** menu, click **Save All**. 6. On the **Build** menu, click **Build Solution**. ### Build the Project Build the project. On the **Build** menu, click **Build Solution**. ## Registering the Directive Processor Before you can call a directive from a text template in [!INCLUDE[vsprvs](../includes/vsprvs-md.md)], you must add a registry key for the directive processor. > [!NOTE] > If you want to install the directive processor on more than one computer, it is better to define a [!INCLUDE[vsprvs](../includes/vsprvs-md.md)] Extension (VSIX) that includes a .pkgdef file along with your assembly. For more information, see [Deploying a Custom Directive Processor](../modeling/deploying-a-custom-directive-processor.md). Keys for directive processors exist in the registry in the following location: ``` HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\*.0\TextTemplating\DirectiveProcessors ``` For 64-bit systems, the registry location is: ``` HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\*.0\TextTemplating\DirectiveProcessors ``` In this section, you add a key for your custom directive processor to the registry in the same location. > [!CAUTION] > Incorrectly editing the registry can severely damage your system. Before you make changes to the registry, back up any valuable data that is on the computer. #### To add a registry key for the directive processor 1. Run the `regedit` command by using the Start menu or the command line. 2. Browse to the location **HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\\\*.0\TextTemplating\DirectiveProcessors**, and click the node. On 64-bit systems, use **HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\\\*.0\TextTemplating\DirectiveProcessors** 3. Add a new key named CustomDirectiveProcessor. > [!NOTE] > This is the name that you will use in the Processor field of your custom directives. This name does not need to match the name of the directive, the name of the directive processor class, or the directive processor namespace. 4. Add a new string value named Class that has a value CustomDP.CustomDirectiveProcessor for the name of the new string. 5. Add a new string value named CodeBase that has a value equal to the path of the CustomDP.dll that you created earlier in this walkthrough. For example, the path might look like `C:\UserFiles\CustomDP\bin\Debug\CustomDP.dll`. Your registry key should have the following values: | Name | Type | Data | |-----------|--------|--------------------------------------------------------------------------| | (Default) | REG_SZ | (value not set) | | Class | REG_SZ | CustomDP.CustomDirectiveProcessor | | CodeBase | REG_SZ | <strong>\<Path to Your Solution></strong>CustomDP\bin\Debug\CustomDP.dll | If you have put the assembly in the GAC, the values should look like the following: | Name | Type | Data | |-----------|--------|-----------------------------------| | (Default) | REG_SZ | (value not set) | | Class | REG_SZ | CustomDP.CustomDirectiveProcessor | | Assembly | REG_SZ | CustomDP.dll | 6. Restart Visual Studio. ## Testing the Directive Processor To test the directive processor, you need to write a text template that calls it. In this example, the text template calls the directive and passes in the name of an XML file that contains documentation for a class file. For more information, see [XML Documentation Comments](https://msdn.microsoft.com/library/803b7f7b-7428-4725-b5db-9a6cff273199). The text template then uses the <xref:System.Xml.XmlDocument> property that the directive creates to navigate the XML and print the documentation comments. #### To create an XML file for use in testing the directive processor 1. Create a text file named `DocFile.xml` by using any text editor (for example, Notepad). > [!NOTE] > You can create this file in any location (for example, C:\Test\DocFile.xml). 2. Add the following to the text file: ``` <?xml version="1.0"?> <doc> <assembly> <name>xmlsample</name> </assembly> <members> <member name="T:SomeClass"> <summary>Class level summary documentation goes here.</summary> <remarks>Longer comments can be associated with a type or member through the remarks tag</remarks> </member> <member name="F:SomeClass.m_Name"> <summary>Store for the name property</summary> </member> <member name="M:SomeClass.#ctor"> <summary>The class constructor.</summary> </member> <member name="M:SomeClass.SomeMethod(System.String)"> <summary>Description for SomeMethod.</summary> <param name="s">Parameter description for s goes here</param> <seealso cref="T:System.String">You can use the cref attribute on any tag to reference a type or member and the compiler will check that the reference exists.</seealso> </member> <member name="M:SomeClass.SomeOtherMethod"> <summary>Some other method.</summary> <returns>Return results are described through the returns tag.</returns> <seealso cref="M:SomeClass.SomeMethod(System.String)">Notice the use of the cref attribute to reference a specific method</seealso> </member> <member name="M:SomeClass.Main(System.String[])"> <summary>The entry point for the application.</summary> <param name="args">A list of command line arguments</param> </member> <member name="P:SomeClass.Name"> <summary>Name property</summary> <value>A value tag is used to describe the property value</value> </member> </members> </doc> ``` 3. Save and close the file. #### To create a text template to test the directive processor 1. In Visual Studio, create a C# or Visual Basic class library project named TemplateTest. 2. Add a new text template file named TestDP.tt. 3. Make sure that the **Custom Tool** property of TestDP.tt is set to `TextTemplatingFileGenerator`. 4. Change the content of TestDP.tt to the following text. > [!NOTE] > Make sure to replace the string <`YOUR PATH>` with the path to the DocFile.xml file. The language of the text template does not have to match the language of the directive processor. ```csharp <#@ assembly name="System.Xml" #> <#@ template debug="true" #> <#@ output extension=".txt" #> <# //This will call the custom directive processor. #> <#@ CoolDirective Processor="CustomDirectiveProcessor" FileName="<YOUR PATH>\DocFile.xml" #> <# //Uncomment this line if you want to see the generated transformation class. #> <# //System.Diagnostics.Debugger.Break(); #> <# //This will use the results of the directive processor. #> <# //The directive processor has read the XML and stored it in Document0. #> <# XmlNode node = Document0.DocumentElement.SelectSingleNode("members"); foreach (XmlNode member in node.ChildNodes) { XmlNode name = member.Attributes.GetNamedItem("name"); WriteLine("{0,7}: {1}", "Name", name.Value); foreach (XmlNode comment in member.ChildNodes) { WriteLine("{0,7}: {1}", comment.Name, comment.InnerText); } WriteLine(""); } #> <# //You can call the directive processor again and pass it a different file. #> <# //@ CoolDirective Processor="CustomDirectiveProcessor" FileName="<YOUR PATH>\<Your Second File>" #> <# //To use the results of the second directive call, use Document1. #> <# //XmlNode node2 = Document1.DocumentElement.SelectSingleNode("members"); //... #> ``` ```vb <#@ assembly name="System.Xml" #> <#@ template debug="true" language="vb" #> <#@ output extension=".txt" #> <# 'This will call the custom directive processor. #> <#@ CoolDirective Processor="CustomDirectiveProcessor" FileName="<YOUR PATH>\DocFile.xml" #> <# 'Uncomment this line if you want to see the generated transformation class. #> <# 'System.Diagnostics.Debugger.Break() #> <# 'This will use the results of the directive processor. #> <# 'The directive processor has read the XML and stored it in Document0. #> <# Dim node as XmlNode = Document0.DocumentElement.SelectSingleNode("members") Dim member As XmlNode For Each member In node.ChildNodes Dim name As XmlNode = member.Attributes.GetNamedItem("name") WriteLine("{0,7}: {1}", "Name", name.Value) Dim comment As XmlNode For Each comment In member.ChildNodes WriteLine("{0,7}: {1}", comment.Name, comment.InnerText) Next WriteLine("") Next #> <# 'You can call the directive processor again and pass it a different file. #> <# '@ CoolDirective Processor="CustomDirectiveProcessor" FileName="<YOUR PATH>\DocFileTwo.xml" #> <# 'To use the results of the second directive call, use Document1. #> <# 'node = Document1.DocumentElement.SelectSingleNode("members") '... #> ``` > [!NOTE] > In this example, the value of the `Processor` parameter is `CustomDirectiveProcessor`. The value of the `Processor` parameter must match the name of the processor's registry key. 5. On the **File** menu, click **Save All**. #### To test the directive processor 1. In **Solution Explorer**, right-click TestDP.tt and then click **Run Custom Tool**. For [!INCLUDE[vbprvb](../includes/vbprvb-md.md)] users, TestDP.txt might not appear in **Solution Explorer** by default. To display all files assigned to the project, open the **Project** menu and click **Show All Files**. 2. In **Solution Explorer**, expand the TestDP.txt node, and then double-click TestDP.txt to open it in the editor. The generated text output appears. The output should look like the following: ``` Name: T:SomeClass summary: Class level summary documentation goes here. remarks: Longer comments can be associated with a type or member through the remarks tag Name: F:SomeClass.m_Name summary: Store for the name property Name: M:SomeClass.#ctor summary: The class constructor. Name: M:SomeClass.SomeMethod(System.String) summary: Description for SomeMethod. param: Parameter description for s goes here seealso: You can use the cref attribute on any tag to reference a type or member and the compiler will check that the reference exists. Name: M:SomeClass.SomeOtherMethod summary: Some other method. returns: Return results are described through the returns tag. seealso: Notice the use of the cref attribute to reference a specific method Name: M:SomeClass.Main(System.String[]) summary: The entry point for the application. param: A list of command line arguments Name: P:SomeClass.Name summary: Name property value: A value tag is used to describe the property value ``` ## Adding HTML to Generated Text After you test your custom directive processor, you might want to add some HTML to your generated text. #### To add HTML to the generated text 1. Replace the code in TestDP.tt with the following. The HTML is highlighted. Make sure to replace the string `YOUR PATH` with the path to the DocFile.xml file. > [!NOTE] > Additional open \<# and close #> tags separate the statement code from the HTML tags. ```csharp <#@ assembly name="System.Xml" #> <#@ template debug="true" #> <#@ output extension=".htm" #> <# //this will call the custom directive processor #> <#@ CoolDirective Processor="CustomDirectiveProcessor" FileName="<YOUR PATH>\DocFile.xml" #> <# //uncomment this line if you want to see the generated transformation class #> <# //System.Diagnostics.Debugger.Break(); #> <html><body> <# //this will use the results of the directive processor #> <# //the directive processor has read the XML and stored it in Document0#> <# XmlNode node = Document0.DocumentElement.SelectSingleNode("members"); foreach (XmlNode member in node.ChildNodes) { #> <h3> <# XmlNode name = member.Attributes.GetNamedItem("name"); WriteLine("{0,7}: {1}", "Name", name.Value); #> </h3> <# foreach (XmlNode comment in member.ChildNodes) { WriteLine("{0,7}: {1}", comment.Name, comment.InnerText); #> <br/> <# } } #> </body></html> ``` ```vb <#@ assembly name="System.Xml" #> <#@ template debug="true" language="vb" #> <#@ output extension=".htm" #> <# 'this will call the custom directive processor #> <#@ CoolDirective Processor="CustomDirectiveProcessor" FileName="<YOUR PATH>\DocFile.xml" #> <# 'uncomment this line if you want to see the generated transformation class #> <# 'System.Diagnostics.Debugger.Break() #> <html><body> <# 'this will use the results of the directive processor #> <# 'the directive processor has read the XML and stored it in Document0#> <# Dim node as XmlNode = Document0.DocumentElement.SelectSingleNode("members") Dim member As XmlNode For Each member In node.ChildNodes #> <h3> <# Dim name As XmlNode = member.Attributes.GetNamedItem("name") WriteLine("{0,7}: {1}", "Name", name.Value) #> </h3> <# Dim comment As XmlNode For Each comment In member.ChildNodes WriteLine("{0,7}: {1}", comment.Name, comment.InnerText) #> <br/> <# Next Next #> </body></html> ``` 2. On the **File** menu, click **Save TestDP.txt**. 3. To view the output in a browser, in **Solution Explorer**, right-click TestDP.htm, and click **View In Browser**. Your output should be the same as the original text except it should have the HTML format applied. Each item name should appear in bold.
{ "pile_set_name": "Github" }
package net.i2p.util; import java.io.Serializable; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; /** * Count things. * * @author zzz, welterde */ public class ObjectCounter<K> implements Serializable { /** * Serializable so it can be passed in an Android Bundle */ private static final long serialVersionUID = 3160378641721937421L; private final ConcurrentHashMap<K, AtomicInteger> map; public ObjectCounter() { this.map = new ConcurrentHashMap<K, AtomicInteger>(); } /** * Add one. * @return count after increment */ public int increment(K h) { AtomicInteger i = this.map.putIfAbsent(h, new AtomicInteger(1)); if (i != null) return i.incrementAndGet(); return 1; } /** * @return current count */ public int count(K h) { AtomicInteger i = this.map.get(h); if (i != null) return i.get(); return 0; } /** * @return set of objects with counts > 0 */ public Set<K> objects() { return this.map.keySet(); } /** * start over * @since 0.7.11 */ public void clear() { this.map.clear(); } }
{ "pile_set_name": "Github" }
/* bzflag * Copyright (c) 1993-2020 Tim Riker * * This package is free software; you can redistribute it and/or * modify it under the terms of the license found in the file * named COPYING that should have accompanied this file. * * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include "common.h" #include "Team.h" #include "AnsiCodes.h" #include "BZDBCache.h" #include "Pack.h" float Team::tankColor[NumTeams][3] = { { 1.0f, 1.0f, 0.0f }, // rogue { 1.0f, 0.0f, 0.0f }, // red { 0.0f, 1.0f, 0.0f }, // green { 0.1f, 0.2f, 1.0f }, // blue { 1.0f, 0.0f, 1.0f }, // purple { 1.0f, 1.0f, 1.0f }, // observer { 0.8f, 0.8f, 0.8f }, // rabbit { 1.0f, 0.5f, 0.0f } // hunter orange }; float Team::radarColor[NumTeams][3] = { { 1.0f, 1.0f, 0.0f }, // rogue { 1.0f, 0.15f, 0.15f }, // red { 0.2f, 0.9f, 0.2f }, // green { 0.08f, 0.25, 1.0f}, // blue { 1.0f, 0.4f, 1.0f }, // purple { 1.0f, 1.0f, 1.0f }, // observer { 1.0f, 1.0f, 1.0f }, // rabbit { 1.0f, 0.5f, 0.0f } // hunter orange }; float Team::shotColor[NumTeams][3]; Team::Team() { size = 0; won = 0; lost = 0; } void* Team::pack(void* buf) const { buf = nboPackUShort(buf, uint16_t(size)); buf = nboPackUShort(buf, uint16_t(won)); buf = nboPackUShort(buf, uint16_t(lost)); return buf; } const void* Team::unpack(const void* buf) { uint16_t inSize, inWon, inLost; buf = nboUnpackUShort(buf, inSize); buf = nboUnpackUShort(buf, inWon); buf = nboUnpackUShort(buf, inLost); size = (unsigned short)inSize; won = (unsigned short)inWon; lost = (unsigned short)inLost; return buf; } const std::string Team::getImagePrefix(TeamColor team) { switch (team) { case RedTeam: return BZDB.get("redTeamPrefix"); case GreenTeam: return BZDB.get("greenTeamPrefix"); case BlueTeam: return BZDB.get("blueTeamPrefix"); case PurpleTeam: return BZDB.get("purpleTeamPrefix"); case RabbitTeam: return BZDB.get("rabbitTeamPrefix"); case HunterTeam: return BZDB.get("hunterTeamPrefix"); case ObserverTeam: return BZDB.get("observerTeamPrefix"); default: return BZDB.get("rogueTeamPrefix"); } } const char* Team::getName(TeamColor team) // const { switch (team) { case AutomaticTeam: return "Automatic"; case RogueTeam: return "Rogue"; case RedTeam: return "Red Team"; case GreenTeam: return "Green Team"; case BlueTeam: return "Blue Team"; case PurpleTeam: return "Purple Team"; case ObserverTeam: return "Observer"; case RabbitTeam: return "Rabbit"; case HunterTeam: return "Hunter"; case NoTeam: return "No Team??"; default: return "Invalid team"; } } TeamColor Team::getTeam(const std::string &name) // const { if (name == Team::getName(AutomaticTeam)) return AutomaticTeam; for (int i = 0; i < NumTeams; i++) { if (name == Team::getName((TeamColor)i)) return (TeamColor)i; } return NoTeam; } const float* Team::getTankColor(TeamColor team) // const { if (int(team) < 0) return tankColor[0]; return tankColor[int(team)]; } const float* Team::getRadarColor(TeamColor team) // const { if (int(team) < 0) return radarColor[0]; return radarColor[int(team)]; } const float* Team::getShotColor(TeamColor team) // const { if (int(team) < 0) return shotColor[0]; return shotColor[int(team)]; } const std::string Team::getAnsiCode(TeamColor team) // const { return rgbToAnsi(getTankColor(team)); } bool Team::isColorTeam(TeamColor team) // const { return team >= RedTeam && team <= PurpleTeam; } void Team::setColors(TeamColor team, const float* tank, const float* radar) { const int teamIndex = int(team); // ignore bogus team color if (teamIndex < 0) return; for (int i = 0; i <= 2; i++) { tankColor[teamIndex][i] = tank[i]; radarColor[teamIndex][i] = radar[i]; shotColor[teamIndex][i] = addBrightness(tank[i]); } } void Team::updateShotColors() { for (int teamIndex = 0; teamIndex < NumTeams; teamIndex++) { for (int i = 0; i <= 2; i++) shotColor[teamIndex][i] = addBrightness(tankColor[teamIndex][i]); } } float Team::addBrightness(const float color) { if (BZDBCache::shotBrightness == 0.0f) return color; float brightness = BZDBCache::shotBrightness; if (brightness > 0.0f) brightness *= pow(1.0f - color, 4.0f); else brightness *= color; // Make sure that the resulting color doesn't get below 0 or above 1 if (brightness + color > 1.0f) return 1.0f; else if (brightness + color < 0.0f) return 0.0f; return brightness + color; } // Local Variables: *** // mode: C++ *** // tab-width: 4 *** // c-basic-offset: 4 *** // indent-tabs-mode: nil *** // End: *** // ex: shiftwidth=4 tabstop=4
{ "pile_set_name": "Github" }
/* YUI 3.17.0 (build ce55cc9) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add('highlight-accentfold', function (Y, NAME) { /** Adds accent-folding highlighters to `Y.Highlight`. @module highlight @submodule highlight-accentfold **/ /** @class Highlight @static **/ var AccentFold = Y.Text.AccentFold, Escape = Y.Escape, EMPTY_OBJECT = {}, Highlight = Y.mix(Y.Highlight, { // -- Public Static Methods ------------------------------------------------ /** Accent-folding version of `all()`. @method allFold @param {String} haystack String to apply highlighting to. @param {String|String[]} needles String or array of strings that should be highlighted. @param {Object} [options] Options object. @param {Boolean} [options.startsWith=false] If `true`, matches must be anchored to the beginning of the string. @return {String} Escaped and highlighted copy of _haystack_. @static **/ allFold: function (haystack, needles, options) { var template = Highlight._TEMPLATE, results = [], startPos = 0, chunk, i, len, match, result; options = Y.merge({ // This tells Highlight.all() not to escape HTML, in order to ensure // usable match offsets. The output of all() is discarded, and we // perform our own escaping before returning the highlighted string. escapeHTML: false, // While the highlight regex operates on the accent-folded strings, // this replacer will highlight the matched positions in the // original string. // // Note: this implementation doesn't handle multi-character folds, // like "æ" -> "ae". Doing so correctly would be prohibitively // expensive both in terms of code size and runtime performance, so // I've chosen to take the pragmatic route and just not do it at // all. This is one of many reasons why accent folding is best done // on the server. replacer: function (match, p1, foldedNeedle, pos) { var len; // Ignore matches inside HTML entities. if (p1 && !(/\s/).test(foldedNeedle)) { return match; } len = foldedNeedle.length; results.push([ haystack.substring(startPos, pos), // substring between previous match and this match haystack.substr(pos, len) // match to be highlighted ]); startPos = pos + len; } }, options || EMPTY_OBJECT); // Run the highlighter on the folded strings. We don't care about the // output; our replacer function will build the canonical highlighted // string, with original accented characters. Highlight.all(AccentFold.fold(haystack), AccentFold.fold(needles), options); // Tack on the remainder of the haystack that wasn't highlighted, if // any. if (startPos < haystack.length) { results.push([haystack.substr(startPos)]); } // Highlight and escape the string. for (i = 0, len = results.length; i < len; ++i) { chunk = Escape.html(results[i][0]); if ((match = results[i][1])) { chunk += template.replace(/\{s\}/g, Escape.html(match)); } results[i] = chunk; } return results.join(''); }, /** Accent-folding version of `start()`. @method startFold @param {String} haystack String to apply highlighting to. @param {String|String[]} needles String or array of strings that should be highlighted. @return {String} Escaped and highlighted copy of _haystack_. @static **/ startFold: function (haystack, needles) { return Highlight.allFold(haystack, needles, {startsWith: true}); }, /** Accent-folding version of `words()`. @method wordsFold @param {String} haystack String to apply highlighting to. @param {String|String[]} needles String or array of strings containing words that should be highlighted. If a string is passed, it will be split into words; if an array is passed, it is assumed to have already been split. @return {String} Escaped and highlighted copy of _haystack_. @static **/ wordsFold: function (haystack, needles) { var template = Highlight._TEMPLATE; return Highlight.words(haystack, AccentFold.fold(needles), { mapper: function (word, needles) { if (needles.hasOwnProperty(AccentFold.fold(word))) { return template.replace(/\{s\}/g, Escape.html(word)); } return Escape.html(word); } }); } }); }, '3.17.0', {"requires": ["highlight-base", "text-accentfold"]});
{ "pile_set_name": "Github" }
{ "pstextpath[](){}{}": { "command": "pstextpath[pos](x,y){graphics object}{text}", "package": "pst-text", "snippet": "pstextpath[${3:pos}](${4:x,y}){${1:graphics object}}{${2:text}}" }, "pstextpath(){}{}": { "command": "pstextpath(x,y){graphics object}{text}", "package": "pst-text", "snippet": "pstextpath(${3:x,y}){${1:graphics object}}{${2:text}}" } }
{ "pile_set_name": "Github" }
#X-Generator: crowdin.com BACK_TO_MY_GROUPS=\u56de\u5230\u6211\u7684\u7ec4 CONTENT_ADDED=\u5185\u5bb9\u5df2\u6dfb\u52a0 CONTENT_ADDED_FOLDER_FAIL=\u65e0\u6cd5\u5c06\u5185\u5bb9\u6dfb\u52a0\u5230\u6587\u4ef6\u5939 ${folderLink}\u3002 CONTENT_ADDED_FOLDER_SUCCESS=\u5185\u5bb9\u6709\u5df2\u6210\u529f\u6dfb\u52a0\u5230\u6587\u4ef6\u5939 ${folderLink}\u3002 CONTENT_NOT_ADDED=\u4e0d\u80fd\u6dfb\u52a0\u5185\u5bb9 DOCUMENT_ADDED_FOLDER_FAIL=\u65e0\u6cd5\u5c06\u6587\u6863\u6dfb\u52a0\u5230\u6587\u4ef6\u5939 ${folderLink}\u3002 DOCUMENT_ADDED_FOLDER_SUCCESS=\u6587\u6863\u5df2\u88ab\u6210\u529f\u6dfb\u52a0\u5230\u6587\u4ef6\u5939 ${folderLink}\u3002 FILE_ADDED_FOLDER_FAIL=\u65e0\u6cd5\u5c06\u8be5\u6587\u4ef6\u6dfb\u52a0\u5230\u6587\u4ef6\u5939 ${folderLink}\u3002 FILE_ADDED_FOLDER_SUCCESS=\u8be5\u6587\u4ef6\u5df2\u6210\u529f\u6dfb\u52a0\u5230\u6587\u4ef6\u5939 ${folderLink} \u4e2d\u3002 LINK_ADDED_FOLDER_FAIL=\u94fe\u63a5\u4e0d\u80fd\u6dfb\u52a0\u5230\u6587\u4ef6\u5939 ${folderLink}\u3002 LINK_ADDED_FOLDER_SUCCESS=\u94fe\u63a5\u5df2\u88ab\u6210\u529f\u6dfb\u52a0\u5230\u6587\u4ef6\u5939 ${folderLink}\u3002 NO_FOLDERS_GROUP=\u5728\u6b64\u7ec4\u4e2d\u76ee\u524d\u6ca1\u6709\u6587\u4ef6\u5939 NO_FOLDERS_MY_LIBRARY=\u6211\u7684\u5a92\u4f53\u5e93\u76ee\u524d\u6ca1\u6709\u6587\u4ef6\u5939 NO_MEMBER_GROUPS=\u60a8\u76ee\u524d\u4e0d\u662f\u4efb\u4f55\u7ec4\u7684\u6210\u5458 SHOW_GROUP_FOLDERS=\u4e3a${displayName}\u663e\u793a\u6587\u4ef6\u5939
{ "pile_set_name": "Github" }
using System.Collections.Generic; using System.Linq; namespace LightBDD.Framework.Parameters.Implementation { internal abstract class AbstractTableBuilder<TRow, TColumn> where TColumn : InputTableColumn { private readonly List<TColumn> _customColumns = new List<TColumn>(); protected bool InferColumns { get; set; } protected IEnumerable<TColumn> BuildColumns(TRow[] rows) { if (!InferColumns) return _customColumns; var custom = _customColumns.ToList(); TColumn FindCustom(string name) { var index = custom.FindIndex(x => x.Name == name); if (index < 0) return null; var column = custom[index]; custom.RemoveAt(index); return column; } var results = TableColumnProvider.InferColumns(rows, true) .Select(CreateColumn) .Select(column => FindCustom(column.Name) ?? column) .ToList(); results.AddRange(custom); return results; } protected void AddCustomColumn(TColumn column) { var currentIdx = _customColumns.FindIndex(c => c.Name == column.Name); if (currentIdx >= 0) _customColumns[currentIdx] = column; else _customColumns.Add(column); } protected abstract TColumn CreateColumn(ColumnInfo columnInfo); } }
{ "pile_set_name": "Github" }
/* ============================================================================== This file is part of the JUCE library. Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) b) the Affero GPL v3 Details of these licenses can be found at: www.gnu.org/licenses JUCE 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. ------------------------------------------------------------------------------ To release a closed-source product which uses JUCE, commercial licenses are available: visit www.juce.com for more information. ============================================================================== */ #ifndef JUCE_APPLICATIONCOMMANDID_H_INCLUDED #define JUCE_APPLICATIONCOMMANDID_H_INCLUDED //============================================================================== /** A type used to hold the unique ID for an application command. This is a numeric type, so it can be stored as an integer. @see ApplicationCommandInfo, ApplicationCommandManager, ApplicationCommandTarget, KeyPressMappingSet */ typedef int CommandID; //============================================================================== /** A set of general-purpose application command IDs. Because these commands are likely to be used in most apps, they're defined here to help different apps to use the same numeric values for them. Of course you don't have to use these, but some of them are used internally by Juce - e.g. the quit ID is recognised as a command by the JUCEApplication class. @see ApplicationCommandInfo, ApplicationCommandManager, ApplicationCommandTarget, KeyPressMappingSet */ namespace StandardApplicationCommandIDs { enum { /** This command ID should be used to send a "Quit the App" command. This command is recognised by the JUCEApplication class, so if it is invoked and no other ApplicationCommandTarget handles the event first, the JUCEApplication object will catch it and call JUCEApplicationBase::systemRequestedQuit(). */ quit = 0x1001, /** The command ID that should be used to send a "Delete" command. */ del = 0x1002, /** The command ID that should be used to send a "Cut" command. */ cut = 0x1003, /** The command ID that should be used to send a "Copy to clipboard" command. */ copy = 0x1004, /** The command ID that should be used to send a "Paste from clipboard" command. */ paste = 0x1005, /** The command ID that should be used to send a "Select all" command. */ selectAll = 0x1006, /** The command ID that should be used to send a "Deselect all" command. */ deselectAll = 0x1007, /** The command ID that should be used to send a "undo" command. */ undo = 0x1008, /** The command ID that should be used to send a "redo" command. */ redo = 0x1009 }; } #endif // JUCE_APPLICATIONCOMMANDID_H_INCLUDED
{ "pile_set_name": "Github" }
=== Contact Form DB === Contributors: msimpson Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=NEVDJ792HKGFN&lc=US&item_name=Wordpress%20Plugin&item_number=cf7%2dto%2ddb%2dextension&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted Tags: contact form,database,contact form database,save contact form,form database,CFDB License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html Requires at least: 3.2.1 Tested up to: 5.0.2 Stable tag: 2.10.36 Saves submitted form data to the database. Export the data to a file or use shortcodes to display it. == Description == The "CFDB" plugin saves contact form submissions to your WordPress database and provides and administration page and shortcodes to view and display the data. Video tutorial on the <a href="http://cfdbplugin.com/">CFDB Plugin Site</a> By simply installing the plugin, it will automatically begin to capture form submissions from: * <a href="https://wordpress.org/plugins/contact-form-7/">Contact Form 7 (CF7) plugin</a> * <a href="https://wordpress.org/plugins/si-contact-form/">Fast Secure Contact Form (FSCF) plugin</a> * <a href="https://wordpress.org/plugins/jetpack/">JetPack Contact Form plugin</a> * <a href="http://www.gravityforms.com">Gravity Forms plugin</a> * <a href="https://wordpress.org/plugins/wr-contactform/">WR ContactForm plugin</a> * <a href="https://wordpress.org/plugins/form-maker/">Form Maker plugin</a> * <a href="https://wordpress.org/plugins/formidable/">Formidable Forms (BETA)</a> * <a href="http://codecanyon.net/item/forms-management-systemwordpress-frontend-plugin/8978741">Forms Management System (BETA)</a> * <a href="http://codecanyon.net/item/quform-wordpress-form-builder/706149/">Quform plugin (BETA)</a> * <a href="https://wordpress.org/plugins/ninja-forms/">Ninja Forms plugin (BETA)</a> * <a href="https://wordpress.org/plugins/caldera-forms/">Caldera Forms plugin (BETA)</a> * <a href="https://wordpress.org/plugins/cforms2/">CFormsII (BETA)</a> * <a href="http://codecanyon.net/item/formcraft-premium-wordpress-form-builder/5335056">FormCraft Premium (BETA)</a> * <a href="http://themeforest.net/item/enfold-responsive-multipurpose-theme/4519990">Enfold theme forms</a> Other form submissions can be saved with the addition of the <a href="http://cfdbplugin.com/?page_id=508">[cfdb-save-form-post]</a> short code on the target submission page. Contact form plugins are great except for one thing...the ability to save and retrieve the form data to/from the database. If you get a lot of form submissions, then you end up sorting through a lot of email. This plugin provides three administration pages in the administration area under the "Contact form DB" submenu. * "Contact form DB" to view and export form submission data * "Database Short Code" page to generate shortcodes and exports * "Database Options" to change configuration parameters Displaying Saved Data in Posts and Pages Use shortcodes such as [cfdb-html], [cfdb-table], [cfdb-datatable], [cfdb-value] and [cfdb-json] to display the data on a non-admin page on your site. Use the short code builder page to set short code options. == Installation == 1. Your WordPress site must be running PHP5 or better. This plugin will fail to activate if your site is running PHP4. 1. Be sure that one or more of the supported form plugins installed and activated. == Frequently Asked Questions == = Is there a tutorial? = See the <a href="https://www.youtube.com/watch?v=mcbIKJK6EJ0">Video Tutorial</a> = I installed the plugin but I don't see any of my forms listed in the administration page = Nothing will show until you have actual form submissions captured by this plugin. The plugin is not aware of your form definitions, it is only aware of form submissions. = Where can I find documentation on the plugin? = Refer the <a href="http://cfdbplugin.com/">Plugin Site</a> = Where do I see the data? = * In the admin page, "Contact Form DB" = Can I display form data on a non-admin web page or in a post? = Yes, <a href="http://cfdbplugin.com/?page_id=89">documentation on shortcodes</a> `[cfdb-html]`, `[cfdb-datatable]`, `[cfdb-table]`, `[cfdb-json]` and `[cfdb-value]`, etc. = What is the name of the table where the data is stored? = `wp_cf7dbplugin_submits` Note: if you changed your WordPress MySql table prefix from the default `wp_` to something else, then this table will also have that prefix instead of `wp_` (`$wpdb->prefix`) = If I uninstall the plugin, what happens to its data in the database? = By default it remains in your database in its own table. There is an option to have the plugin delete all its data if you uninstall it that you can set if you like. You can always deactivate the plugin without loosing data. == Screenshots == 1. Admin Panel view of submitted form data == Changelog == = 2.10.32 = * Improvement: Added option for CF7 forms to capture complete URL that form was posted from = 2.10.31 = * Improvement: Added support for GitHub updater. Install that plugin as well so that you can update CFDB directly from GitHub instead of from WP. https://github.com/afragen/github-updater = 2.10.30 = * Security: updates to protect against XSS attacks * Removed: outdated upload into Google Sheet via old Zend that doesn't support MFA = 2.10.29 = * Security: protecting against a specific XSS vulnerability = 2.10.28 = * Updates: to match the following improvements in CFDB Editor 1.5 * Improvement: CSV Import - can now set delimiter, enclosure and escape characters * Improvement: CSV Import - better de-duplication of submit_times read in CSV = 2.10.27 = * Improvement: Updated Excel & ODS exporter to Spout-2.7.1 from Spout-2.7.0 * New: New transform function diff(field,value,[value2,value3,...]) * New: New transform function cfdb_date_diff(StringDateStart,StringDateEnd) * New: New transform function cfdb_duration(StringDateStart,StringDateEnd,format) = 2.10.26 = * Improvement: Ninja Forms integration now observes the "Admin Label" as an override for the field name. = 2.10.25 = * Bug Fix: Update to match latest version of wp-jalali plugin for generating Jalali-formatted dates * Bug Fix: related to key size for mcrypt_decrypt seen on some hosts * Improvement: Gravity Forms integration now observes teh "Admin Field Label" as an override for the field name. * Improvement: Updated Excel & ODS exporter to Spout-2.7.0 from Spout-2.4.2 = 2.10.24 = * Change: the new SplitField transform is changed: can be used to split a single field into multiple fields based on a delimiter in field values. If you have field "Choice" with values like "AAA|BBB|CCC" you change that to Choice-1,Choice-2,Choice-3 fields using [cfdb-table form="form" trans="SplitField(Choice,|)"] If you don't indicate a delimiter it is assumed to be a comma: If you have field "Choice" with values like "AAA,BBB,CCC" you change that to Choice-1,Choice-2,Choice-3 fields using [cfdb-table form="form" trans="SplitField(Choice)"] Use "headers" to rename those columns: [cfdb-table form="Gravity Form 1" trans="SplitField(List,|)&&SplitField(Option,|)" headers="Option-1=TextOption,Option-2=NumericOption"] = 2.10.23 = * Bug Fix: Admin page Javascript bug exporting file to Google Docs * Bug Fix: Shortcode builder page Javascript syntax error in Dutch translation due to quoting * Improvement: Identifying IP address of poster - looking at more HTTP Headers * New: SplitField transform can be used to split a single field into multiple fields based on a delimiter in field values. If you have field "Choice" with values like "AAA|BBB|CCC" you change that to Choice-1,Choice-2,Choice-3 fields using [cfdb-table form="form" trans="SplitField(|,Choice)"] (use "headers" to rename those columns) [cfdb-table form="Gravity Form 1" trans="SplitField(|,List)&&SplitField(|,Option)" headers="Option-1=TextOption,Option-2=NumericOption"] * New: DefaultField transform can be used to set the value in a field if it is not defined. [cfdb-table form="form" trans="DefaultField(score1,0,score2,0)"] would set "score1" and "score2" fields to be 0 where they have no value in the DB * New: "unknownfields" in [cfdb-html unknownfields="true"] will replace any unknown ${NAME} in the shortcode template with a blank. = 2.10.22 = * Bug Fix: Changed to Caldera Forms 1.4.2 was causing an error when saving submissions * Bug Fix: on Shortcode builder page, certain form names with special characters not displaying correctly = 2.10.21 = * Bug Fix: causing short code builder page to fail to generate shortcodes on some sites. = 2.10.20 = * Bug Fix: Form Maker submissions were being saved under "Untitled" instead of "Form Maker" form name when no form_name field specified * Bug Fix: Shortcode builder page: sometimes text after < character in filter not showing in shortcode = 2.10.19 = * New: Now saves contact form submissions from Forms Management System. Requires Forms Management 2.7 or later. * Bug Fix: Sometimes form data not found in dashboard view when form name is from certain character sets (e.g. Hebrew) = 2.10.18 = * Bug Fix: Shortcode builder & Import pages: Form names with double quotes in drop downs not working properly * Improvement: Shortcode builder page layout reorganized using tabs * New: CountInField transform (different from CountField) can could choices in one field that have multiple entries (from checkboxe field) = 2.10.17 = * Bug Fix: Admin View: Form names with double quotes on them could not be viewed in the admin panel * New: Can save Page Title and Page URL from Contact Form 7 submissions. Enable this in the CFDB Options page. * Improvement: Setting option for property "Allow only Administrators to see CFDB administration screens" to true by default = 2.10.16 = * Improvement: In shortcodes and exports, the form name can be a regular express, for example form names starting with "a" [cfdb-table form="/^a"] (this is case insensitive based on your MySQL CI setting. It uses a MySQL REGEX, not PHP preg_match) * Improvement: Helpful message on CFDB Options page when it cannot be displayed due to inadequate PHP version = 2.10.15 = * Bug Fix: When adding [submit_time] in Contact Form 7 mails, the value might not match what is in the DB depending on your locale setting. * Bug Fix: In the CFDB admin page, the WP Footer would appear on top of the CFDB table when it had a lot of entries. The "wpfooter" is not hidden on that page. = 2.10.14 = * New: [in] and [!in] operators for filters, for example filter="name[in]Mike,John,Tom" * Bug Fix: (Minor) Exporting from admin window when more than one work entered in the search box did not match what was shown on screen * Improvement: When exporting from admin page, if certain rows are selected then only those rows are exported * Improvement: Minor display fixes = 2.10.13 = * Improvement: Excel (.xlsx) exports for forms that include files, now have working hyperlinks to download files from the Excel spreadsheet = 2.10.12 = * Improvement: Plugin settings page now organized in tabs * Improvement: Minor CSS changes on admin pages = 2.10.11 = * New: changes to support capturing submissions from Very Simple Contact Form and Very Simple Signup Form = 2.10.10 = * Improvement: Admin page allow for the setting of the CSV delimiter for export files. If not set, regional delimiter is used ("," or ";") * Change: Previous change set CSV exports to use a delimiter based on the region. This is changed back to always use "," unless "delimiter" parameter sets the delimiter or if new "regionaldelimiter" paramter is set to "true" * New: Added transform trans="AddRowNumberField(fieldname,start)" to add a column labeled "fieldname" that simply numbers the rows starting at number "start" * New: Integration with Very Simple Contact Form = 2.10.9 = * Bug Fix: Google Spreadsheet Live data: bug was introduced in 2.10.6 where data fetched by IMPORTDATA() could return with wrong delimiter (semicolon instead of comma) based on regional settings for CSV delimiter. This would cause Google Spreadsheet to be unable to parse data into columns = 2.10.8 = * Improvement: Links to exports and file downloads now redirect to login page when user is not logged in = 2.10.7 = * Bug Fix: Gravity Form integration was not capturing certain date fields = 2.10.6 = * Improvement: UTF8 CSV and Excel export now smarter about choosing "," or ";" for field and function delimiters respectively. * Improvement: Dashboard single-record view now has download links on files which was missing * Improvement: CFDB Option Error Output File - no longer need to specify full path. Just put in a file name and it will put in the top level WP install directory * Note: If you have CFDB Editor installed, you will need to update that to version 1.4.3 to work properly with this update = 2.10.5 = * New: Now captures form submission from FormCraft Premium (BETA) * Improvement: Excel & OpenDoc exports now formats Submitted datetime field in a format the spreadsheet recognizes * Improvement: Gives clear error message when can't do Excel file export due to PHP version less than 5.4 * Improvement: Less queries to fetch options from DB = 2.10.4 = * Bug Fix: In some situations UFT-16-LE is not read correctly by Excel (issue related to output buffering) = 2.10.3 = * Bug Fix: Fixed issue where some files would not download * Improvement: Can now add "Submitted Login" and "Submitted From" to the list of fields NOT to save * Improvement: Short Code builder page for [cfdb-export-link] was missing options to set file type as .xlsx and .ods and to choose a delimiter for CSV files = 2.10.2 = * NOTE: Parsing of functions in shortcodes has changed to be more strict. Check your shortcodes and update them to remove any extraneous spaces. For example, change trans="field=str_replace(a, b, c)" to trans="field=str_replace(a,b,c)" = 2.10.1 = * Bug Fix: Extra output generated (possibly by other plugins or debug) ahead of export file download made export file corrupt. (Not seen on most sites) = 2.10.0 = * New: Now supports exports to .xlsx and .ods file formats. This requires PHP 5.4 or later. Otherwise you will get an error on export. * Improvement: Can now specify the delimiter for CSV exports * Improvement: Added support for multisite (BETA) * Improvement: Variable substitution enabled for form name in shortcodes = 2.9.16 = * Bug Fix: [cfdb-export-link] is now processing filter $_GET, $_POST, $_COOKIE values before creating the URL * Bug Fix: To Formidable Forms integration (BETA) = 2.9.15 = * Bug Fix: Where WP installations that output debug would add text to ajax return value * Bug Fix: When WPML plugin is also installed, export and ajax URLs were incorrect = 2.9.14 = * New: Formidable Forms integration added (BETA) * New: CFormsII integration added (BETA) * Bug Fix: Ninja Form integration (BETA) - warning messages seen when using PayPal * Performance enhancement: related to accessing options = 2.9.13 = * Bug Fix: on some WP installations, delete operations were being blocked = 2.9.12 = * Added <a href="http://cfdbplugin.com/?page_id=1167#SummationRow">SummationRow</a> transform = 2.9.11 = * Bug fix: where download files can be corrupted (2nd fix) = 2.9.10 = * Bug fix: where download files can be corrupted = 2.9.9 = * Bug fix: fixing rare stripslash() error * Bug fix: fixes to permissions = 2.9.8 = * Bug fix: Capturing Gravity Forms List element when it has columns = 2.9.7 = * Bug Fix: Capturing file uploads from WR Contact Form 1.1.10 = 2.9.6 = * Bug fix: Occasional problem with language translations being initialized * Minor update to Contact Form 7 integration = 2.9.5 = * Bug fix to Google Spreadsheet Live Data export (failing to login) * Bug fix for exporting forms with a single quote in the name = 2.9.4 = * Added spreadsheet-like transforms: ** Sum rows: trans="total=field1,field2,field3" ** Sum columns: trans=TotalField(field1,field2,field3) ** Sum both: trans="total=field1,field2&&TotalField(field1,field2,total)" ** Sum product prices: trans="p1_total=multiply(p1,9.99)&&p2_total=multiply(p2,8.99)&&line_total=sum(p1_total,p2_total)&&TotalField(line_total)" = 2.9.3 = * Fix error on systems where php_uname() is not available * Allowing various PHP math functions in "trans" = 2.9.2 = * Bug Fix: for some cases where cannot delete row in administration page = 2.9.1 = * Bug Fix: for some cases where cannot delete row in administration page = 2.9 = * Updat: Additional HTML-injection protections * New: Option when Editor is installed [cfdb-datatable edit="cells"] enables editing of table cells but not column headers = 2.8.38 = * Improvement: NaturalSortByMultiField transform now supports up to 10 fields to sort on = 2.8.37 = * New: Now captures form submission from Caldera Forms * Improvement: Formatting changes on CFDB Options page = 2.8.36 = * New: Now captures form submission from Quform plugin * New: Now captures form submission from Ninja Forms plugin = 2.8.35 = * Improvement: Reduced cell padding in admin table * Improvement: Fixed typo in new option = 2.8.34 = * New: Now captures Enfold Theme forms * New on Options page: "Use fixed width in Admin datatable" * Improvement: Taiwanese language update = 2.8.33 = * Bug Fix: Fixed Delete button on Admin entry detail page = 2.8.32 = * Improvement: Security patch = 2.8.31 = * Bug Fix: to work with Gravity Forms 1.9.1.2 = 2.8.30 = * Bug Fix: Minor fix to short code builder page = 2.8.29 = * Improvement: Tweak to install procedure = 2.8.28 = * Improvement: Security patch = 2.8.27 = * Improvement: Minor tweak to allow edit mode in short code to be set via $_GET and $_POST = 2.8.26 = * Bug Fix: Encoding fix on administration page = 2.8.25 = * New: Now captures data from WR ContactForm (BETA) * New: Option to allow only Administrators to see CFDB administration screens * New: Option to send CFDB errors to a file to email * Bug Fix: to avoid rare instances of duplicate submit_time = 2.8.24 = * Bug Fix: related to displaying form names in administration panel with certain characters = 2.8.23 = * Bug Fix: for Gravity Form integration. Sometimes field value was not captured where there are multiple fields of the same name but only one shown based on conditional field definition. = 2.8.22 = * Improvement: Changed icon in admin panel * Improvement: Dutch translation update = 2.8.21 = * Improvement: Added icons to admin panel = 2.8.20 = * Improvement: Additional XSS protection for admin panels = 2.8.19 = * Improvement: Swedish translation update = 2.8.18 = * Improvement: Better XSS protection for admin panels = 2.8.17 = * Bug Fix: in [cfdb-html] variable substitution when data for column is not present. = 2.8.16 = * New: Generating the [submit_time] tag for Contact Form 7 is now an option in the Options page and is off by default to avoid the post being flagged as spam * Improvement: Added some protection against cross site scripting = 2.8.15 = * Bug Fix: No longer generating 'submit_url' for Contact Form 7 email because it seems to cause CF7 to think it is a spam submission and it drops it. * Bug Fix: when form name has commas in it, retrieving its data from the DB did not work because plugin was treating it as a list of form names = 2.8.14 = * Bug Fix: to capturing Gravity Forms list values = 2.8.13 = * Bug Fix: in "trans" = 2.8.12 = * Work-around: for WP bug https://core.trac.wordpress.org/ticket/29658 = 2.8.11 = * Bug Fix: related to Excel Internet Query export * Bug Fix: when HTML special characters in short code attributes = 2.8.10 = * Bug Fix: related to "trans" with multiple transform functions = 2.8.9 = * Improvement: Added delete button in admin screen viewing single submission * New: Can now include in CF7 emails the CFDB [submit_time] and [submit_url] * Bug Fix: to handling line breaks in [cfdb-json] = 2.8.8 = * Bug Fix: work-around for bug in PHP 5.3.0 - 5.3.8 https://bugs.php.net/bug.php?id=43200 = 2.8.7 = * Bug Fix: [cfdb-export-link] was not processing all short code options = 2.8.6 = * Bug Fix: on some system submit_time timestamp lost precision due to being represented in scientific notation. This can cause more than one submission being seen as the same. = 2.8.5 = * Bug Fix: to error message introduced in 2.8.4 = 2.8.4 = * New: Shortcode [cfdb-save-form-maker-post] can be used to capture data from Form Maker plugin. * Bug Fix: (recently introduced in 2.8) Fixed handling of filter expressions with $_POST(field) where field is blank * Bug Fix: Fix for rarely experienced bug where plugin is confused about needing to upgrade itself = 2.8.3 = * Improvement: IMPORTANT: Addition fix to work properly with Contact Form 7 version 3.9 = 2.8.2 = * Improvement: IMPORTANT: Contact Form 7 users will need to update to this version when they update to Contact Form 7 version 3.9 otherwise data will no longer be saved in the database! * Bug Fix: cases where blank version saved to DB was causing the plugin to keep trying to upgrade * Bug Fix: data with blank column name was causing query to fail and data not to be displayed = 2.8.1 = * Bug Fix: transform re-assigning the value of a column was creating a duplicate column = 2.8 = * New: Can put functions in short code filters. <a target="_cfdb_doc" href="http://cfdbplugin.com/?page_id=1073">See documentation</a> * New: Can transform data coming into shortcodes by assigning functions or classes in the new "trans" short code attribute. <a target="_cfdb_doc" href="http://cfdbplugin.com/?page_id=1076">See documentation</a> * New: All short code options can be set to $_POST(value), $_GET(value), $_COOKIE(value) * New: Most shortcodes now allows for an optional "before" and "after" section * New: Admin page view now has links on each row to bring up a window with just that entry's data. Easier to read and print (and edit if Editor extension is installed) * Bug Fix: Support for MySqli which should fix some character encoding issues * Bug Fix: Returning null from cfdb_form_data filter now stops the form from saving * Bug Fix: hook to save form data was not returning "true" an causing subsequent hooks for other plugins to not be called. = 2.7.5 = * Improvement: Simpler Google Live Data implementation * New: [cfdb-json] now supports "header" and "headers" options. Short code builder page now generates JSON export link. = 2.7.4 = * Bug Fix: short code builder page for Google Live Data typo: was giving the spreadsheet function as "cfdbddata" instead of "cfdbdata" = 2.7.3 = * Bug Fix: for mysql_real_escape_string error = 2.7.2 = * Bug Fix: Google Spreadsheet Live Data now fixed. But users need to regenerate Google script code * New: Google Spreadsheet Live Data function now supports all standard short code options (filter, show, hide, etc.) * New: Short Code Builder page now can build function call to be used in Google Spreadsheet * New: [cfdb-export-link], CSV exports and Excel export Links now support "headers" options = 2.7.1 = * New: Integration with wp-parsidate to shows Shamsi(Jalali) dates. = 2.7 = * New: Integration with Gravity Forms * Improvement: Translation updates = 2.6.3 = * Bug Fix: When option was set, Cookies were not being captured with the form submission unless explicitly listed * Improvement: Option page has "have donated" option that will turn off showing the Donate button on admin pages = 2.6.2 = * Improvement: Admin page has checkbox for selecting all visible rows * New: Option to set #Rows (of maximum above) visible in the Admin datatable * New: Custom short code filters (alpha) = 2.6.1 = * Bug Fix: needed to strip slashes from dt_options when using cfdb-datatable by URL * Bug Fix: avoiding divide by zero error in [cfdb-value] * Bug Fix: avoiding error when no timezone set: "Notice: date_default_timezone_set() [function.date-default-timezone-set.php]: Timezone ID '' is invalid" = 2.6 = * New: [cfdb-datatable form="form-name" edit="true"] The "edit" option makes the table editable if the CFDB Editor plugin extension is also installed. * Improvement: [cfdb-datatable] "Show" setting shows all rows by default * Improvement: [cfdb-datatable] upgraded the included DataTables to version 1.9.4 * New: Support for import from CSV file when CFDB Editor extension is installed = 2.5.2 = * Bug Fix. When user has exactly one form and admin page auto-loads that form's data, the editor plugin did not know which form to edit. = 2.5.1 = * New: Now "headers" option on [cfdb-table] and [cfdb-datatable] allow you to change column header display names, e.g [cfdb-table form="form1" headers="ext_field1=First Name,ext_field2=Last Name"] * New: Can now query multiple forms at once in shortcodes, e.g. [cfdb-table form="form1,form2"] * New: Added RSS URLs * New: Can now use regex's in options for forms & fields to ignore and which cookie values to save = 2.5 = * New: Added option to set the timezone in which Submit Time should be captured. = 2.4.8 = * Bug Fix: noSaveFields not observed for file upload files = 2.4.7 = * Bug Fix: for "PHP Notice: Undefined property: WPCF7_ContactForm::$user" = 2.4.6 = * Bug Fix: where JetPack users could not see submitted data related to form field names with a single quote in them = 2.4.5 = * Bug Fix: issue where admin page for data does not show for users less than administration even when permissions are set for such users to view the data = 2.4.4 = * Bug Fix: WordPress 3.5 compatibility issue where uploaded files were not being saved. * New: New top-level menu on administration page * Improvement: JetPack form submissions are now separated based on the JetPack form ID. The form name will be listed as 'JetPack Contact Form ' followed by the form's numeric ID. = 2.4.3 = * New: Added Japanese language support (Shift-JIS) = 2.4.2 = * Bug Fix: character encoding issues with Excel IQY = 2.4.1 = * New: Added new short code attribute "role" to limit short code output only to those with sufficient role. * New: Added new short code attribute "permissionmsg" to allow turning off the "You do not have sufficient permissions to access this data" message = 2.4 = * New: Now captures data from JetPack Contact Form * New: Added filter hook <a href="http://cfdbplugin.com/?page_id=747">cfdb_form_data</a> that can be used to change data before it gets submitted * New: Added "random" option to short code. Used to retrieve random subset of rows from the query. Usage example: [cfdb-table form="myform" random="1"]. The number is the number of random rows to return. * New: Added button to remove _wpcf7 columns in admin page = 2.3.2 = * Bug Fix: that occasionally prevents pagination in the admin view of data * Bug Fix: where external integrations posting to CFDB might fail if list of upload files was null instead of empty array = 2.3.1 = * Bug Fix: where $_GET and $_COOKIE would not work = 2.3 = * Bug Fix: Variable substitution in filter now works when embedded in text, e.g. filter="fname~~/.*$_POST(fname).*/i&&lname~~/.*$_POST(lname).*/i" * Bug Fix: Filters: Handling where one has two ampersands in a filter expression to indicate logical AND but the WordPress editor converts them to html-coded version of ampersand. * Improvement: Excel IQuery export now takes standard shortcode options * New: New "header=false" in table type shortcodes and IQuery will avoid showing the header. = 2.2.7 = * Bug Fix: Fix to match change to Contact Form 7 version 3.1 where uploaded files were not being saved to the database. = 2.2.6 = * Bug Fix: seeing error "undefined function is_plugin_active()" = 2.2.5 = * Bug Fix: Admin page data table was not showing top search banner when datatable using i18n * New: Displays Jalali dates when wp-jalali plugin is installed and activated = 2.2.4 = * New: cfdb-html now supports nested shortcodes * Bug Fix: short code builder for cfdb-html not showing template HTML tags * Improvement: if "form" missing from a short code, PHP error no longer happens = 2.2.3 = * New: Can do exports via the Short Code Builder Page with the main short code options applied (show, hide, search, filter, limit, orderby) = 2.2.2 = * Bug Fix: for some users the fix in 2.2.1 for setting character encoding when retrieving was throwing exception because no $wpdb->set_charset() method exists. Made code handle this case = 2.2.1 = * Bug Fix: relating to character encoding: umlaut characters not displaying correctly * Bug Fix: "class" attribution on table tag was not being emitted for [cfdb-datatables] * Bug Fix: Fixed some strings that were not being internationalized. * Improvement: More links to documentation on Database Short Code page = 2.2 = * New: Short code "filter" values using submit_time can now use 'strtotime' values. E.g. "submit_time>last week" * Improvement: Dropped index `form_name_field_name_idx` but this fails on some MySQL versions and needs to be done manually (<a href="http://bugs.mysql.com/bug.php?id=37910">MySQL Bug 37910</a>). = 2.1.1 = * Improvement: Upgrade of DataTables to version 1.8.2 from 1.7.6 = 2.1 = * New: short code: [cfdb-save-form-post] * New: [cfdb-html] new option: "stripbr" * New: Raw submit_time is available for shortcodes as a field name * Improvement: Removed unnecessary quotes in Short Code builder page for "enc" value in URL generated by [cfdb-export-link] * Improvement: On uninstall, table in DB is no longer dropped by default * New: When accessing a file link, it will it can now display in the browser instead of forcing a download. Mime-type issues resolves. = 2.0.1 = * Bug Fix: where [cfdb-count] always gave total, ignoring filters * New: Added 'percent' function to [cfdb-count] = 2.0 = * New: Data editing support in conjunction with Contact Form to Database Edit plugin * Bug Fix: Name of table that stores data was down-cased from wp_CF7DBPlugin_SUBMITS to wp_cf7dbplugin_submits to avoid issues described in http://wordpress.org/support/topic/cf7-and-cfdb-not-saving-submissions = 1.8.8 = * Bug Fix: when using "filter" operators < and > where not working in cases where they were represented &amp;gt; and &amp;lt; HTML codes * Bug Fix: "orderby" in shortcode was ignoring if ordered by "Submitted" or "submit_time" * Improvement: Filter operations now try to do numeric comparisons when possible * New: Can now use "submit_time" field in "filter" to filter on the timestamp float. * Improvement: [cfdb-html] now preserves line breaks in fields by converting new lines to BR tags. * New: CFDBFormIterator now includes a 'submit_time' field showing the raw timestamp = 1.8.7 = * New: [cfdb-html] now has wpautop option * Improvement: Form input is now always run through stripslashes() regardless of whether or not get_magic_quotes_gpc is on. This is to be consistent with wp_magic_quotes always being called = 1.8.6 = * New: shortcode: [cfdb-export-link] * Bug Fix: in JSON output = 1.8.5 = * New: Added Shortcode builder page * New: [cf7db-count] shortcode now supports counting all forms using form="*" or a list of forms using form="form1,form2,form3" * New: [cf7db-html] now has "filelinks" option useful for displaying image uploads. * New: Added options to turn on/off capturing form submissions from CF7 and FSCF = 1.8.4 = * New: Added "cfdb_submit" hook. See http://cfdbplugin.com/?page_id=377 * New: Added delimiter option for [cfdb-value] shortcode, e.g. [cfdb-value delimiter=','] * Bug Fix: related to [cfdb-value] when not used as a shortcode (it was not observing show & hide options) * Improvement: Now including DataTables distribution inside this distribution so that page does not reference scripts from another site (so sites using https have everything encrypted on the page) * Improvement: In [cfdb-html] shortcode, now removing undesired leading "br" tag and ending "p" tag that WordPress injects. This was messing up table rows (tr tags) in the shortcode because WP was injecting line breaks between the rows. = 1.8.3 = * Bug Fix: Minor bug fixes. = 1.8.2 = * Bug Fix: Minor bug fixes. * New: Added option to not delete data on uninstall = 1.8.1 = * Bug Fix: Fixed bug introduced in 1.8 where deleting individual rows from the admin page did nothing. = 1.8 = * New: shortcodes [cfdb-html] and [cfdb-count] * New: Shortcode option: 'limit' * New: Shortcode option: 'orderby' * Improvement: Performance/memory enhancements to enable plugin to handle large data volumes * New: Now capturing form submission times with microseconds to avoid collision of two submissions during the same second * Bug Fix: Fix to work with installations where wp-content is not at the standard location * New: Shortcode "show" and "hide" values can now use regular expressions to identify columns * New: Option to show database query text on Admin page = 1.7 = * New: Creating an export from the admin panel now filters rows based on text in the DataTable "Search" field. * New: [cfdb-json] now has "format" option. * Bug Fix: where "Submitted" column would sometimes appear twice in shortcodes * New: Now can filter on "Submitted" column. * Improvement: Admin Database page is now blank by default and you have to select a form to display. = 1.6.5 = * New: Now fully supports internationalization (i18n) but we need people to contribute more translation files. * Improvement: DataTables (including those created by shortcodes) will automatically i18n based on translations available from DataTables.net * Improvement: Italian translation courtesy of Gianni Diurno * Improvement: Turkish translation courtesy of Oya Simpson * Improvement: Admin page DataTable: removed horizontal scrolling because headers do not scroll with columns properly * Update: Updated license to GPL3 from GPL2 = 1.6.4 = * Bug Fix: Fixed bug causing FireFox to not display DataTables correctly. = 1.6.3 = * Bug Fix: Handling problem where user is unable to export from Admin page because jQuery fails to be loaded. = 1.6.2 = * Bug Fix: avoiding inclusion of DataTables CSS in global admin because of style conflicts & efficiency = 1.6.1 = * Bug Fix: in CSV Exports where Submitted time format had a comma in it, the comma was being interpreted as a field delimiter. * Improvement: Accounting for local timezone offset in display of dates = 1.6 = * Improvement: Admin page for viewing data is now sortable and filterable * New: shortcode: [cfdb-datatable] to putting sortable & filterable tables on posts and pages. This incorporates http://www.datatables.net * New: Option for display of localized date-time format for Submitted field based on WP site configuration in "Database Options" -> "Use Custom Date-Time Display Format" * New: Option to save Cookie data along with the form data. "Field names" of cookies will be "Cookie <cookie-name>" See "Database Options" -> "Save Cookie Data with Form Submissions" and "Save only cookies in DB named" = 1.5 = * New: Now works with Fast Secure Contact Form (FSCF) * New: shortcode `[cfdb-value]` * New: shortcode `[cfdb-json]` * Update: Renamed shortcode `[cf7db-table]` to `[cfdb-table]` (dropped the "7") but old one still works. * New: Added option to set roles that can see data when using `[cfdb-table]` shortcode * New: Can now specify per-column CSS for `[cfdb-table]` shortcode table (see FAQ) * Bug Fix: with `[cfdb-table]` shortcode where the table aways appeared at the top of a post instead of embedded with the rest of the post text. = 1.4.5 = * Improvement: Added a PHP version check. This Plugin Requires PHP5 or later. Often default configurations are PHP4. Now a more informative error is given when the user tries to activate the plugin with PHP4. = 1.4.4 = * New: If user is logged in when submitting a form, 'Submitted Login' is captured * New: `[cfdb-table]` shortcode options for filtering rows including using user variables (see FAQ) * New: `[cfdb-table]` shortcode options for CSS * New: Can exclude forms from being saved to DB by name = 1.4.2 = * New: Added `[cf7db-table]` shortcode to incorporate form data on regular posts and pages. Use `[cf7db-table form="your-form"]` with optional "show" and "hide: [cf7db-table form="your-form" show="field1,field2,field3"] (optionally show selected fields), [cf7db-table form="your-form" hide="field1,field2,field3"] (optionally hide selected fields) = 1.4 = * New: Added export to Google spreadsheet * New: Now saves files uploaded via a CF7 form. When defining a file upload in CF7, be sure to set a file size limit. Example: [file upload limit:10mb] * New: Made date-time format configurable. * New: Can specify field names to be excluded from being saved to the DB. * Improvement: In Database page, the order of columns in the table follows the order of fields from the last form submitted. = 1.3 = * New: Added export to Excel Internet Query * Improvement: "Submitted" now shows time with timezone instead of just the date. * Improvement: The height of cells in the data display are limited to avoid really tall rows. Overflow cells will get a scroll bar. * Improvement: Protection against HTML-injection * New: Option to show line breaks in multi-line form submissions * Improvement: Added POT file for i18n = 1.2.1 = * New: Option for UTF-8 or UTF-16LE export. UTF-16LE works better for MS Excel for some people but does it not preserve line breaks inside a form entry. = 1.2 = * Improvement: Admin menu now appears under CF7's "Contact" top level menu * New: Includes an Options page to configure who can see and delete submitted data in the database * Improvement: Saves data in DB table as UTF-8 to support non-latin character encodings. * Improvement: CSV Export now in a more Excel-friendly encoding so it can properly display characters from different languages = 1.1 = * New: Added Export to CSV file * New: Now can delete a row = 1.0 = * Initial Revision. == Upgrade Notice == = 2.9.2 = For users of the CFDB Editor, CFDB 2.9.x will require and upgrade of the CFDB Editor 1.4 as well. See admin notice after upgrade of CFDB. = 2.9.1 = For users of the CFDB Editor, CFDB 2.9.x will require and upgrade of the CFDB Editor 1.4 as well. See admin notice after upgrade of CFDB. = 2.9 = For users of the CFDB Editor, CFDB 2.9 will require and upgrade of the CFDB Editor 1.4 as well. See admin notice after upgrade of CFDB. = 1.6 = New cool DataTable = 1.5 = Now works with <a href="http://wordpress.org/extend/plugins/si-contact-form/">Fast Secure Contact Form</a>. Plus more and better shortcodes.
{ "pile_set_name": "Github" }
# file : libbuild2/bash/buildfile # license : MIT; see accompanying LICENSE file # NOTE: shared imports should go into root.build. # include ../ imp_libs = ../lib{build2} # Implied interface dependency. include ../in/ int_libs = ../in/lib{build2-in} ./: lib{build2-bash}: libul{build2-bash}: {hxx ixx txx cxx}{** -**.test...} \ $int_libs $imp_libs # Unit tests. # exe{*.test}: { test = true install = false } for t: cxx{**.test...} { d = $directory($t) n = $name($t)... ./: $d/exe{$n}: $t $d/{hxx ixx txx}{+$n} $d/testscript{+$n} $d/exe{$n}: libul{build2-bash}: bin.whole = false } # Build options. # obja{*}: cxx.poptions += -DLIBBUILD2_BASH_STATIC_BUILD objs{*}: cxx.poptions += -DLIBBUILD2_BASH_SHARED_BUILD # Export options. # lib{build2-bash}: { cxx.export.poptions = "-I$out_root" "-I$src_root" cxx.export.libs = $int_libs } liba{build2-bash}: cxx.export.poptions += -DLIBBUILD2_BASH_STATIC libs{build2-bash}: cxx.export.poptions += -DLIBBUILD2_BASH_SHARED # For pre-releases use the complete version to make sure they cannot be used # in place of another pre-release or the final version. See the version module # for details on the version.* variable values. # # And because this is a build system module, we also embed the same value as # the interface version (note that we cannot use build.version.interface for # bundled modules because we could be built with a different version of the # build system). # ver = ($version.pre_release \ ? "$version.project_id" \ : "$version.major.$version.minor") lib{build2-bash}: bin.lib.version = @"-$ver" libs{build2-bash}: bin.lib.load_suffix = "-$ver" # Install into the libbuild2/bash/ subdirectory of, say, /usr/include/ # recreating subdirectories. # {hxx ixx txx}{*}: { install = include/libbuild2/bash/ install.subdirs = true }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Jun 6 2019 20:12:56). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <DVTSourceEditor/DVTInvalidation-Protocol.h> @protocol DVTUndoManagerDelegate; @protocol DVTUndo <DVTInvalidation> @property(nonatomic, retain) id <DVTUndoManagerDelegate> delegate; @property(nonatomic, readonly) BOOL willAutomaticallyUndoNextChangeGroup; - (void)automaticallyUndoNextChangeGroup; @end
{ "pile_set_name": "Github" }
{ "LANGS_CHOOSE": "Kies een taal", "GLOSSARY": "Begrippenlijst", "GLOSSARY_INDEX": "Index", "GLOSSARY_OPEN": "Begrippenlijst", "GITBOOK_LINK": "Gepubliceerd met GitBook", "SUMMARY": "Inhoudsopgave", "SUMMARY_INTRODUCTION": "Inleiding", "SUMMARY_TOGGLE": "Inhoudsopgave", "SEARCH_TOGGLE": "Zoeken", "SEARCH_PLACEHOLDER": "Zoeken", "FONTSETTINGS_TOGGLE": "Lettertype instellingen", "SHARE_TOGGLE": "Delen", "SHARE_ON": "Delen op {{platform}}", "FONTSETTINGS_WHITE": "Wit", "FONTSETTINGS_SEPIA": "Sepia", "FONTSETTINGS_NIGHT": "Zwart", "FONTSETTINGS_SANS": "Schreefloos", "FONTSETTINGS_SERIF": "Schreef" }
{ "pile_set_name": "Github" }
/* ---------------------------------------------------------------------- * Copyright (C) 2010 ARM Limited. All rights reserved. * * $Date: 15. July 2011 * $Revision: V1.0.10 * * Project: CMSIS DSP Library * Title: arm_sin_q31.c * * Description: Fast sine calculation for Q31 values. * * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 * * Version 1.0.10 2011/7/15 * Big Endian support added and Merged M0 and M3/M4 Source code. * * Version 1.0.3 2010/11/29 * Re-organized the CMSIS folders and updated documentation. * * Version 1.0.2 2010/11/11 * Documentation updated. * * Version 1.0.1 2010/10/05 * Production release and review comments incorporated. * * Version 1.0.0 2010/09/20 * Production release and review comments incorporated. * -------------------------------------------------------------------- */ #include "arm_math.h" /** * @ingroup groupFastMath */ /** * @addtogroup sin * @{ */ /** * \par * Tables generated are in Q31(1.31 Fixed point format) * Generation of sin values in floating point: * <pre>tableSize = 256; * for(n = -1; n < (tableSize + 1); n++) * { * sinTable[n+1]= sin(2*pi*n/tableSize); * } </pre> * where pi value is 3.14159265358979 * \par * Convert Floating point to Q31(Fixed point): * (sinTable[i] * pow(2, 31)) * \par * rounding to nearest integer is done * sinTable[i] += (sinTable[i] > 0 ? 0.5 :-0.5); */ static const q31_t sinTableQ31[259] = { 0xfcdbd541, 0x0, 0x3242abf, 0x647d97c, 0x96a9049, 0xc8bd35e, 0xfab272b, 0x12c8106f, 0x15e21445, 0x18f8b83c, 0x1c0b826a, 0x1f19f97b, 0x2223a4c5, 0x25280c5e, 0x2826b928, 0x2b1f34eb, 0x2e110a62, 0x30fbc54d, 0x33def287, 0x36ba2014, 0x398cdd32, 0x3c56ba70, 0x3f1749b8, 0x41ce1e65, 0x447acd50, 0x471cece7, 0x49b41533, 0x4c3fdff4, 0x4ebfe8a5, 0x5133cc94, 0x539b2af0, 0x55f5a4d2, 0x5842dd54, 0x5a82799a, 0x5cb420e0, 0x5ed77c8a, 0x60ec3830, 0x62f201ac, 0x64e88926, 0x66cf8120, 0x68a69e81, 0x6a6d98a4, 0x6c242960, 0x6dca0d14, 0x6f5f02b2, 0x70e2cbc6, 0x72552c85, 0x73b5ebd1, 0x7504d345, 0x7641af3d, 0x776c4edb, 0x78848414, 0x798a23b1, 0x7a7d055b, 0x7b5d039e, 0x7c29fbee, 0x7ce3ceb2, 0x7d8a5f40, 0x7e1d93ea, 0x7e9d55fc, 0x7f0991c4, 0x7f62368f, 0x7fa736b4, 0x7fd8878e, 0x7ff62182, 0x7fffffff, 0x7ff62182, 0x7fd8878e, 0x7fa736b4, 0x7f62368f, 0x7f0991c4, 0x7e9d55fc, 0x7e1d93ea, 0x7d8a5f40, 0x7ce3ceb2, 0x7c29fbee, 0x7b5d039e, 0x7a7d055b, 0x798a23b1, 0x78848414, 0x776c4edb, 0x7641af3d, 0x7504d345, 0x73b5ebd1, 0x72552c85, 0x70e2cbc6, 0x6f5f02b2, 0x6dca0d14, 0x6c242960, 0x6a6d98a4, 0x68a69e81, 0x66cf8120, 0x64e88926, 0x62f201ac, 0x60ec3830, 0x5ed77c8a, 0x5cb420e0, 0x5a82799a, 0x5842dd54, 0x55f5a4d2, 0x539b2af0, 0x5133cc94, 0x4ebfe8a5, 0x4c3fdff4, 0x49b41533, 0x471cece7, 0x447acd50, 0x41ce1e65, 0x3f1749b8, 0x3c56ba70, 0x398cdd32, 0x36ba2014, 0x33def287, 0x30fbc54d, 0x2e110a62, 0x2b1f34eb, 0x2826b928, 0x25280c5e, 0x2223a4c5, 0x1f19f97b, 0x1c0b826a, 0x18f8b83c, 0x15e21445, 0x12c8106f, 0xfab272b, 0xc8bd35e, 0x96a9049, 0x647d97c, 0x3242abf, 0x0, 0xfcdbd541, 0xf9b82684, 0xf6956fb7, 0xf3742ca2, 0xf054d8d5, 0xed37ef91, 0xea1debbb, 0xe70747c4, 0xe3f47d96, 0xe0e60685, 0xdddc5b3b, 0xdad7f3a2, 0xd7d946d8, 0xd4e0cb15, 0xd1eef59e, 0xcf043ab3, 0xcc210d79, 0xc945dfec, 0xc67322ce, 0xc3a94590, 0xc0e8b648, 0xbe31e19b, 0xbb8532b0, 0xb8e31319, 0xb64beacd, 0xb3c0200c, 0xb140175b, 0xaecc336c, 0xac64d510, 0xaa0a5b2e, 0xa7bd22ac, 0xa57d8666, 0xa34bdf20, 0xa1288376, 0x9f13c7d0, 0x9d0dfe54, 0x9b1776da, 0x99307ee0, 0x9759617f, 0x9592675c, 0x93dbd6a0, 0x9235f2ec, 0x90a0fd4e, 0x8f1d343a, 0x8daad37b, 0x8c4a142f, 0x8afb2cbb, 0x89be50c3, 0x8893b125, 0x877b7bec, 0x8675dc4f, 0x8582faa5, 0x84a2fc62, 0x83d60412, 0x831c314e, 0x8275a0c0, 0x81e26c16, 0x8162aa04, 0x80f66e3c, 0x809dc971, 0x8058c94c, 0x80277872, 0x8009de7e, 0x80000000, 0x8009de7e, 0x80277872, 0x8058c94c, 0x809dc971, 0x80f66e3c, 0x8162aa04, 0x81e26c16, 0x8275a0c0, 0x831c314e, 0x83d60412, 0x84a2fc62, 0x8582faa5, 0x8675dc4f, 0x877b7bec, 0x8893b125, 0x89be50c3, 0x8afb2cbb, 0x8c4a142f, 0x8daad37b, 0x8f1d343a, 0x90a0fd4e, 0x9235f2ec, 0x93dbd6a0, 0x9592675c, 0x9759617f, 0x99307ee0, 0x9b1776da, 0x9d0dfe54, 0x9f13c7d0, 0xa1288376, 0xa34bdf20, 0xa57d8666, 0xa7bd22ac, 0xaa0a5b2e, 0xac64d510, 0xaecc336c, 0xb140175b, 0xb3c0200c, 0xb64beacd, 0xb8e31319, 0xbb8532b0, 0xbe31e19b, 0xc0e8b648, 0xc3a94590, 0xc67322ce, 0xc945dfec, 0xcc210d79, 0xcf043ab3, 0xd1eef59e, 0xd4e0cb15, 0xd7d946d8, 0xdad7f3a2, 0xdddc5b3b, 0xe0e60685, 0xe3f47d96, 0xe70747c4, 0xea1debbb, 0xed37ef91, 0xf054d8d5, 0xf3742ca2, 0xf6956fb7, 0xf9b82684, 0xfcdbd541, 0x0, 0x3242abf }; /** * @brief Fast approximation to the trigonometric sine function for Q31 data. * @param[in] x Scaled input value in radians. * @return sin(x). * * The Q31 input value is in the range [0 +1) and is mapped to a radian value in the range [0 2*pi). */ q31_t arm_sin_q31( q31_t x) { q31_t sinVal, in, in2; /* Temporary variables for input, output */ uint32_t index; /* Index variables */ q31_t wa, wb, wc, wd; /* Cubic interpolation coefficients */ q31_t a, b, c, d; /* Four nearest output values */ q31_t *tablePtr; /* Pointer to table */ q31_t fract, fractCube, fractSquare; /* Temporary values for fractional values */ q31_t oneBy6 = 0x15555555; /* Fixed point value of 1/6 */ q31_t tableSpacing = TABLE_SPACING_Q31; /* Table spacing */ q31_t temp; /* Temporary variable for intermediate process */ in = x; /* Calculate the nearest index */ index = (uint32_t) in / (uint32_t) tableSpacing; /* Calculate the nearest value of input */ in2 = (q31_t) index *tableSpacing; /* Calculation of fractional value */ fract = (in - in2) << 8; /* fractSquare = fract * fract */ fractSquare = ((q31_t) (((q63_t) fract * fract) >> 32)); fractSquare = fractSquare << 1; /* fractCube = fract * fract * fract */ fractCube = ((q31_t) (((q63_t) fractSquare * fract) >> 32)); fractCube = fractCube << 1; /* Initialise table pointer */ tablePtr = (q31_t *) & sinTableQ31[index]; /* Cubic interpolation process */ /* Calculation of wa */ /* wa = -(oneBy6)*fractCube + (fractSquare >> 1u) - (0x2AAAAAAA)*fract; */ wa = ((q31_t) (((q63_t) oneBy6 * fractCube) >> 32)); temp = 0x2AAAAAAA; wa = (q31_t) ((((q63_t) wa << 32) + ((q63_t) temp * fract)) >> 32); wa = -(wa << 1u); wa += (fractSquare >> 1u); /* Read first nearest value of output from the sin table */ a = *tablePtr++; /* sinVal = a*wa */ sinVal = ((q31_t) (((q63_t) a * wa) >> 32)); /* q31(1.31) Fixed point value of 1 */ temp = 0x7FFFFFFF; /* Calculation of wb */ wb = ((fractCube >> 1u) - (fractSquare + (fract >> 1u))) + temp; /* Read second nearest value of output from the sin table */ b = *tablePtr++; /* sinVal += b*wb */ sinVal = (q31_t) ((((q63_t) sinVal << 32) + (q63_t) b * (wb)) >> 32); /* Calculation of wc */ wc = -fractCube + fractSquare; wc = (wc >> 1u) + fract; /* Read third nearest value of output from the sin table */ c = *tablePtr++; /* sinVal += c*wc */ sinVal = (q31_t) ((((q63_t) sinVal << 32) + ((q63_t) c * wc)) >> 32); /* Calculation of wd */ /* wd = (oneBy6) * fractCube - (oneBy6) * fract; */ fractCube = fractCube - fract; wd = ((q31_t) (((q63_t) oneBy6 * fractCube) >> 32)); wd = (wd << 1u); /* Read fourth nearest value of output from the sin table */ d = *tablePtr++; /* sinVal += d*wd; */ sinVal = (q31_t) ((((q63_t) sinVal << 32) + ((q63_t) d * wd)) >> 32); /* convert sinVal in 2.30 format to 1.31 format */ return (sinVal << 1u); } /** * @} end of sin group */
{ "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.dubbo.samples.governance.api; public interface DemoService { String sayHello(String name, long millis); }
{ "pile_set_name": "Github" }
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, install, // copy or use the software. // // // License Agreement // For Open Source Computer Vision Library // // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights reserved. // Copyright (C) 2013, OpenCV Foundation, all rights reserved. // Third party copyrights are property of their respective owners. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistribution's of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // * Redistribution's 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. // // * The name of the copyright holders may not be used to endorse or promote products // derived from this software without specific prior written permission. // // This software is provided by the copyright holders and contributors "as is" and // any express or implied warranties, including, but not limited to, the implied // warranties of merchantability and fitness for a particular purpose are disclaimed. // In no event shall the Intel Corporation or contributors be liable for any direct, // indirect, incidental, special, exemplary, or consequential damages // (including, but not limited to, procurement of substitute goods or services; // loss of use, data, or profits; or business interruption) however caused // and on any theory of liability, whether in contract, strict liability, // or tort (including negligence or otherwise) arising in any way out of // the use of this software, even if advised of the possibility of such damage. // //M*/ #ifndef __OPENCV_CORE_PERSISTENCE_HPP__ #define __OPENCV_CORE_PERSISTENCE_HPP__ #ifndef __cplusplus # error persistence.hpp header must be compiled as C++ #endif //! @addtogroup core_c //! @{ /** @brief "black box" representation of the file storage associated with a file on disk. Several functions that are described below take CvFileStorage\* as inputs and allow the user to save or to load hierarchical collections that consist of scalar values, standard CXCore objects (such as matrices, sequences, graphs), and user-defined objects. OpenCV can read and write data in XML (<http://www.w3c.org/XML>) or YAML (<http://www.yaml.org>) formats. Below is an example of 3x3 floating-point identity matrix A, stored in XML and YAML files using CXCore functions: XML: @code{.xml} <?xml version="1.0"> <opencv_storage> <A type_id="opencv-matrix"> <rows>3</rows> <cols>3</cols> <dt>f</dt> <data>1. 0. 0. 0. 1. 0. 0. 0. 1.</data> </A> </opencv_storage> @endcode YAML: @code{.yaml} %YAML:1.0 A: !!opencv-matrix rows: 3 cols: 3 dt: f data: [ 1., 0., 0., 0., 1., 0., 0., 0., 1.] @endcode As it can be seen from the examples, XML uses nested tags to represent hierarchy, while YAML uses indentation for that purpose (similar to the Python programming language). The same functions can read and write data in both formats; the particular format is determined by the extension of the opened file, ".xml" for XML files and ".yml" or ".yaml" for YAML. */ typedef struct CvFileStorage CvFileStorage; typedef struct CvFileNode CvFileNode; //! @} core_c #include "opencv2/core/types.hpp" #include "opencv2/core/mat.hpp" namespace cv { /** @addtogroup core_xml XML/YAML file storages. {#xml_storage} ======================= Writing to a file storage. -------------------------- You can store and then restore various OpenCV data structures to/from XML (<http://www.w3c.org/XML>) or YAML (<http://www.yaml.org>) formats. Also, it is possible store and load arbitrarily complex data structures, which include OpenCV data structures, as well as primitive data types (integer and floating-point numbers and text strings) as their elements. Use the following procedure to write something to XML or YAML: -# Create new FileStorage and open it for writing. It can be done with a single call to FileStorage::FileStorage constructor that takes a filename, or you can use the default constructor and then call FileStorage::open. Format of the file (XML or YAML) is determined from the filename extension (".xml" and ".yml"/".yaml", respectively) -# Write all the data you want using the streaming operator `<<`, just like in the case of STL streams. -# Close the file using FileStorage::release. FileStorage destructor also closes the file. Here is an example: @code #include "opencv2/opencv.hpp" #include <time.h> using namespace cv; int main(int, char** argv) { FileStorage fs("test.yml", FileStorage::WRITE); fs << "frameCount" << 5; time_t rawtime; time(&rawtime); fs << "calibrationDate" << asctime(localtime(&rawtime)); Mat cameraMatrix = (Mat_<double>(3,3) << 1000, 0, 320, 0, 1000, 240, 0, 0, 1); Mat distCoeffs = (Mat_<double>(5,1) << 0.1, 0.01, -0.001, 0, 0); fs << "cameraMatrix" << cameraMatrix << "distCoeffs" << distCoeffs; fs << "features" << "["; for( int i = 0; i < 3; i++ ) { int x = rand() % 640; int y = rand() % 480; uchar lbp = rand() % 256; fs << "{:" << "x" << x << "y" << y << "lbp" << "[:"; for( int j = 0; j < 8; j++ ) fs << ((lbp >> j) & 1); fs << "]" << "}"; } fs << "]"; fs.release(); return 0; } @endcode The sample above stores to XML and integer, text string (calibration date), 2 matrices, and a custom structure "feature", which includes feature coordinates and LBP (local binary pattern) value. Here is output of the sample: @code{.yaml} %YAML:1.0 frameCount: 5 calibrationDate: "Fri Jun 17 14:09:29 2011\n" cameraMatrix: !!opencv-matrix rows: 3 cols: 3 dt: d data: [ 1000., 0., 320., 0., 1000., 240., 0., 0., 1. ] distCoeffs: !!opencv-matrix rows: 5 cols: 1 dt: d data: [ 1.0000000000000001e-01, 1.0000000000000000e-02, -1.0000000000000000e-03, 0., 0. ] features: - { x:167, y:49, lbp:[ 1, 0, 0, 1, 1, 0, 1, 1 ] } - { x:298, y:130, lbp:[ 0, 0, 0, 1, 0, 0, 1, 1 ] } - { x:344, y:158, lbp:[ 1, 1, 0, 0, 0, 0, 1, 0 ] } @endcode As an exercise, you can replace ".yml" with ".xml" in the sample above and see, how the corresponding XML file will look like. Several things can be noted by looking at the sample code and the output: - The produced YAML (and XML) consists of heterogeneous collections that can be nested. There are 2 types of collections: named collections (mappings) and unnamed collections (sequences). In mappings each element has a name and is accessed by name. This is similar to structures and std::map in C/C++ and dictionaries in Python. In sequences elements do not have names, they are accessed by indices. This is similar to arrays and std::vector in C/C++ and lists, tuples in Python. "Heterogeneous" means that elements of each single collection can have different types. Top-level collection in YAML/XML is a mapping. Each matrix is stored as a mapping, and the matrix elements are stored as a sequence. Then, there is a sequence of features, where each feature is represented a mapping, and lbp value in a nested sequence. - When you write to a mapping (a structure), you write element name followed by its value. When you write to a sequence, you simply write the elements one by one. OpenCV data structures (such as cv::Mat) are written in absolutely the same way as simple C data structures - using `<<` operator. - To write a mapping, you first write the special string `{` to the storage, then write the elements as pairs (`fs << <element_name> << <element_value>`) and then write the closing `}`. - To write a sequence, you first write the special string `[`, then write the elements, then write the closing `]`. - In YAML (but not XML), mappings and sequences can be written in a compact Python-like inline form. In the sample above matrix elements, as well as each feature, including its lbp value, is stored in such inline form. To store a mapping/sequence in a compact form, put `:` after the opening character, e.g. use `{:` instead of `{` and `[:` instead of `[`. When the data is written to XML, those extra `:` are ignored. Reading data from a file storage. --------------------------------- To read the previously written XML or YAML file, do the following: -# Open the file storage using FileStorage::FileStorage constructor or FileStorage::open method. In the current implementation the whole file is parsed and the whole representation of file storage is built in memory as a hierarchy of file nodes (see FileNode) -# Read the data you are interested in. Use FileStorage::operator [], FileNode::operator [] and/or FileNodeIterator. -# Close the storage using FileStorage::release. Here is how to read the file created by the code sample above: @code FileStorage fs2("test.yml", FileStorage::READ); // first method: use (type) operator on FileNode. int frameCount = (int)fs2["frameCount"]; String date; // second method: use FileNode::operator >> fs2["calibrationDate"] >> date; Mat cameraMatrix2, distCoeffs2; fs2["cameraMatrix"] >> cameraMatrix2; fs2["distCoeffs"] >> distCoeffs2; cout << "frameCount: " << frameCount << endl << "calibration date: " << date << endl << "camera matrix: " << cameraMatrix2 << endl << "distortion coeffs: " << distCoeffs2 << endl; FileNode features = fs2["features"]; FileNodeIterator it = features.begin(), it_end = features.end(); int idx = 0; std::vector<uchar> lbpval; // iterate through a sequence using FileNodeIterator for( ; it != it_end; ++it, idx++ ) { cout << "feature #" << idx << ": "; cout << "x=" << (int)(*it)["x"] << ", y=" << (int)(*it)["y"] << ", lbp: ("; // you can also easily read numerical arrays using FileNode >> std::vector operator. (*it)["lbp"] >> lbpval; for( int i = 0; i < (int)lbpval.size(); i++ ) cout << " " << (int)lbpval[i]; cout << ")" << endl; } fs2.release(); @endcode Format specification {#format_spec} -------------------- `([count]{u|c|w|s|i|f|d})`... where the characters correspond to fundamental C++ types: - `u` 8-bit unsigned number - `c` 8-bit signed number - `w` 16-bit unsigned number - `s` 16-bit signed number - `i` 32-bit signed number - `f` single precision floating-point number - `d` double precision floating-point number - `r` pointer, 32 lower bits of which are written as a signed integer. The type can be used to store structures with links between the elements. `count` is the optional counter of values of a given type. For example, `2if` means that each array element is a structure of 2 integers, followed by a single-precision floating-point number. The equivalent notations of the above specification are `iif`, `2i1f` and so forth. Other examples: `u` means that the array consists of bytes, and `2d` means the array consists of pairs of doubles. @see @ref filestorage.cpp */ //! @{ /** @example filestorage.cpp A complete example using the FileStorage interface */ ////////////////////////// XML & YAML I/O ////////////////////////// class CV_EXPORTS FileNode; class CV_EXPORTS FileNodeIterator; /** @brief XML/YAML file storage class that encapsulates all the information necessary for writing or reading data to/from a file. */ class CV_EXPORTS_W FileStorage { public: //! file storage mode enum Mode { READ = 0, //!< value, open the file for reading WRITE = 1, //!< value, open the file for writing APPEND = 2, //!< value, open the file for appending MEMORY = 4, //!< flag, read data from source or write data to the internal buffer (which is //!< returned by FileStorage::release) FORMAT_MASK = (7<<3), //!< mask for format flags FORMAT_AUTO = 0, //!< flag, auto format FORMAT_XML = (1<<3), //!< flag, XML format FORMAT_YAML = (2<<3) //!< flag, YAML format }; enum { UNDEFINED = 0, VALUE_EXPECTED = 1, NAME_EXPECTED = 2, INSIDE_MAP = 4 }; /** @brief The constructors. The full constructor opens the file. Alternatively you can use the default constructor and then call FileStorage::open. */ CV_WRAP FileStorage(); /** @overload @param source Name of the file to open or the text string to read the data from. Extension of the file (.xml or .yml/.yaml) determines its format (XML or YAML respectively). Also you can append .gz to work with compressed files, for example myHugeMatrix.xml.gz. If both FileStorage::WRITE and FileStorage::MEMORY flags are specified, source is used just to specify the output file format (e.g. mydata.xml, .yml etc.). @param flags Mode of operation. See FileStorage::Mode @param encoding Encoding of the file. Note that UTF-16 XML encoding is not supported currently and you should use 8-bit encoding instead of it. */ CV_WRAP FileStorage(const String& source, int flags, const String& encoding=String()); /** @overload */ FileStorage(CvFileStorage* fs, bool owning=true); //! the destructor. calls release() virtual ~FileStorage(); /** @brief Opens a file. See description of parameters in FileStorage::FileStorage. The method calls FileStorage::release before opening the file. @param filename Name of the file to open or the text string to read the data from. Extension of the file (.xml or .yml/.yaml) determines its format (XML or YAML respectively). Also you can append .gz to work with compressed files, for example myHugeMatrix.xml.gz. If both FileStorage::WRITE and FileStorage::MEMORY flags are specified, source is used just to specify the output file format (e.g. mydata.xml, .yml etc.). @param flags Mode of operation. One of FileStorage::Mode @param encoding Encoding of the file. Note that UTF-16 XML encoding is not supported currently and you should use 8-bit encoding instead of it. */ CV_WRAP virtual bool open(const String& filename, int flags, const String& encoding=String()); /** @brief Checks whether the file is opened. @returns true if the object is associated with the current file and false otherwise. It is a good practice to call this method after you tried to open a file. */ CV_WRAP virtual bool isOpened() const; /** @brief Closes the file and releases all the memory buffers. Call this method after all I/O operations with the storage are finished. */ CV_WRAP virtual void release(); /** @brief Closes the file and releases all the memory buffers. Call this method after all I/O operations with the storage are finished. If the storage was opened for writing data and FileStorage::WRITE was specified */ CV_WRAP virtual String releaseAndGetString(); /** @brief Returns the first element of the top-level mapping. @returns The first element of the top-level mapping. */ CV_WRAP FileNode getFirstTopLevelNode() const; /** @brief Returns the top-level mapping @param streamidx Zero-based index of the stream. In most cases there is only one stream in the file. However, YAML supports multiple streams and so there can be several. @returns The top-level mapping. */ CV_WRAP FileNode root(int streamidx=0) const; /** @brief Returns the specified element of the top-level mapping. @param nodename Name of the file node. @returns Node with the given name. */ FileNode operator[](const String& nodename) const; /** @overload */ CV_WRAP FileNode operator[](const char* nodename) const; /** @brief Returns the obsolete C FileStorage structure. @returns Pointer to the underlying C FileStorage structure */ CvFileStorage* operator *() { return fs.get(); } /** @overload */ const CvFileStorage* operator *() const { return fs.get(); } /** @brief Writes multiple numbers. Writes one or more numbers of the specified format to the currently written structure. Usually it is more convenient to use operator `<<` instead of this method. @param fmt Specification of each array element, see @ref format_spec "format specification" @param vec Pointer to the written array. @param len Number of the uchar elements to write. */ void writeRaw( const String& fmt, const uchar* vec, size_t len ); /** @brief Writes the registered C structure (CvMat, CvMatND, CvSeq). @param name Name of the written object. @param obj Pointer to the object. @see ocvWrite for details. */ void writeObj( const String& name, const void* obj ); /** @brief Returns the normalized object name for the specified name of a file. @param filename Name of a file @returns The normalized object name. */ static String getDefaultObjectName(const String& filename); Ptr<CvFileStorage> fs; //!< the underlying C FileStorage structure String elname; //!< the currently written element std::vector<char> structs; //!< the stack of written structures int state; //!< the writer state }; template<> CV_EXPORTS void DefaultDeleter<CvFileStorage>::operator ()(CvFileStorage* obj) const; /** @brief File Storage Node class. The node is used to store each and every element of the file storage opened for reading. When XML/YAML file is read, it is first parsed and stored in the memory as a hierarchical collection of nodes. Each node can be a “leaf” that is contain a single number or a string, or be a collection of other nodes. There can be named collections (mappings) where each element has a name and it is accessed by a name, and ordered collections (sequences) where elements do not have names but rather accessed by index. Type of the file node can be determined using FileNode::type method. Note that file nodes are only used for navigating file storages opened for reading. When a file storage is opened for writing, no data is stored in memory after it is written. */ class CV_EXPORTS_W_SIMPLE FileNode { public: //! type of the file storage node enum Type { NONE = 0, //!< empty node INT = 1, //!< an integer REAL = 2, //!< floating-point number FLOAT = REAL, //!< synonym or REAL STR = 3, //!< text string in UTF-8 encoding STRING = STR, //!< synonym for STR REF = 4, //!< integer of size size_t. Typically used for storing complex dynamic structures where some elements reference the others SEQ = 5, //!< sequence MAP = 6, //!< mapping TYPE_MASK = 7, FLOW = 8, //!< compact representation of a sequence or mapping. Used only by YAML writer USER = 16, //!< a registered object (e.g. a matrix) EMPTY = 32, //!< empty structure (sequence or mapping) NAMED = 64 //!< the node has a name (i.e. it is element of a mapping) }; /** @brief The constructors. These constructors are used to create a default file node, construct it from obsolete structures or from the another file node. */ CV_WRAP FileNode(); /** @overload @param fs Pointer to the obsolete file storage structure. @param node File node to be used as initialization for the created file node. */ FileNode(const CvFileStorage* fs, const CvFileNode* node); /** @overload @param node File node to be used as initialization for the created file node. */ FileNode(const FileNode& node); /** @brief Returns element of a mapping node or a sequence node. @param nodename Name of an element in the mapping node. @returns Returns the element with the given identifier. */ FileNode operator[](const String& nodename) const; /** @overload @param nodename Name of an element in the mapping node. */ CV_WRAP FileNode operator[](const char* nodename) const; /** @overload @param i Index of an element in the sequence node. */ CV_WRAP FileNode operator[](int i) const; /** @brief Returns type of the node. @returns Type of the node. See FileNode::Type */ CV_WRAP int type() const; //! returns true if the node is empty CV_WRAP bool empty() const; //! returns true if the node is a "none" object CV_WRAP bool isNone() const; //! returns true if the node is a sequence CV_WRAP bool isSeq() const; //! returns true if the node is a mapping CV_WRAP bool isMap() const; //! returns true if the node is an integer CV_WRAP bool isInt() const; //! returns true if the node is a floating-point number CV_WRAP bool isReal() const; //! returns true if the node is a text string CV_WRAP bool isString() const; //! returns true if the node has a name CV_WRAP bool isNamed() const; //! returns the node name or an empty string if the node is nameless CV_WRAP String name() const; //! returns the number of elements in the node, if it is a sequence or mapping, or 1 otherwise. CV_WRAP size_t size() const; //! returns the node content as an integer. If the node stores floating-point number, it is rounded. operator int() const; //! returns the node content as float operator float() const; //! returns the node content as double operator double() const; //! returns the node content as text string operator String() const; #ifndef OPENCV_NOSTL operator std::string() const; #endif //! returns pointer to the underlying file node CvFileNode* operator *(); //! returns pointer to the underlying file node const CvFileNode* operator* () const; //! returns iterator pointing to the first node element FileNodeIterator begin() const; //! returns iterator pointing to the element following the last node element FileNodeIterator end() const; /** @brief Reads node elements to the buffer with the specified format. Usually it is more convenient to use operator `>>` instead of this method. @param fmt Specification of each array element. See @ref format_spec "format specification" @param vec Pointer to the destination array. @param len Number of elements to read. If it is greater than number of remaining elements then all of them will be read. */ void readRaw( const String& fmt, uchar* vec, size_t len ) const; //! reads the registered object and returns pointer to it void* readObj() const; // do not use wrapper pointer classes for better efficiency const CvFileStorage* fs; const CvFileNode* node; }; /** @brief used to iterate through sequences and mappings. A standard STL notation, with node.begin(), node.end() denoting the beginning and the end of a sequence, stored in node. See the data reading sample in the beginning of the section. */ class CV_EXPORTS FileNodeIterator { public: /** @brief The constructors. These constructors are used to create a default iterator, set it to specific element in a file node or construct it from another iterator. */ FileNodeIterator(); /** @overload @param fs File storage for the iterator. @param node File node for the iterator. @param ofs Index of the element in the node. The created iterator will point to this element. */ FileNodeIterator(const CvFileStorage* fs, const CvFileNode* node, size_t ofs=0); /** @overload @param it Iterator to be used as initialization for the created iterator. */ FileNodeIterator(const FileNodeIterator& it); //! returns the currently observed element FileNode operator *() const; //! accesses the currently observed element methods FileNode operator ->() const; //! moves iterator to the next node FileNodeIterator& operator ++ (); //! moves iterator to the next node FileNodeIterator operator ++ (int); //! moves iterator to the previous node FileNodeIterator& operator -- (); //! moves iterator to the previous node FileNodeIterator operator -- (int); //! moves iterator forward by the specified offset (possibly negative) FileNodeIterator& operator += (int ofs); //! moves iterator backward by the specified offset (possibly negative) FileNodeIterator& operator -= (int ofs); /** @brief Reads node elements to the buffer with the specified format. Usually it is more convenient to use operator `>>` instead of this method. @param fmt Specification of each array element. See @ref format_spec "format specification" @param vec Pointer to the destination array. @param maxCount Number of elements to read. If it is greater than number of remaining elements then all of them will be read. */ FileNodeIterator& readRaw( const String& fmt, uchar* vec, size_t maxCount=(size_t)INT_MAX ); struct SeqReader { int header_size; void* seq; /* sequence, beign read; CvSeq */ void* block; /* current block; CvSeqBlock */ schar* ptr; /* pointer to element be read next */ schar* block_min; /* pointer to the beginning of block */ schar* block_max; /* pointer to the end of block */ int delta_index;/* = seq->first->start_index */ schar* prev_elem; /* pointer to previous element */ }; const CvFileStorage* fs; const CvFileNode* container; SeqReader reader; size_t remaining; }; //! @} core_xml /////////////////// XML & YAML I/O implementation ////////////////// //! @relates cv::FileStorage //! @{ CV_EXPORTS void write( FileStorage& fs, const String& name, int value ); CV_EXPORTS void write( FileStorage& fs, const String& name, float value ); CV_EXPORTS void write( FileStorage& fs, const String& name, double value ); CV_EXPORTS void write( FileStorage& fs, const String& name, const String& value ); CV_EXPORTS void write( FileStorage& fs, const String& name, const Mat& value ); CV_EXPORTS void write( FileStorage& fs, const String& name, const SparseMat& value ); CV_EXPORTS void write( FileStorage& fs, const String& name, const std::vector<KeyPoint>& value); CV_EXPORTS void write( FileStorage& fs, const String& name, const std::vector<DMatch>& value); CV_EXPORTS void writeScalar( FileStorage& fs, int value ); CV_EXPORTS void writeScalar( FileStorage& fs, float value ); CV_EXPORTS void writeScalar( FileStorage& fs, double value ); CV_EXPORTS void writeScalar( FileStorage& fs, const String& value ); //! @} //! @relates cv::FileNode //! @{ CV_EXPORTS void read(const FileNode& node, int& value, int default_value); CV_EXPORTS void read(const FileNode& node, float& value, float default_value); CV_EXPORTS void read(const FileNode& node, double& value, double default_value); CV_EXPORTS void read(const FileNode& node, String& value, const String& default_value); CV_EXPORTS void read(const FileNode& node, Mat& mat, const Mat& default_mat = Mat() ); CV_EXPORTS void read(const FileNode& node, SparseMat& mat, const SparseMat& default_mat = SparseMat() ); CV_EXPORTS void read(const FileNode& node, std::vector<KeyPoint>& keypoints); CV_EXPORTS void read(const FileNode& node, std::vector<DMatch>& matches); template<typename _Tp> static inline void read(const FileNode& node, Point_<_Tp>& value, const Point_<_Tp>& default_value) { std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp; value = temp.size() != 2 ? default_value : Point_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1])); } template<typename _Tp> static inline void read(const FileNode& node, Point3_<_Tp>& value, const Point3_<_Tp>& default_value) { std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp; value = temp.size() != 3 ? default_value : Point3_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1]), saturate_cast<_Tp>(temp[2])); } template<typename _Tp> static inline void read(const FileNode& node, Size_<_Tp>& value, const Size_<_Tp>& default_value) { std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp; value = temp.size() != 2 ? default_value : Size_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1])); } template<typename _Tp> static inline void read(const FileNode& node, Complex<_Tp>& value, const Complex<_Tp>& default_value) { std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp; value = temp.size() != 2 ? default_value : Complex<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1])); } template<typename _Tp> static inline void read(const FileNode& node, Rect_<_Tp>& value, const Rect_<_Tp>& default_value) { std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp; value = temp.size() != 4 ? default_value : Rect_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1]), saturate_cast<_Tp>(temp[2]), saturate_cast<_Tp>(temp[3])); } template<typename _Tp, int cn> static inline void read(const FileNode& node, Vec<_Tp, cn>& value, const Vec<_Tp, cn>& default_value) { std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp; value = temp.size() != cn ? default_value : Vec<_Tp, cn>(&temp[0]); } template<typename _Tp> static inline void read(const FileNode& node, Scalar_<_Tp>& value, const Scalar_<_Tp>& default_value) { std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp; value = temp.size() != 4 ? default_value : Scalar_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1]), saturate_cast<_Tp>(temp[2]), saturate_cast<_Tp>(temp[3])); } static inline void read(const FileNode& node, Range& value, const Range& default_value) { Point2i temp(value.start, value.end); const Point2i default_temp = Point2i(default_value.start, default_value.end); read(node, temp, default_temp); value.start = temp.x; value.end = temp.y; } //! @} /** @brief Writes string to a file storage. @relates cv::FileStorage */ CV_EXPORTS FileStorage& operator << (FileStorage& fs, const String& str); //! @cond IGNORED namespace internal { class CV_EXPORTS WriteStructContext { public: WriteStructContext(FileStorage& _fs, const String& name, int flags, const String& typeName = String()); ~WriteStructContext(); private: FileStorage* fs; }; template<typename _Tp, int numflag> class VecWriterProxy { public: VecWriterProxy( FileStorage* _fs ) : fs(_fs) {} void operator()(const std::vector<_Tp>& vec) const { size_t count = vec.size(); for (size_t i = 0; i < count; i++) write(*fs, vec[i]); } private: FileStorage* fs; }; template<typename _Tp> class VecWriterProxy<_Tp, 1> { public: VecWriterProxy( FileStorage* _fs ) : fs(_fs) {} void operator()(const std::vector<_Tp>& vec) const { int _fmt = DataType<_Tp>::fmt; char fmt[] = { (char)((_fmt >> 8) + '1'), (char)_fmt, '\0' }; fs->writeRaw(fmt, !vec.empty() ? (uchar*)&vec[0] : 0, vec.size() * sizeof(_Tp)); } private: FileStorage* fs; }; template<typename _Tp, int numflag> class VecReaderProxy { public: VecReaderProxy( FileNodeIterator* _it ) : it(_it) {} void operator()(std::vector<_Tp>& vec, size_t count) const { count = std::min(count, it->remaining); vec.resize(count); for (size_t i = 0; i < count; i++, ++(*it)) read(**it, vec[i], _Tp()); } private: FileNodeIterator* it; }; template<typename _Tp> class VecReaderProxy<_Tp, 1> { public: VecReaderProxy( FileNodeIterator* _it ) : it(_it) {} void operator()(std::vector<_Tp>& vec, size_t count) const { size_t remaining = it->remaining; size_t cn = DataType<_Tp>::channels; int _fmt = DataType<_Tp>::fmt; char fmt[] = { (char)((_fmt >> 8)+'1'), (char)_fmt, '\0' }; size_t remaining1 = remaining / cn; count = count < remaining1 ? count : remaining1; vec.resize(count); it->readRaw(fmt, !vec.empty() ? (uchar*)&vec[0] : 0, count*sizeof(_Tp)); } private: FileNodeIterator* it; }; } // internal //! @endcond //! @relates cv::FileStorage //! @{ template<typename _Tp> static inline void write(FileStorage& fs, const _Tp& value) { write(fs, String(), value); } template<> inline void write( FileStorage& fs, const int& value ) { writeScalar(fs, value); } template<> inline void write( FileStorage& fs, const float& value ) { writeScalar(fs, value); } template<> inline void write( FileStorage& fs, const double& value ) { writeScalar(fs, value); } template<> inline void write( FileStorage& fs, const String& value ) { writeScalar(fs, value); } template<typename _Tp> static inline void write(FileStorage& fs, const Point_<_Tp>& pt ) { write(fs, pt.x); write(fs, pt.y); } template<typename _Tp> static inline void write(FileStorage& fs, const Point3_<_Tp>& pt ) { write(fs, pt.x); write(fs, pt.y); write(fs, pt.z); } template<typename _Tp> static inline void write(FileStorage& fs, const Size_<_Tp>& sz ) { write(fs, sz.width); write(fs, sz.height); } template<typename _Tp> static inline void write(FileStorage& fs, const Complex<_Tp>& c ) { write(fs, c.re); write(fs, c.im); } template<typename _Tp> static inline void write(FileStorage& fs, const Rect_<_Tp>& r ) { write(fs, r.x); write(fs, r.y); write(fs, r.width); write(fs, r.height); } template<typename _Tp, int cn> static inline void write(FileStorage& fs, const Vec<_Tp, cn>& v ) { for(int i = 0; i < cn; i++) write(fs, v.val[i]); } template<typename _Tp> static inline void write(FileStorage& fs, const Scalar_<_Tp>& s ) { write(fs, s.val[0]); write(fs, s.val[1]); write(fs, s.val[2]); write(fs, s.val[3]); } static inline void write(FileStorage& fs, const Range& r ) { write(fs, r.start); write(fs, r.end); } template<typename _Tp> static inline void write( FileStorage& fs, const std::vector<_Tp>& vec ) { cv::internal::VecWriterProxy<_Tp, DataType<_Tp>::fmt != 0> w(&fs); w(vec); } template<typename _Tp> static inline void write(FileStorage& fs, const String& name, const Point_<_Tp>& pt ) { cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, pt); } template<typename _Tp> static inline void write(FileStorage& fs, const String& name, const Point3_<_Tp>& pt ) { cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, pt); } template<typename _Tp> static inline void write(FileStorage& fs, const String& name, const Size_<_Tp>& sz ) { cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, sz); } template<typename _Tp> static inline void write(FileStorage& fs, const String& name, const Complex<_Tp>& c ) { cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, c); } template<typename _Tp> static inline void write(FileStorage& fs, const String& name, const Rect_<_Tp>& r ) { cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, r); } template<typename _Tp, int cn> static inline void write(FileStorage& fs, const String& name, const Vec<_Tp, cn>& v ) { cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, v); } template<typename _Tp> static inline void write(FileStorage& fs, const String& name, const Scalar_<_Tp>& s ) { cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, s); } static inline void write(FileStorage& fs, const String& name, const Range& r ) { cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, r); } template<typename _Tp> static inline void write( FileStorage& fs, const String& name, const std::vector<_Tp>& vec ) { cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+(DataType<_Tp>::fmt != 0 ? FileNode::FLOW : 0)); write(fs, vec); } //! @} FileStorage //! @relates cv::FileNode //! @{ static inline void read(const FileNode& node, bool& value, bool default_value) { int temp; read(node, temp, (int)default_value); value = temp != 0; } static inline void read(const FileNode& node, uchar& value, uchar default_value) { int temp; read(node, temp, (int)default_value); value = saturate_cast<uchar>(temp); } static inline void read(const FileNode& node, schar& value, schar default_value) { int temp; read(node, temp, (int)default_value); value = saturate_cast<schar>(temp); } static inline void read(const FileNode& node, ushort& value, ushort default_value) { int temp; read(node, temp, (int)default_value); value = saturate_cast<ushort>(temp); } static inline void read(const FileNode& node, short& value, short default_value) { int temp; read(node, temp, (int)default_value); value = saturate_cast<short>(temp); } template<typename _Tp> static inline void read( FileNodeIterator& it, std::vector<_Tp>& vec, size_t maxCount = (size_t)INT_MAX ) { cv::internal::VecReaderProxy<_Tp, DataType<_Tp>::fmt != 0> r(&it); r(vec, maxCount); } template<typename _Tp> static inline void read( const FileNode& node, std::vector<_Tp>& vec, const std::vector<_Tp>& default_value = std::vector<_Tp>() ) { if(!node.node) vec = default_value; else { FileNodeIterator it = node.begin(); read( it, vec ); } } //! @} FileNode //! @relates cv::FileStorage //! @{ /** @brief Writes data to a file storage. */ template<typename _Tp> static inline FileStorage& operator << (FileStorage& fs, const _Tp& value) { if( !fs.isOpened() ) return fs; if( fs.state == FileStorage::NAME_EXPECTED + FileStorage::INSIDE_MAP ) CV_Error( Error::StsError, "No element name has been given" ); write( fs, fs.elname, value ); if( fs.state & FileStorage::INSIDE_MAP ) fs.state = FileStorage::NAME_EXPECTED + FileStorage::INSIDE_MAP; return fs; } /** @brief Writes data to a file storage. */ static inline FileStorage& operator << (FileStorage& fs, const char* str) { return (fs << String(str)); } /** @brief Writes data to a file storage. */ static inline FileStorage& operator << (FileStorage& fs, char* value) { return (fs << String(value)); } //! @} FileStorage //! @relates cv::FileNodeIterator //! @{ /** @brief Reads data from a file storage. */ template<typename _Tp> static inline FileNodeIterator& operator >> (FileNodeIterator& it, _Tp& value) { read( *it, value, _Tp()); return ++it; } /** @brief Reads data from a file storage. */ template<typename _Tp> static inline FileNodeIterator& operator >> (FileNodeIterator& it, std::vector<_Tp>& vec) { cv::internal::VecReaderProxy<_Tp, DataType<_Tp>::fmt != 0> r(&it); r(vec, (size_t)INT_MAX); return it; } //! @} FileNodeIterator //! @relates cv::FileNode //! @{ /** @brief Reads data from a file storage. */ template<typename _Tp> static inline void operator >> (const FileNode& n, _Tp& value) { read( n, value, _Tp()); } /** @brief Reads data from a file storage. */ template<typename _Tp> static inline void operator >> (const FileNode& n, std::vector<_Tp>& vec) { FileNodeIterator it = n.begin(); it >> vec; } //! @} FileNode //! @relates cv::FileNodeIterator //! @{ static inline bool operator == (const FileNodeIterator& it1, const FileNodeIterator& it2) { return it1.fs == it2.fs && it1.container == it2.container && it1.reader.ptr == it2.reader.ptr && it1.remaining == it2.remaining; } static inline bool operator != (const FileNodeIterator& it1, const FileNodeIterator& it2) { return !(it1 == it2); } static inline ptrdiff_t operator - (const FileNodeIterator& it1, const FileNodeIterator& it2) { return it2.remaining - it1.remaining; } static inline bool operator < (const FileNodeIterator& it1, const FileNodeIterator& it2) { return it1.remaining > it2.remaining; } //! @} FileNodeIterator //! @cond IGNORED inline FileNode FileStorage::getFirstTopLevelNode() const { FileNode r = root(); FileNodeIterator it = r.begin(); return it != r.end() ? *it : FileNode(); } inline FileNode::FileNode() : fs(0), node(0) {} inline FileNode::FileNode(const CvFileStorage* _fs, const CvFileNode* _node) : fs(_fs), node(_node) {} inline FileNode::FileNode(const FileNode& _node) : fs(_node.fs), node(_node.node) {} inline bool FileNode::empty() const { return node == 0; } inline bool FileNode::isNone() const { return type() == NONE; } inline bool FileNode::isSeq() const { return type() == SEQ; } inline bool FileNode::isMap() const { return type() == MAP; } inline bool FileNode::isInt() const { return type() == INT; } inline bool FileNode::isReal() const { return type() == REAL; } inline bool FileNode::isString() const { return type() == STR; } inline CvFileNode* FileNode::operator *() { return (CvFileNode*)node; } inline const CvFileNode* FileNode::operator* () const { return node; } inline FileNode::operator int() const { int value; read(*this, value, 0); return value; } inline FileNode::operator float() const { float value; read(*this, value, 0.f); return value; } inline FileNode::operator double() const { double value; read(*this, value, 0.); return value; } inline FileNode::operator String() const { String value; read(*this, value, value); return value; } inline FileNodeIterator FileNode::begin() const { return FileNodeIterator(fs, node); } inline FileNodeIterator FileNode::end() const { return FileNodeIterator(fs, node, size()); } inline void FileNode::readRaw( const String& fmt, uchar* vec, size_t len ) const { begin().readRaw( fmt, vec, len ); } inline FileNode FileNodeIterator::operator *() const { return FileNode(fs, (const CvFileNode*)(const void*)reader.ptr); } inline FileNode FileNodeIterator::operator ->() const { return FileNode(fs, (const CvFileNode*)(const void*)reader.ptr); } inline String::String(const FileNode& fn): cstr_(0), len_(0) { read(fn, *this, *this); } //! @endcond } // cv #endif // __OPENCV_CORE_PERSISTENCE_HPP__
{ "pile_set_name": "Github" }
{ "title": "Пиры", "peerId": "ID пира", "peers": "Пиры", "address": "Адрес", "location": "Местоположение", "unknownLocation": "Неизвестно", "addConnection": "Добавить соединение", "insertPeerAddress": "Добавить адрес пира, к которому вы хотите присоединиться.", "add": "Добавить", "example": "Пример:" }
{ "pile_set_name": "Github" }
var convert = require('./convert'), func = convert('stubTrue', require('../stubTrue'), require('./_falseOptions')); func.placeholder = require('./placeholder'); module.exports = func;
{ "pile_set_name": "Github" }
'use strict'; import gulp from 'gulp'; import runSequence from 'run-sequence'; gulp.task('dev', ['clean'], function(cb) { cb = cb || function() {}; global.isProd = false; return runSequence(['sass', 'imagemin', 'browserify', 'copyFonts', 'copyIndex', 'copyIcons'], 'watch', cb); });
{ "pile_set_name": "Github" }
/* * AC-3 encoder options * Copyright (c) 2011 Justin Ruggles <[email protected]> * * 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 */ #include "libavutil/opt.h" #include "internal.h" #include "ac3.h" static const AVOption ac3_options[] = { /* Metadata Options */ {"per_frame_metadata", "Allow Changing Metadata Per-Frame", OFFSET(allow_per_frame_metadata), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, AC3ENC_PARAM}, #if AC3ENC_TYPE != AC3ENC_TYPE_EAC3 /* AC-3 downmix levels */ {"center_mixlev", "Center Mix Level", OFFSET(center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_4POINT5DB }, 0.0, 1.0, AC3ENC_PARAM}, {"surround_mixlev", "Surround Mix Level", OFFSET(surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_6DB }, 0.0, 1.0, AC3ENC_PARAM}, #endif /* audio production information */ {"mixing_level", "Mixing Level", OFFSET(mixing_level), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 111, AC3ENC_PARAM}, {"room_type", "Room Type", OFFSET(room_type), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_SMALL_ROOM, AC3ENC_PARAM, "room_type"}, {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"}, {"large", "Large Room", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_LARGE_ROOM }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"}, {"small", "Small Room", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_SMALL_ROOM }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"}, /* other metadata options */ {"copyright", "Copyright Bit", OFFSET(copyright), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 1, AC3ENC_PARAM}, {"dialnorm", "Dialogue Level (dB)", OFFSET(dialogue_level), AV_OPT_TYPE_INT, {.i64 = -31 }, -31, -1, AC3ENC_PARAM}, {"dsur_mode", "Dolby Surround Mode", OFFSET(dolby_surround_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_ON, AC3ENC_PARAM, "dsur_mode"}, {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"}, {"on", "Dolby Surround Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"}, {"off", "Not Dolby Surround Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"}, {"original", "Original Bit Stream", OFFSET(original), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 1, AC3ENC_PARAM}, /* extended bitstream information */ {"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_DOWNMIX_DPLII, AC3ENC_PARAM, "dmix_mode"}, {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"}, {"ltrt", "Lt/Rt Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_LTRT }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"}, {"loro", "Lo/Ro Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_LORO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"}, {"dplii", "Dolby Pro Logic II Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_DPLII }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"}, {"ltrt_cmixlev", "Lt/Rt Center Mix Level", OFFSET(ltrt_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, {"ltrt_surmixlev", "Lt/Rt Surround Mix Level", OFFSET(ltrt_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, {"loro_cmixlev", "Lo/Ro Center Mix Level", OFFSET(loro_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, {"loro_surmixlev", "Lo/Ro Surround Mix Level", OFFSET(loro_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, {"dsurex_mode", "Dolby Surround EX Mode", OFFSET(dolby_surround_ex_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_DSUREX_DPLIIZ, AC3ENC_PARAM, "dsurex_mode"}, {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"}, {"on", "Dolby Surround EX Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"}, {"off", "Not Dolby Surround EX Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"}, {"dpliiz", "Dolby Pro Logic IIz-encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DSUREX_DPLIIZ }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"}, {"dheadphone_mode", "Dolby Headphone Mode", OFFSET(dolby_headphone_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_ON, AC3ENC_PARAM, "dheadphone_mode"}, {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"}, {"on", "Dolby Headphone Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"}, {"off", "Not Dolby Headphone Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"}, {"ad_conv_type", "A/D Converter Type", OFFSET(ad_converter_type), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_ADCONV_HDCD, AC3ENC_PARAM, "ad_conv_type"}, {"standard", "Standard (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_ADCONV_STANDARD }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"}, {"hdcd", "HDCD", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_ADCONV_HDCD }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"}, /* Other Encoding Options */ {"stereo_rematrixing", "Stereo Rematrixing", OFFSET(stereo_rematrixing), AV_OPT_TYPE_BOOL, {.i64 = 1 }, 0, 1, AC3ENC_PARAM}, {"channel_coupling", "Channel Coupling", OFFSET(channel_coupling), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_AUTO }, AC3ENC_OPT_AUTO, AC3ENC_OPT_ON, AC3ENC_PARAM, "channel_coupling"}, {"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_AUTO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "channel_coupling"}, {"cpl_start_band", "Coupling Start Band", OFFSET(cpl_start), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_AUTO }, AC3ENC_OPT_AUTO, 15, AC3ENC_PARAM, "cpl_start_band"}, {"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_AUTO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "cpl_start_band"}, {NULL} }; static const AVCodecDefault ac3_defaults[] = { { "b", "0" }, { NULL } };
{ "pile_set_name": "Github" }
/* * B53 register access through Switch Register Access Bridge Registers * * Copyright (C) 2013 Hauke Mehrtens <[email protected]> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/delay.h> #include <linux/platform_device.h> #include <linux/platform_data/b53.h> #include <linux/of.h> #include "b53_priv.h" /* command and status register of the SRAB */ #define B53_SRAB_CMDSTAT 0x2c #define B53_SRAB_CMDSTAT_RST BIT(2) #define B53_SRAB_CMDSTAT_WRITE BIT(1) #define B53_SRAB_CMDSTAT_GORDYN BIT(0) #define B53_SRAB_CMDSTAT_PAGE 24 #define B53_SRAB_CMDSTAT_REG 16 /* high order word of write data to switch registe */ #define B53_SRAB_WD_H 0x30 /* low order word of write data to switch registe */ #define B53_SRAB_WD_L 0x34 /* high order word of read data from switch register */ #define B53_SRAB_RD_H 0x38 /* low order word of read data from switch register */ #define B53_SRAB_RD_L 0x3c /* command and status register of the SRAB */ #define B53_SRAB_CTRLS 0x40 #define B53_SRAB_CTRLS_RCAREQ BIT(3) #define B53_SRAB_CTRLS_RCAGNT BIT(4) #define B53_SRAB_CTRLS_SW_INIT_DONE BIT(6) /* the register captures interrupt pulses from the switch */ #define B53_SRAB_INTR 0x44 #define B53_SRAB_INTR_P(x) BIT(x) #define B53_SRAB_SWITCH_PHY BIT(8) #define B53_SRAB_1588_SYNC BIT(9) #define B53_SRAB_IMP1_SLEEP_TIMER BIT(10) #define B53_SRAB_P7_SLEEP_TIMER BIT(11) #define B53_SRAB_IMP0_SLEEP_TIMER BIT(12) struct b53_srab_priv { void __iomem *regs; }; static int b53_srab_request_grant(struct b53_device *dev) { struct b53_srab_priv *priv = dev->priv; u8 __iomem *regs = priv->regs; u32 ctrls; int i; ctrls = readl(regs + B53_SRAB_CTRLS); ctrls |= B53_SRAB_CTRLS_RCAREQ; writel(ctrls, regs + B53_SRAB_CTRLS); for (i = 0; i < 20; i++) { ctrls = readl(regs + B53_SRAB_CTRLS); if (ctrls & B53_SRAB_CTRLS_RCAGNT) break; usleep_range(10, 100); } if (WARN_ON(i == 5)) return -EIO; return 0; } static void b53_srab_release_grant(struct b53_device *dev) { struct b53_srab_priv *priv = dev->priv; u8 __iomem *regs = priv->regs; u32 ctrls; ctrls = readl(regs + B53_SRAB_CTRLS); ctrls &= ~B53_SRAB_CTRLS_RCAREQ; writel(ctrls, regs + B53_SRAB_CTRLS); } static int b53_srab_op(struct b53_device *dev, u8 page, u8 reg, u32 op) { struct b53_srab_priv *priv = dev->priv; u8 __iomem *regs = priv->regs; int i; u32 cmdstat; /* set register address */ cmdstat = (page << B53_SRAB_CMDSTAT_PAGE) | (reg << B53_SRAB_CMDSTAT_REG) | B53_SRAB_CMDSTAT_GORDYN | op; writel(cmdstat, regs + B53_SRAB_CMDSTAT); /* check if operation completed */ for (i = 0; i < 5; ++i) { cmdstat = readl(regs + B53_SRAB_CMDSTAT); if (!(cmdstat & B53_SRAB_CMDSTAT_GORDYN)) break; usleep_range(10, 100); } if (WARN_ON(i == 5)) return -EIO; return 0; } static int b53_srab_read8(struct b53_device *dev, u8 page, u8 reg, u8 *val) { struct b53_srab_priv *priv = dev->priv; u8 __iomem *regs = priv->regs; int ret = 0; ret = b53_srab_request_grant(dev); if (ret) goto err; ret = b53_srab_op(dev, page, reg, 0); if (ret) goto err; *val = readl(regs + B53_SRAB_RD_L) & 0xff; err: b53_srab_release_grant(dev); return ret; } static int b53_srab_read16(struct b53_device *dev, u8 page, u8 reg, u16 *val) { struct b53_srab_priv *priv = dev->priv; u8 __iomem *regs = priv->regs; int ret = 0; ret = b53_srab_request_grant(dev); if (ret) goto err; ret = b53_srab_op(dev, page, reg, 0); if (ret) goto err; *val = readl(regs + B53_SRAB_RD_L) & 0xffff; err: b53_srab_release_grant(dev); return ret; } static int b53_srab_read32(struct b53_device *dev, u8 page, u8 reg, u32 *val) { struct b53_srab_priv *priv = dev->priv; u8 __iomem *regs = priv->regs; int ret = 0; ret = b53_srab_request_grant(dev); if (ret) goto err; ret = b53_srab_op(dev, page, reg, 0); if (ret) goto err; *val = readl(regs + B53_SRAB_RD_L); err: b53_srab_release_grant(dev); return ret; } static int b53_srab_read48(struct b53_device *dev, u8 page, u8 reg, u64 *val) { struct b53_srab_priv *priv = dev->priv; u8 __iomem *regs = priv->regs; int ret = 0; ret = b53_srab_request_grant(dev); if (ret) goto err; ret = b53_srab_op(dev, page, reg, 0); if (ret) goto err; *val = readl(regs + B53_SRAB_RD_L); *val += ((u64)readl(regs + B53_SRAB_RD_H) & 0xffff) << 32; err: b53_srab_release_grant(dev); return ret; } static int b53_srab_read64(struct b53_device *dev, u8 page, u8 reg, u64 *val) { struct b53_srab_priv *priv = dev->priv; u8 __iomem *regs = priv->regs; int ret = 0; ret = b53_srab_request_grant(dev); if (ret) goto err; ret = b53_srab_op(dev, page, reg, 0); if (ret) goto err; *val = readl(regs + B53_SRAB_RD_L); *val += (u64)readl(regs + B53_SRAB_RD_H) << 32; err: b53_srab_release_grant(dev); return ret; } static int b53_srab_write8(struct b53_device *dev, u8 page, u8 reg, u8 value) { struct b53_srab_priv *priv = dev->priv; u8 __iomem *regs = priv->regs; int ret = 0; ret = b53_srab_request_grant(dev); if (ret) goto err; writel(value, regs + B53_SRAB_WD_L); ret = b53_srab_op(dev, page, reg, B53_SRAB_CMDSTAT_WRITE); err: b53_srab_release_grant(dev); return ret; } static int b53_srab_write16(struct b53_device *dev, u8 page, u8 reg, u16 value) { struct b53_srab_priv *priv = dev->priv; u8 __iomem *regs = priv->regs; int ret = 0; ret = b53_srab_request_grant(dev); if (ret) goto err; writel(value, regs + B53_SRAB_WD_L); ret = b53_srab_op(dev, page, reg, B53_SRAB_CMDSTAT_WRITE); err: b53_srab_release_grant(dev); return ret; } static int b53_srab_write32(struct b53_device *dev, u8 page, u8 reg, u32 value) { struct b53_srab_priv *priv = dev->priv; u8 __iomem *regs = priv->regs; int ret = 0; ret = b53_srab_request_grant(dev); if (ret) goto err; writel(value, regs + B53_SRAB_WD_L); ret = b53_srab_op(dev, page, reg, B53_SRAB_CMDSTAT_WRITE); err: b53_srab_release_grant(dev); return ret; } static int b53_srab_write48(struct b53_device *dev, u8 page, u8 reg, u64 value) { struct b53_srab_priv *priv = dev->priv; u8 __iomem *regs = priv->regs; int ret = 0; ret = b53_srab_request_grant(dev); if (ret) goto err; writel((u32)value, regs + B53_SRAB_WD_L); writel((u16)(value >> 32), regs + B53_SRAB_WD_H); ret = b53_srab_op(dev, page, reg, B53_SRAB_CMDSTAT_WRITE); err: b53_srab_release_grant(dev); return ret; } static int b53_srab_write64(struct b53_device *dev, u8 page, u8 reg, u64 value) { struct b53_srab_priv *priv = dev->priv; u8 __iomem *regs = priv->regs; int ret = 0; ret = b53_srab_request_grant(dev); if (ret) goto err; writel((u32)value, regs + B53_SRAB_WD_L); writel((u32)(value >> 32), regs + B53_SRAB_WD_H); ret = b53_srab_op(dev, page, reg, B53_SRAB_CMDSTAT_WRITE); err: b53_srab_release_grant(dev); return ret; } static const struct b53_io_ops b53_srab_ops = { .read8 = b53_srab_read8, .read16 = b53_srab_read16, .read32 = b53_srab_read32, .read48 = b53_srab_read48, .read64 = b53_srab_read64, .write8 = b53_srab_write8, .write16 = b53_srab_write16, .write32 = b53_srab_write32, .write48 = b53_srab_write48, .write64 = b53_srab_write64, }; static const struct of_device_id b53_srab_of_match[] = { { .compatible = "brcm,bcm53010-srab" }, { .compatible = "brcm,bcm53011-srab" }, { .compatible = "brcm,bcm53012-srab" }, { .compatible = "brcm,bcm53018-srab" }, { .compatible = "brcm,bcm53019-srab" }, { .compatible = "brcm,bcm5301x-srab" }, { .compatible = "brcm,bcm11360-srab", .data = (void *)BCM583XX_DEVICE_ID }, { .compatible = "brcm,bcm58522-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,bcm58525-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,bcm58535-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,bcm58622-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,bcm58623-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,bcm58625-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,bcm88312-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,cygnus-srab", .data = (void *)BCM583XX_DEVICE_ID }, { .compatible = "brcm,nsp-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,omega-srab", .data = (void *)BCM583XX_DEVICE_ID }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, b53_srab_of_match); static int b53_srab_probe(struct platform_device *pdev) { struct b53_platform_data *pdata = pdev->dev.platform_data; struct device_node *dn = pdev->dev.of_node; const struct of_device_id *of_id = NULL; struct b53_srab_priv *priv; struct b53_device *dev; struct resource *r; if (dn) of_id = of_match_node(b53_srab_of_match, dn); if (of_id) { pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); if (!pdata) return -ENOMEM; pdata->chip_id = (u32)(unsigned long)of_id->data; } priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; r = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->regs = devm_ioremap_resource(&pdev->dev, r); if (IS_ERR(priv->regs)) return -ENOMEM; dev = b53_switch_alloc(&pdev->dev, &b53_srab_ops, priv); if (!dev) return -ENOMEM; if (pdata) dev->pdata = pdata; platform_set_drvdata(pdev, dev); return b53_switch_register(dev); } static int b53_srab_remove(struct platform_device *pdev) { struct b53_device *dev = platform_get_drvdata(pdev); if (dev) b53_switch_remove(dev); return 0; } static struct platform_driver b53_srab_driver = { .probe = b53_srab_probe, .remove = b53_srab_remove, .driver = { .name = "b53-srab-switch", .of_match_table = b53_srab_of_match, }, }; module_platform_driver(b53_srab_driver); MODULE_AUTHOR("Hauke Mehrtens <[email protected]>"); MODULE_DESCRIPTION("B53 Switch Register Access Bridge Registers (SRAB) access driver"); MODULE_LICENSE("Dual BSD/GPL");
{ "pile_set_name": "Github" }
G04 Flashes of rectangular apertures* %FSLAX24Y24*% %MOMM*% %ADD10R,0.44X0.25*% %ADD11R,0.44X0.25X0.19*% D10* X000000Y000000D03* D11* X010000D03* M02*
{ "pile_set_name": "Github" }
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs.actions; import com.intellij.openapi.project.Project; import com.intellij.openapi.vcs.AbstractVcs; import com.intellij.openapi.vcs.FilePath; import com.intellij.openapi.vcs.ProjectLevelVcsManager; import com.intellij.openapi.vcs.VcsKey; import com.intellij.openapi.vfs.VfsUtilCore; import org.jetbrains.annotations.NotNull; import java.util.*; public final class DescindingFilesFilter { private DescindingFilesFilter() { } public static FilePath @NotNull [] filterDescindingFiles(FilePath @NotNull [] roots, Project project) { final List<FilePath> result = new ArrayList<>(); ProjectLevelVcsManager manager = ProjectLevelVcsManager.getInstance(project); Arrays.sort(roots, FilePathComparator.getInstance()); final Map<VcsKey, List<FilePath>> chains = new HashMap<>(); for (FilePath root : roots) { final AbstractVcs vcs = manager.getVcsFor(root); if (vcs == null) continue; if (vcs.allowsNestedRoots()) { // just put into result: nested roots are allowed result.add(root); continue; } //if (pathsFilter != null && (! pathsFilter.convert(new Pair<FilePath, AbstractVcs>(root, vcs)))) continue; final List<FilePath> chain = chains.get(vcs.getKeyInstanceMethod()); if (chain == null) { final List<FilePath> newList = new ArrayList<>(); newList.add(root); chains.put(vcs.getKeyInstanceMethod(), newList); } else { boolean failed = false; for (FilePath chainedPath : chain) { if (VfsUtilCore.isAncestor(chainedPath.getIOFile(), root.getIOFile(), false)) { // do not take this root failed = true; break; } } if (! failed) { chain.add(root); } } } for (List<FilePath> filePaths : chains.values()) { result.addAll(filePaths); } return result.toArray(new FilePath[0]); } private static class FilePathComparator implements Comparator<FilePath> { private final static FilePathComparator ourInstance = new FilePathComparator(); public static FilePathComparator getInstance() { return ourInstance; } @Override public int compare(@NotNull FilePath fp1, @NotNull FilePath fp2) { return fp1.getPath().length() - fp2.getPath().length(); } } }
{ "pile_set_name": "Github" }
<?php /* * This file is part of SwiftMailer. * (c) 2004-2009 Chris Corbyn * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * The minimum interface for an Event. * * @author Chris Corbyn */ interface Swift_Events_Event { /** * Get the source object of this event. * * @return object */ public function getSource(); /** * Prevent this Event from bubbling any further up the stack. * * @param bool $cancel, optional */ public function cancelBubble($cancel = true); /** * Returns true if this Event will not bubble any further up the stack. * * @return bool */ public function bubbleCancelled(); }
{ "pile_set_name": "Github" }
import Cookies from 'js-cookie' const state = { sidebar: { opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, withoutAnimation: false }, device: 'desktop', size: Cookies.get('size') || 'medium' } const mutations = { TOGGLE_SIDEBAR: state => { state.sidebar.opened = !state.sidebar.opened state.sidebar.withoutAnimation = false if (state.sidebar.opened) { Cookies.set('sidebarStatus', 1) } else { Cookies.set('sidebarStatus', 0) } }, CLOSE_SIDEBAR: (state, withoutAnimation) => { Cookies.set('sidebarStatus', 0) state.sidebar.opened = false state.sidebar.withoutAnimation = withoutAnimation }, TOGGLE_DEVICE: (state, device) => { state.device = device }, SET_SIZE: (state, size) => { state.size = size Cookies.set('size', size) } } const actions = { toggleSideBar({ commit }) { commit('TOGGLE_SIDEBAR') }, closeSideBar({ commit }, { withoutAnimation }) { commit('CLOSE_SIDEBAR', withoutAnimation) }, toggleDevice({ commit }, device) { commit('TOGGLE_DEVICE', device) }, setSize({ commit }, size) { commit('SET_SIZE', size) } } export default { namespaced: true, state, mutations, actions }
{ "pile_set_name": "Github" }
int main() { double c; double b; float a; float d; #pragma scop a = 0.6f; b = 120.7234234f; c = 4.0; d = 5; #pragma endscop }
{ "pile_set_name": "Github" }
config B43LEGACY tristate "Broadcom 43xx-legacy wireless support (mac80211 stack)" depends on SSB_POSSIBLE && MAC80211 && HAS_DMA select SSB select FW_LOADER ---help--- b43legacy is a driver for 802.11b devices from Broadcom (BCM4301 and BCM4303) and early model 802.11g chips (BCM4306 Ver. 2) used in the Linksys WPC54G V1 PCMCIA devices. Newer 802.11g and 802.11a devices need b43. It is safe to include both b43 and b43legacy as the underlying glue layer will automatically load the correct version for your device. This driver uses V3 firmware, which must be installed separately using b43-fwcutter. This driver can be built as a module (recommended) that will be called "b43legacy". If unsure, say M. # Auto-select SSB PCI-HOST support, if possible config B43LEGACY_PCI_AUTOSELECT bool depends on B43LEGACY && SSB_PCIHOST_POSSIBLE select SSB_PCIHOST select SSB_B43_PCI_BRIDGE default y # Auto-select SSB PCICORE driver, if possible config B43LEGACY_PCICORE_AUTOSELECT bool depends on B43LEGACY && SSB_DRIVER_PCICORE_POSSIBLE select SSB_DRIVER_PCICORE default y # LED support # This config option automatically enables b43legacy LEDS support, # if it's possible. config B43LEGACY_LEDS bool depends on B43LEGACY && MAC80211_LEDS && (LEDS_CLASS = y || LEDS_CLASS = B43LEGACY) default y # This config option automatically enables b43 HW-RNG support, # if the HW-RNG core is enabled. config B43LEGACY_HWRNG bool depends on B43LEGACY && (HW_RANDOM = y || HW_RANDOM = B43LEGACY) default y config B43LEGACY_DEBUG bool "Broadcom 43xx-legacy debugging" depends on B43LEGACY default y ---help--- Say Y, because this information will help you get the driver running. This option generates a minimum of log output. config B43LEGACY_DMA bool depends on B43LEGACY config B43LEGACY_PIO bool depends on B43LEGACY choice prompt "Broadcom 43xx-legacy data transfer mode" depends on B43LEGACY default B43LEGACY_DMA_AND_PIO_MODE config B43LEGACY_DMA_AND_PIO_MODE bool "DMA + PIO" select B43LEGACY_DMA select B43LEGACY_PIO ---help--- Include both, Direct Memory Access (DMA) and Programmed I/O (PIO) data transfer modes. The mode actually used is selectable through the module parameter "pio". With pio=0 as a module parameter, the default DMA is used, otherwise PIO is used. If unsure, choose this option. config B43LEGACY_DMA_MODE bool "DMA (Direct Memory Access) only" select B43LEGACY_DMA ---help--- Only include Direct Memory Access (DMA). This reduces the size of the driver module, by omitting the PIO code. config B43LEGACY_PIO_MODE bool "PIO (Programmed I/O) only" select B43LEGACY_PIO ---help--- Only include Programmed I/O (PIO). This reduces the size of the driver module, by omitting the DMA code. Please note that PIO transfers are slow (compared to DMA). Also note that not all devices of the b43legacy series support PIO. You should use PIO only if DMA does not work for you. endchoice
{ "pile_set_name": "Github" }
table_create Terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigramSplitSymbolAlphaDigit --normalizer NormalizerAuto [[0,0.0,0.0],true] table_create Memos TABLE_NO_KEY [[0,0.0,0.0],true] column_create Memos body COLUMN_SCALAR Text [[0,0.0,0.0],true] column_create Terms memos_body COLUMN_INDEX|WITH_POSITION Memos body [[0,0.0,0.0],true] load --table Memos [ {"body": "'."} ] [[0,0.0,0.0],1] select Memos --match_columns "body" --query '" "' --output_columns _id,_score,_key [[0,0.0,0.0],[[[0],[["_id","UInt32"],["_score","Int32"]]]]]
{ "pile_set_name": "Github" }
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/quicksight/QuickSight_EXPORTS.h> #include <aws/quicksight/model/RelationalTable.h> #include <aws/quicksight/model/CustomSql.h> #include <aws/quicksight/model/S3Source.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace QuickSight { namespace Model { /** * <p>A view of a data source that contains information about the shape of the data * in the underlying source. This is a variant type structure. For this structure * to be valid, only one of the attributes can be non-null.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/PhysicalTable">AWS * API Reference</a></p> */ class AWS_QUICKSIGHT_API PhysicalTable { public: PhysicalTable(); PhysicalTable(Aws::Utils::Json::JsonView jsonValue); PhysicalTable& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>A physical table type for relational data sources.</p> */ inline const RelationalTable& GetRelationalTable() const{ return m_relationalTable; } /** * <p>A physical table type for relational data sources.</p> */ inline bool RelationalTableHasBeenSet() const { return m_relationalTableHasBeenSet; } /** * <p>A physical table type for relational data sources.</p> */ inline void SetRelationalTable(const RelationalTable& value) { m_relationalTableHasBeenSet = true; m_relationalTable = value; } /** * <p>A physical table type for relational data sources.</p> */ inline void SetRelationalTable(RelationalTable&& value) { m_relationalTableHasBeenSet = true; m_relationalTable = std::move(value); } /** * <p>A physical table type for relational data sources.</p> */ inline PhysicalTable& WithRelationalTable(const RelationalTable& value) { SetRelationalTable(value); return *this;} /** * <p>A physical table type for relational data sources.</p> */ inline PhysicalTable& WithRelationalTable(RelationalTable&& value) { SetRelationalTable(std::move(value)); return *this;} /** * <p>A physical table type built from the results of the custom SQL query.</p> */ inline const CustomSql& GetCustomSql() const{ return m_customSql; } /** * <p>A physical table type built from the results of the custom SQL query.</p> */ inline bool CustomSqlHasBeenSet() const { return m_customSqlHasBeenSet; } /** * <p>A physical table type built from the results of the custom SQL query.</p> */ inline void SetCustomSql(const CustomSql& value) { m_customSqlHasBeenSet = true; m_customSql = value; } /** * <p>A physical table type built from the results of the custom SQL query.</p> */ inline void SetCustomSql(CustomSql&& value) { m_customSqlHasBeenSet = true; m_customSql = std::move(value); } /** * <p>A physical table type built from the results of the custom SQL query.</p> */ inline PhysicalTable& WithCustomSql(const CustomSql& value) { SetCustomSql(value); return *this;} /** * <p>A physical table type built from the results of the custom SQL query.</p> */ inline PhysicalTable& WithCustomSql(CustomSql&& value) { SetCustomSql(std::move(value)); return *this;} /** * <p>A physical table type for as S3 data source.</p> */ inline const S3Source& GetS3Source() const{ return m_s3Source; } /** * <p>A physical table type for as S3 data source.</p> */ inline bool S3SourceHasBeenSet() const { return m_s3SourceHasBeenSet; } /** * <p>A physical table type for as S3 data source.</p> */ inline void SetS3Source(const S3Source& value) { m_s3SourceHasBeenSet = true; m_s3Source = value; } /** * <p>A physical table type for as S3 data source.</p> */ inline void SetS3Source(S3Source&& value) { m_s3SourceHasBeenSet = true; m_s3Source = std::move(value); } /** * <p>A physical table type for as S3 data source.</p> */ inline PhysicalTable& WithS3Source(const S3Source& value) { SetS3Source(value); return *this;} /** * <p>A physical table type for as S3 data source.</p> */ inline PhysicalTable& WithS3Source(S3Source&& value) { SetS3Source(std::move(value)); return *this;} private: RelationalTable m_relationalTable; bool m_relationalTableHasBeenSet; CustomSql m_customSql; bool m_customSqlHasBeenSet; S3Source m_s3Source; bool m_s3SourceHasBeenSet; }; } // namespace Model } // namespace QuickSight } // namespace Aws
{ "pile_set_name": "Github" }
class Tag < Formula desc "Manipulate and query tags on macOS files" homepage "https://github.com/jdberry/tag/" url "https://github.com/jdberry/tag/archive/v0.10.tar.gz" sha256 "5ab057d3e3f0dbb5c3be3970ffd90f69af4cb6201c18c1cbaa23ef367e5b071e" license "MIT" revision 1 head "https://github.com/jdberry/tag.git" bottle do cellar :any_skip_relocation sha256 "e1572ae47d558d60983f7c1cbe9ae42a5c7f2dcb950762ab6c721e81351f5657" => :catalina sha256 "ee5dbe68476b6ae900b92486f3dc3c7a9755296c1fee54a75cd64c7d6af66763" => :mojave sha256 "5801c9fac7b1a4bad52f02fd8a09b64050ebc52515bd96115153c7049bd4619f" => :high_sierra sha256 "5711ce58bd5b224252f1869f84f937c6bca0775bf4c86a6a1168418c1218dc98" => :sierra end def install system "make", "install", "prefix=#{prefix}" end test do test_tag = "test_tag" test_file = Pathname.pwd+"test_file" touch test_file system "#{bin}/tag", "--add", test_tag, test_file assert_equal test_tag, `#{bin}/tag --list --no-name #{test_file}`.chomp end end
{ "pile_set_name": "Github" }
# -*- ruby encoding: utf-8 -*- require 'mime/types'
{ "pile_set_name": "Github" }
(ns zest.docs.registry (:require-macros [cljs.core.async.macros :refer [go]]) (:require [reagent.core :as reagent] [cljs.core.async :as async])) (defn get-so-root [] (let [electron (.require js/window "electron") path (.require js/window "path")] (.join path (.getPath (.-app (.-remote electron)) "userData") "so"))) (defn get-devdocs-root [] (let [electron (.require js/window "electron") path (.require js/window "path")] (.join path (.getPath (.-app (.-remote electron)) "userData") "devdocs"))) (defn get-devdocs-docs-root [] (let [path (.require js/window "path")] (.join path (get-devdocs-root) "docs"))) (defn get-available-devdocs [cb] (let [electron (.require js.window "electron") fs (.require js/window "fs") mkdirp (.require js/window "mkdirp") path (.require js/window "path") request (.require js/window "request") devdocs-json (.join path (.getPath (.-app (.-remote electron)) "userData") "devdocs.json") fetch (fn [] (request "https://devdocs.io/docs.json" (fn [error response body] (.writeFileSync fs devdocs-json body) (cb (.parse js/JSON body)))))] (.sync mkdirp (get-devdocs-docs-root)) (if (and (.existsSync fs devdocs-json) (.isFile (.statSync fs devdocs-json))) (try (cb (.parse js/JSON (.readFileSync fs devdocs-json))) (catch js/Error e (.log js/console (str "Error reading devdocs.json: " e "; fetching")) (fetch))) (do (.log js/console "devdocs.json missing - fetching") (fetch))))) (defn get-installed-devdocs [] (let [fs (.require js/window "fs") mkdirp (.require js/window "mkdirp")] (.sync mkdirp (get-devdocs-docs-root)) (.readdirSync fs (get-devdocs-docs-root)))) (def installed-devdocs-atom (reagent/atom (zest.docs.registry/get-installed-devdocs))) (def installed-devdocs-chan (async/chan)) (defn update-installed-devdocs [] (let [installed (get-installed-devdocs)] (go (async/>! installed-devdocs-chan installed)) (reset! installed-devdocs-atom installed)))
{ "pile_set_name": "Github" }
//@module /* * Copyright (C) 2010-2016 Marvell International Ltd. * Copyright (C) 2002-2010 Kinoma, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Kinoma LowPAN Framework: Kinoma Bluetooth Stack * Bluetooth v4.2 - L2CAP (LE Only) */ const Utils = require("../../common/utils"); const Buffers = require("../../common/buffers"); const ByteBuffer = Buffers.ByteBuffer; var logger = new Utils.Logger("L2CAP"); logger.loggingLevel = Utils.Logger.Level.INFO; const Channel = { NULL: 0x0000, L2CAP_SIGNALING: 0x0001 }; exports.Channel = Channel; const LEChannel = { NULL: 0x0000, ATTRIBUTE_PROTOCOL: 0x0004, LE_L2CAP_SIGNALING: 0x0005, SECURITY_MANAGER_PROTOCOL: 0x0006 }; exports.LEChannel = LEChannel; function toKeyString(cid) { return Utils.toHexString(cid, 2, ""); } exports.createLayer = (hci) => { logger.info("Init"); return new Context(hci); }; class Context { constructor(hci) { this._hci = hci; this._delegate = null; hci.delegate = this; } set delegate(delegate) { this._delegate = delegate; } /* HCI Callback (HCIContext) */ hciReady() { logger.debug("HCI Ready"); this._delegate.l2capReady(); } /* HCI Callback (HCIContext) */ hciConnected(link) { logger.info("HCI Connected: handle=" + Utils.toHexString(link.handle, 2) + ", address=" + link.remoteAddress.toString() + ", type=" + link.remoteAddress.typeString); let mgr = new ConnectionManager(link); let signalingCID = LEChannel.LE_L2CAP_SIGNALING; let sc = new SignalingContext(mgr.openConnection(signalingCID, signalingCID)); this._delegate.l2capConnected(mgr, sc); } } class ConnectionManager { constructor(link) { this._link = link; this.connections = {}; this.currentChannel = -1; link.delegate = this; this._delegate = null; } set delegate(delegate) { this._delegate = delegate; } get link() { return this._link; } openConnection(srcCID, dstCID) { let cidStr = toKeyString(srcCID); logger.debug("Open Connection: src=" + cidStr); if (cidStr in this.connections) { logger.debug("Connection has already been opened"); return null; } let connection = new Connection(this, srcCID, dstCID); this.connections[cidStr] = connection; return connection; } getConnection(cid) { return this.connections[toKeyString(cid)]; } /* HCI Callback (ACLLink) */ received(data, firstFragment) { let fragment; let length = -1; if (firstFragment) { // TODO: Drop incomplete handleSignalingPacket length = Utils.toInt(data, 0, 2, true); let cid = Utils.toInt(data, 2, 2, true); logger.trace("First flushable packet: cid=" + toKeyString(cid) + ", length=" + length); this.currentChannel = cid; fragment = data.slice(4); } else { logger.trace("Continuing fragment"); fragment = data; } if (this.currentChannel > 0) { let key = toKeyString(this.currentChannel); if (!(key in this.connections)) { logger.warn("Discard packet for unavailable channel cid=" + key); return; } let connection = this.connections[key]; if (length > 0) { connection.allocateReceiveBuffer(length); } connection.received(fragment); } } /* HCI Callback (ACLLink) */ disconnected(reason) { for (let key in this.connections) { if (this.connections.hasOwnProperty(key)) { this.connections[key].disconnected(); } } if (this._delegate != null) { this._delegate.disconnected(reason); } } /* HCI Calback (LELink) */ connectionUpdated(connParameters) { if (this._delegate != null) { this._delegate.connectionUpdated(connParameters); } } } class Connection { constructor(connectionManager, sourceChannel, destinationChannel) { this._connectionManager = connectionManager; this._sourceChannel = sourceChannel; this._destinationChannel = destinationChannel; this._rxBuffer = null; this._delegate = null; this._frameQueue = new Array(); } set delegate(delegate) { this._delegate = delegate; } get link() { return this._connectionManager.link; } dequeueFrame() { if (this._frameQueue.length == 0) { return null; } return this._frameQueue.shift(); } /* L2CAP Callback (ConnectionManager) */ allocateReceiveBuffer(length) { logger.trace("Start receiving length=" + length); this._rxBuffer = ByteBuffer.allocateUint8Array(length, true); } /* L2CAP Callback (ConnectionManager) */ received(data) { logger.trace("Fragment received: len=" + data.length); if (this._rxBuffer == null) { logger.warn("RX buffer is null"); return; } this._rxBuffer.putByteArray(data); if (this._rxBuffer.remaining() == 0) { logger.debug("Receiving B-Frame: src=" + Utils.toHexString(this._destinationChannel, 2) + " dst=" + Utils.toHexString(this._sourceChannel, 2) + " " + Utils.toFrameString(this._rxBuffer.array)); this._rxBuffer.flip(); this._frameQueue.push(this._rxBuffer); this._rxBuffer = null; if (this._delegate != null) { this._delegate.received(); } } } sendBasicFrame(data) { let buffer = ByteBuffer.allocateUint8Array(data.length + 4, true); buffer.putInt16(data.length); buffer.putInt16(this._destinationChannel); buffer.putByteArray(data); buffer.flip(); logger.debug("Submit B-Frame: src=" + Utils.toHexString(this._sourceChannel, 2) + " dst=" + Utils.toHexString(this._destinationChannel, 2) + " " + Utils.toFrameString(data)); this.link.send(buffer); } disconnected() { if (this._delegate != null) { this._delegate.disconnected(); } else { logger.info("Connection has been disconnected: cid=" + Utils.toHexString(this._sourceChannel, 2)); } } } /****************************************************************************** * Signaling ******************************************************************************/ const Code = { COMMAND_REJECT: 0x01, CONNECTION_REQUEST: 0x02, ECHO_REQUEST: 0x08, ECHO_RESPONSE: 0x09, CONNECTION_PARAMETER_UPDATE_REQUEST: 0x12, CONNECTION_PARAMETER_UPDATE_RESPONSE: 0x13 }; class SignalingContext { constructor(connection) { this._connection = connection; this._sequence = new Utils.Sequence(8); this._callbacks = new Map(); connection.delegate = this; } allocateBuffer() { return ByteBuffer.allocateUint8Array(23, true); } sendSignalingPacket(code, identifier, packet, callback) { while (identifier == 0) { identifier = this._sequence.nextSequence(); } let buffer = this.allocateBuffer(); buffer.putInt8(code); buffer.putInt8(identifier); buffer.putInt16((packet != null) ? packet.length : 0); if (packet != null && packet.length > 0) { buffer.putByteArray(packet); } buffer.flip(); this._connection.sendBasicFrame(buffer.getByteArray()); if (callback !== undefined) { logger.debug("Callback set for identifier=" + identifier); this._callbacks.set(identifier, callback); } } sendCommandReject(identifier, reason, data) { let length = (data != null) ? data.length : 0; let packet = new Uint8Array(2 + length); packet[0] = reason & 0xFF; packet[1] = (reason >> 8) & 0xFF; for (let i = 0; i < length; i++) { packet[i + 2] = data[i]; } this.sendSignalingPacket(Code.COMMAND_REJECT, identifier, packet); } sendConnectionParameterUpdateRequest(connParameters, callback = null) { let request = this.allocateBuffer(); request.putInt16(connParameters.intervalMin); request.putInt16(connParameters.intervalMax); request.putInt16(connParameters.latency); request.putInt16(connParameters.supervisionTimeout); request.flip(); let packet = request.getByteArray(); this.sendSignalingPacket(Code.CONNECTION_PARAMETER_UPDATE_REQUEST, 0, packet, callback); } /** L2CAP Connection delegate method */ received() { let buffer = this._connection.dequeueFrame(); if (buffer == null) { return; } let code = buffer.getInt8(); let identifier = buffer.getInt8(); let length = buffer.getInt16(); buffer.setLimit(buffer.getPosition() + length); switch (code) { case Code.ECHO_REQUEST: this.sendSignalingPacket(Code.ECHO_RESPONSE, identifier, null); return; case Code.CONNECTION_PARAMETER_UPDATE_REQUEST: { let link = this._connection.link; if (!link.isLELink() || link.isLESlave()) { /* Non LE or LE slave does not support this request */ this.sendCommandReject(identifier, 0x0000, null); return; } let hci = link._linkMgr.context; // FIXME hci.commands.le.connectionUpdate( link.handle, { intervalMin: buffer.getInt16(), intervalMax: buffer.getInt16(), latency: buffer.getInt16(), supervisionTimeout: buffer.getInt16(), minimumCELength: 0, maximumCELength: 0 } ).then(() => { this.sendSignalingPacket( Code.CONNECTION_PARAMETER_UPDATE_RESPONSE, identifier, Utils.toByteArray(0x0000, 2, true)); }).catch(status => { this.sendSignalingPacket( Code.CONNECTION_PARAMETER_UPDATE_RESPONSE, identifier, Utils.toByteArray(0x0001, 2, true)); }); } return; default: if (this._callbacks.has(identifier)) { logger.debug("Callback has been found for identifier=" + identifier); let callback = this._callbacks.get(identifier); if (callback != null) { callback(buffer); } this._callbacks.delete(identifier); } else { logger.warn("Unsupported Signaling Command: code=" + Utils.toHexString(code)); this.sendCommandReject(identifier, 0x0000, null); } } } /** L2CAP Connection delegate method */ disconnected() { logger.info("Signaling context disconnected."); } }
{ "pile_set_name": "Github" }
/** * @license * Copyright 2014 Google Inc. All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @fileoverview Defines tests for the OTR related helper functions. * * @author [email protected] (Ryan Chan) */ goog.setTestOnly('e2e.otr.testing'); goog.provide('e2e.otr.testing'); goog.require('goog.array'); goog.require('goog.testing.asserts'); /** * Compares two Uint8Arrays. * @param {*} a The expected array (2 args) or the debug message (3 args). * @param {*} b The actual array (2 args) or the expected array (3 args). * @param {*=} opt_c The actual array (3 args only). */ e2e.otr.testing.assertTypedArrayEquals = function(a, b, opt_c) { assertArrayEquals.apply(null, goog.array.map(arguments, function(e) { return e instanceof Uint8Array ? goog.array.clone(e) : e; })); };
{ "pile_set_name": "Github" }
--net-file=input_tri.net.xml --detector-files=input_tri.det.xml --detector-output detectors_def.det.xml --measure-files xxx.txt,input_flows.txt
{ "pile_set_name": "Github" }
--- title: HastySite repo: h3rald/hastysite homepage: https://hastysite.h3rald.com/ language: - Nim license: - MIT templates: - Mustache description: HastySite is a minimalist, self-contained, and highly-extensible static site generator. --- HastySite is a minimalist but powerful static site generator written in [Nim](https://nim-lang.org) which aims to be fast at processing content and highly configurable to suit your own needs. ### Key Features - Built-in rich markdown support via [HastyScribe](https://h3rald.com/hastyscribe). - Built-in [mustache](https://mustache.github.io/) support for page templates. - Limited support for standard [CSS variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables). - Fully configurable content and asset processing pipeline, using the [min](https://min-lang.org) programming language. - Custom script definition, using the [min](https://min-lang.org) programming language. - Default stylesheet and fonts from [HastyScribe](https://h3rald.com/hastyscribe). - Default scripts and rules to get started quickly. - All packed in a single executable file, with no dependencies, available for the most common desktop platforms.
{ "pile_set_name": "Github" }
// // AppDelegate.swift // // Copyright (c) 2016 Orderella Ltd. (http://orderella.co.uk) // Author - Martin Wildfeuer (http://www.mwfire.de) // // 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. // import UIKit import PopupDialog @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { // Uncomment for a dark theme demo // // Customize dialog appearance // let pv = PopupDialogDefaultView.appearance() // pv.titleFont = UIFont(name: "HelveticaNeue-Light", size: 16)! // pv.titleColor = .white // pv.messageFont = UIFont(name: "HelveticaNeue", size: 14)! // pv.messageColor = UIColor(white: 0.8, alpha: 1) // // // Customize the container view appearance // let pcv = PopupDialogContainerView.appearance() // pcv.backgroundColor = UIColor(red:0.23, green:0.23, blue:0.27, alpha:1.00) // pcv.cornerRadius = 2 // pcv.shadowEnabled = true // pcv.shadowColor = .black // pcv.shadowOpacity = 0.6 // pcv.shadowRadius = 20 // pcv.shadowOffset = CGSize(width: 0, height: 8) // // // Customize overlay appearance // let ov = PopupDialogOverlayView.appearance() // ov.blurEnabled = true // ov.blurRadius = 30 // ov.liveBlurEnabled = true // ov.opacity = 0.7 // ov.color = .black // // // Customize default button appearance // let db = DefaultButton.appearance() // db.titleFont = UIFont(name: "HelveticaNeue-Medium", size: 14)! // db.titleColor = .white // db.buttonColor = UIColor(red:0.25, green:0.25, blue:0.29, alpha:1.00) // db.separatorColor = UIColor(red:0.20, green:0.20, blue:0.25, alpha:1.00) // // // Customize cancel button appearance // let cb = CancelButton.appearance() // cb.titleFont = UIFont(name: "HelveticaNeue-Medium", size: 14)! // cb.titleColor = UIColor(white: 0.6, alpha: 1) // cb.buttonColor = UIColor(red:0.25, green:0.25, blue:0.29, alpha:1.00) // cb.separatorColor = UIColor(red:0.20, green:0.20, blue:0.25, alpha:1.00) return true } }
{ "pile_set_name": "Github" }
#ifndef UTILS_H #define UTILS_H #include <macutils.h> #include <iputils.h> #endif
{ "pile_set_name": "Github" }
/* -*- mode: c; c-basic-offset: 8; -*- * vim: noexpandtab sw=8 ts=8 sts=0: * * ocfs2_ioctl.h * * Defines OCFS2 ioctls. * * Copyright (C) 2010 Oracle. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License, version 2, as published by the Free Software Foundation. * * 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 OCFS2_IOCTL_H #define OCFS2_IOCTL_H /* * ioctl commands */ #define OCFS2_IOC_GETFLAGS FS_IOC_GETFLAGS #define OCFS2_IOC_SETFLAGS FS_IOC_SETFLAGS #define OCFS2_IOC32_GETFLAGS FS_IOC32_GETFLAGS #define OCFS2_IOC32_SETFLAGS FS_IOC32_SETFLAGS /* * Space reservation / allocation / free ioctls and argument structure * are designed to be compatible with XFS. * * ALLOCSP* and FREESP* are not and will never be supported, but are * included here for completeness. */ struct ocfs2_space_resv { __s16 l_type; __s16 l_whence; __s64 l_start; __s64 l_len; /* len == 0 means until end of file */ __s32 l_sysid; __u32 l_pid; __s32 l_pad[4]; /* reserve area */ }; #define OCFS2_IOC_ALLOCSP _IOW ('X', 10, struct ocfs2_space_resv) #define OCFS2_IOC_FREESP _IOW ('X', 11, struct ocfs2_space_resv) #define OCFS2_IOC_RESVSP _IOW ('X', 40, struct ocfs2_space_resv) #define OCFS2_IOC_UNRESVSP _IOW ('X', 41, struct ocfs2_space_resv) #define OCFS2_IOC_ALLOCSP64 _IOW ('X', 36, struct ocfs2_space_resv) #define OCFS2_IOC_FREESP64 _IOW ('X', 37, struct ocfs2_space_resv) #define OCFS2_IOC_RESVSP64 _IOW ('X', 42, struct ocfs2_space_resv) #define OCFS2_IOC_UNRESVSP64 _IOW ('X', 43, struct ocfs2_space_resv) /* Used to pass group descriptor data when online resize is done */ struct ocfs2_new_group_input { __u64 group; /* Group descriptor's blkno. */ __u32 clusters; /* Total number of clusters in this group */ __u32 frees; /* Total free clusters in this group */ __u16 chain; /* Chain for this group */ __u16 reserved1; __u32 reserved2; }; #define OCFS2_IOC_GROUP_EXTEND _IOW('o', 1, int) #define OCFS2_IOC_GROUP_ADD _IOW('o', 2,struct ocfs2_new_group_input) #define OCFS2_IOC_GROUP_ADD64 _IOW('o', 3,struct ocfs2_new_group_input) /* Used to pass 2 file names to reflink. */ struct reflink_arguments { __u64 old_path; __u64 new_path; __u64 preserve; }; #define OCFS2_IOC_REFLINK _IOW('o', 4, struct reflink_arguments) /* Following definitions dedicated for ocfs2_info_request ioctls. */ #define OCFS2_INFO_MAX_REQUEST (50) #define OCFS2_TEXT_UUID_LEN (OCFS2_VOL_UUID_LEN * 2) /* Magic number of all requests */ #define OCFS2_INFO_MAGIC (0x4F32494E) /* * Always try to separate info request into small pieces to * guarantee the backward&forward compatibility. */ struct ocfs2_info { __u64 oi_requests; /* Array of __u64 pointers to requests */ __u32 oi_count; /* Number of requests in info_requests */ __u32 oi_pad; }; struct ocfs2_info_request { /*00*/ __u32 ir_magic; /* Magic number */ __u32 ir_code; /* Info request code */ __u32 ir_size; /* Size of request */ __u32 ir_flags; /* Request flags */ /*10*/ /* Request specific fields */ }; struct ocfs2_info_clustersize { struct ocfs2_info_request ic_req; __u32 ic_clustersize; __u32 ic_pad; }; struct ocfs2_info_blocksize { struct ocfs2_info_request ib_req; __u32 ib_blocksize; __u32 ib_pad; }; struct ocfs2_info_maxslots { struct ocfs2_info_request im_req; __u32 im_max_slots; __u32 im_pad; }; struct ocfs2_info_label { struct ocfs2_info_request il_req; __u8 il_label[OCFS2_MAX_VOL_LABEL_LEN]; } __attribute__ ((packed)); struct ocfs2_info_uuid { struct ocfs2_info_request iu_req; __u8 iu_uuid_str[OCFS2_TEXT_UUID_LEN + 1]; } __attribute__ ((packed)); struct ocfs2_info_fs_features { struct ocfs2_info_request if_req; __u32 if_compat_features; __u32 if_incompat_features; __u32 if_ro_compat_features; __u32 if_pad; }; struct ocfs2_info_journal_size { struct ocfs2_info_request ij_req; __u64 ij_journal_size; }; struct ocfs2_info_freeinode { struct ocfs2_info_request ifi_req; struct ocfs2_info_local_freeinode { __u64 lfi_total; __u64 lfi_free; } ifi_stat[OCFS2_MAX_SLOTS]; __u32 ifi_slotnum; /* out */ __u32 ifi_pad; }; #define OCFS2_INFO_MAX_HIST (32) struct ocfs2_info_freefrag { struct ocfs2_info_request iff_req; struct ocfs2_info_freefrag_stats { /* (out) */ struct ocfs2_info_free_chunk_list { __u32 fc_chunks[OCFS2_INFO_MAX_HIST]; __u32 fc_clusters[OCFS2_INFO_MAX_HIST]; } ffs_fc_hist; __u32 ffs_clusters; __u32 ffs_free_clusters; __u32 ffs_free_chunks; __u32 ffs_free_chunks_real; __u32 ffs_min; /* Minimum free chunksize in clusters */ __u32 ffs_max; __u32 ffs_avg; __u32 ffs_pad; } iff_ffs; __u32 iff_chunksize; /* chunksize in clusters(in) */ __u32 iff_pad; }; /* Codes for ocfs2_info_request */ enum ocfs2_info_type { OCFS2_INFO_CLUSTERSIZE = 1, OCFS2_INFO_BLOCKSIZE, OCFS2_INFO_MAXSLOTS, OCFS2_INFO_LABEL, OCFS2_INFO_UUID, OCFS2_INFO_FS_FEATURES, OCFS2_INFO_JOURNAL_SIZE, OCFS2_INFO_FREEINODE, OCFS2_INFO_FREEFRAG, OCFS2_INFO_NUM_TYPES }; /* Flags for struct ocfs2_info_request */ /* Filled by the caller */ #define OCFS2_INFO_FL_NON_COHERENT (0x00000001) /* Cluster coherency not required. This is a hint. It is up to ocfs2 whether the request can be fulfilled without locking. */ /* Filled by ocfs2 */ #define OCFS2_INFO_FL_FILLED (0x40000000) /* Filesystem understood this request and filled in the answer */ #define OCFS2_INFO_FL_ERROR (0x80000000) /* Error happened during request handling. */ #define OCFS2_IOC_INFO _IOR('o', 5, struct ocfs2_info) struct ocfs2_move_extents { /* All values are in bytes */ /* in */ __u64 me_start; /* Virtual start in the file to move */ __u64 me_len; /* Length of the extents to be moved */ __u64 me_goal; /* Physical offset of the goal, it's in block unit */ __u64 me_threshold; /* Maximum distance from goal or threshold for auto defragmentation */ __u64 me_flags; /* Flags for the operation: * - auto defragmentation. * - refcount,xattr cases. */ /* out */ __u64 me_moved_len; /* Moved/defraged length */ __u64 me_new_offset; /* Resulting physical location */ __u32 me_reserved[2]; /* Reserved for futhure */ }; #define OCFS2_MOVE_EXT_FL_AUTO_DEFRAG (0x00000001) /* Kernel manages to claim new clusters as the goal place for extents moving */ #define OCFS2_MOVE_EXT_FL_PART_DEFRAG (0x00000002) /* Allow partial extent moving, is to make movement less likely to fail, may make fs even more fragmented */ #define OCFS2_MOVE_EXT_FL_COMPLETE (0x00000004) /* Move or defragmenation completely gets done. */ #define OCFS2_IOC_MOVE_EXT _IOW('o', 6, struct ocfs2_move_extents) #endif /* OCFS2_IOCTL_H */
{ "pile_set_name": "Github" }
// GENERATED FILE - DO NOT EDIT. // Generated by generate_entry_points.py using data from gl.xml and gl_angle_ext.xml. // // Copyright 2020 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // entry_points_enum_autogen.h: // Defines the GL/GLES entry points enumeration. #ifndef LIBANGLE_ENTRYPOINTSENUM_AUTOGEN_H_ #define LIBANGLE_ENTRYPOINTSENUM_AUTOGEN_H_ namespace gl { enum class EntryPoint { Accum, ActiveShaderProgram, ActiveTexture, AlphaFunc, AlphaFuncx, AreTexturesResident, ArrayElement, AttachShader, Begin, BeginConditionalRender, BeginQuery, BeginQueryEXT, BeginQueryIndexed, BeginTransformFeedback, BindAttribLocation, BindBuffer, BindBufferBase, BindBufferRange, BindBuffersBase, BindBuffersRange, BindFragDataLocation, BindFragDataLocationEXT, BindFragDataLocationIndexed, BindFragDataLocationIndexedEXT, BindFramebuffer, BindFramebufferOES, BindImageTexture, BindImageTextures, BindProgramPipeline, BindRenderbuffer, BindRenderbufferOES, BindSampler, BindSamplers, BindTexture, BindTextureUnit, BindTextures, BindTransformFeedback, BindUniformLocationCHROMIUM, BindVertexArray, BindVertexArrayOES, BindVertexBuffer, BindVertexBuffers, Bitmap, BlendBarrier, BlendColor, BlendEquation, BlendEquationSeparate, BlendEquationSeparatei, BlendEquationSeparateiEXT, BlendEquationSeparateiOES, BlendEquationi, BlendEquationiEXT, BlendEquationiOES, BlendFunc, BlendFuncSeparate, BlendFuncSeparatei, BlendFuncSeparateiEXT, BlendFuncSeparateiOES, BlendFunci, BlendFunciEXT, BlendFunciOES, BlitFramebuffer, BlitFramebufferANGLE, BlitNamedFramebuffer, BufferData, BufferStorage, BufferStorageEXT, BufferStorageMemEXT, BufferSubData, CallList, CallLists, CheckFramebufferStatus, CheckFramebufferStatusOES, CheckNamedFramebufferStatus, ClampColor, Clear, ClearAccum, ClearBufferData, ClearBufferSubData, ClearBufferfi, ClearBufferfv, ClearBufferiv, ClearBufferuiv, ClearColor, ClearColorx, ClearDepth, ClearDepthf, ClearDepthx, ClearIndex, ClearNamedBufferData, ClearNamedBufferSubData, ClearNamedFramebufferfi, ClearNamedFramebufferfv, ClearNamedFramebufferiv, ClearNamedFramebufferuiv, ClearStencil, ClearTexImage, ClearTexSubImage, ClientActiveTexture, ClientWaitSync, ClipControl, ClipPlane, ClipPlanef, ClipPlanex, Color3b, Color3bv, Color3d, Color3dv, Color3f, Color3fv, Color3i, Color3iv, Color3s, Color3sv, Color3ub, Color3ubv, Color3ui, Color3uiv, Color3us, Color3usv, Color4b, Color4bv, Color4d, Color4dv, Color4f, Color4fv, Color4i, Color4iv, Color4s, Color4sv, Color4ub, Color4ubv, Color4ui, Color4uiv, Color4us, Color4usv, Color4x, ColorMask, ColorMaski, ColorMaskiEXT, ColorMaskiOES, ColorMaterial, ColorP3ui, ColorP3uiv, ColorP4ui, ColorP4uiv, ColorPointer, CompileShader, CompressedCopyTextureCHROMIUM, CompressedTexImage1D, CompressedTexImage2D, CompressedTexImage2DRobustANGLE, CompressedTexImage3D, CompressedTexImage3DOES, CompressedTexImage3DRobustANGLE, CompressedTexSubImage1D, CompressedTexSubImage2D, CompressedTexSubImage2DRobustANGLE, CompressedTexSubImage3D, CompressedTexSubImage3DOES, CompressedTexSubImage3DRobustANGLE, CompressedTextureSubImage1D, CompressedTextureSubImage2D, CompressedTextureSubImage3D, CopyBufferSubData, CopyImageSubData, CopyNamedBufferSubData, CopyPixels, CopySubTexture3DANGLE, CopySubTextureCHROMIUM, CopyTexImage1D, CopyTexImage2D, CopyTexSubImage1D, CopyTexSubImage2D, CopyTexSubImage3D, CopyTexSubImage3DOES, CopyTexture3DANGLE, CopyTextureCHROMIUM, CopyTextureSubImage1D, CopyTextureSubImage2D, CopyTextureSubImage3D, CoverageModulationCHROMIUM, CreateBuffers, CreateFramebuffers, CreateMemoryObjectsEXT, CreateProgram, CreateProgramPipelines, CreateQueries, CreateRenderbuffers, CreateSamplers, CreateShader, CreateShaderProgramv, CreateTextures, CreateTransformFeedbacks, CreateVertexArrays, CullFace, CurrentPaletteMatrixOES, DebugMessageCallback, DebugMessageCallbackKHR, DebugMessageControl, DebugMessageControlKHR, DebugMessageInsert, DebugMessageInsertKHR, DeleteBuffers, DeleteFencesNV, DeleteFramebuffers, DeleteFramebuffersOES, DeleteLists, DeleteMemoryObjectsEXT, DeleteProgram, DeleteProgramPipelines, DeleteQueries, DeleteQueriesEXT, DeleteRenderbuffers, DeleteRenderbuffersOES, DeleteSamplers, DeleteSemaphoresEXT, DeleteShader, DeleteSync, DeleteTextures, DeleteTransformFeedbacks, DeleteVertexArrays, DeleteVertexArraysOES, DepthFunc, DepthMask, DepthRange, DepthRangeArrayv, DepthRangeIndexed, DepthRangef, DepthRangex, DetachShader, Disable, DisableClientState, DisableExtensionANGLE, DisableVertexArrayAttrib, DisableVertexAttribArray, Disablei, DisableiEXT, DisableiOES, DiscardFramebufferEXT, DispatchCompute, DispatchComputeIndirect, DrawArrays, DrawArraysIndirect, DrawArraysInstanced, DrawArraysInstancedANGLE, DrawArraysInstancedBaseInstance, DrawArraysInstancedBaseInstanceANGLE, DrawArraysInstancedEXT, DrawBuffer, DrawBuffers, DrawBuffersEXT, DrawElements, DrawElementsBaseVertex, DrawElementsBaseVertexEXT, DrawElementsBaseVertexOES, DrawElementsIndirect, DrawElementsInstanced, DrawElementsInstancedANGLE, DrawElementsInstancedBaseInstance, DrawElementsInstancedBaseVertex, DrawElementsInstancedBaseVertexBaseInstance, DrawElementsInstancedBaseVertexBaseInstanceANGLE, DrawElementsInstancedBaseVertexEXT, DrawElementsInstancedBaseVertexOES, DrawElementsInstancedEXT, DrawPixels, DrawRangeElements, DrawRangeElementsBaseVertex, DrawRangeElementsBaseVertexEXT, DrawRangeElementsBaseVertexOES, DrawTexfOES, DrawTexfvOES, DrawTexiOES, DrawTexivOES, DrawTexsOES, DrawTexsvOES, DrawTexxOES, DrawTexxvOES, DrawTransformFeedback, DrawTransformFeedbackInstanced, DrawTransformFeedbackStream, DrawTransformFeedbackStreamInstanced, EGLImageTargetRenderbufferStorageOES, EGLImageTargetTexture2DOES, EdgeFlag, EdgeFlagPointer, EdgeFlagv, Enable, EnableClientState, EnableVertexArrayAttrib, EnableVertexAttribArray, Enablei, EnableiEXT, EnableiOES, End, EndConditionalRender, EndList, EndQuery, EndQueryEXT, EndQueryIndexed, EndTransformFeedback, EvalCoord1d, EvalCoord1dv, EvalCoord1f, EvalCoord1fv, EvalCoord2d, EvalCoord2dv, EvalCoord2f, EvalCoord2fv, EvalMesh1, EvalMesh2, EvalPoint1, EvalPoint2, FeedbackBuffer, FenceSync, Finish, FinishFenceNV, Flush, FlushMappedBufferRange, FlushMappedBufferRangeEXT, FlushMappedNamedBufferRange, FogCoordPointer, FogCoordd, FogCoorddv, FogCoordf, FogCoordfv, Fogf, Fogfv, Fogi, Fogiv, Fogx, Fogxv, FramebufferParameteri, FramebufferRenderbuffer, FramebufferRenderbufferOES, FramebufferTexture, FramebufferTexture1D, FramebufferTexture2D, FramebufferTexture2DMultisampleEXT, FramebufferTexture2DOES, FramebufferTexture3D, FramebufferTexture3DOES, FramebufferTextureEXT, FramebufferTextureLayer, FramebufferTextureMultiviewOVR, FrontFace, Frustum, Frustumf, Frustumx, GenBuffers, GenFencesNV, GenFramebuffers, GenFramebuffersOES, GenLists, GenProgramPipelines, GenQueries, GenQueriesEXT, GenRenderbuffers, GenRenderbuffersOES, GenSamplers, GenSemaphoresEXT, GenTextures, GenTransformFeedbacks, GenVertexArrays, GenVertexArraysOES, GenerateMipmap, GenerateMipmapOES, GenerateTextureMipmap, GetActiveAtomicCounterBufferiv, GetActiveAttrib, GetActiveSubroutineName, GetActiveSubroutineUniformName, GetActiveSubroutineUniformiv, GetActiveUniform, GetActiveUniformBlockName, GetActiveUniformBlockiv, GetActiveUniformBlockivRobustANGLE, GetActiveUniformName, GetActiveUniformsiv, GetAttachedShaders, GetAttribLocation, GetBooleani_v, GetBooleani_vRobustANGLE, GetBooleanv, GetBooleanvRobustANGLE, GetBufferParameteri64v, GetBufferParameteri64vRobustANGLE, GetBufferParameteriv, GetBufferParameterivRobustANGLE, GetBufferPointerv, GetBufferPointervOES, GetBufferPointervRobustANGLE, GetBufferSubData, GetClipPlane, GetClipPlanef, GetClipPlanex, GetCompressedTexImage, GetCompressedTextureImage, GetCompressedTextureSubImage, GetDebugMessageLog, GetDebugMessageLogKHR, GetDoublei_v, GetDoublev, GetError, GetFenceivNV, GetFixedv, GetFloati_v, GetFloatv, GetFloatvRobustANGLE, GetFragDataIndex, GetFragDataIndexEXT, GetFragDataLocation, GetFramebufferAttachmentParameteriv, GetFramebufferAttachmentParameterivOES, GetFramebufferAttachmentParameterivRobustANGLE, GetFramebufferParameteriv, GetFramebufferParameterivRobustANGLE, GetGraphicsResetStatus, GetGraphicsResetStatusEXT, GetInteger64i_v, GetInteger64i_vRobustANGLE, GetInteger64v, GetInteger64vEXT, GetInteger64vRobustANGLE, GetIntegeri_v, GetIntegeri_vRobustANGLE, GetIntegerv, GetIntegervRobustANGLE, GetInternalformati64v, GetInternalformativ, GetInternalformativRobustANGLE, GetLightfv, GetLightiv, GetLightxv, GetMapdv, GetMapfv, GetMapiv, GetMaterialfv, GetMaterialiv, GetMaterialxv, GetMemoryObjectParameterivEXT, GetMultisamplefv, GetMultisamplefvANGLE, GetMultisamplefvRobustANGLE, GetNamedBufferParameteri64v, GetNamedBufferParameteriv, GetNamedBufferPointerv, GetNamedBufferSubData, GetNamedFramebufferAttachmentParameteriv, GetNamedFramebufferParameteriv, GetNamedRenderbufferParameteriv, GetObjectLabel, GetObjectLabelKHR, GetObjectPtrLabel, GetObjectPtrLabelKHR, GetPixelMapfv, GetPixelMapuiv, GetPixelMapusv, GetPointerv, GetPointervKHR, GetPointervRobustANGLERobustANGLE, GetPolygonStipple, GetProgramBinary, GetProgramBinaryOES, GetProgramInfoLog, GetProgramInterfaceiv, GetProgramInterfaceivRobustANGLE, GetProgramPipelineInfoLog, GetProgramPipelineiv, GetProgramResourceIndex, GetProgramResourceLocation, GetProgramResourceLocationIndex, GetProgramResourceLocationIndexEXT, GetProgramResourceName, GetProgramResourceiv, GetProgramStageiv, GetProgramiv, GetProgramivRobustANGLE, GetQueryBufferObjecti64v, GetQueryBufferObjectiv, GetQueryBufferObjectui64v, GetQueryBufferObjectuiv, GetQueryIndexediv, GetQueryObjecti64v, GetQueryObjecti64vEXT, GetQueryObjecti64vRobustANGLE, GetQueryObjectiv, GetQueryObjectivEXT, GetQueryObjectivRobustANGLE, GetQueryObjectui64v, GetQueryObjectui64vEXT, GetQueryObjectui64vRobustANGLE, GetQueryObjectuiv, GetQueryObjectuivEXT, GetQueryObjectuivRobustANGLE, GetQueryiv, GetQueryivEXT, GetQueryivRobustANGLE, GetRenderbufferImageANGLE, GetRenderbufferParameteriv, GetRenderbufferParameterivOES, GetRenderbufferParameterivRobustANGLE, GetSamplerParameterIiv, GetSamplerParameterIivOES, GetSamplerParameterIivRobustANGLE, GetSamplerParameterIuiv, GetSamplerParameterIuivOES, GetSamplerParameterIuivRobustANGLE, GetSamplerParameterfv, GetSamplerParameterfvRobustANGLE, GetSamplerParameteriv, GetSamplerParameterivRobustANGLE, GetSemaphoreParameterui64vEXT, GetShaderInfoLog, GetShaderPrecisionFormat, GetShaderSource, GetShaderiv, GetShaderivRobustANGLE, GetString, GetStringi, GetSubroutineIndex, GetSubroutineUniformLocation, GetSynciv, GetTexEnvfv, GetTexEnviv, GetTexEnvxv, GetTexGendv, GetTexGenfv, GetTexGenfvOES, GetTexGeniv, GetTexGenivOES, GetTexGenxvOES, GetTexImage, GetTexImageANGLE, GetTexLevelParameterfv, GetTexLevelParameterfvANGLE, GetTexLevelParameterfvRobustANGLE, GetTexLevelParameteriv, GetTexLevelParameterivANGLE, GetTexLevelParameterivRobustANGLE, GetTexParameterIiv, GetTexParameterIivOES, GetTexParameterIivRobustANGLE, GetTexParameterIuiv, GetTexParameterIuivOES, GetTexParameterIuivRobustANGLE, GetTexParameterfv, GetTexParameterfvRobustANGLE, GetTexParameteriv, GetTexParameterivRobustANGLE, GetTexParameterxv, GetTextureImage, GetTextureLevelParameterfv, GetTextureLevelParameteriv, GetTextureParameterIiv, GetTextureParameterIuiv, GetTextureParameterfv, GetTextureParameteriv, GetTextureSubImage, GetTransformFeedbackVarying, GetTransformFeedbacki64_v, GetTransformFeedbacki_v, GetTransformFeedbackiv, GetTranslatedShaderSourceANGLE, GetUniformBlockIndex, GetUniformIndices, GetUniformLocation, GetUniformSubroutineuiv, GetUniformdv, GetUniformfv, GetUniformfvRobustANGLE, GetUniformiv, GetUniformivRobustANGLE, GetUniformuiv, GetUniformuivRobustANGLE, GetUnsignedBytei_vEXT, GetUnsignedBytevEXT, GetVertexArrayIndexed64iv, GetVertexArrayIndexediv, GetVertexArrayiv, GetVertexAttribIiv, GetVertexAttribIivRobustANGLE, GetVertexAttribIuiv, GetVertexAttribIuivRobustANGLE, GetVertexAttribLdv, GetVertexAttribPointerv, GetVertexAttribPointervRobustANGLE, GetVertexAttribdv, GetVertexAttribfv, GetVertexAttribfvRobustANGLE, GetVertexAttribiv, GetVertexAttribivRobustANGLE, GetnColorTable, GetnCompressedTexImage, GetnConvolutionFilter, GetnHistogram, GetnMapdv, GetnMapfv, GetnMapiv, GetnMinmax, GetnPixelMapfv, GetnPixelMapuiv, GetnPixelMapusv, GetnPolygonStipple, GetnSeparableFilter, GetnTexImage, GetnUniformdv, GetnUniformfv, GetnUniformfvEXT, GetnUniformfvRobustANGLE, GetnUniformiv, GetnUniformivEXT, GetnUniformivRobustANGLE, GetnUniformuiv, GetnUniformuivRobustANGLE, Hint, ImportMemoryFdEXT, ImportMemoryZirconHandleANGLE, ImportSemaphoreFdEXT, ImportSemaphoreZirconHandleANGLE, IndexMask, IndexPointer, Indexd, Indexdv, Indexf, Indexfv, Indexi, Indexiv, Indexs, Indexsv, Indexub, Indexubv, InitNames, InsertEventMarkerEXT, InterleavedArrays, Invalid, InvalidateBufferData, InvalidateBufferSubData, InvalidateFramebuffer, InvalidateNamedFramebufferData, InvalidateNamedFramebufferSubData, InvalidateSubFramebuffer, InvalidateTexImage, InvalidateTexSubImage, InvalidateTextureANGLE, IsBuffer, IsEnabled, IsEnabledi, IsEnablediEXT, IsEnablediOES, IsFenceNV, IsFramebuffer, IsFramebufferOES, IsList, IsMemoryObjectEXT, IsProgram, IsProgramPipeline, IsQuery, IsQueryEXT, IsRenderbuffer, IsRenderbufferOES, IsSampler, IsSemaphoreEXT, IsShader, IsSync, IsTexture, IsTransformFeedback, IsVertexArray, IsVertexArrayOES, LightModelf, LightModelfv, LightModeli, LightModeliv, LightModelx, LightModelxv, Lightf, Lightfv, Lighti, Lightiv, Lightx, Lightxv, LineStipple, LineWidth, LineWidthx, LinkProgram, ListBase, LoadIdentity, LoadMatrixd, LoadMatrixf, LoadMatrixx, LoadName, LoadPaletteFromModelViewMatrixOES, LoadTransposeMatrixd, LoadTransposeMatrixf, LogicOp, LoseContextCHROMIUM, Map1d, Map1f, Map2d, Map2f, MapBuffer, MapBufferOES, MapBufferRange, MapBufferRangeEXT, MapGrid1d, MapGrid1f, MapGrid2d, MapGrid2f, MapNamedBuffer, MapNamedBufferRange, Materialf, Materialfv, Materiali, Materialiv, Materialx, Materialxv, MatrixIndexPointerOES, MatrixMode, MaxShaderCompilerThreadsKHR, MemoryBarrier, MemoryBarrierByRegion, MemoryObjectParameterivEXT, MinSampleShading, MultMatrixd, MultMatrixf, MultMatrixx, MultTransposeMatrixd, MultTransposeMatrixf, MultiDrawArrays, MultiDrawArraysANGLE, MultiDrawArraysIndirect, MultiDrawArraysIndirectCount, MultiDrawArraysInstancedANGLE, MultiDrawArraysInstancedBaseInstanceANGLE, MultiDrawElements, MultiDrawElementsANGLE, MultiDrawElementsBaseVertex, MultiDrawElementsBaseVertexEXT, MultiDrawElementsIndirect, MultiDrawElementsIndirectCount, MultiDrawElementsInstancedANGLE, MultiDrawElementsInstancedBaseVertexBaseInstanceANGLE, MultiTexCoord1d, MultiTexCoord1dv, MultiTexCoord1f, MultiTexCoord1fv, MultiTexCoord1i, MultiTexCoord1iv, MultiTexCoord1s, MultiTexCoord1sv, MultiTexCoord2d, MultiTexCoord2dv, MultiTexCoord2f, MultiTexCoord2fv, MultiTexCoord2i, MultiTexCoord2iv, MultiTexCoord2s, MultiTexCoord2sv, MultiTexCoord3d, MultiTexCoord3dv, MultiTexCoord3f, MultiTexCoord3fv, MultiTexCoord3i, MultiTexCoord3iv, MultiTexCoord3s, MultiTexCoord3sv, MultiTexCoord4d, MultiTexCoord4dv, MultiTexCoord4f, MultiTexCoord4fv, MultiTexCoord4i, MultiTexCoord4iv, MultiTexCoord4s, MultiTexCoord4sv, MultiTexCoord4x, MultiTexCoordP1ui, MultiTexCoordP1uiv, MultiTexCoordP2ui, MultiTexCoordP2uiv, MultiTexCoordP3ui, MultiTexCoordP3uiv, MultiTexCoordP4ui, MultiTexCoordP4uiv, NamedBufferData, NamedBufferStorage, NamedBufferSubData, NamedFramebufferDrawBuffer, NamedFramebufferDrawBuffers, NamedFramebufferParameteri, NamedFramebufferReadBuffer, NamedFramebufferRenderbuffer, NamedFramebufferTexture, NamedFramebufferTextureLayer, NamedRenderbufferStorage, NamedRenderbufferStorageMultisample, NewList, Normal3b, Normal3bv, Normal3d, Normal3dv, Normal3f, Normal3fv, Normal3i, Normal3iv, Normal3s, Normal3sv, Normal3x, NormalP3ui, NormalP3uiv, NormalPointer, ObjectLabel, ObjectLabelKHR, ObjectPtrLabel, ObjectPtrLabelKHR, Ortho, Orthof, Orthox, PassThrough, PatchParameterfv, PatchParameteri, PauseTransformFeedback, PixelMapfv, PixelMapuiv, PixelMapusv, PixelStoref, PixelStorei, PixelTransferf, PixelTransferi, PixelZoom, PointParameterf, PointParameterfv, PointParameteri, PointParameteriv, PointParameterx, PointParameterxv, PointSize, PointSizePointerOES, PointSizex, PolygonMode, PolygonOffset, PolygonOffsetClamp, PolygonOffsetx, PolygonStipple, PopAttrib, PopClientAttrib, PopDebugGroup, PopDebugGroupKHR, PopGroupMarkerEXT, PopMatrix, PopName, PrimitiveBoundingBox, PrimitiveRestartIndex, PrioritizeTextures, ProgramBinary, ProgramBinaryOES, ProgramParameteri, ProgramUniform1d, ProgramUniform1dv, ProgramUniform1f, ProgramUniform1fv, ProgramUniform1i, ProgramUniform1iv, ProgramUniform1ui, ProgramUniform1uiv, ProgramUniform2d, ProgramUniform2dv, ProgramUniform2f, ProgramUniform2fv, ProgramUniform2i, ProgramUniform2iv, ProgramUniform2ui, ProgramUniform2uiv, ProgramUniform3d, ProgramUniform3dv, ProgramUniform3f, ProgramUniform3fv, ProgramUniform3i, ProgramUniform3iv, ProgramUniform3ui, ProgramUniform3uiv, ProgramUniform4d, ProgramUniform4dv, ProgramUniform4f, ProgramUniform4fv, ProgramUniform4i, ProgramUniform4iv, ProgramUniform4ui, ProgramUniform4uiv, ProgramUniformMatrix2dv, ProgramUniformMatrix2fv, ProgramUniformMatrix2x3dv, ProgramUniformMatrix2x3fv, ProgramUniformMatrix2x4dv, ProgramUniformMatrix2x4fv, ProgramUniformMatrix3dv, ProgramUniformMatrix3fv, ProgramUniformMatrix3x2dv, ProgramUniformMatrix3x2fv, ProgramUniformMatrix3x4dv, ProgramUniformMatrix3x4fv, ProgramUniformMatrix4dv, ProgramUniformMatrix4fv, ProgramUniformMatrix4x2dv, ProgramUniformMatrix4x2fv, ProgramUniformMatrix4x3dv, ProgramUniformMatrix4x3fv, ProvokingVertex, ProvokingVertexANGLE, PushAttrib, PushClientAttrib, PushDebugGroup, PushDebugGroupKHR, PushGroupMarkerEXT, PushMatrix, PushName, QueryCounter, QueryCounterEXT, QueryMatrixxOES, RasterPos2d, RasterPos2dv, RasterPos2f, RasterPos2fv, RasterPos2i, RasterPos2iv, RasterPos2s, RasterPos2sv, RasterPos3d, RasterPos3dv, RasterPos3f, RasterPos3fv, RasterPos3i, RasterPos3iv, RasterPos3s, RasterPos3sv, RasterPos4d, RasterPos4dv, RasterPos4f, RasterPos4fv, RasterPos4i, RasterPos4iv, RasterPos4s, RasterPos4sv, ReadBuffer, ReadPixels, ReadPixelsRobustANGLE, ReadnPixels, ReadnPixelsEXT, ReadnPixelsRobustANGLE, Rectd, Rectdv, Rectf, Rectfv, Recti, Rectiv, Rects, Rectsv, ReleaseShaderCompiler, RenderMode, RenderbufferStorage, RenderbufferStorageMultisample, RenderbufferStorageMultisampleANGLE, RenderbufferStorageMultisampleEXT, RenderbufferStorageOES, RequestExtensionANGLE, ResumeTransformFeedback, Rotated, Rotatef, Rotatex, SampleCoverage, SampleCoveragex, SampleMaski, SampleMaskiANGLE, SamplerParameterIiv, SamplerParameterIivOES, SamplerParameterIivRobustANGLE, SamplerParameterIuiv, SamplerParameterIuivOES, SamplerParameterIuivRobustANGLE, SamplerParameterf, SamplerParameterfv, SamplerParameterfvRobustANGLE, SamplerParameteri, SamplerParameteriv, SamplerParameterivRobustANGLE, Scaled, Scalef, Scalex, Scissor, ScissorArrayv, ScissorIndexed, ScissorIndexedv, SecondaryColor3b, SecondaryColor3bv, SecondaryColor3d, SecondaryColor3dv, SecondaryColor3f, SecondaryColor3fv, SecondaryColor3i, SecondaryColor3iv, SecondaryColor3s, SecondaryColor3sv, SecondaryColor3ub, SecondaryColor3ubv, SecondaryColor3ui, SecondaryColor3uiv, SecondaryColor3us, SecondaryColor3usv, SecondaryColorP3ui, SecondaryColorP3uiv, SecondaryColorPointer, SelectBuffer, SemaphoreParameterui64vEXT, SetFenceNV, ShadeModel, ShaderBinary, ShaderSource, ShaderStorageBlockBinding, SignalSemaphoreEXT, SpecializeShader, StencilFunc, StencilFuncSeparate, StencilMask, StencilMaskSeparate, StencilOp, StencilOpSeparate, TestFenceNV, TexBuffer, TexBufferEXT, TexBufferOES, TexBufferRange, TexBufferRangeEXT, TexBufferRangeOES, TexCoord1d, TexCoord1dv, TexCoord1f, TexCoord1fv, TexCoord1i, TexCoord1iv, TexCoord1s, TexCoord1sv, TexCoord2d, TexCoord2dv, TexCoord2f, TexCoord2fv, TexCoord2i, TexCoord2iv, TexCoord2s, TexCoord2sv, TexCoord3d, TexCoord3dv, TexCoord3f, TexCoord3fv, TexCoord3i, TexCoord3iv, TexCoord3s, TexCoord3sv, TexCoord4d, TexCoord4dv, TexCoord4f, TexCoord4fv, TexCoord4i, TexCoord4iv, TexCoord4s, TexCoord4sv, TexCoordP1ui, TexCoordP1uiv, TexCoordP2ui, TexCoordP2uiv, TexCoordP3ui, TexCoordP3uiv, TexCoordP4ui, TexCoordP4uiv, TexCoordPointer, TexEnvf, TexEnvfv, TexEnvi, TexEnviv, TexEnvx, TexEnvxv, TexGend, TexGendv, TexGenf, TexGenfOES, TexGenfv, TexGenfvOES, TexGeni, TexGeniOES, TexGeniv, TexGenivOES, TexGenxOES, TexGenxvOES, TexImage1D, TexImage2D, TexImage2DExternalANGLE, TexImage2DMultisample, TexImage2DRobustANGLE, TexImage3D, TexImage3DMultisample, TexImage3DOES, TexImage3DRobustANGLE, TexParameterIiv, TexParameterIivOES, TexParameterIivRobustANGLE, TexParameterIuiv, TexParameterIuivOES, TexParameterIuivRobustANGLE, TexParameterf, TexParameterfv, TexParameterfvRobustANGLE, TexParameteri, TexParameteriv, TexParameterivRobustANGLE, TexParameterx, TexParameterxv, TexStorage1D, TexStorage1DEXT, TexStorage2D, TexStorage2DEXT, TexStorage2DMultisample, TexStorage2DMultisampleANGLE, TexStorage3D, TexStorage3DEXT, TexStorage3DMultisample, TexStorage3DMultisampleOES, TexStorageMem2DEXT, TexStorageMem2DMultisampleEXT, TexStorageMem3DEXT, TexStorageMem3DMultisampleEXT, TexStorageMemFlags2DANGLE, TexStorageMemFlags2DMultisampleANGLE, TexStorageMemFlags3DANGLE, TexStorageMemFlags3DMultisampleANGLE, TexSubImage1D, TexSubImage2D, TexSubImage2DRobustANGLE, TexSubImage3D, TexSubImage3DOES, TexSubImage3DRobustANGLE, TextureBarrier, TextureBuffer, TextureBufferRange, TextureParameterIiv, TextureParameterIuiv, TextureParameterf, TextureParameterfv, TextureParameteri, TextureParameteriv, TextureStorage1D, TextureStorage2D, TextureStorage2DMultisample, TextureStorage3D, TextureStorage3DMultisample, TextureSubImage1D, TextureSubImage2D, TextureSubImage3D, TextureView, TransformFeedbackBufferBase, TransformFeedbackBufferRange, TransformFeedbackVaryings, Translated, Translatef, Translatex, Uniform1d, Uniform1dv, Uniform1f, Uniform1fv, Uniform1i, Uniform1iv, Uniform1ui, Uniform1uiv, Uniform2d, Uniform2dv, Uniform2f, Uniform2fv, Uniform2i, Uniform2iv, Uniform2ui, Uniform2uiv, Uniform3d, Uniform3dv, Uniform3f, Uniform3fv, Uniform3i, Uniform3iv, Uniform3ui, Uniform3uiv, Uniform4d, Uniform4dv, Uniform4f, Uniform4fv, Uniform4i, Uniform4iv, Uniform4ui, Uniform4uiv, UniformBlockBinding, UniformMatrix2dv, UniformMatrix2fv, UniformMatrix2x3dv, UniformMatrix2x3fv, UniformMatrix2x4dv, UniformMatrix2x4fv, UniformMatrix3dv, UniformMatrix3fv, UniformMatrix3x2dv, UniformMatrix3x2fv, UniformMatrix3x4dv, UniformMatrix3x4fv, UniformMatrix4dv, UniformMatrix4fv, UniformMatrix4x2dv, UniformMatrix4x2fv, UniformMatrix4x3dv, UniformMatrix4x3fv, UniformSubroutinesuiv, UnmapBuffer, UnmapBufferOES, UnmapNamedBuffer, UseProgram, UseProgramStages, ValidateProgram, ValidateProgramPipeline, Vertex2d, Vertex2dv, Vertex2f, Vertex2fv, Vertex2i, Vertex2iv, Vertex2s, Vertex2sv, Vertex3d, Vertex3dv, Vertex3f, Vertex3fv, Vertex3i, Vertex3iv, Vertex3s, Vertex3sv, Vertex4d, Vertex4dv, Vertex4f, Vertex4fv, Vertex4i, Vertex4iv, Vertex4s, Vertex4sv, VertexArrayAttribBinding, VertexArrayAttribFormat, VertexArrayAttribIFormat, VertexArrayAttribLFormat, VertexArrayBindingDivisor, VertexArrayElementBuffer, VertexArrayVertexBuffer, VertexArrayVertexBuffers, VertexAttrib1d, VertexAttrib1dv, VertexAttrib1f, VertexAttrib1fv, VertexAttrib1s, VertexAttrib1sv, VertexAttrib2d, VertexAttrib2dv, VertexAttrib2f, VertexAttrib2fv, VertexAttrib2s, VertexAttrib2sv, VertexAttrib3d, VertexAttrib3dv, VertexAttrib3f, VertexAttrib3fv, VertexAttrib3s, VertexAttrib3sv, VertexAttrib4Nbv, VertexAttrib4Niv, VertexAttrib4Nsv, VertexAttrib4Nub, VertexAttrib4Nubv, VertexAttrib4Nuiv, VertexAttrib4Nusv, VertexAttrib4bv, VertexAttrib4d, VertexAttrib4dv, VertexAttrib4f, VertexAttrib4fv, VertexAttrib4iv, VertexAttrib4s, VertexAttrib4sv, VertexAttrib4ubv, VertexAttrib4uiv, VertexAttrib4usv, VertexAttribBinding, VertexAttribDivisor, VertexAttribDivisorANGLE, VertexAttribDivisorEXT, VertexAttribFormat, VertexAttribI1i, VertexAttribI1iv, VertexAttribI1ui, VertexAttribI1uiv, VertexAttribI2i, VertexAttribI2iv, VertexAttribI2ui, VertexAttribI2uiv, VertexAttribI3i, VertexAttribI3iv, VertexAttribI3ui, VertexAttribI3uiv, VertexAttribI4bv, VertexAttribI4i, VertexAttribI4iv, VertexAttribI4sv, VertexAttribI4ubv, VertexAttribI4ui, VertexAttribI4uiv, VertexAttribI4usv, VertexAttribIFormat, VertexAttribIPointer, VertexAttribL1d, VertexAttribL1dv, VertexAttribL2d, VertexAttribL2dv, VertexAttribL3d, VertexAttribL3dv, VertexAttribL4d, VertexAttribL4dv, VertexAttribLFormat, VertexAttribLPointer, VertexAttribP1ui, VertexAttribP1uiv, VertexAttribP2ui, VertexAttribP2uiv, VertexAttribP3ui, VertexAttribP3uiv, VertexAttribP4ui, VertexAttribP4uiv, VertexAttribPointer, VertexBindingDivisor, VertexP2ui, VertexP2uiv, VertexP3ui, VertexP3uiv, VertexP4ui, VertexP4uiv, VertexPointer, Viewport, ViewportArrayv, ViewportIndexedf, ViewportIndexedfv, WaitSemaphoreEXT, WaitSync, WeightPointerOES, WindowPos2d, WindowPos2dv, WindowPos2f, WindowPos2fv, WindowPos2i, WindowPos2iv, WindowPos2s, WindowPos2sv, WindowPos3d, WindowPos3dv, WindowPos3f, WindowPos3fv, WindowPos3i, WindowPos3iv, WindowPos3s, WindowPos3sv }; const char *GetEntryPointName(EntryPoint ep); } // namespace gl #endif // LIBANGLE_ENTRY_POINTS_ENUM_AUTOGEN_H_
{ "pile_set_name": "Github" }
/* * This file is part of gtkD. * * gtkD is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 3 * of the License, or (at your option) any later version, with * some exceptions, please read the COPYING file. * * gtkD 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 gtkD; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA */ // generated automatically - do not change // find conversion definition on APILookup.txt // implement new conversion functionalities on the wrap.utils pakage module gstreamer.TocSetterIF; private import gobject.ObjectG; private import gstreamer.Toc; private import gstreamer.c.functions; public import gstreamer.c.types; public import gstreamerc.gstreamertypes; /** * Element interface that allows setting of the TOC. * * Elements that support some kind of chapters or editions (or tracks like in * the FLAC cue sheet) will implement this interface. * * If you just want to retrieve the TOC in your application then all you * need to do is watch for TOC messages on your pipeline's bus (or you can * perform TOC query). This interface is only for setting TOC data, not for * extracting it. To set TOC from the application, find proper tocsetter element * and set TOC using gst_toc_setter_set_toc(). * * Elements implementing the #GstTocSetter interface can extend existing TOC * by getting extend UID for that (you can use gst_toc_find_entry() to retrieve it) * with any TOC entries received from downstream. */ public interface TocSetterIF{ /** Get the main Gtk struct */ public GstTocSetter* getTocSetterStruct(bool transferOwnership = false); /** the main Gtk struct as a void* */ protected void* getStruct(); /** */ public static GType getType() { return gst_toc_setter_get_type(); } /** * Return current TOC the setter uses. The TOC should not be * modified without making it writable first. * * Returns: TOC set, or %NULL. Unref with * gst_toc_unref() when no longer needed */ public Toc getToc(); /** * Reset the internal TOC. Elements should call this from within the * state-change handler. */ public void reset(); /** * Set the given TOC on the setter. Previously set TOC will be * unreffed before setting a new one. * * Params: * toc = a #GstToc to set. */ public void setToc(Toc toc); }
{ "pile_set_name": "Github" }
/** * Copyright (c) 2012 - 2017, Nordic Semiconductor ASA * * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form, except as embedded into a Nordic * Semiconductor ASA integrated circuit in a product or a software update for * such product, must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. Neither the name of Nordic Semiconductor ASA nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * 4. This software, with or without modification, must only be used with a * Nordic Semiconductor ASA integrated circuit. * * 5. Any software provided in binary form under this license must not be reverse * engineered, decompiled, modified and/or disassembled. * * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /** @file * * @defgroup ble_flash_module Flash Manager * @{ * @ingroup ble_sdk_lib * @brief Module for accessing flash memory. * * @details It contains functions for reading, writing and erasing one page in flash. * * The module uses the first 32 bits of the flash page to write a magic number in order to * determine if the page has been written or not. * * @note Be careful not to use a page number in the SoftDevice area (which currently occupies the * range 0 to 127), or in your application space! In both cases, this would end up * with a hard fault. */ #ifndef BLE_FLASH_H__ #define BLE_FLASH_H__ #include <stdint.h> #include <stdbool.h> #include "nrf.h" #ifdef __cplusplus extern "C" { #endif #define BLE_FLASH_PAGE_SIZE ((uint16_t)NRF_FICR->CODEPAGESIZE) /**< Size of one flash page. */ #define BLE_FLASH_MAGIC_NUMBER 0x45DE0000 /**< Magic value to identify if flash contains valid data. */ #define BLE_FLASH_EMPTY_MASK 0xFFFFFFFF /**< Bit mask that defines an empty address in flash. */ /**@brief Macro for getting the end of the flash available for application. * * @details The result flash page number indicates the end boundary of the flash available * to the application. If a bootloader is used, the end will be the start of the * bootloader region. Otherwise, the end will be the size of the flash. */ #define BLE_FLASH_PAGE_END \ ((NRF_UICR->NRFFW[0] != BLE_FLASH_EMPTY_MASK) \ ? (NRF_UICR->NRFFW[0] / BLE_FLASH_PAGE_SIZE) \ : NRF_FICR->CODESIZE) /**@brief Function for erasing the specified flash page, and then writes the given data to this page. * * @warning This operation blocks the CPU. DO NOT use while in a connection! * * @param[in] page_num Page number to update. * @param[in] p_in_array Pointer to a RAM area containing the elements to write in flash. * This area has to be 32 bits aligned. * @param[in] word_count Number of 32 bits words to write in flash. * * @return NRF_SUCCESS on successful flash write, otherwise an error code. */ uint32_t ble_flash_page_write(uint8_t page_num, uint32_t * p_in_array, uint8_t word_count); /**@brief Function for reading data from flash to RAM. * * @param[in] page_num Page number to read. * @param[out] p_out_array Pointer to a RAM area where the found data will be written. * This area has to be 32 bits aligned. * @param[out] p_word_count Number of 32 bits words read. * * @return NRF_SUCCESS on successful upload, NRF_ERROR_NOT_FOUND if no valid data has been found * in flash (first 32 bits not equal to the MAGIC_NUMBER + CRC). */ uint32_t ble_flash_page_read(uint8_t page_num, uint32_t * p_out_array, uint8_t * p_word_count); /**@brief Function for erasing a flash page. * * @note This operation blocks the CPU, so it should not be done while the radio is running! * * @param[in] page_num Page number to erase. * * @return NRF_SUCCESS on success, an error_code otherwise. */ uint32_t ble_flash_page_erase(uint8_t page_num); /**@brief Function for writing one word to flash. * * @note Flash location to be written must have been erased previously. * * @param[in] p_address Pointer to flash location to be written. * @param[in] value Value to write to flash. * * @return NRF_SUCCESS. */ uint32_t ble_flash_word_write(uint32_t * p_address, uint32_t value); /**@brief Function for writing a data block to flash. * * @note Flash locations to be written must have been erased previously. * * @param[in] p_address Pointer to start of flash location to be written. * @param[in] p_in_array Pointer to start of flash block to be written. * @param[in] word_count Number of words to be written. * * @return NRF_SUCCESS. */ uint32_t ble_flash_block_write(uint32_t * p_address, uint32_t * p_in_array, uint16_t word_count); /**@brief Function for computing pointer to start of specified flash page. * * @param[in] page_num Page number. * @param[out] pp_page_addr Pointer to start of flash page. * * @return NRF_SUCCESS. */ uint32_t ble_flash_page_addr(uint8_t page_num, uint32_t ** pp_page_addr); /**@brief Function for calculating a 16 bit CRC using the CRC-16-CCITT scheme. * * @param[in] p_data Pointer to data on which the CRC is to be calculated. * @param[in] size Number of bytes on which the CRC is to be calculated. * @param[in] p_crc Initial CRC value (if NULL, a preset value is used as the initial value). * * @return Calculated CRC. */ uint16_t ble_flash_crc16_compute(uint8_t * p_data, uint16_t size, uint16_t * p_crc); /**@brief Function for handling flashing module Radio Notification event. * * @note For flash writing to work safely while in a connection or while advertising, this function * MUST be called from the Radio Notification module's event handler (see * @ref ble_radio_notification for details). * * @param[in] radio_active TRUE if radio is active (or about to become active), FALSE otherwise. */ void ble_flash_on_radio_active_evt(bool radio_active); #ifdef __cplusplus } #endif #endif // BLE_FLASH_H__ /** @} */
{ "pile_set_name": "Github" }
import com.google.protobuf.ByteString; import com.google.protobuf.CodedInputStream; import com.google.protobuf.conformance.Conformance; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf_test_messages.proto3.TestMessagesProto3; import com.google.protobuf.util.JsonFormat; import com.google.protobuf.util.JsonFormat.TypeRegistry; import java.io.IOException; import java.nio.ByteBuffer; class ConformanceJava { private int testCount = 0; private TypeRegistry typeRegistry; private boolean readFromStdin(byte[] buf, int len) throws Exception { int ofs = 0; while (len > 0) { int read = System.in.read(buf, ofs, len); if (read == -1) { return false; // EOF } ofs += read; len -= read; } return true; } private void writeToStdout(byte[] buf) throws Exception { System.out.write(buf); } // Returns -1 on EOF (the actual values will always be positive). private int readLittleEndianIntFromStdin() throws Exception { byte[] buf = new byte[4]; if (!readFromStdin(buf, 4)) { return -1; } return (buf[0] & 0xff) | ((buf[1] & 0xff) << 8) | ((buf[2] & 0xff) << 16) | ((buf[3] & 0xff) << 24); } private void writeLittleEndianIntToStdout(int val) throws Exception { byte[] buf = new byte[4]; buf[0] = (byte)val; buf[1] = (byte)(val >> 8); buf[2] = (byte)(val >> 16); buf[3] = (byte)(val >> 24); writeToStdout(buf); } private enum BinaryDecoder { BYTE_STRING_DECODER() { @Override public TestMessagesProto3.TestAllTypes parse(ByteString bytes) throws InvalidProtocolBufferException { return TestMessagesProto3.TestAllTypes.parseFrom(bytes); } }, BYTE_ARRAY_DECODER() { @Override public TestMessagesProto3.TestAllTypes parse(ByteString bytes) throws InvalidProtocolBufferException { return TestMessagesProto3.TestAllTypes.parseFrom(bytes.toByteArray()); } }, ARRAY_BYTE_BUFFER_DECODER() { @Override public TestMessagesProto3.TestAllTypes parse(ByteString bytes) throws InvalidProtocolBufferException { ByteBuffer buffer = ByteBuffer.allocate(bytes.size()); bytes.copyTo(buffer); buffer.flip(); try { return TestMessagesProto3.TestAllTypes.parseFrom(CodedInputStream.newInstance(buffer)); } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException( "ByteString based ByteBuffer should not throw IOException.", e); } } }, READONLY_ARRAY_BYTE_BUFFER_DECODER() { @Override public TestMessagesProto3.TestAllTypes parse(ByteString bytes) throws InvalidProtocolBufferException { try { return TestMessagesProto3.TestAllTypes.parseFrom( CodedInputStream.newInstance(bytes.asReadOnlyByteBuffer())); } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException( "ByteString based ByteBuffer should not throw IOException.", e); } } }, DIRECT_BYTE_BUFFER_DECODER() { @Override public TestMessagesProto3.TestAllTypes parse(ByteString bytes) throws InvalidProtocolBufferException { ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); bytes.copyTo(buffer); buffer.flip(); try { return TestMessagesProto3.TestAllTypes.parseFrom(CodedInputStream.newInstance(buffer)); } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException( "ByteString based ByteBuffer should not throw IOException.", e); } } }, READONLY_DIRECT_BYTE_BUFFER_DECODER() { @Override public TestMessagesProto3.TestAllTypes parse(ByteString bytes) throws InvalidProtocolBufferException { ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); bytes.copyTo(buffer); buffer.flip(); try { return TestMessagesProto3.TestAllTypes.parseFrom( CodedInputStream.newInstance(buffer.asReadOnlyBuffer())); } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException( "ByteString based ByteBuffer should not throw IOException.", e); } } }, INPUT_STREAM_DECODER() { @Override public TestMessagesProto3.TestAllTypes parse(ByteString bytes) throws InvalidProtocolBufferException { try { return TestMessagesProto3.TestAllTypes.parseFrom(bytes.newInput()); } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException( "ByteString based InputStream should not throw IOException.", e); } } }; public abstract TestMessagesProto3.TestAllTypes parse(ByteString bytes) throws InvalidProtocolBufferException; } private TestMessagesProto3.TestAllTypes parseBinary(ByteString bytes) throws InvalidProtocolBufferException { TestMessagesProto3.TestAllTypes[] messages = new TestMessagesProto3.TestAllTypes[BinaryDecoder.values().length]; InvalidProtocolBufferException[] exceptions = new InvalidProtocolBufferException[BinaryDecoder.values().length]; boolean hasMessage = false; boolean hasException = false; for (int i = 0; i < BinaryDecoder.values().length; ++i) { try { messages[i] = BinaryDecoder.values()[i].parse(bytes); hasMessage = true; } catch (InvalidProtocolBufferException e) { exceptions[i] = e; hasException = true; } } if (hasMessage && hasException) { StringBuilder sb = new StringBuilder("Binary decoders disagreed on whether the payload was valid.\n"); for (int i = 0; i < BinaryDecoder.values().length; ++i) { sb.append(BinaryDecoder.values()[i].name()); if (messages[i] != null) { sb.append(" accepted the payload.\n"); } else { sb.append(" rejected the payload.\n"); } } throw new RuntimeException(sb.toString()); } if (hasException) { // We do not check if exceptions are equal. Different implementations may return different // exception messages. Throw an arbitrary one out instead. throw exceptions[0]; } // Fast path comparing all the messages with the first message, assuming equality being // symmetric and transitive. boolean allEqual = true; for (int i = 1; i < messages.length; ++i) { if (!messages[0].equals(messages[i])) { allEqual = false; break; } } // Slow path: compare and find out all unequal pairs. if (!allEqual) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < messages.length - 1; ++i) { for (int j = i + 1; j < messages.length; ++j) { if (!messages[i].equals(messages[j])) { sb.append(BinaryDecoder.values()[i].name()) .append(" and ") .append(BinaryDecoder.values()[j].name()) .append(" parsed the payload differently.\n"); } } } throw new RuntimeException(sb.toString()); } return messages[0]; } private Conformance.ConformanceResponse doTest(Conformance.ConformanceRequest request) { TestMessagesProto3.TestAllTypes testMessage; switch (request.getPayloadCase()) { case PROTOBUF_PAYLOAD: { try { testMessage = parseBinary(request.getProtobufPayload()); } catch (InvalidProtocolBufferException e) { return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build(); } break; } case JSON_PAYLOAD: { try { TestMessagesProto3.TestAllTypes.Builder builder = TestMessagesProto3.TestAllTypes.newBuilder(); JsonFormat.parser().usingTypeRegistry(typeRegistry) .merge(request.getJsonPayload(), builder); testMessage = builder.build(); } catch (InvalidProtocolBufferException e) { return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build(); } break; } case PAYLOAD_NOT_SET: { throw new RuntimeException("Request didn't have payload."); } default: { throw new RuntimeException("Unexpected payload case."); } } switch (request.getRequestedOutputFormat()) { case UNSPECIFIED: throw new RuntimeException("Unspecified output format."); case PROTOBUF: return Conformance.ConformanceResponse.newBuilder().setProtobufPayload(testMessage.toByteString()).build(); case JSON: try { return Conformance.ConformanceResponse.newBuilder().setJsonPayload( JsonFormat.printer().usingTypeRegistry(typeRegistry).print(testMessage)).build(); } catch (InvalidProtocolBufferException | IllegalArgumentException e) { return Conformance.ConformanceResponse.newBuilder().setSerializeError( e.getMessage()).build(); } default: { throw new RuntimeException("Unexpected request output."); } } } private boolean doTestIo() throws Exception { int bytes = readLittleEndianIntFromStdin(); if (bytes == -1) { return false; // EOF } byte[] serializedInput = new byte[bytes]; if (!readFromStdin(serializedInput, bytes)) { throw new RuntimeException("Unexpected EOF from test program."); } Conformance.ConformanceRequest request = Conformance.ConformanceRequest.parseFrom(serializedInput); Conformance.ConformanceResponse response = doTest(request); byte[] serializedOutput = response.toByteArray(); writeLittleEndianIntToStdout(serializedOutput.length); writeToStdout(serializedOutput); return true; } public void run() throws Exception { typeRegistry = TypeRegistry.newBuilder().add( TestMessagesProto3.TestAllTypes.getDescriptor()).build(); while (doTestIo()) { this.testCount++; } System.err.println("ConformanceJava: received EOF from test runner after " + this.testCount + " tests"); } public static void main(String[] args) throws Exception { new ConformanceJava().run(); } }
{ "pile_set_name": "Github" }
How to run the website: ``` yarn yarn start ``` If you want to run both the website and the playground: ``` cd ../build cmake .. ninja skip_to_native skip_to_js skip_printer skip_to_ast skip_to_parsetree cd ../website yarn cd playground yarn yarn build cd .. ./run-all.sh ``` For the above to work, please use a node version >4.8.0. Try /usr/bin/node/ or /bin/node. To extract standard lib documentation: ``` ./extract-docs.sh ```
{ "pile_set_name": "Github" }
{ "ecmul_7827-6598_0_21000_96_d0g0v0_Istanbul" : { "_info" : { "comment" : "Puts the point (11999875504842010600789954262886096740416429265635183817701593963271973497827, 11843594000332171325303933275547366297934113019079887694534126289021216356598) and the factor 0 into the ECMUL precompile, truncating or expanding the input data to 96 bytes. Gives the execution 21000 bytes", "filling-rpc-server" : "Geth-1.9.6-unstable-63b18027-20190920", "filling-tool-version" : "retesteth-0.0.1+commit.0ae18aef.Linux.g++", "lllcversion" : "Version: 0.5.12-develop.2019.9.13+commit.2d601a4f.Linux.g++", "source" : "src/GeneralStateTestsFiller/stZeroKnowledge/ecmul_7827-6598_0_21000_96Filler.json", "sourceHash" : "467797f3e67e16d28945bbcf8f7cc28c2e89b0b60a2bccb47cbc6a5939f8c2f2" }, "genesisBlockHeader" : { "bloom" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "coinbase" : "0x3535353535353535353535353535353535353535", "difficulty" : "0x20000", "extraData" : "0x00", "gasLimit" : "0x5f5e100", "gasUsed" : "0x0", "hash" : "0x3363716d83d9915c3eda6e08ad4255e8ed8cb8e45dfd3f9bcbfdc3ab0109c7b8", "mixHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce" : "0x0000000000000000", "number" : "0x0", "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "stateRoot" : "0x1e4d8647fd838e80a081a069c14e553fc488531e005a7d3e0925104d43b0fee1", "timestamp" : "0x0", "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, "pre" : { "0x0000000000000000000000000000000000000000" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000001" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000002" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000003" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000004" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000005" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000006" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000007" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x10a1c1cb95c92ec31d3f22c66eef1d9f3f258c6b" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x13cbb8d99c6c4e0f2728c7d72606e78a29c4e224" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x24143873e0e0815fdcbcffdbe09c979cbf9ad013" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x3535353535353535353535353535353535353535" : { "balance" : "0x0892ee", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x598443f1880ef585b21f1d7585bd0577402861e5" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x77db2bebba79db42a978f896968f4afce746ea1f" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x7d577a597b2742b498cb5cf0c26cdcd726d39e6e" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1" : { "balance" : "0x0de0b6b3a75b6d12", "code" : "0x", "nonce" : "0x0b", "storage" : { } }, "0x90f0b1ebbba1c1936aff7aaf20a7878ff9e04b6c" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0xc305c901078781c232a2a521c2af7980f8385ee9" : { "balance" : "0x00", "code" : "0x600035601c52740100000000000000000000000000000000000000006020526fffffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff000000000000000000000000000000016060527402540be3fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffdabf41c00000000000000000000000002540be40060a0526330c8d1da600051141561012b5760c06004356004013511151558576004356004013560200160043560040161014037604061026061014051610160600060076305f5e0fff11558576040610240526102406060806102c0828460006004601bf15050506102c08051602082012090506000556102c060206020820352604081510160206001820306601f820103905060208203f350005b", "nonce" : "0x01", "storage" : { } }, "0xdceceaf3fc5c0a63d195d69b1a90011b7b19650d" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0xe0fc04fa2d34a66b779fd5cee748268032a146c0" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } } }, "postState" : { "0x24143873e0e0815fdcbcffdbe09c979cbf9ad013" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x0000000000000000000000000000000000000001" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0xdceceaf3fc5c0a63d195d69b1a90011b7b19650d" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0xc305c901078781c232a2a521c2af7980f8385ee9" : { "code" : "0x600035601c52740100000000000000000000000000000000000000006020526fffffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff000000000000000000000000000000016060527402540be3fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffdabf41c00000000000000000000000002540be40060a0526330c8d1da600051141561012b5760c06004356004013511151558576004356004013560200160043560040161014037604061026061014051610160600060076305f5e0fff11558576040610240526102406060806102c0828460006004601bf15050506102c08051602082012090506000556102c060206020820352604081510160206001820306601f820103905060208203f350005b", "nonce" : "0x01", "balance" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000005" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x13cbb8d99c6c4e0f2728c7d72606e78a29c4e224" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x0000000000000000000000000000000000000000" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x0000000000000000000000000000000000000003" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1" : { "code" : "0x", "nonce" : "0x0c", "balance" : "0x0de0b6b3a75ab532", "storage" : { } }, "0x0000000000000000000000000000000000000006" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x0000000000000000000000000000000000000007" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x598443f1880ef585b21f1d7585bd0577402861e5" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x7d577a597b2742b498cb5cf0c26cdcd726d39e6e" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x0000000000000000000000000000000000000004" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0xe0fc04fa2d34a66b779fd5cee748268032a146c0" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x3535353535353535353535353535353535353535" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x1bc16d674ed14ace", "storage" : { } }, "0x0000000000000000000000000000000000000002" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x77db2bebba79db42a978f896968f4afce746ea1f" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x10a1c1cb95c92ec31d3f22c66eef1d9f3f258c6b" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x90f0b1ebbba1c1936aff7aaf20a7878ff9e04b6c" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } } }, "network" : "Istanbul", "sealEngine" : "NoProof", "lastblockhash" : "0x2013a93367c446f778bf453ace99874a0f100b0a3120540dfdd0346d19a5d838", "genesisRLP" : "0xf901f9f901f4a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347943535353535353535353535353535353535353535a01e4d8647fd838e80a081a069c14e553fc488531e005a7d3e0925104d43b0fee1a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000083020000808405f5e100808000a00000000000000000000000000000000000000000000000000000000000000000880000000000000000c0c0", "blocks" : [ { "rlp" : "0xf90306f901f8a03363716d83d9915c3eda6e08ad4255e8ed8cb8e45dfd3f9bcbfdc3ab0109c7b8a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347943535353535353535353535353535353535353535a00ffb9a5616b98699c61f9f3db31003d81c57ecd104a02b3247fc89b5540b9f74a0565a7cfd50830cade1dc3aed7aee95d731fc97f083f101f2067db001735032bba08e7deb3d0b8cecf470155a1939ccb5eba1e89f6148bf1d4136cb529a4d00701bb901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000083020000018405f75e7782b7e08203e800a00000000000000000000000000000000000000000000000000000000000000000880000000000000000f90107f901040b0182b7e094c305c901078781c232a2a521c2af7980f8385ee980b8a430c8d1da000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000601a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe31a2f3c951f6dadcc7ee9007dff81504b0fcd6d7cf59996efdc33d92bf7f9f8f600000000000000000000000000000000000000000000000000000000000000001ca01d6f3d86c9b53419d31f019a4d20e4a08effc9029ea1e489b57d95450105f75ea043a2c5ad258f85880f17a74c84de12c1170f484e8ee57c848e1cc861373a6ef4c0", "blockHeader" : { "bloom" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "coinbase" : "0x3535353535353535353535353535353535353535", "difficulty" : "0x20000", "extraData" : "0x00", "gasLimit" : "0x5f75e77", "gasUsed" : "0xb7e0", "hash" : "0x2013a93367c446f778bf453ace99874a0f100b0a3120540dfdd0346d19a5d838", "mixHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce" : "0x0000000000000000", "number" : "0x1", "parentHash" : "0x3363716d83d9915c3eda6e08ad4255e8ed8cb8e45dfd3f9bcbfdc3ab0109c7b8", "receiptTrie" : "0x8e7deb3d0b8cecf470155a1939ccb5eba1e89f6148bf1d4136cb529a4d00701b", "stateRoot" : "0x0ffb9a5616b98699c61f9f3db31003d81c57ecd104a02b3247fc89b5540b9f74", "timestamp" : "0x3e8", "transactionsTrie" : "0x565a7cfd50830cade1dc3aed7aee95d731fc97f083f101f2067db001735032bb", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, "transactions" : [ { "data" : "0x30c8d1da000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000601a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe31a2f3c951f6dadcc7ee9007dff81504b0fcd6d7cf59996efdc33d92bf7f9f8f60000000000000000000000000000000000000000000000000000000000000000", "gasLimit" : "0xb7e0", "gasPrice" : "0x01", "nonce" : "0x0b", "to" : "0xc305c901078781c232a2a521c2af7980f8385ee9", "value" : "0x", "v" : "0x1c", "r" : "0x1d6f3d86c9b53419d31f019a4d20e4a08effc9029ea1e489b57d95450105f75e", "s" : "0x43a2c5ad258f85880f17a74c84de12c1170f484e8ee57c848e1cc861373a6ef4" } ] } ] }, "ecmul_7827-6598_0_21000_96_d0g1v0_Istanbul" : { "_info" : { "comment" : "Puts the point (11999875504842010600789954262886096740416429265635183817701593963271973497827, 11843594000332171325303933275547366297934113019079887694534126289021216356598) and the factor 0 into the ECMUL precompile, truncating or expanding the input data to 96 bytes. Gives the execution 21000 bytes", "filling-rpc-server" : "Geth-1.9.6-unstable-63b18027-20190920", "filling-tool-version" : "retesteth-0.0.1+commit.0ae18aef.Linux.g++", "lllcversion" : "Version: 0.5.12-develop.2019.9.13+commit.2d601a4f.Linux.g++", "source" : "src/GeneralStateTestsFiller/stZeroKnowledge/ecmul_7827-6598_0_21000_96Filler.json", "sourceHash" : "467797f3e67e16d28945bbcf8f7cc28c2e89b0b60a2bccb47cbc6a5939f8c2f2" }, "genesisBlockHeader" : { "bloom" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "coinbase" : "0x3535353535353535353535353535353535353535", "difficulty" : "0x20000", "extraData" : "0x00", "gasLimit" : "0x5f5e100", "gasUsed" : "0x0", "hash" : "0x3363716d83d9915c3eda6e08ad4255e8ed8cb8e45dfd3f9bcbfdc3ab0109c7b8", "mixHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce" : "0x0000000000000000", "number" : "0x0", "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "stateRoot" : "0x1e4d8647fd838e80a081a069c14e553fc488531e005a7d3e0925104d43b0fee1", "timestamp" : "0x0", "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, "pre" : { "0x0000000000000000000000000000000000000000" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000001" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000002" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000003" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000004" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000005" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000006" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000007" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x10a1c1cb95c92ec31d3f22c66eef1d9f3f258c6b" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x13cbb8d99c6c4e0f2728c7d72606e78a29c4e224" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x24143873e0e0815fdcbcffdbe09c979cbf9ad013" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x3535353535353535353535353535353535353535" : { "balance" : "0x0892ee", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x598443f1880ef585b21f1d7585bd0577402861e5" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x77db2bebba79db42a978f896968f4afce746ea1f" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x7d577a597b2742b498cb5cf0c26cdcd726d39e6e" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1" : { "balance" : "0x0de0b6b3a75b6d12", "code" : "0x", "nonce" : "0x0b", "storage" : { } }, "0x90f0b1ebbba1c1936aff7aaf20a7878ff9e04b6c" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0xc305c901078781c232a2a521c2af7980f8385ee9" : { "balance" : "0x00", "code" : "0x600035601c52740100000000000000000000000000000000000000006020526fffffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff000000000000000000000000000000016060527402540be3fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffdabf41c00000000000000000000000002540be40060a0526330c8d1da600051141561012b5760c06004356004013511151558576004356004013560200160043560040161014037604061026061014051610160600060076305f5e0fff11558576040610240526102406060806102c0828460006004601bf15050506102c08051602082012090506000556102c060206020820352604081510160206001820306601f820103905060208203f350005b", "nonce" : "0x01", "storage" : { } }, "0xdceceaf3fc5c0a63d195d69b1a90011b7b19650d" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0xe0fc04fa2d34a66b779fd5cee748268032a146c0" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } } }, "postState" : { "0x24143873e0e0815fdcbcffdbe09c979cbf9ad013" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x0000000000000000000000000000000000000001" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0xdceceaf3fc5c0a63d195d69b1a90011b7b19650d" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0xc305c901078781c232a2a521c2af7980f8385ee9" : { "code" : "0x600035601c52740100000000000000000000000000000000000000006020526fffffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff000000000000000000000000000000016060527402540be3fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffdabf41c00000000000000000000000002540be40060a0526330c8d1da600051141561012b5760c06004356004013511151558576004356004013560200160043560040161014037604061026061014051610160600060076305f5e0fff11558576040610240526102406060806102c0828460006004601bf15050506102c08051602082012090506000556102c060206020820352604081510160206001820306601f820103905060208203f350005b", "nonce" : "0x01", "balance" : "0x00", "storage" : { "0x00" : "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5" } }, "0x0000000000000000000000000000000000000005" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x13cbb8d99c6c4e0f2728c7d72606e78a29c4e224" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x0000000000000000000000000000000000000000" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x0000000000000000000000000000000000000003" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1" : { "code" : "0x", "nonce" : "0x0c", "balance" : "0x0de0b6b3a75aa845", "storage" : { } }, "0x0000000000000000000000000000000000000006" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x0000000000000000000000000000000000000007" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x598443f1880ef585b21f1d7585bd0577402861e5" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x7d577a597b2742b498cb5cf0c26cdcd726d39e6e" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x0000000000000000000000000000000000000004" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0xe0fc04fa2d34a66b779fd5cee748268032a146c0" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x3535353535353535353535353535353535353535" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x1bc16d674ed157bb", "storage" : { } }, "0x0000000000000000000000000000000000000002" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x77db2bebba79db42a978f896968f4afce746ea1f" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x10a1c1cb95c92ec31d3f22c66eef1d9f3f258c6b" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x90f0b1ebbba1c1936aff7aaf20a7878ff9e04b6c" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } } }, "network" : "Istanbul", "sealEngine" : "NoProof", "lastblockhash" : "0x37871f76b1cf7a4b2439e3bb3100720e0046e9910883d333f4c2b03445d1b71d", "genesisRLP" : "0xf901f9f901f4a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347943535353535353535353535353535353535353535a01e4d8647fd838e80a081a069c14e553fc488531e005a7d3e0925104d43b0fee1a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000083020000808405f5e100808000a00000000000000000000000000000000000000000000000000000000000000000880000000000000000c0c0", "blocks" : [ { "rlp" : "0xf90307f901f8a03363716d83d9915c3eda6e08ad4255e8ed8cb8e45dfd3f9bcbfdc3ab0109c7b8a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347943535353535353535353535353535353535353535a06b0bf58ea08ac271f14054aed262fcf74aa901cd002668535cb6aa31b8c56215a0e8af1424058b254933e335844d9adf634c59811e7aaec50bf4fb713145b50118a0731c30ab6d4b860e14db981ba4cebafaed2879feb329524702f8ee7d9bfc3cd0b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000083020000018405f75e7782c4cd8203e800a00000000000000000000000000000000000000000000000000000000000000000880000000000000000f90108f901050b0183015f9094c305c901078781c232a2a521c2af7980f8385ee980b8a430c8d1da000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000601a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe31a2f3c951f6dadcc7ee9007dff81504b0fcd6d7cf59996efdc33d92bf7f9f8f600000000000000000000000000000000000000000000000000000000000000001ca003282020ad903471d3469093a864a174da5c1876ddf43b91d65645c46b785f74a05ebe49ff31a2f02a78dce0aa899fccd6a8cfed5e03b0bcad3e670be2044c63d9c0", "blockHeader" : { "bloom" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "coinbase" : "0x3535353535353535353535353535353535353535", "difficulty" : "0x20000", "extraData" : "0x00", "gasLimit" : "0x5f75e77", "gasUsed" : "0xc4cd", "hash" : "0x37871f76b1cf7a4b2439e3bb3100720e0046e9910883d333f4c2b03445d1b71d", "mixHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce" : "0x0000000000000000", "number" : "0x1", "parentHash" : "0x3363716d83d9915c3eda6e08ad4255e8ed8cb8e45dfd3f9bcbfdc3ab0109c7b8", "receiptTrie" : "0x731c30ab6d4b860e14db981ba4cebafaed2879feb329524702f8ee7d9bfc3cd0", "stateRoot" : "0x6b0bf58ea08ac271f14054aed262fcf74aa901cd002668535cb6aa31b8c56215", "timestamp" : "0x3e8", "transactionsTrie" : "0xe8af1424058b254933e335844d9adf634c59811e7aaec50bf4fb713145b50118", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, "transactions" : [ { "data" : "0x30c8d1da000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000601a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe31a2f3c951f6dadcc7ee9007dff81504b0fcd6d7cf59996efdc33d92bf7f9f8f60000000000000000000000000000000000000000000000000000000000000000", "gasLimit" : "0x015f90", "gasPrice" : "0x01", "nonce" : "0x0b", "to" : "0xc305c901078781c232a2a521c2af7980f8385ee9", "value" : "0x", "v" : "0x1c", "r" : "0x03282020ad903471d3469093a864a174da5c1876ddf43b91d65645c46b785f74", "s" : "0x5ebe49ff31a2f02a78dce0aa899fccd6a8cfed5e03b0bcad3e670be2044c63d9" } ] } ] }, "ecmul_7827-6598_0_21000_96_d0g2v0_Istanbul" : { "_info" : { "comment" : "Puts the point (11999875504842010600789954262886096740416429265635183817701593963271973497827, 11843594000332171325303933275547366297934113019079887694534126289021216356598) and the factor 0 into the ECMUL precompile, truncating or expanding the input data to 96 bytes. Gives the execution 21000 bytes", "filling-rpc-server" : "Geth-1.9.6-unstable-63b18027-20190920", "filling-tool-version" : "retesteth-0.0.1+commit.0ae18aef.Linux.g++", "lllcversion" : "Version: 0.5.12-develop.2019.9.13+commit.2d601a4f.Linux.g++", "source" : "src/GeneralStateTestsFiller/stZeroKnowledge/ecmul_7827-6598_0_21000_96Filler.json", "sourceHash" : "467797f3e67e16d28945bbcf8f7cc28c2e89b0b60a2bccb47cbc6a5939f8c2f2" }, "genesisBlockHeader" : { "bloom" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "coinbase" : "0x3535353535353535353535353535353535353535", "difficulty" : "0x20000", "extraData" : "0x00", "gasLimit" : "0x5f5e100", "gasUsed" : "0x0", "hash" : "0x3363716d83d9915c3eda6e08ad4255e8ed8cb8e45dfd3f9bcbfdc3ab0109c7b8", "mixHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce" : "0x0000000000000000", "number" : "0x0", "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "stateRoot" : "0x1e4d8647fd838e80a081a069c14e553fc488531e005a7d3e0925104d43b0fee1", "timestamp" : "0x0", "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, "pre" : { "0x0000000000000000000000000000000000000000" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000001" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000002" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000003" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000004" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000005" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000006" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000007" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x10a1c1cb95c92ec31d3f22c66eef1d9f3f258c6b" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x13cbb8d99c6c4e0f2728c7d72606e78a29c4e224" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x24143873e0e0815fdcbcffdbe09c979cbf9ad013" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x3535353535353535353535353535353535353535" : { "balance" : "0x0892ee", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x598443f1880ef585b21f1d7585bd0577402861e5" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x77db2bebba79db42a978f896968f4afce746ea1f" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x7d577a597b2742b498cb5cf0c26cdcd726d39e6e" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1" : { "balance" : "0x0de0b6b3a75b6d12", "code" : "0x", "nonce" : "0x0b", "storage" : { } }, "0x90f0b1ebbba1c1936aff7aaf20a7878ff9e04b6c" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0xc305c901078781c232a2a521c2af7980f8385ee9" : { "balance" : "0x00", "code" : "0x600035601c52740100000000000000000000000000000000000000006020526fffffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff000000000000000000000000000000016060527402540be3fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffdabf41c00000000000000000000000002540be40060a0526330c8d1da600051141561012b5760c06004356004013511151558576004356004013560200160043560040161014037604061026061014051610160600060076305f5e0fff11558576040610240526102406060806102c0828460006004601bf15050506102c08051602082012090506000556102c060206020820352604081510160206001820306601f820103905060208203f350005b", "nonce" : "0x01", "storage" : { } }, "0xdceceaf3fc5c0a63d195d69b1a90011b7b19650d" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0xe0fc04fa2d34a66b779fd5cee748268032a146c0" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } } }, "postState" : { "0x24143873e0e0815fdcbcffdbe09c979cbf9ad013" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x0000000000000000000000000000000000000001" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0xdceceaf3fc5c0a63d195d69b1a90011b7b19650d" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0xc305c901078781c232a2a521c2af7980f8385ee9" : { "code" : "0x600035601c52740100000000000000000000000000000000000000006020526fffffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff000000000000000000000000000000016060527402540be3fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffdabf41c00000000000000000000000002540be40060a0526330c8d1da600051141561012b5760c06004356004013511151558576004356004013560200160043560040161014037604061026061014051610160600060076305f5e0fff11558576040610240526102406060806102c0828460006004601bf15050506102c08051602082012090506000556102c060206020820352604081510160206001820306601f820103905060208203f350005b", "nonce" : "0x01", "balance" : "0x00", "storage" : { "0x00" : "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5" } }, "0x0000000000000000000000000000000000000005" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x13cbb8d99c6c4e0f2728c7d72606e78a29c4e224" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x0000000000000000000000000000000000000000" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x0000000000000000000000000000000000000003" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1" : { "code" : "0x", "nonce" : "0x0c", "balance" : "0x0de0b6b3a75aa845", "storage" : { } }, "0x0000000000000000000000000000000000000006" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x0000000000000000000000000000000000000007" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x598443f1880ef585b21f1d7585bd0577402861e5" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x7d577a597b2742b498cb5cf0c26cdcd726d39e6e" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x0000000000000000000000000000000000000004" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0xe0fc04fa2d34a66b779fd5cee748268032a146c0" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x3535353535353535353535353535353535353535" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x1bc16d674ed157bb", "storage" : { } }, "0x0000000000000000000000000000000000000002" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x77db2bebba79db42a978f896968f4afce746ea1f" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x10a1c1cb95c92ec31d3f22c66eef1d9f3f258c6b" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x90f0b1ebbba1c1936aff7aaf20a7878ff9e04b6c" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } } }, "network" : "Istanbul", "sealEngine" : "NoProof", "lastblockhash" : "0x96edf3fe8463a2ad0be84082d1d087c9e9d7d2d9df21144f5e420bf33c9c95c6", "genesisRLP" : "0xf901f9f901f4a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347943535353535353535353535353535353535353535a01e4d8647fd838e80a081a069c14e553fc488531e005a7d3e0925104d43b0fee1a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000083020000808405f5e100808000a00000000000000000000000000000000000000000000000000000000000000000880000000000000000c0c0", "blocks" : [ { "rlp" : "0xf90307f901f8a03363716d83d9915c3eda6e08ad4255e8ed8cb8e45dfd3f9bcbfdc3ab0109c7b8a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347943535353535353535353535353535353535353535a06b0bf58ea08ac271f14054aed262fcf74aa901cd002668535cb6aa31b8c56215a0040feab6688fbd736671703bb6f483da504fd0a2f31621b4c1c89d8044d8c1dea0731c30ab6d4b860e14db981ba4cebafaed2879feb329524702f8ee7d9bfc3cd0b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000083020000018405f75e7782c4cd8203e800a00000000000000000000000000000000000000000000000000000000000000000880000000000000000f90108f901050b018301adb094c305c901078781c232a2a521c2af7980f8385ee980b8a430c8d1da000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000601a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe31a2f3c951f6dadcc7ee9007dff81504b0fcd6d7cf59996efdc33d92bf7f9f8f600000000000000000000000000000000000000000000000000000000000000001ca03d25569bfa827a48f76ea7a365a8894afb853c8a563e35f607b5c9c98ca525afa03255bb4a71fc5f275d9fd0416c6d2cb82ff56d1fbfd89bc5f40b3b2e135a8e89c0", "blockHeader" : { "bloom" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "coinbase" : "0x3535353535353535353535353535353535353535", "difficulty" : "0x20000", "extraData" : "0x00", "gasLimit" : "0x5f75e77", "gasUsed" : "0xc4cd", "hash" : "0x96edf3fe8463a2ad0be84082d1d087c9e9d7d2d9df21144f5e420bf33c9c95c6", "mixHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce" : "0x0000000000000000", "number" : "0x1", "parentHash" : "0x3363716d83d9915c3eda6e08ad4255e8ed8cb8e45dfd3f9bcbfdc3ab0109c7b8", "receiptTrie" : "0x731c30ab6d4b860e14db981ba4cebafaed2879feb329524702f8ee7d9bfc3cd0", "stateRoot" : "0x6b0bf58ea08ac271f14054aed262fcf74aa901cd002668535cb6aa31b8c56215", "timestamp" : "0x3e8", "transactionsTrie" : "0x040feab6688fbd736671703bb6f483da504fd0a2f31621b4c1c89d8044d8c1de", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, "transactions" : [ { "data" : "0x30c8d1da000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000601a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe31a2f3c951f6dadcc7ee9007dff81504b0fcd6d7cf59996efdc33d92bf7f9f8f60000000000000000000000000000000000000000000000000000000000000000", "gasLimit" : "0x01adb0", "gasPrice" : "0x01", "nonce" : "0x0b", "to" : "0xc305c901078781c232a2a521c2af7980f8385ee9", "value" : "0x", "v" : "0x1c", "r" : "0x3d25569bfa827a48f76ea7a365a8894afb853c8a563e35f607b5c9c98ca525af", "s" : "0x3255bb4a71fc5f275d9fd0416c6d2cb82ff56d1fbfd89bc5f40b3b2e135a8e89" } ] } ] }, "ecmul_7827-6598_0_21000_96_d0g3v0_Istanbul" : { "_info" : { "comment" : "Puts the point (11999875504842010600789954262886096740416429265635183817701593963271973497827, 11843594000332171325303933275547366297934113019079887694534126289021216356598) and the factor 0 into the ECMUL precompile, truncating or expanding the input data to 96 bytes. Gives the execution 21000 bytes", "filling-rpc-server" : "Geth-1.9.6-unstable-63b18027-20190920", "filling-tool-version" : "retesteth-0.0.1+commit.0ae18aef.Linux.g++", "lllcversion" : "Version: 0.5.12-develop.2019.9.13+commit.2d601a4f.Linux.g++", "source" : "src/GeneralStateTestsFiller/stZeroKnowledge/ecmul_7827-6598_0_21000_96Filler.json", "sourceHash" : "467797f3e67e16d28945bbcf8f7cc28c2e89b0b60a2bccb47cbc6a5939f8c2f2" }, "genesisBlockHeader" : { "bloom" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "coinbase" : "0x3535353535353535353535353535353535353535", "difficulty" : "0x20000", "extraData" : "0x00", "gasLimit" : "0x5f5e100", "gasUsed" : "0x0", "hash" : "0x3363716d83d9915c3eda6e08ad4255e8ed8cb8e45dfd3f9bcbfdc3ab0109c7b8", "mixHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce" : "0x0000000000000000", "number" : "0x0", "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "stateRoot" : "0x1e4d8647fd838e80a081a069c14e553fc488531e005a7d3e0925104d43b0fee1", "timestamp" : "0x0", "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, "pre" : { "0x0000000000000000000000000000000000000000" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000001" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000002" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000003" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000004" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000005" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000006" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x0000000000000000000000000000000000000007" : { "balance" : "0x01", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x10a1c1cb95c92ec31d3f22c66eef1d9f3f258c6b" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x13cbb8d99c6c4e0f2728c7d72606e78a29c4e224" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x24143873e0e0815fdcbcffdbe09c979cbf9ad013" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x3535353535353535353535353535353535353535" : { "balance" : "0x0892ee", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x598443f1880ef585b21f1d7585bd0577402861e5" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x77db2bebba79db42a978f896968f4afce746ea1f" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x7d577a597b2742b498cb5cf0c26cdcd726d39e6e" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1" : { "balance" : "0x0de0b6b3a75b6d12", "code" : "0x", "nonce" : "0x0b", "storage" : { } }, "0x90f0b1ebbba1c1936aff7aaf20a7878ff9e04b6c" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0xc305c901078781c232a2a521c2af7980f8385ee9" : { "balance" : "0x00", "code" : "0x600035601c52740100000000000000000000000000000000000000006020526fffffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff000000000000000000000000000000016060527402540be3fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffdabf41c00000000000000000000000002540be40060a0526330c8d1da600051141561012b5760c06004356004013511151558576004356004013560200160043560040161014037604061026061014051610160600060076305f5e0fff11558576040610240526102406060806102c0828460006004601bf15050506102c08051602082012090506000556102c060206020820352604081510160206001820306601f820103905060208203f350005b", "nonce" : "0x01", "storage" : { } }, "0xdceceaf3fc5c0a63d195d69b1a90011b7b19650d" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } }, "0xe0fc04fa2d34a66b779fd5cee748268032a146c0" : { "balance" : "0x0de0b6b3a7640000", "code" : "0x", "nonce" : "0x00", "storage" : { } } }, "postState" : { "0x24143873e0e0815fdcbcffdbe09c979cbf9ad013" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x0000000000000000000000000000000000000001" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0xdceceaf3fc5c0a63d195d69b1a90011b7b19650d" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0xc305c901078781c232a2a521c2af7980f8385ee9" : { "code" : "0x600035601c52740100000000000000000000000000000000000000006020526fffffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff000000000000000000000000000000016060527402540be3fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffdabf41c00000000000000000000000002540be40060a0526330c8d1da600051141561012b5760c06004356004013511151558576004356004013560200160043560040161014037604061026061014051610160600060076305f5e0fff11558576040610240526102406060806102c0828460006004601bf15050506102c08051602082012090506000556102c060206020820352604081510160206001820306601f820103905060208203f350005b", "nonce" : "0x01", "balance" : "0x00", "storage" : { "0x00" : "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5" } }, "0x0000000000000000000000000000000000000005" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x13cbb8d99c6c4e0f2728c7d72606e78a29c4e224" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x0000000000000000000000000000000000000000" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x0000000000000000000000000000000000000003" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1" : { "code" : "0x", "nonce" : "0x0c", "balance" : "0x0de0b6b3a75aa845", "storage" : { } }, "0x0000000000000000000000000000000000000006" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x0000000000000000000000000000000000000007" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x598443f1880ef585b21f1d7585bd0577402861e5" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x7d577a597b2742b498cb5cf0c26cdcd726d39e6e" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x0000000000000000000000000000000000000004" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0xe0fc04fa2d34a66b779fd5cee748268032a146c0" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x3535353535353535353535353535353535353535" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x1bc16d674ed157bb", "storage" : { } }, "0x0000000000000000000000000000000000000002" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x01", "storage" : { } }, "0x77db2bebba79db42a978f896968f4afce746ea1f" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x10a1c1cb95c92ec31d3f22c66eef1d9f3f258c6b" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } }, "0x90f0b1ebbba1c1936aff7aaf20a7878ff9e04b6c" : { "code" : "0x", "nonce" : "0x00", "balance" : "0x0de0b6b3a7640000", "storage" : { } } }, "network" : "Istanbul", "sealEngine" : "NoProof", "lastblockhash" : "0x4860ce4da8695bbdb2ef400694df94c67515033a018a3aee7c9a80893aa723ac", "genesisRLP" : "0xf901f9f901f4a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347943535353535353535353535353535353535353535a01e4d8647fd838e80a081a069c14e553fc488531e005a7d3e0925104d43b0fee1a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000083020000808405f5e100808000a00000000000000000000000000000000000000000000000000000000000000000880000000000000000c0c0", "blocks" : [ { "rlp" : "0xf90307f901f8a03363716d83d9915c3eda6e08ad4255e8ed8cb8e45dfd3f9bcbfdc3ab0109c7b8a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347943535353535353535353535353535353535353535a06b0bf58ea08ac271f14054aed262fcf74aa901cd002668535cb6aa31b8c56215a06fac60cc88d6f2e1fe05b03584d7240b365906106308fe8dbeeabbc54b369dc2a0731c30ab6d4b860e14db981ba4cebafaed2879feb329524702f8ee7d9bfc3cd0b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000083020000018405f75e7782c4cd8203e800a00000000000000000000000000000000000000000000000000000000000000000880000000000000000f90108f901050b0183030d4094c305c901078781c232a2a521c2af7980f8385ee980b8a430c8d1da000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000601a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe31a2f3c951f6dadcc7ee9007dff81504b0fcd6d7cf59996efdc33d92bf7f9f8f600000000000000000000000000000000000000000000000000000000000000001ba0943676b8cfd7ed7358862c9d6e79ae1b5a82b1a9abe9be94f456f671635c3225a03df1837b026d4b9ed939ba2a18840d275ad47017dfe720609c9b808b0218cb8cc0", "blockHeader" : { "bloom" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "coinbase" : "0x3535353535353535353535353535353535353535", "difficulty" : "0x20000", "extraData" : "0x00", "gasLimit" : "0x5f75e77", "gasUsed" : "0xc4cd", "hash" : "0x4860ce4da8695bbdb2ef400694df94c67515033a018a3aee7c9a80893aa723ac", "mixHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce" : "0x0000000000000000", "number" : "0x1", "parentHash" : "0x3363716d83d9915c3eda6e08ad4255e8ed8cb8e45dfd3f9bcbfdc3ab0109c7b8", "receiptTrie" : "0x731c30ab6d4b860e14db981ba4cebafaed2879feb329524702f8ee7d9bfc3cd0", "stateRoot" : "0x6b0bf58ea08ac271f14054aed262fcf74aa901cd002668535cb6aa31b8c56215", "timestamp" : "0x3e8", "transactionsTrie" : "0x6fac60cc88d6f2e1fe05b03584d7240b365906106308fe8dbeeabbc54b369dc2", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, "transactions" : [ { "data" : "0x30c8d1da000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000601a87b0584ce92f4593d161480614f2989035225609f08058ccfa3d0f940febe31a2f3c951f6dadcc7ee9007dff81504b0fcd6d7cf59996efdc33d92bf7f9f8f60000000000000000000000000000000000000000000000000000000000000000", "gasLimit" : "0x030d40", "gasPrice" : "0x01", "nonce" : "0x0b", "to" : "0xc305c901078781c232a2a521c2af7980f8385ee9", "value" : "0x", "v" : "0x1b", "r" : "0x943676b8cfd7ed7358862c9d6e79ae1b5a82b1a9abe9be94f456f671635c3225", "s" : "0x3df1837b026d4b9ed939ba2a18840d275ad47017dfe720609c9b808b0218cb8c" } ] } ] } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.microsoft.azuretools.ijidea.ui.RemoteDebuggingClientDialog"> <grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <margin top="10" left="10" bottom="10" right="10"/> <constraints> <xy x="48" y="54" width="768" height="400"/> </constraints> <properties/> <border type="none"/> <children> <grid id="c82a8" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <margin top="5" left="5" bottom="5" right="5"/> <constraints> <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> </constraints> <properties/> <border type="none" title="Info"/> <children> <component id="9c532" class="javax.swing.JLabel"> <constraints> <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="The plugin only helps you to utilize Web App remote debuggin concept"/> </properties> </component> <component id="fc8b9" class="javax.swing.JLabel"> <constraints> <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="Click &quot;Help&quot; button to read the original README on GitHub."/> </properties> </component> <vspacer id="28683"> <constraints> <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/> </constraints> </vspacer> </children> </grid> <tabbedpane id="f04d7" binding="tabbedPane1" default-binding="true"> <constraints> <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"> <preferred-size width="200" height="200"/> </grid> </constraints> <properties/> <border type="none"/> <children> <grid id="e6e09" layout-manager="GridLayoutManager" row-count="6" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <margin top="10" left="5" bottom="5" right="5"/> <constraints> <tabbedpane title="DebugSession client"/> </constraints> <properties/> <border type="none" title="Start DebugSession client application in a new terminal window using arguments:"/> <children> <component id="6e95" class="javax.swing.JLabel" binding="portLabel"> <constraints> <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="--port"/> </properties> </component> <component id="e5c28" class="javax.swing.JTextField" binding="portTextField" custom-create="true"> <constraints> <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"> <preferred-size width="70" height="-1"/> </grid> </constraints> <properties> <text value="8000"/> </properties> </component> <component id="1c2e2" class="javax.swing.JLabel" binding="serverLabel"> <constraints> <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="--server"/> </properties> </component> <component id="87752" class="javax.swing.JTextField" binding="serverTextField" custom-create="true"> <constraints> <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"> <preferred-size width="150" height="-1"/> </grid> </constraints> <properties/> </component> <component id="85ad9" class="javax.swing.JLabel" binding="userLabel"> <constraints> <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="--user"/> </properties> </component> <component id="342bd" class="javax.swing.JTextField" binding="userTextField" custom-create="true"> <constraints> <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"> <preferred-size width="150" height="-1"/> </grid> </constraints> <properties/> </component> <component id="8f5ff" class="javax.swing.JLabel" binding="passwordLabel"> <constraints> <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="--pass"/> </properties> </component> <component id="2a510" class="javax.swing.JTextField" binding="passwordTextField" custom-create="true"> <constraints> <grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"> <preferred-size width="150" height="-1"/> </grid> </constraints> <properties/> </component> <component id="63e4d" class="javax.swing.JButton" binding="startButton" default-binding="true"> <constraints> <grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="4" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="Start"/> </properties> </component> <vspacer id="fde66"> <constraints> <grid row="4" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/> </constraints> </vspacer> </children> </grid> <grid id="b0f0d" layout-manager="GridLayoutManager" row-count="7" column-count="6" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <margin top="10" left="5" bottom="5" right="5"/> <constraints> <tabbedpane title="App Service"/> </constraints> <properties/> <border type="none" title="App Service general settings:"/> <children> <component id="dbd80" class="javax.swing.JLabel"> <constraints> <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="Web Sockets:"/> </properties> </component> <vspacer id="40b15"> <constraints> <grid row="6" column="0" row-span="1" col-span="4" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/> </constraints> </vspacer> <component id="d726b" class="javax.swing.JLabel"> <constraints> <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="Platform:"/> </properties> </component> <component id="49746" class="org.jdesktop.swingx.JXHyperlink" binding="webSocketOffLink"> <constraints> <grid row="0" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> </constraints> <properties> <horizontalAlignment value="0"/> <text value="Off"/> </properties> </component> <component id="4c1d" class="org.jdesktop.swingx.JXHyperlink" binding="webSocketOnLink"> <constraints> <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> </constraints> <properties> <borderPainted value="false"/> <horizontalAlignment value="0"/> <opaque value="true"/> <text value="On"/> </properties> </component> <component id="9e2e3" class="org.jdesktop.swingx.JXHyperlink" binding="platform32bitLink"> <constraints> <grid row="3" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> </constraints> <properties> <horizontalAlignment value="0"/> <text value="32-bit"/> </properties> </component> <component id="8272f" class="org.jdesktop.swingx.JXHyperlink" binding="platform64bitLink"> <constraints> <grid row="3" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> </constraints> <properties> <horizontalAlignment value="0"/> <text value="64-bit"/> </properties> </component> <component id="bf9c0" class="javax.swing.JLabel"> <constraints> <grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="* Current value is:"/> </properties> </component> <component id="c9c4f" class="javax.swing.JLabel"> <constraints> <grid row="3" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="* Current value is:"/> </properties> </component> <component id="33c4c" class="javax.swing.JLabel"> <constraints> <grid row="1" column="0" row-span="1" col-span="4" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="3" use-parent-layout="false"/> </constraints> <properties> <font style="2"/> <text value="** Click 'On' to enable remote debugging"/> </properties> </component> <component id="9901" class="javax.swing.JLabel"> <constraints> <grid row="4" column="0" row-span="1" col-span="4" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="3" use-parent-layout="false"/> </constraints> <properties> <font style="2"/> <text value="** Click '64-bit' if you use Azul Zulu Java family"/> </properties> </component> <component id="740ab" class="javax.swing.JLabel"> <constraints> <grid row="5" column="0" row-span="1" col-span="4" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="3" use-parent-layout="false"/> </constraints> <properties> <font style="2"/> <text value="*** The 64-bit option can be enabled in Basic plans and higher"/> </properties> </component> <hspacer id="913fc"> <constraints> <grid row="0" column="5" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/> </constraints> </hspacer> <component id="80ef6" class="javax.swing.JLabel"> <constraints> <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value=""/> </properties> </component> <component id="585ce" class="javax.swing.JLabel" binding="webSocketCurrenValueLabel"> <constraints> <grid row="0" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <foreground color="-65536"/> <text value="N/A"/> </properties> </component> <component id="802f" class="javax.swing.JLabel" binding="platformCurrentValueLabel"> <constraints> <grid row="3" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <foreground color="-65536"/> <text value="N/A"/> </properties> </component> </children> </grid> <grid id="126e" layout-manager="GridLayoutManager" row-count="5" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <margin top="10" left="5" bottom="5" right="5"/> <constraints> <tabbedpane title="web.config"/> </constraints> <properties/> <border type="none" title="Upload simple web.config to enable remote debugging"/> <children> <component id="cdb63" class="javax.swing.JLabel"> <constraints> <grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="9" fill="0" indent="3" use-parent-layout="false"/> </constraints> <properties> <font style="2"/> <text value="* will work with Tomcat family web containers only"/> </properties> </component> <component id="8ca32" class="javax.swing.JLabel"> <constraints> <grid row="2" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="3" use-parent-layout="false"/> </constraints> <properties> <font style="2"/> <text value="** will override existing web.config, if any"/> </properties> </component> <vspacer id="74304"> <constraints> <grid row="3" column="0" row-span="1" col-span="2" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/> </constraints> </vspacer> <component id="16860" class="javax.swing.JLabel"> <constraints> <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="File path:"/> </properties> </component> <component id="23fa6" class="javax.swing.JTextField" binding="webConfigPathTextFIeld"> <constraints> <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"> <preferred-size width="150" height="-1"/> </grid> </constraints> <properties> <editable value="false"/> </properties> </component> <component id="ba702" class="org.jdesktop.swingx.JXHyperlink" binding="webConfigOpenLink"> <constraints> <grid row="0" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="Open"/> </properties> </component> <component id="e1879" class="javax.swing.JButton" binding="uploadWebConfigButton"> <constraints> <grid row="4" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="4" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="Upload"/> </properties> </component> </children> </grid> <grid id="b9cfb" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <margin top="10" left="5" bottom="5" right="5"/> <constraints> <tabbedpane title="FTP server"/> </constraints> <properties/> <border type="none" title="FTP deployment server credentials:"/> <children> <component id="92635" class="javax.swing.JLabel"> <constraints> <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="Host:"/> </properties> </component> <vspacer id="46883"> <constraints> <grid row="4" column="0" row-span="1" col-span="2" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/> </constraints> </vspacer> <component id="be1a7" class="javax.swing.JTextField" binding="ftpHostTextField"> <constraints> <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"> <preferred-size width="150" height="-1"/> </grid> </constraints> <properties> <editable value="false"/> </properties> </component> <component id="2340d" class="javax.swing.JLabel"> <constraints> <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="Username:"/> </properties> </component> <component id="a1df7" class="javax.swing.JTextField" binding="ftpUsernametextField"> <constraints> <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"> <preferred-size width="150" height="-1"/> </grid> </constraints> <properties> <editable value="false"/> </properties> </component> <component id="bd0f2" class="javax.swing.JLabel"> <constraints> <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> <text value="Password:"/> </properties> </component> <component id="cbff9" class="javax.swing.JTextField" binding="ftpPasswordTextField"> <constraints> <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"> <preferred-size width="150" height="-1"/> </grid> </constraints> <properties> <editable value="false"/> </properties> </component> <component id="a9eb6" class="javax.swing.JLabel"> <constraints> <grid row="3" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="3" use-parent-layout="false"/> </constraints> <properties> <font style="2"/> <text value="* Use the credentials to connect FTP deployment server with an external application like FileZilla."/> </properties> </component> </children> </grid> </children> </tabbedpane> </children> </grid> </form>
{ "pile_set_name": "Github" }
import { Response } from 'node-fetch' import responseRoot from './__fixtures__/kraken/root' import response401 from './__fixtures__/kraken/401' import response404 from './__fixtures__/kraken/404' const mockJson = jest.fn(() => Promise.resolve({ mock: true })) const fetch = jest.fn().mockImplementation( (url /*, options, qsOptions */): Promise<Partial<Response>> => { switch (url) { case 'https://api.twitch.tv/helix/401': return Promise.resolve({ url, ok: false, status: 401, statusText: 'Unauthorized', json: () => Promise.resolve(response401), }) case 'https://api.twitch.tv/helix/404': return Promise.resolve({ url, ok: false, status: 404, statusText: 'Not Found', json: () => Promise.resolve(response404), }) case 'https://api.twitch.tv/kraken/': return Promise.resolve({ url, ok: true, status: 200, statusText: 'OK', json: () => Promise.resolve(responseRoot), }) default: return Promise.resolve({ url, ok: true, status: 200, statusText: 'OK', json: mockJson, }) } }, ) export { mockJson } export default fetch
{ "pile_set_name": "Github" }
#/****************************************************************************** #* Copyright (c) 2015 - 2020 Xilinx, Inc. All rights reserved. #* SPDX-License-Identifier: MIT #******************************************************************************/ proc swapp_get_name {} { return "OpenAMP matrix multiplication Demo" } proc swapp_get_description {} { return " OpenAMP matrix multiplication application " } proc check_oamp_supported_os {} { set oslist [hsi::get_os] if { [llength $oslist] != 1 } { return 0 } set os [lindex $oslist 0] if { ( $os != "standalone" ) && ( [string match -nocase "freertos*" "$os"] == 0 ) } { error "This application is supported only on the Standalone and FreeRTOS Board Support Packages" } } proc swapp_is_supported_sw {} { # make sure we are using a supported OS check_oamp_supported_os # make sure openamp and metal libs are available set librarylist_1 [hsi::get_libs -filter "NAME==openamp"] set librarylist_2 [hsi::get_libs -filter "NAME==libmetal"] if { ([llength $librarylist_1] == 0) || ([llength $librarylist_2] == 0) } { error "This application requires OpenAMP and Libmetal libraries in the Board Support Package." } elseif { [llength $librarylist_1] > 1 } { error "Multiple OpenAMP libraries present in the Board Support Package." } elseif { [llength $librarylist_2] > 1 } { error "Multiple Libmetal libraries present in the Board Support Package." } } proc swapp_is_supported_hw {} { # check processor type set proc_instance [hsi::get_sw_processor] set hw_processor [common::get_property HW_INSTANCE $proc_instance] set proc_type [common::get_property IP_NAME [hsi::get_cells -hier $hw_processor]] if { ( $proc_type != "psu_cortexr5" ) && ( $proc_type != "psv_cortexr5" ) && ( $proc_type != "ps7_cortexa9" ) } { error "This application is supported only for Cortex-R5 and Cortex-A9 processors." } return 1 } proc get_stdout {} { return } proc check_stdout_hw {} { return } proc setup_for_rpmsg_userspace {} { puts " in setup_for_rpmsg_userspace " set lines "" set loc "rsc_table.c" #saves each line to an arg in a temp list set file [open $loc] foreach {i} [split [read $file] \n] { lappend lines $i } close $file #rewrites your file set file [open $loc w+] foreach {line} $lines { # replace ring tx entry regsub -all "RING_TX +FW_RSC_U32_ADDR_ANY" $line "RING_TX 0x3ed40000" line # replace ring rx entry regsub -all "RING_RX +FW_RSC_U32_ADDR_ANY" $line "RING_RX 0x3ed44000" line puts $file $line } close $file } proc swapp_generate {} { set oslist [get_os] if { [llength $oslist] != 1 } { return 0 } set os [lindex $oslist 0] set proc_instance [hsi::get_sw_processor] set hw_processor [common::get_property HW_INSTANCE $proc_instance] set proc_type [common::get_property IP_NAME [hsi::get_cells -hier $hw_processor]] if { $os == "standalone" } { set osdir "generic" } elseif { [string match -nocase "freertos*" "$os"] > 0 } { set osdir "freertos" } else { error "Invalid OS: $os" } if { $proc_type == "psu_cortexr5" || $proc_type == "psv_cortexr5"} { set procdir "zynqmp_r5" } elseif { $proc_type == "ps7_cortexa9" } { set procdir "zynq7" } else { error "Invalid processor type: $proc_type" } # development support option: set this to 1 in order to link files to your development local repo set linkfiles 0 # if using linkfiles=1, set the path below to your local repo set local_repo_app_src "your_path_here/.../lib/sw_apps/openamp_matrix_multiply/src" foreach entry [glob -nocomplain -type f [file join machine *] [file join machine $procdir *] [file join system *] [file join system $osdir *] [file join system $osdir machine *] [file join system $osdir machine $procdir *]] { if { $linkfiles } { file link -symbolic [file tail $entry] [file join $local_repo_app_src $entry] } else { file copy -force $entry "." } } file delete -force "machine" file delete -force "system" set with_rpmsg_userspace [::common::get_property VALUE [hsi::get_comp_params -filter { NAME == WITH_RPMSG_USERSPACE } ] ] if { $with_rpmsg_userspace} { setup_for_rpmsg_userspace } return } proc swapp_get_linker_constraints {} { # don't generate a linker script, we provide one return "lscript no" } proc swapp_get_supported_processors {} { return "psu_cortexr5 psv_cortexr5 ps7_cortexa9" } proc swapp_get_supported_os {} { return "freertos10_xilinx standalone" }
{ "pile_set_name": "Github" }
#include <linux/ppp-comp.h>
{ "pile_set_name": "Github" }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Polyfill\Util; if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) { class_alias('Symfony\Polyfill\Util\TestListenerForV5', 'Symfony\Polyfill\Util\TestListener'); // Using an early return instead of a else does not work when using the PHPUnit phar due to some weird PHP behavior (the class // gets defined without executing the code before it and so the definition is not properly conditional) } elseif (version_compare(\PHPUnit\Runner\Version::id(), '7.0.0', '<')) { class_alias('Symfony\Polyfill\Util\TestListenerForV6', 'Symfony\Polyfill\Util\TestListener'); } else { class_alias('Symfony\Polyfill\Util\TestListenerForV7', 'Symfony\Polyfill\Util\TestListener'); } if (false) { class TestListener { } }
{ "pile_set_name": "Github" }
/*|----------------------------------------------------------------------------- *| This source code is provided under the Apache 2.0 license -- *| and is provided AS IS with no warranty or guarantee of fit for purpose. -- *| See the project's LICENSE.md for details. -- *| Copyright (C) 2019-2020 Refinitiv. All rights reserved. -- *|----------------------------------------------------------------------------- */ #ifndef __ripcutils_h #define __ripcutils_h #include "rtr/socket.h" #include "rtr/rsslChanManagement.h" #include <sys/stat.h> #if !defined(_WIN16) && !defined(_WIN32) #include <sys/uio.h> #if defined(LINUX) typedef struct iovec iovec_t; #endif #endif #ifdef _WIN32 #include <stdio.h> typedef WSABUF ripcIovType; #define RIPC_IOV_SETLEN(iov,length) (iov)->len = length #define RIPC_IOV_GETLEN(iov) (iov)->len #define RIPC_IOV_SETBUF(iov,buffer) (iov)->buf = buffer #define RIPC_IOV_GETBUF(iov) (iov)->buf #define RIPC_MAXIOVLEN 16 #ifndef snprintf #define snprintf _snprintf #endif #ifndef stat #define stat _stat #endif #ifndef S_IFDIR #define S_IFDIR _S_IFDIR #endif #ifndef S_IFREG #define S_IFREG _S_IFREG #endif #else #ifdef IPC_DEBUG_SOCKET_NAME #include <arpa/inet.h> #endif typedef iovec_t ripcIovType; #define RIPC_IOV_SETLEN(iov,length) (iov)->iov_len = length #define RIPC_IOV_GETLEN(iov) (iov)->iov_len #define RIPC_IOV_SETBUF(iov,buf) (iov)->iov_base = (caddr_t)buf #define RIPC_IOV_GETBUF(iov) (iov)->iov_base #endif #ifndef RIPC_MAXIOVLEN #define RIPC_MAXIOVLEN 16 #endif typedef enum { RIPC_RW_NONE = 0x00, RIPC_RW_BLOCKING = 0x01, /* Perform a blocking operation */ RIPC_RW_WAITALL = 0x02 /* If blocking, wait for max_len * read bytes or outLen written bytes. */ } ripcRWFlags; typedef enum { RIPC_SOPT_BLOCKING = 1, /* Use turn_on */ RIPC_SOPT_LINGER = 2, /* Use linger_time */ RIPC_SOPT_REUSEADDR = 3, /* Use turn_on */ RIPC_SOPT_RD_BUF_SIZE = 4, /* Use buffer_size */ RIPC_SOPT_WRT_BUF_SIZE = 5, /* Use buffer_size */ RIPC_SOPT_CLOEXEC = 6, /* Use turn_on */ RIPC_SOPT_TCP_NODELAY = 7, /* Use turn_on */ RIPC_SOPT_EXCLUSIVEADDRUSE = 8, /* Use Exclusive Address Reuse (WIN) */ RIPC_SOPT_KEEPALIVE = 9, RIPC_SOPT_REUSEPORT = 10 /* Use turn_on. Share server socket (Linux). Under Win should set REUSEADDR and remove EXCLUSIVEADDRUSE */ } ripcSocketOptionsCode; typedef struct { ripcSocketOptionsCode code; union { int turn_on; /* turn the option on */ int linger_time; /* linger_time == 0 turns off */ int buffer_size; /* set to buffer size */ } options; } ripcSocketOption; extern int ipcValidServerName(char *name, int nlen); extern int ipcGetServByName(char *serv_name); extern int ipcSockOpts( RsslSocket fd, ripcSocketOption *option ); // extern int ipcBindSocket(u32 ipaddr, int portNum, RsslSocket fd); extern int ipcReadyWrite(RsslSocket fd); extern int ipcReadyRead(RsslSocket fd); extern int ipcReadyException(RsslSocket fd); extern int ipcConnected(RsslSocket fd); extern int ipcSetProtFuncs(); extern int ipcSetSockFuncs(); #ifdef IPC_DEBUG_SOCKET_NAME extern int _ipcdGetSockName( RsslSocket fd ); extern int _ipcdGetPeerName( RsslSocket fd ); #endif // All signature of function definitions for function pointers extern RsslInt32 ipcSrvrBind(rsslServerImpl *srvr, RsslError *error); extern void *ipcNewSrvrConn(void *srvr, RsslSocket fd, int *initComplete, void* userSpecPtr, RsslError *error); extern void *ipcNewClientConn(RsslSocket fd, int *initComplete, void* userSpecPtr, RsslError* error ); extern int ipcInitTrans(void *transport, ripcSessInProg *inPr, RsslError *error); extern int ipcRead(void *transport, char *buf, int max_len, ripcRWFlags flags, RsslError *error); extern int ipcWrite(void *transport, char *buf, int outLen, ripcRWFlags flags, RsslError *error); extern int ipcWriteV(void *transport, ripcIovType *iov, int iovcnt, int outLen, ripcRWFlags flags, RsslError *error); extern int ipcWrite(void *transport, char *buf, int outLen, ripcRWFlags flags, RsslError *error); extern int ipcScktReconnectClient(void *transport, RsslError *error); extern RsslSocket ipcSrvrAccept(rsslServerImpl *srvr, void** userSpecPtr, RsslError *error); extern int ipcShutdownSckt(void *transport); /* Not support for ipc Sockets */ extern int ipcSessIoctl(void *transport, int code, int value, RsslError *error); /* Not support for ipc Sockets */ extern void ipcUninitialize(); extern int ipcGetSockName(RsslSocket fd, struct sockaddr *address, int *address_len, void *transport); extern int ipcGetSockOpts(RsslSocket fd, int code, int* value, void *transport, RsslError *error); extern int ipcSetSockOpts(RsslSocket fd, ripcSocketOption *option, void *transport); extern int ipcIsConnected(RsslSocket fd, void *transport); extern int ipcServerShutdown(void *transport); // extern for SSLfuncs.connectSocket extern RsslSocket ipcConnectSocket(RsslInt32 *portnum, void *opts, RsslInt32 flags, void** userSpecPtr, RsslError *error); extern int rssl_socket_startup(char *errorText); extern int rssl_socket_shutdown(); #endif
{ "pile_set_name": "Github" }
module.exports = require('./wrapperValue');
{ "pile_set_name": "Github" }