text
stringlengths
4
5.48M
meta
stringlengths
14
6.54k
package com.xti.jenkins.plugin.awslambda.publish; import hudson.model.ProminentProjectAction; /** * Project: aws-lambda * Created by Magnus Sulland on 26/07/2016. */ public class LambdaPublishAction implements ProminentProjectAction{ private static final String URL_NAME = "console"; private final String iconFileName; private final String bigIconFileName; private final String displayName; public LambdaPublishAction(String functionVersion, String functionAlias, Boolean success) { if(success){ iconFileName = "/plugin/aws-lambda/images/Lambda_24.png"; bigIconFileName = "/plugin/aws-lambda/images/Lambda_48.png"; displayName = "Lambda alias " + functionAlias + " points to version " + functionVersion; }else { iconFileName = "/plugin/aws-lambda/images/Lambda_24_grey.png"; bigIconFileName = "/plugin/aws-lambda/images/Lambda_48_grey.png"; displayName = "Unable to point alias " + functionAlias + " to version " + functionVersion; } } @Override public String getIconFileName() { return iconFileName; } public String getBigIconFileName() { return bigIconFileName; } @Override public String getDisplayName() { return displayName; } @Override public String getUrlName() { return URL_NAME; } }
{'content_hash': '73196c1285eafa3605b9267065943c6c', 'timestamp': '', 'source': 'github', 'line_count': 46, 'max_line_length': 102, 'avg_line_length': 30.369565217391305, 'alnum_prop': 0.6671438797423049, 'repo_name': 'XT-i/aws-lambda-jenkins-plugin', 'id': 'e03a4e7cc3f3020a936d06fd6a943c3f0bbb2d76', 'size': '1397', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/xti/jenkins/plugin/awslambda/publish/LambdaPublishAction.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '35664'}, {'name': 'Java', 'bytes': '338830'}, {'name': 'JavaScript', 'bytes': '2185'}]}
package org.apache.avro.mapred; import java.io.IOException; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.FileSplit; /** A {@link org.apache.hadoop.mapred.RecordReader} for sequence files. */ public class SequenceFileRecordReader<K,V> extends AvroRecordReader<Pair<K,V>> { public SequenceFileRecordReader(JobConf job, FileSplit split) throws IOException { super(new SequenceFileReader<K,V>(split.getPath().toUri(), job), split); } }
{'content_hash': '16319a4f3c7a5d9e57908cca6cd4c120', 'timestamp': '', 'source': 'github', 'line_count': 20, 'max_line_length': 80, 'avg_line_length': 24.5, 'alnum_prop': 0.7408163265306122, 'repo_name': 'ecatmur/avro', 'id': 'bb014a34a27146e0ca9d306b2a6f890d2d301b27', 'size': '1296', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileRecordReader.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '1557'}, {'name': 'C', 'bytes': '1006246'}, {'name': 'C#', 'bytes': '811965'}, {'name': 'C++', 'bytes': '669683'}, {'name': 'CMake', 'bytes': '26334'}, {'name': 'CSS', 'bytes': '3562'}, {'name': 'HTML', 'bytes': '77929'}, {'name': 'Java', 'bytes': '3140297'}, {'name': 'JavaScript', 'bytes': '346750'}, {'name': 'LLVM', 'bytes': '7858'}, {'name': 'M4', 'bytes': '29371'}, {'name': 'PHP', 'bytes': '205889'}, {'name': 'Perl', 'bytes': '102415'}, {'name': 'Perl6', 'bytes': '2332'}, {'name': 'Protocol Buffer', 'bytes': '1756'}, {'name': 'Python', 'bytes': '532415'}, {'name': 'Ruby', 'bytes': '152987'}, {'name': 'Shell', 'bytes': '32721'}, {'name': 'Thrift', 'bytes': '1558'}, {'name': 'Vim script', 'bytes': '2764'}, {'name': 'Yacc', 'bytes': '5228'}]}
About ===== Durden is a free (3-clause BSD) desktop environment for Arcan, thus it requires a working arcan installation, optionally set-up with compatible launch targets etc. See the [Arcan](http://github.com/letoram/arcan) repository and wiki for those details. For detailed feature and use descriptions, please see the [Durden-Web](http://durden.arcan-fe.com). The individual markdown pages are also accessible in the gh-pages branch of the durden repository. Authors and Contact ===== Development is discussed on the IRC channel #arcan on the Freenode network (chat.freenode.org) 2015-2019, Björn Ståhl Licensing ===== Durden is Licensed in the 3-clause BSD format that can be found in the licensing file. The included terminal font, Hack-Bold is (c) Chris Simpkins and licensed under the Apache-2.0 license. The included UI font, designosaur, is provided free (cc-by 3.0 attribution) by Archy Studio, http://www.archystudio.com The included fallback font, Emoji-One, is provided free (cc-by 4.0 attribution) by http://emojione.com Hacking ===== See the HACKING.md file for information on where/how to extend and modify. Installation ============ Durden requires a working installation of [arcan](https://github.com/letoram/arcan) so please refer to that project for low level details, which also may cover system keymap (the facilities provided in durden are higher level overrides). The arcan documentation also covers specifics on how to get X, wayland and other clients to work. Other than that, you need to link or copy the durden subdirectory of this repository to were arcan looks for applications, or use an absolute path, like: arcan $HOME/durden/durden See also the starting section below, as well as the configuration sections further below. Starting ===== distr/durden is a support script that can be run to try and automatically set everything up and start. It also takes care of relaunch/recover if the program terminated abnormally. If you have a system that uses the "XDG" set of directories, the script will build the directory tree in XDG\_DATA\_HOME/arcan, otherwise it will use $HOME/.arcan. To help debug issues, you can create a 'logs' folder in that directory and both engine output, Lua crash dumps and frameserver execution will be stored there. Configuration (runtime) ======================= Most changes, from visuals to window management behavior and input device actions, can be done from within durden and the UI itself using the menu HUD. By default, this is accessed from META1+G for (global) and META1+T for current window (target). All actions in durden are mapped into a huge virtual filesystem tree. Keybindings, UI buttons etc. are all simply paths within this filesystem. These are covered in much more detail on the webpage, but the ones you might want to take extra note of is: /global/input/bind/custom /global/system/shutdown/yes /global/open/terminal /global/input/keyboard/maps/bind_sym /global/input/keyboard/maps/bind_utf8 Another thing to note is that at startup, after a crash or keyboard plug event, a fallback helper is activated. This triggers after a number of keypresses that does not activate a valid keybinding. It will then query for re-binding key functions, (meta keys, global menu, menu navigation) as a means for recovering from a broken or unknown keyboard. You can also reach most paths with a mouse by right- clicking on the active workspace indicator on the statusbar. Configuration (manual) ======================= There are four ways of configuring durden without using the UI: 1. The arcan\_db tool (See the manpage for more uses of this tool.) This works offline (without durden running) and only after first successful run. All current settings are stored in a database. This can be viewed, and changed, like this: arcan_db show_appl durden arcan_db add_appl_kv durden my_key Or clear all settings and revert to defaults on the next run: arcan_db drop_appl durden This is also used to control which programs (targets) and sets of arguments (configuration) durden is allowed to run. This restriction is a safety/security measure. Something like: arcan_db add_target test BINARY /usr/bin/test arg1 arcan_db add_config test default arg2 arg3 Would be added to /global/open/target/test 2. Files The default settings used on an empty database is found in: durden/config.lua You can also control what is being run at startup in: durden/autorun.lua The first time durden is run, the following script will be run: durden/firstrun.lua Advanced input device configuration is in durden/devmaps for the various categories of devices. 3. Controls Everything can be accessed and controlled (while running) using a domain socket. This is enabled through the (global/settings/system/control=name) path. If enabled, it will appear in durden/ipc/name. You can use the socat tool to interact with it and control everything as if using input in the UI directly. The commands accepted by this socket is any of (ls, readdir, eval, read, write, exec) to navigate the menu tree, as well as a 'monitor' command which lets you monitor subsystem activity. There is also a 'MONITOR' command that lets you monitor one or several subsystems. There is also a tool in arcan that can be built and run, arcan\_cfgfs, which allows the control socket to be mounted and treated like a filesystem. Troubleshooting ==== There are many moving parts that can go wrong, the display server aspects when it comes to managing GPUs, displays, clients and input devices - as well as client behaviors, the window management policies and the features themselves. On top of this, there are a number of special cases, like VT switching, crash- recovery, display hot-plug, soft-reset and 'suspend-exec until program return' scenarios that all massage these different subsystems in ways that are hard to test automatically and for every configuration. If durden itself crashes, the recovery can be so fast that you won't notice, but the notification widget (if enabled) on the HUD will likely provide you with a crash log. If you suspect a client of behaving badly, you can start it with the environment ARCAN\_SHMIF\_DEBUG=1 to get a trace of what goes on, and there are multiple tools in the arcan source repository for live-inspecting the state of clients. You can also ask a client to provide a debug view for you, if it supports that feature, by going to /target/video/advanced/debug\_window - calling it multiple times may provide multiple levels of debug output. Then there are logging facilities for all the frameservers, durden itself (if run through the launcher script) and .lua snapshots on soft-crashes. These are all enabled by creating a 'logs' directory inside your .arcan folder (on non-xdg systems, that would be $HOME/.arcan) and restart durden.
{'content_hash': 'a04279f7f76e15186699f496e987ca2a', 'timestamp': '', 'source': 'github', 'line_count': 183, 'max_line_length': 85, 'avg_line_length': 37.61748633879781, 'alnum_prop': 0.7751307379430563, 'repo_name': 'letoram/durden', 'id': '59a81e318c5d4afb157e8f96e6815db209e102b0', 'size': '6886', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'GLSL', 'bytes': '17649'}, {'name': 'Lua', 'bytes': '1225073'}, {'name': 'Shell', 'bytes': '3680'}]}
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ /* * (C) 2006 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ #include "stdio.h" #include "mpi.h" int main( int argc, char *argv[] ) { int provided, rank; MPI_Init_thread( &argc, &argv, MPI_THREAD_MULTIPLE, &provided ); MPI_Comm_rank( MPI_COMM_WORLD, &rank ); MPI_Finalize(); /* The test here is a simple one that Finalize exits, so the only action is to write no errors */ if (rank == 0) { printf( " No Errors\n" ); } return 0; }
{'content_hash': '7e982f4c14ae276714709d2b2bd2e9cc', 'timestamp': '', 'source': 'github', 'line_count': 28, 'max_line_length': 76, 'avg_line_length': 20.714285714285715, 'alnum_prop': 0.593103448275862, 'repo_name': 'syftalent/dist-sys-exercises-1', 'id': '4978783969528aa057be7396173d8d99a5f825f9', 'size': '580', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'lec-6/mpi/mpich-3.1.4/test/mpi/threads/init/initth.c', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '18527504'}, {'name': 'C++', 'bytes': '371333'}, {'name': 'CSS', 'bytes': '2594'}, {'name': 'FORTRAN', 'bytes': '1807643'}, {'name': 'Groff', 'bytes': '82714'}, {'name': 'HTML', 'bytes': '115'}, {'name': 'Java', 'bytes': '50567'}, {'name': 'Makefile', 'bytes': '291868'}, {'name': 'Objective-C', 'bytes': '2350'}, {'name': 'PHP', 'bytes': '51'}, {'name': 'Perl', 'bytes': '288111'}, {'name': 'Python', 'bytes': '2429'}, {'name': 'Ruby', 'bytes': '2922'}, {'name': 'Shell', 'bytes': '169588'}, {'name': 'TeX', 'bytes': '262609'}, {'name': 'XSLT', 'bytes': '3178'}]}
<!DOCTYPE html> <title>scroll-timeline and container queries</title> <link rel="help" src="https://drafts.csswg.org/scroll-animations-1/#scroll-timeline-shorthand"> <link rel="help" src="https://drafts.csswg.org/css-contain-3/#container-queries"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/web-animations/testcommon.js"></script> <script src="support/testcommon.js"></script> <style> #scroller { overflow: auto; width: auto; height: 100px; } #scroller > div { height: 200px; } @keyframes anim { from { background-color: rgb(100, 100, 100); } to { background-color: rgb(200, 200, 200); } } #element { height: 10px; width: 10px; animation: anim 10s linear timeline; background-color: rgb(0, 0, 0); } </style> <div> <div id=scroller> <div></div> </div> <div> <div id=element></div> </div> </div> <script> promise_test(async (t) => { element.offsetTop; scroller.scrollTop = 50; await waitForNextFrame(); // Unknown timeline, time held at zero. assert_equals(getComputedStyle(element).backgroundColor, 'rgb(100, 100, 100)'); scroller.style.scrollTimeline = 'timeline'; await waitForCSSScrollTimelineStyle(); assert_equals(getComputedStyle(element).backgroundColor, 'rgb(150, 150, 150)'); }, 'Timelines appearing on preceding siblings are visible to getComputedStyle'); </script>
{'content_hash': '5328d7ed6800165283b6853f820572ae', 'timestamp': '', 'source': 'github', 'line_count': 49, 'max_line_length': 95, 'avg_line_length': 29.79591836734694, 'alnum_prop': 0.673972602739726, 'repo_name': 'chromium/chromium', 'id': 'a1ba3b704b7894679a53f685948710562800aa58', 'size': '1460', 'binary': False, 'copies': '12', 'ref': 'refs/heads/main', 'path': 'third_party/blink/web_tests/external/wpt/scroll-animations/css/scroll-timeline-sibling-gcs.html', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []}
<?php namespace App\Http\Requests\Api\V1_0; use App\Http\Requests\AbstractJsonRequest; use App\Project; use Gate; class CreateOrUpdateHyperlinksRequest extends AbstractJsonRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { $projectId = $this->route('projectId'); $project = Project::findOrFail($projectId); return Gate::allows('update', $project); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'create.*.name'=> 'required', 'create.*.link' => 'required|url', 'update' => 'array', 'update.*.id' => 'required|exists:hyperlinks,id', 'update.*.name' => 'required', 'update.*.link' => 'required|url' ]; } }
{'content_hash': '81e8be3679f8b1261134245e80034507', 'timestamp': '', 'source': 'github', 'line_count': 41, 'max_line_length': 65, 'avg_line_length': 22.804878048780488, 'alnum_prop': 0.558288770053476, 'repo_name': 'OpenISDM/VMS', 'id': '38f2e90eac565047ad229f009d156675a37b043a', 'size': '935', 'binary': False, 'copies': '2', 'ref': 'refs/heads/develop', 'path': 'app/Http/Requests/Api/V1_0/CreateOrUpdateHyperlinksRequest.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '412'}, {'name': 'CSS', 'bytes': '72'}, {'name': 'HTML', 'bytes': '51807'}, {'name': 'JavaScript', 'bytes': '546'}, {'name': 'PHP', 'bytes': '397954'}, {'name': 'Shell', 'bytes': '306'}]}
<?php # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/pubsub/v1/pubsub.proto namespace Google\Cloud\PubSub\V1; use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; /** * Request for the UpdateSnapshot method. * * Generated from protobuf message <code>google.pubsub.v1.UpdateSnapshotRequest</code> */ class UpdateSnapshotRequest extends \Google\Protobuf\Internal\Message { /** * The updated snpashot object. * * Generated from protobuf field <code>.google.pubsub.v1.Snapshot snapshot = 1;</code> */ private $snapshot = null; /** * Indicates which fields in the provided snapshot to update. * Must be specified and non-empty. * * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</code> */ private $update_mask = null; public function __construct() { \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); parent::__construct(); } /** * The updated snpashot object. * * Generated from protobuf field <code>.google.pubsub.v1.Snapshot snapshot = 1;</code> * @return \Google\Cloud\PubSub\V1\Snapshot */ public function getSnapshot() { return $this->snapshot; } /** * The updated snpashot object. * * Generated from protobuf field <code>.google.pubsub.v1.Snapshot snapshot = 1;</code> * @param \Google\Cloud\PubSub\V1\Snapshot $var * @return $this */ public function setSnapshot($var) { GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Snapshot::class); $this->snapshot = $var; return $this; } /** * Indicates which fields in the provided snapshot to update. * Must be specified and non-empty. * * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</code> * @return \Google\Protobuf\FieldMask */ public function getUpdateMask() { return $this->update_mask; } /** * Indicates which fields in the provided snapshot to update. * Must be specified and non-empty. * * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</code> * @param \Google\Protobuf\FieldMask $var * @return $this */ public function setUpdateMask($var) { GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); $this->update_mask = $var; return $this; } }
{'content_hash': 'bf9b247b6691674ec7f51c2d7f276ca3', 'timestamp': '', 'source': 'github', 'line_count': 92, 'max_line_length': 93, 'avg_line_length': 27.73913043478261, 'alnum_prop': 0.6426332288401254, 'repo_name': 'googleapis/proto-client-php', 'id': '52aad9e9519e0b926028c75abc84e8fec187bf35', 'size': '2552', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'src/Google/Cloud/PubSub/V1/UpdateSnapshotRequest.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'PHP', 'bytes': '5915838'}]}
package io.datarouter.client.hbase.cluster; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; import org.apache.hadoop.hbase.ClusterStatus; import org.apache.hadoop.hbase.ServerLoad; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.client.Admin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.datarouter.model.exception.DataAccessException; public class DrServerList{ private static final Logger logger = LoggerFactory.getLogger(DrServerList.class); private final List<DrServerInfo> servers; private final List<ServerName> serverNames; private final Map<ServerName,DrServerInfo> drhServerInfoByServerName; private final SortedSet<DrServerInfo> serversSortedByDescendingLoad; public DrServerList(Admin admin){ try{ ClusterStatus clusterStatus = admin.getClusterStatus(); serverNames = new ArrayList<>(clusterStatus.getServers()); Collections.sort(serverNames); this.servers = new ArrayList<>(); this.serversSortedByDescendingLoad = new TreeSet<>(DrServerInfo.COMPARATOR_DESC_SERVER_LOAD); this.drhServerInfoByServerName = new TreeMap<>(); for(ServerName serverName : serverNames){ DrServerInfo info = new DrServerInfo(serverName, clusterStatus.getLoad(serverName)); this.servers.add(info); this.serversSortedByDescendingLoad.add(info); this.drhServerInfoByServerName.put(serverName, info); } }catch(IOException e){ throw new DataAccessException(e); } } public List<ServerName> getServerNames(){ return serverNames; } public List<ServerName> getServerNamesSorted(){ return serverNames; } public SortedSet<String> getServerNameStrings(){ SortedSet<String> serverNames = new TreeSet<>(); for(DrServerInfo server : servers){ serverNames.add(server.getName()); } return serverNames; } public SortedSet<String> getServerHostnames(){ SortedSet<String> serverNames = new TreeSet<>(); for(DrServerInfo server : servers){ serverNames.add(server.getHostname()); } return serverNames; } public ServerLoad getHServerLoad(ServerName serverName){ DrServerInfo drhServerInfo = drhServerInfoByServerName.get(serverName); if(drhServerInfo == null){ logger.warn("unexpected DRHServerInfo null for " + serverName.getHostAndPort()); return null; } return drhServerInfo.getServerLoad(); } public int getNumServers(){ return servers.size(); } public List<DrServerInfo> getServers(){ return servers; } public SortedSet<DrServerInfo> getServersSortedByDescendingLoad(){ return serversSortedByDescendingLoad; } }
{'content_hash': 'a5fa51a3bf19aedc0ed0d35e444343a8', 'timestamp': '', 'source': 'github', 'line_count': 94, 'max_line_length': 96, 'avg_line_length': 29.0, 'alnum_prop': 0.7743947175348496, 'repo_name': 'hotpads/datarouter', 'id': '05cdb227e52131e4a2e58f7c994440f297bcdb8d', 'size': '3339', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'datarouter-hbase/src/main/java/io/datarouter/client/hbase/cluster/DrServerList.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '9438'}, {'name': 'Java', 'bytes': '8616487'}, {'name': 'JavaScript', 'bytes': '639471'}]}
package com.google.errorprone.bugpatterns; import static com.google.errorprone.BugPattern.SeverityLevel.ERROR; import static com.google.errorprone.fixes.SuggestedFixes.qualifyType; import static com.google.errorprone.matchers.Description.NO_MATCH; import static com.google.errorprone.util.ASTHelpers.getSymbol; import com.google.errorprone.BugPattern; import com.google.errorprone.BugPattern.StandardTags; import com.google.errorprone.VisitorState; import com.google.errorprone.bugpatterns.BugChecker.MemberSelectTreeMatcher; import com.google.errorprone.fixes.SuggestedFix; import com.google.errorprone.matchers.Description; import com.sun.source.tree.ClassTree; import com.sun.source.tree.ExpressionTree; import com.sun.source.tree.MemberSelectTree; import com.sun.source.tree.MethodInvocationTree; import com.sun.source.tree.NewClassTree; import com.sun.source.tree.StatementTree; import com.sun.tools.javac.code.Symbol; import com.sun.tools.javac.code.Symbol.ClassSymbol; import com.sun.tools.javac.code.Symbol.MethodSymbol; import java.util.Objects; /** @author [email protected] (Eddie Aftandilian) */ @BugPattern( name = "StaticQualifiedUsingExpression", summary = "A static variable or method should be qualified with a class name, not expression", severity = ERROR, altNames = {"static", "static-access", "StaticAccessedFromInstance"}, tags = StandardTags.FRAGILE_CODE) public class StaticQualifiedUsingExpression extends BugChecker implements MemberSelectTreeMatcher { @Override public Description matchMemberSelect(MemberSelectTree tree, VisitorState state) { Symbol sym = getSymbol(tree); if (sym == null) { return NO_MATCH; } switch (sym.getKind()) { case FIELD: if (sym.getSimpleName().contentEquals("class") || sym.getSimpleName().contentEquals("super")) { return NO_MATCH; } // fall through case ENUM_CONSTANT: case METHOD: if (!sym.isStatic()) { return NO_MATCH; } break; // continue below default: return NO_MATCH; } ClassSymbol owner = sym.owner.enclClass(); ExpressionTree expression = tree.getExpression(); switch (expression.getKind()) { case MEMBER_SELECT: case IDENTIFIER: // References to static variables should be qualified by the type name of the owning type, // or a sub-type. e.g.: if CONST is declared in Foo, and SubFoo extends Foo, // allow `Foo.CONST` and `SubFoo.CONST` (but not, say, `new Foo().CONST`. Symbol base = getSymbol(expression); if (base instanceof ClassSymbol && base.isSubClass(owner, state.getTypes())) { return NO_MATCH; } break; default: // continue below } SuggestedFix.Builder fix = SuggestedFix.builder(); String replacement; boolean isMethod = sym instanceof MethodSymbol; if (isMethod && Objects.equals(getSymbol(state.findEnclosing(ClassTree.class)), owner)) { replacement = sym.getSimpleName().toString(); } else { replacement = qualifyType(state, fix, sym); } fix.replace(tree, replacement); // Spill possibly side-effectful qualifier expressions to the top level. // This doesn't preserve order of operations for non-trivial expressions, but we don't have // letexprs and hopefully it'll call attention to the fact that just deleting the qualifier // might not always be the right fix. if (expression instanceof MethodInvocationTree || expression instanceof NewClassTree) { StatementTree statement = state.findEnclosing(StatementTree.class); if (statement != null) { fix.prefixWith(statement, state.getSourceForNode(expression) + ";"); } } return buildDescription(tree) .setMessage( String.format( "Static %s %s should not be accessed from an object instance; instead use %s", isMethod ? "method" : "variable", sym.getSimpleName(), replacement)) .addFix(fix.build()) .build(); } }
{'content_hash': '26153daf2b715c6441be0a6225ed445d', 'timestamp': '', 'source': 'github', 'line_count': 102, 'max_line_length': 99, 'avg_line_length': 39.96078431372549, 'alnum_prop': 0.7024043179587831, 'repo_name': 'cushon/error-prone', 'id': '129abe6a3673c298231370cf87385bbc16e7b739', 'size': '4683', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'core/src/main/java/com/google/errorprone/bugpatterns/StaticQualifiedUsingExpression.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '2061'}, {'name': 'Java', 'bytes': '7364383'}, {'name': 'Python', 'bytes': '10499'}, {'name': 'Shell', 'bytes': '1815'}]}
<div class="page-header"> <h2><?= t('Category modification for the project "%s"', $project['name']) ?></h2> </div> <form class="popover-form" method="post" action="<?= $this->url->href('category', 'update', array('project_id' => $project['id'], 'category_id' => $values['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->label(t('Category Name'), 'name') ?> <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> <?= $this->form->label(t('Description'), 'description') ?> <?= $this->form->textarea('description', $values, $errors, array(), 'markdown-editor') ?> <div class="form-actions"> <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'category', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> </div> </form>
{'content_hash': '0b6aa138fa237104c022dabb41a75b32', 'timestamp': '', 'source': 'github', 'line_count': 23, 'max_line_length': 186, 'avg_line_length': 45.26086956521739, 'alnum_prop': 0.5552353506243997, 'repo_name': 'dromek/kanboard', 'id': '7b59268965cfb210403a28134f526c1af51604ad', 'size': '1041', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/Template/category/edit.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '957'}, {'name': 'CSS', 'bytes': '36933'}, {'name': 'JavaScript', 'bytes': '76024'}, {'name': 'Makefile', 'bytes': '6147'}, {'name': 'Nginx', 'bytes': '1629'}, {'name': 'PHP', 'bytes': '4076991'}, {'name': 'Shell', 'bytes': '19'}]}
function Simulation(world_width, world_height, padding = 5) { this._world_size = new SB.Vector(world_width, world_height); this._padding = padding; this._agents = []; } Simulation.prototype = { constructor: Simulation, step: function(dt) { this._agents.forEach(agent => { const vehicle = agent.vehicle; const behavior = agent.behavior; vehicle.net_force.set(0, 0); vehicle.apply_force(behavior.drive(vehicle, dt)); vehicle.step(dt); this._enforce_world_bounds(vehicle.position); this._discard_small_values(vehicle.velocity); }); }, _enforce_world_bounds: function(position) { const p = position; if (p.x < 0 || p.x > this._world_size.x) { p.x = this._world_size.x - p.x; p.x = Math.min ( this._world_size.x - this._padding, Math.max(this._padding, p.x) ); } if (p.y < 0 || p.y > this._world_size.y) { p.y = this._world_size.y - p.y; p.y = Math.min ( this._world_size.y - this._padding, Math.max(this._padding, p.y) ); } }, _discard_small_values: function(v) { v.map_(x => Math.abs(x) < Simulation.EPSILON ? 0 : x); }, get world_size() { return this._world_size; }, get agents() { return this._agents; } }; Simulation.EPSILON = 0.001;
{'content_hash': '6cfdea3fc466c9aa6d9bd981cf0fc989', 'timestamp': '', 'source': 'github', 'line_count': 60, 'max_line_length': 61, 'avg_line_length': 20.666666666666668, 'alnum_prop': 0.614516129032258, 'repo_name': 'rharel/js-steering-behaviors', 'id': '590917d06fe62212322c3f508dd624c3838e560a', 'size': '1399', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/visual/js/Simulation.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '75'}, {'name': 'HTML', 'bytes': '14668'}, {'name': 'JavaScript', 'bytes': '39157'}]}
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="GradleSettings"> <option name="linkedExternalProjectsSettings"> <GradleProjectSettings> <option name="distributionType" value="LOCAL" /> <option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="gradleHome" value="C:\Program Files (x86)\Android\DevStudio\gradle\gradle-2.8" /> <option name="gradleJvm" value="1.8" /> <option name="modules"> <set> <option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$/app" /> </set> </option> </GradleProjectSettings> </option> </component> </project>
{'content_hash': '5b463963442df8aea6c0ae07b5f408ba', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 103, 'avg_line_length': 36.94736842105263, 'alnum_prop': 0.5997150997150997, 'repo_name': 'ibm-bluemix-mobile-services/bms-samples-hellotodo-advanced', 'id': '44b4ddc733e4fc74645bdcd0c000a90bc6665c51', 'size': '702', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Android/helloTodoAdvanced/.idea/gradle.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '6846'}, {'name': 'HTML', 'bytes': '9462'}, {'name': 'Java', 'bytes': '36986'}, {'name': 'JavaScript', 'bytes': '23871'}, {'name': 'Makefile', 'bytes': '1267'}, {'name': 'Objective-C', 'bytes': '18425'}, {'name': 'Ruby', 'bytes': '159'}]}
(function($) { /* ======== A Handy Little QUnit Reference ======== http://api.qunitjs.com/ Test methods: module(name, {[setup][ ,teardown]}) test(name, callback) expect(numberOfAssertions) stop(increment) start(decrement) Test assertions: ok(value, [message]) equal(actual, expected, [message]) notEqual(actual, expected, [message]) deepEqual(actual, expected, [message]) notDeepEqual(actual, expected, [message]) strictEqual(actual, expected, [message]) notStrictEqual(actual, expected, [message]) throws(block, [expected], [message]) */ var tableHtml = [ '<table %s>', '<thead>', '<tr>', '<th data-tablesaw-priority="1" data-tablesaw-sortable-col>Header</th>', '<th data-tablesaw-sortable-col data-sortable-numeric>Header</th>', '<th>Header</th>', '<th>Header</th>', '<th>Header</th>', '<th>Header</th>', '<th>Header</th>', '<th>Header</th>', '<th>Header</th>', '<th>Header</th>', '<th data-tablesaw-priority="6">Header</th>', '</tr>', '</thead>', '<tbody>', '<tr>', '<td>Body Row 1</td>', '<td>1</td>', '<td>This column text is designed to make the columns really wide.</td>', '<td>This column text is designed to make the columns really wide.</td>', '<td>This column text is designed to make the columns really wide.</td>', '<td>This column text is designed to make the columns really wide.</td>', '<td>This column text is designed to make the columns really wide.</td>', '<td>This column text is designed to make the columns really wide.</td>', '<td>This column text is designed to make the columns really wide.</td>', '<td>This column text is designed to make the columns really wide.</td>', '<td>This column text is designed to make the columns really wide.</td>', '</tr>', '<tr><td>Body Row 2</td><td>2</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td></tr>', '<tr><td>Body Row 10</td><td>10</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td></tr>', '<tr><td>body row 4</td><td>10</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td></tr>', '<tr><td>Body Row 1.2</td><td>1.2</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td></tr>', '</tbody>', '</table>'].join(''), $fixture, $table, setup = function( tableAttributes ) { return function() { $fixture = $( '#qunit-fixture' ); // We use columntoggle here to make the cell html comparisons easier (stack adds elements to each cell) $fixture.html( tableHtml.replace( /\%s/, tableAttributes ) ); $( document ).trigger( 'enhance.tablesaw' ); $table = $fixture.find( 'table' ); }; }; module( 'Global' ); test( 'Initialization', function() { ok( $( 'html' ).hasClass( 'tablesaw-enhanced' ), 'Has initialization class.' ); }); module( 'tablesaw is opt-in only, no default', { setup: setup( '' ) }); test( 'Initialization', function() { ok( $table[ 0 ].className.indexOf( 'tablesaw-' ) === -1, 'Does not have initialization class.' ); }); module( 'tablesaw Stack', { setup: setup( 'data-tablesaw-mode="stack"' ) }); test( 'Initialization', function() { ok( $table.hasClass( 'tablesaw-stack' ), 'Has initialization class.' ); }); module( 'tablesaw Column Toggle', { setup: setup( 'data-tablesaw-mode="columntoggle"' ) }); test( 'Initialization', function() { ok( $table.hasClass( 'tablesaw-columntoggle' ), 'Has initialization class.' ); ok( $table.find( 'tbody td' ).eq( 0 ).is( ':visible' ), 'First cell is visible' ); }); test( 'Show Dialog', function() { ok( !$fixture.find( '.tablesaw-columntoggle-popup' ).is( ':visible' ), 'Dialog hidden' ); $table.prev().find( '.tablesaw-columntoggle-btn' ).click(); ok( $fixture.find( '.tablesaw-columntoggle-popup' ).is( ':visible' ), 'Dialog visible after button click' ); }); test( 'Toggle Column', function() { var $cell = $table.find( 'tbody td' ).eq( 0 ); strictEqual( $cell.is( '.tablesaw-cell-hidden' ), false, 'First cell is visible before checkbox unchecked' ); $table.prev().find( '.tablesaw-columntoggle-btn' ).trigger( 'click' ) .next().find( ':checkbox' ).trigger( 'click' ); // close dialog $( '.tablesaw-columntoggle-popup .close' ).click(); strictEqual( $cell.is( '.tablesaw-cell-hidden' ), true, 'First cell is hidden after checkbox unchecked' ); }); module( 'tablesaw Swipe', { setup: setup( 'data-tablesaw-mode="swipe"' ) }); test( 'Initialization', function() { var $buttons = $table.prev().find( '.tablesaw-nav-btn' ); ok( $table.hasClass( 'tablesaw-swipe' ), 'Has initialization class.' ); equal( $buttons.length, 2, 'Has buttons.' ); }); test( 'Navigate with buttons', function() { var $buttons = $table.prev().find( '.tablesaw-nav-btn' ), $prev = $buttons.filter( '.left' ), $next = $buttons.filter( '.right' ); ok( $prev.is( '.disabled' ), 'Starts at far left, previous button disabled.' ); ok( !$next.is( '.disabled' ), 'Starts at far left, next button enabled.' ); ok( $table.find( 'tbody td:first-child' ).not( '.tablesaw-cell-hidden' ), 'First column is visible' ); $next.trigger( 'click' ); ok( !$prev.is( '.disabled' ), 'Previous button enabled.' ); ok( $table.find( 'tbody td:first-child' ).is( '.tablesaw-cell-hidden' ), 'First column is hidden after click' ); }); module( 'tablesaw Sortable without a Mode', { setup: setup( 'data-tablesaw-sortable' ) }); test( 'Sortable still initializes without a data-tablesaw-mode', function() { ok( $table.hasClass( 'tablesaw-sortable' ), 'Has initialization class.' ); ok( $table.find( '.tablesaw-sortable-head' ).length > 0, 'Header has sort class.' ); }); module( 'tablesaw Sortable', { setup: setup( 'data-tablesaw-mode="columntoggle" data-tablesaw-sortable' ) }); test( 'Initialization', function() { ok( $table.hasClass( 'tablesaw-sortable' ), 'Has initialization class.' ); ok( $table.find( '.tablesaw-sortable-head' ).length > 0, 'Header has sort class.' ); }); test( 'Can sort descending', function() { var previousRow1Text = $table.find( 'tbody tr td' ).eq( 0 ).text(), $sortButton = $table.find( '.tablesaw-sortable-head button' ).eq( 0 ); $sortButton.click(); notEqual( $table.find( 'tbody tr td' ).eq( 0 ).text(), previousRow1Text, 'First row is sorted descending' ); $sortButton.click(); equal( $table.find( 'tbody tr td' ).eq( 0 ).text(), previousRow1Text, 'First row is sorted ascending' ); }); test( 'Can sort numeric descending', function() { var $sortButton = $table.find( '.tablesaw-sortable-head button' ).eq( 1 ); $sortButton.click(); equal( $table.find( 'tbody tr:eq(0) td:eq(1)' ).html(), '10', 'First row is sorted descending' ); $sortButton.click(); equal( $table.find( 'tbody tr:eq(0) td:eq(1)' ).html(), '1', 'First row is sorted ascending' ); }); test( 'Sort works with floats', function() { var previousText = "Body Row 1.2", $sortButton = $table.find( '.tablesaw-sortable-head button' ).eq( 0 ), rows = $table.find( 'tbody tr' ).length; $sortButton.click(); equal( $table.find( 'tbody tr:eq(' + (rows - 2 ) + ') td:eq(0)' ).text(), previousText, previousText + ' is in row ' + ( rows - 2 ) + ' of ' + rows + ' (descending)' ); $sortButton.click(); equal( $table.find( 'tbody tr:eq(1) td:eq(0)' ).text(), previousText, previousText + ' is in the second row (ascending)' ); }); test( 'Sort is case insensitive', function() { var previousText = "body row 4", $sortButton = $table.find( '.tablesaw-sortable-head button' ).eq( 0 ); $sortButton.click(); equal( $table.find( 'tbody tr:eq(0) td:eq(0)' ).text(), previousText, previousText + ' is in the first row (descending)' ); $sortButton.click(); equal( $table.find( 'tbody tr:eq(4) td:eq(0)' ).text(), previousText, previousText + ' is in the third row (ascending)' ); }); module( 'tablesaw Sortable Switcher', { setup: setup( 'data-tablesaw-mode="columntoggle" data-tablesaw-sortable data-tablesaw-sortable-switch' ) }); test( 'Can sort descending with switcher', function() { var previousRow1Text = $table.find( 'tbody tr td' ).eq( 0 ).text(), $switcher = $table.prev().find( 'select' ).eq( 0 ); $switcher.val( '0_desc' ).trigger( 'change' ); notEqual( $table.find( 'tbody tr td' ).eq( 0 ).text(), previousRow1Text, 'First row is sorted descending' ); $switcher.val( '0_asc' ).trigger( 'change' ); equal( $table.find( 'tbody tr td' ).eq( 0 ).text(), previousRow1Text, 'First row is sorted ascending' ); }); test( 'Can sort numeric descending with switcher', function() { var $switcher = $table.prev().find( 'select' ).eq( 0 ); $switcher.val( '1_desc' ).trigger( 'change' ); equal( $table.find( 'tbody tr:eq(0) td:eq(1)' ).html(), '10', 'First row is sorted descending' ); $switcher.val( '1_asc' ).trigger( 'change' ); equal( $table.find( 'tbody tr:eq(0) td:eq(1)' ).html(), '1', 'First row is sorted ascending' ); }); module( 'tablesaw Mini Map', { setup: setup( 'data-tablesaw-mode="columntoggle" data-tablesaw-minimap' ) }); test( 'Initialization', function() { var $minimap = $table.prev().find( '.minimap' ); ok( $minimap.length, 'Minimap exists.' ); equal( $minimap.find( 'li' ).length, $table.find( 'tbody tr:eq(0) td' ).length, 'Minimap has same number of dots as columns.' ); }); module( 'tablesaw Mode Switch', { setup: setup( 'data-tablesaw-mode="stack" data-tablesaw-mode-switch' ) }); test( 'Initialization', function() { var $switcher = $table.prev().find( '.tablesaw-modeswitch' ); ok( $switcher.length, 'Mode Switcher exists.' ); }); test( 'Can switch to Swipe mode', function() { var $switcher = $table.prev().find( '.tablesaw-modeswitch' ).find( 'select' ); ok( !$table.hasClass( 'tablesaw-swipe' ), 'Doesn’t have class.' ); $switcher.val( 'swipe' ).trigger( 'change' ); ok( $table.hasClass( 'tablesaw-swipe' ), 'Has class.' ); }); test( 'Can switch to Column Toggle mode', function() { var $switcher = $table.prev().find( '.tablesaw-modeswitch' ).find( 'select' ); ok( !$table.hasClass( 'tablesaw-columntoggle' ), 'Doesn’t have class.' ); $switcher.val( 'columntoggle' ).trigger( 'change' ); ok( $table.hasClass( 'tablesaw-columntoggle' ), 'Has class.' ); }); module( 'tablesaw Stack Hide Empty', { setup: function(){ $fixture = $( '#qunit-fixture' ); $fixture.html( tableHtml.replace( /\%s/, 'data-tablesaw-mode="stack" data-tablesaw-hide-empty' ) ); $('table tbody tr:eq(3) td:eq(4)', $fixture).html(''); $( document ).trigger( 'enhance.tablesaw' ); } }); test( 'Empty cells are hidden', function() { $fixture = $( '#qunit-fixture' ); var testCell = $fixture.find( 'table tbody tr:eq(3) td:eq(4)' ); //not sure how to better test this if(window.innerWidth < 640){ ok( testCell.is(':hidden')); } else{ ok( testCell.is(':visible')); } }); }(jQuery));
{'content_hash': 'b99e8f5cb4f5148bc559a66552b8568c', 'timestamp': '', 'source': 'github', 'line_count': 302, 'max_line_length': 170, 'avg_line_length': 37.71854304635762, 'alnum_prop': 0.6035466596435782, 'repo_name': 'cindygp/froyo_pedidos', 'id': '6909c7b28f287f6c4ee3c18e2c8ff4b53dfe0410', 'size': '11395', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'assets/plugins/tablesaw/test/tablesaw_test.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '434'}, {'name': 'CSS', 'bytes': '2597298'}, {'name': 'CoffeeScript', 'bytes': '19442'}, {'name': 'HTML', 'bytes': '207382'}, {'name': 'JavaScript', 'bytes': '10292097'}, {'name': 'PHP', 'bytes': '1987054'}, {'name': 'Shell', 'bytes': '4528'}]}
# # #/*************************************************************************** # * * # * This program is free software; you can redistribute it and/or modify * # * it under the terms of the GNU General Public License as published by * # * the Free Software Foundation; either version 2 of the License, or * # * (at your option) any later version. * # * * # ***************************************************************************/ # CONFIGURATION PLUGIN_UPLOAD = $(CURDIR)/plugin_upload.py # Makefile for a PyQGIS plugin # translation SOURCES = environment_creator.py ui_environment_creator.py __init__.py environment_creatordialog.py #TRANSLATIONS = i18n/environment_creator_en.ts TRANSLATIONS = # global PLUGINNAME = environment_creator PY_FILES = environment_creator.py environment_creatordialog.py __init__.py EXTRAS = icon.png UI_FILES = ui_environment_creator.py RESOURCE_FILES = resources_rc.py HELP = help/build/html default: compile compile: $(UI_FILES) $(RESOURCE_FILES) %_rc.py : %.qrc pyrcc4 -o $*_rc.py $< %.py : %.ui pyuic4 -o $@ $< %.qm : %.ts lrelease $< # The deploy target only works on unix like operating system where # the Python plugin directory is located at: # $HOME/.qgis/python/plugins deploy: compile doc transcompile mkdir -p $(HOME)/.qgis/python/plugins/$(PLUGINNAME) cp -vf $(PY_FILES) $(HOME)/.qgis/python/plugins/$(PLUGINNAME) cp -vf $(UI_FILES) $(HOME)/.qgis/python/plugins/$(PLUGINNAME) cp -vf $(RESOURCE_FILES) $(HOME)/.qgis/python/plugins/$(PLUGINNAME) cp -vf $(EXTRAS) $(HOME)/.qgis/python/plugins/$(PLUGINNAME) cp -vfr i18n $(HOME)/.qgis/python/plugins/$(PLUGINNAME) cp -vfr $(HELP) $(HOME)/.qgis/python/plugins/$(PLUGINNAME)/help # The dclean target removes compiled python files from plugin directory # also delets any .svn entry dclean: find $(HOME)/.qgis/python/plugins/$(PLUGINNAME) -iname "*.pyc" -delete find $(HOME)/.qgis/python/plugins/$(PLUGINNAME) -iname ".svn" -prune -exec rm -Rf {} \; # The derase deletes deployed plugin derase: rm -Rf $(HOME)/.qgis/python/plugins/$(PLUGINNAME) # The zip target deploys the plugin and creates a zip file with the deployed # content. You can then upload the zip file on http://plugins.qgis.org zip: deploy dclean rm -f $(PLUGINNAME).zip cd $(HOME)/.qgis/python/plugins; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME) # Create a zip package of the plugin named $(PLUGINNAME).zip. # This requires use of git (your plugin development directory must be a # git repository). # To use, pass a valid commit or tag as follows: # make package VERSION=Version_0.3.2 package: compile rm -f $(PLUGINNAME).zip git archive --prefix=$(PLUGINNAME)/ -o $(PLUGINNAME).zip $(VERSION) echo "Created package: $(PLUGINNAME).zip" upload: zip $(PLUGIN_UPLOAD) $(PLUGINNAME).zip # transup # update .ts translation files transup: pylupdate4 Makefile # transcompile # compile translation files into .qm binary format transcompile: $(TRANSLATIONS:.ts=.qm) # transclean # deletes all .qm files transclean: rm -f i18n/*.qm clean: rm $(UI_FILES) $(RESOURCE_FILES) # build documentation with sphinx doc: cd help; make html
{'content_hash': 'bf66e75f0dbb6ff688c778e20042bf14', 'timestamp': '', 'source': 'github', 'line_count': 109, 'max_line_length': 99, 'avg_line_length': 30.660550458715598, 'alnum_prop': 0.6391382405745063, 'repo_name': 'arpho/mmasgis5', 'id': '4b44b6c649d30e16fd582dbd44cfd1163ae17e8c', 'size': '3767', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Environment_Creator/Makefile', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '617'}, {'name': 'C++', 'bytes': '856'}, {'name': 'CSS', 'bytes': '17115'}, {'name': 'JavaScript', 'bytes': '21348'}, {'name': 'Prolog', 'bytes': '1548'}, {'name': 'Python', 'bytes': '13348612'}]}
describe "Api::V1::Me::Programs" do let(:access_token) { create(:oauth_access_token) } let(:work) { create(:work, :with_current_season) } let(:episode) { create(:episode, work: work) } let!(:status) do create(:status, kind: "watching", work: work, user: access_token.owner) end let(:channel_work) do create(:channel_work, user: access_token.owner, work: work) end let!(:program) { create(:program, episode: episode, channel: channel_work.channel) } describe "GET /v1/me/programs" do before do data = { access_token: access_token.token } get api("/v1/me/programs", data) end it "responses 200" do expect(response.status).to eq(200) end it "gets programs which user is watching" do channel = channel_work.channel work = episode.work expected_hash = { "id" => program.id, "started_at" => "2017-01-28T15:00:00.000Z", "is_rebroadcast" => false, "channel" => { "id" => channel.id, "name" => channel.name }, "work" => { "id" => work.id, "title" => work.title, "title_kana" => work.title_kana, "media" => "tv", "media_text" => "TV", "season_name" => "2017-winter", "season_name_text" => "2017年冬", "released_on" => "2012-04-05", "released_on_about" => "2012年", "official_site_url" => "http://example.com", "wikipedia_url" => "http://wikipedia.org", "twitter_username" => "precure_official", "twitter_hashtag" => "precure", "mal_anime_id" => "12345", "images" => { "recommended_url" => "", "facebook" => { "og_image_url" => "" }, "twitter" => { "mini_avatar_url" => "https://twitter.com/precure_official/profile_image?size=mini", "normal_avatar_url" => "https://twitter.com/precure_official/profile_image?size=normal", "bigger_avatar_url" => "https://twitter.com/precure_official/profile_image?size=bigger", "original_avatar_url" => "https://twitter.com/precure_official/profile_image?size=original", "image_url" => "" } }, "episodes_count" => 1, "watchers_count" => 1, "reviews_count" => 0, "no_episodes" => false }, "episode" => { "id" => episode.id, "number" => episode.raw_number, "number_text" => episode.number, "sort_number" => episode.sort_number, "title" => episode.title, "records_count" => 0, "record_comments_count" => 0 } } expect(json["programs"][0]).to include(expected_hash) expect(json["total_count"]).to eq(1) expect(json["next_page"]).to eq(nil) expect(json["prev_page"]).to eq(nil) end end end
{'content_hash': '7b4074a3a4b748ec076023843aef4d8b', 'timestamp': '', 'source': 'github', 'line_count': 85, 'max_line_length': 106, 'avg_line_length': 34.64705882352941, 'alnum_prop': 0.5222410865874363, 'repo_name': 'elzzup/annict', 'id': '6aeaaaa372809e063a6db70fd8192751aad9d020', 'size': '2982', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spec/requests/api/v1/me/programs_spec.rb', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '48592'}, {'name': 'CoffeeScript', 'bytes': '16467'}, {'name': 'HTML', 'bytes': '153898'}, {'name': 'JavaScript', 'bytes': '791'}, {'name': 'Ruby', 'bytes': '294320'}]}
#include <pool/entropy_block.h> #include <stdlib.h> #include <string.h> #include <pthread.h> #include <global/defs.h> #include <global/math_defs.h> #include <global/alloc_type.h> #include <crypto/digest.h> #include <pool/entropy_block_digest.h> /** * Allocates memory for an entropy array. * * @param size The size of the entropy array to be allocated. * @param alloc_type The alloc type used for allocating the entropy array. * @return The address of a newly allocated entropy array if the operation was * successfull, NULL otherwise. */ static char* es_alloc_entropy_array(const int size, const int alloc_type) { char *array = NULL; switch(alloc_type) { case ES_NORMAL_ALLOC: /* * Normal allocation used for the current entropy array. Checks if * the operation succeeded or not should be done in the caller * function. */ array = (char*)malloc(size * sizeof(char)); break; case ES_CLEAN_ALLOC: /* * Clean allocation used for the current entropy array. Checks if * the operation succeeded or not should be done in the caller * function. */ array = (char*)calloc(size, sizeof(char)); break; default: /* * No allocation to be done in this case, which means the entropy * array will be NULL, which means the operation failed. */ break; } return array; } /** * Clears the contents of a given entropy array. * * @param array The array to be cleared. */ inline static void es_clear_entropy_array(char *array) { /* Clear the contents of the specified entropy array. */ memset(array, 0, sizeof(char) * strlen(array)); } /** * Free the memory used by an entropy array. A clean operation is performed * first to ensure no sensitive information (in this case, entropy bytes) are * in danger of being leaked. * * @param array The array to be freed. */ static void es_free_entropy_array(char **array) { /* Clear the contents of the specified entropy array. */ es_clear_entropy_array(*array); /* Free the entropy array. */ free(*array); *array = NULL; } /** * Compute the entropy percentage of the specified array in relation to the * maximum block threshold. * * @param array The array for which the percentage will be computed. * @param size The size of the specified array. * @return The entropy percentage of the specified array. */ static inline const double es_compute_array_entropy_percentage( const char *array, const int size) { return ((double)(strlen(array) * ES_MAXIMUM_BLOCK_THRESHOLD)) / size; } /** * Allocates memory for an entropy block. * * @param size The number of entropy bytes to be stored in an entropy block. * @param alloc_type The alloc type used for internal arrays. * @return The address of a newly allocated entropy block if the operation was * successfull, NULL otherwise. */ struct es_entropy_block* es_alloc_entropy_block( const int size, const int alloc_type) { int status = ES_FAILURE; struct es_entropy_block *block = NULL; /* Perform sanity checks. */ if(size <= 0) goto exit; if(es_validate_alloc_type(alloc_type) != ES_SUCCESS) goto exit; /* Allocate memory for the entropy block structure. */ block = (struct es_entropy_block*)malloc(sizeof(struct es_entropy_block)); if(!block) goto exit; /* Allocate memory for the main entropy array. */ block->content = es_alloc_entropy_array(size, alloc_type); if(!block->content) goto exit; /* * Allocate memory for the internal buffer. The size of the buffer is equal * to the size of the main entropy array. */ block->buffer = es_alloc_entropy_array(size, alloc_type); if(!block->buffer) goto exit; /* Initialize the underlying mutex. */ if(pthread_mutex_init(&block->mutex, NULL)) goto exit; /* Update the operation status. */ status = ES_SUCCESS; exit: /* If the operation failed, free the partially allocated entropy block. */ if(status == ES_FAILURE && block) es_free_entropy_block(&block); return block; } /** * Frees the memory used by an entropy block. * * @param block The entropy block to be freed. */ void es_free_entropy_block(struct es_entropy_block **block) { /* Perform sanity checks. */ if(!block || !(*block)) return; /* Free both the main entropy array and the internal buffer. */ if((*block)->content) es_free_entropy_array(&(*block)->content); if((*block)->buffer) es_free_entropy_array(&(*block)->buffer); /* Destroy the mutex associated with the current entropy block. */ pthread_mutex_destroy(&(*block)->mutex); /* Free the entropy block structure. */ free(*block); *block = NULL; } /** * Initializes an etropy block with the default values. * * @param block The entropy block to be initialized. * @param size The number of entropy bytes to be stored in an entropy block. * @return ES_SUCCESS if the operation was successfull, ES_FAILURE otherwise. */ const int es_init_entropy_block(struct es_entropy_block *block, const int size) { /* Perform sanity checks. */ if(!block) return ES_FAILURE; if(size <= 0) return ES_FAILURE; /* Initialize the structure fields with their default values. */ block->size = size; block->state = ES_DIRTY_BLOCK_STATE; block->threshold = ES_MINIMUM_BLOCK_THRESHOLD; block->digest_type = ES_SHA512_DIGEST; return ES_SUCCESS; } /** * Creates an entropy block. * * @param size The number of entropy bytes to be stored in an entropy block. * @param alloc_type The alloc type used for internal arrays. * @return The address of a newly allocated entropy block if the operation was * successfull, NULL otherwise. */ struct es_entropy_block* es_create_entropy_block( const int size, const int alloc_type) { int status = ES_FAILURE; struct es_entropy_block *block = NULL; /* Perform sanity checks. */ if(size <= 0) goto exit; if(es_validate_alloc_type(alloc_type) != ES_SUCCESS) goto exit; /* Allocate memory for the new entropy block. */ block = es_alloc_entropy_block(size, alloc_type); if(!block) goto exit; /* Initialize the entropy block fields with their default values. */ if(es_init_entropy_block(block, size) != ES_SUCCESS) goto exit; /* Update the operation status. */ status = ES_SUCCESS; exit: /* If the operation failed, destroy the partially created entropy block. */ if(status == ES_FAILURE && block) es_destroy_entropy_block(&block); return block; } /** * Destroys an entropy block. * * @param block The entropy block to be destroyed. */ void es_destroy_entropy_block(struct es_entropy_block **block) { /* Free the given entropy block. */ es_free_entropy_block(block); } /** * Validates an entropy block. * * @param block The entropy block to be validated. * @return ES_SUCCESS if the operation was successfull, ES_FAILURE otherwise. */ const int es_validate_entropy_block(struct es_entropy_block *block) { /* Perform sanity checks. */ if(!block) return ES_FAILURE; /* Perform field validation. */ if(!block->content) return ES_FAILURE; if(!block->buffer) return ES_FAILURE; if(es_validate_entropy_block_state(block->state) != ES_SUCCESS) return ES_FAILURE; if(block->threshold < ES_MINIMUM_BLOCK_THRESHOLD || ES_MINIMUM_BLOCK_THRESHOLD > ES_MAXIMUM_BLOCK_THRESHOLD) return ES_FAILURE; if(!es_validate_digest_type(block->digest_type) != ES_SUCCESS) return ES_FAILURE; return ES_SUCCESS; } /** * Updates the contents of the specified entropy block with the new content * array. Depending on the value of the block threshold, the content may be * written to the internal buffer or directly to the main array. * * @param block The entropy block to be updated. * @param content The contents to be written to the specified entropy block. * @return ES_SUCCESS if the operation was successfull, ES_FAILURE otherwise. */ const int es_update_entropy_block_content( struct es_entropy_block *block, const char *content) { int buffer_size = 0; int copy_size = 0; double block_percentage = 0.0; char *digest = NULL; /* Perform sanity checks. */ if(!block) return ES_FAILURE; if(!es_validate_entropy_block(block) != ES_SUCCESS) return ES_FAILURE; if(!content) return ES_FAILURE; /* * Append the given content to the entropy block buffer. In some cases there * might be only a partial copy of the given content into the buffer (when * the entropy block buffer has fewer empty positions than the number needed * to completely append the given content). The copy size is then the * minimum value between the size of the given content and the remaining * space in the entropy block buffer. */ buffer_size = strlen(block->buffer); copy_size = es_min(strlen(content), block->size - buffer_size - 1); strncat(block->buffer, content, copy_size); block->buffer[strlen(block->buffer) - 1] = '\0'; /* * Compute the entropy percentage for the entropy block buffer. If the * percentage is lower than the threshold, then the update ends here. Only * if the percentage is higher or at least equal with the threshold should * the buffer content be mixed with the main entropy array. */ block_percentage = es_compute_array_entropy_percentage( block->buffer, block->size); if(block->threshold > block_percentage) return ES_SUCCESS; /* * Mix both the main entropy array and the entropy block buffer by computing * their digest. */ if(es_compute_digest_2( block->digest_type, block->content, block->buffer, &digest) != ES_SUCCESS) return ES_FAILURE; /* * The entropy block buffer and the main entropy array must be cleared in * order to avoid any leaks of sensitive information (in this case, entropy * bytes). */ es_clear_entropy_array(block->content); es_clear_entropy_array(block->buffer); /* Copy the contents of the computed digest into the main entropy array. */ strncpy(block->content, digest, block->size - 1); block->content[block->size - 1] = '\0'; /* Free the digest array. */ free(digest); /* * Change the block state to clean now that the new content has been * written. */ block->state = ES_CLEAN_BLOCK_STATE; return ES_SUCCESS; } /** * Requests the content of the specified entropy block. A copy of the block * content is performed and the responsibility for freeing it goes to the caller * function. * * @param block The entropy block for which we request the content. * @param content A copy of the contents of the specified entropy block. * @return ES_SUCCESS if the operation was successfull, ES_FAILURE otherwise. */ const int es_request_entropy_block_content( struct es_entropy_block *block, char **content) { /* Perform sanity checks. */ if(!block) return ES_FAILURE; if(!es_validate_entropy_block(block) != ES_SUCCESS) return ES_FAILURE; if(block->state == ES_DIRTY_BLOCK_STATE) return ES_FAILURE; /* Allocate memory for the entropy block content copy. */ *content = (char*)calloc(block->size, sizeof(char)); if(!*content) return ES_FAILURE; /* Copy the contents of the current entropy block. */ strncpy(*content, block->content, block->size); /* * Change the block state to dirty now that the block content has been * consumed. */ block->state = ES_DIRTY_BLOCK_STATE; return ES_SUCCESS; } /** * Validates the specified entropy block state. * * @param block_state The block state to be validated. * @return ES_SUCCESS if the operation was successfull, ES_FAILURE otherwise. */ inline const int es_validate_entropy_block_state(const int block_state) { switch(block_state) { case ES_CLEAN_BLOCK_STATE: case ES_DIRTY_BLOCK_STATE: /* Block state is valid. */ return ES_SUCCESS; default: /* Block state is invalid. */ return ES_FAILURE; } }
{'content_hash': '6bc779fe0b9b813acf55493a7100d1c7', 'timestamp': '', 'source': 'github', 'line_count': 436, 'max_line_length': 80, 'avg_line_length': 26.738532110091743, 'alnum_prop': 0.7040658775090067, 'repo_name': 'cvpoienaru/EntropySource', 'id': '3d65b0a3abbe51d60685ae3b5cf1471545e2195c', 'size': '13058', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/pool/entropy_block.c', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'Arduino', 'bytes': '9310'}, {'name': 'C', 'bytes': '209698'}, {'name': 'Makefile', 'bytes': '22150'}, {'name': 'Shell', 'bytes': '9084'}]}
Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **partyIdentifier** | **String** | An identifier for the Party that is unique within a given context.. | [optional] **addresses** | [**[Address1]**](Address1.md) | An array of the Party&#39;s addresses. | [optional] **description** | **String** | An optional description of the Party. | [optional] [default to &#39;null&#39;] **preferences** | [**[Preferences]**](Preferences.md) | A list of Preferences associated with the Party. | [optional] **registeredIds** | [**[RegisteredIdentifier1]**](RegisteredIdentifier1.md) | An identifier for a Party that has been assigend by a recognized or statutory body. | [optional] **organizationName** | [**OrganizationName1**](OrganizationName1.md) | | [optional] **otherOrganizationNames** | [**[OrganizationName1]**](OrganizationName1.md) | | [optional]
{'content_hash': 'f92f7d7e3beb88e868fbaf7a76e43301', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 175, 'avg_line_length': 81.81818181818181, 'alnum_prop': 0.6511111111111111, 'repo_name': 'commonality/archetypes', 'id': '2bebe20ef024851641de7a84175bf03bebca6d09', 'size': '936', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/api/archetypes/v1/party/js/CompanyGroup.md', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'JavaScript', 'bytes': '3333'}]}
using System; using System.Diagnostics.CodeAnalysis; namespace Restall.Ichnaea.Demo.Web.Accounts { [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global", Justification = CodeAnalysisJustification.DtoParticipatesInSerialisation)] public class GetAccountResponse { public Guid Id { get; set; } public string SortCode { get; set; } public string AccountNumber { get; set; } public string Holder { get; set; } public decimal Balance { get; set; } public decimal Overdraft { get; set; } public Uri CreditAccountUri { get; set; } public Uri DebitAccountUri { get; set; } public Uri GetAllAccountsUri { get; set; } } }
{'content_hash': 'df9196c7183aaf86ba3949b808ef1e22', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 142, 'avg_line_length': 24.25925925925926, 'alnum_prop': 0.7358778625954199, 'repo_name': 'pete-restall/Ichnaea', 'id': '9a5c4cc024e6f4cb58724fbd4d567ef1386183d6', 'size': '655', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Ichnaea.Demo/Web/Accounts/GetAccountResponse.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '353097'}]}
package org.mifos.test.acceptance.framework.loanproduct; import org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage; import org.mifos.test.acceptance.framework.MifosPage; import com.thoughtworks.selenium.Selenium; public class DefineProductMixConfirmationPage extends MifosPage { public DefineProductMixConfirmationPage(Selenium selenium) { super(selenium); verifyPage("createProductsMixConfirmation"); } public ClientsAndAccountsHomepage navigateToClientsAndAccountsUsingHeaderTab() { selenium.click("header.link.clientsAndAccounts"); waitForPageToLoad(); return new ClientsAndAccountsHomepage(selenium); } }
{'content_hash': 'e906658e77ccba597ce3e0644cfd41a0', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 84, 'avg_line_length': 31.09090909090909, 'alnum_prop': 0.7821637426900585, 'repo_name': 'madhav123/gkmaster', 'id': 'b2ad91bd1ffdc0af621268469c62a231ad61c256', 'size': '1445', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'acceptanceTests/src/test/java/org/mifos/test/acceptance/framework/loanproduct/DefineProductMixConfirmationPage.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '160631'}, {'name': 'Java', 'bytes': '19827990'}, {'name': 'JavaScript', 'bytes': '1140843'}, {'name': 'Python', 'bytes': '37612'}, {'name': 'Shell', 'bytes': '54460'}]}
using System; using System.Windows.Forms; namespace Uhr { static class Program { [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Main()); } } }
{'content_hash': '9b8008b21532a55a1f2ae3aeada21134', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 65, 'avg_line_length': 19.9375, 'alnum_prop': 0.5830721003134797, 'repo_name': 'Sghirate/7wUhr', 'id': '79a00d2fbaa1b4ac77b3895482dcf001fd681b6c', 'size': '321', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Program.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '6937'}]}
``` courses = ["Design Research", "Design & Philosophy", "Typography", "Graphic Design", "Digital Media", "Photography", "Computer Skills", "Workgroup", "Media Theory"] print len(courses) print courses[2] del courses[8] courses.append("Media Theory") print courses ```
{'content_hash': '9367b05ca76ca28b651cd0ae9316c535', 'timestamp': '', 'source': 'github', 'line_count': 8, 'max_line_length': 164, 'avg_line_length': 33.5, 'alnum_prop': 0.7164179104477612, 'repo_name': 'ArtezGDA/text-IO', 'id': '05740f2ddfdf7e6ac93076443ba37bc55d4233be', 'size': '268', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Bella/1.array.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '312828'}, {'name': 'JavaScript', 'bytes': '6634'}, {'name': 'Python', 'bytes': '2718648'}, {'name': 'Ruby', 'bytes': '846066'}, {'name': 'Shell', 'bytes': '613'}]}
Installs ExpanDrive. http://www.expandrive.com/ ## Usage ```puppet include expandrive ``` ## Required Puppet Modules * `boxen` ## Development Write code. Run `script/cibuild` to test it. Check the `script` directory for other useful tools.
{'content_hash': 'e6ab23844e6b274e166013abeec6afcf', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 63, 'avg_line_length': 13.722222222222221, 'alnum_prop': 0.7206477732793523, 'repo_name': 'covermymeds/puppet-expandrive', 'id': '7c093cbbd7bc7e2c437192727a29661fa6f1f263', 'size': '279', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Puppet', 'bytes': '287'}, {'name': 'Ruby', 'bytes': '505'}, {'name': 'Shell', 'bytes': '416'}]}
shared_examples_for 'an idempotent method' do it 'is idempotent' do first = subject error = 'RSpec not configured for threadsafety' fail error unless RSpec.configuration.threadsafe? mutex = __memoized.instance_variable_get(:@mutex) memoized = __memoized.instance_variable_get(:@memoized) mutex.synchronize { memoized.delete(:subject) } should equal(first) end end
{'content_hash': 'a0b3ca1323ec9061175d9ae9b60f799f', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 59, 'avg_line_length': 36.0, 'alnum_prop': 0.7196969696969697, 'repo_name': 'zaidan/devtools', 'id': 'be0755ee356b5b67dd0714b315add6a6496f3b71', 'size': '396', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'shared/spec/shared/idempotent_method_behavior.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '37092'}]}
<resources> <string name="app_name">Walther</string> <string name="main_screen_text">Coming soon.</string> </resources>
{'content_hash': 'd39f03bbeb980b2c9e4f745d27460e9b', 'timestamp': '', 'source': 'github', 'line_count': 4, 'max_line_length': 57, 'avg_line_length': 32.0, 'alnum_prop': 0.6875, 'repo_name': 'waltaro/walther', 'id': 'da3b3e0b38624fa0a23d7a95db0fd8086c116e63', 'size': '128', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'app/src/main/res/values/strings.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Kotlin', 'bytes': '4446'}]}
public enum RadioMessageType { Greeting, FollowMe, Attack, AcknowledgeOrder, HelpMe, } public struct RadioMessage { private readonly Ship source; private RadioMessageType messageType; public Ship SourceShip { get { return source; } } public RadioMessageType MessageType { get { return messageType; } } public RadioMessage(Ship source, RadioMessageType messageType) { this.source = source; this.messageType = messageType; } }
{'content_hash': 'a191d53473129aee6b65f47b051710fb', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 71, 'avg_line_length': 19.76, 'alnum_prop': 0.6842105263157895, 'repo_name': 'spriest487/spacetrader-unity', 'id': '8d4a8d2db431f8e7cea2293eacf16aeffac06fd8', 'size': '494', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Assets/Ships/RadioMessage.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '460012'}, {'name': 'GLSL', 'bytes': '4175'}]}
ACCEPTED #### According to IRMNG Homonym List #### Published in Conch. , 1, 186. #### Original name null ### Remarks null
{'content_hash': 'c90c5e2ab7a9a011ffe680f0cd57dc9e', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 18, 'avg_line_length': 9.615384615384615, 'alnum_prop': 0.656, 'repo_name': 'mdoering/backbone', 'id': '7accd881553dcc8d1053d9499265629fc3fb576e', 'size': '175', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/incertae sedis/Discolites/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
<div class="commune_descr limited"> <p> Saint-Chély-d'Aubrac est un village géographiquement positionné dans le département de l'Aveyron en Midi-Pyrénées. Elle totalisait 546 habitants en 2008.</p> <p>À Saint-Chély-d'Aubrac, la valorisation moyenne à la vente d'un appartement se situe à zero &euro; du m² en vente. La valeur moyenne d'une maison à l'achat se situe à 1&nbsp;116 &euro; du m². À la location la valorisation moyenne se situe à 0 &euro; du m² par mois.</p> <p>Si vous pensez emmenager à Saint-Chély-d'Aubrac, vous pourrez aisément trouver une maison à vendre. </p> <p>Le nombre d'habitations, à Saint-Chély-d'Aubrac, était réparti en 2011 en 33 appartements et 443 maisons soit un marché relativement équilibré.</p> <p>La ville propose de nombreux équipements sportifs, elle propose entre autres un bassin de natation, deux terrains de tennis, un domaine skiable et deux boucles de randonnée.</p> <p>À proximité de Saint-Chély-d'Aubrac sont positionnées géographiquement les communes de <a href="{{VLROOT}}/immobilier/castelnau-de-mandailles_12061/">Castelnau-de-Mandailles</a> localisée à 6&nbsp;km, 548 habitants, <a href="{{VLROOT}}/immobilier/lassouts_12124/">Lassouts</a> localisée à 12&nbsp;km, 313 habitants, <a href="{{VLROOT}}/immobilier/saint-come-dolt_12216/">Saint-Côme-d'Olt</a> à 12&nbsp;km, 1&nbsp;387 habitants, <a href="{{VLROOT}}/immobilier/nasbinals_48104/">Nasbinals</a> située à 12&nbsp;km, 519 habitants, <a href="{{VLROOT}}/immobilier/cayrol_12064/">Le&nbsp;Cayrol</a> située à 10&nbsp;km, 285 habitants, <a href="{{VLROOT}}/immobilier/montpeyroux_12156/">Montpeyroux</a> située à 9&nbsp;km, 571 habitants, entre autres. De plus, Saint-Chély-d'Aubrac est située à seulement 29&nbsp;km de <a href="{{VLROOT}}/immobilier/marvejols_48092/">Marvejols</a>.</p> </div>
{'content_hash': 'd29c75ab631e99e2d7700676b07161e1', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 272, 'avg_line_length': 95.73684210526316, 'alnum_prop': 0.7487630566245189, 'repo_name': 'donaldinou/frontend', 'id': '0a6dc2808faef8789e83e42a02c274d63ff644e2', 'size': '1869', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Viteloge/CoreBundle/Resources/descriptions/12214.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '3073'}, {'name': 'CSS', 'bytes': '111338'}, {'name': 'HTML', 'bytes': '58634405'}, {'name': 'JavaScript', 'bytes': '88564'}, {'name': 'PHP', 'bytes': '841919'}]}
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE762_Mismatched_Memory_Management_Routines__new_array_free_int64_t_72a.cpp Label Definition File: CWE762_Mismatched_Memory_Management_Routines__new_array_free.label.xml Template File: sources-sinks-72a.tmpl.cpp */ /* * @description * CWE: 762 Mismatched Memory Management Routines * BadSource: Allocate data using new [] * GoodSource: Allocate data using malloc() * Sinks: * GoodSink: Deallocate data using delete [] * BadSink : Deallocate data using free() * Flow Variant: 72 Data flow: data passed in a vector from one function to another in different source files * * */ #include "std_testcase.h" #include <vector> using namespace std; namespace CWE762_Mismatched_Memory_Management_Routines__new_array_free_int64_t_72 { #ifndef OMITBAD /* bad function declaration */ void badSink(vector<int64_t *> dataVector); void bad() { int64_t * data; vector<int64_t *> dataVector; /* Initialize data*/ data = NULL; /* POTENTIAL FLAW: Allocate memory with a function that requires delete [] to free the memory */ data = new int64_t[100]; /* Put data in a vector */ dataVector.insert(dataVector.end(), 1, data); dataVector.insert(dataVector.end(), 1, data); dataVector.insert(dataVector.end(), 1, data); badSink(dataVector); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void goodG2BSink(vector<int64_t *> dataVector); static void goodG2B() { int64_t * data; vector<int64_t *> dataVector; /* Initialize data*/ data = NULL; /* FIX: Allocate memory from the heap using malloc() */ data = (int64_t *)malloc(100*sizeof(int64_t)); if (data == NULL) {exit(-1);} /* Put data in a vector */ dataVector.insert(dataVector.end(), 1, data); dataVector.insert(dataVector.end(), 1, data); dataVector.insert(dataVector.end(), 1, data); goodG2BSink(dataVector); } /* goodB2G uses the BadSource with the GoodSink */ void goodB2GSink(vector<int64_t *> dataVector); static void goodB2G() { int64_t * data; vector<int64_t *> dataVector; /* Initialize data*/ data = NULL; /* POTENTIAL FLAW: Allocate memory with a function that requires delete [] to free the memory */ data = new int64_t[100]; dataVector.insert(dataVector.end(), 1, data); dataVector.insert(dataVector.end(), 1, data); dataVector.insert(dataVector.end(), 1, data); goodB2GSink(dataVector); } void good() { goodG2B(); goodB2G(); } #endif /* OMITGOOD */ } /* close namespace */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN using namespace CWE762_Mismatched_Memory_Management_Routines__new_array_free_int64_t_72; /* so that we can use good and bad easily */ int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
{'content_hash': 'fa55cedcf5209db9dfc444fd8bee4290', 'timestamp': '', 'source': 'github', 'line_count': 122, 'max_line_length': 133, 'avg_line_length': 28.704918032786885, 'alnum_prop': 0.6570531125071388, 'repo_name': 'JianpingZeng/xcc', 'id': 'dc60ee438044b1107f8b594054f4f036e94142b9', 'size': '3502', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'xcc/test/juliet/testcases/CWE762_Mismatched_Memory_Management_Routines/s05/CWE762_Mismatched_Memory_Management_Routines__new_array_free_int64_t_72a.cpp', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []}
configPriority="0" # ------------------- Do not alter this section -------------------- existingEnvVars=() function setvar() { if [[ "$configPriority" == "0" ]]; then test -z "$(eval "echo \$$1")" && export $1=$2 || existingEnvVars=("${existingEnvVars[@]}" $1) else export $1=$2 fi } # ------------------------------------------------------------------ # ================================================================== # GeoMesa Environment Variables # ================================================================== # To change %%gmtools.dist.name%%_HOME and/or GEOMESA_CONF_DIR, export the desired path to the respective variable # before running any scripts. These existing environmental variables will not be overwritten. # GeoMesa lib directory. # This resides inside GeoMesa tools by default but can be moved elsewhere. If this is # not set but %%gmtools.dist.name%%_HOME is, this will default to %%gmtools.dist.name%%_HOME/lib. # # setvar GEOMESA_LIB /path/to/geomesa-$VERSION/dist/tools/geomesa-tools-$VERSION/lib # GeoMesa logs directory. # This resides inside GeoMesa tools by default but can be moved elsewhere. If this is # not set but %%gmtools.dist.name%%_HOME is, this will default to %%gmtools.dist.name%%_HOME/logs. # # setvar GEOMESA_LOG_DIR /path/to/geomesa-$VERSION/dist/tools/geomesa-tools-$VERSION/logs # ================================================================== # Cassandra Environment Variables # ================================================================== # Cassandra home directory # # setvar CASSANDRA_HOME /path/to/cassandra # ================================================================== # Java Environment Variables # ================================================================== # Prepend user defined classpaths to the GEOMESA_CP (class path variable) # Follows the standard Java classpaths syntax # # setvar GEOMESA_EXTRA_CLASSPATHS /some/dir/:/another/dir/ # Java library path. Used to set GeoMesa Options. # # setvar JAVA_LIBRARY_PATH /path/to/java/library # Java command parameters. # $JAVA_OPTS is included by default, editing this option will overwrite this default. # Add additional options after {$JAVA_OPTS} to preserve current JAVA_OPTS. # Replace {$JAVA_OPTS} to use different java options. # # setvar CUSTOM_JAVA_OPTS "{$JAVA_OPTS}"
{'content_hash': '245cd7f4e0f04f8b797b0f8c93514b3a', 'timestamp': '', 'source': 'github', 'line_count': 63, 'max_line_length': 114, 'avg_line_length': 37.12698412698413, 'alnum_prop': 0.5733219324497648, 'repo_name': 'aheyne/geomesa', 'id': 'ee2d1af31a12c331169135afad2ad9afcb068d80', 'size': '3282', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'geomesa-cassandra/geomesa-cassandra-tools/conf-filtered/geomesa-env.sh', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '2900'}, {'name': 'Java', 'bytes': '250636'}, {'name': 'JavaScript', 'bytes': '140'}, {'name': 'Python', 'bytes': '12067'}, {'name': 'R', 'bytes': '2716'}, {'name': 'Scala', 'bytes': '8104315'}, {'name': 'Scheme', 'bytes': '3143'}, {'name': 'Shell', 'bytes': '155348'}]}
package io.aeron.cluster; import java.util.concurrent.TimeUnit; import static org.agrona.BitUtil.findNextPositivePowerOfTwo; /** * Supplies an instance of a {@link WheelTimerService} based on the configuration given to the constructor */ public class WheelTimerServiceSupplier implements TimerServiceSupplier { private final TimeUnit timeUnit; private final long startTime; private final long tickResolution; private final int ticksPerWheel; /** * Construct the supplier with the necessary parameters to configure the timer wheel. * * @param timeUnit for the values used to express the time. This time unit is used to denote the supplied * time values. When the instance is constructed it will use this to convert the supplied * <code>startTime</code> and <code>tickResolution</code> into the time unit that is being * used by the cluster clock. * @param startTime for the wheel (in given {@link TimeUnit}). * @param tickResolution for the wheel, i.e. how many {@link TimeUnit}s per tick. * @param ticksPerWheel or spokes, for the wheel (must be power of 2). */ public WheelTimerServiceSupplier( final TimeUnit timeUnit, final long startTime, final long tickResolution, final int ticksPerWheel) { this.timeUnit = timeUnit; this.startTime = startTime; this.tickResolution = tickResolution; this.ticksPerWheel = ticksPerWheel; } /** * {@inheritDoc} */ public TimerService newInstance(final TimeUnit clusterTimeUnit, final TimerService.TimerHandler timerHandler) { final long startTimeInClusterTimeUnits = clusterTimeUnit.convert(startTime, timeUnit); final long resolutionInClusterTimeUnits = clusterTimeUnit.convert(tickResolution, timeUnit); return new WheelTimerService( timerHandler, clusterTimeUnit, startTimeInClusterTimeUnits, findNextPositivePowerOfTwo(resolutionInClusterTimeUnits), ticksPerWheel); } }
{'content_hash': '03f1737530ba29363fd47425599b6658', 'timestamp': '', 'source': 'github', 'line_count': 56, 'max_line_length': 116, 'avg_line_length': 38.482142857142854, 'alnum_prop': 0.679814385150812, 'repo_name': 'mikeb01/Aeron', 'id': '061c0d612a04c3534c4399ef7be1ec3073a34da7', 'size': '2759', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'aeron-cluster/src/main/java/io/aeron/cluster/WheelTimerServiceSupplier.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '41480'}, {'name': 'C', 'bytes': '2135180'}, {'name': 'C++', 'bytes': '2826597'}, {'name': 'CMake', 'bytes': '81425'}, {'name': 'Dockerfile', 'bytes': '2186'}, {'name': 'Java', 'bytes': '7084749'}, {'name': 'Shell', 'bytes': '65347'}]}
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using WizardsChess.Chess; using WizardsChess.Movement; using WizardsChess.Movement.Drv; using WizardsChess.VoiceControl; using WizardsChess.VoiceControl.Commands; using WizardsChess.VoiceControl.Events; using WizardsChessTest.Mocks.Movement.Drv; namespace WizardsChessTest.Movement { [TestClass] public class MoveTesting { [TestMethod] public void TestMoveComponentCompilation() { ChessLogic logic = new ChessLogic(); movePlanner = new MovePlanner(logic.Board); constructAnAxis(ref xMover, ref xCalibrator, ref xPreciseMover, ref xGridMover); constructAnAxis(ref yMover, ref yCalibrator, ref yPreciseMover, ref yGridMover); var magnet = new MockMagnet(); movePerformer = new MovePerformer(xGridMover, yGridMover, magnet); moveManager = new MoveManager(movePlanner, movePerformer); } [TestMethod] public void TestMovePerformerMove() { TestMoveComponentCompilation(); int targetX = 2; int targetY = -2; movePerformer.CalibrateAsync().Wait(); var list = new List<Point2D>() { new Point2D(-1, -1), new Point2D(targetX, targetY) }; movePerformer.MovePieceAsync(list).Wait(); Assert.AreEqual(targetX, xGridMover.GridPosition,"The xMotor didn't end where expected."); Assert.AreEqual(targetY, yGridMover.GridPosition, "The yMotor didn't end where expected."); Assert.AreEqual(targetX, (int)Math.Round((float)xMover.Locator.Position / xCalibrator.StepsPerGridUnit), "xPreciseMover was not where expected."); Assert.AreEqual(targetY, (int)Math.Round((float)yMover.Locator.Position / yCalibrator.StepsPerGridUnit), "yPreciseMover was not where expected."); } [TestMethod] public void TestMovePerformerOneMoveInList() { TestMoveComponentCompilation(); movePerformer.MovePieceAsync(new List<Point2D>() { new Point2D(1, 1) }).Wait(); Assert.AreEqual(0, xGridMover.GridPosition, "The xMotor didn't end where expected."); Assert.AreEqual(0, yGridMover.GridPosition, "The yMotor didn't end where expected."); Assert.AreEqual(0, (int)Math.Round((float)xMover.Locator.Position / xCalibrator.StepsPerGridUnit), "xPreciseMover was not where expected."); Assert.AreEqual(0, (int)Math.Round((float)yMover.Locator.Position / yCalibrator.StepsPerGridUnit), "yPreciseMover was not where expected."); } [TestMethod] public void TestMovePerformerEmptyList() { TestMoveComponentCompilation(); movePerformer.MovePieceAsync(new List<Point2D>() { new Point2D(1, 1) }).Wait(); Assert.AreEqual(0, xGridMover.GridPosition, "The xMotor didn't end where expected."); Assert.AreEqual(0, yGridMover.GridPosition, "The yMotor didn't end where expected."); Assert.AreEqual(0, (int)Math.Round((float)xMover.Locator.Position / xCalibrator.StepsPerGridUnit), "xPreciseMover was not where expected."); Assert.AreEqual(0, (int)Math.Round((float)yMover.Locator.Position / yCalibrator.StepsPerGridUnit), "yPreciseMover was not where expected."); } private IMotorMover xMover; private IMotorMover yMover; private IMotorCalibrator xCalibrator; private IMotorCalibrator yCalibrator; private IPreciseMotorMover xPreciseMover; private IPreciseMotorMover yPreciseMover; private IGridMotorMover xGridMover; private IGridMotorMover yGridMover; private IMovePerformer movePerformer; private IMovePlanner movePlanner; private IMoveManager moveManager; private void constructAnAxis(ref IMotorMover mover, ref IMotorCalibrator calibrator, ref IPreciseMotorMover preciseMover, ref IGridMotorMover gridMover) { var motor = MockMotor.Create(); var locator = new MotorLocator(new MockGpio(), motor.Information); var signaler = new PositionSignaler(locator); mover = new MotorMover(3, signaler, locator, motor); var topInterrupter = new MockPhotoInterrupter(1, 4, 6, locator, motor); var bottomInterrupter = new MockPhotoInterrupter(-1, -6, -4, locator, motor); calibrator = new MotorCalibrator(-5, 5, mover, motor.Information, topInterrupter, bottomInterrupter); preciseMover = new PreciseMotorMover(mover); gridMover = new GridMotorMover(preciseMover, calibrator); } } }
{'content_hash': '4705ff5fe8ab84b71df3047e29afa487', 'timestamp': '', 'source': 'github', 'line_count': 99, 'max_line_length': 154, 'avg_line_length': 43.333333333333336, 'alnum_prop': 0.7696969696969697, 'repo_name': 'MorganR/wizards-chess', 'id': 'd5b075506d2a51c151049d4a4a645cf9149a7768', 'size': '4292', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'WizardsChess/WizardsChessTest/Movement/MoveTesting.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C#', 'bytes': '257960'}, {'name': 'Shell', 'bytes': '545'}]}
using message_center::MessageCenter; namespace ash { namespace { const char kUsbPeripheralInvalidDpCableNotificationId[] = "cros_usb_peripheral_invalid_dp_cable_notification_id"; const char kUsbPeripheralInvalidUSB4ValidTBTCableNotificationId[] = "cros_usb_peripheral_invalid_usb4_valid_tbt_cable_notification_id"; const char kUsbPeripheralInvalidUSB4CableNotificationId[] = "cros_usb_peripheral_invalid_usb4_cable_notification_id"; const char kUsbPeripheralInvalidTBTCableNotificationId[] = "cros_usb_peripheral_invalid_tbt_cable_notification_id"; const char kUsbPeripheralSpeedLimitingCableNotificationId[] = "cros_usb_peripheral_speed_limiting_cable_notification_id"; } // namespace class UsbPeripheralNotificationControllerTest : public AshTestBase { public: UsbPeripheralNotificationControllerTest() = default; UsbPeripheralNotificationControllerTest( const UsbPeripheralNotificationControllerTest&) = delete; UsbPeripheralNotificationControllerTest& operator=( const UsbPeripheralNotificationControllerTest&) = delete; ~UsbPeripheralNotificationControllerTest() override = default; UsbPeripheralNotificationController* controller() { return Shell::Get()->usb_peripheral_notification_controller(); } private: }; TEST_F(UsbPeripheralNotificationControllerTest, InvalidDpCableNotification) { EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 0u); controller()->OnInvalidDpCableWarning(); EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 1u); message_center::Notification* notification = MessageCenter::Get()->FindVisibleNotificationById( kUsbPeripheralInvalidDpCableNotificationId); ASSERT_TRUE(notification); EXPECT_EQ(notification->buttons().size(), 1u); controller()->OnInvalidDpCableWarning(); EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 1u); } TEST_F(UsbPeripheralNotificationControllerTest, InvalidUSB4ValidTBTCableNotification) { EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 0u); controller()->OnInvalidUSB4ValidTBTCableWarning(); EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 1u); message_center::Notification* notification = MessageCenter::Get()->FindVisibleNotificationById( kUsbPeripheralInvalidUSB4ValidTBTCableNotificationId); ASSERT_TRUE(notification); EXPECT_EQ(notification->buttons().size(), 1u); controller()->OnInvalidUSB4ValidTBTCableWarning(); EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 1u); } TEST_F(UsbPeripheralNotificationControllerTest, InvalidUSB4CableNotification) { EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 0u); controller()->OnInvalidUSB4CableWarning(); EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 1u); message_center::Notification* notification = MessageCenter::Get()->FindVisibleNotificationById( kUsbPeripheralInvalidUSB4CableNotificationId); ASSERT_TRUE(notification); EXPECT_EQ(notification->buttons().size(), 1u); controller()->OnInvalidUSB4CableWarning(); EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 1u); } TEST_F(UsbPeripheralNotificationControllerTest, InvalidTBTCableNotification) { EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 0u); controller()->OnInvalidTBTCableWarning(); EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 1u); message_center::Notification* notification = MessageCenter::Get()->FindVisibleNotificationById( kUsbPeripheralInvalidTBTCableNotificationId); ASSERT_TRUE(notification); EXPECT_EQ(notification->buttons().size(), 1u); controller()->OnInvalidTBTCableWarning(); EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 1u); } TEST_F(UsbPeripheralNotificationControllerTest, SpeedLimitingCableNotification) { EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 0u); controller()->OnSpeedLimitingCableWarning(); EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 1u); message_center::Notification* notification = MessageCenter::Get()->FindVisibleNotificationById( kUsbPeripheralSpeedLimitingCableNotificationId); ASSERT_TRUE(notification); EXPECT_EQ(notification->buttons().size(), 1u); controller()->OnSpeedLimitingCableWarning(); EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 1u); } TEST_F(UsbPeripheralNotificationControllerTest, SpeedLimitingCableNotificationWithClick) { EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 0u); controller()->OnSpeedLimitingCableWarning(); EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 1u); message_center::Notification* notification = MessageCenter::Get()->FindVisibleNotificationById( kUsbPeripheralSpeedLimitingCableNotificationId); ASSERT_TRUE(notification); // Click the notification to close it. notification->delegate()->Click(absl::nullopt, absl::nullopt); // Resend the notification, but expect it not to show after being clicked. EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 0u); controller()->OnSpeedLimitingCableWarning(); EXPECT_EQ(MessageCenter::Get()->NotificationCount(), 0u); } } // namespace ash
{'content_hash': '196194e9a64f81cf89349a3730a51d47', 'timestamp': '', 'source': 'github', 'line_count': 133, 'max_line_length': 79, 'avg_line_length': 38.50375939849624, 'alnum_prop': 0.7674282366725249, 'repo_name': 'chromium/chromium', 'id': '2299bd3d114895cb7f9071983fbcb4a6c9db2d96', 'size': '5490', 'binary': False, 'copies': '6', 'ref': 'refs/heads/main', 'path': 'ash/system/usb_peripheral/usb_peripheral_notification_controller_unittest.cc', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []}
.class Landroid/bluetooth/BluetoothInputDevice$1; .super Landroid/bluetooth/IBluetoothStateChangeCallback$Stub; .source "BluetoothInputDevice.java" # annotations .annotation system Ldalvik/annotation/EnclosingClass; value = Landroid/bluetooth/BluetoothInputDevice; .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x0 name = null .end annotation # instance fields .field final synthetic this$0:Landroid/bluetooth/BluetoothInputDevice; # direct methods .method constructor <init>(Landroid/bluetooth/BluetoothInputDevice;)V .locals 0 iput-object p1, p0, Landroid/bluetooth/BluetoothInputDevice$1;->this$0:Landroid/bluetooth/BluetoothInputDevice; invoke-direct {p0}, Landroid/bluetooth/IBluetoothStateChangeCallback$Stub;-><init>()V return-void .end method # virtual methods .method public onBluetoothStateChange(Z)V .locals 4 const-string/jumbo v1, "BluetoothInputDevice" new-instance v2, Ljava/lang/StringBuilder; invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V const-string/jumbo v3, "onBluetoothStateChange: up=" invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v2 invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder; move-result-object v2 invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v2 invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I if-nez p1, :cond_1 iget-object v1, p0, Landroid/bluetooth/BluetoothInputDevice$1;->this$0:Landroid/bluetooth/BluetoothInputDevice; invoke-static {v1}, Landroid/bluetooth/BluetoothInputDevice;->-get0(Landroid/bluetooth/BluetoothInputDevice;)Landroid/content/ServiceConnection; move-result-object v2 monitor-enter v2 :try_start_0 iget-object v1, p0, Landroid/bluetooth/BluetoothInputDevice$1;->this$0:Landroid/bluetooth/BluetoothInputDevice; const/4 v3, 0x0 invoke-static {v1, v3}, Landroid/bluetooth/BluetoothInputDevice;->-set0(Landroid/bluetooth/BluetoothInputDevice;Landroid/bluetooth/IBluetoothInputDevice;)Landroid/bluetooth/IBluetoothInputDevice; iget-object v1, p0, Landroid/bluetooth/BluetoothInputDevice$1;->this$0:Landroid/bluetooth/BluetoothInputDevice; invoke-static {v1}, Landroid/bluetooth/BluetoothInputDevice;->-get1(Landroid/bluetooth/BluetoothInputDevice;)Landroid/content/Context; move-result-object v1 iget-object v3, p0, Landroid/bluetooth/BluetoothInputDevice$1;->this$0:Landroid/bluetooth/BluetoothInputDevice; invoke-static {v3}, Landroid/bluetooth/BluetoothInputDevice;->-get0(Landroid/bluetooth/BluetoothInputDevice;)Landroid/content/ServiceConnection; move-result-object v3 invoke-virtual {v1, v3}, Landroid/content/Context;->unbindService(Landroid/content/ServiceConnection;)V :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 :cond_0 :goto_0 monitor-exit v2 return-void :catch_0 move-exception v0 :try_start_1 const-string/jumbo v1, "BluetoothInputDevice" const-string/jumbo v3, "" invoke-static {v1, v3, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 goto :goto_0 :catchall_0 move-exception v1 monitor-exit v2 throw v1 :cond_1 iget-object v1, p0, Landroid/bluetooth/BluetoothInputDevice$1;->this$0:Landroid/bluetooth/BluetoothInputDevice; invoke-static {v1}, Landroid/bluetooth/BluetoothInputDevice;->-get0(Landroid/bluetooth/BluetoothInputDevice;)Landroid/content/ServiceConnection; move-result-object v2 monitor-enter v2 :try_start_2 iget-object v1, p0, Landroid/bluetooth/BluetoothInputDevice$1;->this$0:Landroid/bluetooth/BluetoothInputDevice; invoke-static {v1}, Landroid/bluetooth/BluetoothInputDevice;->-get2(Landroid/bluetooth/BluetoothInputDevice;)Landroid/bluetooth/IBluetoothInputDevice; move-result-object v1 if-nez v1, :cond_0 iget-object v1, p0, Landroid/bluetooth/BluetoothInputDevice$1;->this$0:Landroid/bluetooth/BluetoothInputDevice; invoke-virtual {v1}, Landroid/bluetooth/BluetoothInputDevice;->doBind()Z :try_end_2 .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1 .catchall {:try_start_2 .. :try_end_2} :catchall_1 goto :goto_0 :catch_1 move-exception v0 :try_start_3 const-string/jumbo v1, "BluetoothInputDevice" const-string/jumbo v3, "" invoke-static {v1, v3, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I :try_end_3 .catchall {:try_start_3 .. :try_end_3} :catchall_1 goto :goto_0 :catchall_1 move-exception v1 monitor-exit v2 throw v1 .end method
{'content_hash': 'd6a5dba94825ddf5706ac9ed3b7f8df8', 'timestamp': '', 'source': 'github', 'line_count': 167, 'max_line_length': 199, 'avg_line_length': 30.04191616766467, 'alnum_prop': 0.7382898146302571, 'repo_name': 'BatMan-Rom/ModdedFiles', 'id': 'cb8567eb59fb6c7b9b2f0b9fc9fcd8d6a39648f5', 'size': '5017', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'framework.jar.out/smali/android/bluetooth/BluetoothInputDevice$1.smali', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'GLSL', 'bytes': '15069'}, {'name': 'HTML', 'bytes': '139176'}, {'name': 'Smali', 'bytes': '541934400'}]}
#include "config.h" #include "system.h" #include "coretypes.h" #include "tm.h" #include "tree.h" #include "rtl.h" #include "tm_p.h" #include "hard-reg-set.h" #include "basic-block.h" #include "output.h" #include "diagnostic.h" #include "tree-flow.h" #include "tree-dump.h" #include "tree-pass.h" #include "timevar.h" #include "cfgloop.h" #include "flags.h" #include "tree-inline.h" #include "tree-scalar-evolution.h" /* The loop tree currently optimized. */ struct loops *current_loops = NULL; /* Initializes the loop structures. */ static struct loops * tree_loop_optimizer_init (void) { struct loops *loops; loops = loop_optimizer_init (LOOPS_NORMAL | LOOPS_HAVE_MARKED_SINGLE_EXITS); if (!loops) return NULL; rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa); return loops; } /* The loop superpass. */ static bool gate_tree_loop (void) { return flag_tree_loop_optimize != 0; } struct tree_opt_pass pass_tree_loop = { "loop", /* name */ gate_tree_loop, /* gate */ NULL, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ TV_TREE_LOOP, /* tv_id */ PROP_cfg, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ TODO_ggc_collect, /* todo_flags_start */ TODO_dump_func | TODO_verify_ssa | TODO_ggc_collect, /* todo_flags_finish */ 0 /* letter */ }; /* Loop optimizer initialization. */ static unsigned int tree_ssa_loop_init (void) { current_loops = tree_loop_optimizer_init (); if (!current_loops) return 0; scev_initialize (current_loops); return 0; } struct tree_opt_pass pass_tree_loop_init = { "loopinit", /* name */ NULL, /* gate */ tree_ssa_loop_init, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ TV_TREE_LOOP_INIT, /* tv_id */ PROP_cfg, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */ 0 /* letter */ }; /* Loop invariant motion pass. */ static unsigned int tree_ssa_loop_im (void) { if (!current_loops) return 0; tree_ssa_lim (current_loops); return 0; } static bool gate_tree_ssa_loop_im (void) { return flag_tree_loop_im != 0; } struct tree_opt_pass pass_lim = { "lim", /* name */ gate_tree_ssa_loop_im, /* gate */ tree_ssa_loop_im, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ TV_LIM, /* tv_id */ PROP_cfg, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */ 0 /* letter */ }; /* Loop unswitching pass. */ static unsigned int tree_ssa_loop_unswitch (void) { if (!current_loops) return 0; return tree_ssa_unswitch_loops (current_loops); } static bool gate_tree_ssa_loop_unswitch (void) { return flag_unswitch_loops != 0; } struct tree_opt_pass pass_tree_unswitch = { "unswitch", /* name */ gate_tree_ssa_loop_unswitch, /* gate */ tree_ssa_loop_unswitch, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ TV_TREE_LOOP_UNSWITCH, /* tv_id */ PROP_cfg, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */ 0 /* letter */ }; /* Loop autovectorization. */ static unsigned int tree_vectorize (void) { vectorize_loops (current_loops); return 0; } static bool gate_tree_vectorize (void) { return flag_tree_vectorize && current_loops; } struct tree_opt_pass pass_vectorize = { "vect", /* name */ gate_tree_vectorize, /* gate */ tree_vectorize, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ TV_TREE_VECTORIZATION, /* tv_id */ PROP_cfg | PROP_ssa, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ TODO_verify_loops, /* todo_flags_start */ TODO_dump_func | TODO_update_ssa, /* todo_flags_finish */ 0 /* letter */ }; /* Loop nest optimizations. */ static unsigned int tree_linear_transform (void) { if (!current_loops) return 0; linear_transform_loops (current_loops); return 0; } static bool gate_tree_linear_transform (void) { return flag_tree_loop_linear != 0; } struct tree_opt_pass pass_linear_transform = { "ltrans", /* name */ gate_tree_linear_transform, /* gate */ tree_linear_transform, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ TV_TREE_LINEAR_TRANSFORM, /* tv_id */ PROP_cfg | PROP_ssa, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */ 0 /* letter */ }; /* Canonical induction variable creation pass. */ static unsigned int tree_ssa_loop_ivcanon (void) { if (!current_loops) return 0; return canonicalize_induction_variables (current_loops); } static bool gate_tree_ssa_loop_ivcanon (void) { return flag_tree_loop_ivcanon != 0; } struct tree_opt_pass pass_iv_canon = { "ivcanon", /* name */ gate_tree_ssa_loop_ivcanon, /* gate */ tree_ssa_loop_ivcanon, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ TV_TREE_LOOP_IVCANON, /* tv_id */ PROP_cfg | PROP_ssa, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */ 0 /* letter */ }; /* Propagation of constants using scev. */ static bool gate_scev_const_prop (void) { return true; } struct tree_opt_pass pass_scev_cprop = { "sccp", /* name */ gate_scev_const_prop, /* gate */ scev_const_prop, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ TV_SCEV_CONST, /* tv_id */ PROP_cfg | PROP_ssa, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_cleanup_cfg | TODO_update_ssa_only_virtuals, /* todo_flags_finish */ 0 /* letter */ }; /* Remove empty loops. */ static unsigned int tree_ssa_empty_loop (void) { if (!current_loops) return 0; return remove_empty_loops (current_loops); } struct tree_opt_pass pass_empty_loop = { "empty", /* name */ NULL, /* gate */ tree_ssa_empty_loop, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ TV_COMPLETE_UNROLL, /* tv_id */ PROP_cfg | PROP_ssa, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */ 0 /* letter */ }; /* Record bounds on numbers of iterations of loops. */ static unsigned int tree_ssa_loop_bounds (void) { if (!current_loops) return 0; estimate_numbers_of_iterations (current_loops); scev_reset (); return 0; } struct tree_opt_pass pass_record_bounds = { NULL, /* name */ NULL, /* gate */ tree_ssa_loop_bounds, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ TV_TREE_LOOP_BOUNDS, /* tv_id */ PROP_cfg | PROP_ssa, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ 0, /* todo_flags_finish */ 0 /* letter */ }; /* Complete unrolling of loops. */ static unsigned int tree_complete_unroll (void) { if (!current_loops) return 0; return tree_unroll_loops_completely (current_loops, flag_unroll_loops || flag_peel_loops || optimize >= 3); } static bool gate_tree_complete_unroll (void) { return true; } struct tree_opt_pass pass_complete_unroll = { "cunroll", /* name */ gate_tree_complete_unroll, /* gate */ tree_complete_unroll, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ TV_COMPLETE_UNROLL, /* tv_id */ PROP_cfg | PROP_ssa, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */ 0 /* letter */ }; /* Prefetching. */ static unsigned int tree_ssa_loop_prefetch (void) { if (!current_loops) return 0; return tree_ssa_prefetch_arrays (current_loops); } static bool gate_tree_ssa_loop_prefetch (void) { return flag_prefetch_loop_arrays != 0; } struct tree_opt_pass pass_loop_prefetch = { "prefetch", /* name */ gate_tree_ssa_loop_prefetch, /* gate */ tree_ssa_loop_prefetch, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ TV_TREE_PREFETCH, /* tv_id */ PROP_cfg | PROP_ssa, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */ 0 /* letter */ }; /* Induction variable optimizations. */ static unsigned int tree_ssa_loop_ivopts (void) { if (!current_loops) return 0; tree_ssa_iv_optimize (current_loops); return 0; } static bool gate_tree_ssa_loop_ivopts (void) { return flag_ivopts != 0; } struct tree_opt_pass pass_iv_optimize = { "ivopts", /* name */ gate_tree_ssa_loop_ivopts, /* gate */ tree_ssa_loop_ivopts, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ TV_TREE_LOOP_IVOPTS, /* tv_id */ PROP_cfg | PROP_ssa, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_loops | TODO_update_ssa, /* todo_flags_finish */ 0 /* letter */ }; /* Loop optimizer finalization. */ static unsigned int tree_ssa_loop_done (void) { if (!current_loops) return 0; free_numbers_of_iterations_estimates (current_loops); scev_finalize (); loop_optimizer_finalize (current_loops); current_loops = NULL; return 0; } struct tree_opt_pass pass_tree_loop_done = { "loopdone", /* name */ NULL, /* gate */ tree_ssa_loop_done, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ TV_TREE_LOOP_FINI, /* tv_id */ PROP_cfg, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_cleanup_cfg | TODO_dump_func, /* todo_flags_finish */ 0 /* letter */ };
{'content_hash': '96d877f9e945d243431bd75267d03b2b', 'timestamp': '', 'source': 'github', 'line_count': 493, 'max_line_length': 78, 'avg_line_length': 23.01217038539554, 'alnum_prop': 0.575495813133539, 'repo_name': 'shaotuanchen/sunflower_exp', 'id': 'f921c86711ced13ffea30adff50335fbfb93e9e7', 'size': '12082', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'tools/source/gcc-4.2.4/gcc/tree-ssa-loop.c', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Assembly', 'bytes': '459993'}, {'name': 'Awk', 'bytes': '6562'}, {'name': 'Batchfile', 'bytes': '9028'}, {'name': 'C', 'bytes': '50326113'}, {'name': 'C++', 'bytes': '2040239'}, {'name': 'CSS', 'bytes': '2355'}, {'name': 'Clarion', 'bytes': '2484'}, {'name': 'Coq', 'bytes': '61440'}, {'name': 'DIGITAL Command Language', 'bytes': '69150'}, {'name': 'Emacs Lisp', 'bytes': '186910'}, {'name': 'Fortran', 'bytes': '5364'}, {'name': 'HTML', 'bytes': '2171356'}, {'name': 'JavaScript', 'bytes': '27164'}, {'name': 'Logos', 'bytes': '159114'}, {'name': 'M', 'bytes': '109006'}, {'name': 'M4', 'bytes': '100614'}, {'name': 'Makefile', 'bytes': '5409865'}, {'name': 'Mercury', 'bytes': '702'}, {'name': 'Module Management System', 'bytes': '56956'}, {'name': 'OCaml', 'bytes': '253115'}, {'name': 'Objective-C', 'bytes': '57800'}, {'name': 'Papyrus', 'bytes': '3298'}, {'name': 'Perl', 'bytes': '70992'}, {'name': 'Perl 6', 'bytes': '693'}, {'name': 'PostScript', 'bytes': '3440120'}, {'name': 'Python', 'bytes': '40729'}, {'name': 'Redcode', 'bytes': '1140'}, {'name': 'Roff', 'bytes': '3794721'}, {'name': 'SAS', 'bytes': '56770'}, {'name': 'SRecode Template', 'bytes': '540157'}, {'name': 'Shell', 'bytes': '1560436'}, {'name': 'Smalltalk', 'bytes': '10124'}, {'name': 'Standard ML', 'bytes': '1212'}, {'name': 'TeX', 'bytes': '385584'}, {'name': 'WebAssembly', 'bytes': '52904'}, {'name': 'Yacc', 'bytes': '510934'}]}
import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { map } from 'rxjs/operators'; import * as R from 'ramda'; @Injectable() export class WordService { // https://404it.no/en/blog/javascript_get_base_url_or_root_url // https://developer.mozilla.org/en-US/docs/Web/API/Location private static baseUrl() : string { const re = new RegExp(/^.*\//); return re.exec(window.location.href)[0]; } private words : Array<string> ; constructor(private http : HttpClient) { http.get(WordService.baseUrl() + 'resources/dictionaryWords.txt', { responseType: 'text' }) .pipe( map(text => text.toUpperCase()), map(text => text.split('\n')), map(words => R.map(R.trim, words)) ) .subscribe( words => this.words = words, err => console.error(`Hangman word list loading error - ${err}.`), () => console.log('Hangman word list loaded!') ) ; } // Generate a random integer in range 0 to max. private static getRandomInt(max : number) : number { return Math.floor(Math.random() * (max + 1)); } // A single random word for the 'words' array. randomWord() : string { let word = 'HANGMAN' ; if (0 < this.words.length) { const pos : number = WordService.getRandomInt(this.words.length - 1); word = this.words[pos]; } return word ; } }
{'content_hash': '45620de171c64ba561a0894f38fed4b0', 'timestamp': '', 'source': 'github', 'line_count': 47, 'max_line_length': 95, 'avg_line_length': 29.5531914893617, 'alnum_prop': 0.6234701223902088, 'repo_name': 'ROpsal/ng2-hangman', 'id': '2147c7648a041b25002ea221f315811d0fb3fa88', 'size': '1389', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/app/word.service.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '2153'}, {'name': 'HTML', 'bytes': '2945'}, {'name': 'JavaScript', 'bytes': '1684'}, {'name': 'TypeScript', 'bytes': '29375'}]}
require 'test_helper' class Admin::RecipesControllerTest < ActionDispatch::IntegrationTest include Devise::Test::IntegrationHelpers setup do @admin = users(:admin) end test "should get index" do sign_in @admin get admin_recipes_url assert_response :success end test "should get show" do sign_in @admin get admin_recipe_url(recipes(:valid_recipe)) assert_response :success end end
{'content_hash': 'd1e56ab9ee7e4492a02ef867d6b1c2b9', 'timestamp': '', 'source': 'github', 'line_count': 21, 'max_line_length': 68, 'avg_line_length': 20.285714285714285, 'alnum_prop': 0.7089201877934272, 'repo_name': 'RubyForceTeam/cookbook', 'id': 'abc42728de6bf4919f99698e852286025fef2c50', 'size': '426', 'binary': False, 'copies': '1', 'ref': 'refs/heads/staging', 'path': 'test/controllers/admin/recipes_controller_test.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '7633'}, {'name': 'HTML', 'bytes': '41730'}, {'name': 'JavaScript', 'bytes': '30742'}, {'name': 'Ruby', 'bytes': '177743'}]}
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{'content_hash': 'a8122252d3e8d8be56b053679ed94ae8', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 10.23076923076923, 'alnum_prop': 0.6917293233082706, 'repo_name': 'mdoering/backbone', 'id': '29b6c2d389dc2f0469ca9d219d1c110888055f8d', 'size': '202', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Rhodophyta/Florideophyceae/Ceramiales/Rhodomelaceae/Laurencia/Laurencia filiformis/ Syn. Dolichoscelis clavifera/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
Some sort of browser game engine Alright, after you cloned repo, all you need to get this started: ```bash cd scripts/app npm install webpack --watch ``` You all set! You can edit .js files with es6 syntax and you will have app.js file that is used in index.html
{'content_hash': 'e077f091413b28239919ed1e329a7e26', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 108, 'avg_line_length': 24.181818181818183, 'alnum_prop': 0.7481203007518797, 'repo_name': 'idchlife/browser-game-engine', 'id': '751c10835a37ea7b6c9d6f152149c519bc6c534a', 'size': '288', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '215'}, {'name': 'JavaScript', 'bytes': '18506'}]}
<div class="disclaimer"> {% if site.theme.show_disclaimer %} <p> The postings on this site are my own and don't necessarily represent my employer’s positions, strategies or opinions. </p> {% endif %} <p> © {{ site.theme.name }} 2013 &mdash; built with Jekyll using Lagom theme </p> </div>
{'content_hash': '310d891f763859563d074061314a6fa3', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 76, 'avg_line_length': 26.166666666666668, 'alnum_prop': 0.6464968152866242, 'repo_name': 'michaelchum/old-blog', 'id': '7af6b6f0b880154d9497b642b581fc478bc83047', 'size': '317', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': '_includes/footer.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '122563'}]}
using System; using System.Windows.Input; namespace Gui.Utils { public class RelayCommand : ICommand { private readonly Action execute; private readonly Func<bool> canExecute; public RelayCommand(Action execute) : this(execute, null) { } public RelayCommand(Action execute, Func<bool> canExecute) { this.execute = execute; this.canExecute = canExecute; } public bool CanExecute(object parameter) { return canExecute == null || canExecute(); } public event EventHandler CanExecuteChanged { add => CommandManager.RequerySuggested += value; remove => CommandManager.RequerySuggested -= value; } public void Execute(object parameter) { execute(); } } }
{'content_hash': 'ea6e06bb460f0ba6c6927f864959d71e', 'timestamp': '', 'source': 'github', 'line_count': 38, 'max_line_length': 60, 'avg_line_length': 18.736842105263158, 'alnum_prop': 0.7064606741573034, 'repo_name': 'glen-summers/ClientServerDemo', 'id': 'd9c9e549e772aedf02454265824205ac2eb7e2be', 'size': '712', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'source/Gui/Utils/RelayCommand.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '1661'}, {'name': 'C#', 'bytes': '47266'}, {'name': 'SQLPL', 'bytes': '1922'}]}
import pygame import sys from pygame.locals import * from pygame import transform import pygame.freetype import traceback import logging log = logging.getLogger("R.Engine.Sprite") class Sprite(object): game = None def __init__(self, surface, x, y): self.log = log # Compatibility reasons - refactoring # set up any private class variables. self._name = None self._rect = None self._surface = None self.__surface__ = None self.surface = surface self.x = x self.y = y self.alpha = 255 self.hidden = False self.dx = 0 self.dy = 0 # App is a variable tracking the game application. # It is assigned when the sprite is added to the draw list. self.app = None self.layer = None self.motions = [] def getName(self): return self._name def setName(self, name): if self.app: if self._name: self.app.renameSprite(self, name) else: self.app.registerSprite(self, name) self._name = name name = property(getName, setName) def getHidden(self): return self._hidden def setHidden(self, hidden): self._hidden = hidden hidden = property(getHidden, setHidden) def hide(self): self.log.debug("hiding sprite") self.hidden = True def unhide(self): self.log.debug("unhiding sprite") self.hidden = False def isActive(self): return (self.app != None) def getAlpha(self): return self._alpha def setAlpha(self, alpha): self._surface.set_alpha(alpha) self._alpha = alpha alpha = property(getAlpha, setAlpha) def addMotion(self, motion): self.log.info("adding motion %s to sprite"%(motion)) self.motions.append(motion) motion.begin() def removeMotion(self, motion): self.log.debug("removing motion %s from sprite"%(motion)) if isinstance(motion, Action): motion.cancel() self.motions.remove(motion) elif isinstance(motion, str): for imotion in self.motions: if imotion.name == motion.lower(): imotion.cancel() self.motions = [imotion for imotion in self.motions if not imotion.canceled] def tick(self, dt): self.x += self.dx * dt self.y += self.dy * dt if self.motions: for motion in self.motions: motion.update(dt) self.update(dt) def update(self, dt): pass def draw(self, canvas): if not self.hidden: canvas.blit(self._surface, self._rect) def destroy(self): self.app.removeSprite(self) # ---------------------------------------------- # Setup class properties def getX(self): return self._x def setX(self, x): self._rect.centerx = x self._x = x def getY(self): return self._y def setY(self, y): self._rect.centery = y self._y = y x = property(getX, setX) y = property(getY, setY) def getLeft(self): return self._x - self._rect.width / 2 def setLeft(self, left): self._x = left + self._rect.width / 2 def getRight(self): return self._x + self._rect.width / 2 def setRight(self, right): self._x = right - self._rect.width / 2 def getTop(self): return self._y - self._rect.height / 2 def setTop(self, top): self._y = top + self._rect.height / 2 def getBottom(self): return self._y + self._rect.height / 2 def setBottom(self, bottom): self._y = bottom - self._rect.height / 2 left = property(getLeft, setLeft) right = property(getRight, setRight) top = property(getTop, setTop) bottom = property(getBottom, setBottom) def getWidth(self): return self._rect.width def getHeight(self): return self._rect.height def setWidth(self, width): self._surface = scaleImage(self.__surface__, width, self._rect.height) self._rect.width = width def setHeight(self, height): self._surface = scaleImage(self.__surface__, self._rect.width, height) self._rect.height = height width = property(getWidth, setWidth) height= property(getHeight, setHeight) def getSurface(self): return self._surface def setSurface(self, surface): self.__surface__ = surface # __surface__ original, untouched surface object self._surface = surface if hasattr(self, "_rect"): if self._rect == None: self._rect = surface.get_rect() else: self._rect = surface.get_rect() if surface.get_width() - self._rect.width >= 1 or \ surface.get_height()- self._rect.height >= 1: self.setWidth(self.getWidth()) self.setHeight(self.getHeight()) self._rect = self._surface.get_rect() surface = property(getSurface, setSurface) def getRect(self): return self._rect def setRect(self, rect): self._rect = rect rect = property(getRect, setRect) #--------------------------------------------- class Text(Sprite): game = None def __init__(self, value, x, y, color, size, font=None): log.debug("initializing text object of value '%s'"%(value)) # manually set values to avoid problems in auto render self._font = font self._value = value self._color = color self._size = size # setting prop values will auto render the text on each assignment self.font = font self.value = value self.color = color self.size = size super(Text, self).__init__(self._surface, x, y) def render(self): self._surface, self._rect = self._font.render(self._value, self._color, None, rotation = 0, ptsize = self._size) def getFont(self): return self._fontFilename def setFont(self, font): self._font = pygame.freetype.Font(font, ptsize = self._size) self._fontFilename = font self.render() font = property(getFont, setFont) def getValue(self): return self._value def setValue(self, value): self._value = value self.render() value = property(getValue, setValue) def getColor(self): return self._color def setColor(self, color): self._color = color self.render() color = property(getColor, setColor) def getSize(self): return self._size def setSize(self, size): self._size = size self.render() size = property(getSize, setSize) def scaleImage(surface, width, height): """ Return surface scaled to fit width and height. """ log.debug("scaled image %s" % repr(surface)) return transform.smoothscale(surface, (width, height))
{'content_hash': '10e0a165585e7bdf4f7528629c9131d4', 'timestamp': '', 'source': 'github', 'line_count': 243, 'max_line_length': 88, 'avg_line_length': 29.275720164609055, 'alnum_prop': 0.5649423671633399, 'repo_name': 'omegachysis/arche-fitness', 'id': '0889496c6ba4529970218a2465f067d1b761caf0', 'size': '7115', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'arche-fitness/Sprite.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Python', 'bytes': '53880'}]}
import feedparser as fp import argparse import time class AWSStatus(object): OK = 0 WARNING = 1 CRITICAL = 2 def __init__(self): self.states = {} def add_status(self, reg, svc, state, details): self.states.get(reg, {})[svc] = (state, details) class AWSFeedParser(object): # Not strictly AWS regions, yet, but more of geo-regions REGIONS = ['us', 'ap', 'eu', 'sa'] STALE_THRESHOLD_SECONDS = 6 * 60 * 60 # 6 hours INFORMATIONAL = 'Informational message: ' SERVICE_NORMAL = 'Service is operating normally: ' def __init__(self): self.regs = {} for r in self.REGIONS: fname = r + '.txt' with open(fname) as f: lines = f.readlines() self.regs[r] = lines # print self.regs def _log(self, mes): print mes # TODO replace this with a dict def _wanted(self, svcs, line): for svc in svcs: if svc in line: return True return False def parse(self, regions=[], svcs=[]): for r in regions: lines = self.regs[r] filtered = [l for l in lines if self._wanted(regions, l)] filtered = [l for l in lines if self._wanted(svcs, l)] print filtered for line in lines: for svc in svcs: if svc not in line: continue print "Getting feed for", line feed = fp.parse(line) if 'entries' not in feed: self._log("Empty feed") continue entries = feed['entries'] if len(entries) == 0: self._log("Empty feed") continue # published_parsed is in UTC lastpubtime = time.mktime(entries[0]['published_parsed']) curtime = time.mktime(time.gmtime()) diff = curtime - lastpubtime if diff > self.STALE_THRESHOLD_SECONDS: self._log("Old entries present") continue for entry in feed['entries']: self._log(entry['title']) pubtime = time.mktime(entry['published_parsed']) curtime = time.mktime(time.gmtime()) self._log("Found something") print "-----------------------" def main(): parser = argparse.ArgumentParser(description='Process the region and service names') parser.add_argument('--regions', help="comma separated list of region names - us, eu, ap, sa") parser.add_argument('--services', help="comma separated list of service names - ec2, s3 etc") args = parser.parse_args() regs = args.regions.split(',') svcs = args.services.split(',') p = AWSFeedParser() p.parse(regs, svcs) if __name__ == '__main__': main()
{'content_hash': 'd778cfe309c9f91a67d653fe63e97922', 'timestamp': '', 'source': 'github', 'line_count': 92, 'max_line_length': 98, 'avg_line_length': 33.108695652173914, 'alnum_prop': 0.4967170059093894, 'repo_name': 'talonx/aws-rss-alerts', 'id': 'a1acf70ad59b7a558c96aa46b9acb07df0982716', 'size': '3046', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'awsfeedparser.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '3046'}]}
{% set active_tab = selectedView %} <div class="grid-row"> <div class="column-full"> <div class="sibling-container"> <nav class="activity-navigation"> <ul> <li> <a {% if active_tab == 'guidance' %} class="current" {% endif %} href="{{taxonSlug}}?view=guidance">Guidance and services</a> </li> <li> <a {% if active_tab == 'policy' %} class="current" {% endif %} href="{{taxonSlug}}?view=policy">Policy</a> </li> <li> <a {% if active_tab == 'all' %} class="current" {% endif %} href="{{taxonSlug}}?view=all">Everything</a> </li> </ul> </nav> </div> </div> </div>
{'content_hash': '843f6cd1cc5ba7231f059aca387e088d', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 137, 'avg_line_length': 28.08, 'alnum_prop': 0.49145299145299143, 'repo_name': 'alphagov/govuk-navigation-prototype', 'id': '4bbbec8eedb4ddc0b65b7865fd0a838bae83aba8', 'size': '702', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/views/shared/_tabs.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '82908'}, {'name': 'HTML', 'bytes': '60588'}, {'name': 'JavaScript', 'bytes': '33151'}, {'name': 'Ruby', 'bytes': '3769'}, {'name': 'Shell', 'bytes': '842'}]}
import _plotly_utils.basevalidators class BgcolorsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="bgcolorsrc", parent_name="splom.hoverlabel", **kwargs ): super(BgcolorsrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_type=kwargs.pop("edit_type", "none"), **kwargs, )
{'content_hash': '71233373fcf6ffe9dd14df3574eb0b5e', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 80, 'avg_line_length': 32.76923076923077, 'alnum_prop': 0.6126760563380281, 'repo_name': 'plotly/plotly.py', 'id': '16232f6f22f21601dd6f50a9d0478d8c0f1cc170', 'size': '426', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'packages/python/plotly/plotly/validators/splom/hoverlabel/_bgcolorsrc.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '545'}, {'name': 'JavaScript', 'bytes': '2074'}, {'name': 'PostScript', 'bytes': '565328'}, {'name': 'Python', 'bytes': '31506317'}, {'name': 'TypeScript', 'bytes': '71337'}]}
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.storage.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.storage.fluent.models.BlobContainerInner; import com.azure.resourcemanager.storage.models.ImmutableStorageWithVersioning; /** Samples for BlobContainers Create. */ public final class BlobContainersCreateSamples { /* * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersPutDefaultEncryptionScope.json */ /** * Sample code: PutContainerWithDefaultEncryptionScope. * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void putContainerWithDefaultEncryptionScope(com.azure.resourcemanager.AzureResourceManager azure) { azure .storageAccounts() .manager() .serviceClient() .getBlobContainers() .createWithResponse( "res3376", "sto328", "container6185", new BlobContainerInner() .withDefaultEncryptionScope("encryptionscope185") .withDenyEncryptionScopeOverride(true), Context.NONE); } /* * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersPutObjectLevelWorm.json */ /** * Sample code: PutContainerWithObjectLevelWorm. * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void putContainerWithObjectLevelWorm(com.azure.resourcemanager.AzureResourceManager azure) { azure .storageAccounts() .manager() .serviceClient() .getBlobContainers() .createWithResponse( "res3376", "sto328", "container6185", new BlobContainerInner() .withImmutableStorageWithVersioning(new ImmutableStorageWithVersioning().withEnabled(true)), Context.NONE); } /* * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersPut.json */ /** * Sample code: PutContainers. * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void putContainers(com.azure.resourcemanager.AzureResourceManager azure) { azure .storageAccounts() .manager() .serviceClient() .getBlobContainers() .createWithResponse("res3376", "sto328", "container6185", new BlobContainerInner(), Context.NONE); } }
{'content_hash': '7d269b66abaaceec4f1813b31915e3ab', 'timestamp': '', 'source': 'github', 'line_count': 76, 'max_line_length': 155, 'avg_line_length': 38.421052631578945, 'alnum_prop': 0.6530821917808219, 'repo_name': 'Azure/azure-sdk-for-java', 'id': '36c788c424d8b72f94f254a5bb34a401b59f21a2', 'size': '2920', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/storage/generated/BlobContainersCreateSamples.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '8762'}, {'name': 'Bicep', 'bytes': '15055'}, {'name': 'CSS', 'bytes': '7676'}, {'name': 'Dockerfile', 'bytes': '2028'}, {'name': 'Groovy', 'bytes': '3237482'}, {'name': 'HTML', 'bytes': '42090'}, {'name': 'Java', 'bytes': '432409546'}, {'name': 'JavaScript', 'bytes': '36557'}, {'name': 'Jupyter Notebook', 'bytes': '95868'}, {'name': 'PowerShell', 'bytes': '737517'}, {'name': 'Python', 'bytes': '240542'}, {'name': 'Scala', 'bytes': '1143898'}, {'name': 'Shell', 'bytes': '18488'}, {'name': 'XSLT', 'bytes': '755'}]}
import { TranslateModule } from '@ngx-translate/core' import { HttpClientTestingModule } from '@angular/common/http/testing' import { MatDialog, MatDialogModule } from '@angular/material/dialog' import { CookieModule, CookieService } from 'ngx-cookie' import { ComponentFixture, TestBed } from '@angular/core/testing' import { WelcomeComponent } from './welcome.component' import { of } from 'rxjs' import { ConfigurationService } from '../Services/configuration.service' describe('WelcomeComponent', () => { let component: WelcomeComponent let configurationService: any let cookieService: any let fixture: ComponentFixture<WelcomeComponent> let dialog: any beforeEach(() => { configurationService = jasmine.createSpyObj('ConfigurationService', ['getApplicationConfiguration']) configurationService.getApplicationConfiguration.and.returnValue(of({ application: {} })) dialog = jasmine.createSpyObj('MatDialog', ['open']) dialog.open.and.returnValue(null) TestBed.configureTestingModule({ imports: [ TranslateModule.forRoot(), CookieModule.forRoot(), HttpClientTestingModule, MatDialogModule ], declarations: [WelcomeComponent], providers: [ { provide: ConfigurationService, useValue: configurationService }, { provide: MatDialog, useValue: dialog }, CookieService ] }) .compileComponents() cookieService = TestBed.inject(CookieService) }) beforeEach(() => { fixture = TestBed.createComponent(WelcomeComponent) component = fixture.componentInstance cookieService.remove('welcomebanner_status') }) it('should create', () => { expect(component).toBeTruthy() }) it('should open the welcome banner dialog if configured to show on start', () => { configurationService.getApplicationConfiguration.and.returnValue(of({ application: { welcomeBanner: { showOnFirstStart: true } } })) component.ngOnInit() expect(dialog.open).toHaveBeenCalled() }) it('should not open the welcome banner dialog if configured to not show on start', () => { configurationService.getApplicationConfiguration.and.returnValue(of({ application: { welcomeBanner: { showOnFirstStart: false } } })) component.ngOnInit() expect(dialog.open).not.toHaveBeenCalled() }) it('should not open the welcome banner dialog if previously dismissed', () => { configurationService.getApplicationConfiguration.and.returnValue(of({ application: { welcomeBanner: { showOnFirstStart: true } } })) cookieService.put('welcomebanner_status', 'dismiss') component.ngOnInit() expect(dialog.open).not.toHaveBeenCalled() }) })
{'content_hash': '2524762a02e09d897e25c6d072447aae', 'timestamp': '', 'source': 'github', 'line_count': 74, 'max_line_length': 137, 'avg_line_length': 36.32432432432432, 'alnum_prop': 0.7146577380952381, 'repo_name': 'bkimminich/juice-shop', 'id': 'fa5bcba713821e5af9bfddb0239a10fd9a6c7d7f', 'size': '2807', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'frontend/src/app/welcome/welcome.component.spec.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '34624'}, {'name': 'Dockerfile', 'bytes': '1464'}, {'name': 'HTML', 'bytes': '179729'}, {'name': 'JavaScript', 'bytes': '1392004'}, {'name': 'Python', 'bytes': '2011'}, {'name': 'Ruby', 'bytes': '438'}, {'name': 'Shell', 'bytes': '1893'}, {'name': 'TypeScript', 'bytes': '571139'}]}
package com.example.fw; import java.util.List; import java.util.ArrayList; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import com.example.tests.GroupData; import com.example.tests.TestBase; import com.example.utils.SortedListOf; public class GroupHelper extends WebDriverHelperBase { public GroupHelper(ApplicationManager manager) { super(manager); } /*private SortedListOf<GroupData> cachedGroups; public SortedListOf<GroupData> getGroups() { if (cachedGroups == null){ rebuildCache(); } return cachedGroups; }*/ public SortedListOf<GroupData> getUiGroups() { SortedListOf<GroupData> groups = new SortedListOf<GroupData>(); manager.navigateTo().groupsPage(); List<WebElement> checkboxes = driver.findElements(By.name("selected[]")); for (WebElement checkbox : checkboxes) { String title = checkbox.getAttribute("title"); //group.name = title.substring("Select (".length(), title.length() - ")".length()); String name = title.substring(title.indexOf("(")+1, title.indexOf(")")); groups.add(new GroupData().withName(name)); } return groups; } public GroupHelper createGroup(GroupData group) { initGroupCreation(); fillGroupForm(group); submitGroupForm(); returntoGroupPage(); //manager.getModel().addGroup(group); return this; } public GroupHelper deleteGroup(int index) { manager.navigateTo().groupsPage(); selectGroupByIndex(index); submitGroupDeletion(); returntoGroupPage(); //manager.getModel().removeGroup(index); return this; } public GroupHelper modifyGroup(int index, GroupData group) { manager.navigateTo().groupsPage(); initGroupModification(index); fillGroupForm(group); submitGroupModification(); returntoGroupPage(); // manager.getModel().removeGroup(index).addGroup(group); return this; } //=================================================================================== public GroupHelper initGroupCreation() { manager.navigateTo().groupsPage(); click(By.name("new")); return this; } public GroupHelper fillGroupForm(GroupData group) { type(By.name("group_name"), group.getName()); type(By.name("group_header"), group.getHeader()); type(By.name("group_footer"), group.getFooter()); return this; } public GroupHelper submitGroupForm() { click(By.name("submit")); return this; } public GroupHelper returntoGroupPage() { click(By.linkText("group page")); return this; } public GroupHelper deleteFewGroups(int[] index) { for (int i=0; i<index.length; i++){ selectGroupByIndex(index[i]); } submitGroupDeletion(); return this; } private GroupHelper selectGroupByIndex(int index) { click(By.xpath("//input[@name='selected[]'][" + (index+1) + "]")); return this; } public GroupHelper initGroupModification(int index) { selectGroupByIndex(index); click(By.name("edit")); return this; } public GroupHelper submitGroupModification() { click(By.name("update")); return this; } private void submitGroupDeletion() { click(By.name("delete")); } }
{'content_hash': '68273e5acc6bb2208089e6e5d78ea09b', 'timestamp': '', 'source': 'github', 'line_count': 129, 'max_line_length': 86, 'avg_line_length': 24.093023255813954, 'alnum_prop': 0.6833976833976834, 'repo_name': 'pavlenkonata/PFT-17_nataliia.pavlenko', 'id': 'c3d6ee3c9805f3d394f19c4b537e3ed609b95a14', 'size': '3108', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'addressbook_selenium_tests/src/com/example/fw/GroupHelper.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '16038'}, {'name': 'Java', 'bytes': '62941'}, {'name': 'JavaScript', 'bytes': '10665'}, {'name': 'Shell', 'bytes': '564'}]}
#ifndef SRS_APP_ASYNC_CALL_HPP #define SRS_APP_ASYNC_CALL_HPP /* #include <srs_app_async_call.hpp> */ #include <srs_core.hpp> #include <string> #include <vector> #include <srs_app_thread.hpp> /** * the async call for http hooks, * for the http hooks will switch st-thread, * so we must use isolate thread to avoid the thread corrupt, * for example, when dvr call http hooks, the video receive thread got * a video and pass it to the dvr again. * futhurmore, the aync call never block the main worker thread. */ class ISrsAsyncCallTask { public: ISrsAsyncCallTask(); virtual ~ISrsAsyncCallTask(); public: /** * execute the task async. * this method is the actual execute method of task, * for example, to notify callback server. */ virtual int call() = 0; /** * convert task to string to describe it. * used for logger. */ virtual std::string to_string() = 0; }; /** * the async callback for dvr, callback and other async worker. * when worker call with the task, the worker will do it in isolate thread. * that is, the task is execute/call in async mode. */ class SrsAsyncCallWorker : public ISrsReusableThreadHandler { private: SrsReusableThread* pthread; protected: std::vector<ISrsAsyncCallTask*> tasks; st_cond_t wait; public: SrsAsyncCallWorker(); virtual ~SrsAsyncCallWorker(); public: virtual int execute(ISrsAsyncCallTask* t); virtual int count(); public: virtual int start(); virtual void stop(); // interface ISrsReusableThreadHandler public: virtual int cycle(); }; #endif
{'content_hash': 'ae322461acb0d7bb18dfcc256073fc11', 'timestamp': '', 'source': 'github', 'line_count': 70, 'max_line_length': 75, 'avg_line_length': 22.9, 'alnum_prop': 0.6887086712414223, 'repo_name': 'icevl/srs', 'id': 'dd4d93949af0e788e09f421e47e205f97a2db314', 'size': '2690', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'trunk/src/app/srs_app_async_call.hpp', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ActionScript', 'bytes': '89199'}, {'name': 'Assembly', 'bytes': '3935'}, {'name': 'C', 'bytes': '191199'}, {'name': 'C++', 'bytes': '3498890'}, {'name': 'CMake', 'bytes': '3918'}, {'name': 'HTML', 'bytes': '106989'}, {'name': 'JavaScript', 'bytes': '76859'}, {'name': 'Makefile', 'bytes': '10029'}, {'name': 'Python', 'bytes': '44292'}, {'name': 'QMake', 'bytes': '704'}, {'name': 'Shell', 'bytes': '172651'}]}
<?php require_once(dirname(__FILE__) . '/TemplateEngineTestBase.php'); class TemplateEngineCoreInitTest extends TemplateEngineTestBase { //overwrite setUp/tearDown to avoid TemplateEngine inclusion protected function setUp() { } protected function tearDown() { } public function testInitialization() { $this->assertEquals(false, class_exists('TemplateEngine', false), 'TemplateEngine class not yet defined'); include('TemplateEngine2.php'); $this->assertEquals(true, class_exists('TemplateEngine', false), 'TemplateEngine class defined'); $this->assertNotEquals(null, TemplateEngine::Inst(), 'TemplateEngine::Inst() does not return null'); $this->assertEquals(true, is_array(TemplateEngine::get('TE_ERRORS', null)), 'TE_ERRORS is set and an array'); $this->assertEquals(0, count(TemplateEngine::get('TE_ERRORS', null)), 'TE_ERRORS is of length 0'); $this->assertEquals(true, is_array(TemplateEngine::get('TE_WARNINGS', null)), 'TE_WARNINGS is set and an array'); $this->assertEquals(0, count(TemplateEngine::get('TE_WARNINGS', null)), 'TE_WARNINGS is of length 0'); $this->assertEquals(true, is_array(TemplateEngine::get('TE_INFOS', null)), 'TE_INFOS is set and an array'); $this->assertEquals(0, count(TemplateEngine::get('TE_INFOS', null)), 'TE_INFOS is of length 0'); $this->assertEquals(true, is_string(TemplateEngine::get('HEADER_TEXT', null)), 'HEADER_TEXT is of set and a string'); $this->assertEquals("", TemplateEngine::get('HEADER_TEXT', null), 'HEADER_TEXT is empty'); } } //EOF
{'content_hash': '71dd591ba9b227cd47306d34e1125a9a', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 119, 'avg_line_length': 50.86666666666667, 'alnum_prop': 0.7241153342070773, 'repo_name': 'cobexer/templateengine2', 'id': '43ec2034019d3892475566b220c43bb1bad4b33f', 'size': '1814', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tests/TemplateEngineCoreInitTest.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '37'}, {'name': 'Makefile', 'bytes': '4704'}, {'name': 'PHP', 'bytes': '117161'}, {'name': 'TeX', 'bytes': '19717'}]}
{% extends "base.html" %} {% load i18n %} {% load crispy_forms_tags %} {% load staticfiles %} {% block title %} {% trans "Edit Review" %} {% endblock %} {% block extracss %} <link rel="stylesheet" type="text/css" href="{% static 'select2/css/select2.min.css' %}" /> {% endblock %} {% block page_content %} <div class="row"> <div class="col-md-12"> <div class="content-box-header"> <div class="panel-title">{% trans "Edit Review" %} {{object}}</div> </div> <div class="content-box-large box-with-header"> {% crispy form %} </div> </div> </div> {% endblock %} {% block extrajs %} <script src="{% static 'select2/js/select2.full.min.js' %}"></script> <script> $("#select-user").select2({ placeholder: "{% trans 'Select a user' %}", }); $("#select-quiz").select2({ placeholder: "{% trans 'Select a Question Set' %}", }); $("#select-reviewers").select2({ placeholder: "{% trans 'Select users' %}", allowClear: true }); </script> {% endblock %}
{'content_hash': '977c8a1c35cab0134dbdc4c650332dd7', 'timestamp': '', 'source': 'github', 'line_count': 39, 'max_line_length': 91, 'avg_line_length': 25.205128205128204, 'alnum_prop': 0.5920651068158698, 'repo_name': 'moshthepitt/answers', 'id': 'c2e03d05e3b6468451330903c664dd635208133d', 'size': '983', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'templates/reviews/review_edit.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '21826'}, {'name': 'HTML', 'bytes': '78587'}, {'name': 'JavaScript', 'bytes': '8141'}, {'name': 'Python', 'bytes': '157546'}]}
namespace switches { // ----------------------------------------------------------------------------- // When commenting your switch, please use the same voice as surrounding // comments. Imagine "This switch..." at the beginning of the phrase, and it'll // all work out. // ----------------------------------------------------------------------------- // Disables the blocking of external URL requests from sub-frames not initiated // by user interaction. const char kDisableIOSBlockUnpromptedExternalURLs[] = "disable-block-external-urls"; // Disables the use of WKWebView instead of UIWebView. const char kDisableIOSWKWebView[] = "disable-wkwebview"; // Enables the blocking of external URL requests from sub-frames not initiated // by user interaction. const char kEnableIOSBlockUnpromptedExternalURLs[] = "enable-block-external-urls"; // Enables the use of WKWebView instead of UIWebView. const char kEnableIOSWKWebView[] = "enable-wkwebview"; // Enables context-sensitive reader mode button in the toolbar. const char kEnableReaderModeToolbarIcon[] = "enable-reader-mode-toolbar-icon"; // Defines the value in MB of the memory wedge to insert at cold launch. const char kIOSMemoryWedgeSize[] = "ios-memory-wedge-size-mb"; } // namespace switches
{'content_hash': '928844dfd3bfff97f04b55b425826b16', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 80, 'avg_line_length': 40.935483870967744, 'alnum_prop': 0.6721828211189913, 'repo_name': 'Just-D/chromium-1', 'id': 'cbd15d06ce95e877b7990c702ab98c656f242112', 'size': '1484', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ios/chrome/browser/chrome_switches.cc', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'AppleScript', 'bytes': '6973'}, {'name': 'Arduino', 'bytes': '464'}, {'name': 'Assembly', 'bytes': '37073'}, {'name': 'Batchfile', 'bytes': '8451'}, {'name': 'C', 'bytes': '9517927'}, {'name': 'C++', 'bytes': '244067615'}, {'name': 'CSS', 'bytes': '944025'}, {'name': 'DM', 'bytes': '60'}, {'name': 'Groff', 'bytes': '2494'}, {'name': 'HTML', 'bytes': '27307576'}, {'name': 'Java', 'bytes': '14757472'}, {'name': 'JavaScript', 'bytes': '20666212'}, {'name': 'Makefile', 'bytes': '70864'}, {'name': 'Objective-C', 'bytes': '1772355'}, {'name': 'Objective-C++', 'bytes': '10088862'}, {'name': 'PHP', 'bytes': '97817'}, {'name': 'PLpgSQL', 'bytes': '178732'}, {'name': 'Perl', 'bytes': '63937'}, {'name': 'Protocol Buffer', 'bytes': '485040'}, {'name': 'Python', 'bytes': '8652947'}, {'name': 'Shell', 'bytes': '481276'}, {'name': 'Standard ML', 'bytes': '5106'}, {'name': 'XSLT', 'bytes': '418'}, {'name': 'nesC', 'bytes': '18347'}]}
<div> This option sets environment for the build </div>
{'content_hash': '4599bf65cf49d7a8cca8910d9c1c3ef7', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 44, 'avg_line_length': 19.333333333333332, 'alnum_prop': 0.7241379310344828, 'repo_name': 'epicforce/leroy_jenkins', 'id': '606a67c954a80df6143ca847073d7bf1e3289d86', 'size': '58', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/resources/org/jenkins/plugins/leroy/LeroyBuilder/help-envrn.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '21970'}, {'name': 'Java', 'bytes': '183475'}, {'name': 'JavaScript', 'bytes': '24295'}]}
@import Diffusion; @implementation PingExample { PTDiffusionSession* _session; } -(void)startWithURL:(NSURL*)url { NSLog(@"Connecting..."); [PTDiffusionSession openWithURL:url completionHandler:^(PTDiffusionSession *session, NSError *error) { if (!session) { NSLog(@"Failed to open session: %@", error); return; } // At this point we now have a connected session. NSLog(@"Connected. Session Identifier: %@", session.sessionId); // Set ivar to maintain a strong reference to the session. self->_session = session; [self->_session.pings pingServerWithCompletionHandler:^(PTDiffusionPingDetails * _Nullable details, NSError * _Nullable error) { if (error) { NSLog(@"Failed to ping the server: %@", error); return; } NSLog(@"Server Ping successful with %dms latency", (int) round(details.roundTripTime * 1000)); }]; }]; } @end
{'content_hash': '1557291a4dc4bc02b3518ef1b224263e', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 137, 'avg_line_length': 30.305555555555557, 'alnum_prop': 0.5527039413382218, 'repo_name': 'pushtechnology/diffusion-examples', 'id': 'f15dd80702a80a5a7d3f5d2179fb881b96f79cf0', 'size': '1801', 'binary': False, 'copies': '1', 'ref': 'refs/heads/6.8', 'path': 'apple/PingExample.m', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '300206'}, {'name': 'C#', 'bytes': '316143'}, {'name': 'HTML', 'bytes': '3414'}, {'name': 'Java', 'bytes': '294854'}, {'name': 'JavaScript', 'bytes': '74740'}, {'name': 'Makefile', 'bytes': '15236'}, {'name': 'Objective-C', 'bytes': '180172'}, {'name': 'Python', 'bytes': '26889'}, {'name': 'Swift', 'bytes': '17428'}, {'name': 'TypeScript', 'bytes': '75546'}]}
package com.github.nimabt.renetty.http.exception; import com.github.nimabt.renetty.http.model.response.AbstractHttpResponse; import com.github.nimabt.renetty.http.model.response.BinaryHttpResponse; import com.github.nimabt.renetty.http.model.response.TextHttpResponse; import com.github.nimabt.renetty.http.util.ConstValues; import io.netty.handler.codec.http.HttpResponseStatus; /** * @author: nima.abt * @since: 4/25/17 */ public class HttpRequestException extends Exception { private final AbstractHttpResponse httpResponse; public HttpRequestException(final AbstractHttpResponse httpResponse, final String message){ super(message); this.httpResponse = httpResponse; } public HttpRequestException(final HttpResponseStatus httpResponseStatus){ this(new TextHttpResponse(httpResponseStatus, null,ConstValues.DEFAULT_CONTENT_TYPE),null); } public HttpRequestException(final HttpResponseStatus httpResponseStatus, final String body){ this(new TextHttpResponse(httpResponseStatus,body,ConstValues.DEFAULT_CONTENT_TYPE),null); } public HttpRequestException(final HttpResponseStatus httpResponseStatus, final String body, final String contentType){ this(new TextHttpResponse(httpResponseStatus,body,contentType),null); } public HttpRequestException(final HttpResponseStatus httpResponseStatus, final String body, final String contentType, final String message){ this(new TextHttpResponse(httpResponseStatus,body,contentType),message); } public HttpRequestException(final HttpResponseStatus httpResponseStatus, final byte[] data){ this(new BinaryHttpResponse(httpResponseStatus,data,ConstValues.DEFAULT_BIN_CONTENT_TYPE),null); } public HttpRequestException(final HttpResponseStatus httpResponseStatus, final byte[] data, final String contentType){ this(new BinaryHttpResponse(httpResponseStatus,data,contentType),null); } public HttpRequestException(final HttpResponseStatus httpResponseStatus, final byte[] data, final String contentType, final String message){ this(new BinaryHttpResponse(httpResponseStatus,data,contentType),message); } public AbstractHttpResponse getHttpResponse() { return httpResponse; } @Override public String toString() { return "HttpRequestException{" + "httpResponse=" + httpResponse + '}'; } }
{'content_hash': 'c5657524b54783c43935ee53651afccd', 'timestamp': '', 'source': 'github', 'line_count': 67, 'max_line_length': 144, 'avg_line_length': 36.56716417910448, 'alnum_prop': 0.7604081632653061, 'repo_name': 'nimabt/renetty', 'id': '0a69da04337c300a67ee11eb23f9e78ca680899c', 'size': '2450', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'renetty-http/src/main/java/com/github/nimabt/renetty/http/exception/HttpRequestException.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '63539'}]}
pf_sys::ThreadLock g_thread_lock; namespace pf_sys { uint16_t g_thread_quit_count = 0; //-- thread class Thread::Thread() { __ENTER_FUNCTION id_ = 0; status_ = kReady; #if __WINDOWS__ thread_handle_ = NULL; #endif __LEAVE_FUNCTION } Thread::~Thread() { //do nothing } void Thread::start() { __ENTER_FUNCTION if (status_ != kReady) return; #if __LINUX__ int32_t result = pthread_create(reinterpret_cast<pthread_t *>(&id_), NULL, ps_thread_process, this); if (result != 0) { char msg[32] = {0}; snprintf(msg, sizeof(msg) - 1, "pthread_create failed, result: %d", result); AssertEx(false, msg); } #elif __WINDOWS__ thread_handle_ = ::CreateThread(NULL, 0, ps_thread_process, this, CREATE_SUSPENDED, &id_); Assert(thread_handle_ != NULL); id_ *= 1000; //??? ResumeThread(thread_handle_); #endif __LEAVE_FUNCTION } void Thread::stop() { //do nothing } void Thread::exit(void *retval) { __ENTER_FUNCTION #if __LINUX__ pthread_exit(retval); #elif __WINDOWS__ USE_PARAM(retval); ::CloseHandle(thread_handle_); #endif __LEAVE_FUNCTION } void Thread::run() { //do nothing } #if __LINUX__ void *ps_thread_process(void *derived_thread) { #elif __WINDOWS__ DWORD WINAPI ps_thread_process(void *derived_thread) { #endif __ENTER_FUNCTION Thread* thread = static_cast<Thread*>(derived_thread); if (NULL == thread) return NULL; thread->set_status(Thread::kRunning); thread->run(); thread->set_status(Thread::kExit); #if __WINDOWS__ thread->exit(NULL); #endif g_thread_lock.lock(); ++g_thread_quit_count; g_thread_lock.unlock(); __LEAVE_FUNCTION return NULL; } #if __LINUX__ uint64_t Thread::get_id() { #elif __WINDOWS__ DWORD Thread::get_id() { #endif return id_; } Thread::status_t Thread::get_status() { return status_; } void Thread::set_status(status_t status) { __ENTER_FUNCTION status_ = status; __LEAVE_FUNCTION } //thread class -- //-- thread lock class ThreadLock::ThreadLock() { __ENTER_FUNCTION #if __LINUX__ pthread_mutex_init(&mutex_, NULL); #elif __WINDOWS__ InitializeCriticalSection(&lock_); #endif __LEAVE_FUNCTION } ThreadLock::~ThreadLock() { __ENTER_FUNCTION #if __LINUX__ pthread_mutex_destroy(&mutex_); #elif __WINDOWS__ DeleteCriticalSection(&lock_); #endif __LEAVE_FUNCTION } void ThreadLock::lock() { __ENTER_FUNCTION #if __LINUX__ pthread_mutex_lock(&mutex_); #elif __WINDOWS__ EnterCriticalSection(&lock_); #endif __LEAVE_FUNCTION } void ThreadLock::unlock() { __ENTER_FUNCTION #if __LINUX__ pthread_mutex_unlock(&mutex_); #elif __WINDOWS__ LeaveCriticalSection(&lock_); #endif __LEAVE_FUNCTION } //thread lock class -- uint64_t get_current_thread_id() { __ENTER_FUNCTION uint64_t result = 0; #if __LINUX__ result = static_cast<uint64_t>(pthread_self()); #elif __WINDOWS__ result = static_cast<uint64_t>(GetCurrentThreadId()); #endif return result; __LEAVE_FUNCTION return NULL; } } //namespace pf_sys
{'content_hash': '17734f8e6845f576ed5e0f215dc7ec14', 'timestamp': '', 'source': 'github', 'line_count': 162, 'max_line_length': 79, 'avg_line_length': 19.858024691358025, 'alnum_prop': 0.6024246192104445, 'repo_name': 'ueverything/plainframework', 'id': '8277cf7efc2935020a1d678ed367d592d48066de', 'size': '3245', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'pf/core/src/sys/thread.cc', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Ada', 'bytes': '89080'}, {'name': 'Assembly', 'bytes': '138199'}, {'name': 'Batchfile', 'bytes': '174'}, {'name': 'C', 'bytes': '7479555'}, {'name': 'C#', 'bytes': '54012'}, {'name': 'C++', 'bytes': '1280386'}, {'name': 'CLIPS', 'bytes': '5291'}, {'name': 'CMake', 'bytes': '76160'}, {'name': 'DIGITAL Command Language', 'bytes': '27303'}, {'name': 'Groff', 'bytes': '7559'}, {'name': 'HTML', 'bytes': '29824'}, {'name': 'Lua', 'bytes': '3920'}, {'name': 'Makefile', 'bytes': '7566'}, {'name': 'Module Management System', 'bytes': '1545'}, {'name': 'Pascal', 'bytes': '70297'}, {'name': 'Perl', 'bytes': '3895'}, {'name': 'SAS', 'bytes': '1847'}, {'name': 'Shell', 'bytes': '8768'}]}
import BaseComponent from "../../base/BaseComponent";@storeLink@ class @componentName@ extends BaseComponent{ constructor(){ super(); } @getStoreFunc@ render(){ return (<div> I am @componentName@ component </div>) } } export default @componentName@;
{'content_hash': '8d76e61eb81daabaadcdd6f079627005', 'timestamp': '', 'source': 'github', 'line_count': 15, 'max_line_length': 64, 'avg_line_length': 17.933333333333334, 'alnum_prop': 0.6840148698884758, 'repo_name': 'VoidCanvas/react-foundation', 'id': '54280a7d29dc3f52a3b97d3adda33aeee4d88071', 'size': '269', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '.voidcanvas/raw-component.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '55'}, {'name': 'HTML', 'bytes': '192'}, {'name': 'JavaScript', 'bytes': '5984'}]}
// Copyright (c) 2012 Ecma International. All rights reserved. // Ecma International makes this code available under the terms and conditions set // forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the // "Use Terms"). Any redistribution of this code must retain the above // copyright and this notice and otherwise comply with the Use Terms. /*--- es5id: 15.2.3.13-2-4 description: Object.isExtensible returns true for all built-in objects (Array) includes: [runTestCase.js] ---*/ function testcase() { var e = Object.isExtensible(Array); if (e === true) { return true; } } runTestCase(testcase);
{'content_hash': '026f5e8feb5f27add460a8dbbf9bcc73', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 82, 'avg_line_length': 33.421052631578945, 'alnum_prop': 0.7244094488188977, 'repo_name': 'PiotrDabkowski/Js2Py', 'id': 'f668712a1352fcacfb044a32307bdddd97fa104e', 'size': '635', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tests/test_cases/built-ins/Object/isExtensible/15.2.3.13-2-4.js', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'Dockerfile', 'bytes': '289'}, {'name': 'JavaScript', 'bytes': '8556970'}, {'name': 'Python', 'bytes': '4583980'}, {'name': 'Shell', 'bytes': '457'}]}
#ifndef COMBINATIONS_H_ #define COMBINATIONS_H_ #include <vector> #include <forward_list> #include <algorithm> #include <memory> #include "dither_types.h" namespace dither { inline void product( std::forward_list<dtest_case>& rvvi, // final result dtest_case& rvi, // current result std::vector<dtest_case>::const_iterator me, // current input std::vector<dtest_case>::const_iterator end); // final input inline void product2( std::forward_list<std::vector<param>>& rvvi, // final result std::vector<param>& rvi, // current result std::vector<std::vector<param>>::const_iterator me, // current input std::vector<std::vector<param>>::const_iterator end); // final input inline void gcombinations_(const std::vector<int>&, std::vector<int>&, std::forward_list<std::vector<int>>&); inline void combinations(const int, const std::vector<int>&, std::forward_list<std::vector<int>>&); inline void product2( std::forward_list<std::vector<param>>& rvvi, // final result std::vector<param>& rvi, // current result std::vector<std::vector<param>>::const_iterator me, // current input std::vector<std::vector<param>>::const_iterator end) // final input { if (me == end) { // terminal condition of the recursion. We no longer have // any input vectors to manipulate. Add the current result (rvi) // to the total set of results (rvvvi). rvvi.push_front(rvi); return; } // need an easy name for my vector-of-ints const std::vector<param>& mevi = *me; for (std::vector<param>::const_iterator it = mevi.begin(); it != mevi.end(); it++) { // final rvi will look like "a, b, c, ME, d, e, f" // At the moment, rvi already has "a, b, c" rvi.push_back(*it); // add ME product2(rvvi, rvi, me + 1, end); // add "d, e, f" rvi.pop_back(); // clean ME off for next round } } void combinations(const int n, const std::vector<int>& input, std::forward_list<std::vector<int>>& output) { std::vector<int> scratch(n); if (n <= input.size()) { for (int i = 0; i < n; i++) { scratch[i] = i; } gcombinations_(input, scratch, output); while (1) { int i; for (i = n - 1; (i >= 0) && (scratch[i] == (input.size() - n + i)); i--) ; if (i < 0) { break; } else { scratch[i]++; for (++i; i < n; i++) { scratch[i] = scratch[i - 1] + 1; } gcombinations_(input, scratch, output); } } } } inline void gcombinations_(const std::vector<int>& input, std::vector<int>& scratch, std::forward_list<std::vector<int>>& output) { std::vector<int> result(scratch.size()); for (std::size_t i = 0; i < result.size(); i++) { result[i] = input[scratch[i]]; } output.push_front(result); } inline void product( std::forward_list<dtest_case>& rvvi, // final result dtest_case& rvi, // current result std::vector<dtest_case>::const_iterator me, // current input std::vector<dtest_case>::const_iterator end) // final input { if (me == end) { // terminal condition of the recursion. We no longer have // any input vectors to manipulate. Add the current result (rvi) // to the total set of results (rvvvi). rvvi.push_front(rvi); return; } // need an easy name for my vector-of-ints const dtest_case& mevi = *me; for (dtest_case::const_iterator it = mevi.begin(); it != mevi.end(); it++) { // final rvi will look like "a, b, c, ME, d, e, f" // At the moment, rvi already has "a, b, c" rvi.push_back(*it); // add ME product(rvvi, rvi, me + 1, end); // add "d, e, f" rvi.pop_back(); // clean ME off for next round } } inline void product3(std::forward_list<dtest_case>& results, std::vector<dtest_case>::const_iterator begin, std::vector<dtest_case>::const_iterator end) { dtest_case ranges; for (auto it = begin; it != end; ++it) { const dval tmp = (*it).size() - 1; ranges.push_back(tmp); } dtest_case scratch(ranges.size(), 0); const std::size_t max = ranges.size() - 1; for (std::size_t i = max;;) { if (i == max) { for (dval val = 0; val <= ranges[i]; val++) { results.push_front(scratch); scratch[i]++; } scratch[i] = 0; i--; } else if (i == 0 && scratch[i] >= ranges[i]) { return; } else if (scratch[i] < ranges[i]) { scratch[i]++; i++; } else { scratch[i] = -1; i--; } } } inline std::size_t product4(std::forward_list<param**>& results, param** param_cache, std::vector<std::vector<param>*>& param_matrix) { std::vector<int> ranges; std::unique_ptr<param* []> scratch_ptr(new param*[param_matrix.size()]); auto scratch = scratch_ptr.get(); for (std::size_t j = 0; j < param_matrix.size(); j++) { ranges.push_back(param_matrix[j]->size() - 1); scratch[j] = &(*param_matrix[j])[0]; } std::vector<int> indexes(ranges.size(), 0); const std::size_t max = ranges.size() - 1; const std::size_t length = ranges.size(); std::size_t j = 0; for (std::size_t i = max;;) { if (i == max) { for (std::size_t val = 0; val <= ranges[i]; val++) { scratch[i] = &(*param_matrix[i])[indexes[i]]; std::copy(scratch, scratch + length, param_cache); results.push_front(param_cache); param_cache += length; indexes[i]++; j++; } indexes[i] = 0; i--; } else if (i == 0 && indexes[i] >= ranges[i]) { return j; } else if (indexes[i] < ranges[i]) { indexes[i]++; scratch[i] = &(*param_matrix[i])[indexes[i]]; i++; } else { indexes[i] = -1; i--; } } } } #endif
{'content_hash': '81c736ba6a11919f8fca3a902aa2130c', 'timestamp': '', 'source': 'github', 'line_count': 194, 'max_line_length': 78, 'avg_line_length': 31.5979381443299, 'alnum_prop': 0.5367047308319739, 'repo_name': 'jesg/dither', 'id': 'a4376110a3ca96de5fb12e427ce7be176d14552d', 'size': '6323', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'ext/dither/combinations.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C++', 'bytes': '34113'}, {'name': 'Java', 'bytes': '41827'}, {'name': 'Ruby', 'bytes': '27819'}]}
package ie.ucd.clops.runtime.automaton.exception; import ie.ucd.clops.runtime.ClopsInternalException; public class AutomatonException extends ClopsInternalException { private static final long serialVersionUID = 1L; }
{'content_hash': '3b76454bc38f981ed72c746fb4e49a33', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 64, 'avg_line_length': 31.571428571428573, 'alnum_prop': 0.8371040723981901, 'repo_name': 'GaloisInc/CLOPS', 'id': 'f272c230dcd527f798adcf32f24d4471be1e3883', 'size': '222', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/java/ie/ucd/clops/runtime/automaton/exception/AutomatonException.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C++', 'bytes': '3924'}, {'name': 'CSS', 'bytes': '50549'}, {'name': 'Emacs Lisp', 'bytes': '1255'}, {'name': 'GAP', 'bytes': '15558'}, {'name': 'Java', 'bytes': '376488'}, {'name': 'JavaScript', 'bytes': '56638'}, {'name': 'Makefile', 'bytes': '387'}, {'name': 'Ruby', 'bytes': '33239'}, {'name': 'Shell', 'bytes': '1159'}, {'name': 'TeX', 'bytes': '7300'}]}
<!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_29) on Mon Apr 09 00:41:06 EDT 2012 --> <TITLE> Uses of Package cs213.photoAlbum.control </TITLE> <META NAME="date" CONTENT="2012-04-09"> <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 Package cs213.photoAlbum.control"; } } </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"> <FONT CLASS="NavBarFont1">Class</FONT>&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-files/index-1.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> </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?cs213/photoAlbum/control/package-use.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-use.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 Package<br>cs213.photoAlbum.control</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="../../../cs213/photoAlbum/control/package-summary.html">cs213.photoAlbum.control</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#cs213.photoAlbum.GuiView"><B>cs213.photoAlbum.GuiView</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#cs213.photoAlbum.control"><B>cs213.photoAlbum.control</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#cs213.photoAlbum.simpleview"><B>cs213.photoAlbum.simpleview</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="cs213.photoAlbum.GuiView"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Classes in <A HREF="../../../cs213/photoAlbum/control/package-summary.html">cs213.photoAlbum.control</A> used by <A HREF="../../../cs213/photoAlbum/GuiView/package-summary.html">cs213.photoAlbum.GuiView</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../cs213/photoAlbum/control/class-use/Control.html#cs213.photoAlbum.GuiView"><B>Control</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The Control interface will handle all algorithmic logic, decision making, and data manipulation processes.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="cs213.photoAlbum.control"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Classes in <A HREF="../../../cs213/photoAlbum/control/package-summary.html">cs213.photoAlbum.control</A> used by <A HREF="../../../cs213/photoAlbum/control/package-summary.html">cs213.photoAlbum.control</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../cs213/photoAlbum/control/class-use/Control.html#cs213.photoAlbum.control"><B>Control</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The Control interface will handle all algorithmic logic, decision making, and data manipulation processes.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="cs213.photoAlbum.simpleview"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Classes in <A HREF="../../../cs213/photoAlbum/control/package-summary.html">cs213.photoAlbum.control</A> used by <A HREF="../../../cs213/photoAlbum/simpleview/package-summary.html">cs213.photoAlbum.simpleview</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../cs213/photoAlbum/control/class-use/Control.html#cs213.photoAlbum.simpleview"><B>Control</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The Control interface will handle all algorithmic logic, decision making, and data manipulation processes.</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"> <FONT CLASS="NavBarFont1">Class</FONT>&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-files/index-1.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> </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?cs213/photoAlbum/control/package-use.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-use.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> </BODY> </HTML>
{'content_hash': '97e31b1f26c75f210289048b6b09b03d', 'timestamp': '', 'source': 'github', 'line_count': 208, 'max_line_length': 224, 'avg_line_length': 41.77884615384615, 'alnum_prop': 0.64614499424626, 'repo_name': 'GalCohen/Photo-Albums', 'id': '87a768e49f0388e84ab3cb098bda7a1d77b4eca6', 'size': '8690', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/cs213/photoAlbum/control/package-use.html', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Java', 'bytes': '141855'}]}
#if !TARGET_OS_WATCH #import <SystemConfiguration/SCNetworkReachability.h> #endif #import "PFEventuallyQueue.h" @class BFExecutor; @class PFEventuallyPin; @class PFObject; @class PFOperationSet; @class PFTaskQueue; extern NSUInteger const PFEventuallyQueueDefaultMaxAttemptsCount; extern NSTimeInterval const PFEventuallyQueueDefaultTimeoutRetryInterval; @class BFTaskCompletionSource; @interface PFEventuallyQueue () { @protected BFExecutor *_synchronizationExecutor; dispatch_queue_t _synchronizationQueue; #if !TARGET_OS_WATCH // Object for getting network status. SCNetworkReachabilityRef _reachability; dispatch_queue_t _reachabilityQueue; #endif @private dispatch_queue_t _processingQueue; dispatch_source_t _processingQueueSource; dispatch_semaphore_t _retryingSemaphore; NSMutableDictionary *_taskCompletionSources; /*! Task queue that will enqueue command enqueueing task so that we enqueue the command one at a time. */ PFTaskQueue *_commandEnqueueTaskQueue; } @property (nonatomic, assign, readwrite, getter=isConnected) BOOL connected; /*! This method is used to do some work after the command is finished running and either succeeded or dropped from queue with error/exception. @param command Command that was run. @param identifier Unique identifier of the command @param resultTask Task that represents the result of running a command. @returns A continuation task in case the EventuallyQueue need to do something. Typically this will return back given resultTask. */ - (BFTask *)_didFinishRunningCommand:(id<PFNetworkCommand>)command withIdentifier:(NSString *)identifier resultTask:(BFTask *)resultTask; ///-------------------------------------- /// @name Reachability ///-------------------------------------- - (void)_startMonitoringNetworkReachability; - (void)_stopMonitoringNetworkReachability; ///-------------------------------------- /// @name Test Helper ///-------------------------------------- - (void)_setMaxAttemptsCount:(NSUInteger)attemptsCount; - (void)_setRetryInterval:(NSTimeInterval)retryInterval; - (void)_simulateReboot NS_REQUIRES_SUPER; - (int)_commandsInMemory; - (void)_notifyTestHelperObjectUpdated; @end @protocol PFEventuallyQueueSubclass <NSObject> ///-------------------------------------- /// @name Pending Commands ///-------------------------------------- /*! Generates a new identifier for a command so that it can be sorted later by this identifier. */ - (NSString *)_newIdentifierForCommand:(id<PFNetworkCommand>)command; /*! This method is triggered on batch processing of the queue. It will capture the identifiers and use them to execute commands. @returns An array of identifiers of all commands that are pending sorted by the order they're enqueued. */ - (NSArray *)_pendingCommandIdentifiers; /*! This method should return a command for a given identifier. @param identifier An identifier of a command, that was in array returned by <_pendingCommandIdentifiers> @param error Pointer to `NSError *` that should be set if the method failed to construct/retrieve a command. @returns A command that needs to be run, or `nil` if there was an error. */ - (id<PFNetworkCommand>)_commandWithIdentifier:(NSString *)identifier error:(NSError **)error; ///-------------------------------------- /// @name Running Commands ///-------------------------------------- /*! This method serves as a way to do any kind of work to enqueue a command properly. If the task fails with an error/exception or is cancelled - execution won't start. @param command Command that needs to be enqueued @param object The object on which the command is run against. @param identifier Unique identifier used to represent a command. @returns Task that is resolved when the command is complete enqueueing. */ - (BFTask *)_enqueueCommandInBackground:(id<PFNetworkCommand>)command object:(PFObject *)object identifier:(NSString *)identifier; - (BFTask *)_waitForOperationSet:(PFOperationSet *)operationSet eventuallyPin:(PFEventuallyPin *)eventuallyPin; @end
{'content_hash': 'a453409aa277c1fa6939753e9ded98d7', 'timestamp': '', 'source': 'github', 'line_count': 136, 'max_line_length': 114, 'avg_line_length': 31.46323529411765, 'alnum_prop': 0.6840383267118486, 'repo_name': 'iodine/Parse-SDK-iOS-OSX', 'id': '5ac7181d7952048b142a0905e731443c6bf5ac7f', 'size': '4584', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Parse/Internal/PFEventuallyQueue_Private.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '2551'}, {'name': 'C++', 'bytes': '4635'}, {'name': 'Objective-C', 'bytes': '2277745'}, {'name': 'Ruby', 'bytes': '22259'}, {'name': 'Shell', 'bytes': '1743'}, {'name': 'Swift', 'bytes': '10882'}]}
<!DOCTYPE html > <html> <head> <link rel="stylesheet" href="demos.css" type="text/css" media="screen" /> <script type="text/javascript" src="../libraries/RGraph.common.core.js" ></script> <script type="text/javascript" src="../libraries/RGraph.common.dynamic.js" ></script> <script type="text/javascript" src="../libraries/RGraph.common.effects.js" ></script> <script type="text/javascript" src="../libraries/RGraph.common.tooltips.js" ></script> <script type="text/javascript" src="../libraries/RGraph.bar.js" ></script> <script type="text/javascript" src="../libraries/RGraph.pie.js" ></script> <!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]--> <title>A Bar chart with Pie charts in tooltips</title> <meta name="keywords" content="demo bar tooltips ontooltip event pie" /> <meta name="description" content="A Bar chart that has tooltips and uses the ontooltip event to add Pie charts to the tooltips" /> <meta name="robots" content="noindex,nofollow" /> </head> <body> <h1>A Bar chart with Pie charts in tooltips</h1> <p> This Bar chart shows how you can have charts in tooltips. It uses the new DOM1 style of adding the ontooltip event. This ontooltip event creates the chart in the tooltip. </p> <canvas id="cvs" width="600" height="250">[No canvas support]</canvas> <script> window.onload = function () { var bar8 = new RGraph.Bar('cvs', [14,16,18,19,13,14]) .Set('labels', ['Fred','John','James','Louis','Pete','Kevin']) .Set('tooltips', function (index) { var label = bar8.Get('chart.labels')[index]; return '<div style="text-align: center; font-weight: bold; font-size: 16pt">' + label + '</div><br /><canvas id="tooltip_canvas" width="250" height="110"></canvas>'; }) RGraph.Effects.Bar.Grow(bar8); /** * The ontooltip event runs when a tooltip is shown and creates the Pie chart in the tooltip */ bar8.ontooltip = function (obj) { var pie_data = [ [80,75,65], [84,85,95], [43,54,85], [43,51,62], [74,75,65], [78,85,95], [46,35,52], [84,94,94] ] var tooltip = RGraph.Registry.Get('chart.tooltip'); var index = tooltip.__index__; var pie = new RGraph.Pie('tooltip_canvas', pie_data[index]) .Set('labels', ['Monday','Tuesday','Wednesday']) .Set('gutter.top', 10) .Set('gutter.bottom', 25) .Draw(); pie.onmousemove = function (e, shape) { alert('An alert triggered by the Pie chart! Segment: ' + shape.index); } } } </script> <p> <a href="./">&laquo; Back</a> </p> </body> </html>
{'content_hash': '62ae163d0896602be500c274ca1c20ae', 'timestamp': '', 'source': 'github', 'line_count': 82, 'max_line_length': 203, 'avg_line_length': 41.03658536585366, 'alnum_prop': 0.4915304606240713, 'repo_name': 'richardfearn/diirt', 'id': '6be61a01e8460aab01522a439fc9dd0c6f99e7fe', 'size': '3365', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'pods/web-pods/src/main/webapp/js/widgets/lib/RGraph/demos/bar-pie-charts-tooltips.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '74191'}, {'name': 'GAP', 'bytes': '6519'}, {'name': 'Java', 'bytes': '4176965'}, {'name': 'JavaScript', 'bytes': '1716484'}, {'name': 'Shell', 'bytes': '3421'}]}
package net.syntaxblitz.TimTerm.commands; import java.util.List; public class Whois extends Search { @Override protected String getURI(String query, List<String> flags) { return "http://who.is/whois/" + query.replaceAll("[^A-Za-z0-9.\\-]", ""); } @Override protected boolean getShouldEncode() { return false; } }
{'content_hash': 'd878164a6e91035fad88c3f2438b03b7', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 75, 'avg_line_length': 19.41176470588235, 'alnum_prop': 0.693939393939394, 'repo_name': 'SyntaxBlitz/timterm', 'id': '31ffbd02ad57d83fb5ac257544c6f29ae45cdf64', 'size': '330', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'java/timterm/src/net/syntaxblitz/TimTerm/commands/Whois.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '5145'}, {'name': 'Java', 'bytes': '16201'}]}
package com.pacoworks.rxpaper.sample.model; public class ImmutableObject { private final String value; public ImmutableObject(String value) { this.value = value; } public String getValue() { return value; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ImmutableObject that = (ImmutableObject)o; return value != null ? value.equals(that.value) : that.value == null; } @Override public int hashCode() { return value != null ? value.hashCode() : 0; } @Override public String toString() { return "ImmutableObject{" + "value='" + value + '\'' + '}'; } }
{'content_hash': '44546b34abf4edf705fb7c5d75824822', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 77, 'avg_line_length': 21.88888888888889, 'alnum_prop': 0.5647208121827412, 'repo_name': 'pakoito/RxPaper', 'id': '045d6e8a5d3b46c929697346cc11de4bb6fb0663', 'size': '1942', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tests/src/main/java/com/pacoworks/rxpaper/sample/model/ImmutableObject.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '33537'}]}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta name="description" content="Bootstrap Admin App + jQuery"> <meta name="keywords" content="app, responsive, jquery, bootstrap, dashboard, admin"> <title>Angle - Bootstrap Admin Template</title> <!-- =============== VENDOR STYLES ===============--> <!-- FONT AWESOME--> <link rel="stylesheet" href="../vendor/fontawesome/css/font-awesome.min.css"> <!-- SIMPLE LINE ICONS--> <link rel="stylesheet" href="../vendor/simple-line-icons/css/simple-line-icons.css"> <!-- ANIMATE.CSS--> <link rel="stylesheet" href="../vendor/animate.css/animate.min.css"> <!-- WHIRL (spinners)--> <link rel="stylesheet" href="../vendor/whirl/dist/whirl.css"> <!-- =============== PAGE VENDOR STYLES ===============--> <!-- MORRIS--> <link rel="stylesheet" href="../vendor/morris.js/morris.css"> <!-- =============== BOOTSTRAP STYLES ===============--> <link rel="stylesheet" href="css/bootstrap.css" id="bscss"> <!-- =============== APP STYLES ===============--> <link rel="stylesheet" href="css/app.css" id="maincss"> </head> <body> <div class="wrapper"> <!-- top navbar--> <header class="topnavbar-wrapper"> <!-- START Top Navbar--> <nav role="navigation" class="navbar topnavbar"> <!-- START navbar header--> <div class="navbar-header"> <a href="#/" class="navbar-brand"> <div class="brand-logo"> <img src="img/logo.png" alt="App Logo" class="img-responsive"> </div> <div class="brand-logo-collapsed"> <img src="img/logo-single.png" alt="App Logo" class="img-responsive"> </div> </a> </div> <!-- END navbar header--> <!-- START Nav wrapper--> <div class="nav-wrapper"> <!-- START Left navbar--> <ul class="nav navbar-nav"> <li> <!-- Button used to collapse the left sidebar. Only visible on tablet and desktops--> <a href="#" data-toggle-state="aside-collapsed" class="hidden-xs"> <em class="fa fa-navicon"></em> </a> <!-- Button to show/hide the sidebar on mobile. Visible on mobile only.--> <a href="#" data-toggle-state="aside-toggled" data-no-persist="true" class="visible-xs sidebar-toggle"> <em class="fa fa-navicon"></em> </a> </li> <!-- START User avatar toggle--> <li> <!-- Button used to collapse the left sidebar. Only visible on tablet and desktops--> <a id="user-block-toggle" href="#user-block" data-toggle="collapse"> <em class="icon-user"></em> </a> </li> <!-- END User avatar toggle--> <!-- START lock screen--> <li> <a href="lock.html" title="Lock screen"> <em class="icon-lock"></em> </a> </li> <!-- END lock screen--> </ul> <!-- END Left navbar--> <!-- START Right Navbar--> <ul class="nav navbar-nav navbar-right"> <!-- Search icon--> <li> <a href="#" data-search-open=""> <em class="icon-magnifier"></em> </a> </li> <!-- Fullscreen (only desktops)--> <li class="visible-lg"> <a href="#" data-toggle-fullscreen=""> <em class="fa fa-expand"></em> </a> </li> <!-- START Alert menu--> <li class="dropdown dropdown-list"> <a href="#" data-toggle="dropdown"> <em class="icon-bell"></em> <div class="label label-danger">11</div> </a> <!-- START Dropdown menu--> <ul class="dropdown-menu animated flipInX"> <li> <!-- START list group--> <div class="list-group"> <!-- list item--> <a href="#" class="list-group-item"> <div class="media-box"> <div class="pull-left"> <em class="fa fa-twitter fa-2x text-info"></em> </div> <div class="media-box-body clearfix"> <p class="m0">New followers</p> <p class="m0 text-muted"> <small>1 new follower</small> </p> </div> </div> </a> <!-- list item--> <a href="#" class="list-group-item"> <div class="media-box"> <div class="pull-left"> <em class="fa fa-envelope fa-2x text-warning"></em> </div> <div class="media-box-body clearfix"> <p class="m0">New e-mails</p> <p class="m0 text-muted"> <small>You have 10 new emails</small> </p> </div> </div> </a> <!-- list item--> <a href="#" class="list-group-item"> <div class="media-box"> <div class="pull-left"> <em class="fa fa-tasks fa-2x text-success"></em> </div> <div class="media-box-body clearfix"> <p class="m0">Pending Tasks</p> <p class="m0 text-muted"> <small>11 pending task</small> </p> </div> </div> </a> <!-- last list item --> <a href="#" class="list-group-item"> <small>More notifications</small> <span class="label label-danger pull-right">14</span> </a> </div> <!-- END list group--> </li> </ul> <!-- END Dropdown menu--> </li> <!-- END Alert menu--> <!-- START Contacts button--> <li> <a href="#" data-toggle-state="offsidebar-open" data-no-persist="true"> <em class="icon-notebook"></em> </a> </li> <!-- END Contacts menu--> </ul> <!-- END Right Navbar--> </div> <!-- END Nav wrapper--> <!-- START Search form--> <form role="search" action="search.html" class="navbar-form"> <div class="form-group has-feedback"> <input type="text" placeholder="Type and hit enter ..." class="form-control"> <div data-search-dismiss="" class="fa fa-times form-control-feedback"></div> </div> <button type="submit" class="hidden btn btn-default">Submit</button> </form> <!-- END Search form--> </nav> <!-- END Top Navbar--> </header> <!-- sidebar--> <aside class="aside"> <!-- START Sidebar (left)--> <div class="aside-inner"> <nav data-sidebar-anyclick-close="" class="sidebar"> <!-- START sidebar nav--> <ul class="nav"> <!-- START user info--> <li class="has-user-block"> <div id="user-block" class="collapse"> <div class="item user-block"> <!-- User picture--> <div class="user-block-picture"> <div class="user-block-status"> <img src="img/user/02.jpg" alt="Avatar" width="60" height="60" class="img-thumbnail img-circle"> <div class="circle circle-success circle-lg"></div> </div> </div> <!-- Name and Job--> <div class="user-block-info"> <span class="user-block-name">Hello, Mike</span> <span class="user-block-role">Designer</span> </div> </div> </div> </li> <!-- END user info--> <!-- Iterates over all sidebar items--> <li class="nav-heading "> <span data-localize="sidebar.heading.HEADER">Main Navigation</span> </li> <li class=" "> <a href="#dashboard" title="Dashboard" data-toggle="collapse"> <em class="icon-speedometer"></em> <div class="pull-right label label-info">3</div> <span data-localize="sidebar.nav.DASHBOARD">Dashboard</span> </a> <ul id="dashboard" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">Dashboard</li> <li class=" "> <a href="dashboard.html" title="Dashboard v1"> <span>Dashboard v1</span> </a> </li> <li class=" "> <a href="dashboard_v2.html" title="Dashboard v2"> <span>Dashboard v2</span> </a> </li> <li class=" "> <a href="dashboard_v3.html" title="Dashboard v3"> <span>Dashboard v3</span> </a> </li> </ul> </li> <li class=" "> <a href="widgets.html" title="Widgets"> <em class="icon-grid"></em> <div class="pull-right label label-success">30</div> <span data-localize="sidebar.nav.WIDGETS">Widgets</span> </a> </li> <li class=" "> <a href="#layout" title="Layouts" data-toggle="collapse"> <em class="icon-layers"></em> <span>Layouts</span> </a> <ul id="layout" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">Layouts</li> <li class=" "> <a href="dashboard_h.html" title="Horizontal"> <span>Horizontal</span> </a> </li> </ul> </li> <li class="nav-heading "> <span data-localize="sidebar.heading.COMPONENTS">Components</span> </li> <li class=" "> <a href="#elements" title="Elements" data-toggle="collapse"> <em class="icon-chemistry"></em> <span data-localize="sidebar.nav.element.ELEMENTS">Elements</span> </a> <ul id="elements" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">Elements</li> <li class=" "> <a href="buttons.html" title="Buttons"> <span data-localize="sidebar.nav.element.BUTTON">Buttons</span> </a> </li> <li class=" "> <a href="notifications.html" title="Notifications"> <span data-localize="sidebar.nav.element.NOTIFICATION">Notifications</span> </a> </li> <li class=" "> <a href="sweetalert.html" title="Sweet Alert"> <div class="pull-right label label-purple">new</div> <span>Sweet Alert</span> </a> </li> <li class=" "> <a href="tour.html" title="Tour"> <div class="pull-right label label-purple">new</div> <span>Tour</span> </a> </li> <li class=" "> <a href="carousel.html" title="Carousel"> <span data-localize="sidebar.nav.element.INTERACTION">Carousel</span> </a> </li> <li class=" "> <a href="spinners.html" title="Spinners"> <span data-localize="sidebar.nav.element.SPINNER">Spinners</span> </a> </li> <li class=" "> <a href="animations.html" title="Animations"> <span data-localize="sidebar.nav.element.ANIMATION">Animations</span> </a> </li> <li class=" "> <a href="dropdown-animations.html" title="Dropdown"> <span data-localize="sidebar.nav.element.DROPDOWN">Dropdown</span> </a> </li> <li class=" "> <a href="nestable.html" title="Nestable"> <span>Nestable</span> </a> </li> <li class=" "> <a href="sortable.html" title="Sortable"> <span>Sortable</span> </a> </li> <li class=" "> <a href="panels.html" title="Panels"> <span data-localize="sidebar.nav.element.PANEL">Panels</span> </a> </li> <li class=" "> <a href="portlets.html" title="Portlets"> <span data-localize="sidebar.nav.element.PORTLET">Portlets</span> </a> </li> <li class=" "> <a href="grid.html" title="Grid"> <span data-localize="sidebar.nav.element.GRID">Grid</span> </a> </li> <li class=" "> <a href="grid-masonry.html" title="Grid Masonry"> <span data-localize="sidebar.nav.element.GRID_MASONRY">Grid Masonry</span> </a> </li> <li class=" "> <a href="typo.html" title="Typography"> <span data-localize="sidebar.nav.element.TYPO">Typography</span> </a> </li> <li class=" "> <a href="icons-font.html" title="Font Icons"> <div class="pull-right label label-success">+400</div> <span data-localize="sidebar.nav.element.FONT_ICON">Font Icons</span> </a> </li> <li class=" "> <a href="icons-weather.html" title="Weather Icons"> <div class="pull-right label label-success">+100</div> <span data-localize="sidebar.nav.element.WEATHER_ICON">Weather Icons</span> </a> </li> <li class=" "> <a href="colors.html" title="Colors"> <span data-localize="sidebar.nav.element.COLOR">Colors</span> </a> </li> </ul> </li> <li class=" "> <a href="#forms" title="Forms" data-toggle="collapse"> <em class="icon-note"></em> <span data-localize="sidebar.nav.form.FORM">Forms</span> </a> <ul id="forms" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">Forms</li> <li class=" "> <a href="form-standard.html" title="Standard"> <span data-localize="sidebar.nav.form.STANDARD">Standard</span> </a> </li> <li class=" "> <a href="form-extended.html" title="Extended"> <span data-localize="sidebar.nav.form.EXTENDED">Extended</span> </a> </li> <li class=" "> <a href="form-validation.html" title="Validation"> <span data-localize="sidebar.nav.form.VALIDATION">Validation</span> </a> </li> <li class=" "> <a href="form-wizard.html" title="Wizard"> <span>Wizard</span> </a> </li> <li class=" "> <a href="form-upload.html" title="Upload"> <span>Upload</span> </a> </li> <li class=" "> <a href="form-xeditable.html" title="xEditable"> <span>xEditable</span> </a> </li> </ul> </li> <li class=" "> <a href="#charts" title="Charts" data-toggle="collapse"> <em class="icon-graph"></em> <span data-localize="sidebar.nav.chart.CHART">Charts</span> </a> <ul id="charts" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">Charts</li> <li class=" "> <a href="chart-flot.html" title="Flot"> <span data-localize="sidebar.nav.chart.FLOT">Flot</span> </a> </li> <li class=" "> <a href="chart-radial.html" title="Radial"> <span data-localize="sidebar.nav.chart.RADIAL">Radial</span> </a> </li> <li class=" "> <a href="chart-js.html" title="Chart JS"> <span>Chart JS</span> </a> </li> <li class=" "> <a href="chart-rickshaw.html" title="Rickshaw"> <span>Rickshaw</span> </a> </li> <li class=" active"> <a href="chart-morris.html" title="MorrisJS"> <span>MorrisJS</span> </a> </li> <li class=" "> <a href="chart-chartist.html" title="Chartist"> <span>Chartist</span> </a> </li> </ul> </li> <li class=" "> <a href="#tables" title="Tables" data-toggle="collapse"> <em class="icon-grid"></em> <span data-localize="sidebar.nav.table.TABLE">Tables</span> </a> <ul id="tables" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">Tables</li> <li class=" "> <a href="table-standard.html" title="Standard"> <span data-localize="sidebar.nav.table.STANDARD">Standard</span> </a> </li> <li class=" "> <a href="table-extended.html" title="Extended"> <span data-localize="sidebar.nav.table.EXTENDED">Extended</span> </a> </li> <li class=" "> <a href="table-datatable.html" title="DataTables"> <span data-localize="sidebar.nav.table.DATATABLE">DataTables</span> </a> </li> <li class=" "> <a href="table-jqgrid.html" title="jqGrid"> <span>jqGrid</span> </a> </li> </ul> </li> <li class=" "> <a href="#maps" title="Maps" data-toggle="collapse"> <em class="icon-map"></em> <span data-localize="sidebar.nav.map.MAP">Maps</span> </a> <ul id="maps" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">Maps</li> <li class=" "> <a href="maps-google.html" title="Google Maps"> <span data-localize="sidebar.nav.map.GOOGLE">Google Maps</span> </a> </li> <li class=" "> <a href="maps-vector.html" title="Vector Maps"> <span data-localize="sidebar.nav.map.VECTOR">Vector Maps</span> </a> </li> </ul> </li> <li class="nav-heading "> <span data-localize="sidebar.heading.MORE">More</span> </li> <li class=" "> <a href="#pages" title="Pages" data-toggle="collapse"> <em class="icon-doc"></em> <span data-localize="sidebar.nav.pages.PAGES">Pages</span> </a> <ul id="pages" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">Pages</li> <li class=" "> <a href="login.html" title="Login"> <span data-localize="sidebar.nav.pages.LOGIN">Login</span> </a> </li> <li class=" "> <a href="register.html" title="Sign up"> <span data-localize="sidebar.nav.pages.REGISTER">Sign up</span> </a> </li> <li class=" "> <a href="recover.html" title="Recover Password"> <span data-localize="sidebar.nav.pages.RECOVER">Recover Password</span> </a> </li> <li class=" "> <a href="lock.html" title="Lock"> <span data-localize="sidebar.nav.pages.LOCK">Lock</span> </a> </li> <li class=" "> <a href="template.html" title="Starter Template"> <span data-localize="sidebar.nav.pages.STARTER">Starter Template</span> </a> </li> <li class=" "> <a href="404.html" title="404"> <span>404</span> </a> </li> </ul> </li> <li class=" "> <a href="#extras" title="Extras" data-toggle="collapse"> <em class="icon-cup"></em> <div class="pull-right label label-success">new</div> <span data-localize="sidebar.nav.extra.EXTRA">Extras</span> </a> <ul id="extras" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">Extras</li> <li class=" "> <a href="#blog" title="Blog" data-toggle="collapse"> <em class="fa fa-angle-right"></em> <div class="pull-right label label-success">new</div> <span>Blog</span> </a> <ul id="blog" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">Blog</li> <li class=" "> <a href="blog.html" title="List"> <span>List</span> </a> </li> <li class=" "> <a href="blog-post.html" title="Post"> <span>Post</span> </a> </li> <li class=" "> <a href="blog-articles.html" title="Articles"> <span>Articles</span> </a> </li> <li class=" "> <a href="blog-article-view.html" title="Article View"> <span>Article View</span> </a> </li> </ul> </li> <li class=" "> <a href="#ecommerce" title="eCommerce" data-toggle="collapse"> <em class="fa fa-angle-right"></em> <div class="pull-right label label-success">new</div> <span>eCommerce</span> </a> <ul id="ecommerce" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">eCommerce</li> <li class=" "> <a href="ecommerce-orders.html" title="Orders"> <div class="pull-right label label-info">10</div> <span>Orders</span> </a> </li> <li class=" "> <a href="ecommerce-order-view.html" title="Order View"> <span>Order View</span> </a> </li> <li class=" "> <a href="ecommerce-products.html" title="Products"> <span>Products</span> </a> </li> <li class=" "> <a href="ecommerce-product-view.html" title="Product View"> <span>Product View</span> </a> </li> </ul> </li> <li class=" "> <a href="#forum" title="Forum" data-toggle="collapse"> <em class="fa fa-angle-right"></em> <div class="pull-right label label-success">new</div> <span>Forum</span> </a> <ul id="forum" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">Forum</li> <li class=" "> <a href="forum-categories.html" title="Categories"> <span>Categories</span> </a> </li> <li class=" "> <a href="forum-topics.html" title="Topics"> <span>Topics</span> </a> </li> <li class=" "> <a href="forum-discussion.html" title="Discussion"> <span>Discussion</span> </a> </li> </ul> </li> <li class=" "> <a href="mailbox.html" title="Mailbox"> <span data-localize="sidebar.nav.extra.MAILBOX">Mailbox</span> </a> </li> <li class=" "> <a href="timeline.html" title="Timeline"> <span data-localize="sidebar.nav.extra.TIMELINE">Timeline</span> </a> </li> <li class=" "> <a href="calendar.html" title="Calendar"> <span data-localize="sidebar.nav.extra.CALENDAR">Calendar</span> </a> </li> <li class=" "> <a href="invoice.html" title="Invoice"> <span data-localize="sidebar.nav.extra.INVOICE">Invoice</span> </a> </li> <li class=" "> <a href="search.html" title="Search"> <span data-localize="sidebar.nav.extra.SEARCH">Search</span> </a> </li> <li class=" "> <a href="todo.html" title="Todo List"> <span data-localize="sidebar.nav.extra.TODO">Todo List</span> </a> </li> <li class=" "> <a href="profile.html" title="Profile"> <span data-localize="sidebar.nav.extra.PROFILE">Profile</span> </a> </li> </ul> </li> <li class=" "> <a href="#multilevel" title="Multilevel" data-toggle="collapse"> <em class="fa fa-folder-open-o"></em> <span>Multilevel</span> </a> <ul id="multilevel" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">Multilevel</li> <li class=" "> <a href="#level1" title="Level 1" data-toggle="collapse"> <span>Level 1</span> </a> <ul id="level1" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">Level 1</li> <li class=" "> <a href="multilevel-1.html" title="Level1 Item"> <span>Level1 Item</span> </a> </li> <li class=" "> <a href="#level2" title="Level 2" data-toggle="collapse"> <span>Level 2</span> </a> <ul id="level2" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">Level 2</li> <li class=" "> <a href="#level3" title="Level 3" data-toggle="collapse"> <span>Level 3</span> </a> <ul id="level3" class="nav sidebar-subnav collapse"> <li class="sidebar-subnav-header">Level 3</li> <li class=" "> <a href="multilevel-3.html" title="Level3 Item"> <span>Level3 Item</span> </a> </li> </ul> </li> </ul> </li> </ul> </li> </ul> </li> <li class=" "> <a href="documentation.html" title="Documentation"> <em class="icon-graduation"></em> <span data-localize="sidebar.nav.DOCUMENTATION">Documentation</span> </a> </li> </ul> <!-- END sidebar nav--> </nav> </div> <!-- END Sidebar (left)--> </aside> <!-- offsidebar--> <aside class="offsidebar hide"> <!-- START Off Sidebar (right)--> <nav> <div role="tabpanel"> <!-- Nav tabs--> <ul role="tablist" class="nav nav-tabs nav-justified"> <li role="presentation" class="active"> <a href="#app-settings" aria-controls="app-settings" role="tab" data-toggle="tab"> <em class="icon-equalizer fa-lg"></em> </a> </li> <li role="presentation"> <a href="#app-chat" aria-controls="app-chat" role="tab" data-toggle="tab"> <em class="icon-users fa-lg"></em> </a> </li> </ul> <!-- Tab panes--> <div class="tab-content"> <div id="app-settings" role="tabpanel" class="tab-pane fade in active"> <h3 class="text-center text-thin">Settings</h3> <div class="p"> <h4 class="text-muted text-thin">Themes</h4> <div class="table-grid mb"> <div class="col mb"> <div class="setting-color"> <label data-load-css="css/theme-a.css"> <input type="radio" name="setting-theme" checked="checked"> <span class="icon-check"></span> <span class="split"> <span class="color bg-info"></span> <span class="color bg-info-light"></span> </span> <span class="color bg-white"></span> </label> </div> </div> <div class="col mb"> <div class="setting-color"> <label data-load-css="css/theme-b.css"> <input type="radio" name="setting-theme"> <span class="icon-check"></span> <span class="split"> <span class="color bg-green"></span> <span class="color bg-green-light"></span> </span> <span class="color bg-white"></span> </label> </div> </div> <div class="col mb"> <div class="setting-color"> <label data-load-css="css/theme-c.css"> <input type="radio" name="setting-theme"> <span class="icon-check"></span> <span class="split"> <span class="color bg-purple"></span> <span class="color bg-purple-light"></span> </span> <span class="color bg-white"></span> </label> </div> </div> <div class="col mb"> <div class="setting-color"> <label data-load-css="css/theme-d.css"> <input type="radio" name="setting-theme"> <span class="icon-check"></span> <span class="split"> <span class="color bg-danger"></span> <span class="color bg-danger-light"></span> </span> <span class="color bg-white"></span> </label> </div> </div> </div> <div class="table-grid mb"> <div class="col mb"> <div class="setting-color"> <label data-load-css="css/theme-e.css"> <input type="radio" name="setting-theme"> <span class="icon-check"></span> <span class="split"> <span class="color bg-info-dark"></span> <span class="color bg-info"></span> </span> <span class="color bg-gray-dark"></span> </label> </div> </div> <div class="col mb"> <div class="setting-color"> <label data-load-css="css/theme-f.css"> <input type="radio" name="setting-theme"> <span class="icon-check"></span> <span class="split"> <span class="color bg-green-dark"></span> <span class="color bg-green"></span> </span> <span class="color bg-gray-dark"></span> </label> </div> </div> <div class="col mb"> <div class="setting-color"> <label data-load-css="css/theme-g.css"> <input type="radio" name="setting-theme"> <span class="icon-check"></span> <span class="split"> <span class="color bg-purple-dark"></span> <span class="color bg-purple"></span> </span> <span class="color bg-gray-dark"></span> </label> </div> </div> <div class="col mb"> <div class="setting-color"> <label data-load-css="css/theme-h.css"> <input type="radio" name="setting-theme"> <span class="icon-check"></span> <span class="split"> <span class="color bg-danger-dark"></span> <span class="color bg-danger"></span> </span> <span class="color bg-gray-dark"></span> </label> </div> </div> </div> </div> <div class="p"> <h4 class="text-muted text-thin">Layout</h4> <div class="clearfix"> <p class="pull-left">Fixed</p> <div class="pull-right"> <label class="switch"> <input id="chk-fixed" type="checkbox" data-toggle-state="layout-fixed"> <span></span> </label> </div> </div> <div class="clearfix"> <p class="pull-left">Boxed</p> <div class="pull-right"> <label class="switch"> <input id="chk-boxed" type="checkbox" data-toggle-state="layout-boxed"> <span></span> </label> </div> </div> <div class="clearfix"> <p class="pull-left">RTL</p> <div class="pull-right"> <label class="switch"> <input id="chk-rtl" type="checkbox"> <span></span> </label> </div> </div> </div> <div class="p"> <h4 class="text-muted text-thin">Aside</h4> <div class="clearfix"> <p class="pull-left">Collapsed</p> <div class="pull-right"> <label class="switch"> <input id="chk-collapsed" type="checkbox" data-toggle-state="aside-collapsed"> <span></span> </label> </div> </div> <div class="clearfix"> <p class="pull-left">Float</p> <div class="pull-right"> <label class="switch"> <input id="chk-float" type="checkbox" data-toggle-state="aside-float"> <span></span> </label> </div> </div> <div class="clearfix"> <p class="pull-left">Hover</p> <div class="pull-right"> <label class="switch"> <input id="chk-hover" type="checkbox" data-toggle-state="aside-hover"> <span></span> </label> </div> </div> </div> </div> <div id="app-chat" role="tabpanel" class="tab-pane fade"> <h3 class="text-center text-thin">Connections</h3> <ul class="nav"> <!-- START list title--> <li class="p"> <small class="text-muted">ONLINE</small> </li> <!-- END list title--> <li> <!-- START User status--> <a href="#" class="media-box p mt0"> <span class="pull-right"> <span class="circle circle-success circle-lg"></span> </span> <span class="pull-left"> <!-- Contact avatar--> <img src="img/user/05.jpg" alt="Image" class="media-box-object img-circle thumb48"> </span> <!-- Contact info--> <span class="media-box-body"> <span class="media-box-heading"> <strong>Juan Sims</strong> <br> <small class="text-muted">Designeer</small> </span> </span> </a> <!-- END User status--> <!-- START User status--> <a href="#" class="media-box p mt0"> <span class="pull-right"> <span class="circle circle-success circle-lg"></span> </span> <span class="pull-left"> <!-- Contact avatar--> <img src="img/user/06.jpg" alt="Image" class="media-box-object img-circle thumb48"> </span> <!-- Contact info--> <span class="media-box-body"> <span class="media-box-heading"> <strong>Maureen Jenkins</strong> <br> <small class="text-muted">Designeer</small> </span> </span> </a> <!-- END User status--> <!-- START User status--> <a href="#" class="media-box p mt0"> <span class="pull-right"> <span class="circle circle-danger circle-lg"></span> </span> <span class="pull-left"> <!-- Contact avatar--> <img src="img/user/07.jpg" alt="Image" class="media-box-object img-circle thumb48"> </span> <!-- Contact info--> <span class="media-box-body"> <span class="media-box-heading"> <strong>Billie Dunn</strong> <br> <small class="text-muted">Designeer</small> </span> </span> </a> <!-- END User status--> <!-- START User status--> <a href="#" class="media-box p mt0"> <span class="pull-right"> <span class="circle circle-warning circle-lg"></span> </span> <span class="pull-left"> <!-- Contact avatar--> <img src="img/user/08.jpg" alt="Image" class="media-box-object img-circle thumb48"> </span> <!-- Contact info--> <span class="media-box-body"> <span class="media-box-heading"> <strong>Tomothy Roberts</strong> <br> <small class="text-muted">Designer</small> </span> </span> </a> <!-- END User status--> </li> <!-- START list title--> <li class="p"> <small class="text-muted">OFFLINE</small> </li> <!-- END list title--> <li> <!-- START User status--> <a href="#" class="media-box p mt0"> <span class="pull-right"> <span class="circle circle-lg"></span> </span> <span class="pull-left"> <!-- Contact avatar--> <img src="img/user/09.jpg" alt="Image" class="media-box-object img-circle thumb48"> </span> <!-- Contact info--> <span class="media-box-body"> <span class="media-box-heading"> <strong>Lawrence Robinson</strong> <br> <small class="text-muted">Developer</small> </span> </span> </a> <!-- END User status--> <!-- START User status--> <a href="#" class="media-box p mt0"> <span class="pull-right"> <span class="circle circle-lg"></span> </span> <span class="pull-left"> <!-- Contact avatar--> <img src="img/user/10.jpg" alt="Image" class="media-box-object img-circle thumb48"> </span> <!-- Contact info--> <span class="media-box-body"> <span class="media-box-heading"> <strong>Tyrone Owens</strong> <br> <small class="text-muted">Designer</small> </span> </span> </a> <!-- END User status--> </li> <li> <div class="p-lg text-center"> <!-- Optional link to list more users--> <a href="#" title="See more contacts" class="btn btn-purple btn-sm"> <strong>Load more..</strong> </a> </div> </li> </ul> <!-- Extra items--> <div class="p"> <p> <small class="text-muted">Tasks completion</small> </p> <div class="progress progress-xs m0"> <div role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" class="progress-bar progress-bar-success progress-80"> <span class="sr-only">80% Complete</span> </div> </div> </div> <div class="p"> <p> <small class="text-muted">Upload quota</small> </p> <div class="progress progress-xs m0"> <div role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" class="progress-bar progress-bar-warning progress-40"> <span class="sr-only">40% Complete</span> </div> </div> </div> </div> </div> </div> </nav> <!-- END Off Sidebar (right)--> </aside> <!-- Main section--> <section> <!-- Page content--> <div class="content-wrapper"> <h3>Morris JS</h3> <div class="container-fluid"> <div class="row"> <div class="col-md-6"> <div class="panel panel-default"> <div class="panel-heading">Line</div> <div class="panel-body"> <div id="morris-line"></div> </div> </div> </div> <div class="col-md-6"> <div class="panel panel-default"> <div class="panel-heading">Area</div> <div class="panel-body"> <div id="morris-area"></div> </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="panel panel-default"> <div class="panel-heading">Bar</div> <div class="panel-body"> <div id="morris-bar"></div> </div> </div> </div> <div class="col-md-6"> <div class="panel panel-default"> <div class="panel-heading">Donut</div> <div class="panel-body"> <div id="morris-donut"></div> </div> </div> </div> </div> </div> </div> </section> <!-- Page footer--> <footer> <span>&copy; 2015 - Angle</span> </footer> </div> <!-- =============== VENDOR SCRIPTS ===============--> <!-- MODERNIZR--> <script src="../vendor/modernizr/modernizr.js"></script> <!-- JQUERY--> <script src="../vendor/jquery/dist/jquery.js"></script> <!-- BOOTSTRAP--> <script src="../vendor/bootstrap/dist/js/bootstrap.js"></script> <!-- STORAGE API--> <script src="../vendor/jQuery-Storage-API/jquery.storageapi.js"></script> <!-- JQUERY EASING--> <script src="../vendor/jquery.easing/js/jquery.easing.js"></script> <!-- ANIMO--> <script src="../vendor/animo.js/animo.js"></script> <!-- SLIMSCROLL--> <script src="../vendor/slimScroll/jquery.slimscroll.min.js"></script> <!-- SCREENFULL--> <script src="../vendor/screenfull/dist/screenfull.js"></script> <!-- LOCALIZE--> <script src="../vendor/jquery-localize-i18n/dist/jquery.localize.js"></script> <!-- RTL demo--> <script src="js/demo/demo-rtl.js"></script> <!-- =============== PAGE VENDOR SCRIPTS ===============--> <!-- RAPHAEL--> <script src="../vendor/raphael/raphael.js"></script> <!-- MORRIS--> <script src="../vendor/morris.js/morris.js"></script> <!-- =============== APP SCRIPTS ===============--> <script src="js/app.js"></script> </body> </html>
{'content_hash': '2f99a7e5e48869e7319c72b904050602', 'timestamp': '', 'source': 'github', 'line_count': 1157, 'max_line_length': 162, 'avg_line_length': 51.191875540190146, 'alnum_prop': 0.3352242989076297, 'repo_name': 'Codeidea/budget-tracker', 'id': '2285201e7dacd762c831c4cf37ccf043ac2ed92a', 'size': '59229', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'templates/angle_demo/chart-morris.html', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '570837'}, {'name': 'HTML', 'bytes': '4693800'}, {'name': 'JavaScript', 'bytes': '8631'}, {'name': 'Python', 'bytes': '20288'}]}
cmake_minimum_required(VERSION 3.6.0) # SDK_ARCH if(NOT SDK_ARCH) set(SDK_ARCH "armv7-a") elseif(SDK_ARCH MATCHES "^(arm64|aarch64)$") set(SDK_ARCH "armv8-a") endif() # compiler and linker flags if(SDK_ARCH MATCHES "^arm") list(APPEND SDK_C_FLAGS -march=${SDK_ARCH}) endif() if(SDK_ARCH MATCHES "^armv7") list(APPEND SDK_C_FLAGS -mfloat-abi=softfp -mfpu=neon -ftree-vectorize -ffast-math) endif() include(${CMAKE_CURRENT_LIST_DIR}/gcc-toolchain.cmake)
{'content_hash': 'b9f95db2b4b1f9884ff5ae2615c7eb68', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 85, 'avg_line_length': 25.72222222222222, 'alnum_prop': 0.7105831533477321, 'repo_name': 'maxint/arcbuild', 'id': 'e0600cb32c0eb21415e7ad15426da30de1b57d7d', 'size': '1005', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'arcbuild/toolchains/gcc-arm.cmake', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '200'}, {'name': 'CMake', 'bytes': '77759'}, {'name': 'Shell', 'bytes': '139'}]}
require 'helper' describe Gems do after do Gems.reset end context 'when delegating to a client' do before do stub_get('/api/v1/gems/rails.json'). to_return(:body => fixture('rails.json')) end it 'gets the correct resource' do Gems.info('rails') expect(a_get('/api/v1/gems/rails.json')).to have_been_made end it 'returns the same results as a client' do expect(Gems.info('rails')).to eq Gems::Client.new.info('rails') end end describe '.respond_to?' do it 'returns true if a method exists' do expect(Gems).to respond_to(:new) end it "returns false if a method doesn't exist" do expect(Gems).not_to respond_to(:foo) end end describe '.new' do it 'returns a Gems::Client' do expect(Gems.new).to be_a Gems::Client end end describe '.host' do it 'returns the default host' do expect(Gems.host).to eq Gems::Configuration::DEFAULT_HOST end end describe '.host=' do it 'sets the host' do Gems.host = 'http://localhost:3000' expect(Gems.host).to eq 'http://localhost:3000' end end describe '.user_agent' do it 'returns the default user agent' do expect(Gems.user_agent).to eq Gems::Configuration::DEFAULT_USER_AGENT end end describe '.user_agent=' do it 'sets the user agent' do Gems.user_agent = 'Custom User Agent' expect(Gems.user_agent).to eq 'Custom User Agent' end end describe '.configure' do Gems::Configuration::VALID_OPTIONS_KEYS.each do |key| it "sets the #{key}" do Gems.configure do |config| config.send("#{key}=", key) expect(Gems.send(key)).to eq key end end end end end
{'content_hash': 'ad715458f0222575e6cb6877ce553fb1', 'timestamp': '', 'source': 'github', 'line_count': 75, 'max_line_length': 75, 'avg_line_length': 23.333333333333332, 'alnum_prop': 0.6194285714285714, 'repo_name': 'seuros/gems', 'id': '4bbf53a117469891a98bc6b3ee301825c283f5a8', 'size': '1750', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'spec/gems_spec.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '37455'}]}
package org.joda.time; import java.lang.reflect.Method; import java.text.DateFormatSymbols; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Locale; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; import org.joda.time.chrono.ISOChronology; /** * DateTimeUtils provide public utility methods for the date-time library. * <p> * DateTimeUtils uses shared static variables which are declared as volatile * for thread-safety. These can be changed during the lifetime of the application * however doing so is generally a bad idea. * * @author Stephen Colebourne * @since 1.0 */ public class DateTimeUtils { /** * The singleton instance of the system millisecond provider. */ public static final MillisProvider SYSTEM_MILLIS_PROVIDER = new SystemMillisProvider(); /** The millisecond provider currently in use. */ private static volatile MillisProvider cMillisProvider = SYSTEM_MILLIS_PROVIDER; /** * The default names. * This is lazily initialized to reduce risks of race conditions at startup. */ private static final AtomicReference<Map<String, DateTimeZone>> cZoneNames = new AtomicReference<Map<String,DateTimeZone>>(); /** * Restrictive constructor */ protected DateTimeUtils() { super(); } //----------------------------------------------------------------------- /** * Gets the current time in milliseconds. * <p> * By default this returns <code>System.currentTimeMillis()</code>. * This may be changed using other methods in this class. * * @return the current time in milliseconds from 1970-01-01T00:00:00Z */ public static final long currentTimeMillis() { return cMillisProvider.getMillis(); } /** * Resets the current time to return the system time. * <p> * This method changes the behaviour of {@link #currentTimeMillis()}. * Whenever the current time is queried, {@link System#currentTimeMillis()} is used. * * @throws SecurityException if the application does not have sufficient security rights */ public static final void setCurrentMillisSystem() throws SecurityException { checkPermission(); cMillisProvider = SYSTEM_MILLIS_PROVIDER; } /** * Sets the current time to return a fixed millisecond time. * <p> * This method changes the behaviour of {@link #currentTimeMillis()}. * Whenever the current time is queried, the same millisecond time will be returned. * * @param fixedMillis the fixed millisecond time to use * @throws SecurityException if the application does not have sufficient security rights */ public static final void setCurrentMillisFixed(long fixedMillis) throws SecurityException { checkPermission(); cMillisProvider = new FixedMillisProvider(fixedMillis); } /** * Sets the current time to return the system time plus an offset. * <p> * This method changes the behaviour of {@link #currentTimeMillis()}. * Whenever the current time is queried, {@link System#currentTimeMillis()} is used * and then offset by adding the millisecond value specified here. * * @param offsetMillis the fixed millisecond time to use * @throws SecurityException if the application does not have sufficient security rights */ public static final void setCurrentMillisOffset(long offsetMillis) throws SecurityException { checkPermission(); if (offsetMillis == 0) { cMillisProvider = SYSTEM_MILLIS_PROVIDER; } else { cMillisProvider = new OffsetMillisProvider(offsetMillis); } } /** * Sets the provider of the current time to class specified. * <p> * This method changes the behaviour of {@link #currentTimeMillis()}. * Whenever the current time is queried, the specified class will be called. * * @param millisProvider the provider of the current time to use, not null * @throws SecurityException if the application does not have sufficient security rights * @since 2.0 */ public static final void setCurrentMillisProvider(MillisProvider millisProvider) throws SecurityException { if (millisProvider == null) { throw new IllegalArgumentException("The MillisProvider must not be null"); } checkPermission(); cMillisProvider = millisProvider; } /** * Checks whether the provider may be changed using permission 'CurrentTime.setProvider'. * * @throws SecurityException if the provider may not be changed */ private static void checkPermission() throws SecurityException { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new JodaTimePermission("CurrentTime.setProvider")); } } //----------------------------------------------------------------------- /** * Gets the millisecond instant from the specified instant object handling null. * <p> * If the instant object is <code>null</code>, the {@link #currentTimeMillis()} * will be returned. Otherwise, the millis from the object are returned. * * @param instant the instant to examine, null means now * @return the time in milliseconds from 1970-01-01T00:00:00Z */ public static final long getInstantMillis(ReadableInstant instant) { if (instant == null) { return DateTimeUtils.currentTimeMillis(); } return instant.getMillis(); } //----------------------------------------------------------------------- /** * Gets the chronology from the specified instant object handling null. * <p> * If the instant object is <code>null</code>, or the instant's chronology is * <code>null</code>, {@link ISOChronology#getInstance()} will be returned. * Otherwise, the chronology from the object is returned. * * @param instant the instant to examine, null means ISO in the default zone * @return the chronology, never null */ public static final Chronology getInstantChronology(ReadableInstant instant) { if (instant == null) { return ISOChronology.getInstance(); } Chronology chrono = instant.getChronology(); if (chrono == null) { return ISOChronology.getInstance(); } return chrono; } //----------------------------------------------------------------------- /** * Gets the chronology from the specified instant based interval handling null. * <p> * The chronology is obtained from the start if that is not null, or from the * end if the start is null. The result is additionally checked, and if still * null then {@link ISOChronology#getInstance()} will be returned. * * @param start the instant to examine and use as the primary source of the chronology * @param end the instant to examine and use as the secondary source of the chronology * @return the chronology, never null */ public static final Chronology getIntervalChronology(ReadableInstant start, ReadableInstant end) { Chronology chrono = null; if (start != null) { chrono = start.getChronology(); } else if (end != null) { chrono = end.getChronology(); } if (chrono == null) { chrono = ISOChronology.getInstance(); } return chrono; } //----------------------------------------------------------------------- /** * Gets the chronology from the specified interval object handling null. * <p> * If the interval object is <code>null</code>, or the interval's chronology is * <code>null</code>, {@link ISOChronology#getInstance()} will be returned. * Otherwise, the chronology from the object is returned. * * @param interval the interval to examine, null means ISO in the default zone * @return the chronology, never null */ public static final Chronology getIntervalChronology(ReadableInterval interval) { if (interval == null) { return ISOChronology.getInstance(); } Chronology chrono = interval.getChronology(); if (chrono == null) { return ISOChronology.getInstance(); } return chrono; } //----------------------------------------------------------------------- /** * Gets the interval handling null. * <p> * If the interval is <code>null</code>, an interval representing now * to now in the {@link ISOChronology#getInstance() ISOChronology} * will be returned. Otherwise, the interval specified is returned. * * @param interval the interval to use, null means now to now * @return the interval, never null * @since 1.1 */ public static final ReadableInterval getReadableInterval(ReadableInterval interval) { if (interval == null) { long now = DateTimeUtils.currentTimeMillis(); interval = new Interval(now, now); } return interval; } //----------------------------------------------------------------------- /** * Gets the chronology handling null. * <p> * If the chronology is <code>null</code>, {@link ISOChronology#getInstance()} * will be returned. Otherwise, the chronology is returned. * * @param chrono the chronology to use, null means ISO in the default zone * @return the chronology, never null */ public static final Chronology getChronology(Chronology chrono) { if (chrono == null) { return ISOChronology.getInstance(); } return chrono; } //----------------------------------------------------------------------- /** * Gets the zone handling null. * <p> * If the zone is <code>null</code>, {@link DateTimeZone#getDefault()} * will be returned. Otherwise, the zone specified is returned. * * @param zone the time zone to use, null means the default zone * @return the time zone, never null */ public static final DateTimeZone getZone(DateTimeZone zone) { if (zone == null) { return DateTimeZone.getDefault(); } return zone; } //----------------------------------------------------------------------- /** * Gets the period type handling null. * <p> * If the zone is <code>null</code>, {@link PeriodType#standard()} * will be returned. Otherwise, the type specified is returned. * * @param type the time zone to use, null means the standard type * @return the type to use, never null */ public static final PeriodType getPeriodType(PeriodType type) { if (type == null) { return PeriodType.standard(); } return type; } //----------------------------------------------------------------------- /** * Gets the millisecond duration from the specified duration object handling null. * <p> * If the duration object is <code>null</code>, zero will be returned. * Otherwise, the millis from the object are returned. * * @param duration the duration to examine, null means zero * @return the duration in milliseconds */ public static final long getDurationMillis(ReadableDuration duration) { if (duration == null) { return 0L; } return duration.getMillis(); } //----------------------------------------------------------------------- /** * Checks whether the partial is contiguous. * <p> * A partial is contiguous if one field starts where another ends. * <p> * For example <code>LocalDate</code> is contiguous because DayOfMonth has * the same range (Month) as the unit of the next field (MonthOfYear), and * MonthOfYear has the same range (Year) as the unit of the next field (Year). * <p> * Similarly, <code>LocalTime</code> is contiguous, as it consists of * MillisOfSecond, SecondOfMinute, MinuteOfHour and HourOfDay (note how * the names of each field 'join up'). * <p> * However, a Year/HourOfDay partial is not contiguous because the range * field Day is not equal to the next field Year. * Similarly, a DayOfWeek/DayOfMonth partial is not contiguous because * the range Month is not equal to the next field Day. * * @param partial the partial to check * @return true if the partial is contiguous * @throws IllegalArgumentException if the partial is null * @since 1.1 */ public static final boolean isContiguous(ReadablePartial partial) { if (partial == null) { throw new IllegalArgumentException("Partial must not be null"); } DurationFieldType lastType = null; for (int i = 0; i < partial.size(); i++) { DateTimeField loopField = partial.getField(i); if (i > 0) { if (loopField.getRangeDurationField() == null || loopField.getRangeDurationField().getType() != lastType) { return false; } } lastType = loopField.getDurationField().getType(); } return true; } //----------------------------------------------------------------------- /** * Gets the {@link DateFormatSymbols} based on the given locale. * <p> * If JDK 6 or newer is being used, DateFormatSymbols.getInstance(locale) will * be used in order to allow the use of locales defined as extensions. * Otherwise, new DateFormatSymbols(locale) will be used. * See JDK 6 {@link DateFormatSymbols} for further information. * * @param locale the {@link Locale} used to get the correct {@link DateFormatSymbols} * @return the symbols * @since 2.0 */ public static final DateFormatSymbols getDateFormatSymbols(Locale locale) { try { Method method = DateFormatSymbols.class.getMethod("getInstance", new Class[] {Locale.class}); return (DateFormatSymbols) method.invoke(null, new Object[] {locale}); } catch (Exception ex) { return new DateFormatSymbols(locale); } } //----------------------------------------------------------------------- /** * Gets the default map of time zone names. * <p> * This can be changed by {@link #setDefaultTimeZoneNames}. * <p> * The default set of short time zone names is as follows: * <ul> * <li>UT - UTC * <li>UTC - UTC * <li>GMT - UTC * <li>EST - America/New_York * <li>EDT - America/New_York * <li>CST - America/Chicago * <li>CDT - America/Chicago * <li>MST - America/Denver * <li>MDT - America/Denver * <li>PST - America/Los_Angeles * <li>PDT - America/Los_Angeles * </ul> * * @return the unmodifiable map of abbreviations to zones, not null * @since 2.2 */ public static final Map<String, DateTimeZone> getDefaultTimeZoneNames() { Map<String, DateTimeZone> names = cZoneNames.get(); if (names == null) { names = buildDefaultTimeZoneNames(); if (!cZoneNames.compareAndSet(null, names)) { names = cZoneNames.get(); } } return names; } /** * Sets the default map of time zone names. * <p> * The map is copied before storage. * * @param names the map of abbreviations to zones, not null * @since 2.2 */ public static final void setDefaultTimeZoneNames(Map<String, DateTimeZone> names) { cZoneNames.set(Collections.unmodifiableMap(new HashMap<String, DateTimeZone>(names))); } public static Map<String, DateTimeZone> buildDefaultTimeZoneNames() { // names from RFC-822 / JDK // this is all very US-centric and dubious, but perhaps it will help some Map<String, DateTimeZone> map = new LinkedHashMap<String, DateTimeZone>(); map.put("UT", DateTimeZone.UTC); map.put("UTC", DateTimeZone.UTC); map.put("GMT", DateTimeZone.UTC); put(map, "EST", "America/New_York"); put(map, "EDT", "America/New_York"); put(map, "CST", "America/Chicago"); put(map, "CDT", "America/Chicago"); put(map, "MST", "America/Denver"); put(map, "MDT", "America/Denver"); put(map, "PST", "America/Los_Angeles"); put(map, "PDT", "America/Los_Angeles"); return Collections.unmodifiableMap(map); } private static void put(Map<String, DateTimeZone> map, String name, String id) { try { map.put(name, DateTimeZone.forID(id)); } catch (RuntimeException ex) { // ignore } } //------------------------------------------------------------------------- /** * Calculates the astronomical Julian Day for an instant. * <p> * The <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> is a well-known * system of time measurement for scientific use by the astronomy community. * It expresses the interval of time in days and fractions of a day since * January 1, 4713 BC (Julian) Greenwich noon. * <p> * Each day starts at midday (not midnight) and time is expressed as a fraction. * Thus the fraction 0.25 is 18:00. equal to one quarter of the day from midday to midday. * <p> * Note that this method has nothing to do with the day-of-year. * * @param epochMillis the epoch millis from 1970-01-01Z * @return the astronomical Julian Day represented by the specified instant * @since 2.2 */ public static final double toJulianDay(long epochMillis) { // useful links // http://en.wikipedia.org/wiki/Julian_day#cite_note-13 - Wikipedia // http://aa.usno.navy.mil/data/docs/JulianDate.php" - USNO // http://users.zoominternet.net/~matto/Java/Julian%20Date%20Converter.htm - Julian Date Converter by Matt Oltersdorf // http://ssd.jpl.nasa.gov/tc.cgi#top - CalTech double epochDay = epochMillis / 86400000d; return epochDay + 2440587.5d; } /** * Calculates the astronomical Julian Day Number for an instant. * <p> * The {@link #toJulianDay(long)} method calculates the astronomical Julian Day * with a fraction based on days starting at midday. * This method calculates the variant where days start at midnight. * JDN 0 is used for the date equivalent to Monday January 1, 4713 BC (Julian). * Thus these days start 12 hours before those of the fractional Julian Day. * <p> * Note that this method has nothing to do with the day-of-year. * * @param epochMillis the epoch millis from 1970-01-01Z * @return the astronomical Julian Day represented by the specified instant * @since 2.2 */ public static final long toJulianDayNumber(long epochMillis) { return (long) Math.floor(toJulianDay(epochMillis) + 0.5d); } /** * Creates a date-time from a Julian Day. * <p> * Returns the {@code DateTime} object equal to the specified Julian Day. * * @param julianDay the Julian Day * @return the epoch millis from 1970-01-01Z * @since 2.2 */ public static final long fromJulianDay(double julianDay) { double epochDay = julianDay - 2440587.5d; return (long) (epochDay * 86400000d); } //----------------------------------------------------------------------- /** * A millisecond provider, allowing control of the system clock. * * @author Stephen Colebourne * @since 2.0 (previously private) */ public static interface MillisProvider { /** * Gets the current time. * <p> * Implementations of this method must be thread-safe. * * @return the current time in milliseconds */ long getMillis(); } /** * System millis provider. */ static class SystemMillisProvider implements MillisProvider { /** * Gets the current time. * @return the current time in millis */ public long getMillis() { return System.currentTimeMillis(); } } /** * Fixed millisecond provider. */ static class FixedMillisProvider implements MillisProvider { /** The fixed millis value. */ private final long iMillis; /** * Constructor. * @param fixedMillis the millis value */ FixedMillisProvider(long fixedMillis) { iMillis = fixedMillis; } /** * Gets the current time. * @return the current time in millis */ public long getMillis() { return iMillis; } } /** * Offset from system millis provider. */ static class OffsetMillisProvider implements MillisProvider { /** The millis offset. */ private final long iMillis; /** * Constructor. * @param offsetMillis the millis offset */ OffsetMillisProvider(long offsetMillis) { iMillis = offsetMillis; } /** * Gets the current time. * @return the current time in millis */ public long getMillis() { return System.currentTimeMillis() + iMillis; } } }
{'content_hash': '97a5a63452b5fac810b70729cc5ff4b3', 'timestamp': '', 'source': 'github', 'line_count': 585, 'max_line_length': 125, 'avg_line_length': 37.27521367521368, 'alnum_prop': 0.594423553150509, 'repo_name': 'PavelSozonov/JodaTimeTesting', 'id': 'a4e0d64e65f6fe9c29b59615f68ed304a94f0bff', 'size': '22422', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/org/joda/time/DateTimeUtils.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '988'}, {'name': 'HTML', 'bytes': '74917301'}, {'name': 'Java', 'bytes': '5884672'}]}
using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace DbExam.Models { public class Superhero : INameable { /*Each superhero has name, secret identity, city that protects, alignment , * story, a list of fractions and a list of powers*/ private ICollection<Power> powers; private ICollection<Fraction> fractions; private ICollection<Relationship> relationships; public Superhero() { this.powers = new HashSet<Power>(); this.fractions = new HashSet<Fraction>(); this.relationships = new HashSet<Relationship>(); } public int Id { get; set; } [Required] [StringLength(60, MinimumLength = 3)] public string Name { get; set; } [Required] [StringLength(20, MinimumLength = 3)] [Index(IsUnique = true)] public string SecretIdentity { get; set; } [Required] public int CityId { get; set; } public virtual City City { get; set; } [Required] public AlignmentType AlignmentType { get; set; } [Column(TypeName = "ntext")] [Required] public string Story { get; set; } public virtual ICollection<Relationship> Relationships { get { return this.relationships; } set { this.relationships = value; } } public virtual ICollection<Power> Powers { get { return this.powers; } set { this.powers = value; } } public virtual ICollection<Fraction> Fractions { get { return this.fractions; } set { this.fractions = value; } } } }
{'content_hash': '7762ea6622de1106743889ae359031ac', 'timestamp': '', 'source': 'github', 'line_count': 80, 'max_line_length': 83, 'avg_line_length': 24.9, 'alnum_prop': 0.5251004016064257, 'repo_name': 'shakuu/Exams', 'id': 'a60af314ab7512d0aa69e0a93f2d9e469229f65a', 'size': '1994', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'DBEXAM/Databases-and-sql-description/DbExam/DbExam.Models/Superhero.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '588398'}, {'name': 'CSS', 'bytes': '40104'}, {'name': 'HTML', 'bytes': '1768934'}, {'name': 'JavaScript', 'bytes': '465329'}, {'name': 'SQLPL', 'bytes': '1563'}]}
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. using System; using System.ComponentModel.Composition.Hosting; using System.Diagnostics; using System.IO; using System.Linq; using System.Threading; using Microsoft.VisualStudio.TestTools.UnitTesting; using VsChromium.Core.Files; using VsChromium.Core.Ipc.TypedMessages; using VsChromium.Core.Linq; using VsChromium.Server.FileSystem; using VsChromium.Server.Search; namespace VsChromium.Tests.Server { [TestClass] public class TestSearchCode : MefTestBase { private static CompositionContainer _container; private static FileInfo _testFile; private static IFileRegistrationTracker _registry; private static ISearchEngine _searchEngine; private static readonly EventWaitHandle _serverReadyEvent = new ManualResetEvent(false); [ClassInitialize] public static void Initialize(TestContext context) { _container = SetupServerMefContainer(); _registry = _container.GetExportedValue<IFileRegistrationTracker>(); _searchEngine = _container.GetExportedValue<ISearchEngine>(); _searchEngine.FilesLoaded += (sender, result) => _serverReadyEvent.Set(); _testFile = Utils.GetChromiumTestEnlistmentFile(); _registry.RegisterFileAsync(new FullPath(_testFile.FullName)); } [ClassCleanup] public static void Cleanup() { _container.Dispose(); } [TestMethod] public void SingleOccurrenceWorks() { const string searchPattern = "Test directory looking like"; VerifySearchCodeResponse(searchPattern, Options.MatchCase, 1); var searchPatternLower = searchPattern.ToLowerInvariant(); VerifySearchCodeResponse(searchPatternLower, Options.None, 1); } [TestMethod] public void MultipleOccurrenceWorks() { const string searchPattern = "Nothing here. Just making sure the directory exists."; VerifySearchCodeResponse(searchPattern, Options.MatchCase, 3); var searchPatternLower = searchPattern.ToLowerInvariant(); VerifySearchCodeResponse(searchPatternLower, Options.None, 3); } [TestMethod] public void SingleWildcardWorks() { const string searchPattern = "Test*looking"; VerifySearchCodeResponse(searchPattern, Options.MatchCase, 1, 0, 22); var searchPatternLower = searchPattern.ToLowerInvariant(); VerifySearchCodeResponse(searchPatternLower, Options.None, 1, 0, 22); } [TestMethod] public void SingleWildcardWorks2() { const string searchPattern = "looking*like"; VerifySearchCodeResponse(searchPattern, Options.MatchCase, 1, 15, 12); var searchPatternLower = searchPattern.ToLowerInvariant(); VerifySearchCodeResponse(searchPatternLower, Options.None, 1, 15, 12); } [TestMethod] public void MultipleWildcardsWorks() { const string searchPattern = "Test*looking*like"; VerifySearchCodeResponse(searchPattern, Options.MatchCase, 1, 0, 27); var searchPatternLower = searchPattern.ToLowerInvariant(); VerifySearchCodeResponse(searchPatternLower, Options.None, 1, 0, 27); } [TestMethod] public void MultipleWildcardsWorks2() { const string searchPattern = "Test*directory*looking*like"; VerifySearchCodeResponse(searchPattern, Options.MatchCase, 1, 0, 27); var searchPatternLower = searchPattern.ToLowerInvariant(); VerifySearchCodeResponse(searchPatternLower, Options.None, 1, 0, 27); } [TestMethod] public void MultipleWildcardsWorks3() { const string searchPattern = "directory*looking*like"; VerifySearchCodeResponse(searchPattern, Options.MatchCase, 1, 5, 22); var searchPatternLower = searchPattern.ToLowerInvariant(); VerifySearchCodeResponse(searchPatternLower, Options.None, 1, 5, 22); } [TestMethod] public void EscapeWildcardIsIgnored() { const string searchPattern = @"foo\* bar"; VerifySearchCodeResponse(searchPattern, Options.MatchCase, 0); var searchPatternLower = searchPattern.ToLowerInvariant(); VerifySearchCodeResponse(searchPatternLower, Options.None, 0); } [TestMethod] public void EscapeWildcardIsIgnored2() { const string searchPattern = @"foo\*\\bar"; VerifySearchCodeResponse(searchPattern, Options.MatchCase, 0); var searchPatternLower = searchPattern.ToLowerInvariant(); VerifySearchCodeResponse(searchPatternLower, Options.None, 0); } [TestMethod] public void MultipleWholeWordWorks() { const string searchPattern = "directory"; VerifySearchCodeResponse(searchPattern, Options.MatchCase | Options.MatchWholeWord, 4); var searchPatternLower = searchPattern.ToLowerInvariant(); VerifySearchCodeResponse(searchPatternLower, Options.None | Options.MatchWholeWord, 4); } [TestMethod] public void MultipleWholeWordWorks2() { const string searchPattern = "irectory"; VerifySearchCodeResponse(searchPattern, Options.MatchCase | Options.MatchWholeWord, 0); var searchPatternLower = searchPattern.ToLowerInvariant(); VerifySearchCodeResponse(searchPatternLower, Options.None | Options.MatchWholeWord, 0); } [TestMethod] public void RegexWorks() { const string searchPattern = "Test directory looking like"; VerifySearchCodeResponse(searchPattern, Options.MatchCase | Options.Regex, 1); VerifySearchCodeResponse(searchPattern, Options.Regex, 1); } [TestMethod] public void RegexWorks2() { const string searchPattern = "[a-z]+"; VerifySearchCodeResponse(searchPattern, Options.MatchCase | Options.Regex, 102); VerifySearchCodeResponse(searchPattern, Options.Regex, 104); } [Flags] private enum Options { None = 0, MatchCase = 0x01, Regex = 0x02, MatchWholeWord = 0x04, } private static void VerifySearchCodeResponse( string searchPattern, Options options, int occurrenceCount, params int[] positionsAndLengths) { if (!_serverReadyEvent.WaitOne(TimeSpan.FromSeconds(5.0))) { Assert.Fail("Search engine did not load files within timeout. This is due to an error or a (very) slow file system."); } var searchParams = new SearchParams { SearchString = searchPattern, MaxResults = 2000, MatchCase = options.HasFlag(Options.MatchCase), Regex = options.HasFlag(Options.Regex), IncludeSymLinks = false, MatchWholeWord = options.HasFlag(Options.MatchWholeWord), UseRe2Engine = true, }; var searchResult = _searchEngine.SearchCode(searchParams); Assert.IsNotNull(searchResult); searchResult.Entries.ForAll((index, entry) => { Debug.WriteLine(string.Format("File name: \"{0}\"", entry.FileName)); entry.Spans.ForAll(span => { Assert.IsNotNull(span); Debug.WriteLine(string.Format(" Text position: offset={0}, length={1}, text=\"{2}\"", span.Position, span.Length, ExtractFileText(entry.FileName.FullPath, span))); if (positionsAndLengths != null && positionsAndLengths.Length > 0) { Assert.AreEqual(positionsAndLengths[index * 2], span.Position); Assert.AreEqual(positionsAndLengths[(index * 2) + 1], span.Length); } }); }); var hitCount = searchResult.Entries.Aggregate(0, (c, entry) => c += entry.Spans.Count); Assert.AreEqual(occurrenceCount, hitCount); } private static string ExtractFileText(FullPath filepath, FilePositionSpan filePositionSpan) { var path = filepath.Value; if (!File.Exists(path)) return string.Format("File not found: {0}", path); var text = File.ReadAllText(path); var offset = filePositionSpan.Position; var length = Math.Min(80, filePositionSpan.Length); if (offset < 0) return "<Invalid offset>"; if (length < 0) return "<Invalid length>"; if (offset + length > text.Length) return "<Invalid span>"; var extract = text.Substring(offset, length); return extract; } } }
{'content_hash': '63535227dd1076edf71f856083e0ca7b', 'timestamp': '', 'source': 'github', 'line_count': 232, 'max_line_length': 126, 'avg_line_length': 36.60344827586207, 'alnum_prop': 0.6804050871408385, 'repo_name': 'chromium/vs-chromium', 'id': '92da9e3467ff0c144f7bd4d8cc4c928cb3af5306', 'size': '8494', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Tests/Server/TestSearchCode.cs', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Batchfile', 'bytes': '6989'}, {'name': 'C', 'bytes': '889'}, {'name': 'C#', 'bytes': '1680231'}, {'name': 'C++', 'bytes': '40185'}, {'name': 'Python', 'bytes': '166'}]}
package com.ghstudios.android.loader; import android.content.Context; import android.database.Cursor; import com.ghstudios.android.data.database.DataManager; public class WyporiumTradeListCursorLoader extends SQLiteCursorLoader { public WyporiumTradeListCursorLoader(Context context) { super(context); } @Override protected Cursor loadCursor() { // Query the list of all wyporium trades return DataManager.get(getContext()).queryWyporiumTrades(); } }
{'content_hash': '3bb5ece33be616897d0afc95e3f9370c', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 71, 'avg_line_length': 26.31578947368421, 'alnum_prop': 0.746, 'repo_name': 'jaysonthepirate/MHGenDatabase', 'id': '85d77eef67533f2e1db2fd4c75a18ff1afdddf18', 'size': '500', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/java/com/ghstudios/android/loader/WyporiumTradeListCursorLoader.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '1119497'}]}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc on Fri Aug 22 03:44:09 EDT 2003 --> <TITLE> PlugInConfig (Apache Struts API Documentation) </TITLE> <META NAME="keywords" CONTENT="org.apache.struts.config.PlugInConfig,PlugInConfig class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> </HEAD> <SCRIPT> function asd() { parent.document.title="PlugInConfig (Apache Struts API Documentation)"; } </SCRIPT> <BODY BGCOLOR="white" onload="asd();"> <!-- ========== START OF NAVBAR ========== --> <A NAME="navbar_top"><!-- --></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <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="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/PlugInConfig.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&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> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../org/apache/struts/config/ModuleConfigFactory.html"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../org/apache/struts/config/PlugInSetPropertyRule.html"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="PlugInConfig.html" TARGET="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp; <SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.apache.struts.config</FONT> <BR> Class PlugInConfig</H2> <PRE> java.lang.Object | +--<B>org.apache.struts.config.PlugInConfig</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable</DD> </DL> <HR> <DL> <DT>public class <B>PlugInConfig</B><DT>extends java.lang.Object<DT>implements java.io.Serializable</DL> <P> <p>A JavaBean representing the configuration information of a <code>&lt;plug-in&gt;</code> element in a Struts configuration file.</p> <P> <P> <DL> <DT><B>Since:</B></DT> <DD>Struts 1.1</DD> <DT><B>Version:</B></DT> <DD>$Revision: 1.1 $ $Date: 2003-08-22 17:14:33 +0900 (金, 22 8月 2003) $</DD> <DT><B>Author:</B></DT> <DD>Craig R. McClanahan</DD> <DT><B>See Also:</B><DD><A HREF="../../../../serialized-form.html" TARGET="org.apache.struts.config.PlugInConfig">Serialized Form</A></DL> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Field Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/apache/struts/config/PlugInConfig.html#className">className</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The fully qualified Java class name of the <code>PlugIn</code> implementation class being configured.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/apache/struts/config/PlugInConfig.html#configured">configured</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Has this component been completely configured?</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;java.util.Map</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/apache/struts/config/PlugInConfig.html#properties">properties</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A <code>Map</code> of the name-value pairs that will be used to configure the property values of a <code>PlugIn</code> instance.</TD> </TR> </TABLE> &nbsp; <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../org/apache/struts/config/PlugInConfig.html#PlugInConfig()">PlugInConfig</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Method Summary</B></FONT></TD> </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><A HREF="../../../../org/apache/struts/config/PlugInConfig.html#addProperty(java.lang.String, java.lang.String)">addProperty</A></B>(java.lang.String&nbsp;name, java.lang.String&nbsp;value)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Add a new property name and value to the set that will be used to configure the <code>PlugIn</code> instance.</TD> </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><A HREF="../../../../org/apache/struts/config/PlugInConfig.html#freeze()">freeze</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Freeze the configuration of this component.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/apache/struts/config/PlugInConfig.html#getClassName()">getClassName</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>&nbsp;java.util.Map</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/apache/struts/config/PlugInConfig.html#getProperties()">getProperties</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the properties that will be used to configure a <code>PlugIn</code> instance.</TD> </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><A HREF="../../../../org/apache/struts/config/PlugInConfig.html#setClassName(java.lang.String)">setClassName</A></B>(java.lang.String&nbsp;className)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class java.lang.Object</B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ============ FIELD DETAIL =========== --> <A NAME="field_detail"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Field Detail</B></FONT></TD> </TR> </TABLE> <A NAME="configured"><!-- --></A><H3> configured</H3> <PRE> protected boolean <B>configured</B></PRE> <DL> <DD>Has this component been completely configured? <P> <DL> </DL> </DL> <HR> <A NAME="properties"><!-- --></A><H3> properties</H3> <PRE> protected java.util.Map <B>properties</B></PRE> <DL> <DD>A <code>Map</code> of the name-value pairs that will be used to configure the property values of a <code>PlugIn</code> instance. <P> <DL> </DL> </DL> <HR> <A NAME="className"><!-- --></A><H3> className</H3> <PRE> protected java.lang.String <B>className</B></PRE> <DL> <DD>The fully qualified Java class name of the <code>PlugIn</code> implementation class being configured. <P> <DL> </DL> </DL> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TD> </TR> </TABLE> <A NAME="PlugInConfig()"><!-- --></A><H3> PlugInConfig</H3> <PRE> public <B>PlugInConfig</B>()</PRE> <DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Method Detail</B></FONT></TD> </TR> </TABLE> <A NAME="getClassName()"><!-- --></A><H3> getClassName</H3> <PRE> public java.lang.String <B>getClassName</B>()</PRE> <DL> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="setClassName(java.lang.String)"><!-- --></A><H3> setClassName</H3> <PRE> public void <B>setClassName</B>(java.lang.String&nbsp;className)</PRE> <DL> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="addProperty(java.lang.String, java.lang.String)"><!-- --></A><H3> addProperty</H3> <PRE> public void <B>addProperty</B>(java.lang.String&nbsp;name, java.lang.String&nbsp;value)</PRE> <DL> <DD>Add a new property name and value to the set that will be used to configure the <code>PlugIn</code> instance. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>name</CODE> - Property name<DD><CODE>value</CODE> - Property value</DL> </DD> </DL> <HR> <A NAME="freeze()"><!-- --></A><H3> freeze</H3> <PRE> public void <B>freeze</B>()</PRE> <DL> <DD>Freeze the configuration of this component. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getProperties()"><!-- --></A><H3> getProperties</H3> <PRE> public java.util.Map <B>getProperties</B>()</PRE> <DL> <DD>Return the properties that will be used to configure a <code>PlugIn</code> instance. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ========== START OF NAVBAR ========== --> <A NAME="navbar_bottom"><!-- --></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <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="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/PlugInConfig.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&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> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../org/apache/struts/config/ModuleConfigFactory.html"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../org/apache/struts/config/PlugInSetPropertyRule.html"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="PlugInConfig.html" TARGET="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp; <SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> Copyright © 2000-2003 - Apache Software Foundation </BODY> </HTML>
{'content_hash': 'd2731b0cd836e388df99d33a89cc31b1', 'timestamp': '', 'source': 'github', 'line_count': 439, 'max_line_length': 184, 'avg_line_length': 35.09567198177677, 'alnum_prop': 0.6268579217238918, 'repo_name': 'codelibs/cl-struts', 'id': '55679ad0a27645d843bffad8497873daf6d93a39', 'size': '15407', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'legacy/api-1.1/org/apache/struts/config/PlugInConfig.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '42594'}, {'name': 'GAP', 'bytes': '7214'}, {'name': 'HTML', 'bytes': '17088052'}, {'name': 'Java', 'bytes': '6592773'}, {'name': 'XSLT', 'bytes': '36989'}]}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>mathcomp-algebra: 4 m 30 s 🏆</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.14.0 / mathcomp-algebra - 1.14.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> mathcomp-algebra <small> 1.14.0 <span class="label label-success">4 m 30 s 🏆</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-06-03 04:13:51 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-06-03 04:13:51 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 4 Virtual package relying on a GMP lib system installation coq 8.14.0 Formal proof management system dune 3.2.0 Fast, portable, and opinionated build system ocaml 4.10.2 The OCaml compiler (virtual package) ocaml-base-compiler 4.10.2 Official release 4.10.2 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.3 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Mathematical Components &lt;[email protected]&gt;&quot; homepage: &quot;https://math-comp.github.io/&quot; bug-reports: &quot;https://github.com/math-comp/math-comp/issues&quot; dev-repo: &quot;git+https://github.com/math-comp/math-comp.git&quot; license: &quot;CECILL-B&quot; build: [ make &quot;-C&quot; &quot;mathcomp/algebra&quot; &quot;-j&quot; &quot;%{jobs}%&quot; &quot;COQEXTRAFLAGS+=-native-compiler yes&quot; {coq-native:installed &amp; coq:version &lt; &quot;8.13~&quot; } ] install: [ make &quot;-C&quot; &quot;mathcomp/algebra&quot; &quot;install&quot; ] depends: [ &quot;coq-mathcomp-fingroup&quot; { = version } ] tags: [ &quot;keyword:algebra&quot; &quot;keyword:small scale reflection&quot; &quot;keyword:mathematical components&quot; &quot;keyword:odd order theorem&quot; &quot;logpath:mathcomp.algebra&quot; ] authors: [ &quot;Jeremy Avigad &lt;&gt;&quot; &quot;Andrea Asperti &lt;&gt;&quot; &quot;Stephane Le Roux &lt;&gt;&quot; &quot;Yves Bertot &lt;&gt;&quot; &quot;Laurence Rideau &lt;&gt;&quot; &quot;Enrico Tassi &lt;&gt;&quot; &quot;Ioana Pasca &lt;&gt;&quot; &quot;Georges Gonthier &lt;&gt;&quot; &quot;Sidi Ould Biha &lt;&gt;&quot; &quot;Cyril Cohen &lt;&gt;&quot; &quot;Francois Garillot &lt;&gt;&quot; &quot;Alexey Solovyev &lt;&gt;&quot; &quot;Russell O&#39;Connor &lt;&gt;&quot; &quot;Laurent Théry &lt;&gt;&quot; &quot;Assia Mahboubi &lt;&gt;&quot; ] synopsis: &quot;Mathematical Components Library on Algebra&quot; description: &quot;&quot;&quot; This library contains definitions and theorems about discrete (i.e. with decidable equality) algebraic structures : ring, fields, ordered fields, real fields, modules, algebras, integers, rational numbers, polynomials, matrices, vector spaces... &quot;&quot;&quot; url { src: &quot;https://github.com/math-comp/math-comp/archive/mathcomp-1.14.0.tar.gz&quot; checksum: &quot;sha256=d259cc95a2f8f74c6aa5f3883858c9b79c6e87f769bde9a415115fa4876ebb31&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-mathcomp-algebra.1.14.0 coq.8.14.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-mathcomp-algebra.1.14.0 coq.8.14.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>3 m 45 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-mathcomp-algebra.1.14.0 coq.8.14.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>4 m 30 s</dd> </dl> <h2>Installation size</h2> <p>Total: 25 M</p> <ul> <li>2 M <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/ssrnum.glob</code></li> <li>2 M <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/matrix.vo</code></li> <li>2 M <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/matrix.glob</code></li> <li>1 M <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/mxalgebra.vo</code></li> <li>1 M <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/ssralg.vo</code></li> <li>1 M <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/ssralg.glob</code></li> <li>1 M <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/polydiv.glob</code></li> <li>1 M <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/ssrnum.vo</code></li> <li>1 M <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/mxalgebra.glob</code></li> <li>1 M <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/polydiv.vo</code></li> <li>988 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/mxpoly.vo</code></li> <li>852 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/poly.glob</code></li> <li>768 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/mxpoly.glob</code></li> <li>767 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/poly.vo</code></li> <li>717 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/ssrint.glob</code></li> <li>655 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/interval.vo</code></li> <li>654 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/vector.vo</code></li> <li>571 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/vector.glob</code></li> <li>457 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/intdiv.vo</code></li> <li>457 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/interval.glob</code></li> <li>449 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/intdiv.glob</code></li> <li>423 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/ssrint.vo</code></li> <li>392 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/rat.glob</code></li> <li>341 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/rat.vo</code></li> <li>265 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/finalg.vo</code></li> <li>251 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/ssralg.v</code></li> <li>229 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/fraction.glob</code></li> <li>213 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/finalg.glob</code></li> <li>203 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/ring_quotient.vo</code></li> <li>198 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/ssrnum.v</code></li> <li>173 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/matrix.v</code></li> <li>167 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/polyXY.vo</code></li> <li>152 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/polyXY.glob</code></li> <li>130 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/fraction.vo</code></li> <li>130 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/mxalgebra.v</code></li> <li>121 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/polydiv.v</code></li> <li>114 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/ring_quotient.glob</code></li> <li>111 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/countalg.vo</code></li> <li>100 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/poly.v</code></li> <li>92 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/countalg.glob</code></li> <li>82 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/zmodp.vo</code></li> <li>82 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/mxpoly.v</code></li> <li>76 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/vector.v</code></li> <li>69 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/zmodp.glob</code></li> <li>64 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/finalg.v</code></li> <li>57 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/ssrint.v</code></li> <li>47 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/intdiv.v</code></li> <li>43 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/interval.v</code></li> <li>34 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/rat.v</code></li> <li>30 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/countalg.v</code></li> <li>26 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/ring_quotient.v</code></li> <li>20 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/all_algebra.vo</code></li> <li>18 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/polyXY.v</code></li> <li>14 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/zmodp.v</code></li> <li>13 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/fraction.v</code></li> <li>1 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/all_algebra.glob</code></li> <li>1 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/mathcomp/algebra/all_algebra.v</code></li> </ul> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq-mathcomp-algebra.1.14.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{'content_hash': '3847634dda802f0e83e6a271cb081946', 'timestamp': '', 'source': 'github', 'line_count': 214, 'max_line_length': 554, 'avg_line_length': 67.53738317757009, 'alnum_prop': 0.6000830277451048, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': 'e878d6ed45a1a19ef91761765fd9b9920f901032', 'size': '14479', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.10.2-2.0.6/released/8.14.0/mathcomp-algebra/1.14.0.html', 'mode': '33188', 'license': 'mit', 'language': []}
package edu.rice.cs.caper.bayou.core.synthesizer; /** * A wrapper for searching for a target type in the enumerator. * Also contains fields useful for making a decision when the search passes/fails. */ public class SearchTarget { /** * The type to search for -- the only required field for SearchTarget */ private final Type type; /** * The parameter name (if any) for which the search is being conducted. * Used in order to create meaningful variable names if the search failed. */ private String paramName; /** * Denotes whether the enumerator should create a single use variable or not * if the search failed (e.g., API call arguments) */ private boolean singleUseVariable; /** * The name of the API call whose argument is being searched for. * Used for cost metric to order variables if the search passed. */ private String apiCallName; /** * Initializes the search target type * * @param type type to search for */ public SearchTarget(Type type) { this.type = type; } /** * Gets the type for the search target * * @return current value */ public Type getType() { return type; } /** * Sets the parameter name for the search * * @param s the name * @return this object for chaining */ public SearchTarget setParamName(String s) { paramName = s; return this; } /** * Gets the name for the search target (if any) * * @return current value */ public String getParamName() { return paramName; } /** * Sets the value of singleUseVariable search property * * @param b value to set to * @return this object for chaining */ public SearchTarget setSingleUseVariable(boolean b) { singleUseVariable = b; return this; } /** * Gets the value of singleUseVariable search property * * @return current value */ public boolean getSingleUseVariable() { return singleUseVariable; } /** * Sets the API call name whose argument is being searched for * * @param s the API call name * @return this object for chaining */ public SearchTarget setAPICallName(String s) { apiCallName = s; return this; } /** * Gets the API call name whose argument is being searched for * * @return the API call name */ public String getAPICallName() { return apiCallName; } }
{'content_hash': 'c45ecb8a95efdb0ff494dabd1aeb272d', 'timestamp': '', 'source': 'github', 'line_count': 110, 'max_line_length': 82, 'avg_line_length': 23.62727272727273, 'alnum_prop': 0.6067718353212774, 'repo_name': 'capergroup/bayou', 'id': '974d9ba9c66c342193041fef96824a4368d10df5', 'size': '3160', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/edu/rice/cs/caper/bayou/core/synthesizer/SearchTarget.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '559'}, {'name': 'Java', 'bytes': '784595'}, {'name': 'Python', 'bytes': '268918'}, {'name': 'Shell', 'bytes': '16160'}]}
angular.module('app').directive('mainDirective', function() { return { //write your custom directive here }; });
{'content_hash': 'd9798e71d8b05b3e3e70e780d13b9424', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 61, 'avg_line_length': 24.2, 'alnum_prop': 0.6611570247933884, 'repo_name': 'niarve/node-starter-kit', 'id': '1efade14dc2696691c2e8678b83a755a91a86fc6', 'size': '121', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/js/directives/directive.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '169'}, {'name': 'HTML', 'bytes': '521'}, {'name': 'JavaScript', 'bytes': '3119'}]}
using System; namespace GithubAPI { public class UserSummaryData { public string login {get; set;} public string avatar_url { get; set;} } }
{'content_hash': '91b253a14e312b7e94404d6e17c32714', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 39, 'avg_line_length': 13.636363636363637, 'alnum_prop': 0.7, 'repo_name': 'rzee7/GithubDashboard-Xamarin', 'id': 'e80c61d03c14f1cff19dc0b7a2f8431e91793d4f', 'size': '150', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'GithubDashboard/GithubAPI/UserSummaryData.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C#', 'bytes': '58892'}]}
/** * Created by yuan on 2016/3/4. */ function Person(name){ this.name = name; this._events = {}; } Person.prototype.on = function(eventName,callback){ if(this._events[eventName]){ this._events[eventName].push(callback); }else{ this._events[eventName] = [callback]; } } Person.prototype.emit = function(eventName){ var args = Array.prototype.slice.call(arguments,1); var callbacks = this._events[eventName]; var self = this; callbacks.forEach(function(callback){ callback.apply(self,args); }); } var girl = new Person(); girl.on('长发及腰',function(){ console.log('待我娶你可好'); }); girl.on('长发及腰',function(){ console.log('不娶勿撩'); }); girl.emit('长发及腰');
{'content_hash': '7ca2a5065c6f0d1833051d188d8525d3', 'timestamp': '', 'source': 'github', 'line_count': 42, 'max_line_length': 55, 'avg_line_length': 17.428571428571427, 'alnum_prop': 0.6161202185792349, 'repo_name': 'wallaceyuan/node_work', 'id': 'cd595fa1c26f481a2965e4fde132f3c596ae2e51', 'size': '776', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '5.event/1.event.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '44'}, {'name': 'HTML', 'bytes': '241'}, {'name': 'JavaScript', 'bytes': '13206'}]}
/* Sticky footer styles -------------------------------------------------- */ html, body { height: 100%; /* The html and body elements cannot have any padding or margin. */ } /* Wrapper for page content to push down footer */ #wrap { min-height: 100%; height: auto !important; height: 100%; /* Negative indent footer by its height */ margin: 0 auto -60px; /* Pad bottom by footer height */ padding: 0 0 60px; } /* Set the fixed height of the footer here */ #footer { height: 60px; background-color: #f5f5f5; } @media (max-width: 768px) { body{ padding-top: 20px; } } /* Custom page CSS -------------------------------------------------- */ /* Not required for template or sticky footer method. */ .container { max-width: 680px; padding: 0 15px; } .container .credit { margin: 20px 0; }
{'content_hash': 'ee87d478394977847a12627380f5f53a', 'timestamp': '', 'source': 'github', 'line_count': 43, 'max_line_length': 69, 'avg_line_length': 19.162790697674417, 'alnum_prop': 0.5679611650485437, 'repo_name': 'milengeorgiev/imaginatory', 'id': '732baef2372a84f36bc07a43ab04a650fb799571', 'size': '824', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'css/sticky-footer.css', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '3965'}, {'name': 'HTML', 'bytes': '2687'}, {'name': 'JavaScript', 'bytes': '1807'}]}
<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE erlref SYSTEM "erlref.dtd"> <erlref> <header> <copyright> <year>2012</year><year>2013</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> 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. </legalnotice> <title>http_uri</title> <prepared></prepared> <responsible></responsible> <docno></docno> <date></date> <rev></rev> </header> <module>http_uri</module> <modulesummary>URI utility module</modulesummary> <description> <p>This module provides utility functions for working with URIs, according to <url href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</url>.</p> </description> <section> <title>DATA TYPES</title> <p>Type definitions that are used more than once in this module:</p> <p><c>boolean() = true | false</c></p> <p><c>string()</c> = list of ASCII characters</p> </section> <section> <title>URI DATA TYPES</title> <p>Type definitions that are related to URI:</p> <taglist> <tag><c>uri() = string()</c></tag> <item><p>Syntax according to the URI definition in RFC 3986, for example, "http://www.erlang.org/"</p></item> <tag><c>user_info() = string()</c></tag> <item><p></p></item> <tag><c>scheme() = atom()</c></tag> <item><p>Example: http, https</p></item> <tag><c>host() = string()</c></tag> <item><p></p></item> <tag><c>port() = pos_integer()</c></tag> <item><p></p></item> <tag><c>path() = string()</c></tag> <item><p>Represents a file path or directory path</p></item> <tag><c>query() = string()</c></tag> <item><p></p></item> <tag><c>fragment() = string()</c></tag> <item><p></p></item> </taglist> <p>For more information about URI, see <url href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</url>.</p> <marker id="scheme_defaults"></marker> </section> <funcs> <func> <name>decode(HexEncodedURI) -> URI</name> <fsummary>Decodes a hexadecimal encoded URI.</fsummary> <type> <v>HexEncodedURI = string() - A possibly hexadecimal encoded URI</v> <v>URI = uri()</v> </type> <desc> <p>Decodes a possibly hexadecimal encoded URI.</p> </desc> </func> <func> <name>encode(URI) -> HexEncodedURI</name> <fsummary>Encodes a hexadecimal encoded URI.</fsummary> <type> <v>URI = uri()</v> <v>HexEncodedURI = string() - Hexadecimal encoded URI</v> </type> <desc> <p>Encodes a hexadecimal encoded URI.</p> <marker id="decode"></marker> </desc> </func> <func> <name>parse(URI) -> {ok, Result} | {error, Reason}</name> <name>parse(URI, Options) -> {ok, Result} | {error, Reason}</name> <fsummary>Parses a URI.</fsummary> <type> <v>URI = uri()</v> <v>Options = [Option]</v> <v>Option = {ipv6_host_with_brackets, boolean()} | {scheme_defaults, scheme_defaults()} | {fragment, boolean()}]</v> <v>Result = {Scheme, UserInfo, Host, Port, Path, Query} | {Scheme, UserInfo, Host, Port, Path, Query, Fragment}</v> <v>UserInfo = user_info()</v> <v>Host = host()</v> <v>Port = pos_integer()</v> <v>Path = path()</v> <v>Query = query()</v> <v>Fragment = fragment()</v> <v>Reason = term()</v> </type> <desc> <p>Parses a URI. If no scheme defaults are provided, the value of the <seealso marker="#scheme_defaults">scheme_defaults</seealso> function is used.</p> <p>When parsing a URI with an unknown scheme (that is, a scheme not found in the scheme defaults), a port number must be provided, otherwise the parsing fails.</p> <p>If the fragment option is <c>true</c>, the URI fragment is returned as part of the parsing result, otherwise it is ignored.</p> <marker id="encode"></marker> </desc> </func> <func> <name>scheme_defaults() -> SchemeDefaults</name> <fsummary>A list of the scheme and their default ports.</fsummary> <type> <v>SchemeDefaults = [{scheme(), default_scheme_port_number()}] </v> <v>default_scheme_port_number() = pos_integer()</v> </type> <desc> <p>Provides a list of the scheme and their default port numbers supported (by default) by this utility.</p> <marker id="parse"></marker> </desc> </func> </funcs> <!-- <section> <title>SEE ALSO</title> <p><url href="http://www.ietf.org/rfc/rfc2616.txt">RFC 2616</url>, <seealso marker="inets">inets(3)</seealso>, <seealso marker="kernel:gen_tcp">gen_tcp(3)</seealso>, <seealso marker="ssl:ssl">ssl(3)</seealso> </p> </section> --> </erlref>
{'content_hash': '6602d4607809998f1dc17e530d7d0035', 'timestamp': '', 'source': 'github', 'line_count': 178, 'max_line_length': 81, 'avg_line_length': 30.780898876404493, 'alnum_prop': 0.5809454279978098, 'repo_name': 'jemsbhai/otp', 'id': '47c40da96ad3ed7d7b7cabbe39d1a4baa616f604', 'size': '5479', 'binary': False, 'copies': '6', 'ref': 'refs/heads/maint', 'path': 'lib/inets/doc/src/http_uri.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ApacheConf', 'bytes': '30356'}, {'name': 'Assembly', 'bytes': '134967'}, {'name': 'Batchfile', 'bytes': '1186'}, {'name': 'C', 'bytes': '13554941'}, {'name': 'C++', 'bytes': '1667662'}, {'name': 'CSS', 'bytes': '12282'}, {'name': 'DIGITAL Command Language', 'bytes': '21'}, {'name': 'DTrace', 'bytes': '230095'}, {'name': 'Emacs Lisp', 'bytes': '378945'}, {'name': 'Erlang', 'bytes': '72162342'}, {'name': 'Groff', 'bytes': '1954'}, {'name': 'HTML', 'bytes': '433079'}, {'name': 'Java', 'bytes': '661171'}, {'name': 'JavaScript', 'bytes': '33014'}, {'name': 'Logos', 'bytes': '8702'}, {'name': 'Makefile', 'bytes': '1288241'}, {'name': 'NSIS', 'bytes': '27847'}, {'name': 'Objective-C', 'bytes': '4115'}, {'name': 'Perl', 'bytes': '96898'}, {'name': 'Python', 'bytes': '117380'}, {'name': 'Shell', 'bytes': '259491'}, {'name': 'Standard ML', 'bytes': '545'}, {'name': 'Tcl', 'bytes': '9372'}, {'name': 'XSLT', 'bytes': '221521'}]}
package com.datamountaineer.streamreactor.connect.voltdb.writers import io.confluent.common.config.ConfigException import org.apache.kafka.connect.errors.ConnectException import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec class RetriesTest extends AnyWordSpec with Matchers with Retries { "Retries" should { "return the value when no error is encountered" in { val expected = "The return value" val actual = withRetries(10, 10, Some("abcd"))(expected) actual shouldBe expected } "return the value if an error is thrown but max retries is not met" in { val expected = "The return value" var count = 10 val actual = withRetries(10, 10, Some("abcd")) { count -= 1 if (count == 0) expected else throw new RuntimeException("something went wrong") } actual shouldBe expected } "return the value even with 0 retries" in { val expected = 12315L val actual = withRetries(0, 10, Some("abcd"))(expected) actual shouldBe expected } "throws the last exception" in { var count = 4 intercept[ConfigException] { withRetries(4, 10, Some("abcd")) { count -= 1 if (count > 0) throw new ConnectException("Not yet") else throw new ConfigException("this one") } } } } }
{'content_hash': 'd11f7f7d84958a78a8ac278b1962c3a4', 'timestamp': '', 'source': 'github', 'line_count': 45, 'max_line_length': 76, 'avg_line_length': 30.68888888888889, 'alnum_prop': 0.6538740043446778, 'repo_name': 'datamountaineer/stream-reactor', 'id': 'aee8ab14e5c5e0838e43e0443c4e10e7659cca78', 'size': '1976', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'kafka-connect-voltdb/src/test/scala/com/datamountaineer/streamreactor/connect/voltdb/writers/RetriesTest.scala', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '11639'}, {'name': 'Scala', 'bytes': '1693832'}, {'name': 'Smarty', 'bytes': '393'}]}
(function( window, $, undefined ) { $("<div>").attr("style", "!import_rule .fake-rule"); $("<div>").attr("style", '!import_rule .fake-rule'); })( this, this.jQuery );
{'content_hash': 'ca9d84f71d7b0341868457a675f17737', 'timestamp': '', 'source': 'github', 'line_count': 6, 'max_line_length': 53, 'avg_line_length': 28.5, 'alnum_prop': 0.5672514619883041, 'repo_name': 'jugglinmike/DressUp', 'id': '980d9ecf813805a1f5ca330eac18ede24d5c0591', 'size': '171', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/input/nonexistent_rule.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '320'}, {'name': 'JavaScript', 'bytes': '5779'}, {'name': 'Perl', 'bytes': '3320'}, {'name': 'Ruby', 'bytes': '2519'}, {'name': 'Shell', 'bytes': '2093'}]}
package org.apache.ignite.ml.composition.combinators.sequential; import java.util.ArrayList; import java.util.List; import org.apache.ignite.lang.IgniteBiPredicate; import org.apache.ignite.ml.IgniteModel; import org.apache.ignite.ml.composition.CompositionUtils; import org.apache.ignite.ml.composition.DatasetMapping; import org.apache.ignite.ml.dataset.DatasetBuilder; import org.apache.ignite.ml.math.functions.IgniteBiFunction; import org.apache.ignite.ml.math.functions.IgniteFunction; import org.apache.ignite.ml.structures.LabeledVector; import org.apache.ignite.ml.trainers.DatasetTrainer; import org.apache.ignite.ml.trainers.FeatureLabelExtractor; /** * Sequential composition of trainers. * Sequential composition of trainers is itself trainer which produces {@link ModelsSequentialComposition}. * Training is done in following fashion: * <pre> * 1. First trainer is trained and `mdl1` is produced. * 2. From `mdl1` {@link DatasetMapping} is constructed. This mapping `dsM` encapsulates dependency between first * training result and second trainer. * 3. Second trainer is trained using dataset aquired from application `dsM` to original dataset; `mdl2` is produced. * 4. `mdl1` and `mdl2` are composed into {@link ModelsSequentialComposition}. * </pre> * * @param <I> Type of input of model produced by first trainer. * @param <O1> Type of output of model produced by first trainer. * @param <O2> Type of output of model produced by second trainer. * @param <L> Type of labels. */ public class TrainersSequentialComposition<I, O1, O2, L> extends DatasetTrainer<ModelsSequentialComposition<I, O1, O2>, L> { /** First trainer. */ private DatasetTrainer<IgniteModel<I, O1>, L> tr1; /** Second trainer. */ private DatasetTrainer<IgniteModel<O1, O2>, L> tr2; /** Dataset mapping. */ protected IgniteBiFunction<Integer, ? super IgniteModel<I, O1>, IgniteFunction<LabeledVector<L>, LabeledVector<L>>> datasetMapping; /** * Construct sequential composition of same trainers. * * @param tr Trainer used for sequential composition. * @param datasetMapping Dataset mapping. * @param shouldStop Predicate depending on index and model produced by the last trainer * indicating if composition process should stop * @param out2In Function for conversion of output of model into input of next model. * @param <I> Type of input of model produced by trainer. * @param <O> Type of output of model produced by trainer. * @param <L> Type of labels for trainer. * @return Sequential composition of same trainers. */ public static <I, O, L> TrainersSequentialComposition<I, O, O, L> ofSame( DatasetTrainer<? extends IgniteModel<I, O>, L> tr, IgniteBiFunction<Integer, ? super IgniteModel<I, O>, IgniteFunction<LabeledVector<L>, LabeledVector<L>>> datasetMapping, IgniteBiPredicate<Integer, IgniteModel<I, O>> shouldStop, IgniteFunction<O, I> out2In) { return new SameTrainersSequentialComposition<>(CompositionUtils.unsafeCoerce(tr), datasetMapping, shouldStop, out2In); } /** * Sequential composition of same trainers. * * @param <I> Type of input of model produced by trainers. * @param <O> Type of output of model produced by trainers. * @param <L> Type of labels. */ private static class SameTrainersSequentialComposition<I, O, L> extends TrainersSequentialComposition<I, O, O, L> { /** Trainer to sequentially compose. */ private final DatasetTrainer<IgniteModel<I, O>, L> tr; /** * Predicate depending on index and model produced by the last trainer indicating if composition process should * stop */ private final IgniteBiPredicate<Integer, IgniteModel<I, O>> shouldStop; /** Function for conversion of output of model into input of next model. */ private final IgniteFunction<O, I> out2Input; /** * Create instance of this class. * * @param tr Trainer to sequentially compose. * @param datasetMapping Dataaset mapping. * @param shouldStop Predicate depending on index and model produced by the last trainer * indicating if composition process should stop. * @param out2Input Function for conversion of output of model into input of next model. */ public SameTrainersSequentialComposition( DatasetTrainer<IgniteModel<I, O>, L> tr, IgniteBiFunction<Integer, ? super IgniteModel<I, O>, IgniteFunction<LabeledVector<L>, LabeledVector<L>>> datasetMapping, IgniteBiPredicate<Integer, IgniteModel<I, O>> shouldStop, IgniteFunction<O, I> out2Input) { super(null, null, datasetMapping); this.tr = tr; this.shouldStop = (iteration, model) -> iteration != 0 && shouldStop.apply(iteration, model); this.out2Input = out2Input; } /** {@inheritDoc} */ @Override public <K, V> ModelsSequentialComposition<I, O, O> fit(DatasetBuilder<K, V> datasetBuilder, FeatureLabelExtractor<K, V, L> extractor) { int i = 0; IgniteModel<I, O> currMdl = null; IgniteFunction<LabeledVector<L>, LabeledVector<L>> mapping = IgniteFunction.identity(); List<IgniteModel<I, O>> mdls = new ArrayList<>(); while (!shouldStop.apply(i, currMdl)) { currMdl = tr.fit(datasetBuilder, extractor.andThen(mapping)); mdls.add(currMdl); if (shouldStop.apply(i, currMdl)) break; mapping = datasetMapping.apply(i, currMdl); i++; } return ModelsSequentialComposition.ofSame(mdls, out2Input); } } /** * Construct sequential composition of given two trainers. * * @param tr1 First trainer. * @param tr2 Second trainer. * @param datasetMapping Dataset mapping. */ public TrainersSequentialComposition(DatasetTrainer<? extends IgniteModel<I, O1>, L> tr1, DatasetTrainer<? extends IgniteModel<O1, O2>, L> tr2, IgniteFunction<? super IgniteModel<I, O1>, IgniteFunction<LabeledVector<L>, LabeledVector<L>>> datasetMapping) { this.tr1 = CompositionUtils.unsafeCoerce(tr1); this.tr2 = CompositionUtils.unsafeCoerce(tr2); this.datasetMapping = (i, mdl) -> datasetMapping.apply(mdl); } /** * Create sequential composition of two trainers. * @param tr1 First trainer. * @param tr2 Second trainer. * @param datasetMapping Dataset mapping containing dependence between first and second trainer. */ public TrainersSequentialComposition(DatasetTrainer<? extends IgniteModel<I, O1>, L> tr1, DatasetTrainer<? extends IgniteModel<O1, O2>, L> tr2, IgniteBiFunction<Integer, ? super IgniteModel<I, O1>, IgniteFunction<LabeledVector<L>, LabeledVector<L>>> datasetMapping) { this.tr1 = CompositionUtils.unsafeCoerce(tr1); this.tr2 = CompositionUtils.unsafeCoerce(tr2); this.datasetMapping = datasetMapping; } /** {@inheritDoc} */ @Override public <K, V> ModelsSequentialComposition<I, O1, O2> fit(DatasetBuilder<K, V> datasetBuilder, FeatureLabelExtractor<K, V, L> extractor) { IgniteModel<I, O1> mdl1 = tr1.fit(datasetBuilder, extractor); IgniteFunction<LabeledVector<L>, LabeledVector<L>> mapping = datasetMapping.apply(0, mdl1); IgniteModel<O1, O2> mdl2 = tr2.fit(datasetBuilder, extractor.andThen(mapping)); return new ModelsSequentialComposition<>(mdl1, mdl2); } /** {@inheritDoc} */ @Override public <K, V> ModelsSequentialComposition<I, O1, O2> update( ModelsSequentialComposition<I, O1, O2> mdl, DatasetBuilder<K, V> datasetBuilder, FeatureLabelExtractor<K, V, L> extractor) { IgniteModel<I, O1> firstUpdated = tr1.update(mdl.firstModel(), datasetBuilder, extractor); IgniteFunction<LabeledVector<L>, LabeledVector<L>> mapping = datasetMapping.apply(0, firstUpdated); IgniteModel<O1, O2> secondUpdated = tr2.update(mdl.secondModel(), datasetBuilder, extractor.andThen(mapping)); return new ModelsSequentialComposition<>(firstUpdated, secondUpdated); } /** * This method is never called, instead of constructing logic of update from * {@link DatasetTrainer#isUpdateable} and * {@link DatasetTrainer#updateModel} * in this class we explicitly override update method. * * @param mdl Model. * @return True if current critical for training parameters correspond to parameters from last training. */ @Override public boolean isUpdateable(ModelsSequentialComposition<I, O1, O2> mdl) { // Never called. throw new IllegalStateException(); } /** * This method is never called, instead of constructing logic of update from * {@link DatasetTrainer#isUpdateable(IgniteModel)} and * {@link DatasetTrainer#updateModel(IgniteModel, DatasetBuilder, IgniteBiFunction, IgniteBiFunction)} * in this class we explicitly override update method. * * @param mdl Model. * @return Updated model. */ @Override protected <K, V> ModelsSequentialComposition<I, O1, O2> updateModel( ModelsSequentialComposition<I, O1, O2> mdl, DatasetBuilder<K, V> datasetBuilder, FeatureLabelExtractor<K, V, L> extractor) { // Never called. throw new IllegalStateException(); } /** * Performs coersion of this trainer to {@code DatasetTrainer<IgniteModel<I, O2>, L>}. * * @return Trainer coerced to {@code DatasetTrainer<IgniteModel<I, O>, L>}. */ public DatasetTrainer<IgniteModel<I, O2>, L> unsafeSimplyTyped() { return CompositionUtils.unsafeCoerce(this); } }
{'content_hash': '6f228b30ebd2a5790fdde9102a2f5320', 'timestamp': '', 'source': 'github', 'line_count': 230, 'max_line_length': 132, 'avg_line_length': 43.61739130434783, 'alnum_prop': 0.6736443381180224, 'repo_name': 'ptupitsyn/ignite', 'id': '1105e1b016b1340bde02bebba7c8891efba638ff', 'size': '10834', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'modules/ml/src/main/java/org/apache/ignite/ml/composition/combinators/sequential/TrainersSequentialComposition.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '61156'}, {'name': 'C', 'bytes': '5286'}, {'name': 'C#', 'bytes': '6134000'}, {'name': 'C++', 'bytes': '3594158'}, {'name': 'CSS', 'bytes': '304650'}, {'name': 'Dockerfile', 'bytes': '14859'}, {'name': 'Groovy', 'bytes': '15081'}, {'name': 'HTML', 'bytes': '1454824'}, {'name': 'Java', 'bytes': '39370496'}, {'name': 'JavaScript', 'bytes': '1756771'}, {'name': 'M4', 'bytes': '21724'}, {'name': 'Makefile', 'bytes': '121163'}, {'name': 'PHP', 'bytes': '486991'}, {'name': 'PLpgSQL', 'bytes': '623'}, {'name': 'PowerShell', 'bytes': '12344'}, {'name': 'Python', 'bytes': '340696'}, {'name': 'Scala', 'bytes': '1011929'}, {'name': 'Shell', 'bytes': '615741'}, {'name': 'Smalltalk', 'bytes': '1908'}, {'name': 'TypeScript', 'bytes': '472483'}]}
package org.apache.hadoop.fs.azure; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeNotNull; import java.io.IOException; import java.io.OutputStream; import java.util.Arrays; import java.util.Random; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.azure.AzureException; import org.apache.hadoop.util.Time; import org.junit.After; import org.junit.Before; import org.junit.Test; /** * Write data into a page blob and verify you can read back all of it * or just a part of it. */ public class TestReadAndSeekPageBlobAfterWrite { private static final Log LOG = LogFactory.getLog(TestReadAndSeekPageBlobAfterWrite.class); private FileSystem fs; private AzureBlobStorageTestAccount testAccount; private byte[] randomData; // Page blob physical page size private static final int PAGE_SIZE = PageBlobFormatHelpers.PAGE_SIZE; // Size of data on page (excluding header) private static final int PAGE_DATA_SIZE = PAGE_SIZE - PageBlobFormatHelpers.PAGE_HEADER_SIZE; private static final int MAX_BYTES = 33554432; // maximum bytes in a file that we'll test private static final int MAX_PAGES = MAX_BYTES / PAGE_SIZE; // maximum number of pages we'll test private Random rand = new Random(); // A key with a prefix under /pageBlobs, which for the test file system will // force use of a page blob. private static final String KEY = "/pageBlobs/file.dat"; private static final Path PATH = new Path(KEY); // path of page blob file to read and write protected AzureBlobStorageTestAccount createTestAccount() throws Exception { return AzureBlobStorageTestAccount.create(); } @Before public void setUp() throws Exception { testAccount = createTestAccount(); if (testAccount != null) { fs = testAccount.getFileSystem(); } assumeNotNull(testAccount); // Make sure we are using an integral number of pages. assertEquals(0, MAX_BYTES % PAGE_SIZE); // load an in-memory array of random data randomData = new byte[PAGE_SIZE * MAX_PAGES]; rand.nextBytes(randomData); } @After public void tearDown() throws Exception { if (testAccount != null) { testAccount.cleanup(); testAccount = null; fs = null; } } /** * Make sure the file name (key) is a page blob file name. If anybody changes that, * we need to come back and update this test class. */ @Test public void testIsPageBlobFileName() { AzureNativeFileSystemStore store = ((NativeAzureFileSystem) fs).getStore(); String[] a = KEY.split("/"); String key2 = a[1] + "/"; assertTrue(store.isPageBlobKey(key2)); } /** * For a set of different file sizes, write some random data to a page blob, * read it back, and compare that what was read is the same as what was written. */ @Test public void testReadAfterWriteRandomData() throws IOException { // local shorthand final int PDS = PAGE_DATA_SIZE; // Test for sizes at and near page boundaries int[] dataSizes = { // on first page 0, 1, 2, 3, // Near first physical page boundary (because the implementation // stores PDS + the page header size bytes on each page). PDS - 1, PDS, PDS + 1, PDS + 2, PDS + 3, // near second physical page boundary (2 * PDS) - 1, (2 * PDS), (2 * PDS) + 1, (2 * PDS) + 2, (2 * PDS) + 3, // near tenth physical page boundary (10 * PDS) - 1, (10 * PDS), (10 * PDS) + 1, (10 * PDS) + 2, (10 * PDS) + 3, // test one big size, >> 4MB (an internal buffer size in the code) MAX_BYTES }; for (int i : dataSizes) { testReadAfterWriteRandomData(i); } } private void testReadAfterWriteRandomData(int size) throws IOException { writeRandomData(size); readRandomDataAndVerify(size); } /** * Read "size" bytes of data and verify that what was read and what was written * are the same. */ private void readRandomDataAndVerify(int size) throws AzureException, IOException { byte[] b = new byte[size]; FSDataInputStream stream = fs.open(PATH); int bytesRead = stream.read(b); stream.close(); assertEquals(bytesRead, size); // compare the data read to the data written assertTrue(comparePrefix(randomData, b, size)); } // return true if the beginning "size" values of the arrays are the same private boolean comparePrefix(byte[] a, byte[] b, int size) { if (a.length < size || b.length < size) { return false; } for (int i = 0; i < size; i++) { if (a[i] != b[i]) { return false; } } return true; } // Write a specified amount of random data to the file path for this test class. private void writeRandomData(int size) throws IOException { OutputStream output = fs.create(PATH); output.write(randomData, 0, size); output.close(); } /** * Write data to a page blob, open it, seek, and then read a range of data. * Then compare that the data read from that range is the same as the data originally written. */ @Test public void testPageBlobSeekAndReadAfterWrite() throws IOException { writeRandomData(PAGE_SIZE * MAX_PAGES); int recordSize = 100; byte[] b = new byte[recordSize]; FSDataInputStream stream = fs.open(PATH); // Seek to a boundary around the middle of the 6th page int seekPosition = 5 * PAGE_SIZE + 250; stream.seek(seekPosition); // Read a record's worth of bytes and verify results int bytesRead = stream.read(b); verifyReadRandomData(b, bytesRead, seekPosition, recordSize); // Seek to another spot and read a record greater than a page seekPosition = 10 * PAGE_SIZE + 250; stream.seek(seekPosition); recordSize = 1000; b = new byte[recordSize]; bytesRead = stream.read(b); verifyReadRandomData(b, bytesRead, seekPosition, recordSize); // Read the last 100 bytes of the file recordSize = 100; seekPosition = PAGE_SIZE * MAX_PAGES - recordSize; stream.seek(seekPosition); b = new byte[recordSize]; bytesRead = stream.read(b); verifyReadRandomData(b, bytesRead, seekPosition, recordSize); // Read past the end of the file and we should get only partial data. recordSize = 100; seekPosition = PAGE_SIZE * MAX_PAGES - recordSize + 50; stream.seek(seekPosition); b = new byte[recordSize]; bytesRead = stream.read(b); assertEquals(50, bytesRead); // compare last 50 bytes written with those read byte[] tail = Arrays.copyOfRange(randomData, seekPosition, randomData.length); assertTrue(comparePrefix(tail, b, 50)); } // Verify that reading a record of data after seeking gives the expected data. private void verifyReadRandomData(byte[] b, int bytesRead, int seekPosition, int recordSize) { byte[] originalRecordData = Arrays.copyOfRange(randomData, seekPosition, seekPosition + recordSize + 1); assertEquals(recordSize, bytesRead); assertTrue(comparePrefix(originalRecordData, b, recordSize)); } // Test many small flushed writes interspersed with periodic hflush calls. // For manual testing, increase NUM_WRITES to a large number. // The goal for a long-running manual test is to make sure that it finishes // and the close() call does not time out. It also facilitates debugging into // hflush/hsync. @Test public void testManySmallWritesWithHFlush() throws IOException { writeAndReadOneFile(50, 100, 20); } /** * Write a total of numWrites * recordLength data to a file, read it back, * and check to make sure what was read is the same as what was written. * The syncInterval is the number of writes after which to call hflush to * force the data to storage. */ private void writeAndReadOneFile(int numWrites, int recordLength, int syncInterval) throws IOException { final int NUM_WRITES = numWrites; final int RECORD_LENGTH = recordLength; final int SYNC_INTERVAL = syncInterval; // A lower bound on the minimum time we think it will take to do // a write to Azure storage. final long MINIMUM_EXPECTED_TIME = 20; LOG.info("Writing " + NUM_WRITES * RECORD_LENGTH + " bytes to " + PATH.getName()); FSDataOutputStream output = fs.create(PATH); int writesSinceHFlush = 0; try { // Do a flush and hflush to exercise case for empty write queue in PageBlobOutputStream, // to test concurrent execution gates. output.flush(); output.hflush(); for (int i = 0; i < NUM_WRITES; i++) { output.write(randomData, i * RECORD_LENGTH, RECORD_LENGTH); writesSinceHFlush++; output.flush(); if ((i % SYNC_INTERVAL) == 0) { output.hflush(); writesSinceHFlush = 0; } } } finally { long start = Time.monotonicNow(); output.close(); long end = Time.monotonicNow(); LOG.debug("close duration = " + (end - start) + " msec."); if (writesSinceHFlush > 0) { assertTrue(String.format( "close duration with >= 1 pending write is %d, less than minimum expected of %d", end - start, MINIMUM_EXPECTED_TIME), end - start >= MINIMUM_EXPECTED_TIME); } } // Read the data back and check it. FSDataInputStream stream = fs.open(PATH); int SIZE = NUM_WRITES * RECORD_LENGTH; byte[] b = new byte[SIZE]; try { stream.seek(0); stream.read(b, 0, SIZE); verifyReadRandomData(b, SIZE, 0, SIZE); } finally { stream.close(); } // delete the file fs.delete(PATH, false); } // Test writing to a large file repeatedly as a stress test. // Set the repetitions to a larger number for manual testing // for a longer stress run. @Test public void testLargeFileStress() throws IOException { int numWrites = 32; int recordSize = 1024 * 1024; int syncInterval = 10; int repetitions = 1; for (int i = 0; i < repetitions; i++) { writeAndReadOneFile(numWrites, recordSize, syncInterval); } } // Write to a file repeatedly to verify that it extends. // The page blob file should start out at 128MB and finish at 256MB. @Test(timeout=300000) public void testFileSizeExtension() throws IOException { final int writeSize = 1024 * 1024; final int numWrites = 129; final byte dataByte = 5; byte[] data = new byte[writeSize]; Arrays.fill(data, dataByte); FSDataOutputStream output = fs.create(PATH); try { for (int i = 0; i < numWrites; i++) { output.write(data); output.hflush(); LOG.debug("total writes = " + (i + 1)); } } finally { output.close(); } // Show that we wrote more than the default page blob file size. assertTrue(numWrites * writeSize > PageBlobOutputStream.PAGE_BLOB_MIN_SIZE); // Verify we can list the new size. That will prove we expanded the file. FileStatus[] status = fs.listStatus(PATH); assertTrue(status[0].getLen() == numWrites * writeSize); LOG.debug("Total bytes written to " + PATH + " = " + status[0].getLen()); fs.delete(PATH, false); } }
{'content_hash': '9ffdcaa5d354ca3434de76ec06871018', 'timestamp': '', 'source': 'github', 'line_count': 339, 'max_line_length': 106, 'avg_line_length': 33.876106194690266, 'alnum_prop': 0.66901776384535, 'repo_name': 'ronny-macmaster/hadoop', 'id': '41b8386fac8c03ce277d2d44f3c5d2d8e77c6e9e', 'size': '12290', 'binary': False, 'copies': '2', 'ref': 'refs/heads/trunk', 'path': 'hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/TestReadAndSeekPageBlobAfterWrite.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '69197'}, {'name': 'C', 'bytes': '1491086'}, {'name': 'C++', 'bytes': '1853571'}, {'name': 'CMake', 'bytes': '56070'}, {'name': 'CSS', 'bytes': '60295'}, {'name': 'HTML', 'bytes': '244787'}, {'name': 'Java', 'bytes': '70133756'}, {'name': 'JavaScript', 'bytes': '791556'}, {'name': 'Protocol Buffer', 'bytes': '284945'}, {'name': 'Python', 'bytes': '23553'}, {'name': 'Shell', 'bytes': '392933'}, {'name': 'TLA', 'bytes': '14993'}, {'name': 'TeX', 'bytes': '19322'}, {'name': 'XSLT', 'bytes': '16894'}]}
1) Boost C++ ASIO is required for TCP communication 2) Compiler support for C++14 for call to make_unique --------------------------------------------------- ## Protocol Messages (delimited by newline) ### FILL message sent by server message: FILL:SYMBOL:BIDASK:ORDERID:FILLED_PRICE:FILLED_QTY:SEQNUM example: FILL:IBM:ASK:SDF:104.01:54:10 ### PRICE message sent by client message: PRICE:SYMBOL:ACTION:BIDASK:PRICE:QUANTITY example: PRICE:IBM:ADD:ASK:104.01:54 ### ORDER message sent by client message: ORDER:SYMBOL:ACTION:BIDASK:ORDERID:PRICE:QUANTITY example: ORDER:IBM:DELETE:BID:1234:104.01:54 ### COMMAND messages sent by client message: COMMAND:ORDERBOOK description: print orderbook to stdout. message: COMMAND:LISTORDERS description: print open orders to stdout. message: COMMAND:FILLS description: print fills to stdout. --------------------------------------------------- ## Exchange Rules for ADD, MODIFY and DELETE ### ADD #### Both ORDER and PRICE messages 1) Orders are mapped by price in a FIFO queue. 2) Before incoming orders are mapped, a check is made for matching orders at limit price or better. 3) Orders that have the same order id as those in the order-book will be rejected. ### MODIFY #### ORDER message 1) Only price and quantity are modifiable. 2) Cannot modify for same quantity or higher quantity. 3) Cannot modify for less than a quantity of one. #### PRICE message 1) Only price and quantity are modifiable. 2) Quantity modifiable for any amount greater than zero. 3) Modify lower will randomly choose to remove quantity from either back or front of queue. 4) Modify higher will add the difference as a new order to achieve modify quantity. ### DELETE #### ORDER message Order will be deleted by order id and side regardless of quantity, price. #### PRICE message Will delete all market data orders for price and BIDASK type regardless of quantity. --------------------------------------------------- ## Extras 1) SIM_PORT can be exported for server to change default port value of 12345. 2) test.py script for testing different scenarios either in random mode or from test.txt where I have included some scenarios I checked. 3) Choose whether or not to get fills via TCP using -DNO_CALLBACK in CCXFLAGS --------------------------------------------------- ## Final Thought At some point it would been nice to have a market data feed to connect to and have each session observe a set of subscriptions by symbol. Nevertheless, the orderbook portion of the project is orthogonal to server and can be used as a stand-alone library.
{'content_hash': '3399f72a4b23bc7ed81116f10d95cfa7', 'timestamp': '', 'source': 'github', 'line_count': 53, 'max_line_length': 255, 'avg_line_length': 50.77358490566038, 'alnum_prop': 0.6830174656261613, 'repo_name': 'jimbouki/4BRE', 'id': '3a9550793ee5d641b89b9f0b048e52db464c1aec', 'size': '2780', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'C++', 'bytes': '36776'}, {'name': 'Makefile', 'bytes': '619'}, {'name': 'Python', 'bytes': '3789'}]}
ACCEPTED #### According to Index Fungorum #### Published in null #### Original name Exobasidium indicum Syd. & P. Syd. ### Remarks null
{'content_hash': '723b18b7ae8a1b4ee7138126ca4282d7', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 34, 'avg_line_length': 10.692307692307692, 'alnum_prop': 0.6834532374100719, 'repo_name': 'mdoering/backbone', 'id': '752fe96440a3c82f25c936f3fe35eccbd1706970', 'size': '197', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Fungi/Basidiomycota/Exobasidiomycetes/Exobasidiales/Exobasidiaceae/Exobasidium/Exobasidium indicum/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
using System; using System.Collections.Generic; using System.Linq; using Nop.Core; using Nop.Core.Caching; using Nop.Core.Data; using Nop.Core.Domain.Common; using Nop.Core.Domain.Customers; using Nop.Core.Domain.Logging; using Nop.Data; namespace Nop.Services.Logging { /// <summary> /// Customer activity service /// </summary> public class CustomerActivityService : ICustomerActivityService { #region Constants /// <summary> /// Key for caching /// </summary> private const string ACTIVITYTYPE_ALL_KEY = "Nop.activitytype.all"; /// <summary> /// Key pattern to clear cache /// </summary> private const string ACTIVITYTYPE_PATTERN_KEY = "Nop.activitytype."; #endregion #region Fields /// <summary> /// Cache manager /// </summary> private readonly ICacheManager _cacheManager; private readonly IRepository<ActivityLog> _activityLogRepository; private readonly IRepository<ActivityLogType> _activityLogTypeRepository; private readonly IWorkContext _workContext; private readonly IDbContext _dbContext; private readonly IDataProvider _dataProvider; private readonly CommonSettings _commonSettings; #endregion #region Ctor /// <summary> /// Ctor /// </summary> /// <param name="cacheManager">Cache manager</param> /// <param name="activityLogRepository">Activity log repository</param> /// <param name="activityLogTypeRepository">Activity log type repository</param> /// <param name="workContext">Work context</param> /// <param name="dbContext">DB context</param>> /// <param name="dataProvider">WeData provider</param> /// <param name="commonSettings">Common settings</param> public CustomerActivityService(ICacheManager cacheManager, IRepository<ActivityLog> activityLogRepository, IRepository<ActivityLogType> activityLogTypeRepository, IWorkContext workContext, IDbContext dbContext, IDataProvider dataProvider, CommonSettings commonSettings) { this._cacheManager = cacheManager; this._activityLogRepository = activityLogRepository; this._activityLogTypeRepository = activityLogTypeRepository; this._workContext = workContext; this._dbContext = dbContext; this._dataProvider = dataProvider; this._commonSettings = commonSettings; } #endregion #region Nested classes [Serializable] public class ActivityLogTypeForCaching { public int Id { get; set; } public string SystemKeyword { get; set; } public string Name { get; set; } public bool Enabled { get; set; } } #endregion #region Utitlies /// <summary> /// Gets all activity log types (class for caching) /// </summary> /// <returns>Activity log types</returns> protected virtual IList<ActivityLogTypeForCaching> GetAllActivityTypesCached() { //cache string key = string.Format(ACTIVITYTYPE_ALL_KEY); return _cacheManager.Get(key, () => { var result = new List<ActivityLogTypeForCaching>(); var activityLogTypes = GetAllActivityTypes(); foreach (var alt in activityLogTypes) { var altForCaching = new ActivityLogTypeForCaching() { Id = alt.Id, SystemKeyword = alt.SystemKeyword, Name = alt.Name, Enabled = alt.Enabled }; result.Add(altForCaching); } return result; }); } #endregion #region Methods /// <summary> /// Inserts an activity log type item /// </summary> /// <param name="activityLogType">Activity log type item</param> public virtual void InsertActivityType(ActivityLogType activityLogType) { if (activityLogType == null) throw new ArgumentNullException("activityLogType"); _activityLogTypeRepository.Insert(activityLogType); _cacheManager.RemoveByPattern(ACTIVITYTYPE_PATTERN_KEY); } /// <summary> /// Updates an activity log type item /// </summary> /// <param name="activityLogType">Activity log type item</param> public virtual void UpdateActivityType(ActivityLogType activityLogType) { if (activityLogType == null) throw new ArgumentNullException("activityLogType"); _activityLogTypeRepository.Update(activityLogType); _cacheManager.RemoveByPattern(ACTIVITYTYPE_PATTERN_KEY); } /// <summary> /// Deletes an activity log type item /// </summary> /// <param name="activityLogType">Activity log type</param> public virtual void DeleteActivityType(ActivityLogType activityLogType) { if (activityLogType == null) throw new ArgumentNullException("activityLogType"); _activityLogTypeRepository.Delete(activityLogType); _cacheManager.RemoveByPattern(ACTIVITYTYPE_PATTERN_KEY); } /// <summary> /// Gets all activity log type items /// </summary> /// <returns>Activity log type collection</returns> public virtual IList<ActivityLogType> GetAllActivityTypes() { var query = from alt in _activityLogTypeRepository.Table orderby alt.Name select alt; var activityLogTypes = query.ToList(); return activityLogTypes; } /// <summary> /// Gets an activity log type item /// </summary> /// <param name="activityLogTypeId">Activity log type identifier</param> /// <returns>Activity log type item</returns> public virtual ActivityLogType GetActivityTypeById(int activityLogTypeId) { if (activityLogTypeId == 0) return null; return _activityLogTypeRepository.GetById(activityLogTypeId); } /// <summary> /// Inserts an activity log item /// </summary> /// <param name="systemKeyword">The system keyword</param> /// <param name="comment">The activity comment</param> /// <param name="commentParams">The activity comment parameters for string.Format() function.</param> /// <returns>Activity log item</returns> public virtual ActivityLog InsertActivity(string systemKeyword, string comment, params object[] commentParams) { return InsertActivity(systemKeyword, comment, _workContext.CurrentCustomer, commentParams); } /// <summary> /// Inserts an activity log item /// </summary> /// <param name="systemKeyword">The system keyword</param> /// <param name="comment">The activity comment</param> /// <param name="customer">The customer</param> /// <param name="commentParams">The activity comment parameters for string.Format() function.</param> /// <returns>Activity log item</returns> public virtual ActivityLog InsertActivity(string systemKeyword, string comment, Customer customer, params object[] commentParams) { if (customer == null) return null; var activityTypes = GetAllActivityTypesCached(); var activityType = activityTypes.ToList().Find(at => at.SystemKeyword == systemKeyword); if (activityType == null || !activityType.Enabled) return null; comment = CommonHelper.EnsureNotNull(comment); comment = string.Format(comment, commentParams); comment = CommonHelper.EnsureMaximumLength(comment, 4000); var activity = new ActivityLog(); activity.ActivityLogTypeId = activityType.Id; activity.Customer = customer; activity.Comment = comment; activity.CreatedOnUtc = DateTime.UtcNow; _activityLogRepository.Insert(activity); return activity; } /// <summary> /// Deletes an activity log item /// </summary> /// <param name="activityLog">Activity log type</param> public virtual void DeleteActivity(ActivityLog activityLog) { if (activityLog == null) throw new ArgumentNullException("activityLog"); _activityLogRepository.Delete(activityLog); } /// <summary> /// Gets all activity log items /// </summary> /// <param name="createdOnFrom">Log item creation from; null to load all customers</param> /// <param name="createdOnTo">Log item creation to; null to load all customers</param> /// <param name="customerId">Customer identifier; null to load all customers</param> /// <param name="activityLogTypeId">Activity log type identifier</param> /// <param name="pageIndex">Page index</param> /// <param name="pageSize">Page size</param> /// <returns>Activity log collection</returns> public virtual IPagedList<ActivityLog> GetAllActivities(DateTime? createdOnFrom, DateTime? createdOnTo, int? customerId, int activityLogTypeId, int pageIndex, int pageSize) { var query = _activityLogRepository.Table; if (createdOnFrom.HasValue) query = query.Where(al => createdOnFrom.Value <= al.CreatedOnUtc); if (createdOnTo.HasValue) query = query.Where(al => createdOnTo.Value >= al.CreatedOnUtc); if (activityLogTypeId > 0) query = query.Where(al => activityLogTypeId == al.ActivityLogTypeId); if (customerId.HasValue) query = query.Where(al => customerId.Value == al.CustomerId); query = query.OrderByDescending(al => al.CreatedOnUtc); var activityLog = new PagedList<ActivityLog>(query, pageIndex, pageSize); return activityLog; } /// <summary> /// Gets an activity log item /// </summary> /// <param name="activityLogId">Activity log identifier</param> /// <returns>Activity log item</returns> public virtual ActivityLog GetActivityById(int activityLogId) { if (activityLogId == 0) return null; return _activityLogRepository.GetById(activityLogId); } /// <summary> /// Clears activity log /// </summary> public virtual void ClearAllActivities() { if (_commonSettings.UseStoredProceduresIfSupported && _dataProvider.StoredProceduredSupported) { //although it's not a stored procedure we use it to ensure that a database supports them //we cannot wait until EF team has it implemented - http://data.uservoice.com/forums/72025-entity-framework-feature-suggestions/suggestions/1015357-batch-cud-support //do all databases support "Truncate command"? //TODO: do not hard-code the table name _dbContext.ExecuteSqlCommand("TRUNCATE TABLE [ActivityLog]"); } else { var activityLog = _activityLogRepository.Table.ToList(); foreach (var activityLogItem in activityLog) _activityLogRepository.Delete(activityLogItem); } } #endregion } }
{'content_hash': '8a52ff17751c675477477ae242c40b0c', 'timestamp': '', 'source': 'github', 'line_count': 315, 'max_line_length': 181, 'avg_line_length': 38.2, 'alnum_prop': 0.5950303332502286, 'repo_name': 'shoy160/nopCommerce', 'id': '974f6ee0b26411c8f0d34296603aba61760b76fd', 'size': '12035', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Libraries/Nop.Services/Logging/CustomerActivityService.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP', 'bytes': '98'}, {'name': 'C#', 'bytes': '11866411'}, {'name': 'CSS', 'bytes': '335015'}, {'name': 'JavaScript', 'bytes': '614009'}]}
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Monoscape.Common; using System.ServiceModel; using Monoscape.LoadBalancerController.Api.Services.LoadBalancerWeb; namespace Monoscape.LoadBalancerController.Web.Runtime { internal static class EndPoints { //private static Object threadLock = new Object(); public static ILbLoadBalancerWebService LoadBalancerWebService { get { //Log.Debug(typeof(EndPoints), "Waiting for thread lock..."); //lock (threadLock) //{ //Log.Debug(typeof(EndPoints), "Lock acquired"); var binding = MonoscapeServiceHost.GetBinding(); var address = new EndpointAddress(Settings.LoadBalancerEndPointURL); ChannelFactory<ILbLoadBalancerWebService> factory = new ChannelFactory<ILbLoadBalancerWebService>(binding, address); return factory.CreateChannel(); //} } } } }
{'content_hash': 'b2095c2476523515c1fb72069c082d77', 'timestamp': '', 'source': 'github', 'line_count': 33, 'max_line_length': 136, 'avg_line_length': 32.72727272727273, 'alnum_prop': 0.6212962962962963, 'repo_name': 'monoscape/monoscape', 'id': 'b916bcb1ad3a07f252282069e0eff08ff4301377', 'size': '1761', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Monoscape.LoadBalancerController.Web/Runtime/EndPoints.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ASP', 'bytes': '51853'}, {'name': 'C#', 'bytes': '644242'}, {'name': 'CSS', 'bytes': '7093'}, {'name': 'Shell', 'bytes': '2732'}]}
using System; using System.Reactive; using System.Reactive.Threading.Tasks; using Octokit.Reactive.Internal; namespace Octokit.Reactive { public class ObservableAuthorizationsClient : IObservableAuthorizationsClient { readonly IAuthorizationsClient _client; readonly IConnection _connection; public ObservableAuthorizationsClient(IGitHubClient client) { Ensure.ArgumentNotNull(client, "client"); _client = client.Authorization; _connection = client.Connection; } /// <summary> /// Get all <see cref="Authorization"/>s for the authenticated user. This method requires basic auth. /// </summary> /// <remarks> /// See <a href="http://developer.github.com/v3/oauth/#list-your-authorizations">API documentation</a> for more /// details. /// </remarks> /// <returns>A list of <see cref="Authorization"/>s for the authenticated user.</returns> public IObservable<Authorization> GetAll() { return GetAll(ApiOptions.None); } /// <summary> /// Get all <see cref="Authorization"/>s for the authenticated user. This method requires basic auth. /// </summary> /// <remarks> /// See <a href="http://developer.github.com/v3/oauth/#list-your-authorizations">API documentation</a> for more /// details. /// </remarks> /// <param name="options">Options for changing the API response</param> /// <returns>A list of <see cref="Authorization"/>s for the authenticated user.</returns> public IObservable<Authorization> GetAll(ApiOptions options) { Ensure.ArgumentNotNull(options, "options"); return _connection.GetAndFlattenAllPages<Authorization>(ApiUrls.Authorizations(), options); } /// <summary> /// Get a specific <see cref="Authorization"/> for the authenticated user. This method requires basic auth. /// </summary> /// <remarks> /// See <a href="http://developer.github.com/v3/oauth/#get-a-single-authorization">API documentation</a> for /// more details. /// </remarks> /// <param name="id">The id of the <see cref="Authorization"/></param> /// <returns>An <see cref="Authorization"/></returns> public IObservable<Authorization> Get(int id) { return _client.Get(id).ToObservable(); } /// <summary> /// Creates a new personal token for the authenticated user. /// </summary> /// <remarks> /// This method requires authentication. /// See the <a href="https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization">API documentation</a> for more information. /// </remarks> /// <param name="newAuthorization">Describes the new authorization to create</param> /// <exception cref="AuthorizationException"> /// Thrown when the current user does not have permission to make this request. /// </exception> /// <exception cref="TwoFactorRequiredException"> /// Thrown when the current account has two-factor authentication enabled and an authentication code is required. /// </exception> /// <exception cref="ApiException">Thrown when a general API error occurs.</exception> /// <returns>The created <see cref="Authorization"/>.</returns> public IObservable<ApplicationAuthorization> Create(NewAuthorization newAuthorization) { Ensure.ArgumentNotNull(newAuthorization, "newAuthorization"); return _client.Create(newAuthorization).ToObservable(); } /// <summary> /// Creates a new personal token for the authenticated user. /// </summary> /// <remarks> /// This method requires authentication. /// See the <a href="https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization">API documentation</a> for more information. /// </remarks> /// <param name="twoFactorAuthenticationCode">The two-factor authentication code in response to the current user's previous challenge</param> /// <param name="newAuthorization">Describes the new authorization to create</param> /// <exception cref="AuthorizationException"> /// Thrown when the current user does not have permission to make this request. /// </exception> /// <exception cref="TwoFactorRequiredException"> /// Thrown when the current account has two-factor authentication enabled and an authentication code is required. /// </exception> /// <exception cref="ApiException">Thrown when a general API error occurs.</exception> /// <returns>The created <see cref="Authorization"/>.</returns> public IObservable<ApplicationAuthorization> Create( NewAuthorization newAuthorization, string twoFactorAuthenticationCode) { Ensure.ArgumentNotNull(newAuthorization, "newAuthorization"); Ensure.ArgumentNotNullOrEmptyString(twoFactorAuthenticationCode, "twoFactorAuthenticationCode"); return _client.Create(newAuthorization, twoFactorAuthenticationCode).ToObservable(); } /// <summary> /// Creates a new authorization for the specified OAuth application if an authorization for that application /// doesn’t already exist for the user; otherwise, it fails. /// </summary> /// <remarks> /// This method requires authentication. /// See the <a href="http://developer.github.com/v3/oauth/#get-or-create-an-authorization-for-a-specific-app">API documentation</a> for more information. /// </remarks> /// <param name="clientId">Client Id of the OAuth application for the token</param> /// <param name="clientSecret">The client secret</param> /// <param name="newAuthorization">Describes the new authorization to create</param> /// <exception cref="AuthorizationException"> /// Thrown when the current user does not have permission to make this request. /// </exception> /// <exception cref="TwoFactorRequiredException"> /// Thrown when the current account has two-factor authentication enabled and an authentication code is required. /// </exception> /// <exception cref="ApiException">Thrown when a general API error occurs.</exception> /// <returns>The created <see cref="Authorization"/>.</returns> public IObservable<ApplicationAuthorization> Create( string clientId, string clientSecret, NewAuthorization newAuthorization) { Ensure.ArgumentNotNullOrEmptyString(clientId, "clientId"); Ensure.ArgumentNotNullOrEmptyString(clientSecret, "clientSecret"); Ensure.ArgumentNotNull(newAuthorization, "newAuthorization"); return _client.Create(clientId, clientSecret, newAuthorization).ToObservable(); } /// <summary> /// Creates a new authorization for the specified OAuth application if an authorization for that application /// doesn’t already exist for the user; otherwise, it fails. /// </summary> /// <remarks> /// This method requires authentication. /// See the <a href="http://developer.github.com/v3/oauth/#get-or-create-an-authorization-for-a-specific-app">API documentation</a> for more information. /// </remarks> /// <param name="clientId">Client Id of the OAuth application for the token</param> /// <param name="clientSecret">The client secret</param> /// <param name="twoFactorAuthenticationCode">The two-factor authentication code in response to the current user's previous challenge</param> /// <param name="newAuthorization">Describes the new authorization to create</param> /// <exception cref="AuthorizationException"> /// Thrown when the current user does not have permission to make this request. /// </exception> /// <exception cref="TwoFactorRequiredException"> /// Thrown when the current account has two-factor authentication enabled and an authentication code is required. /// </exception> /// <exception cref="ApiException">Thrown when a general API error occurs.</exception> /// <returns>The created <see cref="Authorization"/>.</returns> public IObservable<ApplicationAuthorization> Create( string clientId, string clientSecret, NewAuthorization newAuthorization, string twoFactorAuthenticationCode) { Ensure.ArgumentNotNullOrEmptyString(clientId, "clientId"); Ensure.ArgumentNotNullOrEmptyString(clientSecret, "clientSecret"); Ensure.ArgumentNotNull(newAuthorization, "newAuthorization"); Ensure.ArgumentNotNullOrEmptyString(twoFactorAuthenticationCode, "twoFactorAuthenticationCode"); return _client.Create(clientId, clientSecret, newAuthorization, twoFactorAuthenticationCode).ToObservable(); } /// <summary> /// This method will create a new authorization for the specified OAuth application, only if an authorization /// for that application doesn’t already exist for the user. It returns the user’s token for the application /// if one exists. Otherwise, it creates one. /// </summary> /// <remarks> /// See <a href="http://developer.github.com/v3/oauth/#get-or-create-an-authorization-for-a-specific-app">API /// documentation</a> for more details. /// </remarks> /// <param name="clientId">Client Id for the OAuth application that is requesting the token</param> /// <param name="clientSecret">The client secret</param> /// <param name="newAuthorization">Defines the scopes and metadata for the token</param> /// <exception cref="AuthorizationException">Thrown when the user does not have permission to make /// this request. Check </exception> /// <exception cref="TwoFactorRequiredException">Thrown when the current account has two-factor /// authentication enabled.</exception> /// <returns></returns> public IObservable<ApplicationAuthorization> GetOrCreateApplicationAuthentication( string clientId, string clientSecret, NewAuthorization newAuthorization) { Ensure.ArgumentNotNullOrEmptyString(clientId, "clientId"); Ensure.ArgumentNotNullOrEmptyString(clientSecret, "clientSecret"); Ensure.ArgumentNotNull(newAuthorization, "newAuthorization"); return _client.GetOrCreateApplicationAuthentication(clientId, clientSecret, newAuthorization) .ToObservable(); } /// <summary> /// This method will create a new authorization for the specified OAuth application, only if an authorization /// for that application doesn’t already exist for the user. It returns the user’s token for the application /// if one exists. Otherwise, it creates one. /// </summary> /// <remarks> /// See <a href="http://developer.github.com/v3/oauth/#get-or-create-an-authorization-for-a-specific-app">API /// documentation</a> for more details. /// </remarks> /// <param name="clientId">Client Id for the OAuth application that is requesting the token</param> /// <param name="clientSecret">The client secret</param> /// <param name="newAuthorization">Defines the scopes and metadata for the token</param> /// <param name="twoFactorAuthenticationCode">The two-factor authentication code provided by the user</param> /// <exception cref="AuthorizationException">Thrown when the user does not have permission to make /// this request. Check </exception> /// <exception cref="TwoFactorChallengeFailedException">Thrown when the two-factor code is not /// valid.</exception> /// <returns></returns> public IObservable<ApplicationAuthorization> GetOrCreateApplicationAuthentication( string clientId, string clientSecret, NewAuthorization newAuthorization, string twoFactorAuthenticationCode) { Ensure.ArgumentNotNullOrEmptyString(clientId, "clientId"); Ensure.ArgumentNotNullOrEmptyString(clientSecret, "clientSecret"); Ensure.ArgumentNotNull(newAuthorization, "newAuthorization"); Ensure.ArgumentNotNullOrEmptyString(twoFactorAuthenticationCode, "twoFactorAuthenticationCode"); return _client.GetOrCreateApplicationAuthentication( clientId, clientSecret, newAuthorization, twoFactorAuthenticationCode) .ToObservable(); } /// <summary> /// Checks the validity of an OAuth token without running afoul of normal rate limits for failed login attempts. /// </summary> /// <remarks> /// This method requires authentication. /// See the <a href="https://developer.github.com/v3/oauth_authorizations/#check-an-authorization">API documentation</a> for more information. /// </remarks> /// <param name="clientId">Client Id of the OAuth application for the token</param> /// <param name="accessToken">The OAuth token to check</param> /// <returns>The valid <see cref="ApplicationAuthorization"/>.</returns> public IObservable<ApplicationAuthorization> CheckApplicationAuthentication(string clientId, string accessToken) { Ensure.ArgumentNotNullOrEmptyString("clientId", clientId); Ensure.ArgumentNotNullOrEmptyString("accessToken", accessToken); return _client.CheckApplicationAuthentication(clientId, accessToken) .ToObservable(); } /// <summary> /// Resets a valid OAuth token for an OAuth application without end user involvement. /// </summary> /// <remarks> /// This method requires authentication. /// See the <a href="https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization">API documentation</a> for more information. /// </remarks> /// <param name="clientId">ClientID of the OAuth application for the token</param> /// <param name="accessToken">The OAuth token to reset</param> /// <returns>The valid <see cref="ApplicationAuthorization"/> with a new OAuth token</returns> public IObservable<ApplicationAuthorization> ResetApplicationAuthentication(string clientId, string accessToken) { Ensure.ArgumentNotNullOrEmptyString("clientId", clientId); Ensure.ArgumentNotNullOrEmptyString("accessToken", accessToken); return _client.ResetApplicationAuthentication(clientId, accessToken) .ToObservable(); } /// <summary> /// Revokes a single OAuth token for an OAuth application. /// </summary> /// <remarks> /// This method requires authentication. /// See the <a href="https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application">API documentation for more information.</a> /// </remarks> /// <param name="clientId">ClientID of the OAuth application for the token</param> /// <param name="accessToken">The OAuth token to revoke</param> /// <returns></returns> public IObservable<Unit> RevokeApplicationAuthentication(string clientId, string accessToken) { Ensure.ArgumentNotNullOrEmptyString("clientId", clientId); Ensure.ArgumentNotNullOrEmptyString("accessToken", accessToken); return _client.RevokeApplicationAuthentication(clientId, accessToken) .ToObservable(); } /// <summary> /// Update the <see cref="Authorization"/> specified by the id. /// </summary> /// <param name="id">The id of the <see cref="Authorization"/></param> /// <param name="authorizationUpdate">The changes to make to the authorization</param> /// <returns></returns> public IObservable<Authorization> Update(int id, AuthorizationUpdate authorizationUpdate) { Ensure.ArgumentNotNull(authorizationUpdate, "authorizationUpdate"); return _client.Update(id, authorizationUpdate).ToObservable(); } /// <summary> /// Deletes the specified <see cref="Authorization"/>. /// </summary> /// <remarks> /// This method requires authentication. /// See the <a href="http://developer.github.com/v3/oauth/#delete-an-authorization">API /// documentation</a> for more details. /// </remarks> /// <param name="id">The system-wide Id of the authorization to delete</param> /// <exception cref="AuthorizationException"> /// Thrown when the current user does not have permission to make the request. /// </exception> /// <exception cref="ApiException">Thrown when a general API error occurs.</exception> public IObservable<Unit> Delete(int id) { return _client.Delete(id).ToObservable(); } /// <summary> /// Deletes the specified <see cref="Authorization"/>. /// </summary> /// <remarks> /// This method requires authentication. /// See the <a href="http://developer.github.com/v3/oauth/#delete-an-authorization">API /// documentation</a> for more details. /// </remarks> /// <param name="id">The system-wide Id of the authorization to delete</param> /// <param name="twoFactorAuthenticationCode">Two factor authorization code</param> /// <exception cref="AuthorizationException"> /// Thrown when the current user does not have permission to make the request. /// </exception> /// <exception cref="ApiException">Thrown when a general API error occurs.</exception> public IObservable<Unit> Delete(int id, string twoFactorAuthenticationCode) { return _client.Delete(id, twoFactorAuthenticationCode).ToObservable(); } } }
{'content_hash': 'a16da25f0923d63a6b78786705c355b1', 'timestamp': '', 'source': 'github', 'line_count': 354, 'max_line_length': 170, 'avg_line_length': 52.41242937853107, 'alnum_prop': 0.650156300528188, 'repo_name': 'thedillonb/octokit.net', 'id': 'e63ac304c7dd600e09fafedf376662d6b4fa51d0', 'size': '18568', 'binary': False, 'copies': '12', 'ref': 'refs/heads/master', 'path': 'Octokit.Reactive/Clients/ObservableAuthorizationsClient.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '6946919'}, {'name': 'PowerShell', 'bytes': '10946'}, {'name': 'Shell', 'bytes': '270'}]}
function isnan(num) return tostring(num) == tostring(0/0) end function isinfinite(num) return tostring(num) == tostring(1/0) end function default(one, def) if one == nil then return def else return one end end function getColumnTypes() --Name, Buy, Sell, Delta $, Volume return {"java.lang.String", "java.lang.Double", "java.lang.Double", "java.lang.Double", "java.lang.Integer"} end function getColumnNames() return {"Name", "Buy Price", "Sell Price", "Delta $", "Volume"} end function translateTableCol(buy, sell, props) maxprice = tonumber(filter:get("Maximum_Price")) minprice = tonumber(filter:get("Minimum_Price")) or 0 minmarg = tonumber(filter:get("Minimum_Margin")) outside_color = filter:get("Invalid_Color") or "red" r = translateTable(buy, sell) props:put("name", r[1]) if minmarg ~= nil and r[4] < minmarg then props:put("color", outside_color) elseif maxprice ~= nil and r[2] > maxprice then props:put("color", outside_color) elseif isnan(r[4]) or isinfinite(r[4]) then props:put("color", "red") else props:put("color", "none") end return r end function translateTable(buy, sell) return { getItemName(buy["type"]), buy.topFive, sell.topFive, sell.topFive - buy.topFive, buy.volume } end
{'content_hash': '146732962ffeef79027a84c28491c161', 'timestamp': '', 'source': 'github', 'line_count': 61, 'max_line_length': 109, 'avg_line_length': 21.75409836065574, 'alnum_prop': 0.6556141672946496, 'repo_name': 'memcallen/EveMarketTool', 'id': '411f2818670059495998552545f962f1a2638e5f', 'size': '1327', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'EveMarketTool/decoders/price_table.lua', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '207134'}, {'name': 'Lua', 'bytes': '5172'}, {'name': 'Python', 'bytes': '985'}]}
<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ededed" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ededed" android:orientation="vertical" > <RelativeLayout android:id="@+id/layout_01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <ListView android:id="@+id/order_listView" android:layout_width="match_parent" android:layout_height="236dp" android:divider="#d9d9d9" android:dividerHeight="1dp" android:minHeight="36dp" > </ListView> </RelativeLayout> <RelativeLayout android:id="@+id/layout_02" android:layout_width="fill_parent" android:layout_height="43dp" android:layout_below="@id/layout_01" android:layout_marginTop="15dp" android:background="#ededed" android:orientation="horizontal" > <TextView android:id="@+id/table_id" android:layout_width="78dp" android:layout_height="43dp" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginLeft="24dp" android:background="#ededed" android:gravity="left|center_vertical" android:text="@string/order_text_title_tableid" android:textColor="#4d4d4d" android:textSize="20dp" /> <EditText android:id="@+id/table_input_id" android:layout_width="140dp" android:layout_height="43dp" android:layout_centerVertical="true" android:layout_toRightOf="@id/table_id" android:hint="@string/order_text_hint_tableid" android:inputType="number" android:maxLength="20" android:singleLine="true" android:textSize="20dp" /> </RelativeLayout> <RelativeLayout android:id="@+id/layout_03" android:layout_width="fill_parent" android:layout_height="43dp" android:layout_below="@id/layout_02" android:background="#ededed" android:orientation="horizontal" > <TextView android:id="@+id/table_people_count" android:layout_width="78dp" android:layout_height="43dp" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginLeft="24dp" android:background="#ededed" android:gravity="left|center_vertical" android:text="@string/order_text_title_table_people_count" android:textColor="#4d4d4d" android:textSize="20dp" /> <EditText android:id="@+id/table_input_people_count" android:layout_width="140dp" android:layout_height="43dp" android:layout_centerVertical="true" android:layout_toRightOf="@id/table_people_count" android:hint="@string/order_text_hint_poeple_count" android:inputType="number" android:maxLength="20" android:singleLine="true" android:textSize="20dp" /> </RelativeLayout> <RelativeLayout android:id="@+id/layout_04" android:layout_width="fill_parent" android:layout_height="43dp" android:layout_below="@id/layout_03" android:background="#ededed" android:orientation="horizontal" > <TextView android:id="@+id/employee_id" android:layout_width="78dp" android:layout_height="43dp" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginLeft="24dp" android:background="#ededed" android:gravity="left|center_vertical" android:text="@string/order_text_title_employee" android:textColor="#4d4d4d" android:textSize="20dp" /> <EditText android:id="@+id/employee_input_id" android:layout_width="140dp" android:layout_height="43dp" android:layout_centerVertical="true" android:layout_toRightOf="@id/employee_id" android:hint="@string/order_text_hint_qrcode" android:inputType="number" android:maxLength="20" android:enabled="false" android:singleLine="true" android:textSize="20dp" /> <Button android:id="@+id/employee_2code_id" android:layout_width="121dp" android:layout_height="43dp" android:layout_centerVertical="true" android:layout_marginRight="17dp" android:layout_toRightOf="@id/employee_input_id" android:background="@drawable/order_btn_2code_bg" /> </RelativeLayout> <RelativeLayout android:id="@+id/layout_05" android:layout_width="fill_parent" android:layout_height="60dp" android:layout_below="@id/layout_04" android:background="#ededed" android:orientation="horizontal" > <TextView android:id="@+id/user_id" android:layout_width="78dp" android:layout_height="43dp" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginLeft="24dp" android:background="#ededed" android:gravity="left|center_vertical" android:text="@string/order_text_title_userid" android:textColor="#4d4d4d" android:textSize="20dp" /> <EditText android:id="@+id/user_input_id" android:layout_width="140dp" android:layout_height="43dp" android:layout_centerVertical="true" android:layout_toRightOf="@id/user_id" android:hint="@string/order_text_hint_userid" android:inputType="number" android:maxLength="20" android:singleLine="true" android:textSize="20dp" /> <Button android:id="@+id/discount_get_id" android:layout_width="121dp" android:layout_height="43dp" android:layout_centerVertical="true" android:layout_marginRight="17dp" android:layout_toRightOf="@id/user_input_id" android:background="@drawable/myorder_btn_order_bg" android:text="@string/order_text_btn_discount" android:textColor="#ffffff" /> </RelativeLayout> <RelativeLayout android:id="@+id/layout_06" android:layout_width="fill_parent" android:layout_height="43dp" android:layout_below="@id/layout_05" android:background="#ededed" android:orientation="horizontal" > <TextView android:id="@+id/discount_price" android:layout_width="120dp" android:layout_height="43dp" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="17dp" android:background="#ededed" android:gravity="right|center_vertical" android:text="@string/order_text_discount" android:textColor="#4d4d4d" android:textSize="20dp" /> <TextView android:id="@+id/original_price" android:layout_width="wrap_content" android:layout_height="43dp" android:layout_centerVertical="true" android:layout_marginLeft="24dp" android:layout_toLeftOf="@id/discount_price" android:background="#ededed" android:gravity="right|center_vertical" android:text="@string/order_text_originalprice" android:textColor="#4d4d4d" android:textSize="20dp" /> </RelativeLayout> <RelativeLayout android:id="@+id/layout_07" android:layout_width="fill_parent" android:layout_height="43dp" android:layout_below="@id/layout_06" android:background="#ededed" android:orientation="horizontal" > <TextView android:id="@+id/real_price" android:layout_width="160dp" android:layout_height="43dp" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="17dp" android:background="#ededed" android:gravity="right|center_vertical" android:text="@string/order_text_realprice" android:textColor="#fe3c3c" android:textSize="20dp" /> </RelativeLayout> <RelativeLayout android:id="@+id/myorder_layout_button" android:layout_width="fill_parent" android:layout_height="60dp" android:layout_below="@id/layout_07" android:layout_marginTop="55dp" android:background="#ffdddddd" android:gravity="center_vertical" android:orientation="vertical" > <TextView android:id="@+id/goods_allprice" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignParentLeft="true" android:layout_marginLeft="35dp" android:background="#ffdddddd" android:gravity="left|center_vertical" android:text="@string/order_text_realprice" android:textColor="#fe3c3c" android:textSize="20dp" /> <Button android:id="@+id/ok_button" android:layout_width="121dp" android:layout_height="43dp" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="40dp" android:background="@drawable/myorder_btn_order_bg" android:text="@string/order_text_btn_ok" android:textColor="#ffffff" android:textSize="20dp" /> </RelativeLayout> </RelativeLayout> </ScrollView>
{'content_hash': '470d0058e7c9e1cf469f356ad9681274', 'timestamp': '', 'source': 'github', 'line_count': 280, 'max_line_length': 74, 'avg_line_length': 40.67142857142857, 'alnum_prop': 0.5400421496311907, 'repo_name': 'aaronluo/cuoxiazi', 'id': '4c61e28958736a8f246d62a5698478789d5f3bd2', 'size': '11388', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': '03_release/build_v2.0_20150330/code/eOrderMobile/res/layout-xxhdpi/order_activity.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '504471'}, {'name': 'HTML', 'bytes': '112444'}, {'name': 'Java', 'bytes': '5247385'}, {'name': 'JavaScript', 'bytes': '1383858'}]}
<idea-plugin> <application-components> <component> <implementation-class>com.intellij.openapi.vcs.changes.VetoSavingCommittingDocumentsAdapter</implementation-class> </component> <component> <implementation-class>com.intellij.lifecycle.PeriodicalTasksCloser</implementation-class> </component> <component> <implementation-class>com.intellij.openapi.vcs.changes.actions.migrate.MigrateDiffApplicationComponent</implementation-class> </component> <component> <implementation-class>com.intellij.openapi.vcs.changes.patch.PatchClipboardTracker</implementation-class> </component> </application-components> <project-components> <component> <interface-class>com.intellij.openapi.vcs.ProjectLevelVcsManager</interface-class> <implementation-class>com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl</implementation-class> <loadForDefaultProject/> </component> <!-- <component> <implementation-class>com.intellij.openapi.vcs.changes.dbCommitted.HistoryCacheManager</implementation-class> <option name="workspace" value="true"/> </component> --> <component> <implementation-class>com.intellij.openapi.vcs.changes.VcsEventWatcher</implementation-class> </component> <component> <implementation-class>com.intellij.openapi.vcs.annotate.AnnotationsPreloader</implementation-class> </component> <component> <implementation-class>com.intellij.openapi.vcs.impl.VcsDirectoryMappingStorage</implementation-class> <skipForDefaultProject/> </component> <component> <interface-class>com.intellij.openapi.vcs.impl.LineStatusTrackerManagerI</interface-class> <implementation-class>com.intellij.openapi.vcs.impl.LineStatusTrackerManager</implementation-class> <option name="workspace" value="true"/> <skipForDefaultProject/> </component> <component> <implementation-class>com.intellij.openapi.vcs.update.RestoreUpdateTree</implementation-class> <skipForDefaultProject/> </component> <component> <interface-class>com.intellij.openapi.vcs.changes.ChangeListManager</interface-class> <implementation-class>com.intellij.openapi.vcs.changes.ChangeListManagerImpl</implementation-class> </component> <component> <interface-class>com.intellij.openapi.vcs.changes.ChangesViewI</interface-class> <implementation-class>com.intellij.openapi.vcs.changes.ChangesViewManager</implementation-class> <headless-implementation-class>com.intellij.openapi.vcs.changes.DummyChangesView</headless-implementation-class> <option name="workspace" value="true"/> <skipForDefaultProject/> </component> <component> <interface-class>com.intellij.openapi.vcs.changes.VcsDirtyScopeManager</interface-class> <implementation-class>com.intellij.openapi.vcs.changes.VcsDirtyScopeManagerImpl</implementation-class> <option name="workspace" value="true"/> </component> <component> <implementation-class>com.intellij.openapi.vcs.changes.patch.CreatePatchCommitExecutor</implementation-class> <option name="workspace" value="true"/> </component> <component> <implementation-class>com.intellij.openapi.vcs.changes.shelf.ShelveChangesManager</implementation-class> <option name="workspace" value="true"/> </component> <component> <implementation-class>com.intellij.openapi.vcs.changes.shelf.ShelvedChangesViewManager</implementation-class> <headless-implementation-class></headless-implementation-class> <option name="workspace" value="true"/> <skipForDefaultProject/> </component> <component> <interface-class>com.intellij.openapi.vcs.changes.ui.ChangesViewContentI</interface-class> <implementation-class>com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager</implementation-class> <headless-implementation-class>com.intellij.openapi.vcs.changes.ui.DummyChangesViewContentManager</headless-implementation-class> <option name="workspace" value="true"/> <skipForDefaultProject/> </component> <component> <implementation-class>com.intellij.openapi.vcs.changes.committed.CommittedChangesCache</implementation-class> <skipForDefaultProject/> </component> <component> <implementation-class>com.intellij.openapi.vcs.changes.committed.OutdatedVersionNotifier</implementation-class> <skipForDefaultProject/> <headless-implementation-class/> </component> <component> <implementation-class>com.intellij.openapi.vcs.changes.committed.IncomingChangesIndicator</implementation-class> <headless-implementation-class/> <skipForDefaultProject/> </component> <component> <implementation-class>com.intellij.openapi.vcs.impl.VcsFileStatusProvider</implementation-class> <skipForDefaultProject/> </component> <component><interface-class>com.intellij.openapi.vcs.impl.VcsBaseContentProvider</interface-class> <implementation-class>com.intellij.openapi.vcs.impl.VcsFileStatusProvider</implementation-class> </component> <component><interface-class>com.intellij.openapi.vcs.contentAnnotation.VcsContentAnnotation</interface-class> <implementation-class>com.intellij.openapi.vcs.contentAnnotation.VcsContentAnnotationImpl</implementation-class></component> <component><interface-class>com.intellij.openapi.vcs.contentAnnotation.ContentAnnotationCache</interface-class> <implementation-class>com.intellij.openapi.vcs.contentAnnotation.ContentAnnotationCacheImpl</implementation-class></component> </project-components> </idea-plugin>
{'content_hash': '3a45422f631d4da275cda4a132bc9880', 'timestamp': '', 'source': 'github', 'line_count': 109, 'max_line_length': 135, 'avg_line_length': 52.1651376146789, 'alnum_prop': 0.7576503693281744, 'repo_name': 'idea4bsd/idea4bsd', 'id': '2628f03a06ab942dda5675a50a239921f245f93e', 'size': '5686', 'binary': False, 'copies': '4', 'ref': 'refs/heads/idea4bsd-master', 'path': 'platform/platform-resources/src/componentSets/VCS.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'AMPL', 'bytes': '20665'}, {'name': 'AspectJ', 'bytes': '182'}, {'name': 'Batchfile', 'bytes': '59458'}, {'name': 'C', 'bytes': '224097'}, {'name': 'C#', 'bytes': '1538'}, {'name': 'C++', 'bytes': '197012'}, {'name': 'CSS', 'bytes': '197224'}, {'name': 'CoffeeScript', 'bytes': '1759'}, {'name': 'Cucumber', 'bytes': '14382'}, {'name': 'Erlang', 'bytes': '10'}, {'name': 'Groff', 'bytes': '35232'}, {'name': 'Groovy', 'bytes': '2971715'}, {'name': 'HLSL', 'bytes': '57'}, {'name': 'HTML', 'bytes': '1829102'}, {'name': 'J', 'bytes': '5050'}, {'name': 'Java', 'bytes': '158117117'}, {'name': 'JavaScript', 'bytes': '563135'}, {'name': 'Jupyter Notebook', 'bytes': '93222'}, {'name': 'Kotlin', 'bytes': '2208983'}, {'name': 'Lex', 'bytes': '179058'}, {'name': 'Makefile', 'bytes': '3018'}, {'name': 'NSIS', 'bytes': '49952'}, {'name': 'Objective-C', 'bytes': '28750'}, {'name': 'Perl', 'bytes': '903'}, {'name': 'Perl6', 'bytes': '26'}, {'name': 'Protocol Buffer', 'bytes': '6607'}, {'name': 'Python', 'bytes': '23911290'}, {'name': 'Ruby', 'bytes': '1217'}, {'name': 'Scala', 'bytes': '11698'}, {'name': 'Shell', 'bytes': '63460'}, {'name': 'Smalltalk', 'bytes': '64'}, {'name': 'TeX', 'bytes': '25473'}, {'name': 'Thrift', 'bytes': '1846'}, {'name': 'TypeScript', 'bytes': '9469'}, {'name': 'Visual Basic', 'bytes': '77'}, {'name': 'XSLT', 'bytes': '113040'}]}
@interface ExplictAnimationsDemoTests : XCTestCase @end @implementation ExplictAnimationsDemoTests - (void)setUp { [super setUp]; // Put setup code here. This method is called before the invocation of each test method in the class. } - (void)tearDown { // Put teardown code here. This method is called after the invocation of each test method in the class. [super tearDown]; } - (void)testExample { XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); } @end
{'content_hash': 'b4f19632cf66df3beade4d0b2dfcbbdd', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 107, 'avg_line_length': 20.625, 'alnum_prop': 0.7090909090909091, 'repo_name': 'sseen/iOS_CoreAnimationDemos', 'id': '2c0a29607589274ca6d9c8ff9147dd6855187534', 'size': '686', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ExplictAnimationsDemo/ExplictAnimationsDemoTests/ExplictAnimationsDemoTests.m', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '71331'}, {'name': 'C++', 'bytes': '297108'}, {'name': 'Objective-C', 'bytes': '335924'}]}
layout: post title: About Automated Testing and Ketchup Bottles published: true lang: en ref: automatedtestingketchuup --- ![Sometimes a Ketchup bottle can bring some insights to your life.](../images/HeinzKetchup.jpg) > Quality is to a product what character is to a man I still do not understand quite well why I am almost paranoid about automated testing in software delivery business. Maybe I should go the doctor, specially when I think about the subject after reading a ketchup bottle quote. Considering testing is a quality improvement for a product, making these tests is an act of character for a software developer. It is something you should not ask permission to do and at the same time be accountable for not doing. You usually do not ask permission to have a good character, but you will definitely be blamed if you demonstrate otherwise. I put a very high quality standard in the things I do, otherwise I probably prefer doing nothing. More into the details, write automated tests for me it is not just and extra task you must perform like "write unit tests", most of the time erroneously addressed at the end of the development. Instead, it is what will drive the next line of code I write. TDD anyone? When you put automated testing in the front line of the developer daily work: * Helps you constantly check if you are working to fulfil a certain criteria or it is just because you had a "great" idea. In case of the later, then either a new criteria should be added or you are losing focus * Helps identify very quickly when a criteria is not testable, when other criteria are missing, when they are conflicting, ambiguous, if I need missing test data, etc * Find new corner cases to add test coverage Back in the 80's there was all these movements of having quality departments, groups etc. This is still common, but in general, the latest understanding is everyone should put quality in everything that is done, not to a specific department. And for coding is no different.
{'content_hash': '250f0c914a2cd895f999e7c2c4ebc24d', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 273, 'avg_line_length': 55.861111111111114, 'alnum_prop': 0.7906514172053705, 'repo_name': 'ikondrasovas/ikondrasovas.github.io', 'id': '237d99e057cc12ed6deaa7b2e0e2c3ce6d048caf', 'size': '2015', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '_posts/2020-08-17-Quality-Character.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '62905'}, {'name': 'HTML', 'bytes': '6299'}]}
import {Component, OnInit} from '@angular/core'; import {Dude, DudeService} from "./dude/dude.service"; import {tap} from "rxjs/operators"; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent implements OnInit { title = 'app'; dudes: Dude[] = []; constructor (private dudeService: DudeService){} ngOnInit() { this.loadDudes(); } loadDudes(): void { this.dudeService.getDudes() .pipe(tap(() => this.dudeService.initSelectedDude())) .subscribe(dudes => { this.dudes = dudes; }); } }
{'content_hash': '97f70894066ce9a902c4d7b018f89cb9', 'timestamp': '', 'source': 'github', 'line_count': 28, 'max_line_length': 59, 'avg_line_length': 22.285714285714285, 'alnum_prop': 0.6346153846153846, 'repo_name': 'joalder/billstation', 'id': 'b211f01af891d648e6305ed4bec06bc5f590ca17', 'size': '624', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'frontend/src/app/app.component.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '1234'}, {'name': 'HTML', 'bytes': '9612'}, {'name': 'JavaScript', 'bytes': '4657446'}, {'name': 'Python', 'bytes': '21717'}, {'name': 'Shell', 'bytes': '201'}, {'name': 'TypeScript', 'bytes': '28290'}]}
.class final enum Lcom/android/server/BackupManagerService$RestoreState; .super Ljava/lang/Enum; .source "BackupManagerService.java" # annotations .annotation system Ldalvik/annotation/EnclosingClass; value = Lcom/android/server/BackupManagerService; .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x4018 name = "RestoreState" .end annotation .annotation system Ldalvik/annotation/Signature; value = { "Ljava/lang/Enum", "<", "Lcom/android/server/BackupManagerService$RestoreState;", ">;" } .end annotation # static fields .field private static final synthetic $VALUES:[Lcom/android/server/BackupManagerService$RestoreState; .field public static final enum DOWNLOAD_DATA:Lcom/android/server/BackupManagerService$RestoreState; .field public static final enum FINAL:Lcom/android/server/BackupManagerService$RestoreState; .field public static final enum INITIAL:Lcom/android/server/BackupManagerService$RestoreState; .field public static final enum PM_METADATA:Lcom/android/server/BackupManagerService$RestoreState; .field public static final enum RUNNING_QUEUE:Lcom/android/server/BackupManagerService$RestoreState; # direct methods .method static constructor <clinit>()V .locals 7 .prologue const/4 v6, 0x4 const/4 v5, 0x3 const/4 v4, 0x2 const/4 v3, 0x1 const/4 v2, 0x0 .line 4127 new-instance v0, Lcom/android/server/BackupManagerService$RestoreState; const-string v1, "INITIAL" invoke-direct {v0, v1, v2}, Lcom/android/server/BackupManagerService$RestoreState;-><init>(Ljava/lang/String;I)V sput-object v0, Lcom/android/server/BackupManagerService$RestoreState;->INITIAL:Lcom/android/server/BackupManagerService$RestoreState; .line 4128 new-instance v0, Lcom/android/server/BackupManagerService$RestoreState; const-string v1, "DOWNLOAD_DATA" invoke-direct {v0, v1, v3}, Lcom/android/server/BackupManagerService$RestoreState;-><init>(Ljava/lang/String;I)V sput-object v0, Lcom/android/server/BackupManagerService$RestoreState;->DOWNLOAD_DATA:Lcom/android/server/BackupManagerService$RestoreState; .line 4129 new-instance v0, Lcom/android/server/BackupManagerService$RestoreState; const-string v1, "PM_METADATA" invoke-direct {v0, v1, v4}, Lcom/android/server/BackupManagerService$RestoreState;-><init>(Ljava/lang/String;I)V sput-object v0, Lcom/android/server/BackupManagerService$RestoreState;->PM_METADATA:Lcom/android/server/BackupManagerService$RestoreState; .line 4130 new-instance v0, Lcom/android/server/BackupManagerService$RestoreState; const-string v1, "RUNNING_QUEUE" invoke-direct {v0, v1, v5}, Lcom/android/server/BackupManagerService$RestoreState;-><init>(Ljava/lang/String;I)V sput-object v0, Lcom/android/server/BackupManagerService$RestoreState;->RUNNING_QUEUE:Lcom/android/server/BackupManagerService$RestoreState; .line 4131 new-instance v0, Lcom/android/server/BackupManagerService$RestoreState; const-string v1, "FINAL" invoke-direct {v0, v1, v6}, Lcom/android/server/BackupManagerService$RestoreState;-><init>(Ljava/lang/String;I)V sput-object v0, Lcom/android/server/BackupManagerService$RestoreState;->FINAL:Lcom/android/server/BackupManagerService$RestoreState; .line 4126 const/4 v0, 0x5 new-array v0, v0, [Lcom/android/server/BackupManagerService$RestoreState; sget-object v1, Lcom/android/server/BackupManagerService$RestoreState;->INITIAL:Lcom/android/server/BackupManagerService$RestoreState; aput-object v1, v0, v2 sget-object v1, Lcom/android/server/BackupManagerService$RestoreState;->DOWNLOAD_DATA:Lcom/android/server/BackupManagerService$RestoreState; aput-object v1, v0, v3 sget-object v1, Lcom/android/server/BackupManagerService$RestoreState;->PM_METADATA:Lcom/android/server/BackupManagerService$RestoreState; aput-object v1, v0, v4 sget-object v1, Lcom/android/server/BackupManagerService$RestoreState;->RUNNING_QUEUE:Lcom/android/server/BackupManagerService$RestoreState; aput-object v1, v0, v5 sget-object v1, Lcom/android/server/BackupManagerService$RestoreState;->FINAL:Lcom/android/server/BackupManagerService$RestoreState; aput-object v1, v0, v6 sput-object v0, Lcom/android/server/BackupManagerService$RestoreState;->$VALUES:[Lcom/android/server/BackupManagerService$RestoreState; return-void .end method .method private constructor <init>(Ljava/lang/String;I)V .locals 0 .parameter .parameter .annotation system Ldalvik/annotation/Signature; value = { "()V" } .end annotation .prologue .line 4126 invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V return-void .end method .method public static valueOf(Ljava/lang/String;)Lcom/android/server/BackupManagerService$RestoreState; .locals 1 .parameter "name" .prologue .line 4126 const-class v0, Lcom/android/server/BackupManagerService$RestoreState; invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum; move-result-object v0 check-cast v0, Lcom/android/server/BackupManagerService$RestoreState; return-object v0 .end method .method public static values()[Lcom/android/server/BackupManagerService$RestoreState; .locals 1 .prologue .line 4126 sget-object v0, Lcom/android/server/BackupManagerService$RestoreState;->$VALUES:[Lcom/android/server/BackupManagerService$RestoreState; invoke-virtual {v0}, [Lcom/android/server/BackupManagerService$RestoreState;->clone()Ljava/lang/Object; move-result-object v0 check-cast v0, [Lcom/android/server/BackupManagerService$RestoreState; return-object v0 .end method
{'content_hash': 'bae36265bbc42fef5640a777da5d6fa4', 'timestamp': '', 'source': 'github', 'line_count': 178, 'max_line_length': 144, 'avg_line_length': 32.831460674157306, 'alnum_prop': 0.759069130732375, 'repo_name': 'baidurom/reference', 'id': '739774bb22308dd3fbdf271495d9b441c8aa8228', 'size': '5844', 'binary': False, 'copies': '4', 'ref': 'refs/heads/coron-4.2', 'path': 'aosp/services.jar.out/smali/com/android/server/BackupManagerService$RestoreState.smali', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
namespace syncer_v2 { MockModelTypeProcessor::MockModelTypeProcessor() : is_synchronous_(true) { } MockModelTypeProcessor::~MockModelTypeProcessor() { } void MockModelTypeProcessor::OnConnect(scoped_ptr<CommitQueue> commit_queue) { NOTREACHED(); } void MockModelTypeProcessor::OnCommitCompleted( const DataTypeState& type_state, const CommitResponseDataList& response_list) { base::Closure task = base::Bind(&MockModelTypeProcessor::OnCommitCompletedImpl, base::Unretained(this), type_state, response_list); pending_tasks_.push_back(task); if (is_synchronous_) RunQueuedTasks(); } void MockModelTypeProcessor::OnUpdateReceived( const DataTypeState& type_state, const UpdateResponseDataList& response_list, const UpdateResponseDataList& pending_updates) { base::Closure task = base::Bind(&MockModelTypeProcessor::OnUpdateReceivedImpl, base::Unretained(this), type_state, response_list, pending_updates); pending_tasks_.push_back(task); if (is_synchronous_) RunQueuedTasks(); } void MockModelTypeProcessor::SetSynchronousExecution(bool is_synchronous) { is_synchronous_ = is_synchronous; } void MockModelTypeProcessor::RunQueuedTasks() { for (std::vector<base::Closure>::iterator it = pending_tasks_.begin(); it != pending_tasks_.end(); ++it) { it->Run(); } pending_tasks_.clear(); } CommitRequestData MockModelTypeProcessor::CommitRequest( const std::string& tag_hash, const sync_pb::EntitySpecifics& specifics) { const int64_t base_version = GetBaseVersion(tag_hash); EntityData data; if (HasServerAssignedId(tag_hash)) { data.id = GetServerAssignedId(tag_hash); } data.client_tag_hash = tag_hash; data.specifics = specifics; // These fields are not really used for much, but we set them anyway // to make this item look more realistic. data.creation_time = base::Time::UnixEpoch() + base::TimeDelta::FromDays(1); data.modification_time = data.creation_time + base::TimeDelta::FromSeconds(base_version); data.non_unique_name = "Name: " + tag_hash; CommitRequestData request_data; request_data.entity = data.Pass(); request_data.sequence_number = GetNextSequenceNumber(tag_hash); request_data.base_version = base_version; return request_data; } CommitRequestData MockModelTypeProcessor::DeleteRequest( const std::string& tag_hash) { const int64_t base_version = GetBaseVersion(tag_hash); EntityData data; if (HasServerAssignedId(tag_hash)) { data.id = GetServerAssignedId(tag_hash); } data.client_tag_hash = tag_hash; // These fields have little or no effect on behavior. We set them anyway to // make the test more realistic. data.creation_time = base::Time::UnixEpoch() + base::TimeDelta::FromDays(1); data.non_unique_name = "Name deleted"; data.modification_time = data.creation_time + base::TimeDelta::FromSeconds(base_version); CommitRequestData request_data; request_data.entity = data.Pass(); request_data.sequence_number = GetNextSequenceNumber(tag_hash); request_data.base_version = base_version; return request_data; } size_t MockModelTypeProcessor::GetNumUpdateResponses() const { return received_update_responses_.size(); } UpdateResponseDataList MockModelTypeProcessor::GetNthUpdateResponse( size_t n) const { DCHECK_LT(n, GetNumUpdateResponses()); return received_update_responses_[n]; } UpdateResponseDataList MockModelTypeProcessor::GetNthPendingUpdates( size_t n) const { DCHECK_LT(n, GetNumUpdateResponses()); return received_pending_updates_[n]; } DataTypeState MockModelTypeProcessor::GetNthTypeStateReceivedInUpdateResponse( size_t n) const { DCHECK_LT(n, GetNumUpdateResponses()); return type_states_received_on_update_[n]; } size_t MockModelTypeProcessor::GetNumCommitResponses() const { return received_commit_responses_.size(); } CommitResponseDataList MockModelTypeProcessor::GetNthCommitResponse( size_t n) const { DCHECK_LT(n, GetNumCommitResponses()); return received_commit_responses_[n]; } DataTypeState MockModelTypeProcessor::GetNthTypeStateReceivedInCommitResponse( size_t n) const { DCHECK_LT(n, GetNumCommitResponses()); return type_states_received_on_commit_[n]; } bool MockModelTypeProcessor::HasUpdateResponse( const std::string& tag_hash) const { std::map<const std::string, UpdateResponseData>::const_iterator it = update_response_items_.find(tag_hash); return it != update_response_items_.end(); } UpdateResponseData MockModelTypeProcessor::GetUpdateResponse( const std::string& tag_hash) const { DCHECK(HasUpdateResponse(tag_hash)); std::map<const std::string, UpdateResponseData>::const_iterator it = update_response_items_.find(tag_hash); return it->second; } bool MockModelTypeProcessor::HasCommitResponse( const std::string& tag_hash) const { std::map<const std::string, CommitResponseData>::const_iterator it = commit_response_items_.find(tag_hash); return it != commit_response_items_.end(); } CommitResponseData MockModelTypeProcessor::GetCommitResponse( const std::string& tag_hash) const { DCHECK(HasCommitResponse(tag_hash)); std::map<const std::string, CommitResponseData>::const_iterator it = commit_response_items_.find(tag_hash); return it->second; } void MockModelTypeProcessor::OnCommitCompletedImpl( const DataTypeState& type_state, const CommitResponseDataList& response_list) { received_commit_responses_.push_back(response_list); type_states_received_on_commit_.push_back(type_state); for (CommitResponseDataList::const_iterator it = response_list.begin(); it != response_list.end(); ++it) { commit_response_items_.insert(std::make_pair(it->client_tag_hash, *it)); // Server wins. Set the model's base version. SetBaseVersion(it->client_tag_hash, it->response_version); SetServerAssignedId(it->client_tag_hash, it->id); } } void MockModelTypeProcessor::OnUpdateReceivedImpl( const DataTypeState& type_state, const UpdateResponseDataList& response_list, const UpdateResponseDataList& pending_updates) { received_update_responses_.push_back(response_list); received_pending_updates_.push_back(pending_updates); type_states_received_on_update_.push_back(type_state); for (UpdateResponseDataList::const_iterator it = response_list.begin(); it != response_list.end(); ++it) { const std::string client_tag_hash = it->entity->client_tag_hash; update_response_items_.insert(std::make_pair(client_tag_hash, *it)); // Server wins. Set the model's base version. SetBaseVersion(client_tag_hash, it->response_version); SetServerAssignedId(client_tag_hash, it->entity->id); } } // Fetches the sequence number as of the most recent update request. int64_t MockModelTypeProcessor::GetCurrentSequenceNumber( const std::string& tag_hash) const { std::map<const std::string, int64_t>::const_iterator it = sequence_numbers_.find(tag_hash); if (it == sequence_numbers_.end()) { return 0; } else { return it->second; } } // The model thread should be sending us items with strictly increasing // sequence numbers. Here's where we emulate that behavior. int64_t MockModelTypeProcessor::GetNextSequenceNumber( const std::string& tag_hash) { int64_t sequence_number = GetCurrentSequenceNumber(tag_hash); sequence_number++; sequence_numbers_[tag_hash] = sequence_number; return sequence_number; } int64_t MockModelTypeProcessor::GetBaseVersion( const std::string& tag_hash) const { std::map<const std::string, int64_t>::const_iterator it = base_versions_.find(tag_hash); if (it == base_versions_.end()) { return kUncommittedVersion; } else { return it->second; } } void MockModelTypeProcessor::SetBaseVersion(const std::string& tag_hash, int64_t version) { base_versions_[tag_hash] = version; } bool MockModelTypeProcessor::HasServerAssignedId( const std::string& tag_hash) const { return assigned_ids_.find(tag_hash) != assigned_ids_.end(); } const std::string& MockModelTypeProcessor::GetServerAssignedId( const std::string& tag_hash) const { DCHECK(HasServerAssignedId(tag_hash)); return assigned_ids_.find(tag_hash)->second; } void MockModelTypeProcessor::SetServerAssignedId(const std::string& tag_hash, const std::string& id) { assigned_ids_[tag_hash] = id; } } // namespace syncer_v2
{'content_hash': '9b428bad3cc8c618273c59b4cc7cce87', 'timestamp': '', 'source': 'github', 'line_count': 265, 'max_line_length': 80, 'avg_line_length': 32.82641509433962, 'alnum_prop': 0.7092769283825727, 'repo_name': 'js0701/chromium-crosswalk', 'id': 'd4249e2c2a37eae21153e355228bb41b1de0d093', 'size': '9025', 'binary': False, 'copies': '6', 'ref': 'refs/heads/master', 'path': 'sync/test/engine/mock_model_type_processor.cc', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []}
layout: flat title: About STIX toc: about_toc.html --- [Structured Threat Information Expression (STIX™)](http://stixproject.github.io/releases/1.2/) is a structured language for describing cyber threat information so it can be shared, stored, and analyzed in a consistent manner. The [STIX whitepaper](/getting-started/whitepaper) describes the motivation and architecture behind STIX. At a high level the STIX language consists of 9 key constructs and the relationships between them: <img src="/images/stix-architecture.png" style="height: 400px" class="aside-text-left"/> - [Observables](http://cyboxproject.github.io) describe what has been or might be seen in cyber - [Indicators](/data-model/{{site.current_version}}/indicator/IndicatorType) describe patterns for what might be seen and what they mean if they are - [Incidents](/data-model/{{site.current_version}}/incident/IncidentType) describe instances of specific adversary actions - [Adversary Tactics, Techniques, and Procedures](/data-model/{{site.current_version}}/ttp/TTPType) describe attack patterns, malware, exploits, kill chains, tools, infrastructure, victim targeting, and other methods used by the adversary - [Exploit Targets](/data-model/{{site.current_version}}/et/ExploitTargetType) describe vulnerabilities, weaknesses, or configurations that might be exploited - [Courses of Action](/data-model/{{site.current_version}}/coa/CourseOfActionType) describe response actions that may be taken in response to an attack or as a preventative measure - [Campaigns](/data-model/{{site.current_version}}/campaign/CampaignType) describe sets of incidents and/or TTPs with a shared intent - [Threat Actors](/data-model/{{site.current_version}}/ta/ThreatActorType) describe identification and/or characterization of the adversary - [Reports](/data-model/{{site.current_version}}/report/ReportType) collect related STIX content and give them shared context <br class="clear: both;" /> ### The STIX Community STIX has been transitioned to OASIS! See the [Community](/community) page for more information. A few shortcuts: - [OASIS Technical Committee](https://www.oasis-open.org/committees/cti) - where STIX development happens - [Mailing Lists](/community/#discussion-list-amp-archives) - stay up to date on development and usage - [Code Repositories](https://github.com/STIXProject/) - the central location for development of the schemas, specifications, tools, and documentation (including this site) ## Frequently Asked Questions #### Who is STIX for? What does STIX do for me? STIX is for anyone involved in defending networks or systems against cyber threats, including cyber defenders, cyber threat analysts, malware analysts, security tool vendors, security researchers, threat sharing communities, and more. STIX provides a common language for describing cyber threat information so it can be shared, stored, and otherwise used in a consistent manner that facilitates automation. #### How do I get it? [Download the current version](/releases/1.2/). Bindings and related tools to help process and work with STIX are [open source on Github](https://github.com/STIXProject). #### Where can I find examples of STIX data? Are there any STIX repositories? The [Samples](/examples) page on this website hosts full threat reports expressed via STIX, including Mandiant's APT1 report and FireEye's Poison Ivy report. [Idioms](/documentation/idioms) also provide good constrained examples. In addition to the MITRE samples, community members have set up [TAXII](http://taxiiproject.github.io/) repositories containing STIX content and even directories pointing to those repositories. One example repository is http://hailataxii.com. #### How do I use STIX? What tools/utilities are available for this effort? The primary way to use STIX is of course via commercial products. The [STIX Blog](http://stixproject.tumblr.com) is a good place to find announcements about new products that support STIX. If you're developing a product or tool, the current STIX reference implementation is in XML so any XML libraries are suitable for producing and consuming STIX XML. The project also maintains open-source [Python bindings](https://github.com/STIXProject/python-stix) and other [Utilities](https://gibhub.com/STIXProject) to make working with STIX at the code level easier. [Documentation](/documentation) and [Suggested Practices](/documentation/suggested-practices), as well as [Examples](/documentation/idioms), can help you understand how to use the STIX Language conceptually (beyond just producing the XML). #### Who is using STIX? [Many organizations](/supporters) have announced support for STIX and TAXII, and are listed on our [Supporters](/supporters) page. Please use our [submission form](http://goo.gl/forms/jKQH7a6TfW) to request that your organization’s products and services be added to the list. The [STIX Blog](http://stixproject.tumblr.com) also lists press releases and other vendor announcements. #### How is STIX licensed? See the [Terms of Use](/legal). ## Relationship to Other Efforts #### TAXII [TAXII](http://taxiiproject.github.io/) (Trusted Automated eXchange of Indicator Information) is the main transport mechanism for cyber threat information represented in STIX. Through the use of TAXII services, organizations can share cyber threat information in a secure and automated manner. The STIX and TAXII communities work closely together (and in fact consist of many of the same people) to ensure that they continue to provide a full stack for sharing threat intelligence. #### CybOX [CybOX](https://cyboxproject.github.io/) (Cyber Observable eXpression) is a language for describing events of stateful properties ("things") that are observable in the cyber domain. STIX leverages CybOX for this purpose, such as in indicator patterns, infrastructure descriptions, and course of action parameters. The STIX and CybOX communities work closely together (and in fact consist of many of the same people) to ensure that CybOX is valuable independently, as well as supports the use cases required by STIX. #### MAEC [MAEC](https://maecproject.github.io/) (Malware Attribute Enumeration and Classification) is a language for describing malware behavior and the results of a malware analysis. STIX leverages MAEC via the TTP construct for this purpose, and additionally both STIX and MAEC use CybOX. While MAEC is led by DHS, the STIX, CybOX, and MAEC communities work closely together (and in fact consist of many of the same people) to ensure that the combination of the three specifications can interoperate and support both individual and combined usages. The STIX and MAEC teams have together produced a whitepaper describing how to [characterize malware across MAEC and STIX](/about/Characterizing_Malware_MAEC_and_STIX_v1.0.pdf). #### CAPEC STIX can utilize [Common Attack Pattern Enumeration and Classification](https://capec.mitre.org/) (CAPEC™) for structured characterization of tactics, techniques, and procedures (TTP) attack patterns through use of the CAPEC schema extension. #### IODEF The [Incident Object Description Format](https://tools.ietf.org/html/rfc5070) (IODEF) is an Internet Engineering Task Force (IETF) standard developed for exchange of incident information. There is no formal relationship between STIX and IODEF, although it is possible to leverage IODEF within STIX in order to represent incident information. Doing so, however, would lose the richness and architectural alignment provided by the STIX Incident structure. #### OpenIOC The STIX Indicator's test mechanism field is an extensible alternative to providing an indicator signature in something other than CybOX. [Open Indicators of Compromise](http://www.openioc.org/), [Open Vulnerability and Assessment Language](https://oval.cisecurity.org/) (OVAL®), SNORT rules, and YARA rules are supported as default extensions to that test mechanism field. #### CIQ The [OASIS Customer Information Quality](https://www.oasis-open.org/committees/ciq/) (CIQ) is a language for representing information about individuals and organizations. The STIX Identity structure uses an extension mechanism to represent identify information used to characterize malicious actors, victims and intelligence sources. The STIX-provided extension leverages CIQ. #### VERIS The [Vocabulary for Event Recording and Incident Sharing](http://veriscommunity.net/) (VERIS) is a metrics framework designed to provide a common language for describing security incidents and their effects in a structured manner. The difference between STIX incidents and VERIS is in purpose and use: VERIS is an after-the-fact characterization of cyber incidents intended for post-incident strategic trend analysis and risk management. STIX provides the capability to capture information about security incidents and their effects but does so in the context of a broader threat intelligence framework. Verizon and members of the VERIS team are active members of the STIX community and have contributed their thoughts and access to the VERIS structures to help improve and refine the content of the STIX Incident schema. A good portion of the STIX Incident schema was derived from this VERIS input.
{'content_hash': '9eb3b2ea11dd375eed112070f9c67831', 'timestamp': '', 'source': 'github', 'line_count': 97, 'max_line_length': 899, 'avg_line_length': 95.4639175257732, 'alnum_prop': 0.7954643628509719, 'repo_name': 'johnwunder/johnwunder.github.io', 'id': 'ebe7b31f14d78d3b5e11bf578ab5ce29a11eb34e', 'size': '9271', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'about/index.md', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'CSS', 'bytes': '9605'}, {'name': 'HTML', 'bytes': '18133902'}, {'name': 'JavaScript', 'bytes': '3731'}, {'name': 'Ruby', 'bytes': '24306'}, {'name': 'Shell', 'bytes': '1640'}]}
using Microsoft.SharePoint.Client.NetCore.Runtime; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Threading.Tasks; namespace Microsoft.SharePoint.Client.NetCore { [ScriptType("SP.Change", ServerTypeId = "{c717121b-f82f-4afb-a2b7-25f67522120f}")] public class Change : ClientObject { [Remote] public ChangeToken ChangeToken { get { base.CheckUninitializedProperty("ChangeToken"); return (ChangeToken)base.ObjectData.Properties["ChangeToken"]; } } [Remote] public ChangeType ChangeType { get { base.CheckUninitializedProperty("ChangeType"); return (ChangeType)base.ObjectData.Properties["ChangeType"]; } } [Remote] public string RelativeTime { get { base.CheckUninitializedProperty("RelativeTime"); return (string)base.ObjectData.Properties["RelativeTime"]; } } [Remote] public Guid SiteId { get { base.CheckUninitializedProperty("SiteId"); return (Guid)base.ObjectData.Properties["SiteId"]; } } [Remote] public DateTime Time { get { base.CheckUninitializedProperty("Time"); return (DateTime)base.ObjectData.Properties["Time"]; } } [EditorBrowsable(EditorBrowsableState.Never)] public Change(ClientRuntimeContext context, ObjectPath objectPath) : base(context, objectPath) { } protected override bool InitOnePropertyFromJson(string peekedName, JsonReader reader) { bool flag = base.InitOnePropertyFromJson(peekedName, reader); if (flag) { return flag; } if (peekedName != null) { if (!(peekedName == "ChangeToken")) { if (!(peekedName == "ChangeType")) { if (!(peekedName == "RelativeTime")) { if (!(peekedName == "SiteId")) { if (peekedName == "Time") { flag = true; reader.ReadName(); base.ObjectData.Properties["Time"] = reader.ReadDateTime(); } } else { flag = true; reader.ReadName(); base.ObjectData.Properties["SiteId"] = reader.ReadGuid(); } } else { flag = true; reader.ReadName(); base.ObjectData.Properties["RelativeTime"] = reader.ReadString(); } } else { flag = true; reader.ReadName(); base.ObjectData.Properties["ChangeType"] = reader.ReadEnum<ChangeType>(); } } else { flag = true; reader.ReadName(); base.ObjectData.Properties["ChangeToken"] = reader.Read<ChangeToken>(); } } return flag; } } }
{'content_hash': '4332aa8040cc01214f1a07347eb12daf', 'timestamp': '', 'source': 'github', 'line_count': 123, 'max_line_length': 102, 'avg_line_length': 31.764227642276424, 'alnum_prop': 0.41899155362170465, 'repo_name': 'OneBitSoftware/NetCore.CSOM', 'id': 'c0412867388398a744f01088bdf58fa7d7cb966a', 'size': '3909', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Microsoft.SharePoint.Client.NetCore/Change.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '1853437'}]}
/* * reserved comment block * DO NOT REMOVE OR ALTER! */ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.sun.org.apache.xml.internal.utils.res; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ListResourceBundle; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; /** * The default (english) resource bundle. * * @xsl.usage internal */ public class XResourceBundle extends ListResourceBundle { /** * Error resource constants */ public static final String ERROR_RESOURCES = "com.sun.org.apache.xalan.internal.res.XSLTErrorResources", XSLT_RESOURCE = "com.sun.org.apache.xml.internal.utils.res.XResourceBundle", LANG_BUNDLE_NAME = "com.sun.org.apache.xml.internal.utils.res.XResources", MULT_ORDER = "multiplierOrder", MULT_PRECEDES = "precedes", MULT_FOLLOWS = "follows", LANG_ORIENTATION = "orientation", LANG_RIGHTTOLEFT = "rightToLeft", LANG_LEFTTORIGHT = "leftToRight", LANG_NUMBERING = "numbering", LANG_ADDITIVE = "additive", LANG_MULT_ADD = "multiplicative-additive", LANG_MULTIPLIER = "multiplier", LANG_MULTIPLIER_CHAR = "multiplierChar", LANG_NUMBERGROUPS = "numberGroups", LANG_NUM_TABLES = "tables", LANG_ALPHABET = "alphabet", LANG_TRAD_ALPHABET = "tradAlphabet"; /** * Get the association list. * * @return The association list. */ public Object[][] getContents() { return new Object[][]{ {"ui_language", "en"}, {"help_language", "en"}, {"language", "en"}, {"alphabet", new CharArrayWrapper(new char[]{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'})}, {"tradAlphabet", new CharArrayWrapper(new char[]{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'})}, //language orientation {"orientation", "LeftToRight"}, //language numbering {"numbering", "additive"},}; } }
{'content_hash': 'b8d1c560cb09b7c8f4767fb2b7e7b14b', 'timestamp': '', 'source': 'github', 'line_count': 74, 'max_line_length': 99, 'avg_line_length': 42.66216216216216, 'alnum_prop': 0.5958188153310104, 'repo_name': 'mirkosertic/Bytecoder', 'id': 'def8cec86cec88ae89deccbd39fe9d0db7a0d3cd', 'size': '3157', 'binary': False, 'copies': '22', 'ref': 'refs/heads/master', 'path': 'classlib/java.xml/src/main/resources/META-INF/modules/java.xml/classes/com/sun/org/apache/xml/internal/utils/res/XResourceBundle.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '153'}, {'name': 'C++', 'bytes': '1301'}, {'name': 'CSS', 'bytes': '5154'}, {'name': 'Clojure', 'bytes': '87'}, {'name': 'HTML', 'bytes': '599386'}, {'name': 'Java', 'bytes': '106011215'}, {'name': 'Kotlin', 'bytes': '15858'}, {'name': 'LLVM', 'bytes': '2839'}, {'name': 'Shell', 'bytes': '164'}]}
var margin = {top: 20, right: 20, bottom: 30, left: 50}, width = 2000 - margin.left - margin.right, height = 500 - margin.top - margin.bottom; /* var brasileiro = d3.locale({ months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"] }); */ var parseDate = d3.time.format("%Y-%m-%d").parse; var x = d3.time.scale() .range([0, width]); var y = d3.scale.linear() .range([height, 0]); var xAxis = d3.svg.axis() .scale(x) .orient("bottom"); var yAxis = d3.svg.axis() .scale(y) .orient("left"); var line = d3.svg.line() .x(function(d) { return x(d.date); }) .y(function(d) { return y(d.freq); }); var svg = d3.select("#container-graph").append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); d3.tsv("data/comentarios_temporal_line_chart.tsv", function(error, data) { if (error) throw error; data.forEach(function(d) { d.date = parseDate(d.date); d.freq = +d.freq; }); // extract the x labels for the axis and scale domain var xLabels = data.map(function (d) { return d['date']; }); x.domain(d3.extent(data, function(d) { return d.date; })); y.domain(d3.extent(data, function(d) { return d.freq; })); //x.domain(xLabels); //y.domain([0, Math.round(d3.max(data, function(d) { return parseFloat(d['freq']); }))]); var line = d3.svg.line() .x(function(d) { return x(d['date']); }) .y(function(d) { return y(d['freq']); }); console.log(line); svg.append("g") .attr("class", "x axis") .attr("transform", "translate(0," + height + ")") .call(xAxis); svg.append("g") .attr("class", "y axis") .call(yAxis) .append("text") .attr("transform", "rotate(-90)") .attr("y", 6) .attr("dy", ".71em") .style("text-anchor", "end") .text("Comentários"); svg.append("path") .datum(data) .attr("class", "line") .attr("d", line); // get the x and y values for least squares var xSeries = d3.range(1, xLabels.length + 1); var ySeries = data.map(function(d) { return parseFloat(d['freq']); }); console.log(ySeries); var leastSquaresCoeff = leastSquares(xSeries, ySeries); // apply the reults of the least squares regression var x1 = xLabels[0]; var y1 = leastSquaresCoeff[0] + leastSquaresCoeff[1]; var x2 = xLabels[xLabels.length - 1]; var y2 = leastSquaresCoeff[0] * xSeries.length + leastSquaresCoeff[1]; var trendData = [[x1,y1,x2,y2]]; var trendline = svg.selectAll(".trendline") .data(trendData); trendline.enter() .append("line") .attr("class", "trendline") .attr("x1", function(d) { return x(d[0]); }) .attr("y1", function(d) { return y(d[1]); }) .attr("x2", function(d) { return x(d[2]); }) .attr("y2", function(d) { return y(d[3]); }) .attr("stroke", "#d62728") .attr("stroke-width", 2); }); // returns slope, intercept and r-square of the line function leastSquares(xSeries, ySeries) { var reduceSumFunc = function(prev, cur) { return prev + cur; }; var xBar = xSeries.reduce(reduceSumFunc) * 1.0 / xSeries.length; var yBar = ySeries.reduce(reduceSumFunc) * 1.0 / ySeries.length; var ssXX = xSeries.map(function(d) { return Math.pow(d - xBar, 2); }) .reduce(reduceSumFunc); var ssYY = ySeries.map(function(d) { return Math.pow(d - yBar, 2); }) .reduce(reduceSumFunc); var ssXY = xSeries.map(function(d, i) { return (d - xBar) * (ySeries[i] - yBar); }) .reduce(reduceSumFunc); var slope = ssXY / ssXX; var intercept = yBar - (xBar * slope); var rSquare = Math.pow(ssXY, 2) / (ssXX * ssYY); return [slope, intercept, rSquare]; }
{'content_hash': '33b6e1cc07920e8f941604d16ea38358', 'timestamp': '', 'source': 'github', 'line_count': 145, 'max_line_length': 134, 'avg_line_length': 27.820689655172412, 'alnum_prop': 0.5718889439762023, 'repo_name': 'W3CBrasil/AI-Social', 'id': '4efd3ec6d51adf9df024b7cb8c562af7dff7e581', 'size': '4036', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'web/site/js/comentarios_temporal_line_chart.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '51364'}, {'name': 'C++', 'bytes': '3317'}, {'name': 'CSS', 'bytes': '66345'}, {'name': 'HTML', 'bytes': '40984'}, {'name': 'JavaScript', 'bytes': '81067'}, {'name': 'Makefile', 'bytes': '981'}, {'name': 'PHP', 'bytes': '24989'}, {'name': 'Python', 'bytes': '90259'}, {'name': 'Ruby', 'bytes': '864'}, {'name': 'Shell', 'bytes': '2623'}]}