text
stringlengths
2
1.04M
meta
dict
package seelog import ( "fmt" "io/ioutil" "os" "path/filepath" "sort" "strconv" "strings" "time" ) // Common constants const ( rollingLogHistoryDelimiter = "." ) // Types of the rolling writer: roll by date, by time, etc. type rollingType uint8 const ( rollingTypeSize = iota rollingTypeTime ) type rollingIntervalType uint8 const ( rollingIntervalAny = iota rollingIntervalDaily ) var rollingInvervalTypesStringRepresentation = map[rollingIntervalType]string{ rollingIntervalDaily: "daily", } func rollingIntervalTypeFromString(rollingTypeStr string) (rollingIntervalType, bool) { for tp, tpStr := range rollingInvervalTypesStringRepresentation { if tpStr == rollingTypeStr { return tp, true } } return 0, false } var rollingTypesStringRepresentation = map[rollingType]string{ rollingTypeSize: "size", rollingTypeTime: "date", } func rollingTypeFromString(rollingTypeStr string) (rollingType, bool) { for tp, tpStr := range rollingTypesStringRepresentation { if tpStr == rollingTypeStr { return tp, true } } return 0, false } // Old logs archivation type. type rollingArchiveType uint8 const ( rollingArchiveNone = iota rollingArchiveZip ) var rollingArchiveTypesStringRepresentation = map[rollingArchiveType]string{ rollingArchiveNone: "none", rollingArchiveZip: "zip", } func rollingArchiveTypeFromString(rollingArchiveTypeStr string) (rollingArchiveType, bool) { for tp, tpStr := range rollingArchiveTypesStringRepresentation { if tpStr == rollingArchiveTypeStr { return tp, true } } return 0, false } // Default names for different archivation types var rollingArchiveTypesDefaultNames = map[rollingArchiveType]string{ rollingArchiveZip: "log.zip", } // rollerVirtual is an interface that represents all virtual funcs that are // called in different rolling writer subtypes. type rollerVirtual interface { needsToRoll() (bool, error) // Returns true if needs to switch to another file. isFileTailValid(tail string) bool // Returns true if logger roll file tail (part after filename) is ok. sortFileTailsAsc(fs []string) ([]string, error) // Sorts logger roll file tails in ascending order of their creation by logger. // Creates a new froll history file using the contents of current file and filename of the latest roll. // If lastRollFileTail is empty (""), then it means that there is no latest roll (current is the first one) getNewHistoryFileNameTail(lastRollFileTail string) string getCurrentModifiedFileName(originalFileName string) string // Returns filename modified according to specific logger rules } // rollingFileWriter writes received messages to a file, until time interval passes // or file exceeds a specified limit. After that the current log file is renamed // and writer starts to log into a new file. You can set a limit for such renamed // files count, if you want, and then the rolling writer would delete older ones when // the files count exceed the specified limit. type rollingFileWriter struct { fileName string // current file name. May differ from original in date rolling loggers originalFileName string // original one currentDirPath string currentFile *os.File currentFileSize int64 rollingType rollingType // Rolling mode (Files roll by size/date/...) archiveType rollingArchiveType archivePath string maxRolls int self rollerVirtual // Used for virtual calls } func newRollingFileWriter(fpath string, rtype rollingType, atype rollingArchiveType, apath string, maxr int) (*rollingFileWriter, error) { rw := new(rollingFileWriter) rw.currentDirPath, rw.fileName = filepath.Split(fpath) if len(rw.currentDirPath) == 0 { rw.currentDirPath = "." } rw.originalFileName = rw.fileName rw.rollingType = rtype rw.archiveType = atype rw.archivePath = apath rw.maxRolls = maxr return rw, nil } func (rw *rollingFileWriter) getSortedLogHistory() ([]string, error) { files, err := getDirFilePaths(rw.currentDirPath, nil, true) if err != nil { return nil, err } pref := rw.originalFileName + rollingLogHistoryDelimiter var validFileTails []string for _, file := range files { if file != rw.fileName && strings.HasPrefix(file, pref) { tail := rw.getFileTail(file) if rw.self.isFileTailValid(tail) { validFileTails = append(validFileTails, tail) } } } sortedTails, err := rw.self.sortFileTailsAsc(validFileTails) if err != nil { return nil, err } validSortedFiles := make([]string, len(sortedTails)) for i, v := range sortedTails { validSortedFiles[i] = rw.originalFileName + rollingLogHistoryDelimiter + v } return validSortedFiles, nil } func (rw *rollingFileWriter) createFileAndFolderIfNeeded() error { var err error if len(rw.currentDirPath) != 0 { err = os.MkdirAll(rw.currentDirPath, defaultDirectoryPermissions) if err != nil { return err } } rw.fileName = rw.self.getCurrentModifiedFileName(rw.originalFileName) filePath := filepath.Join(rw.currentDirPath, rw.fileName) // If exists stat, err := os.Lstat(filePath) if err == nil { rw.currentFile, err = os.OpenFile(filePath, os.O_WRONLY|os.O_APPEND, defaultFilePermissions) stat, err = os.Lstat(filePath) if err != nil { return err } rw.currentFileSize = stat.Size() } else { rw.currentFile, err = os.Create(filePath) rw.currentFileSize = 0 } if err != nil { return err } return nil } func (rw *rollingFileWriter) deleteOldRolls(history []string) error { if rw.maxRolls <= 0 { return nil } rollsToDelete := len(history) - rw.maxRolls if rollsToDelete <= 0 { return nil } switch rw.archiveType { case rollingArchiveZip: var files map[string][]byte // If archive exists _, err := os.Lstat(rw.archivePath) if nil == err { // Extract files and content from it files, err = unzip(rw.archivePath) if err != nil { return err } // Remove the original file err = tryRemoveFile(rw.archivePath) if err != nil { return err } } else { files = make(map[string][]byte) } // Add files to the existing files map, filled above for i := 0; i < rollsToDelete; i++ { rollPath := filepath.Join(rw.currentDirPath, history[i]) bts, err := ioutil.ReadFile(rollPath) if err != nil { return err } files[rollPath] = bts } // Put the final file set to zip file. err = createZip(rw.archivePath, files) if err != nil { return err } } // In all cases (archive files or not) the files should be deleted. for i := 0; i < rollsToDelete; i++ { rollPath := filepath.Join(rw.currentDirPath, history[i]) err := tryRemoveFile(rollPath) if err != nil { return err } } return nil } func (rw *rollingFileWriter) getFileTail(fileName string) string { return fileName[len(rw.originalFileName+rollingLogHistoryDelimiter):] } func (rw *rollingFileWriter) Write(bytes []byte) (n int, err error) { if rw.currentFile == nil { err := rw.createFileAndFolderIfNeeded() if err != nil { return 0, err } } // needs to roll if: // * file roller max file size exceeded OR // * time roller interval passed nr, err := rw.self.needsToRoll() if err != nil { return 0, err } if nr { // First, close current file. err = rw.currentFile.Close() if err != nil { return 0, err } // Current history of all previous log files. // For file roller it may be like this: // * ... // * file.log.4 // * file.log.5 // * file.log.6 // // For date roller it may look like this: // * ... // * file.log.11.Aug.13 // * file.log.15.Aug.13 // * file.log.16.Aug.13 // Sorted log history does NOT include current file. history, err := rw.getSortedLogHistory() if err != nil { return 0, err } // Renames current file to create a new roll history entry // For file roller it may be like this: // * ... // * file.log.4 // * file.log.5 // * file.log.6 // n file.log.7 <---- RENAMED (from file.log) // Time rollers that doesn't modify file names (e.g. 'date' roller) skip this logic. var newHistoryName string var newTail string if len(history) > 0 { // Create new tail name using last history file name newTail = rw.self.getNewHistoryFileNameTail(rw.getFileTail(history[len(history)-1])) } else { // Create first tail name newTail = rw.self.getNewHistoryFileNameTail("") } if len(newTail) != 0 { newHistoryName = rw.fileName + rollingLogHistoryDelimiter + newTail } else { newHistoryName = rw.fileName } if newHistoryName != rw.fileName { err = os.Rename(filepath.Join(rw.currentDirPath, rw.fileName), filepath.Join(rw.currentDirPath, newHistoryName)) if err != nil { return 0, err } } // Finally, add the newly added history file to the history archive // and, if after that the archive exceeds the allowed max limit, older rolls // must the removed/archived. history = append(history, newHistoryName) if len(history) > rw.maxRolls { err = rw.deleteOldRolls(history) if err != nil { return 0, err } } err = rw.createFileAndFolderIfNeeded() if err != nil { return 0, err } } rw.currentFileSize += int64(len(bytes)) return rw.currentFile.Write(bytes) } func (rw *rollingFileWriter) Close() error { if rw.currentFile != nil { e := rw.currentFile.Close() if e != nil { return e } rw.currentFile = nil } return nil } // ============================================================================================= // Different types of rolling writers // ============================================================================================= // -------------------------------------------------- // Rolling writer by SIZE // -------------------------------------------------- // rollingFileWriterSize performs roll when file exceeds a specified limit. type rollingFileWriterSize struct { *rollingFileWriter maxFileSize int64 } func newRollingFileWriterSize(fpath string, atype rollingArchiveType, apath string, maxSize int64, maxRolls int) (*rollingFileWriterSize, error) { rw, err := newRollingFileWriter(fpath, rollingTypeSize, atype, apath, maxRolls) if err != nil { return nil, err } rws := &rollingFileWriterSize{rw, maxSize} rws.self = rws return rws, nil } func (rws *rollingFileWriterSize) needsToRoll() (bool, error) { return rws.currentFileSize >= rws.maxFileSize, nil } func (rws *rollingFileWriterSize) isFileTailValid(tail string) bool { if len(tail) == 0 { return false } _, err := strconv.Atoi(tail) return err == nil } type rollSizeFileTailsSlice []string func (p rollSizeFileTailsSlice) Len() int { return len(p) } func (p rollSizeFileTailsSlice) Less(i, j int) bool { v1, _ := strconv.Atoi(p[i]) v2, _ := strconv.Atoi(p[j]) return v1 < v2 } func (p rollSizeFileTailsSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } func (rws *rollingFileWriterSize) sortFileTailsAsc(fs []string) ([]string, error) { ss := rollSizeFileTailsSlice(fs) sort.Sort(ss) return ss, nil } func (rws *rollingFileWriterSize) getNewHistoryFileNameTail(lastRollFileTail string) string { v := 0 if len(lastRollFileTail) != 0 { v, _ = strconv.Atoi(lastRollFileTail) } return fmt.Sprintf("%d", v+1) } func (rws *rollingFileWriterSize) getCurrentModifiedFileName(originalFileName string) string { return originalFileName } func (rws *rollingFileWriterSize) String() string { return fmt.Sprintf("Rolling file writer (By SIZE): filename: %s, archive: %s, archivefile: %s, maxFileSize: %v, maxRolls: %v", rws.fileName, rollingArchiveTypesStringRepresentation[rws.archiveType], rws.archivePath, rws.maxFileSize, rws.maxRolls) } // -------------------------------------------------- // Rolling writer by TIME // -------------------------------------------------- // rollingFileWriterTime performs roll when a specified time interval has passed. type rollingFileWriterTime struct { *rollingFileWriter timePattern string interval rollingIntervalType currentTimeFileName string } func newRollingFileWriterTime(fpath string, atype rollingArchiveType, apath string, maxr int, timePattern string, interval rollingIntervalType) (*rollingFileWriterTime, error) { rw, err := newRollingFileWriter(fpath, rollingTypeTime, atype, apath, maxr) if err != nil { return nil, err } rws := &rollingFileWriterTime{rw, timePattern, interval, ""} rws.self = rws return rws, nil } func (rwt *rollingFileWriterTime) needsToRoll() (bool, error) { if rwt.originalFileName+rollingLogHistoryDelimiter+time.Now().Format(rwt.timePattern) == rwt.fileName { return false, nil } if rwt.interval == rollingIntervalAny { return true, nil } tprev, err := time.ParseInLocation(rwt.timePattern, rwt.getFileTail(rwt.fileName), time.Local) if err != nil { return false, err } diff := time.Now().Sub(tprev) switch rwt.interval { case rollingIntervalDaily: return diff >= 24*time.Hour, nil } return false, fmt.Errorf("Unknown interval type: %d", rwt.interval) } func (rwt *rollingFileWriterTime) isFileTailValid(tail string) bool { if len(tail) == 0 { return false } _, err := time.ParseInLocation(rwt.timePattern, tail, time.Local) return err == nil } type rollTimeFileTailsSlice struct { data []string pattern string } func (p rollTimeFileTailsSlice) Len() int { return len(p.data) } func (p rollTimeFileTailsSlice) Less(i, j int) bool { t1, _ := time.ParseInLocation(p.pattern, p.data[i], time.Local) t2, _ := time.ParseInLocation(p.pattern, p.data[j], time.Local) return t1.Before(t2) } func (p rollTimeFileTailsSlice) Swap(i, j int) { p.data[i], p.data[j] = p.data[j], p.data[i] } func (rwt *rollingFileWriterTime) sortFileTailsAsc(fs []string) ([]string, error) { ss := rollTimeFileTailsSlice{data: fs, pattern: rwt.timePattern} sort.Sort(ss) return ss.data, nil } func (rwt *rollingFileWriterTime) getNewHistoryFileNameTail(lastRollFileTail string) string { return "" } func (rwt *rollingFileWriterTime) getCurrentModifiedFileName(originalFileName string) string { return originalFileName + rollingLogHistoryDelimiter + time.Now().Format(rwt.timePattern) } func (rwt *rollingFileWriterTime) String() string { return fmt.Sprintf("Rolling file writer (By TIME): filename: %s, archive: %s, archivefile: %s, maxInterval: %v, pattern: %s, maxRolls: %v", rwt.fileName, rollingArchiveTypesStringRepresentation[rwt.archiveType], rwt.archivePath, rwt.interval, rwt.timePattern, rwt.maxRolls) }
{ "content_hash": "4a05c5537605590e6863a6ee7e501ba7", "timestamp": "", "source": "github", "line_count": 528, "max_line_length": 146, "avg_line_length": 27.539772727272727, "alnum_prop": 0.6888797194140706, "repo_name": "cider-plugins/cider-github-status", "id": "9239e69f9388f74c93964d066c7f40de598f24bd", "size": "15922", "binary": false, "copies": "16", "ref": "refs/heads/master", "path": "Godeps/_workspace/src/github.com/cihub/seelog/writers_rollingfilewriter.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "1397324" }, { "name": "Python", "bytes": "3478" }, { "name": "Shell", "bytes": "1576" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Struct template compare_hash</title> <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> <link rel="up" href="../../intrusive/reference.html#header.boost.intrusive.options_hpp" title="Header &lt;boost/intrusive/options.hpp&gt;"> <link rel="prev" href="compare.html" title="Struct template compare"> <link rel="next" href="constant_time_size.html" title="Struct template constant_time_size"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td> <td align="center"><a href="../../../../index.html">Home</a></td> <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="compare.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../intrusive/reference.html#header.boost.intrusive.options_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="constant_time_size.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="refentry"> <a name="boost.intrusive.compare_hash"></a><div class="titlepage"></div> <div class="refnamediv"> <h2><span class="refentrytitle">Struct template compare_hash</span></h2> <p>boost::intrusive::compare_hash</p> </div> <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../intrusive/reference.html#header.boost.intrusive.options_hpp" title="Header &lt;boost/intrusive/options.hpp&gt;">boost/intrusive/options.hpp</a>&gt; </span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">bool</span> Enabled<span class="special">&gt;</span> <span class="keyword">struct</span> <a class="link" href="compare_hash.html" title="Struct template compare_hash">compare_hash</a> <span class="special">{</span> <span class="special">}</span><span class="special">;</span></pre></div> <div class="refsect1"> <a name="id-1.3.20.42.21.8.4"></a><h2>Description</h2> <p>This option setter specifies if the container will compare the hash value before comparing objects. This option can't be specified if store_hash&lt;&gt; is not true. This is specially helpful when we have containers with a high load factor. and the comparison function is much more expensive that comparing already stored hash values. </p> </div> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright © 2005 Olaf Krzikalla<br>Copyright © 2006-2015 Ion Gaztanaga<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="compare.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../intrusive/reference.html#header.boost.intrusive.options_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="constant_time_size.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
{ "content_hash": "bda19c8b2492bb4bc27395d9a7138437", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 460, "avg_line_length": 79.21428571428571, "alnum_prop": 0.6762849413886384, "repo_name": "davehorton/drachtio-server", "id": "5aa5b3251a68cf6c6abef56855f31c511d79bd92", "size": "4438", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "deps/boost_1_77_0/doc/html/boost/intrusive/compare_hash.html", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "662596" }, { "name": "Dockerfile", "bytes": "1330" }, { "name": "JavaScript", "bytes": "60639" }, { "name": "M4", "bytes": "35273" }, { "name": "Makefile", "bytes": "5960" }, { "name": "Shell", "bytes": "47298" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <sem:triples uri="http://www.lds.org/vrl/objects/furnishings/candelabras" xmlns:sem="http://marklogic.com/semantics"> <sem:triple> <sem:subject>http://www.lds.org/vrl/objects/furnishings/candelabras</sem:subject> <sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate> <sem:object datatype="xsd:string" xml:lang="eng">Candelabras</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/vrl/objects/furnishings/candelabras</sem:subject> <sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate> <sem:object datatype="sem:iri">http://www.lds.org/concept-scheme/vrl</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/vrl/objects/furnishings/candelabras</sem:subject> <sem:predicate>http://www.lds.org/core#entityType</sem:predicate> <sem:object datatype="sem:iri">http://www.lds.org/Topic</sem:object> </sem:triple> </sem:triples>
{ "content_hash": "698cd8d60bd17597095aedbf6289470c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 117, "avg_line_length": 55.05555555555556, "alnum_prop": 0.715438950554995, "repo_name": "freshie/ml-taxonomies", "id": "dac7a9537c54c2a148b57d75edc01adf5d0fe0a3", "size": "991", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "roxy/data/gospel-topical-explorer-v2/taxonomies/vrl/objects/furnishings/candelabras.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "4422" }, { "name": "CSS", "bytes": "38665" }, { "name": "HTML", "bytes": "356" }, { "name": "JavaScript", "bytes": "411651" }, { "name": "Ruby", "bytes": "259121" }, { "name": "Shell", "bytes": "7329" }, { "name": "XQuery", "bytes": "857170" }, { "name": "XSLT", "bytes": "13753" } ], "symlink_target": "" }
/*****************************************************************************/ /* XDMF */ /* eXtensible Data Model and Format */ /* */ /* Id : XdmfSystemUtils.hpp */ /* */ /* Author: */ /* Kenneth Leiter */ /* [email protected] */ /* US Army Research Laboratory */ /* Aberdeen Proving Ground, MD */ /* */ /* Copyright @ 2011 US Army Research Laboratory */ /* All Rights Reserved */ /* See Copyright.txt for details */ /* */ /* This software is distributed WITHOUT ANY WARRANTY; without */ /* even the implied warranty of MERCHANTABILITY or FITNESS */ /* FOR A PARTICULAR PURPOSE. See the above copyright notice */ /* for more information. */ /* */ /*****************************************************************************/ #ifndef XDMFSYSTEMUTILS_HPP_ #define XDMFSYSTEMUTILS_HPP_ // C Compatible Includes #include "XdmfCore.hpp" #ifdef __cplusplus // Includes #include <string> /** * @brief System specific functions. * * Collects all system specific functions needed by Xdmf. */ class XDMFCORE_EXPORT XdmfSystemUtils { public: /** * Converts a filesystem path to an absolute real path (absolute * path with no symlinks) * * Example of use: * * C++ * * @dontinclude ExampleXdmfSystemUtils.cpp * @skipline //#getRealPath * @until //#getRealPath * * Python * * @dontinclude XdmfExampleSystemUtils.py * @skipline #//getRealPath * @until #//getRealPath * * @param path a string containing the path to convert. * * @return the equivalent real path. */ static std::string getRealPath(const std::string & path); protected: XdmfSystemUtils(); ~XdmfSystemUtils(); private: XdmfSystemUtils(const XdmfSystemUtils &); // Not implemented. void operator=(const XdmfSystemUtils &); // Not implemented. }; #endif #ifdef __cplusplus extern "C" { #endif XDMFCORE_EXPORT char * XdmfSystemUtilsGetRealPath(char * path); #ifdef __cplusplus } #endif #endif /* XDMFSYSTEMUTILS_HPP_ */
{ "content_hash": "a7ae19bcff930f074e3d7c81dd3cd656", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 79, "avg_line_length": 32.27956989247312, "alnum_prop": 0.40806129247168554, "repo_name": "keithroe/vtkoptix", "id": "d8e5329f4d3720b969a5978599131eb38178f491", "size": "3002", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "ThirdParty/xdmf3/vtkxdmf3/core/XdmfSystemUtils.hpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "37444" }, { "name": "Batchfile", "bytes": "106" }, { "name": "C", "bytes": "46217717" }, { "name": "C++", "bytes": "73779038" }, { "name": "CMake", "bytes": "1786055" }, { "name": "CSS", "bytes": "7532" }, { "name": "Cuda", "bytes": "37418" }, { "name": "D", "bytes": "2081" }, { "name": "GAP", "bytes": "14120" }, { "name": "GLSL", "bytes": "222494" }, { "name": "Groff", "bytes": "65394" }, { "name": "HTML", "bytes": "193016" }, { "name": "Java", "bytes": "148789" }, { "name": "JavaScript", "bytes": "54139" }, { "name": "Lex", "bytes": "50109" }, { "name": "M4", "bytes": "159710" }, { "name": "Makefile", "bytes": "275672" }, { "name": "Objective-C", "bytes": "22779" }, { "name": "Objective-C++", "bytes": "191216" }, { "name": "Perl", "bytes": "173168" }, { "name": "Prolog", "bytes": "4406" }, { "name": "Python", "bytes": "15765617" }, { "name": "Shell", "bytes": "88087" }, { "name": "Slash", "bytes": "1476" }, { "name": "Smarty", "bytes": "393" }, { "name": "Tcl", "bytes": "1404085" }, { "name": "Yacc", "bytes": "191144" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "2c1498188bbb35f05aaef72a223101f5", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.307692307692308, "alnum_prop": 0.6940298507462687, "repo_name": "mdoering/backbone", "id": "4bf76866fb1e03c6ca050a2523dd736f59dcbd20", "size": "196", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Rubiaceae/Oldenlandia/Oldenlandia yunnanensis/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
printf "any.js:3:15 = " assert_ok "$FLOW" type-at-pos any.js 3 15 --strip-root --pretty printf "any.js:4:2 = " assert_ok "$FLOW" type-at-pos any.js 4 2 --strip-root --pretty printf "any.js:4:6 = " assert_ok "$FLOW" type-at-pos any.js 4 6 --strip-root --pretty printf "any.js:5:5 = " assert_ok "$FLOW" type-at-pos any.js 5 5 --strip-root --pretty printf "any.js:7:13 = " assert_ok "$FLOW" type-at-pos any.js 7 13 --strip-root --pretty printf "any.js:8:5 = " assert_ok "$FLOW" type-at-pos any.js 8 5 --strip-root --pretty printf "any.js:8:10 = " assert_ok "$FLOW" type-at-pos any.js 8 10 --strip-root --pretty printf "any.js:9:10 = " assert_ok "$FLOW" type-at-pos any.js 9 10 --strip-root --pretty # array.js # TODO `Array` is not populated in type_tables # printf "array.js:3:18 = " # assert_ok "$FLOW" type-at-pos array.js 3 18 --strip-root --pretty # TODO `$ReadOnlyArray` is not populated in type_tables # printf "array.js:4:30 = " # assert_ok "$FLOW" type-at-pos array.js 4 30 --strip-root --pretty printf "array.js:6:15 = " assert_ok "$FLOW" type-at-pos array.js 6 15 --strip-root --pretty printf "array.js:10:15 = " assert_ok "$FLOW" type-at-pos array.js 10 15 --strip-root --pretty printf "array.js:15:4 = " assert_ok "$FLOW" type-at-pos array.js 15 4 --strip-root --pretty printf "array.js:19:4 = " assert_ok "$FLOW" type-at-pos array.js 19 4 --strip-root --pretty printf "array.js:23:4 = " assert_ok "$FLOW" type-at-pos array.js 23 4 --strip-root --pretty # destructuring.js printf "destructuring.js:3:6 = " assert_ok "$FLOW" type-at-pos destructuring.js 3 6 --strip-root --pretty printf "destructuring.js:17:13 = " assert_ok "$FLOW" type-at-pos destructuring.js 17 13 --strip-root --pretty # exact.js printf "exact.js:4:6 = " assert_ok "$FLOW" type-at-pos exact.js 4 6 --strip-root --pretty printf "exact.js:5:13 = " assert_ok "$FLOW" type-at-pos exact.js 5 13 --strip-root --pretty printf "exact.js:6:13 = " assert_ok "$FLOW" type-at-pos exact.js 6 13 --strip-root --pretty printf "exact.js:7:13 = " assert_ok "$FLOW" type-at-pos exact.js 7 13 --strip-root --pretty printf "exact.js:9:17 = " assert_ok "$FLOW" type-at-pos exact.js 9 17 --strip-root --pretty printf "exact.js:10:7 = " assert_ok "$FLOW" type-at-pos exact.js 10 7 --strip-root --pretty printf "exact.js:13:13 = " assert_ok "$FLOW" type-at-pos exact.js 13 13 --strip-root --pretty printf "exact.js:16:13 = " assert_ok "$FLOW" type-at-pos exact.js 16 13 --strip-root --pretty printf "exact.js:18:6 = " assert_ok "$FLOW" type-at-pos exact.js 18 6 --strip-root --pretty printf "exact.js:19:6 = " assert_ok "$FLOW" type-at-pos exact.js 19 6 --strip-root --pretty # generics.js printf "generics.js:5:1 = " assert_ok "$FLOW" type-at-pos generics.js 5 1 --strip-root --pretty printf "generics.js:10:1 = " assert_ok "$FLOW" type-at-pos generics.js 10 1 --strip-root --pretty printf "generics.js:14:1 = " assert_ok "$FLOW" type-at-pos generics.js 14 1 --strip-root --pretty printf "generics.js:18:1 = " assert_ok "$FLOW" type-at-pos generics.js 18 1 --strip-root --pretty printf "generics.js:22:1 = " assert_ok "$FLOW" type-at-pos generics.js 22 1 --strip-root --pretty printf "generics.js:30:13 = " assert_ok "$FLOW" type-at-pos generics.js 30 13 --strip-root --pretty # implicit-instantiation.js printf "implicit-instantiation.js:5:10" assert_ok "$FLOW" type-at-pos implicit-instantiation.js 5 10 --strip-root --pretty --expand-json-output printf "implicit-instantiation.js:6:10" assert_ok "$FLOW" type-at-pos implicit-instantiation.js 6 10 --strip-root --pretty --expand-json-output printf "implicit-instantiation.js:10:21" assert_ok "$FLOW" type-at-pos implicit-instantiation.js 10 21 --strip-root --pretty --expand-json-output # mixed.js printf "mixed.js:18:17 = " assert_ok "$FLOW" type-at-pos mixed.js 18 17 --strip-root --pretty # opaque.js printf "opaque.js:3:20 = " assert_ok "$FLOW" type-at-pos opaque.js 3 20 --strip-root --pretty printf "opaque.js:4:14 = " assert_ok "$FLOW" type-at-pos opaque.js 4 14 --strip-root --pretty printf "opaque.js:4:19 = " assert_ok "$FLOW" type-at-pos opaque.js 4 19 --strip-root --pretty printf "opaque.js:6:22 = " assert_ok "$FLOW" type-at-pos opaque.js 6 22 --strip-root --pretty printf "opaque.js:7:13 = " assert_ok "$FLOW" type-at-pos opaque.js 7 13 --strip-root --pretty printf "opaque.js:7:18 = " assert_ok "$FLOW" type-at-pos opaque.js 7 18 --strip-root --pretty printf "opaque.js:9:22 = " assert_ok "$FLOW" type-at-pos opaque.js 9 22 --strip-root --pretty printf "opaque.js:10:13 = " assert_ok "$FLOW" type-at-pos opaque.js 10 13 --strip-root --pretty printf "opaque.js:10:18 = " assert_ok "$FLOW" type-at-pos opaque.js 10 18 --strip-root --pretty printf "opaque.js:12:14 = " assert_ok "$FLOW" type-at-pos opaque.js 12 14 --strip-root --pretty printf "opaque.js:13:14 = " assert_ok "$FLOW" type-at-pos opaque.js 13 14 --strip-root --pretty printf "opaque.js:13:19 = " assert_ok "$FLOW" type-at-pos opaque.js 13 19 --strip-root --pretty printf "opaque.js:15:22 = " assert_ok "$FLOW" type-at-pos opaque.js 15 22 --strip-root --pretty printf "opaque.js:16:14 = " assert_ok "$FLOW" type-at-pos opaque.js 16 14 --strip-root --pretty printf "opaque.js:16:19 = " assert_ok "$FLOW" type-at-pos opaque.js 16 19 --strip-root --pretty printf "opaque.js:19:14 = " assert_ok "$FLOW" type-at-pos opaque.js 19 14 --strip-root --pretty printf "opaque.js:19:22 = " assert_ok "$FLOW" type-at-pos opaque.js 19 22 --strip-root --pretty printf "opaque.js:20:16 = " assert_ok "$FLOW" type-at-pos opaque.js 20 16 --strip-root --pretty printf "opaque.js:20:34 = " assert_ok "$FLOW" type-at-pos opaque.js 20 34 --strip-root --pretty printf "opaque.js:21:19 = " assert_ok "$FLOW" type-at-pos opaque.js 21 19 --strip-root --pretty printf "opaque.js:21:28 = " assert_ok "$FLOW" type-at-pos opaque.js 21 28 --strip-root --pretty printf "opaque.js:24:7 = " assert_ok "$FLOW" type-at-pos opaque.js 24 7 --strip-root --pretty # optional.js printf "optional.js:4:10 = " assert_ok "$FLOW" type-at-pos optional.js 4 10 --strip-root --pretty printf "optional.js:7:2 = " assert_ok "$FLOW" type-at-pos optional.js 7 2 --strip-root --pretty printf "optional.js:10:11 = " assert_ok "$FLOW" type-at-pos optional.js 10 11 --strip-root --pretty printf "optional.js:10:14 = " assert_ok "$FLOW" type-at-pos optional.js 10 14 --strip-root --pretty printf "optional.js:14:10 = " assert_ok "$FLOW" type-at-pos optional.js 14 10 --strip-root --pretty # stack-overflow-bugfix.js # This used to cause Stack overflow due to a normalizer bug in Substitution # with a mapping of the form: A -> Bound(A) printf "stack-overflow-bugfix.js:14:10 = " assert_ok "$FLOW" type-at-pos stack-overflow-bugfix.js 5 6 --strip-root --pretty --expand-type-aliases # recursive.js printf "recursive.js:3:25 = " assert_ok "$FLOW" type-at-pos recursive.js 3 25 --strip-root --pretty printf "recursive.js:6:11 = " assert_ok "$FLOW" type-at-pos recursive.js 6 11 --strip-root --pretty printf "recursive.js:13:12 = " assert_ok "$FLOW" type-at-pos recursive.js 13 12 --strip-root --pretty printf "recursive.js:23:12 = " assert_ok "$FLOW" type-at-pos recursive.js 23 12 --strip-root --pretty printf "recursive.js:38:2 = " assert_ok "$FLOW" type-at-pos recursive.js 38 2 --strip-root --pretty printf "recursive.js:41:17 = " assert_ok "$FLOW" type-at-pos recursive.js 41 17 --strip-root --pretty printf "recursive.js:58:1 = " assert_ok "$FLOW" type-at-pos recursive.js 58 1 --strip-root --pretty printf "recursive.js:60:6 = " assert_ok "$FLOW" type-at-pos recursive.js 60 6 --strip-root --pretty printf "recursive.js:60:31 = " assert_ok "$FLOW" type-at-pos recursive.js 60 31 --strip-root --pretty # spread.js printf "spread.js:11:6 = " assert_ok "$FLOW" type-at-pos spread.js 11 6 --strip-root --pretty printf "spread.js:12:6 = " assert_ok "$FLOW" type-at-pos spread.js 12 6 --strip-root --pretty printf "spread.js:13:6 = " assert_ok "$FLOW" type-at-pos spread.js 13 6 --strip-root --pretty printf "spread.js:14:6 = " assert_ok "$FLOW" type-at-pos spread.js 14 6 --strip-root --pretty printf "spread.js:15:6 = " assert_ok "$FLOW" type-at-pos spread.js 15 6 --strip-root --pretty printf "spread.js:16:6 = " assert_ok "$FLOW" type-at-pos spread.js 16 6 --strip-root --pretty printf "spread.js:17:6 = " assert_ok "$FLOW" type-at-pos spread.js 17 6 --strip-root --pretty printf "spread.js:18:6 = " assert_ok "$FLOW" type-at-pos spread.js 18 6 --strip-root --pretty printf "spread.js:19:6 = " assert_ok "$FLOW" type-at-pos spread.js 19 6 --strip-root --pretty printf "spread.js:20:6 = " assert_ok "$FLOW" type-at-pos spread.js 20 6 --strip-root --pretty printf "spread.js:21:6 = " assert_ok "$FLOW" type-at-pos spread.js 21 6 --strip-root --pretty printf "spread.js:22:6 = " assert_ok "$FLOW" type-at-pos spread.js 22 6 --strip-root --pretty printf "spread.js:23:6 = " assert_ok "$FLOW" type-at-pos spread.js 23 6 --strip-root --pretty printf "spread.js:26:6 = " assert_ok "$FLOW" type-at-pos spread.js 26 6 --strip-root --pretty printf "spread.js:27:6 = " assert_ok "$FLOW" type-at-pos spread.js 27 6 --strip-root --pretty printf "spread.js:28:6 = " assert_ok "$FLOW" type-at-pos spread.js 28 6 --strip-root --pretty printf "spread.js:29:6 = " assert_ok "$FLOW" type-at-pos spread.js 29 6 --strip-root --pretty printf "spread.js:30:6 = " assert_ok "$FLOW" type-at-pos spread.js 30 6 --strip-root --pretty printf "spread.js:31:6 = " assert_ok "$FLOW" type-at-pos spread.js 31 6 --strip-root --pretty printf "spread.js:32:6 = " assert_ok "$FLOW" type-at-pos spread.js 32 6 --strip-root --pretty printf "spread.js:33:6 = " assert_ok "$FLOW" type-at-pos spread.js 33 6 --strip-root --pretty printf "spread.js:34:6 = " assert_ok "$FLOW" type-at-pos spread.js 34 6 --strip-root --pretty printf "spread.js:35:6 = " assert_ok "$FLOW" type-at-pos spread.js 35 6 --strip-root --pretty printf "spread.js:36:6 = " assert_ok "$FLOW" type-at-pos spread.js 36 6 --strip-root --pretty --expand-type-aliases printf "spread.js:37:6 = " assert_ok "$FLOW" type-at-pos spread.js 37 6 --strip-root --pretty printf "spread.js:38:6 = " assert_ok "$FLOW" type-at-pos spread.js 38 6 --strip-root --pretty printf "spread.js:39:6 = " assert_ok "$FLOW" type-at-pos spread.js 39 6 --strip-root --pretty printf "spread.js:40:6 = " assert_ok "$FLOW" type-at-pos spread.js 40 6 --strip-root --pretty printf "spread.js:41:6 = " assert_ok "$FLOW" type-at-pos spread.js 41 6 --strip-root --pretty printf "spread.js:42:6 = " assert_ok "$FLOW" type-at-pos spread.js 42 6 --strip-root --pretty printf "spread.js:43:6 = " assert_ok "$FLOW" type-at-pos spread.js 43 6 --strip-root --pretty printf "spread.js:44:6 = " assert_ok "$FLOW" type-at-pos spread.js 44 6 --strip-root --pretty printf "spread.js:45:6 = " assert_ok "$FLOW" type-at-pos spread.js 45 6 --strip-root --pretty printf "spread.js:46:6 = " assert_ok "$FLOW" type-at-pos spread.js 46 6 --strip-root --pretty # subst.js printf "subst.js:13:7 = " assert_ok "$FLOW" type-at-pos subst.js 13 7 --strip-root --pretty printf "subst.js:14:7 = " assert_ok "$FLOW" type-at-pos subst.js 14 7 --strip-root --pretty printf "subst.js:17:7 = " assert_ok "$FLOW" type-at-pos subst.js 17 7 --strip-root --pretty printf "subst.js:18:7 = " assert_ok "$FLOW" type-at-pos subst.js 18 7 --strip-root --pretty printf "subst.js:21:7 = " assert_ok "$FLOW" type-at-pos subst.js 21 7 --strip-root --pretty printf "subst.js:22:7 = " assert_ok "$FLOW" type-at-pos subst.js 22 7 --strip-root --pretty # type-alias.js printf "type-alias.js:3:6 = " assert_ok "$FLOW" type-at-pos type-alias.js 3 6 --strip-root --pretty printf "type-alias.js:4:6 = " assert_ok "$FLOW" type-at-pos type-alias.js 4 6 --strip-root --pretty printf "type-alias.js:5:6 = " assert_ok "$FLOW" type-at-pos type-alias.js 5 6 --strip-root --pretty printf "type-alias.js:6:6 = " assert_ok "$FLOW" type-at-pos type-alias.js 6 6 --strip-root --pretty printf "type-alias.js:7:6 = " assert_ok "$FLOW" type-at-pos type-alias.js 7 6 --strip-root --pretty printf "type-alias.js:7:6 (--expand-type-aliases) = " assert_ok "$FLOW" type-at-pos type-alias.js 7 6 --strip-root --pretty --expand-type-aliases printf "type-alias.js:8:6 = " assert_ok "$FLOW" type-at-pos type-alias.js 8 6 --strip-root --pretty printf "type-alias.js:12:12 " assert_ok "$FLOW" type-at-pos type-alias.js 12 12 --strip-root --pretty printf "type-alias.js:12:29 " assert_ok "$FLOW" type-at-pos type-alias.js 12 29 --strip-root --pretty # Test interaction with RPolyTest printf "type-alias.js:15:8 " assert_ok "$FLOW" type-at-pos type-alias.js 15 8 --strip-root --pretty printf "type-alias.js:16:8 " assert_ok "$FLOW" type-at-pos type-alias.js 16 8 --strip-root --pretty printf "type-alias.js:17:8 " assert_ok "$FLOW" type-at-pos type-alias.js 17 8 --strip-root --pretty printf "type-alias.js:18:8 " assert_ok "$FLOW" type-at-pos type-alias.js 18 8 --strip-root --pretty printf "type-alias.js:19:8 " assert_ok "$FLOW" type-at-pos type-alias.js 19 8 --strip-root --pretty printf "type-alias.js:20:8 " assert_ok "$FLOW" type-at-pos type-alias.js 20 8 --strip-root --pretty printf "type-alias.js:24:6 " assert_ok "$FLOW" type-at-pos type-alias.js 24 6 --strip-root --pretty --expand-type-aliases printf "type-alias.js:25:6 " assert_ok "$FLOW" type-at-pos type-alias.js 25 6 --strip-root --pretty --expand-type-aliases printf "type-alias.js:27:6 " assert_ok "$FLOW" type-at-pos type-alias.js 27 6 --strip-root --pretty --expand-type-aliases printf "type-alias.js:29:6 " assert_ok "$FLOW" type-at-pos type-alias.js 29 6 --strip-root --pretty --expand-type-aliases printf "type-alias.js:31:6 " assert_ok "$FLOW" type-at-pos type-alias.js 31 6 --strip-root --pretty --expand-type-aliases printf "type-alias.js:34:6 " assert_ok "$FLOW" type-at-pos type-alias.js 34 6 --strip-root --pretty --expand-json-output # type-destructor.js printf "type-destructor.js:3:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 3 6 --strip-root --pretty printf "type-destructor.js:4:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 4 6 --strip-root --pretty printf "type-destructor.js:5:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 5 6 --strip-root --pretty printf "type-destructor.js:8:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 8 6 --strip-root --pretty printf "type-destructor.js:10:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 10 6 --strip-root --pretty printf "type-destructor.js:12:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 12 6 --strip-root --pretty printf "type-destructor.js:13:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 15 6 --strip-root --pretty printf "type-destructor.js:16:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 16 6 --strip-root --pretty printf "type-destructor.js:17:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 17 6 --strip-root --pretty printf "type-destructor.js:19:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 19 6 --strip-root --pretty printf "type-destructor.js:20:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 20 6 --strip-root --pretty printf "type-destructor.js:21:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 21 6 --strip-root --pretty printf "type-destructor.js:23:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 23 6 --strip-root --pretty printf "type-destructor.js:27:5 = " assert_ok "$FLOW" type-at-pos type-destructor.js 27 5 --strip-root --pretty printf "type-destructor.js:28:5 = " assert_ok "$FLOW" type-at-pos type-destructor.js 28 5 --strip-root --pretty printf "type-destructor.js:29:5 = " assert_ok "$FLOW" type-at-pos type-destructor.js 29 5 --strip-root --pretty printf "type-destructor.js:33:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 33 6 --strip-root --pretty printf "type-destructor.js:34:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 34 6 --strip-root --pretty printf "type-destructor.js:36:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 36 6 --strip-root --pretty printf "type-destructor.js:37:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 37 6 --strip-root --pretty printf "type-destructor.js:41:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 41 6 --strip-root --pretty printf "type-destructor.js:42:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 42 6 --strip-root --pretty printf "type-destructor.js:44:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 44 6 --strip-root --pretty printf "type-destructor.js:45:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 45 6 --strip-root --pretty printf "type-destructor.js:47:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 47 6 --strip-root --pretty printf "type-destructor.js:48:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 48 6 --strip-root --pretty printf "type-destructor.js:62:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 62 6 --strip-root --pretty printf "type-destructor.js:63:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 63 6 --strip-root --pretty printf "type-destructor.js:68:13 = " assert_ok "$FLOW" type-at-pos type-destructor.js 68 13 --strip-root --pretty # type-destructor-trigger.js printf "type-destructor-trigger.js:11:7 = " assert_ok "$FLOW" type-at-pos type-destructor-trigger.js 11 7 --strip-root --pretty # unions.js printf "unions.js:9:3 = " assert_ok "$FLOW" type-at-pos unions.js 9 3 --strip-root --pretty printf "unions.js:15:2 = " assert_ok "$FLOW" type-at-pos unions.js 15 2 --strip-root --pretty printf "unions.js:24:3 = " assert_ok "$FLOW" type-at-pos unions.js 24 3 --strip-root --pretty printf "unions.js:43:3 = " assert_ok "$FLOW" type-at-pos unions.js 43 3 --strip-root --pretty printf "unions.js:44:3 = " assert_ok "$FLOW" type-at-pos unions.js 44 3 --strip-root --pretty printf "unions.js:49:1 = " assert_ok "$FLOW" type-at-pos unions.js 49 1 --strip-root --pretty printf "unions.js:52:1 = " assert_ok "$FLOW" type-at-pos unions.js 52 1 --strip-root --pretty printf "unions.js:57:5 = " assert_ok "$FLOW" type-at-pos unions.js 57 5 --strip-root --pretty printf "unions.js:59:18 = " assert_ok "$FLOW" type-at-pos unions.js 59 18 --strip-root --pretty
{ "content_hash": "f78f1f11fc4351be6f7a76440a983cd7", "timestamp": "", "source": "github", "line_count": 389, "max_line_length": 104, "avg_line_length": 46.41388174807198, "alnum_prop": 0.6939905843256715, "repo_name": "popham/flow", "id": "f8ad377bb8fe0b0da7d713659333bce782e61d8f", "size": "18077", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "tests/type-at-pos_types/test.sh", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "157881" }, { "name": "C++", "bytes": "6429" }, { "name": "CSS", "bytes": "47811" }, { "name": "Dockerfile", "bytes": "153" }, { "name": "HTML", "bytes": "36393" }, { "name": "JavaScript", "bytes": "2374184" }, { "name": "Liquid", "bytes": "13690" }, { "name": "Makefile", "bytes": "22213" }, { "name": "OCaml", "bytes": "5643421" }, { "name": "PowerShell", "bytes": "1089" }, { "name": "Python", "bytes": "1359" }, { "name": "Ruby", "bytes": "25540" }, { "name": "Shell", "bytes": "163238" }, { "name": "Standard ML", "bytes": "4343" } ], "symlink_target": "" }
'use strict'; // Load the module dependencies var mongoose = require('mongoose'), crypto = require('crypto'), Schema = mongoose.Schema; // Define a new 'UserSchema' var UserSchema = new Schema({ firstName: String, lastName: String, email: { type: String, // Validate the email format match: [/.+\@.+\..+/, "Please fill a valid email address"] }, username: { type: String, // Set a unique 'username' index unique: true, // Validate 'username' value existance required: 'Username is required', // Trim the 'username' field trim: true }, password: { type: String, // Validate the 'password' value length validate: [ function(password) { return password && password.length > 6; }, 'Password should be longer' ] }, salt: { type: String }, provider: { type: String, // Validate 'provider' value existance required: 'Provider is required' }, providerId: String, providerData: {}, created: { type: Date, // Create a default 'created' value default: Date.now } }); // Set the 'fullname' virtual property UserSchema.virtual('fullName').get(function() { return this.firstName + ' ' + this.lastName; }).set(function(fullName) { var splitName = fullName.split(' '); this.firstName = splitName[0] || ''; this.lastName = splitName[1] || ''; }); // Use a pre-save middleware to hash the password UserSchema.pre('save', function(next) { if (this.password) { this.salt = new Buffer(crypto.randomBytes(16).toString('base64'), 'base64'); this.password = this.hashPassword(this.password); } next(); }); // Create an instance method for hashing a password UserSchema.methods.hashPassword = function(password) { return crypto.pbkdf2Sync(password, this.salt, 10000, 64).toString('base64'); }; // Create an instance method for authenticating user UserSchema.methods.authenticate = function(password) { return this.password === this.hashPassword(password); }; // Find possible not used username UserSchema.statics.findUniqueUsername = function(username, suffix, callback) { var _this = this; // Add a 'username' suffix var possibleUsername = username + (suffix || ''); // Use the 'User' model 'findOne' method to find an available unique username _this.findOne({ username: possibleUsername }, function(err, user) { // If an error occurs call the callback with a null value, otherwise find find an available unique username if (!err) { // If an available unique username was found call the callback method, otherwise call the 'findUniqueUsername' method again with a new suffix if (!user) { callback(possibleUsername); } else { return _this.findUniqueUsername(username, (suffix || 0) + 1, callback); } } else { callback(null); } }); }; // Configure the 'UserSchema' to use getters and virtuals when transforming to JSON UserSchema.set('toJSON', { getters: true, virtuals: true }); // Create the 'User' model out of the 'UserSchema' mongoose.model('User', UserSchema);
{ "content_hash": "d66b4f781b937543040318f88fa1a6fb", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 144, "avg_line_length": 26.345132743362832, "alnum_prop": 0.6896204232448774, "repo_name": "rgonzalr/mean-test", "id": "f30c609334620c271aa87919a84582e8d150617a", "size": "3012", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/models/user.server.model.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "21239" } ], "symlink_target": "" }
#ifndef TRULE_H_ #define TRULE_H_ #include <algorithm> #include <vector> #include <cassert> #include <iostream> #include "boost/shared_ptr.hpp" #include "boost/functional/hash.hpp" #include "sparse_vector.h" #include "wordid.h" #include "tdict.h" class TRule; typedef boost::shared_ptr<TRule> TRulePtr; namespace cdec { struct TreeFragment; } struct AlignmentPoint { AlignmentPoint() : s_(), t_() {} AlignmentPoint(int s, int t) : s_(s), t_(t) {} AlignmentPoint Inverted() const { return AlignmentPoint(t_, s_); } short s_; short t_; }; inline std::ostream& operator<<(std::ostream& os, const AlignmentPoint& p) { return os << static_cast<int>(p.s_) << '-' << static_cast<int>(p.t_); } // Translation rule class TRule { public: TRule() : lhs_(0), prev_i(-1), prev_j(-1) { } TRule(WordID lhs, const WordID* src, int src_size, const WordID* trg, int trg_size, const int* feat_ids, const double* feat_vals, int feat_size, int arity, const AlignmentPoint* als, int alsnum) : e_(trg, trg + trg_size), f_(src, src + src_size), lhs_(lhs), arity_(arity), prev_i(-1), prev_j(-1), a_(als, als + alsnum) { for (int i = 0; i < feat_size; ++i) scores_.set_value(feat_ids[i], feat_vals[i]); } TRule(WordID lhs, const WordID* src, int src_size, const WordID* trg, int trg_size, int arity, int pi, int pj) : e_(trg, trg + trg_size), f_(src, src + src_size), lhs_(lhs), arity_(arity), prev_i(pi), prev_j(pj) {} bool IsGoal() const; explicit TRule(const std::vector<WordID>& e) : e_(e), lhs_(0), prev_i(-1), prev_j(-1) {} TRule(const std::vector<WordID>& e, const std::vector<WordID>& f, const WordID& lhs) : e_(e), f_(f), lhs_(lhs), prev_i(-1), prev_j(-1) {} TRule(const TRule& other) : e_(other.e_), f_(other.f_), lhs_(other.lhs_), scores_(other.scores_), arity_(other.arity_), prev_i(-1), prev_j(-1), a_(other.a_) {} explicit TRule(const std::string& text, bool mono = false) : prev_i(-1), prev_j(-1) { ReadFromString(text, mono); } // make a rule from a hiero-like rule table, e.g. // [X] ||| [X,1] DE [X,2] ||| [X,2] of the [X,1] static TRule* CreateRuleSynchronous(const std::string& rule); // make a rule from a phrasetable entry (i.e., one that has no LHS type), e.g: // el gato ||| the cat ||| Feature_2=0.34 static TRule* CreateRulePhrasetable(const std::string& rule); // make a rule from a non-synchrnous CFG representation, e.g.: // [LHS] ||| term1 [NT] term2 [OTHER_NT] [YET_ANOTHER_NT] static TRule* CreateRuleMonolingual(const std::string& rule); static TRule* CreateLexicalRule(const WordID& src, const WordID& trg) { return new TRule(src, trg); } void ESubstitute(const std::vector<const std::vector<WordID>* >& var_values, std::vector<WordID>* result) const { unsigned vc = 0; result->clear(); for (const auto& c : e_) { if (c < 1) { ++vc; const auto& var_value = *var_values[-c]; std::copy(var_value.begin(), var_value.end(), std::back_inserter(*result)); } else { result->push_back(c); } } assert(vc == var_values.size()); } void FSubstitute(const std::vector<const std::vector<WordID>* >& var_values, std::vector<WordID>* result) const { unsigned vc = 0; result->clear(); for (const auto& c : f_) { if (c < 1) { const auto& var_value = *var_values[vc++]; std::copy(var_value.begin(), var_value.end(), std::back_inserter(*result)); } else { result->push_back(c); } } assert(vc == var_values.size()); } bool ReadFromString(const std::string& line, bool monolingual = false); bool Initialized() const { return e_.size(); } std::string AsString(bool verbose = true) const; friend std::ostream &operator<<(std::ostream &o,TRule const& r); static TRule DummyRule() { TRule res; res.e_.resize(1, 0); return res; } const std::vector<WordID>& f() const { return f_; } const std::vector<WordID>& e() const { return e_; } const std::vector<AlignmentPoint>& als() const { return a_; } int EWords() const { return ELength() - Arity(); } int FWords() const { return FLength() - Arity(); } int FLength() const { return f_.size(); } int ELength() const { return e_.size(); } int Arity() const { return arity_; } bool IsUnary() const { return (Arity() == 1) && (f_.size() == 1); } const SparseVector<double>& GetFeatureValues() const { return scores_; } double Score(int i) const { return scores_.value(i); } WordID GetLHS() const { return lhs_; } void ComputeArity(); // 0 = first variable, -1 = second variable, -2 = third ..., i.e. tail_nodes_[-w] if w<=0, TD::Convert(w) otherwise std::vector<WordID> e_; // < 0: *-1 = encoding of category of variable std::vector<WordID> f_; WordID lhs_; SparseVector<double> scores_; char arity_; std::vector<WordID> ext_states_; // in t2s or t2t translation, this is of length arity_ and // indicates what state the transducer is in after having processed // this transduction rule // these attributes are application-specific and should probably be refactored TRulePtr parent_rule_; // usually NULL, except when doing constrained decoding // this is only used when doing synchronous parsing short int prev_i; short int prev_j; std::vector<AlignmentPoint> a_; // alignment points, may be empty // only for coarse-to-fine decoding boost::shared_ptr<std::vector<TRulePtr> > fine_rules_; // optional, shows internal structure of TSG rules boost::shared_ptr<cdec::TreeFragment> tree_structure; friend class boost::serialization::access; template<class Archive> void save(Archive & ar, const unsigned int /*version*/) const { ar & TD::Convert(-lhs_); unsigned f_size = f_.size(); ar & f_size; assert(f_size <= (sizeof(size_t) * 8)); size_t f_nt_mask = 0; for (int i = f_.size() - 1; i >= 0; --i) { f_nt_mask <<= 1; f_nt_mask |= (f_[i] <= 0 ? 1 : 0); } ar & f_nt_mask; for (unsigned i = 0; i < f_.size(); ++i) ar & TD::Convert(f_[i] < 0 ? -f_[i] : f_[i]); unsigned e_size = e_.size(); ar & e_size; size_t e_nt_mask = 0; assert(e_size <= (sizeof(size_t) * 8)); for (int i = e_.size() - 1; i >= 0; --i) { e_nt_mask <<= 1; e_nt_mask |= (e_[i] <= 0 ? 1 : 0); } ar & e_nt_mask; for (unsigned i = 0; i < e_.size(); ++i) if (e_[i] <= 0) ar & e_[i]; else ar & TD::Convert(e_[i]); ar & arity_; ar & scores_; } template<class Archive> void load(Archive & ar, const unsigned int /*version*/) { std::string lhs; ar & lhs; lhs_ = -TD::Convert(lhs); unsigned f_size; ar & f_size; f_.resize(f_size); size_t f_nt_mask; ar & f_nt_mask; std::string sym; for (unsigned i = 0; i < f_size; ++i) { bool mask = (f_nt_mask & 1); ar & sym; f_[i] = TD::Convert(sym) * (mask ? -1 : 1); f_nt_mask >>= 1; } unsigned e_size; ar & e_size; e_.resize(e_size); size_t e_nt_mask; ar & e_nt_mask; for (unsigned i = 0; i < e_size; ++i) { bool mask = (e_nt_mask & 1); if (mask) { ar & e_[i]; } else { ar & sym; e_[i] = TD::Convert(sym); } e_nt_mask >>= 1; } ar & arity_; ar & scores_; } BOOST_SERIALIZATION_SPLIT_MEMBER() private: TRule(const WordID& src, const WordID& trg) : e_(1, trg), f_(1, src), lhs_(), arity_(), prev_i(), prev_j() {} }; inline size_t hash_value(const TRule& r) { size_t h = boost::hash_value(r.e_); boost::hash_combine(h, -r.lhs_); boost::hash_combine(h, boost::hash_value(r.f_)); return h; } inline bool operator==(const TRule& a, const TRule& b) { return (a.lhs_ == b.lhs_ && a.e_ == b.e_ && a.f_ == b.f_); } #endif
{ "content_hash": "197b1a0b249369689eb0fa35dcd54f3a", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 198, "avg_line_length": 32.74485596707819, "alnum_prop": 0.5776046248586151, "repo_name": "pks/cdec-dtrain-legacy", "id": "7af467473d672f516d47ba10059c275baa5cca0b", "size": "7957", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "decoder/trule.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "100229" }, { "name": "C++", "bytes": "2857299" }, { "name": "Groff", "bytes": "964240" }, { "name": "LLVM", "bytes": "11021" }, { "name": "Perl", "bytes": "204327" }, { "name": "Python", "bytes": "426963" }, { "name": "Ruby", "bytes": "8041" }, { "name": "Shell", "bytes": "3861" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright 2014-2016 Red Hat, Inc. and/or its affiliates and other contributors as indicated by the @author tags. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.hawkular.metrics</groupId> <artifactId>hawkular-metrics-dist</artifactId> <version>0.21.0-SNAPSHOT</version> </parent> <artifactId>hawkular-metrics-standalone-dist</artifactId> <packaging>ear</packaging> <name>Hawkular Metrics Distribution for Standalone</name> <description>Hawkular Metrics Distribution (EAR) for Standalone</description> <dependencies> <dependency> <groupId>org.hawkular.metrics</groupId> <artifactId>hawkular-metrics-standalone</artifactId> <version>${project.version}</version> <type>war</type> </dependency> <dependency> <groupId>org.hawkular.alerts</groupId> <artifactId>hawkular-alerts-rest-standalone</artifactId> <version>${version.org.hawkular.alerts}</version> <type>war</type> </dependency> <dependency> <groupId>org.hawkular.alerts</groupId> <artifactId>hawkular-alerter-metrics</artifactId> <version>${version.org.hawkular.alerts}</version> <type>war</type> </dependency> <!-- Because metrics war has a dependency on alerting war (to inject AlertsService) and both components use cassalog, we hit an issue such that the metrics schema file resources could not be located, the CL was tied to the alerting war. To make them available we are placing the schema jar in the ear's lib, which is available to every deployment's CL. We may not need this if we have a better solution resulting from: https://github.com/hawkular/cassalog/issues/4 --> <dependency> <groupId>org.hawkular.metrics</groupId> <artifactId>hawkular-metrics-schema</artifactId> <version>${project.version}</version> <exclusions> <exclusion> <groupId>*</groupId> <artifactId>*</artifactId> </exclusion> </exclusions> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-ear-plugin</artifactId> <configuration> <version>7</version> <initializeInOrder>true</initializeInOrder> <fileNameMapping>no-version</fileNameMapping> <defaultLibBundleDir>lib/</defaultLibBundleDir> <modules> <webModule> <groupId>org.hawkular.alerts</groupId> <artifactId>hawkular-alerts-rest-standalone</artifactId> <bundleFileName>hawkular-alerts.war</bundleFileName> <contextRoot>/hawkular/alerts</contextRoot> </webModule> <webModule> <groupId>org.hawkular.metrics</groupId> <artifactId>hawkular-metrics-standalone</artifactId> <bundleFileName>hawkular-metrics.war</bundleFileName> <contextRoot>/hawkular/metrics</contextRoot> </webModule> <webModule> <groupId>org.hawkular.alerts</groupId> <artifactId>hawkular-alerter-metrics</artifactId> <contextRoot>/hawkular/__alerter-metrics</contextRoot> </webModule> </modules> </configuration> </plugin> </plugins> </build> </project>
{ "content_hash": "710c6037352cd49c8e4d5994c355a928", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 113, "avg_line_length": 38.757009345794394, "alnum_prop": 0.6631299734748011, "repo_name": "pilhuhn/rhq-metrics", "id": "6f05a668c6c4fc01d9d3870fec8909cf10c5bc7b", "size": "4147", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dist/standalone-ear/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1093" }, { "name": "Groovy", "bytes": "385386" }, { "name": "HTML", "bytes": "3341" }, { "name": "Java", "bytes": "1447082" }, { "name": "JavaScript", "bytes": "1856" }, { "name": "Scala", "bytes": "3666" }, { "name": "Shell", "bytes": "5577" }, { "name": "XSLT", "bytes": "22575" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Autocomplete - Scrollable results</title> <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css"> <script src="../../jquery-1.8.2.js"></script> <script src="../../ui/jquery.ui.core.js"></script> <script src="../../ui/jquery.ui.widget.js"></script> <script src="../../ui/jquery.ui.position.js"></script> <script src="../../ui/jquery.ui.autocomplete.js"></script> <link rel="stylesheet" href="../demos.css"> <style> .ui-autocomplete { max-height: 100px; overflow-y: auto; /* prevent horizontal scrollbar */ overflow-x: hidden; /* add padding to account for vertical scrollbar */ padding-right: 20px; } /* IE 6 doesn't support max-height * we use height instead, but this forces the menu to always be this tall */ * html .ui-autocomplete { height: 100px; } </style> <script> $(function() { var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme" ]; $( "#tags" ).autocomplete({ source: availableTags }); }); </script> </head> <body> <div class="demo"> <div class="ui-widget"> <label for="tags">Tags: </label> <input id="tags" /> </div> </div><!-- End demo --> <div class="demo-description"> <p>When displaying a long list of options, you can simply set the max-height for the autocomplete menu to prevent the menu from growing too large. Try typing "a" or "s" above to get a long list of results that you can scroll through.</p> </div><!-- End demo-description --> </body> </html>
{ "content_hash": "590470269f4f8d0cb27bfedbf98536f2", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 237, "avg_line_length": 22.468354430379748, "alnum_prop": 0.6169014084507042, "repo_name": "freewind/rythmfiddle", "id": "8a648a01e6a2fe769516dadd122084dfef63f307", "size": "1775", "binary": false, "copies": "9", "ref": "refs/heads/master", "path": "public/libs/jquery-ui-1.8.24/development-bundle/demos/autocomplete/maxheight.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "26704" }, { "name": "JavaScript", "bytes": "6934401" }, { "name": "PHP", "bytes": "27631" }, { "name": "Ruby", "bytes": "548" }, { "name": "Shell", "bytes": "1114" } ], "symlink_target": "" }
/* * This file is part of Nucleus, licensed under the MIT License (MIT). See the LICENSE.txt file * at the root of this project for more details. */ package io.github.nucleuspowered.nucleus.modules.world.config; import com.google.common.collect.Lists; import io.github.nucleuspowered.nucleus.internal.qsml.NucleusConfigAdapter; import java.util.List; public class WorldConfigAdapter extends NucleusConfigAdapter.StandardWithSimpleDefault<WorldConfig> { @Override protected List<Transformation> getTransformations() { return Lists.newArrayList( new Transformation(new Object[] { "display-generation-warning" }, ((inputPath, valueAtPath) -> new Object[] { "pre-generation", "display-generation-warning" })) ); } public WorldConfigAdapter() { super(WorldConfig.class); } }
{ "content_hash": "033ec730fbfa161b990695117f1dd1ad", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 118, "avg_line_length": 35.75, "alnum_prop": 0.7097902097902098, "repo_name": "OblivionNW/Nucleus", "id": "fbbb4f8f6196e02fe393fdd435479709728bbd96", "size": "858", "binary": false, "copies": "1", "ref": "refs/heads/sponge-api/7", "path": "src/main/java/io/github/nucleuspowered/nucleus/modules/world/config/WorldConfigAdapter.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "2841749" }, { "name": "Shell", "bytes": "80" } ], "symlink_target": "" }
from __future__ import print_function import sys import esky if getattr(sys,"frozen",False): #app = esky.Esky(sys.executable,"https://example-app.com/downloads/") app = esky.Esky(sys.executable,"http://localhost:8000") try: app.auto_update() except Exception as e: print ("ERROR UPDATING APP:", e) print("HELLO AGAAIN WORLD - Stage 2")
{ "content_hash": "d524af507a85f809a28437d20b6e5369", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 73, "avg_line_length": 24.8, "alnum_prop": 0.6612903225806451, "repo_name": "datalytica/esky", "id": "92fdfad5a5c8f457ec592b00910f096707ba371b", "size": "372", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "tutorial/stage2/example.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "393772" } ], "symlink_target": "" }
package com.swordfish.bdd.senha; import java.util.regex.Pattern; import com.swordfish.bdd.senha.exception.SenhaInvalidaException; import com.swordfish.bdd.senha.model.Configuracao; import com.swordfish.bdd.senha.model.TipoSenha; public class ValidadorSenha { private static String padraoCaracEspeciais = "[$#&%@_*]"; private static void validarTamanho(String senha, Configuracao conf) throws SenhaInvalidaException { if (senha.length() != conf.getTamanho()) { throw new SenhaInvalidaException("Tamanho da senha diferente do especificado."); } } private static void validarPresencaCaracterEspecial(String senha, boolean deveApresentar) throws SenhaInvalidaException { if (deveApresentar) { if (!Pattern.compile(padraoCaracEspeciais).matcher(senha).find()) { throw new SenhaInvalidaException("A senha não apresenta caracteres especiais."); } } else { if (Pattern.compile(padraoCaracEspeciais).matcher(senha).find()) { throw new SenhaInvalidaException("A senha não deve apresentar caracteres especiais."); } } } private static void validarPresencaSubstring(String senha, String substring) throws SenhaInvalidaException { if (senha.indexOf(substring) != -1) { throw new SenhaInvalidaException("A senha não pode apresentar a substring: " + substring + "."); } } private static void validarSenhaAlfabeticaComMaiuscula(String senha) throws SenhaInvalidaException { if (!Pattern.compile("[A-Z]").matcher(senha).find()) { throw new SenhaInvalidaException("Nenhuma letra maiúscula encontrada."); } } private static void validarRepeticaoNumero(String senha) throws SenhaInvalidaException { boolean[] digitosGerados = new boolean[10]; for (int i = 0; i < senha.length(); i++) { int digito = Integer.parseInt(senha.substring(i, i + 1)); if (digitosGerados[digito] == false) { digitosGerados[digito] = true; } else { throw new SenhaInvalidaException("A senha apresenta dígitos repetidos."); } } } public static boolean validar(String senha, Configuracao conf) throws SenhaInvalidaException { validarTamanho(senha, conf); if (conf.getNome() != null) { validarPresencaSubstring(senha, conf.getNome()); } if (conf.getDiaNasc() != null && conf.getMesNasc() != null) { validarPresencaSubstring(senha, (conf.getDiaString()) + String.valueOf(conf.getMesString())); } validarPresencaCaracterEspecial(senha, conf.isCaracteresEspeciais()); String parteNumerica = senha.replaceAll("[a-zA-Z]", "").replaceAll(padraoCaracEspeciais, ""); String parteAlfabetica = senha.replaceAll("\\d", "").replaceAll(padraoCaracEspeciais, ""); if (conf.getTipoSenha().equals(TipoSenha.ALFANUMERICO)) { if (parteNumerica.equals("")) { throw new SenhaInvalidaException("Nenhum dígito encontrado."); } if (parteAlfabetica.equals("")) { throw new SenhaInvalidaException("Nenhuma letra encontrada."); } if (!conf.isRepeticaoNumeros()) { validarRepeticaoNumero(parteNumerica); } if (conf.isMaiuscula()) { validarSenhaAlfabeticaComMaiuscula(senha); } } else if (conf.getTipoSenha().equals(TipoSenha.ALFABETICO)) { if (!parteNumerica.equals("")) { throw new SenhaInvalidaException("A senha não pode apresentar dígitos."); } if (parteAlfabetica.equals("")) { throw new SenhaInvalidaException("Nenhuma letra encontrada."); } if (conf.isMaiuscula()) { validarSenhaAlfabeticaComMaiuscula(senha); } } else if (conf.getTipoSenha().equals(TipoSenha.NUMERICO)) { if (parteNumerica.equals("")) { throw new SenhaInvalidaException("Nenhum dígito encontrado."); } if (!parteAlfabetica.equals("")) { throw new SenhaInvalidaException("A senha não pode apresentar letras."); } if (!conf.isRepeticaoNumeros()) { validarRepeticaoNumero(parteNumerica); } } return true; } }
{ "content_hash": "d173d680c7b46938f7b5d45f707b213b", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 122, "avg_line_length": 32.083333333333336, "alnum_prop": 0.7215584415584415, "repo_name": "tacsio/swordfish", "id": "d06a6ea8b3599aef87c101aebda406ee799295e2", "size": "3860", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/swordfish/bdd/senha/ValidadorSenha.java", "mode": "33188", "license": "mit", "language": [ { "name": "Gherkin", "bytes": "4050" }, { "name": "HTML", "bytes": "9994" }, { "name": "Java", "bytes": "24117" }, { "name": "JavaScript", "bytes": "4318" } ], "symlink_target": "" }
<?php namespace Symfony\Component\Form\Tests\Extension\Core\Type; /** * @author Bernhard Schussek <[email protected]> */ class ButtonTypeTest extends BaseTypeTest { /** * @group legacy */ public function testLegacyName() { $form = $this->factory->create('button'); $this->assertSame('button', $form->getConfig()->getType()->getName()); } public function testCreateButtonInstances() { $this->assertInstanceOf('Symfony\Component\Form\Button', $this->factory->create('Symfony\Component\Form\Extension\Core\Type\ButtonType')); } protected function getTestedType() { return 'Symfony\Component\Form\Extension\Core\Type\ButtonType'; } }
{ "content_hash": "091a578608dcfcc2dcb2fe7d2254b9cd", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 146, "avg_line_length": 24.322580645161292, "alnum_prop": 0.6312997347480106, "repo_name": "pellu/roadtothesuccess", "id": "fc31688c1130d749e666a503ada7201908179128", "size": "990", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/ButtonTypeTest.php", "mode": "33261", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3838" }, { "name": "Batchfile", "bytes": "397" }, { "name": "CSS", "bytes": "234899" }, { "name": "HTML", "bytes": "124940" }, { "name": "JavaScript", "bytes": "104448" }, { "name": "PHP", "bytes": "103849" }, { "name": "Shell", "bytes": "2537" } ], "symlink_target": "" }
<?php namespace Anax\DI; /** * Interface to implement for DI aware services to let them know of the current $di * */ trait TInjectable { /** * Properties */ protected $di; // the service container /** * Set the service container to use * * @param class $di a service container * * @return $this */ public function setDI($di) { $this->di = $di; } /** * Magic method to get and create services. * When created it is also stored as a parameter of this object. * * @param string $service name of class property not existing. * * @return class as the service requested. */ public function __get($service) { $this->$service = $this->di->get($service); return $this->$service; } /** * Magic method to get and create services as a method call. * When created it is also stored as a parameter of this object. * * @param string $service name of class property not existing. * @param array $arguments Additional arguments to sen to the method (NOT IMPLEMENTED). * * @return class as the service requested. */ public function __call($service, $arguments = []) { $this->$service = $this->di->get($service); return $this->$service; } }
{ "content_hash": "9708050324a667d89fffc0fd0aea9c03", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 92, "avg_line_length": 22.46031746031746, "alnum_prop": 0.5547703180212014, "repo_name": "nuvalis/JS-KMOM710", "id": "d044b47a6092ba17a74a4fe9839a320f4b83e110", "size": "1415", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/DI/TInjectable.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "45042" }, { "name": "JavaScript", "bytes": "17115" }, { "name": "PHP", "bytes": "387410" } ], "symlink_target": "" }
// Copyright: 2014 PMSI-AlignAlytics // License: "https://github.com/PMSI-AlignAlytics/dimple/blob/master/MIT-LICENSE.txt" // Source: /src/objects/series/methods/_axisBounds.js this._axisBounds = function (position) { var bounds = { min: 0, max: 0 }, // The primary axis for this comparison primaryAxis = null, // The secondary axis for this comparison secondaryAxis = null, // The running totals of the categories categoryTotals = [], // The maximum index of category totals catCount = 0, measureName, fieldName, distinctCats, aggData = this._positionData; // If the primary axis is x the secondary is y and vice versa, a z axis has no secondary if (position === "x") { primaryAxis = this.x; secondaryAxis = this.y; } else if (position === "y") { primaryAxis = this.y; secondaryAxis = this.x; } else if (position === "z") { primaryAxis = this.z; } else if (position === "p") { primaryAxis = this.p; } else if (position === "c") { primaryAxis = this.c; } // If the corresponding axis is category axis if (primaryAxis.showPercent) { // Iterate the data aggData.forEach(function (d) { if (d[primaryAxis.position + "Bound"] < bounds.min) { bounds.min = d[primaryAxis.position + "Bound"]; } if (d[primaryAxis.position + "Bound"] > bounds.max) { bounds.max = d[primaryAxis.position + "Bound"]; } }, this); } else if (secondaryAxis === null || secondaryAxis.categoryFields === null || secondaryAxis.categoryFields.length === 0) { aggData.forEach(function (d) { // If the primary axis is stacked if (this._isStacked() && (primaryAxis.position === "x" || primaryAxis.position === "y")) { // We just need to push the bounds. A stacked axis will always include 0 so I just need to push the min and max out from there if (d[primaryAxis.position + "Value"] < 0) { bounds.min = bounds.min + d[primaryAxis.position + "Value"]; } else { bounds.max = bounds.max + d[primaryAxis.position + "Value"]; } } else { // If it isn't stacked we need to catch the minimum and maximum values if (d[primaryAxis.position + "Value"] < bounds.min) { bounds.min = d[primaryAxis.position + "Value"]; } if (d[primaryAxis.position + "Value"] > bounds.max) { bounds.max = d[primaryAxis.position + "Value"]; } } }, this); } else { // If this category value (or combination if multiple fields defined) is not already in the array of categories, add it. measureName = primaryAxis.position + "Value"; fieldName = secondaryAxis.position + "Field"; // Get a list of distinct categories on the secondary axis distinctCats = []; aggData.forEach(function (d) { // Create a field for this row in the aggregated data var field = d[fieldName].join("/"), index = distinctCats.indexOf(field); if (index === -1) { distinctCats.push(field); index = distinctCats.length - 1; } // Get the index of the field if (categoryTotals[index] === undefined) { categoryTotals[index] = { min: 0, max: 0 }; if (index >= catCount) { catCount = index + 1; } } // The secondary axis is a category axis, we need to account // for distribution across categories if (this.stacked) { if (d[measureName] < 0) { categoryTotals[index].min = categoryTotals[index].min + d[measureName]; } else { categoryTotals[index].max = categoryTotals[index].max + d[measureName]; } } else { // If it isn't stacked we need to catch the minimum and maximum values if (d[measureName] < categoryTotals[index].min) { categoryTotals[index].min = d[measureName]; } if (d[measureName] > categoryTotals[index].max) { categoryTotals[index].max = d[measureName]; } } }, this); categoryTotals.forEach(function (catTot) { if (catTot !== undefined) { if (catTot.min < bounds.min) { bounds.min = catTot.min; } if (catTot.max > bounds.max) { bounds.max = catTot.max; } } }, this); } return bounds; };
{ "content_hash": "886f8137d96a4dcfb81dd6af18715ac9", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 151, "avg_line_length": 50.24786324786325, "alnum_prop": 0.44021092022452796, "repo_name": "GerHobbelt/dimple", "id": "fb49e900a2232f41952fd68139c4ade1641d7ae0", "size": "5879", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "src/objects/series/methods/_axisBounds.js", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
- W5500 chip development platform for **net'enabled** microcotroller applications - Ethernet (W5500 Hardwired TCP/IP chip) and 32-bit ARM® Cortex™-M0 based designs - Arduino Pin-compatible platform hardware - New Code Samples: [Updated network protocol libraries and example projects](https://github.com/Wiznet/W5500_EVB/blob/master/README.md#related-project-github-repositories) <!-- W5500 EVB pic --> ![W5500 EVB](http://wizwiki.net/wiki/lib/exe/fetch.php?media=products:w5500:w5500_evb:w5500-evb_side.png "W5500 EVB") For more details, please refer to [W5500 EVB page](http://wizwiki.net/wiki/doku.php?id=products:w5500:w5500_evb) in WIZnet Wiki. ## Features - WIZnet W5500 Hardwired TCP/IP chip - Hardwired TCP/IP embedded Ethernet controller - SPI (Serial Peripheral Interface) Microcontroller Interface - Hardwired TCP/IP stack supports TCP, UDP, IPv4, ICMP, ARP, IGMP, and PPPoE protocols - Easy to implement of the other network protocols - NXP LPC11E36/501 MCU (LPC11E36FHN33) - 32-bit ARM® Cortex™-M0 microcontroller running at up to 50MHz - 96kB on-chip flash / 12kB on-chip SRAM / 4kB on-chip EEPROM / Various peripherals - Pin-compatible with Arduino Shields designed for the UNO Rev3 - On-board Temperature sensor / Potentiometer - 2 x Push button switch(SW), 1 x RGB LED, 4-Mbit External Serial Dataflash memory - Ethernet / USB-mini B connector and 10-pin Cortex debug connector for SWD(Serial Wire Debug) - W5500 EVB Arduino Compatible Pinout ![W5500 EVB Arduino Compatible Pinout](http://wizwiki.net/wiki/lib/exe/fetch.php?media=products:w5500:w5500_evb:w5500_evb_v1.0_arduino_pin_map.png "W5500 EVB Arduino Compatible Pinout") - W5500 EVB External Pinout ![W5500 EVB External Pinout](http://wizwiki.net/wiki/lib/exe/fetch.php?media=products:w5500:w5500_evb:w5500_evb_v1.0_external_pin_map.png "W5500 EVB External Pinout") ## Software These are libraries source code and example projects based on LPCXpresso IDE. Requried Libraries are as below. - lpc_chip_11exx (NXP LPC11exx serise chip driver) - wiznet_evb_w5500evb_board (WIZnet W5500 EVB board library) - ioLibrary (WIZnet W5500 EVB ethernet library and protocols) Example projects are as below. - Basic demos (LED blinky and loopback test) - DHCP client - DNS clinet - On-board Temperature sensor - On-board Potentiometer ### ioLibrary GitHub Repository - [ioLibrary](https://github.com/Wiznet/ioLibrary_Driver) : Latest WIZnet chip drivers and protocol libraries for developers ### Related Project GitHub Repositories - [Loopback Test](https://github.com/Wiznet/Loopback_LPC11E36_LPCXpresso): Loopback test example project (TCP server / TCP client / UDP) - [HTTP Server](https://github.com/Wiznet/HTTPServer_LPC11E36_LPCXpresso): Web server example project - [FTP Server](https://github.com/Wiznet/FTP_LPC11E36_LPCXpresso): FTP server example project - [SNMPv1 Agent](https://github.com/Wiznet/SNMP_LPC11E36_LPCXpresso): SNMPv1 agent example project (Get/Set/Trap) - [SNTP Client](https://github.com/Wiznet/SNTP_LPC11E36_LPCXpresso): NTP client example project - [TFTP Client](https://github.com/Wiznet/TFTP_LPC11E36_LPCXpresso): TFTP client example project ## Hardware material, Documents and Others Various materials are could be found at [W5500 EVB page](http://wizwiki.net/wiki/doku.php?id=products:w5500:w5500_evb) in WIZnet Wiki. - Documents - Getting Started: Hello world! / Downloading a new program - Make New W5500 EVB Projects - Technical Reference - Datasheet - Schematic - Partlist - Demension - See also ## Revision History First release : Jun. 2014
{ "content_hash": "6bfa27f5e09c36236d403a15ad194e03", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 185, "avg_line_length": 51.07142857142857, "alnum_prop": 0.7723076923076924, "repo_name": "xd785/W5500_EVB", "id": "a4c1e7bdad5871d103df7d08be8bd6aabce36aef", "size": "3593", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "18940" }, { "name": "C", "bytes": "672184" }, { "name": "C++", "bytes": "176387" }, { "name": "Makefile", "bytes": "217414" } ], "symlink_target": "" }
 #pragma once #include <aws/macie2/Macie2_EXPORTS.h> #include <aws/core/utils/DateTime.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace Macie2 { namespace Model { /** * <p>Provides information about the context in which temporary security * credentials were issued to an entity.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/macie2-2020-01-01/SessionContextAttributes">AWS * API Reference</a></p> */ class AWS_MACIE2_API SessionContextAttributes { public: SessionContextAttributes(); SessionContextAttributes(Aws::Utils::Json::JsonView jsonValue); SessionContextAttributes& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>The date and time, in UTC and ISO 8601 format, when the credentials were * issued.</p> */ inline const Aws::Utils::DateTime& GetCreationDate() const{ return m_creationDate; } /** * <p>The date and time, in UTC and ISO 8601 format, when the credentials were * issued.</p> */ inline bool CreationDateHasBeenSet() const { return m_creationDateHasBeenSet; } /** * <p>The date and time, in UTC and ISO 8601 format, when the credentials were * issued.</p> */ inline void SetCreationDate(const Aws::Utils::DateTime& value) { m_creationDateHasBeenSet = true; m_creationDate = value; } /** * <p>The date and time, in UTC and ISO 8601 format, when the credentials were * issued.</p> */ inline void SetCreationDate(Aws::Utils::DateTime&& value) { m_creationDateHasBeenSet = true; m_creationDate = std::move(value); } /** * <p>The date and time, in UTC and ISO 8601 format, when the credentials were * issued.</p> */ inline SessionContextAttributes& WithCreationDate(const Aws::Utils::DateTime& value) { SetCreationDate(value); return *this;} /** * <p>The date and time, in UTC and ISO 8601 format, when the credentials were * issued.</p> */ inline SessionContextAttributes& WithCreationDate(Aws::Utils::DateTime&& value) { SetCreationDate(std::move(value)); return *this;} /** * <p>Specifies whether the credentials were authenticated with a multi-factor * authentication (MFA) device.</p> */ inline bool GetMfaAuthenticated() const{ return m_mfaAuthenticated; } /** * <p>Specifies whether the credentials were authenticated with a multi-factor * authentication (MFA) device.</p> */ inline bool MfaAuthenticatedHasBeenSet() const { return m_mfaAuthenticatedHasBeenSet; } /** * <p>Specifies whether the credentials were authenticated with a multi-factor * authentication (MFA) device.</p> */ inline void SetMfaAuthenticated(bool value) { m_mfaAuthenticatedHasBeenSet = true; m_mfaAuthenticated = value; } /** * <p>Specifies whether the credentials were authenticated with a multi-factor * authentication (MFA) device.</p> */ inline SessionContextAttributes& WithMfaAuthenticated(bool value) { SetMfaAuthenticated(value); return *this;} private: Aws::Utils::DateTime m_creationDate; bool m_creationDateHasBeenSet = false; bool m_mfaAuthenticated; bool m_mfaAuthenticatedHasBeenSet = false; }; } // namespace Model } // namespace Macie2 } // namespace Aws
{ "content_hash": "c5f28dca6dbbf07a52069f675286d661", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 135, "avg_line_length": 31.554545454545455, "alnum_prop": 0.682800345721694, "repo_name": "aws/aws-sdk-cpp", "id": "fa37f3e30b0a29382ffa3979505a5ea6f5116219", "size": "3590", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "aws-cpp-sdk-macie2/include/aws/macie2/model/SessionContextAttributes.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "309797" }, { "name": "C++", "bytes": "476866144" }, { "name": "CMake", "bytes": "1245180" }, { "name": "Dockerfile", "bytes": "11688" }, { "name": "HTML", "bytes": "8056" }, { "name": "Java", "bytes": "413602" }, { "name": "Python", "bytes": "79245" }, { "name": "Shell", "bytes": "9246" } ], "symlink_target": "" }
package bio.terra.common; import bio.terra.model.ErrorModel; import bio.terra.service.job.JobMapKeys; import bio.terra.stairway.FlightContext; import bio.terra.stairway.FlightMap; import bio.terra.stairway.RetryRuleExponentialBackoff; import bio.terra.stairway.RetryRuleRandomBackoff; import com.fasterxml.jackson.core.type.TypeReference; import com.google.cloud.bigquery.BigQueryException; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; /** Common methods for building flights */ public final class FlightUtils { private static final Logger logger = LoggerFactory.getLogger(FlightUtils.class); private FlightUtils() {} /** * Build an error model and set it as the response * * @param context * @param message * @param responseStatus */ public static void setErrorResponse( FlightContext context, String message, HttpStatus responseStatus) { ErrorModel errorModel = new ErrorModel().message(message); setResponse(context, errorModel, responseStatus); } /** * Set the response and status code in the result map. * * @param context flight context * @param responseObject response object to set * @param responseStatus status code to set */ public static void setResponse( FlightContext context, Object responseObject, HttpStatus responseStatus) { FlightMap workingMap = context.getWorkingMap(); workingMap.put(JobMapKeys.RESPONSE.getKeyName(), responseObject); workingMap.put(JobMapKeys.STATUS_CODE.getKeyName(), responseStatus); } /** * Common logic for deciding if a BigQuery exception is a retry-able IAM propagation error. There * is not a specific reason code for the IAM setPolicy failed error. This check is a bit fragile. * * @param ex exception to test * @return true if exception is likely to be an IAM Propagation error. */ public static boolean isBigQueryIamPropagationError(BigQueryException ex) { if (StringUtils.equals(ex.getReason(), "invalid") && StringUtils.contains(ex.getMessage(), "IAM setPolicy")) { logger.info("Caught probable IAM propagation error - retrying", ex); return true; } return false; } public static RetryRuleRandomBackoff getDefaultRandomBackoffRetryRule(final int maxConcurrency) { return new RetryRuleRandomBackoff(500, maxConcurrency, 5); } public static RetryRuleExponentialBackoff getDefaultExponentialBackoffRetryRule() { return new RetryRuleExponentialBackoff(2, 30, 600); } /** * Given a {@link FlightContext} object, look to see if the there is a value in the input map and * if not, read it from the working map * * @param context The FlightContext object to examine * @param key The map key to attempt to read values from * @param clazz Class used to deserialize the value from the map * @param <T> The type of the expected value in the maps * @return A typed value from the flight context with type T or null if no value is found */ public static <T> T getContextValue(FlightContext context, String key, Class<T> clazz) { T value = context.getInputParameters().get(key, clazz); if (value == null) { value = context.getWorkingMap().get(key, clazz); } return value; } public static <T> T getTyped(FlightMap workingMap, String key) { return workingMap.get(key, new TypeReference<>() {}); } }
{ "content_hash": "0a7a1e6ea3d75e041c5175799499c01e", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 99, "avg_line_length": 36.851063829787236, "alnum_prop": 0.7346997690531177, "repo_name": "DataBiosphere/jade-data-repo", "id": "ac6a6f5f02b8f49a4c605c0103919cc30cab4871", "size": "3464", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/main/java/bio/terra/common/FlightUtils.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ANTLR", "bytes": "7971" }, { "name": "HTML", "bytes": "5990" }, { "name": "Java", "bytes": "4573023" }, { "name": "Python", "bytes": "6461" }, { "name": "Shell", "bytes": "43170" } ], "symlink_target": "" }
saschaeglaucom ============== This is the code for my personal website, [saschaeglau.com](http://www.saschaeglau.com).
{ "content_hash": "5f1e486ac266a4829c0bf8fd409761c1", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 88, "avg_line_length": 30, "alnum_prop": 0.6833333333333333, "repo_name": "tmlye/saschaeglaucom", "id": "775f76ffde48028061d3a64da2c8465a542051b0", "size": "120", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "568" }, { "name": "HTML", "bytes": "2749" } ], "symlink_target": "" }
set -e REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../../.. && pwd -P) export PY=${PY:-python} # Exports: # + CARGO_HOME: The CARGO_HOME of the Pants-controlled rust toolchain. # Exposes: # + bootstrap_rust: Bootstraps a Pants-controlled rust toolchain and associated extras. # shellcheck source=build-support/bin/native/bootstrap_rust.sh source "${REPO_ROOT}/build-support/bin/native/bootstrap_rust.sh" bootstrap_rust >&2 download_binary="${REPO_ROOT}/build-support/bin/download_binary.sh" # The following is needed by grpcio-sys and we have no better way to hook its build.rs than this; # ie: wrapping cargo. cmakeroot="$("${download_binary}" "cmake" "3.9.5" "cmake.tar.gz")" goroot="$("${download_binary}" "go" "1.7.3" "go.tar.gz")/go" # Code generation in the bazel_protos crate needs to be able to find protoc on the PATH. protoc="$("${download_binary}" "protobuf" "3.4.1" "protoc")" export GOROOT="${goroot}" PATH="${cmakeroot}/bin:${goroot}/bin:${CARGO_HOME}/bin:$(dirname "${protoc}"):${PATH}" export PATH export PROTOC="${protoc}" cargo_bin="${CARGO_HOME}/bin/cargo" if [[ -n "${CARGO_WRAPPER_DEBUG}" ]]; then cat << DEBUG >&2 >>> Executing ${cargo_bin} $@ >>> In ENV: >>> GOROOT=${GOROOT} >>> PATH=${PATH} >>> PROTOC=${PROTOC} >>> DEBUG fi exec "${cargo_bin}" "$@"
{ "content_hash": "ca6cc1e47aa598b6bf3f115f6aa8941b", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 97, "avg_line_length": 29.636363636363637, "alnum_prop": 0.6625766871165644, "repo_name": "twitter/pants", "id": "bba51ea1f424ad625d9d725e2636fb02abe4ee52", "size": "1325", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "build-support/bin/native/cargo.sh", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "655" }, { "name": "C++", "bytes": "2010" }, { "name": "CSS", "bytes": "9444" }, { "name": "Dockerfile", "bytes": "5639" }, { "name": "GAP", "bytes": "1283" }, { "name": "Gherkin", "bytes": "919" }, { "name": "Go", "bytes": "2765" }, { "name": "HTML", "bytes": "85294" }, { "name": "Java", "bytes": "498956" }, { "name": "JavaScript", "bytes": "22906" }, { "name": "Python", "bytes": "6700799" }, { "name": "Rust", "bytes": "765598" }, { "name": "Scala", "bytes": "89346" }, { "name": "Shell", "bytes": "94395" }, { "name": "Thrift", "bytes": "2953" } ], "symlink_target": "" }
#ifndef GAME_STRATEGY_OUTSIDE_PATH_HANDLER #define GAME_STRATEGY_OUTSIDE_PATH_HANDLER #include "gameStrategyHandler.h" /** * Creates a new "route" for the robot which is not on a classical Path ! */ void gameStrategyCreateOutsideTemporaryPaths(GameStrategyContext* gameStrategyContext); /** * Do the cleanup when the robot is back to the Track. */ void gameStrategyClearOusideTemporaryPathsAndLocations(GameStrategyContext* gameStrategyContext); #endif
{ "content_hash": "816815fecac4cdd2a57da69a55a04e05", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 97, "avg_line_length": 28.176470588235293, "alnum_prop": 0.7703549060542797, "repo_name": "svanacker/cen-electronic", "id": "ad4f864367c9461ff988ea71e1a6acf46ae6ffe0", "size": "479", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "robot/strategy/gameStrategyOutsidePathHandler.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "3522784" }, { "name": "C++", "bytes": "116495" }, { "name": "Java", "bytes": "13807" }, { "name": "Makefile", "bytes": "49587" }, { "name": "Objective-C", "bytes": "4043" }, { "name": "Shell", "bytes": "8769" } ], "symlink_target": "" }
/* ### * IP: GHIDRA * * 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 ghidra.app.util.viewer.listingpanel; import static org.junit.Assert.*; import java.util.List; import java.util.concurrent.atomic.AtomicReference; import org.junit.*; import docking.widgets.fieldpanel.Layout; import docking.widgets.fieldpanel.support.RowColLocation; import ghidra.GhidraOptions; import ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin; import ghidra.app.plugin.core.navigation.NextPrevAddressPlugin; import ghidra.app.services.CodeViewerService; import ghidra.app.services.ProgramManager; import ghidra.app.util.viewer.field.FieldFactory; import ghidra.app.util.viewer.field.ListingField; import ghidra.framework.options.Options; import ghidra.framework.plugintool.PluginTool; import ghidra.program.database.ProgramBuilder; import ghidra.program.database.ProgramDB; import ghidra.program.model.address.*; import ghidra.program.model.data.PointerDataType; import ghidra.program.model.listing.*; import ghidra.program.model.symbol.RefType; import ghidra.program.model.symbol.SourceType; import ghidra.program.util.*; import ghidra.test.AbstractGhidraHeadedIntegrationTest; import ghidra.test.TestEnv; public class ListingPanelTest extends AbstractGhidraHeadedIntegrationTest { private TestEnv env; private PluginTool tool; private CodeBrowserPlugin cb; private Program program; private AddressFactory addrFactory; private AddressSpace space; private CodeViewerService cvs; private ListingModel listingModel; @Before public void setUp() throws Exception { env = new TestEnv(); tool = env.getTool(); tool.addPlugin(CodeBrowserPlugin.class.getName()); tool.addPlugin(NextPrevAddressPlugin.class.getName()); cb = env.getPlugin(CodeBrowserPlugin.class); loadProgram("notepad"); resetFormatOptions(); cvs = tool.getService(CodeViewerService.class); listingModel = cvs.getListingModel(); } private Layout getLayout(Address addr) { return listingModel.getLayout(addr, false); } @After public void tearDown() { env.dispose(); } private Address addr(long address) { return space.getAddress(address); } private void loadProgram(String programName) throws Exception { program = buildProgram(); ProgramManager pm = tool.getService(ProgramManager.class); pm.openProgram(program.getDomainFile()); addrFactory = program.getAddressFactory(); space = addrFactory.getDefaultAddressSpace(); } private ProgramDB buildProgram() throws Exception { ProgramBuilder builder = new ProgramBuilder("notepad", ProgramBuilder._X86, this); builder.createMemory(".text", "0x1001000", 0x6600); builder.createMemory(".data", "0x1008000", 0x600); builder.createMemory(".data", "0x1008600", 0x1344); builder.createMemory(".rsrc", "0x100a000", 0x5400); builder.applyDataType("0x1001000", PointerDataType.dataType, 4); builder.setBytes("0x1001008", "01 02 03 04"); builder.createMemoryReference("1001100", "1001008", RefType.READ, SourceType.DEFAULT); builder.createLabel("0x1001008", "ADVAPI32.dll_RegQueryValueExW"); builder.createExternalReference("0x1001008", "ADVAPI32.dll", "RegQueryValueExW", 0); builder.setBytes("1004772", "bf 00 01 00 00", true); builder.createMemoryReference("1004700", "1004777", RefType.DATA, SourceType.DEFAULT); return builder.getProgram(); } @Test public void testGetLayout() { // env.showTool(); assertNull(getLayout(addr(0))); Layout l = getLayout(addr(0x1001000)); assertNotNull(l); assertEquals(6, l.getNumFields()); assertNull(getLayout(addr(0x1001001))); } @Test public void testGetStringsFromLayout() { env.showTool(); Layout l = getLayout(addr(0x1001008)); int n = l.getNumFields(); assertEquals(7, n); assertEquals("ADVAPI32.dll_RegQueryValueExW", l.getField(0).getText()); assertEquals("XREF[1]: ", l.getField(1).getText()); assertEquals("01001100(R) ", l.getField(2).getText()); assertEquals("01001008", l.getField(3).getText()); assertEquals("01 02 03 04", l.getField(4).getText()); assertEquals("addr", l.getField(5).getText()); assertEquals("ADVAPI32.dll::RegQueryValueExW", l.getField(6).getText()); } @Test public void testGetStringsFromLayout1() { env.showTool(); Layout l = getLayout(addr(0x1004772)); int n = l.getNumFields(); assertEquals(4, n); assertEquals("01004772", l.getField(0).getText()); assertEquals("bf 00 01 00 00", l.getField(1).getText()); assertEquals("MOV", l.getField(2).getText()); assertEquals("EDI,0x100", l.getField(3).getText()); } @Test public void testProgramLocation1() { Layout l = getLayout(addr(0x1004772)); ListingField f = (ListingField) l.getField(1); assertEquals("bf 00 01 00 00", f.getText()); FieldFactory ff = f.getFieldFactory(); RowColLocation rc = f.textOffsetToScreenLocation(3); ProgramLocation loc = ff.getProgramLocation(rc.row(), rc.col(), f); assertEquals(BytesFieldLocation.class, loc.getClass()); BytesFieldLocation bfloc = (BytesFieldLocation) loc; assertEquals(1, bfloc.getByteIndex()); rc = f.textOffsetToScreenLocation(13); assertEquals(1, rc.row()); loc = ff.getProgramLocation(rc.row(), rc.col(), f); assertEquals(BytesFieldLocation.class, loc.getClass()); bfloc = (BytesFieldLocation) loc; assertEquals(4, bfloc.getByteIndex()); } @Test public void testProgramLocation2() { int id = program.startTransaction("test"); Instruction inst = program.getListing().getInstructionAt(addr(0x1004772)); String comment = "This is a very long comment. I want this sentence to wrap to the next line so that I can test wrapping."; inst.setComment(CodeUnit.EOL_COMMENT, comment); program.endTransaction(id, true); cb.updateNow(); Layout l = getLayout(addr(0x1004772)); env.showTool(); ListingField f = (ListingField) l.getField(4); assertEquals(comment, f.getText()); FieldFactory ff = f.getFieldFactory(); RowColLocation rc = f.textOffsetToScreenLocation(3); ProgramLocation loc = ff.getProgramLocation(rc.row(), rc.col(), f); assertEquals(EolCommentFieldLocation.class, loc.getClass()); EolCommentFieldLocation bfloc = (EolCommentFieldLocation) loc; assertEquals(0, bfloc.getRow()); assertEquals(3, bfloc.getCharOffset()); rc = f.textOffsetToScreenLocation(72); assertEquals(0, rc.row()); loc = ff.getProgramLocation(rc.row(), rc.col(), f); assertEquals(EolCommentFieldLocation.class, loc.getClass()); bfloc = (EolCommentFieldLocation) loc; assertEquals(0, bfloc.getRow()); assertEquals(72, bfloc.getCharOffset()); } @Test public void testProgramLocation3() { int id = program.startTransaction("test"); Instruction inst = program.getListing().getInstructionAt(addr(0x1004772)); String comment = "This is a very long comment. I want this sentence to wrap to the next line so that I can test wrapping."; inst.setComment(CodeUnit.EOL_COMMENT, comment); program.endTransaction(id, true); Options opt = tool.getOptions(GhidraOptions.CATEGORY_BROWSER_FIELDS); opt.setBoolean("EOL Comments Field.Enable Word Wrapping", true); cb.updateNow(); Layout l = getLayout(addr(0x1004772)); env.showTool(); ListingField f = (ListingField) l.getField(4); assertEquals(comment, f.getText()); FieldFactory ff = f.getFieldFactory(); RowColLocation rc = f.textOffsetToScreenLocation(3); ProgramLocation loc = ff.getProgramLocation(rc.row(), rc.col(), f); assertEquals(EolCommentFieldLocation.class, loc.getClass()); EolCommentFieldLocation bfloc = (EolCommentFieldLocation) loc; assertEquals(0, bfloc.getRow()); assertEquals(3, bfloc.getCharOffset()); rc = f.textOffsetToScreenLocation(72); assertEquals(2, rc.row()); loc = ff.getProgramLocation(rc.row(), rc.col(), f); assertEquals(EolCommentFieldLocation.class, loc.getClass()); bfloc = (EolCommentFieldLocation) loc; assertEquals(0, bfloc.getRow()); assertEquals(72, bfloc.getCharOffset()); } @Test public void testProgramLocation4() { int id = program.startTransaction("test"); Instruction inst = program.getListing().getInstructionAt(addr(0x1004772)); String comment1 = "This is a very long comment."; String comment2 = "I want this sentence to wrap to the next line so that I can test wrapping."; String[] comments = new String[] { comment1, comment2 }; inst.setCommentAsArray(CodeUnit.EOL_COMMENT, comments); program.endTransaction(id, true); Options opt = tool.getOptions(GhidraOptions.CATEGORY_BROWSER_FIELDS); opt.setBoolean("EOL Comments Field.Enable Word Wrapping", true); cb.updateNow(); Layout l = getLayout(addr(0x1004772)); env.showTool(); ListingField f = (ListingField) l.getField(4); assertEquals(comment1 + " " + comment2, f.getText()); FieldFactory ff = f.getFieldFactory(); RowColLocation rc = f.textOffsetToScreenLocation(3); ProgramLocation loc = ff.getProgramLocation(rc.row(), rc.col(), f); assertEquals(EolCommentFieldLocation.class, loc.getClass()); EolCommentFieldLocation bfloc = (EolCommentFieldLocation) loc; assertEquals(0, bfloc.getRow()); assertEquals(3, bfloc.getCharOffset()); rc = f.textOffsetToScreenLocation(72); assertEquals(2, rc.row()); loc = ff.getProgramLocation(rc.row(), rc.col(), f); assertEquals(EolCommentFieldLocation.class, loc.getClass()); bfloc = (EolCommentFieldLocation) loc; assertEquals(1, bfloc.getRow()); assertEquals(42, bfloc.getCharOffset()); } @Test public void testTextOffset() { int id = program.startTransaction("test"); Instruction inst = program.getListing().getInstructionAt(addr(0x1004772)); String comment1 = "This is a very long comment."; String comment2 = "I want this sentence to wrap to the next line so that I can test wrapping."; String[] comments = new String[] { comment1, comment2 }; inst.setCommentAsArray(CodeUnit.EOL_COMMENT, comments); program.endTransaction(id, true); // Options opt = tool.getOptions(GhidraOptions.CATEGORY_BROWSER_FIELDS); // opt.putBoolean("test", "EOL Comments Field.Enable Word Wrapping", true); cb.updateNow(); Layout l = getLayout(addr(0x1004772)); env.showTool(); ListingField f = (ListingField) l.getField(4); assertEquals(comment1 + " " + comment2, f.getText()); int offset = f.screenLocationToTextOffset(1, 0); assertEquals("I want", f.getText().substring(offset, offset + 6)); } @Test public void testListingDisplayListener() { showTool(tool); AtomicReference<AddressSetView> addresses = new AtomicReference<>(); CodeViewerService cvs = tool.getService(CodeViewerService.class); cvs.addListingDisplayListener(new AddressSetDisplayListener() { @Override public void visibleAddressesChanged(AddressSetView visibleAddresses) { addresses.set(visibleAddresses); } }); assertNull(addresses.get()); cvs.goTo(new ProgramLocation(program, addr(0x1008000)), false); assertNotNull(addresses.get()); assertTrue(addresses.get().contains(addr(0x1008000))); assertFalse(addresses.get().contains(addr(0x1001000))); cvs.goTo(new ProgramLocation(program, addr(0x1001000)), false); assertNotNull(addresses.get()); assertFalse(addresses.get().contains(addr(0x1008000))); assertTrue(addresses.get().contains(addr(0x1001000))); } private void resetFormatOptions() { Options fieldOptions = cb.getFormatManager().getFieldOptions(); List<String> names = fieldOptions.getOptionNames(); for (String name : names) { if (!name.startsWith("Format Code")) { continue; } if (name.indexOf("Show ") >= 0 || name.indexOf("Flag ") >= 0) { fieldOptions.setBoolean(name, false); } else if (name.indexOf("Lines") >= 0) { fieldOptions.setInt(name, 0); } } waitForPostedSwingRunnables(); cb.updateNow(); } }
{ "content_hash": "060e6eacf2867b8cbad39d8859b7fe1f", "timestamp": "", "source": "github", "line_count": 349, "max_line_length": 109, "avg_line_length": 34.96848137535817, "alnum_prop": 0.7385283513602098, "repo_name": "NationalSecurityAgency/ghidra", "id": "aecaec11a8fcf39184f205303eb14b00803fb735", "size": "12204", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Ghidra/Features/Base/src/test.slow/java/ghidra/app/util/viewer/listingpanel/ListingPanelTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "77536" }, { "name": "Batchfile", "bytes": "21610" }, { "name": "C", "bytes": "1132868" }, { "name": "C++", "bytes": "7334484" }, { "name": "CSS", "bytes": "75788" }, { "name": "GAP", "bytes": "102771" }, { "name": "GDB", "bytes": "3094" }, { "name": "HTML", "bytes": "4121163" }, { "name": "Hack", "bytes": "31483" }, { "name": "Haskell", "bytes": "453" }, { "name": "Java", "bytes": "88669329" }, { "name": "JavaScript", "bytes": "1109" }, { "name": "Lex", "bytes": "22193" }, { "name": "Makefile", "bytes": "15883" }, { "name": "Objective-C", "bytes": "23937" }, { "name": "Pawn", "bytes": "82" }, { "name": "Python", "bytes": "587415" }, { "name": "Shell", "bytes": "234945" }, { "name": "TeX", "bytes": "54049" }, { "name": "XSLT", "bytes": "15056" }, { "name": "Xtend", "bytes": "115955" }, { "name": "Yacc", "bytes": "127754" } ], "symlink_target": "" }
/** * TimeOfDay.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter. */ package com.google.api.ads.dfp.axis.v201306; /** * Represents a specific time in a day. */ public class TimeOfDay implements java.io.Serializable { /* Hour in 24 hour time (0..24). This field must be between 0 * and 24, * inclusive. This field is required. */ private java.lang.Integer hour; /* Minutes in an hour. Currently, only 0, 15, 30, and 45 are supported. * This * field is required. */ private com.google.api.ads.dfp.axis.v201306.MinuteOfHour minute; public TimeOfDay() { } public TimeOfDay( java.lang.Integer hour, com.google.api.ads.dfp.axis.v201306.MinuteOfHour minute) { this.hour = hour; this.minute = minute; } /** * Gets the hour value for this TimeOfDay. * * @return hour * Hour in 24 hour time (0..24). This field must be between 0 * and 24, * inclusive. This field is required. */ public java.lang.Integer getHour() { return hour; } /** * Sets the hour value for this TimeOfDay. * * @param hour * Hour in 24 hour time (0..24). This field must be between 0 * and 24, * inclusive. This field is required. */ public void setHour(java.lang.Integer hour) { this.hour = hour; } /** * Gets the minute value for this TimeOfDay. * * @return minute * Minutes in an hour. Currently, only 0, 15, 30, and 45 are supported. * This * field is required. */ public com.google.api.ads.dfp.axis.v201306.MinuteOfHour getMinute() { return minute; } /** * Sets the minute value for this TimeOfDay. * * @param minute * Minutes in an hour. Currently, only 0, 15, 30, and 45 are supported. * This * field is required. */ public void setMinute(com.google.api.ads.dfp.axis.v201306.MinuteOfHour minute) { this.minute = minute; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof TimeOfDay)) return false; TimeOfDay other = (TimeOfDay) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = true && ((this.hour==null && other.getHour()==null) || (this.hour!=null && this.hour.equals(other.getHour()))) && ((this.minute==null && other.getMinute()==null) || (this.minute!=null && this.minute.equals(other.getMinute()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; if (getHour() != null) { _hashCode += getHour().hashCode(); } if (getMinute() != null) { _hashCode += getMinute().hashCode(); } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(TimeOfDay.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201306", "TimeOfDay")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("hour"); elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201306", "hour")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("minute"); elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201306", "minute")); elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201306", "MinuteOfHour")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
{ "content_hash": "69841e19714337fc01c99bd852cce04b", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 129, "avg_line_length": 32.182857142857145, "alnum_prop": 0.5900213068181818, "repo_name": "nafae/developer", "id": "5b0ef044513e6cfcc0585f14cfb30b1dfbab14a9", "size": "5632", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/dfp_axis/src/main/java/com/google/api/ads/dfp/axis/v201306/TimeOfDay.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "127846798" }, { "name": "Perl", "bytes": "28418" } ], "symlink_target": "" }
global using Autofac.Extensions.DependencyInjection; global using Autofac; global using Azure.Core; global using Azure.Identity; global using Basket.API.Infrastructure.ActionResults; global using Basket.API.Infrastructure.Exceptions; global using Basket.API.Infrastructure.Filters; global using Basket.API.Infrastructure.Middlewares; global using Basket.API.IntegrationEvents.EventHandling; global using Basket.API.IntegrationEvents.Events; global using Basket.API.Model; global using Grpc.Core; global using GrpcBasket; global using HealthChecks.UI.Client; global using Microsoft.AspNetCore.Authentication.JwtBearer; global using Microsoft.AspNetCore.Authorization; global using Microsoft.AspNetCore.Builder; global using Microsoft.AspNetCore.Diagnostics.HealthChecks; global using Microsoft.AspNetCore.Hosting; global using Microsoft.AspNetCore.Http.Features; global using Microsoft.AspNetCore.Http; global using Microsoft.AspNetCore.Mvc.Authorization; global using Microsoft.AspNetCore.Mvc.Filters; global using Microsoft.AspNetCore.Mvc; global using Microsoft.AspNetCore.Server.Kestrel.Core; global using Microsoft.AspNetCore; global using Azure.Messaging.ServiceBus; global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; global using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ; global using Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus; global using Microsoft.eShopOnContainers.Services.Basket.API.Controllers; global using Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Repositories; global using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.EventHandling; global using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Events; global using Microsoft.eShopOnContainers.Services.Basket.API.Model; global using Microsoft.eShopOnContainers.Services.Basket.API.Services; global using Microsoft.eShopOnContainers.Services.Basket.API; global using Microsoft.Extensions.Configuration; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.Extensions.Diagnostics.HealthChecks; global using Microsoft.Extensions.Hosting; global using Microsoft.Extensions.Logging; global using Microsoft.Extensions.Options; global using Microsoft.OpenApi.Models; global using RabbitMQ.Client; global using Serilog.Context; global using Serilog; global using StackExchange.Redis; global using Swashbuckle.AspNetCore.SwaggerGen; global using System.Collections.Generic; global using System.ComponentModel.DataAnnotations; global using System.IdentityModel.Tokens.Jwt; global using System.IO; global using System.Linq; global using System.Net; global using System.Security.Claims; global using System.Text.Json; global using System.Threading.Tasks; global using System;
{ "content_hash": "60e7f99e9e9fccae09178cd329ae3379", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 93, "avg_line_length": 47.885245901639344, "alnum_prop": 0.8657993837726806, "repo_name": "albertodall/eShopOnContainers", "id": "75f7a878e416e1173325df90af75308779c0fd60", "size": "3041", "binary": false, "copies": "3", "ref": "refs/heads/dev", "path": "src/Services/Basket/Basket.API/GlobalUsings.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1196" }, { "name": "C#", "bytes": "933872" }, { "name": "CSS", "bytes": "57213" }, { "name": "Dockerfile", "bytes": "66088" }, { "name": "HTML", "bytes": "101511" }, { "name": "JavaScript", "bytes": "283613" }, { "name": "Mustache", "bytes": "24323" }, { "name": "PowerShell", "bytes": "28577" }, { "name": "SCSS", "bytes": "41494" }, { "name": "Shell", "bytes": "22808" }, { "name": "Smarty", "bytes": "20151" }, { "name": "TypeScript", "bytes": "64288" } ], "symlink_target": "" }
<?php defined('BASEPATH') OR exit('No direct script access allowed'); /* |-------------------------------------------------------------------------- | Base Site URL |-------------------------------------------------------------------------- | | URL to your CodeIgniter root. Typically this will be your base URL, | WITH a trailing slash: | | http://example.com/ | | WARNING: You MUST set this value! | | If it is not set, then CodeIgniter will try guess the protocol and path | your installation, but due to security concerns the hostname will be set | to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise. | The auto-detection mechanism exists only for convenience during | development and MUST NOT be used in production! | | If you need to allow multiple domains, remember that this file is still | a PHP script and you can easily do that on your own. | */ $config['base_url'] = 'http://exp-helper/'; /* |-------------------------------------------------------------------------- | Index File |-------------------------------------------------------------------------- | | Typically this will be your index.php file, unless you've renamed it to | something else. If you are using mod_rewrite to remove the page set this | variable so that it is blank. | */ $config['index_page'] = ''; /* |-------------------------------------------------------------------------- | URI PROTOCOL |-------------------------------------------------------------------------- | | This item determines which server global should be used to retrieve the | URI string. The default setting of 'REQUEST_URI' works for most servers. | If your links do not seem to work, try one of the other delicious flavors: | | 'REQUEST_URI' Uses $_SERVER['REQUEST_URI'] | 'QUERY_STRING' Uses $_SERVER['QUERY_STRING'] | 'PATH_INFO' Uses $_SERVER['PATH_INFO'] | | WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded! */ $config['uri_protocol'] = 'REQUEST_URI'; /* |-------------------------------------------------------------------------- | URL suffix |-------------------------------------------------------------------------- | | This option allows you to add a suffix to all URLs generated by CodeIgniter. | For more information please see the user guide: | | https://codeigniter.com/user_guide/general/urls.html */ $config['url_suffix'] = ''; /* |-------------------------------------------------------------------------- | Default Language |-------------------------------------------------------------------------- | | This determines which set of language files should be used. Make sure | there is an available translation if you intend to use something other | than english. | */ $config['language'] = 'english'; /* |-------------------------------------------------------------------------- | Default Character Set |-------------------------------------------------------------------------- | | This determines which character set is used by default in various methods | that require a character set to be provided. | | See http://php.net/htmlspecialchars for a list of supported charsets. | */ $config['charset'] = 'UTF-8'; /* |-------------------------------------------------------------------------- | Enable/Disable System Hooks |-------------------------------------------------------------------------- | | If you would like to use the 'hooks' feature you must enable it by | setting this variable to TRUE (boolean). See the user guide for details. | */ $config['enable_hooks'] = FALSE; /* |-------------------------------------------------------------------------- | Class Extension Prefix |-------------------------------------------------------------------------- | | This item allows you to set the filename/classname prefix when extending | native libraries. For more information please see the user guide: | | https://codeigniter.com/user_guide/general/core_classes.html | https://codeigniter.com/user_guide/general/creating_libraries.html | */ $config['subclass_prefix'] = 'MY_'; /* |-------------------------------------------------------------------------- | Composer auto-loading |-------------------------------------------------------------------------- | | Enabling this setting will tell CodeIgniter to look for a Composer | package auto-loader script in application/vendor/autoload.php. | | $config['composer_autoload'] = TRUE; | | Or if you have your vendor/ directory located somewhere else, you | can opt to set a specific path as well: | | $config['composer_autoload'] = '/path/to/vendor/autoload.php'; | | For more information about Composer, please visit http://getcomposer.org/ | | Note: This will NOT disable or override the CodeIgniter-specific | autoloading (application/config/autoload.php) */ $config['composer_autoload'] = FALSE; /* |-------------------------------------------------------------------------- | Allowed URL Characters |-------------------------------------------------------------------------- | | This lets you specify which characters are permitted within your URLs. | When someone tries to submit a URL with disallowed characters they will | get a warning message. | | As a security measure you are STRONGLY encouraged to restrict URLs to | as few characters as possible. By default only these are allowed: a-z 0-9~%.:_- | | Leave blank to allow all characters -- but only if you are insane. | | The configured value is actually a regular expression character group | and it will be executed as: ! preg_match('/^[<permitted_uri_chars>]+$/i | | DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!! | */ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; /* |-------------------------------------------------------------------------- | Enable Query Strings |-------------------------------------------------------------------------- | | By default CodeIgniter uses search-engine friendly segment based URLs: | example.com/who/what/where/ | | You can optionally enable standard query string based URLs: | example.com?who=me&what=something&where=here | | Options are: TRUE or FALSE (boolean) | | The other items let you set the query string 'words' that will | invoke your controllers and its functions: | example.com/index.php?c=controller&m=function | | Please note that some of the helpers won't work as expected when | this feature is enabled, since CodeIgniter is designed primarily to | use segment based URLs. | */ $config['enable_query_strings'] = FALSE; $config['controller_trigger'] = 'c'; $config['function_trigger'] = 'm'; $config['directory_trigger'] = 'd'; /* |-------------------------------------------------------------------------- | Allow $_GET array |-------------------------------------------------------------------------- | | By default CodeIgniter enables access to the $_GET array. If for some | reason you would like to disable it, set 'allow_get_array' to FALSE. | | WARNING: This feature is DEPRECATED and currently available only | for backwards compatibility purposes! | */ $config['allow_get_array'] = TRUE; /* |-------------------------------------------------------------------------- | Error Logging Threshold |-------------------------------------------------------------------------- | | You can enable error logging by setting a threshold over zero. The | threshold determines what gets logged. Threshold options are: | | 0 = Disables logging, Error logging TURNED OFF | 1 = Error Messages (including PHP errors) | 2 = Debug Messages | 3 = Informational Messages | 4 = All Messages | | You can also pass an array with threshold levels to show individual error types | | array(2) = Debug Messages, without Error Messages | | For a live site you'll usually only enable Errors (1) to be logged otherwise | your log files will fill up very fast. | */ $config['log_threshold'] = 0; /* |-------------------------------------------------------------------------- | Error Logging Directory Path |-------------------------------------------------------------------------- | | Leave this BLANK unless you would like to set something other than the default | application/logs/ directory. Use a full server path with trailing slash. | */ $config['log_path'] = ''; /* |-------------------------------------------------------------------------- | Log File Extension |-------------------------------------------------------------------------- | | The default filename extension for log files. The default 'php' allows for | protecting the log files via basic scripting, when they are to be stored | under a publicly accessible directory. | | Note: Leaving it blank will default to 'php'. | */ $config['log_file_extension'] = ''; /* |-------------------------------------------------------------------------- | Log File Permissions |-------------------------------------------------------------------------- | | The file system permissions to be applied on newly created log files. | | IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal | integer notation (i.e. 0700, 0644, etc.) */ $config['log_file_permissions'] = 0644; /* |-------------------------------------------------------------------------- | Date Format for Logs |-------------------------------------------------------------------------- | | Each item that is logged has an associated date. You can use PHP date | codes to set your own date formatting | */ $config['log_date_format'] = 'Y-m-d H:i:s'; /* |-------------------------------------------------------------------------- | Error Views Directory Path |-------------------------------------------------------------------------- | | Leave this BLANK unless you would like to set something other than the default | application/views/errors/ directory. Use a full server path with trailing slash. | */ $config['error_views_path'] = ''; /* |-------------------------------------------------------------------------- | Cache Directory Path |-------------------------------------------------------------------------- | | Leave this BLANK unless you would like to set something other than the default | application/cache/ directory. Use a full server path with trailing slash. | */ $config['cache_path'] = ''; /* |-------------------------------------------------------------------------- | Cache Include Query String |-------------------------------------------------------------------------- | | Whether to take the URL query string into consideration when generating | output cache files. Valid options are: | | FALSE = Disabled | TRUE = Enabled, take all query parameters into account. | Please be aware that this may result in numerous cache | files generated for the same page over and over again. | array('q') = Enabled, but only take into account the specified list | of query parameters. | */ $config['cache_query_string'] = FALSE; /* |-------------------------------------------------------------------------- | Encryption Key |-------------------------------------------------------------------------- | | If you use the Encryption class, you must set an encryption key. | See the user guide for more info. | | https://codeigniter.com/user_guide/libraries/encryption.html | */ $config['encryption_key'] = ''; /* |-------------------------------------------------------------------------- | Session Variables |-------------------------------------------------------------------------- | | 'sess_driver' | | The storage driver to use: files, database, redis, memcached | | 'sess_cookie_name' | | The session cookie name, must contain only [0-9a-z_-] characters | | 'sess_expiration' | | The number of SECONDS you want the session to last. | Setting to 0 (zero) means expire when the browser is closed. | | 'sess_save_path' | | The location to save sessions to, driver dependent. | | For the 'files' driver, it's a path to a writable directory. | WARNING: Only absolute paths are supported! | | For the 'database' driver, it's a table name. | Please read up the manual for the format with other session drivers. | | IMPORTANT: You are REQUIRED to set a valid save path! | | 'sess_match_ip' | | Whether to match the user's IP address when reading the session data. | | WARNING: If you're using the database driver, don't forget to update | your session table's PRIMARY KEY when changing this setting. | | 'sess_time_to_update' | | How many seconds between CI regenerating the session ID. | | 'sess_regenerate_destroy' | | Whether to destroy session data associated with the old session ID | when auto-regenerating the session ID. When set to FALSE, the data | will be later deleted by the garbage collector. | | Other session cookie settings are shared with the rest of the application, | except for 'cookie_prefix' and 'cookie_httponly', which are ignored here. | */ $config['sess_driver'] = 'files'; $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_save_path'] = NULL; $config['sess_match_ip'] = FALSE; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = FALSE; /* |-------------------------------------------------------------------------- | Cookie Related Variables |-------------------------------------------------------------------------- | | 'cookie_prefix' = Set a cookie name prefix if you need to avoid collisions | 'cookie_domain' = Set to .your-domain.com for site-wide cookies | 'cookie_path' = Typically will be a forward slash | 'cookie_secure' = Cookie will only be set if a secure HTTPS connection exists. | 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript) | | Note: These settings (with the exception of 'cookie_prefix' and | 'cookie_httponly') will also affect sessions. | */ $config['cookie_prefix'] = ''; $config['cookie_domain'] = ''; $config['cookie_path'] = '/'; $config['cookie_secure'] = FALSE; $config['cookie_httponly'] = FALSE; /* |-------------------------------------------------------------------------- | Standardize newlines |-------------------------------------------------------------------------- | | Determines whether to standardize newline characters in input data, | meaning to replace \r\n, \r, \n occurrences with the PHP_EOL value. | | WARNING: This feature is DEPRECATED and currently available only | for backwards compatibility purposes! | */ $config['standardize_newlines'] = FALSE; /* |-------------------------------------------------------------------------- | Global XSS Filtering |-------------------------------------------------------------------------- | | Determines whether the XSS filter is always active when GET, POST or | COOKIE data is encountered | | WARNING: This feature is DEPRECATED and currently available only | for backwards compatibility purposes! | */ $config['global_xss_filtering'] = FALSE; /* |-------------------------------------------------------------------------- | Cross Site Request Forgery |-------------------------------------------------------------------------- | Enables a CSRF cookie token to be set. When set to TRUE, token will be | checked on a submitted form. If you are accepting user data, it is strongly | recommended CSRF protection be enabled. | | 'csrf_token_name' = The token name | 'csrf_cookie_name' = The cookie name | 'csrf_expire' = The number in seconds the token should expire. | 'csrf_regenerate' = Regenerate token on every submission | 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks */ $config['csrf_protection'] = FALSE; $config['csrf_token_name'] = 'csrf_test_name'; $config['csrf_cookie_name'] = 'csrf_cookie_name'; $config['csrf_expire'] = 7200; $config['csrf_regenerate'] = TRUE; $config['csrf_exclude_uris'] = array(); /* |-------------------------------------------------------------------------- | Output Compression |-------------------------------------------------------------------------- | | Enables Gzip output compression for faster page loads. When enabled, | the output class will test whether your server supports Gzip. | Even if it does, however, not all browsers support compression | so enable only if you are reasonably sure your visitors can handle it. | | Only used if zlib.output_compression is turned off in your php.ini. | Please do not use it together with httpd-level output compression. | | VERY IMPORTANT: If you are getting a blank page when compression is enabled it | means you are prematurely outputting something to your browser. It could | even be a line of whitespace at the end of one of your scripts. For | compression to work, nothing can be sent before the output buffer is called | by the output class. Do not 'echo' any values with compression enabled. | */ $config['compress_output'] = FALSE; /* |-------------------------------------------------------------------------- | Master Time Reference |-------------------------------------------------------------------------- | | Options are 'local' or any PHP supported timezone. This preference tells | the system whether to use your server's local time as the master 'now' | reference, or convert it to the configured one timezone. See the 'date | helper' page of the user guide for information regarding date handling. | */ $config['time_reference'] = 'local'; /* |-------------------------------------------------------------------------- | Rewrite PHP Short Tags |-------------------------------------------------------------------------- | | If your PHP installation does not have short tag support enabled CI | can rewrite the tags on-the-fly, enabling you to utilize that syntax | in your view files. Options are TRUE or FALSE (boolean) | | Note: You need to have eval() enabled for this to work. | */ $config['rewrite_short_tags'] = FALSE; /* |-------------------------------------------------------------------------- | Reverse Proxy IPs |-------------------------------------------------------------------------- | | If your server is behind a reverse proxy, you must whitelist the proxy | IP addresses from which CodeIgniter should trust headers such as | HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify | the visitor's IP address. | | You can use both an array or a comma-separated list of proxy addresses, | as well as specifying whole subnets. Here are a few examples: | | Comma-separated: '10.0.1.200,192.168.5.0/24' | Array: array('10.0.1.200', '192.168.5.0/24') */ $config['proxy_ips'] = '';
{ "content_hash": "9af961b3fbdb191b40832bfaddd86614", "timestamp": "", "source": "github", "line_count": 523, "max_line_length": 83, "avg_line_length": 35.267686424474185, "alnum_prop": 0.542314990512334, "repo_name": "ExpMoD/Ex-helper", "id": "7e5e82fc51cb506683e061a5bfa82255447aefe9", "size": "18445", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/config/config.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "365" }, { "name": "CSS", "bytes": "54709" }, { "name": "HTML", "bytes": "8515431" }, { "name": "JavaScript", "bytes": "62629" }, { "name": "PHP", "bytes": "1802630" } ], "symlink_target": "" }
<li class="avam-selectable-item avam-group-menu" ng-click="onToggleSubMenu()" ng-class="{'avam-menu-item-horizontal' : !isVertical()}"> <div class="avam-noselect" > <i class="glyphicon {{icon}} avam-menu-icon"></i> {{label}} <i class="glyphicon glyphicon-menu-left avam-menu-group-indicator" ng-class="{'glyphicon-menu-down' : isOpen}" ng-show="isVertical()" ></i> </div> </li> <div ng-show="isOpen" class="avam-sub-menu avam-fade-in-animation" ng-class="{'avam-drop-down-menu' : !isVertical()}"> <ul ng-transclude></ul> </div>
{ "content_hash": "b7d17734dd7005adcb8e108ec60c1a28", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 77, "avg_line_length": 36.6, "alnum_prop": 0.663023679417122, "repo_name": "aryaadi3020/avamMenu", "id": "86d409a0ed24d5d1b37f0de6af872956a2a121a4", "size": "549", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/avamMenuGroup.template.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2224" }, { "name": "HTML", "bytes": "3000" }, { "name": "JavaScript", "bytes": "10337" }, { "name": "TypeScript", "bytes": "6297" } ], "symlink_target": "" }
namespace flutter_runner { namespace { // Layer separation is as infinitesimal as possible without introducing // Z-fighting. constexpr float kScenicZElevationBetweenLayers = 0.0001f; constexpr float kScenicZElevationForPlatformView = 100.f; constexpr float kScenicElevationForInputInterceptor = 500.f; SkScalar OpacityFromMutatorStack(const flutter::MutatorsStack& mutatorsStack) { SkScalar mutatorsOpacity = 1.f; for (auto i = mutatorsStack.Bottom(); i != mutatorsStack.Top(); ++i) { const auto& mutator = *i; switch (mutator->GetType()) { case flutter::MutatorType::opacity: { mutatorsOpacity *= std::clamp(mutator->GetAlphaFloat(), 0.f, 1.f); } break; default: { break; } } } return mutatorsOpacity; } SkMatrix TransformFromMutatorStack( const flutter::MutatorsStack& mutatorsStack) { SkMatrix mutatorsTransform; for (auto i = mutatorsStack.Bottom(); i != mutatorsStack.Top(); ++i) { const auto& mutator = *i; switch (mutator->GetType()) { case flutter::MutatorType::transform: { mutatorsTransform.preConcat(mutator->GetMatrix()); } break; default: { break; } } } return mutatorsTransform; } } // namespace FuchsiaExternalViewEmbedder::FuchsiaExternalViewEmbedder( std::string debug_label, fuchsia::ui::views::ViewToken view_token, scenic::ViewRefPair view_ref_pair, SessionConnection& session, VulkanSurfaceProducer& surface_producer, bool intercept_all_input) : session_(session), surface_producer_(surface_producer), root_view_(session_.get(), std::move(view_token), std::move(view_ref_pair.control_ref), std::move(view_ref_pair.view_ref), debug_label), metrics_node_(session_.get()), layer_tree_node_(session_.get()) { layer_tree_node_.SetLabel("Flutter::LayerTree"); metrics_node_.SetLabel("Flutter::MetricsWatcher"); metrics_node_.SetEventMask(fuchsia::ui::gfx::kMetricsEventMask); metrics_node_.AddChild(layer_tree_node_); root_view_.AddChild(metrics_node_); // Set up the input interceptor at the top of the scene, if applicable. It // will capture all input, and any unwanted input will be reinjected into // embedded views. if (intercept_all_input) { input_interceptor_node_.emplace(session_.get()); input_interceptor_node_->SetLabel("Flutter::InputInterceptor"); input_interceptor_node_->SetHitTestBehavior( fuchsia::ui::gfx::HitTestBehavior::kDefault); input_interceptor_node_->SetSemanticVisibility(false); metrics_node_.AddChild(input_interceptor_node_.value()); } session_.Present(); } FuchsiaExternalViewEmbedder::~FuchsiaExternalViewEmbedder() = default; SkCanvas* FuchsiaExternalViewEmbedder::GetRootCanvas() { auto found = frame_layers_.find(kRootLayerId); if (found == frame_layers_.end()) { FML_DLOG(WARNING) << "No root canvas could be found. This is extremely unlikely and " "indicates that the external view embedder did not receive the " "notification to begin the frame."; return nullptr; } return found->second.canvas_spy->GetSpyingCanvas(); } std::vector<SkCanvas*> FuchsiaExternalViewEmbedder::GetCurrentCanvases() { std::vector<SkCanvas*> canvases; for (const auto& layer : frame_layers_) { // This method (for legacy reasons) expects non-root current canvases. if (layer.first.has_value()) { canvases.push_back(layer.second.canvas_spy->GetSpyingCanvas()); } } return canvases; } void FuchsiaExternalViewEmbedder::PrerollCompositeEmbeddedView( int view_id, std::unique_ptr<flutter::EmbeddedViewParams> params) { zx_handle_t handle = static_cast<zx_handle_t>(view_id); FML_DCHECK(frame_layers_.count(handle) == 0); frame_layers_.emplace(std::make_pair(EmbedderLayerId{handle}, EmbedderLayer(frame_size_, *params))); frame_composition_order_.push_back(handle); } SkCanvas* FuchsiaExternalViewEmbedder::CompositeEmbeddedView(int view_id) { zx_handle_t handle = static_cast<zx_handle_t>(view_id); auto found = frame_layers_.find(handle); FML_DCHECK(found != frame_layers_.end()); return found->second.canvas_spy->GetSpyingCanvas(); } flutter::PostPrerollResult FuchsiaExternalViewEmbedder::PostPrerollAction( fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) { return flutter::PostPrerollResult::kSuccess; } void FuchsiaExternalViewEmbedder::BeginFrame( SkISize frame_size, GrDirectContext* context, double device_pixel_ratio, fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) { TRACE_EVENT0("flutter", "FuchsiaExternalViewEmbedder::BeginFrame"); // Reset for new frame. Reset(); frame_size_ = frame_size; frame_dpr_ = device_pixel_ratio; // Create the root layer. frame_layers_.emplace( std::make_pair(kRootLayerId, EmbedderLayer(frame_size, std::nullopt))); frame_composition_order_.push_back(kRootLayerId); // Set up the input interceptor at the top of the scene, if applicable. if (input_interceptor_node_.has_value()) { const uint64_t rect_hash = (static_cast<uint64_t>(frame_size_.width()) << 32) + frame_size_.height(); // Create a new rect if needed for the interceptor. auto found_rect = scenic_interceptor_rects_.find(rect_hash); if (found_rect == scenic_interceptor_rects_.end()) { auto [emplaced_rect, success] = scenic_interceptor_rects_.emplace(std::make_pair( rect_hash, scenic::Rectangle(session_.get(), frame_size_.width(), frame_size_.height()))); FML_DCHECK(success); found_rect = std::move(emplaced_rect); } // TODO(fxb/): Don't hardcode elevation. input_interceptor_node_->SetTranslation( frame_size.width() * 0.5f, frame_size.height() * 0.5f, -kScenicElevationForInputInterceptor); input_interceptor_node_->SetShape(found_rect->second); } } void FuchsiaExternalViewEmbedder::EndFrame( bool should_resubmit_frame, fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) { TRACE_EVENT0("flutter", "FuchsiaExternalViewEmbedder::EndFrame"); } void FuchsiaExternalViewEmbedder::SubmitFrame( GrDirectContext* context, std::unique_ptr<flutter::SurfaceFrame> frame, const std::shared_ptr<const fml::SyncSwitch>& gpu_disable_sync_switch) { TRACE_EVENT0("flutter", "FuchsiaExternalViewEmbedder::SubmitFrame"); std::vector<std::unique_ptr<SurfaceProducerSurface>> frame_surfaces; std::unordered_map<EmbedderLayerId, size_t> frame_surface_indices; // Create surfaces for the frame and associate them with layer IDs. { TRACE_EVENT0("flutter", "CreateSurfaces"); for (const auto& layer : frame_layers_) { if (!layer.second.canvas_spy->DidDrawIntoCanvas()) { continue; } auto surface = surface_producer_.ProduceSurface(layer.second.surface_size); FML_DCHECK(surface) << "Embedder did not return a valid render target of size (" << layer.second.surface_size.width() << ", " << layer.second.surface_size.height() << ")"; frame_surface_indices.emplace( std::make_pair(layer.first, frame_surfaces.size())); frame_surfaces.emplace_back(std::move(surface)); } } // Submit layers and platform views to Scenic in composition order. { TRACE_EVENT0("flutter", "SubmitLayers"); std::unordered_map<uint64_t, size_t> scenic_rect_indices; size_t scenic_layer_index = 0; float embedded_views_height = 0.0f; // First re-scale everything according to the DPR. const float inv_dpr = 1.0f / frame_dpr_; layer_tree_node_.SetScale(inv_dpr, inv_dpr, 1.0f); bool first_layer = true; for (const auto& layer_id : frame_composition_order_) { const auto& layer = frame_layers_.find(layer_id); FML_DCHECK(layer != frame_layers_.end()); // Draw the PlatformView associated with each layer first. if (layer_id.has_value()) { FML_DCHECK(layer->second.embedded_view_params.has_value()); auto& view_params = layer->second.embedded_view_params.value(); // Validate the MutatorsStack encodes the same transform as the // transform matrix. FML_DCHECK(TransformFromMutatorStack(view_params.mutatorsStack()) == view_params.transformMatrix()); // Get the ScenicView structure corresponding to the platform view. auto found = scenic_views_.find(layer_id.value()); FML_DCHECK(found != scenic_views_.end()); auto& view_holder = found->second; // Compute offset and size for the platform view. const SkMatrix& view_transform = view_params.transformMatrix(); const SkPoint view_offset = SkPoint::Make( view_transform.getTranslateX(), view_transform.getTranslateY()); const SkSize view_size = view_params.sizePoints(); const SkSize view_scale = SkSize::Make(view_transform.getScaleX(), view_transform.getScaleY()); FML_DCHECK(!view_size.isEmpty() && !view_scale.isEmpty()); // Compute opacity for the platform view. const float view_opacity = OpacityFromMutatorStack(view_params.mutatorsStack()); // Set opacity. if (view_opacity != view_holder.opacity) { view_holder.opacity_node.SetOpacity(view_opacity); view_holder.opacity = view_opacity; } // Set transform and elevation. const float view_elevation = kScenicZElevationBetweenLayers * scenic_layer_index + embedded_views_height; if (view_offset != view_holder.offset || view_scale != view_holder.scale || view_elevation != view_holder.elevation) { view_holder.entity_node.SetTranslation(view_offset.fX, view_offset.fY, -view_elevation); view_holder.entity_node.SetScale(view_scale.fWidth, view_scale.fHeight, 1.f); view_holder.offset = view_offset; view_holder.scale = view_scale; view_holder.elevation = view_elevation; } // Set HitTestBehavior. if (view_holder.pending_hit_testable != view_holder.hit_testable) { view_holder.entity_node.SetHitTestBehavior( view_holder.pending_hit_testable ? fuchsia::ui::gfx::HitTestBehavior::kDefault : fuchsia::ui::gfx::HitTestBehavior::kSuppress); view_holder.hit_testable = view_holder.pending_hit_testable; } // Set size, occlusion hint, and focusable. // // Scenic rejects `SetViewProperties` calls with a zero size. if (!view_size.isEmpty() && (view_size != view_holder.size || view_holder.pending_occlusion_hint != view_holder.occlusion_hint || view_holder.pending_focusable != view_holder.focusable)) { view_holder.size = view_size; view_holder.occlusion_hint = view_holder.pending_occlusion_hint; view_holder.focusable = view_holder.pending_focusable; view_holder.view_holder.SetViewProperties({ .bounding_box = { .min = {.x = 0.f, .y = 0.f, .z = -1000.f}, .max = {.x = view_holder.size.fWidth, .y = view_holder.size.fHeight, .z = 0.f}, }, .inset_from_min = {.x = view_holder.occlusion_hint.fLeft, .y = view_holder.occlusion_hint.fTop, .z = 0.f}, .inset_from_max = {.x = view_holder.occlusion_hint.fRight, .y = view_holder.occlusion_hint.fBottom, .z = 0.f}, .focus_change = view_holder.focusable, }); } // Attach the ScenicView to the main scene graph. layer_tree_node_.AddChild(view_holder.opacity_node); // Account for the ScenicView's height when positioning the next layer. embedded_views_height += kScenicZElevationForPlatformView; } if (layer->second.canvas_spy->DidDrawIntoCanvas()) { const auto& surface_index = frame_surface_indices.find(layer_id); FML_DCHECK(surface_index != frame_surface_indices.end()); uint32_t surface_image_id = frame_surfaces[surface_index->second]->GetImageId(); // Create a new layer if needed for the surface. FML_DCHECK(scenic_layer_index <= scenic_layers_.size()); if (scenic_layer_index == scenic_layers_.size()) { ScenicLayer new_layer{ .shape_node = scenic::ShapeNode(session_.get()), .material = scenic::Material(session_.get()), }; new_layer.shape_node.SetMaterial(new_layer.material); scenic_layers_.emplace_back(std::move(new_layer)); } // Compute a hash and index for the rect. const uint64_t rect_hash = (static_cast<uint64_t>(layer->second.surface_size.width()) << 32) + layer->second.surface_size.height(); size_t rect_index = 0; auto found_index = scenic_rect_indices.find(rect_hash); if (found_index == scenic_rect_indices.end()) { scenic_rect_indices.emplace(std::make_pair(rect_hash, 0)); } else { rect_index = found_index->second + 1; scenic_rect_indices[rect_hash] = rect_index; } // Create a new rect if needed for the surface. auto found_rects = scenic_rects_.find(rect_hash); if (found_rects == scenic_rects_.end()) { auto [emplaced_rects, success] = scenic_rects_.emplace( std::make_pair(rect_hash, std::vector<scenic::Rectangle>())); FML_DCHECK(success); found_rects = std::move(emplaced_rects); } FML_DCHECK(rect_index <= found_rects->second.size()); if (rect_index == found_rects->second.size()) { found_rects->second.emplace_back(scenic::Rectangle( session_.get(), layer->second.surface_size.width(), layer->second.surface_size.height())); } // Set layer shape and texture. // Scenic currently lacks an API to enable rendering of alpha channel; // Flutter Embedder also lacks an API to detect if a layer has alpha or // not. Alpha channels are only rendered if there is a OpacityNode // higher in the tree with opacity != 1. For now, always assume t he // layer has alpha and clamp to a infinitesimally smaller value than 1. // // This does not cause visual problems in practice, but probably has // performance implications. auto& scenic_layer = scenic_layers_[scenic_layer_index]; auto& scenic_rect = found_rects->second[rect_index]; const float layer_elevation = kScenicZElevationBetweenLayers * scenic_layer_index + embedded_views_height; scenic_layer.shape_node.SetLabel("Flutter::Layer"); scenic_layer.shape_node.SetShape(scenic_rect); scenic_layer.shape_node.SetTranslation( layer->second.surface_size.width() * 0.5f, layer->second.surface_size.height() * 0.5f, -layer_elevation); scenic_layer.material.SetColor(SK_AlphaOPAQUE, SK_AlphaOPAQUE, SK_AlphaOPAQUE, SK_AlphaOPAQUE - 1); scenic_layer.material.SetTexture(surface_image_id); // Only the first (i.e. the bottom-most) layer should receive input. // TODO: Workaround for invisible overlays stealing input. Remove when // the underlying bug is fixed. if (first_layer) { scenic_layer.shape_node.SetHitTestBehavior( fuchsia::ui::gfx::HitTestBehavior::kDefault); } else { scenic_layer.shape_node.SetHitTestBehavior( fuchsia::ui::gfx::HitTestBehavior::kSuppress); } first_layer = false; // Attach the ScenicLayer to the main scene graph. layer_tree_node_.AddChild(scenic_layer.shape_node); // Account for the ScenicLayer's height when positioning the next layer. scenic_layer_index++; } } } // Present the session to Scenic, along with surface acquire/release fencess. { TRACE_EVENT0("flutter", "SessionPresent"); session_.Present(); } // Render the recorded SkPictures into the surfaces. { TRACE_EVENT0("flutter", "RasterizeSurfaces"); for (const auto& surface_index : frame_surface_indices) { TRACE_EVENT0("flutter", "RasterizeSurface"); const auto& layer = frame_layers_.find(surface_index.first); FML_DCHECK(layer != frame_layers_.end()); sk_sp<SkPicture> picture = layer->second.recorder->finishRecordingAsPicture(); FML_DCHECK(picture); sk_sp<SkSurface> sk_surface = frame_surfaces[surface_index.second]->GetSkiaSurface(); FML_DCHECK(sk_surface); FML_DCHECK(SkISize::Make(sk_surface->width(), sk_surface->height()) == frame_size_); SkCanvas* canvas = sk_surface->getCanvas(); FML_DCHECK(canvas); canvas->setMatrix(SkMatrix::I()); canvas->clear(SK_ColorTRANSPARENT); canvas->drawPicture(picture); canvas->flush(); } } // Flush deferred Skia work and inform Scenic that render targets are ready. { TRACE_EVENT0("flutter", "PresentSurfaces"); surface_producer_.OnSurfacesPresented(std::move(frame_surfaces)); } // Submit the underlying render-backend-specific frame for processing. frame->Submit(); } void FuchsiaExternalViewEmbedder::EnableWireframe(bool enable) { session_.get()->Enqueue( scenic::NewSetEnableDebugViewBoundsCmd(root_view_.id(), enable)); session_.Present(); } void FuchsiaExternalViewEmbedder::CreateView(int64_t view_id, ViewIdCallback on_view_bound) { FML_DCHECK(scenic_views_.find(view_id) == scenic_views_.end()); ScenicView new_view = { .opacity_node = scenic::OpacityNodeHACK(session_.get()), .entity_node = scenic::EntityNode(session_.get()), .view_holder = scenic::ViewHolder( session_.get(), scenic::ToViewHolderToken(zx::eventpair((zx_handle_t)view_id)), "Flutter::PlatformView"), }; on_view_bound(new_view.view_holder.id()); new_view.opacity_node.SetLabel("flutter::PlatformView::OpacityMutator"); new_view.entity_node.SetLabel("flutter::PlatformView::TransformMutator"); new_view.opacity_node.AddChild(new_view.entity_node); new_view.entity_node.Attach(new_view.view_holder); new_view.entity_node.SetTranslation(0.f, 0.f, -kScenicZElevationBetweenLayers); scenic_views_.emplace(std::make_pair(view_id, std::move(new_view))); } void FuchsiaExternalViewEmbedder::DestroyView(int64_t view_id, ViewIdCallback on_view_unbound) { auto scenic_view = scenic_views_.find(view_id); FML_DCHECK(scenic_view != scenic_views_.end()); scenic::ResourceId resource_id = scenic_view->second.view_holder.id(); scenic_views_.erase(scenic_view); on_view_unbound(resource_id); } void FuchsiaExternalViewEmbedder::SetViewProperties( int64_t view_id, const SkRect& occlusion_hint, bool hit_testable, bool focusable) { auto found = scenic_views_.find(view_id); FML_DCHECK(found != scenic_views_.end()); auto& view_holder = found->second; view_holder.pending_occlusion_hint = occlusion_hint; view_holder.pending_hit_testable = hit_testable; view_holder.pending_focusable = focusable; } void FuchsiaExternalViewEmbedder::Reset() { frame_layers_.clear(); frame_composition_order_.clear(); frame_size_ = SkISize::Make(0, 0); frame_dpr_ = 1.f; // Detach the root node to prepare for the next frame. layer_tree_node_.DetachChildren(); // Clear images on all layers so they aren't cached unnecessarily. for (auto& layer : scenic_layers_) { layer.material.SetTexture(0); } } } // namespace flutter_runner
{ "content_hash": "862cd68c6907b88bc01e42620821b03c", "timestamp": "", "source": "github", "line_count": 531, "max_line_length": 80, "avg_line_length": 38.48022598870057, "alnum_prop": 0.6367640581412422, "repo_name": "jason-simmons/sky_engine", "id": "f14d5e8e9d8567d1708be6f2868085c6c8d495d5", "size": "20942", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "shell/platform/fuchsia/flutter/fuchsia_external_view_embedder.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "2706" }, { "name": "C", "bytes": "303671" }, { "name": "C++", "bytes": "19916615" }, { "name": "Dart", "bytes": "59878" }, { "name": "Groff", "bytes": "29030" }, { "name": "Java", "bytes": "773038" }, { "name": "JavaScript", "bytes": "6905" }, { "name": "Makefile", "bytes": "402" }, { "name": "Objective-C", "bytes": "134360" }, { "name": "Objective-C++", "bytes": "431612" }, { "name": "Python", "bytes": "2745849" }, { "name": "Shell", "bytes": "180384" }, { "name": "nesC", "bytes": "18347" } ], "symlink_target": "" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的一般信息由以下 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("SettlementApi.Context")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("SettlementApi.Context")] [assembly: AssemblyCopyright("Copyright © Microsoft 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] //将 ComVisible 设置为 false 将使此程序集中的类型 //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, //请将此类型的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("a1392550-9420-4dad-9635-20fa2dce1897")] // 程序集的版本信息由下列四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: : // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "content_hash": "db2a1b5310d9f2ab1d9b7f603fa02a1b", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 59, "avg_line_length": 27.25, "alnum_prop": 0.7227319062181448, "repo_name": "wjwu/Settlement-React", "id": "31beba7d81eec8b8ab5ab865b2bea7a16b657837", "size": "1332", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SettlementApi/SettlementApi.Context/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "100" }, { "name": "C#", "bytes": "259242" }, { "name": "CSS", "bytes": "2574" }, { "name": "HTML", "bytes": "6701" }, { "name": "JavaScript", "bytes": "170105" } ], "symlink_target": "" }
package edu.swmed.qbrc.jacksonate.rest.jackson.writers; import java.io.IOException; import org.codehaus.jackson.JsonGenerationException; import org.codehaus.jackson.JsonGenerator; public class IntegerWriter implements Callable<Integer> { @Override public void call(Object param, JsonGenerator jgen) throws JsonGenerationException, IOException { if (param != null) jgen.writeNumber((Integer)param); else jgen.writeNull(); } }
{ "content_hash": "cceb46be2ad777920dd522ad2405e06b", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 97, "avg_line_length": 29.333333333333332, "alnum_prop": 0.7909090909090909, "repo_name": "QBRC/Jacksonate", "id": "60c010da7804a99d4dae5b9ddbea0771ce4c135d", "size": "440", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/edu/swmed/qbrc/jacksonate/rest/jackson/writers/IntegerWriter.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "30740" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Wed Mar 04 22:48:15 CET 2015 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Class org.optaplanner.core.config.exhaustivesearch.ExhaustiveSearchType (OptaPlanner distribution 6.2.0.Final API) </TITLE> <META NAME="date" CONTENT="2015-03-04"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.optaplanner.core.config.exhaustivesearch.ExhaustiveSearchType (OptaPlanner distribution 6.2.0.Final API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchType.html" title="enum in org.optaplanner.core.config.exhaustivesearch"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>OptaPlanner distribution 6.2.0.Final</b></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/optaplanner/core/config/exhaustivesearch//class-useExhaustiveSearchType.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ExhaustiveSearchType.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>org.optaplanner.core.config.exhaustivesearch.ExhaustiveSearchType</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchType.html" title="enum in org.optaplanner.core.config.exhaustivesearch">ExhaustiveSearchType</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.optaplanner.core.config.exhaustivesearch"><B>org.optaplanner.core.config.exhaustivesearch</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.optaplanner.core.config.exhaustivesearch"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchType.html" title="enum in org.optaplanner.core.config.exhaustivesearch">ExhaustiveSearchType</A> in <A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/package-summary.html">org.optaplanner.core.config.exhaustivesearch</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Fields in <A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/package-summary.html">org.optaplanner.core.config.exhaustivesearch</A> declared as <A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchType.html" title="enum in org.optaplanner.core.config.exhaustivesearch">ExhaustiveSearchType</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;<A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchType.html" title="enum in org.optaplanner.core.config.exhaustivesearch">ExhaustiveSearchType</A></CODE></FONT></TD> <TD><CODE><B>ExhaustiveSearchPhaseConfig.</B><B><A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchPhaseConfig.html#exhaustiveSearchType">exhaustiveSearchType</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/package-summary.html">org.optaplanner.core.config.exhaustivesearch</A> that return <A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchType.html" title="enum in org.optaplanner.core.config.exhaustivesearch">ExhaustiveSearchType</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchType.html" title="enum in org.optaplanner.core.config.exhaustivesearch">ExhaustiveSearchType</A></CODE></FONT></TD> <TD><CODE><B>ExhaustiveSearchPhaseConfig.</B><B><A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchPhaseConfig.html#getExhaustiveSearchType()">getExhaustiveSearchType</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchType.html" title="enum in org.optaplanner.core.config.exhaustivesearch">ExhaustiveSearchType</A></CODE></FONT></TD> <TD><CODE><B>ExhaustiveSearchType.</B><B><A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchType.html#valueOf(java.lang.String)">valueOf</A></B>(<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the enum constant of this type with the specified name.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchType.html" title="enum in org.optaplanner.core.config.exhaustivesearch">ExhaustiveSearchType</A>[]</CODE></FONT></TD> <TD><CODE><B>ExhaustiveSearchType.</B><B><A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchType.html#values()">values</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array containing the constants of this enum type, in the order they are declared.</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/package-summary.html">org.optaplanner.core.config.exhaustivesearch</A> with parameters of type <A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchType.html" title="enum in org.optaplanner.core.config.exhaustivesearch">ExhaustiveSearchType</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>ExhaustiveSearchPhaseConfig.</B><B><A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchPhaseConfig.html#setExhaustiveSearchType(org.optaplanner.core.config.exhaustivesearch.ExhaustiveSearchType)">setExhaustiveSearchType</A></B>(<A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchType.html" title="enum in org.optaplanner.core.config.exhaustivesearch">ExhaustiveSearchType</A>&nbsp;exhaustiveSearchType)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/optaplanner/core/config/exhaustivesearch/ExhaustiveSearchType.html" title="enum in org.optaplanner.core.config.exhaustivesearch"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>OptaPlanner distribution 6.2.0.Final</b></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/optaplanner/core/config/exhaustivesearch//class-useExhaustiveSearchType.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ExhaustiveSearchType.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2006-2015 <a href="http://www.jboss.org/">JBoss by Red Hat</a>. All Rights Reserved. </BODY> </HTML>
{ "content_hash": "aba3e3489d8293d93f5d1eff1912a47f", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 495, "avg_line_length": 55.60434782608696, "alnum_prop": 0.6706544686840253, "repo_name": "jormunmor/doctorado", "id": "f27b45cc4f7682e2df316f948b51212157df2954", "size": "12789", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "optaplanner-distribution-6.2.0.Final/javadocs/org/optaplanner/core/config/exhaustivesearch/class-use/ExhaustiveSearchType.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2671" }, { "name": "C", "bytes": "14433" }, { "name": "C#", "bytes": "18659" }, { "name": "C++", "bytes": "2923396" }, { "name": "CMake", "bytes": "38809" }, { "name": "CSS", "bytes": "949322" }, { "name": "GAP", "bytes": "24568" }, { "name": "HTML", "bytes": "62229389" }, { "name": "Java", "bytes": "2437530" }, { "name": "JavaScript", "bytes": "8047306" }, { "name": "Makefile", "bytes": "293709" }, { "name": "Objective-C++", "bytes": "7535732" }, { "name": "PostScript", "bytes": "13039" }, { "name": "Python", "bytes": "4330" }, { "name": "QMake", "bytes": "5527" }, { "name": "Shell", "bytes": "2037" }, { "name": "TeX", "bytes": "2066789" } ], "symlink_target": "" }
> Stability: 2 - Stable The `os` module provides a number of operating system-related utility methods. It can be accessed using: ```js const os = require('os'); ``` ## os.EOL <!-- YAML added: v0.7.8 --> * {string} A string constant defining the operating system-specific end-of-line marker: * `\n` on POSIX * `\r\n` on Windows ## os.arch() <!-- YAML added: v0.5.0 --> * Returns: {string} The `os.arch()` method returns a string identifying the operating system CPU architecture *for which the Node.js binary was compiled*. The current possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`, `'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, `'x32'`, `'x64'`, and `'x86'`. Equivalent to [`process.arch`][]. ## os.constants <!-- YAML added: v6.3.0 --> * {Object} Returns an object containing commonly used operating system specific constants for error codes, process signals, and so on. The specific constants currently defined are described in [OS Constants][]. ## os.cpus() <!-- YAML added: v0.3.3 --> * Returns: {Array} The `os.cpus()` method returns an array of objects containing information about each CPU/core installed. The properties included on each object include: * `model` {string} * `speed` {number} (in MHz) * `times` {Object} * `user` {number} The number of milliseconds the CPU has spent in user mode. * `nice` {number} The number of milliseconds the CPU has spent in nice mode. * `sys` {number} The number of milliseconds the CPU has spent in sys mode. * `idle` {number} The number of milliseconds the CPU has spent in idle mode. * `irq` {number} The number of milliseconds the CPU has spent in irq mode. For example: <!-- eslint-disable semi --> ```js [ { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', speed: 2926, times: { user: 252020, nice: 0, sys: 30340, idle: 1070356870, irq: 0 } }, { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', speed: 2926, times: { user: 306960, nice: 0, sys: 26980, idle: 1071569080, irq: 0 } }, { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', speed: 2926, times: { user: 248450, nice: 0, sys: 21750, idle: 1070919370, irq: 0 } }, { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', speed: 2926, times: { user: 256880, nice: 0, sys: 19430, idle: 1070905480, irq: 20 } }, { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', speed: 2926, times: { user: 511580, nice: 20, sys: 40900, idle: 1070842510, irq: 0 } }, { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', speed: 2926, times: { user: 291660, nice: 0, sys: 34360, idle: 1070888000, irq: 10 } }, { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', speed: 2926, times: { user: 308260, nice: 0, sys: 55410, idle: 1071129970, irq: 880 } }, { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', speed: 2926, times: { user: 266450, nice: 1480, sys: 34920, idle: 1072572010, irq: 30 } } ] ``` *Note*: Because `nice` values are UNIX-specific, on Windows the `nice` values of all processors are always 0. ## os.endianness() <!-- YAML added: v0.9.4 --> * Returns: {string} The `os.endianness()` method returns a string identifying the endianness of the CPU *for which the Node.js binary was compiled*. Possible values are: * `'BE'` for big endian * `'LE'` for little endian. ## os.freemem() <!-- YAML added: v0.3.3 --> * Returns: {integer} The `os.freemem()` method returns the amount of free system memory in bytes as an integer. ## os.homedir() <!-- YAML added: v2.3.0 --> * Returns: {string} The `os.homedir()` method returns the home directory of the current user as a string. ## os.hostname() <!-- YAML added: v0.3.3 --> * Returns: {string} The `os.hostname()` method returns the hostname of the operating system as a string. ## os.loadavg() <!-- YAML added: v0.3.3 --> * Returns: {Array} The `os.loadavg()` method returns an array containing the 1, 5, and 15 minute load averages. The load average is a measure of system activity, calculated by the operating system and expressed as a fractional number. As a rule of thumb, the load average should ideally be less than the number of logical CPUs in the system. The load average is a UNIX-specific concept with no real equivalent on Windows platforms. On Windows, the return value is always `[0, 0, 0]`. ## os.networkInterfaces() <!-- YAML added: v0.6.0 --> * Returns: {Object} The `os.networkInterfaces()` method returns an object containing only network interfaces that have been assigned a network address. Each key on the returned object identifies a network interface. The associated value is an array of objects that each describe an assigned network address. The properties available on the assigned network address object include: * `address` {string} The assigned IPv4 or IPv6 address * `netmask` {string} The IPv4 or IPv6 network mask * `family` {string} Either `IPv4` or `IPv6` * `mac` {string} The MAC address of the network interface * `internal` {boolean} `true` if the network interface is a loopback or similar interface that is not remotely accessible; otherwise `false` * `scopeid` {number} The numeric IPv6 scope ID (only specified when `family` is `IPv6`) <!-- eslint-disable --> ```js { lo: [ { address: '127.0.0.1', netmask: '255.0.0.0', family: 'IPv4', mac: '00:00:00:00:00:00', internal: true }, { address: '::1', netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', family: 'IPv6', mac: '00:00:00:00:00:00', internal: true } ], eth0: [ { address: '192.168.1.108', netmask: '255.255.255.0', family: 'IPv4', mac: '01:02:03:0a:0b:0c', internal: false }, { address: 'fe80::a00:27ff:fe4e:66a1', netmask: 'ffff:ffff:ffff:ffff::', family: 'IPv6', mac: '01:02:03:0a:0b:0c', internal: false } ] } ``` ## os.platform() <!-- YAML added: v0.5.0 --> * Returns: {string} The `os.platform()` method returns a string identifying the operating system platform as set during compile time of Node.js. Currently possible values are: * `'aix'` * `'darwin'` * `'freebsd'` * `'linux'` * `'openbsd'` * `'sunos'` * `'win32'` Equivalent to [`process.platform`][]. *Note*: The value `'android'` may also be returned if the Node.js is built on the Android operating system. However, Android support in Node.js is considered to be experimental at this time. ## os.release() <!-- YAML added: v0.3.3 --> * Returns: {string} The `os.release()` method returns a string identifying the operating system release. *Note*: On POSIX systems, the operating system release is determined by calling uname(3). On Windows, `GetVersionExW()` is used. Please see https://en.wikipedia.org/wiki/Uname#Examples for more information. ## os.tmpdir() <!-- YAML added: v0.9.9 changes: - version: v2.0.0 pr-url: https://github.com/nodejs/node/pull/747 description: This function is now cross-platform consistent and no longer returns a path with a trailing slash on any platform --> * Returns: {string} The `os.tmpdir()` method returns a string specifying the operating system's default directory for temporary files. ## os.totalmem() <!-- YAML added: v0.3.3 --> * Returns: {integer} The `os.totalmem()` method returns the total amount of system memory in bytes as an integer. ## os.type() <!-- YAML added: v0.3.3 --> * Returns: {string} The `os.type()` method returns a string identifying the operating system name as returned by uname(3). For example `'Linux'` on Linux, `'Darwin'` on macOS and `'Windows_NT'` on Windows. Please see https://en.wikipedia.org/wiki/Uname#Examples for additional information about the output of running uname(3) on various operating systems. ## os.uptime() <!-- YAML added: v0.3.3 --> * Returns: {integer} The `os.uptime()` method returns the system uptime in number of seconds. *Note*: On Windows the returned value includes fractions of a second. Use `Math.floor()` to get whole seconds. ## os.userInfo([options]) <!-- YAML added: v6.0.0 --> * `options` {Object} * `encoding` {string} Character encoding used to interpret resulting strings. If `encoding` is set to `'buffer'`, the `username`, `shell`, and `homedir` values will be `Buffer` instances. (Default: 'utf8') * Returns: {Object} The `os.userInfo()` method returns information about the currently effective user -- on POSIX platforms, this is typically a subset of the password file. The returned object includes the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and `gid` fields are `-1`, and `shell` is `null`. The value of `homedir` returned by `os.userInfo()` is provided by the operating system. This differs from the result of `os.homedir()`, which queries several environment variables for the home directory before falling back to the operating system response. ## OS Constants The following constants are exported by `os.constants`. *Note*: Not all constants will be available on every operating system. ### Signal Constants <!-- YAML changes: - version: v5.11.0 pr-url: https://github.com/nodejs/node/pull/6093 description: Added support for `SIGINFO`. --> The following signal constants are exported by `os.constants.signals`: <table> <tr> <th>Constant</th> <th>Description</th> </tr> <tr> <td><code>SIGHUP</code></td> <td>Sent to indicate when a controlling terminal is closed or a parent process exits.</td> </tr> <tr> <td><code>SIGINT</code></td> <td>Sent to indicate when a user wishes to interrupt a process (`(Ctrl+C)`).</td> </tr> <tr> <td><code>SIGQUIT</code></td> <td>Sent to indicate when a user wishes to terminate a process and perform a core dump.</td> </tr> <tr> <td><code>SIGILL</code></td> <td>Sent to a process to notify that it has attempted to perform an illegal, malformed, unknown or privileged instruction.</td> </tr> <tr> <td><code>SIGTRAP</code></td> <td>Sent to a process when an exception has occurred.</td> </tr> <tr> <td><code>SIGABRT</code></td> <td>Sent to a process to request that it abort.</td> </tr> <tr> <td><code>SIGIOT</code></td> <td>Synonym for <code>SIGABRT</code></td> </tr> <tr> <td><code>SIGBUS</code></td> <td>Sent to a process to notify that it has caused a bus error.</td> </tr> <tr> <td><code>SIGFPE</code></td> <td>Sent to a process to notify that it has performed an illegal arithmetic operation.</td> </tr> <tr> <td><code>SIGKILL</code></td> <td>Sent to a process to terminate it immediately.</td> </tr> <tr> <td><code>SIGUSR1</code> <code>SIGUSR2</code></td> <td>Sent to a process to identify user-defined conditions.</td> </tr> <tr> <td><code>SIGSEGV</code></td> <td>Sent to a process to notify of a segmentation fault.</td> </tr> <tr> <td><code>SIGPIPE</code></td> <td>Sent to a process when it has attempted to write to a disconnected pipe.</td> </tr> <tr> <td><code>SIGALRM</code></td> <td>Sent to a process when a system timer elapses.</td> </tr> <tr> <td><code>SIGTERM</code></td> <td>Sent to a process to request termination.</td> </tr> <tr> <td><code>SIGCHLD</code></td> <td>Sent to a process when a child process terminates.</td> </tr> <tr> <td><code>SIGSTKFLT</code></td> <td>Sent to a process to indicate a stack fault on a coprocessor.</td> </tr> <tr> <td><code>SIGCONT</code></td> <td>Sent to instruct the operating system to continue a paused process.</td> </tr> <tr> <td><code>SIGSTOP</code></td> <td>Sent to instruct the operating system to halt a process.</td> </tr> <tr> <td><code>SIGTSTP</code></td> <td>Sent to a process to request it to stop.</td> </tr> <tr> <td><code>SIGBREAK</code></td> <td>Sent to indicate when a user wishes to interrupt a process.</td> </tr> <tr> <td><code>SIGTTIN</code></td> <td>Sent to a process when it reads from the TTY while in the background.</td> </tr> <tr> <td><code>SIGTTOU</code></td> <td>Sent to a process when it writes to the TTY while in the background.</td> </tr> <tr> <td><code>SIGURG</code></td> <td>Sent to a process when a socket has urgent data to read.</td> </tr> <tr> <td><code>SIGXCPU</code></td> <td>Sent to a process when it has exceeded its limit on CPU usage.</td> </tr> <tr> <td><code>SIGXFSZ</code></td> <td>Sent to a process when it grows a file larger than the maximum allowed.</td> </tr> <tr> <td><code>SIGVTALRM</code></td> <td>Sent to a process when a virtual timer has elapsed.</td> </tr> <tr> <td><code>SIGPROF</code></td> <td>Sent to a process when a system timer has elapsed.</td> </tr> <tr> <td><code>SIGWINCH</code></td> <td>Sent to a process when the controlling terminal has changed its size.</td> </tr> <tr> <td><code>SIGIO</code></td> <td>Sent to a process when I/O is available.</td> </tr> <tr> <td><code>SIGPOLL</code></td> <td>Synonym for <code>SIGIO</code></td> </tr> <tr> <td><code>SIGLOST</code></td> <td>Sent to a process when a file lock has been lost.</td> </tr> <tr> <td><code>SIGPWR</code></td> <td>Sent to a process to notify of a power failure.</td> </tr> <tr> <td><code>SIGINFO</code></td> <td>Synonym for <code>SIGPWR</code></td> </tr> <tr> <td><code>SIGSYS</code></td> <td>Sent to a process to notify of a bad argument.</td> </tr> <tr> <td><code>SIGUNUSED</code></td> <td>Synonym for <code>SIGSYS</code></td> </tr> </table> ### Error Constants The following error constants are exported by `os.constants.errno`: #### POSIX Error Constants <table> <tr> <th>Constant</th> <th>Description</th> </tr> <tr> <td><code>E2BIG</code></td> <td>Indicates that the list of arguments is longer than expected.</td> </tr> <tr> <td><code>EACCES</code></td> <td>Indicates that the operation did not have sufficient permissions.</td> </tr> <tr> <td><code>EADDRINUSE</code></td> <td>Indicates that the network address is already in use.</td> </tr> <tr> <td><code>EADDRNOTAVAIL</code></td> <td>Indicates that the network address is currently unavailable for use.</td> </tr> <tr> <td><code>EAFNOSUPPORT</code></td> <td>Indicates that the network address family is not supported.</td> </tr> <tr> <td><code>EAGAIN</code></td> <td>Indicates that there is currently no data available and to try the operation again later.</td> </tr> <tr> <td><code>EALREADY</code></td> <td>Indicates that the socket already has a pending connection in progress.</td> </tr> <tr> <td><code>EBADF</code></td> <td>Indicates that a file descriptor is not valid.</td> </tr> <tr> <td><code>EBADMSG</code></td> <td>Indicates an invalid data message.</td> </tr> <tr> <td><code>EBUSY</code></td> <td>Indicates that a device or resource is busy.</td> </tr> <tr> <td><code>ECANCELED</code></td> <td>Indicates that an operation was canceled.</td> </tr> <tr> <td><code>ECHILD</code></td> <td>Indicates that there are no child processes.</td> </tr> <tr> <td><code>ECONNABORTED</code></td> <td>Indicates that the network connection has been aborted.</td> </tr> <tr> <td><code>ECONNREFUSED</code></td> <td>Indicates that the network connection has been refused.</td> </tr> <tr> <td><code>ECONNRESET</code></td> <td>Indicates that the network connection has been reset.</td> </tr> <tr> <td><code>EDEADLK</code></td> <td>Indicates that a resource deadlock has been avoided.</td> </tr> <tr> <td><code>EDESTADDRREQ</code></td> <td>Indicates that a destination address is required.</td> </tr> <tr> <td><code>EDOM</code></td> <td>Indicates that an argument is out of the domain of the function.</td> </tr> <tr> <td><code>EDQUOT</code></td> <td>Indicates that the disk quota has been exceeded.</td> </tr> <tr> <td><code>EEXIST</code></td> <td>Indicates that the file already exists.</td> </tr> <tr> <td><code>EFAULT</code></td> <td>Indicates an invalid pointer address.</td> </tr> <tr> <td><code>EFBIG</code></td> <td>Indicates that the file is too large.</td> </tr> <tr> <td><code>EHOSTUNREACH</code></td> <td>Indicates that the host is unreachable.</td> </tr> <tr> <td><code>EIDRM</code></td> <td>Indicates that the identifier has been removed.</td> </tr> <tr> <td><code>EILSEQ</code></td> <td>Indicates an illegal byte sequence.</td> </tr> <tr> <td><code>EINPROGRESS</code></td> <td>Indicates that an operation is already in progress.</td> </tr> <tr> <td><code>EINTR</code></td> <td>Indicates that a function call was interrupted.</td> </tr> <tr> <td><code>EINVAL</code></td> <td>Indicates that an invalid argument was provided.</td> </tr> <tr> <td><code>EIO</code></td> <td>Indicates an otherwise unspecified I/O error.</td> </tr> <tr> <td><code>EISCONN</code></td> <td>Indicates that the socket is connected.</td> </tr> <tr> <td><code>EISDIR</code></td> <td>Indicates that the path is a directory.</td> </tr> <tr> <td><code>ELOOP</code></td> <td>Indicates too many levels of symbolic links in a path.</td> </tr> <tr> <td><code>EMFILE</code></td> <td>Indicates that there are too many open files.</td> </tr> <tr> <td><code>EMLINK</code></td> <td>Indicates that there are too many hard links to a file.</td> </tr> <tr> <td><code>EMSGSIZE</code></td> <td>Indicates that the provided message is too long.</td> </tr> <tr> <td><code>EMULTIHOP</code></td> <td>Indicates that a multihop was attempted.</td> </tr> <tr> <td><code>ENAMETOOLONG</code></td> <td>Indicates that the filename is too long.</td> </tr> <tr> <td><code>ENETDOWN</code></td> <td>Indicates that the network is down.</td> </tr> <tr> <td><code>ENETRESET</code></td> <td>Indicates that the connection has been aborted by the network.</td> </tr> <tr> <td><code>ENETUNREACH</code></td> <td>Indicates that the network is unreachable.</td> </tr> <tr> <td><code>ENFILE</code></td> <td>Indicates too many open files in the system.</td> </tr> <tr> <td><code>ENOBUFS</code></td> <td>Indicates that no buffer space is available.</td> </tr> <tr> <td><code>ENODATA</code></td> <td>Indicates that no message is available on the stream head read queue.</td> </tr> <tr> <td><code>ENODEV</code></td> <td>Indicates that there is no such device.</td> </tr> <tr> <td><code>ENOENT</code></td> <td>Indicates that there is no such file or directory.</td> </tr> <tr> <td><code>ENOEXEC</code></td> <td>Indicates an exec format error.</td> </tr> <tr> <td><code>ENOLCK</code></td> <td>Indicates that there are no locks available.</td> </tr> <tr> <td><code>ENOLINK</code></td> <td>Indications that a link has been severed.</td> </tr> <tr> <td><code>ENOMEM</code></td> <td>Indicates that there is not enough space.</td> </tr> <tr> <td><code>ENOMSG</code></td> <td>Indicates that there is no message of the desired type.</td> </tr> <tr> <td><code>ENOPROTOOPT</code></td> <td>Indicates that a given protocol is not available.</td> </tr> <tr> <td><code>ENOSPC</code></td> <td>Indicates that there is no space available on the device.</td> </tr> <tr> <td><code>ENOSR</code></td> <td>Indicates that there are no stream resources available.</td> </tr> <tr> <td><code>ENOSTR</code></td> <td>Indicates that a given resource is not a stream.</td> </tr> <tr> <td><code>ENOSYS</code></td> <td>Indicates that a function has not been implemented.</td> </tr> <tr> <td><code>ENOTCONN</code></td> <td>Indicates that the socket is not connected.</td> </tr> <tr> <td><code>ENOTDIR</code></td> <td>Indicates that the path is not a directory.</td> </tr> <tr> <td><code>ENOTEMPTY</code></td> <td>Indicates that the directory is not empty.</td> </tr> <tr> <td><code>ENOTSOCK</code></td> <td>Indicates that the given item is not a socket.</td> </tr> <tr> <td><code>ENOTSUP</code></td> <td>Indicates that a given operation is not supported.</td> </tr> <tr> <td><code>ENOTTY</code></td> <td>Indicates an inappropriate I/O control operation.</td> </tr> <tr> <td><code>ENXIO</code></td> <td>Indicates no such device or address.</td> </tr> <tr> <td><code>EOPNOTSUPP</code></td> <td>Indicates that an operation is not supported on the socket. Note that while `ENOTSUP` and `EOPNOTSUPP` have the same value on Linux, according to POSIX.1 these error values should be distinct.)</td> </tr> <tr> <td><code>EOVERFLOW</code></td> <td>Indicates that a value is too large to be stored in a given data type.</td> </tr> <tr> <td><code>EPERM</code></td> <td>Indicates that the operation is not permitted.</td> </tr> <tr> <td><code>EPIPE</code></td> <td>Indicates a broken pipe.</td> </tr> <tr> <td><code>EPROTO</code></td> <td>Indicates a protocol error.</td> </tr> <tr> <td><code>EPROTONOSUPPORT</code></td> <td>Indicates that a protocol is not supported.</td> </tr> <tr> <td><code>EPROTOTYPE</code></td> <td>Indicates the wrong type of protocol for a socket.</td> </tr> <tr> <td><code>ERANGE</code></td> <td>Indicates that the results are too large.</td> </tr> <tr> <td><code>EROFS</code></td> <td>Indicates that the file system is read only.</td> </tr> <tr> <td><code>ESPIPE</code></td> <td>Indicates an invalid seek operation.</td> </tr> <tr> <td><code>ESRCH</code></td> <td>Indicates that there is no such process.</td> </tr> <tr> <td><code>ESTALE</code></td> <td>Indicates that the file handle is stale.</td> </tr> <tr> <td><code>ETIME</code></td> <td>Indicates an expired timer.</td> </tr> <tr> <td><code>ETIMEDOUT</code></td> <td>Indicates that the connection timed out.</td> </tr> <tr> <td><code>ETXTBSY</code></td> <td>Indicates that a text file is busy.</td> </tr> <tr> <td><code>EWOULDBLOCK</code></td> <td>Indicates that the operation would block.</td> </tr> <tr> <td><code>EXDEV</code></td> <td>Indicates an improper link. </tr> </table> #### Windows Specific Error Constants The following error codes are specific to the Windows operating system: <table> <tr> <th>Constant</th> <th>Description</th> </tr> <tr> <td><code>WSAEINTR</code></td> <td>Indicates an interrupted function call.</td> </tr> <tr> <td><code>WSAEBADF</code></td> <td>Indicates an invalid file handle.</td> </tr> <tr> <td><code>WSAEACCES</code></td> <td>Indicates insufficient permissions to complete the operation.</td> </tr> <tr> <td><code>WSAEFAULT</code></td> <td>Indicates an invalid pointer address.</td> </tr> <tr> <td><code>WSAEINVAL</code></td> <td>Indicates that an invalid argument was passed.</td> </tr> <tr> <td><code>WSAEMFILE</code></td> <td>Indicates that there are too many open files.</td> </tr> <tr> <td><code>WSAEWOULDBLOCK</code></td> <td>Indicates that a resource is temporarily unavailable.</td> </tr> <tr> <td><code>WSAEINPROGRESS</code></td> <td>Indicates that an operation is currently in progress.</td> </tr> <tr> <td><code>WSAEALREADY</code></td> <td>Indicates that an operation is already in progress.</td> </tr> <tr> <td><code>WSAENOTSOCK</code></td> <td>Indicates that the resource is not a socket.</td> </tr> <tr> <td><code>WSAEDESTADDRREQ</code></td> <td>Indicates that a destination address is required.</td> </tr> <tr> <td><code>WSAEMSGSIZE</code></td> <td>Indicates that the message size is too long.</td> </tr> <tr> <td><code>WSAEPROTOTYPE</code></td> <td>Indicates the wrong protocol type for the socket.</td> </tr> <tr> <td><code>WSAENOPROTOOPT</code></td> <td>Indicates a bad protocol option.</td> </tr> <tr> <td><code>WSAEPROTONOSUPPORT</code></td> <td>Indicates that the protocol is not supported.</td> </tr> <tr> <td><code>WSAESOCKTNOSUPPORT</code></td> <td>Indicates that the socket type is not supported.</td> </tr> <tr> <td><code>WSAEOPNOTSUPP</code></td> <td>Indicates that the operation is not supported.</td> </tr> <tr> <td><code>WSAEPFNOSUPPORT</code></td> <td>Indicates that the protocol family is not supported.</td> </tr> <tr> <td><code>WSAEAFNOSUPPORT</code></td> <td>Indicates that the address family is not supported.</td> </tr> <tr> <td><code>WSAEADDRINUSE</code></td> <td>Indicates that the network address is already in use.</td> </tr> <tr> <td><code>WSAEADDRNOTAVAIL</code></td> <td>Indicates that the network address is not available.</td> </tr> <tr> <td><code>WSAENETDOWN</code></td> <td>Indicates that the network is down.</td> </tr> <tr> <td><code>WSAENETUNREACH</code></td> <td>Indicates that the network is unreachable.</td> </tr> <tr> <td><code>WSAENETRESET</code></td> <td>Indicates that the network connection has been reset.</td> </tr> <tr> <td><code>WSAECONNABORTED</code></td> <td>Indicates that the connection has been aborted.</td> </tr> <tr> <td><code>WSAECONNRESET</code></td> <td>Indicates that the connection has been reset by the peer.</td> </tr> <tr> <td><code>WSAENOBUFS</code></td> <td>Indicates that there is no buffer space available.</td> </tr> <tr> <td><code>WSAEISCONN</code></td> <td>Indicates that the socket is already connected.</td> </tr> <tr> <td><code>WSAENOTCONN</code></td> <td>Indicates that the socket is not connected.</td> </tr> <tr> <td><code>WSAESHUTDOWN</code></td> <td>Indicates that data cannot be sent after the socket has been shutdown.</td> </tr> <tr> <td><code>WSAETOOMANYREFS</code></td> <td>Indicates that there are too many references.</td> </tr> <tr> <td><code>WSAETIMEDOUT</code></td> <td>Indicates that the connection has timed out.</td> </tr> <tr> <td><code>WSAECONNREFUSED</code></td> <td>Indicates that the connection has been refused.</td> </tr> <tr> <td><code>WSAELOOP</code></td> <td>Indicates that a name cannot be translated.</td> </tr> <tr> <td><code>WSAENAMETOOLONG</code></td> <td>Indicates that a name was too long.</td> </tr> <tr> <td><code>WSAEHOSTDOWN</code></td> <td>Indicates that a network host is down.</td> </tr> <tr> <td><code>WSAEHOSTUNREACH</code></td> <td>Indicates that there is no route to a network host.</td> </tr> <tr> <td><code>WSAENOTEMPTY</code></td> <td>Indicates that the directory is not empty.</td> </tr> <tr> <td><code>WSAEPROCLIM</code></td> <td>Indicates that there are too many processes.</td> </tr> <tr> <td><code>WSAEUSERS</code></td> <td>Indicates that the user quota has been exceeded.</td> </tr> <tr> <td><code>WSAEDQUOT</code></td> <td>Indicates that the disk quota has been exceeded.</td> </tr> <tr> <td><code>WSAESTALE</code></td> <td>Indicates a stale file handle reference.</td> </tr> <tr> <td><code>WSAEREMOTE</code></td> <td>Indicates that the item is remote.</td> </tr> <tr> <td><code>WSASYSNOTREADY</code></td> <td>Indicates that the network subsystem is not ready.</td> </tr> <tr> <td><code>WSAVERNOTSUPPORTED</code></td> <td>Indicates that the winsock.dll version is out of range.</td> </tr> <tr> <td><code>WSANOTINITIALISED</code></td> <td>Indicates that successful WSAStartup has not yet been performed.</td> </tr> <tr> <td><code>WSAEDISCON</code></td> <td>Indicates that a graceful shutdown is in progress.</td> </tr> <tr> <td><code>WSAENOMORE</code></td> <td>Indicates that there are no more results.</td> </tr> <tr> <td><code>WSAECANCELLED</code></td> <td>Indicates that an operation has been canceled.</td> </tr> <tr> <td><code>WSAEINVALIDPROCTABLE</code></td> <td>Indicates that the procedure call table is invalid.</td> </tr> <tr> <td><code>WSAEINVALIDPROVIDER</code></td> <td>Indicates an invalid service provider.</td> </tr> <tr> <td><code>WSAEPROVIDERFAILEDINIT</code></td> <td>Indicates that the service provider failed to initialized.</td> </tr> <tr> <td><code>WSASYSCALLFAILURE</code></td> <td>Indicates a system call failure.</td> </tr> <tr> <td><code>WSASERVICE_NOT_FOUND</code></td> <td>Indicates that a service was not found.</td> </tr> <tr> <td><code>WSATYPE_NOT_FOUND</code></td> <td>Indicates that a class type was not found.</td> </tr> <tr> <td><code>WSA_E_NO_MORE</code></td> <td>Indicates that there are no more results.</td> </tr> <tr> <td><code>WSA_E_CANCELLED</code></td> <td>Indicates that the call was canceled.</td> </tr> <tr> <td><code>WSAEREFUSED</code></td> <td>Indicates that a database query was refused.</td> </tr> </table> ### libuv Constants <table> <tr> <th>Constant</th> <th>Description</th> </tr> <tr> <td><code>UV_UDP_REUSEADDR</code></td> <td></td> </tr> </table> [`process.arch`]: process.html#process_process_arch [`process.platform`]: process.html#process_process_platform [OS Constants]: #os_os_constants
{ "content_hash": "9545b9c24ead05d21ff35abb7ea640cb", "timestamp": "", "source": "github", "line_count": 1177, "max_line_length": 80, "avg_line_length": 25.78334749362787, "alnum_prop": 0.6216100438264078, "repo_name": "RPGOne/Skynet", "id": "6afa69d39edb1da45ba9987844195c57794d8c06", "size": "30353", "binary": false, "copies": "1", "ref": "refs/heads/Miho", "path": "node-master/doc/api/os.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "1C Enterprise", "bytes": "36" }, { "name": "Ada", "bytes": "89079" }, { "name": "Assembly", "bytes": "11425802" }, { "name": "Batchfile", "bytes": "123467" }, { "name": "C", "bytes": "34703955" }, { "name": "C#", "bytes": "55955" }, { "name": "C++", "bytes": "84647314" }, { "name": "CMake", "bytes": "220849" }, { "name": "CSS", "bytes": "39257" }, { "name": "Cuda", "bytes": "1344541" }, { "name": "DIGITAL Command Language", "bytes": "349320" }, { "name": "DTrace", "bytes": "37428" }, { "name": "Emacs Lisp", "bytes": "19654" }, { "name": "Erlang", "bytes": "39438" }, { "name": "Fortran", "bytes": "16914" }, { "name": "HTML", "bytes": "929759" }, { "name": "Java", "bytes": "112658" }, { "name": "JavaScript", "bytes": "32806873" }, { "name": "Jupyter Notebook", "bytes": "1616334" }, { "name": "Lua", "bytes": "22549" }, { "name": "M4", "bytes": "64967" }, { "name": "Makefile", "bytes": "1046428" }, { "name": "Matlab", "bytes": "888" }, { "name": "Module Management System", "bytes": "1545" }, { "name": "NSIS", "bytes": "2860" }, { "name": "Objective-C", "bytes": "131433" }, { "name": "PHP", "bytes": "750783" }, { "name": "Pascal", "bytes": "75208" }, { "name": "Perl", "bytes": "626627" }, { "name": "Perl 6", "bytes": "2495926" }, { "name": "PowerShell", "bytes": "38374" }, { "name": "Prolog", "bytes": "300018" }, { "name": "Python", "bytes": "26363074" }, { "name": "R", "bytes": "236175" }, { "name": "Rebol", "bytes": "217" }, { "name": "Roff", "bytes": "328366" }, { "name": "SAS", "bytes": "1847" }, { "name": "Scala", "bytes": "248902" }, { "name": "Scheme", "bytes": "14853" }, { "name": "Shell", "bytes": "360815" }, { "name": "TeX", "bytes": "105346" }, { "name": "Vim script", "bytes": "6101" }, { "name": "XS", "bytes": "4319" }, { "name": "eC", "bytes": "5158" } ], "symlink_target": "" }
package shadowsocks import ( "os" "time" "go.uber.org/zap" "go.uber.org/zap/zapcore" ) var ( // Logger used to out put the log, zap logger is fast and efficiency Logger *zap.Logger // Level can be set into Debug Info Error, and Error level is used by default Level string ) // SetLogger will generate a zap logger with given level for log output func SetLogger() { var lv = zap.NewAtomicLevel() var encoder zapcore.Encoder var output zapcore.WriteSyncer output = zapcore.AddSync(os.Stdout) switch Level { case "debug", "Debug", "DEBUG": lv.SetLevel(zap.DebugLevel) case "info", "Info", "INFO": lv.SetLevel(zap.InfoLevel) case "error", "Error", "ERROR": lv.SetLevel(zap.ErrorLevel) case "fatal", "Fatal", "FATAL": lv.SetLevel(zap.FatalLevel) default: lv.SetLevel(zap.ErrorLevel) } timeEncoder := func(t time.Time, enc zapcore.PrimitiveArrayEncoder) { enc.AppendString(t.Local().Format("2006-01-02 15:04:05")) } encoderCfg := zapcore.EncoderConfig{ NameKey: "Name", StacktraceKey: "Stack", MessageKey: "Message", LevelKey: "Level", TimeKey: "TimeStamp", CallerKey: "Caller", EncodeTime: timeEncoder, EncodeLevel: zapcore.CapitalColorLevelEncoder, EncodeDuration: zapcore.StringDurationEncoder, EncodeCaller: zapcore.ShortCallerEncoder, } //encoder = zapcore.NewJSONEncoder(encoderCfg) encoder = zapcore.NewConsoleEncoder(encoderCfg) Logger = zap.New(zapcore.NewCore(encoder, output, lv), zap.AddCaller()) }
{ "content_hash": "0e58e6a9a97266e6959fe2ff23073d2b", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 78, "avg_line_length": 25.610169491525422, "alnum_prop": 0.7061548643282595, "repo_name": "arthurkiller/shadowsocks-go", "id": "68aec95fa65bd59ff47f038b9c46d541e1263b26", "size": "1511", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "shadowsocks/log.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "89" }, { "name": "Go", "bytes": "110003" }, { "name": "Makefile", "bytes": "640" }, { "name": "Shell", "bytes": "9343" } ], "symlink_target": "" }
#ifndef GONA_GRAPHICS_NATIVE_BITMAP_X_H #define GONA_GRAPHICS_NATIVE_BITMAP_X_H #include <X11/Xlib.h> #include <X11/Xutil.h> #include <stdlib.h> #include <string.h> #include "../../GnImage.h" #include "../GnBitmap.h" class GnNativeBitmap : public GnBitmap { public: GnNativeBitmap(Display *display, Window wnd, unsigned int width, unsigned int height) : m_display(display), m_wnd(wnd), m_xImage(0), m_buf(0), m_width(width), m_height(height) { // Create a X Graphics Context m_gc = XCreateGC(display, wnd, 0, 0); int screen = XDefaultScreen(display); int depth = XDefaultDepth(display, screen); Visual *visual = XDefaultVisual(display, screen); switch (depth) { case 15: m_bpp = 16; // TODO: pixel format break; case 16: m_bpp = 16; // TODO: pixel format break; case 24: case 32: // TODO: pixel format m_bpp = 32; break; } // Allocate the image's pixel buffer. unsigned int stride = width * (m_bpp / 8); unsigned int imgSize = stride * height; m_buf = (unsigned char*)malloc(imgSize); memset(m_buf, 255, imgSize); // Create a image structure. m_xImage = XCreateImage(display, visual, depth, ZPixmap, 0, (char*)m_buf, width, height, m_bpp, stride); } ~GnNativeBitmap() { // Frees both the image structure // and the data pointed to by the image structure. XDestroyImage(m_xImage); XFreeGC(m_display, m_gc); } public: /** * Transfer the bitmap bits to device. */ virtual void draw() { if (!m_xImage) { return; } m_xImage->data = (char*)m_buf; XPutImage(m_display, m_wnd, m_gc, m_xImage, 0, 0, 0, 0, m_width, m_height); } /** * Returns the pixel buffer. */ virtual unsigned char *getBuf() { return m_buf; } /** * Returns the width in pixels. */ virtual unsigned int getWidth() { return m_width; } /** * Returns the height in pixels. */ virtual unsigned int getHeight() { return m_height; } /** * Returns the number of bits per pixel. */ virtual int getBPP() { return m_bpp; } protected: GnNativeBitmap() : m_xImage(0), m_buf(0), m_width(0), m_height(0), m_bpp(0) { } private: Display *m_display; Window m_wnd; GC m_gc; XImage *m_xImage; unsigned char *m_buf; unsigned int m_width; unsigned int m_height; unsigned int m_bpp; }; #endif // GONA_GRAPHICS_NATIVE_BITMAP_X_H
{ "content_hash": "a4bafe12942017db77011519af556f92", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 91, "avg_line_length": 21.24576271186441, "alnum_prop": 0.5991224571200638, "repo_name": "airgiser/gona", "id": "e18e2663c29f112dbd2cd9b9733e644ccff22e71", "size": "2596", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/foundation/graphics/agg/native/GnNativeBitmap_unix.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "10530" }, { "name": "C++", "bytes": "101620" }, { "name": "Java", "bytes": "7101" }, { "name": "Makefile", "bytes": "7984" }, { "name": "Objective-C", "bytes": "3251" }, { "name": "Objective-C++", "bytes": "1385" } ], "symlink_target": "" }
<a href='https://github.com/angular/angular.js/edit/v1.4.x/src/ng/directive/ngEventDirs.js?message=docs(ngBlur)%3A%20describe%20your%20change...#L400' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this Doc</a> <a href='https://github.com/angular/angular.js/tree/v1.4.1/src/ng/directive/ngEventDirs.js#L400' class='view-source pull-right btn btn-primary'> <i class="glyphicon glyphicon-zoom-in">&nbsp;</i>View Source </a> <header class="api-profile-header"> <h1 class="api-profile-header-heading">ngBlur</h1> <ol class="api-profile-header-structure naked-list step-list"> <li> - directive in module <a href="api/ng">ng</a> </li> </ol> </header> <div class="api-profile-description"> <p>Specify custom behavior on blur event.</p> <p>A <a href="https://developer.mozilla.org/en-US/docs/Web/Events/blur">blur event</a> fires when an element has lost focus.</p> <p>Note: As the <code>blur</code> event is executed synchronously also during DOM manipulations (e.g. removing a focussed input), AngularJS executes the expression using <code>scope.$evalAsync</code> if the event is fired during an <code>$apply</code> to ensure a consistent state.</p> </div> <div> <h2>Directive Info</h2> <ul> <li>This directive executes at priority level 0.</li> </ul> <h2 id="usage">Usage</h2> <div class="usage"> <ul> <li>as attribute: <pre><code>&lt;window, input, select, textarea, a&#10; ng-blur=&quot;expression&quot;&gt;&#10;...&#10;&lt;/window, input, select, textarea, a&gt;</code></pre> </li> </div> <section class="api-section"> <h3>Arguments</h3> <table class="variables-matrix input-arguments"> <thead> <tr> <th>Param</th> <th>Type</th> <th>Details</th> </tr> </thead> <tbody> <tr> <td> ngBlur </td> <td> <a href="" class="label type-hint type-hint-expression">expression</a> </td> <td> <p><a href="guide/expression">Expression</a> to evaluate upon blur. (<a href="guide/expression#-event-">Event object is available as <code>$event</code></a>)</p> </td> </tr> </tbody> </table> </section> <h2 id="example">Example</h2><p>See <a href="api/ng/directive/ngClick">ngClick</a></p> </div>
{ "content_hash": "5aaae5d9e97fc2aa20da4c66f4f17849", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 254, "avg_line_length": 24.07070707070707, "alnum_prop": 0.6261015526647083, "repo_name": "viral810/ngSimpleCMS", "id": "b9c335914124e806c0975417b1d2aac2993e8eef", "size": "2383", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "web/bundles/sunraangular/js/angular/angular-1.4.1/docs/partials/api/ng/directive/ngBlur.html", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3606" }, { "name": "CSS", "bytes": "380387" }, { "name": "HTML", "bytes": "15140977" }, { "name": "JavaScript", "bytes": "3143485" }, { "name": "PHP", "bytes": "69377" }, { "name": "Ruby", "bytes": "1784" } ], "symlink_target": "" }
double inv_norm_cdf(double y0);
{ "content_hash": "c6ce9ce47a8a98380ec455b707b2d0d3", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 31, "avg_line_length": 32, "alnum_prop": 0.75, "repo_name": "jaak-s/macau", "id": "8423d5d7b653e9fb49a87c29385dc4080ca5ef91", "size": "46", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/macau-cpp/inv_norm_cdf.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "297" }, { "name": "C++", "bytes": "548512" }, { "name": "Dockerfile", "bytes": "608" }, { "name": "Jupyter Notebook", "bytes": "3505" }, { "name": "Makefile", "bytes": "663" }, { "name": "Python", "bytes": "46521" }, { "name": "Vim script", "bytes": "206" } ], "symlink_target": "" }
package com.planet_ink.coffee_mud.Abilities.Thief; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; public class Thief_ContractHit extends ThiefSkill { @Override public String ID() { return "Thief_ContractHit"; } private final static String localizedName = CMLib.lang().L("Contract Hit"); @Override public String name() { return localizedName; } @Override protected int canAffectCode() { return Ability.CAN_MOBS; } @Override protected int canTargetCode() { return Ability.CAN_MOBS; } @Override public int abstractQuality() { return Ability.QUALITY_MALICIOUS; } private static final String[] triggerStrings =I(new String[] {"CONTRACTHIT"}); @Override public String[] triggerStrings() { return triggerStrings; } @Override public boolean disregardsArmorCheck(final MOB mob) { return true; } @Override public int classificationCode() { return Ability.ACODE_THIEF_SKILL|Ability.DOMAIN_CRIMINAL; } @Override public String displayText() { return ""; } protected boolean done=false; protected boolean readyToHit=false; protected boolean hitting=false; protected Vector<MOB> hitmen=new Vector<MOB>(); @Override public void executeMsg(final Environmental myHost, final CMMsg msg) { if(affected instanceof MOB) if(msg.amISource((MOB)affected) &&(msg.sourceMinor()==CMMsg.TYP_DEATH)) { done=true; unInvoke(); } super.executeMsg(myHost,msg); } @Override public boolean tick(final Tickable ticking, final int tickID) { if((affected instanceof MOB)&&(invoker()!=null)) { if(super.tickDown==1) { makeLongLasting(); readyToHit=true; } final MOB mob=(MOB)affected; if(readyToHit&&(!hitting) &&(mob.location()!=null) &&(CMLib.flags().isACityRoom(mob.location()))) { hitting=true; final int num=CMLib.dice().roll(1,3,3); int level=mob.phyStats().level(); if(level>(invoker.phyStats().level()+(2*getXLEVELLevel(invoker)))) level=(invoker.phyStats().level()+(2*getXLEVELLevel(invoker))); CharClass C=CMClass.getCharClass("StdCharClass"); if(C==null) C=mob.charStats().getCurrentClass(); for(int i=0;i<num;i++) { final MOB M=CMClass.getMOB("Assassin"); M.basePhyStats().setLevel(level); M.recoverPhyStats(); M.basePhyStats().setArmor(CMLib.leveler().getLevelMOBArmor(M)); M.basePhyStats().setAttackAdjustment(CMLib.leveler().getLevelAttack(M)); M.basePhyStats().setDamage(CMLib.leveler().getLevelMOBDamage(M)); M.basePhyStats().setRejuv(PhyStats.NO_REJUV); M.baseState().setMana(CMLib.leveler().getLevelMana(M)); M.baseState().setMovement(CMLib.leveler().getLevelMove(M)); M.baseState().setHitPoints(CMLib.leveler().getLevelHitPoints(M)); final Behavior B=CMClass.getBehavior("Thiefness"); B.setParms("Assassin"); M.addBehavior(B); M.recoverPhyStats(); M.recoverCharStats(); M.recoverMaxState(); M.text(); // this establishes his current state. hitmen.addElement(M); M.bringToLife(mob.location(),true); M.setStartRoom(null); M.setVictim(mob); mob.setVictim(M); Ability A=M.fetchAbility("Thief_Hide"); if(A!=null) A.invoke(M,M,true,0); A=M.fetchAbility("Thief_BackStab"); if(A!=null) A.invoke(M,mob,false,0); } } else if(hitting) { boolean anyLeft=false; for(int i=0;i<hitmen.size();i++) { final MOB M=hitmen.elementAt(i); if((!M.amDead()) &&(M.location()!=null) &&(CMLib.flags().isInTheGame(M,false)) &&(CMLib.flags().isAliveAwakeMobileUnbound(M,true))) { anyLeft=true; M.isInCombat(); if((((M.getVictim()!=mob)) ||(!M.location().isInhabitant(mob))) &&(M.fetchEffect("Thief_Assassinate")==null)) { M.setVictim(null); final Ability A=M.fetchAbility("Thief_Assassinate"); A.setProficiency(100); A.invoke(M,mob,false,0); } } } if(!anyLeft) unInvoke(); } } return super.tick(ticking,tickID); } @Override public void unInvoke() { MOB M=invoker(); final MOB M2=(MOB)affected; super.unInvoke(); if((M!=null)&&(M2!=null)&&(((done)||(M2.amDead())))) { if((M.location()!=null)&&(super.canBeUninvoked())) { M.location().showHappens(CMMsg.MSG_OK_VISUAL,L("Someone steps out of the shadows and whispers something to @x1.",M.name())); M.tell(L("'It is done.'")); } } for(int i=0;i<hitmen.size();i++) { M=hitmen.elementAt(i); M.destroy(); } } @Override public int castingQuality(final MOB mob, final Physical target) { if(mob!=null) { if(!(target instanceof MOB)) return Ability.QUALITY_INDIFFERENT; if(!CMLib.flags().isACityRoom(mob.location())) return Ability.QUALITY_INDIFFERENT; if(mob.isInCombat()) return Ability.QUALITY_INDIFFERENT; if(target==mob) return Ability.QUALITY_INDIFFERENT; } return super.castingQuality(mob,target); } @Override public boolean invoke(final MOB mob, final List<String> commands, final Physical givenTarget, final boolean auto, final int asLevel) { if(commands.size()<1) { mob.tell(L("Who would you like to put a hit out on?")); return false; } if(mob.location()==null) return false; if(!CMLib.flags().isACityRoom(mob.location())) { mob.tell(L("You need to be on the streets to put out a hit.")); return false; } if(mob.isInCombat()) { mob.tell(L("You are too busy to get that done right now.")); return false; } List<MOB> V=new Vector<MOB>(); try { V=CMLib.map().findInhabitantsFavorExact(CMLib.map().rooms(), mob,CMParms.combine(commands,0), false, 10); } catch(final NoSuchElementException nse) { } MOB target=null; if(V.size()>0) target=V.get(CMLib.dice().roll(1,V.size(),-1)); if(target==null) { mob.tell(L("You've never heard of '@x1'.",CMParms.combine(commands,0))); return false; } if(target==mob) { mob.tell(L("You cannot hit yourself!")); return false; } if(!mob.mayIFight(target)) { mob.tell(L("You are not allowed to put out a hit on @x1.",target.name(mob))); return false; } int level=target.phyStats().level(); if(level>(mob.phyStats().level()+(2*getXLEVELLevel(mob)))) level=(mob.phyStats().level()+(2*getXLEVELLevel(mob))); final double goldRequired=100.0*level; final String localCurrency=CMLib.beanCounter().getCurrency(mob.location()); if(CMLib.beanCounter().getTotalAbsoluteValue(mob,localCurrency)<goldRequired) { final String costWords=CMLib.beanCounter().nameCurrencyShort(localCurrency,goldRequired); mob.tell(L("You'll need at least @x1 to put a hit out on @x2.",costWords,target.name(mob))); return false; } if(!super.invoke(mob,commands,givenTarget,auto,asLevel)) return false; int levelDiff=target.phyStats().level()-(mob.phyStats().level()+(2*getXLEVELLevel(mob))); if(levelDiff<0) levelDiff=0; levelDiff*=10; final boolean success=proficiencyCheck(mob,-levelDiff,auto); final CMMsg msg=CMClass.getMsg(mob,target,this,CMMsg.MASK_ALWAYS|CMMsg.MSG_THIEF_ACT,CMMsg.MSG_THIEF_ACT,CMMsg.MSG_THIEF_ACT,L("<S-NAME> whisper(s) to a dark figure stepping out of the shadows. The person nods and slips away.")); if(mob.location().okMessage(mob,msg)) { mob.location().send(mob,msg); CMLib.beanCounter().subtractMoney(mob,localCurrency,goldRequired); if(success) maliciousAffect(mob,target,asLevel,target.phyStats().level()+10,0); } return success; } }
{ "content_hash": "5e5add5e5bc9cf149552655a4ac2ea5d", "timestamp": "", "source": "github", "line_count": 305, "max_line_length": 232, "avg_line_length": 28.20327868852459, "alnum_prop": 0.6515926528714252, "repo_name": "bozimmerman/CoffeeMud", "id": "a33f9fc0b6f3a35f0004689e7e2fe0f318c8cd1e", "size": "9206", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "com/planet_ink/coffee_mud/Abilities/Thief/Thief_ContractHit.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5847" }, { "name": "CSS", "bytes": "1619" }, { "name": "HTML", "bytes": "12319179" }, { "name": "Java", "bytes": "38979811" }, { "name": "JavaScript", "bytes": "45220" }, { "name": "Makefile", "bytes": "23191" }, { "name": "Shell", "bytes": "8783" } ], "symlink_target": "" }
package net.fortytwo.ripple.libs.math; import net.fortytwo.flow.Sink; import net.fortytwo.ripple.RippleException; import net.fortytwo.ripple.model.ModelConnection; import net.fortytwo.ripple.model.PrimitiveStackMapping; import net.fortytwo.ripple.model.RippleList; import net.fortytwo.ripple.model.StackMapping; /** * A primitive which consumes a number representing an angle in radians and * produces its tangent. * * @author Joshua Shinavier (http://fortytwo.net) */ public class Tan extends PrimitiveStackMapping { private static final String[] IDENTIFIERS = { MathLibrary.NS_2013_03 + "tan", MathLibrary.NS_2008_08 + "tan", MathLibrary.NS_2007_08 + "tan"}; public String[] getIdentifiers() { return IDENTIFIERS; } public Tan() { super(); } public Parameter[] getParameters() { return new Parameter[]{ new Parameter("x", null, true)}; } public String getComment() { return "x => tan(x)"; } public void apply(final RippleList arg, final Sink<RippleList> solutions, final ModelConnection mc) throws RippleException { RippleList stack = arg; double a; a = mc.toNumber(stack.getFirst()).doubleValue(); stack = stack.getRest(); // TODO: check for undefined values double d = Math.tan(a); solutions.accept( stack.push(d)); } @Override public StackMapping getInverse() throws RippleException { return MathLibrary.getAtanValue(); } }
{ "content_hash": "4a38acc70a73da35893c706f01da8fb6", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 75, "avg_line_length": 26.733333333333334, "alnum_prop": 0.6321695760598504, "repo_name": "joshsh/ripple", "id": "4ec2dc7db1ada5caa1fc76fddf15a023d7bea56a", "size": "1604", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "ripple-core/src/main/java/net/fortytwo/ripple/libs/math/Tan.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "267" }, { "name": "GAP", "bytes": "14859" }, { "name": "Java", "bytes": "1069362" }, { "name": "Shell", "bytes": "778" }, { "name": "Web Ontology Language", "bytes": "9336" } ], "symlink_target": "" }
import saga c = saga.Context ('ssh') c.user_id = 'dinesh' s = saga.Session () s.add_context (c) js = saga.job.Service("lsf+ssh://yellowstone.ucar.edu", session=s)
{ "content_hash": "3063f0561573a6cc7ef2363db0f5e18c", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 66, "avg_line_length": 16.7, "alnum_prop": 0.6586826347305389, "repo_name": "telamonian/saga-python", "id": "e98f840060550cbd1298c8c34ce001405e2006d3", "size": "168", "binary": false, "copies": "5", "ref": "refs/heads/devel", "path": "tests/issues/yubikey.py", "mode": "33188", "license": "mit", "language": [ { "name": "Gnuplot", "bytes": "2790" }, { "name": "Makefile", "bytes": "142" }, { "name": "Python", "bytes": "1551101" }, { "name": "Shell", "bytes": "55277" } ], "symlink_target": "" }
package org.kie.karaf.itest.blueprint; import org.kie.karaf.itest.AbstractKarafIntegrationTest; import org.junit.Test; import org.junit.runner.RunWith; import org.kie.api.runtime.KieSession; import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.exam.karaf.options.LogLevelOption; import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; import org.ops4j.pax.exam.spi.reactors.PerMethod; import org.osgi.framework.Constants; import javax.inject.Inject; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.CoreOptions.streamBundle; import static org.ops4j.pax.exam.CoreOptions.wrappedBundle; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.*; import static org.ops4j.pax.tinybundles.core.TinyBundles.bundle; @RunWith(PaxExam.class) @ExamReactorStrategy(PerMethod.class) public class KieBlueprintDependencyKarafIntegrationTest extends AbstractKarafIntegrationTest { private static final String BLUEPRINT_XML_LOCATION = "/org/kie/karaf/itest/blueprint/kie-beans-blueprint.xml"; private static final String DRL_LOCATION = "/drl_kiesample_dependency/Hal1.drl"; @Inject private KieSession kieSession; @Test public void testKieBase() throws Exception { assertNotNull(kieSession); assertTrue("KieBase contains no packages?", kieSession.getKieBase().getKiePackages().size() > 0); } @Configuration public static Option[] configure() { return new Option[]{ // Install Karaf Container getKarafDistributionOption(), // Don't bother with local console output as it just ends up cluttering the logs configureConsole().ignoreLocalConsole(), // Force the log level to INFO so we have more details during the test. It defaults to WARN. logLevel(LogLevelOption.LogLevel.WARN), // Option to be used to do remote debugging // debugConfiguration("5005", true), // Load Kie-Aries-Blueprint loadKieFeatures("kie-aries-blueprint"), // wrap and install junit bundle - the DRL imports a class from it // (simulates for instance a bundle with domain classes used in rules) wrappedBundle(mavenBundle().groupId("junit").artifactId("junit").versionAsInProject()), // Create a bundle with META-INF/spring/kie-beans.xml - this should be processed automatically by Spring streamBundle(bundle() .add("OSGI-INF/blueprint/kie-beans-blueprint.xml", KieBlueprintDependencyKarafIntegrationTest.class.getResource(BLUEPRINT_XML_LOCATION)) .add("drl_kiesample_dependency/Hal1.drl", KieBlueprintDependencyKarafIntegrationTest.class.getResource(DRL_LOCATION)) .set(Constants.IMPORT_PACKAGE, "org.kie.aries.blueprint," + "org.kie.aries.blueprint.factorybeans," + "org.kie.aries.blueprint.helpers," + "org.kie.api," + "org.kie.api.runtime," + // junit is acting as a dependency for the rule "org.junit," + "*") .set(Constants.BUNDLE_SYMBOLICNAME, "Test-Blueprint-Bundle") // alternative for enumerating org.kie.aries.blueprint packages in Import-Package: //.set(Constants.DYNAMICIMPORT_PACKAGE, "*") .build()).start() }; } }
{ "content_hash": "214e93fd4acb50496fcae157378e8aab", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 120, "avg_line_length": 47.752941176470586, "alnum_prop": 0.6136979551613698, "repo_name": "reynoldsm88/droolsjbpm-integration", "id": "2e11c4f0e8c70ef44cfe5d2cbfb0cb56f2cf473d", "size": "4680", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "kie-osgi/kie-karaf-itests/src/test/java/org/kie/karaf/itest/blueprint/KieBlueprintDependencyKarafIntegrationTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2569" }, { "name": "CSS", "bytes": "7748" }, { "name": "FreeMarker", "bytes": "20776" }, { "name": "HTML", "bytes": "2654" }, { "name": "Java", "bytes": "6923430" }, { "name": "JavaScript", "bytes": "32051" }, { "name": "Shell", "bytes": "3525" }, { "name": "Visual Basic", "bytes": "4658" }, { "name": "XSLT", "bytes": "1094" } ], "symlink_target": "" }
 #include <aws/logs/model/LogStream.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace CloudWatchLogs { namespace Model { LogStream::LogStream() : m_logStreamNameHasBeenSet(false), m_creationTime(0), m_creationTimeHasBeenSet(false), m_firstEventTimestamp(0), m_firstEventTimestampHasBeenSet(false), m_lastEventTimestamp(0), m_lastEventTimestampHasBeenSet(false), m_lastIngestionTime(0), m_lastIngestionTimeHasBeenSet(false), m_uploadSequenceTokenHasBeenSet(false), m_arnHasBeenSet(false) { } LogStream::LogStream(JsonView jsonValue) : m_logStreamNameHasBeenSet(false), m_creationTime(0), m_creationTimeHasBeenSet(false), m_firstEventTimestamp(0), m_firstEventTimestampHasBeenSet(false), m_lastEventTimestamp(0), m_lastEventTimestampHasBeenSet(false), m_lastIngestionTime(0), m_lastIngestionTimeHasBeenSet(false), m_uploadSequenceTokenHasBeenSet(false), m_arnHasBeenSet(false) { *this = jsonValue; } LogStream& LogStream::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("logStreamName")) { m_logStreamName = jsonValue.GetString("logStreamName"); m_logStreamNameHasBeenSet = true; } if(jsonValue.ValueExists("creationTime")) { m_creationTime = jsonValue.GetInt64("creationTime"); m_creationTimeHasBeenSet = true; } if(jsonValue.ValueExists("firstEventTimestamp")) { m_firstEventTimestamp = jsonValue.GetInt64("firstEventTimestamp"); m_firstEventTimestampHasBeenSet = true; } if(jsonValue.ValueExists("lastEventTimestamp")) { m_lastEventTimestamp = jsonValue.GetInt64("lastEventTimestamp"); m_lastEventTimestampHasBeenSet = true; } if(jsonValue.ValueExists("lastIngestionTime")) { m_lastIngestionTime = jsonValue.GetInt64("lastIngestionTime"); m_lastIngestionTimeHasBeenSet = true; } if(jsonValue.ValueExists("uploadSequenceToken")) { m_uploadSequenceToken = jsonValue.GetString("uploadSequenceToken"); m_uploadSequenceTokenHasBeenSet = true; } if(jsonValue.ValueExists("arn")) { m_arn = jsonValue.GetString("arn"); m_arnHasBeenSet = true; } return *this; } JsonValue LogStream::Jsonize() const { JsonValue payload; if(m_logStreamNameHasBeenSet) { payload.WithString("logStreamName", m_logStreamName); } if(m_creationTimeHasBeenSet) { payload.WithInt64("creationTime", m_creationTime); } if(m_firstEventTimestampHasBeenSet) { payload.WithInt64("firstEventTimestamp", m_firstEventTimestamp); } if(m_lastEventTimestampHasBeenSet) { payload.WithInt64("lastEventTimestamp", m_lastEventTimestamp); } if(m_lastIngestionTimeHasBeenSet) { payload.WithInt64("lastIngestionTime", m_lastIngestionTime); } if(m_uploadSequenceTokenHasBeenSet) { payload.WithString("uploadSequenceToken", m_uploadSequenceToken); } if(m_arnHasBeenSet) { payload.WithString("arn", m_arn); } return payload; } } // namespace Model } // namespace CloudWatchLogs } // namespace Aws
{ "content_hash": "9fbde21217b08e7d56fe8d86b17daaf9", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 71, "avg_line_length": 20.506493506493506, "alnum_prop": 0.7241925269157695, "repo_name": "awslabs/aws-sdk-cpp", "id": "421702f8d15445e360af14237f30de008f9216ba", "size": "3277", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "aws-cpp-sdk-logs/source/model/LogStream.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "7596" }, { "name": "C++", "bytes": "61740540" }, { "name": "CMake", "bytes": "337520" }, { "name": "Java", "bytes": "223122" }, { "name": "Python", "bytes": "47357" } ], "symlink_target": "" }
<?php namespace Lunr\Spark\Twitter; /** * Twitter Domains */ class Domain { /** * Twitter API * @var String */ const API = 'https://api.twitter.com/'; /** * Twitter public stream * @var String */ const STREAM = 'https://stream.twitter.com/'; /** * Twitter user stream * @var String */ const USERSTREAM = 'https://userstream.twitter.com/'; /** * Twitter site stream * @var String */ const SITESTREAM = 'https://sitestream.twitter.com/'; }
{ "content_hash": "f783c18a2fdb869c16d2f268c04e1cb9", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 57, "avg_line_length": 14.621621621621621, "alnum_prop": 0.5360443622920518, "repo_name": "tardypad/lunr", "id": "1e3393afab80eba948447c2c64ae2047fd4c6ea7", "size": "788", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/Lunr/Spark/Twitter/Domain.php", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "4969" }, { "name": "PHP", "bytes": "2327756" }, { "name": "Shell", "bytes": "291" } ], "symlink_target": "" }
import React, { Component, PropTypes } from 'react' import { connect } from 'react-redux' import { orange500 } from 'material-ui/styles/colors' import FontIcon from 'material-ui/FontIcon' import AllocationTopbar from '../components/AllocationTopbar/AllocationTopbar' import JobLink from '../components/JobLink/JobLink' import AllocationLink from '../components/AllocationLink/AllocationLink' import ClientLink from '../components/ClientLink/ClientLink' import { WATCH_ALLOC, UNWATCH_ALLOC, WATCH_ALLOCS, UNWATCH_ALLOCS } from '../sagas/event' class Allocation extends Component { componentWillMount () { this.props.dispatch({ type: WATCH_ALLOC, payload: this.props.params.allocId }) } componentWillUnmount () { this.props.dispatch({ type: UNWATCH_ALLOC, payload: this.props.params.allocId }) this.props.dispatch({ type: UNWATCH_ALLOCS }) } componentDidUpdate(prevProps) { if (this.props.allocation.DesiredStatus && this.props.allocation.DesiredStatus != 'run') { if (this.props.allocations.length === 0) { this.props.dispatch({ type: WATCH_ALLOCS }) } else { this.props.dispatch({ type: UNWATCH_ALLOCS }) } } if (prevProps.params.allocId == this.props.params.allocId) { return; } if (prevProps.params.allocId) { this.props.dispatch({ type: UNWATCH_ALLOC, payload: prevProps.params.allocId }) } this.props.dispatch({ type: WATCH_ALLOC, payload: this.props.params.allocId }) } getName() { const name = this.props.allocation.Name return name.substring( name.indexOf("[") + 1, name.indexOf("]") ) } derp() { if (this.props.allocation.DesiredStatus == 'run') { return; } if (this.props.allocations.length == 0) { return } let alt = this.props.allocations.filter(a => a.Name == this.props.allocation.Name && a.ID != this.props.allocation.ID && a.DesiredStatus == 'run' ) if (alt.length == 0) { return } alt = alt[0] return ( <div className='warning-bar' style={{ backgroundColor: orange500 }}> <FontIcon className='material-icons' color='white'>info</FontIcon> <div> <AllocationLink allocationId={ alt.ID }>View replacement allocation</AllocationLink> </div> </div> ) } render () { if (this.props.allocation.Name == null) { return null } return ( <div> <AllocationTopbar { ...this.props } /> <div style={{ padding: 10, paddingBottom: 0 }}> <h3> Allocation: &nbsp; <JobLink jobId={ this.props.allocation.JobID } /> &nbsp; > &nbsp; <JobLink jobId={ this.props.allocation.JobID } taskGroupId={ this.props.allocation.TaskGroupId }> { this.props.allocation.TaskGroup } </JobLink> &nbsp; #{ this.getName() } &nbsp; @ <ClientLink clientId={ this.props.allocation.NodeID } clients={ this.props.nodes } /> </h3> { this.derp() } <br /> { this.props.children } </div> </div> ) } } function mapStateToProps ({ allocation, allocations, nodes }) { return { allocation, allocations, nodes } } Allocation.propTypes = { dispatch: PropTypes.func.isRequired, params: PropTypes.object.isRequired, allocation: PropTypes.object.isRequired, allocations: PropTypes.array.isRequired, nodes: PropTypes.array.isRequired, location: PropTypes.object.isRequired, // eslint-disable-line no-unused-vars children: PropTypes.object.isRequired } export default connect(mapStateToProps)(Allocation)
{ "content_hash": "9889dd68df43d157b78e0e26e50f3993", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 109, "avg_line_length": 25.986013986013987, "alnum_prop": 0.6259418729817008, "repo_name": "Wintermute1/hashi-ui", "id": "62f4a26817d8fb2f454c211a51190759ebb3bb27", "size": "3716", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "frontend/src/containers/allocation.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "11402" }, { "name": "Go", "bytes": "95675" }, { "name": "HCL", "bytes": "525" }, { "name": "HTML", "bytes": "2790" }, { "name": "JavaScript", "bytes": "247508" }, { "name": "Makefile", "bytes": "3641" }, { "name": "Shell", "bytes": "3392" } ], "symlink_target": "" }
// // use_future.hpp // ~~~~~~~~~~~~~~ // // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_ASIO_USE_FUTURE_HPP #define BOOST_ASIO_USE_FUTURE_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include <boost/asio/detail/config.hpp> #include <boost/asio/detail/future.hpp> #if defined(BOOST_ASIO_HAS_STD_FUTURE_CLASS) \ || defined(GENERATING_DOCUMENTATION) #include <memory> #include <boost/asio/detail/type_traits.hpp> #include <boost/asio/detail/push_options.hpp> namespace boost { namespace asio { namespace detail { template <typename Function, typename Allocator> class packaged_token; template <typename Function, typename Allocator, typename Result> class packaged_handler; } // namespace detail /// Class used to specify that an asynchronous operation should return a future. /** * The use_future_t class is used to indicate that an asynchronous operation * should return a std::future object. A use_future_t object may be passed as a * handler to an asynchronous operation, typically using the special value @c * boost::asio::use_future. For example: * * @code std::future<std::size_t> my_future * = my_socket.async_read_some(my_buffer, boost::asio::use_future); @endcode * * The initiating function (async_read_some in the above example) returns a * future that will receive the result of the operation. If the operation * completes with an error_code indicating failure, it is converted into a * system_error and passed back to the caller via the future. */ template <typename Allocator = std::allocator<void> > class use_future_t { public: /// The allocator type. The allocator is used when constructing the /// @c std::promise object for a given asynchronous operation. typedef Allocator allocator_type; /// Construct using default-constructed allocator. BOOST_ASIO_CONSTEXPR use_future_t() { } /// Construct using specified allocator. explicit use_future_t(const Allocator& allocator) : allocator_(allocator) { } #if !defined(BOOST_ASIO_NO_DEPRECATED) /// (Deprecated: Use rebind().) Specify an alternate allocator. template <typename OtherAllocator> use_future_t<OtherAllocator> operator[](const OtherAllocator& allocator) const { return use_future_t<OtherAllocator>(allocator); } #endif // !defined(BOOST_ASIO_NO_DEPRECATED) /// Specify an alternate allocator. template <typename OtherAllocator> use_future_t<OtherAllocator> rebind(const OtherAllocator& allocator) const { return use_future_t<OtherAllocator>(allocator); } /// Obtain allocator. allocator_type get_allocator() const { return allocator_; } /// Wrap a function object in a packaged task. /** * The @c package function is used to adapt a function object as a packaged * task. When this adapter is passed as a completion token to an asynchronous * operation, the result of the function object is retuned via a std::future. * * @par Example * * @code std::future<std::size_t> fut = * my_socket.async_read_some(buffer, * use_future([](boost::system::error_code ec, std::size_t n) * { * return ec ? 0 : n; * })); * ... * std::size_t n = fut.get(); @endcode */ template <typename Function> #if defined(GENERATING_DOCUMENTATION) unspecified #else // defined(GENERATING_DOCUMENTATION) detail::packaged_token<typename decay<Function>::type, Allocator> #endif // defined(GENERATING_DOCUMENTATION) operator()(BOOST_ASIO_MOVE_ARG(Function) f) const; private: // Helper type to ensure that use_future can be constexpr default-constructed // even when std::allocator<void> can't be. struct std_allocator_void { BOOST_ASIO_CONSTEXPR std_allocator_void() { } operator std::allocator<void>() const { return std::allocator<void>(); } }; typename conditional< is_same<std::allocator<void>, Allocator>::value, std_allocator_void, Allocator>::type allocator_; }; /// A special value, similar to std::nothrow. /** * See the documentation for boost::asio::use_future_t for a usage example. */ #if defined(BOOST_ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) constexpr use_future_t<> use_future; #elif defined(BOOST_ASIO_MSVC) __declspec(selectany) use_future_t<> use_future; #endif } // namespace asio } // namespace boost #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/impl/use_future.hpp> #endif // defined(BOOST_ASIO_HAS_STD_FUTURE_CLASS) // || defined(GENERATING_DOCUMENTATION) #endif // BOOST_ASIO_USE_FUTURE_HPP
{ "content_hash": "e9a67af7008ebc5173c983170b7b8418", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 80, "avg_line_length": 29.753086419753085, "alnum_prop": 0.7051867219917013, "repo_name": "fceller/arangodb", "id": "01fb2760f376311a9c754f6f539227fecd68cbd2", "size": "4820", "binary": false, "copies": "10", "ref": "refs/heads/devel", "path": "3rdParty/boost/1.69.0/boost/asio/use_future.hpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ada", "bytes": "89080" }, { "name": "AppleScript", "bytes": "1429" }, { "name": "Assembly", "bytes": "142084" }, { "name": "Batchfile", "bytes": "9073" }, { "name": "C", "bytes": "1938354" }, { "name": "C#", "bytes": "55625" }, { "name": "C++", "bytes": "79379178" }, { "name": "CLIPS", "bytes": "5291" }, { "name": "CMake", "bytes": "109718" }, { "name": "CSS", "bytes": "1341035" }, { "name": "CoffeeScript", "bytes": "94" }, { "name": "DIGITAL Command Language", "bytes": "27303" }, { "name": "Emacs Lisp", "bytes": "15477" }, { "name": "Go", "bytes": "1018005" }, { "name": "Groff", "bytes": "263567" }, { "name": "HTML", "bytes": "459886" }, { "name": "JavaScript", "bytes": "55446690" }, { "name": "LLVM", "bytes": "39361" }, { "name": "Lua", "bytes": "16189" }, { "name": "Makefile", "bytes": "178253" }, { "name": "Module Management System", "bytes": "1545" }, { "name": "NSIS", "bytes": "26909" }, { "name": "Objective-C", "bytes": "4430" }, { "name": "Objective-C++", "bytes": "1857" }, { "name": "Pascal", "bytes": "145262" }, { "name": "Perl", "bytes": "227308" }, { "name": "Protocol Buffer", "bytes": "5837" }, { "name": "Python", "bytes": "3563935" }, { "name": "Ruby", "bytes": "1000962" }, { "name": "SAS", "bytes": "1847" }, { "name": "Scheme", "bytes": "19885" }, { "name": "Shell", "bytes": "488846" }, { "name": "VimL", "bytes": "4075" }, { "name": "Yacc", "bytes": "36950" } ], "symlink_target": "" }
import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; // angular 2 highcharts import { ChartModule } from 'angular2-highcharts'; // charts import {BarChartComponent} from './barchart'; import {LineChartComponent} from './linechart'; import {AreaChartComponent} from './areachart'; import {PieChartComponent} from './piechart'; @NgModule({ imports: [ CommonModule, ChartModule ], declarations: [ BarChartComponent, LineChartComponent, AreaChartComponent, PieChartComponent ], exports: [ BarChartComponent, LineChartComponent, AreaChartComponent, PieChartComponent ], providers: [ ] }) export class ChartsModule { }
{ "content_hash": "c7680c758d991618ea6bf633d83fed27", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 50, "avg_line_length": 22.735294117647058, "alnum_prop": 0.6468305304010349, "repo_name": "alexcompton/kelsifinances", "id": "e688ba6747be0f65446dd78a4e99560998dab9ce", "size": "773", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "client/charts/charts.module.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "411" }, { "name": "HTML", "bytes": "9311" }, { "name": "JavaScript", "bytes": "1596" }, { "name": "TypeScript", "bytes": "67239" } ], "symlink_target": "" }
Feedr helps you fetch and store Atom and RSS feeds. Use it, for example, to build a feed reader. ## Installation Add this line to your application's Gemfile: gem 'feedr' And then execute: $ bundle Or install it yourself as: $ gem install feedr ## Usage See feedr-example: http://github.com/christianhellsten/feedr-example ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Added some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
{ "content_hash": "b8d9a549133f1438bf079b7bb21817ca", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 64, "avg_line_length": 19.5, "alnum_prop": 0.7213675213675214, "repo_name": "christianhellsten/feedr", "id": "c5656569bf1c0a8a4fff21dedc7ce579ad62ff64", "size": "594", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "11835" } ], "symlink_target": "" }
import Mock from 'mockjs'; let expressApply = []; for (let i = 0; i < 20; i++) { expressApply.push(Mock.mock({ aid: Mock.Random.id(), realname: Mock.Random.cname(), schoolname: Mock.Random.cname(), buildtime: Mock.Random.date(), telephone: Mock.Random.integer(), emplid: Mock.Random.integer(), stucard: Mock.Random.image(), applystatus: 0 })); } export default expressApply;
{ "content_hash": "c3615242bbd8e6f4087a280c933442b0", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 37, "avg_line_length": 23, "alnum_prop": 0.6400966183574879, "repo_name": "chwech/idianfun-admin", "id": "8c8d9a0cc57e6bd3d6dccbde38cf3356e4527535", "size": "414", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/mock/data/expressApply.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "70" }, { "name": "HTML", "bytes": "207" }, { "name": "JavaScript", "bytes": "85623" }, { "name": "Vue", "bytes": "196762" } ], "symlink_target": "" }
A factory package for Meteor. This version is very similar to https://atmospherejs.com/dburles/factory although internally it's implementation is quite different. ## Usage To define a factory: ``` Factory.define("app", Apps, { name: function() { return Faker.name(); } }); ``` To create an app and insert it into the collection (usually for things like unit tests): ``` Factory.create("app"); ``` To build an app, appropriate for `Apps.insert` (or other purposes, e.g. styleguide): ``` Factory.build("app") ``` ### Relationships A key thing is relationships between factories. ``` Factory.define("appVersion", AppVersions, { app: Factory.get("app") }); ``` If we call `Factory.create("appVersion")`, it will return a single version, but *will also insert an app into the `Apps`*. The `app` key on the version will allow you to find it. If you call `Factory.build("appVersion")` *no app* will be created and the `app` key will be set to a random id (NOTE: this may be a bad idea and quite confusing). There is a more useful method for this case: ``` Factory.compile("appVersion") ``` This returns an object with *collection names* as keys and an array of build documents as values, for instance: ``` { appVersions: [{...}], apps: [{...}] } ``` This is useful for styleguide specs for instance, as the component will usually need some or all of this data. ## TODO - JSdocs - Support mutators/validation for insert - afterCreate / decide on what after does - make extend a little saner? - decide if we'll send a PR to dburles or call this a separate package. - Allow "runtime" dependencies between packages - Seed approach for unit test consistency and speed.
{ "content_hash": "8c1c03aca22bdb7a79af7b2f5666ff72", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 178, "avg_line_length": 25.892307692307693, "alnum_prop": 0.7159833630421866, "repo_name": "mdicaire/message_management_rest_api_app", "id": "3595d170f2def41108350bff864d3ccb27362a9d", "size": "1694", "binary": false, "copies": "9", "ref": "refs/heads/master", "path": "app/packages/factory/README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "22965" }, { "name": "HTML", "bytes": "6121" }, { "name": "JavaScript", "bytes": "44009" }, { "name": "Shell", "bytes": "8319" } ], "symlink_target": "" }
<?xml version="1.0" ?> <dynamics> <package name="uo_widget_form_list.treeview.jquery"> <require>uo_widget_list.treeview.jquery</require> </package> <package name="uo_widget_form_list.auto_check.jquery"> <require>uo_widget.base.jquery</require> <path priority="low">%sf_plugins_dir%/sfUnobstrusiveWidgetPlugin/data/assets</path> <javascript>js/jquery/uo_widget_list_auto_check.jquery</javascript> </package> </dynamics>
{ "content_hash": "3e99f2bc31c342356b14eade87c8275a", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 87, "avg_line_length": 31.785714285714285, "alnum_prop": 0.7168539325842697, "repo_name": "Symfony-Plugins/sfUnobstrusiveWidgetPlugin", "id": "f1674effdf3815052332e7297cb20a98ab72343a", "size": "445", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/dynamics/jquery/uo_widget_form_list.jquery.xml", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "206275" }, { "name": "PHP", "bytes": "151116" } ], "symlink_target": "" }
<?php namespace RawPHP\CommunicationLogger\Adapter\Factory; use PDO; /** * Class ConnectionFactory * * @package RawPHP\CommunicationLogger\Adapter\Factory */ class ConnectionFactory { /** * Create PDO connection. * * @param string $type * @param string $host * @param string $port * @param string $database * @param string $user * @param string $password * * @return PDO */ public function create($type, $host, $port, $database, $user, $password) { return new PDO( sprintf( '%s:host=%s;port=%s;dbname=%s', $type, $host, $port, $database ), $user, $password ); } }
{ "content_hash": "44ef2f5d674ed85a589479bbab1fd66a", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 76, "avg_line_length": 19.65, "alnum_prop": 0.5012722646310432, "repo_name": "rawphp/communication-logger", "id": "a8f662fdd4b49ad7832cc3a96236a41765e3e733", "size": "786", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Adapter/Factory/ConnectionFactory.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "45940" } ], "symlink_target": "" }
set(RESTRICT "" CACHE STRING "Sets RESTRICT value for current target.") set(INLINE "" CACHE STRING "Sets INLINE value for current target.") set(ARCH_ARM 0 CACHE BOOL "Enables ARM architecture.") set(ARCH_MIPS 0 CACHE BOOL "Enables MIPS architecture.") set(ARCH_X86 0 CACHE BOOL "Enables X86 architecture.") set(ARCH_X86_64 0 CACHE BOOL "Enables X86_64 architecture.") set(HAVE_EDSP 0 CACHE BOOL "Enables EDSP optimizations.") set(HAVE_MEDIA 0 CACHE BOOL "Enables MEDIA optimizations.") set(HAVE_NEON 0 CACHE BOOL "Enables NEON intrinsics optimizations.") set(HAVE_NEON_ASM 0 CACHE BOOL "Enables NEON assembly optimizations.") set(HAVE_MIPS32 0 CACHE BOOL "Enables MIPS32 optimizations.") set(HAVE_DSPR2 0 CACHE BOOL "Enables DSPR2 optimizations.") set(HAVE_MSA 0 CACHE BOOL "Enables MSA optimizations.") set(HAVE_MIPS64 0 CACHE BOOL "Enables MIPS64 optimizations. ") set(HAVE_MMX 0 CACHE BOOL "Enables MMX optimizations. ") set(HAVE_SSE 0 CACHE BOOL "Enables SSE optimizations.") set(HAVE_SSE2 0 CACHE BOOL "Enables SSE2 optimizations.") set(HAVE_SSE3 0 CACHE BOOL "Enables SSE3 optimizations.") set(HAVE_SSSE3 0 CACHE BOOL "Enables SSSE3 optimizations.") set(HAVE_SSE4_1 0 CACHE BOOL "Enables SSE 4.1 optimizations.") set(HAVE_AVX 0 CACHE BOOL "Enables AVX optimizations.") set(HAVE_AVX2 0 CACHE BOOL "Enables AVX2 optimizations.") set(HAVE_AOM_PORTS 0 CACHE BOOL "Internal flag, deprecated.") set(HAVE_FEXCEPT 0 CACHE BOOL "Internal flag, GNU fenv.h present for target.") set(HAVE_PTHREAD_H 0 CACHE BOOL "Internal flag, target pthread support.") set(HAVE_UNISTD_H 0 CACHE BOOL "Internal flag, unistd.h present for target.") set(HAVE_WXWIDGETS 0 CACHE BOOL "WxWidgets present.") set(CONFIG_DEPENDENCY_TRACKING 1 CACHE BOOL "Internal flag.") set(CONFIG_EXTERNAL_BUILD 0 CACHE BOOL "Internal flag.") set(CONFIG_INSTALL_DOCS 0 CACHE BOOL "Internal flag.") set(CONFIG_INSTALL_BINS 0 CACHE BOOL "Internal flag.") set(CONFIG_INSTALL_LIBS 0 CACHE BOOL "Internal flag.") set(CONFIG_INSTALL_SRCS 0 CACHE BOOL "Internal flag.") set(CONFIG_DEBUG 0 CACHE BOOL "Internal flag.") set(CONFIG_GPROF 0 CACHE BOOL "Internal flag.") set(CONFIG_GCOV 0 CACHE BOOL "Internal flag.") set(CONFIG_RVCT 0 CACHE BOOL "Internal flag.") set(CONFIG_GCC 0 CACHE BOOL "Internal flag.") set(CONFIG_MSVS 0 CACHE BOOL "Internal flag.") set(CONFIG_PIC 0 CACHE BOOL "Internal flag.") set(CONFIG_BIG_ENDIAN 0 CACHE BOOL "Internal flag.") set(CONFIG_CODEC_SRCS 0 CACHE BOOL "Internal flag.") set(CONFIG_DEBUG_LIBS 0 CACHE BOOL "Internal flag.") set(CONFIG_RUNTIME_CPU_DETECT 1 CACHE BOOL "Internal flag.") set(CONFIG_POSTPROC 1 CACHE BOOL "Internal flag.") set(CONFIG_MULTITHREAD 1 CACHE BOOL "Internal flag.") set(CONFIG_INTERNAL_STATS 0 CACHE BOOL "Internal flag.") set(CONFIG_AV1_ENCODER 1 CACHE BOOL "Enable AV1 encoder.") set(CONFIG_AV1_DECODER 1 CACHE BOOL "Enable AV1 decoder.") set(CONFIG_AV1 1 CACHE BOOL "Internal flag.") set(CONFIG_ENCODERS 1 CACHE BOOL "Enable encoding.") set(CONFIG_DECODERS 1 CACHE BOOL "Enable decoding.") set(CONFIG_STATIC_MSVCRT 0 CACHE BOOL "Internal flag.") set(CONFIG_SPATIAL_RESAMPLING 1 CACHE BOOL "Internal flag.") set(CONFIG_REALTIME_ONLY 0 CACHE BOOL "Internal flag.") set(CONFIG_ONTHEFLY_BITPACKING 0 CACHE BOOL "Internal flag.") set(CONFIG_ERROR_CONCEALMENT 0 CACHE BOOL "Internal flag.") set(CONFIG_SHARED 0 CACHE BOOL "Internal flag.") set(CONFIG_STATIC 1 CACHE BOOL "Internal flag.") set(CONFIG_SMALL 0 CACHE BOOL "Internal flag.") set(CONFIG_POSTPROC_VISUALIZER 0 CACHE BOOL "Internal flag.") set(CONFIG_OS_SUPPORT 0 CACHE BOOL "Internal flag.") set(CONFIG_UNIT_TESTS 1 CACHE BOOL "Internal flag.") set(CONFIG_WEBM_IO 1 CACHE BOOL "Enables WebM support.") set(CONFIG_LIBYUV 1 CACHE BOOL "Enables libyuv scaling and conversion support.") set(CONFIG_ACCOUNTING 0 CACHE BOOL "Enables bit accounting.") set(CONFIG_INSPECTION 0 CACHE BOOL "Enables bitstream inspection.") set(CONFIG_DECODE_PERF_TESTS 0 CACHE BOOL "Internal flag.") set(CONFIG_ENCODE_PERF_TESTS 0 CACHE BOOL "Internal flag.") set(CONFIG_COEFFICIENT_RANGE_CHECKING 0 CACHE BOOL "Internal flag.") set(CONFIG_LOWBITDEPTH 1 CACHE BOOL "Internal flag.") set(CONFIG_AOM_HIGHBITDEPTH 0 CACHE BOOL "Internal flag.") set(CONFIG_EXPERIMENTAL 0 CACHE BOOL "Internal flag.") set(CONFIG_SIZE_LIMIT 0 CACHE BOOL "Internal flag.") set(CONFIG_AOM_QM 0 CACHE BOOL "Internal flag.") set(CONFIG_FP_MB_STATS 0 CACHE BOOL "Internal flag.") set(CONFIG_EMULATE_HARDWARE 0 CACHE BOOL "Internal flag.") set(CONFIG_CDEF 1 CACHE BOOL "Internal flag.") set(CONFIG_VAR_TX 0 CACHE BOOL "Internal flag.") set(CONFIG_RECT_TX 1 CACHE BOOL "Internal flag.") set(CONFIG_REF_MV 1 CACHE BOOL "Internal flag.") set(CONFIG_TPL_MV 0 CACHE BOOL "Internal flag.") set(CONFIG_DUAL_FILTER 0 CACHE BOOL "Internal flag.") set(CONFIG_CONVOLVE_ROUND 0 CACHE BOOL "Internal flag.") set(CONFIG_EXT_TX 0 CACHE BOOL "Internal flag.") set(CONFIG_TX64X64 0 CACHE BOOL "Internal flag.") set(CONFIG_SUB8X8_MC 0 CACHE BOOL "Internal flag.") set(CONFIG_EXT_INTRA 0 CACHE BOOL "Internal flag.") set(CONFIG_INTRA_INTERP 0 CACHE BOOL "Internal flag.") set(CONFIG_FILTER_INTRA 0 CACHE BOOL "Internal flag.") set(CONFIG_EXT_INTER 0 CACHE BOOL "Internal flag.") set(CONFIG_INTERINTRA 0 CACHE BOOL "Internal flag.") set(CONFIG_WEDGE 0 CACHE BOOL "Internal flag.") set(CONFIG_COMPOUND_SEGMENT 0 CACHE BOOL "Internal flag.") set(CONFIG_EXT_REFS 0 CACHE BOOL "Internal flag.") set(CONFIG_GLOBAL_MOTION 0 CACHE BOOL "Internal flag.") set(CONFIG_NEW_QUANT 0 CACHE BOOL "Internal flag.") set(CONFIG_SUPERTX 0 CACHE BOOL "Internal flag.") set(CONFIG_ANS 0 CACHE BOOL "Internal flag.") set(CONFIG_EC_MULTISYMBOL 1 CACHE BOOL "Internal flag.") set(CONFIG_NEW_TOKENSET 1 CACHE BOOL "Internal flag.") set(CONFIG_LOOP_RESTORATION 0 CACHE BOOL "Internal flag.") set(CONFIG_EXT_PARTITION 0 CACHE BOOL "Internal flag.") set(CONFIG_EXT_PARTITION_TYPES 0 CACHE BOOL "Internal flag.") set(CONFIG_UNPOISON_PARTITION_CTX 0 CACHE BOOL "Internal flag.") set(CONFIG_EXT_TILE 0 CACHE BOOL "Internal flag.") set(CONFIG_MOTION_VAR 0 CACHE BOOL "Internal flag.") set(CONFIG_NCOBMC 0 CACHE BOOL "Internal flag.") set(CONFIG_WARPED_MOTION 0 CACHE BOOL "Internal flag.") set(CONFIG_ENTROPY 0 CACHE BOOL "Internal flag.") set(CONFIG_Q_ADAPT_PROBS 0 CACHE BOOL "Internal flag.") set(CONFIG_SUBFRAME_PROB_UPDATE 0 CACHE BOOL "Internal flag.") set(CONFIG_BITSTREAM_DEBUG 0 CACHE BOOL "Internal flag.") set(CONFIG_ALT_INTRA 1 CACHE BOOL "Internal flag.") set(CONFIG_PALETTE 1 CACHE BOOL "Internal flag.") set(CONFIG_DAALA_EC 1 CACHE BOOL "Internal flag.") set(CONFIG_RAWBITS 0 CACHE BOOL "Internal flag.") set(CONFIG_PVQ 0 CACHE BOOL "Internal flag.") set(CONFIG_XIPHRC 0 CACHE BOOL "Internal flag.") set(CONFIG_CB4X4 0 CACHE BOOL "Internal flag.") set(CONFIG_CHROMA_2X2 0 CACHE BOOL "Internal flag.") set(CONFIG_FRAME_SIZE 0 CACHE BOOL "Internal flag.") set(CONFIG_DELTA_Q 1 CACHE BOOL "Internal flag.") set(CONFIG_ADAPT_SCAN 1 CACHE BOOL "Internal flag.") set(CONFIG_FILTER_7BIT 1 CACHE BOOL "Internal flag.") set(CONFIG_PARALLEL_DEBLOCKING 0 CACHE BOOL "Internal flag.") set(CONFIG_PARALLEL_DEBLOCKING_15TAP 0 CACHE BOOL "Internal flag.") set(CONFIG_LOOPFILTERING_ACROSS_TILES 0 CACHE BOOL "Internal flag.") set(CONFIG_TILE_GROUPS 1 CACHE BOOL "Internal flag.") set(CONFIG_EC_ADAPT 1 CACHE BOOL "Internal flag.") set(CONFIG_TEMPMV_SIGNALING 0 CACHE BOOL "Internal flag.") set(CONFIG_RD_DEBUG 0 CACHE BOOL "Internal flag.") set(CONFIG_REFERENCE_BUFFER 1 CACHE BOOL "Internal flag.") set(CONFIG_COEF_INTERLEAVE 0 CACHE BOOL "Internal flag.") set(CONFIG_ENTROPY_STATS 0 CACHE BOOL "Internal flag.") set(CONFIG_MASKED_TX 0 CACHE BOOL "Internal flag.") set(CONFIG_DEPENDENT_HORZTILES 0 CACHE BOOL "Internal flag.") set(CONFIG_DAALA_DIST 0 CACHE BOOL "Internal flag.") set(CONFIG_TRIPRED 0 CACHE BOOL "Internal flag.") set(CONFIG_PALETTE_THROUGHPUT 0 CACHE BOOL "Internal flag.") set(CONFIG_REF_ADAPT 0 CACHE BOOL "Internal flag.") set(CONFIG_LV_MAP 0 CACHE BOOL "Internal flag.") set(CONFIG_MV_COMPRESS 0 CACHE BOOL "Internal flag.") set(CONFIG_FRAME_SUPERRES 0 CACHE BOOL "Internal flag.") set(CONFIG_NEW_MULTISYMBOL 0 CACHE BOOL "Internal flag.") set(CONFIG_ANALYZER 0 CACHE BOOL "Internal flag.")
{ "content_hash": "107af132bf08bad85fa7aa6ebef5cc5f", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 80, "avg_line_length": 55.945205479452056, "alnum_prop": 0.7653036238981391, "repo_name": "smarter/aom", "id": "6d982c32b03dd2ae6174bbc69208a47dc1f43314", "size": "8982", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "build/cmake/aom_config_defaults.cmake", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Assembly", "bytes": "813276" }, { "name": "C", "bytes": "10769422" }, { "name": "C++", "bytes": "1394428" }, { "name": "CMake", "bytes": "179502" }, { "name": "Makefile", "bytes": "114701" }, { "name": "Objective-C", "bytes": "402286" }, { "name": "Perl", "bytes": "77061" }, { "name": "Perl6", "bytes": "106037" }, { "name": "Python", "bytes": "5034" }, { "name": "Shell", "bytes": "128409" } ], "symlink_target": "" }
import * as XhrTransforms from '../src/xhr-transformers'; import {Headers} from '../src/headers'; describe('transformers', () => { it("timeout should set the xhr timeout to the message timeout if defined in the message", () => { let xhr = {}; XhrTransforms.timeoutTransformer(null, null, {}, xhr); expect(xhr.timeout).toBeUndefined(); XhrTransforms.timeoutTransformer(null, null, {timeout: 200}, xhr); expect(xhr.timeout).toBe(200); }); it("callbackParameterNameTransformer should set the xhr.callbackParameterName if defined in the message", () => { let xhr = {}; XhrTransforms.callbackParameterNameTransformer(null, null, {}, xhr); expect(xhr.callbackParameterName).toBeUndefined(); XhrTransforms.callbackParameterNameTransformer(null, null, {callbackParameterName: 'foo'}, xhr); expect(xhr.callbackParameterName).toBe('foo'); }); it("credentialsTransformer should set the xhr.withCredentials if defined in the message", () => { let xhr = {}, credentials = {}; XhrTransforms.credentialsTransformer(null, null, {}, xhr); expect(xhr.withCredentials).toBeUndefined(); XhrTransforms.credentialsTransformer(null, null, {withCredentials: credentials}, xhr); expect(xhr.withCredentials).toBe(credentials); }); it("responseTypeTransformer should change the responseType to text when it's json", () => { let xhr = {upload: {}}, progressCallback = {}; XhrTransforms.progressTransformer(null, null, {}, xhr); expect(xhr.upload.onprogress).toBeUndefined(); XhrTransforms.progressTransformer(null, null, {progressCallback: progressCallback}, xhr); expect(xhr.upload.onprogress).toBe(progressCallback); }); it("contentTransformer should set the Content-Type header to application/json when it serializes the content to JSON", () => { let message = {headers: new Headers()}; XhrTransforms.contentTransformer(null, null, message, {}); expect(message.headers.get("Content-Type")).toBeUndefined(); message.content = "test"; XhrTransforms.contentTransformer(null, null, message, {}); expect(message.headers.get("Content-Type")).toBeUndefined(); message.content = {test:"content"}; message.headers.add("Content-Type", "text/test"); XhrTransforms.contentTransformer(null, null, message, {}); expect(message.headers.get("Content-Type")).toBe("text/test"); message.headers.clear(); message.content = {test:"content"}; XhrTransforms.contentTransformer(null, null, message, {}); expect(message.headers.get("Content-Type")).toBe("application/json"); }); });
{ "content_hash": "706e2cd6d92ab142f1ac4c04b6b17212", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 128, "avg_line_length": 38.48529411764706, "alnum_prop": 0.7011845624761177, "repo_name": "davismj/http-client", "id": "74a07fa35ee9956c7d9484af95880d99c3d1bb03", "size": "2617", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "test/xhr-transformers.spec.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "194640" } ], "symlink_target": "" }
from flask import Blueprint, jsonify, current_app, request, g from web.autorizacao import requer_acesso from web.autenticacao import requer_usuario from domain.recurso import DTOAgendamento, DTOIntervalo from domain.usuario.nivel_acesso import * from domain.iso8601 import to_iso from domain.excecoes import * api = Blueprint('api', __name__) def recurso_to_dict(recurso): print(recurso.__dict__) return { 'nome': recurso.nome, 'categoria': recurso.tipo.nome, 'utilizavel': recurso.utilizavel, 'agendamentos': [agendamento_to_dict(a) for a in recurso.agendamentos] } def agendamento_to_dict(agendamento): return { 'idResponsavel': agendamento.idResponsavel, 'intervalo': intervalo_to_dict(agendamento.intervalo) } def intervalo_to_dict(intervalo): return { 'inicio': to_iso(intervalo.inicio), 'fim': to_iso(intervalo.fim) } def return_recurso(id): recurso = current_app.crud_recurso.obter(id) return jsonify({'recurso': recurso_to_dict(recurso)}) def erro(txt, code=400): response = jsonify({'erro': txt}) response.status_code = code return response @api.route("/recursos") @requer_usuario def listar_recurso(): recursos = current_app.crud_recurso.listar() json = { 'recursos': [recurso_to_dict(r) for r in recursos] } return jsonify(json) @api.route("/recursos/<id>") @requer_acesso(SistemaManutencao(), Administrador()) def obter_recurso(id): return return_recurso(int(id)) @api.route("/recursos/<id_recurso>/estado", methods=['POST']) @requer_acesso(SistemaManutencao(), Administrador()) def alterar_estado(id_recurso): entrada = request.get_json() current_app.estado_recurso.alterar_estado(int(id_recurso), entrada['utilizavel']) return return_recurso(id_recurso) @api.route("/recursos/<id_recurso>/agendamentos", methods=['POST']) @requer_usuario def agendar(id_recurso): id = int(id_recurso) entrada = request.get_json() try: dto = DTOAgendamento( idResponsavel = g.usuario.id, intervalo = DTOIntervalo( entrada['agendamento']['intervalo']['inicio'], entrada['agendamento']['intervalo']['fim'] ) ) current_app.agendamento.agendar(id, dto) return return_recurso(id) except ExcecaoAgendamentoRecursoOcupado: return erro('Recurso não disponível para o intervalo desejado') except ExcecaoAgendamentoRecursoInutilizavel: return erro('Recurso está marcado como inutilizável') except KeyError: return erro('Formato de entrada inválido') @api.route("/recursos/<id_recurso>/cancelar_agendamento", methods=['POST']) @requer_usuario def cancelar_agendamento(id_recurso): id = int(id_recurso) entrada = request.get_json() try: dto = DTOAgendamento( idResponsavel = int(entrada['agendamento']['idResponsavel']), intervalo = DTOIntervalo( entrada['agendamento']['intervalo']['inicio'], entrada['agendamento']['intervalo']['fim'] ) ) if dto.idResponsavel != g.usuario.id and g.nivelAcesso != Administrador(): raise ExcecaoNaoAutorizado current_app.agendamento.remover(id, dto) return return_recurso(id) except ExcecaoAgendamentoInexistente: return erro('Não existe agendamento igual ao especificado') except KeyError: return erro('Formato de entrada inválido')
{ "content_hash": "e2c8a49106cb6c9df04091997d981085", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 85, "avg_line_length": 31.491071428571427, "alnum_prop": 0.6640204139495322, "repo_name": "ESEGroup/Paraguai", "id": "64036144c866f9eba20043ea2b27e01467a42ad7", "size": "3534", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web/views/api.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "7243" }, { "name": "HTML", "bytes": "14750" }, { "name": "JavaScript", "bytes": "502" }, { "name": "Python", "bytes": "67669" } ], "symlink_target": "" }
package org.apache.zeppelin.interpreter; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import org.apache.commons.lang.ArrayUtils; import org.apache.zeppelin.conf.ZeppelinConfiguration; import org.apache.zeppelin.conf.ZeppelinConfiguration.ConfVars; import org.apache.zeppelin.display.AngularObjectRegistry; import org.apache.zeppelin.display.AngularObjectRegistryListener; import org.apache.zeppelin.interpreter.Interpreter.RegisteredInterpreter; import org.apache.zeppelin.interpreter.remote.RemoteAngularObjectRegistry; import org.apache.zeppelin.interpreter.remote.RemoteInterpreter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.gson.Gson; import com.google.gson.GsonBuilder; /** * Manage interpreters. * */ public class InterpreterFactory { Logger logger = LoggerFactory.getLogger(InterpreterFactory.class); private Map<String, URLClassLoader> cleanCl = Collections .synchronizedMap(new HashMap<String, URLClassLoader>()); private ZeppelinConfiguration conf; String[] interpreterClassList; private Map<String, InterpreterSetting> interpreterSettings = new HashMap<String, InterpreterSetting>(); private Map<String, List<String>> interpreterBindings = new HashMap<String, List<String>>(); private Gson gson; private InterpreterOption defaultOption; AngularObjectRegistryListener angularObjectRegistryListener; public InterpreterFactory(ZeppelinConfiguration conf, AngularObjectRegistryListener angularObjectRegistryListener) throws InterpreterException, IOException { this(conf, new InterpreterOption(true), angularObjectRegistryListener); } public InterpreterFactory(ZeppelinConfiguration conf, InterpreterOption defaultOption, AngularObjectRegistryListener angularObjectRegistryListener) throws InterpreterException, IOException { this.conf = conf; this.defaultOption = defaultOption; this.angularObjectRegistryListener = angularObjectRegistryListener; String replsConf = conf.getString(ConfVars.ZEPPELIN_INTERPRETERS); interpreterClassList = replsConf.split(","); GsonBuilder builder = new GsonBuilder(); builder.setPrettyPrinting(); builder.registerTypeAdapter(Interpreter.class, new InterpreterSerializer()); gson = builder.create(); init(); } private void init() throws InterpreterException, IOException { ClassLoader oldcl = Thread.currentThread().getContextClassLoader(); // Load classes File[] interpreterDirs = new File(conf.getInterpreterDir()).listFiles(); if (interpreterDirs != null) { for (File path : interpreterDirs) { logger.info("Reading " + path.getAbsolutePath()); URL[] urls = null; try { urls = recursiveBuildLibList(path); } catch (MalformedURLException e1) { logger.error("Can't load jars ", e1); } URLClassLoader ccl = new URLClassLoader(urls, oldcl); for (String className : interpreterClassList) { try { Class.forName(className, true, ccl); Set<String> keys = Interpreter.registeredInterpreters.keySet(); for (String intName : keys) { if (className.equals( Interpreter.registeredInterpreters.get(intName).getClassName())) { Interpreter.registeredInterpreters.get(intName).setPath(path.getAbsolutePath()); logger.info("Interpreter " + intName + " found. class=" + className); cleanCl.put(path.getAbsolutePath(), ccl); } } } catch (ClassNotFoundException e) { // nothing to do } } } } loadFromFile(); // if no interpreter settings are loaded, create default set synchronized (interpreterSettings) { if (interpreterSettings.size() == 0) { HashMap<String, List<RegisteredInterpreter>> groupClassNameMap = new HashMap<String, List<RegisteredInterpreter>>(); for (String k : Interpreter.registeredInterpreters.keySet()) { RegisteredInterpreter info = Interpreter.registeredInterpreters.get(k); if (!groupClassNameMap.containsKey(info.getGroup())) { groupClassNameMap.put(info.getGroup(), new LinkedList<RegisteredInterpreter>()); } groupClassNameMap.get(info.getGroup()).add(info); } for (String className : interpreterClassList) { for (String groupName : groupClassNameMap.keySet()) { List<RegisteredInterpreter> infos = groupClassNameMap.get(groupName); boolean found = false; Properties p = new Properties(); for (RegisteredInterpreter info : infos) { if (found == false && info.getClassName().equals(className)) { found = true; } for (String k : info.getProperties().keySet()) { p.put(k, info.getProperties().get(k).getDefaultValue()); } } if (found) { // add all interpreters in group add(groupName, groupName, defaultOption, p); groupClassNameMap.remove(groupName); break; } } } } } for (String settingId : interpreterSettings.keySet()) { InterpreterSetting setting = interpreterSettings.get(settingId); logger.info("Interpreter setting group {} : id={}, name={}", setting.getGroup(), settingId, setting.getName()); for (Interpreter interpreter : setting.getInterpreterGroup()) { logger.info(" className = {}", interpreter.getClassName()); } } } private void loadFromFile() throws IOException { GsonBuilder builder = new GsonBuilder(); builder.setPrettyPrinting(); builder.registerTypeAdapter(Interpreter.class, new InterpreterSerializer()); Gson gson = builder.create(); File settingFile = new File(conf.getInterpreterSettingPath()); if (!settingFile.exists()) { // nothing to read return; } FileInputStream fis = new FileInputStream(settingFile); InputStreamReader isr = new InputStreamReader(fis); BufferedReader bufferedReader = new BufferedReader(isr); StringBuilder sb = new StringBuilder(); String line; while ((line = bufferedReader.readLine()) != null) { sb.append(line); } isr.close(); fis.close(); String json = sb.toString(); InterpreterInfoSaving info = gson.fromJson(json, InterpreterInfoSaving.class); for (String k : info.interpreterSettings.keySet()) { InterpreterSetting setting = info.interpreterSettings.get(k); // Always use separate interpreter process // While we decided to turn this feature on always (without providing // enable/disable option on GUI). // previously created setting should turn this feature on here. setting.getOption().setRemote(true); InterpreterSetting intpSetting = new InterpreterSetting( setting.id(), setting.getName(), setting.getGroup(), setting.getOption()); InterpreterGroup interpreterGroup = createInterpreterGroup( setting.id(), setting.getGroup(), setting.getOption(), setting.getProperties()); intpSetting.setInterpreterGroup(interpreterGroup); interpreterSettings.put(k, intpSetting); } this.interpreterBindings = info.interpreterBindings; } private void saveToFile() throws IOException { String jsonString; synchronized (interpreterSettings) { InterpreterInfoSaving info = new InterpreterInfoSaving(); info.interpreterBindings = interpreterBindings; info.interpreterSettings = interpreterSettings; jsonString = gson.toJson(info); } File settingFile = new File(conf.getInterpreterSettingPath()); if (!settingFile.exists()) { settingFile.createNewFile(); } FileOutputStream fos = new FileOutputStream(settingFile, false); OutputStreamWriter out = new OutputStreamWriter(fos); out.append(jsonString); out.close(); fos.close(); } private RegisteredInterpreter getRegisteredReplInfoFromClassName(String clsName) { Set<String> keys = Interpreter.registeredInterpreters.keySet(); for (String intName : keys) { RegisteredInterpreter info = Interpreter.registeredInterpreters.get(intName); if (clsName.equals(info.getClassName())) { return info; } } return null; } /** * Return ordered interpreter setting list. * The list does not contain more than one setting from the same interpreter class. * Order by InterpreterClass (order defined by ZEPPELIN_INTERPRETERS), Interpreter setting name * @return */ public List<String> getDefaultInterpreterSettingList() { // this list will contain default interpreter setting list List<String> defaultSettings = new LinkedList<String>(); // to ignore the same interpreter group Map<String, Boolean> interpreterGroupCheck = new HashMap<String, Boolean>(); List<InterpreterSetting> sortedSettings = get(); for (InterpreterSetting setting : sortedSettings) { if (defaultSettings.contains(setting.id())) { continue; } if (!interpreterGroupCheck.containsKey(setting.getGroup())) { defaultSettings.add(setting.id()); interpreterGroupCheck.put(setting.getGroup(), true); } } return defaultSettings; } public List<RegisteredInterpreter> getRegisteredInterpreterList() { List<RegisteredInterpreter> registeredInterpreters = new LinkedList<RegisteredInterpreter>(); for (String className : interpreterClassList) { registeredInterpreters.add(Interpreter.findRegisteredInterpreterByClassName(className)); } return registeredInterpreters; } /** * @param name user defined name * @param groupName interpreter group name to instantiate * @param properties * @return * @throws InterpreterException * @throws IOException */ public InterpreterGroup add(String name, String groupName, InterpreterOption option, Properties properties) throws InterpreterException, IOException { synchronized (interpreterSettings) { InterpreterSetting intpSetting = new InterpreterSetting( name, groupName, option); InterpreterGroup interpreterGroup = createInterpreterGroup( intpSetting.id(), groupName, option, properties); intpSetting.setInterpreterGroup(interpreterGroup); interpreterSettings.put(intpSetting.id(), intpSetting); saveToFile(); return interpreterGroup; } } private InterpreterGroup createInterpreterGroup(String id, String groupName, InterpreterOption option, Properties properties) throws InterpreterException { AngularObjectRegistry angularObjectRegistry; InterpreterGroup interpreterGroup = new InterpreterGroup(id); if (option.isRemote()) { angularObjectRegistry = new RemoteAngularObjectRegistry( id, angularObjectRegistryListener, interpreterGroup ); } else { angularObjectRegistry = new AngularObjectRegistry( id, angularObjectRegistryListener); } interpreterGroup.setAngularObjectRegistry(angularObjectRegistry); for (String className : interpreterClassList) { Set<String> keys = Interpreter.registeredInterpreters.keySet(); for (String intName : keys) { RegisteredInterpreter info = Interpreter.registeredInterpreters .get(intName); if (info.getClassName().equals(className) && info.getGroup().equals(groupName)) { Interpreter intp; if (option.isRemote()) { intp = createRemoteRepl(info.getPath(), info.getClassName(), properties); } else { intp = createRepl(info.getPath(), info.getClassName(), properties); } interpreterGroup.add(intp); intp.setInterpreterGroup(interpreterGroup); break; } } } return interpreterGroup; } public void remove(String id) throws IOException { synchronized (interpreterSettings) { if (interpreterSettings.containsKey(id)) { InterpreterSetting intp = interpreterSettings.get(id); intp.getInterpreterGroup().close(); intp.getInterpreterGroup().destroy(); interpreterSettings.remove(id); for (List<String> settings : interpreterBindings.values()) { Iterator<String> it = settings.iterator(); while (it.hasNext()) { String settingId = it.next(); if (settingId.equals(id)) { it.remove(); } } } saveToFile(); } } } /** * Get loaded interpreters * @return */ public List<InterpreterSetting> get() { synchronized (interpreterSettings) { List<InterpreterSetting> orderedSettings = new LinkedList<InterpreterSetting>(); List<InterpreterSetting> settings = new LinkedList<InterpreterSetting>( interpreterSettings.values()); Collections.sort(settings, new Comparator<InterpreterSetting>(){ @Override public int compare(InterpreterSetting o1, InterpreterSetting o2) { return o1.getName().compareTo(o2.getName()); } }); for (String className : interpreterClassList) { for (InterpreterSetting setting : settings) { for (InterpreterSetting orderedSetting : orderedSettings) { if (orderedSetting.id().equals(setting.id())) { continue; } } for (Interpreter intp : setting.getInterpreterGroup()) { if (className.equals(intp.getClassName())) { boolean alreadyAdded = false; for (InterpreterSetting st : orderedSettings) { if (setting.id().equals(st.id())) { alreadyAdded = true; } } if (alreadyAdded == false) { orderedSettings.add(setting); } } } } } return orderedSettings; } } public InterpreterSetting get(String name) { synchronized (interpreterSettings) { return interpreterSettings.get(name); } } public void putNoteInterpreterSettingBinding(String noteId, List<String> settingList) throws IOException { synchronized (interpreterSettings) { interpreterBindings.put(noteId, settingList); saveToFile(); } } public void removeNoteInterpreterSettingBinding(String noteId) { synchronized (interpreterSettings) { interpreterBindings.remove(noteId); } } public List<String> getNoteInterpreterSettingBinding(String noteId) { LinkedList<String> bindings = new LinkedList<String>(); synchronized (interpreterSettings) { List<String> settingIds = interpreterBindings.get(noteId); if (settingIds != null) { bindings.addAll(settingIds); } } return bindings; } /** * Change interpreter property and restart * @param name * @param properties * @throws IOException */ public void setPropertyAndRestart(String id, InterpreterOption option, Properties properties) throws IOException { synchronized (interpreterSettings) { InterpreterSetting intpsetting = interpreterSettings.get(id); if (intpsetting != null) { intpsetting.getInterpreterGroup().close(); intpsetting.getInterpreterGroup().destroy(); intpsetting.setOption(option); InterpreterGroup interpreterGroup = createInterpreterGroup( intpsetting.id(), intpsetting.getGroup(), option, properties); intpsetting.setInterpreterGroup(interpreterGroup); saveToFile(); } else { throw new InterpreterException("Interpreter setting id " + id + " not found"); } } } public void restart(String id) { synchronized (interpreterSettings) { InterpreterSetting intpsetting = interpreterSettings.get(id); if (intpsetting != null) { intpsetting.getInterpreterGroup().close(); intpsetting.getInterpreterGroup().destroy(); InterpreterGroup interpreterGroup = createInterpreterGroup( intpsetting.id(), intpsetting.getGroup(), intpsetting.getOption(), intpsetting.getProperties()); intpsetting.setInterpreterGroup(interpreterGroup); } else { throw new InterpreterException("Interpreter setting id " + id + " not found"); } } } public void close() { List<Thread> closeThreads = new LinkedList<Thread>(); synchronized (interpreterSettings) { Collection<InterpreterSetting> intpsettings = interpreterSettings.values(); for (final InterpreterSetting intpsetting : intpsettings) { Thread t = new Thread() { public void run() { intpsetting.getInterpreterGroup().close(); intpsetting.getInterpreterGroup().destroy(); } }; t.start(); closeThreads.add(t); } } for (Thread t : closeThreads) { try { t.join(); } catch (InterruptedException e) { logger.error("Can't close interpreterGroup", e); } } } private Interpreter createRepl(String dirName, String className, Properties property) throws InterpreterException { logger.info("Create repl {} from {}", className, dirName); ClassLoader oldcl = Thread.currentThread().getContextClassLoader(); try { URLClassLoader ccl = cleanCl.get(dirName); if (ccl == null) { // classloader fallback ccl = URLClassLoader.newInstance(new URL[] {}, oldcl); } boolean separateCL = true; try { // check if server's classloader has driver already. Class cls = this.getClass().forName(className); if (cls != null) { separateCL = false; } } catch (Exception e) { // nothing to do. } URLClassLoader cl; if (separateCL == true) { cl = URLClassLoader.newInstance(new URL[] {}, ccl); } else { cl = ccl; } Thread.currentThread().setContextClassLoader(cl); Class<Interpreter> replClass = (Class<Interpreter>) cl.loadClass(className); Constructor<Interpreter> constructor = replClass.getConstructor(new Class[] {Properties.class}); Interpreter repl = constructor.newInstance(property); repl.setClassloaderUrls(ccl.getURLs()); LazyOpenInterpreter intp = new LazyOpenInterpreter( new ClassloaderInterpreter(repl, cl)); return intp; } catch (SecurityException e) { throw new InterpreterException(e); } catch (NoSuchMethodException e) { throw new InterpreterException(e); } catch (IllegalArgumentException e) { throw new InterpreterException(e); } catch (InstantiationException e) { throw new InterpreterException(e); } catch (IllegalAccessException e) { throw new InterpreterException(e); } catch (InvocationTargetException e) { throw new InterpreterException(e); } catch (ClassNotFoundException e) { throw new InterpreterException(e); } finally { Thread.currentThread().setContextClassLoader(oldcl); } } private Interpreter createRemoteRepl(String interpreterPath, String className, Properties property) { int connectTimeout = conf.getInt(ConfVars.ZEPPELIN_INTERPRETER_CONNECT_TIMEOUT); LazyOpenInterpreter intp = new LazyOpenInterpreter(new RemoteInterpreter( property, className, conf.getInterpreterRemoteRunnerPath(), interpreterPath, connectTimeout)); return intp; } private URL[] recursiveBuildLibList(File path) throws MalformedURLException { URL[] urls = new URL[0]; if (path == null || path.exists() == false) { return urls; } else if (path.getName().startsWith(".")) { return urls; } else if (path.isDirectory()) { File[] files = path.listFiles(); if (files != null) { for (File f : files) { urls = (URL[]) ArrayUtils.addAll(urls, recursiveBuildLibList(f)); } } return urls; } else { return new URL[] {path.toURI().toURL()}; } } }
{ "content_hash": "8a84f9b164538941f8158798df81ae89", "timestamp": "", "source": "github", "line_count": 646, "max_line_length": 97, "avg_line_length": 32.746130030959755, "alnum_prop": 0.6626169991490971, "repo_name": "kidaa/incubator-zeppelin", "id": "f753d5e19631a64d95b84869cefa25f46c4c5117", "size": "21954", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "42784" }, { "name": "HTML", "bytes": "203849" }, { "name": "Java", "bytes": "1424704" }, { "name": "JavaScript", "bytes": "115363" }, { "name": "Python", "bytes": "20514" }, { "name": "Scala", "bytes": "114379" }, { "name": "Shell", "bytes": "36478" }, { "name": "Thrift", "bytes": "2528" }, { "name": "XSLT", "bytes": "1326" } ], "symlink_target": "" }
package com.google.template.soy.passes; import com.google.template.soy.soytree.AbstractSoyNodeVisitor; import com.google.template.soy.soytree.SoyNode; import com.google.template.soy.soytree.SoyNode.ParentSoyNode; import com.google.template.soy.soytree.TemplateNode; /** * Visitor for removing SoyDoc strings from {@code TemplateNode}s (saves memory when they're not * needed). * * <p>Important: Do not use outside of Soy code (treat as superpackage-private). * */ public final class ClearSoyDocStringsVisitor extends AbstractSoyNodeVisitor<Void> { // ----------------------------------------------------------------------------------------------- // Implementations for specific nodes. @Override protected void visitTemplateNode(TemplateNode node) { node.clearSoyDocStrings(); } // ----------------------------------------------------------------------------------------------- // Fallback implementation. @Override protected void visitSoyNode(SoyNode node) { if (node instanceof ParentSoyNode<?>) { visitChildren((ParentSoyNode<?>) node); } } }
{ "content_hash": "ca4b66d607e12725c09c792e76e79655", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 100, "avg_line_length": 31.34285714285714, "alnum_prop": 0.6144029170464904, "repo_name": "yext/closure-templates", "id": "76e5886db3781b34ae3253618307e9df1ed12198", "size": "1691", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "java/src/com/google/template/soy/passes/ClearSoyDocStringsVisitor.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "25304" }, { "name": "Java", "bytes": "4765013" }, { "name": "JavaScript", "bytes": "1402588" }, { "name": "Python", "bytes": "66376" } ], "symlink_target": "" }
package jetbrains.buildServer.helm; import org.jetbrains.annotations.NotNull; import java.util.List; import java.util.Map; /** * Created by Evgeniy Koshkin ([email protected]) on 29.11.17. */ public interface HelmCommandArgumentsProvider { @NotNull String getCommandId(); @NotNull List<String> getArguments(@NotNull Map<String, String> runnerParameters); }
{ "content_hash": "5acf2b9ed1ffed5a7b576cbbf38fbe93", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 77, "avg_line_length": 23, "alnum_prop": 0.7519181585677749, "repo_name": "ekoshkin/teamcity-kubernetes-plugin", "id": "9c54fdb0840b3c18bd70d43f643ccce0049830d8", "size": "391", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "teamcity-kubernetes-plugin-agent/src/main/java/jetbrains/buildServer/helm/HelmCommandArgumentsProvider.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "217" }, { "name": "Java", "bytes": "97931" }, { "name": "JavaScript", "bytes": "18741" } ], "symlink_target": "" }
package de.unibremen.beduino.dcaf; import de.unibremen.beduino.dcaf.datastructures.Authorization; import de.unibremen.beduino.dcaf.datastructures.TicketRequestMessage; import de.unibremen.beduino.dcaf.exceptions.NotAuthorizedException; import org.jetbrains.annotations.NotNull; import java.net.URI; /** * @author Connor Lanigan * @author Sven Höper */ public abstract class PermissionFilter { /** * @param camIdentifier Client Authorization Manager Identifier * @param ticketRequestMessage Ticket Request Message * @return TicketRequestMessage mit den Berechtigungen die gewährt wurden */ public TicketRequestMessage filter(@NotNull String camIdentifier, @NotNull TicketRequestMessage ticketRequestMessage) throws NotAuthorizedException { TicketRequestMessage tRM = doFilter(camIdentifier, ticketRequestMessage); for (Authorization a : tRM.sai) { URI uri = URI.create(a.getUri()); a.setHost(uri.getHost()); a.setUri(uri.getPath()); } return tRM; } protected abstract TicketRequestMessage doFilter(@NotNull String camIdentifier, @NotNull TicketRequestMessage ticketRequestMessage) throws NotAuthorizedException; }
{ "content_hash": "19aa8c9f5f22c65a0158edc01d0c190c", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 135, "avg_line_length": 34.486486486486484, "alnum_prop": 0.7210031347962382, "repo_name": "beduino-project/dcaf-java", "id": "530fb00bedbb3daef63c29cbda36145cb76b601f", "size": "1278", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/de/unibremen/beduino/dcaf/PermissionFilter.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "42638" } ], "symlink_target": "" }
*> \brief <b> DPBSVX computes the solution to system of linear equations A * X = B for OTHER matrices</b> * * =========== DOCUMENTATION =========== * * Online html documentation available at * http://www.netlib.org/lapack/explore-html/ * *> \htmlonly *> Download DPBSVX + dependencies *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dpbsvx.f"> *> [TGZ]</a> *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dpbsvx.f"> *> [ZIP]</a> *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpbsvx.f"> *> [TXT]</a> *> \endhtmlonly * * Definition: * =========== * * SUBROUTINE DPBSVX( FACT, UPLO, N, KD, NRHS, AB, LDAB, AFB, LDAFB, * EQUED, S, B, LDB, X, LDX, RCOND, FERR, BERR, * WORK, IWORK, INFO ) * * .. Scalar Arguments .. * CHARACTER EQUED, FACT, UPLO * INTEGER INFO, KD, LDAB, LDAFB, LDB, LDX, N, NRHS * DOUBLE PRECISION RCOND * .. * .. Array Arguments .. * INTEGER IWORK( * ) * DOUBLE PRECISION AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ), * $ BERR( * ), FERR( * ), S( * ), WORK( * ), * $ X( LDX, * ) * .. * * *> \par Purpose: * ============= *> *> \verbatim *> *> DPBSVX uses the Cholesky factorization A = U**T*U or A = L*L**T to *> compute the solution to a real system of linear equations *> A * X = B, *> where A is an N-by-N symmetric positive definite band matrix and X *> and B are N-by-NRHS matrices. *> *> Error bounds on the solution and a condition estimate are also *> provided. *> \endverbatim * *> \par Description: * ================= *> *> \verbatim *> *> The following steps are performed: *> *> 1. If FACT = 'E', real scaling factors are computed to equilibrate *> the system: *> diag(S) * A * diag(S) * inv(diag(S)) * X = diag(S) * B *> Whether or not the system will be equilibrated depends on the *> scaling of the matrix A, but if equilibration is used, A is *> overwritten by diag(S)*A*diag(S) and B by diag(S)*B. *> *> 2. If FACT = 'N' or 'E', the Cholesky decomposition is used to *> factor the matrix A (after equilibration if FACT = 'E') as *> A = U**T * U, if UPLO = 'U', or *> A = L * L**T, if UPLO = 'L', *> where U is an upper triangular band matrix, and L is a lower *> triangular band matrix. *> *> 3. If the leading i-by-i principal minor is not positive definite, *> then the routine returns with INFO = i. Otherwise, the factored *> form of A is used to estimate the condition number of the matrix *> A. If the reciprocal of the condition number is less than machine *> precision, INFO = N+1 is returned as a warning, but the routine *> still goes on to solve for X and compute error bounds as *> described below. *> *> 4. The system of equations is solved for X using the factored form *> of A. *> *> 5. Iterative refinement is applied to improve the computed solution *> matrix and calculate error bounds and backward error estimates *> for it. *> *> 6. If equilibration was used, the matrix X is premultiplied by *> diag(S) so that it solves the original system before *> equilibration. *> \endverbatim * * Arguments: * ========== * *> \param[in] FACT *> \verbatim *> FACT is CHARACTER*1 *> Specifies whether or not the factored form of the matrix A is *> supplied on entry, and if not, whether the matrix A should be *> equilibrated before it is factored. *> = 'F': On entry, AFB contains the factored form of A. *> If EQUED = 'Y', the matrix A has been equilibrated *> with scaling factors given by S. AB and AFB will not *> be modified. *> = 'N': The matrix A will be copied to AFB and factored. *> = 'E': The matrix A will be equilibrated if necessary, then *> copied to AFB and factored. *> \endverbatim *> *> \param[in] UPLO *> \verbatim *> UPLO is CHARACTER*1 *> = 'U': Upper triangle of A is stored; *> = 'L': Lower triangle of A is stored. *> \endverbatim *> *> \param[in] N *> \verbatim *> N is INTEGER *> The number of linear equations, i.e., the order of the *> matrix A. N >= 0. *> \endverbatim *> *> \param[in] KD *> \verbatim *> KD is INTEGER *> The number of superdiagonals of the matrix A if UPLO = 'U', *> or the number of subdiagonals if UPLO = 'L'. KD >= 0. *> \endverbatim *> *> \param[in] NRHS *> \verbatim *> NRHS is INTEGER *> The number of right-hand sides, i.e., the number of columns *> of the matrices B and X. NRHS >= 0. *> \endverbatim *> *> \param[in,out] AB *> \verbatim *> AB is DOUBLE PRECISION array, dimension (LDAB,N) *> On entry, the upper or lower triangle of the symmetric band *> matrix A, stored in the first KD+1 rows of the array, except *> if FACT = 'F' and EQUED = 'Y', then A must contain the *> equilibrated matrix diag(S)*A*diag(S). The j-th column of A *> is stored in the j-th column of the array AB as follows: *> if UPLO = 'U', AB(KD+1+i-j,j) = A(i,j) for max(1,j-KD)<=i<=j; *> if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(N,j+KD). *> See below for further details. *> *> On exit, if FACT = 'E' and EQUED = 'Y', A is overwritten by *> diag(S)*A*diag(S). *> \endverbatim *> *> \param[in] LDAB *> \verbatim *> LDAB is INTEGER *> The leading dimension of the array A. LDAB >= KD+1. *> \endverbatim *> *> \param[in,out] AFB *> \verbatim *> AFB is DOUBLE PRECISION array, dimension (LDAFB,N) *> If FACT = 'F', then AFB is an input argument and on entry *> contains the triangular factor U or L from the Cholesky *> factorization A = U**T*U or A = L*L**T of the band matrix *> A, in the same storage format as A (see AB). If EQUED = 'Y', *> then AFB is the factored form of the equilibrated matrix A. *> *> If FACT = 'N', then AFB is an output argument and on exit *> returns the triangular factor U or L from the Cholesky *> factorization A = U**T*U or A = L*L**T. *> *> If FACT = 'E', then AFB is an output argument and on exit *> returns the triangular factor U or L from the Cholesky *> factorization A = U**T*U or A = L*L**T of the equilibrated *> matrix A (see the description of A for the form of the *> equilibrated matrix). *> \endverbatim *> *> \param[in] LDAFB *> \verbatim *> LDAFB is INTEGER *> The leading dimension of the array AFB. LDAFB >= KD+1. *> \endverbatim *> *> \param[in,out] EQUED *> \verbatim *> EQUED is CHARACTER*1 *> Specifies the form of equilibration that was done. *> = 'N': No equilibration (always true if FACT = 'N'). *> = 'Y': Equilibration was done, i.e., A has been replaced by *> diag(S) * A * diag(S). *> EQUED is an input argument if FACT = 'F'; otherwise, it is an *> output argument. *> \endverbatim *> *> \param[in,out] S *> \verbatim *> S is DOUBLE PRECISION array, dimension (N) *> The scale factors for A; not accessed if EQUED = 'N'. S is *> an input argument if FACT = 'F'; otherwise, S is an output *> argument. If FACT = 'F' and EQUED = 'Y', each element of S *> must be positive. *> \endverbatim *> *> \param[in,out] B *> \verbatim *> B is DOUBLE PRECISION array, dimension (LDB,NRHS) *> On entry, the N-by-NRHS right hand side matrix B. *> On exit, if EQUED = 'N', B is not modified; if EQUED = 'Y', *> B is overwritten by diag(S) * B. *> \endverbatim *> *> \param[in] LDB *> \verbatim *> LDB is INTEGER *> The leading dimension of the array B. LDB >= max(1,N). *> \endverbatim *> *> \param[out] X *> \verbatim *> X is DOUBLE PRECISION array, dimension (LDX,NRHS) *> If INFO = 0 or INFO = N+1, the N-by-NRHS solution matrix X to *> the original system of equations. Note that if EQUED = 'Y', *> A and B are modified on exit, and the solution to the *> equilibrated system is inv(diag(S))*X. *> \endverbatim *> *> \param[in] LDX *> \verbatim *> LDX is INTEGER *> The leading dimension of the array X. LDX >= max(1,N). *> \endverbatim *> *> \param[out] RCOND *> \verbatim *> RCOND is DOUBLE PRECISION *> The estimate of the reciprocal condition number of the matrix *> A after equilibration (if done). If RCOND is less than the *> machine precision (in particular, if RCOND = 0), the matrix *> is singular to working precision. This condition is *> indicated by a return code of INFO > 0. *> \endverbatim *> *> \param[out] FERR *> \verbatim *> FERR is DOUBLE PRECISION array, dimension (NRHS) *> The estimated forward error bound for each solution vector *> X(j) (the j-th column of the solution matrix X). *> If XTRUE is the true solution corresponding to X(j), FERR(j) *> is an estimated upper bound for the magnitude of the largest *> element in (X(j) - XTRUE) divided by the magnitude of the *> largest element in X(j). The estimate is as reliable as *> the estimate for RCOND, and is almost always a slight *> overestimate of the true error. *> \endverbatim *> *> \param[out] BERR *> \verbatim *> BERR is DOUBLE PRECISION array, dimension (NRHS) *> The componentwise relative backward error of each solution *> vector X(j) (i.e., the smallest relative change in *> any element of A or B that makes X(j) an exact solution). *> \endverbatim *> *> \param[out] WORK *> \verbatim *> WORK is DOUBLE PRECISION array, dimension (3*N) *> \endverbatim *> *> \param[out] IWORK *> \verbatim *> IWORK is INTEGER array, dimension (N) *> \endverbatim *> *> \param[out] INFO *> \verbatim *> INFO is INTEGER *> = 0: successful exit *> < 0: if INFO = -i, the i-th argument had an illegal value *> > 0: if INFO = i, and i is *> <= N: the leading minor of order i of A is *> not positive definite, so the factorization *> could not be completed, and the solution has not *> been computed. RCOND = 0 is returned. *> = N+1: U is nonsingular, but RCOND is less than machine *> precision, meaning that the matrix is singular *> to working precision. Nevertheless, the *> solution and error bounds are computed because *> there are a number of situations where the *> computed solution can be more accurate than the *> value of RCOND would suggest. *> \endverbatim * * Authors: * ======== * *> \author Univ. of Tennessee *> \author Univ. of California Berkeley *> \author Univ. of Colorado Denver *> \author NAG Ltd. * *> \date April 2012 * *> \ingroup doubleOTHERsolve * *> \par Further Details: * ===================== *> *> \verbatim *> *> The band storage scheme is illustrated by the following example, when *> N = 6, KD = 2, and UPLO = 'U': *> *> Two-dimensional storage of the symmetric matrix A: *> *> a11 a12 a13 *> a22 a23 a24 *> a33 a34 a35 *> a44 a45 a46 *> a55 a56 *> (aij=conjg(aji)) a66 *> *> Band storage of the upper triangle of A: *> *> * * a13 a24 a35 a46 *> * a12 a23 a34 a45 a56 *> a11 a22 a33 a44 a55 a66 *> *> Similarly, if UPLO = 'L' the format of A is as follows: *> *> a11 a22 a33 a44 a55 a66 *> a21 a32 a43 a54 a65 * *> a31 a42 a53 a64 * * *> *> Array elements marked * are not used by the routine. *> \endverbatim *> * ===================================================================== SUBROUTINE DPBSVX( FACT, UPLO, N, KD, NRHS, AB, LDAB, AFB, LDAFB, $ EQUED, S, B, LDB, X, LDX, RCOND, FERR, BERR, $ WORK, IWORK, INFO ) * * -- LAPACK driver routine (version 3.7.0) -- * -- LAPACK is a software package provided by Univ. of Tennessee, -- * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- * April 2012 * * .. Scalar Arguments .. CHARACTER EQUED, FACT, UPLO INTEGER INFO, KD, LDAB, LDAFB, LDB, LDX, N, NRHS DOUBLE PRECISION RCOND * .. * .. Array Arguments .. INTEGER IWORK( * ) DOUBLE PRECISION AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ), $ BERR( * ), FERR( * ), S( * ), WORK( * ), $ X( LDX, * ) * .. * * ===================================================================== * * .. Parameters .. DOUBLE PRECISION ZERO, ONE PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 ) * .. * .. Local Scalars .. LOGICAL EQUIL, NOFACT, RCEQU, UPPER INTEGER I, INFEQU, J, J1, J2 DOUBLE PRECISION AMAX, ANORM, BIGNUM, SCOND, SMAX, SMIN, SMLNUM * .. * .. External Functions .. LOGICAL LSAME DOUBLE PRECISION DLAMCH, DLANSB EXTERNAL LSAME, DLAMCH, DLANSB * .. * .. External Subroutines .. EXTERNAL DCOPY, DLACPY, DLAQSB, DPBCON, DPBEQU, DPBRFS, $ DPBTRF, DPBTRS, XERBLA * .. * .. Intrinsic Functions .. INTRINSIC MAX, MIN * .. * .. Executable Statements .. * INFO = 0 NOFACT = LSAME( FACT, 'N' ) EQUIL = LSAME( FACT, 'E' ) UPPER = LSAME( UPLO, 'U' ) IF( NOFACT .OR. EQUIL ) THEN EQUED = 'N' RCEQU = .FALSE. ELSE RCEQU = LSAME( EQUED, 'Y' ) SMLNUM = DLAMCH( 'Safe minimum' ) BIGNUM = ONE / SMLNUM END IF * * Test the input parameters. * IF( .NOT.NOFACT .AND. .NOT.EQUIL .AND. .NOT.LSAME( FACT, 'F' ) ) $ THEN INFO = -1 ELSE IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN INFO = -2 ELSE IF( N.LT.0 ) THEN INFO = -3 ELSE IF( KD.LT.0 ) THEN INFO = -4 ELSE IF( NRHS.LT.0 ) THEN INFO = -5 ELSE IF( LDAB.LT.KD+1 ) THEN INFO = -7 ELSE IF( LDAFB.LT.KD+1 ) THEN INFO = -9 ELSE IF( LSAME( FACT, 'F' ) .AND. .NOT. $ ( RCEQU .OR. LSAME( EQUED, 'N' ) ) ) THEN INFO = -10 ELSE IF( RCEQU ) THEN SMIN = BIGNUM SMAX = ZERO DO 10 J = 1, N SMIN = MIN( SMIN, S( J ) ) SMAX = MAX( SMAX, S( J ) ) 10 CONTINUE IF( SMIN.LE.ZERO ) THEN INFO = -11 ELSE IF( N.GT.0 ) THEN SCOND = MAX( SMIN, SMLNUM ) / MIN( SMAX, BIGNUM ) ELSE SCOND = ONE END IF END IF IF( INFO.EQ.0 ) THEN IF( LDB.LT.MAX( 1, N ) ) THEN INFO = -13 ELSE IF( LDX.LT.MAX( 1, N ) ) THEN INFO = -15 END IF END IF END IF * IF( INFO.NE.0 ) THEN CALL XERBLA( 'DPBSVX', -INFO ) RETURN END IF * IF( EQUIL ) THEN * * Compute row and column scalings to equilibrate the matrix A. * CALL DPBEQU( UPLO, N, KD, AB, LDAB, S, SCOND, AMAX, INFEQU ) IF( INFEQU.EQ.0 ) THEN * * Equilibrate the matrix. * CALL DLAQSB( UPLO, N, KD, AB, LDAB, S, SCOND, AMAX, EQUED ) RCEQU = LSAME( EQUED, 'Y' ) END IF END IF * * Scale the right-hand side. * IF( RCEQU ) THEN DO 30 J = 1, NRHS DO 20 I = 1, N B( I, J ) = S( I )*B( I, J ) 20 CONTINUE 30 CONTINUE END IF * IF( NOFACT .OR. EQUIL ) THEN * * Compute the Cholesky factorization A = U**T *U or A = L*L**T. * IF( UPPER ) THEN DO 40 J = 1, N J1 = MAX( J-KD, 1 ) CALL DCOPY( J-J1+1, AB( KD+1-J+J1, J ), 1, $ AFB( KD+1-J+J1, J ), 1 ) 40 CONTINUE ELSE DO 50 J = 1, N J2 = MIN( J+KD, N ) CALL DCOPY( J2-J+1, AB( 1, J ), 1, AFB( 1, J ), 1 ) 50 CONTINUE END IF * CALL DPBTRF( UPLO, N, KD, AFB, LDAFB, INFO ) * * Return if INFO is non-zero. * IF( INFO.GT.0 )THEN RCOND = ZERO RETURN END IF END IF * * Compute the norm of the matrix A. * ANORM = DLANSB( '1', UPLO, N, KD, AB, LDAB, WORK ) * * Compute the reciprocal of the condition number of A. * CALL DPBCON( UPLO, N, KD, AFB, LDAFB, ANORM, RCOND, WORK, IWORK, $ INFO ) * * Compute the solution matrix X. * CALL DLACPY( 'Full', N, NRHS, B, LDB, X, LDX ) CALL DPBTRS( UPLO, N, KD, NRHS, AFB, LDAFB, X, LDX, INFO ) * * Use iterative refinement to improve the computed solution and * compute error bounds and backward error estimates for it. * CALL DPBRFS( UPLO, N, KD, NRHS, AB, LDAB, AFB, LDAFB, B, LDB, X, $ LDX, FERR, BERR, WORK, IWORK, INFO ) * * Transform the solution matrix X to a solution of the original * system. * IF( RCEQU ) THEN DO 70 J = 1, NRHS DO 60 I = 1, N X( I, J ) = S( I )*X( I, J ) 60 CONTINUE 70 CONTINUE DO 80 J = 1, NRHS FERR( J ) = FERR( J ) / SCOND 80 CONTINUE END IF * * Set INFO = N+1 if the matrix is singular to working precision. * IF( RCOND.LT.DLAMCH( 'Epsilon' ) ) $ INFO = N + 1 * RETURN * * End of DPBSVX * END
{ "content_hash": "9f948049d33a7a0df1c5d408973f4292", "timestamp": "", "source": "github", "line_count": 545, "max_line_length": 111, "avg_line_length": 33.49908256880734, "alnum_prop": 0.5321794380237717, "repo_name": "grisuthedragon/OpenBLAS", "id": "b194d26a452396e53bd2f488c0d797be7b97bfb1", "size": "18257", "binary": false, "copies": "5", "ref": "refs/heads/develop", "path": "lapack-netlib/SRC/dpbsvx.f", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "26217073" }, { "name": "C", "bytes": "19459665" }, { "name": "C++", "bytes": "1282767" }, { "name": "CMake", "bytes": "355140" }, { "name": "Fortran", "bytes": "50636253" }, { "name": "Makefile", "bytes": "808560" }, { "name": "Matlab", "bytes": "9066" }, { "name": "Perl", "bytes": "108676" }, { "name": "Perl6", "bytes": "1924" }, { "name": "Python", "bytes": "28928" }, { "name": "R", "bytes": "3209" }, { "name": "Shell", "bytes": "3889" }, { "name": "TeX", "bytes": "71637" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.12"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>My Project: TreeAmerican Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">My Project </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.12 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="classTreeAmerican-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">TreeAmerican Class Reference</div> </div> </div><!--header--> <div class="contents"> <p><code>#include &lt;<a class="el" href="TreeAmerican_8h_source.html">TreeAmerican.h</a>&gt;</code></p> <div class="dynheader"> Inheritance diagram for TreeAmerican:</div> <div class="dyncontent"> <div class="center"><img src="classTreeAmerican__inherit__graph.png" border="0" usemap="#TreeAmerican_inherit__map" alt="Inheritance graph"/></div> <map name="TreeAmerican_inherit__map" id="TreeAmerican_inherit__map"> <area shape="rect" id="node2" href="classTreeProduct.html" title="{TreeProduct\n||+ TreeProduct()\l+ FinalPayOff()\l+ PreFinalValue()\l+ ~TreeProduct()\l+ clone()\l+ GetFinalTime()\l}" alt="" coords="9,5,132,156"/> </map> </div> <div class="dynheader"> Collaboration diagram for TreeAmerican:</div> <div class="dyncontent"> <div class="center"><img src="classTreeAmerican__coll__graph.png" border="0" usemap="#TreeAmerican_coll__map" alt="Collaboration graph"/></div> <map name="TreeAmerican_coll__map" id="TreeAmerican_coll__map"> <area shape="rect" id="node2" href="classTreeProduct.html" title="{TreeProduct\n||+ TreeProduct()\l+ FinalPayOff()\l+ PreFinalValue()\l+ ~TreeProduct()\l+ clone()\l+ GetFinalTime()\l}" alt="" coords="9,5,132,156"/> </map> </div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:abad26455948d0de73ecf79f7366825d9"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTreeAmerican.html#abad26455948d0de73ecf79f7366825d9">TreeAmerican</a> (double FinalTime, const <a class="el" href="classPayOffBridge.html">PayOffBridge</a> &amp;ThePayOff_)</td></tr> <tr class="separator:abad26455948d0de73ecf79f7366825d9"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ade2d404dec9ebd28695f246393dd0256"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classTreeProduct.html">TreeProduct</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTreeAmerican.html#ade2d404dec9ebd28695f246393dd0256">clone</a> () const</td></tr> <tr class="separator:ade2d404dec9ebd28695f246393dd0256"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad3a967025c3355fdce85f5d28afcc302"><td class="memItemLeft" align="right" valign="top">virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTreeAmerican.html#ad3a967025c3355fdce85f5d28afcc302">FinalPayOff</a> (double Spot) const</td></tr> <tr class="separator:ad3a967025c3355fdce85f5d28afcc302"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aac1d79d79a45a83a06cdbaaf9d80018e"><td class="memItemLeft" align="right" valign="top">virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTreeAmerican.html#aac1d79d79a45a83a06cdbaaf9d80018e">PreFinalValue</a> (double Spot, double Time, double DiscountedFutureValue) const</td></tr> <tr class="separator:aac1d79d79a45a83a06cdbaaf9d80018e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9f6c80b655c9792d9a9698e3d19157f5"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTreeAmerican.html#a9f6c80b655c9792d9a9698e3d19157f5">~TreeAmerican</a> ()</td></tr> <tr class="separator:a9f6c80b655c9792d9a9698e3d19157f5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pub_methods_classTreeProduct"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classTreeProduct')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classTreeProduct.html">TreeProduct</a></td></tr> <tr class="memitem:ac7a606cd5a196a7e280549cdbc8ac5cc inherit pub_methods_classTreeProduct"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTreeProduct.html#ac7a606cd5a196a7e280549cdbc8ac5cc">TreeProduct</a> (double FinalTime_)</td></tr> <tr class="separator:ac7a606cd5a196a7e280549cdbc8ac5cc inherit pub_methods_classTreeProduct"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a05e31647f87241f2cabbd3af756a9fd6 inherit pub_methods_classTreeProduct"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTreeProduct.html#a05e31647f87241f2cabbd3af756a9fd6">~TreeProduct</a> ()</td></tr> <tr class="separator:a05e31647f87241f2cabbd3af756a9fd6 inherit pub_methods_classTreeProduct"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad8ae61f333f08e7a9f2e24e3611263f9 inherit pub_methods_classTreeProduct"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTreeProduct.html#ad8ae61f333f08e7a9f2e24e3611263f9">GetFinalTime</a> () const</td></tr> <tr class="separator:ad8ae61f333f08e7a9f2e24e3611263f9 inherit pub_methods_classTreeProduct"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a id="abad26455948d0de73ecf79f7366825d9"></a> <h2 class="memtitle"><span class="permalink"><a href="#abad26455948d0de73ecf79f7366825d9">&sect;&nbsp;</a></span>TreeAmerican()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">TreeAmerican::TreeAmerican </td> <td>(</td> <td class="paramtype">double&#160;</td> <td class="paramname"><em>FinalTime</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classPayOffBridge.html">PayOffBridge</a> &amp;&#160;</td> <td class="paramname"><em>ThePayOff_</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> </div> </div> <a id="a9f6c80b655c9792d9a9698e3d19157f5"></a> <h2 class="memtitle"><span class="permalink"><a href="#a9f6c80b655c9792d9a9698e3d19157f5">&sect;&nbsp;</a></span>~TreeAmerican()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual TreeAmerican::~TreeAmerican </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a id="ade2d404dec9ebd28695f246393dd0256"></a> <h2 class="memtitle"><span class="permalink"><a href="#ade2d404dec9ebd28695f246393dd0256">&sect;&nbsp;</a></span>clone()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="classTreeProduct.html">TreeProduct</a>* TreeAmerican::clone </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Implements <a class="el" href="classTreeProduct.html#a38edda2bee3c7203e94511df96a18c32">TreeProduct</a>.</p> </div> </div> <a id="ad3a967025c3355fdce85f5d28afcc302"></a> <h2 class="memtitle"><span class="permalink"><a href="#ad3a967025c3355fdce85f5d28afcc302">&sect;&nbsp;</a></span>FinalPayOff()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual double TreeAmerican::FinalPayOff </td> <td>(</td> <td class="paramtype">double&#160;</td> <td class="paramname"><em>Spot</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Implements <a class="el" href="classTreeProduct.html#acda7abc61cf6ac1b0f69a09eb0709832">TreeProduct</a>.</p> </div> </div> <a id="aac1d79d79a45a83a06cdbaaf9d80018e"></a> <h2 class="memtitle"><span class="permalink"><a href="#aac1d79d79a45a83a06cdbaaf9d80018e">&sect;&nbsp;</a></span>PreFinalValue()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual double TreeAmerican::PreFinalValue </td> <td>(</td> <td class="paramtype">double&#160;</td> <td class="paramname"><em>Spot</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double&#160;</td> <td class="paramname"><em>Time</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double&#160;</td> <td class="paramname"><em>DiscountedFutureValue</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Implements <a class="el" href="classTreeProduct.html#a0b58b8acdd3759f55212c1c65361056e">TreeProduct</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="TreeAmerican_8h_source.html">TreeAmerican.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.12 </small></address> </body> </html>
{ "content_hash": "a49c5fc4591452746e836677689e34ea", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 364, "avg_line_length": 47.42279411764706, "alnum_prop": 0.6754787192805644, "repo_name": "calvin456/intro_derivative_pricing", "id": "3bbf8de3566e7b470666af90ecdb152c55d826bc", "size": "12899", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "library/include/html/classTreeAmerican.html", "mode": "33261", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "695" }, { "name": "C", "bytes": "36155" }, { "name": "C++", "bytes": "1441313" } ], "symlink_target": "" }
title: Cockpit 159 author: pitti date: 2018-01-10 10:30 tags: cockpit linux slug: cockpit-159 category: release summary: Cockpit with VDO support and VM improvements comments: 'true' --- Cockpit is the [modern Linux admin interface](https://cockpit-project.org/). We release regularly. Here are the release notes from version 159. ### Configure data deduplication with VDO devices The "Virtual Data Optimizer" is a new feature to eliminate duplication and add compression to block devices. This is mostly aimed at providing storage for virtual machines or object storage systems like Ceph. This is being developed upstream by the [dm-vdo GitHub project](https://github.com/dm-vdo). It is currently available in [RHEL 7.5 alpha](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/vdo) and expected to land in other distributions eventually. Cockpit's Storage page can now create and configure VDO devices. See it in action: <iframe width="960" height="720" src="//youtube.com/embed/_iOYN4Y24aY?rel=0" frameborder="0" allowfullscreen></iframe> ### Add serial console to virtual Machines page and redesign the Consoles tab The Machines page has offered in-browser and external VNC console access to virtual machines for some time. However, this does not work on "headless" virtual machines that don't provide a (virtual) graphics card and VNC libvirt device. The Consoles tab now offers a serial console for these kind of VMs to be able to administer them from Cockpit as well. This went along with a redesign of the Consoles tab to better fit the various types of consoles. See it in action: <iframe width="960" height="720" src="//youtube.com/embed/nT2EA6wYkKI?rel=0" frameborder="0" allowfullscreen></iframe> Thanks to Marek Libra for this feature! ### Show more error message details for VM failures on virtual Machines page Errors from virtual machine operations on the Storage page can now be expanded to show more details: ![VM error expander](/images/machines-error-expander.png) Thanks to Marek Libra for this improvement! ### Try it out Cockpit 159 is available now: * [For your Linux system](https://cockpit-project.org/running.html) * [Source Tarball](https://github.com/cockpit-project/cockpit/releases/tag/159) * [Fedora 27](https://bodhi.fedoraproject.org/updates/cockpit-159-1.fc27)
{ "content_hash": "a81ed18fec56b0af809c7ddeae5fa88c", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 128, "avg_line_length": 38.9344262295082, "alnum_prop": 0.7797894736842105, "repo_name": "martinpitt/cockpit-project.github.io", "id": "80ac64cf3a4a95a940c53fcda12886c3690cae50", "size": "2379", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "_posts/2018-01-10-cockpit-159.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "18068" }, { "name": "CoffeeScript", "bytes": "8384" }, { "name": "HTML", "bytes": "844712" }, { "name": "JavaScript", "bytes": "10148" }, { "name": "Ruby", "bytes": "20339" }, { "name": "SCSS", "bytes": "2546" }, { "name": "Sass", "bytes": "45407" }, { "name": "Shell", "bytes": "1911" } ], "symlink_target": "" }
$(document).ready(function() { // MENU $(".menu-search ul li li:first-child a").css("border-top", "none"); $(".menu-search ul").supersubs({ minWidth: 15, maxWidth: 40 }).superfish({ autoArrows: false, dropShadows: false }); var htmlStr = $("code").html(); $("code").text(htmlStr); // BOX HIDE $('span.hide').click(function() { $(this).parent().next('.content').fadeToggle(100); }); // TITLE SEARCH BOX $('.box-search').hide(); $('span.search').click( function() { $('.box-search').fadeTo(800, 1.0).end(); $('span.search').hide(); }); // THUMB OPTIONS $("a.zoom").fancybox({ 'speedIn': 600, 'speedOut': 200, 'overlayShow': true, 'overlayColor': '#000', 'titlePosition': 'over' }); $("img.shadow").wrap("<span class='shadow'></span>"); $("img.left").wrap("<span class='shadow left'></span>"); $("img.right").wrap("<span class='shadow right'></span>"); $(function() { $("div.thumb").hover( function() { $(this).children("img").fadeTo(200, 0.85).end().children("div").show(); }, function() { $(this).children("img").fadeTo(200, 1).end().children("div").hide(); }); }); // SYSTEM MESSAGES $(".messages:first-child").css({ "margin": "0 0 1px" }); // MESSAGE BOX $(".content .message:last-child").css({ "border-bottom": "none", "padding": "12px 0 0" }); if ($.browser.msie && $.browser.version.substr(0, 1) < 8) { $(".content .message:last-child").css({ "border-bottom": "none", "padding": "11px 0 0" }); } // TABS, ACCORDIONS, TREEVIEW & TOOLTIPS $(".tabs").tabs({ fx: { opacity: 'toggle' } }); $(".accordion").accordion({ autoHeight: false, navigation: true }); $(".filetree").treeview({ persist: "location", collapsed: true }); $(".tooltip").tipsy(); // TABLE SORTER /* var $allTable = $(".table-all"); var tablesorterConfig = { widgets: ['zebra'], headers: { 0: { sorter: false } } }; tablesorterConfig.headers[$allTable.find("thead th").length - 1] = { sorter: false }; $allTable.tablesorter(tablesorterConfig).tablesorterPager({ container: $("#pager"), positionFixed: false, size: 5 }); var $sortingTable = $(".sorting"); tablesorterConfig.headers[$sortingTable.find("thead th").length - 1] = { sorter: false }; $sortingTable.tablesorter(tablesorterConfig); // BUTTON LINKS $("a.button").wrapInner("<span></span>"); $("a.button, button, .pager img").hover( function() { $(this).stop().fadeTo(200, 0.7); }, function() { $(this).stop().fadeTo(200, 1.0); }); */ // CHECK ALL PAGES $('.checkall').click(function() { $(this).parents('table').find(':checkbox').attr('checked', this.checked); }); // STYLE FILE BUTTON $("input[type=file]").wrap("<div style='display : inline-block; overflow : hidden; width : auto; height : 27px;'></div>"); $("input[type=file]").filestyle({ imageheight: 27, imagewidth: 133, width: 166 }); // SLIDER $(".range-slide div.slide").each(function() { values = $(this).attr('value').split(','); firstVal = values[0]; secondVal = values[1]; rangeInputfirst = $(this).siblings('input.amount-first'); rangeInputsecond = $(this).siblings('input.amount-second'); $(this).slider({ values: [firstVal, secondVal], min: parseInt($(this).attr('min'), 0), max: parseInt($(this).attr('max'), 0), range: true, slide: function(event, ui) { $(this).siblings('input.amount-first').val("" + ui.values[0]); $(this).siblings('input.amount-second').val("" + ui.values[1]); } }); rangeInputfirst.val("" + $(this).slider("values", 0)); rangeInputsecond.val("" + $(this).slider("values", 1)); }); $(".signle-slide div.slide").each(function() { value = $(this).attr('value').split(','); firstVal = value; rangeSpan = $(this).siblings('input.amount'); $(this).slider({ value: [firstVal], min: parseInt($(this).attr('min'), 0), max: parseInt($(this).attr('max'), 0), slide: function(event, ui) { $(this).siblings('input.amount').val("" + ui.value); } }); rangeSpan.val("" + $(this).slider("value")); }); // PROGRESSBAR $(".progressbar div").progressbar({ value: 100 }); // FORMS $(".line:odd").css({ "border-top": "2px solid #f2f4f7", "border-bottom": "2px solid #f2f4f7" }); $(".line:first-child").css({ "border-top": "none" }); $(".line:last-child").css({ "border-bottom": "none" }); $('input.datepicker').datePicker({ clickInput: true, startDate: '01/01/1995' }); $(".pager select, select").sbCustomSelect().each( function() { $(".sb-dropdown").wrap("<div class='sb-overlay'></div>"); }); $('#popup_itemcount').change(function() { oTable.fnLengthChange( $(this).val() ); }); $('#item_count').change(function() { $('#paginator').submit(); }); $("input[type=radio], input[type=checkbox]").each(function() { if ($(this).parents("table").length === 0) { $(this).customInput(); } }); $('.hide-input input, .search input, .box-search input').click(function() { if (this.value === this.defaultValue) { this.value = ''; } }); $('.hide-input input, .search input, .box-search input').focus(function() { if (this.value === this.defaultValue) { this.value = ''; } }); $('.hide-input input, .search input, .box-search input').blur(function() { if (this.value === '') { this.value = this.defaultValue; } }); // Input and textarea IE 7 fix if ($.browser.msie && $.browser.version.substr(0, 1) < 8) { $("input.tiny").wrap("<div class='input-tiny'></div>"); $("input.small").wrap("<div class='input-small'></div>"); $("input.medium").wrap("<div class='input-medium'></div>"); $("input.big").wrap("<div class='input-big'></div>"); $("input.xl").wrap("<div class='input-xl'></div>"); $("textarea.small").wrap("<div class='textarea-small'></div>"); $("textarea.medium").wrap("<div class='textarea-medium'></div>"); $("textarea.big").wrap("<div class='textarea-big'></div>"); $("textarea.xl").wrap("<div class='textarea-xl'></div>"); } // WYSISWYG $('.wysiwyg').wysiwyg({ css : "css/wysiwyg-editor.css", plugins: { rmFormat: { rmMsWordMarkup: true } } }); // TABEL STATICS $("table.statics").each(function() { var colors = []; $("table.statics thead th:not(:first)").each(function() { colors.push($(this).css("color")); }); $(this).graphTable({ series: 'columns', position: 'replace', height: '200px', colors: colors }, { xaxis: { tickSize: 1 } }); }); $("table.statics-date").each(function() { var colors = []; var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; $("table.statics-date thead th:not(:first)").each(function() { colors.push($(this).css("color")); }); $(this).graphTable({ series: 'columns', position: 'replace', height: '200px', colors: colors, xaxisTransform: function(month) { var i = 0; while ((i < 12) && (month != months[i])) { i++; } return i; } }, { xaxis: { tickSize: 1, tickFormatter: function(v, a) { return months[v]; } } }); }); $('.flot-graph').before('<div class="space"></div>'); function showTooltip(x, y, contents) { $('<div id="tooltip">' + contents + '</div>').css({ position: 'absolute', display: 'none', top: y + 5, left: x + 5 }).appendTo("body").fadeIn("fast"); } var previousPoint = null; $(".flot-graph").bind("plothover", function(event, pos, item) { $("#x").text(pos.x); $("#y").text(pos.y); if (item) { if (previousPoint != item.dataIndex) { previousPoint = item.dataIndex; $("#tooltip").remove(); var x = item.datapoint[0], y = item.datapoint[1]; showTooltip(item.pageX, item.pageY, "<b>" + item.series.label + "</b>: " + y); } } else { $("#tooltip").remove(); previousPoint = null; } }); }); /* celula */ function ativaSelect(id) { $("#"+id).sbCustomSelect().each( function() { $(".sb-dropdown").wrap("<div class='sb-overlay'></div>"); }); }
{ "content_hash": "921fec80a4395568719fc984a0012464", "timestamp": "", "source": "github", "line_count": 344, "max_line_length": 126, "avg_line_length": 28.046511627906977, "alnum_prop": 0.47781923714759533, "repo_name": "tassioauad/ZendFramework2-Module-Access", "id": "b5ba91bb054281d3709b56e6758c93f1b73e6c5a", "size": "9648", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/js/inline2.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "JavaScript", "bytes": "1003081" }, { "name": "PHP", "bytes": "138366" } ], "symlink_target": "" }
require 'spec_helper' module VSphereCloud describe IPConflictDetector, fake_logger: true do let(:networks) do { 'network_1' => ['169.254.1.1'], 'network_2' => ['169.254.2.1', '169.254.3.1'] } end let(:client) { instance_double(VSphereCloud::VCenterClient) } context 'when no existing VMs on a desired network report having the desired IP' do it 'does not detect a conflict with deployed VMs' do allow(client).to receive(:find_vm_by_ip).and_return(nil) conflict_detector = IPConflictDetector.new(client) expect { conflict_detector.ensure_no_conflicts(networks) }.to_not raise_error end end context 'when existing VMs on a desired network report having the desired IP' do let(:deployed_vm) do instance_double( VimSdk::Vim::VirtualMachine, name: 'squatter-vm', guest: instance_double(VimSdk::Vim::Vm::GuestInfo, net: deployed_vm_nics) ) end context 'when a deployed VM has the desired IPs on the same network' do let(:deployed_vm_nics) do [ instance_double( VimSdk::Vim::Vm::GuestInfo::NicInfo, ip_address: ['169.254.1.1', 'fe80::250:56ff:fea9:793d'], network: 'network_1' ), instance_double( VimSdk::Vim::Vm::GuestInfo::NicInfo, ip_address: ['169.254.2.1', 'fe80::250:56ff:fea9:793d'], network: 'network_2' ), instance_double( VimSdk::Vim::Vm::GuestInfo::NicInfo, ip_address: ['169.254.3.1', 'fe80::250:56ff:fea9:793d'], network: 'network_2' ) ] end it 'detects conflicts with deployed VMs' do allow(client).to receive(:find_vm_by_ip).with('169.254.1.1').and_return(deployed_vm) allow(client).to receive(:find_vm_by_ip).with('169.254.2.1').and_return(deployed_vm) allow(client).to receive(:find_vm_by_ip).with('169.254.3.1').and_return(deployed_vm) conflict_detector = IPConflictDetector.new(client) expect { conflict_detector.ensure_no_conflicts(networks) }.to raise_error do |error| expect(error.message).to include( "squatter-vm", "network_1", "169.254.1.1", "network_2", "169.254.2.1", "network_2", "169.254.3.1" ) end end end context 'when a deployed VM has the desired IPs on a different network' do let(:deployed_vm_nics) do [ instance_double(VimSdk::Vim::Vm::GuestInfo::NicInfo, ip_address: ['169.254.1.1', 'fe80::250:56ff:fea9:793d'], network: 'network_3' ), instance_double(VimSdk::Vim::Vm::GuestInfo::NicInfo, ip_address: ['169.254.2.1', 'fe80::250:56ff:fea9:793d'], network: 'network_4' ) ] end it 'does not detect conflicts with deployed VMs' do allow(client).to receive(:find_vm_by_ip).with('169.254.1.1').and_return(deployed_vm) allow(client).to receive(:find_vm_by_ip).with('169.254.2.1').and_return(deployed_vm) allow(client).to receive(:find_vm_by_ip).with('169.254.3.1').and_return(deployed_vm) conflict_detector = IPConflictDetector.new(client) expect { conflict_detector.ensure_no_conflicts(networks) }.to_not raise_error end end end end end
{ "content_hash": "9ac1de29944377c99f8f1469076ebf0b", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 94, "avg_line_length": 35.76470588235294, "alnum_prop": 0.5526315789473685, "repo_name": "cloudfoundry-incubator/bosh-vsphere-cpi-release", "id": "3d59c9efa68a263ac253597af4f3a367f3b2a9ba", "size": "3648", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/vsphere_cpi/spec/unit/cloud/vsphere/ip_conflict_detector_spec.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "1372" }, { "name": "Go", "bytes": "12926" }, { "name": "HTML", "bytes": "39472" }, { "name": "Python", "bytes": "9913" }, { "name": "Ruby", "bytes": "13688789" }, { "name": "Shell", "bytes": "26034" } ], "symlink_target": "" }
@charset "utf-8"; html,body { margin:0; padding:0; width:100%;} body{font-size:12px;font-family: "微软雅黑"; color:#333; line-height:160%; background: url(../images/login-bg.jpg) center top repeat-x #FFF; height:100%;} p,ul,li,dd,h1,h2,h3,form,input,select,textarea{margin:0; padding:0; border:0;font-family:"微软雅黑"; line-height:150%;} ul,li{list-style:none;} div,p{word-wrap: break-word;} img{border: none;} input,button,select,textarea{outline:none} /* form */ .text{border:1px solid #CCC; padding:5px; background-color:#FCFCFC; line-height:14px; width:220px; font-size:12px; -webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow: #CCC 0px 0px 5px;-moz-box-shadow: #CCC 0px 0px 5px;box-shadow: #CCC 0px 0px 5px; border:1px solid #CCC; font-size:12px; } .text:focus{border:1px solid #31b6e7; background-color:#FFF;-webkit-box-shadow: #CCC 0px 0px 5px;-moz-box-shadow: #CCC 0px 0px 5px;box-shadow: #0178a4 0px 0px 5px; } .text:hover{ background-color:#FFF; } input.submit{border:none; font-weight:bold;color:#FFF; margin-top:5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow: #CCC 0px 0px 5px;-moz-box-shadow: #CCC 0px 0px 5px;box-shadow: #CCC 0px 0px 5px;background: #31b6e7; cursor: pointer;} input.submit:hover{ background:#ff9229;} input.submit{ padding:6px 20px;} /* login */ .login{ position:relative; z-index:10; padding:1px 0 0 0; background:url(../images/login-bg.jpg) center top no-repeat #FFF;} .login .menus{ position:absolute; top:0; left:0; width:100%; height:40px;} .login .menus .public{ text-align:right; padding-right:30px;} .login .menus .public a{ display:inline-block; line-height:38px; color:#EEE; font-size:14px; padding:0 15px; border-right:1px solid #666;} .login .menus .public a:hover{ background:#555;} .login .box{position:relative;z-index:100; margin:150px auto; width:700px; height:320px; background:url(../images/login.png) center top no-repeat;} .login form{position:relative;width:370px; height:260px;margin:10px auto; padding:0 0 0 20px;} .login .header{ height:85px;} .login .header .logo{ position:absolute; top:25px; left:20px; background:url(../images/logo-login.png) no-repeat; width:245px; height:50px;} .login label{ display:inline-block; width:70px; text-align:right; padding-right:20px; vertical-align:middle;} .login li{padding:10px 5px; font-size:14px;} .login .alt{ position:absolute; top:43px; left:260px;font-size:20px;} .login .text{filter:alpha(opacity=80);-moz-opacity:0.8;opacity:0.8;} .login .copyright{ position:absolute; left:0; width:100%; bottom:-40px; text-align:center; color:#AAA;} .login .air-balloon{ position:absolute; top:-100px; left:-100px; z-index:50;} .login .air-balloon.ab-1{ width:70px; height:103px; background:url(../images/air-balloon-1.png) no-repeat;} .login .air-balloon.ab-2{ width:70px; height:113px; background:url(../images/air-balloon-2.png) no-repeat;} .login .submits{ text-align:center} .login .footer{ position: fixed; left:0; bottom:0; z-index:-1; width:100%; height:198px; background:url(../images/login-foot.jpg) center bottom repeat-x;} .weibo{ height:21px; display:inline-block; vertical-align:middle; overflow:hidden; font-size:0; text-indent:-9999px} .weibo.tencent{ width:21px; background:url(../images/icos.png) 0 0 no-repeat;} .weibo.tencent:hover{ background:url(../images/icos.png) 0 -50px no-repeat;}
{ "content_hash": "4acf1d45cacfaecf7f9759e4ccefe721", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 323, "avg_line_length": 69.9795918367347, "alnum_prop": 0.7247010790317877, "repo_name": "yanwuv4yue/TGKS_COMMON", "id": "4a6b1d133c83e7ce10c99df000d9fb6c2c65a5f9", "size": "3445", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "WebRoot/resources/plugin/index/css/main.css", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "5080" }, { "name": "Java", "bytes": "217169" }, { "name": "JavaScript", "bytes": "282441" } ], "symlink_target": "" }
package org.ovirt.engine.ui.uicommonweb.models.vms; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.ovirt.engine.core.common.businessentities.StoragePool; import org.ovirt.engine.core.common.businessentities.VDSGroup; import org.ovirt.engine.core.common.businessentities.VmTemplate; import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.ui.frontend.AsyncQuery; import org.ovirt.engine.ui.frontend.INewAsyncCallback; import org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider; import org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion; import org.ovirt.engine.ui.uicompat.ConstantsManager; public class NewVmFromTemplateModelBehavior extends NewVmModelBehavior { private VmTemplate selectedTemplate; public NewVmFromTemplateModelBehavior(VmTemplate template) { this.selectedTemplate = template; } @Override protected void postInitTemplate(List<VmTemplate> templates) { DataCenterWithCluster selectedDCWithCluster = getModel().getDataCenterWithClustersList().getSelectedItem(); Guid clusterId = selectedDCWithCluster != null ? selectedDCWithCluster.getCluster().getId() : selectedTemplate.getVdsGroupId(); VmTemplate baseTemplate = null; if (selectedTemplate.isBaseTemplate()) { baseTemplate = selectedTemplate; } Guid baseTemplateId = selectedTemplate.getBaseTemplateId(); List<VmTemplate> relatedTemplates = new ArrayList<>(); for (VmTemplate template : templates) { if (template.getBaseTemplateId().equals(baseTemplateId)) { if (template.getVdsGroupId() == null || template.getVdsGroupId().equals(clusterId)) { relatedTemplates.add(template); } if (baseTemplate == null) { if (template.getId().equals(baseTemplateId)) { baseTemplate = template; } } } } if (!relatedTemplates.contains(baseTemplate)) { relatedTemplates.add(baseTemplate); } initTemplateWithVersion(relatedTemplates, null, false); if (selectedDCWithCluster != null && selectedDCWithCluster.getCluster() != null) { if (selectedTemplate.getVdsGroupId() == null || selectedTemplate.getVdsGroupId().equals(selectedDCWithCluster.getCluster().getId())) { TemplateWithVersion templateCouple = new TemplateWithVersion(baseTemplate, selectedTemplate); getModel().getTemplateWithVersion().setSelectedItem(templateCouple); } } updateIsDisksAvailable(); } protected void loadDataCenters() { if (!selectedTemplate.getId().equals(Guid.Empty)) { AsyncDataProvider.getInstance().getDataCenterById(new AsyncQuery(getModel(), new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { if (returnValue != null) { StoragePool dataCenter = (StoragePool) returnValue; List<StoragePool> dataCenters = new ArrayList<>(Arrays.asList(new StoragePool[] { dataCenter })); initClusters(dataCenters); } else { getModel().disableEditing(ConstantsManager.getInstance().getConstants().notAvailableWithNoUpDC()); } } }), selectedTemplate.getStoragePoolId()); } else { // blank template lives on all data centers super.loadDataCenters(); } } protected void initClusters(final List<StoragePool> dataCenters) { AsyncDataProvider.getInstance().getClusterListByService( new AsyncQuery(getModel(), new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { UnitVmModel model = (UnitVmModel) target; List<VDSGroup> clusters = (List<VDSGroup>) returnValue; List<VDSGroup> filteredClusters = AsyncDataProvider.getInstance().filterByArchitecture(clusters, selectedTemplate.getClusterArch()); model.setDataCentersAndClusters(model, dataCenters, filteredClusters, selectedTemplate.getVdsGroupId()); initCdImage(); } }), true, false); } }
{ "content_hash": "6db5580f46cd7d68974534c137b46a04", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 146, "avg_line_length": 42.601694915254235, "alnum_prop": 0.5808633379749354, "repo_name": "zerodengxinchao/ovirt-engine", "id": "253a81c9384c7e765cde2cc735e43865dfbc6ccd", "size": "5027", "binary": false, "copies": "6", "ref": "refs/heads/eayunos-4.2", "path": "frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmFromTemplateModelBehavior.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "68312" }, { "name": "HTML", "bytes": "16218" }, { "name": "Java", "bytes": "35067557" }, { "name": "JavaScript", "bytes": "69948" }, { "name": "Makefile", "bytes": "24723" }, { "name": "PLSQL", "bytes": "533" }, { "name": "PLpgSQL", "bytes": "796728" }, { "name": "Python", "bytes": "970860" }, { "name": "Roff", "bytes": "10764" }, { "name": "Shell", "bytes": "163853" }, { "name": "XSLT", "bytes": "54683" } ], "symlink_target": "" }
package io.github.siddharthgoel88.useragents.impl; import io.github.siddharthgoel88.useragents.UserAgent; /** * UserAgents from latest to oldest for Irlbot */ public class Irlbot extends UserAgent { public String[] getAllUserAgentStrings() { String [] userAgentStrings = { "IRLbot/3.0 (compatible; MSIE 6.0; http://irl.cs.tamu.edu/crawler/)", "IRLbot/3.0 (compatible; MSIE 6.0; http://irl.cs.tamu.edu/crawler)", "IRLbot/2.0 (compatible; MSIE 6.0; http://irl.cs.tamu.edu/crawler)", "IRLbot/2.0 (+http://irl.cs.tamu.edu/crawler)", "IRLbot/2.0 ( http://irl.cs.tamu.edu/crawler)" }; return userAgentStrings; } }
{ "content_hash": "814459e8414c0d8cc4968d2352a4e215", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 72, "avg_line_length": 31.85, "alnum_prop": 0.695447409733124, "repo_name": "siddharthgoel88/feku", "id": "e3fd8bae14ace5de642e6c4473013f0f9865a498", "size": "637", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/io/github/siddharthgoel88/useragents/impl/Irlbot.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "1189537" } ], "symlink_target": "" }
package org.apache.jorphan.util; /** * This Exception is for use by functions etc to signal a Stop Test Now condition * where there is no access to the normal stop method. * Stop test now means interrupting current running samplers which will mark them as failed * */ public class JMeterStopTestNowException extends RuntimeException { private static final long serialVersionUID = 240L; public JMeterStopTestNowException() { super(); } public JMeterStopTestNowException(String s) { super(s); } public JMeterStopTestNowException(String s, Throwable ex) { super(s, ex); } public JMeterStopTestNowException(String s, Throwable ex, boolean enableSuppression, boolean writableStackTrace) { super(s, ex, enableSuppression, writableStackTrace); } public JMeterStopTestNowException(Throwable ex) { super(ex); } }
{ "content_hash": "de482ac6054a26059fa9b660735d9bf0", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 118, "avg_line_length": 27.303030303030305, "alnum_prop": 0.7114317425083241, "repo_name": "apache/jmeter", "id": "9c9c6e6a21f5225506df629f434fd2c901b3d2a4", "size": "1698", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "src/jorphan/src/main/java/org/apache/jorphan/util/JMeterStopTestNowException.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "25552" }, { "name": "CSS", "bytes": "23066" }, { "name": "Groovy", "bytes": "163162" }, { "name": "HTML", "bytes": "93440" }, { "name": "Java", "bytes": "9107417" }, { "name": "JavaScript", "bytes": "36223" }, { "name": "Kotlin", "bytes": "198418" }, { "name": "Less", "bytes": "6310" }, { "name": "Shell", "bytes": "24265" }, { "name": "XSLT", "bytes": "91415" } ], "symlink_target": "" }
[![Build Status](https://travis-ci.org/tomerghelber/probabilities.svg)](https://travis-ci.org/tomerghelber/probabilities) [![Coverage Status](https://coveralls.io/repos/tomerghelber/probabilities/badge.png)](https://coveralls.io/r/tomerghelber/probabilities) Probabilities ============= Provides programmatic access to MyAnimeList data with python. Objects in pymal are lazy-loading: they won't go out and fetch MAL info until you first-request it. This [our doc](http://probabilities.rtfd.org). Installation ============ After cloning the repository, navigate to the directory and run `python setup.py install`. Or `pip install probabilities`. Future plans ============ Add more probabilities!
{ "content_hash": "ea573c8c95d8fb3e65414d78815045a6", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 258, "avg_line_length": 41.1764705882353, "alnum_prop": 0.75, "repo_name": "tomerghelber/probabilities", "id": "8e83ccb1401ae24729957968a432aac3d4fc58d2", "size": "717", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Makefile", "bytes": "6791" }, { "name": "Python", "bytes": "32368" }, { "name": "Shell", "bytes": "6478" } ], "symlink_target": "" }
@interface CountdownTests : XCTestCase @end @implementation CountdownTests - (void)setUp { [super setUp]; // Set-up code here. } - (void)tearDown { // Tear-down code here. [super tearDown]; } - (void)testExample { XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); } @end
{ "content_hash": "36027ad151b9535f0c349a12b9ad3e75", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 66, "avg_line_length": 12.307692307692308, "alnum_prop": 0.6125, "repo_name": "zxl777/WorkingTimer", "id": "02d4486020482c36f63be93a63888bc9717ffe9b", "size": "495", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CountdownTests/CountdownTests.m", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "796" }, { "name": "C++", "bytes": "308" }, { "name": "Objective-C", "bytes": "107558" }, { "name": "Ruby", "bytes": "11" }, { "name": "Shell", "bytes": "2757" } ], "symlink_target": "" }
package grails.plugin.springsecurity.web.access.intercept; import grails.plugin.springsecurity.InterceptedUrl; import grails.plugin.springsecurity.ReflectionUtils; import java.util.ArrayList; import java.util.List; import org.springframework.http.HttpMethod; /** * @author <a href='mailto:[email protected]'>Burt Beckwith</a> */ public class RequestmapFilterInvocationDefinition extends AbstractFilterInvocationDefinition { @Override protected void initialize() { if (initialized) { return; } try { reset(); initialized = true; } catch (RuntimeException e) { log.warn("Exception initializing; this is ok if it's at startup and due " + "to GORM not being initialized yet since the first web request will " + "re-initialize. Error message is: {0}", e.getMessage()); } } /** * Call at startup or when <code>Requestmap</code> instances have been added, removed, or changed. */ @Override public synchronized void reset() { resetConfigs(); for (InterceptedUrl iu : loadRequestmaps()) { compileAndStoreMapping(iu); } if (log.isTraceEnabled()) { log.trace("configs: {0}", getConfigAttributeMap()); } } protected List<InterceptedUrl> loadRequestmaps() { List<InterceptedUrl> data = new ArrayList<InterceptedUrl>(); boolean supportsHttpMethod = ReflectionUtils.requestmapClassSupportsHttpMethod(); for (Object requestmap : ReflectionUtils.loadAllRequestmaps()) { String urlPattern = ReflectionUtils.getRequestmapUrl(requestmap); String configAttribute = ReflectionUtils.getRequestmapConfigAttribute(requestmap); HttpMethod method = supportsHttpMethod ? ReflectionUtils.getRequestmapHttpMethod(requestmap) : null; data.add(new InterceptedUrl(urlPattern, split(configAttribute), method)); } return data; } }
{ "content_hash": "2e90705beb65e05912a4d984e7b78c88", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 103, "avg_line_length": 28.140625, "alnum_prop": 0.745141588006663, "repo_name": "rumee/messaging", "id": "3cc7b0833a8ccc43784bbf715ba9c3cde781698c", "size": "2400", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "target/work/plugins/spring-security-core-2.0-RC2/src/java/grails/plugin/springsecurity/web/access/intercept/RequestmapFilterInvocationDefinition.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "439487" }, { "name": "Groovy", "bytes": "386989" }, { "name": "Java", "bytes": "185855" }, { "name": "JavaScript", "bytes": "623134" } ], "symlink_target": "" }
#pragma once #include "envoy/buffer/buffer.h" #include "envoy/common/platform.h" #include "envoy/local_info/local_info.h" #include "envoy/network/connection.h" #include "envoy/stats/histogram.h" #include "envoy/stats/scope.h" #include "envoy/stats/sink.h" #include "envoy/stats/stats.h" #include "envoy/stats/tag.h" #include "envoy/thread_local/thread_local.h" #include "envoy/upstream/cluster_manager.h" #include "source/common/buffer/buffer_impl.h" #include "source/common/common/macros.h" #include "source/common/network/io_socket_handle_impl.h" #include "source/extensions/stat_sinks/common/statsd/tag_formats.h" #include "absl/types/optional.h" namespace Envoy { namespace Extensions { namespace StatSinks { namespace Common { namespace Statsd { static const std::string& getDefaultPrefix() { CONSTRUCT_ON_FIRST_USE(std::string, "envoy"); } /** * Implementation of Sink that writes to a UDP statsd address. */ class UdpStatsdSink : public Stats::Sink { public: /** * Base interface for writing UDP datagrams. */ class Writer : public ThreadLocal::ThreadLocalObject { public: virtual void write(const std::string& message) PURE; virtual void writeBuffer(Buffer::Instance& data) PURE; }; UdpStatsdSink(ThreadLocal::SlotAllocator& tls, Network::Address::InstanceConstSharedPtr address, const bool use_tag, const std::string& prefix = getDefaultPrefix(), absl::optional<uint64_t> buffer_size = absl::nullopt, const Statsd::TagFormat& tag_format = Statsd::getDefaultTagFormat()); // For testing. UdpStatsdSink(ThreadLocal::SlotAllocator& tls, const std::shared_ptr<Writer>& writer, const bool use_tag, const std::string& prefix = getDefaultPrefix(), absl::optional<uint64_t> buffer_size = absl::nullopt, const Statsd::TagFormat& tag_format = Statsd::getDefaultTagFormat()) : tls_(tls.allocateSlot()), use_tag_(use_tag), prefix_(prefix.empty() ? getDefaultPrefix() : prefix), buffer_size_(buffer_size.value_or(0)), tag_format_(tag_format) { tls_->set( [writer](Event::Dispatcher&) -> ThreadLocal::ThreadLocalObjectSharedPtr { return writer; }); } // Stats::Sink void flush(Stats::MetricSnapshot& snapshot) override; void onHistogramComplete(const Stats::Histogram& histogram, uint64_t value) override; bool getUseTagForTest() { return use_tag_; } uint64_t getBufferSizeForTest() { return buffer_size_; } const std::string& getPrefix() { return prefix_; } private: /** * This is a simple UDP localhost writer for statsd messages. */ class WriterImpl : public Writer { public: WriterImpl(UdpStatsdSink& parent); // Writer void write(const std::string& message) override; void writeBuffer(Buffer::Instance& data) override; private: UdpStatsdSink& parent_; const Network::IoHandlePtr io_handle_; }; void flushBuffer(Buffer::OwnedImpl& buffer, Writer& writer) const; void writeBuffer(Buffer::OwnedImpl& buffer, Writer& writer, const std::string& data) const; template <typename ValueType> const std::string buildMessage(const Stats::Metric& metric, ValueType value, const std::string& type) const; const std::string getName(const Stats::Metric& metric) const; const std::string buildTagStr(const std::vector<Stats::Tag>& tags) const; const ThreadLocal::SlotPtr tls_; const Network::Address::InstanceConstSharedPtr server_address_; const bool use_tag_; // Prefix for all flushed stats. const std::string prefix_; const uint64_t buffer_size_; const Statsd::TagFormat tag_format_; }; /** * Per thread implementation of a TCP stats flusher for statsd. */ class TcpStatsdSink : public Stats::Sink { public: TcpStatsdSink(const LocalInfo::LocalInfo& local_info, const std::string& cluster_name, ThreadLocal::SlotAllocator& tls, Upstream::ClusterManager& cluster_manager, Stats::Scope& scope, const std::string& prefix = getDefaultPrefix()); // Stats::Sink void flush(Stats::MetricSnapshot& snapshot) override; void onHistogramComplete(const Stats::Histogram& histogram, uint64_t value) override; const std::string& getPrefix() { return prefix_; } private: struct TlsSink : public ThreadLocal::ThreadLocalObject, public Network::ConnectionCallbacks { TlsSink(TcpStatsdSink& parent, Event::Dispatcher& dispatcher); ~TlsSink() override; void beginFlush(bool expect_empty_buffer); void commonFlush(const std::string& name, uint64_t value, char stat_type); void flushCounter(const std::string& name, uint64_t delta); void flushGauge(const std::string& name, uint64_t value); void endFlush(bool do_write); void onTimespanComplete(const std::string& name, std::chrono::milliseconds ms); void onPercentHistogramComplete(const std::string& name, float value); uint64_t usedBuffer() const; void write(Buffer::Instance& buffer); // Network::ConnectionCallbacks void onEvent(Network::ConnectionEvent event) override; void onAboveWriteBufferHighWatermark() override {} void onBelowWriteBufferLowWatermark() override {} TcpStatsdSink& parent_; Event::Dispatcher& dispatcher_; Network::ClientConnectionPtr connection_; Buffer::OwnedImpl buffer_; absl::optional<Buffer::ReservationSingleSlice> current_buffer_reservation_; char* current_slice_mem_{}; }; // Somewhat arbitrary 16MiB limit for buffered stats. static constexpr uint32_t MAX_BUFFERED_STATS_BYTES = (1024 * 1024 * 16); // 16KiB intermediate buffer for flushing. static constexpr uint32_t FLUSH_SLICE_SIZE_BYTES = (1024 * 16); // Prefix for all flushed stats. const std::string prefix_; Upstream::ClusterInfoConstSharedPtr cluster_info_; ThreadLocal::SlotPtr tls_; Upstream::ClusterManager& cluster_manager_; Stats::Counter& cx_overflow_stat_; }; } // namespace Statsd } // namespace Common } // namespace StatSinks } // namespace Extensions } // namespace Envoy
{ "content_hash": "a5823cff63690d4124be4b86f9ea30e4", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 100, "avg_line_length": 36.654545454545456, "alnum_prop": 0.7119708994708994, "repo_name": "envoyproxy/envoy", "id": "e1a5cd4e46aeb2de1921a634431f325746d34f35", "size": "6048", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "source/extensions/stat_sinks/common/statsd/statsd.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "439" }, { "name": "C", "bytes": "54172" }, { "name": "C++", "bytes": "36279350" }, { "name": "CSS", "bytes": "884" }, { "name": "Dockerfile", "bytes": "891" }, { "name": "Emacs Lisp", "bytes": "966" }, { "name": "Go", "bytes": "558" }, { "name": "HTML", "bytes": "582" }, { "name": "Java", "bytes": "1309139" }, { "name": "JavaScript", "bytes": "76" }, { "name": "Jinja", "bytes": "46306" }, { "name": "Kotlin", "bytes": "311319" }, { "name": "Makefile", "bytes": "303" }, { "name": "NASL", "bytes": "327095" }, { "name": "Objective-C", "bytes": "95941" }, { "name": "PureBasic", "bytes": "472" }, { "name": "Python", "bytes": "630897" }, { "name": "Ruby", "bytes": "47" }, { "name": "Rust", "bytes": "38041" }, { "name": "Shell", "bytes": "194810" }, { "name": "Smarty", "bytes": "3528" }, { "name": "Starlark", "bytes": "2229814" }, { "name": "Swift", "bytes": "307285" }, { "name": "Thrift", "bytes": "748" } ], "symlink_target": "" }
package io.appium.java_client; public interface InteractsWithApps { /** * Launch the app which was provided in the capabilities at session creation */ public void launchApp(); /** * Install an app on the mobile device * * @param appPath * path to app to install */ public void installApp(String appPath); /** * Checks if an app is installed on the device * * @param bundleId * bundleId of the app * @return True if app is installed, false otherwise */ public boolean isAppInstalled(String bundleId); /** * Reset the currently running app for this session */ public void resetApp(); /** * Runs the current app as a background app for the number of seconds * requested. This is a synchronous method, it returns after the back has * been returned to the foreground. * * @param seconds * Number of seconds to run App in background */ public void runAppInBackground(int seconds); /** * Remove the specified app from the device (uninstall) * * @param bundleId * the bunble identifier (or app id) of the app to remove */ public void removeApp(String bundleId); /** * Close the app which was provided in the capabilities at session creation */ public void closeApp(); }
{ "content_hash": "3e7fe1af88f91441820501d983513584", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 77, "avg_line_length": 24.88888888888889, "alnum_prop": 0.6450892857142857, "repo_name": "budioktaviyan/appium-sample", "id": "4f9edd9e07e1fbefd726e69d103185e13c9d162f", "size": "1344", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/src/io/appium/java_client/InteractsWithApps.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "132745" } ], "symlink_target": "" }
package distributed.chat.service; public class DistributedChatServiceInfo { public static final int PORT_NUMBER = 2000; public static final String CHAT_SERVICE_BINDING = "CHAT_SERVICE"; }
{ "content_hash": "8eece4ba7ca28bba4e94cb9109fd854d", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 69, "avg_line_length": 22.11111111111111, "alnum_prop": 0.7638190954773869, "repo_name": "jamoyer/DistributedChatService", "id": "2ec3da47a3a5e3e0b1060b87514d82d881b53f55", "size": "199", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/distributed/chat/service/DistributedChatServiceInfo.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "41173" } ], "symlink_target": "" }
/*============================================================================== Program: Gutenberg 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.txt ==============================================================================*/ // Qt includes #include <QApplication> #include <QDebug> #include <QFontDatabase> #include <QLabel> #include <QtDeclarative/QDeclarativeView> #include <QtDeclarative/QDeclarativeContext> // Self includes #include "GutenbergQMLTest.h" int main(int argc, char* argv[]) { QApplication app( argc, argv ); QDeclarativeView qmlView; qmlView.rootContext()->setContextProperty("QMLTest", &app); qmlView.setResizeMode(QDeclarativeView::SizeRootObjectToView); qmlView.setMinimumSize(QSize(300, 300)); qmlView.setSource(QUrl("qrc:/QMLDemo.qml")); qmlView.show(); return app.exec(); }
{ "content_hash": "c1f6b47736457974b33580b5a8550e43", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 80, "avg_line_length": 27.18918918918919, "alnum_prop": 0.6242544731610338, "repo_name": "vovythevov/Gutenberg", "id": "64386f8f552b841f157c9b2ebc588f54ff6c01de", "size": "1006", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Demo/QMLDemo/main.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "10331" }, { "name": "CSS", "bytes": "418" } ], "symlink_target": "" }
#include <stdio.h> #include <string.h> #include <syslog.h> #include <xtables.h> #include <linux/netfilter_ipv6/ip6t_LOG.h> #ifndef IP6T_LOG_UID /* Old kernel */ #define IP6T_LOG_UID 0x08 #undef IP6T_LOG_MASK #define IP6T_LOG_MASK 0x0f #endif #define LOG_DEFAULT_LEVEL LOG_WARNING enum { O_LOG_LEVEL = 0, O_LOG_PREFIX, O_LOG_TCPSEQ, O_LOG_TCPOPTS, O_LOG_IPOPTS, O_LOG_UID, O_LOG_MAC, }; static void LOG_help(void) { printf( "LOG target options:\n" " --log-level level Level of logging (numeric or see syslog.conf)\n" " --log-prefix prefix Prefix log messages with this prefix.\n" " --log-tcp-sequence Log TCP sequence numbers.\n" " --log-tcp-options Log TCP options.\n" " --log-ip-options Log IP options.\n" " --log-uid Log UID owning the local socket.\n" " --log-macdecode Decode MAC addresses and protocol.\n"); } #define s struct ip6t_log_info static const struct xt_option_entry LOG_opts[] = { {.name = "log-level", .id = O_LOG_LEVEL, .type = XTTYPE_SYSLOGLEVEL, .flags = XTOPT_PUT, XTOPT_POINTER(s, level)}, {.name = "log-prefix", .id = O_LOG_PREFIX, .type = XTTYPE_STRING, .flags = XTOPT_PUT, XTOPT_POINTER(s, prefix), .min = 1}, {.name = "log-tcp-sequence", .id = O_LOG_TCPSEQ, .type = XTTYPE_NONE}, {.name = "log-tcp-options", .id = O_LOG_TCPOPTS, .type = XTTYPE_NONE}, {.name = "log-ip-options", .id = O_LOG_IPOPTS, .type = XTTYPE_NONE}, {.name = "log-uid", .id = O_LOG_UID, .type = XTTYPE_NONE}, {.name = "log-macdecode", .id = O_LOG_MAC, .type = XTTYPE_NONE}, XTOPT_TABLEEND, }; #undef s static void LOG_init(struct xt_entry_target *t) { struct ip6t_log_info *loginfo = (struct ip6t_log_info *)t->data; loginfo->level = LOG_DEFAULT_LEVEL; } struct ip6t_log_names { const char *name; unsigned int level; }; static const struct ip6t_log_names ip6t_log_names[] = { { .name = "alert", .level = LOG_ALERT }, { .name = "crit", .level = LOG_CRIT }, { .name = "debug", .level = LOG_DEBUG }, { .name = "emerg", .level = LOG_EMERG }, { .name = "error", .level = LOG_ERR }, /* DEPRECATED */ { .name = "info", .level = LOG_INFO }, { .name = "notice", .level = LOG_NOTICE }, { .name = "panic", .level = LOG_EMERG }, /* DEPRECATED */ { .name = "warning", .level = LOG_WARNING } }; static void LOG_parse(struct xt_option_call *cb) { struct ip6t_log_info *info = cb->data; xtables_option_parse(cb); switch (cb->entry->id) { case O_LOG_PREFIX: if (strchr(cb->arg, '\n') != NULL) xtables_error(PARAMETER_PROBLEM, "Newlines not allowed in --log-prefix"); break; case O_LOG_TCPSEQ: info->logflags = IP6T_LOG_TCPSEQ; break; case O_LOG_TCPOPTS: info->logflags = IP6T_LOG_TCPOPT; break; case O_LOG_IPOPTS: info->logflags = IP6T_LOG_IPOPT; break; case O_LOG_UID: info->logflags = IP6T_LOG_UID; break; case O_LOG_MAC: info->logflags = IP6T_LOG_MACDECODE; break; } } static void LOG_print(const void *ip, const struct xt_entry_target *target, int numeric) { const struct ip6t_log_info *loginfo = (const struct ip6t_log_info *)target->data; unsigned int i = 0; printf(" LOG"); if (numeric) printf(" flags %u level %u", loginfo->logflags, loginfo->level); else { for (i = 0; i < ARRAY_SIZE(ip6t_log_names); ++i) if (loginfo->level == ip6t_log_names[i].level) { printf(" level %s", ip6t_log_names[i].name); break; } if (i == ARRAY_SIZE(ip6t_log_names)) printf(" UNKNOWN level %u", loginfo->level); if (loginfo->logflags & IP6T_LOG_TCPSEQ) printf(" tcp-sequence"); if (loginfo->logflags & IP6T_LOG_TCPOPT) printf(" tcp-options"); if (loginfo->logflags & IP6T_LOG_IPOPT) printf(" ip-options"); if (loginfo->logflags & IP6T_LOG_UID) printf(" uid"); if (loginfo->logflags & IP6T_LOG_MACDECODE) printf(" macdecode"); if (loginfo->logflags & ~(IP6T_LOG_MASK)) printf(" unknown-flags"); } if (strcmp(loginfo->prefix, "") != 0) printf(" prefix \"%s\"", loginfo->prefix); } static void LOG_save(const void *ip, const struct xt_entry_target *target) { const struct ip6t_log_info *loginfo = (const struct ip6t_log_info *)target->data; if (strcmp(loginfo->prefix, "") != 0) printf(" --log-prefix \"%s\"", loginfo->prefix); if (loginfo->level != LOG_DEFAULT_LEVEL) printf(" --log-level %d", loginfo->level); if (loginfo->logflags & IP6T_LOG_TCPSEQ) printf(" --log-tcp-sequence"); if (loginfo->logflags & IP6T_LOG_TCPOPT) printf(" --log-tcp-options"); if (loginfo->logflags & IP6T_LOG_IPOPT) printf(" --log-ip-options"); if (loginfo->logflags & IP6T_LOG_UID) printf(" --log-uid"); if (loginfo->logflags & IP6T_LOG_MACDECODE) printf(" --log-macdecode"); } static struct xtables_target log_tg6_reg = { .name = "LOG", .version = XTABLES_VERSION, .family = NFPROTO_IPV6, .size = XT_ALIGN(sizeof(struct ip6t_log_info)), .userspacesize = XT_ALIGN(sizeof(struct ip6t_log_info)), .help = LOG_help, .init = LOG_init, .print = LOG_print, .save = LOG_save, .x6_parse = LOG_parse, .x6_options = LOG_opts, }; void _init(void) { xtables_register_target(&log_tg6_reg); }
{ "content_hash": "5f643ace89fdd0524153f57a8d43872a", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 75, "avg_line_length": 28.13586956521739, "alnum_prop": 0.6275835425922349, "repo_name": "wilebeast/FireFox-OS", "id": "a419ec91ec52d37b89d0d5b94003880486a99dbd", "size": "5177", "binary": false, "copies": "366", "ref": "refs/heads/master", "path": "B2G/external/iptables/extensions/libip6t_LOG.c", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="de"> <head> <!-- Generated by javadoc (version 1.7.0_55) on Thu Sep 25 12:22:17 CEST 2014 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Uses of Interface at.irian.ankor.event.EventListeners (Ankor - Project 0.4-SNAPSHOT API)</title> <meta name="date" content="2014-09-25"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface at.irian.ankor.event.EventListeners (Ankor - Project 0.4-SNAPSHOT API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?at/irian/ankor/event/class-use/EventListeners.html" target="_top">Frames</a></li> <li><a href="EventListeners.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface at.irian.ankor.event.EventListeners" class="title">Uses of Interface<br>at.irian.ankor.event.EventListeners</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#at.irian.ankor.event">at.irian.ankor.event</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#at.irian.ankor.event.dispatch">at.irian.ankor.event.dispatch</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#at.irian.ankor.ref.el">at.irian.ankor.ref.el</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#at.irian.ankor.ref.impl">at.irian.ankor.ref.impl</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#at.irian.ankor.session">at.irian.ankor.session</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="at.irian.ankor.event"> <!-- --> </a> <h3>Uses of <a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a> in <a href="../../../../../at/irian/ankor/event/package-summary.html">at.irian.ankor.event</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../at/irian/ankor/event/package-summary.html">at.irian.ankor.event</a> that implement <a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../at/irian/ankor/event/ArrayListEventListeners.html" title="class in at.irian.ankor.event">ArrayListEventListeners</a></strong></code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation"> <caption><span>Constructors in <a href="../../../../../at/irian/ankor/event/package-summary.html">at.irian.ankor.event</a> with parameters of type <a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colLast"><code><strong><a href="../../../../../at/irian/ankor/event/ArrayListEventListeners.html#ArrayListEventListeners(at.irian.ankor.event.EventListeners)">ArrayListEventListeners</a></strong>(<a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a>&nbsp;parentListeners)</code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="at.irian.ankor.event.dispatch"> <!-- --> </a> <h3>Uses of <a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a> in <a href="../../../../../at/irian/ankor/event/dispatch/package-summary.html">at.irian.ankor.event.dispatch</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation"> <caption><span>Constructors in <a href="../../../../../at/irian/ankor/event/dispatch/package-summary.html">at.irian.ankor.event.dispatch</a> with parameters of type <a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colLast"><code><strong><a href="../../../../../at/irian/ankor/event/dispatch/SimpleEventDispatcher.html#SimpleEventDispatcher(at.irian.ankor.event.EventListeners)">SimpleEventDispatcher</a></strong>(<a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a>&nbsp;eventListeners)</code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="at.irian.ankor.ref.el"> <!-- --> </a> <h3>Uses of <a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a> in <a href="../../../../../at/irian/ankor/ref/el/package-summary.html">at.irian.ankor.ref.el</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../at/irian/ankor/ref/el/package-summary.html">at.irian.ankor.ref.el</a> that return <a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a></code></td> <td class="colLast"><span class="strong">ELRefContext.</span><code><strong><a href="../../../../../at/irian/ankor/ref/el/ELRefContext.html#eventListeners()">eventListeners</a></strong>()</code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="at.irian.ankor.ref.impl"> <!-- --> </a> <h3>Uses of <a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a> in <a href="../../../../../at/irian/ankor/ref/impl/package-summary.html">at.irian.ankor.ref.impl</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../at/irian/ankor/ref/impl/package-summary.html">at.irian.ankor.ref.impl</a> that return <a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a></code></td> <td class="colLast"><span class="strong">RefContextImplementor.</span><code><strong><a href="../../../../../at/irian/ankor/ref/impl/RefContextImplementor.html#eventListeners()">eventListeners</a></strong>()</code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="at.irian.ankor.session"> <!-- --> </a> <h3>Uses of <a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a> in <a href="../../../../../at/irian/ankor/session/package-summary.html">at.irian.ankor.session</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../at/irian/ankor/session/package-summary.html">at.irian.ankor.session</a> that return <a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a></code></td> <td class="colLast"><span class="strong">ModelSession.</span><code><strong><a href="../../../../../at/irian/ankor/session/ModelSession.html#getEventListeners()">getEventListeners</a></strong>()</code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation"> <caption><span>Constructors in <a href="../../../../../at/irian/ankor/session/package-summary.html">at.irian.ankor.session</a> with parameters of type <a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colLast"><code><strong><a href="../../../../../at/irian/ankor/session/DefaultModelSessionFactory.html#DefaultModelSessionFactory(at.irian.ankor.event.dispatch.EventDispatcherFactory, at.irian.ankor.event.EventListeners, at.irian.ankor.ref.RefContextFactory, at.irian.ankor.application.Application)">DefaultModelSessionFactory</a></strong>(<a href="../../../../../at/irian/ankor/event/dispatch/EventDispatcherFactory.html" title="interface in at.irian.ankor.event.dispatch">EventDispatcherFactory</a>&nbsp;eventDispatcherFactory, <a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">EventListeners</a>&nbsp;defaultEventListeners, <a href="../../../../../at/irian/ankor/ref/RefContextFactory.html" title="interface in at.irian.ankor.ref">RefContextFactory</a>&nbsp;refContextFactory, <a href="../../../../../at/irian/ankor/application/Application.html" title="interface in at.irian.ankor.application">Application</a>&nbsp;application)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../at/irian/ankor/event/EventListeners.html" title="interface in at.irian.ankor.event">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?at/irian/ankor/event/class-use/EventListeners.html" target="_top">Frames</a></li> <li><a href="EventListeners.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2014 <a href="https://github.com/orgs/ankor-io/teams/ankor-developers">Ankor Developers Team</a>. All rights reserved.</small></p> </body> </html>
{ "content_hash": "c8fd7ff1d13f8ee55433136440f18009", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 539, "avg_line_length": 54.850746268656714, "alnum_prop": 0.6644897959183673, "repo_name": "ankor-io/ankor-framework", "id": "14001feb0d4be5525834e6c5943af23b503573cf", "size": "14700", "binary": false, "copies": "1", "ref": "refs/heads/stable", "path": "website/ankorsite/static/javadoc/apidocs-0.4/at/irian/ankor/event/class-use/EventListeners.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "526" }, { "name": "C", "bytes": "12173" }, { "name": "C#", "bytes": "157078" }, { "name": "CSS", "bytes": "10636" }, { "name": "CoffeeScript", "bytes": "48194" }, { "name": "HTML", "bytes": "17806" }, { "name": "Java", "bytes": "751745" }, { "name": "JavaScript", "bytes": "290740" }, { "name": "Makefile", "bytes": "811" }, { "name": "Objective-C", "bytes": "114772" }, { "name": "PowerShell", "bytes": "3261" }, { "name": "Python", "bytes": "17835" }, { "name": "Shell", "bytes": "36" } ], "symlink_target": "" }
include_recipe 'ambari::ambari_repo_setup' package 'ambari-metrics-assembly' do action :install end
{ "content_hash": "6314b8ccdc01aa21e94900255d906960", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 42, "avg_line_length": 25.5, "alnum_prop": 0.7843137254901961, "repo_name": "NinjaLabib/chef-bach", "id": "6444e6532455159a1ec48eb87760e84229a0cb76", "size": "782", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "cookbooks/ambari_metrics/recipes/ambari_metrics_assembly.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "311494" }, { "name": "Python", "bytes": "12012" }, { "name": "Ruby", "bytes": "898698" }, { "name": "Shell", "bytes": "150703" } ], "symlink_target": "" }
using content::RenderFrameHost; using content::WebContents; namespace extensions { // static. const char SurfaceWorkerGuest::Type[] = "surfaceview"; // static GuestViewBase* SurfaceWorkerGuest::Create( content::BrowserContext* browser_context, content::WebContents* owner_web_contents, int guest_instance_id) { return new SurfaceWorkerGuest(browser_context, owner_web_contents, guest_instance_id); } SurfaceWorkerGuest::SurfaceWorkerGuest( content::BrowserContext* browser_context, content::WebContents* owner_web_contents, int guest_instance_id) : GuestView<SurfaceWorkerGuest>(browser_context, owner_web_contents, guest_instance_id), weak_ptr_factory_(this) { } SurfaceWorkerGuest::~SurfaceWorkerGuest() { } bool SurfaceWorkerGuest::HandleContextMenu( const content::ContextMenuParams& params) { return false; } const char* SurfaceWorkerGuest::GetAPINamespace() const { return surface_worker::kEmbedderAPINamespace; } int SurfaceWorkerGuest::GetTaskPrefix() const { return IDS_EXTENSION_TASK_MANAGER_SURFACEWORKER_TAG_PREFIX; } void SurfaceWorkerGuest::CreateWebContents( const base::DictionaryValue& create_params, const WebContentsCreatedCallback& callback) { std::string url; if (!create_params.GetString(surface_worker::kURL, &url)) { callback.Run(NULL); return; } url_ = GURL(url); if (!url_.is_valid()) { callback.Run(NULL); return; } GURL guest_site(base::StringPrintf("%s://surface-%s", content::kGuestScheme, GetOwnerSiteURL().host().c_str())); GuestViewManager* guest_view_manager = GuestViewManager::FromBrowserContext( owner_web_contents()->GetBrowserContext()); content::SiteInstance* guest_site_instance = guest_view_manager->GetGuestSiteInstance(guest_site); WebContents::CreateParams params( owner_web_contents()->GetBrowserContext(), guest_site_instance); params.guest_delegate = this; callback.Run(WebContents::Create(params)); } void SurfaceWorkerGuest::DidAttachToEmbedder() { web_contents()->GetController().LoadURL( url_, content::Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); url_ = GURL(); } } // namespace extensions
{ "content_hash": "d677826e44202eec80ea796a5efdeba5", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 74, "avg_line_length": 29.451219512195124, "alnum_prop": 0.6641821946169773, "repo_name": "markYoungH/chromium.src", "id": "949a2a26c22ff271ec850b3ad292935d310dc7db", "size": "2948", "binary": false, "copies": "9", "ref": "refs/heads/nw12", "path": "extensions/browser/guest_view/surface_worker/surface_worker_guest.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "34522" }, { "name": "Batchfile", "bytes": "8451" }, { "name": "C", "bytes": "9249764" }, { "name": "C++", "bytes": "222763973" }, { "name": "CSS", "bytes": "875874" }, { "name": "Dart", "bytes": "74976" }, { "name": "Go", "bytes": "18155" }, { "name": "HTML", "bytes": "27190037" }, { "name": "Java", "bytes": "7645280" }, { "name": "JavaScript", "bytes": "18828195" }, { "name": "Makefile", "bytes": "96270" }, { "name": "Objective-C", "bytes": "1397246" }, { "name": "Objective-C++", "bytes": "7575073" }, { "name": "PHP", "bytes": "97817" }, { "name": "PLpgSQL", "bytes": "248854" }, { "name": "Perl", "bytes": "63937" }, { "name": "Protocol Buffer", "bytes": "418340" }, { "name": "Python", "bytes": "8032766" }, { "name": "Shell", "bytes": "464218" }, { "name": "Standard ML", "bytes": "4965" }, { "name": "XSLT", "bytes": "418" }, { "name": "nesC", "bytes": "18335" } ], "symlink_target": "" }
// // Program Name - S4_SP_ArrayDemo.cpp // Series: GetOnToC++ Step: 4 Side Program // // Purpose: Set the array to the even integers from 2 to 20 and Compute // the sum of the elements of the array. // // Compile: g++ S4_SP_ArrayDemo.cpp -o S4_SP_ArrayDemo // Execute: ./S4_SP_ArrayDemo // // Created by Narayan Mahadevan on 18/08/13. // Copyright (c) 2013 MakeTechEz. All rights reserved. // #include <iostream> #include <iomanip> using namespace std; int main() { // constant variable can be used to specify array size const int arraySize = 10; int total = 0; int s[ arraySize ]; // array s has 10 elements for ( int i = 0; i < arraySize; ++i ) // set the values s[ i ] = 2 + 2 * i; cout << "Element" << setw( 13 ) << "Value" << endl; // output contents of array s in tabular format for ( int j = 0; j < arraySize; ++j ) { cout << setw( 7 ) << j << setw( 13 ) << s[ j ] << endl; total += s[ j ]; } cout << "Total of array elements: " << total << endl; } // end main
{ "content_hash": "df70ed80376aab6afe67a8930821670c", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 77, "avg_line_length": 29, "alnum_prop": 0.5172413793103449, "repo_name": "NarayanMahadevan/MakeTechEz", "id": "88890363dff03586226f9992eb1ac17a79333e30", "size": "1189", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "GetOnToC++/Step_4/S4_SP_ArrayDemo.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "223130" }, { "name": "Objective-C", "bytes": "1627887" } ], "symlink_target": "" }
module P1 where {- (*) Find the last element of a list. (Note that the Lisp transcription of this problem is incorrect.) Example in Haskell: Prelude> myLast [1,2,3,4] 4 Prelude> myLast ['x','y','z'] 'z' -} lastElement :: [a] -> a lastElement [] = error "Can't take last element from empty list" lastElement (x:[]) = x lastElement (_:xs) = lastElement xs lastElement' :: [a] -> a lastElement' [] = error "Can't take last element from empty list" lastElement' (x:xs) = foldl (\_ el -> el) x xs lastElement'' :: [a] -> a lastElement'' list = head $ reverse list
{ "content_hash": "68490fe33d13bd6bab1c5dfc8959a4c4", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 72, "avg_line_length": 25.192307692307693, "alnum_prop": 0.566412213740458, "repo_name": "nikolaspapirniywork/99_problems", "id": "18dde4b7d04d2932eff61584e0e4f6dd54126158", "size": "655", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "haskell/src/P1.hs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Haskell", "bytes": "9037" }, { "name": "Perl", "bytes": "356" } ], "symlink_target": "" }
package org.ngrinder.script.controller; import static org.fest.assertions.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; import org.junit.Test; import org.ngrinder.common.util.HttpContainerContext; import org.ngrinder.model.User; import org.ngrinder.script.service.FileEntryService; public class BreadCrumbTest { @Test public void testBreadCrumb() { FileEntryController controller = new FileEntryController(); controller.httpContainerContext = mock(HttpContainerContext.class); when(controller.httpContainerContext.getCurrentContextUrlFromUserRequest()).thenReturn("http://helloworld.org/ngrinder"); User user = new User(); user.setUserId("admin"); assertThat(controller.getSvnUrlBreadcrumbs(user, "hello/world")) .isEqualTo("<a href='http://helloworld.org/ngrinder/script/list'>http://helloworld.org/ngrinder/svn/admin</a>/<a href='http://helloworld.org/ngrinder/script/list/hello'>hello</a>/<a href='http://helloworld.org/ngrinder/script/list/hello/world'>world</a>"); } }
{ "content_hash": "5dd671eef7b5be42b60336681d293b75", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 260, "avg_line_length": 45.5, "alnum_prop": 0.7893772893772893, "repo_name": "SRCB-CloudPart/ngrinder", "id": "1db395b20d9f52919978c301d15850beb7771d54", "size": "1092", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "ngrinder-controller/src/test/java/org/ngrinder/script/controller/BreadCrumbTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1479" }, { "name": "CSS", "bytes": "75784" }, { "name": "Groff", "bytes": "51750" }, { "name": "Groovy", "bytes": "6731" }, { "name": "HTML", "bytes": "308" }, { "name": "Java", "bytes": "1883736" }, { "name": "JavaScript", "bytes": "405721" }, { "name": "Python", "bytes": "2890" }, { "name": "Shell", "bytes": "8568" } ], "symlink_target": "" }
<?php class FoldersController extends AppController { public $uses = array('ApertureConnector.CustomSortOrder', 'ApertureConnector.Folder', 'ApertureConnector.Album'); public $components = array('ApertureConnector.Properties'); public $paginate = array( 'limit' => 16, 'fields' => array('modelId', 'uuid', 'name'), //tableau de champs nommés 'recursive' => -1 ); public function index() { $albumUuid = "TopLevelAlbums"; $projectUuid = "AllProjectsItem"; $albums = $this->getTree($albumUuid); $projects = $this->getTree($projectUuid); $folders = array($albums, $projects); $this->set('folders', $folders); $this->set('_serialize', array('folders')); } private function getTree($root){ $findOptions = array( 'conditions' => array( 'Folder.uuid' => $root, 'Folder.isHidden' => 0, 'Folder.isInTrash' => 0), ); $tree = $this->Folder->find('first',$findOptions); $this->fillFolder($tree); if(!$tree){ throw new NotFoundException(); } return $tree; } private function fillFolder(&$parent){ $findFolderOptions = array( 'conditions' => array( 'Folder.parentFolderUuid' => $parent['Folder']['uuid'], 'Folder.isHidden' => 0, 'Folder.isInTrash' => 0), 'joins' => array( array('table' => 'RKCustomSortOrder', 'alias' => 'CustomSortOrder', 'type' => 'LEFT', 'conditions' => array( 'CustomSortOrder.objectUuid = Folder.uuid', 'CustomSortOrder.containerUuid = Folder.parentFolderUuid', 'CustomSortOrder.purpose' => substr($parent['Folder']['sortKeyPath'], 7) ) ) ), 'order' => 'ifnull(CustomSortOrder.orderNumber,999999999) '.($parent['Folder']['sortAscending'] == 1?'ASC':'DESC'), 'fields' => array("Folder.modelId", "Folder.uuid", "Folder.folderType", "Folder.name", "Folder.parentFolderUuid", "Folder.implicitAlbumUuid", "Folder.posterVersionUuid", "Folder.automaticallyGenerateFullSizePreviews", "Folder.versionCount", "Folder.minImageDate", "Folder.maxImageDate", "Folder.folderPath", "Folder.createDate", "Folder.isExpanded", "Folder.isHidden", "Folder.isFavorite", "Folder.isInTrash", "Folder.isMagic", "Folder.colorLabelIndex", "Folder.sortAscending", "Folder.sortKeyPath", "Folder.isHiddenWhenEmpty", "Folder.minImageTimeZoneName", "Folder.maxImageTimeZoneName", 'ifnull(CustomSortOrder.orderNumber,999999999) as "Folder.orderNumber"', 'replace(Folder.uuid, \'%\', \'_\') as "Folder.encodedUuid"'), ); $folders = $this->Folder->find('all',$findFolderOptions); $findAlbumOptions = array( 'conditions' => array( 'Album.folderUuid' => $parent['Folder']['uuid'], 'Album.isHidden' => 0, 'Album.isInTrash' => 0, 'Album.isMagic' => 0, 'Album.name IS NOT NULL', ), 'joins' => array( array('table' => 'RKCustomSortOrder', 'alias' => 'CustomSortOrder', 'type' => 'LEFT', 'conditions' => array( 'CustomSortOrder.objectUuid = Album.uuid', 'CustomSortOrder.containerUuid = Album.folderUuid', 'CustomSortOrder.purpose' => substr($parent['Folder']['sortKeyPath'], 7) ) ) ), 'order' => 'ifnull(CustomSortOrder.orderNumber,999999999) '.($parent['Folder']['sortAscending'] == 1?'ASC':'DESC'), 'fields' => array("Album.name", "Album.uuid", "Album.isMagic", "Album.albumType", "Album.albumSubclass", 'ifnull(CustomSortOrder.orderNumber,999999999) as "Album.orderNumber"', 'replace(Album.uuid, \'%\', \'_\') as "Album.encodedUuid"'), ); $albums = $this->Album->find('all',$findAlbumOptions); $parent['Children'] = array(); $folderIdx = 0; $albumIdx = 0; while ($folderIdx < count($folders)){ while ($albumIdx < count($albums) && ($parent['Folder']['sortAscending'] == 1?$albums[$albumIdx]['Album']['orderNumber']<=$folders[$folderIdx]['Folder']['orderNumber']:$albums[$albumIdx]['Album']['orderNumber']>=$folders[$folderIdx]['Folder']['orderNumber'])){ $parent['Children'][] = $albums[$albumIdx]; ++$albumIdx; } $this->fillFolder($folders[$folderIdx]); $parent['Children'][] = $folders[$folderIdx]; ++$folderIdx; } while ($albumIdx < count($albums)){ $parent['Children'][] = $albums[$albumIdx]; ++$albumIdx; } } public function view($uuid){ $decodedProjectUuid = $this->Folder->decodeUuid($uuid); $rate = isset($this->params['named']['rate']) ? $this->params['named']['rate'] : 0; $project = $this->Folder->findByUuid($decodedProjectUuid); if($project){ if( $project['Folder']['folderType'] == 2 ){ $this->paginate['conditions'] = array( 'Version.showInLibrary' => 1, 'Version.isHidden' => 0, 'Version.isInTrash' => 0, 'Version.mainRating >=' => $rate, 'Version.Projectuuid' => $decodedProjectUuid); $this->paginate['order'] = array('Version.imageDate' => 'asc'); $versions = $this->paginate('Version'); $this->set(compact('project', 'versions')); $this->set('_serialize', array('project', 'versions')); $this->render('thumbnails'); } else { $this->fillFolder($project); $folders = array($project); $this->set(compact('folders')); $this->set('_serialize', array('folders')); $this->render('index'); } } else{ throw new NotFoundException(); } $this->response->cache('-1 minute', '+5 days'); } private function generateZip($versions, $name){ $extime = ini_get('max_execution_time'); ini_set('max_execution_time', 600); $fileTime = date("D, d M Y H:i:s T"); $zip = new \PHPZip\Zip\Stream\ZipStream("ZipFolders.zip"); $missingFiles = "Images manquantes de ".$name." : \n"; $hasMissingFiles = false; foreach ($versions as $version){ $properties = $this->Properties->getProperties($version); if(isset($properties['ExportedJpg'])){ $zip->addLargeFile(Configure::read('exportedPath').$properties['ExportedJpg'], $properties['ExportedJpg']); } else{ $hasMissingFiles = true; $missingFiles .= "\t-".$properties['ProjectName'].' > '.$version['Version']['name']."\n"; } } if($hasMissingFiles){ $zip->addFile($missingFiles, 'missing.txt'); } $zip->finalize(); exit; /*$file = tempnam("tmp", "zip"); $zip = new ZipArchive(); $zip->open($file, ZipArchive::OVERWRITE); $missingFiles = "Images manquantes de ".$name." : \n"; $zip->close(); header('Content-Type: application/zip'); header('Content-Length: ' . filesize($file)); header('Content-Disposition: attachment; filename="download.zip"'); readfile($file); unlink($file); exit;*/ } public function download($uuid){ $decodedProjectUuid = $this->decodeUuid($uuid); $rate = isset($this->params['named']['rate']) ? $this->params['named']['rate'] : 0; $project = $this->Folder->findByUuid($decodedProjectUuid); if($project){ $options = array( 'conditions' => array( 'Version.showInLibrary' => 1, 'Version.isHidden' => 0, 'Version.isInTrash' => 0, 'Version.mainRating >=' => $rate, 'Version.Projectuuid' => $decodedProjectUuid) ); $versions = $this->Version->find('all', $options); $this->generateZip($versions, $project['Folder']['name']); } } public function downloadAlbum($uuid){ $decodedAlbumUuid = $this->Album->decodeUuid($uuid); $rate = isset($this->params['named']['rate']) ? $this->params['named']['rate'] : 0; $albumConditions = array( 'conditions' => array('Album.uuid' => $decodedAlbumUuid), //tableau de conditions 'fields' => array('modelId', 'uuid', 'name', 'sortKeyPath', 'sortAscending', 'versionCount') //tableau de champs nommés ); if($decodedAlbumUuid && $album = $this->Album->find('first', $albumConditions)){ $options = array( 'joins' => array( array('table' => 'RKAlbumVersion', 'alias' => 'AlbumVersion', 'type' => 'INNER', 'conditions' => array( 'AlbumVersion.albumid' => $album['Album']['modelId'], 'AlbumVersion.versionid = Version.modelid' ) ) ), 'conditions' => array( 'Version.showInLibrary' => 1, 'Version.isHidden' => 0, 'Version.isInTrash' => 0, 'Version.mainRating >=' => $rate) ); $versions = $this->Version->find('all', $options); $this->generateZip($versions, $album['Album']['name']); } } public function viewAlbum($uuid) { $decodedAlbumUuid = $this->Album->decodeUuid($uuid); $rate = isset($this->params['named']['rate']) ? $this->params['named']['rate'] : 0; $albumConditions = array( 'conditions' => array('Album.uuid' => $decodedAlbumUuid), //tableau de conditions 'fields' => array('modelId', 'uuid', 'name', 'sortKeyPath', 'sortAscending', 'versionCount') //tableau de champs nommés ); if($decodedAlbumUuid && $album = $this->Album->find('first', $albumConditions)){ $this->paginate['joins'] = array( array('table' => 'RKAlbumVersion', 'alias' => 'AlbumVersion', 'type' => 'INNER', 'conditions' => array( 'AlbumVersion.albumid' => $album['Album']['modelId'], 'AlbumVersion.versionid = Version.modelid' ) ) ); $this->paginate['conditions'] = array( 'Version.showInLibrary' => 1, 'Version.isHidden' => 0, 'Version.isInTrash' => 0, 'Version.mainRating >=' => $rate); $this->paginate['order'] = array('Version.imageDate' => 'asc'); $versions = $this->paginate('Version'); $album = $album; $this->set(compact('album', 'versions')); $this->set('_serialize', array('album', 'versions')); } else{ throw new NotFoundException(); } $this->render('thumbnails'); } public function beforeFilter() { parent::beforeFilter(); $this->Auth->allow('view', 'viewAlbum', 'downloadAlbum'); } } ?>
{ "content_hash": "12977802de1454920ef0288042f7f4fc", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 729, "avg_line_length": 33.60726072607261, "alnum_prop": 0.5925562211529019, "repo_name": "theus77/floral", "id": "f2b395059daa207194cb43fc52b77e0ee17e40ad", "size": "10186", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/Controller/FoldersController.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "310" }, { "name": "Batchfile", "bytes": "936" }, { "name": "CSS", "bytes": "44230" }, { "name": "PHP", "bytes": "178016" }, { "name": "Ruby", "bytes": "4945" }, { "name": "Shell", "bytes": "1996" } ], "symlink_target": "" }
<?php //***************************************************************************// // // // Copyright (c) 2004-2017 Jonathon Freeman | CrunchDrop | Phillip // // Copyright (c) 2007 Brian Otto // // All rights reserved. // // // // This program is free software. You may use, modify, and/or redistribute // // it under the terms of the MIT License. // // // //***************************************************************************// // Load the database information. require('./includes/dbinfo.inc.php'); // Load the database driver. if(!@include("./includes/{$aDBInfo['type']}.inc.php")) { die('<span style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px;">Please upload a database driver!</span>'); } // Create a new database connection. $dbConn = new DBConnection($aDBInfo); // Make sure we connected. if(!$dbConn->objConnection || !$dbConn->objSelect) { DatabaseError(); } // *************************************************************************** \\ // Tells the user when there's a problem with the database. function DatabaseError() { global $CFG, $dbConn, $strDBEMail; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="SHORTCUT ICON" href="favicon.ico" /> <title>Database Error</title> <style type="text/css"> body { color: black; background-color: white; width: 450px; line-height: 14px; padding: 15px; font-family: tahoma, arial, sans-serif; font-size: 11px; text-align: justify; } </style> </head> <body> <div><b>There seems to be a problem with the database.</b></div> <p>Please try again by pressing the <a href="javascript:window.location=window.location;">refresh</a> button in your browser. An e-mail message has been dispatched to the <a href="mailto:<?php echo($aDBInfo['email']); ?>">Webmaster</a>, whom you can also contact if the problem persists. We apologize for any inconvenience.</p> <p><b>Error</b>: <?php echo($dbConn->geterror()); ?>.</p> <?php // For testing purposes. if($CFG['showqueries']) { ShowQueries(); } ?> </body> </html> <?php // We're done. exit; } ?>
{ "content_hash": "775cd668b882dfb47003e92bf981f4be", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 328, "avg_line_length": 33.074074074074076, "alnum_prop": 0.5184770436730123, "repo_name": "wtcBB/wtcBB", "id": "ad9fa3ad7dbed2dee41a61005fcd988179ea9b2e", "size": "2679", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "wtcBB/includes/db.inc.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "274" }, { "name": "JavaScript", "bytes": "3499" }, { "name": "PHP", "bytes": "932675" }, { "name": "Smarty", "bytes": "212" } ], "symlink_target": "" }
<?php namespace Kunstmaan\VotingBundle\Tests\EventListener\Security; use Kunstmaan\VotingBundle\Event\Facebook\FacebookLikeEvent; use Kunstmaan\VotingBundle\EventListener\Security\MaxNumberByIpEventListener; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; /** * Test Max Number by Ip event listener */ class MaxNumberByIpEventListenerTest extends TestCase { /** * @param $returnNull * @param int $voteNumber * * @return \Kunstmaan\VotingBundle\Services\RepositoryResolver */ protected function mockRepositoryResolver($returnNull, $voteNumber = 0) { $mockedRepository = null; if (!$returnNull) { $mockedRepository = $this->createMock('Kunstmaan\VotingBundle\Repository\AbstractVoteRepository'); //, array('countByReferenceAndByIp'), array(), 'MockedRepository', false); $mockedRepository->expects($this->any()) ->method('countByReferenceAndByIp') ->willReturn($voteNumber); } $mockedResolver = $this->createMock('Kunstmaan\VotingBundle\Services\RepositoryResolver'); //, array('getRepositoryForEvent'), array(), 'MockedResolver', false); $mockedResolver->expects($this->any()) ->method('getRepositoryForEvent') ->willReturn($mockedRepository); /* @var \Kunstmaan\VotingBundle\Services\RepositoryResolver $mockedResolver */ return $mockedResolver; } /** * @dataProvider dataTestOnVote */ public function testOnVote($maxNumber, $number, $stopPropagation) { $mockedEvent = $this->createMock('Kunstmaan\VotingBundle\Event\UpDown\UpVoteEvent'); //, array('stopPropagation'), array(new Request(), null, null)); if ($stopPropagation) { $mockedEvent->expects($this->once()) ->method('stopPropagation'); } else { $mockedEvent->expects($this->never()) ->method('stopPropagation'); } $mockedEvent->expects($this->any()) ->method('getRequest') ->willReturn(new Request()); $resolver = $this->mockRepositoryResolver(false, $number); $listener = new MaxNumberByIpEventListener($resolver, $maxNumber); $listener->onVote($mockedEvent); } /** * @dataProvider dataTestOnVote */ public function testOnVoteReturnsNothing($maxNumber, $number, $stopPropagation) { $event = new FacebookLikeEvent(new Request(), new Response(), 2); $resolver = $this->mockRepositoryResolver(false, $number); $listener = new MaxNumberByIpEventListener($resolver, $maxNumber); $this->assertNull($listener->onVote($event)); $this->assertSame($stopPropagation, $event->isPropagationStopped()); } /** * Data for test on vote * * @return array */ public function dataTestOnVote() { return array( array(2, 2, true), array(2, 1, false), array(2, 3, true), ); } }
{ "content_hash": "e62053a4f26d2014009f6bcacb0c5cd4", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 185, "avg_line_length": 31.714285714285715, "alnum_prop": 0.6357786357786358, "repo_name": "wesleylancel/KunstmaanBundlesCMS", "id": "809b7988ba21ac1f0eb752c90bcc393513cedb12", "size": "3108", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/Kunstmaan/VotingBundle/Tests/unit/EventListener/Security/MaxNumberByIpEventListenerTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "202578" }, { "name": "Gherkin", "bytes": "22161" }, { "name": "HTML", "bytes": "380014" }, { "name": "JavaScript", "bytes": "476890" }, { "name": "PHP", "bytes": "2790894" }, { "name": "Ruby", "bytes": "2363" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LightNode.Server { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false)] public sealed class IgnoreClientGenerateAttribute : Attribute { } }
{ "content_hash": "2a762121f6852502e703e921f830f7f1", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 93, "avg_line_length": 23, "alnum_prop": 0.7732919254658385, "repo_name": "neuecc/LightNode", "id": "d924940e766e2ef0175d68fddaf8abfcd58aaed3", "size": "324", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "Source/LightNode2/Server/IgnoreClientGenerateAttribute.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "488" }, { "name": "Batchfile", "bytes": "2800" }, { "name": "C#", "bytes": "842989" }, { "name": "HTML", "bytes": "7634" }, { "name": "TypeScript", "bytes": "16336" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Sauce-0.11.0: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Sauce-0.11.0 </div> <div id="projectbrief">A C++ Dependency Injection Framework</div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.7.6.1 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><b>sauce</b> </li> <li class="navelem"><b>internal</b> </li> <li class="navelem"><a class="el" href="classsauce_1_1internal_1_1_instance_binding.html">InstanceBinding</a> </li> </ul> </div> </div> <div class="header"> <div class="headertitle"> <div class="title">sauce::internal::InstanceBinding&lt; Dependency &gt; Member List</div> </div> </div><!--header--> <div class="contents"> This is the complete list of members for <a class="el" href="classsauce_1_1internal_1_1_instance_binding.html">sauce::internal::InstanceBinding&lt; Dependency &gt;</a>, including all inherited members.<table> <tr bgcolor="#f0f0f0"><td><b>Binding</b>() (defined in <a class="el" href="classsauce_1_1internal_1_1_binding.html">sauce::internal::Binding&lt; Dependency, NoScope &gt;</a>)</td><td><a class="el" href="classsauce_1_1internal_1_1_binding.html">sauce::internal::Binding&lt; Dependency, NoScope &gt;</a></td><td><code> [inline]</code></td></tr> <tr bgcolor="#f0f0f0"><td><b>BindingPtr</b> typedef (defined in <a class="el" href="classsauce_1_1internal_1_1_instance_binding.html">sauce::internal::InstanceBinding&lt; Dependency &gt;</a>)</td><td><a class="el" href="classsauce_1_1internal_1_1_instance_binding.html">sauce::internal::InstanceBinding&lt; Dependency &gt;</a></td><td></td></tr> <tr bgcolor="#f0f0f0"><td><b>cache</b>(InjectorPtr injector, typename Key&lt; Dependency &gt;::Ptr injected, i::TypeId scope) const (defined in <a class="el" href="classsauce_1_1internal_1_1_injector_friend.html">sauce::internal::InjectorFriend</a>)</td><td><a class="el" href="classsauce_1_1internal_1_1_injector_friend.html">sauce::internal::InjectorFriend</a></td><td><code> [inline, protected]</code></td></tr> <tr bgcolor="#f0f0f0"><td><b>Dependency</b> typedef (defined in <a class="el" href="classsauce_1_1internal_1_1_binding.html">sauce::internal::Binding&lt; Dependency, NoScope &gt;</a>)</td><td><a class="el" href="classsauce_1_1internal_1_1_binding.html">sauce::internal::Binding&lt; Dependency, NoScope &gt;</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="classsauce_1_1internal_1_1_opaque_binding.html#a7f2819936b99c569cc29e3114d216328">sauce::internal::ResolvedBinding::eagerlyInject</a>(OpaqueBindingPtr, sauce::shared_ptr&lt; Injector &gt;) const =0</td><td><a class="el" href="classsauce_1_1internal_1_1_opaque_binding.html">sauce::internal::OpaqueBinding</a></td><td><code> [pure virtual]</code></td></tr> <tr class="memlist"><td><a class="el" href="classsauce_1_1internal_1_1_resolved_binding.html#a052b701d112012a04c93d7c76ffac334">sauce::internal::ResolvedBinding::get</a>(IfacePtr &amp;, BindingPtr, sauce::shared_ptr&lt; Injector &gt;) const =0</td><td><a class="el" href="classsauce_1_1internal_1_1_resolved_binding.html">sauce::internal::ResolvedBinding&lt; Dependency &gt;</a></td><td><code> [pure virtual]</code></td></tr> <tr class="memlist"><td><a class="el" href="classsauce_1_1internal_1_1_resolved_binding.html#a7ff0341fe08ae52a0f03a35ad6dd3c79">getKey</a>() const </td><td><a class="el" href="classsauce_1_1internal_1_1_resolved_binding.html">sauce::internal::ResolvedBinding&lt; Dependency &gt;</a></td><td><code> [inline, virtual]</code></td></tr> <tr class="memlist"><td><a class="el" href="classsauce_1_1internal_1_1_binding.html#ae7bf0f08a99b2346aca54988a13bad99">getName</a>() const</td><td><a class="el" href="classsauce_1_1internal_1_1_binding.html">sauce::internal::Binding&lt; Dependency, NoScope &gt;</a></td><td><code> [inline, virtual]</code></td></tr> <tr class="memlist"><td><a class="el" href="classsauce_1_1internal_1_1_instance_binding.html#aa12cb8a1f0b19a908464063b023bfa7a">inject</a>(IfacePtr &amp;injected, BindingPtr, InjectorPtr) const </td><td><a class="el" href="classsauce_1_1internal_1_1_instance_binding.html">sauce::internal::InstanceBinding&lt; Dependency &gt;</a></td><td><code> [inline, virtual]</code></td></tr> <tr bgcolor="#f0f0f0"><td><b>injectHelper</b>(typename Key&lt; Dependency &gt;::Ptr &amp;injected, InjectorPtr injector, std::string const name) const (defined in <a class="el" href="classsauce_1_1internal_1_1_injector_friend.html">sauce::internal::InjectorFriend</a>)</td><td><a class="el" href="classsauce_1_1internal_1_1_injector_friend.html">sauce::internal::InjectorFriend</a></td><td><code> [inline, protected]</code></td></tr> <tr bgcolor="#f0f0f0"><td><b>InstanceBinding</b>(IfacePtr iface) (defined in <a class="el" href="classsauce_1_1internal_1_1_instance_binding.html">sauce::internal::InstanceBinding&lt; Dependency &gt;</a>)</td><td><a class="el" href="classsauce_1_1internal_1_1_instance_binding.html">sauce::internal::InstanceBinding&lt; Dependency &gt;</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classsauce_1_1internal_1_1_opaque_binding.html#a08d286d2d97f34d3c5104b4ed95527bc">isModifier</a>() const </td><td><a class="el" href="classsauce_1_1internal_1_1_opaque_binding.html">sauce::internal::OpaqueBinding</a></td><td><code> [inline, virtual]</code></td></tr> <tr bgcolor="#f0f0f0"><td><b>probe</b>(InjectorPtr injector, typename Key&lt; Dependency &gt;::Ptr &amp;injected, i::TypeId scope) const (defined in <a class="el" href="classsauce_1_1internal_1_1_injector_friend.html">sauce::internal::InjectorFriend</a>)</td><td><a class="el" href="classsauce_1_1internal_1_1_injector_friend.html">sauce::internal::InjectorFriend</a></td><td><code> [inline, protected]</code></td></tr> <tr class="memlist"><td><a class="el" href="classsauce_1_1internal_1_1_binding.html#a195b6fc17905a087a72fb6c515736254">setName</a>(std::string const name)</td><td><a class="el" href="classsauce_1_1internal_1_1_binding.html">sauce::internal::Binding&lt; Dependency, NoScope &gt;</a></td><td><code> [inline, virtual]</code></td></tr> <tr class="memlist"><td><a class="el" href="classsauce_1_1internal_1_1_resolved_binding.html#a503de5fe9cb4996db536f6f6d6d486be">Binding&lt; Dependency, NoScope &gt;::validateAcyclic</a>(sauce::shared_ptr&lt; Injector &gt;, TypeIds &amp;) const =0</td><td><a class="el" href="classsauce_1_1internal_1_1_resolved_binding.html">sauce::internal::ResolvedBinding&lt; Dependency &gt;</a></td><td><code> [pure virtual]</code></td></tr> <tr bgcolor="#f0f0f0"><td><b>validateAcyclicHelper</b>(InjectorPtr injector, TypeIds &amp;ids, std::string const name) const (defined in <a class="el" href="classsauce_1_1internal_1_1_injector_friend.html">sauce::internal::InjectorFriend</a>)</td><td><a class="el" href="classsauce_1_1internal_1_1_injector_friend.html">sauce::internal::InjectorFriend</a></td><td><code> [inline, protected]</code></td></tr> <tr bgcolor="#f0f0f0"><td><b>~Binding</b>() (defined in <a class="el" href="classsauce_1_1internal_1_1_binding.html">sauce::internal::Binding&lt; Dependency, NoScope &gt;</a>)</td><td><a class="el" href="classsauce_1_1internal_1_1_binding.html">sauce::internal::Binding&lt; Dependency, NoScope &gt;</a></td><td><code> [inline, virtual]</code></td></tr> <tr bgcolor="#f0f0f0"><td><b>~OpaqueBinding</b>() (defined in <a class="el" href="classsauce_1_1internal_1_1_opaque_binding.html">sauce::internal::OpaqueBinding</a>)</td><td><a class="el" href="classsauce_1_1internal_1_1_opaque_binding.html">sauce::internal::OpaqueBinding</a></td><td><code> [inline, virtual]</code></td></tr> <tr bgcolor="#f0f0f0"><td><b>~ResolvedBinding</b>() (defined in <a class="el" href="classsauce_1_1internal_1_1_resolved_binding.html">sauce::internal::ResolvedBinding&lt; Dependency &gt;</a>)</td><td><a class="el" href="classsauce_1_1internal_1_1_resolved_binding.html">sauce::internal::ResolvedBinding&lt; Dependency &gt;</a></td><td><code> [inline, virtual]</code></td></tr> </table></div><!-- contents --> <hr class="footer"/><address class="footer"><small> Generated by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.7.6.1 </small></address> </body> </html>
{ "content_hash": "6710bdc0c12b43e71400ae5f87d73727", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 436, "avg_line_length": 99.16666666666667, "alnum_prop": 0.6940126050420168, "repo_name": "phs/sauce", "id": "3097aed00285bc1957ab82ac40ef367e2b894821", "size": "9520", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doxygen-doc/html/classsauce_1_1internal_1_1_instance_binding-members.html", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "780" }, { "name": "C++", "bytes": "220626" }, { "name": "CSS", "bytes": "16060" }, { "name": "HTML", "bytes": "2340883" }, { "name": "M4", "bytes": "33982" }, { "name": "Makefile", "bytes": "9164" }, { "name": "Shell", "bytes": "1881" } ], "symlink_target": "" }
from django.db import models from django.contrib.auth.models import User from django.utils import timezone class Class(models.Model): cls_id = models.AutoField("ClassManagement id", primary_key=True) teacher = models.ManyToManyField(User, related_name='teacher', blank=True) students = models.ManyToManyField(User, blank=True) name = models.CharField('ClassManagement Name', max_length=100) description = models.CharField('ClassManagement Description', max_length=100) def __str__(self): return self.name def __repr__(self): return self.__str__() def __unicode__(self): return self.__str__()
{ "content_hash": "da8652dff9019b058956576173ff1321", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 81, "avg_line_length": 32.6, "alnum_prop": 0.6932515337423313, "repo_name": "Mihai925/EduCoding", "id": "2895684f9dac73fed03073e3225fcc0f91eea2b0", "size": "652", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Class/models.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "103299" }, { "name": "HTML", "bytes": "79484" }, { "name": "JavaScript", "bytes": "47731" }, { "name": "Python", "bytes": "72639" }, { "name": "Shell", "bytes": "130" } ], "symlink_target": "" }
<?php namespace Symfony\Component\Messenger\Middleware; use Symfony\Component\Messenger\Exception\NoHandlerForMessageException; /** * @author Samuel Roze <[email protected]> */ class AllowNoHandlerMiddleware implements MiddlewareInterface { public function handle($message, callable $next) { try { return $next($message); } catch (NoHandlerForMessageException $e) { // We allow not having a handler for this message. } } }
{ "content_hash": "d45acbad6934ca65b0ba0e98bf32f176", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 71, "avg_line_length": 22.454545454545453, "alnum_prop": 0.6781376518218624, "repo_name": "pamil/symfony", "id": "33494548f832f5bb4b068de630c5375c766aaa52", "size": "723", "binary": false, "copies": "9", "ref": "refs/heads/master", "path": "src/Symfony/Component/Messenger/Middleware/AllowNoHandlerMiddleware.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3010" }, { "name": "HTML", "bytes": "369457" }, { "name": "Hack", "bytes": "26" }, { "name": "JavaScript", "bytes": "354" }, { "name": "PHP", "bytes": "15753235" }, { "name": "Shell", "bytes": "375" } ], "symlink_target": "" }
Chris Caruso, Brian Chen, Joshua Wolfe ###### "In photography there is a reality so subtle <br> that it becomes more real than reality." <br> -Alfred Stieglitz ## About pocketDSLR pocketDSLR is a bare-bones, point-n-shoot camera application designed for Android Lollipop devices. It utilizes the Android 5.0 APIs (v. 21) allowing for unique customization and control over the onboard camera. These functionalities include, but are not limited to: * Manipulating shutter speed * Changing exposure level * Control ISO levels * Provide manual fucussing The intended goals for pocketDSLR are to: * Privide manual control of the device's native camera * Accomplish this in an efficient, fast functioning application * Allow image manipulation to provide missing camera functionalities. (*TBD*)
{ "content_hash": "eb98cf25dc237b7fb905dab1f1538a24", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 120, "avg_line_length": 44.22222222222222, "alnum_prop": 0.7864321608040201, "repo_name": "pocketDSLR/pocketDSLR", "id": "4ee554878fc5fef04658ec4793bea0440624144b", "size": "809", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "65020" } ], "symlink_target": "" }
@interface Hope4CarViewController : GAITrackedViewController<UIActionSheetDelegate> - (IBAction)startBackgroundSearch:(id)sender; - (IBAction)showIntroduction:(id)sender; @end
{ "content_hash": "1fc09e5c365ba6c74b2f635dc29e203d", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 83, "avg_line_length": 25.571428571428573, "alnum_prop": 0.8268156424581006, "repo_name": "emrehasan/Hope4Car", "id": "23c558fc92cb665f5c3a610b067b54e97bab7e87", "size": "394", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Smart2Go/Smart2Go/Hope4CarViewController.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Objective-C", "bytes": "394712" } ], "symlink_target": "" }
#ifndef UCDN_H #define UCDN_H #if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__) # define HB_BEGIN_VISIBILITY _Pragma ("GCC visibility push(hidden)") # define HB_END_VISIBILITY _Pragma ("GCC visibility pop") #else # define HB_BEGIN_VISIBILITY # define HB_END_VISIBILITY #endif #ifdef __cplusplus # define HB_BEGIN_HEADER extern "C" { HB_BEGIN_VISIBILITY # define HB_END_HEADER HB_END_VISIBILITY } #else # define HB_BEGIN_HEADER HB_BEGIN_VISIBILITY # define HB_END_HEADER HB_END_VISIBILITY #endif HB_BEGIN_HEADER #include <stdint.h> #define UCDN_EAST_ASIAN_F 0 #define UCDN_EAST_ASIAN_H 1 #define UCDN_EAST_ASIAN_W 2 #define UCDN_EAST_ASIAN_NA 3 #define UCDN_EAST_ASIAN_A 4 #define UCDN_EAST_ASIAN_N 5 #define UCDN_SCRIPT_COMMON 0 #define UCDN_SCRIPT_LATIN 1 #define UCDN_SCRIPT_GREEK 2 #define UCDN_SCRIPT_CYRILLIC 3 #define UCDN_SCRIPT_ARMENIAN 4 #define UCDN_SCRIPT_HEBREW 5 #define UCDN_SCRIPT_ARABIC 6 #define UCDN_SCRIPT_SYRIAC 7 #define UCDN_SCRIPT_THAANA 8 #define UCDN_SCRIPT_DEVANAGARI 9 #define UCDN_SCRIPT_BENGALI 10 #define UCDN_SCRIPT_GURMUKHI 11 #define UCDN_SCRIPT_GUJARATI 12 #define UCDN_SCRIPT_ORIYA 13 #define UCDN_SCRIPT_TAMIL 14 #define UCDN_SCRIPT_TELUGU 15 #define UCDN_SCRIPT_KANNADA 16 #define UCDN_SCRIPT_MALAYALAM 17 #define UCDN_SCRIPT_SINHALA 18 #define UCDN_SCRIPT_THAI 19 #define UCDN_SCRIPT_LAO 20 #define UCDN_SCRIPT_TIBETAN 21 #define UCDN_SCRIPT_MYANMAR 22 #define UCDN_SCRIPT_GEORGIAN 23 #define UCDN_SCRIPT_HANGUL 24 #define UCDN_SCRIPT_ETHIOPIC 25 #define UCDN_SCRIPT_CHEROKEE 26 #define UCDN_SCRIPT_CANADIAN_ABORIGINAL 27 #define UCDN_SCRIPT_OGHAM 28 #define UCDN_SCRIPT_RUNIC 29 #define UCDN_SCRIPT_KHMER 30 #define UCDN_SCRIPT_MONGOLIAN 31 #define UCDN_SCRIPT_HIRAGANA 32 #define UCDN_SCRIPT_KATAKANA 33 #define UCDN_SCRIPT_BOPOMOFO 34 #define UCDN_SCRIPT_HAN 35 #define UCDN_SCRIPT_YI 36 #define UCDN_SCRIPT_OLD_ITALIC 37 #define UCDN_SCRIPT_GOTHIC 38 #define UCDN_SCRIPT_DESERET 39 #define UCDN_SCRIPT_INHERITED 40 #define UCDN_SCRIPT_TAGALOG 41 #define UCDN_SCRIPT_HANUNOO 42 #define UCDN_SCRIPT_BUHID 43 #define UCDN_SCRIPT_TAGBANWA 44 #define UCDN_SCRIPT_LIMBU 45 #define UCDN_SCRIPT_TAI_LE 46 #define UCDN_SCRIPT_LINEAR_B 47 #define UCDN_SCRIPT_UGARITIC 48 #define UCDN_SCRIPT_SHAVIAN 49 #define UCDN_SCRIPT_OSMANYA 50 #define UCDN_SCRIPT_CYPRIOT 51 #define UCDN_SCRIPT_BRAILLE 52 #define UCDN_SCRIPT_BUGINESE 53 #define UCDN_SCRIPT_COPTIC 54 #define UCDN_SCRIPT_NEW_TAI_LUE 55 #define UCDN_SCRIPT_GLAGOLITIC 56 #define UCDN_SCRIPT_TIFINAGH 57 #define UCDN_SCRIPT_SYLOTI_NAGRI 58 #define UCDN_SCRIPT_OLD_PERSIAN 59 #define UCDN_SCRIPT_KHAROSHTHI 60 #define UCDN_SCRIPT_BALINESE 61 #define UCDN_SCRIPT_CUNEIFORM 62 #define UCDN_SCRIPT_PHOENICIAN 63 #define UCDN_SCRIPT_PHAGS_PA 64 #define UCDN_SCRIPT_NKO 65 #define UCDN_SCRIPT_SUNDANESE 66 #define UCDN_SCRIPT_LEPCHA 67 #define UCDN_SCRIPT_OL_CHIKI 68 #define UCDN_SCRIPT_VAI 69 #define UCDN_SCRIPT_SAURASHTRA 70 #define UCDN_SCRIPT_KAYAH_LI 71 #define UCDN_SCRIPT_REJANG 72 #define UCDN_SCRIPT_LYCIAN 73 #define UCDN_SCRIPT_CARIAN 74 #define UCDN_SCRIPT_LYDIAN 75 #define UCDN_SCRIPT_CHAM 76 #define UCDN_SCRIPT_TAI_THAM 77 #define UCDN_SCRIPT_TAI_VIET 78 #define UCDN_SCRIPT_AVESTAN 79 #define UCDN_SCRIPT_EGYPTIAN_HIEROGLYPHS 80 #define UCDN_SCRIPT_SAMARITAN 81 #define UCDN_SCRIPT_LISU 82 #define UCDN_SCRIPT_BAMUM 83 #define UCDN_SCRIPT_JAVANESE 84 #define UCDN_SCRIPT_MEETEI_MAYEK 85 #define UCDN_SCRIPT_IMPERIAL_ARAMAIC 86 #define UCDN_SCRIPT_OLD_SOUTH_ARABIAN 87 #define UCDN_SCRIPT_INSCRIPTIONAL_PARTHIAN 88 #define UCDN_SCRIPT_INSCRIPTIONAL_PAHLAVI 89 #define UCDN_SCRIPT_OLD_TURKIC 90 #define UCDN_SCRIPT_KAITHI 91 #define UCDN_SCRIPT_BATAK 92 #define UCDN_SCRIPT_BRAHMI 93 #define UCDN_SCRIPT_MANDAIC 94 #define UCDN_SCRIPT_CHAKMA 95 #define UCDN_SCRIPT_MEROITIC_CURSIVE 96 #define UCDN_SCRIPT_MEROITIC_HIEROGLYPHS 97 #define UCDN_SCRIPT_MIAO 98 #define UCDN_SCRIPT_SHARADA 99 #define UCDN_SCRIPT_SORA_SOMPENG 100 #define UCDN_SCRIPT_TAKRI 101 #define UCDN_SCRIPT_UNKNOWN 102 #define UCDN_GENERAL_CATEGORY_CC 0 #define UCDN_GENERAL_CATEGORY_CF 1 #define UCDN_GENERAL_CATEGORY_CN 2 #define UCDN_GENERAL_CATEGORY_CO 3 #define UCDN_GENERAL_CATEGORY_CS 4 #define UCDN_GENERAL_CATEGORY_LL 5 #define UCDN_GENERAL_CATEGORY_LM 6 #define UCDN_GENERAL_CATEGORY_LO 7 #define UCDN_GENERAL_CATEGORY_LT 8 #define UCDN_GENERAL_CATEGORY_LU 9 #define UCDN_GENERAL_CATEGORY_MC 10 #define UCDN_GENERAL_CATEGORY_ME 11 #define UCDN_GENERAL_CATEGORY_MN 12 #define UCDN_GENERAL_CATEGORY_ND 13 #define UCDN_GENERAL_CATEGORY_NL 14 #define UCDN_GENERAL_CATEGORY_NO 15 #define UCDN_GENERAL_CATEGORY_PC 16 #define UCDN_GENERAL_CATEGORY_PD 17 #define UCDN_GENERAL_CATEGORY_PE 18 #define UCDN_GENERAL_CATEGORY_PF 19 #define UCDN_GENERAL_CATEGORY_PI 20 #define UCDN_GENERAL_CATEGORY_PO 21 #define UCDN_GENERAL_CATEGORY_PS 22 #define UCDN_GENERAL_CATEGORY_SC 23 #define UCDN_GENERAL_CATEGORY_SK 24 #define UCDN_GENERAL_CATEGORY_SM 25 #define UCDN_GENERAL_CATEGORY_SO 26 #define UCDN_GENERAL_CATEGORY_ZL 27 #define UCDN_GENERAL_CATEGORY_ZP 28 #define UCDN_GENERAL_CATEGORY_ZS 29 #define UCDN_BIDI_CLASS_L 0 #define UCDN_BIDI_CLASS_LRE 1 #define UCDN_BIDI_CLASS_LRO 2 #define UCDN_BIDI_CLASS_R 3 #define UCDN_BIDI_CLASS_AL 4 #define UCDN_BIDI_CLASS_RLE 5 #define UCDN_BIDI_CLASS_RLO 6 #define UCDN_BIDI_CLASS_PDF 7 #define UCDN_BIDI_CLASS_EN 8 #define UCDN_BIDI_CLASS_ES 9 #define UCDN_BIDI_CLASS_ET 10 #define UCDN_BIDI_CLASS_AN 11 #define UCDN_BIDI_CLASS_CS 12 #define UCDN_BIDI_CLASS_NSM 13 #define UCDN_BIDI_CLASS_BN 14 #define UCDN_BIDI_CLASS_B 15 #define UCDN_BIDI_CLASS_S 16 #define UCDN_BIDI_CLASS_WS 17 #define UCDN_BIDI_CLASS_ON 18 /** * Return version of the Unicode database. * * @return Unicode database version */ const char *ucdn_get_unicode_version(void); /** * Get combining class of a codepoint. * * @param code Unicode codepoint * @return combining class value, as defined in UAX#44 */ int ucdn_get_combining_class(uint32_t code); /** * Get east-asian width of a codepoint. * * @param code Unicode codepoint * @return value according to UCDN_EAST_ASIAN_* and as defined in UAX#11. */ int ucdn_get_east_asian_width(uint32_t code); /** * Get general category of a codepoint. * * @param code Unicode codepoint * @return value according to UCDN_GENERAL_CATEGORY_* and as defined in * UAX#44. */ int ucdn_get_general_category(uint32_t code); /** * Get bidirectional class of a codepoint. * * @param code Unicode codepoint * @return value according to UCDN_BIDI_CLASS_* and as defined in UAX#44. */ int ucdn_get_bidi_class(uint32_t code); /** * Get script of a codepoint. * * @param code Unicode codepoint * @return value according to UCDN_SCRIPT_* and as defined in UAX#24. */ int ucdn_get_script(uint32_t code); /** * Check if codepoint can be mirrored. * * @param code Unicode codepoint * @return 1 if mirrored character exists, otherwise 0 */ int ucdn_get_mirrored(uint32_t code); /** * Mirror a codepoint. * * @param code Unicode codepoint * @return mirrored codepoint or the original codepoint if no * mirrored character exists */ uint32_t ucdn_mirror(uint32_t code); /** * Pairwise canonical decomposition of a codepoint. This includes * Hangul Jamo decomposition (see chapter 3.12 of the Unicode core * specification). * * Hangul is decomposed into L and V jamos for LV forms, and an * LV precomposed syllable and a T jamo for LVT forms. * * @param code Unicode codepoint * @param a filled with first codepoint of decomposition * @param b filled with second codepoint of decomposition, or 0 * @return success */ int ucdn_decompose(uint32_t code, uint32_t *a, uint32_t *b); /** * Compatibility decomposition of a codepoint. * * @param code Unicode codepoint * @param decomposed filled with decomposition, must be able to hold 18 * characters * @return length of decomposition or 0 in case none exists */ int ucdn_compat_decompose(uint32_t code, uint32_t *decomposed); /** * Pairwise canonical composition of two codepoints. This includes * Hangul Jamo composition (see chapter 3.12 of the Unicode core * specification). * * Hangul composition expects either L and V jamos, or an LV * precomposed syllable and a T jamo. This is exactly the inverse * of pairwise Hangul decomposition. * * @param code filled with composition * @param a first codepoint * @param b second codepoint * @return success */ int ucdn_compose(uint32_t *code, uint32_t a, uint32_t b); HB_END_HEADER #endif
{ "content_hash": "38b5a28554219b31cdf62aa02cf56d8e", "timestamp": "", "source": "github", "line_count": 295, "max_line_length": 73, "avg_line_length": 28.769491525423728, "alnum_prop": 0.7654059149287145, "repo_name": "indashnet/InDashNet.Open.UN2000", "id": "802f044a8bbeda07e903faacd961dc6f406b7af4", "size": "9281", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "android/external/harfbuzz_ng/src/hb-ucdn/ucdn.h", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package cache import ( "fmt" "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/apps" "k8s.io/kubernetes/pkg/apis/batch" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/labels" ) // TODO: generate these classes and methods for all resources of interest using // a script. Can use "go generate" once 1.4 is supported by all users. // StoreToPodLister makes a Store have the List method of the client.PodInterface // The Store must contain (only) Pods. // // Example: // s := cache.NewStore() // lw := cache.ListWatch{Client: c, FieldSelector: sel, Resource: "pods"} // r := cache.NewReflector(lw, &api.Pod{}, s).Run() // l := StoreToPodLister{s} // l.List() type StoreToPodLister struct { Indexer } // Please note that selector is filtering among the pods that have gotten into // the store; there may have been some filtering that already happened before // that. // // TODO: converge on the interface in pkg/client. func (s *StoreToPodLister) List(selector labels.Selector) (pods []*api.Pod, err error) { // TODO: it'd be great to just call // s.Pods(api.NamespaceAll).List(selector), however then we'd have to // remake the list.Items as a []*api.Pod. So leave this separate for // now. for _, m := range s.Indexer.List() { pod := m.(*api.Pod) if selector.Matches(labels.Set(pod.Labels)) { pods = append(pods, pod) } } return pods, nil } // Pods is taking baby steps to be more like the api in pkg/client func (s *StoreToPodLister) Pods(namespace string) storePodsNamespacer { return storePodsNamespacer{s.Indexer, namespace} } type storePodsNamespacer struct { indexer Indexer namespace string } // Please note that selector is filtering among the pods that have gotten into // the store; there may have been some filtering that already happened before // that. func (s storePodsNamespacer) List(selector labels.Selector) (api.PodList, error) { pods := api.PodList{} if s.namespace == api.NamespaceAll { for _, m := range s.indexer.List() { pod := m.(*api.Pod) if selector.Matches(labels.Set(pod.Labels)) { pods.Items = append(pods.Items, *pod) } } return pods, nil } key := &api.Pod{ObjectMeta: api.ObjectMeta{Namespace: s.namespace}} items, err := s.indexer.Index(NamespaceIndex, key) if err != nil { // Ignore error; do slow search without index. glog.Warningf("can not retrieve list of objects using index : %v", err) for _, m := range s.indexer.List() { pod := m.(*api.Pod) if s.namespace == pod.Namespace && selector.Matches(labels.Set(pod.Labels)) { pods.Items = append(pods.Items, *pod) } } return pods, nil } for _, m := range items { pod := m.(*api.Pod) if selector.Matches(labels.Set(pod.Labels)) { pods.Items = append(pods.Items, *pod) } } return pods, nil } func (s storePodsNamespacer) Get(name string) (*api.Pod, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(api.Resource("pod"), name) } return obj.(*api.Pod), nil } // Exists returns true if a pod matching the namespace/name of the given pod exists in the store. func (s *StoreToPodLister) Exists(pod *api.Pod) (bool, error) { _, exists, err := s.Indexer.Get(pod) if err != nil { return false, err } return exists, nil } // NodeConditionPredicate is a function that indicates whether the given node's conditions meet // some set of criteria defined by the function. type NodeConditionPredicate func(node api.Node) bool // StoreToNodeLister makes a Store have the List method of the client.NodeInterface // The Store must contain (only) Nodes. type StoreToNodeLister struct { Store } func (s *StoreToNodeLister) List() (machines api.NodeList, err error) { for _, m := range s.Store.List() { machines.Items = append(machines.Items, *(m.(*api.Node))) } return machines, nil } // NodeCondition returns a storeToNodeConditionLister func (s *StoreToNodeLister) NodeCondition(predicate NodeConditionPredicate) storeToNodeConditionLister { // TODO: Move this filtering server side. Currently our selectors don't facilitate searching through a list so we // have the reflector filter out the Unschedulable field and sift through node conditions in the lister. return storeToNodeConditionLister{s.Store, predicate} } // storeToNodeConditionLister filters and returns nodes matching the given type and status from the store. type storeToNodeConditionLister struct { store Store predicate NodeConditionPredicate } // List returns a list of nodes that match the conditions defined by the predicate functions in the storeToNodeConditionLister. func (s storeToNodeConditionLister) List() (nodes api.NodeList, err error) { for _, m := range s.store.List() { node := *m.(*api.Node) if s.predicate(node) { nodes.Items = append(nodes.Items, node) } else { glog.V(5).Infof("Node %s matches none of the conditions", node.Name) } } return } // StoreToReplicationControllerLister gives a store List and Exists methods. The store must contain only ReplicationControllers. type StoreToReplicationControllerLister struct { Indexer } // Exists checks if the given rc exists in the store. func (s *StoreToReplicationControllerLister) Exists(controller *api.ReplicationController) (bool, error) { _, exists, err := s.Indexer.Get(controller) if err != nil { return false, err } return exists, nil } // StoreToReplicationControllerLister lists all controllers in the store. // TODO: converge on the interface in pkg/client func (s *StoreToReplicationControllerLister) List() (controllers []api.ReplicationController, err error) { for _, c := range s.Indexer.List() { controllers = append(controllers, *(c.(*api.ReplicationController))) } return controllers, nil } func (s *StoreToReplicationControllerLister) ReplicationControllers(namespace string) storeReplicationControllersNamespacer { return storeReplicationControllersNamespacer{s.Indexer, namespace} } type storeReplicationControllersNamespacer struct { indexer Indexer namespace string } func (s storeReplicationControllersNamespacer) Get(name string) (*api.ReplicationController, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(api.Resource("replicationcontroller"), name) } return obj.(*api.ReplicationController), nil } func (s storeReplicationControllersNamespacer) List(selector labels.Selector) ([]api.ReplicationController, error) { controllers := []api.ReplicationController{} if s.namespace == api.NamespaceAll { for _, m := range s.indexer.List() { rc := *(m.(*api.ReplicationController)) if selector.Matches(labels.Set(rc.Labels)) { controllers = append(controllers, rc) } } return controllers, nil } key := &api.ReplicationController{ObjectMeta: api.ObjectMeta{Namespace: s.namespace}} items, err := s.indexer.Index(NamespaceIndex, key) if err != nil { // Ignore error; do slow search without index. glog.Warningf("can not retrieve list of objects using index : %v", err) for _, m := range s.indexer.List() { rc := *(m.(*api.ReplicationController)) if s.namespace == rc.Namespace && selector.Matches(labels.Set(rc.Labels)) { controllers = append(controllers, rc) } } return controllers, nil } for _, m := range items { rc := *(m.(*api.ReplicationController)) if selector.Matches(labels.Set(rc.Labels)) { controllers = append(controllers, rc) } } return controllers, nil } // GetPodControllers returns a list of replication controllers managing a pod. Returns an error only if no matching controllers are found. func (s *StoreToReplicationControllerLister) GetPodControllers(pod *api.Pod) (controllers []api.ReplicationController, err error) { var selector labels.Selector var rc api.ReplicationController if len(pod.Labels) == 0 { err = fmt.Errorf("no controllers found for pod %v because it has no labels", pod.Name) return } key := &api.ReplicationController{ObjectMeta: api.ObjectMeta{Namespace: pod.Namespace}} items, err := s.Indexer.Index(NamespaceIndex, key) if err != nil { return } for _, m := range items { rc = *m.(*api.ReplicationController) labelSet := labels.Set(rc.Spec.Selector) selector = labels.Set(rc.Spec.Selector).AsSelector() // If an rc with a nil or empty selector creeps in, it should match nothing, not everything. if labelSet.AsSelector().Empty() || !selector.Matches(labels.Set(pod.Labels)) { continue } controllers = append(controllers, rc) } if len(controllers) == 0 { err = fmt.Errorf("could not find controller for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return } // StoreToDeploymentLister gives a store List and Exists methods. The store must contain only Deployments. type StoreToDeploymentLister struct { Store } // Exists checks if the given deployment exists in the store. func (s *StoreToDeploymentLister) Exists(deployment *extensions.Deployment) (bool, error) { _, exists, err := s.Store.Get(deployment) if err != nil { return false, err } return exists, nil } // StoreToDeploymentLister lists all deployments in the store. // TODO: converge on the interface in pkg/client func (s *StoreToDeploymentLister) List() (deployments []extensions.Deployment, err error) { for _, c := range s.Store.List() { deployments = append(deployments, *(c.(*extensions.Deployment))) } return deployments, nil } // GetDeploymentsForReplicaSet returns a list of deployments managing a replica set. Returns an error only if no matching deployments are found. func (s *StoreToDeploymentLister) GetDeploymentsForReplicaSet(rs *extensions.ReplicaSet) (deployments []extensions.Deployment, err error) { var d extensions.Deployment if len(rs.Labels) == 0 { err = fmt.Errorf("no deployments found for ReplicaSet %v because it has no labels", rs.Name) return } // TODO: MODIFY THIS METHOD so that it checks for the podTemplateSpecHash label for _, m := range s.Store.List() { d = *m.(*extensions.Deployment) if d.Namespace != rs.Namespace { continue } selector, err := unversioned.LabelSelectorAsSelector(d.Spec.Selector) if err != nil { return nil, fmt.Errorf("invalid label selector: %v", err) } // If a deployment with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(rs.Labels)) { continue } deployments = append(deployments, d) } if len(deployments) == 0 { err = fmt.Errorf("could not find deployments set for ReplicaSet %s in namespace %s with labels: %v", rs.Name, rs.Namespace, rs.Labels) } return } // StoreToReplicaSetLister gives a store List and Exists methods. The store must contain only ReplicaSets. type StoreToReplicaSetLister struct { Store } // Exists checks if the given ReplicaSet exists in the store. func (s *StoreToReplicaSetLister) Exists(rs *extensions.ReplicaSet) (bool, error) { _, exists, err := s.Store.Get(rs) if err != nil { return false, err } return exists, nil } // List lists all ReplicaSets in the store. // TODO: converge on the interface in pkg/client func (s *StoreToReplicaSetLister) List() (rss []extensions.ReplicaSet, err error) { for _, rs := range s.Store.List() { rss = append(rss, *(rs.(*extensions.ReplicaSet))) } return rss, nil } type storeReplicaSetsNamespacer struct { store Store namespace string } func (s storeReplicaSetsNamespacer) List(selector labels.Selector) (rss []extensions.ReplicaSet, err error) { for _, c := range s.store.List() { rs := *(c.(*extensions.ReplicaSet)) if s.namespace == api.NamespaceAll || s.namespace == rs.Namespace { if selector.Matches(labels.Set(rs.Labels)) { rss = append(rss, rs) } } } return } func (s storeReplicaSetsNamespacer) Get(name string) (*extensions.ReplicaSet, error) { obj, exists, err := s.store.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(extensions.Resource("replicaset"), name) } return obj.(*extensions.ReplicaSet), nil } func (s *StoreToReplicaSetLister) ReplicaSets(namespace string) storeReplicaSetsNamespacer { return storeReplicaSetsNamespacer{s.Store, namespace} } // GetPodReplicaSets returns a list of ReplicaSets managing a pod. Returns an error only if no matching ReplicaSets are found. func (s *StoreToReplicaSetLister) GetPodReplicaSets(pod *api.Pod) (rss []extensions.ReplicaSet, err error) { var selector labels.Selector var rs extensions.ReplicaSet if len(pod.Labels) == 0 { err = fmt.Errorf("no ReplicaSets found for pod %v because it has no labels", pod.Name) return } for _, m := range s.Store.List() { rs = *m.(*extensions.ReplicaSet) if rs.Namespace != pod.Namespace { continue } selector, err = unversioned.LabelSelectorAsSelector(rs.Spec.Selector) if err != nil { err = fmt.Errorf("invalid selector: %v", err) return } // If a ReplicaSet with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) { continue } rss = append(rss, rs) } if len(rss) == 0 { err = fmt.Errorf("could not find ReplicaSet for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return } // StoreToDaemonSetLister gives a store List and Exists methods. The store must contain only DaemonSets. type StoreToDaemonSetLister struct { Store } // Exists checks if the given daemon set exists in the store. func (s *StoreToDaemonSetLister) Exists(ds *extensions.DaemonSet) (bool, error) { _, exists, err := s.Store.Get(ds) if err != nil { return false, err } return exists, nil } // List lists all daemon sets in the store. // TODO: converge on the interface in pkg/client func (s *StoreToDaemonSetLister) List() (dss extensions.DaemonSetList, err error) { for _, c := range s.Store.List() { dss.Items = append(dss.Items, *(c.(*extensions.DaemonSet))) } return dss, nil } // GetPodDaemonSets returns a list of daemon sets managing a pod. // Returns an error if and only if no matching daemon sets are found. func (s *StoreToDaemonSetLister) GetPodDaemonSets(pod *api.Pod) (daemonSets []extensions.DaemonSet, err error) { var selector labels.Selector var daemonSet extensions.DaemonSet if len(pod.Labels) == 0 { err = fmt.Errorf("no daemon sets found for pod %v because it has no labels", pod.Name) return } for _, m := range s.Store.List() { daemonSet = *m.(*extensions.DaemonSet) if daemonSet.Namespace != pod.Namespace { continue } selector, err = unversioned.LabelSelectorAsSelector(daemonSet.Spec.Selector) if err != nil { // this should not happen if the DaemonSet passed validation return nil, err } // If a daemonSet with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) { continue } daemonSets = append(daemonSets, daemonSet) } if len(daemonSets) == 0 { err = fmt.Errorf("could not find daemon set for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return } // StoreToServiceLister makes a Store that has the List method of the client.ServiceInterface // The Store must contain (only) Services. type StoreToServiceLister struct { Store } func (s *StoreToServiceLister) List() (services api.ServiceList, err error) { for _, m := range s.Store.List() { services.Items = append(services.Items, *(m.(*api.Service))) } return services, nil } // TODO: Move this back to scheduler as a helper function that takes a Store, // rather than a method of StoreToServiceLister. func (s *StoreToServiceLister) GetPodServices(pod *api.Pod) (services []api.Service, err error) { var selector labels.Selector var service api.Service for _, m := range s.Store.List() { service = *m.(*api.Service) // consider only services that are in the same namespace as the pod if service.Namespace != pod.Namespace { continue } if service.Spec.Selector == nil { // services with nil selectors match nothing, not everything. continue } selector = labels.Set(service.Spec.Selector).AsSelector() if selector.Matches(labels.Set(pod.Labels)) { services = append(services, service) } } if len(services) == 0 { err = fmt.Errorf("could not find service for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return } // StoreToEndpointsLister makes a Store that lists endpoints. type StoreToEndpointsLister struct { Store } // List lists all endpoints in the store. func (s *StoreToEndpointsLister) List() (services api.EndpointsList, err error) { for _, m := range s.Store.List() { services.Items = append(services.Items, *(m.(*api.Endpoints))) } return services, nil } // GetServiceEndpoints returns the endpoints of a service, matched on service name. func (s *StoreToEndpointsLister) GetServiceEndpoints(svc *api.Service) (ep api.Endpoints, err error) { for _, m := range s.Store.List() { ep = *m.(*api.Endpoints) if svc.Name == ep.Name && svc.Namespace == ep.Namespace { return ep, nil } } err = fmt.Errorf("could not find endpoints for service: %v", svc.Name) return } // StoreToJobLister gives a store List and Exists methods. The store must contain only Jobs. type StoreToJobLister struct { Store } // Exists checks if the given job exists in the store. func (s *StoreToJobLister) Exists(job *batch.Job) (bool, error) { _, exists, err := s.Store.Get(job) if err != nil { return false, err } return exists, nil } // StoreToJobLister lists all jobs in the store. func (s *StoreToJobLister) List() (jobs batch.JobList, err error) { for _, c := range s.Store.List() { jobs.Items = append(jobs.Items, *(c.(*batch.Job))) } return jobs, nil } // GetPodJobs returns a list of jobs managing a pod. Returns an error only if no matching jobs are found. func (s *StoreToJobLister) GetPodJobs(pod *api.Pod) (jobs []batch.Job, err error) { var selector labels.Selector var job batch.Job if len(pod.Labels) == 0 { err = fmt.Errorf("no jobs found for pod %v because it has no labels", pod.Name) return } for _, m := range s.Store.List() { job = *m.(*batch.Job) if job.Namespace != pod.Namespace { continue } selector, _ = unversioned.LabelSelectorAsSelector(job.Spec.Selector) if !selector.Matches(labels.Set(pod.Labels)) { continue } jobs = append(jobs, job) } if len(jobs) == 0 { err = fmt.Errorf("could not find jobs for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return } // Typed wrapper around a store of PersistentVolumes type StoreToPVFetcher struct { Store } // GetPersistentVolumeInfo returns cached data for the PersistentVolume 'id'. func (s *StoreToPVFetcher) GetPersistentVolumeInfo(id string) (*api.PersistentVolume, error) { o, exists, err := s.Get(&api.PersistentVolume{ObjectMeta: api.ObjectMeta{Name: id}}) if err != nil { return nil, fmt.Errorf("error retrieving PersistentVolume '%v' from cache: %v", id, err) } if !exists { return nil, fmt.Errorf("PersistentVolume '%v' not found", id) } return o.(*api.PersistentVolume), nil } // Typed wrapper around a store of PersistentVolumeClaims type StoreToPVCFetcher struct { Store } // GetPersistentVolumeClaimInfo returns cached data for the PersistentVolumeClaim 'id'. func (s *StoreToPVCFetcher) GetPersistentVolumeClaimInfo(namespace string, id string) (*api.PersistentVolumeClaim, error) { o, exists, err := s.Get(&api.PersistentVolumeClaim{ObjectMeta: api.ObjectMeta{Namespace: namespace, Name: id}}) if err != nil { return nil, fmt.Errorf("error retrieving PersistentVolumeClaim '%s/%s' from cache: %v", namespace, id, err) } if !exists { return nil, fmt.Errorf("PersistentVolumeClaim '%s/%s' not found", namespace, id) } return o.(*api.PersistentVolumeClaim), nil } // StoreToPetSetLister gives a store List and Exists methods. The store must contain only PetSets. type StoreToPetSetLister struct { Store } // Exists checks if the given PetSet exists in the store. func (s *StoreToPetSetLister) Exists(ps *apps.PetSet) (bool, error) { _, exists, err := s.Store.Get(ps) if err != nil { return false, err } return exists, nil } // List lists all PetSets in the store. func (s *StoreToPetSetLister) List() (psList []apps.PetSet, err error) { for _, ps := range s.Store.List() { psList = append(psList, *(ps.(*apps.PetSet))) } return psList, nil } type storePetSetsNamespacer struct { store Store namespace string } func (s *StoreToPetSetLister) PetSets(namespace string) storePetSetsNamespacer { return storePetSetsNamespacer{s.Store, namespace} } // GetPodPetSets returns a list of PetSets managing a pod. Returns an error only if no matching PetSets are found. func (s *StoreToPetSetLister) GetPodPetSets(pod *api.Pod) (psList []apps.PetSet, err error) { var selector labels.Selector var ps apps.PetSet if len(pod.Labels) == 0 { err = fmt.Errorf("no PetSets found for pod %v because it has no labels", pod.Name) return } for _, m := range s.Store.List() { ps = *m.(*apps.PetSet) if ps.Namespace != pod.Namespace { continue } selector, err = unversioned.LabelSelectorAsSelector(ps.Spec.Selector) if err != nil { err = fmt.Errorf("invalid selector: %v", err) return } // If a PetSet with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) { continue } psList = append(psList, ps) } if len(psList) == 0 { err = fmt.Errorf("could not find PetSet for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return }
{ "content_hash": "376db1a1fc0b822654f745261c6fea8c", "timestamp": "", "source": "github", "line_count": 692, "max_line_length": 144, "avg_line_length": 31.748554913294797, "alnum_prop": 0.7170232134729176, "repo_name": "xenserverarmy/ose-scanner", "id": "12351cfe5c2bdd586dc18e1927e67a7d804bfa79", "size": "22559", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "controller/vendor/k8s.io/kubernetes/pkg/client/cache/listers.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "152083" }, { "name": "Makefile", "bytes": "5276" }, { "name": "Roff", "bytes": "2082" }, { "name": "Shell", "bytes": "23821" } ], "symlink_target": "" }
<?php namespace SportTrackerConnector\Tests\Workout\Dumper\AbstractDumper; use org\bovigo\vfs\vfsStream; /** * Test for \SportTrackerConnector\Workout\Dumper\AbstractDumper. */ class AbstractDumperTest extends \PHPUnit_Framework_TestCase { /** * The root folder of vfsStream for testing. * * @var \org\bovigo\vfs\vfsStreamDirectory */ private $root; /** * Set up test environment. */ public function setUp() { $this->root = vfsStream::setup(); } /** * Test dump to file throws exception if file does not exist and the directory is not writable. */ public function testDumpToFileThrowsExceptionIfFileDoesNotExistAndTheDirectoryIsNotWritable() { $mock = $this->getMockForAbstractClass('SportTrackerConnector\Workout\Dumper\AbstractDumper'); $this->root->chmod(000); $file = vfsStream::url('root/workout.tst'); $workoutMock = $this->getMock('SportTrackerConnector\Workout\Workout'); $this->setExpectedException('InvalidArgumentException', 'Directory for output file "vfs://root/workout.tst" is not writable.'); $mock->dumpToFile($workoutMock, $file); } /** * Test dump to file throws exception if file is not writable. */ public function testDumpToFileThrowsExceptionIfFileIsNotWritable() { $mock = $this->getMockForAbstractClass('SportTrackerConnector\Workout\Dumper\AbstractDumper'); $file = vfsStream::url('root/workout.tst'); touch($file); chmod($file, 000); $workoutMock = $this->getMock('SportTrackerConnector\Workout\Workout'); $this->setExpectedException('InvalidArgumentException', 'The output file "vfs://root/workout.tst" is not writable.'); $mock->dumpToFile($workoutMock, $file); } /** * Test that dump to file will call dump to string. */ public function testDumpToFileCallsDumpToString() { $mock = $this->getMockBuilder('SportTrackerConnector\Workout\Dumper\AbstractDumper') ->setMethods(array('dumpToString')) ->getMockForAbstractClass(); $workoutMock = $this->getMock('SportTrackerConnector\Workout\Workout'); $fileMock = vfsStream::url('root/workout.tst'); $mock->expects($this->once())->method('dumpToString')->with($workoutMock)->will($this->returnValue('dumped content')); $mock->dumpToFile($workoutMock, $fileMock); $this->assertFileExists($fileMock); $this->assertSame('dumped content', file_get_contents($fileMock)); } }
{ "content_hash": "e234ab75cc038a577aa5c004602d4ab8", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 135, "avg_line_length": 31.5609756097561, "alnum_prop": 0.6638330757341576, "repo_name": "devuo/sports-tracker-connector", "id": "3d408ccfb9fcc1a9844ef76fbe7cbb3be56f534f", "size": "2588", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Tests/Workout/Dumper/AbstractDumper/AbstractDumperTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "65" }, { "name": "PHP", "bytes": "207006" } ], "symlink_target": "" }
function [nodeLabels] = UGM_Decode_Sample(nodePot, edgePot, edgeStruct,sampleFunc,varargin) % [nodeLabels] = UGM_Decode_Sample(nodePot, edgePot, % edgeStruct,sampleFunc,varargin) % % INPUT % nodePot(node,class) % edgePot(class,class,edge) where e is referenced by V,E (must be the same % between feature engine and inference engine) % % OUTPUT % nodeLabel(node) samples = sampleFunc(nodePot,edgePot,edgeStruct,varargin{:}); nSamples = size(samples,2); edgeEnds = edgeStruct.edgeEnds; maxPot = -inf; for s = 1:nSamples % Compute Potential of Configuration logPot = UGM_LogConfigurationPotential(samples(:,s),nodePot,edgePot,edgeEnds); % Record Max if logPot > maxPot maxPot = logPot; nodeLabels = samples(:,s); end end
{ "content_hash": "938c5f2bea7b3dbdf39fbc40032fcee1", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 92, "avg_line_length": 25.6, "alnum_prop": 0.7122395833333334, "repo_name": "shangliy/ee660", "id": "c59e288832638b131eed8bb2b8fca447a52a4d8b", "size": "768", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pmtksupportCopy/markSchmidt-9march2011/markSchmidt/UGM/decode/UGM_Decode_Sample.m", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "7515" }, { "name": "C", "bytes": "654077" }, { "name": "C++", "bytes": "241202" }, { "name": "CSS", "bytes": "16501" }, { "name": "FORTRAN", "bytes": "237793" }, { "name": "Groff", "bytes": "11025" }, { "name": "HTML", "bytes": "452787" }, { "name": "JavaScript", "bytes": "54587" }, { "name": "Limbo", "bytes": "18665" }, { "name": "M", "bytes": "60278" }, { "name": "Makefile", "bytes": "11329" }, { "name": "Mathematica", "bytes": "518" }, { "name": "Matlab", "bytes": "7867112" }, { "name": "Mercury", "bytes": "435" }, { "name": "Objective-C", "bytes": "502" }, { "name": "Perl", "bytes": "261" }, { "name": "Python", "bytes": "53630" }, { "name": "R", "bytes": "5191" }, { "name": "Shell", "bytes": "210" }, { "name": "TypeScript", "bytes": "32028" } ], "symlink_target": "" }
<?php class DefaultController extends YBackController { /** * Отображает товар по указанному идентификатору * @param integer $id Идинтификатор товар для отображения */ public function actionView($id) { $this->render('view', array('model' => $this->loadModel($id))); } /** * Создает новую модель товара. * Если создание прошло успешно - перенаправляет на просмотр. */ public function actionCreate() { $model = new Afisha; // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Afisha'])) { $model->attributes = $_POST['Afisha']; if ($model->save()) { $model->saveWithImage('image', $this->module->getUploadPath()); Yii::app()->user->setFlash( YFlashMessages::NOTICE_MESSAGE, Yii::t('AfishaModule.afisha', 'Запись добавлена!') ); if (!isset($_POST['submit-type'])) $this->redirect(array('update', 'id' => $model->id)); else $this->redirect(array($_POST['submit-type'])); } } $this->render('create', array('model' => $model)); } /** * Редактирование товара. * @param integer $id the ID of the model to be updated */ public function actionUpdate($id) { $model = $this->loadModel($id); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Afisha'])) { $image = $model->image; $model->attributes = $_POST['Afisha']; if ($model->save()) { $model->saveWithImage('image', $this->module->getUploadPath(), $image); Yii::app()->user->setFlash( YFlashMessages::NOTICE_MESSAGE, Yii::t('AfishaModule.afisha', 'Запись обновлена!') ); if (!isset($_POST['submit-type'])) $this->redirect(array('update', 'id' => $model->id)); else $this->redirect(array($_POST['submit-type'])); } } $this->render('update', array('model' => $model)); } /** * Удаяет модель товара из базы. * Если удаление прошло успешно - возвращется в index * @param integer $id идентификатор товара, который нужно удалить */ public function actionDelete($id) { if (Yii::app()->request->isPostRequest) { // поддерживаем удаление только из POST-запроса $this->loadModel($id)->delete(); Yii::app()->user->setFlash( YFlashMessages::NOTICE_MESSAGE, Yii::t('AfishaModule.afisha', 'Запись удалена!') ); // если это AJAX запрос ( кликнули удаление в админском grid view), мы не должны никуда редиректить if (!isset($_GET['ajax'])) $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('index')); } else throw new CHttpException(400, Yii::t('AfishaModule.afishag', 'Неверный запрос. Пожалуйста, больше не повторяйте такие запросы!')); } /** * Управление товарами. */ public function actionIndex() { $model = new Afisha('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Afisha'])) $model->attributes = $_GET['Afisha']; $this->render('index', array('model' => $model)); } /** * Возвращает модель по указанному идентификатору * Если модель не будет найдена - возникнет HTTP-исключение. * @param integer идентификатор нужной модели */ public function loadModel($id) { $model = Afisha::model()->findByPk($id); if ($model === null) throw new CHttpException(404, Yii::t('AfishaModule.afisha', 'Запрошенная страница не найдена!')); return $model; } /** * Производит AJAX-валидацию * @param CModel модель, которую необходимо валидировать */ protected function performAjaxValidation($model) { if (isset($_POST['ajax']) && $_POST['ajax'] === 'afisha-form') { echo CActiveForm::validate($model); Yii::app()->end(); } } }
{ "content_hash": "251d303dcc17aaa5179ca5a7e61b59c8", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 142, "avg_line_length": 31.53846153846154, "alnum_prop": 0.5305986696230599, "repo_name": "itrustam/cupon", "id": "5f087fa49c80816cacf34155ad37cc855f799788", "size": "5183", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "protected/modules/afisha/controllers/DefaultController.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "JavaScript", "bytes": "6890128" }, { "name": "PHP", "bytes": "25089038" }, { "name": "Ruby", "bytes": "2768" }, { "name": "Shell", "bytes": "5912" } ], "symlink_target": "" }
package com.cloud.consoleproxy; import java.util.HashMap; import java.util.Map; import com.cloud.consoleproxy.util.Logger; public class ConsoleProxyHttpHandlerHelper { private static final Logger s_logger = Logger.getLogger(ConsoleProxyHttpHandlerHelper.class); public static Map<String, String> getQueryMap(String query) { String[] params = query.split("&"); Map<String, String> map = new HashMap<String, String>(); for (String param : params) { String[] paramTokens = param.split("="); if (paramTokens != null && paramTokens.length == 2) { String name = param.split("=")[0]; String value = param.split("=")[1]; map.put(name, value); } else if (paramTokens.length == 3) { // very ugly, added for Xen tunneling url String name = paramTokens[0]; String value = paramTokens[1] + "=" + paramTokens[2]; map.put(name, value); } else { if (s_logger.isDebugEnabled()) s_logger.debug("Invalid paramemter in URL found. param: " + param); } } // This is a ugly solution for now. We will do encryption/decryption translation // here to make it transparent to rest of the code. if (map.get("token") != null) { ConsoleProxyPasswordBasedEncryptor encryptor = new ConsoleProxyPasswordBasedEncryptor(ConsoleProxy.getEncryptorPassword()); ConsoleProxyClientParam param = encryptor.decryptObject(ConsoleProxyClientParam.class, map.get("token")); // make sure we get information from token only guardUserInput(map); if (param != null) { if (param.getClientHostAddress() != null) { s_logger.debug("decode token. host: " + param.getClientHostAddress()); map.put("host", param.getClientHostAddress()); } else { s_logger.error("decode token. host info is not found!"); } if (param.getClientHostPort() != 0) { s_logger.debug("decode token. port: " + param.getClientHostPort()); map.put("port", String.valueOf(param.getClientHostPort())); } else { s_logger.error("decode token. port info is not found!"); } if (param.getClientTag() != null) { s_logger.debug("decode token. tag: " + param.getClientTag()); map.put("tag", param.getClientTag()); } else { s_logger.error("decode token. tag info is not found!"); } if (param.getClientHostPassword() != null) { map.put("sid", param.getClientHostPassword()); } else { s_logger.error("decode token. sid info is not found!"); } if (param.getClientTunnelUrl() != null) map.put("consoleurl", param.getClientTunnelUrl()); if (param.getClientTunnelSession() != null) map.put("sessionref", param.getClientTunnelSession()); if (param.getTicket() != null) map.put("ticket", param.getTicket()); if (param.getLocale() != null) map.put("locale", param.getLocale()); if (param.getHypervHost() != null) map.put("hypervHost", param.getHypervHost()); if (param.getUsername() != null) map.put("username", param.getUsername()); if (param.getPassword() != null) map.put("password", param.getPassword()); } else { s_logger.error("Unable to decode token"); } } else { // we no longer accept information from parameter other than token guardUserInput(map); } return map; } private static void guardUserInput(Map<String, String> map) { map.remove("host"); map.remove("port"); map.remove("tag"); map.remove("sid"); map.remove("consoleurl"); map.remove("sessionref"); map.remove("ticket"); map.remove("locale"); map.remove("hypervHost"); map.remove("username"); map.remove("password"); } }
{ "content_hash": "dd9e75788c9ea7e719f81e2785e3a26b", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 135, "avg_line_length": 43.88235294117647, "alnum_prop": 0.5297140303842717, "repo_name": "GabrielBrascher/cloudstack", "id": "51a703ae4b4a23c4460bfefaa98022206f9ceb53", "size": "5277", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "services/console-proxy/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyHttpHandlerHelper.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "9979" }, { "name": "C#", "bytes": "2356211" }, { "name": "CSS", "bytes": "42504" }, { "name": "Dockerfile", "bytes": "4189" }, { "name": "FreeMarker", "bytes": "4887" }, { "name": "Groovy", "bytes": "146420" }, { "name": "HTML", "bytes": "53626" }, { "name": "Java", "bytes": "38859783" }, { "name": "JavaScript", "bytes": "995137" }, { "name": "Less", "bytes": "28250" }, { "name": "Makefile", "bytes": "871" }, { "name": "Python", "bytes": "12977377" }, { "name": "Ruby", "bytes": "22732" }, { "name": "Shell", "bytes": "744445" }, { "name": "Vue", "bytes": "2012353" }, { "name": "XSLT", "bytes": "57835" } ], "symlink_target": "" }
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>statsmodels.base.distributed_estimation.DistributedResults.bse &#8212; statsmodels v0.10.2 documentation</title> <link rel="stylesheet" href="../_static/nature.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" type="text/css" href="../_static/graphviz.css" /> <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/language_data.js"></script> <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> <link rel="shortcut icon" href="../_static/statsmodels_hybi_favico.ico"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="statsmodels.base.distributed_estimation.DistributedResults.conf_int" href="statsmodels.base.distributed_estimation.DistributedResults.conf_int.html" /> <link rel="prev" title="statsmodels.base.distributed_estimation.DistributedResults" href="statsmodels.base.distributed_estimation.DistributedResults.html" /> <link rel="stylesheet" href="../_static/examples.css" type="text/css" /> <link rel="stylesheet" href="../_static/facebox.css" type="text/css" /> <script type="text/javascript" src="../_static/scripts.js"> </script> <script type="text/javascript" src="../_static/facebox.js"> </script> <script type="text/javascript"> $.facebox.settings.closeImage = "../_static/closelabel.png" $.facebox.settings.loadingImage = "../_static/loading.gif" </script> <script> $(document).ready(function() { $.getJSON("../../versions.json", function(versions) { var dropdown = document.createElement("div"); dropdown.className = "dropdown"; var button = document.createElement("button"); button.className = "dropbtn"; button.innerHTML = "Other Versions"; var content = document.createElement("div"); content.className = "dropdown-content"; dropdown.appendChild(button); dropdown.appendChild(content); $(".header").prepend(dropdown); for (var i = 0; i < versions.length; i++) { if (versions[i].substring(0, 1) == "v") { versions[i] = [versions[i], versions[i].substring(1)]; } else { versions[i] = [versions[i], versions[i]]; }; }; for (var i = 0; i < versions.length; i++) { var a = document.createElement("a"); a.innerHTML = versions[i][1]; a.href = "../../" + versions[i][0] + "/index.html"; a.title = versions[i][1]; $(".dropdown-content").append(a); }; }); }); </script> </head><body> <div class="headerwrap"> <div class = "header"> <a href = "../index.html"> <img src="../_static/statsmodels_hybi_banner.png" alt="Logo" style="padding-left: 15px"/></a> </div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="statsmodels.base.distributed_estimation.DistributedResults.conf_int.html" title="statsmodels.base.distributed_estimation.DistributedResults.conf_int" accesskey="N">next</a> |</li> <li class="right" > <a href="statsmodels.base.distributed_estimation.DistributedResults.html" title="statsmodels.base.distributed_estimation.DistributedResults" accesskey="P">previous</a> |</li> <li><a href ="../install.html">Install</a></li> &nbsp;|&nbsp; <li><a href="https://groups.google.com/forum/?hl=en#!forum/pystatsmodels">Support</a></li> &nbsp;|&nbsp; <li><a href="https://github.com/statsmodels/statsmodels/issues">Bugs</a></li> &nbsp;|&nbsp; <li><a href="../dev/index.html">Develop</a></li> &nbsp;|&nbsp; <li><a href="../examples/index.html">Examples</a></li> &nbsp;|&nbsp; <li><a href="../faq.html">FAQ</a></li> &nbsp;|&nbsp; <li class="nav-item nav-item-1"><a href="../large_data.html" >Working with Large Data Sets</a> |</li> <li class="nav-item nav-item-2"><a href="statsmodels.base.distributed_estimation.DistributedResults.html" accesskey="U">statsmodels.base.distributed_estimation.DistributedResults</a> |</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="statsmodels-base-distributed-estimation-distributedresults-bse"> <h1>statsmodels.base.distributed_estimation.DistributedResults.bse<a class="headerlink" href="#statsmodels-base-distributed-estimation-distributedresults-bse" title="Permalink to this headline">¶</a></h1> <p>method</p> <dl class="method"> <dt id="statsmodels.base.distributed_estimation.DistributedResults.bse"> <code class="sig-prename descclassname">DistributedResults.</code><code class="sig-name descname">bse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#statsmodels.base.distributed_estimation.DistributedResults.bse" title="Permalink to this definition">¶</a></dt> <dd><p>The standard errors of the parameter estimates.</p> </dd></dl> </div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <h4>Previous topic</h4> <p class="topless"><a href="statsmodels.base.distributed_estimation.DistributedResults.html" title="previous chapter">statsmodels.base.distributed_estimation.DistributedResults</a></p> <h4>Next topic</h4> <p class="topless"><a href="statsmodels.base.distributed_estimation.DistributedResults.conf_int.html" title="next chapter">statsmodels.base.distributed_estimation.DistributedResults.conf_int</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/generated/statsmodels.base.distributed_estimation.DistributedResults.bse.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" /> <input type="submit" value="Go" /> </form> </div> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="footer" role="contentinfo"> &#169; Copyright 2009-2018, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.1. </div> </body> </html>
{ "content_hash": "46c54baa47f0fbf2d4d38477bf8fbc7f", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 312, "avg_line_length": 46.6280487804878, "alnum_prop": 0.6530665620504773, "repo_name": "statsmodels/statsmodels.github.io", "id": "a3da3601bc0824694afd0fbb027be40839119398", "size": "7651", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "v0.10.2/generated/statsmodels.base.distributed_estimation.DistributedResults.bse.html", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
namespace wgt { QtMenuBar::QtMenuBar( QMenuBar & qMenuBar, const char * windowId ) : QtMenu( qMenuBar, windowId ) , qMenuBar_( qMenuBar ) { } void QtMenuBar::addAction( IAction & action, const char* path ) { auto qAction = getQAction(action); if ( qAction == nullptr ) { qAction = createQAction( action ); } assert(qAction != nullptr); path = relativePath( path ); if (path == nullptr || strlen( path ) == 0) { path = action.text(); } auto tok = strchr( path, '.' ); auto menuPath = tok != nullptr ? QString::fromUtf8( path, tok - path ) : path; QMenu * menu = qMenuBar_.findChild<QMenu*>( menuPath, Qt::FindDirectChildrenOnly ); if (menu == nullptr) { menu = qMenuBar_.addMenu( menuPath ); menu->setObjectName( menuPath ); } path = tok != nullptr ? tok + 1 : nullptr; QtMenu::addMenuAction( *menu, *qAction, path ); qMenuBar_.repaint(); } void QtMenuBar::removeAction( IAction & action ) { auto qAction = getQAction( action ); if ( qAction == nullptr ) { NGT_ERROR_MSG("Target action '%s' '%s' does not exist\n", action.text(), StringUtils::join(action.paths(), ';').c_str()); return; } auto menus = qMenuBar_.findChildren<QMenu*>( QString(), Qt::FindDirectChildrenOnly ); for (auto & menu : menus) { QtMenu::removeMenuAction( *menu, *qAction ); if (menu->isEmpty()) { delete menu; } } destroyQAction( action ); } } // end namespace wgt
{ "content_hash": "11e2ec79ab51f3fc4190153c05c17b3b", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 123, "avg_line_length": 23.71186440677966, "alnum_prop": 0.6461758398856325, "repo_name": "dava/wgtf", "id": "f55601697a139745dafab8875d94eeb04c4ed6c2", "size": "1592", "binary": false, "copies": "1", "ref": "refs/heads/dava/development", "path": "src/core/lib/core_qt_common/qt_menu_bar.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "3332" }, { "name": "C", "bytes": "586" }, { "name": "C++", "bytes": "4348584" }, { "name": "CMake", "bytes": "198187" }, { "name": "JavaScript", "bytes": "135317" }, { "name": "Makefile", "bytes": "936" }, { "name": "Python", "bytes": "32510" }, { "name": "QML", "bytes": "1293442" }, { "name": "Shell", "bytes": "8109" } ], "symlink_target": "" }
// Copyright 2018 The Bazel Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.devtools.build.lib.skylarkbuildapi.android; import com.google.common.collect.ImmutableMap; import com.google.devtools.build.lib.skylarkbuildapi.android.AndroidApplicationResourceInfoApi.AndroidApplicationResourceInfoApiProvider; import com.google.devtools.build.lib.skylarkbuildapi.android.AndroidDeviceBrokerInfoApi.AndroidDeviceBrokerInfoApiProvider; import com.google.devtools.build.lib.skylarkbuildapi.android.AndroidInstrumentationInfoApi.AndroidInstrumentationInfoApiProvider; import com.google.devtools.build.lib.skylarkbuildapi.android.AndroidNativeLibsInfoApi.AndroidNativeLibsInfoApiProvider; import com.google.devtools.build.lib.skylarkbuildapi.android.AndroidResourcesInfoApi.AndroidResourcesInfoApiProvider; import com.google.devtools.build.lib.skylarkbuildapi.android.ApkInfoApi.ApkInfoApiProvider; import com.google.devtools.build.lib.skylarkbuildapi.core.Bootstrap; import com.google.devtools.build.lib.syntax.FlagGuardedValue; import com.google.devtools.build.lib.syntax.StarlarkSemantics.FlagIdentifier; /** {@link Bootstrap} for Starlark objects related to Android rules. */ public class AndroidBootstrap implements Bootstrap { private final AndroidSkylarkCommonApi<?, ?> androidCommon; private final ApkInfoApiProvider apkInfoProvider; private final AndroidInstrumentationInfoApiProvider<?> androidInstrumentationInfoProvider; private final AndroidDeviceBrokerInfoApiProvider androidDeviceBrokerInfoProvider; private final AndroidResourcesInfoApi.AndroidResourcesInfoApiProvider<?, ?, ?> androidResourcesInfoProvider; private final AndroidNativeLibsInfoApiProvider androidNativeLibsInfoProvider; private final AndroidApplicationResourceInfoApiProvider<?> androidApplicationResourceInfoApiProvider; public AndroidBootstrap( AndroidSkylarkCommonApi<?, ?> androidCommon, ApkInfoApiProvider apkInfoProvider, AndroidInstrumentationInfoApiProvider<?> androidInstrumentationInfoProvider, AndroidDeviceBrokerInfoApiProvider androidDeviceBrokerInfoProvider, AndroidResourcesInfoApiProvider<?, ?, ?> androidResourcesInfoProvider, AndroidNativeLibsInfoApiProvider androidNativeLibsInfoProvider, AndroidApplicationResourceInfoApiProvider<?> androidApplicationResourceInfoApiProvider) { this.androidCommon = androidCommon; this.apkInfoProvider = apkInfoProvider; this.androidInstrumentationInfoProvider = androidInstrumentationInfoProvider; this.androidDeviceBrokerInfoProvider = androidDeviceBrokerInfoProvider; this.androidResourcesInfoProvider = androidResourcesInfoProvider; this.androidNativeLibsInfoProvider = androidNativeLibsInfoProvider; this.androidApplicationResourceInfoApiProvider = androidApplicationResourceInfoApiProvider; } @Override public void addBindingsToBuilder(ImmutableMap.Builder<String, Object> builder) { // TODO: Make an incompatible change flag to hide android_common behind // --experimental_google_legacy_api. // Rationale: android_common module contains commonly used functions used outside of // the Android Starlark migration. Let's not break them without an incompatible // change process. builder.put("android_common", androidCommon); builder.put( ApkInfoApi.NAME, FlagGuardedValue.onlyWhenExperimentalFlagIsTrue( FlagIdentifier.EXPERIMENTAL_GOOGLE_LEGACY_API, apkInfoProvider)); builder.put( AndroidInstrumentationInfoApi.NAME, FlagGuardedValue.onlyWhenExperimentalFlagIsTrue( FlagIdentifier.EXPERIMENTAL_GOOGLE_LEGACY_API, androidInstrumentationInfoProvider)); builder.put( AndroidDeviceBrokerInfoApi.NAME, FlagGuardedValue.onlyWhenExperimentalFlagIsTrue( FlagIdentifier.EXPERIMENTAL_GOOGLE_LEGACY_API, androidDeviceBrokerInfoProvider)); builder.put( AndroidResourcesInfoApi.NAME, FlagGuardedValue.onlyWhenExperimentalFlagIsTrue( FlagIdentifier.EXPERIMENTAL_GOOGLE_LEGACY_API, androidResourcesInfoProvider)); builder.put( AndroidNativeLibsInfoApi.NAME, FlagGuardedValue.onlyWhenExperimentalFlagIsTrue( FlagIdentifier.EXPERIMENTAL_GOOGLE_LEGACY_API, androidNativeLibsInfoProvider)); builder.put( AndroidApplicationResourceInfoApi.NAME, FlagGuardedValue.onlyWhenExperimentalFlagIsTrue( FlagIdentifier.EXPERIMENTAL_GOOGLE_LEGACY_API, androidApplicationResourceInfoApiProvider)); } }
{ "content_hash": "9a106eb8b2de81677f63c3de43ae11f0", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 137, "avg_line_length": 54.83870967741935, "alnum_prop": 0.8066666666666666, "repo_name": "akira-baruah/bazel", "id": "1b1d866d48db2a0bd38d148cdb11c804622244d8", "size": "5100", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/google/devtools/build/lib/skylarkbuildapi/android/AndroidBootstrap.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "14332" }, { "name": "C++", "bytes": "1037443" }, { "name": "HTML", "bytes": "18607" }, { "name": "Java", "bytes": "27157305" }, { "name": "Makefile", "bytes": "248" }, { "name": "PowerShell", "bytes": "5536" }, { "name": "Python", "bytes": "663737" }, { "name": "Roff", "bytes": "511" }, { "name": "Shell", "bytes": "1038494" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="refresh" content="0;URL=type.U928.html"> </head> <body> <p>Redirecting to <a href="type.U928.html">type.U928.html</a>...</p> <script>location.replace("type.U928.html" + location.search + location.hash);</script> </body> </html>
{ "content_hash": "a23e732fca5643ce3aea89b30c2f4c8e", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 90, "avg_line_length": 29.7, "alnum_prop": 0.6531986531986532, "repo_name": "nitro-devs/nitro-game-engine", "id": "bfc113f2a5bf711b9cdd5a38960eea68061bb127", "size": "297", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/typenum/consts/U928.t.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CMake", "bytes": "1032" }, { "name": "Rust", "bytes": "59380" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginRight="16dp" android:layout_marginLeft="16dp" android:layout_marginTop="8dp" > <ImageView android:id="@+id/iv_image" android:scaleType="centerCrop" android:layout_width="100dp" android:layout_height="100dp" android:visibility="gone" /> </FrameLayout>
{ "content_hash": "407f2e8798d6f5c64e35d166b7e78b24", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 71, "avg_line_length": 34.86666666666667, "alnum_prop": 0.6730401529636711, "repo_name": "xuhaoyang/Weibo", "id": "5f3e697c93e1ad011bb4c85a2adb72a81270431e", "size": "523", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/include_status_image.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "682766" } ], "symlink_target": "" }