text
stringlengths
2
1.04M
meta
dict
namespace v8 { namespace internal { namespace compiler { JSIntrinsicLowering::JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph, JSHeapBroker* broker) : AdvancedReducer(editor), jsgraph_(jsgraph), broker_(broker) {} Reduction JSIntrinsicLowering::Reduce(Node* node) { DisallowHeapAccessIf no_heap_access(broker()->is_concurrent_inlining()); if (node->opcode() != IrOpcode::kJSCallRuntime) return NoChange(); const Runtime::Function* const f = Runtime::FunctionForId(CallRuntimeParametersOf(node->op()).id()); if (f->function_id == Runtime::kTurbofanStaticAssert) { return ReduceTurbofanStaticAssert(node); } if (f->function_id == Runtime::kIsBeingInterpreted) { return ReduceIsBeingInterpreted(node); } if (f->intrinsic_type != Runtime::IntrinsicType::INLINE) return NoChange(); switch (f->function_id) { case Runtime::kInlineCopyDataProperties: return ReduceCopyDataProperties(node); case Runtime::kInlineCreateIterResultObject: return ReduceCreateIterResultObject(node); case Runtime::kInlineDeoptimizeNow: return ReduceDeoptimizeNow(node); case Runtime::kInlineGeneratorClose: return ReduceGeneratorClose(node); case Runtime::kInlineCreateJSGeneratorObject: return ReduceCreateJSGeneratorObject(node); case Runtime::kInlineAsyncFunctionAwaitCaught: return ReduceAsyncFunctionAwaitCaught(node); case Runtime::kInlineAsyncFunctionAwaitUncaught: return ReduceAsyncFunctionAwaitUncaught(node); case Runtime::kInlineAsyncFunctionEnter: return ReduceAsyncFunctionEnter(node); case Runtime::kInlineAsyncFunctionReject: return ReduceAsyncFunctionReject(node); case Runtime::kInlineAsyncFunctionResolve: return ReduceAsyncFunctionResolve(node); case Runtime::kInlineAsyncGeneratorAwaitCaught: return ReduceAsyncGeneratorAwaitCaught(node); case Runtime::kInlineAsyncGeneratorAwaitUncaught: return ReduceAsyncGeneratorAwaitUncaught(node); case Runtime::kInlineAsyncGeneratorReject: return ReduceAsyncGeneratorReject(node); case Runtime::kInlineAsyncGeneratorResolve: return ReduceAsyncGeneratorResolve(node); case Runtime::kInlineAsyncGeneratorYield: return ReduceAsyncGeneratorYield(node); case Runtime::kInlineGeneratorGetResumeMode: return ReduceGeneratorGetResumeMode(node); case Runtime::kInlineIsArray: return ReduceIsInstanceType(node, JS_ARRAY_TYPE); case Runtime::kInlineIsJSReceiver: return ReduceIsJSReceiver(node); case Runtime::kInlineIsSmi: return ReduceIsSmi(node); case Runtime::kInlineToLength: return ReduceToLength(node); case Runtime::kInlineToObject: return ReduceToObject(node); case Runtime::kInlineToStringRT: return ReduceToString(node); case Runtime::kInlineCall: return ReduceCall(node); case Runtime::kInlineIncBlockCounter: return ReduceIncBlockCounter(node); default: break; } return NoChange(); } Reduction JSIntrinsicLowering::ReduceCopyDataProperties(Node* node) { return Change( node, Builtins::CallableFor(isolate(), Builtins::kCopyDataProperties), 0); } Reduction JSIntrinsicLowering::ReduceCreateIterResultObject(Node* node) { Node* const value = NodeProperties::GetValueInput(node, 0); Node* const done = NodeProperties::GetValueInput(node, 1); Node* const context = NodeProperties::GetContextInput(node); Node* const effect = NodeProperties::GetEffectInput(node); return Change(node, javascript()->CreateIterResultObject(), value, done, context, effect); } Reduction JSIntrinsicLowering::ReduceDeoptimizeNow(Node* node) { Node* const frame_state = NodeProperties::GetFrameStateInput(node); Node* const effect = NodeProperties::GetEffectInput(node); Node* const control = NodeProperties::GetControlInput(node); // TODO(bmeurer): Move MergeControlToEnd() to the AdvancedReducer. Node* deoptimize = graph()->NewNode( common()->Deoptimize(DeoptimizeKind::kEager, DeoptimizeReason::kDeoptimizeNow, FeedbackSource()), frame_state, effect, control); NodeProperties::MergeControlToEnd(graph(), common(), deoptimize); Revisit(graph()->end()); node->TrimInputCount(0); NodeProperties::ChangeOp(node, common()->Dead()); return Changed(node); } Reduction JSIntrinsicLowering::ReduceCreateJSGeneratorObject(Node* node) { Node* const closure = NodeProperties::GetValueInput(node, 0); Node* const receiver = NodeProperties::GetValueInput(node, 1); Node* const context = NodeProperties::GetContextInput(node); Node* const effect = NodeProperties::GetEffectInput(node); Node* const control = NodeProperties::GetControlInput(node); Operator const* const op = javascript()->CreateGeneratorObject(); Node* create_generator = graph()->NewNode(op, closure, receiver, context, effect, control); ReplaceWithValue(node, create_generator, create_generator); return Changed(create_generator); } Reduction JSIntrinsicLowering::ReduceGeneratorClose(Node* node) { Node* const generator = NodeProperties::GetValueInput(node, 0); Node* const effect = NodeProperties::GetEffectInput(node); Node* const control = NodeProperties::GetControlInput(node); Node* const closed = jsgraph()->Constant(JSGeneratorObject::kGeneratorClosed); Node* const undefined = jsgraph()->UndefinedConstant(); Operator const* const op = simplified()->StoreField( AccessBuilder::ForJSGeneratorObjectContinuation()); ReplaceWithValue(node, undefined, node); NodeProperties::RemoveType(node); return Change(node, op, generator, closed, effect, control); } Reduction JSIntrinsicLowering::ReduceAsyncFunctionAwaitCaught(Node* node) { return Change( node, Builtins::CallableFor(isolate(), Builtins::kAsyncFunctionAwaitCaught), 0); } Reduction JSIntrinsicLowering::ReduceAsyncFunctionAwaitUncaught(Node* node) { return Change( node, Builtins::CallableFor(isolate(), Builtins::kAsyncFunctionAwaitUncaught), 0); } Reduction JSIntrinsicLowering::ReduceAsyncFunctionEnter(Node* node) { NodeProperties::ChangeOp(node, javascript()->AsyncFunctionEnter()); return Changed(node); } Reduction JSIntrinsicLowering::ReduceAsyncFunctionReject(Node* node) { RelaxControls(node); NodeProperties::ChangeOp(node, javascript()->AsyncFunctionReject()); return Changed(node); } Reduction JSIntrinsicLowering::ReduceAsyncFunctionResolve(Node* node) { RelaxControls(node); NodeProperties::ChangeOp(node, javascript()->AsyncFunctionResolve()); return Changed(node); } Reduction JSIntrinsicLowering::ReduceAsyncGeneratorAwaitCaught(Node* node) { return Change( node, Builtins::CallableFor(isolate(), Builtins::kAsyncGeneratorAwaitCaught), 0); } Reduction JSIntrinsicLowering::ReduceAsyncGeneratorAwaitUncaught(Node* node) { return Change( node, Builtins::CallableFor(isolate(), Builtins::kAsyncGeneratorAwaitUncaught), 0); } Reduction JSIntrinsicLowering::ReduceAsyncGeneratorReject(Node* node) { return Change( node, Builtins::CallableFor(isolate(), Builtins::kAsyncGeneratorReject), 0); } Reduction JSIntrinsicLowering::ReduceAsyncGeneratorResolve(Node* node) { return Change( node, Builtins::CallableFor(isolate(), Builtins::kAsyncGeneratorResolve), 0); } Reduction JSIntrinsicLowering::ReduceAsyncGeneratorYield(Node* node) { return Change( node, Builtins::CallableFor(isolate(), Builtins::kAsyncGeneratorYield), 0); } Reduction JSIntrinsicLowering::ReduceGeneratorGetResumeMode(Node* node) { Node* const generator = NodeProperties::GetValueInput(node, 0); Node* const effect = NodeProperties::GetEffectInput(node); Node* const control = NodeProperties::GetControlInput(node); Operator const* const op = simplified()->LoadField(AccessBuilder::ForJSGeneratorObjectResumeMode()); return Change(node, op, generator, effect, control); } Reduction JSIntrinsicLowering::ReduceIsInstanceType( Node* node, InstanceType instance_type) { // if (%_IsSmi(value)) { // return false; // } else { // return %_GetInstanceType(%_GetMap(value)) == instance_type; // } Node* value = NodeProperties::GetValueInput(node, 0); Node* effect = NodeProperties::GetEffectInput(node); Node* control = NodeProperties::GetControlInput(node); Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), value); Node* branch = graph()->NewNode(common()->Branch(), check, control); Node* if_true = graph()->NewNode(common()->IfTrue(), branch); Node* etrue = effect; Node* vtrue = jsgraph()->FalseConstant(); Node* if_false = graph()->NewNode(common()->IfFalse(), branch); Node* efalse = effect; Node* map = efalse = graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), value, efalse, if_false); Node* map_instance_type = efalse = graph()->NewNode( simplified()->LoadField(AccessBuilder::ForMapInstanceType()), map, efalse, if_false); Node* vfalse = graph()->NewNode(simplified()->NumberEqual(), map_instance_type, jsgraph()->Constant(instance_type)); Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false); // Replace all effect uses of {node} with the {ephi}. Node* ephi = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, merge); ReplaceWithValue(node, node, ephi, merge); // Turn the {node} into a Phi. return Change(node, common()->Phi(MachineRepresentation::kTagged, 2), vtrue, vfalse, merge); } Reduction JSIntrinsicLowering::ReduceIsJSReceiver(Node* node) { return Change(node, simplified()->ObjectIsReceiver()); } Reduction JSIntrinsicLowering::ReduceIsSmi(Node* node) { return Change(node, simplified()->ObjectIsSmi()); } Reduction JSIntrinsicLowering::ReduceTurbofanStaticAssert(Node* node) { if (FLAG_always_opt) { // Ignore static asserts, as we most likely won't have enough information RelaxEffectsAndControls(node); } else { Node* value = NodeProperties::GetValueInput(node, 0); Node* effect = NodeProperties::GetEffectInput(node); Node* assert = graph()->NewNode(common()->StaticAssert(), value, effect); ReplaceWithValue(node, node, assert, nullptr); } return Changed(jsgraph_->UndefinedConstant()); } Reduction JSIntrinsicLowering::ReduceIsBeingInterpreted(Node* node) { RelaxEffectsAndControls(node); return Changed(jsgraph_->FalseConstant()); } Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op) { // Replace all effect uses of {node} with the effect dependency. RelaxEffectsAndControls(node); // Remove the inputs corresponding to context, effect and control. NodeProperties::RemoveNonValueInputs(node); // Finally update the operator to the new one. NodeProperties::ChangeOp(node, op); return Changed(node); } Reduction JSIntrinsicLowering::ReduceToLength(Node* node) { NodeProperties::ChangeOp(node, javascript()->ToLength()); return Changed(node); } Reduction JSIntrinsicLowering::ReduceToObject(Node* node) { NodeProperties::ChangeOp(node, javascript()->ToObject()); return Changed(node); } Reduction JSIntrinsicLowering::ReduceToString(Node* node) { // ToString is unnecessary if the input is a string. HeapObjectMatcher m(NodeProperties::GetValueInput(node, 0)); if (m.HasValue() && m.Ref(broker()).IsString()) { ReplaceWithValue(node, m.node()); return Replace(m.node()); } NodeProperties::ChangeOp(node, javascript()->ToString()); return Changed(node); } Reduction JSIntrinsicLowering::ReduceCall(Node* node) { size_t const arity = CallRuntimeParametersOf(node->op()).arity(); NodeProperties::ChangeOp(node, javascript()->Call(arity)); return Changed(node); } Reduction JSIntrinsicLowering::ReduceIncBlockCounter(Node* node) { DCHECK(!Linkage::NeedsFrameStateInput(Runtime::kIncBlockCounter)); DCHECK(!Linkage::NeedsFrameStateInput(Runtime::kInlineIncBlockCounter)); return Change(node, Builtins::CallableFor(isolate(), Builtins::kIncBlockCounter), 0, kDoesNotNeedFrameState); } Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a, Node* b) { RelaxControls(node); node->ReplaceInput(0, a); node->ReplaceInput(1, b); node->TrimInputCount(2); NodeProperties::ChangeOp(node, op); return Changed(node); } Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a, Node* b, Node* c) { RelaxControls(node); node->ReplaceInput(0, a); node->ReplaceInput(1, b); node->ReplaceInput(2, c); node->TrimInputCount(3); NodeProperties::ChangeOp(node, op); return Changed(node); } Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a, Node* b, Node* c, Node* d) { RelaxControls(node); node->ReplaceInput(0, a); node->ReplaceInput(1, b); node->ReplaceInput(2, c); node->ReplaceInput(3, d); node->TrimInputCount(4); NodeProperties::ChangeOp(node, op); return Changed(node); } Reduction JSIntrinsicLowering::Change(Node* node, Callable const& callable, int stack_parameter_count, enum FrameStateFlag frame_state_flag) { CallDescriptor::Flags flags = frame_state_flag == kNeedsFrameState ? CallDescriptor::kNeedsFrameState : CallDescriptor::kNoFlags; auto call_descriptor = Linkage::GetStubCallDescriptor( graph()->zone(), callable.descriptor(), stack_parameter_count, flags, node->op()->properties()); node->InsertInput(graph()->zone(), 0, jsgraph()->HeapConstant(callable.code())); NodeProperties::ChangeOp(node, common()->Call(call_descriptor)); return Changed(node); } Graph* JSIntrinsicLowering::graph() const { return jsgraph()->graph(); } Isolate* JSIntrinsicLowering::isolate() const { return jsgraph()->isolate(); } CommonOperatorBuilder* JSIntrinsicLowering::common() const { return jsgraph()->common(); } JSOperatorBuilder* JSIntrinsicLowering::javascript() const { return jsgraph_->javascript(); } SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { return jsgraph()->simplified(); } } // namespace compiler } // namespace internal } // namespace v8
{ "content_hash": "35c2804045e7eb52b709ca7290d71bda", "timestamp": "", "source": "github", "line_count": 396, "max_line_length": 80, "avg_line_length": 36.69949494949495, "alnum_prop": 0.7156815523291818, "repo_name": "enclose-io/compiler", "id": "9d6f071aacc7b67b2319b1c6d768bb24a939bbe6", "size": "15195", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "current/deps/v8/src/compiler/js-intrinsic-lowering.cc", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "11474" }, { "name": "Shell", "bytes": "131" } ], "symlink_target": "" }
import Controller from '@ember/controller'; import { get, getProperties } from '@ember/object'; import { inject as service } from '@ember/service'; import recordsList from 'code-corps-ember/utils/records-list'; export default Controller.extend({ projectSkillsList: service(), store: service(), project: null, addCategory(category) { let { project, store } = getProperties(this, 'project', 'store'); store.createRecord('project-category', { project, category }).save(); }, removeCategory(category) { let { project, projectCategories } = getProperties(this, 'project', 'projectCategories'); let projectCategory = recordsList.find(projectCategories, category, project); projectCategory.destroyRecord(); }, removeProjectSkill(projectSkill) { return projectSkill.destroyRecord(); }, toggleSkill(skill) { let list = get(this, 'projectSkillsList'); return list.toggle(skill); }, updateCategories(newSelection, value, operation) { if (operation === 'added') { this.addCategory(value); } if (operation === 'removed') { this.removeCategory(value); } } });
{ "content_hash": "f2923630456f1809c1c71fd877a9ca5b", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 81, "avg_line_length": 26.674418604651162, "alnum_prop": 0.6809067131647777, "repo_name": "code-corps/code-corps-ember", "id": "fc968195a247bae15b5e7ca4a6cabac370d34606", "size": "1147", "binary": false, "copies": "2", "ref": "refs/heads/develop", "path": "app/controllers/project/settings/profile.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "150855" }, { "name": "HTML", "bytes": "220649" }, { "name": "JavaScript", "bytes": "1188778" } ], "symlink_target": "" }
<md-card> <md-card-title>SVG Product Icons</md-card-title> <md-divider></md-divider> <md-card-content> <h3 class="md-title">Style</h3> <p class="md-body-1">While Teradata doesn't have product logos, products do have illustrated vector icons.</p> <p class="md-body-1">Product icons will be flat, angled, and incorporate arrows or movement into dimensionality.</p> <h4 class="md-subtitle">Examples</h4> <div layout="row"> <div flex layout="column" layout-align="center center"> <md-icon class="md-icon-lg fill-teal-700" svgIcon="assets:appcenter"></md-icon> <div class="md-subtitle push-top">AppCenter</div> </div> <div flex layout="column" layout-align="center center"> <md-icon class="md-icon-lg fill-orange-700" svgIcon="assets:listener"></md-icon> <div class="md-subtitle push-top">Listener</div> </div> <div flex layout="column" layout-align="center center"> <md-icon class="md-icon-lg fill-cyan-700" svgIcon="assets:querygrid"></md-icon> <div class="md-subtitle push-top">QueryGrid</div> </div> </div> <h3 class="md-title">Usage</h3> <p class="md-body-1">Use the <code>md-icon</code> component to load an SVG instead of a typing font icon:</p> <td-highlight lang="html"> <![CDATA[ <md-icon svgIcon="assets:appcenter"></md-icon> /* to color an SVG icon use our utility material color fill class */ <md-icon class="fill-teal-700" svgIcon="assets:appcenter">/md-icon> ]]> </td-highlight> </md-card-content> <md-divider></md-divider> <md-card-actions> <span class="md-caption">Teradata AppCenter, Teradata Listener & Teradata QuerGrid icons copyright Teradata. All rights reserved.</span> </md-card-actions> </md-card>
{ "content_hash": "ef5e88432e379e8e079c7d83ecbf3746", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 140, "avg_line_length": 48.567567567567565, "alnum_prop": 0.6533110740122426, "repo_name": "ccpony/uniformax-web", "id": "1939b27f41c15fbdbfa712ce631f7ba7f4058dcd", "size": "1797", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/app/components/style-guide/product-icons/product-icons.component.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "250797" }, { "name": "HTML", "bytes": "441561" }, { "name": "JavaScript", "bytes": "15890" }, { "name": "Shell", "bytes": "3067" }, { "name": "TypeScript", "bytes": "663041" } ], "symlink_target": "" }
angular .module('tas') .config(authConfig) .run(privateRoutes); function authConfig($routeProvider){ $routeProvider .when('/login', { templateUrl: 'js/auth/login.html', controller: 'AuthController', controllerAs: 'auth', resolve: { data: function ($location, authFactory) { if(authFactory.isLoggedIn()) { $location.path('/tas'); } } } }) .when('/logout', { template: '', controller: 'LogoutController' }); } function privateRoutes($rootScope, authFactory, $location){ $rootScope.$on('$routeChangeStart', function (event, nextRoute) { $rootScope.user = authFactory.getAuth(); if (nextRoute.$$route.private && !authFactory.isLoggedIn()) { $location.path('/login'); } }); }
{ "content_hash": "c64854ed6e81d81cdfb0faa1a6e440bf", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 69, "avg_line_length": 23.65714285714286, "alnum_prop": 0.5760869565217391, "repo_name": "luketlancaster/funwithangular", "id": "b85011ed2fd48860b29e022de0ba49083da3aa87", "size": "828", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "js/auth/auth.config.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "494" }, { "name": "HTML", "bytes": "6967" }, { "name": "JavaScript", "bytes": "6949" } ], "symlink_target": "" }
package picocli; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static picocli.CommandLine.ScopeType.INHERIT; import java.util.concurrent.Callable; import org.junit.Test; import picocli.CommandLine.ArgGroup; import picocli.CommandLine.Command; import picocli.CommandLine.IFactory; import picocli.CommandLine.Model.CommandSpec; import picocli.CommandLine.Option; import picocli.CommandLine.Spec; public class Issue1767 { @Command(name = "test") static class TestCommand implements Callable<Integer> { @ArgGroup TestArgGroup testArgGroup; @Spec CommandSpec spec; public static class TestArgGroup { @Option(names = "-r") public Integer option1; } public Integer call() throws Exception { Integer value = spec.options().get(0).getValue(); return value==null ? 0 : value; } } @Test public void testIssue1772() { assertEquals(5, new CommandLine(new TestCommand()).execute("-r", "5")); assertEquals(0, new CommandLine(new TestCommand()).execute()); } }
{ "content_hash": "bcbc28c40d72b6fe751ef48c2e1d0ee4", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 79, "avg_line_length": 28.45, "alnum_prop": 0.6889279437609842, "repo_name": "remkop/picocli", "id": "d7288aec3f0938e8f7253b7b3a7219accc3b84e0", "size": "1138", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/test/java/picocli/Issue1767.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "76794" }, { "name": "HTML", "bytes": "2925" }, { "name": "Java", "bytes": "4411912" }, { "name": "Kotlin", "bytes": "25214" }, { "name": "Scala", "bytes": "6012" }, { "name": "Shell", "bytes": "89133" } ], "symlink_target": "" }
class ChannelOverrideWorkItem : public WorkItem { public: ChannelOverrideWorkItem(); ChannelOverrideWorkItem(const ChannelOverrideWorkItem&) = delete; ChannelOverrideWorkItem& operator=(const ChannelOverrideWorkItem&) = delete; ~ChannelOverrideWorkItem() override; private: // WorkItem: bool DoImpl() override; void RollbackImpl() override; // The original value to be used in rollback. Only valid when a change has // been made. absl::optional<installer::AdditionalParameters> original_ap_; }; #endif // CHROME_INSTALLER_SETUP_CHANNEL_OVERRIDE_WORK_ITEM_H_
{ "content_hash": "f0bb4cd3817875cc79ca7f4523e4acc1", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 32.44444444444444, "alnum_prop": 0.7636986301369864, "repo_name": "ric2b/Vivaldi-browser", "id": "35a9c81d71d07030b90a5163571a4a11011672c8", "size": "1882", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "chromium/chrome/installer/setup/channel_override_work_item.h", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
<div mdl class="demo-layout mdl-layout mdl-js-layout mdl-layout--fixed-header mdl-layout--fixed-drawer"> <header mdl id="drawer" class="demo-header mdl-layout__header mdl-color--grey-100 mdl-color-text--grey-600"> <router-outlet name="header"></router-outlet> </header> <div mdl class="demo-drawer mdl-layout__drawer mdl-color-text--blue-grey-50"> <router-outlet name="sidenav"></router-outlet> </div> <main class="mdl-layout__content mdl-color--grey-100"> <router-outlet></router-outlet> </main> </div>
{ "content_hash": "ffa3b0dd24468f7d25ed294ae26a2001", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 109, "avg_line_length": 46.18181818181818, "alnum_prop": 0.7263779527559056, "repo_name": "leandropjp/AngularUFPB", "id": "92011d9a82952c4970856539e04e12a5bbdea64e", "size": "508", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/app/layout/content/content.component.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "20104" }, { "name": "HTML", "bytes": "37987" }, { "name": "JavaScript", "bytes": "3997" }, { "name": "TypeScript", "bytes": "54884" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>lambda: Not compatible 👼</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.5.2~camlp4 / lambda - 8.9.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> lambda <small> 8.9.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-06-19 05:53:44 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-06-19 05:53:44 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp4 4.05+1 Camlp4 is a system for writing extensible parsers for programming languages conf-findutils 1 Virtual package relying on findutils coq 8.5.2~camlp4 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocamlbuild 0.14.1 OCamlbuild is a build system with builtin rules to easily build most OCaml projects # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://github.com/coq-contribs/lambda&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/Lambda&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.9&quot; &amp; &lt; &quot;8.10~&quot;} ] tags: [ &quot;keyword: pure lambda-calculus&quot; &quot;keyword: confluence&quot; &quot;keyword: parallel-moves lemma&quot; &quot;keyword: Lévy&#39;s Cube Lemma&quot; &quot;keyword: Church-Rosser&quot; &quot;keyword: residual&quot; &quot;keyword: Prism theorem&quot; &quot;category: Computer Science/Lambda Calculi&quot; ] authors: [ &quot;Gérard Huet&quot; ] bug-reports: &quot;https://github.com/coq-contribs/lambda/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/lambda.git&quot; synopsis: &quot;Residual Theory in Lambda-Calculus&quot; description: &quot;&quot;&quot; We present the complete development in Gallina of the residual theory of beta-reduction in pure lambda-calculus. The main result is the Prism Theorem, and its corollary Lévy&#39;s Cube Lemma, a strong form of the parallel-moves lemma, itself a key step towards the confluence theorem and its usual corollaries (Church-Rosser, uniqueness of normal forms).&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/lambda/archive/v8.9.0.tar.gz&quot; checksum: &quot;md5=04315a5378f4bee939f34a07a19c6b5c&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-lambda.8.9.0 coq.8.5.2~camlp4</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.5.2~camlp4). The following dependencies couldn&#39;t be met: - coq-lambda -&gt; coq &gt;= 8.9 Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></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>opam remove -y coq; opam install -y --show-action --unlock-base coq-lambda.8.9.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</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": "5241663c2ed1832734855f9c5e23fd55", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 159, "avg_line_length": 40.96666666666667, "alnum_prop": 0.5576349335503119, "repo_name": "coq-bench/coq-bench.github.io", "id": "0016b70f199896ad70ecc8fe83cfb4b1e5d886c1", "size": "7402", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.05.0-2.0.1/released/8.5.2~camlp4/lambda/8.9.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
require 'delayed/command' class AdminsController < ApplicationController include CommonSweepers RESTART_MSG = "Your settings have been updated. If you changed some settings e.g. search, you need to restart some processes. Please see the buttons and explanations below." before_filter :login_required before_filter :is_user_admin_auth def show respond_to do |format| format.html end end def update_admins admin_ids = params[:admins] || [] current_admins = Person.admins admins = admin_ids.collect{|id| Person.find(id)} current_admins.each{|ca| ca.is_admin = false} admins.each{|a| a.is_admin = true} (admins | current_admins).each do |admin| admin.save! end redirect_to :action=>:show end def registration_form respond_to do |format| format.html end end def tags @tags=TextValue.all_tags.sort_by{|t| t.text} end def update_features_enabled Seek::Config.public_seek_enabled= string_to_boolean(params[:public_seek_enabled] || true) Seek::Config.events_enabled= string_to_boolean params[:events_enabled] Seek::Config.jerm_enabled= string_to_boolean params[:jerm_enabled] Seek::Config.email_enabled= string_to_boolean params[:email_enabled] Seek::Config.pdf_conversion_enabled= string_to_boolean params[:pdf_conversion_enabled] Seek::Config.forum_enabled= string_to_boolean params[:forum_enabled] Seek::Config.set_smtp_settings 'address', params[:address] Seek::Config.set_smtp_settings 'domain', params[:domain] Seek::Config.set_smtp_settings 'authentication', params[:authentication] Seek::Config.set_smtp_settings 'user_name', params[:user_name] Seek::Config.set_smtp_settings 'password', params[:password] Seek::Config.set_smtp_settings 'enable_starttls_auto',params[:enable_starttls_auto]=="1" Seek::Config.support_email_address= params[:support_email_address] Seek::Config.solr_enabled= string_to_boolean params[:solr_enabled] Seek::Config.jws_enabled= string_to_boolean params[:jws_enabled] Seek::Config.jws_online_root= params[:jws_online_root] Seek::Config.exception_notification_recipients = params[:exception_notification_recipients] Seek::Config.exception_notification_enabled = string_to_boolean params[:exception_notification_enabled] Seek::Config.hide_details_enabled= string_to_boolean params[:hide_details_enabled] Seek::Config.activation_required_enabled= string_to_boolean params[:activation_required_enabled] Seek::Config.google_analytics_tracker_id= params[:google_analytics_tracker_id] Seek::Config.google_analytics_enabled= string_to_boolean params[:google_analytics_enabled] Seek::Config.piwik_analytics_enabled= string_to_boolean params[:piwik_analytics_enabled] Seek::Config.piwik_analytics_id_site= params[:piwik_analytics_id_site] Seek::Config.piwik_analytics_url= params[:piwik_analytics_url] Seek::Config.set_smtp_settings 'port', params[:port] if only_integer params[:port], 'port' Seek::Util.clear_cached update_redirect_to (only_integer params[:port], "port"),'features_enabled' end def update_home_settings Seek::Config.project_news_enabled= string_to_boolean params[:project_news_enabled] Seek::Config.project_news_feed_urls= params[:project_news_feed_urls] Seek::Config.project_news_number_of_entries= params[:project_news_number_of_entries] if only_integer params[:project_news_number_of_entries], "#{t('project')} news items" Seek::Config.community_news_enabled= string_to_boolean params[:community_news_enabled] Seek::Config.community_news_feed_urls= params[:community_news_feed_urls] Seek::Config.community_news_number_of_entries= params[:community_news_number_of_entries] if only_integer params[:community_news_number_of_entries], "community news items" Seek::Config.home_description = params[:home_description] begin Seek::FeedReader.clear_cache rescue e logger.error "Error whilst attempting to clear feed cache #{e.message}" end update_redirect_to true,'home_settings' end def rebrand respond_to do |format| format.html end end def update_rebrand Seek::Config.project_name= params[:project_name] Seek::Config.project_type= params[:project_type] Seek::Config.project_link= params[:project_link] Seek::Config.project_title= params[:project_title] Seek::Config.project_long_name= params[:project_long_name] Seek::Config.dm_project_name= params[:dm_project_name] Seek::Config.dm_project_title= params[:dm_project_title] Seek::Config.dm_project_link= params[:dm_project_link] Seek::Config.application_name= params[:application_name] Seek::Config.application_title= params[:application_title] Seek::Config.header_image_enabled= string_to_boolean params[:header_image_enabled] Seek::Config.header_image= params[:header_image] Seek::Config.header_image_link= params[:header_image_link] Seek::Config.header_image_title= params[:header_image_title] Seek::Config.copyright_addendum_enabled= string_to_boolean params[:copyright_addendum_enabled] Seek::Config.copyright_addendum_content= params[:copyright_addendum_content] Seek::Config.noreply_sender= params[:noreply_sender] update_redirect_to true,'rebrand' end def update_pagination update_flag = true Seek::Config.set_default_page "people",params[:people] Seek::Config.set_default_page "projects", params[:projects] Seek::Config.set_default_page "institutions", params[:institutions] Seek::Config.set_default_page "investigations", params[:investigations] Seek::Config.set_default_page "studies", params[:studies] Seek::Config.set_default_page "assays", params[:assays] Seek::Config.set_default_page "data_files", params[:data_files] Seek::Config.set_default_page "models", params[:models] Seek::Config.set_default_page "sops", params[:sops] Seek::Config.set_default_page "publications", params[:publications] Seek::Config.set_default_page "presentations", params[:presentations] Seek::Config.set_default_page "events", params[:events] Seek::Config.limit_latest= params[:limit_latest] if only_positive_integer params[:limit_latest], "latest limit" update_redirect_to (only_positive_integer params[:limit_latest], 'latest limit'),'pagination' end def update_others update_flag = true if Seek::Config.tag_threshold.to_s != params[:tag_threshold] || Seek::Config.max_visible_tags.to_s!=params[:max_visible_tags] expire_annotation_fragments end Seek::Config.site_base_host = params[:site_base_host] unless params[:site_base_host].nil? #check valid email Seek::Config.pubmed_api_email = params[:pubmed_api_email] if params[:pubmed_api_email] == '' || (check_valid_email params[:pubmed_api_email], "pubmed api email") Seek::Config.crossref_api_email = params[:crossref_api_email] if params[:crossref_api_email] == '' || (check_valid_email params[:crossref_api_email], "crossref api email") Seek::Config.bioportal_api_key = params[:bioportal_api_key] Seek::Config.tag_threshold = params[:tag_threshold] if only_integer params[:tag_threshold], "tag threshold" Seek::Config.max_visible_tags = params[:max_visible_tags] if only_positive_integer params[:max_visible_tags], "maximum visible tags" Seek::Config.sabiork_ws_base_url = params[:sabiork_ws_base_url] unless params[:sabiork_ws_base_url].nil? update_flag = (params[:pubmed_api_email] == '' ||(check_valid_email params[:pubmed_api_email], "pubmed api email")) && (params[:crossref_api_email] == '' || (check_valid_email params[:crossref_api_email], "crossref api email")) && (only_integer params[:tag_threshold], "tag threshold") && (only_positive_integer params[:max_visible_tags], "maximum visible tags") update_redirect_to update_flag,'others' end def restart_server command = "touch #{Rails.root}/tmp/restart.txt" error = execute_command(command) redirect_with_status(error, 'server') end def restart_delayed_job error = nil if Rails.env!="test" begin Seek::Workers.restart #give it up to 5 seconds to start up, otherwise the page reloads too quickly and says it is not running sleep(0.5) pid = Daemons::PidFile.new("#{Rails.root}/tmp/pids","delayed_job.0") x=0 while !pid.running? && (x<10) sleep(0.5) x+=1 end rescue Exception=>e error=e.message end end redirect_with_status(error, 'background tasks') end def edit_tag if request.post? @tag=TextValue.find(params[:id]) replacement_tags = [] params[:tags_autocompleter_selected_ids].each do |selected_id| replacement_tags << TextValue.find(selected_id) end unless params[:tags_autocompleter_selected_ids].nil? params[:tags_autocompleter_unrecognized_items].select{|t| !t.blank?}.each do |item| tag = TextValue.find_by_text(item) tag = TextValue.create :text=>item if tag.nil? replacement_tags << tag end unless params[:tags_autocompleter_unrecognized_items].nil? @tag.annotations.each do |a| annotatable = a.annotatable source = a.source attribute_name = a.attribute.name a.destroy unless replacement_tags.include?(@tag) replacement_tags.each do |tag| if annotatable.annotations_with_attribute_and_by_source(attribute_name, source).select{|a| a.value == tag}.blank? new_annotation = Annotation.new :attribute_name=>attribute_name, :value=>tag, :annotatable => annotatable, :source => source new_annotation.save! end end end @tag=TextValue.find(params[:id]) @tag.destroy if @tag.annotations.blank? expire_annotation_fragments redirect_to :action=>:tags else @tag=TextValue.find(params[:id]) @all_tags_as_json=TextValue.all.collect{|t| {'id'=>t.id, 'name'=>h(t.text)}}.to_json respond_to do |format| format.html end end end def delete_tag tag=TextValue.find(params[:id]) if request.post? tag.annotations.each do |a| a.destroy end tag.destroy flash.now[:notice]="Tag #{tag.text} deleted" else flash.now[:error]="Must be a post" end expire_annotation_fragments redirect_to :action=>:tags end def get_stats collection = [] type = nil title = nil @page=params[:id] case @page when "pals" title = "PALs" collection = Person.pals type = "users" when "admins" title = "Administrators" collection = Person.admins type = "users" when "invalid" collection = {} type = "invalid_users" pal_role=ProjectRole.pal_role collection[:pal_mismatch] = Person.all.select {|p| p.is_pal? != p.project_roles.include?(pal_role)} collection[:duplicates] = Person.duplicates collection[:no_person] = User.without_profile when "not_activated" title = "Users requiring activation" collection = User.not_activated type = "users" when "projectless" title = "Users not in a #{Seek::Config.project_name} #{t('project')}" collection = Person.without_group.registered type = "users" when "contents" type = "content_stats" when "activity" type = "activity_stats" when "search" type = "search_stats" when "job_queue" type = "job_queue" when "auth_consistency" type = "auth_consistency" when "monthly_stats" monthly_stats = get_monthly_stats type = "monthly_statistics" when "workflow_stats" type = "workflow_stats" when "none" type = "none" end respond_to do |format| case type when "invalid_users" format.html { render :partial => "admins/invalid_user_stats_list", :locals => { :collection => collection} } when "users" format.html { render :partial => "admins/user_stats_list", :locals => { :title => title, :collection => collection} } when "content_stats" format.html { render :partial => "admins/content_stats", :locals => {:stats => Seek::ContentStats.generate} } when "activity_stats" format.html { render :partial => "admins/activity_stats", :locals => {:stats => Seek::ActivityStats.new} } when "search_stats" format.html { render :partial => "admins/search_stats", :locals => {:stats => Seek::SearchStats.new} } when "job_queue" format.html { render :partial => "admins/job_queue" } when "auth_consistency" format.html { render :partial => "admins/auth_consistency" } when "monthly_statistics" format.html { render :partial => "admins/monthly_statistics", :locals => {:stats => monthly_stats}} when "workflow_stats" format.html { render :partial => "admins/workflow_stats" } when "none" format.html { render :text=>"" } end end end def get_monthly_stats first_month = User.all.sort_by(&:created_at).first.created_at number_of_months_since_first = (Date.today.year * 12 + Date.today.month) - (first_month.year * 12 + first_month.month) stats = {} (0..number_of_months_since_first).each do |x| time_range = (x.month.ago.beginning_of_month.to_date..x.month.ago.end_of_month.to_date) registrations = User.where(:created_at => time_range).count active_users = 0 User.all.each do |user| active_users = active_users + 1 unless user.taverna_player_runs.where(:created_at => time_range, :saved_state => "finished").empty? end complete_runs = TavernaPlayer::Run.where(:created_at => time_range, :saved_state => "finished").count stats[x.month.ago.beginning_of_month.to_i] = [registrations, active_users, complete_runs] end return stats end def test_email_configuration smtp_hash_old = ActionMailer::Base.smtp_settings smtp_hash_new = {:address => params[:address], :enable_starttls_auto => params[:enable_starttls_auto]=="1", :domain => params[:domain], :authentication => params[:authentication], :user_name => (params[:user_name].blank? ? nil : params[:user_name]), :password => (params[:password].blank? ? nil : params[:password])} smtp_hash_new[:port] = params[:port] if only_integer params[:port], 'port' ActionMailer::Base.smtp_settings = smtp_hash_new raise_delivery_errors_setting = ActionMailer::Base.raise_delivery_errors ActionMailer::Base.raise_delivery_errors = true begin Mailer.test_email(params[:testing_email]).deliver render :update do |page| page.replace_html "ajax_loader_position", "<div id='ajax_loader_position'></div>" page.alert("test email is sent successfully to #{params[:testing_email]}") end rescue Exception => e render :update do |page| page.replace_html "ajax_loader_position", "<div id='ajax_loader_position'></div>" page.alert("Fail to send test email, #{e.message}") end ensure ActionMailer::Base.smtp_settings = smtp_hash_old ActionMailer::Base.raise_delivery_errors = raise_delivery_errors_setting end end private def created_at_data_for_model model x={} start="1 Nov 2008" x[Date.parse(start).jd]=0 x[Date.today.jd]=0 model.order(:created_at).each do |i| date=i.created_at.to_date day=date.jd x[day] ||= 0 x[day]+=1 end sorted_keys=x.keys.sort (sorted_keys.first..sorted_keys.last).collect{|i| x[i].nil? ? 0 : x[i] } end def check_valid_email email_address, field if email_address =~ /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/ return true else flash[:error] = "Please input the correct #{field}" return false end end def only_integer input, field begin Integer(input) return true rescue flash[:error] = "Please enter a valid number for the #{field}" return false end end def only_positive_integer input, field begin if Integer(input) > 0 return true else flash[:error] = "Please enter a valid positive number for the #{field}" return false end rescue flash[:error] = "Please enter a valid positive number for the #{field}" return false end end def string_to_boolean string if string == '1' return true else return false end end def update_redirect_to flag, action if flag flash[:notice] = RESTART_MSG expire_header_and_footer redirect_to :action=>:show else redirect_to :action=> action.to_s end end def execute_command(command) return nil if Rails.env=="test" begin cl = Cocaine::CommandLine.new(command) cl.run return nil rescue Cocaine::CommandNotFoundError => e return "The command the restart the background tasks could not be found!" rescue Exception => e error = e.message return error end end def redirect_with_status(error, process) if error.blank? flash[:notice] = "The #{process} was restarted" else flash[:error] = "There is a problem with restarting the #{process}. #{error.gsub("Cocaine::", "")}" end redirect_to :action=>:show end end
{ "content_hash": "3e7302b8b3da65a97354700352aa0bb0", "timestamp": "", "source": "github", "line_count": 465, "max_line_length": 366, "avg_line_length": 37.93118279569892, "alnum_prop": 0.6599387685678648, "repo_name": "BioVeL/seek", "id": "ec6137656b368ab4c25ba4a6f55e467cd602b18a", "size": "17638", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/controllers/admins_controller.rb", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "26547" }, { "name": "HTML", "bytes": "1156434" }, { "name": "JavaScript", "bytes": "258441" }, { "name": "Ruby", "bytes": "2667969" }, { "name": "Shell", "bytes": "2299" }, { "name": "Web Ontology Language", "bytes": "297214" }, { "name": "XSLT", "bytes": "22416" } ], "symlink_target": "" }
<?php require_once ABSPATH . 'wp-admin/includes/upgrade.php'; if ( ! class_exists( 'Hustle_Db' ) ) : /** * Class Hustle_Db * * Takes care of all the db initializations * */ class Hustle_Db { const DB_VERSION_KEY = 'hustle_database_version'; const TABLE_HUSTLE_MODULES = 'hustle_modules'; const TABLE_HUSTLE_MODULES_META = 'hustle_modules_meta'; /** * Last version where the db was updated. * Change this if you want the 'create tables' function and migration (if conditions are met) to run. * * @since 4.0 */ const DB_VERSION = '4.0'; /** * Store module's entries. * * @since 4.0 */ const TABLE_HUSTLE_ENTRIES = 'hustle_entries'; /** * Store module's entries' meta. * * @since 4.0 */ const TABLE_HUSTLE_ENTRIES_META = 'hustle_entries_meta'; /** * Store module's views and conversions. * * @since 4.0 */ const TABLE_HUSTLE_TRACKING = 'hustle_tracking'; /** * Current tables. * * @since 4.0 */ private static $tables = array(); public static $db; /** * Check whether the db is up to date. * * @since 4.0 * @return boolean */ public static function is_db_up_to_date() { $stored_db_version = get_option( self::DB_VERSION_KEY, false ); // check if current version is equal to database version if ( version_compare( $stored_db_version, self::DB_VERSION, '=' ) ) { return true; } return false; } /** * Creates plugin tables * * @since 1.0.0 */ public static function maybe_create_tables( $force = false ) { if ( ! $force && self::is_db_up_to_date() ) { return; } $hustle_db = new self(); foreach ( $hustle_db->_get_tables() as $name => $columns ) { $sql = $hustle_db->_create_table_sql( $name, $columns ); $result = dbDelta( $sql ); } update_option( self::DB_VERSION_KEY, self::DB_VERSION ); } /** * Generates CREATE TABLE sql script for provided table name and columns list. * * @since 1.0.0 * * @access private * @param string $name The name of a table. * @param array $columns The array of columns, indexes, constraints. * @return string The sql script for table creation. */ private function _create_table_sql( $name, array $columns ) { global $wpdb; $charset = ''; if ( ! empty( $wpdb->charset ) ) { $charset = 'DEFAULT CHARACTER SET ' . $wpdb->charset; } $collate = ''; if ( ! empty( $wpdb->collate ) ) { $collate .= ' COLLATE ' . $wpdb->collate; } $name = $wpdb->prefix . $name; return sprintf( 'CREATE TABLE %s (%s%s%s)%s%s', $name, PHP_EOL, implode( ','.PHP_EOL, $columns ), PHP_EOL, $charset, $collate ); } /** * Returns "module_meta" table array with their "Create syntax" * * @since 4.0.0 * @since 4.0 'module_mode' added. 'test_mode' removed. * * @return array */ public static function get_table_modules() { return array( 'module_id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT', "blog_id bigint(20) UNSIGNED NOT NULL DEFAULT '0'", 'module_name varchar(255) NOT NULL', 'module_type varchar(100) NOT NULL', 'active tinyint DEFAULT 1', 'module_mode varchar(100) NOT NULL', 'PRIMARY KEY (module_id)', 'KEY active (active)', ); } /** * Returns "module_meta" table array with their "Create syntax" * * @since 4.0.0 * @since 4.0 'module_mode' added. 'test_mode' removed. * * @return array */ public static function get_table_modules_meta() { global $wpdb; $collate = ''; if ( ! empty( $wpdb->collate ) ) { $collate .= ' COLLATE ' . $wpdb->collate; } return array( 'meta_id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT', "module_id bigint(20) UNSIGNED NOT NULL DEFAULT '0'", 'meta_key varchar(191) ' . $collate . ' DEFAULT NULL', 'meta_value longtext ' . $collate, 'PRIMARY KEY (meta_id)', 'KEY module_id (module_id)', 'KEY meta_key (meta_key(191))', ); } /** * Returns db table arrays with their "Create syntax" * * @since 1.0.0 * @since 4.0 'module_mode' added. 'test_mode' removed. * * @return array */ private function _get_tables() { global $wpdb; return array( self::TABLE_HUSTLE_MODULES => self::get_table_modules(), self::TABLE_HUSTLE_MODULES_META => self::get_table_modules_meta(), self::TABLE_HUSTLE_ENTRIES => array( 'entry_id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT', 'entry_type varchar(191) NOT NULL', 'module_id bigint(20) UNSIGNED NOT NULL', "date_created datetime NOT NULL default '0000-00-00 00:00:00'", 'PRIMARY KEY (entry_id)', 'KEY entry_type (entry_type(191))', 'KEY entry_module_id (module_id)', ), self::TABLE_HUSTLE_ENTRIES_META => array( 'meta_id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT', 'entry_id bigint(20) UNSIGNED NOT NULL', 'meta_key varchar(191) DEFAULT NULL', 'meta_value longtext NULL', "date_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00'", "date_updated datetime NOT NULL DEFAULT '0000-00-00 00:00:00'", 'PRIMARY KEY (meta_id)', 'KEY meta_key (meta_key(191))', 'KEY meta_entry_id (entry_id ASC )', 'KEY meta_key_object (entry_id ASC, meta_key ASC)', ), self::TABLE_HUSTLE_TRACKING => array( 'tracking_id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT', 'module_id bigint(20) UNSIGNED NOT NULL', 'page_id bigint(20) UNSIGNED NOT NULL', 'module_type varchar(100) NOT NULL', 'action varchar(100) NOT NULL', 'ip varchar(191) DEFAULT NULL', 'counter mediumint(8) UNSIGNED NOT NULL DEFAULT 1', "date_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00'", "date_updated datetime NOT NULL DEFAULT '0000-00-00 00:00:00'", 'PRIMARY KEY (tracking_id)', 'KEY tracking_module_id (module_id ASC )', 'KEY action (action(100))', 'KEY tracking_module_object (action ASC, module_id ASC, module_type ASC)', 'KEY tracking_module_object_ip (module_id ASC, tracking_id ASC, ip ASC)', ), ); } /** * Add $wpdb prefix to table name * * @since 4.0 * @global object $wpdb * @param string $table * @return string */ private static function add_prefix( $table ) { global $wpdb; return $wpdb->prefix . $table; } /** * Get modules table name * * @since 4.0 * @return string */ public static function modules_table() { return self::add_prefix( self::TABLE_HUSTLE_MODULES ); } /** * Get modules meta table name * * @since 4.0 * @return string */ public static function modules_meta_table() { return self::add_prefix( self::TABLE_HUSTLE_MODULES_META ); } /** * Get entries table name * * @since 4.0 * @return string */ public static function entries_table() { return self::add_prefix( self::TABLE_HUSTLE_ENTRIES ); } /** * Get entries meta table name * * @since 4.0 * @return string */ public static function entries_meta_table() { return self::add_prefix( self::TABLE_HUSTLE_ENTRIES_META ); } /** * Get tracking table name * * @since 4.0 * @return string */ public static function tracking_table() { return self::add_prefix( self::TABLE_HUSTLE_TRACKING ); } } endif;
{ "content_hash": "4376f3307ca48da83a4b9700ad761f76", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 103, "avg_line_length": 25.359861591695502, "alnum_prop": 0.6049938600081867, "repo_name": "mandino/nu", "id": "a76d508267d1e5d6645a211d921ca3e976ce214b", "size": "7329", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "wp-content/plugins/hustle/inc/hustle-db.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2534865" }, { "name": "HTML", "bytes": "131438" }, { "name": "JavaScript", "bytes": "3766596" }, { "name": "Modelica", "bytes": "10338" }, { "name": "PHP", "bytes": "19289064" }, { "name": "Perl", "bytes": "2554" }, { "name": "Shell", "bytes": "1145" } ], "symlink_target": "" }
var redis = require('../redis'); var offsets = { 1: 0, 2: 0 }; function fetchOffset(motorId){ redis.get('motorpos:'+motorId, function(err, result){ if(err){ console.error(err.stack||err); }else{ offsets[motorId] = result ? parseInt(result) : 0; } }); } Object.keys(offsets).forEach(fetchOffset); exports.get = function getOffset(motorId){ return offsets[motorId]; }; exports.set = function setOffset(motorId, offset){ offsets[motorId] = offset; redis.set('motorpos:'+motorId, offset, function(err){ if(err){ console.error(err.stack||err); } }); };
{ "content_hash": "a9ba541be3391a61d17f25389fe17a5d", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 54, "avg_line_length": 18.677419354838708, "alnum_prop": 0.6632124352331606, "repo_name": "fgascon/hpclock", "id": "60ec80caa88f887c92603f7b0a243569e80bfc57", "size": "579", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/motors/offsets.js", "mode": "33188", "license": "mit", "language": [ { "name": "Arduino", "bytes": "1502" }, { "name": "JavaScript", "bytes": "4302" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra"> <info organisation="org.scala-sbt" module="control_2.11" revision="0.13.8" status="release" publication="20150320121203"> <description> Control </description> </info> <configurations> <conf name="compile" visibility="public" description=""/> <conf name="runtime" visibility="public" description="" extends="compile"/> <conf name="test" visibility="public" description="" extends="runtime"/> <conf name="provided" visibility="public" description=""/> <conf name="optional" visibility="public" description=""/> <conf name="sources" visibility="public" description=""/> <conf name="docs" visibility="public" description=""/> <conf name="pom" visibility="public" description=""/> </configurations> <publications> <artifact name="control_2.11" type="jar" ext="jar" conf="compile"/> <artifact name="control_2.11" type="src" ext="jar" conf="sources" e:classifier="sources"/> </publications> <dependencies> <dependency org="org.scala-lang" name="scala-library" rev="2.11.1" conf="compile->default(compile)"/> </dependencies> </ivy-module>
{ "content_hash": "8a0c8533dc20d1a6da5d7b5c0eee35cb", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 122, "avg_line_length": 38.483870967741936, "alnum_prop": 0.6890192791282481, "repo_name": "nguquen/openshift-cartridge-activator-jdk8", "id": "6592d8f27744c46944e572eb6bf138128fd9e99c", "size": "1193", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "usr/1.3.6/repository/org.scala-sbt/control_2.11/0.13.8/ivys/ivy.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "7342" }, { "name": "CSS", "bytes": "2019" }, { "name": "CoffeeScript", "bytes": "3771" }, { "name": "HTML", "bytes": "80567" }, { "name": "Java", "bytes": "17599" }, { "name": "JavaScript", "bytes": "264" }, { "name": "Scala", "bytes": "39320" }, { "name": "Shell", "bytes": "11203" } ], "symlink_target": "" }
from django.conf import settings from django.template import Template from cmsplugin_wrapper.models import WrapperPlugin varname = getattr(settings, 'CMSPLUGIN_WRAPPER_VARNAME', 'CMSPLUGIN_WRAPPER_HOLDER') def wrap_plugin(instance, placeholder, rendered_content, original_context): wrap_holder = original_context[varname] if isinstance(instance, WrapperPlugin): wrap_info = { 'wrapper_plugin': instance, 'context': original_context, 'plugins': [], 'plugin_counter': 0 } wrap_holder['at_index'] = wrap_holder['at_index'] and wrap_holder['at_index'] + 1 or 0 wrap_holder['index'].append(wrap_info) elif wrap_holder['at_index'] is not None and not (instance._render_meta.text_enabled and instance.parent): wrap_info = wrap_holder['index'][wrap_holder['at_index']] wrap_info['plugin_counter'] = wrap_info['plugin_counter'] + 1 wrap_info['plugins'].append((instance, rendered_content)) if wrap_info['plugin_counter'] == wrap_info['wrapper_plugin'].number or \ wrap_info['plugin_counter'] == instance._render_meta.total: template = Template(wrap_info['wrapper_plugin'].template) context = wrap_info['context'] context['plugins'] = wrap_info['plugins'] wrap_holder['index'].pop() wrap_holder['at_index'] = wrap_holder['at_index'] == 0 and None or wrap_holder['at_index'] - 1 return template.render(context) return u' '
{ "content_hash": "2c150da022bb5d2cc31195d8a5d7ff54", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 110, "avg_line_length": 44.02777777777778, "alnum_prop": 0.6138801261829653, "repo_name": "django-cms-plugins/cmsplugin-wrapper", "id": "a311d361c26bcee5e3a319049eec68cf96b0521f", "size": "1585", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cmsplugin_wrapper/plugin_processors.py", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
namespace bp = boost::python; struct PrimitiveRestartIndex_wrapper : osg::PrimitiveRestartIndex, bp::wrapper< osg::PrimitiveRestartIndex > { struct Extensions_wrapper : osg::PrimitiveRestartIndex::Extensions, bp::wrapper< osg::PrimitiveRestartIndex::Extensions > { Extensions_wrapper(unsigned int contextID ) : osg::PrimitiveRestartIndex::Extensions( contextID ) , bp::wrapper< osg::PrimitiveRestartIndex::Extensions >(){ // constructor } static void lowestCommonDenominator( ::osg::PrimitiveRestartIndex::Extensions & inst, ::osg::PrimitiveRestartIndex::Extensions & rhs ){ inst.lowestCommonDenominator(rhs); } virtual void setThreadSafeRefUnref( bool threadSafe ) { if( bp::override func_setThreadSafeRefUnref = this->get_override( "setThreadSafeRefUnref" ) ) func_setThreadSafeRefUnref( threadSafe ); else{ this->osg::Referenced::setThreadSafeRefUnref( threadSafe ); } } void default_setThreadSafeRefUnref( bool threadSafe ) { osg::Referenced::setThreadSafeRefUnref( threadSafe ); } }; PrimitiveRestartIndex_wrapper( ) : osg::PrimitiveRestartIndex( ) , bp::wrapper< osg::PrimitiveRestartIndex >(){ // null constructor } PrimitiveRestartIndex_wrapper(unsigned int restartIndex ) : osg::PrimitiveRestartIndex( restartIndex ) , bp::wrapper< osg::PrimitiveRestartIndex >(){ // constructor } virtual void apply( ::osg::State & state ) const { if( bp::override func_apply = this->get_override( "apply" ) ) func_apply( boost::ref(state) ); else{ this->osg::PrimitiveRestartIndex::apply( boost::ref(state) ); } } void default_apply( ::osg::State & state ) const { osg::PrimitiveRestartIndex::apply( boost::ref(state) ); } virtual char const * className( ) const { if( bp::override func_className = this->get_override( "className" ) ) return func_className( ); else{ return this->osg::PrimitiveRestartIndex::className( ); } } char const * default_className( ) const { return osg::PrimitiveRestartIndex::className( ); } virtual ::osg::Object * clone( ::osg::CopyOp const & copyop ) const { if( bp::override func_clone = this->get_override( "clone" ) ) return func_clone( boost::ref(copyop) ); else{ return this->osg::PrimitiveRestartIndex::clone( boost::ref(copyop) ); } } ::osg::Object * default_clone( ::osg::CopyOp const & copyop ) const { return osg::PrimitiveRestartIndex::clone( boost::ref(copyop) ); } virtual ::osg::Object * cloneType( ) const { if( bp::override func_cloneType = this->get_override( "cloneType" ) ) return func_cloneType( ); else{ return this->osg::PrimitiveRestartIndex::cloneType( ); } } ::osg::Object * default_cloneType( ) const { return osg::PrimitiveRestartIndex::cloneType( ); } virtual ::osg::StateAttribute::Type getType( ) const { if( bp::override func_getType = this->get_override( "getType" ) ) return func_getType( ); else{ return this->osg::PrimitiveRestartIndex::getType( ); } } ::osg::StateAttribute::Type default_getType( ) const { return osg::PrimitiveRestartIndex::getType( ); } virtual bool isSameKindAs( ::osg::Object const * obj ) const { if( bp::override func_isSameKindAs = this->get_override( "isSameKindAs" ) ) return func_isSameKindAs( boost::python::ptr(obj) ); else{ return this->osg::PrimitiveRestartIndex::isSameKindAs( boost::python::ptr(obj) ); } } bool default_isSameKindAs( ::osg::Object const * obj ) const { return osg::PrimitiveRestartIndex::isSameKindAs( boost::python::ptr(obj) ); } virtual char const * libraryName( ) const { if( bp::override func_libraryName = this->get_override( "libraryName" ) ) return func_libraryName( ); else{ return this->osg::PrimitiveRestartIndex::libraryName( ); } } char const * default_libraryName( ) const { return osg::PrimitiveRestartIndex::libraryName( ); } virtual ::osg::Texture * asTexture( ) { if( bp::override func_asTexture = this->get_override( "asTexture" ) ) return func_asTexture( ); else{ return this->osg::StateAttribute::asTexture( ); } } ::osg::Texture * default_asTexture( ) { return osg::StateAttribute::asTexture( ); } virtual ::osg::Texture const * asTexture( ) const { if( bp::override func_asTexture = this->get_override( "asTexture" ) ) return func_asTexture( ); else{ return this->osg::StateAttribute::asTexture( ); } } ::osg::Texture const * default_asTexture( ) const { return osg::StateAttribute::asTexture( ); } virtual bool checkValidityOfAssociatedModes( ::osg::State & arg0 ) const { if( bp::override func_checkValidityOfAssociatedModes = this->get_override( "checkValidityOfAssociatedModes" ) ) return func_checkValidityOfAssociatedModes( boost::ref(arg0) ); else{ return this->osg::StateAttribute::checkValidityOfAssociatedModes( boost::ref(arg0) ); } } bool default_checkValidityOfAssociatedModes( ::osg::State & arg0 ) const { return osg::StateAttribute::checkValidityOfAssociatedModes( boost::ref(arg0) ); } virtual void compileGLObjects( ::osg::State & arg0 ) const { if( bp::override func_compileGLObjects = this->get_override( "compileGLObjects" ) ) func_compileGLObjects( boost::ref(arg0) ); else{ this->osg::StateAttribute::compileGLObjects( boost::ref(arg0) ); } } void default_compileGLObjects( ::osg::State & arg0 ) const { osg::StateAttribute::compileGLObjects( boost::ref(arg0) ); } virtual void computeDataVariance( ) { if( bp::override func_computeDataVariance = this->get_override( "computeDataVariance" ) ) func_computeDataVariance( ); else{ this->osg::Object::computeDataVariance( ); } } void default_computeDataVariance( ) { osg::Object::computeDataVariance( ); } virtual unsigned int getMember( ) const { if( bp::override func_getMember = this->get_override( "getMember" ) ) return func_getMember( ); else{ return this->osg::StateAttribute::getMember( ); } } unsigned int default_getMember( ) const { return osg::StateAttribute::getMember( ); } virtual bool getModeUsage( ::osg::StateAttribute::ModeUsage & arg0 ) const { if( bp::override func_getModeUsage = this->get_override( "getModeUsage" ) ) return func_getModeUsage( boost::ref(arg0) ); else{ return this->osg::StateAttribute::getModeUsage( boost::ref(arg0) ); } } bool default_getModeUsage( ::osg::StateAttribute::ModeUsage & arg0 ) const { return osg::StateAttribute::getModeUsage( boost::ref(arg0) ); } virtual ::osg::Referenced * getUserData( ) { if( bp::override func_getUserData = this->get_override( "getUserData" ) ) return func_getUserData( ); else{ return this->osg::Object::getUserData( ); } } ::osg::Referenced * default_getUserData( ) { return osg::Object::getUserData( ); } virtual ::osg::Referenced const * getUserData( ) const { if( bp::override func_getUserData = this->get_override( "getUserData" ) ) return func_getUserData( ); else{ return this->osg::Object::getUserData( ); } } ::osg::Referenced const * default_getUserData( ) const { return osg::Object::getUserData( ); } virtual bool isTextureAttribute( ) const { if( bp::override func_isTextureAttribute = this->get_override( "isTextureAttribute" ) ) return func_isTextureAttribute( ); else{ return this->osg::StateAttribute::isTextureAttribute( ); } } bool default_isTextureAttribute( ) const { return osg::StateAttribute::isTextureAttribute( ); } virtual void resizeGLObjectBuffers( unsigned int arg0 ) { if( bp::override func_resizeGLObjectBuffers = this->get_override( "resizeGLObjectBuffers" ) ) func_resizeGLObjectBuffers( arg0 ); else{ this->osg::StateAttribute::resizeGLObjectBuffers( arg0 ); } } void default_resizeGLObjectBuffers( unsigned int arg0 ) { osg::StateAttribute::resizeGLObjectBuffers( arg0 ); } virtual void setName( ::std::string const & name ) { if( bp::override func_setName = this->get_override( "setName" ) ) func_setName( name ); else{ this->osg::Object::setName( name ); } } void default_setName( ::std::string const & name ) { osg::Object::setName( name ); } virtual void setThreadSafeRefUnref( bool threadSafe ) { if( bp::override func_setThreadSafeRefUnref = this->get_override( "setThreadSafeRefUnref" ) ) func_setThreadSafeRefUnref( threadSafe ); else{ this->osg::Object::setThreadSafeRefUnref( threadSafe ); } } void default_setThreadSafeRefUnref( bool threadSafe ) { osg::Object::setThreadSafeRefUnref( threadSafe ); } virtual void setUserData( ::osg::Referenced * obj ) { if( bp::override func_setUserData = this->get_override( "setUserData" ) ) func_setUserData( boost::python::ptr(obj) ); else{ this->osg::Object::setUserData( boost::python::ptr(obj) ); } } void default_setUserData( ::osg::Referenced * obj ) { osg::Object::setUserData( boost::python::ptr(obj) ); } }; void register_PrimitiveRestartIndex_class(){ { //::osg::PrimitiveRestartIndex typedef bp::class_< PrimitiveRestartIndex_wrapper, bp::bases< osg::StateAttribute >, osg::ref_ptr< ::osg::PrimitiveRestartIndex >, boost::noncopyable > PrimitiveRestartIndex_exposer_t; PrimitiveRestartIndex_exposer_t PrimitiveRestartIndex_exposer = PrimitiveRestartIndex_exposer_t( "PrimitiveRestartIndex", "\n osg::PrimitiveRestartIndex does nothing if OpenGL 3.1 is not available.\n", bp::no_init ); bp::scope PrimitiveRestartIndex_scope( PrimitiveRestartIndex_exposer ); { //::osg::PrimitiveRestartIndex::Extensions typedef bp::class_< PrimitiveRestartIndex_wrapper::Extensions_wrapper, bp::bases< osg::Referenced >, osg::ref_ptr< ::osg::PrimitiveRestartIndex::Extensions > > Extensions_exposer_t; Extensions_exposer_t Extensions_exposer = Extensions_exposer_t( "Extensions", "\n Extensions class which encapsulates the querying of extensions and\n associated function pointers, and provide convenience wrappers to\n check for the extensions or use the associated functions.\n", bp::no_init ); bp::scope Extensions_scope( Extensions_exposer ); Extensions_exposer.def( bp::init< unsigned int >(( bp::arg("contextID") ), "\n Extensions class which encapsulates the querying of extensions and\n associated function pointers, and provide convenience wrappers to\n check for the extensions or use the associated functions.\n") ); bp::implicitly_convertible< unsigned int, osg::PrimitiveRestartIndex::Extensions >(); { //::osg::PrimitiveRestartIndex::Extensions::glPrimitiveRestartIndex typedef void ( ::osg::PrimitiveRestartIndex::Extensions::*glPrimitiveRestartIndex_function_type)( ::GLuint ) const; Extensions_exposer.def( "glPrimitiveRestartIndex" , glPrimitiveRestartIndex_function_type( &::osg::PrimitiveRestartIndex::Extensions::glPrimitiveRestartIndex ) , ( bp::arg("index") ) ); } { //::osg::PrimitiveRestartIndex::Extensions::isOpenGL31Supported typedef bool ( ::osg::PrimitiveRestartIndex::Extensions::*isOpenGL31Supported_function_type)( ) const; Extensions_exposer.def( "isOpenGL31Supported" , isOpenGL31Supported_function_type( &::osg::PrimitiveRestartIndex::Extensions::isOpenGL31Supported ) ); } { //::osg::PrimitiveRestartIndex::Extensions::isPrimitiveRestartIndexNVSupported typedef bool ( ::osg::PrimitiveRestartIndex::Extensions::*isPrimitiveRestartIndexNVSupported_function_type)( ) const; Extensions_exposer.def( "isPrimitiveRestartIndexNVSupported" , isPrimitiveRestartIndexNVSupported_function_type( &::osg::PrimitiveRestartIndex::Extensions::isPrimitiveRestartIndexNVSupported ) ); } { //::osg::PrimitiveRestartIndex::Extensions::lowestCommonDenominator typedef void ( *lowestCommonDenominator_function_type )( ::osg::PrimitiveRestartIndex::Extensions &,::osg::PrimitiveRestartIndex::Extensions & ); Extensions_exposer.def( "lowestCommonDenominator" , lowestCommonDenominator_function_type( &PrimitiveRestartIndex_wrapper::Extensions_wrapper::lowestCommonDenominator ) , ( bp::arg("inst"), bp::arg("rhs") ) ); } { //::osg::PrimitiveRestartIndex::Extensions::setupGLExtensions typedef void ( ::osg::PrimitiveRestartIndex::Extensions::*setupGLExtensions_function_type)( unsigned int ) ; Extensions_exposer.def( "setupGLExtensions" , setupGLExtensions_function_type( &::osg::PrimitiveRestartIndex::Extensions::setupGLExtensions ) , ( bp::arg("contextID") ) ); } { //::osg::Referenced::setThreadSafeRefUnref typedef void ( ::osg::Referenced::*setThreadSafeRefUnref_function_type)( bool ) ; typedef void ( PrimitiveRestartIndex_wrapper::Extensions_wrapper::*default_setThreadSafeRefUnref_function_type)( bool ) ; Extensions_exposer.def( "setThreadSafeRefUnref" , setThreadSafeRefUnref_function_type(&::osg::Referenced::setThreadSafeRefUnref) , default_setThreadSafeRefUnref_function_type(&PrimitiveRestartIndex_wrapper::Extensions_wrapper::default_setThreadSafeRefUnref) , ( bp::arg("threadSafe") ) ); } } PrimitiveRestartIndex_exposer.def( bp::init< >("\n osg::PrimitiveRestartIndex does nothing if OpenGL 3.1 is not available.\n") ); PrimitiveRestartIndex_exposer.def( bp::init< unsigned int >(( bp::arg("restartIndex") )) ); bp::implicitly_convertible< unsigned int, osg::PrimitiveRestartIndex >(); { //::osg::PrimitiveRestartIndex::apply typedef void ( ::osg::PrimitiveRestartIndex::*apply_function_type)( ::osg::State & ) const; typedef void ( PrimitiveRestartIndex_wrapper::*default_apply_function_type)( ::osg::State & ) const; PrimitiveRestartIndex_exposer.def( "apply" , apply_function_type(&::osg::PrimitiveRestartIndex::apply) , default_apply_function_type(&PrimitiveRestartIndex_wrapper::default_apply) , ( bp::arg("state") ) ); } { //::osg::PrimitiveRestartIndex::className typedef char const * ( ::osg::PrimitiveRestartIndex::*className_function_type)( ) const; typedef char const * ( PrimitiveRestartIndex_wrapper::*default_className_function_type)( ) const; PrimitiveRestartIndex_exposer.def( "className" , className_function_type(&::osg::PrimitiveRestartIndex::className) , default_className_function_type(&PrimitiveRestartIndex_wrapper::default_className) ); } { //::osg::PrimitiveRestartIndex::clone typedef ::osg::Object * ( ::osg::PrimitiveRestartIndex::*clone_function_type)( ::osg::CopyOp const & ) const; typedef ::osg::Object * ( PrimitiveRestartIndex_wrapper::*default_clone_function_type)( ::osg::CopyOp const & ) const; PrimitiveRestartIndex_exposer.def( "clone" , clone_function_type(&::osg::PrimitiveRestartIndex::clone) , default_clone_function_type(&PrimitiveRestartIndex_wrapper::default_clone) , ( bp::arg("copyop") ) , bp::return_value_policy< bp::reference_existing_object >() ); } { //::osg::PrimitiveRestartIndex::cloneType typedef ::osg::Object * ( ::osg::PrimitiveRestartIndex::*cloneType_function_type)( ) const; typedef ::osg::Object * ( PrimitiveRestartIndex_wrapper::*default_cloneType_function_type)( ) const; PrimitiveRestartIndex_exposer.def( "cloneType" , cloneType_function_type(&::osg::PrimitiveRestartIndex::cloneType) , default_cloneType_function_type(&PrimitiveRestartIndex_wrapper::default_cloneType) , bp::return_value_policy< bp::reference_existing_object >() ); } { //::osg::PrimitiveRestartIndex::getExtensions typedef ::osg::PrimitiveRestartIndex::Extensions * ( *getExtensions_function_type )( unsigned int,bool ); PrimitiveRestartIndex_exposer.def( "getExtensions" , getExtensions_function_type( &::osg::PrimitiveRestartIndex::getExtensions ) , ( bp::arg("contextID"), bp::arg("createIfNotInitalized") ) , bp::return_internal_reference< >() ); } { //::osg::PrimitiveRestartIndex::getRestartIndex typedef unsigned int ( ::osg::PrimitiveRestartIndex::*getRestartIndex_function_type)( ) const; PrimitiveRestartIndex_exposer.def( "getRestartIndex" , getRestartIndex_function_type( &::osg::PrimitiveRestartIndex::getRestartIndex ) ); } { //::osg::PrimitiveRestartIndex::getType typedef ::osg::StateAttribute::Type ( ::osg::PrimitiveRestartIndex::*getType_function_type)( ) const; typedef ::osg::StateAttribute::Type ( PrimitiveRestartIndex_wrapper::*default_getType_function_type)( ) const; PrimitiveRestartIndex_exposer.def( "getType" , getType_function_type(&::osg::PrimitiveRestartIndex::getType) , default_getType_function_type(&PrimitiveRestartIndex_wrapper::default_getType) ); } { //::osg::PrimitiveRestartIndex::isSameKindAs typedef bool ( ::osg::PrimitiveRestartIndex::*isSameKindAs_function_type)( ::osg::Object const * ) const; typedef bool ( PrimitiveRestartIndex_wrapper::*default_isSameKindAs_function_type)( ::osg::Object const * ) const; PrimitiveRestartIndex_exposer.def( "isSameKindAs" , isSameKindAs_function_type(&::osg::PrimitiveRestartIndex::isSameKindAs) , default_isSameKindAs_function_type(&PrimitiveRestartIndex_wrapper::default_isSameKindAs) , ( bp::arg("obj") ) ); } { //::osg::PrimitiveRestartIndex::libraryName typedef char const * ( ::osg::PrimitiveRestartIndex::*libraryName_function_type)( ) const; typedef char const * ( PrimitiveRestartIndex_wrapper::*default_libraryName_function_type)( ) const; PrimitiveRestartIndex_exposer.def( "libraryName" , libraryName_function_type(&::osg::PrimitiveRestartIndex::libraryName) , default_libraryName_function_type(&PrimitiveRestartIndex_wrapper::default_libraryName) ); } { //::osg::PrimitiveRestartIndex::setExtensions typedef void ( *setExtensions_function_type )( unsigned int,::osg::PrimitiveRestartIndex::Extensions * ); PrimitiveRestartIndex_exposer.def( "setExtensions" , setExtensions_function_type( &::osg::PrimitiveRestartIndex::setExtensions ) , ( bp::arg("contextID"), bp::arg("extensions") ) ); } { //::osg::PrimitiveRestartIndex::setRestartIndex typedef void ( ::osg::PrimitiveRestartIndex::*setRestartIndex_function_type)( unsigned int ) ; PrimitiveRestartIndex_exposer.def( "setRestartIndex" , setRestartIndex_function_type( &::osg::PrimitiveRestartIndex::setRestartIndex ) , ( bp::arg("restartIndex") ) ); } { //::osg::StateAttribute::asTexture typedef ::osg::Texture * ( ::osg::StateAttribute::*asTexture_function_type)( ) ; typedef ::osg::Texture * ( PrimitiveRestartIndex_wrapper::*default_asTexture_function_type)( ) ; PrimitiveRestartIndex_exposer.def( "asTexture" , asTexture_function_type(&::osg::StateAttribute::asTexture) , default_asTexture_function_type(&PrimitiveRestartIndex_wrapper::default_asTexture) , bp::return_internal_reference< >() ); } { //::osg::StateAttribute::asTexture typedef ::osg::Texture const * ( ::osg::StateAttribute::*asTexture_function_type)( ) const; typedef ::osg::Texture const * ( PrimitiveRestartIndex_wrapper::*default_asTexture_function_type)( ) const; PrimitiveRestartIndex_exposer.def( "asTexture" , asTexture_function_type(&::osg::StateAttribute::asTexture) , default_asTexture_function_type(&PrimitiveRestartIndex_wrapper::default_asTexture) , bp::return_internal_reference< >() ); } { //::osg::StateAttribute::checkValidityOfAssociatedModes typedef bool ( ::osg::StateAttribute::*checkValidityOfAssociatedModes_function_type)( ::osg::State & ) const; typedef bool ( PrimitiveRestartIndex_wrapper::*default_checkValidityOfAssociatedModes_function_type)( ::osg::State & ) const; PrimitiveRestartIndex_exposer.def( "checkValidityOfAssociatedModes" , checkValidityOfAssociatedModes_function_type(&::osg::StateAttribute::checkValidityOfAssociatedModes) , default_checkValidityOfAssociatedModes_function_type(&PrimitiveRestartIndex_wrapper::default_checkValidityOfAssociatedModes) , ( bp::arg("arg0") ) ); } { //::osg::StateAttribute::compileGLObjects typedef void ( ::osg::StateAttribute::*compileGLObjects_function_type)( ::osg::State & ) const; typedef void ( PrimitiveRestartIndex_wrapper::*default_compileGLObjects_function_type)( ::osg::State & ) const; PrimitiveRestartIndex_exposer.def( "compileGLObjects" , compileGLObjects_function_type(&::osg::StateAttribute::compileGLObjects) , default_compileGLObjects_function_type(&PrimitiveRestartIndex_wrapper::default_compileGLObjects) , ( bp::arg("arg0") ) ); } { //::osg::Object::computeDataVariance typedef void ( ::osg::Object::*computeDataVariance_function_type)( ) ; typedef void ( PrimitiveRestartIndex_wrapper::*default_computeDataVariance_function_type)( ) ; PrimitiveRestartIndex_exposer.def( "computeDataVariance" , computeDataVariance_function_type(&::osg::Object::computeDataVariance) , default_computeDataVariance_function_type(&PrimitiveRestartIndex_wrapper::default_computeDataVariance) ); } { //::osg::StateAttribute::getMember typedef unsigned int ( ::osg::StateAttribute::*getMember_function_type)( ) const; typedef unsigned int ( PrimitiveRestartIndex_wrapper::*default_getMember_function_type)( ) const; PrimitiveRestartIndex_exposer.def( "getMember" , getMember_function_type(&::osg::StateAttribute::getMember) , default_getMember_function_type(&PrimitiveRestartIndex_wrapper::default_getMember) ); } { //::osg::StateAttribute::getModeUsage typedef bool ( ::osg::StateAttribute::*getModeUsage_function_type)( ::osg::StateAttribute::ModeUsage & ) const; typedef bool ( PrimitiveRestartIndex_wrapper::*default_getModeUsage_function_type)( ::osg::StateAttribute::ModeUsage & ) const; PrimitiveRestartIndex_exposer.def( "getModeUsage" , getModeUsage_function_type(&::osg::StateAttribute::getModeUsage) , default_getModeUsage_function_type(&PrimitiveRestartIndex_wrapper::default_getModeUsage) , ( bp::arg("arg0") ) ); } { //::osg::Object::getUserData typedef ::osg::Referenced * ( ::osg::Object::*getUserData_function_type)( ) ; typedef ::osg::Referenced * ( PrimitiveRestartIndex_wrapper::*default_getUserData_function_type)( ) ; PrimitiveRestartIndex_exposer.def( "getUserData" , getUserData_function_type(&::osg::Object::getUserData) , default_getUserData_function_type(&PrimitiveRestartIndex_wrapper::default_getUserData) , bp::return_internal_reference< >() ); } { //::osg::Object::getUserData typedef ::osg::Referenced const * ( ::osg::Object::*getUserData_function_type)( ) const; typedef ::osg::Referenced const * ( PrimitiveRestartIndex_wrapper::*default_getUserData_function_type)( ) const; PrimitiveRestartIndex_exposer.def( "getUserData" , getUserData_function_type(&::osg::Object::getUserData) , default_getUserData_function_type(&PrimitiveRestartIndex_wrapper::default_getUserData) , bp::return_internal_reference< >() ); } { //::osg::StateAttribute::isTextureAttribute typedef bool ( ::osg::StateAttribute::*isTextureAttribute_function_type)( ) const; typedef bool ( PrimitiveRestartIndex_wrapper::*default_isTextureAttribute_function_type)( ) const; PrimitiveRestartIndex_exposer.def( "isTextureAttribute" , isTextureAttribute_function_type(&::osg::StateAttribute::isTextureAttribute) , default_isTextureAttribute_function_type(&PrimitiveRestartIndex_wrapper::default_isTextureAttribute) ); } { //::osg::StateAttribute::resizeGLObjectBuffers typedef void ( ::osg::StateAttribute::*resizeGLObjectBuffers_function_type)( unsigned int ) ; typedef void ( PrimitiveRestartIndex_wrapper::*default_resizeGLObjectBuffers_function_type)( unsigned int ) ; PrimitiveRestartIndex_exposer.def( "resizeGLObjectBuffers" , resizeGLObjectBuffers_function_type(&::osg::StateAttribute::resizeGLObjectBuffers) , default_resizeGLObjectBuffers_function_type(&PrimitiveRestartIndex_wrapper::default_resizeGLObjectBuffers) , ( bp::arg("arg0") ) ); } { //::osg::Object::setName typedef void ( ::osg::Object::*setName_function_type)( ::std::string const & ) ; typedef void ( PrimitiveRestartIndex_wrapper::*default_setName_function_type)( ::std::string const & ) ; PrimitiveRestartIndex_exposer.def( "setName" , setName_function_type(&::osg::Object::setName) , default_setName_function_type(&PrimitiveRestartIndex_wrapper::default_setName) , ( bp::arg("name") ) ); } { //::osg::Object::setName typedef void ( ::osg::Object::*setName_function_type)( char const * ) ; PrimitiveRestartIndex_exposer.def( "setName" , setName_function_type( &::osg::Object::setName ) , ( bp::arg("name") ) , " Set the name of object using a C style string." ); } { //::osg::Object::setThreadSafeRefUnref typedef void ( ::osg::Object::*setThreadSafeRefUnref_function_type)( bool ) ; typedef void ( PrimitiveRestartIndex_wrapper::*default_setThreadSafeRefUnref_function_type)( bool ) ; PrimitiveRestartIndex_exposer.def( "setThreadSafeRefUnref" , setThreadSafeRefUnref_function_type(&::osg::Object::setThreadSafeRefUnref) , default_setThreadSafeRefUnref_function_type(&PrimitiveRestartIndex_wrapper::default_setThreadSafeRefUnref) , ( bp::arg("threadSafe") ) ); } { //::osg::Object::setUserData typedef void ( ::osg::Object::*setUserData_function_type)( ::osg::Referenced * ) ; typedef void ( PrimitiveRestartIndex_wrapper::*default_setUserData_function_type)( ::osg::Referenced * ) ; PrimitiveRestartIndex_exposer.def( "setUserData" , setUserData_function_type(&::osg::Object::setUserData) , default_setUserData_function_type(&PrimitiveRestartIndex_wrapper::default_setUserData) , ( bp::arg("obj") ) ); } PrimitiveRestartIndex_exposer.staticmethod( "getExtensions" ); PrimitiveRestartIndex_exposer.staticmethod( "setExtensions" ); } }
{ "content_hash": "724dc62695db95c882bbf90d4b3ce0c3", "timestamp": "", "source": "github", "line_count": 678, "max_line_length": 307, "avg_line_length": 45.91150442477876, "alnum_prop": 0.5948984836802879, "repo_name": "JaneliaSciComp/osgpyplusplus", "id": "8e4430bf23e50d73d5f938692138c5a754e11a9d", "size": "31328", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/modules/osg/generated_code/PrimitiveRestartIndex.pypp.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "5836" }, { "name": "C++", "bytes": "15619800" }, { "name": "CMake", "bytes": "40664" }, { "name": "Python", "bytes": "181050" } ], "symlink_target": "" }
from sklearn_explain.tests.skl_datasets import skl_datasets_test as skltest skltest.test_class_dataset_and_model("iris" , "SVC_rbf_9")
{ "content_hash": "d4bd15b70ce3c22951e81388fc2e1eb4", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 75, "avg_line_length": 34.25, "alnum_prop": 0.7737226277372263, "repo_name": "antoinecarme/sklearn_explain", "id": "b00a17b10a2bc8b37491febd8d2580a69930048b", "size": "137", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/skl_datasets/iris/skl_dataset_iris_SVC_rbf_9_code_gen.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "110343" } ], "symlink_target": "" }
Romie = function() { this.moving = false; } Romie.prototype.forward = function(callback) { if ( ! this.moving) { this.moving = true; Weblab.sendCommand("F", function(response) { if (response != 'OK') callback(JSON.parse(response)); this.moving = false; }.bind(this), function(response) { this.moving = false; }.bind(this)); } } Romie.prototype.left = function() { if ( ! this.moving) { this.moving = true; Weblab.sendCommand("L", function(response) { this.moving = false; }.bind(this), function(response) { this.moving = false; }.bind(this)); } } Romie.prototype.right = function() { if ( ! this.moving) { this.moving = true; Weblab.sendCommand("R", function(response) { this.moving = false; }.bind(this), function(response) { this.moving = false; }.bind(this)); } } Romie.prototype.isMoving = function() {return this.moving;}
{ "content_hash": "ffe3d0741d08e71251219517969c5cf5", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 59, "avg_line_length": 19.26086956521739, "alnum_prop": 0.6399548532731377, "repo_name": "zstars/weblabdeusto", "id": "a4e3b23550227611b532b1b5403fe19c29e1c410", "size": "886", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "client/src/es/deusto/weblab/public/jslabs/romie/js/romie.js", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "ASP", "bytes": "4785" }, { "name": "ActionScript", "bytes": "8508" }, { "name": "ApacheConf", "bytes": "122186" }, { "name": "Batchfile", "bytes": "7753" }, { "name": "C", "bytes": "19456" }, { "name": "C#", "bytes": "315160" }, { "name": "C++", "bytes": "9547" }, { "name": "CSS", "bytes": "150709" }, { "name": "CoffeeScript", "bytes": "30909" }, { "name": "Go", "bytes": "7076" }, { "name": "HTML", "bytes": "452001" }, { "name": "Java", "bytes": "1234794" }, { "name": "JavaScript", "bytes": "1656027" }, { "name": "Makefile", "bytes": "1571" }, { "name": "Mako", "bytes": "824" }, { "name": "PHP", "bytes": "155137" }, { "name": "Python", "bytes": "3435335" }, { "name": "Shell", "bytes": "2596" }, { "name": "Smarty", "bytes": "20160" }, { "name": "VHDL", "bytes": "5874" } ], "symlink_target": "" }
<!doctype html> <html dir="rtl" lang=ar> <head> <title>{{ page.title }}</title> <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='regular.css') }}"> <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Meta tags for web app usage --> <meta content="#1D1D1D" name="theme-color"> <meta content="yes" name="mobile-web-app-capable"> <meta content="yes" name="apple-mobile-web-app-capable"> <meta content="black-translucent" name="apple-mobile-web-app-status-bar-style"> </head> <body> <div class="a4"> <h1 class="title"> <a href="/">{{ page.title }}</a> </h1> {% block body %}{% endblock %} </div> </body> </html>
{ "content_hash": "5dae80f2ec71f77b697fe4555820a907", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 98, "avg_line_length": 33.666666666666664, "alnum_prop": 0.6014851485148515, "repo_name": "Upflask/Upflask-languages", "id": "fa734565d98796aecc0fc9f747194379f64623c8", "size": "808", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "templates/regularar.html", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "41132" } ], "symlink_target": "" }
package com.intellij.codeInsight.daemon.impl.quickfix; import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase; public class DeleteCatchTest extends LightQuickFixParameterizedTestCase { @Override protected String getBasePath() { return "/codeInsight/daemonCodeAnalyzer/quickFix/deleteCatch"; } }
{ "content_hash": "5f41a195ac19ee9adfaea5e1c3022044", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 83, "avg_line_length": 30.545454545454547, "alnum_prop": 0.8273809523809523, "repo_name": "ingokegel/intellij-community", "id": "90725732fb4990439d9270ec2a5c029619ea0884", "size": "457", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "java/java-tests/testSrc/com/intellij/codeInsight/daemon/impl/quickfix/DeleteCatchTest.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
Partial Derivatives =================== Medical emergency ----------------- Nedwina has defective ankles, but like a true Seattleite she has decided to climb Mt. Rainier. Her doctor says she cannot walk on any surface whose angle with the $xy$-plane is greater than $\pi/3$. Nedwina knows a nerd who modeled her favorite part of Rainier by the equation $x^3+z^2(y^2+y^3)+x+y+z=0.$ Can Nedwina stand at the point $(0,0,0)$ without violating her doctor's orders? What is the best linear approximation to the surface around the point $(0,0,0)$? Here's the model with $(0,0,0)$ indicated ------------------------------------------- A simpler situation ------------------- Find the tangent plane to the paraboloid $z=x^2+y^2$ at the point $(1,1,2)$. A silly observation ------------------- If we slice the whole package with a plane, we go from a surface and tangent plane to a curve and tangent line! Partial derivatives ------------------- This process of restricting attention to one variable and taking derivatives "with respect to that variable" is called taking partial derivatives. Formal definition: given a function of two variables $f(x,y)$, the partial derivatives with respect to $x$ and $y$ at a point $(a,b)$ are defined as follows. $$\frac{\partial f}{\partial x}=f_x(a,b)=\lim_{h\to 0}\frac{f(a+h,b)-f(a,b)}{h}$$ $$\frac{\partial f}{\partial y}=f_y(a,b)=\lim_{h\to 0}\frac{f(a,b+h)-f(a,b)}{h}$$ Rules - Treat one variable as a constant - Differentiate with respect to the other one - Rejoice Example ------- For example, consider the function $f(x,y)=x^2+y^2$. To compute the partial derivative with respect to $x$, we treat $y$ as a constant and do the usual one-variable differentiation: $$\frac{\partial f}{\partial x}=2x.$$ Do some! Compute the partial derivatives with respect to $x$ and $y$ of these functions. - $f(x,y)=\sin(x)\cos(y)$ - $f(x,y)=x^y$ - $f(x,y)=y^5$ Tangent planes ============== Tangent planes to graphs ------------------------ One of the main uses of partial derivatives is in producing tangent planes. Theorem: for a function $f(x,y)$, the tangent plane to the graph $z=f(x,y)$ at the point $(a,b,c)$ is given by the equation $$z-c=f_x(a,b)(x-a)+f_y(a,b)(y-b)$$ Example: $f(x,y)=x^2+y^2$, $(a,b,c)=(1,1,2)$, get the plane $$z-2=2(x-1)+2(y-1).$$ Why does this make sense? - If we take a vertical or horizontal trace, the tangent plane should give the tangent line. Does it? - The partial derivatives seem to capture just a vertical and horizontal trace. Is that really enough? Try one! -------- Calculate the tangent plane to the graph of the function $$f(x,y)=\sin(x)\cos(y)$$ at the point $(a,b,\sin(a)\cos(b))$. General formula for $f(x,y)$ at $(a,b,c)$: $$z-c=f_x(a,b)(x-a)+f_y(a,b)(y-b)$$ Big but ------- Our nerd's Rainier model does not express $z$ as a function of $x$ and $y$: $$x^3+z^2(y^2+y^3)+x+y+z=0$$ What should we do? - Think of $z$ as an implicit function of $x$ and $y$! - Do you remember how implicit differentiation works? Implicit partial derivatives ---------------------------- Follow the procedure you learned in the days of yore. Let's focus on partial derivatives with respect to $x$. - Pretend $z$ is a function of $x$ and $y$ is a constant, so we have a partial derivative $\partial z/\partial x$. - Use the product rule, chain rule, etc., to take the derivative of the relation. - Solve for $\partial z/\partial x$ in terms of $x$, $y$, $z$. Example: for the cone $z^2=x^2+y^2$ we get $2zz_x=2x$, so for $z\neq 0$ we have $$\frac{\partial z}{\partial x}=\frac{x}{z}.$$ Tangent plane to cone --------------------- Continuing the cone example, at a point $(a,b,c)$ of the circular cone $z^2=x^2+y^2$, we have $z_x(a,b)=a/c$ and $z_y(a,b)=b/c$. Thus, the tangent plane is $$z-c=\frac{a}{c}(x-a)+\frac{b}{c}(y-b),$$ or, equivalently, $$c(z-c)=a(x-a)+b(y-b).$$ For kicks, let's expand that: $$cz-c^2=ax-a^2+by-b^2.$$ Since $c^2=a^2+b^2$, we can simplify this to $cz=ax+by$. Nice! Bizarre note: if we scale $a$, $b$, and $c$ by the same number, the tangent plane does not change. Is there a reason for this? Your turn! ---------- Find the tangent plane to Mt. Rainier at $(0,0,0)$. The equation is $x^3+z^2(y^2+y^3)+x+y+z=0.$ Is the plane too steep for Nedwina? ### Videos [Video chunk 14-1](http://www.math.washington.edu/~lieblich/Math126/video/14-1.mp4) [Video chunk 14-2](http://www.math.washington.edu/~lieblich/Math126/video/14-2.mp4) ### Content contributors @maxlieblich
{ "content_hash": "6083ff51fa0dce9b8837bdb42613cdac", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 83, "avg_line_length": 25.965714285714284, "alnum_prop": 0.6397447183098591, "repo_name": "maxlieblich/math126", "id": "96a2d0ba1a22df91f9065067c6d4c8a0d115066f", "size": "4544", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/lecture-14.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "8080" }, { "name": "CoffeeScript", "bytes": "55845" }, { "name": "HTML", "bytes": "874" }, { "name": "JavaScript", "bytes": "121127" }, { "name": "Makefile", "bytes": "5119" }, { "name": "Python", "bytes": "7994" } ], "symlink_target": "" }
arduino_daq ================== Use this directory as CMake source dir to build a standalone libray for arduino_daq.
{ "content_hash": "41e020aac56ce6ee256edc6115998db9", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 84, "avg_line_length": 23.6, "alnum_prop": 0.6694915254237288, "repo_name": "ual-arm-ros-pkg/arduino-daq-ros-pkg", "id": "d58f21c534bb9f29c99c3d622fb46bc16e91bf8b", "size": "118", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "libarduinodaq/README.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "6022" }, { "name": "C", "bytes": "108702" }, { "name": "C++", "bytes": "260864" }, { "name": "CMake", "bytes": "5870" } ], "symlink_target": "" }
var plan = require("../lib/plan-iddfs-multi"); var chai = require("chai"); var expect = chai.expect; var isAcceptable = function(state){ return state.get("act1_changed_state") && state.get("act2_changed_state"); } describe("plan-iddfs-multistate", function(){ it("should return a plan", function(){ var actions = [ { action: "act1", possible:function(state, history){ return true; }, updateState: function(state){ return [state.set("act1_changed_state", true)]; } }, { action: "act2", possible:function(state, history){ return true; }, updateState: function(state){ return [state.set("act2_changed_state", true)]; } } ]; var myPlan = plan(actions, {}, isAcceptable); var firstPlan = myPlan.next(); expect(firstPlan.value.length).to.equal(2); expect(firstPlan.value[0].actionObj.action).to.equal("act1"); expect(firstPlan.value[1].actionObj.action).to.equal("act2"); }); it("should return a plan only if actions are possible", function(){ var actions = [ { action: "act1", possible:function(state, history){ return true; }, updateState: function(state){ return [state.set("act1_changed_state", true)]; } }, { action: "act2", possible:function(state, history){ return [state.get("act1_changed_state")]; }, updateState: function(state){ return [state.set("act2_changed_state", true)]; } } ]; var myPlan = plan(actions, {}, isAcceptable); var firstPlan = myPlan.next(); expect(firstPlan.value.length).to.equal(2); expect(firstPlan.value[0].actionObj.action).to.equal("act1"); expect(firstPlan.value[1].actionObj.action).to.equal("act2"); }); it("should iterate to get all possible plans", function(){ var actions = [ { action: "act1", possible:function(state, history){ return true; }, updateState: function(state){ return [state.set("act1_changed_state", true)]; } }, { action: "act2", possible:function(state, history){ return true; }, updateState: function(state){ return [state.set("act2_changed_state", true)]; } } ]; for(var myPlan of plan(actions, {}, isAcceptable,2)){ expect(myPlan.length).to.equal(2); if(myPlan[0].actionObj.action === "act1"){ expect(myPlan[1].actionObj.action).to.equal("act2"); } else { expect(myPlan[1].actionObj.action).to.equal("act1"); } } }); it("should halt if maxDepth is reached", function(){ var actions = [ { action: "act1", possible:function(state, history){ return true; }, updateState: function(state){ return [state.set("act1_changed_state", true)]; } }, { action: "act2", possible:function(state, history){ return true; }, updateState: function(state){ return [state.set("act2_changed_state", true)]; } } ]; for(var myPlan of plan(actions, {}, isAcceptable,1)){ throw new Error("No plan should have been returned"); } }); })
{ "content_hash": "f7a70c1a6bbb19d5317dbfffe0bf4d4d", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 76, "avg_line_length": 25.825757575757574, "alnum_prop": 0.5488413024347316, "repo_name": "stierma1/forward-chainer", "id": "e77f143b835cadf83c7dc95c370a66dfba00894e", "size": "3409", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/plan-iddfs-multi-spec.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "42183" } ], "symlink_target": "" }
package com.fasterxml.jackson.databind.objectid; import java.util.ArrayList; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.testutil.NoCheckSubTypeValidator; @SuppressWarnings("serial") public class ObjectId825BTest extends BaseMapTest { static abstract class AbstractAct extends AbstractEntity { protected java.util.ArrayList<Tr> outTr; public java.util.ArrayList<Tr> getOutTr() { return this.outTr; } public void setOutTr(java.util.ArrayList<Tr> outTr) { this.outTr = outTr; } } static abstract class AbstractCond extends AbstractAct { } static abstract class AbstractData extends AbstractSym { } static abstract class AbstractDec extends AbstractAct { protected java.util.ArrayList<Dec> dec; public java.util.ArrayList<Dec> getDec() { return this.dec; } public void setDec(java.util.ArrayList<Dec> dec) { this.dec = dec; } } @JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="oidString") @JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class") static abstract class AbstractEntity implements java.io.Serializable { public String oidString; protected AbstractEntity() { } public String getOidString() { return oidString; } public void setOidString(String oidString) { this.oidString = oidString; } } static abstract class AbstractSym extends AbstractEntity { } static class Ch extends AbstractEntity { protected java.util.ArrayList<? extends AbstractAct> act; public java.util.ArrayList<? extends AbstractAct> getAct() { return this.act; } public void setAct(java.util.ArrayList<? extends AbstractAct> act) { this.act = act; } } static class CTC extends AbstractEntity { protected java.util.ArrayList<CTV> var; public CTC() { } public java.util.ArrayList<CTV> getVar() { if (var == null) { var = new ArrayList<CTV>(); } return new ArrayList<CTV>(var); } public void setVar(java.util.ArrayList<CTV> var) { this.var = var; } } static class CTD extends AbstractDec { } static class CTV extends AbstractEntity { protected Ch ch; protected java.util.ArrayList<? extends AbstractData> locV; public Ch getCh() { return this.ch; } public void setCh(Ch ch) { this.ch = ch; } public java.util.ArrayList<? extends AbstractData> getLocV() { return this.locV; } public void setLocV(java.util.ArrayList<? extends AbstractData> locV) { this.locV = locV; } } static class Dec extends AbstractCond { } static class Ti extends AbstractAct { protected AbstractData timer; public AbstractData getTimer() { return this.timer; } public void setTimer(AbstractData timer) { this.timer = timer; } } static class Tr extends AbstractEntity { protected AbstractAct target; public AbstractAct getTarget() { return this.target; } public void setTarget(AbstractAct target) { this.target = target; } } static class V extends AbstractData { private static final long serialVersionUID = 1L; } /* /***************************************************** /* Test methods /***************************************************** */ public void testFull825() throws Exception { final ObjectMapper mapper = jsonMapperBuilder() .activateDefaultTyping(NoCheckSubTypeValidator.instance, ObjectMapper.DefaultTyping.OBJECT_AND_NON_CONCRETE) .build(); String INPUT = a2q( "{\n"+ " '@class': '_PKG_CTC',\n"+ " 'var': [{\n"+ " 'ch': {\n"+ " '@class': '_PKG_Ch',\n"+ " 'act': [{\n"+ " '@class': '_PKG_CTD',\n"+ " 'oidString': 'oid1',\n"+ " 'dec': [{\n"+ " '@class': '_PKG_Dec',\n"+ " 'oidString': 'oid2',\n"+ " 'outTr': [{\n"+ " '@class': '_PKG_Tr',\n"+ " 'target': {\n"+ " '@class': '_PKG_Ti',\n"+ " 'oidString': 'oid3',\n"+ " 'timer': 'problemoid',\n"+ " 'outTr': [{\n"+ " '@class': '_PKG_Tr',\n"+ " 'target': {\n"+ " '@class': '_PKG_Ti',\n"+ " 'oidString': 'oid4',\n"+ " 'timer': {\n"+ " '@class': '_PKG_V',\n"+ " 'oidString': 'problemoid'\n"+ " }\n"+ " }\n"+ " }]\n"+ " }\n"+ " }]\n"+ " }]\n"+ " }],\n"+ " 'oidString': 'oid5'\n"+ " },\n"+ " '@class': '_PKG_CTV',\n"+ " 'oidString': 'oid6',\n"+ " 'locV': ['problemoid']\n"+ " }],\n"+ " 'oidString': 'oid7'\n"+ "}\n" ); // also replace package final String newPkg = getClass().getName() + "\\$"; INPUT = INPUT.replaceAll("_PKG_", newPkg); CTC result = mapper.readValue(INPUT, CTC.class); assertNotNull(result); } }
{ "content_hash": "bf9e9011d3a216521d3299d27df64030", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 97, "avg_line_length": 28.405940594059405, "alnum_prop": 0.5097594980829557, "repo_name": "FasterXML/jackson-databind", "id": "f3e4e702161548eaec5260d1f063322946bd812e", "size": "5738", "binary": false, "copies": "1", "ref": "refs/heads/2.15", "path": "src/test/java/com/fasterxml/jackson/databind/objectid/ObjectId825BTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "7940640" }, { "name": "Logos", "bytes": "173041" }, { "name": "Shell", "bytes": "264" } ], "symlink_target": "" }
<?php namespace Symfony\Component\Locale\Stub\DateFormat; /** * Parser and formatter for AM/PM markers format * * @author Igor Wiedler <[email protected]> */ class AmPmTransformer extends Transformer { /** * {@inheritDoc} */ public function format(\DateTime $dateTime, $length) { return $dateTime->format('A'); } /** * {@inheritDoc} */ public function getReverseMatchingRegExp($length) { return 'AM|PM'; } /** * {@inheritDoc} */ public function extractDateOptions($matched, $length) { return array( 'marker' => $matched ); } }
{ "content_hash": "cebf312e797e26be7e483ee6ab4e9267", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 57, "avg_line_length": 17.846153846153847, "alnum_prop": 0.5316091954022989, "repo_name": "WCORP/just2", "id": "8cfd0ac0476c0af09cef6405289389787d35e711", "size": "932", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/AmPmTransformer.php", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1017310" }, { "name": "PHP", "bytes": "405326" } ], "symlink_target": "" }
require 'spec_helper' Chef::Knife::Bootstrap.load_deps require 'net/ssh' describe Chef::Knife::Bootstrap do before(:all) do @original_config = Chef::Config.hash_dup @original_knife_config = Chef::Config[:knife].dup end after(:all) do Chef::Config.configuration = @original_config Chef::Config[:knife] = @original_knife_config end before(:each) do Chef::Log.logger = Logger.new(StringIO.new) @knife = Chef::Knife::Bootstrap.new @knife.config[:template_file] = File.expand_path(File.join(CHEF_SPEC_DATA, "bootstrap", "test.erb")) @stdout = StringIO.new @knife.ui.stub!(:stdout).and_return(@stdout) @stderr = StringIO.new @knife.ui.stub!(:stderr).and_return(@stderr) end it "should return a name of default bootstrap template" do @knife.find_template.should be_a_kind_of(String) end it "should error if template can not be found" do @knife.config[:template_file] = false @knife.config[:distro] = 'penultimate' lambda { @knife.find_template }.should raise_error end it "should look for templates early in the run" do File.stub(:exists?).and_return(true) @knife.name_args = ['shatner'] @knife.stub!(:read_template).and_return("") @knife.stub!(:knife_ssh).and_return(true) @knife_ssh = @knife.knife_ssh @knife.should_receive(:find_template).ordered @knife.should_receive(:knife_ssh).ordered @knife_ssh.should_receive(:run) # rspec appears to keep order per object @knife.run end it "should load the specified template" do @knife.config[:distro] = 'fedora13-gems' lambda { @knife.find_template }.should_not raise_error end it "should load the specified template from a Ruby gem" do @knife.config[:template_file] = false Gem.stub(:find_files).and_return(["/Users/schisamo/.rvm/gems/[email protected]/gems/knife-windows-0.5.4/lib/chef/knife/bootstrap/fake-bootstrap-template.erb"]) File.stub(:exists?).and_return(true) IO.stub(:read).and_return('random content') @knife.config[:distro] = 'fake-bootstrap-template' lambda { @knife.find_template }.should_not raise_error end it "should return an empty run_list" do @knife.instance_variable_set("@template_file", @knife.config[:template_file]) template_string = @knife.read_template @knife.render_template(template_string).should == '{"run_list":[]}' end it "should have role[base] in the run_list" do @knife.instance_variable_set("@template_file", @knife.config[:template_file]) template_string = @knife.read_template @knife.parse_options(["-r","role[base]"]) @knife.render_template(template_string).should == '{"run_list":["role[base]"]}' end it "should have role[base] and recipe[cupcakes] in the run_list" do @knife.instance_variable_set("@template_file", @knife.config[:template_file]) template_string = @knife.read_template @knife.parse_options(["-r", "role[base],recipe[cupcakes]"]) @knife.render_template(template_string).should == '{"run_list":["role[base]","recipe[cupcakes]"]}' end it "should have foo => {bar => baz} in the first_boot" do @knife.instance_variable_set("@template_file", @knife.config[:template_file]) template_string = @knife.read_template @knife.parse_options(["-j", '{"foo":{"bar":"baz"}}']) expected_hash = Yajl::Parser.new.parse('{"foo":{"bar":"baz"},"run_list":[]}') actual_hash = Yajl::Parser.new.parse(@knife.render_template(template_string)) actual_hash.should == expected_hash end it "should create a hint file when told to" do @knife.config[:template_file] = File.expand_path(File.join(CHEF_SPEC_DATA, "bootstrap", "test-hints.erb")) @knife.instance_variable_set("@template_file", @knife.config[:template_file]) template_string = @knife.read_template @knife.parse_options(["--hint", "openstack"]) @knife.render_template(template_string).should match /\/etc\/chef\/ohai\/hints\/openstack.json/ end it "should populate a hint file with JSON when given a file to read" do @knife.stub(:find_template).and_return(true) @knife.config[:template_file] = File.expand_path(File.join(CHEF_SPEC_DATA, "bootstrap", "test-hints.erb")) ::File.stub!(:read).and_return('{ "foo" : "bar" }') @knife.instance_variable_set("@template_file", @knife.config[:template_file]) template_string = @knife.read_template @knife.stub!(:read_template).and_return('{ "foo" : "bar" }') @knife.parse_options(["--hint", "openstack=hints/openstack.json"]) @knife.render_template(template_string).should match /\{\"foo\":\"bar\"\}/ end it "should take the node name from ARGV" do @knife.name_args = ['barf'] @knife.name_args.first.should == "barf" end describe "when configuring the underlying knife ssh command" context "from the command line" do before do @knife.name_args = ["foo.example.com"] @knife.config[:ssh_user] = "rooty" @knife.config[:ssh_port] = "4001" @knife.config[:ssh_password] = "open_sesame" Chef::Config[:knife][:ssh_user] = nil Chef::Config[:knife][:ssh_port] = nil @knife.config[:identity_file] = "~/.ssh/me.rsa" @knife.stub!(:read_template).and_return("") @knife_ssh = @knife.knife_ssh end it "configures the hostname" do @knife_ssh.name_args.first.should == "foo.example.com" end it "configures the ssh user" do @knife_ssh.config[:ssh_user].should == 'rooty' end it "configures the ssh password" do @knife_ssh.config[:ssh_password].should == 'open_sesame' end it "configures the ssh port" do @knife_ssh.config[:ssh_port].should == '4001' end it "configures the ssh identity file" do @knife_ssh.config[:identity_file].should == '~/.ssh/me.rsa' end end context "from the knife config file" do before do @knife.name_args = ["config.example.com"] @knife.config[:ssh_user] = nil @knife.config[:ssh_port] = nil @knife.config[:ssh_gateway] = nil @knife.config[:identity_file] = nil @knife.config[:host_key_verify] = nil Chef::Config[:knife][:ssh_user] = "curiosity" Chef::Config[:knife][:ssh_port] = "2430" Chef::Config[:knife][:identity_file] = "~/.ssh/you.rsa" Chef::Config[:knife][:ssh_gateway] = "towel.blinkenlights.nl" Chef::Config[:knife][:host_key_verify] = true @knife.stub!(:read_template).and_return("") @knife_ssh = @knife.knife_ssh end it "configures the ssh user" do @knife_ssh.config[:ssh_user].should == 'curiosity' end it "configures the ssh port" do @knife_ssh.config[:ssh_port].should == '2430' end it "configures the ssh identity file" do @knife_ssh.config[:identity_file].should == '~/.ssh/you.rsa' end it "configures the ssh gateway" do @knife_ssh.config[:ssh_gateway].should == 'towel.blinkenlights.nl' end it "configures the host key verify mode" do @knife_ssh.config[:host_key_verify].should == true end end describe "when falling back to password auth when host key auth fails" do before do @knife.name_args = ["foo.example.com"] @knife.config[:ssh_user] = "rooty" @knife.config[:identity_file] = "~/.ssh/me.rsa" @knife.stub!(:read_template).and_return("") @knife_ssh = @knife.knife_ssh end it "prompts the user for a password " do @knife.stub!(:knife_ssh).and_return(@knife_ssh) @knife_ssh.stub!(:get_password).and_return('typed_in_password') alternate_knife_ssh = @knife.knife_ssh_with_password_auth alternate_knife_ssh.config[:ssh_password].should == 'typed_in_password' end it "configures knife not to use the identity file that didn't work previously" do @knife.stub!(:knife_ssh).and_return(@knife_ssh) @knife_ssh.stub!(:get_password).and_return('typed_in_password') alternate_knife_ssh = @knife.knife_ssh_with_password_auth alternate_knife_ssh.config[:identity_file].should be_nil end end describe "when running the bootstrap" do before do @knife.name_args = ["foo.example.com"] @knife.config[:ssh_user] = "rooty" @knife.config[:identity_file] = "~/.ssh/me.rsa" @knife.stub!(:read_template).and_return("") @knife_ssh = @knife.knife_ssh @knife.stub!(:knife_ssh).and_return(@knife_ssh) end it "verifies that a server to bootstrap was given as a command line arg" do @knife.name_args = nil lambda { @knife.run }.should raise_error(SystemExit) @stderr.string.should match /ERROR:.+FQDN or ip/ end it "configures the underlying ssh command and then runs it" do @knife_ssh.should_receive(:run) @knife.run end it "falls back to password based auth when auth fails the first time" do @knife.stub!(:puts) @fallback_knife_ssh = @knife_ssh.dup @knife_ssh.should_receive(:run).and_raise(Net::SSH::AuthenticationFailed.new("no ssh for you")) @knife.stub!(:knife_ssh_with_password_auth).and_return(@fallback_knife_ssh) @fallback_knife_ssh.should_receive(:run) @knife.run end end end
{ "content_hash": "f358a1ecf29274b5f52201a4545eadf3", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 171, "avg_line_length": 37.72064777327935, "alnum_prop": 0.6453794139744553, "repo_name": "SUSE-Cloud/chef", "id": "e8ca7cca87815de6eb52751713d8e4d49f873376", "size": "9996", "binary": false, "copies": "1", "ref": "refs/heads/10-stable-suse", "path": "chef/spec/unit/knife/bootstrap_spec.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1792" }, { "name": "CSS", "bytes": "21552" }, { "name": "Groff", "bytes": "270663" }, { "name": "HTML", "bytes": "553850" }, { "name": "JavaScript", "bytes": "49788" }, { "name": "Makefile", "bytes": "1326" }, { "name": "Perl6", "bytes": "64" }, { "name": "PowerShell", "bytes": "12510" }, { "name": "Python", "bytes": "9724" }, { "name": "Ruby", "bytes": "8612480" }, { "name": "Shell", "bytes": "19202" } ], "symlink_target": "" }
layout: nav_menu_item title: API Reference date: 2016-04-25 15:55 author: anya.stettler comments: true categories: [Onboarding API navigation] ---
{ "content_hash": "ba0c10a75cf11daffc96a85edd23f03a", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 39, "avg_line_length": 19.5, "alnum_prop": 0.7243589743589743, "repo_name": "anyarms/developer-dot", "id": "4705fd4e66d22d807a014f017bacb405c37f5644", "size": "161", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_drafts/deprecated/nav items/2016-04-25-api-reference.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "40443" }, { "name": "HTML", "bytes": "41054" }, { "name": "JavaScript", "bytes": "112902" }, { "name": "Ruby", "bytes": "1730" } ], "symlink_target": "" }
using KindergartentManagerment.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace KindergartentManagerment.Areas.GradeClass.Controllers { public class CalendarController : Controller { // GET: Kindergarten/Calendar KindergartentManagerment.Models.ApplicationDbContext db = new KindergartentManagerment.Models.ApplicationDbContext(); public ActionResult Index() { return View(); } /// <summary> /// API: http://arshaw.com/fullcalendar/docs/event_data/Event_Object/ /// </summary> /// <param name="start"></param> /// <param name="end"></param> /// <returns></returns> public JsonResult GetCalendarEvents() { var eventDetails = db.SYS_EVENT.ToList(); var eventList = from item in eventDetails select new { id = item.EVENT_ID, title = item.EVENT_NAME, start = item.EVENT_START, end = item.EVENT_END, allDay = false, editable = false, color = item.EVENT_STATUS_COLOR }; return Json(eventList.ToArray(), JsonRequestBehavior.AllowGet); } [HttpPost] [ValidateAntiForgeryToken] public ActionResult Index(SYS_EVENT item) { if (ModelState.IsValid) { db.SYS_EVENT.Add(item); db.SaveChanges(); } return View(); } } }
{ "content_hash": "7d52bf2b675b399bbbe868a5e9ea22fd", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 125, "avg_line_length": 32.49090909090909, "alnum_prop": 0.5013989927252378, "repo_name": "nguyenk15/KindergartenManagerment", "id": "31165044ea8d7d1ae900faeaaf5aecbe2a6d9e51", "size": "1789", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Program/KindergartentManagerment/Areas/GradeClass/Controllers/CalendarController.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "115" }, { "name": "C#", "bytes": "1287034" }, { "name": "CSS", "bytes": "509920" }, { "name": "HTML", "bytes": "3403657" }, { "name": "JavaScript", "bytes": "3281083" }, { "name": "PHP", "bytes": "3368" }, { "name": "PowerShell", "bytes": "122838" } ], "symlink_target": "" }
class ChangeTableAuthors < ActiveRecord::Migration def self.up change_table :blank_ones do |t| t.authorstamps(:integer, :null => true) end end end
{ "content_hash": "6c10b1713dd3c47556c9c2dbc12f1c5a", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 50, "avg_line_length": 15.363636363636363, "alnum_prop": 0.6686390532544378, "repo_name": "vollnhals/ar-audit-tracer", "id": "4a19acebb163c385bb7521730c0e6d19d76bca79", "size": "169", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "test/resources/migrations/change_table_authors.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "16570" } ], "symlink_target": "" }
FROM java:8 MAINTAINER Chris Rebert <[email protected]> WORKDIR / USER daemon ADD target/scala-2.11/no-carrier-assembly.jar /app/no-carrier.jar ENTRYPOINT ["java", "-jar", "/app/no-carrier.jar"]
{ "content_hash": "0b8670e0d817f138e36bab17fda00662", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 65, "avg_line_length": 22.333333333333332, "alnum_prop": 0.7412935323383084, "repo_name": "alacasta/no-carrier", "id": "527927c4c1ffb758e036ddf8d4512cdae5b4cfb4", "size": "233", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Dockerfile", "mode": "33188", "license": "mit", "language": [ { "name": "Scala", "bytes": "36936" }, { "name": "Shell", "bytes": "754" } ], "symlink_target": "" }
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'seamule' require 'minitest/autorun'
{ "content_hash": "52afdc245030f76a1a5f0d515ce7dbc7", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 58, "avg_line_length": 26.25, "alnum_prop": 0.6857142857142857, "repo_name": "pablo-co/seamule", "id": "497db262924ab8e4cc5b00749d0c49af204c9be2", "size": "105", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/test_helper.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "11442" }, { "name": "Shell", "bytes": "115" } ], "symlink_target": "" }
Python utilities to diff xml
{ "content_hash": "85a200f4148977f50b688705cec598a4", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 28, "avg_line_length": 29, "alnum_prop": 0.8275862068965517, "repo_name": "kalotay/xmldiff", "id": "3de136bd16abe6a179d0b51d674860a10f58e0d3", "size": "39", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "1143" } ], "symlink_target": "" }
@import Cocoa ; @import LuaSkin ; static const char * const USERDATA_TAG = "hs._asm.iokit" ; static LSRefTable refTable = LUA_NOREF; #define get_objectFromUserdata(objType, L, idx, tag) (objType*)*((void**)luaL_checkudata(L, idx, tag)) #pragma mark - Support Functions and Classes @interface ASM_IO_OBJECT_T : NSObject @property int selfRefCount ; @property io_object_t object ; @end @implementation ASM_IO_OBJECT_T - (instancetype)initWithObjet:(io_object_t)object { self = [super init] ; if (self) { _selfRefCount = 0 ; _object = object ; kern_return_t err = IOObjectRetain(_object) ; if (err != KERN_SUCCESS) { [LuaSkin logWarn:[NSString stringWithFormat:@"%s:initWithObject -- unable to retain IOObject (Kernel Error #%d)", USERDATA_TAG, err]] ; self = nil ; } } return self ; } - (void)dealloc { kern_return_t err = IOObjectRelease(_object) ; if (err != KERN_SUCCESS) { [LuaSkin logWarn:[NSString stringWithFormat:@"%s:dealloc -- unable to release IOObject (Kernel Error #%d)", USERDATA_TAG, err]] ; } _object = 0 ; } @end #pragma mark - Module Functions static int iokit_rootEntry(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TBREAK] ; io_object_t root = IORegistryGetRootEntry(kIOMasterPortDefault) ; if (root != MACH_PORT_NULL) { [skin pushNSObject:[[ASM_IO_OBJECT_T alloc] initWithObjet:root]] ; kern_return_t err = IOObjectRelease(root) ; if (err != KERN_SUCCESS) { [LuaSkin logDebug:[NSString stringWithFormat:@"%s.root -- unable to release IOObject (Kernel Error #%d)", USERDATA_TAG, err]] ; } } else { lua_pushnil(L) ; } return 1 ; } static int iokit_serviceMatching(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TTABLE, LS_TBREAK] ; NSDictionary *matchCriteria = [skin toNSObjectAtIndex:1] ; if ([matchCriteria isKindOfClass:[NSDictionary class]]) { // IOServiceGetMatchingService consumes a CFReference, so transfer it out of ARC io_object_t obj = IOServiceGetMatchingService(kIOMasterPortDefault, (__bridge_retained CFDictionaryRef)matchCriteria) ; if (obj) { [skin pushNSObject:[[ASM_IO_OBJECT_T alloc] initWithObjet:obj]] ; kern_return_t err = IOObjectRelease(obj) ; if (err != KERN_SUCCESS) { [LuaSkin logDebug:[NSString stringWithFormat:@"%s.serviceMatching -- unable to release IOObject (Kernel Error #%d)", USERDATA_TAG, err]] ; } } else { lua_pushnil(L) ; } } else { return luaL_argerror(L, 1, "expected table of key-value pairs") ; } return 1 ; } static int iokit_servicesMatching(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TTABLE, LS_TBREAK] ; NSDictionary *matchCriteria = [skin toNSObjectAtIndex:1] ; if ([matchCriteria isKindOfClass:[NSDictionary class]]) { io_iterator_t iterator = 0 ; // IOServiceGetMatchingServices consumes a CFReference, so transfer it out of ARC kern_return_t err = IOServiceGetMatchingServices(kIOMasterPortDefault, (__bridge_retained CFDictionaryRef)matchCriteria, &iterator) ; if (err == KERN_SUCCESS) { lua_newtable(L) ; io_object_t entry = 0 ; while ((entry = IOIteratorNext(iterator))) { [skin pushNSObject:[[ASM_IO_OBJECT_T alloc] initWithObjet:entry]] ; err = IOObjectRelease(entry) ; lua_rawseti(L, -2, luaL_len(L, -2) + 1) ; if (err != KERN_SUCCESS) { [LuaSkin logDebug:[NSString stringWithFormat:@"%s.servicesMatching -- unable to release entry %lld (Kernel Error #%d)", USERDATA_TAG, luaL_len(L, -2), err]] ; } } err = IOObjectRelease(iterator) ; if (err != KERN_SUCCESS) { [LuaSkin logDebug:[NSString stringWithFormat:@"%s.servicesMatching -- unable to release iterator (Kernel Error #%d)", USERDATA_TAG, err]] ; } } else { [LuaSkin logDebug:[NSString stringWithFormat:@"%s.servicesMatching -- unable to get iterator (Kernel Error #%d)", USERDATA_TAG, err]] ; lua_pushnil(L) ; } } else { return luaL_argerror(L, 1, "expected table of key-value pairs") ; } return 1 ; } static int iokit_serviceFromPath(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TSTRING, LS_TBREAK] ; io_string_t path ; strncpy(path, lua_tostring(L, 1), sizeof(io_string_t)) ; io_object_t obj = IORegistryEntryFromPath(kIOMasterPortDefault, path) ; if (obj) { [skin pushNSObject:[[ASM_IO_OBJECT_T alloc] initWithObjet:obj]] ; kern_return_t err = IOObjectRelease(obj) ; if (err != KERN_SUCCESS) { [LuaSkin logDebug:[NSString stringWithFormat:@"%s.serviceForPath -- unable to release IOObject (Kernel Error #%d)", USERDATA_TAG, err]] ; } } else { lua_pushnil(L) ; } return 1 ; } static int iokit_dictionaryMatchingName(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TSTRING, LS_TBREAK] ; CFDictionaryRef matchingDict = IOServiceNameMatching(lua_tostring(L, 1)) ; if (matchingDict) { [skin pushNSObject:(__bridge_transfer NSMutableDictionary *)matchingDict] ; } else { lua_pushnil(L) ; } return 1 ; } static int iokit_dictionaryMatchingClass(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TSTRING, LS_TBREAK] ; CFDictionaryRef matchingDict = IOServiceMatching(lua_tostring(L, 1)) ; if (matchingDict) { [skin pushNSObject:(__bridge_transfer NSMutableDictionary *)matchingDict] ; } else { lua_pushnil(L) ; } return 1 ; } static int iokit_dictionaryMatchingEntryID(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TNUMBER | LS_TINTEGER, LS_TBREAK] ; uint64_t entryID = (uint64_t)lua_tointeger(L, 1) ; CFDictionaryRef matchingDict = IORegistryEntryIDMatching(entryID) ; if (matchingDict) { [skin pushNSObject:(__bridge_transfer NSMutableDictionary *)matchingDict] ; } else { lua_pushnil(L) ; } return 1 ; } static int iokit_dictionaryMatchingBSDName(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TSTRING, LS_TBREAK] ; CFDictionaryRef matchingDict = IOBSDNameMatching(kIOMasterPortDefault, kNilOptions, lua_tostring(L, 1)) ; if (matchingDict) { [skin pushNSObject:(__bridge_transfer NSMutableDictionary *)matchingDict] ; } else { lua_pushnil(L) ; } return 1 ; } static int iokit_bundleIdentifierForClass(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TSTRING, LS_TBREAK] ; NSString *className = [skin toNSObjectAtIndex:1] ; CFStringRef bundle = IOObjectCopyBundleIdentifierForClass((__bridge CFStringRef)className) ; if (bundle) { [skin pushNSObject:(__bridge_transfer NSString *)bundle] ; } else { lua_pushnil(L) ; } return 1 ; } static int iokit_superclassForClass(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TSTRING, LS_TBREAK] ; NSString *className = [skin toNSObjectAtIndex:1] ; CFStringRef superclass = IOObjectCopySuperclassForClass((__bridge CFStringRef)className) ; if (superclass) { [skin pushNSObject:(__bridge_transfer NSString *)superclass] ; } else { lua_pushnil(L) ; } return 1 ; } #pragma mark - Module Methods static int iokit_name(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TUSERDATA, USERDATA_TAG, LS_TBREAK] ; ASM_IO_OBJECT_T *obj = [skin toNSObjectAtIndex:1] ; io_name_t deviceName ; kern_return_t err = IORegistryEntryGetName(obj.object, deviceName) ; if (err == KERN_SUCCESS) { lua_pushstring(L, deviceName) ; } else { [LuaSkin logDebug:[NSString stringWithFormat:@"%s:name -- unable to retrieve IOObject name (Kernel Error #%d)", USERDATA_TAG, err]] ; lua_pushnil(L) ; } return 1 ; } static int iokit_class(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TUSERDATA, USERDATA_TAG, LS_TBREAK] ; ASM_IO_OBJECT_T *obj = [skin toNSObjectAtIndex:1] ; CFStringRef className = IOObjectCopyClass(obj.object) ; if (className) { [skin pushNSObject:(__bridge_transfer NSString *)className] ; } else { lua_pushnil(L) ; } return 1 ; } static int iokit_properties(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TUSERDATA, USERDATA_TAG, LS_TBOOLEAN | LS_TOPTIONAL, LS_TBREAK] ; ASM_IO_OBJECT_T *obj = [skin toNSObjectAtIndex:1] ; BOOL includeNonSerializable = (lua_gettop(L) > 1) ? (BOOL)(lua_toboolean(L, 2)) : NO ; CFMutableDictionaryRef propertiesDict ; kern_return_t err = IORegistryEntryCreateCFProperties(obj.object, &propertiesDict, kCFAllocatorDefault, kNilOptions) ; if (err == KERN_SUCCESS) { lua_newtable(L) ; if (propertiesDict) { NSDictionary *properties = (__bridge_transfer NSDictionary *)propertiesDict ; [properties enumerateKeysAndObjectsUsingBlock:^(NSString *key, id value, __unused BOOL *stop) { // don't bother with properties we can't represent unless asked if (includeNonSerializable || !([(NSObject *)value isKindOfClass:[NSString class]] && [(NSString *)value hasSuffix:@" is not serializable"])) { [skin pushNSObject:value withOptions:LS_NSDescribeUnknownTypes] ; lua_setfield(L, -2, key.UTF8String) ; } }] ; } } else { [LuaSkin logDebug:[NSString stringWithFormat:@"%s:properties -- unable to retrieve IOObject properties (Kernel Error #%d)", USERDATA_TAG, err]] ; lua_pushnil(L) ; } return 1 ; } static int iokit_entryID(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TUSERDATA, USERDATA_TAG, LS_TBREAK] ; ASM_IO_OBJECT_T *obj = [skin toNSObjectAtIndex:1] ; uint64_t entryID ; kern_return_t err = IORegistryEntryGetRegistryEntryID(obj.object, &entryID) ; if (err == KERN_SUCCESS) { lua_pushinteger(L, (lua_Integer)entryID) ; } else { [LuaSkin logDebug:[NSString stringWithFormat:@"%s:entryID -- unable to retrieve IOObject entryID (Kernel Error #%d)", USERDATA_TAG, err]] ; lua_pushnil(L) ; } return 1 ; } static int iokit_equals(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TUSERDATA, USERDATA_TAG, LS_TUSERDATA, USERDATA_TAG, LS_TBREAK] ; ASM_IO_OBJECT_T *obj1 = [skin toNSObjectAtIndex:1] ; ASM_IO_OBJECT_T *obj2 = [skin toNSObjectAtIndex:2] ; lua_pushboolean(L, (Boolean)IOObjectIsEqualTo(obj1.object, obj2.object)) ; return 1 ; } static int iokit_childrenInPlane(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TUSERDATA, USERDATA_TAG, LS_TSTRING | LS_TOPTIONAL, LS_TBREAK] ; ASM_IO_OBJECT_T *obj = [skin toNSObjectAtIndex:1] ; io_name_t plane = kIOServicePlane ; if (lua_gettop(L) > 1) strncpy(plane, lua_tostring(L, 2), sizeof(io_name_t)) ; io_iterator_t iterator = 0 ; kern_return_t err = IORegistryEntryGetChildIterator(obj.object, plane, &iterator) ; if (err == KERN_SUCCESS) { lua_newtable(L) ; io_object_t entry = 0 ; while ((entry = IOIteratorNext(iterator))) { [skin pushNSObject:[[ASM_IO_OBJECT_T alloc] initWithObjet:entry]] ; err = IOObjectRelease(entry) ; lua_rawseti(L, -2, luaL_len(L, -2) + 1) ; if (err != KERN_SUCCESS) { [LuaSkin logDebug:[NSString stringWithFormat:@"%s:childrenInPlane(%s) -- unable to release entry %lld (Kernel Error #%d)", USERDATA_TAG, plane, luaL_len(L, -2), err]] ; } } err = IOObjectRelease(iterator) ; if (err != KERN_SUCCESS) { [LuaSkin logDebug:[NSString stringWithFormat:@"%s:childrenInPlane(%s) -- unable to release iterator (Kernel Error #%d)", USERDATA_TAG, plane, err]] ; } } else { [LuaSkin logDebug:[NSString stringWithFormat:@"%s:childrenInPlane(%s) -- unable to get iterator (Kernel Error #%d)", USERDATA_TAG, plane, err]] ; lua_pushnil(L) ; } return 1 ; } static int iokit_parentsInPlane(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TUSERDATA, USERDATA_TAG, LS_TSTRING | LS_TOPTIONAL, LS_TBREAK] ; ASM_IO_OBJECT_T *obj = [skin toNSObjectAtIndex:1] ; io_name_t plane = kIOServicePlane ; if (lua_gettop(L) > 1) strncpy(plane, lua_tostring(L, 2), sizeof(io_name_t)) ; io_iterator_t iterator = 0 ; kern_return_t err = IORegistryEntryGetParentIterator(obj.object, plane, &iterator) ; if (err == KERN_SUCCESS) { lua_newtable(L) ; io_object_t entry = 0 ; while ((entry = IOIteratorNext(iterator))) { [skin pushNSObject:[[ASM_IO_OBJECT_T alloc] initWithObjet:entry]] ; err = IOObjectRelease(entry) ; lua_rawseti(L, -2, luaL_len(L, -2) + 1) ; if (err != KERN_SUCCESS) { [LuaSkin logDebug:[NSString stringWithFormat:@"%s:parentsInPlane(%s) -- unable to release entry %lld (Kernel Error #%d)", USERDATA_TAG, plane, luaL_len(L, -2), err]] ; } } err = IOObjectRelease(iterator) ; if (err != KERN_SUCCESS) { [LuaSkin logDebug:[NSString stringWithFormat:@"%s:parentsInPlane(%s) -- unable to release iterator (Kernel Error #%d)", USERDATA_TAG, plane, err]] ; } } else { [LuaSkin logDebug:[NSString stringWithFormat:@"%s:parentsInPlane(%s) -- unable to get iterator (Kernel Error #%d)", USERDATA_TAG, plane, err]] ; lua_pushnil(L) ; } return 1 ; } static int iokit_conformsTo(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TUSERDATA, USERDATA_TAG, LS_TSTRING, LS_TBREAK] ; ASM_IO_OBJECT_T *obj = [skin toNSObjectAtIndex:1] ; io_name_t className ; strncpy(className, lua_tostring(L, 2), sizeof(io_name_t)) ; lua_pushboolean(L, (Boolean)IOObjectConformsTo(obj.object, className)) ; return 1 ; } static int iokit_locationInPlane(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TUSERDATA, USERDATA_TAG, LS_TSTRING | LS_TOPTIONAL, LS_TBREAK] ; ASM_IO_OBJECT_T *obj = [skin toNSObjectAtIndex:1] ; io_name_t plane = kIOServicePlane ; io_name_t location ; if (lua_gettop(L) > 1) strncpy(plane, lua_tostring(L, 2), sizeof(io_name_t)) ; kern_return_t err = IORegistryEntryGetLocationInPlane(obj.object, plane, location) ; if (err == KERN_SUCCESS) { lua_pushstring(L, location) ; } else { [LuaSkin logDebug:[NSString stringWithFormat:@"%s:locationInPlane(%s) -- unable to retrieve IOObject location (Kernel Error #%d)", USERDATA_TAG, plane, err]] ; lua_pushnil(L) ; } return 1 ; } static int iokit_nameInPlane(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TUSERDATA, USERDATA_TAG, LS_TSTRING | LS_TOPTIONAL, LS_TBREAK] ; ASM_IO_OBJECT_T *obj = [skin toNSObjectAtIndex:1] ; io_name_t plane = kIOServicePlane ; io_name_t name ; if (lua_gettop(L) > 1) strncpy(plane, lua_tostring(L, 2), sizeof(io_name_t)) ; kern_return_t err = IORegistryEntryGetNameInPlane(obj.object, plane, name) ; if (err == KERN_SUCCESS) { lua_pushstring(L, name) ; } else { [LuaSkin logDebug:[NSString stringWithFormat:@"%s:nameInPlane(%s) -- unable to retrieve IOObject location (Kernel Error #%d)", USERDATA_TAG, plane, err]] ; lua_pushnil(L) ; } return 1 ; } static int iokit_pathInPlane(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TUSERDATA, USERDATA_TAG, LS_TSTRING | LS_TOPTIONAL, LS_TBREAK] ; ASM_IO_OBJECT_T *obj = [skin toNSObjectAtIndex:1] ; io_name_t plane = kIOServicePlane ; io_string_t path ; if (lua_gettop(L) > 1) strncpy(plane, lua_tostring(L, 2), sizeof(io_name_t)) ; kern_return_t err = IORegistryEntryGetPath(obj.object, plane, path) ; if (err == KERN_SUCCESS) { lua_pushstring(L, path) ; } else { [LuaSkin logDebug:[NSString stringWithFormat:@"%s:pathInPlane(%s) -- unable to retrieve IOObject location (Kernel Error #%d)", USERDATA_TAG, plane, err]] ; lua_pushnil(L) ; } return 1 ; } static int iokit_inPlane(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TUSERDATA, USERDATA_TAG, LS_TSTRING | LS_TOPTIONAL, LS_TBREAK] ; ASM_IO_OBJECT_T *obj = [skin toNSObjectAtIndex:1] ; io_name_t plane = kIOServicePlane ; if (lua_gettop(L) > 1) strncpy(plane, lua_tostring(L, 2), sizeof(io_name_t)) ; lua_pushboolean(L, (Boolean)IORegistryEntryInPlane(obj.object, plane)) ; return 1 ; } static int iokit_searchForProperty(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TUSERDATA, USERDATA_TAG, LS_TSTRING, LS_TBREAK | LS_TVARARG] ; ASM_IO_OBJECT_T *obj = [skin toNSObjectAtIndex:1] ; NSString *key = [skin toNSObjectAtIndex:2] ; io_name_t plane = kIOServicePlane ; IOOptionBits options = kIORegistryIterateRecursively ; switch(lua_gettop(L)) { case 3: if (lua_type(L, 3) == LUA_TBOOLEAN) break ; case 4: [skin checkArgs:LS_TUSERDATA, USERDATA_TAG, LS_TSTRING, LS_TSTRING, LS_TBOOLEAN | LS_TOPTIONAL, LS_TBREAK] ; strncpy(plane, lua_tostring(L, 3), sizeof(io_name_t)) ; break ; } if (lua_type(L, -1) == LUA_TBOOLEAN && lua_toboolean(L, -1)) options |= kIORegistryIterateParents ; CFTypeRef result = IORegistryEntrySearchCFProperty(obj.object, plane, (__bridge CFStringRef)key, kCFAllocatorDefault, options) ; if (result) { [skin pushNSObject:(__bridge_transfer id)result] ; } else { lua_pushnil(L) ; } return 1 ; } #pragma mark - Module Constants #pragma mark - Lua<->NSObject Conversion Functions // These must not throw a lua error to ensure LuaSkin can safely be used from Objective-C // delegates and blocks. static int pushASM_IO_OBJECT_T(lua_State *L, id obj) { ASM_IO_OBJECT_T *value = obj; value.selfRefCount++ ; void** valuePtr = lua_newuserdata(L, sizeof(ASM_IO_OBJECT_T *)); *valuePtr = (__bridge_retained void *)value; luaL_getmetatable(L, USERDATA_TAG); lua_setmetatable(L, -2); return 1; } static id toASM_IO_OBJECT_TFromLua(lua_State *L, int idx) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; ASM_IO_OBJECT_T *value ; if (luaL_testudata(L, idx, USERDATA_TAG)) { value = get_objectFromUserdata(__bridge ASM_IO_OBJECT_T, L, idx, USERDATA_TAG) ; } else { [skin logError:[NSString stringWithFormat:@"expected %s object, found %s", USERDATA_TAG, lua_typename(L, lua_type(L, idx))]] ; } return value ; } #pragma mark - Hammerspoon/Lua Infrastructure static int userdata_tostring(lua_State* L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; ASM_IO_OBJECT_T *obj = [skin luaObjectAtIndex:1 toClass:"ASM_IO_OBJECT_T"] ; io_name_t name ; kern_return_t err = IORegistryEntryGetName(obj.object, name) ; NSString *title ; if (err == KERN_SUCCESS) { title = [NSString stringWithUTF8String:name] ; } else { title = @"<err>" ; [LuaSkin logDebug:[NSString stringWithFormat:@"%s:__tostring -- unable to retrieve IOObject name (Kernel Error #%d)", USERDATA_TAG, err]] ; lua_pushnil(L) ; } [skin pushNSObject:[NSString stringWithFormat:@"%s: %@ (%p)", USERDATA_TAG, title, lua_topointer(L, 1)]] ; return 1 ; } static int userdata_eq(lua_State* L) { // can't get here if at least one of us isn't a userdata type, and we only care if both types are ours, // so use luaL_testudata before the macro causes a lua error if (luaL_testudata(L, 1, USERDATA_TAG) && luaL_testudata(L, 2, USERDATA_TAG)) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; ASM_IO_OBJECT_T *obj1 = [skin luaObjectAtIndex:1 toClass:"ASM_IO_OBJECT_T"] ; ASM_IO_OBJECT_T *obj2 = [skin luaObjectAtIndex:2 toClass:"ASM_IO_OBJECT_T"] ; // lua_pushboolean(L, [obj1 isEqualTo:obj2]) ; lua_pushboolean(L, (Boolean)IOObjectIsEqualTo(obj1.object, obj2.object)) ; } else { lua_pushboolean(L, NO) ; } return 1 ; } static int userdata_gc(lua_State* L) { ASM_IO_OBJECT_T *obj = get_objectFromUserdata(__bridge_transfer ASM_IO_OBJECT_T, L, 1, USERDATA_TAG) ; if (obj) { obj.selfRefCount-- ; if (obj.selfRefCount == 0) { obj = nil ; } } // Remove the Metatable so future use of the variable in Lua won't think its valid lua_pushnil(L) ; lua_setmetatable(L, 1) ; return 0 ; } // static int meta_gc(lua_State* __unused L) { // return 0 ; // } // Metatable for userdata objects static const luaL_Reg userdata_metaLib[] = { {"name", iokit_name}, {"class", iokit_class}, {"properties", iokit_properties}, {"registryID", iokit_entryID}, {"sameAs", iokit_equals}, {"childrenInPlane", iokit_childrenInPlane}, {"parentsInPlane", iokit_parentsInPlane}, {"conformsTo", iokit_conformsTo}, {"locationInPlane", iokit_locationInPlane}, {"nameInPlane", iokit_nameInPlane}, {"pathInPlane", iokit_pathInPlane}, {"inPlane", iokit_inPlane}, {"searchForProperty", iokit_searchForProperty}, {"__tostring", userdata_tostring}, {"__eq", userdata_eq}, {"__gc", userdata_gc}, {NULL, NULL} }; #if defined(SOURCE_PATH) && ! defined(RELEASE_VERSION) #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) static int source_path(lua_State *L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; [skin checkArgs:LS_TBREAK] ; lua_pushstring(L, TOSTRING(SOURCE_PATH)) ; return 1 ; } #undef TOSTRING #undef STRINGIFY #endif // Functions for returned object when module loads static luaL_Reg moduleLib[] = { {"root", iokit_rootEntry}, {"serviceMatching", iokit_serviceMatching}, {"servicesMatching", iokit_servicesMatching}, {"serviceForPath", iokit_serviceFromPath}, {"dictionaryMatchingName", iokit_dictionaryMatchingName}, {"dictionaryMatchingClass", iokit_dictionaryMatchingClass}, {"dictionaryMatchingRegistryID", iokit_dictionaryMatchingEntryID}, {"dictionaryMatchingBSDName", iokit_dictionaryMatchingBSDName}, {"bundleIDForClass", iokit_bundleIdentifierForClass}, {"superclassForClass", iokit_superclassForClass}, #if defined(SOURCE_PATH) && ! defined(RELEASE_VERSION) {"_source_path", source_path}, #endif {NULL, NULL} }; // // Metatable for module, if needed // static const luaL_Reg module_metaLib[] = { // {"__gc", meta_gc}, // {NULL, NULL} // }; // NOTE: ** Make sure to change luaopen_..._internal ** int luaopen_hs__asm_iokit_internal(lua_State* L) { LuaSkin *skin = [LuaSkin sharedWithState:L] ; refTable = [skin registerLibraryWithObject:USERDATA_TAG functions:moduleLib metaFunctions:nil // or module_metaLib objectFunctions:userdata_metaLib]; [skin registerPushNSHelper:pushASM_IO_OBJECT_T forClass:"ASM_IO_OBJECT_T"]; [skin registerLuaObjectHelper:toASM_IO_OBJECT_TFromLua forClass:"ASM_IO_OBJECT_T" withUserdataMapping:USERDATA_TAG]; return 1; }
{ "content_hash": "cd4a827e4e18a4cb682dc182774132a1", "timestamp": "", "source": "github", "line_count": 605, "max_line_length": 184, "avg_line_length": 40.45289256198347, "alnum_prop": 0.630424123559696, "repo_name": "asmagill/hammerspoon_asm", "id": "b74acfe935d58114eee3b44abfc5ad2599efd738", "size": "24474", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "iokit/internal.m", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "235183" }, { "name": "Lua", "bytes": "352790" }, { "name": "Makefile", "bytes": "123733" }, { "name": "Objective-C", "bytes": "1227281" } ], "symlink_target": "" }
(HMAC signed URLs) [![npm](https://img.shields.io/npm/v/hsu.svg)](https://www.npmjs.com/package/hsu) [![Build Status](https://travis-ci.org/smebberson/hsu.svg?branch=master)](https://travis-ci.org/smebberson/hsu) [![Coverage Status](https://coveralls.io/repos/github/smebberson/hsu/badge.svg?branch=master)](https://coveralls.io/github/smebberson/hsu?branch=master) Express middleware to generate and verify rolling, HMAC signed, timed URLs. The HMAC digest is verified using information in the users session. Any previous digests are instantly replaced when a new one is created (i.e. rolling). You can have concurrent signed URLs for the same user. There are three stages to HSU: - The create stage in which a signed URL is created (i.e. password reset form in which the users email address is collected). - The verify stage in which a URL is protected unless the signed URL is verified (i.e. the password reset form in which the new password is collected, the link to this form usually comes from an email). - The complete stage in which the URL has been consumed and is removed such that it can't be used again (i.e. the users password was successfully reset; we don't want that URL to be able to reset their password again). HSU also aims to meet the following goals: - The route should be locked down to the device in which the request was made. - No one should have access to the password reset route (verify stage) unless they have a verifiable signed URL. - You should be able to restart the process at anytime, at which point, all previous signed URLs become unusable. - One the process has been completed, all previous signed URLs become unusable. - A signed URL should only be valid for a limited amount of time (1 hour by default). ## Install ``` $ npm install hsu ``` ## API ``` var hsu = require('hsu'); ``` ### hsu(options) Creates a function (i.e. `hsuProtect`) which is called with an `id` to scope the middleware (allows multiple signed URLs to be in affect for the one user concurrently). ``` var hsuProtect = hsu({ secret: '4B[>9=&DziVm7' }); ``` #### Options The `hsu` function takes a required `options` object. The options object has both a required key, and an optional key. ##### Required keys The `hsu` `options` object must have the following required key: ###### secret A string which will be used in the HMAC digest generation. ##### Optional keys The `hsu` `options` object can also contain any of the following optional keys: ###### sessionKey Determines which property ('key') on `req` the session object is located. Defaults to `session` (i.e. `req.session`). The salt used to create the HMAC digest is stored and read as `req[sessionKey].hsuSalt`. ###### ttl The number of seconds the URL should be valid for. Defaults to 1 hour (i.e. 3600 seconds). ### hsuProtect(id) _**Please note:** `hsuProtect` is not part of the actual API it's just the name of the variable holding the function produced by calling `hsu(options)`._ Generates three different middleware, all scoped to the `id`, one for each stage of the process (i.e. setup, verify and complete). `id` scoping allows you to allows multiple signed URLs to be in affect for the one user concurrently. The `id` semantically should represent the process: ``` hsuProtect('verify-primary-email').setup // Function hsuProtect('verify-primary-email').verify // Function hsuProtect('verify-primary-email').complete // Function hsuProtect('verify-recovery-email').setup // Function hsuProtect('verify-recovery-email').verify // Function hsuProtect('verify-recovery-email').complete // Function ``` #### hsuProtect(id).setup This middleware adds a `req.signUrl(urlToSign)` function to make a signed URL. You need to pass a URL (`urlToSign`) to this function and it will return the original URL with a signed component. ``` var signedUrl = req.signUrl('https://domain.com/reset?user=6dg3tct749fj1&ion=1&espv=2'); console.log(signedUrl); // https://domain.com/reset?user=6dg3tct749fj1&ion=1&espv=2&signature=kV5lVrYg05wFD6KArI0HrkrwpkAHphLqTPTq1VUjmoY%3D ``` #### hsuProtect(id).verify This middleware will 403 on all requests that are not verifiable signed URLs. #### hsuProtect(id).complete This middleware adds a `req.hsuComplete()` function that will mark a current signed URL as complete and render it unusable. Future requests to the same URL will 403. Use the `req.hsuComplete()` function only after your process has completed. For example, in the case of a password reset, only once you're database has been successfully updated with a new password. This allows the user to request the signed URL multiple times with success, before completing the process. ## Example ### A simple Express example The following is an example of using HSU to generate a signed URL, and then verify it on the next request. ``` var express = require('express'), cookieSession = require('cookie-session') hsu = require('hsu'); // setup route middleware var hsuProtect = hsu({ secret: '9*3>Ne>aKk4g)' }); // create the express app var app = express() // we need a session app.use(cookieSession({ keys: ['A', 'B', 'C'] })); // setup an email that requests a users password app.get('/account/reset', function (req, res, next) { res.render('account-reset-email'); }); // setup a route that will email the user a signed URL app.post('/account/reset', hsuProtect('account-reset').setup, function (req, res, next) { var signedUrl = req.signUrl('/account/' + req.user.id + '/reset'); // send email to user res.render('account-reset-email-sent'); }); // setup a route to verify the signed URL app.get('/acount/:id/reset', hsuProtect('account-reset').verify, function (req, res, next) { // This will only be called if the signed URL passed // otherwise a HTTP status of 403 will be returned and this // will never execute. res.render('account-new-password'); }); // setup a route to complete the process app.post('/account/:id/reset', hsuProtect('account-reset').complete, function (req, res, next) { // update the database with the new password // render the signed URL unusable req.hsuComplete(); res.render('account-new-password-complete'); }); ``` ### Custom error handling When signed URL verification fails, an error is thrown that has `err.code === 'EBADHMACDIGEST'`. This can be used to display custom error messages. ``` var express = require('express'), cookieSession = require('cookie-session') hsu = require('hsu'); // setup route middleware var hsuProtect = hsu({ secret: '9*3>Ne>aKk4g)' }); // create the express app var app = express() // we need a session app.use(cookieSession({ keys: ['A', 'B', 'C'] })); // setup an email that requests a users password app.get('/account/reset', function (req, res, next) { res.render('account-reset-email'); }); // setup a route that will email the user a signed URL app.post('/account/reset', hsuProtect('account-reset').setup, function (req, res, next) { var signedUrl = req.signUrl('/account/' + req.user.id + '/reset'); // send email to user res.render('account-reset-email-sent'); }); // setup a route to verify the signed URL app.get('/acount/:id/reset', hsuProtect('account-reset').verify, function (req, res, next) { // This will only be called if the signed URL passed // otherwise a HTTP status of 403 will be returned and this // will never execute. res.render('account-new-password'); }); // setup a route to complete the process app.post('/account/:id/reset', hsuProtect('account-reset').complete, function (req, res, next) { // update the database with the new password // render the signed URL unusable req.hsuComplete(); res.render('account-new-password-complete'); }); // error handler app.use(function (err, req, res, next) { if (err.code !== 'EBADHMACDIGEST') { return next(err); } // handle HMAC digest errors here res.status(403).send('URL has been tampered with.'); }); ``` ## Change log [Review the change log for all changes.](CHANGELOG.md) ## Contributing Contributors are welcomed. HSU comes complete with an isolated development environment. You can [read more about contributing to HSU here](CONTRIBUTING.md). ## License [MIT](LICENSE.md)
{ "content_hash": "1e1a7628ebc05a3f156a5e56914889ff", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 305, "avg_line_length": 33.369477911646584, "alnum_prop": 0.7177759056444819, "repo_name": "smebberson/hsu", "id": "809b8b62deab439ed4091326a372e676c5374b20", "size": "8316", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "33942" }, { "name": "Shell", "bytes": "3735" } ], "symlink_target": "" }
package com.opensymphony.xwork2; import com.opensymphony.xwork2.config.ConfigurationException; import com.opensymphony.xwork2.config.entities.ActionConfig; import com.opensymphony.xwork2.config.entities.InterceptorConfig; import com.opensymphony.xwork2.config.entities.ResultConfig; import com.opensymphony.xwork2.conversion.TypeConverter; import com.opensymphony.xwork2.factory.*; import com.opensymphony.xwork2.inject.Container; import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.interceptor.Interceptor; import com.opensymphony.xwork2.util.ClassLoaderUtil; import com.opensymphony.xwork2.validator.Validator; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.Serializable; import java.util.Map; /** * ObjectFactory is responsible for building the core framework objects. Users may register their * own implementation of the ObjectFactory to control instantiation of these Objects. * * <p> * This default implementation uses the {@link #buildBean(Class,java.util.Map) buildBean} * method to create all classes (interceptors, actions, results, etc). * </p> * * @author Jason Carreira */ public class ObjectFactory implements Serializable { private static final Logger LOG = LogManager.getLogger(ObjectFactory.class); private transient ClassLoader ccl; private Container container; private ActionFactory actionFactory; private ResultFactory resultFactory; private InterceptorFactory interceptorFactory; private ValidatorFactory validatorFactory; private ConverterFactory converterFactory; private UnknownHandlerFactory unknownHandlerFactory; @Inject(value="objectFactory.classloader", required=false) public void setClassLoader(ClassLoader cl) { this.ccl = cl; } @Inject public void setContainer(Container container) { this.container = container; } @Inject public void setActionFactory(ActionFactory actionFactory) { this.actionFactory = actionFactory; } @Inject public void setResultFactory(ResultFactory resultFactory) { this.resultFactory = resultFactory; } @Inject public void setInterceptorFactory(InterceptorFactory interceptorFactory) { this.interceptorFactory = interceptorFactory; } @Inject public void setValidatorFactory(ValidatorFactory validatorFactory) { this.validatorFactory = validatorFactory; } @Inject public void setConverterFactory(ConverterFactory converterFactory) { this.converterFactory = converterFactory; } @Inject public void setUnknownHandlerFactory(UnknownHandlerFactory unknownHandlerFactory) { this.unknownHandlerFactory = unknownHandlerFactory; } /** * Allows for ObjectFactory implementations that support * Actions without no-arg constructors. * * @return true if no-arg constructor is required, false otherwise */ public boolean isNoArgConstructorRequired() { return true; } /** * Utility method to obtain the class matched to className. Caches look ups so that subsequent * lookups will be faster. * * @param className The fully qualified name of the class to return * @return The class itself * @throws ClassNotFoundException if class not found in classpath */ public Class getClassInstance(String className) throws ClassNotFoundException { if (ccl != null) { return ccl.loadClass(className); } return ClassLoaderUtil.loadClass(className, this.getClass()); } /** * Build an instance of the action class to handle a particular request (eg. web request) * @param actionName the name the action configuration is set up with in the configuration * @param namespace the namespace the action is configured in * @param config the action configuration found in the config for the actionName / namespace * @param extraContext a Map of extra context which uses the same keys as the {@link com.opensymphony.xwork2.ActionContext} * @return instance of the action class to handle a web request * @throws Exception in case of any error */ public Object buildAction(String actionName, String namespace, ActionConfig config, Map<String, Object> extraContext) throws Exception { // 源码解析: 通过ActionFactory创建Action实例 return actionFactory.buildAction(actionName, namespace, config, extraContext); } /** * Build a generic Java object of the given type. * * @param clazz the type of Object to build * @param extraContext a Map of extra context which uses the same keys as the {@link com.opensymphony.xwork2.ActionContext} * @return object for the given type * @throws Exception in case of any error */ public Object buildBean(Class clazz, Map<String, Object> extraContext) throws Exception { return clazz.newInstance(); } /** * @param obj object to inject internal * @return the object */ protected Object injectInternalBeans(Object obj) { if (obj != null && container != null) { container.inject(obj); } return obj; } /** * Build a generic Java object of the given type. * * @param className the type of Object to build * @param extraContext a Map of extra context which uses the same keys as the {@link com.opensymphony.xwork2.ActionContext} * @return object for the given type * @throws Exception in case of any error */ public Object buildBean(String className, Map<String, Object> extraContext) throws Exception { return buildBean(className, extraContext, true); } /** * Build a generic Java object of the given type. * * @param className the type of Object to build * @param extraContext a Map of extra context which uses the same keys as the {@link com.opensymphony.xwork2.ActionContext} * @param injectInternal true if inject internal beans * @return object for the given type * @throws Exception in case of any error */ public Object buildBean(String className, Map<String, Object> extraContext, boolean injectInternal) throws Exception { Class clazz = getClassInstance(className); Object obj = buildBean(clazz, extraContext); if (injectInternal) { injectInternalBeans(obj); } return obj; } /** * Builds an Interceptor from the InterceptorConfig and the Map of * parameters from the interceptor reference. Implementations of this method * should ensure that the Interceptor is parametrized with both the * parameters from the Interceptor config and the interceptor ref Map (the * interceptor ref params take precedence), and that the Interceptor.init() * method is called on the Interceptor instance before it is returned. * * @param interceptorConfig the InterceptorConfig from the configuration * @param interceptorRefParams a Map of params provided in the Interceptor reference in the * Action mapping or InterceptorStack definition * @return interceptor */ public Interceptor buildInterceptor(InterceptorConfig interceptorConfig, Map<String, String> interceptorRefParams) throws ConfigurationException { return interceptorFactory.buildInterceptor(interceptorConfig, interceptorRefParams); } /** * Build a Result using the type in the ResultConfig and set the parameters in the ResultConfig. * * @param resultConfig the ResultConfig found for the action with the result code returned * @param extraContext a Map of extra context which uses the same keys as the {@link com.opensymphony.xwork2.ActionContext} * * @return result * @throws Exception in case of any error */ public Result buildResult(ResultConfig resultConfig, Map<String, Object> extraContext) throws Exception { return resultFactory.buildResult(resultConfig, extraContext); } /** * Build a Validator of the given type and set the parameters on it * * @param className the type of Validator to build * @param params property name -&gt; value Map to set onto the Validator instance * @param extraContext a Map of extra context which uses the same keys as the {@link com.opensymphony.xwork2.ActionContext} * * @return validator of the given type * @throws Exception in case of any error */ public Validator buildValidator(String className, Map<String, Object> params, Map<String, Object> extraContext) throws Exception { return validatorFactory.buildValidator(className, params, extraContext); } /** * Build converter of given type * * @param converterClass to instantiate * @param extraContext a Map of extra context which uses the same keys as the {@link com.opensymphony.xwork2.ActionContext} * @return instance of converterClass with inject dependencies * @throws Exception in case of any error */ public TypeConverter buildConverter(Class<? extends TypeConverter> converterClass, Map<String, Object> extraContext) throws Exception { return converterFactory.buildConverter(converterClass, extraContext); } /** * Builds unknown handler * * @param unknownHandlerName the unknown handler name * @param extraContext extra context * @return a unknown handler * @throws Exception in case of any error */ public UnknownHandler buildUnknownHandler(String unknownHandlerName, Map<String, Object> extraContext) throws Exception { return unknownHandlerFactory.buildUnknownHandler(unknownHandlerName, extraContext); } }
{ "content_hash": "aa89d4fb0e7b26af2eb1c23bb38882e1", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 150, "avg_line_length": 39.70564516129032, "alnum_prop": 0.7165634203310653, "repo_name": "txazo/struts2", "id": "40ace6407f35e3bfe455af96546e8af055b3a6ab", "size": "10495", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/opensymphony/xwork2/ObjectFactory.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "5295" }, { "name": "FreeMarker", "bytes": "168228" }, { "name": "HTML", "bytes": "18991" }, { "name": "Java", "bytes": "4490044" }, { "name": "JavaScript", "bytes": "28734" }, { "name": "XSLT", "bytes": "258" } ], "symlink_target": "" }
from .cwrap import cwrap
{ "content_hash": "0dab7803793e6b46be2616943b5d74d2", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 24, "avg_line_length": 25, "alnum_prop": 0.8, "repo_name": "RPGOne/Skynet", "id": "4fa8e292a81d7d06357e3b2359b3aa6853ad0090", "size": "25", "binary": false, "copies": "1", "ref": "refs/heads/Miho", "path": "pytorch-master/tools/cwrap/__init__.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "1C Enterprise", "bytes": "36" }, { "name": "Ada", "bytes": "89079" }, { "name": "Assembly", "bytes": "11425802" }, { "name": "Batchfile", "bytes": "123467" }, { "name": "C", "bytes": "34703955" }, { "name": "C#", "bytes": "55955" }, { "name": "C++", "bytes": "84647314" }, { "name": "CMake", "bytes": "220849" }, { "name": "CSS", "bytes": "39257" }, { "name": "Cuda", "bytes": "1344541" }, { "name": "DIGITAL Command Language", "bytes": "349320" }, { "name": "DTrace", "bytes": "37428" }, { "name": "Emacs Lisp", "bytes": "19654" }, { "name": "Erlang", "bytes": "39438" }, { "name": "Fortran", "bytes": "16914" }, { "name": "HTML", "bytes": "929759" }, { "name": "Java", "bytes": "112658" }, { "name": "JavaScript", "bytes": "32806873" }, { "name": "Jupyter Notebook", "bytes": "1616334" }, { "name": "Lua", "bytes": "22549" }, { "name": "M4", "bytes": "64967" }, { "name": "Makefile", "bytes": "1046428" }, { "name": "Matlab", "bytes": "888" }, { "name": "Module Management System", "bytes": "1545" }, { "name": "NSIS", "bytes": "2860" }, { "name": "Objective-C", "bytes": "131433" }, { "name": "PHP", "bytes": "750783" }, { "name": "Pascal", "bytes": "75208" }, { "name": "Perl", "bytes": "626627" }, { "name": "Perl 6", "bytes": "2495926" }, { "name": "PowerShell", "bytes": "38374" }, { "name": "Prolog", "bytes": "300018" }, { "name": "Python", "bytes": "26363074" }, { "name": "R", "bytes": "236175" }, { "name": "Rebol", "bytes": "217" }, { "name": "Roff", "bytes": "328366" }, { "name": "SAS", "bytes": "1847" }, { "name": "Scala", "bytes": "248902" }, { "name": "Scheme", "bytes": "14853" }, { "name": "Shell", "bytes": "360815" }, { "name": "TeX", "bytes": "105346" }, { "name": "Vim script", "bytes": "6101" }, { "name": "XS", "bytes": "4319" }, { "name": "eC", "bytes": "5158" } ], "symlink_target": "" }
<?php namespace Proto\Console; use Proto\Console\Commands\Serve; use Proto\Console\Commands\CacheClear; use Proto\Console\Commands\BaseCommand; use Symfony\Component\Console\Application; class Console { public function register() { return array( Serve::class, CacheClear::class ); } /** * @param Application $application * @param BaseCommand $command * @return bool */ public function registerCommand(Application $application, BaseCommand $command) { if (!$command->isValid()) { return false; } $application->add($command); return $application; } }
{ "content_hash": "01025ce42b7fbfccca264752d81e9bc4", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 83, "avg_line_length": 20.727272727272727, "alnum_prop": 0.6140350877192983, "repo_name": "jrbarnard/fe-templating", "id": "b9669ffa0761abb341d192c199d99691607e1906", "size": "684", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "App/Console/Console.php", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "9851" }, { "name": "PHP", "bytes": "40613" } ], "symlink_target": "" }
'use strict'; angular.module('angularFullstackApp') .config(function ($stateProvider) { $stateProvider .state('admin', { url: '/admin', templateUrl: 'app/admin/admin.html', controller: 'AdminCtrl' }); });
{ "content_hash": "ece3b6b528b416213036c514eac722cf", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 44, "avg_line_length": 22.636363636363637, "alnum_prop": 0.5863453815261044, "repo_name": "sharmilajesupaul/angular-fullstack", "id": "72239da5d1d6b8bce515304f21b56b48d00aebfc", "size": "249", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "client/app/admin/admin.js", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "24139" }, { "name": "CSS", "bytes": "2188" }, { "name": "HTML", "bytes": "16499" }, { "name": "JavaScript", "bytes": "57316" } ], "symlink_target": "" }
package com.maxmouchet.vamk.timetables.parser.table trait TableParser { def parse: Array[Array[String]] }
{ "content_hash": "6a5d606294d96f5787361f2934cb9de8", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 51, "avg_line_length": 15.857142857142858, "alnum_prop": 0.7657657657657657, "repo_name": "OpenLamas/vamk-timetables", "id": "6f7b76016876d3e0bb9ab90d1644f474ab38141f", "size": "111", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/scala/src/main/scala/com/maxmouchet/vamk/timetables/parser/table/TableParser.scala", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3207" }, { "name": "CoffeeScript", "bytes": "4691" }, { "name": "JavaScript", "bytes": "2783" }, { "name": "Ruby", "bytes": "24700" }, { "name": "Scala", "bytes": "17206" }, { "name": "Shell", "bytes": "396" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/alarm_list_icon_shape" android:drawable="@drawable/alarm_list_icon_shape"/> </layer-list>
{ "content_hash": "8ab65a4cd7be745ddbcc9182fd554b99", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 71, "avg_line_length": 31.75, "alnum_prop": 0.6377952755905512, "repo_name": "EventFahrplan/EventFahrplan", "id": "f4cb0b45854bf8fb3ca3b64cc30af3d0b4a22c0f", "size": "254", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/drawable/alarm_list_icon_layer.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "60766" }, { "name": "Kotlin", "bytes": "805800" } ], "symlink_target": "" }
namespace grok { namespace input { /// class ReadLineSource ::= a character source takes input from readline class ReadLineSource { public: using char_type = char; using category = boost::iostreams::source_tag; using size_type = std::string::size_type; ReadLineSource(ReadLine RL) : RL_{ RL }, buffer_{ }, pos_{ 0 }, lines_{ 0 }, prompt_{ false } { } std::streamsize read(char_type *s, std::streamsize n); std::string& container() { return buffer_; } private: ReadLine RL_; std::string buffer_; size_type pos_; size_type lines_; bool prompt_; }; using ReadLineStream = boost::iostreams::stream<ReadLineSource>; } } #endif // input-stream.h
{ "content_hash": "c5cd2321a1442cbf561f6c948ca973c0", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 73, "avg_line_length": 22.64516129032258, "alnum_prop": 0.6452991452991453, "repo_name": "PrinceDhaliwal/grok", "id": "bd16773722d3bf22fa8478db7b292e91c52465fa", "size": "876", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/input/input-stream.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "94" }, { "name": "C++", "bytes": "342986" }, { "name": "CMake", "bytes": "14557" }, { "name": "JavaScript", "bytes": "39257" } ], "symlink_target": "" }
package org.drools.compiler.integrationtests; import org.drools.compiler.CommonTestMethodBase; import org.drools.core.common.DroolsObjectInputStream; import org.drools.core.common.DroolsObjectOutputStream; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.kie.api.KieBase; import org.kie.api.marshalling.Marshaller; import org.kie.api.marshalling.ObjectMarshallingStrategy; import org.kie.api.marshalling.ObjectMarshallingStrategyAcceptor; import org.kie.api.runtime.KieSession; import org.kie.internal.KnowledgeBase; import org.kie.internal.marshalling.MarshallerFactory; import org.kie.internal.runtime.StatefulKnowledgeSession; import java.io.EOFException; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; public class EventAccessorRestoreTest extends CommonTestMethodBase { @Rule public TemporaryFolder temp = new TemporaryFolder(); private File kbaseFile = null; @Before public void setUp() { String str = "package org.drools.test;\n" + "" + "global java.util.List list; \n" + "\n" + "declare Tick @role(event) \n" + " @timestamp( time ) \n" + " id : int \n" + " time : long \n" + "end \n" + "" + "" + "rule \"Init\" when\n" + " $i : Integer() \n" + "then\n" + " Tick tick = new Tick( $i, new java.util.Date().getTime() ); \n" + " insert( tick ); \n" + " System.out.println( tick ); \n" + " list.add( tick ); \n" + "end\n" + ""; KnowledgeBase kbase = loadKnowledgeBaseFromString( str ); KieSession ksession = kbase.newStatefulKnowledgeSession(); try { kbaseFile = temp.newFile( "test.bin" ); FileOutputStream fos = new FileOutputStream( kbaseFile ) ; saveSession( fos, ksession ); fos.close(); } catch ( Exception e ) { e.printStackTrace(); fail( e.getMessage() ); } } public void saveSession( FileOutputStream output, KieSession ksession ) throws IOException { DroolsObjectOutputStream droolsOut = new DroolsObjectOutputStream( output ); droolsOut.writeObject( ksession.getKieBase() ); Marshaller mas = createMarshaller( ksession.getKieBase() ); mas.marshall( droolsOut, ksession ); droolsOut.flush(); droolsOut.close(); } private Marshaller createMarshaller( KieBase kbase ) { ObjectMarshallingStrategyAcceptor acceptor = MarshallerFactory.newClassFilterAcceptor( new String[]{ "*.*" } ); ObjectMarshallingStrategy strategy = MarshallerFactory.newSerializeMarshallingStrategy( acceptor ); return MarshallerFactory.newMarshaller( kbase, new ObjectMarshallingStrategy[] { strategy } ); } public KieSession loadSession( FileInputStream input ) throws IOException, ClassNotFoundException { KieSession ksession = null; DroolsObjectInputStream droolsIn = new DroolsObjectInputStream( input, this.getClass().getClassLoader() ); try { KnowledgeBase kbase = (KnowledgeBase) droolsIn.readObject(); Marshaller mas = createMarshaller( kbase ); ksession = mas.unmarshall(droolsIn); } catch ( EOFException e ) { e.printStackTrace(); fail( e.getMessage() ); } finally { droolsIn.close(); } return ksession; } @Test public void testDeserialization() { try { FileInputStream fis = new FileInputStream( kbaseFile ); KieSession knowledgeSession = loadSession( fis ); ArrayList list = new ArrayList(); knowledgeSession.setGlobal( "list", list ); knowledgeSession.insert( 30 ); knowledgeSession.fireAllRules(); assertEquals( 1, list.size() ); assertEquals( "Tick", list.get( 0 ).getClass().getSimpleName() ); } catch ( Exception e ) { e.printStackTrace(); fail( e.getMessage() ); } } }
{ "content_hash": "4b4ff9eaad87ae9d50231c7d937e776b", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 119, "avg_line_length": 35.01587301587302, "alnum_prop": 0.6101541251133273, "repo_name": "Buble1981/MyDroolsFork", "id": "b43ee1a1ade817be4fe7250c0c9aeabdfa557fae", "size": "4412", "binary": false, "copies": "2", "ref": "refs/heads/NewMavenClassLoaderResolver", "path": "drools-compiler/src/test/java/org/drools/compiler/integrationtests/EventAccessorRestoreTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1412" }, { "name": "Java", "bytes": "26177097" }, { "name": "Python", "bytes": "4529" }, { "name": "Ruby", "bytes": "491" }, { "name": "Shell", "bytes": "2039" }, { "name": "Standard ML", "bytes": "82260" }, { "name": "XSLT", "bytes": "24302" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <title>AdUrCup Dashboard</title> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Compiled and minified CSS --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/css/materialize.min.css"> <link rel="stylesheet" type="text/css" href="css/main.css"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> </head> <body class=" grey lighten-5"> <div class="container"> <div class="row"> <div class="col s12 m6 l6"> <div class="input-field col m6 l6 s12"> <select id="cutlery"> <option value="" disabled="disabled" selected>Choose Category</option> <option value="Bowl">Bowl</option> <option value="Container">Container</option> <option value="Cutlery">Cutlery</option> <option value="Cup">Cup</option> </select> <label>Crockery Type</label> </div> </div> </div> <div class="row"> <div class="input-field col m6 l6 s12"> <select id="lidavail" class="browser-default"> <option value="" disabled>Choose Lid Type</option> <option value="Available">Available</option> <option value="Not_Available" id="yes">Not Available</option> <option value="Lid_Only">Availbe with lid only</option> </select> <label>Material</label> </div> <div class="input-field col m6 l6 s12"> <input placeholder="Lid Options" id="Lid_Opt" type="text" value="NA"> <label for="Lid_Opt">Lid Options</label> </div> </div> </div> <script src="https://code.jquery.com/jquery-2.2.4.js" integrity="sha256-iT6Q9iMJYuQiMWNd9lDyBUStIq/8PuOW33aOqmvFpqI=" crossorigin="anonymous"></script> <!-- Compiled and minified JavaScript --> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/js/materialize.min.js"></script> <script type="text/javascript" src="js/index.js"></script> </body> </html>
{ "content_hash": "62a25cc9fafb6b6ab6169bb0a63df490", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 154, "avg_line_length": 30.926470588235293, "alnum_prop": 0.6395625297194484, "repo_name": "sahilkhurana19/AdUrCup-Dashboard", "id": "099c6badfb5e4321c14cbaba1e33b3a4e046993e", "size": "2103", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "main.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "23379" }, { "name": "HTML", "bytes": "20508" }, { "name": "JavaScript", "bytes": "105037" } ], "symlink_target": "" }
from django import VERSION from admin_customizer.fields import OrderPreservingManyToManyField from django.db import models class Author(models.Model): name = models.CharField(max_length=100) class Book(models.Model): name = models.CharField(max_length=100) created = models.DateTimeField(auto_now_add=True) authors = OrderPreservingManyToManyField(Author) class BookNote(models.Model): book = models.ForeignKey("Book", null=True) notes = models.TextField()
{ "content_hash": "ad73eddcd1c88eab37875c1f8d3b11ae", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 66, "avg_line_length": 32.266666666666666, "alnum_prop": 0.7665289256198347, "repo_name": "ionelmc/django-admin-customizer", "id": "870f05d598d530d42145d9c4897601ddaaeca21b", "size": "484", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/test_app/models.py", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "CSS", "bytes": "1129" }, { "name": "HTML", "bytes": "1324" }, { "name": "JavaScript", "bytes": "9420" }, { "name": "Python", "bytes": "57016" } ], "symlink_target": "" }
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace MetaCache_v3.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.3.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } }
{ "content_hash": "4cc26a83b5c62e89c1ec912c7b9c4556", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 151, "avg_line_length": 42.03846153846154, "alnum_prop": 0.5672461116193962, "repo_name": "SMihand/Cache-GlobalsProxy-Framework", "id": "e415308924537f4d647de3125605f467aece24d0", "size": "1095", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MetaEditor/Properties/Settings.Designer.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "400842" } ], "symlink_target": "" }
******** bytecode ******** ``bytecode`` is a Python module to generate and modify bytecode. * `bytecode project homepage at GitHub <https://github.com/vstinner/bytecode>`_ (code, bugs) * `bytecode documentation <https://bytecode.readthedocs.io/>`_ (this documentation) * `Download latest bytecode release at the Python Cheeseshop (PyPI) <https://pypi.python.org/pypi/bytecode>`_ Table Of Contents ================= .. toctree:: :maxdepth: 3 usage cfg api peephole byteplay_codetransformer changelog todo See also ======== * `codetransformer <https://pypi.python.org/pypi/codetransformer>`_ * `byteplay <https://github.com/serprex/byteplay>`_ * `byteasm <https://github.com/zachariahreed/byteasm>`_: an "assembler" for Python 3 bytecodes. * `BytecodeAssembler <https://pypi.python.org/pypi/BytecodeAssembler>`_ * `PEP 511 -- API for code transformers <https://www.python.org/dev/peps/pep-0511/>`_
{ "content_hash": "113340eeec9a4d0d0717f614223d8315", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 75, "avg_line_length": 22, "alnum_prop": 0.6797040169133193, "repo_name": "haypo/bytecode", "id": "7c1932a97901d72508f71ee4b9d8b7635e2073a7", "size": "946", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/index.rst", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "171321" } ], "symlink_target": "" }
ChenpingCocoa ============= just do it cocoapod
{ "content_hash": "a84f34ce77c720a51b1593dff5acdf81", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 19, "avg_line_length": 12.25, "alnum_prop": 0.5918367346938775, "repo_name": "cgpu456/ChenpingCocoa", "id": "a3451f5ba48ba5370793dc4bd9f79d3c8f8f1bd9", "size": "49", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package com.mpwc.service.impl; import java.util.Date; import java.util.List; import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; import com.mpwc.model.Project; import com.mpwc.model.TimeBox; import com.mpwc.model.Worker; import com.mpwc.service.ProjectLocalServiceUtil; import com.mpwc.service.TimeBoxLocalServiceUtil; import com.mpwc.service.base.ProjectLocalServiceBaseImpl; import com.mpwc.service.persistence.ProjectFinderUtil; /** * The implementation of the project local service. * * <p> * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link com.mpwc.service.ProjectLocalService} interface. * * <p> * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM. * </p> * * @author rsicart * @see com.mpwc.service.base.ProjectLocalServiceBaseImpl * @see com.mpwc.service.ProjectLocalServiceUtil */ public class ProjectLocalServiceImpl extends ProjectLocalServiceBaseImpl { /* * NOTE FOR DEVELOPERS: * * Never reference this interface directly. Always use {@link com.mpwc.service.ProjectLocalServiceUtil} to access the project local service. */ public List<Project> getProjectsByName(String name) throws PortalException, SystemException { // return bookPersistence.findByTitle(title); return ProjectFinderUtil.getProjectsByName("%" + name + "%"); } public List<Project> getProjectsByStatusDesc(String desc) throws PortalException, SystemException { // return bookPersistence.findByTitle(title); return ProjectFinderUtil.getProjectsByStatusDesc("%" + desc + "%"); } public List<Project> getProjectsByFilters(String desc, String name, String type, String descShort, Date startDate, Date endDate, Double costEstimatedeuros, long timeEstimatedHours, boolean canSetWorkerHours, String comments) throws SystemException { return ProjectFinderUtil.getProjectsByFilters(desc, name, type, descShort, startDate, endDate, costEstimatedeuros, timeEstimatedHours, canSetWorkerHours, comments); } public Project add(Project project) throws SystemException, PortalException { //create new project Project p = projectPersistence.create(counterLocalService.increment(Project.class.getName())); //add resources resourceLocalService.addResources(p.getCompanyId(), p.getGroupId(), Project.class.getName(), false); //set project properties p.setName(project.getName()); p.setType(project.getType()); p.setDescShort(project.getDescShort()); p.setDescFull(project.getDescFull()); p.setStartDate(project.getStartDate()); p.setEndDate(project.getEndDate()); p.setCostEstimatedEuros(project.getCostEstimatedEuros()); p.setTimeEstimatedHours(project.getTimeEstimatedHours()); p.setCanSetWorkerHours(project.getCanSetWorkerHours()); p.setComments(project.getComments()); p.setProjectStatusId(project.getProjectStatusId()); p.setCreateDate(project.getCreateDate()); //other properties p.setCompanyId(project.getCompanyId()); p.setGroupId(project.getGroupId()); return projectPersistence.update(p, false); } /* Worker related operations * (see ProjectPersistenceImpl.java to find more methods to add) */ public List<Worker> getWorkers(long projectId) throws SystemException { return projectPersistence.getWorkers(projectId); } public long addWorker(long projectId, long workerId) throws SystemException { System.out.println("ProjectLocalServiceImpl addWorker "+workerId+" to project "+projectId); projectPersistence.addWorker(projectId, workerId); return workerId; } public long addWorker(long projectId, Worker worker) throws SystemException { projectPersistence.addWorker(projectId, worker); return worker.getWorkerId(); } public void setWorkers(long projectId, List<Worker> workerList) throws SystemException { projectPersistence.setWorkers(projectId, workerList); } public long removeWorker(long projectId, long workerId) throws SystemException { Project p; try { p = ProjectLocalServiceUtil.getProject(projectId); //remove project manager if is this worker if(p.getWorkerId()==workerId){ p.setWorkerId(0); ProjectLocalServiceUtil.updateProject(p); } } catch (PortalException e) { System.out.println("removeWorker exception:"+e.getMessage()); } projectPersistence.removeWorker(projectId, workerId); return workerId; } public long removeWorker(long projectId, Worker worker) throws SystemException { Project p; try { p = ProjectLocalServiceUtil.getProject(projectId); //remove project manager if is this worker if(p.getWorkerId()==worker.getWorkerId()){ p.setWorkerId((Long)null); ProjectLocalServiceUtil.updateProject(p); } } catch (PortalException e) { System.out.println("removeWorker exception:"+e.getMessage()); } projectPersistence.removeWorker(projectId, worker); return worker.getWorkerId(); } public int addProjectWorker(long projectId, long workerId) throws SystemException { //Bug LPS-29668 in liferay portal, dont uncomment until 6.2 (or 6.1.1 GA2 patched) //projectPersistence.addWorker(projectId, workerId); //Temporal alternative solution, instead line above, use finder method below System.out.println("ProjectLocalServiceImpl addProjectWorker "+workerId+" to project "+projectId); int res = ProjectFinderUtil.addProjectWorker(projectId, workerId); return res; } public int delProjectWorker(long projectId, long workerId) throws SystemException { //Bug LPS-29668 in liferay portal, dont uncomment until 6.2 (or 6.1.1 GA2 patched) //projectPersistence.removeWorker(projectId, workerId); //Temporal alternative solution, instead line above, use finder method below System.out.println("ProjectLocalServiceImpl delProjectWorker "+workerId+" from project "+projectId); int res = ProjectFinderUtil.delProjectWorker(projectId, workerId); return res; } public boolean containsWorker(long projectId, long workerId) throws SystemException { return projectPersistence.containsWorker(projectId, workerId); } public List<Worker> getProjectWorkers(long projectId) throws SystemException { return ProjectFinderUtil.getProjectWorkers(projectId); } public List<TimeBox> getTimeBoxs(long projectId) throws SystemException { return projectPersistence.getTimeBoxs(projectId); } /* * Returns total minutes added to a project (by timeboxes) */ public long totalizeTimeBoxs(long projectId) throws SystemException { long total = 0; List<TimeBox> ltb = projectPersistence.getTimeBoxs(projectId); for(TimeBox tb : ltb){ total += tb.getMinutes(); } return total; } public long addTimeBox(TimeBox tb) throws SystemException { try { TimeBoxLocalServiceUtil.add(tb); } catch (PortalException e) { //doesnt exist in db return 0; } return tb.getTimeboxId(); } public List<Project> findByContactoId(long contactoId) throws SystemException { return projectPersistence.findByContactoId(contactoId); } }
{ "content_hash": "33b92d0078702a2db34ce50ce5d166ff", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 198, "avg_line_length": 35.34803921568628, "alnum_prop": 0.7678546664817639, "repo_name": "rsicart/mpwc", "id": "62c57c6a6c09f6b70bbea70c1381525052b470ad", "size": "7799", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docroot/WEB-INF/src/com/mpwc/service/impl/ProjectLocalServiceImpl.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "709625" }, { "name": "JavaScript", "bytes": "9235" } ], "symlink_target": "" }
from elementfinder import ElementFinder __all__ = [ "ElementFinder", ]
{ "content_hash": "112f44e6c2b8d24c9d1f9dcec5124cff", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 39, "avg_line_length": 15.2, "alnum_prop": 0.6842105263157895, "repo_name": "longmazhanfeng/automationlibrary", "id": "532d3e322fb4be412362e48384d53d238ca71ac0", "size": "101", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MobileLibrary/src/AppiumLibrary/locators/__init__.py", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "2519" }, { "name": "Python", "bytes": "326623" } ], "symlink_target": "" }
package org.apache.ambari.server.actionmanager; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.StaticallyInject; import org.apache.ambari.server.controller.ExecuteActionRequest; import org.apache.ambari.server.controller.internal.RequestOperationLevel; import org.apache.ambari.server.controller.internal.RequestResourceFilter; import org.apache.ambari.server.controller.spi.Resource; import org.apache.ambari.server.orm.dao.HostDAO; import org.apache.ambari.server.orm.entities.HostEntity; import org.apache.ambari.server.orm.entities.RequestEntity; import org.apache.ambari.server.orm.entities.RequestOperationLevelEntity; import org.apache.ambari.server.orm.entities.RequestResourceFilterEntity; import org.apache.ambari.server.orm.entities.StageEntity; import org.apache.ambari.server.state.Clusters; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.gson.Gson; import com.google.inject.Inject; import com.google.inject.assistedinject.Assisted; import com.google.inject.assistedinject.AssistedInject; @StaticallyInject public class Request { private static final Logger LOG = LoggerFactory.getLogger(Request.class); private final long requestId; private long clusterId; private String clusterName; private Long requestScheduleId; private String commandName; private String requestContext; private long createTime; private long startTime; private long endTime; private String clusterHostInfo; /** * If true, this request can not be executed in parallel with any another * requests. That is useful when updating MM state, performing * decommission etc. * Defaults to false. */ private boolean exclusive; /** * As of now, this field is not used. Request status is * calculated at RequestResourceProvider on the fly. */ private HostRoleStatus status; // not persisted yet private String inputs; private List<RequestResourceFilter> resourceFilters; private RequestOperationLevel operationLevel; private RequestType requestType; private Collection<Stage> stages = new ArrayList<Stage>(); @Inject private static HostDAO hostDAO; @AssistedInject /** * Construct new entity */ public Request(@Assisted long requestId, @Assisted("clusterId") Long clusterId, Clusters clusters) { this.requestId = requestId; this.clusterId = clusterId.longValue(); this.createTime = System.currentTimeMillis(); this.startTime = -1; this.endTime = -1; this.exclusive = false; this.clusterHostInfo = "{}"; if (-1L != this.clusterId) { try { this.clusterName = clusters.getClusterById(this.clusterId).getClusterName(); } catch (AmbariException e) { LOG.debug("Could not load cluster with id {}, the cluster may have been removed for request {}", clusterId, Long.valueOf(requestId)); } } } @AssistedInject /** * Construct new entity from stages provided */ //TODO remove when not needed public Request(@Assisted Collection<Stage> stages, @Assisted String clusterHostInfo, Clusters clusters){ if (stages != null && !stages.isEmpty()) { this.stages.addAll(stages); Stage stage = stages.iterator().next(); this.requestId = stage.getRequestId(); this.clusterName = stage.getClusterName(); try { this.clusterId = clusters.getCluster(clusterName).getClusterId(); } catch (Exception e) { if (null != clusterName) { String message = String.format("Cluster %s not found", clusterName); LOG.error(message); throw new RuntimeException(message); } } this.requestContext = stages.iterator().next().getRequestContext(); this.createTime = System.currentTimeMillis(); this.startTime = -1; this.endTime = -1; this.clusterHostInfo = clusterHostInfo; this.requestType = RequestType.INTERNAL_REQUEST; this.exclusive = false; } else { String message = "Attempted to construct request from empty stage collection"; LOG.error(message); throw new RuntimeException(message); } } @AssistedInject /** * Construct new entity from stages provided */ //TODO remove when not needed public Request(@Assisted Collection<Stage> stages, @Assisted String clusterHostInfo, @Assisted ExecuteActionRequest actionRequest, Clusters clusters, Gson gson) throws AmbariException { this(stages, clusterHostInfo, clusters); if (actionRequest != null) { this.resourceFilters = actionRequest.getResourceFilters(); this.operationLevel = actionRequest.getOperationLevel(); this.inputs = gson.toJson(actionRequest.getParameters()); this.requestType = actionRequest.isCommand() ? RequestType.COMMAND : RequestType.ACTION; this.commandName = actionRequest.isCommand() ? actionRequest.getCommandName() : actionRequest.getActionName(); this.exclusive = actionRequest.isExclusive(); } } @AssistedInject /** * Load existing request from database */ public Request(@Assisted RequestEntity entity, final StageFactory stageFactory, Clusters clusters){ if (entity == null) { throw new RuntimeException("Request entity cannot be null."); } this.requestId = entity.getRequestId(); this.clusterId = entity.getClusterId(); if (-1L != this.clusterId) { try { this.clusterName = clusters.getClusterById(this.clusterId).getClusterName(); } catch (AmbariException e) { LOG.debug("Could not load cluster with id {}, the cluster may have been removed for request {}", Long.valueOf(clusterId), Long.valueOf(requestId)); } } this.createTime = entity.getCreateTime(); this.startTime = entity.getStartTime(); this.endTime = entity.getEndTime(); this.exclusive = entity.isExclusive(); this.requestContext = entity.getRequestContext(); this.inputs = entity.getInputs(); this.clusterHostInfo = entity.getClusterHostInfo(); this.requestType = entity.getRequestType(); this.commandName = entity.getCommandName(); this.status = entity.getStatus(); if (entity.getRequestScheduleEntity() != null) { this.requestScheduleId = entity.getRequestScheduleEntity().getScheduleId(); } Collection<StageEntity> stageEntities = entity.getStages(); if(stageEntities == null || stageEntities.isEmpty()) { stages = Collections.emptyList(); } else { stages = new ArrayList<>(stageEntities.size()); for (StageEntity stageEntity : stageEntities) { stages.add(stageFactory.createExisting(stageEntity)); } } resourceFilters = filtersFromEntity(entity); operationLevel = operationLevelFromEntity(entity); } private static List<String> getHostsList(String hosts) { List<String> hostList = new ArrayList<String>(); if (hosts != null && !hosts.isEmpty()) { for (String host : hosts.split(",")) { if (!host.trim().isEmpty()) { hostList.add(host.trim()); } } } return hostList; } public Collection<Stage> getStages() { return stages; } public void setStages(Collection<Stage> stages) { this.stages = stages; } public long getRequestId() { return requestId; } public synchronized RequestEntity constructNewPersistenceEntity() { RequestEntity requestEntity = new RequestEntity(); requestEntity.setRequestId(requestId); requestEntity.setClusterId(clusterId); requestEntity.setCreateTime(createTime); requestEntity.setStartTime(startTime); requestEntity.setEndTime(endTime); requestEntity.setExclusive(exclusive); requestEntity.setRequestContext(requestContext); requestEntity.setInputs(inputs); requestEntity.setRequestType(requestType); requestEntity.setRequestScheduleId(requestScheduleId); requestEntity.setClusterHostInfo(clusterHostInfo); //TODO set all fields if (resourceFilters != null) { List<RequestResourceFilterEntity> filterEntities = new ArrayList<RequestResourceFilterEntity>(); for (RequestResourceFilter resourceFilter : resourceFilters) { RequestResourceFilterEntity filterEntity = new RequestResourceFilterEntity(); filterEntity.setServiceName(resourceFilter.getServiceName()); filterEntity.setComponentName(resourceFilter.getComponentName()); filterEntity.setHosts(resourceFilter.getHostNames() != null ? StringUtils.join(resourceFilter.getHostNames(), ",") : null); filterEntity.setRequestEntity(requestEntity); filterEntity.setRequestId(requestId); filterEntities.add(filterEntity); } requestEntity.setResourceFilterEntities(filterEntities); } if (operationLevel != null) { HostEntity hostEntity = hostDAO.findByName(operationLevel.getHostName()); Long hostId = hostEntity != null ? hostEntity.getHostId() : null; RequestOperationLevelEntity operationLevelEntity = new RequestOperationLevelEntity(); operationLevelEntity.setLevel(operationLevel.getLevel().toString()); operationLevelEntity.setClusterName(operationLevel.getClusterName()); operationLevelEntity.setServiceName(operationLevel.getServiceName()); operationLevelEntity.setHostComponentName(operationLevel.getHostComponentName()); operationLevelEntity.setHostId(hostId); operationLevelEntity.setRequestEntity(requestEntity); operationLevelEntity.setRequestId(requestId); requestEntity.setRequestOperationLevel(operationLevelEntity); } return requestEntity; } public String getClusterHostInfo() { return clusterHostInfo; } public void setClusterHostInfo(String clusterHostInfo) { this.clusterHostInfo = clusterHostInfo; } public Long getClusterId() { return Long.valueOf(clusterId); } public String getClusterName() { return clusterName; } public String getRequestContext() { return requestContext; } public void setRequestContext(String requestContext) { this.requestContext = requestContext; } public long getCreateTime() { return createTime; } public long getStartTime() { return startTime; } public void setStartTime(long startTime) { this.startTime = startTime; } public long getEndTime() { return endTime; } public void setEndTime(long endTime) { this.endTime = endTime; } public String getInputs() { return inputs; } public void setInputs(String inputs) { this.inputs = inputs; } public List<RequestResourceFilter> getResourceFilters() { return resourceFilters; } public void setResourceFilters(List<RequestResourceFilter> resourceFilters) { this.resourceFilters = resourceFilters; } public RequestOperationLevel getOperationLevel() { return operationLevel; } public void setOperationLevel(RequestOperationLevel operationLevel) { this.operationLevel = operationLevel; } public RequestType getRequestType() { return requestType; } public void setRequestType(RequestType requestType) { this.requestType = requestType; } public String getCommandName() { return commandName; } public void setCommandName(String commandName) { this.commandName = commandName; } public Long getRequestScheduleId() { return requestScheduleId; } public void setRequestScheduleId(Long requestScheduleId) { this.requestScheduleId = requestScheduleId; } public List<HostRoleCommand> getCommands() { List<HostRoleCommand> commands = new ArrayList<HostRoleCommand>(); for (Stage stage : stages) { commands.addAll(stage.getOrderedHostRoleCommands()); } return commands; } @Override public String toString() { return "Request{" + "requestId=" + requestId + ", clusterId=" + clusterId + ", clusterName='" + clusterName + '\'' + ", requestContext='" + requestContext + '\'' + ", createTime=" + createTime + ", startTime=" + startTime + ", endTime=" + endTime + ", inputs='" + inputs + '\'' + ", resourceFilters='" + resourceFilters + '\'' + ", operationLevel='" + operationLevel + '\'' + ", requestType=" + requestType + ", stages=" + stages + '}'; } public HostRoleStatus getStatus() { return status; } public void setStatus(HostRoleStatus status) { this.status = status; } public boolean isExclusive() { return exclusive; } public void setExclusive(boolean isExclusive) { exclusive = isExclusive; } /** * @param entity the request entity * @return a list of {@link RequestResourceFilter} from the entity, or {@code null} * if none are defined */ public static List<RequestResourceFilter> filtersFromEntity (RequestEntity entity) { List<RequestResourceFilter> resourceFilters = null; Collection<RequestResourceFilterEntity> resourceFilterEntities = entity.getResourceFilterEntities(); if (resourceFilterEntities != null) { resourceFilters = new ArrayList<RequestResourceFilter>(); for (RequestResourceFilterEntity resourceFilterEntity : resourceFilterEntities) { RequestResourceFilter resourceFilter = new RequestResourceFilter( resourceFilterEntity.getServiceName(), resourceFilterEntity.getComponentName(), getHostsList(resourceFilterEntity.getHosts())); resourceFilters.add(resourceFilter); } } return resourceFilters; } /** * @param entity the request entity * @return the {@link RequestOperationLevel} from the entity, or {@code null} * if none is defined */ public static RequestOperationLevel operationLevelFromEntity(RequestEntity entity) { RequestOperationLevel level = null; RequestOperationLevelEntity operationLevelEntity = entity.getRequestOperationLevel(); if (operationLevelEntity != null) { String hostName = null; if (operationLevelEntity.getHostId() != null) { HostEntity hostEntity = hostDAO.findById(operationLevelEntity.getHostId()); hostName = hostEntity.getHostName(); } level = new RequestOperationLevel( Resource.Type.valueOf(operationLevelEntity.getLevel()), operationLevelEntity.getClusterName(), operationLevelEntity.getServiceName(), operationLevelEntity.getHostComponentName(), hostName); } return level; } }
{ "content_hash": "2d68b3423553504e6fd920aec10fab66", "timestamp": "", "source": "github", "line_count": 453, "max_line_length": 132, "avg_line_length": 32.44812362030905, "alnum_prop": 0.7080753792775019, "repo_name": "arenadata/ambari", "id": "2424d0dfc989829f5f259014e2e19f2b9fa6e3cd", "size": "15504", "binary": false, "copies": "2", "ref": "refs/heads/branch-adh-1.6", "path": "ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Request.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "46700" }, { "name": "C", "bytes": "331204" }, { "name": "C#", "bytes": "215907" }, { "name": "C++", "bytes": "257" }, { "name": "CSS", "bytes": "343739" }, { "name": "CoffeeScript", "bytes": "8465" }, { "name": "Dockerfile", "bytes": "6387" }, { "name": "EJS", "bytes": "777" }, { "name": "FreeMarker", "bytes": "2654" }, { "name": "Gherkin", "bytes": "990" }, { "name": "Groovy", "bytes": "15882" }, { "name": "HTML", "bytes": "717983" }, { "name": "Handlebars", "bytes": "1819641" }, { "name": "Java", "bytes": "29172298" }, { "name": "JavaScript", "bytes": "18571926" }, { "name": "Jinja", "bytes": "1490416" }, { "name": "Less", "bytes": "412933" }, { "name": "Makefile", "bytes": "11111" }, { "name": "PHP", "bytes": "149648" }, { "name": "PLpgSQL", "bytes": "287501" }, { "name": "PowerShell", "bytes": "2090340" }, { "name": "Python", "bytes": "18507704" }, { "name": "R", "bytes": "3943" }, { "name": "Ruby", "bytes": "38590" }, { "name": "SCSS", "bytes": "40072" }, { "name": "Shell", "bytes": "924115" }, { "name": "Stylus", "bytes": "820" }, { "name": "TSQL", "bytes": "42351" }, { "name": "Vim script", "bytes": "5813" }, { "name": "sed", "bytes": "2303" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "05bfb2a0b593fbd4def030563e8b8edd", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "1861f7045fd9b1ac4cd906c947916e1125c6eb98", "size": "175", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Ophrys/Ophrys kotschyi/ Syn. Ophrys cypria/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "db.h" #include "net.h" #include "init.h" #include "addrman.h" #include "ui_interface.h" #include "script.h" #ifdef WIN32 #include <string.h> #endif #ifdef USE_UPNP #include <miniupnpc/miniwget.h> #include <miniupnpc/miniupnpc.h> #include <miniupnpc/upnpcommands.h> #include <miniupnpc/upnperrors.h> #endif // Dump addresses to peers.dat every 15 minutes (900s) #define DUMP_ADDRESSES_INTERVAL 900 using namespace std; using namespace boost; static const int MAX_OUTBOUND_CONNECTIONS = 8; bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false); struct LocalServiceInfo { int nScore; int nPort; }; // // Global state variables // bool fDiscover = true; uint64 nLocalServices = NODE_NETWORK; static CCriticalSection cs_mapLocalHost; static map<CNetAddr, LocalServiceInfo> mapLocalHost; static bool vfReachable[NET_MAX] = {}; static bool vfLimited[NET_MAX] = {}; static CNode* pnodeLocalHost = NULL; static CNode* pnodeSync = NULL; uint64 nLocalHostNonce = 0; static std::vector<SOCKET> vhListenSocket; CAddrMan addrman; int nMaxConnections = 125; vector<CNode*> vNodes; CCriticalSection cs_vNodes; map<CInv, CDataStream> mapRelay; deque<pair<int64, CInv> > vRelayExpiration; CCriticalSection cs_mapRelay; limitedmap<CInv, int64> mapAlreadyAskedFor(MAX_INV_SZ); static deque<string> vOneShots; CCriticalSection cs_vOneShots; set<CNetAddr> setservAddNodeAddresses; CCriticalSection cs_setservAddNodeAddresses; vector<std::string> vAddedNodes; CCriticalSection cs_vAddedNodes; static CSemaphore *semOutbound = NULL; void AddOneShot(string strDest) { LOCK(cs_vOneShots); vOneShots.push_back(strDest); } unsigned short GetListenPort() { return (unsigned short)(GetArg("-port", GetDefaultPort())); } void CNode::PushGetBlocks(CBlockIndex* pindexBegin, uint256 hashEnd) { // Filter out duplicate requests if (pindexBegin == pindexLastGetBlocksBegin && hashEnd == hashLastGetBlocksEnd) return; pindexLastGetBlocksBegin = pindexBegin; hashLastGetBlocksEnd = hashEnd; PushMessage("getblocks", CBlockLocator(pindexBegin), hashEnd); } // find 'best' local address for a particular peer bool GetLocal(CService& addr, const CNetAddr *paddrPeer) { if (fNoListen) return false; int nBestScore = -1; int nBestReachability = -1; { LOCK(cs_mapLocalHost); for (map<CNetAddr, LocalServiceInfo>::iterator it = mapLocalHost.begin(); it != mapLocalHost.end(); it++) { int nScore = (*it).second.nScore; int nReachability = (*it).first.GetReachabilityFrom(paddrPeer); if (nReachability > nBestReachability || (nReachability == nBestReachability && nScore > nBestScore)) { addr = CService((*it).first, (*it).second.nPort); nBestReachability = nReachability; nBestScore = nScore; } } } return nBestScore >= 0; } // get best local address for a particular peer as a CAddress CAddress GetLocalAddress(const CNetAddr *paddrPeer) { CAddress ret(CService("0.0.0.0",0),0); CService addr; if (GetLocal(addr, paddrPeer)) { ret = CAddress(addr); ret.nServices = nLocalServices; ret.nTime = GetAdjustedTime(); } return ret; } bool RecvLine(SOCKET hSocket, string& strLine) { strLine = ""; loop { char c; int nBytes = recv(hSocket, &c, 1, 0); if (nBytes > 0) { if (c == '\n') continue; if (c == '\r') return true; strLine += c; if (strLine.size() >= 9000) return true; } else if (nBytes <= 0) { boost::this_thread::interruption_point(); if (nBytes < 0) { int nErr = WSAGetLastError(); if (nErr == WSAEMSGSIZE) continue; if (nErr == WSAEWOULDBLOCK || nErr == WSAEINTR || nErr == WSAEINPROGRESS) { MilliSleep(10); continue; } } if (!strLine.empty()) return true; if (nBytes == 0) { // socket closed printf("socket closed\n"); return false; } else { // socket error int nErr = WSAGetLastError(); printf("recv failed: %d\n", nErr); return false; } } } } // used when scores of local addresses may have changed // pushes better local address to peers void static AdvertizeLocal() { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) { if (pnode->fSuccessfullyConnected) { CAddress addrLocal = GetLocalAddress(&pnode->addr); if (addrLocal.IsRoutable() && (CService)addrLocal != (CService)pnode->addrLocal) { pnode->PushAddress(addrLocal); pnode->addrLocal = addrLocal; } } } } void SetReachable(enum Network net, bool fFlag) { LOCK(cs_mapLocalHost); vfReachable[net] = fFlag; if (net == NET_IPV6 && fFlag) vfReachable[NET_IPV4] = true; } // learn a new local address bool AddLocal(const CService& addr, int nScore) { if (!addr.IsRoutable()) return false; if (!fDiscover && nScore < LOCAL_MANUAL) return false; if (IsLimited(addr)) return false; printf("AddLocal(%s,%i)\n", addr.ToString().c_str(), nScore); { LOCK(cs_mapLocalHost); bool fAlready = mapLocalHost.count(addr) > 0; LocalServiceInfo &info = mapLocalHost[addr]; if (!fAlready || nScore >= info.nScore) { info.nScore = nScore + (fAlready ? 1 : 0); info.nPort = addr.GetPort(); } SetReachable(addr.GetNetwork()); } AdvertizeLocal(); return true; } bool AddLocal(const CNetAddr &addr, int nScore) { return AddLocal(CService(addr, GetListenPort()), nScore); } /** Make a particular network entirely off-limits (no automatic connects to it) */ void SetLimited(enum Network net, bool fLimited) { if (net == NET_UNROUTABLE) return; LOCK(cs_mapLocalHost); vfLimited[net] = fLimited; } bool IsLimited(enum Network net) { LOCK(cs_mapLocalHost); return vfLimited[net]; } bool IsLimited(const CNetAddr &addr) { return IsLimited(addr.GetNetwork()); } /** vote for a local address */ bool SeenLocal(const CService& addr) { { LOCK(cs_mapLocalHost); if (mapLocalHost.count(addr) == 0) return false; mapLocalHost[addr].nScore++; } AdvertizeLocal(); return true; } /** check whether a given address is potentially local */ bool IsLocal(const CService& addr) { LOCK(cs_mapLocalHost); return mapLocalHost.count(addr) > 0; } /** check whether a given address is in a network we can probably connect to */ bool IsReachable(const CNetAddr& addr) { LOCK(cs_mapLocalHost); enum Network net = addr.GetNetwork(); return vfReachable[net] && !vfLimited[net]; } bool GetMyExternalIP2(const CService& addrConnect, const char* pszGet, const char* pszKeyword, CNetAddr& ipRet) { SOCKET hSocket; if (!ConnectSocket(addrConnect, hSocket)) return error("GetMyExternalIP() : connection to %s failed", addrConnect.ToString().c_str()); send(hSocket, pszGet, strlen(pszGet), MSG_NOSIGNAL); string strLine; while (RecvLine(hSocket, strLine)) { if (strLine.empty()) // HTTP response is separated from headers by blank line { loop { if (!RecvLine(hSocket, strLine)) { closesocket(hSocket); return false; } if (pszKeyword == NULL) break; if (strLine.find(pszKeyword) != string::npos) { strLine = strLine.substr(strLine.find(pszKeyword) + strlen(pszKeyword)); break; } } closesocket(hSocket); if (strLine.find("<") != string::npos) strLine = strLine.substr(0, strLine.find("<")); strLine = strLine.substr(strspn(strLine.c_str(), " \t\n\r")); while (strLine.size() > 0 && isspace(strLine[strLine.size()-1])) strLine.resize(strLine.size()-1); CService addr(strLine,0,true); printf("GetMyExternalIP() received [%s] %s\n", strLine.c_str(), addr.ToString().c_str()); if (!addr.IsValid() || !addr.IsRoutable()) return false; ipRet.SetIP(addr); return true; } } closesocket(hSocket); return error("GetMyExternalIP() : connection closed"); } bool GetMyExternalIP(CNetAddr& ipRet) { CService addrConnect; const char* pszGet; const char* pszKeyword; for (int nLookup = 0; nLookup <= 1; nLookup++) for (int nHost = 1; nHost <= 2; nHost++) { // We should be phasing out our use of sites like these. If we need // replacements, we should ask for volunteers to put this simple // php file on their web server that prints the client IP: // <?php echo $_SERVER["REMOTE_ADDR"]; ?> if (nHost == 1) { addrConnect = CService("91.198.22.70", 80); // checkip.dyndns.org if (nLookup == 1) { CService addrIP("checkip.dyndns.org", 80, true); if (addrIP.IsValid()) addrConnect = addrIP; } pszGet = "GET / HTTP/1.1\r\n" "Host: checkip.dyndns.org\r\n" "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\r\n" "Connection: close\r\n" "\r\n"; pszKeyword = "Address:"; } else if (nHost == 2) { addrConnect = CService("74.208.43.192", 80); // www.showmyip.com if (nLookup == 1) { CService addrIP("www.showmyip.com", 80, true); if (addrIP.IsValid()) addrConnect = addrIP; } pszGet = "GET /simple/ HTTP/1.1\r\n" "Host: www.showmyip.com\r\n" "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\r\n" "Connection: close\r\n" "\r\n"; pszKeyword = NULL; // Returns just IP address } if (GetMyExternalIP2(addrConnect, pszGet, pszKeyword, ipRet)) return true; } return false; } void ThreadGetMyExternalIP(void* parg) { // Make this thread recognisable as the external IP detection thread RenameThread("bitcoin-ext-ip"); CNetAddr addrLocalHost; if (GetMyExternalIP(addrLocalHost)) { printf("GetMyExternalIP() returned %s\n", addrLocalHost.ToStringIP().c_str()); AddLocal(addrLocalHost, LOCAL_HTTP); } } void AddressCurrentlyConnected(const CService& addr) { addrman.Connected(addr); } CNode* FindNode(const CNetAddr& ip) { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) if ((CNetAddr)pnode->addr == ip) return (pnode); return NULL; } CNode* FindNode(std::string addrName) { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) if (pnode->addrName == addrName) return (pnode); return NULL; } CNode* FindNode(const CService& addr) { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) if ((CService)pnode->addr == addr) return (pnode); return NULL; } CNode* ConnectNode(CAddress addrConnect, const char *pszDest) { if (pszDest == NULL) { if (IsLocal(addrConnect)) return NULL; // Look for an existing connection CNode* pnode = FindNode((CService)addrConnect); if (pnode) { pnode->AddRef(); return pnode; } } /// debug print printf("trying connection %s lastseen=%.1fhrs\n", pszDest ? pszDest : addrConnect.ToString().c_str(), pszDest ? 0 : (double)(GetAdjustedTime() - addrConnect.nTime)/3600.0); // Connect SOCKET hSocket; if (pszDest ? ConnectSocketByName(addrConnect, hSocket, pszDest, GetDefaultPort()) : ConnectSocket(addrConnect, hSocket)) { addrman.Attempt(addrConnect); /// debug print printf("connected %s\n", pszDest ? pszDest : addrConnect.ToString().c_str()); // Set to non-blocking #ifdef WIN32 u_long nOne = 1; if (ioctlsocket(hSocket, FIONBIO, &nOne) == SOCKET_ERROR) printf("ConnectSocket() : ioctlsocket non-blocking setting failed, error %d\n", WSAGetLastError()); #else if (fcntl(hSocket, F_SETFL, O_NONBLOCK) == SOCKET_ERROR) printf("ConnectSocket() : fcntl non-blocking setting failed, error %d\n", errno); #endif // Add node CNode* pnode = new CNode(hSocket, addrConnect, pszDest ? pszDest : "", false); pnode->AddRef(); { LOCK(cs_vNodes); vNodes.push_back(pnode); } pnode->nTimeConnected = GetTime(); return pnode; } else { return NULL; } } void CNode::CloseSocketDisconnect() { fDisconnect = true; if (hSocket != INVALID_SOCKET) { printf("disconnecting node %s\n", addrName.c_str()); closesocket(hSocket); hSocket = INVALID_SOCKET; } // in case this fails, we'll empty the recv buffer when the CNode is deleted TRY_LOCK(cs_vRecvMsg, lockRecv); if (lockRecv) vRecvMsg.clear(); // if this was the sync node, we'll need a new one if (this == pnodeSync) pnodeSync = NULL; } void CNode::Cleanup() { } void CNode::PushVersion() { /// when NTP implemented, change to just nTime = GetAdjustedTime() int64 nTime = (fInbound ? GetAdjustedTime() : GetTime()); CAddress addrYou = (addr.IsRoutable() && !IsProxy(addr) ? addr : CAddress(CService("0.0.0.0",0))); CAddress addrMe = GetLocalAddress(&addr); RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce)); printf("send version message: version %d, blocks=%d, us=%s, them=%s, peer=%s\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString().c_str(), addrYou.ToString().c_str(), addr.ToString().c_str()); PushMessage("version", PROTOCOL_VERSION, nLocalServices, nTime, addrYou, addrMe, nLocalHostNonce, FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector<string>()), nBestHeight); } std::map<CNetAddr, int64> CNode::setBanned; CCriticalSection CNode::cs_setBanned; void CNode::ClearBanned() { setBanned.clear(); } bool CNode::IsBanned(CNetAddr ip) { bool fResult = false; { LOCK(cs_setBanned); std::map<CNetAddr, int64>::iterator i = setBanned.find(ip); if (i != setBanned.end()) { int64 t = (*i).second; if (GetTime() < t) fResult = true; } } return fResult; } bool CNode::Misbehaving(int howmuch) { if (addr.IsLocal()) { printf("Warning: Local node %s misbehaving (delta: %d)!\n", addrName.c_str(), howmuch); return false; } nMisbehavior += howmuch; if (nMisbehavior >= GetArg("-banscore", 100)) { int64 banTime = GetTime()+GetArg("-bantime", 60*60*24); // Default 24-hour ban printf("Misbehaving: %s (%d -> %d) DISCONNECTING\n", addr.ToString().c_str(), nMisbehavior-howmuch, nMisbehavior); { LOCK(cs_setBanned); if (setBanned[addr] < banTime) setBanned[addr] = banTime; } CloseSocketDisconnect(); return true; } else printf("Misbehaving: %s (%d -> %d)\n", addr.ToString().c_str(), nMisbehavior-howmuch, nMisbehavior); return false; } #undef X #define X(name) stats.name = name void CNode::copyStats(CNodeStats &stats) { X(nServices); X(nLastSend); X(nLastRecv); X(nTimeConnected); X(addrName); X(nVersion); X(cleanSubVer); X(fInbound); X(nStartingHeight); X(nMisbehavior); X(nSendBytes); X(nRecvBytes); X(nBlocksRequested); stats.fSyncNode = (this == pnodeSync); } #undef X // requires LOCK(cs_vRecvMsg) bool CNode::ReceiveMsgBytes(const char *pch, unsigned int nBytes) { while (nBytes > 0) { // get current incomplete message, or create a new one if (vRecvMsg.empty() || vRecvMsg.back().complete()) vRecvMsg.push_back(CNetMessage(SER_NETWORK, nRecvVersion)); CNetMessage& msg = vRecvMsg.back(); // absorb network data int handled; if (!msg.in_data) handled = msg.readHeader(pch, nBytes); else handled = msg.readData(pch, nBytes); if (handled < 0) return false; pch += handled; nBytes -= handled; } return true; } int CNetMessage::readHeader(const char *pch, unsigned int nBytes) { // copy data to temporary parsing buffer unsigned int nRemaining = 24 - nHdrPos; unsigned int nCopy = std::min(nRemaining, nBytes); memcpy(&hdrbuf[nHdrPos], pch, nCopy); nHdrPos += nCopy; // if header incomplete, exit if (nHdrPos < 24) return nCopy; // deserialize to CMessageHeader try { hdrbuf >> hdr; } catch (std::exception &e) { return -1; } // reject messages larger than MAX_SIZE if (hdr.nMessageSize > MAX_SIZE) return -1; // switch state to reading message data in_data = true; vRecv.resize(hdr.nMessageSize); return nCopy; } int CNetMessage::readData(const char *pch, unsigned int nBytes) { unsigned int nRemaining = hdr.nMessageSize - nDataPos; unsigned int nCopy = std::min(nRemaining, nBytes); memcpy(&vRecv[nDataPos], pch, nCopy); nDataPos += nCopy; return nCopy; } // requires LOCK(cs_vSend) void SocketSendData(CNode *pnode) { std::deque<CSerializeData>::iterator it = pnode->vSendMsg.begin(); while (it != pnode->vSendMsg.end()) { const CSerializeData &data = *it; assert(data.size() > pnode->nSendOffset); int nBytes = send(pnode->hSocket, &data[pnode->nSendOffset], data.size() - pnode->nSendOffset, MSG_NOSIGNAL | MSG_DONTWAIT); if (nBytes > 0) { pnode->nLastSend = GetTime(); pnode->nSendBytes += nBytes; pnode->nSendOffset += nBytes; if (pnode->nSendOffset == data.size()) { pnode->nSendOffset = 0; pnode->nSendSize -= data.size(); it++; } else { // could not send full message; stop sending more break; } } else { if (nBytes < 0) { // error int nErr = WSAGetLastError(); if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) { printf("socket send error %d\n", nErr); pnode->CloseSocketDisconnect(); } } // couldn't send anything at all break; } } if (it == pnode->vSendMsg.end()) { assert(pnode->nSendOffset == 0); assert(pnode->nSendSize == 0); } pnode->vSendMsg.erase(pnode->vSendMsg.begin(), it); } static list<CNode*> vNodesDisconnected; void ThreadSocketHandler() { unsigned int nPrevNodeCount = 0; loop { // // Disconnect nodes // { LOCK(cs_vNodes); // Disconnect unused nodes vector<CNode*> vNodesCopy = vNodes; BOOST_FOREACH(CNode* pnode, vNodesCopy) { if (pnode->fDisconnect || (pnode->GetRefCount() <= 0 && pnode->vRecvMsg.empty() && pnode->nSendSize == 0 && pnode->ssSend.empty())) { // remove from vNodes vNodes.erase(remove(vNodes.begin(), vNodes.end(), pnode), vNodes.end()); // release outbound grant (if any) pnode->grantOutbound.Release(); // close socket and cleanup pnode->CloseSocketDisconnect(); pnode->Cleanup(); // hold in disconnected pool until all refs are released if (pnode->fNetworkNode || pnode->fInbound) pnode->Release(); vNodesDisconnected.push_back(pnode); } } // Delete disconnected nodes list<CNode*> vNodesDisconnectedCopy = vNodesDisconnected; BOOST_FOREACH(CNode* pnode, vNodesDisconnectedCopy) { // wait until threads are done using it if (pnode->GetRefCount() <= 0) { bool fDelete = false; { TRY_LOCK(pnode->cs_vSend, lockSend); if (lockSend) { TRY_LOCK(pnode->cs_vRecvMsg, lockRecv); if (lockRecv) { TRY_LOCK(pnode->cs_inventory, lockInv); if (lockInv) fDelete = true; } } } if (fDelete) { vNodesDisconnected.remove(pnode); delete pnode; } } } } if (vNodes.size() != nPrevNodeCount) { nPrevNodeCount = vNodes.size(); uiInterface.NotifyNumConnectionsChanged(vNodes.size()); } // // Find which sockets have data to receive // struct timeval timeout; timeout.tv_sec = 0; timeout.tv_usec = 50000; // frequency to poll pnode->vSend fd_set fdsetRecv; fd_set fdsetSend; fd_set fdsetError; FD_ZERO(&fdsetRecv); FD_ZERO(&fdsetSend); FD_ZERO(&fdsetError); SOCKET hSocketMax = 0; bool have_fds = false; BOOST_FOREACH(SOCKET hListenSocket, vhListenSocket) { FD_SET(hListenSocket, &fdsetRecv); hSocketMax = max(hSocketMax, hListenSocket); have_fds = true; } { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) { if (pnode->hSocket == INVALID_SOCKET) continue; FD_SET(pnode->hSocket, &fdsetError); hSocketMax = max(hSocketMax, pnode->hSocket); have_fds = true; // Implement the following logic: // * If there is data to send, select() for sending data. As this only // happens when optimistic write failed, we choose to first drain the // write buffer in this case before receiving more. This avoids // needlessly queueing received data, if the remote peer is not themselves // receiving data. This means properly utilizing TCP flow control signalling. // * Otherwise, if there is no (complete) message in the receive buffer, // or there is space left in the buffer, select() for receiving data. // * (if neither of the above applies, there is certainly one message // in the receiver buffer ready to be processed). // Together, that means that at least one of the following is always possible, // so we don't deadlock: // * We send some data. // * We wait for data to be received (and disconnect after timeout). // * We process a message in the buffer (message handler thread). { TRY_LOCK(pnode->cs_vSend, lockSend); if (lockSend && !pnode->vSendMsg.empty()) { FD_SET(pnode->hSocket, &fdsetSend); continue; } } { TRY_LOCK(pnode->cs_vRecvMsg, lockRecv); if (lockRecv && ( pnode->vRecvMsg.empty() || !pnode->vRecvMsg.front().complete() || pnode->GetTotalRecvSize() <= ReceiveFloodSize())) FD_SET(pnode->hSocket, &fdsetRecv); } } } int nSelect = select(have_fds ? hSocketMax + 1 : 0, &fdsetRecv, &fdsetSend, &fdsetError, &timeout); boost::this_thread::interruption_point(); if (nSelect == SOCKET_ERROR) { if (have_fds) { int nErr = WSAGetLastError(); printf("socket select error %d\n", nErr); for (unsigned int i = 0; i <= hSocketMax; i++) FD_SET(i, &fdsetRecv); } FD_ZERO(&fdsetSend); FD_ZERO(&fdsetError); MilliSleep(timeout.tv_usec/1000); } // // Accept new connections // BOOST_FOREACH(SOCKET hListenSocket, vhListenSocket) if (hListenSocket != INVALID_SOCKET && FD_ISSET(hListenSocket, &fdsetRecv)) { #ifdef USE_IPV6 struct sockaddr_storage sockaddr; #else struct sockaddr sockaddr; #endif socklen_t len = sizeof(sockaddr); SOCKET hSocket = accept(hListenSocket, (struct sockaddr*)&sockaddr, &len); CAddress addr; int nInbound = 0; if (hSocket != INVALID_SOCKET) if (!addr.SetSockAddr((const struct sockaddr*)&sockaddr)) printf("Warning: Unknown socket family\n"); { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) if (pnode->fInbound) nInbound++; } if (hSocket == INVALID_SOCKET) { int nErr = WSAGetLastError(); if (nErr != WSAEWOULDBLOCK) printf("socket error accept failed: %d\n", nErr); } else if (nInbound >= nMaxConnections - MAX_OUTBOUND_CONNECTIONS) { { LOCK(cs_setservAddNodeAddresses); if (!setservAddNodeAddresses.count(addr)) closesocket(hSocket); } } else if (CNode::IsBanned(addr)) { printf("connection from %s dropped (banned)\n", addr.ToString().c_str()); closesocket(hSocket); } else { printf("accepted connection %s\n", addr.ToString().c_str()); CNode* pnode = new CNode(hSocket, addr, "", true); pnode->AddRef(); { LOCK(cs_vNodes); vNodes.push_back(pnode); } } } // // Service each socket // vector<CNode*> vNodesCopy; { LOCK(cs_vNodes); vNodesCopy = vNodes; BOOST_FOREACH(CNode* pnode, vNodesCopy) pnode->AddRef(); } BOOST_FOREACH(CNode* pnode, vNodesCopy) { boost::this_thread::interruption_point(); // // Receive // if (pnode->hSocket == INVALID_SOCKET) continue; if (FD_ISSET(pnode->hSocket, &fdsetRecv) || FD_ISSET(pnode->hSocket, &fdsetError)) { TRY_LOCK(pnode->cs_vRecvMsg, lockRecv); if (lockRecv) { { // typical socket buffer is 8K-64K char pchBuf[0x10000]; int nBytes = recv(pnode->hSocket, pchBuf, sizeof(pchBuf), MSG_DONTWAIT); if (nBytes > 0) { if (!pnode->ReceiveMsgBytes(pchBuf, nBytes)) pnode->CloseSocketDisconnect(); pnode->nLastRecv = GetTime(); pnode->nRecvBytes += nBytes; } else if (nBytes == 0) { // socket closed gracefully if (!pnode->fDisconnect) printf("socket closed\n"); pnode->CloseSocketDisconnect(); } else if (nBytes < 0) { // error int nErr = WSAGetLastError(); if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) { if (!pnode->fDisconnect) printf("socket recv error %d\n", nErr); pnode->CloseSocketDisconnect(); } } } } } // // Send // if (pnode->hSocket == INVALID_SOCKET) continue; if (FD_ISSET(pnode->hSocket, &fdsetSend)) { TRY_LOCK(pnode->cs_vSend, lockSend); if (lockSend) SocketSendData(pnode); } // // Inactivity checking // if (pnode->vSendMsg.empty()) pnode->nLastSendEmpty = GetTime(); if (GetTime() - pnode->nTimeConnected > 60) { if (pnode->nLastRecv == 0 || pnode->nLastSend == 0) { printf("socket no message in first 60 seconds, %d %d\n", pnode->nLastRecv != 0, pnode->nLastSend != 0); pnode->fDisconnect = true; } else if (GetTime() - pnode->nLastSend > 90*60 && GetTime() - pnode->nLastSendEmpty > 90*60) { printf("socket not sending\n"); pnode->fDisconnect = true; } else if (GetTime() - pnode->nLastRecv > 90*60) { printf("socket inactivity timeout\n"); pnode->fDisconnect = true; } } } { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodesCopy) pnode->Release(); } MilliSleep(10); } } #ifdef USE_UPNP void ThreadMapPort() { std::string port = strprintf("%u", GetListenPort()); const char * multicastif = 0; const char * minissdpdpath = 0; struct UPNPDev * devlist = 0; char lanaddr[64]; #ifndef UPNPDISCOVER_SUCCESS /* miniupnpc 1.5 */ devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0); #else /* miniupnpc 1.6 */ int error = 0; devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error); #endif struct UPNPUrls urls; struct IGDdatas data; int r; r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr)); if (r == 1) { if (fDiscover) { char externalIPAddress[40]; r = UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIPAddress); if(r != UPNPCOMMAND_SUCCESS) printf("UPnP: GetExternalIPAddress() returned %d\n", r); else { if(externalIPAddress[0]) { printf("UPnP: ExternalIPAddress = %s\n", externalIPAddress); AddLocal(CNetAddr(externalIPAddress), LOCAL_UPNP); } else printf("UPnP: GetExternalIPAddress failed.\n"); } } string strDesc = "KnugenCoin " + FormatFullVersion(); try { loop { #ifndef UPNPDISCOVER_SUCCESS /* miniupnpc 1.5 */ r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", 0); #else /* miniupnpc 1.6 */ r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", 0, "0"); #endif if(r!=UPNPCOMMAND_SUCCESS) printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n", port.c_str(), port.c_str(), lanaddr, r, strupnperror(r)); else printf("UPnP Port Mapping successful.\n");; MilliSleep(20*60*1000); // Refresh every 20 minutes } } catch (boost::thread_interrupted) { r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port.c_str(), "TCP", 0); printf("UPNP_DeletePortMapping() returned : %d\n", r); freeUPNPDevlist(devlist); devlist = 0; FreeUPNPUrls(&urls); throw; } } else { printf("No valid UPnP IGDs found\n"); freeUPNPDevlist(devlist); devlist = 0; if (r != 0) FreeUPNPUrls(&urls); } } void MapPort(bool fUseUPnP) { static boost::thread* upnp_thread = NULL; if (fUseUPnP) { if (upnp_thread) { upnp_thread->interrupt(); upnp_thread->join(); delete upnp_thread; } upnp_thread = new boost::thread(boost::bind(&TraceThread<boost::function<void()> >, "upnp", &ThreadMapPort)); } else if (upnp_thread) { upnp_thread->interrupt(); upnp_thread->join(); delete upnp_thread; upnp_thread = NULL; } } #else void MapPort(bool) { // Intentionally left blank. } #endif // DNS seeds // Each pair gives a source name and a seed name. // The first name is used as information source for addrman. // The second name should resolve to a list of seed addresses. static const char *strMainNetDNSSeed[][2] = { {NULL, NULL}, {NULL, NULL} }; static const char *strTestNetDNSSeed[][2] = { {NULL, NULL} }; void ThreadDNSAddressSeed() { static const char *(*strDNSSeed)[2] = fTestNet ? strTestNetDNSSeed : strMainNetDNSSeed; int found = 0; printf("Loading addresses from DNS seeds (could take a while)\n"); for (unsigned int seed_idx = 0; strDNSSeed[seed_idx][0] != NULL; seed_idx++) { if (HaveNameProxy()) { AddOneShot(strDNSSeed[seed_idx][1]); } else { vector<CNetAddr> vaddr; vector<CAddress> vAdd; if (LookupHost(strDNSSeed[seed_idx][1], vaddr)) { BOOST_FOREACH(CNetAddr& ip, vaddr) { int nOneDay = 24*3600; CAddress addr = CAddress(CService(ip, GetDefaultPort())); addr.nTime = GetTime() - 3*nOneDay - GetRand(4*nOneDay); // use a random age between 3 and 7 days old vAdd.push_back(addr); found++; } } addrman.Add(vAdd, CNetAddr(strDNSSeed[seed_idx][0], true)); } } printf("%d addresses found from DNS seeds\n", found); } unsigned int pnSeed[] = { }; void DumpAddresses() { int64 nStart = GetTimeMillis(); CAddrDB adb; adb.Write(addrman); printf("Flushed %d addresses to peers.dat %"PRI64d"ms\n", addrman.size(), GetTimeMillis() - nStart); } void static ProcessOneShot() { string strDest; { LOCK(cs_vOneShots); if (vOneShots.empty()) return; strDest = vOneShots.front(); vOneShots.pop_front(); } CAddress addr; CSemaphoreGrant grant(*semOutbound, true); if (grant) { if (!OpenNetworkConnection(addr, &grant, strDest.c_str(), true)) AddOneShot(strDest); } } void ThreadOpenConnections() { // Connect to specific addresses if (mapArgs.count("-connect") && mapMultiArgs["-connect"].size() > 0) { for (int64 nLoop = 0;; nLoop++) { ProcessOneShot(); BOOST_FOREACH(string strAddr, mapMultiArgs["-connect"]) { CAddress addr; OpenNetworkConnection(addr, NULL, strAddr.c_str()); for (int i = 0; i < 10 && i < nLoop; i++) { MilliSleep(500); } } MilliSleep(500); } } // Initiate network connections int64 nStart = GetTime(); loop { ProcessOneShot(); MilliSleep(500); CSemaphoreGrant grant(*semOutbound); boost::this_thread::interruption_point(); // Add seed nodes if IRC isn't working if (addrman.size()==0 && (GetTime() - nStart > 60) && !fTestNet) { std::vector<CAddress> vAdd; for (unsigned int i = 0; i < ARRAYLEN(pnSeed); i++) { // It'll only connect to one or two seed nodes because once it connects, // it'll get a pile of addresses with newer timestamps. // Seed nodes are given a random 'last seen time' of between one and two // weeks ago. const int64 nOneWeek = 7*24*60*60; struct in_addr ip; memcpy(&ip, &pnSeed[i], sizeof(ip)); CAddress addr(CService(ip, GetDefaultPort())); addr.nTime = GetTime()-GetRand(nOneWeek)-nOneWeek; vAdd.push_back(addr); } addrman.Add(vAdd, CNetAddr("127.0.0.1")); } // // Choose an address to connect to based on most recently seen // CAddress addrConnect; // Only connect out to one peer per network group (/16 for IPv4). // Do this here so we don't have to critsect vNodes inside mapAddresses critsect. int nOutbound = 0; set<vector<unsigned char> > setConnected; { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) { if (!pnode->fInbound) { setConnected.insert(pnode->addr.GetGroup()); nOutbound++; } } } int64 nANow = GetAdjustedTime(); int nTries = 0; loop { // use an nUnkBias between 10 (no outgoing connections) and 90 (8 outgoing connections) CAddress addr = addrman.Select(10 + min(nOutbound,8)*10); // if we selected an invalid address, restart if (!addr.IsValid() || setConnected.count(addr.GetGroup()) || IsLocal(addr)) break; // If we didn't find an appropriate destination after trying 100 addresses fetched from addrman, // stop this loop, and let the outer loop run again (which sleeps, adds seed nodes, recalculates // already-connected network ranges, ...) before trying new addrman addresses. nTries++; if (nTries > 100) break; if (IsLimited(addr)) continue; // only consider very recently tried nodes after 30 failed attempts if (nANow - addr.nLastTry < 600 && nTries < 30) continue; // do not allow non-default ports, unless after 50 invalid addresses selected already if (addr.GetPort() != GetDefaultPort() && nTries < 50) continue; addrConnect = addr; break; } if (addrConnect.IsValid()) OpenNetworkConnection(addrConnect, &grant); } } void ThreadOpenAddedConnections() { { LOCK(cs_vAddedNodes); vAddedNodes = mapMultiArgs["-addnode"]; } if (HaveNameProxy()) { while(true) { list<string> lAddresses(0); { LOCK(cs_vAddedNodes); BOOST_FOREACH(string& strAddNode, vAddedNodes) lAddresses.push_back(strAddNode); } BOOST_FOREACH(string& strAddNode, lAddresses) { CAddress addr; CSemaphoreGrant grant(*semOutbound); OpenNetworkConnection(addr, &grant, strAddNode.c_str()); MilliSleep(500); } MilliSleep(120000); // Retry every 2 minutes } } for (unsigned int i = 0; true; i++) { list<string> lAddresses(0); { LOCK(cs_vAddedNodes); BOOST_FOREACH(string& strAddNode, vAddedNodes) lAddresses.push_back(strAddNode); } list<vector<CService> > lservAddressesToAdd(0); BOOST_FOREACH(string& strAddNode, lAddresses) { vector<CService> vservNode(0); if(Lookup(strAddNode.c_str(), vservNode, GetDefaultPort(), fNameLookup, 0)) { lservAddressesToAdd.push_back(vservNode); { LOCK(cs_setservAddNodeAddresses); BOOST_FOREACH(CService& serv, vservNode) setservAddNodeAddresses.insert(serv); } } } // Attempt to connect to each IP for each addnode entry until at least one is successful per addnode entry // (keeping in mind that addnode entries can have many IPs if fNameLookup) { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) for (list<vector<CService> >::iterator it = lservAddressesToAdd.begin(); it != lservAddressesToAdd.end(); it++) BOOST_FOREACH(CService& addrNode, *(it)) if (pnode->addr == addrNode) { it = lservAddressesToAdd.erase(it); it--; break; } } BOOST_FOREACH(vector<CService>& vserv, lservAddressesToAdd) { CSemaphoreGrant grant(*semOutbound); OpenNetworkConnection(CAddress(vserv[i % vserv.size()]), &grant); MilliSleep(500); } MilliSleep(120000); // Retry every 2 minutes } } // if successful, this moves the passed grant to the constructed node bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound, const char *strDest, bool fOneShot) { // // Initiate outbound network connection // boost::this_thread::interruption_point(); if (!strDest) if (IsLocal(addrConnect) || FindNode((CNetAddr)addrConnect) || CNode::IsBanned(addrConnect) || FindNode(addrConnect.ToStringIPPort().c_str())) return false; if (strDest && FindNode(strDest)) return false; CNode* pnode = ConnectNode(addrConnect, strDest); boost::this_thread::interruption_point(); if (!pnode) return false; if (grantOutbound) grantOutbound->MoveTo(pnode->grantOutbound); pnode->fNetworkNode = true; if (fOneShot) pnode->fOneShot = true; return true; } // for now, use a very simple selection metric: the node from which we received // most recently double static NodeSyncScore(const CNode *pnode) { return -pnode->nLastRecv; } void static StartSync(const vector<CNode*> &vNodes) { CNode *pnodeNewSync = NULL; double dBestScore = 0; // fImporting and fReindex are accessed out of cs_main here, but only // as an optimization - they are checked again in SendMessages. if (fImporting || fReindex) return; // Iterate over all nodes BOOST_FOREACH(CNode* pnode, vNodes) { // check preconditions for allowing a sync if (!pnode->fClient && !pnode->fOneShot && !pnode->fDisconnect && pnode->fSuccessfullyConnected && (pnode->nStartingHeight > (nBestHeight - 144)) && (pnode->nVersion < NOBLKS_VERSION_START || pnode->nVersion >= NOBLKS_VERSION_END)) { // if ok, compare node's score with the best so far double dScore = NodeSyncScore(pnode); if (pnodeNewSync == NULL || dScore > dBestScore) { pnodeNewSync = pnode; dBestScore = dScore; } } } // if a new sync candidate was found, start sync! if (pnodeNewSync) { pnodeNewSync->fStartSync = true; pnodeSync = pnodeNewSync; } } void ThreadMessageHandler() { SetThreadPriority(THREAD_PRIORITY_BELOW_NORMAL); while (true) { bool fHaveSyncNode = false; vector<CNode*> vNodesCopy; { LOCK(cs_vNodes); vNodesCopy = vNodes; BOOST_FOREACH(CNode* pnode, vNodesCopy) { pnode->AddRef(); if (pnode == pnodeSync) fHaveSyncNode = true; } } if (!fHaveSyncNode) StartSync(vNodesCopy); // Poll the connected nodes for messages CNode* pnodeTrickle = NULL; if (!vNodesCopy.empty()) pnodeTrickle = vNodesCopy[GetRand(vNodesCopy.size())]; bool fSleep = true; BOOST_FOREACH(CNode* pnode, vNodesCopy) { if (pnode->fDisconnect) continue; // Receive messages { TRY_LOCK(pnode->cs_vRecvMsg, lockRecv); if (lockRecv) { if (!ProcessMessages(pnode)) pnode->CloseSocketDisconnect(); if (pnode->nSendSize < SendBufferSize()) { if (!pnode->vRecvGetData.empty() || (!pnode->vRecvMsg.empty() && pnode->vRecvMsg[0].complete())) { fSleep = false; } } } } boost::this_thread::interruption_point(); // Send messages { TRY_LOCK(pnode->cs_vSend, lockSend); if (lockSend) SendMessages(pnode, pnode == pnodeTrickle); } boost::this_thread::interruption_point(); } { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodesCopy) pnode->Release(); } if (fSleep) MilliSleep(100); } } bool BindListenPort(const CService &addrBind, string& strError) { strError = ""; int nOne = 1; // Create socket for listening for incoming connections #ifdef USE_IPV6 struct sockaddr_storage sockaddr; #else struct sockaddr sockaddr; #endif socklen_t len = sizeof(sockaddr); if (!addrBind.GetSockAddr((struct sockaddr*)&sockaddr, &len)) { strError = strprintf("Error: bind address family for %s not supported", addrBind.ToString().c_str()); printf("%s\n", strError.c_str()); return false; } SOCKET hListenSocket = socket(((struct sockaddr*)&sockaddr)->sa_family, SOCK_STREAM, IPPROTO_TCP); if (hListenSocket == INVALID_SOCKET) { strError = strprintf("Error: Couldn't open socket for incoming connections (socket returned error %d)", WSAGetLastError()); printf("%s\n", strError.c_str()); return false; } #ifdef SO_NOSIGPIPE // Different way of disabling SIGPIPE on BSD setsockopt(hListenSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&nOne, sizeof(int)); #endif #ifndef WIN32 // Allow binding if the port is still in TIME_WAIT state after // the program was closed and restarted. Not an issue on windows. setsockopt(hListenSocket, SOL_SOCKET, SO_REUSEADDR, (void*)&nOne, sizeof(int)); #endif #ifdef WIN32 // Set to non-blocking, incoming connections will also inherit this if (ioctlsocket(hListenSocket, FIONBIO, (u_long*)&nOne) == SOCKET_ERROR) #else if (fcntl(hListenSocket, F_SETFL, O_NONBLOCK) == SOCKET_ERROR) #endif { strError = strprintf("Error: Couldn't set properties on socket for incoming connections (error %d)", WSAGetLastError()); printf("%s\n", strError.c_str()); return false; } #ifdef USE_IPV6 // some systems don't have IPV6_V6ONLY but are always v6only; others do have the option // and enable it by default or not. Try to enable it, if possible. if (addrBind.IsIPv6()) { #ifdef IPV6_V6ONLY #ifdef WIN32 setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&nOne, sizeof(int)); #else setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&nOne, sizeof(int)); #endif #endif #ifdef WIN32 int nProtLevel = 10 /* PROTECTION_LEVEL_UNRESTRICTED */; int nParameterId = 23 /* IPV6_PROTECTION_LEVEl */; // this call is allowed to fail setsockopt(hListenSocket, IPPROTO_IPV6, nParameterId, (const char*)&nProtLevel, sizeof(int)); #endif } #endif if (::bind(hListenSocket, (struct sockaddr*)&sockaddr, len) == SOCKET_ERROR) { int nErr = WSAGetLastError(); if (nErr == WSAEADDRINUSE) strError = strprintf(_("Unable to bind to %s on this computer. KnugenCoin is probably already running."), addrBind.ToString().c_str()); else strError = strprintf(_("Unable to bind to %s on this computer (bind returned error %d, %s)"), addrBind.ToString().c_str(), nErr, strerror(nErr)); printf("%s\n", strError.c_str()); return false; } printf("Bound to %s\n", addrBind.ToString().c_str()); // Listen for incoming connections if (listen(hListenSocket, SOMAXCONN) == SOCKET_ERROR) { strError = strprintf("Error: Listening for incoming connections failed (listen returned error %d)", WSAGetLastError()); printf("%s\n", strError.c_str()); return false; } vhListenSocket.push_back(hListenSocket); if (addrBind.IsRoutable() && fDiscover) AddLocal(addrBind, LOCAL_BIND); return true; } void static Discover() { if (!fDiscover) return; #ifdef WIN32 // Get local host IP char pszHostName[1000] = ""; if (gethostname(pszHostName, sizeof(pszHostName)) != SOCKET_ERROR) { vector<CNetAddr> vaddr; if (LookupHost(pszHostName, vaddr)) { BOOST_FOREACH (const CNetAddr &addr, vaddr) { AddLocal(addr, LOCAL_IF); } } } #else // Get local host ip struct ifaddrs* myaddrs; if (getifaddrs(&myaddrs) == 0) { for (struct ifaddrs* ifa = myaddrs; ifa != NULL; ifa = ifa->ifa_next) { if (ifa->ifa_addr == NULL) continue; if ((ifa->ifa_flags & IFF_UP) == 0) continue; if (strcmp(ifa->ifa_name, "lo") == 0) continue; if (strcmp(ifa->ifa_name, "lo0") == 0) continue; if (ifa->ifa_addr->sa_family == AF_INET) { struct sockaddr_in* s4 = (struct sockaddr_in*)(ifa->ifa_addr); CNetAddr addr(s4->sin_addr); if (AddLocal(addr, LOCAL_IF)) printf("IPv4 %s: %s\n", ifa->ifa_name, addr.ToString().c_str()); } #ifdef USE_IPV6 else if (ifa->ifa_addr->sa_family == AF_INET6) { struct sockaddr_in6* s6 = (struct sockaddr_in6*)(ifa->ifa_addr); CNetAddr addr(s6->sin6_addr); if (AddLocal(addr, LOCAL_IF)) printf("IPv6 %s: %s\n", ifa->ifa_name, addr.ToString().c_str()); } #endif } freeifaddrs(myaddrs); } #endif // Don't use external IPv4 discovery, when -onlynet="IPv6" if (!IsLimited(NET_IPV4)) NewThread(ThreadGetMyExternalIP, NULL); } void StartNode(boost::thread_group& threadGroup) { if (semOutbound == NULL) { // initialize semaphore int nMaxOutbound = min(MAX_OUTBOUND_CONNECTIONS, nMaxConnections); semOutbound = new CSemaphore(nMaxOutbound); } if (pnodeLocalHost == NULL) pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress(CService("127.0.0.1", 0), nLocalServices)); Discover(); // // Start threads // if (!GetBoolArg("-dnsseed", true)) printf("DNS seeding disabled\n"); else threadGroup.create_thread(boost::bind(&TraceThread<boost::function<void()> >, "dnsseed", &ThreadDNSAddressSeed)); #ifdef USE_UPNP // Map ports with UPnP MapPort(GetBoolArg("-upnp", USE_UPNP)); #endif // Send and receive from sockets, accept connections threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "net", &ThreadSocketHandler)); // Initiate outbound connections from -addnode threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "addcon", &ThreadOpenAddedConnections)); // Initiate outbound connections threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "opencon", &ThreadOpenConnections)); // Process messages threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "msghand", &ThreadMessageHandler)); // Dump network addresses threadGroup.create_thread(boost::bind(&LoopForever<void (*)()>, "dumpaddr", &DumpAddresses, DUMP_ADDRESSES_INTERVAL * 1000)); } bool StopNode() { printf("StopNode()\n"); GenerateBitcoins(false, NULL); MapPort(false); nTransactionsUpdated++; if (semOutbound) for (int i=0; i<MAX_OUTBOUND_CONNECTIONS; i++) semOutbound->post(); MilliSleep(50); DumpAddresses(); return true; } class CNetCleanup { public: CNetCleanup() { } ~CNetCleanup() { // Close sockets BOOST_FOREACH(CNode* pnode, vNodes) if (pnode->hSocket != INVALID_SOCKET) closesocket(pnode->hSocket); BOOST_FOREACH(SOCKET hListenSocket, vhListenSocket) if (hListenSocket != INVALID_SOCKET) if (closesocket(hListenSocket) == SOCKET_ERROR) printf("closesocket(hListenSocket) failed with error %d\n", WSAGetLastError()); // clean up some globals (to help leak detection) BOOST_FOREACH(CNode *pnode, vNodes) delete pnode; BOOST_FOREACH(CNode *pnode, vNodesDisconnected) delete pnode; vNodes.clear(); vNodesDisconnected.clear(); delete semOutbound; semOutbound = NULL; delete pnodeLocalHost; pnodeLocalHost = NULL; #ifdef WIN32 // Shutdown Windows Sockets WSACleanup(); #endif } } instance_of_cnetcleanup; void RelayTransaction(const CTransaction& tx, const uint256& hash) { CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss.reserve(10000); ss << tx; RelayTransaction(tx, hash, ss); } void RelayTransaction(const CTransaction& tx, const uint256& hash, const CDataStream& ss) { CInv inv(MSG_TX, hash); { LOCK(cs_mapRelay); // Expire old relay messages while (!vRelayExpiration.empty() && vRelayExpiration.front().first < GetTime()) { mapRelay.erase(vRelayExpiration.front().second); vRelayExpiration.pop_front(); } // Save original serialized message so newer versions are preserved mapRelay.insert(std::make_pair(inv, ss)); vRelayExpiration.push_back(std::make_pair(GetTime() + 15 * 60, inv)); } LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) { if(!pnode->fRelayTxes) continue; LOCK(pnode->cs_filter); if (pnode->pfilter) { if (pnode->pfilter->IsRelevantAndUpdate(tx, hash)) pnode->PushInventory(inv); } else pnode->PushInventory(inv); } }
{ "content_hash": "b259555cb05db895f8cdfa562760f820", "timestamp": "", "source": "github", "line_count": 1899, "max_line_length": 196, "avg_line_length": 30.020010531858873, "alnum_prop": 0.5433272523154645, "repo_name": "Safello/KnugenCoin", "id": "bfd1a10b72fac35155ad560a93fc80c0ece37c9c", "size": "57008", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/net.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "103297" }, { "name": "C++", "bytes": "2512866" }, { "name": "CSS", "bytes": "1127" }, { "name": "IDL", "bytes": "14634" }, { "name": "Objective-C", "bytes": "5864" }, { "name": "Python", "bytes": "69714" }, { "name": "Shell", "bytes": "9702" }, { "name": "TypeScript", "bytes": "5239467" } ], "symlink_target": "" }
package com.amazonaws.services.elasticfilesystem.model; import javax.annotation.Generated; /** * <p> * Returned if the file system's lifecycle state is not "available". * </p> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class IncorrectFileSystemLifeCycleStateException extends com.amazonaws.services.elasticfilesystem.model.AmazonElasticFileSystemException { private static final long serialVersionUID = 1L; private String errorCode; /** * Constructs a new IncorrectFileSystemLifeCycleStateException with the specified error message. * * @param message * Describes the error encountered. */ public IncorrectFileSystemLifeCycleStateException(String message) { super(message); } /** * @param errorCode */ @com.fasterxml.jackson.annotation.JsonProperty("ErrorCode") public void setErrorCode(String errorCode) { this.errorCode = errorCode; } /** * @return */ @com.fasterxml.jackson.annotation.JsonProperty("ErrorCode") public String getErrorCode() { return this.errorCode; } /** * @param errorCode * @return Returns a reference to this object so that method calls can be chained together. */ public IncorrectFileSystemLifeCycleStateException withErrorCode(String errorCode) { setErrorCode(errorCode); return this; } }
{ "content_hash": "ac59b42a431ac0c948c248793cdee7cf", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 145, "avg_line_length": 25.87272727272727, "alnum_prop": 0.6921995783555868, "repo_name": "aws/aws-sdk-java", "id": "fc4f911e04796ffa755df9aadfcdb323ba99f0bf", "size": "2003", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-efs/src/main/java/com/amazonaws/services/elasticfilesystem/model/IncorrectFileSystemLifeCycleStateException.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
require "gapic/config" require "gapic/config/method" require "google/cloud/compute/v1/version" require "google/cloud/compute/v1/machine_images/credentials" require "google/cloud/compute/v1/machine_images/rest" module Google module Cloud module Compute module V1 ## # The MachineImages API. # # To load this service and instantiate a REST client: # # require "google/cloud/compute/v1/machine_images" # client = ::Google::Cloud::Compute::V1::MachineImages::Rest::Client.new # module MachineImages end end end end end helper_path = ::File.join __dir__, "machine_images", "helpers.rb" require "google/cloud/compute/v1/machine_images/helpers" if ::File.file? helper_path
{ "content_hash": "e4b21c4e1c8943d1b6d81a340629b8dd", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 84, "avg_line_length": 26.96551724137931, "alnum_prop": 0.6547314578005116, "repo_name": "googleapis/google-cloud-ruby", "id": "fbc3717a2360f30a7b712d740a52baf608ce594f", "size": "1445", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "google-cloud-compute-v1/lib/google/cloud/compute/v1/machine_images.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "23930" }, { "name": "CSS", "bytes": "1422" }, { "name": "DIGITAL Command Language", "bytes": "2216" }, { "name": "Go", "bytes": "1321" }, { "name": "HTML", "bytes": "66414" }, { "name": "JavaScript", "bytes": "1862" }, { "name": "Ruby", "bytes": "103945852" }, { "name": "Shell", "bytes": "19653" } ], "symlink_target": "" }
<?php // autoload_psr4.php @generated by Composer $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( 'phpseclib\\' => array($vendorDir . '/phpseclib/phpseclib/phpseclib'), 'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/type-resolver/src', $vendorDir . '/phpdocumentor/reflection-docblock/src'), 'Zend\\Diactoros\\' => array($vendorDir . '/zendframework/zend-diactoros/src'), 'XdgBaseDir\\' => array($vendorDir . '/dnoegel/php-xdg-base-dir/src'), 'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'), 'TijsVerkoyen\\CssToInlineStyles\\' => array($vendorDir . '/tijsverkoyen/css-to-inline-styles/src'), 'Tests\\' => array($baseDir . '/tests'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), 'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'), 'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'), 'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'), 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'), 'Symfony\\Component\\HttpKernel\\' => array($vendorDir . '/symfony/http-kernel'), 'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'), 'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'), 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'), 'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'), 'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'), 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), 'Symfony\\Component\\ClassLoader\\' => array($vendorDir . '/symfony/class-loader'), 'Symfony\\Bridge\\PsrHttpMessage\\' => array($vendorDir . '/symfony/psr-http-message-bridge'), 'Ramsey\\Uuid\\' => array($vendorDir . '/ramsey/uuid/src'), 'Psy\\' => array($vendorDir . '/psy/psysh/src/Psy'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), 'Predis\\' => array($vendorDir . '/predis/predis/src'), 'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'), 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), 'League\\OAuth2\\Server\\' => array($vendorDir . '/league/oauth2-server/src'), 'League\\OAuth1\\' => array($vendorDir . '/league/oauth1-client/src'), 'League\\HTMLToMarkdown\\' => array($vendorDir . '/league/html-to-markdown/src'), 'League\\Fractal\\' => array($vendorDir . '/league/fractal/src'), 'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'), 'League\\Event\\' => array($vendorDir . '/league/event/src'), 'Lcobucci\\JWT\\' => array($vendorDir . '/lcobucci/jwt/src'), 'Laravel\\Tinker\\' => array($vendorDir . '/laravel/tinker/src'), 'Laravel\\Socialite\\' => array($vendorDir . '/laravel/socialite/src'), 'Laravel\\Passport\\' => array($vendorDir . '/laravel/passport/src'), 'JellyBool\\Translug\\' => array($vendorDir . '/jellybool/translug/src'), 'Intervention\\Image\\' => array($vendorDir . '/intervention/image/src/Intervention/Image'), 'Illuminate\\' => array($vendorDir . '/laravel/framework/src/Illuminate'), 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'), 'Faker\\' => array($vendorDir . '/fzaninotto/faker/src/Faker'), 'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'), 'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'), 'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'), 'Cron\\' => array($vendorDir . '/mtdowling/cron-expression/src/Cron'), 'Carbon\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'), 'Barryvdh\\LaravelIdeHelper\\' => array($vendorDir . '/barryvdh/laravel-ide-helper/src'), 'App\\' => array($baseDir . '/app'), );
{ "content_hash": "ee1a177060c26b1429393ebd09d60b41", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 200, "avg_line_length": 70, "alnum_prop": 0.6476190476190476, "repo_name": "jdshao/blog", "id": "88a9deff7d09a6ae9ca55173f640f4b68c32584a", "size": "4410", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/composer/autoload_psr4.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "553" }, { "name": "HTML", "bytes": "72910" }, { "name": "JavaScript", "bytes": "17029" }, { "name": "PHP", "bytes": "219714" }, { "name": "Vue", "bytes": "163863" } ], "symlink_target": "" }
require('babel-polyfill'); // Webpack config for creating the production bundle. var path = require('path'); var webpack = require('webpack'); var CleanPlugin = require('clean-webpack-plugin'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var strip = require('strip-loader'); var projectRootPath = path.resolve(__dirname, '../'); var assetsPath = path.resolve(projectRootPath, './static/dist'); // https://github.com/halt-hammerzeit/webpack-isomorphic-tools var WebpackIsomorphicToolsPlugin = require('webpack-isomorphic-tools/plugin'); var webpackIsomorphicToolsPlugin = new WebpackIsomorphicToolsPlugin(require('./webpack-isomorphic-tools')); var CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { devtool: 'source-map', context: path.resolve(__dirname, '..'), entry: { 'main': [ './src/client.js' ] }, output: { path: assetsPath, filename: '[name]-[chunkhash].js', chunkFilename: '[name]-[chunkhash].js', publicPath: '/dist/' }, module: { loaders: [ { test: /\.jsx?$/, exclude: /node_modules/, loaders: [strip.loader('debug'), 'babel']}, { test: /\.json$/, loader: 'json-loader' }, { test: /\.less$/, loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=2&sourceMap!autoprefixer?browsers=last 2 version!less?outputStyle=expanded&sourceMap=true&sourceMapContents=true') }, { test: /\.scss$/, loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=2&sourceMap!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded&sourceMap=true&sourceMapContents=true') }, { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff" }, { test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff" }, { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream" }, { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file" }, { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml" }, { test: webpackIsomorphicToolsPlugin.regular_expression('images'), loader: 'url-loader?limit=10240' } ] }, progress: true, resolve: { modulesDirectories: [ 'src', 'node_modules' ], extensions: ['', '.json', '.js', '.jsx'] }, plugins: [ new CleanPlugin([assetsPath], { root: projectRootPath }), // css files from the extract-text-plugin loader new ExtractTextPlugin('[name]-[chunkhash].css', {allChunks: true}), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: '"production"' }, __CLIENT__: true, __SERVER__: false, __DEVELOPMENT__: false, __DEVTOOLS__: false }), // ignore dev config new webpack.IgnorePlugin(/\.\/dev/, /\/config$/), // optimizations new webpack.optimize.DedupePlugin(), new webpack.optimize.OccurenceOrderPlugin(), new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }), new CopyWebpackPlugin([ { from: 'node_modules/antd/dist/*', flatten: true, force: true }, { from: 'node_modules/antd/dist/*.css.map', flatten: true, force: true } ]), webpackIsomorphicToolsPlugin ] };
{ "content_hash": "80af9dbbf2578550276da4824c649bc7", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 212, "avg_line_length": 37.7816091954023, "alnum_prop": 0.6355339215089747, "repo_name": "johnnycx127/react-demo", "id": "f84e342d3d4f1892e1a65fae3b9b92a9a45b438b", "size": "3287", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "webpack/prod.config.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2434" }, { "name": "JavaScript", "bytes": "115390" } ], "symlink_target": "" }
'use strict'; //Schedules service used to communicate Schedules REST endpoints /* angular.module('schedules').factory('Schedules', ['$resource', function($resource) { return $resource('schedules/:scheduleId', { scheduleId: '@_id' }, { update: { method: 'PUT' } }); } ]); */ angular.module('schedules').factory('Schedules', ['$resource', function($resource) { return $resource('schedules/:scheduleId', { scheduleId: '@_id' }, { update: { method: 'PUT' }, get: { method: 'GET', isArray: true } }); } ]);
{ "content_hash": "e3eb236aaeed64dfce2b2f59d93aed37", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 68, "avg_line_length": 22.64516129032258, "alnum_prop": 0.47150997150997154, "repo_name": "fforres/canchapp", "id": "eda4cf4c45c1ea5506987554d832c621b21a4a72", "size": "702", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "public/modules/schedules/services/schedules.client.service.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "500" }, { "name": "JavaScript", "bytes": "354117" }, { "name": "Perl", "bytes": "48" }, { "name": "Shell", "bytes": "414" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <data> <variable name="viewModel" type="pl.lizardproject.qe2017.itemlist.ItemViewModel"/> </data> <android.support.percent.PercentRelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/selectableItemBackground" android:onClick="@{viewModel::onClickCommand}" android:paddingBottom="6dp" android:paddingTop="6dp"> <TextView android:id="@+id/text" android:layout_height="wrap_content" android:maxLines="1" android:text="@{viewModel.item.name}" android:textAppearance="@android:style/TextAppearance.Medium" app:layout_widthPercent="80%"/> <TextView android:id="@+id/category" android:layout_height="wrap_content" android:layout_below="@+id/text" android:paddingTop="6dp" android:text="@{String.format(@string/category, viewModel.item.category.toString().toLowerCase())}" android:textAppearance="@android:style/TextAppearance.Small" android:textColor="@color/colorAccent" app:layout_widthPercent="80%"/> <TextView android:layout_height="wrap_content" android:layout_below="@+id/category" android:text="@{String.format(@string/priority, viewModel.item.priority.toString().toLowerCase())}" android:textAppearance="@android:style/TextAppearance.Small" android:textColor="@color/colorAccent" app:layout_widthPercent="80%"/> <CheckBox android:id="@+id/checkbox" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_toRightOf="@id/text" android:checked="@{viewModel.item.isChecked}" app:layout_widthPercent="10%" app:onCheckedChangeListener="@{viewModel::onCheckChangedCommand}"/> <ImageView android:id="@+id/deleteButton" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_toRightOf="@id/checkbox" android:onClick="@{viewModel::onDeleteClickCommand}" android:scaleType="fitEnd" android:src="@drawable/delete" app:layout_widthPercent="10%"/> </android.support.percent.PercentRelativeLayout> </layout>
{ "content_hash": "b0d50d6973c14cd1115fc08a51d2b8ad", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 111, "avg_line_length": 43.04761904761905, "alnum_prop": 0.6047197640117994, "repo_name": "The-Lizard-Project/qe2017", "id": "c3a627330234364a5c4e5cf658a529384b04fc32", "size": "2712", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Aplikacja/app/src/main/res/layout/item_item_list.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "40851" }, { "name": "Kotlin", "bytes": "26044" } ], "symlink_target": "" }
<?xml version="1.0"?> <doc> <assembly> <name>Elmah</name> </assembly> <members> <member name="T:Elmah.AboutPage"> <summary> Renders an HTML page that presents information about the version, build configuration, source files as well as a method to check for updates. </summary> </member> <member name="T:Elmah.ApplicationException"> <summary> The exception that is thrown when a non-fatal error occurs. This exception also serves as the base for all exceptions thrown by this library. </summary> </member> <member name="M:Elmah.ApplicationException.#ctor"> <summary> Initializes a new instance of the <see cref="T:Elmah.ApplicationException"/> class. </summary> </member> <member name="M:Elmah.ApplicationException.#ctor(System.String)"> <summary> Initializes a new instance of the <see cref="T:Elmah.ApplicationException"/> class with a specified error message. </summary> </member> <member name="M:Elmah.ApplicationException.#ctor(System.String,System.Exception)"> <summary> Initializes a new instance of the <see cref="T:Elmah.ApplicationException"/> class with a specified error message and a reference to the inner exception that is the cause of this exception. </summary> </member> <member name="M:Elmah.ApplicationException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)"> <summary> Initializes a new instance of the <see cref="T:Elmah.ApplicationException"/> class with serialized data. </summary> </member> <member name="T:Elmah.AccessErrorLog"> <summary> An <see cref="T:Elmah.ErrorLog"/> implementation that uses Microsoft Access as its backing store. </summary> <remarks> The MDB file is automatically created at the path specified in the connection string if it does not already exist. </remarks> </member> <member name="T:Elmah.ErrorLog"> <summary> Represents an error log capable of storing and retrieving errors generated in an ASP.NET Web application. </summary> </member> <member name="M:Elmah.ErrorLog.Log(Elmah.Error)"> <summary> Logs an error in log for the application. </summary> </member> <member name="M:Elmah.ErrorLog.LogAsync(Elmah.Error)"> <summary> When overridden in a subclass, starts a task that asynchronously does the same as <see cref="M:Elmah.ErrorLog.Log(Elmah.Error)"/>. </summary> </member> <member name="M:Elmah.ErrorLog.LogAsync(Elmah.Error,System.Threading.CancellationToken)"> <summary> When overridden in a subclass, starts a task that asynchronously does the same as <see cref="M:Elmah.ErrorLog.Log(Elmah.Error)"/>. An additional parameter specifies a <see cref="T:System.Threading.CancellationToken"/> to use. </summary> </member> <member name="M:Elmah.ErrorLog.BeginLog(Elmah.Error,System.AsyncCallback,System.Object)"> <summary> When overridden in a subclass, begins an asynchronous version of <see cref="M:Elmah.ErrorLog.Log(Elmah.Error)"/>. </summary> </member> <member name="M:Elmah.ErrorLog.EndLog(System.IAsyncResult)"> <summary> When overridden in a subclass, ends an asynchronous version of <see cref="M:Elmah.ErrorLog.Log(Elmah.Error)"/>. </summary> </member> <member name="M:Elmah.ErrorLog.GetError(System.String)"> <summary> Retrieves a single application error from log given its identifier, or null if it does not exist. </summary> </member> <member name="M:Elmah.ErrorLog.GetErrorAsync(System.String)"> <summary> When overridden in a subclass, starts a task that asynchronously does the same as <see cref="M:Elmah.ErrorLog.GetError(System.String)"/>. </summary> </member> <member name="M:Elmah.ErrorLog.GetErrorAsync(System.String,System.Threading.CancellationToken)"> <summary> When overridden in a subclass, starts a task that asynchronously does the same as <see cref="M:Elmah.ErrorLog.GetError(System.String)"/>. An additional parameter specifies a <see cref="T:System.Threading.CancellationToken"/> to use. </summary> </member> <member name="M:Elmah.ErrorLog.BeginGetError(System.String,System.AsyncCallback,System.Object)"> <summary> When overridden in a subclass, begins an asynchronous version of <see cref="M:Elmah.ErrorLog.GetError(System.String)"/>. </summary> </member> <member name="M:Elmah.ErrorLog.EndGetError(System.IAsyncResult)"> <summary> When overridden in a subclass, ends an asynchronous version of <see cref="M:Elmah.ErrorLog.GetError(System.String)"/>. </summary> </member> <member name="M:Elmah.ErrorLog.GetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"> <summary> Retrieves a page of application errors from the log in descending order of logged time. </summary> </member> <member name="M:Elmah.ErrorLog.GetErrorsAsync(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"> <summary> When overridden in a subclass, starts a task that asynchronously does the same as <see cref="M:Elmah.ErrorLog.GetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"/>. An additional parameter specifies a <see cref="T:System.Threading.CancellationToken"/> to use. </summary> </member> <member name="M:Elmah.ErrorLog.GetErrorsAsync(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry},System.Threading.CancellationToken)"> <summary> When overridden in a subclass, starts a task that asynchronously does the same as <see cref="M:Elmah.ErrorLog.GetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"/>. </summary> </member> <member name="M:Elmah.ErrorLog.BeginGetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry},System.AsyncCallback,System.Object)"> <summary> When overridden in a subclass, begins an asynchronous version of <see cref="M:Elmah.ErrorLog.GetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"/>. </summary> </member> <member name="M:Elmah.ErrorLog.EndGetErrors(System.IAsyncResult)"> <summary> When overridden in a subclass, ends an asynchronous version of <see cref="M:Elmah.ErrorLog.GetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"/>. </summary> </member> <member name="M:Elmah.ErrorLog.GetDefault(System.Web.HttpContextBase)"> <summary> Gets the default error log implementation specified in the configuration file, or the in-memory log implemention if none is configured. </summary> </member> <member name="P:Elmah.ErrorLog.Name"> <summary> Get the name of this log. </summary> </member> <member name="P:Elmah.ErrorLog.ApplicationName"> <summary> Gets the name of the application to which the log is scoped. </summary> </member> <member name="M:Elmah.AccessErrorLog.#ctor(System.Collections.IDictionary)"> <summary> Initializes a new instance of the <see cref="T:Elmah.AccessErrorLog"/> class using a dictionary of configured settings. </summary> </member> <member name="M:Elmah.AccessErrorLog.#ctor(System.String)"> <summary> Initializes a new instance of the <see cref="T:Elmah.AccessErrorLog"/> class to use a specific connection string for connecting to the database. </summary> </member> <member name="M:Elmah.AccessErrorLog.Log(Elmah.Error)"> <summary> Logs an error to the database. </summary> <remarks> Use the stored procedure called by this implementation to set a policy on how long errors are kept in the log. The default implementation stores all errors for an indefinite time. </remarks> </member> <member name="M:Elmah.AccessErrorLog.GetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"> <summary> Returns a page of errors from the databse in descending order of logged time. </summary> </member> <member name="M:Elmah.AccessErrorLog.GetError(System.String)"> <summary> Returns the specified error from the database, or null if it does not exist. </summary> </member> <member name="P:Elmah.AccessErrorLog.Name"> <summary> Gets the name of this error log implementation. </summary> </member> <member name="P:Elmah.AccessErrorLog.ConnectionString"> <summary> Gets the connection string used by the log to connect to the database. </summary> </member> <member name="T:Elmah.Assertions.AssertionFactoryHandler"> <summary> Represents the method that will be responsible for creating an assertion object and initializing it from an XML configuration element. </summary> </member> <member name="T:Elmah.Assertions.AssertionFactory"> <summary> Holds factory methods for creating configured assertion objects. </summary> </member> <member name="M:Elmah.Assertions.AssertionFactory.DecodeClrTypeNamespaceFromXmlNamespace(System.String,System.String@,System.String@)"> <remarks> Ideally, we would be able to use SoapServices.DecodeXmlNamespaceForClrTypeNamespace but that requires a link demand permission that will fail in partially trusted environments such as ASP.NET medium trust. </remarks> </member> <member name="T:Elmah.Assertions.ComparisonAssertion"> <summary> An assertion implementation whose test is based on whether the result of an input expression evaluated against a context matches a regular expression pattern or not. </summary> </member> <member name="T:Elmah.Assertions.IAssertion"> <summary> Provides evaluation of a context to determine whether it matches certain criteria or not. </summary> </member> <member name="M:Elmah.Assertions.IAssertion.Test(System.Object)"> <remarks> The context is typed generically as System.Object when it could have been restricted to System.Web.HttpContext and also avoid unnecessary casting downstream. However, using object allows simple assertions to be unit-tested without having to stub out a lot of the classes from System.Web (most of which cannot be stubbed anyhow due to lack of virtual and instance methods). </remarks> </member> <member name="T:Elmah.Assertions.CompositeAssertion"> <summary> Read-only collection of <see cref="T:Elmah.Assertions.IAssertion"/> instances. </summary> </member> <member name="T:Elmah.DataBinder"> <summary> Provides data expression evaluation facilites similar to <see cref="T:System.Web.UI.DataBinder"/> in ASP.NET. </summary> </member> <member name="T:Elmah.Assertions.JScriptAssertion"> <summary> An assertion implementation that uses a JScript expression to determine the outcome. </summary> <remarks> Each instance of this type maintains a separate copy of the JScript engine so use it sparingly. For example, instead of creating several objects, each with different a expression, try and group all expressions that apply to particular context into a single compound JScript expression using the conditional-OR (||) operator. </remarks> </member> <member name="T:Elmah.Assertions.JScriptAssertion.PartialTrustEvaluationStrategy"> <summary> Uses the JScript eval function to compile and evaluate the expression against the context on each evaluation. </summary> </member> <member name="T:Elmah.Assertions.JScriptAssertion.FullTrustEvaluationStrategy"> <summary> Compiles the given expression into a JScript function at time of construction and then simply invokes it during evaluation, using the context as a parameter. </summary> </member> <member name="T:Elmah.Assertions.RegexMatchAssertion"> <summary> An assertion implementation whose test is based on whether the result of an input expression evaluated against a context matches a regular expression pattern or not. </summary> </member> <member name="T:Elmah.Assertions.StaticAssertion"> <summary> An static assertion implementation that always evaluates to a preset value. </summary> </member> <member name="T:Elmah.Assertions.TypeAssertion"> <summary> An assertion implementation whose test is based on whether the result of an input expression evaluated against a context matches a regular expression pattern or not. </summary> </member> <member name="M:Elmah.Async.TaskFromResultOrError``1(``0,System.Exception)"> <summary> Creates a task that has already completed with either the given result or faulted with the given exception. </summary> <remarks> If <paramref name="exception"/> is supplied then <paramref name="result"/> is ignored. </remarks> </member> <member name="F:Elmah.AsyncResult._owner"> <summary> The object which started the operation. </summary> </member> <member name="F:Elmah.AsyncResult._operationId"> <summary> Used to verify the BeginXXX and EndXXX calls match. </summary> </member> <member name="F:Elmah.Build.Status"> <summary> This is the status or milestone of the build. Examples are M1, M2, ..., Mn, BETA1, BETA2, RC1, RC2, RTM. </summary> </member> <member name="P:Elmah.Build.ImageRuntimeVersion"> <summary> Gets a string representing the version of the CLR saved in the file containing the manifest. Under 1.0, this returns the hard-wired string "v1.0.3705". </summary> </member> <member name="T:Elmah.ConnectionStringHelper"> <summary> Helper class for resolving connection strings. </summary> </member> <member name="M:Elmah.ConnectionStringHelper.GetConnectionString(System.Collections.IDictionary)"> <summary> Gets the connection string from the given configuration dictionary. </summary> </member> <member name="M:Elmah.ConnectionStringHelper.GetConnectionStringProviderName(System.Collections.IDictionary)"> <summary> Gets the provider name from the named connection string (if supplied) from the given configuration dictionary. </summary> </member> <member name="M:Elmah.ConnectionStringHelper.GetDataSourceFilePath(System.String)"> <summary> Extracts the Data Source file path from a connection string ~/ gets resolved as does |DataDirectory| </summary> </member> <member name="M:Elmah.ConnectionStringHelper.GetConnectionString(System.Collections.IDictionary,System.Boolean)"> <summary> Gets the connection string from the given configuration, resolving ~/ and DataDirectory if necessary. </summary> </member> <member name="M:Elmah.ConnectionStringHelper.GetResolvedConnectionString(System.String)"> <summary> Converts the supplied connection string so that the Data Source specification contains the full path and not ~/ or DataDirectory. </summary> </member> <member name="T:Elmah.ErrorMailHtmlPage"> <summary> Renders an HTML page displaying details about an error from the error log ready for emailing. </summary> </member> <member name="T:Elmah.DbCommandExtensions"> <summary> Extension methods for <see cref="T:System.Data.IDbCommand"/> objects. </summary> </member> <member name="M:Elmah.DbCommandExtensions.ParameterAdder(System.Data.IDbCommand)"> <remarks> Use <see cref="F:System.Reflection.Missing.Value"/> for parameter value to avoid having it set by the returned function. </remarks> </member> <member name="M:Elmah.DbCommandExtensions.ParameterAdder``2(``0,System.Func{``0,``1})"> <remarks> Use <see cref="F:System.Reflection.Missing.Value"/> for parameter value to avoid having it set by the returned function. </remarks> </member> <member name="M:Elmah.ExceptionExtensions.TrySetCallerInfo(System.Exception,Elmah.CallerInfo)"> <summary> Attempts to install a <see cref="T:Elmah.CallerInfo"/> into an <see cref="T:System.Exception"/> via <see cref="P:System.Exception.Data"/>. </summary> <returns> Returns <see cref="T:Elmah.CallerInfo"/> that was replaced otherwise <c>null</c>. </returns> </member> <member name="M:Elmah.HttpRequestValidation.TryGetUnvalidatedCollections``1(System.Web.HttpRequestBase,System.Func{System.Collections.Specialized.NameValueCollection,System.Collections.Specialized.NameValueCollection,System.Web.HttpCookieCollection,``0})"> <summary> Returns unvalidated collections if build targets .NET Framework 4.0 or later and if caller is hosted at run-time (based on value of <see cref="P:System.Web.Hosting.HostingEnvironment.IsHosted"/>) when targeting .NET Framework 4.0 exclusively. In all other cases except when targeting .NET Framework 4.5, collections returned are validated ones from <see cref="P:System.Web.HttpRequestBase.Form"/> and <see cref="P:System.Web.HttpRequestBase.QueryString"/> and therefore could raise <see cref="T:System.Web.HttpRequestValidationException"/>. </summary> </member> <member name="M:MoreLinq.MoreEnumerable.Index``1(System.Collections.Generic.IEnumerable{``0})"> <summary> Returns a sequence of <see cref="T:System.Collections.Generic.KeyValuePair`2"/> where the key is the zero-based index of the value in the source sequence. </summary> <typeparam name="TSource">Type of elements in <paramref name="source"/> sequence.</typeparam> <param name="source">The source sequence.</param> <returns>A sequence of <see cref="T:System.Collections.Generic.KeyValuePair`2"/>.</returns> <remarks>This operator uses deferred execution and streams its results.</remarks> </member> <member name="M:MoreLinq.MoreEnumerable.Index``1(System.Collections.Generic.IEnumerable{``0},System.Int32)"> <summary> Returns a sequence of <see cref="T:System.Collections.Generic.KeyValuePair`2"/> where the key is the index of the value in the source sequence. An additional parameter specifies the starting index. </summary> <typeparam name="TSource">Type of elements in <paramref name="source"/> sequence.</typeparam> <param name="source">The source sequence.</param> <param name="startIndex"></param> <returns>A sequence of <see cref="T:System.Collections.Generic.KeyValuePair`2"/>.</returns> <remarks>This operator uses deferred execution and streams its results.</remarks> </member> <member name="M:MoreLinq.MoreEnumerable.Pairwise``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``1})"> <summary> Returns a sequence resulting from applying a function to each element in the source sequence and its predecessor, with the exception of the first element which is only returned as the predecessor of the second element. </summary> <typeparam name="TSource">The type of the elements of <paramref name="source"/>.</typeparam> <typeparam name="TResult">The type of the element of the returned sequence.</typeparam> <param name="source">The source sequence.</param> <param name="resultSelector">A transform function to apply to each pair of sequence.</param> <returns> Returns the resulting sequence. </returns> <remarks> This operator uses deferred execution and streams its results. </remarks> <example> <code> int[] numbers = { 123, 456, 789 }; IEnumerable&lt;int&gt; result = numbers.Pairwise(5, (a, b) => a + b); </code> The <c>result</c> variable, when iterated over, will yield 579 and 1245, in turn. </example> </member> <member name="M:MoreLinq.MoreEnumerable.ToDelimitedString``1(System.Collections.Generic.IEnumerable{``0})"> <summary> Creates a delimited string from a sequence of values. The delimiter used depends on the current culture of the executing thread. </summary> <remarks> This operator uses immediate execution and effectively buffers the sequence. </remarks> <typeparam name="TSource">Type of element in the source sequence</typeparam> <param name="source">The sequence of items to delimit. Each is converted to a string using the simple ToString() conversion.</param> </member> <member name="M:MoreLinq.MoreEnumerable.ToDelimitedString``1(System.Collections.Generic.IEnumerable{``0},System.String)"> <summary> Creates a delimited string from a sequence of values and a given delimiter. </summary> <remarks> This operator uses immediate execution and effectively buffers the sequence. </remarks> <typeparam name="TSource">Type of element in the source sequence</typeparam> <param name="source">The sequence of items to delimit. Each is converted to a string using the simple ToString() conversion.</param> <param name="delimiter">The delimiter to inject between elements. May be null, in which case the executing thread's current culture's list separator is used.</param> </member> <member name="T:Elmah.ErrorDetailPage"> <summary> Renders an HTML page displaying details about an error from the error log. </summary> </member> <member name="T:Elmah.HelperResult"> <summary> Represents the result of a helper action as an HTML-encoded string. </summary> </member> <member name="T:Elmah.Debug"> <summary> Provides methods for assertions and debugging help that is mostly applicable during development. </summary> </member> <member name="M:Elmah.Environment.TryGetMachineName(System.Web.HttpContextBase,System.String)"> <remarks> If <paramref name="unknownName"/> is a null reference then this method will still return an empty string. </remarks> </member> <member name="T:Elmah.Error"> <summary> Represents a logical application error (as opposed to the actual exception it may be representing). </summary> </member> <member name="M:Elmah.Error.#ctor"> <summary> Initializes a new instance of the <see cref="T:Elmah.Error"/> class. </summary> </member> <member name="M:Elmah.Error.#ctor(System.Exception)"> <summary> Initializes a new instance of the <see cref="T:Elmah.Error"/> class from a given <see cref="P:Elmah.Error.Exception"/> instance. </summary> </member> <member name="M:Elmah.Error.#ctor(System.Exception,System.Web.HttpContextBase)"> <summary> Initializes a new instance of the <see cref="T:Elmah.Error"/> class from a given <see cref="P:Elmah.Error.Exception"/> instance and <see cref="T:System.Web.HttpContext"/> instance representing the HTTP context during the exception. </summary> </member> <member name="M:Elmah.Error.ToString"> <summary> Returns the value of the <see cref="P:Elmah.Error.Message"/> property. </summary> </member> <member name="M:Elmah.Error.System#ICloneable#Clone"> <summary> Creates a new object that is a copy of the current instance. </summary> </member> <member name="P:Elmah.Error.Exception"> <summary> Gets the <see cref="P:Elmah.Error.Exception"/> instance used to initialize this instance. </summary> <remarks> This is a run-time property only that is not written or read during XML serialization via <see cref="M:Elmah.ErrorXml.Decode(System.Xml.XmlReader)"/> and <see cref="M:Elmah.ErrorXml.Encode(Elmah.Error,System.Xml.XmlWriter)"/>. </remarks> </member> <member name="P:Elmah.Error.ApplicationName"> <summary> Gets or sets the name of application in which this error occurred. </summary> </member> <member name="P:Elmah.Error.HostName"> <summary> Gets or sets name of host machine where this error occurred. </summary> </member> <member name="P:Elmah.Error.Type"> <summary> Gets or sets the type, class or category of the error. </summary> </member> <member name="P:Elmah.Error.Source"> <summary> Gets or sets the source that is the cause of the error. </summary> </member> <member name="P:Elmah.Error.Message"> <summary> Gets or sets a brief text describing the error. </summary> </member> <member name="P:Elmah.Error.Detail"> <summary> Gets or sets a detailed text describing the error, such as a stack trace. </summary> </member> <member name="P:Elmah.Error.User"> <summary> Gets or sets the user logged into the application at the time of the error. </summary> </member> <member name="P:Elmah.Error.Time"> <summary> Gets or sets the date and time (in local time) at which the error occurred. </summary> </member> <member name="P:Elmah.Error.StatusCode"> <summary> Gets or sets the HTTP status code of the output returned to the client for the error. </summary> <remarks> For cases where this value cannot always be reliably determined, the value may be reported as zero. </remarks> </member> <member name="P:Elmah.Error.WebHostHtmlMessage"> <summary> Gets or sets the HTML message generated by the web host (ASP.NET) for the given error. </summary> </member> <member name="P:Elmah.Error.ServerVariables"> <summary> Gets a collection representing the Web server variables captured as part of diagnostic data for the error. </summary> </member> <member name="P:Elmah.Error.QueryString"> <summary> Gets a collection representing the Web query string variables captured as part of diagnostic data for the error. </summary> </member> <member name="P:Elmah.Error.Form"> <summary> Gets a collection representing the form variables captured as part of diagnostic data for the error. </summary> </member> <member name="P:Elmah.Error.Cookies"> <summary> Gets a collection representing the client cookies captured as part of diagnostic data for the error. </summary> </member> <member name="P:Elmah.Error.AdditionalData"> <summary> Gets a collection representing custom storage </summary> </member> <member name="T:Elmah.ErrorDigestRssHandler"> <summary> Renders an RSS feed that is a daily digest of the most recently recorded errors in the error log. The feed spans at most 15 days on which errors occurred. </summary> </member> <member name="T:Elmah.ErrorDisplay"> <summary> Provides miscellaneous formatting methods for </summary> </member> <member name="M:Elmah.ErrorDisplay.HumaneExceptionErrorType(System.String)"> <summary> Formats the type of an error, typically supplied as the <see cref="P:Elmah.Error.Type"/> value, in a short and human- readable form. </summary> <remarks> Typically, exception type names can be long to display and complex to consume. The essential part can usually be found in the start of an exception type name minus its namespace. For example, a human reading the string, "System.Runtime.InteropServices.COMException", will usually considers "COM" as the most useful component of the entire type name. This method does exactly that. It assumes that the the input type is a .NET Framework exception type name where the namespace and class will be separated by the last period (.) and where the type name ends in "Exception". If these conditions are method then a string like, "System.Web.HttpException" will be transformed into simply "Html". </remarks> </member> <member name="M:Elmah.ErrorDisplay.HumaneExceptionErrorType(Elmah.Error)"> <summary> Formats the error type of an <see cref="T:Elmah.Error"/> object in a short and human-readable form. </summary> </member> <member name="T:Elmah.ErrorFilterModule"> <summary> HTTP module implementation that logs unhandled exceptions in an ASP.NET Web application to an error log. </summary> </member> <member name="M:Elmah.ErrorFilterModule.Init(System.Web.HttpApplication)"> <summary> Initializes the module and prepares it to handle requests. </summary> </member> <member name="M:Elmah.ErrorFilterModule.Dispose"> <summary> Disposes of the resources (other than memory) used by the module. </summary> </member> <member name="T:Elmah.ErrorFilterSectionHandler"> <summary> Handler for the &lt;errorFilter&gt; section of the configuration file. </summary> </member> <member name="T:Elmah.ErrorHtmlPage"> <summary> Renders an HTML page displaying the detailed host-generated (ASP.NET) HTML recorded for an error from the error log. </summary> </member> <member name="T:Elmah.ErrorJson"> <summary> Responsible for primarily encoding the JSON representation of <see cref="T:Elmah.Error"/> objects. </summary> </member> <member name="M:Elmah.ErrorJson.EncodeString(Elmah.Error)"> <summary> Encodes the default JSON representation of an <see cref="T:Elmah.Error"/> object to a string. </summary> <remarks> Only properties and collection entires with non-null and non-empty strings are emitted. </remarks> </member> <member name="M:Elmah.ErrorJson.Encode(Elmah.Error,System.IO.TextWriter)"> <summary> Encodes the default JSON representation of an <see cref="T:Elmah.Error"/> object to a <see cref="T:System.IO.TextWriter"/>. </summary> <remarks> Only properties and collection entires with non-null and non-empty strings are emitted. </remarks> </member> <member name="T:Elmah.ErrorJsonHandler"> <summary> Renders an error as JSON Text (RFC 4627). </summary> </member> <member name="T:Elmah.ErrorLogDataSourceAdapter"> <summary> Methods of this type are designed to serve an <see cref="T:System.Web.UI.WebControls.ObjectDataSource"/> control and are adapted according to expected call signatures and behavior. </summary> </member> <member name="M:Elmah.ErrorLogDataSourceAdapter.#ctor"> <summary> Initializes a new instance of the <see cref="T:Elmah.ErrorLogDataSourceAdapter"/> class with the default error log implementation. </summary> </member> <member name="M:Elmah.ErrorLogDataSourceAdapter.GetErrorCount"> <summary> Use as the value for <see cref="P:System.Web.UI.WebControls.ObjectDataSource.SelectCountMethod"/>. </summary> </member> <member name="M:Elmah.ErrorLogDataSourceAdapter.GetErrors(System.Int32,System.Int32)"> <summary> Use as the value for <see cref="P:System.Web.UI.WebControls.ObjectDataSource.SelectMethod"/>. </summary> <remarks> The parameters of this method are named after the default values for <see cref="P:System.Web.UI.WebControls.ObjectDataSource.StartRowIndexParameterName"/> and <see cref="P:System.Web.UI.WebControls.ObjectDataSource.MaximumRowsParameterName"/> so that the minimum markup is needed for the object data source control. </remarks> </member> <member name="T:Elmah.ErrorLogEntry"> <summary> Binds an <see cref="P:Elmah.ErrorLogEntry.Error"/> instance with the <see cref="T:Elmah.ErrorLog"/> instance from where it was served. </summary> </member> <member name="M:Elmah.ErrorLogEntry.#ctor(Elmah.ErrorLog,System.String,Elmah.Error)"> <summary> Initializes a new instance of the <see cref="T:Elmah.ErrorLogEntry"/> class for a given unique error entry in an error log. </summary> </member> <member name="P:Elmah.ErrorLogEntry.Log"> <summary> Gets the <see cref="T:Elmah.ErrorLog"/> instance where this entry originated from. </summary> </member> <member name="P:Elmah.ErrorLogEntry.Id"> <summary> Gets the unique identifier that identifies the error entry in the log. </summary> </member> <member name="P:Elmah.ErrorLogEntry.Error"> <summary> Gets the <see cref="P:Elmah.ErrorLogEntry.Error"/> object held in the entry. </summary> </member> <member name="T:Elmah.ErrorLogModule"> <summary> HTTP module implementation that logs unhandled exceptions in an ASP.NET Web application to an error log. </summary> </member> <member name="T:Elmah.HttpModuleBase"> <summary> Provides an abstract base class for <see cref="T:System.Web.IHttpModule"/> that supports discovery from within partial trust environments. </summary> </member> <member name="M:Elmah.HttpModuleBase.OnInit(System.Web.HttpApplication)"> <summary> Initializes the module and prepares it to handle requests. </summary> </member> <member name="M:Elmah.HttpModuleBase.OnDispose"> <summary> Disposes of the resources (other than memory) used by the module. </summary> </member> <member name="P:Elmah.HttpModuleBase.SupportDiscoverability"> <summary> Determines whether the module will be registered for discovery in partial trust environments or not. </summary> </member> <member name="M:Elmah.ErrorLogModule.OnInit(System.Web.HttpApplication)"> <summary> Initializes the module and prepares it to handle requests. </summary> </member> <member name="M:Elmah.ErrorLogModule.GetErrorLog(System.Web.HttpContextBase)"> <summary> Gets the <see cref="T:Elmah.ErrorLog"/> instance to which the module will log exceptions. </summary> </member> <member name="M:Elmah.ErrorLogModule.OnError(System.Object,System.EventArgs)"> <summary> The handler called when an unhandled exception bubbles up to the module. </summary> </member> <member name="M:Elmah.ErrorLogModule.OnErrorSignaled(System.Object,Elmah.ErrorSignalEventArgs)"> <summary> The handler called when an exception is explicitly signaled. </summary> </member> <member name="M:Elmah.ErrorLogModule.LogException(System.Exception,System.Web.HttpContextBase)"> <summary> Logs an exception and its context to the error log. </summary> </member> <member name="M:Elmah.ErrorLogModule.OnLogged(Elmah.ErrorLoggedEventArgs)"> <summary> Raises the <see cref="E:Elmah.ErrorLogModule.Logged"/> event. </summary> </member> <member name="M:Elmah.ErrorLogModule.OnFiltering(Elmah.ExceptionFilterEventArgs)"> <summary> Raises the <see cref="E:Elmah.ErrorLogModule.Filtering"/> event. </summary> </member> <member name="P:Elmah.ErrorLogModule.SupportDiscoverability"> <summary> Determines whether the module will be registered for discovery in partial trust environments or not. </summary> </member> <member name="T:Elmah.ErrorLogPage"> <summary> Renders an HTML page displaying a page of errors from the error log. </summary> </member> <member name="T:Elmah.ErrorLogPageFactory"> <summary> HTTP handler factory that dispenses handlers for rendering views and resources needed to display the error log. </summary> </member> <member name="M:Elmah.ErrorLogPageFactory.GetHandler(System.Web.HttpContextBase,System.String,System.String,System.String)"> <summary> Returns an object that implements the <see cref="T:System.Web.IHttpHandler"/> interface and which is responsible for serving the request. </summary> <returns> A new <see cref="T:System.Web.IHttpHandler"/> object that processes the request. </returns> </member> <member name="M:Elmah.ErrorLogPageFactory.ReleaseHandler(System.Web.IHttpHandler)"> <summary> Enables the factory to reuse an existing handler instance. </summary> </member> <member name="M:Elmah.ErrorLogPageFactory.IsAuthorized(System.Web.HttpContextBase)"> <summary> Determines if the request is authorized by objects implementing <see cref="T:Elmah.IRequestAuthorizationHandler"/>. </summary> <returns> Returns <c>false</c> if unauthorized, <c>true</c> if authorized otherwise <c>null</c> if no handlers were available to answer. </returns> </member> <member name="T:Elmah.ErrorLogSectionHandler"> <summary> Handler for the &lt;errorLog&gt; section of the configuration file. </summary> </member> <member name="T:Elmah.ErrorMailHtmlFormatter"> <summary> Formats the HTML to display the details of a given error that is suitable for sending as the body of an e-mail message. </summary> </member> <member name="T:Elmah.ErrorTextFormatter"> <summary> Provides the base contract for implementations that render text-based formatting for an error. </summary> </member> <member name="M:Elmah.ErrorTextFormatter.Format(System.IO.TextWriter,Elmah.Error)"> <summary> Formats a text representation of the given <see cref="T:Elmah.Error"/> instance using a <see cref="T:System.IO.TextWriter"/>. </summary> </member> <member name="P:Elmah.ErrorTextFormatter.MimeType"> <summary> Gets the MIME type of the text format provided by the formatter implementation. </summary> </member> <member name="M:Elmah.ErrorMailHtmlFormatter.Format(System.IO.TextWriter,Elmah.Error)"> <summary> Formats a complete HTML document describing the given <see cref="T:Elmah.Error"/> instance. </summary> </member> <member name="P:Elmah.ErrorMailHtmlFormatter.MimeType"> <summary> Returns the text/html MIME type that is the format provided by this <see cref="T:Elmah.ErrorTextFormatter"/> implementation. </summary> </member> <member name="T:Elmah.ErrorMailModule"> <summary> HTTP module that sends an e-mail whenever an unhandled exception occurs in an ASP.NET web application. </summary> </member> <member name="M:Elmah.ErrorMailModule.OnInit(System.Web.HttpApplication)"> <summary> Initializes the module and prepares it to handle requests. </summary> </member> <member name="M:Elmah.ErrorMailModule.OnError(System.Object,System.EventArgs)"> <summary> The handler called when an unhandled exception bubbles up to the module. </summary> </member> <member name="M:Elmah.ErrorMailModule.OnErrorSignaled(System.Object,Elmah.ErrorSignalEventArgs)"> <summary> The handler called when an exception is explicitly signaled. </summary> </member> <member name="M:Elmah.ErrorMailModule.OnError(System.Exception,System.Web.HttpContextBase)"> <summary> Reports the exception. </summary> </member> <member name="M:Elmah.ErrorMailModule.OnFiltering(Elmah.ExceptionFilterEventArgs)"> <summary> Raises the <see cref="E:Elmah.ErrorMailModule.Filtering"/> event. </summary> </member> <member name="M:Elmah.ErrorMailModule.ReportErrorAsync(Elmah.Error)"> <summary> Schedules the error to be e-mailed asynchronously. </summary> <remarks> The default implementation uses the <see cref="T:System.Threading.ThreadPool"/> to queue the reporting. </remarks> </member> <member name="M:Elmah.ErrorMailModule.ReportError(Elmah.Error)"> <summary> Schedules the error to be e-mailed synchronously. </summary> </member> <member name="M:Elmah.ErrorMailModule.CreateErrorFormatter"> <summary> Creates the <see cref="T:Elmah.ErrorTextFormatter"/> implementation to be used to format the body of the e-mail. </summary> </member> <member name="M:Elmah.ErrorMailModule.SendMail(System.Net.Mail.MailMessage)"> <summary> Sends the e-mail using SmtpMail or SmtpClient. </summary> </member> <member name="M:Elmah.ErrorMailModule.OnMailing(Elmah.ErrorMailEventArgs)"> <summary> Fires the <see cref="E:Elmah.ErrorMailModule.Mailing"/> event. </summary> </member> <member name="M:Elmah.ErrorMailModule.OnMailed(Elmah.ErrorMailEventArgs)"> <summary> Fires the <see cref="E:Elmah.ErrorMailModule.Mailed"/> event. </summary> </member> <member name="M:Elmah.ErrorMailModule.OnDisposingMail(Elmah.ErrorMailEventArgs)"> <summary> Fires the <see cref="E:Elmah.ErrorMailModule.DisposingMail"/> event. </summary> </member> <member name="M:Elmah.ErrorMailModule.GetConfig"> <summary> Gets the configuration object used by <see cref="M:Elmah.ErrorMailModule.OnInit(System.Web.HttpApplication)"/> to read the settings for module. </summary> </member> <member name="P:Elmah.ErrorMailModule.SupportDiscoverability"> <summary> Determines whether the module will be registered for discovery in partial trust environments or not. </summary> </member> <member name="P:Elmah.ErrorMailModule.MailSender"> <summary> Gets the e-mail address of the sender. </summary> </member> <member name="P:Elmah.ErrorMailModule.MailRecipient"> <summary> Gets the e-mail address of the recipient, or a comma-/semicolon-delimited list of e-mail addresses in case of multiple recipients. </summary> <remarks> When using System.Web.Mail components under .NET Framework 1.x, multiple recipients must be semicolon-delimited. When using System.Net.Mail components under .NET Framework 2.0 or later, multiple recipients must be comma-delimited. </remarks> </member> <member name="P:Elmah.ErrorMailModule.MailCopyRecipient"> <summary> Gets the e-mail address of the recipient for mail carbon copy (CC), or a comma-/semicolon-delimited list of e-mail addresses in case of multiple recipients. </summary> <remarks> When using System.Web.Mail components under .NET Framework 1.x, multiple recipients must be semicolon-delimited. When using System.Net.Mail components under .NET Framework 2.0 or later, multiple recipients must be comma-delimited. </remarks> </member> <member name="P:Elmah.ErrorMailModule.MailSubjectFormat"> <summary> Gets the text used to format the e-mail subject. </summary> <remarks> The subject text specification may include {0} where the error message (<see cref="P:Elmah.Error.Message"/>) should be inserted and {1} <see cref="P:Elmah.Error.Type"/> where the error type should be insert. </remarks> </member> <member name="P:Elmah.ErrorMailModule.MailPriority"> <summary> Gets the priority of the e-mail. </summary> </member> <member name="P:Elmah.ErrorMailModule.SmtpServer"> <summary> Gets the SMTP server host name used when sending the mail. </summary> </member> <member name="P:Elmah.ErrorMailModule.SmtpPort"> <summary> Gets the SMTP port used when sending the mail. </summary> </member> <member name="P:Elmah.ErrorMailModule.AuthUserName"> <summary> Gets the user name to use if the SMTP server requires authentication. </summary> </member> <member name="P:Elmah.ErrorMailModule.AuthPassword"> <summary> Gets the clear-text password to use if the SMTP server requires authentication. </summary> </member> <member name="P:Elmah.ErrorMailModule.NoYsod"> <summary> Indicates whether <a href="http://en.wikipedia.org/wiki/Screens_of_death#ASP.NET">YSOD</a> is attached to the e-mail or not. If <c>true</c>, the YSOD is not attached. </summary> </member> <member name="P:Elmah.ErrorMailModule.UseSsl"> <summary> Determines if SSL will be used to encrypt communication with the mail server. </summary> </member> <member name="T:Elmah.ErrorMailSectionHandler"> <summary> Handler for the &lt;errorMail&gt; section of the configuration file. </summary> </member> <member name="T:Elmah.ErrorRssHandler"> <summary> Renders a XML using the RSS 0.91 vocabulary that displays, at most, the 15 most recent errors recorded in the error log. </summary> </member> <member name="T:Elmah.ErrorTweetModule"> <summary> HTTP module implementation that posts tweets (short messages usually limited to 140 characters) about unhandled exceptions in an ASP.NET Web application to a Twitter account. </summary> <remarks> This module requires that the hosting application has permissions send HTTP POST requests to another Internet domain. </remarks> </member> <member name="M:Elmah.ErrorTweetModule.OnInit(System.Web.HttpApplication)"> <summary> Initializes the module and prepares it to handle requests. </summary> </member> <member name="M:Elmah.ErrorTweetModule.GetErrorLog(System.Web.HttpContextBase)"> <summary> Gets the <see cref="T:Elmah.ErrorLog"/> instance to which the module will log exceptions. </summary> </member> <member name="M:Elmah.ErrorTweetModule.OnError(System.Object,System.EventArgs)"> <summary> The handler called when an unhandled exception bubbles up to the module. </summary> </member> <member name="M:Elmah.ErrorTweetModule.OnErrorSignaled(System.Object,Elmah.ErrorSignalEventArgs)"> <summary> The handler called when an exception is explicitly signaled. </summary> </member> <member name="M:Elmah.ErrorTweetModule.LogException(System.Exception,System.Web.HttpContextBase)"> <summary> Logs an exception and its context to the error log. </summary> </member> <member name="M:Elmah.ErrorTweetModule.OnFiltering(Elmah.ExceptionFilterEventArgs)"> <summary> Raises the <see cref="E:Elmah.ErrorTweetModule.Filtering"/> event. </summary> </member> <member name="M:Elmah.ErrorTweetModule.GetConfig"> <summary> Gets the configuration object used by <see cref="M:Elmah.ErrorTweetModule.OnInit(System.Web.HttpApplication)"/> to read the settings for module. </summary> </member> <member name="P:Elmah.ErrorTweetModule.SupportDiscoverability"> <summary> Determines whether the module will be registered for discovery in partial trust environments or not. </summary> </member> <member name="T:Elmah.ErrorTweetSectionHandler"> <summary> Handler for the &lt;errorTweet&gt; section of the configuration file. </summary> </member> <member name="T:Elmah.ErrorXml"> <summary> Responsible for encoding and decoding the XML representation of an <see cref="T:Elmah.Error"/> object. </summary> </member> <member name="M:Elmah.ErrorXml.DecodeString(System.String)"> <summary> Decodes an <see cref="T:Elmah.Error"/> object from its default XML representation. </summary> </member> <member name="M:Elmah.ErrorXml.Decode(System.Xml.XmlReader)"> <summary> Decodes an <see cref="T:Elmah.Error"/> object from its XML representation. </summary> </member> <member name="M:Elmah.ErrorXml.ReadXmlAttributes(System.Xml.XmlReader,Elmah.Error)"> <summary> Reads the error data in XML attributes. </summary> </member> <member name="M:Elmah.ErrorXml.ReadInnerXml(System.Xml.XmlReader,Elmah.Error)"> <summary> Reads the error data in child nodes. </summary> </member> <member name="M:Elmah.ErrorXml.EncodeString(Elmah.Error)"> <summary> Encodes the default XML representation of an <see cref="T:Elmah.Error"/> object to a string. </summary> </member> <member name="M:Elmah.ErrorXml.Encode(Elmah.Error,System.Xml.XmlWriter)"> <summary> Encodes the XML representation of an <see cref="T:Elmah.Error"/> object. </summary> </member> <member name="M:Elmah.ErrorXml.WriteXmlAttributes(Elmah.Error,System.Xml.XmlWriter)"> <summary> Writes the error data that belongs in XML attributes. </summary> </member> <member name="M:Elmah.ErrorXml.WriteInnerXml(Elmah.Error,System.Xml.XmlWriter)"> <summary> Writes the error data that belongs in child nodes. </summary> </member> <member name="M:Elmah.ErrorXml.Encode(System.Collections.Specialized.NameValueCollection,System.Xml.XmlWriter)"> <summary> Encodes an XML representation for a <see cref="T:System.Collections.Specialized.NameValueCollection"/> object. </summary> </member> <member name="M:Elmah.ErrorXml.UpcodeTo(System.Xml.XmlReader,System.Collections.Specialized.NameValueCollection)"> <summary> Updates an existing <see cref="T:System.Collections.Specialized.NameValueCollection"/> object from its XML representation. </summary> </member> <member name="T:Elmah.ErrorXmlHandler"> <summary> Renders an error as an XML document. </summary> </member> <member name="T:Elmah.FixIIS5xWildcardMappingModule"> <summary> HTTP module that resolves issues in ELMAH when wilcard mapping is implemented in IIS 5.x. </summary> <remarks> See <a href="http://groups.google.com/group/elmah/browse_thread/thread/c22b85ace3812da1">Elmah with existing wildcard mapping</a> for more information behind the reason for this module. </remarks> </member> <member name="T:Elmah.HtmlLinkType"> <summary> User agents, search engines, etc. may interpret and use these link types in a variety of ways. For example, user agents may provide access to linked documents through a navigation bar. </summary> <remarks> See <a href="http://www.w3.org/TR/html401/types.html#type-links">6.12 Link types</a> for more information. </remarks> </member> <member name="T:Elmah.HttpStatus"> <summary> Represents an HTTP status (code plus reason) as per <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1">Section 6.1 of RFC 2616</a>. </summary> </member> <member name="T:JetBrains.Annotations.AssertionMethodAttribute"> <summary> Indicates that the marked method is assertion method, i.e. it halts control flow if one of the conditions is satisfied. To set the condition, mark one of the parameters with <see cref="T:JetBrains.Annotations.AssertionConditionAttribute"/> attribute. </summary> <seealso cref="T:JetBrains.Annotations.AssertionConditionAttribute"/> </member> <member name="T:JetBrains.Annotations.AssertionConditionAttribute"> <summary> Indicates the condition parameter of the assertion method. The method itself should be marked by <see cref="T:JetBrains.Annotations.AssertionMethodAttribute"/> attribute. The mandatory argument of the attribute is the assertion type. </summary> <seealso cref="T:JetBrains.Annotations.AssertionConditionType"/> </member> <member name="M:JetBrains.Annotations.AssertionConditionAttribute.#ctor(JetBrains.Annotations.AssertionConditionType)"> <summary> Initializes new instance of AssertionConditionAttribute. </summary> <param name="conditionType">Specifies condition type.</param> </member> <member name="P:JetBrains.Annotations.AssertionConditionAttribute.ConditionType"> <summary> Gets condition type. </summary> </member> <member name="T:JetBrains.Annotations.AssertionConditionType"> <summary> Specifies assertion type. If the assertion method argument satisifes the condition, then the execution continues. Otherwise, execution is assumed to be halted. </summary> </member> <member name="F:JetBrains.Annotations.AssertionConditionType.IS_TRUE"> <summary> Indicates that the marked parameter should be evaluated to true. </summary> </member> <member name="F:JetBrains.Annotations.AssertionConditionType.IS_FALSE"> <summary> Indicates that the marked parameter should be evaluated to false. </summary> </member> <member name="F:JetBrains.Annotations.AssertionConditionType.IS_NULL"> <summary> Indicates that the marked parameter should be evaluated to null value. </summary> </member> <member name="F:JetBrains.Annotations.AssertionConditionType.IS_NOT_NULL"> <summary> Indicates that the marked parameter should be evaluated to not null value. </summary> </member> <member name="T:Elmah.JsonTextWriter"> <summary> Represents a writer that provides a fast, non-cached, forward-only way of generating streams or files containing JSON Text according to the grammar rules laid out in <a href="http://www.ietf.org/rfc/rfc4627.txt">RFC 4627</a>. </summary> <remarks> This class supports ELMAH and is not intended to be used directly from your code. It may be modified or removed in the future without notice. It has public accessibility for testing purposes. If you need a general-purpose JSON Text encoder, consult <a href="http://www.json.org/">JSON.org</a> for implementations or use classes available from the Microsoft .NET Framework. </remarks> </member> <member name="T:Elmah.ManifestResourceHandler"> <summary> Reads a resource from the assembly manifest and returns its contents as the response entity. </summary> </member> <member name="T:Mannex.Int32Extensions"> <summary> Extension methods for <see cref="T:System.Int32"/>. </summary> </member> <member name="M:Mannex.Int32Extensions.ToInvariantString(System.Int32)"> <summary> Converts <see cref="T:System.Int32"/> to its string representation in the invariant culture. </summary> </member> <member name="M:Mannex.Int32Extensions.DivRem``1(System.Int32,System.Int32,System.Func{System.Int32,System.Int32,``0})"> <summary> Calculates the quotient and remainder from dividing two numbers and returns a user-defined result. </summary> </member> <member name="T:Mannex.Collections.Generic.DictionaryExtensions"> <summary> Extension methods for <see cref="T:System.Collections.Generic.Dictionary`2"/>. </summary> </member> <member name="M:Mannex.Collections.Generic.DictionaryExtensions.Find``2(System.Collections.Generic.IDictionary{``0,``1},``0)"> <summary> Finds the value for a key, returning the default value for <typeparamref name="TKey"/> if the key is not present. </summary> </member> <member name="M:Mannex.Collections.Generic.DictionaryExtensions.Find``2(System.Collections.Generic.IDictionary{``0,``1},``0,``1)"> <summary> Finds the value for a key, returning a given default value for <typeparamref name="TKey"/> if the key is not present. </summary> </member> <member name="T:Mannex.ICloneableExtensions"> <summary> Extension methods for <see cref="T:System.ICloneable"/> objects. </summary> </member> <member name="M:Mannex.ICloneableExtensions.CloneObject``1(``0)"> <summary> Creates a new object that is a copy of the current instance. </summary> </member> <member name="T:Mannex.Threading.Tasks.TaskCompletionSourceExtensions"> <summary> Extension methods for <see cref="T:System.Threading.Tasks.TaskCompletionSource`1"/>. </summary> </member> <member name="M:Mannex.Threading.Tasks.TaskCompletionSourceExtensions.TryConcludeFrom``1(System.Threading.Tasks.TaskCompletionSource{``0},System.Threading.Tasks.Task{``0})"> <summary> Attempts to conclude <see cref="T:System.Threading.Tasks.TaskCompletionSource`1"/> as being canceled, faulted or having completed successfully based on the corresponding status of the given <see cref="T:System.Threading.Tasks.Task`1"/>. </summary> </member> <member name="T:Mannex.Threading.Tasks.TaskExtensions"> <summary> Extension methods for <see cref="T:System.Threading.Tasks.Task"/>. </summary> </member> <member name="M:Mannex.Threading.Tasks.TaskExtensions.Apmize``1(System.Threading.Tasks.Task{``0},System.AsyncCallback,System.Object)"> <summary> Returns a <see cref="T:System.Threading.Tasks.Task`1"/> that can be used as the <see cref="T:System.IAsyncResult"/> return value from the method that begin the operation of an API following the <a href="http://msdn.microsoft.com/en-us/library/ms228963.aspx">Asynchronous Programming Model</a>. If an <see cref="T:System.AsyncCallback"/> is supplied, it is invoked when the supplied task concludes (fails, cancels or completes successfully). </summary> </member> <member name="M:Mannex.Threading.Tasks.TaskExtensions.Apmize``1(System.Threading.Tasks.Task{``0},System.AsyncCallback,System.Object,System.Threading.Tasks.TaskScheduler)"> <summary> Returns a <see cref="T:System.Threading.Tasks.Task`1"/> that can be used as the <see cref="T:System.IAsyncResult"/> return value from the method that begin the operation of an API following the <a href="http://msdn.microsoft.com/en-us/library/ms228963.aspx">Asynchronous Programming Model</a>. If an <see cref="T:System.AsyncCallback"/> is supplied, it is invoked when the supplied task concludes (fails, cancels or completes successfully). </summary> </member> <member name="T:Elmah.Mask"> <summary> Collection of utility methods for masking values. </summary> </member> <member name="T:Elmah.MemoryErrorLog"> <summary> An <see cref="T:Elmah.ErrorLog"/> implementation that uses memory as its backing store. </summary> <remarks> All <see cref="T:Elmah.MemoryErrorLog"/> instances will share the same memory store that is bound to the application (not an instance of this class). </remarks> </member> <member name="F:Elmah.MemoryErrorLog.MaximumSize"> <summary> The maximum number of errors that will ever be allowed to be stored in memory. </summary> </member> <member name="F:Elmah.MemoryErrorLog.DefaultSize"> <summary> The maximum number of errors that will be held in memory by default if no size is specified. </summary> </member> <member name="M:Elmah.MemoryErrorLog.#ctor"> <summary> Initializes a new instance of the <see cref="T:Elmah.MemoryErrorLog"/> class with a default size for maximum recordable entries. </summary> </member> <member name="M:Elmah.MemoryErrorLog.#ctor(System.Int32)"> <summary> Initializes a new instance of the <see cref="T:Elmah.MemoryErrorLog"/> class with a specific size for maximum recordable entries. </summary> </member> <member name="M:Elmah.MemoryErrorLog.#ctor(System.Collections.IDictionary)"> <summary> Initializes a new instance of the <see cref="T:Elmah.MemoryErrorLog"/> class using a dictionary of configured settings. </summary> </member> <member name="M:Elmah.MemoryErrorLog.Log(Elmah.Error)"> <summary> Logs an error to the application memory. </summary> <remarks> If the log is full then the oldest error entry is removed. </remarks> </member> <member name="M:Elmah.MemoryErrorLog.GetError(System.String)"> <summary> Returns the specified error from application memory, or null if it does not exist. </summary> </member> <member name="M:Elmah.MemoryErrorLog.GetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"> <summary> Returns a page of errors from the application memory in descending order of logged time. </summary> </member> <member name="P:Elmah.MemoryErrorLog.Name"> <summary> Gets the name of this error log implementation. </summary> </member> <member name="T:Elmah.MsAjaxDeltaErrorLogModule"> <summary> Module to log unhandled exceptions during a delta-update request issued by the client when a page uses the UpdatePanel introduced with ASP.NET 2.0 AJAX Extensions. </summary> <remarks> <para> This module is ONLY required when dealing with v1.0.x.x of System.Web.Extensions.dll (i.e. the downloadable version to extend v2.0 of the .Net Framework) </para> <para> Using it with v3.5 of System.Web.Extensions.dll (which shipped as part of v3.5 of the .Net Framework) will result in a duplication of errors. </para> <para> This is because MS have changed the implementation of System.Web.UI.PageRequestManager.OnPageError </para> <para> In v1.0.x.x, the code performs a brutal <code>Response.End();</code> in an attempt to "tidy up"! This means that the error will not bubble up to the Application.Error handlers, so Elmah is unable to catch them. </para> <para> In v3.5, this is handled much more gracefully, allowing Elmah to do its thing without the need for this module! </para> </remarks> </member> <member name="M:Elmah.MsAjaxDeltaErrorLogModule.LogException(System.Exception,System.Web.HttpContextBase)"> <summary> Logs an exception and its context to the error log. </summary> </member> <member name="T:Elmah.MySqlErrorLog"> <summary> An <see cref="T:Elmah.ErrorLog"/> implementation that uses <a href="http://www.mysql.com/">MySQL</a> as its backing store. </summary> </member> <member name="M:Elmah.MySqlErrorLog.#ctor(System.Collections.IDictionary)"> <summary> Initializes a new instance of the <see cref="T:Elmah.SqlErrorLog"/> class using a dictionary of configured settings. </summary> </member> <member name="M:Elmah.MySqlErrorLog.#ctor(System.String)"> <summary> Initializes a new instance of the <see cref="T:Elmah.SqlErrorLog"/> class to use a specific connection string for connecting to the database. </summary> </member> <member name="M:Elmah.MySqlErrorLog.Log(Elmah.Error)"> <summary> Logs an error to the database. </summary> <remarks> Use the stored procedure called by this implementation to set a policy on how long errors are kept in the log. The default implementation stores all errors for an indefinite time. </remarks> </member> <member name="M:Elmah.MySqlErrorLog.GetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"> <summary> Returns a page of errors from the databse in descending order of logged time. </summary> </member> <member name="M:Elmah.MySqlErrorLog.GetError(System.String)"> <summary> Returns the specified error from the database, or null if it does not exist. </summary> </member> <member name="P:Elmah.MySqlErrorLog.Name"> <summary> Gets the name of this error log implementation. </summary> </member> <member name="P:Elmah.MySqlErrorLog.ConnectionString"> <summary> Gets the connection string used by the log to connect to the database. </summary> </member> <member name="T:Elmah.OracleErrorLog"> <summary> An <see cref="T:Elmah.ErrorLog"/> implementation that uses Oracle as its backing store. </summary> </member> <member name="M:Elmah.OracleErrorLog.#ctor(System.Collections.IDictionary)"> <summary> Initializes a new instance of the <see cref="T:Elmah.OracleErrorLog"/> class using a dictionary of configured settings. </summary> </member> <member name="M:Elmah.OracleErrorLog.#ctor(System.String)"> <summary> Initializes a new instance of the <see cref="T:Elmah.OracleErrorLog"/> class to use a specific connection string for connecting to the database. </summary> </member> <member name="M:Elmah.OracleErrorLog.#ctor(System.String,System.Data.Common.DbProviderFactory)"> <summary> Initializes a new instance of the <see cref="T:Elmah.OracleErrorLog"/> class to use a specific connection string and provider for connecting to the database. </summary> <remarks> The only supported <see cref="T:System.Data.Common.DbProviderFactory"/> instances are those of <c>Oracle.DataAccess.Client</c> (ODP.NET) and <c>System.Data.OracleClient</c>. The supplied instance is not validated so any other provider will yield undefined behavior. </remarks> </member> <member name="M:Elmah.OracleErrorLog.#ctor(System.String,System.String)"> <summary> Initializes a new instance of the <see cref="T:Elmah.OracleErrorLog"/> class to use a specific connection string for connecting to the database. An additional parameter specifies the schema owner. </summary> </member> <member name="M:Elmah.OracleErrorLog.#ctor(System.String,System.String,System.Data.Common.DbProviderFactory)"> <summary> Initializes a new instance of the <see cref="T:Elmah.OracleErrorLog"/> class to use a specific connection string and provider for connecting to the database. An additional parameter specifies the schema owner. </summary> <remarks> The only supported <see cref="T:System.Data.Common.DbProviderFactory"/> instances are those of <c>Oracle.DataAccess.Client</c> (ODP.NET) and <c>System.Data.OracleClient</c>. The supplied instance is not validated so any other provider will yield undefined behavior. </remarks> </member> <member name="M:Elmah.OracleErrorLog.Log(Elmah.Error)"> <summary> Logs an error to the database. </summary> <remarks> Use the stored procedure called by this implementation to set a policy on how long errors are kept in the log. The default implementation stores all errors for an indefinite time. </remarks> </member> <member name="M:Elmah.OracleErrorLog.GetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"> <summary> Returns a page of errors from the databse in descending order of logged time. </summary> </member> <member name="M:Elmah.OracleErrorLog.GetError(System.String)"> <summary> Returns the specified error from the database, or null if it does not exist. </summary> </member> <member name="P:Elmah.OracleErrorLog.SchemaOwner"> <summary> Gets the name of the schema owner where the errors are being stored. </summary> </member> <member name="P:Elmah.OracleErrorLog.Name"> <summary> Gets the name of this error log implementation. </summary> </member> <member name="P:Elmah.OracleErrorLog.ConnectionString"> <summary> Gets the connection string used by the log to connect to the database. </summary> </member> <member name="T:Elmah.PgsqlErrorLog"> <summary> An <see cref="T:Elmah.ErrorLog"/> implementation that uses PostgreSQL as its backing store. </summary> </member> <member name="M:Elmah.PgsqlErrorLog.#ctor(System.Collections.IDictionary)"> <summary> Initializes a new instance of the <see cref="T:Elmah.PgsqlErrorLog"/> class using a dictionary of configured settings. </summary> </member> <member name="M:Elmah.PgsqlErrorLog.#ctor(System.String)"> <summary> Initializes a new instance of the <see cref="T:Elmah.PgsqlErrorLog"/> class to use a specific connection string for connecting to the database. </summary> </member> <member name="P:Elmah.PgsqlErrorLog.Name"> <summary> Gets the name of this error log implementation. </summary> </member> <member name="P:Elmah.PgsqlErrorLog.ConnectionString"> <summary> Gets the connection string used by the log to connect to the database. </summary> </member> <member name="T:Elmah.PoweredBy"> <summary> Displays a "Powered-by ELMAH" message that also contains the assembly file version informatin and copyright notice. </summary> </member> <member name="M:Elmah.PoweredBy.RenderContents(System.Web.UI.HtmlTextWriter)"> <summary> Renders the contents of the control into the specified writer. </summary> </member> <member name="T:Elmah.SccStamp"> <summary> Represents a source code control (SCC) stamp and its components. </summary> </member> <member name="M:Elmah.SccStamp.#ctor(System.String)"> <summary> Initializes an <see cref="T:Elmah.SccStamp"/> instance given a SCC stamp ID. The ID is expected to be in the format popularized by CVS and SVN. </summary> </member> <member name="M:Elmah.SccStamp.FindAll(System.Reflection.Assembly)"> <summary> Finds and builds an array of <see cref="T:Elmah.SccStamp"/> instances from all the <see cref="T:Elmah.SccAttribute"/> attributes applied to the given assembly. </summary> </member> <member name="M:Elmah.SccStamp.FindLatest(System.Reflection.Assembly)"> <summary> Finds the latest SCC stamp for an assembly. The latest stamp is the one with the highest revision number. </summary> </member> <member name="M:Elmah.SccStamp.FindLatest(Elmah.SccStamp[])"> <summary> Finds the latest stamp among an array of <see cref="T:Elmah.SccStamp"/> objects. The latest stamp is the one with the highest revision number. </summary> </member> <member name="M:Elmah.SccStamp.SortByRevision(Elmah.SccStamp[])"> <summary> Sorts an array of <see cref="T:Elmah.SccStamp"/> objects by their revision numbers in ascending order. </summary> </member> <member name="M:Elmah.SccStamp.SortByRevision(Elmah.SccStamp[],System.Boolean)"> <summary> Sorts an array of <see cref="T:Elmah.SccStamp"/> objects by their revision numbers in ascending or descending order. </summary> </member> <member name="P:Elmah.SccStamp.Id"> <summary> Gets the original SCC stamp ID. </summary> </member> <member name="P:Elmah.SccStamp.Author"> <summary> Gets the author component of the SCC stamp ID. </summary> </member> <member name="P:Elmah.SccStamp.FileName"> <summary> Gets the file name component of the SCC stamp ID. </summary> </member> <member name="P:Elmah.SccStamp.Revision"> <summary> Gets the revision number component of the SCC stamp ID. </summary> </member> <member name="P:Elmah.SccStamp.LastChanged"> <summary> Gets the last modification time component of the SCC stamp ID. </summary> </member> <member name="P:Elmah.SccStamp.LastChangedUtc"> <summary> Gets the last modification time, in coordinated universal time (UTC), component of the SCC stamp ID in local time. </summary> </member> <member name="T:Elmah.SecuritySectionHandler"> <summary> Handler for the &lt;security&gt; section of the configuration file. </summary> </member> <member name="T:Elmah.ServiceProviderQueryHandler"> <summary> A delegate to an implementation that returns an <see cref="T:System.IServiceProvider"/> object based on a given context. </summary> </member> <member name="T:Elmah.ServiceCenter"> <summary> Central point for locating arbitrary services. </summary> </member> <member name="F:Elmah.ServiceCenter.Default"> <summary> The default and factory-supplied implementation of <see cref="T:Elmah.ServiceProviderQueryHandler"/>. </summary> </member> <member name="M:Elmah.ServiceCenter.FindService(System.Object,System.Type)"> <summary> Attempts to locate a service of a given type based on a given context. If the service is not available, a null reference is returned. </summary> </member> <member name="M:Elmah.ServiceCenter.GetService(System.Object,System.Type)"> <summary> Gets a service of a given type based on a given context. If the service is not available, an exception is thrown. </summary> </member> <member name="M:Elmah.ServiceCenter.GetServiceProvider(System.Object)"> <summary> Gets an <see cref="T:System.IServiceProvider"/> object based on a supplied context and which can be used to request further services. </summary> </member> <member name="P:Elmah.ServiceCenter.Current"> <summary> The current <see cref="T:Elmah.ServiceProviderQueryHandler"/> implementation in effect. </summary> </member> <member name="T:Elmah.SimpleServiceProviderFactory"> <summary> A simple factory for creating instances of types specified in a section of the configuration file. </summary> </member> <member name="T:Elmah.SqlErrorLog"> <summary> An <see cref="T:Elmah.ErrorLog"/> implementation that uses Microsoft SQL Server 2000 as its backing store. </summary> </member> <member name="M:Elmah.SqlErrorLog.#ctor(System.Collections.IDictionary)"> <summary> Initializes a new instance of the <see cref="T:Elmah.SqlErrorLog"/> class using a dictionary of configured settings. </summary> </member> <member name="M:Elmah.SqlErrorLog.#ctor(System.String)"> <summary> Initializes a new instance of the <see cref="T:Elmah.SqlErrorLog"/> class to use a specific connection string for connecting to the database. </summary> </member> <member name="M:Elmah.SqlErrorLog.Log(Elmah.Error)"> <summary> Logs an error to the database. </summary> <remarks> Use the stored procedure called by this implementation to set a policy on how long errors are kept in the log. The default implementation stores all errors for an indefinite time. </remarks> </member> <member name="M:Elmah.SqlErrorLog.GetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"> <summary> Returns a page of errors from the databse in descending order of logged time. </summary> </member> <member name="M:Elmah.SqlErrorLog.GetErrorsAsync(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry},System.Threading.CancellationToken)"> <summary> Asynchronous version of <see cref="M:Elmah.SqlErrorLog.GetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"/>. </summary> </member> <member name="M:Elmah.SqlErrorLog.EndGetErrors(System.IAsyncResult)"> <summary> Ends an asynchronous version of <see cref="M:Elmah.ErrorLog.GetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"/>. </summary> </member> <member name="M:Elmah.SqlErrorLog.GetError(System.String)"> <summary> Returns the specified error from the database, or null if it does not exist. </summary> </member> <member name="P:Elmah.SqlErrorLog.Name"> <summary> Gets the name of this error log implementation. </summary> </member> <member name="P:Elmah.SqlErrorLog.ConnectionString"> <summary> Gets the connection string used by the log to connect to the database. </summary> </member> <member name="T:Elmah.SqlErrorLog.AsyncResultWrapper"> <summary> An <see cref="T:System.IAsyncResult"/> implementation that wraps another. </summary> </member> <member name="T:Elmah.SqlServerCompactErrorLog"> <summary> An <see cref="T:Elmah.ErrorLog"/> implementation that uses SQL Server Compact 4 as its backing store. </summary> </member> <member name="M:Elmah.SqlServerCompactErrorLog.#ctor(System.Collections.IDictionary)"> <summary> Initializes a new instance of the <see cref="T:Elmah.SqlServerCompactErrorLog"/> class using a dictionary of configured settings. </summary> </member> <member name="M:Elmah.SqlServerCompactErrorLog.#ctor(System.String)"> <summary> Initializes a new instance of the <see cref="T:Elmah.SqlServerCompactErrorLog"/> class to use a specific connection string for connecting to the database. </summary> </member> <member name="M:Elmah.SqlServerCompactErrorLog.Log(Elmah.Error)"> <summary> Logs an error to the database. </summary> <remarks> Use the stored procedure called by this implementation to set a policy on how long errors are kept in the log. The default implementation stores all errors for an indefinite time. </remarks> </member> <member name="M:Elmah.SqlServerCompactErrorLog.GetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"> <summary> Returns a page of errors from the databse in descending order of logged time. </summary> </member> <member name="M:Elmah.SqlServerCompactErrorLog.GetError(System.String)"> <summary> Returns the specified error from the database, or null if it does not exist. </summary> </member> <member name="P:Elmah.SqlServerCompactErrorLog.Name"> <summary> Gets the name of this error log implementation. </summary> </member> <member name="P:Elmah.SqlServerCompactErrorLog.ConnectionString"> <summary> Gets the connection string used by the log to connect to the database. </summary> </member> <member name="T:Elmah.StringFormatter"> <summary> Helper class for formatting templated strings with supplied replacements. </summary> </member> <member name="M:Elmah.StringFormatter.Format(System.String,System.Object[])"> <summary> Replaces each format item in a specified string with the text equivalent of a corresponding object's value. </summary> </member> <member name="T:Elmah.StringTranslation"> <summary> Provides translation from multiple representations of a string to a single base representation. </summary> </member> <member name="T:Elmah.SQLiteErrorLog"> <summary> An <see cref="T:Elmah.ErrorLog"/> implementation that uses SQLite as its backing store. </summary> </member> <member name="M:Elmah.SQLiteErrorLog.#ctor(System.Collections.IDictionary)"> <summary> Initializes a new instance of the <see cref="T:Elmah.SQLiteErrorLog"/> class using a dictionary of configured settings. </summary> </member> <member name="M:Elmah.SQLiteErrorLog.#ctor(System.String)"> <summary> Initializes a new instance of the <see cref="T:Elmah.SQLiteErrorLog"/> class to use a specific connection string for connecting to the database. </summary> </member> <member name="M:Elmah.SQLiteErrorLog.Log(Elmah.Error)"> <summary> Logs an error to the database. </summary> <remarks> Use the stored procedure called by this implementation to set a policy on how long errors are kept in the log. The default implementation stores all errors for an indefinite time. </remarks> </member> <member name="M:Elmah.SQLiteErrorLog.GetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"> <summary> Returns a page of errors from the databse in descending order of logged time. </summary> </member> <member name="M:Elmah.SQLiteErrorLog.GetError(System.String)"> <summary> Returns the specified error from the database, or null if it does not exist. </summary> </member> <member name="P:Elmah.SQLiteErrorLog.Name"> <summary> Gets the name of this error log implementation. </summary> </member> <member name="P:Elmah.SQLiteErrorLog.ConnectionString"> <summary> Gets the connection string used by the log to connect to the database. </summary> </member> <member name="T:Elmah.TestException"> <summary> The exception that is thrown when to test the error logging subsystem. This exception is used for testing purposes only and should not be used for any other purpose. </summary> </member> <member name="M:Elmah.TestException.#ctor"> <summary> Initializes a new instance of the <see cref="T:Elmah.TestException"/> class. </summary> </member> <member name="M:Elmah.TestException.#ctor(System.String)"> <summary> Initializes a new instance of the <see cref="T:Elmah.TestException"/> class with a specified error message. </summary> </member> <member name="M:Elmah.TestException.#ctor(System.String,System.Exception)"> <summary> ializes a new instance of the <see cref="T:Elmah.TestException"/> class with a specified error message and a reference to the inner exception that is the cause of this exception. </summary> </member> <member name="M:Elmah.TestException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)"> <summary> Initializes a new instance of the <see cref="T:Elmah.TestException"/> class with serialized data. </summary> </member> <member name="T:Elmah.XmlFileErrorLog"> <summary> An <see cref="T:Elmah.ErrorLog"/> implementation that uses XML files stored on disk as its backing store. </summary> </member> <member name="M:Elmah.XmlFileErrorLog.#ctor(System.Collections.IDictionary)"> <summary> Initializes a new instance of the <see cref="T:Elmah.XmlFileErrorLog"/> class using a dictionary of configured settings. </summary> </member> <member name="M:Elmah.XmlFileErrorLog.MapPath(System.String)"> <remarks> This method is excluded from inlining so that if HostingEnvironment does not need JIT-ing if it is not implicated by the caller. </remarks> </member> <member name="M:Elmah.XmlFileErrorLog.#ctor(System.String)"> <summary> Initializes a new instance of the <see cref="T:Elmah.XmlFileErrorLog"/> class to use a specific path to store/load XML files. </summary> </member> <member name="M:Elmah.XmlFileErrorLog.Log(Elmah.Error)"> <summary> Logs an error to the database. </summary> <remarks> Logs an error as a single XML file stored in a folder. XML files are named with a sortable date and a unique identifier. Currently the XML files are stored indefinately. As they are stored as files, they may be managed using standard scheduled jobs. </remarks> </member> <member name="M:Elmah.XmlFileErrorLog.GetErrors(System.Int32,System.Int32,System.Collections.Generic.ICollection{Elmah.ErrorLogEntry})"> <summary> Returns a page of errors from the folder in descending order of logged time as defined by the sortable filenames. </summary> </member> <member name="M:Elmah.XmlFileErrorLog.GetError(System.String)"> <summary> Returns the specified error from the filesystem, or throws an exception if it does not exist. </summary> </member> <member name="P:Elmah.XmlFileErrorLog.LogPath"> <summary> Gets the path to where the log is stored. </summary> </member> <member name="P:Elmah.XmlFileErrorLog.Name"> <summary> Gets the name of this error log implementation. </summary> </member> <member name="T:Elmah.XmlSerializer"> <summary> Serializes object to and from XML documents. </summary> </member> <member name="T:Elmah.XmlText"> <summary> XML 1.0 services. </summary> </member> <member name="M:Elmah.XmlText.StripIllegalXmlCharacters(System.String)"> <summary> Replaces illegal XML characters with a question mark (?). </summary> <remarks> Only strips illegal characters as per XML 1.0, not 1.1. See section <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#charsets">2.2 Characters</a> of <a href="http://www.w3.org/TR/2006/REC-xml-20060816">Extensible Markup Language (XML) 1.0 (Fourth Edition)</a>. </remarks> </member> <member name="M:Elmah.XmlText.StripIllegalXmlCharacters(System.String,System.String)"> <summary> Replaces illegal XML characters with a replacement string, with the default being a question mark (?) if the replacement is null reference. </summary> <remarks> Only strips illegal characters as per XML 1.0, not 1.1. See section <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#charsets">2.2 Characters</a> of <a href="http://www.w3.org/TR/2006/REC-xml-20060816">Extensible Markup Language (XML) 1.0 (Fourth Edition)</a>. </remarks> </member> </members> </doc>
{ "content_hash": "dd5040fdf201887679045fdb2602bc4f", "timestamp": "", "source": "github", "line_count": 2171, "max_line_length": 264, "avg_line_length": 45.964071856287426, "alnum_prop": 0.5944201707620155, "repo_name": "jaysilk84/ELMAH", "id": "8e54a32e8965dc4605d44499c7a9bb404cb26f32", "size": "99788", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Elmah/xmldoc/net-4.5/Elmah.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "700718" }, { "name": "Shell", "bytes": "4822" }, { "name": "Visual Basic", "bytes": "3895" } ], "symlink_target": "" }
+++ title = "Incompatibilidade Teste de Wilcoxon no R e na Apache Commons Math (java)" date = "2017-08-29 19:57:36" categories = ["sopt"] original_url = "https://pt.stackoverflow.com/q/233280" at_home="no" +++
{ "content_hash": "dc6a28204426f1ec39bdbd8018008078", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 82, "avg_line_length": 26.375, "alnum_prop": 0.6872037914691943, "repo_name": "brbloggers/brbloggers", "id": "c63ff40dba3e05858a47e113fc1521f9cefa6832", "size": "211", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "content/sopt/233280.md", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "24047" }, { "name": "HTML", "bytes": "143721" }, { "name": "R", "bytes": "14256" }, { "name": "Shell", "bytes": "85" } ], "symlink_target": "" }
<?php /** * Created by Danil Baibak [email protected] * Date: 24/03/15 * Time: 14:00 */ namespace Application\Services; class SiteMapService { const MAX_PRIORITY = 1.00; const MIN_PRIORITY = 0.2; const PRIORITY_STEP = 0.2; /** * @var array priority for each link */ private $linkPriority = []; /** * @var array of modify date for those links that is possible */ private $modifyDate = []; /** * @var array of unique links that were found */ private $listOfLinks = []; /** * @var data for input to the XML file */ private $content; /** * @var string url of the site */ private $mainUrl; /** * @var string host */ private $baseUrl; /** * @var bool need or not save date of last modification */ private $isModifyDate; /** * @var bool need or not save priority */ private $needPriority; /** * @var */ private $nodeUrl; /** * Create settings of the current sitemap generation * * @param string $mainUrl url of the site * @param string $needModifyDate mode for add date of modify * @param string $needPriority mode for add priority */ public function __construct($mainUrl, $needModifyDate, $needPriority) { $urlData = parse_url($mainUrl); $this->baseUrl = $urlData['scheme'] . '://' . $urlData['host']; $this->mainUrl = $mainUrl; $this->nodeUrl = 'http://' . $_SERVER['SERVER_NAME'] . ':9090/'; $this->isModifyDate = $needModifyDate === 'true' ? true : false; $this->needPriority = $needPriority === 'true' ? true : false; } /** * Find and check all links on the current page * * @param string $url url od the current page * @param string host host of the current site * @param float $currentPriority priority of the current page * * @return array list of the new and unique links that were found on the current page */ private function findLinks($url, $host, $currentPriority) { $newLinks = []; $html = file_get_html($url); if ($html) { foreach($html->find('a') as $e) { $link = str_replace('#', '', $e->href); //don't check not links if (strpos($link, 'mailto') === false) { //get details of the current link $linkDetail = parse_url($e->href); /** * Check details of the current link */ if ( isset($linkDetail['scheme']) && isset($linkDetail['host']) && $linkDetail['host'] != $host || !isset($linkDetail['path']) || strpos($linkDetail['path'], 'http') !== false && $linkDetail['path'] != '/' ) { continue; } //check is the current link new if (!in_array($linkDetail['path'], $this->listOfLinks)) { preg_match('/(.png)?(.jpg)?(.zip)?(.pdf)?(.psd)?$/', $linkDetail['path'], $matches); //check is current link seen on the web page if (empty($matches[0])) { //check is site available by current link if (self::isUrlAvailable($this->baseUrl . $linkDetail['path'])) { //save current link $newLinks[] = $linkDetail['path']; $this->listOfLinks[] = $linkDetail['path']; //send data about current link that was found $this->sendRequest($this->nodeUrl .'current_link?link=' . $linkDetail['path']); //send link about number of the links that was found $this->sendRequest( $this->nodeUrl .'links_number?links_number=' . count($this->listOfLinks) ); //send data about memory usage $this->sendRequest( $this->nodeUrl .'memory_usage?memory=' . round(memory_get_usage() / 1000000, 3) ); //save priority if ($this->needPriority) { $this->linkPriority[] = $currentPriority; } //try get date from server when file was modified last time if ($this->isModifyDate) { $modifyDate = $this->getFileModifyDate($this->baseUrl . $linkDetail['path']); if ($modifyDate) { $linksKeys = array_keys($this->listOfLinks); $this->modifyDate[end($linksKeys)] = $modifyDate; } } } } } } } } return $newLinks; } /** * Scanning current page and find all unique links on it * * @param string $depthScan do we need scan all pages of the site */ public function scanSite($depthScan) { $urlDetail = parse_url($this->mainUrl); $this->listOfLinks = []; $linksDepth = 1; $currentPriority = $this->needPriority ? self::MAX_PRIORITY - self::PRIORITY_STEP : false; //send data about depth of the searching $this->sendRequest($this->nodeUrl .'links_depth?depth=' . $linksDepth); $this->listOfLinks = $this->findLinks($this->mainUrl, $urlDetail['host'], $currentPriority); $scanLinksList = $this->listOfLinks; //do we need scan all pages of the site if ($depthScan === 'true') { do { //send data about depth of the searching $this->sendRequest($this->nodeUrl .'links_depth?depth=' . ++$linksDepth); $newLinks = []; //try find new links for each page foreach($scanLinksList as $link) { $justFoundLinks = $this->findLinks($this->baseUrl . $link, $urlDetail['host'], $currentPriority); $newLinks = array_unique(array_merge($newLinks, $justFoundLinks)); } if ($this->needPriority) { //calculate priority $currentPriority = $currentPriority > self::MIN_PRIORITY ? $currentPriority - self::PRIORITY_STEP : $currentPriority; } $scanLinksList = $newLinks; } while(!empty($newLinks)); } } /** * Create XML file with site map * * @param string $changefreq change frequency */ public function saveSiteMap($changefreq) { $pathToFile = BASE_PATH . "public/data/site_map.xml"; //headers $this->content = '<?xml version="1.0" encoding="UTF-8"?>' . "\r\n"; $this->content.= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\r\n"; //body of the site map if (!empty($this->listOfLinks)) { $lastMod = false; $priorityMainPage = $this->needPriority ? 1.00 : false; //put main page $this->putContent($this->mainUrl, $priorityMainPage, $lastMod, $changefreq); //put data about all links that were found according to the settings foreach ($this->listOfLinks as $key => $link) { if ($this->isModifyDate) { $lastMod = isset($this->modifyDate[$key]) ? $this->modifyDate[$key] : false; } $priority = $this->needPriority ? $this->linkPriority[$key] : false; $this->putContent($this->baseUrl . $link, $priority, $lastMod, $changefreq); } } $this->content.= "</urlset>\n"; $this->checkXmlFile($pathToFile); //save data into the file file_put_contents($pathToFile, $this->content); } /** * If file is not writable, we should change rules of the access * * @param $pathToFile */ public function checkXmlFile($pathToFile) { if (!is_writable($pathToFile)) { chmod($pathToFile, 0755); } } /** * Create information for the current link * * @param string $link current link * @param bool/int $priority priority of the current page * @param bool/sting $lastMod date of the last modifications * @param sting $changefreq change frequency */ public function putContent($link, $priority, $lastMod, $changefreq) { $this->content .= ' <url>' . "\n"; $this->content .= ' <loc>' . $link . '</loc>' . "\n"; //date of the last modifications if ($lastMod) { $this->content .= ' <lastmod>' . $lastMod . '</lastmod>' . "\n"; } //change frequency if ($changefreq != 'none') { $this->content .= ' <changefreq>' . $changefreq . '</changefreq>' . "\n"; } //priority of the current page if ($priority) { $this->content .= ' <priority>' . $priority . '</priority>' . "\n"; } $this->content .= ' </url>' . "\n"; } /** * Check is site available by current url * * @param string $url current link * @return bool */ public static function isUrlAvailable($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_NOBODY, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_exec($ch); $returnCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return $returnCode === 200 ? true : false; } /** * Simple curl for sending requests to the nodejs server * * @param string $url url of the request */ private function sendRequest($url) { $ch = curl_init($url); curl_exec($ch); curl_close($ch); } /** * Get file modify date from server if it's possible * * @param string $filePath link to the file * @return bool|string */ private function getFileModifyDate($filePath) { $response = false; $headers = get_headers($filePath, 1); //check headers if ($headers && isset($headers['Last-Modified'])) { $lastModified = is_array($headers['Last-Modified']) ? end($headers['Last-Modified']) : $headers['Last-Modified']; $modifyDate = new \DateTime($lastModified); $response = $modifyDate->format('Y-m-d H:i:s'); } return $response; } }
{ "content_hash": "5c7087c6baacd7830bca55858f864e68", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 117, "avg_line_length": 34.50764525993884, "alnum_prop": 0.4859978730946473, "repo_name": "DanilBaibak/sitemap_generator", "id": "2d8a81c12e5b171d434a48a43dacc946525615f8", "size": "11284", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Application/Services/SiteMapService.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "172" }, { "name": "CSS", "bytes": "707" }, { "name": "HTML", "bytes": "6167" }, { "name": "JavaScript", "bytes": "6259" }, { "name": "PHP", "bytes": "83515" }, { "name": "Shell", "bytes": "425" } ], "symlink_target": "" }
package ru.lanbilling.webservice.wsdl; import java.util.ArrayList; import java.util.List; import javax.annotation.Generated; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="ret" type="{urn:api3}soapRegistry" maxOccurs="unbounded"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "ret" }) @XmlRootElement(name = "registryControl2Response") @Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11") public class RegistryControl2Response { @XmlElement(required = true) @Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11") protected List<SoapRegistry> ret; /** * Gets the value of the ret property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the ret property. * * <p> * For example, to add a new item, do as follows: * <pre> * getRet().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link SoapRegistry } * * */ @Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11") public List<SoapRegistry> getRet() { if (ret == null) { ret = new ArrayList<SoapRegistry>(); } return this.ret; } }
{ "content_hash": "b0c79ce9155115cd5f4d9f6ba231a673", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 116, "avg_line_length": 29.960526315789473, "alnum_prop": 0.6433904259991217, "repo_name": "kanonirov/lanb-client", "id": "3bd4557fc0fe449b5f461d4559772cec59f02d69", "size": "2277", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/ru/lanbilling/webservice/wsdl/RegistryControl2Response.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "6444427" } ], "symlink_target": "" }
import subtleAlgorithm from './subtle_rsaes.js'; import bogusWebCrypto from './bogus.js'; import crypto, { isCryptoKey } from './webcrypto.js'; import { checkEncCryptoKey } from '../lib/crypto_key.js'; import checkKeyLength from './check_key_length.js'; import invalidKeyInput from './invalid_key_input.js'; export const encrypt = async (alg, key, cek) => { if (!isCryptoKey(key)) { throw new TypeError(invalidKeyInput(key, 'CryptoKey')); } checkEncCryptoKey(key, alg, 'encrypt', 'wrapKey'); checkKeyLength(alg, key); if (key.usages.includes('encrypt')) { return new Uint8Array(await crypto.subtle.encrypt(subtleAlgorithm(alg), key, cek)); } if (key.usages.includes('wrapKey')) { const cryptoKeyCek = await crypto.subtle.importKey('raw', cek, ...bogusWebCrypto); return new Uint8Array(await crypto.subtle.wrapKey('raw', cryptoKeyCek, key, subtleAlgorithm(alg))); } throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation'); }; export const decrypt = async (alg, key, encryptedKey) => { if (!isCryptoKey(key)) { throw new TypeError(invalidKeyInput(key, 'CryptoKey')); } checkEncCryptoKey(key, alg, 'decrypt', 'unwrapKey'); checkKeyLength(alg, key); if (key.usages.includes('decrypt')) { return new Uint8Array(await crypto.subtle.decrypt(subtleAlgorithm(alg), key, encryptedKey)); } if (key.usages.includes('unwrapKey')) { const cryptoKeyCek = await crypto.subtle.unwrapKey('raw', encryptedKey, key, subtleAlgorithm(alg), ...bogusWebCrypto); return new Uint8Array(await crypto.subtle.exportKey('raw', cryptoKeyCek)); } throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation'); };
{ "content_hash": "87f47eae5d2d9ab33d88c0e35b9be2a6", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 126, "avg_line_length": 50.02777777777778, "alnum_prop": 0.6868406440866185, "repo_name": "cdnjs/cdnjs", "id": "a952a5049bacf8238d95b505d5c7150db1e7a445", "size": "1801", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ajax/libs/jose/4.0.4/runtime/rsaes.js", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<?php namespace Zerbikat\BackendBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Zerbikat\BackendBundle\Entity\Kalea; use Zerbikat\BackendBundle\Form\KaleaType; use Pagerfanta\Adapter\DoctrineORMAdapter; use Pagerfanta\Pagerfanta; use Pagerfanta\Adapter\ArrayAdapter; /** * Kalea controller. * * @Route("/kalea") */ class KaleaController extends Controller { /** * Lists all Kalea entities. * * @Route("/", name="kalea_index") * @Method("GET") */ public function indexAction() { $auth_checker = $this->get('security.authorization_checker'); if ($auth_checker->isGranted('ROLE_KUDEAKETA')) { $em = $this->getDoctrine()->getManager(); $kaleas = $em->getRepository('BackendBundle:Kalea')->findAll(); $deleteForms = array(); foreach ($kaleas as $kalea) { $deleteForms[$kalea->getId()] = $this->createDeleteForm($kalea)->createView(); } return $this->render('kalea/index.html.twig', array( 'kaleas' => $kaleas, 'deleteforms' => $deleteForms )); }else { return $this->redirectToRoute('backend_errorea'); } } /** * Creates a new Kalea entity. * * @Route("/new", name="kalea_new") * @Method({"GET", "POST"}) */ public function newAction(Request $request) { $auth_checker = $this->get('security.authorization_checker'); if ($auth_checker->isGranted('ROLE_ADMIN')) { $kalea = new Kalea(); $form = $this->createForm('Zerbikat\BackendBundle\Form\KaleaType', $kalea); $form->handleRequest($request); // $form->getData()->setUdala($this->getUser()->getUdala()); // $form->setData($form->getData()); if ($form->isSubmitted() && $form->isValid()) { $em = $this->getDoctrine()->getManager(); $em->persist($kalea); $em->flush(); // return $this->redirectToRoute('kalea_show', array('id' => $kalea->getId())); return $this->redirectToRoute('kalea_index'); } else { $form->getData()->setUdala($this->getUser()->getUdala()); $form->setData($form->getData()); } return $this->render('kalea/new.html.twig', array( 'kalea' => $kalea, 'form' => $form->createView(), )); }else { return $this->redirectToRoute('backend_errorea'); } } /** * Finds and displays a Kalea entity. * * @Route("/{id}", name="kalea_show") * @Method("GET") */ public function showAction(Kalea $kalea) { $deleteForm = $this->createDeleteForm($kalea); return $this->render('kalea/show.html.twig', array( 'kalea' => $kalea, 'delete_form' => $deleteForm->createView(), )); } /** * Displays a form to edit an existing Kalea entity. * * @Route("/{id}/edit", name="kalea_edit") * @Method({"GET", "POST"}) */ public function editAction(Request $request, Kalea $kalea) { $auth_checker = $this->get('security.authorization_checker'); if((($auth_checker->isGranted('ROLE_ADMIN')) && ($kalea->getUdala()==$this->getUser()->getUdala())) ||($auth_checker->isGranted('ROLE_SUPER_ADMIN'))) { $deleteForm = $this->createDeleteForm($kalea); $editForm = $this->createForm('Zerbikat\BackendBundle\Form\KaleaType', $kalea); $editForm->handleRequest($request); if ($editForm->isSubmitted() && $editForm->isValid()) { $em = $this->getDoctrine()->getManager(); $em->persist($kalea); $em->flush(); return $this->redirectToRoute('kalea_edit', array('id' => $kalea->getId())); } return $this->render('kalea/edit.html.twig', array( 'kalea' => $kalea, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), )); }else { return $this->redirectToRoute('backend_errorea'); } } /** * Deletes a Kalea entity. * * @Route("/{id}", name="kalea_delete") * @Method("DELETE") */ public function deleteAction(Request $request, Kalea $kalea) { $auth_checker = $this->get('security.authorization_checker'); if((($auth_checker->isGranted('ROLE_ADMIN')) && ($kalea->getUdala()==$this->getUser()->getUdala())) ||($auth_checker->isGranted('ROLE_SUPER_ADMIN'))) { $form = $this->createDeleteForm($kalea); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $em = $this->getDoctrine()->getManager(); $em->remove($kalea); $em->flush(); } return $this->redirectToRoute('kalea_index'); }else { //baimenik ez return $this->redirectToRoute('backend_errorea'); } } /** * Creates a form to delete a Kalea entity. * * @param Kalea $kalea The Kalea entity * * @return \Symfony\Component\Form\Form The form */ private function createDeleteForm(Kalea $kalea) { return $this->createFormBuilder() ->setAction($this->generateUrl('kalea_delete', array('id' => $kalea->getId()))) ->setMethod('DELETE') ->getForm() ; } }
{ "content_hash": "c431580fe20d648e3f5df997264ede45", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 107, "avg_line_length": 32.30810810810811, "alnum_prop": 0.5255144721432157, "repo_name": "PasaiakoUdala/zerbikat", "id": "2bf96699ca4222df36e2bb32ed9daff7ef0dbed3", "size": "5977", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Zerbikat/BackendBundle/Controller/KaleaController.php", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "1862" }, { "name": "Dockerfile", "bytes": "3073" }, { "name": "JavaScript", "bytes": "484" }, { "name": "Makefile", "bytes": "854" }, { "name": "PHP", "bytes": "1129401" }, { "name": "Ruby", "bytes": "5887" }, { "name": "Shell", "bytes": "1765" }, { "name": "Twig", "bytes": "896480" } ], "symlink_target": "" }
class Bucket < ActiveRecord::Base belongs_to :user belongs_to :milestone validates_presence_of :user_id, :tag def apply_one(ticket) lh_ticket = Ticket.retrieve(ticket.project, ticket.number) lh_ticket.milestone_id = milestone.lighthouse_id if milestone lh_ticket.state = state if state lh_ticket.body = boilerplate if boilerplate lh_ticket.tags << tag lh_ticket.save ticket.update_attribute :data, lh_ticket.to_xml end end
{ "content_hash": "6ad5388e6a7abd7a822dfc9f026fe88d", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 65, "avg_line_length": 28.9375, "alnum_prop": 0.7192224622030238, "repo_name": "cyberfox/triage", "id": "a2825c28ce36c4c8f3833630e183c45ad6533f62", "size": "463", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/models/bucket.rb", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "8328" }, { "name": "Ruby", "bytes": "99806" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <resources> <!-- From: file:/home/salih/AndroidStudioProjects/GitarAkortab/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.2/res/values-mn-rMN/values.xml --> <eat-comment/> <string msgid="4600421777120114993" name="abc_action_bar_home_description">"Нүүр хуудас руу шилжих"</string> <string msgid="1397052879051804371" name="abc_action_bar_home_description_format">"%1$s, %2$s"</string> <string msgid="6623331958280229229" name="abc_action_bar_home_subtitle_description_format">"%1$s, %2$s, %3$s"</string> <string msgid="1594238315039666878" name="abc_action_bar_up_description">"Дээш шилжих"</string> <string msgid="3588849162933574182" name="abc_action_menu_overflow_description">"Нэмэлт сонголтууд"</string> <string msgid="4076576682505996667" name="abc_action_mode_done">"Дууссан"</string> <string msgid="7468859129482906941" name="abc_activity_chooser_view_see_all">"Бүгдийг харах"</string> <string msgid="2031811694353399454" name="abc_activitychooserview_choose_application">"Апп сонгох"</string> <string msgid="3691816814315814921" name="abc_searchview_description_clear">"Асуулгыг цэвэрлэх"</string> <string msgid="2550479030709304392" name="abc_searchview_description_query">"Хайх асуулга"</string> <string msgid="8264924765203268293" name="abc_searchview_description_search">"Хайх"</string> <string msgid="8928215447528550784" name="abc_searchview_description_submit">"Асуулгыг илгээх"</string> <string msgid="893419373245838918" name="abc_searchview_description_voice">"Дуут хайлт"</string> <string msgid="3421042268587513524" name="abc_shareactionprovider_share_with">"Хуваалцах"</string> <string msgid="7165123711973476752" name="abc_shareactionprovider_share_with_application">"%s-тай хуваалцах"</string> </resources>
{ "content_hash": "132afa00c64efa5682128f5d7b1bb761", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 176, "avg_line_length": 93.25, "alnum_prop": 0.7554959785522788, "repo_name": "tugbaduzenli/AndroidLessonProject", "id": "4806244301de6bacd71653870912f472d8733c4b", "size": "2013", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/build/intermediates/res/debug/values-mn-rMN/values.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "377510" }, { "name": "XML", "bytes": "1179973" } ], "symlink_target": "" }
module Cassette class Client def self.method_missing(name, *args) @default_client ||= new @default_client.send(name, *args) end def initialize(opts = {}) self.config = opts.fetch(:config, Cassette.config) self.logger = opts.fetch(:logger, Cassette.logger) self.http = opts.fetch(:http_client, Cassette::Http::Request.new(config)) self.cache = opts.fetch(:cache, Cassette::Client::Cache.new(logger)) end def health_check st_for('monitoring') end def tgt(usr, pwd, force = false) logger.info 'Requesting TGT' cached = true tgt = cache.fetch_tgt(force: force) do cached = false request_new_tgt(usr, pwd) end logger.info("TGT cache hit, value: '#{tgt}'") if cached tgt end def st(tgt_param, service, force = false) logger.info "Requesting ST for #{service}" tgt = tgt_param.respond_to?(:call) ? tgt_param[] : tgt_param cache.fetch_st(tgt, service, force: force) do response = http.post("#{tickets_path}/#{tgt}", service: service) response.body.tap do |st| logger.info "ST is #{st}" end end end def st_for(service_name) st_with_retry(config.username, config.password, service_name) end protected attr_accessor :cache, :logger, :http, :config def st_with_retry(user, pass, service, retrying = false) st(-> { tgt(user, pass, retrying) }, service) rescue Cassette::Errors::NotFound => e raise e if retrying logger.info 'Got 404 response, regenerating TGT' retrying = true retry end def tickets_path '/v1/tickets' end def request_new_tgt(usr, pwd) response = http.post(tickets_path, username: usr, password: pwd) tgt = Regexp.last_match(1) if response.headers['Location'] =~ %r{tickets/(.*)} logger.info "TGT is #{tgt}" tgt end end end
{ "content_hash": "ccb1ca2fb2359b25793510e82ede4e86", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 84, "avg_line_length": 26.364864864864863, "alnum_prop": 0.6063557150179395, "repo_name": "locaweb/cassette", "id": "52437ca609912c6563e94c6d189e602997689ae0", "size": "1951", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/cassette/client.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "67517" } ], "symlink_target": "" }
(function () { 'use strict'; angular.module('pnc.build-configs').component('pncBuildConfigs', { templateUrl: 'pnc/build-configs/pnc-build-configs.template.html', controller: Controller }); function Controller() { angular.noop(); } })();
{ "content_hash": "eb8b5b0a951cb3e4db4bc76430ec76a1", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 69, "avg_line_length": 21.75, "alnum_prop": 0.6551724137931034, "repo_name": "alexcreasy/pnc-lab", "id": "4935c67327bea0428f06a97d1bb721dff2dda963", "size": "261", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/pnc/build-configs/pnc-build-configs.component.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "941" }, { "name": "HTML", "bytes": "26031" }, { "name": "JavaScript", "bytes": "98622" } ], "symlink_target": "" }
import pymongo from pymongo import MongoClient from bson.objectid import ObjectId from datetime import datetime from DBUtil import * from default_problem_data import setSimulationToDefault from SimulationBackupInterface import * import logging from UserDataDAO import getGroupTypeDB class SimulationDAO(object): def getIntersectionIDs(self, simulation_id): """ Get intersection IDs associated with simulation id """ db = DBUtil().getDatabase() simulation = db.simulation.find_one({"_id": ObjectId(simulation_id)}) return simulation["junctions"] def getRestOfIntersectionIDs(self, simulation_id): """ Get rest of the intersection IDs in the simulation id """ db = DBUtil().getDatabase() simulation = db.simulation.find_one({"_id": ObjectId(simulation_id)}) actual_junction = simulation["junctions"] junctions = db.junction.find() assoc_junctions = [] for junction_id in junctions: if junction_id['_id'] != actual_junction[0]: assoc_junctions.append(junction_id['_id']) return assoc_junctions class VehiclesDAO(object): def readAllVehicles(self): """ Reads vehicles from vehicles table gets simulation id """ db = DBUtil().getDatabase() return db.vehicle.find() def readVehicles(self, simulation_id): """ Reads vehicles from vehicles table gets simulation id """ db = DBUtil().getDatabase() vehicles = db.vehicle.find({"simulation_id": ObjectId(simulation_id)}) return vehicles def deleteVehicle(self, vehicle_id): """ Delete vehicles from vehicles table gets vehicle id """ db = DBUtil().getDatabase() db.vehicle.remove({"_id":ObjectId(vehicle_id)}) def createVehicle(self, vehicle_id): """ Delete vehicles from vehicles table gets vehicle id """ db = DBUtil().getDatabase() db.vehicle.remove({"_id":ObjectId(vehicle_id)}) def updateVehicle(self, vehicle_id, accel, decel, sigma, max_speed, length, probability): """ Update vehicle from vehicles table gets vehicle id and updated params """ db = DBUtil().getDatabase() found = db.vehicle.find_one({"_id": ObjectId(vehicle_id)}) found["_id"] = ObjectId(vehicle_id) #found["name"] = name found["accel"] = accel found["decel"] = decel found["sigma"] = sigma found["max_speed"] = max_speed found["length"] = length found["probability"] = probability db.vehicle.save(found) def createVehicle(self, simulation_id, name, accel, decel, sigma, max_speed, length, probability): """ Create vehicle into vehicles table gets params """ db = DBUtil().getDatabase() db.vehicle.insert({ "simulation_id": ObjectId(simulation_id), "name": name, "accel": accel, "decel": decel, "sigma": sigma, "max_speed": max_speed, "length": length, "probability": probability }) class FlowsDAO(object): def readAllFlows(self, simulation_id): """ Reads all flows gets simulation id """ db = DBUtil().getDatabase() flowPoints = db.flows.find({"simulation_id": ObjectId(simulation_id)}) return flowPoints def readFlow(self, simulation_id, point_name): """ Reads vehicles from vehicles table gets simulation id """ db = DBUtil().getDatabase() flow = db.flows.find_one({"simulation_id": ObjectId(simulation_id), "point_name": point_name}) return flow def deleteFlow(self, simulation_id, point_name): """ Not implemented Yet """ db = DBUtil().getDatabase() def createFlow(self, simulation_id, point_name): """ Not implemented yet """ db = DBUtil().getDatabase() def updateFlow(self, simulation_id, point_name, flow_rate): """ Update Flow table based on the parameters being passed """ db = DBUtil().getDatabase() found = db.flows.find_one({"simulation_id": ObjectId(simulation_id), "point_name": point_name}) found["flow_rate"] = flow_rate db.flows.save(found) class TurnProbabilityDAO(object): def readAllTurnProbabilities(self, simulation_id, intersection_id): """ Reads vehicles from vehicles table gets simulation id """ db = DBUtil().getDatabase() turn = db.turnprobability.find({"simulation_id": ObjectId(simulation_id), "intersection_id": intersection_id}) return turn def readTurnProbability(self, simulation_id, edge_id): """ Reads vehicles from vehicles table gets simulation id """ db = DBUtil().getDatabase() turn = db.turnprobability.find_one({"simulation_id": ObjectId(simulation_id), "edge_id": edge_id}) return turn def deleteTurnProbability(self, edge_id): """ Not implemented Yet """ db = DBUtil().getDatabase() def createTurnProbability(self, edge_id): """ Not implemented yet """ db = DBUtil().getDatabase() def updateTurnProbability(self, simulation_id, edge_id, left_turn, right_turn, go_straight): """ Update turn probability table based on the parameters being passed """ db = DBUtil().getDatabase() found = db.turnprobability.find_one({"simulation_id": ObjectId(simulation_id), "edge_id": edge_id}) found["left_turn"] = left_turn found["right_turn"] = right_turn found["go_straight"] = go_straight db.turnprobability.save(found) class TrafficLightDAO(object): def readAllTrafficLightLogic(self, simulation_id, intersection_id): """ Reads traffic light logic from traffic light table gets traffic light id """ db = DBUtil().getDatabase() traffic_light_logic = db.trafficlightlogic.find({ "simulation_id": ObjectId(simulation_id), "intersection_id": intersection_id }).sort([("creation_time", 1)]) return traffic_light_logic def readTrafficLightLogic(self, simulation_id, intersection_id): """ Reads traffic light logic from traffic light table gets traffic light id """ db = DBUtil().getDatabase() traffic_light_logic = db.trafficlightlogic.find({ "simulation_id": ObjectId(simulation_id), "intersection_id": intersection_id}).sort([("creation_time", 1)]) return traffic_light_logic def deleteTrafficLightLogic(self, id): """ Delete traffic light logic from traffic light table gets vehicle id """ db = DBUtil().getDatabase() db.trafficlightlogic.remove({"_id": ObjectId(id)}) db.trafficlightlogic.remove({"associated_with_id": ObjectId(id)}) def createTrafficLightLogic(self, simulation_id, intersection_id, state, duration): """ Create vehicle into vehicles table gets params light_index = 0!1!2 is passed as this format """ db = DBUtil().getDatabase() db.trafficlightlogic.insert({ "simulation_id": simulation_id, "intersection_id": intersection_id, "state": state, "duration": duration, "creation_time": str(datetime.now()) }) def updateTrafficLightLogic(self, id, duration): """ Update traffic light logic table gets id and updated params """ db = DBUtil().getDatabase() found = db.trafficlightlogic.find_one({"_id": ObjectId(id)}) found["duration"] = duration db.trafficlightlogic.save(found) ''' def updateTrafficLightLogic(self, id, state, duration): """ Update traffic light logic table gets id and updated params """ db = DBUtil().getDatabase() found = db.trafficlightlogic.find_one({"_id": ObjectId(id)}) found["state"] = state found["duration"] = duration db.trafficlightlogic.save(found) found_asso = db.trafficlightlogic.find({"associated_with_id": ObjectId(id)}) for find in found_asso: find["state"] = state find["duration"] = duration db.trafficlightlogic.save(find) ''' class SimAssociationDAO(object): def readAssociatedSimIDs(self, simulation_id): """ Gets actual simulation id and finds all the associated simulation ids with it """ db = DBUtil().getDatabase() print simulation_id assoc_ids= db.simulation_association.find_one({ "sim_id": ObjectId(simulation_id)}) vals = assoc_ids["sim_asso"] return vals def getOrigIdForAssociatedSimID(self, asso_id): db = DBUtil().getDatabase() asso_records = db.simulation_association.find({ "sim_asso": ObjectId(asso_id)} ) sim_id = None for record in asso_records: sim_id = record['sim_id'] if record.get('is_master') is not None and record.get('is_master'): return sim_id; return sim_id class StudentGroupDAO(object): def readAllGroupNames(self): """ Get all the group names for the collaboration """ db = DBUtil().getDatabase() groups = db.studentgroup.find({"name": {"$in": ["1","2","3","4","5","6","7","8","9","10"]}}).sort([("name", 1)]) return groups def readGroupNames(self, id): """ Get all the group names for the collaboration """ db = DBUtil().getDatabase() found = db.studentgroup.find_one({"_id": id}) return found def updateCollaborationUrl(self, id, collaboration_url): """ Update url for the hangout """ db = DBUtil().getDatabase() found = db.studentgroup.find_one({"_id": id}) found["collaboration_url"] = collaboration_url found["last_update_time"] = str(datetime.now()) db.studentgroup.save(found) def getCollaborationUrl(self, id): """ Get url for the hangout """ db = DBUtil().getDatabase() found = db.studentgroup.find_one({"_id": id}) return found class ProblemsDAO(object): def readAllProblems(self): """ Reads all problems """ db = DBUtil().getDatabase() problems = db.problems.find() return problems def readProblem(self, problem_id): """ Read problem from problems table """ db = DBUtil().getDatabase() problem = db.problems.find_one({"problem_id": problem_id}) return problem def getProblemID(self, simulation_id): """ Return the problem ID that student is working on """ db = DBUtil().getDatabase() found = db.simulation.find_one({"_id": ObjectId(simulation_id)}) return found["problem_id"] def updateProblem(self, simulation_id, problem_id): """ Update the problem that student is working on """ db = DBUtil().getDatabase() found = db.simulation.find_one({"_id": ObjectId(simulation_id)}) found["problem_id"] = problem_id db.simulation.save(found) db.problems.update({"problem_id" : problem_id}, {"$push" : {"history" : {"update_time": datetime.now(), "simulation_id" : simulation_id} } }) asso_simids = SimAssociationDAO().readAssociatedSimIDs(simulation_id) for sim_id in asso_simids: logging.info('sim_id: ' + str(sim_id)) db.simulation.update ({"_id": sim_id}, { '$set': { 'problem_id': problem_id}}) # FORGOT TO ADD THE LOGIC EARLIER, QUICKFIX FOR NOW SimulationBackupInterface(simulation_id).backupSimulation("SYSTEM", "PROBLEM_UPDATED") simdata = db.simulation.find_one({"_id": sim_id}) intersection_id = "202305472" if (simdata is not None): group_type = getGroupTypeDB(simdata['group_id']) if (group_type is not None) and (group_type == 'B'): intersection_id = "202305458" setSimulationToDefault(sim_id, problem_id, intersection_id) class ReasonDAO(object): def createReason(self, simulation_id, user_id, problem_id, desc): """ Create reason for changing parameters into reason_change table """ db = DBUtil().getDatabase() db.reason_change.insert({ "simulation_id": simulation_id, "user_id": user_id, "problem_id": problem_id, "description": desc, "creation_time": str(datetime.now()) }) class ColabLogDAO(object): def createLog(self, simulation_id, user_id, problem_id): """ Log collaboration history """ db = DBUtil().getDatabase() db.colab_log.insert({ "simulation_id": simulation_id, "user_id": user_id, "problem_id": problem_id, "colab_time": str(datetime.now()) }) def readCollaboration(self, user_id): db = DBUtil().getDatabase() colabs = db.colab_log.find({"user_id": user_id}).sort([("colab_time", 1)]) return colabs
{ "content_hash": "1015e7a3541a1038778c0b31989c68c1", "timestamp": "", "source": "github", "line_count": 375, "max_line_length": 160, "avg_line_length": 31.144, "alnum_prop": 0.6845620344207552, "repo_name": "shekharshank/c2sumo", "id": "0facd33af2554a9575400916052f4d6ec2edc25a", "size": "11679", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/C3STEM/Middleware/DAO.py", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "7600" }, { "name": "CSS", "bytes": "60642" }, { "name": "HTML", "bytes": "111873" }, { "name": "Java", "bytes": "63964" }, { "name": "JavaScript", "bytes": "3775992" }, { "name": "Python", "bytes": "469154" } ], "symlink_target": "" }
package org.brucalipto.btcbalancer; import java.math.BigDecimal; public interface Constants { BigDecimal ONE_CENT = new BigDecimal(0.01); BigDecimal QUARTER = new BigDecimal(0.25); BigDecimal HALF = new BigDecimal(0.5); BigDecimal ZERO = BigDecimal.ZERO; BigDecimal ONE = BigDecimal.ONE; BigDecimal TWO = new BigDecimal(2); BigDecimal TEN = BigDecimal.TEN; BigDecimal FIAT_MULTIPLIER = new BigDecimal(1e5); BigDecimal SATOSHI_MULTIPLIER = new BigDecimal(1e8); String CONFIGURATION_APIKEY = "apikey"; String CONFIGURATION_SECRETKEY = "secretkey"; String CONFIGURATION_FIAT_CURRENCY = "fiatCurrency"; String CONFIGURATION_IGNORE_SSL_ERRORS = "ignoreSSLErrors"; String CONFIGURATION_FEE_OVERRIDE = "feeOverride"; String CONFIGURATION_FEE_OVERRIDE_PERCENTUAL_VALUE = "feeOverridePercentualValue"; String CONFIGURATION_PERCENTUAL_DISTANCE = "percentualDistance"; String CONFIGURATION_MINIMUM_BTC_TRANSACTION = "minimumBTCTransaction"; }
{ "content_hash": "800580ec432b86279a0f6050501edaad", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 83, "avg_line_length": 39.2, "alnum_prop": 0.7673469387755102, "repo_name": "ottuzzi/BTCBalancer", "id": "e145a0d138c9b3e030bf5aa7e43cda5a0f61d6dd", "size": "980", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "btcbalancer/src/main/java/org/brucalipto/btcbalancer/Constants.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "38900" } ], "symlink_target": "" }
layout : post title : "Arup" subtitle : "Workplace As Workshop" tagline : "A pilot model workplace" assetsfolder : "arup" imgfeatured : "arup_17.jpg" imgtitletext : "Arup workplace" img_alt_text : "This is the Arup workplace" date : 2015-06-01 00:00:00 categories : transformative-4 author-name : Stella DeVulder author-twitter : stelladevulder author-facebook: "https://www.facebook.com/stella.devulder" summary : | A pilot experimenting with new types of spaces. --- <div class="quote-and-content" markdown="1"> <div class="content" markdown="1"> {% picture {{page.assetsfolder}}/arup_17.jpg alt="" %} AN UNKNOWN CAPTION {: .caption} </div> <div class="quote" markdown="1"> ##Look at me, I'm a title {% quote { "person" : "Ninotschka Titchkosky" } %} The Workshop recalibrates the notion of a place at the centre of everything {% endquote %} </div> </div> {% gallery { "dummy" : "dummy"} %} {% picture {{page.assetsfolder}}/arup_00.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_01.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_02.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_03.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_04.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_05.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_06.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_07.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_08.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_09.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_10.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_11.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_12.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_13.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_14.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_15.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_16.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_17.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_18.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_19.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_20.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_21.jpg alt="" %} {% picture {{page.assetsfolder}}/arup_22.jpg alt="" %} {% endgallery %} <div class="project-details"> <h3>Location</h3> <p >201 Kent Street, Sydney</p> <h3>Client</h3> <p >Arup</p> <h3>Completed</h3> <p >February 2015</p> <h3>Floor Area</h3> <p >1000m²</p> </div> ###A model of work spaces BVN were commissioned to work with Arup to create a pilot project that would allow the people in Arup to experience and experiment with new types of spaces that would inform their future move to a new building. BVN embraced the idea that an innovative engineering firm such as Arup needs more than just rectangular desks, computer screens and traditional meeting rooms. BVN wanted to find a model of work spaces that are specific to Arup, that would also help encourage innovation and experimentation within the business and were better aligned with who they believe they are. Importantly, the design builds on feedback from staff about being able to have sit-stand desks, a greater variety of spaces as well as spaces which express both the Arup culture and the work and research done within the firm. The design was developed in two parts. The first part comprised of an ABW trial space for the consulting group which included work-points, collaborative spaces and lounges and a quiet workspace “the Den”. By selecting three different furniture suppliers ARUP were given the chance to trial and review different furniture settings. Secondly, the Workshop – that was developed in collaboration with Koskela - included a variety of spaces, such as informal and flexible collaboration spaces, social spaces and spaces devoted to knowledge sharing and research. In addition the meeting spaces were designed to be radically reconfigurable using folding and sliding walls and a variety of flexible furniture that allows for all types of gatherings ranging from small meetings to ‘Town Hall’ events involving the entire firm. The Workshop recalibrates the notion of a place at the centre of everything by enabling ideas to be exchanged and objects to be tinkered with both digital and physical. This is aided by the location of the centre for knowledge sharing and research for Arup (Arup University) at the heart of this space, as an archetype of the future model, the workshop is a space which encourages people to collaborate, experiment, discuss, build, research and impart knowledge. # Team # | ----------------- | ------------ | ----------------- | | Project Team | Name | Title | | ----------------- | ------------ | ----------------- | | | Ninotschka Titchkosky | Project Principal | | | Alex Chaston | Project Team | | | Chris Bickerton | Project Team | | | Patrik Typpo | Graphics | | ----------------- | ------------ | ----------------- | | Consultant Team | Company Name | Role | | ----------------- | ------------ | ----------------- | | | Exceed Construction Management Pty Ltd | Main Contractor | | | Koskela | Furniture | | | Schiavello | Furniture | | | Unifor | Furniture | | | Kasian | Mechanical, electrical, lighting and all services |
{ "content_hash": "53e28c51df869fda92c4b50bd8e97ab8", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 489, "avg_line_length": 54.693693693693696, "alnum_prop": 0.5928183165870532, "repo_name": "bvn-architecture/transformative", "id": "9394ec7b7dee5770c58d56b2418cc45b1ce42920", "size": "6086", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "transformative/_posts/2015-03-22-Arup.markdown", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "49387" }, { "name": "HTML", "bytes": "449398" }, { "name": "JavaScript", "bytes": "238442" }, { "name": "Ruby", "bytes": "17244" } ], "symlink_target": "" }
package ws.jaxws.generated.client; import java.net.MalformedURLException; import java.net.URL; import java.util.logging.Logger; import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.WebEndpoint; import javax.xml.ws.WebServiceClient; import javax.xml.ws.WebServiceFeature; /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.1.7-b01- * Generated source version: 2.1 * */ @WebServiceClient(name = "Calculator", targetNamespace = "http://ws.server.calculator", wsdlLocation = "file:/home/ufo/workspaces/java_maven_example_project/wsJaxWsClient/wsdl/Calculator.wsdl") public class Calculator extends Service { private final static URL CALCULATOR_WSDL_LOCATION; private final static Logger logger = Logger.getLogger(ws.jaxws.generated.client.Calculator.class.getName()); static { URL url = null; try { URL baseUrl; baseUrl = ws.jaxws.generated.client.Calculator.class.getResource("."); url = new URL(baseUrl, "file:/home/ufo/workspaces/java_maven_example_project/wsJaxWsClient/wsdl/Calculator.wsdl"); } catch (MalformedURLException e) { logger.warning("Failed to create URL for the wsdl Location: 'file:/home/ufo/workspaces/java_maven_example_project/wsJaxWsClient/wsdl/Calculator.wsdl', retrying as a local file"); logger.warning(e.getMessage()); } CALCULATOR_WSDL_LOCATION = url; } public Calculator(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } public Calculator() { super(CALCULATOR_WSDL_LOCATION, new QName("http://ws.server.calculator", "Calculator")); } /** * * @return * returns CalculatorPortType */ @WebEndpoint(name = "CalculatorPort") public CalculatorPortType getCalculatorPort() { return super.getPort(new QName("http://ws.server.calculator", "CalculatorPort"), CalculatorPortType.class); } /** * * @param features * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. * @return * returns CalculatorPortType */ @WebEndpoint(name = "CalculatorPort") public CalculatorPortType getCalculatorPort(WebServiceFeature... features) { return super.getPort(new QName("http://ws.server.calculator", "CalculatorPort"), CalculatorPortType.class, features); } }
{ "content_hash": "8c12ea51ee6257c27e1792227b833465", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 193, "avg_line_length": 35.57746478873239, "alnum_prop": 0.6908155186064925, "repo_name": "ufoscout/java-sample-projects", "id": "31e80a427afb0aa716670f6161e8685d953db077", "size": "2526", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "wsJaxWsClient/src/main/java/ws/jaxws/generated/client/Calculator.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "63455" }, { "name": "Groovy", "bytes": "2297" }, { "name": "Java", "bytes": "367999" }, { "name": "JavaScript", "bytes": "320925" }, { "name": "Perl", "bytes": "1240" } ], "symlink_target": "" }
.. _yaml_mcmc_head: MCMC Moves Header for YAML Files ******************************** In the ``mcmc_moves`` section, you can define the propagators used to move forward the replicas of a :doc:`sampler <samplers>`. This block is optional. By default, YANK uses a sequence of MCMC moves that mix MC rigid rotation and translation of the ligand with Langevin dynamics. ---- .. _yaml_mcmc_example: MCMC Moves Syntax ================= MCMC moves definitions must adhere to the following syntax .. code-block:: yaml mcmc_moves: {UserDefinedMCMCMoveName1}: type: {MCMCMove} {MCMCMoveOptions} {UserDefinedMCMCMoveName2}: type: {MCMCMOve} {MCMCMoveOptions} ... where ``{UserDefinedMCMCMoveName}`` is a unique string identifier within the ``mcmc_moves`` block. The only mandatory keyword is ``type``. YANK supports all the ``MCMCMove`` classes defined in the `openmmtools.mcmc <http://openmmtools.readthedocs.io/en/latest/mcmc.html#mcmc-move-types>`_ module, which currently are: * ``SequenceMove``: Container MCMC move describing a sequence of other moves. * ``LangevinSplittingDynamicsMove``: High-quality Langevin integrator family based on symmetric Strang splittings, using g-BAOAB :cite:`LeimkuhlerMatthews2016` as default * ``LangevinDynamicsMove``: Leapfrog Langevin dynamics integrator from OpenMM (``simtk.openmm.LangevinIntegrator``); not recommended * ``GHMCMove``: Metropolized Langevin integrator, when exact sampling is required; not recommended for large systems * ``HMCMove``: Hybrid Monte Carlo integrator, when exact sampling is required; not recommended for large systems * ``MonteCarloBarostatMove``: Explicit Monte Carlo barostat; not recommended, since this can be incorporated within Langevin dynamics moves instead * ``MCDisplacementMove``: Monte Carlo displacement of ligand; useful for fragment-sized ligands in implicit solvent * ``MCRotationMove``: Monte Carlo rotation of ligand; useful for fragment-sized ligands in implicit solvent Each move accepts a specific set of options (see the constructor documentation of the classes in the `openmmtools.mcmc <http://openmmtools.readthedocs.io/en/latest/mcmc.html#mcmc-move-types>`_ module. The default moves used by YANK are equivalent to the following: .. _yaml_mcmc_defaults: .. code-block:: yaml mcmc_moves: default1: type: LangevinSplittingDynamicsMove timestep: 2.0*femtoseconds # 2 fs timestep collision_rate: 1.0 / picosecond # weak collision rate n_steps: 500 # 500 steps/iteration reassign_velocities: yes # reassign Maxwell-Boltzmann velocities each iteration n_restart_attempts: 6 # attempt to recover from NaNs splitting: 'V R O R V' # use the high-quality BAOAB integrator default2: type: SequenceMove move_list: - type: MCDisplacementMove # Monte Carlo ligand displacement - type: MCRotationMove # Monte Carlo ligand rotation - type: LangevinSplittingDynamicsMove timestep: 2.0*femtoseconds # 2 fs timestep collision_rate: 1.0 / picosecond # weak collision rate n_steps: 500 # 500 steps/iteration reassign_velocities: yes # reassign Maxwell-Boltzmann velocities each iteration n_restart_attempts: 6 # attempt to recover from NaNs splitting: 'V R O R V' # use the high-quality BAOAB integrator ``default1`` is used for the solvent phase and for complex phases using a ``BoreschLike`` restraint. For complex phases using any other restraint, ``default2`` is used. Each iteration of the sampler applies the MCMC move once. In ``default2`` example above, one iteration of the algorithm consists of one MC ligand rigid translation, followed by one MC ligand rigid rotation, and 500 steps of Langevin dynamics.
{ "content_hash": "4cd50036df882e0fcc700d439951c731", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 200, "avg_line_length": 51.44155844155844, "alnum_prop": 0.7033577379449634, "repo_name": "choderalab/yank", "id": "1ce965fccd503bba74765dd4e3f1aa265873ed51", "size": "3961", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/yamlpages/mcmc.rst", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "480" }, { "name": "Python", "bytes": "973580" }, { "name": "Shell", "bytes": "2032" } ], "symlink_target": "" }
FROM linuxkit/alpine:0c069d0fd7defddb6e03925fcd4915407db0c9e1 AS mirror RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/ RUN apk add --no-cache --initdb -p /out \ alpine-baselayout \ busybox \ e2fsprogs \ e2fsprogs-extra \ btrfs-progs \ xfsprogs \ xfsprogs-extra \ musl \ sfdisk \ util-linux \ && true RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache FROM linuxkit/alpine:0c069d0fd7defddb6e03925fcd4915407db0c9e1 AS build RUN apk add --no-cache go musl-dev ENV GOPATH=/go PATH=$PATH:/go/bin GO111MODULE=off # Hack to work around an issue with go on arm64 requiring gcc RUN [ $(uname -m) = aarch64 ] && apk add --no-cache gcc || true COPY vendor /go/src/extend/vendor COPY extend.go /go/src/extend/ RUN go-compile.sh /go/src/extend FROM scratch ENTRYPOINT [] CMD [] WORKDIR / COPY --from=mirror /out/ / COPY --from=build /go/bin/extend usr/bin/extend CMD ["/usr/bin/extend"]
{ "content_hash": "98beb47696c8ff37d4c85a41b622faf6", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 71, "avg_line_length": 26.771428571428572, "alnum_prop": 0.6937033084311632, "repo_name": "konstruktoid/linuxkit", "id": "ccecae383de367e16703dd4697777c636a4eb87f", "size": "937", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pkg/extend/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "54628" }, { "name": "Cap'n Proto", "bytes": "2365" }, { "name": "Dockerfile", "bytes": "76491" }, { "name": "Go", "bytes": "495185" }, { "name": "HTML", "bytes": "188" }, { "name": "Makefile", "bytes": "47167" }, { "name": "OCaml", "bytes": "69432" }, { "name": "Python", "bytes": "6363" }, { "name": "Ruby", "bytes": "937" }, { "name": "Shell", "bytes": "167453" }, { "name": "Standard ML", "bytes": "37" } ], "symlink_target": "" }
""" FTW transporter package. """ # Copyright © 2014 1&1 Internet AG # # 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.
{ "content_hash": "d44171adb1250e821e0fc8ec19fb3cab", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 74, "avg_line_length": 40.8, "alnum_prop": 0.7549019607843137, "repo_name": "Feed-The-Web/ftw-transporter", "id": "7c4069c44e678c27cc531a3b7ad7ebbfe06b23b8", "size": "637", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/ftw_transporter/__init__.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "2722" } ], "symlink_target": "" }
package kafka.utils import kafka.common.InvalidTopicException import kafka.common.InvalidClientIdException import util.matching.Regex object ClientId { val legalChars = "[a-zA-Z0-9_-]" val maxNameLength = 200 // to prevent hitting filename max length limit private val rgx = new Regex(legalChars + "*") def validate(clientId: String) { if (clientId.length > maxNameLength) throw new InvalidClientIdException("ClientId is illegal, can't be longer than " + maxNameLength + " characters") rgx.findFirstIn(clientId) match { case Some(t) => if (!t.equals(clientId)) throw new InvalidClientIdException("ClientId " + clientId + " is illegal, contains a character other than ASCII alphanumerics, _ and -") case None => throw new InvalidClientIdException("ClientId " + clientId + " is illegal, contains a character other than ASCII alphanumerics, _ and -") } } } object Topic { val legalChars = "[a-zA-Z0-9_-]" val maxNameLength = 255 private val rgx = new Regex(legalChars + "+") def validate(topic: String) { if (topic.length <= 0) throw new InvalidTopicException("topic name is illegal, can't be empty") else if (topic.length > maxNameLength) throw new InvalidTopicException("topic name is illegal, can't be longer than " + maxNameLength + " characters") rgx.findFirstIn(topic) match { case Some(t) => if (!t.equals(topic)) throw new InvalidTopicException("topic name " + topic + " is illegal, contains a character other than ASCII alphanumerics, _ and -") case None => throw new InvalidTopicException("topic name " + topic + " is illegal, contains a character other than ASCII alphanumerics, _ and -") } } } case class ClientIdAndTopic(clientId: String, topic:String) { override def toString = "%s-%s".format(clientId, topic) }
{ "content_hash": "300b4997ed569818dbaef20b65710b02", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 156, "avg_line_length": 38, "alnum_prop": 0.6917293233082706, "repo_name": "dchenbecker/kafka-sbt", "id": "780339ecd89fb44fb14a169abeaa6d75f2fd8694", "size": "2663", "binary": false, "copies": "1", "ref": "refs/heads/topic/0.8-sbt-0.12", "path": "core/src/main/scala/kafka/utils/ClientIdAndTopic.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "107761" }, { "name": "Python", "bytes": "237238" }, { "name": "Scala", "bytes": "1237543" }, { "name": "Shell", "bytes": "91437" } ], "symlink_target": "" }
package com.intellij.psi.impl.source.resolve.reference.impl.providers; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.NotNullLazyValue; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiPackage; import com.intellij.psi.PsiReference; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.psi.templateLanguages.OuterLanguageElement; import com.intellij.psi.xml.XmlTag; import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class JavaClassListReferenceProvider extends JavaClassReferenceProvider { public JavaClassListReferenceProvider() { setOption(ADVANCED_RESOLVE, Boolean.TRUE); } @Override public PsiReference @NotNull [] getReferencesByString(String str, @NotNull final PsiElement position, int offsetInPosition){ if (position instanceof XmlTag && ((XmlTag)position).getValue().getTextElements().length == 0) { return PsiReference.EMPTY_ARRAY; } if (str.length() < 2) { return PsiReference.EMPTY_ARRAY; } int offset = position.getTextRange().getStartOffset() + offsetInPosition; for(PsiElement child = position.getFirstChild(); child != null; child = child.getNextSibling()){ if (child instanceof OuterLanguageElement && child.getTextRange().contains(offset)) { return PsiReference.EMPTY_ARRAY; } } NotNullLazyValue<Set<String>> topLevelPackages = new NotNullLazyValue<Set<String>>() { @NotNull @Override protected Set<String> compute() { Set<String> knownTopLevelPackages = new HashSet<>(); List<PsiPackage> defaultPackages = getDefaultPackages(position.getProject()); for (PsiElement pack : defaultPackages) { if (pack instanceof PsiPackage) { knownTopLevelPackages.add(((PsiPackage)pack).getName()); } } return knownTopLevelPackages; } }; final List<PsiReference> results = new ArrayList<>(); for(int dot = str.indexOf('.'); dot > 0; dot = str.indexOf('.', dot + 1)) { int start = dot; while (start > 0 && Character.isLetterOrDigit(str.charAt(start - 1))) start--; if (dot == start) { continue; } String candidate = str.substring(start, dot); if (topLevelPackages.getValue().contains(candidate)) { int end = dot; while (end < str.length() - 1) { end++; char ch = str.charAt(end); if (ch != '.' && !Character.isJavaIdentifierPart(ch)) { break; } } String s = str.substring(start, end + 1); ContainerUtil.addAll(results, new JavaClassReferenceSet(s, position, offsetInPosition + start, false, this) { @Override public boolean isSoft() { return true; } @Override public boolean isAllowDollarInNames() { return true; } }.getAllReferences()); ProgressManager.checkCanceled(); } } return results.toArray(PsiReference.EMPTY_ARRAY); } @Override public GlobalSearchScope getScope(Project project) { return GlobalSearchScope.allScope(project); } }
{ "content_hash": "42a8e9b1fcb8433eadd821fee484cacd", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 126, "avg_line_length": 34.30612244897959, "alnum_prop": 0.6683521713265913, "repo_name": "leafclick/intellij-community", "id": "7ab33c6e8a2a88ec3b4bcc96cdd0b0c63504fd1e", "size": "3962", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaClassListReferenceProvider.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
import mock from rally.plugins.openstack.scenarios.nova import keypairs from tests.unit import test class NovaKeypairTestCase(test.ScenarioTestCase): def test_create_and_list_keypairs(self): scenario = keypairs.NovaKeypair(self.context) scenario.generate_random_name = mock.MagicMock(return_value="name") scenario._create_keypair = mock.MagicMock(return_value="foo_keypair") scenario._list_keypairs = mock.MagicMock() scenario.create_and_list_keypairs(fakearg="fakearg") scenario._create_keypair.assert_called_once_with(fakearg="fakearg") scenario._list_keypairs.assert_called_once_with() def test_create_and_delete_keypair(self): scenario = keypairs.NovaKeypair(self.context) scenario.generate_random_name = mock.MagicMock(return_value="name") scenario._create_keypair = mock.MagicMock(return_value="foo_keypair") scenario._delete_keypair = mock.MagicMock() scenario.create_and_delete_keypair(fakearg="fakearg") scenario._create_keypair.assert_called_once_with(fakearg="fakearg") scenario._delete_keypair.assert_called_once_with("foo_keypair") def test_boot_and_delete_server_with_keypair(self): scenario = keypairs.NovaKeypair(self.context) scenario.generate_random_name = mock.MagicMock(return_value="name") scenario._create_keypair = mock.MagicMock(return_value="foo_keypair") scenario._boot_server = mock.MagicMock(return_value="foo_server") scenario._delete_server = mock.MagicMock() scenario._delete_keypair = mock.MagicMock() fake_server_args = { "foo": 1, "bar": 2, } scenario.boot_and_delete_server_with_keypair( "img", 1, boot_server_kwargs=fake_server_args, fake_arg1="foo", fake_arg2="bar") scenario._create_keypair.assert_called_once_with( fake_arg1="foo", fake_arg2="bar") scenario._boot_server.assert_called_once_with( "img", 1, foo=1, bar=2, key_name="foo_keypair") scenario._delete_server.assert_called_once_with("foo_server") scenario._delete_keypair.assert_called_once_with("foo_keypair")
{ "content_hash": "c607b2c511eb0ea9529c514dae18f936", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 77, "avg_line_length": 39.732142857142854, "alnum_prop": 0.6719101123595506, "repo_name": "eayunstack/rally", "id": "9b6e27580105464cf6e46be9ba91d25f25bbc5cd", "size": "2883", "binary": false, "copies": "6", "ref": "refs/heads/product", "path": "tests/unit/plugins/openstack/scenarios/nova/test_keypairs.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "36716" }, { "name": "Mako", "bytes": "17389" }, { "name": "Python", "bytes": "2988245" }, { "name": "Shell", "bytes": "41128" } ], "symlink_target": "" }
package db import ( "database/sql" "github.com/atnet/gof/db/orm" ) type Connector interface { GetDb() *sql.DB GetOrm() orm.Orm Query(sql string, f func(*sql.Rows), arg ...interface{}) error // 查询Rows QueryRow(sql string, f func(*sql.Row), arg ...interface{}) error ExecScalar(s string, result interface{}, arg ...interface{}) error // 执行 Exec(sql string, args ...interface{}) (rows int, lastInsertId int, err error) ExecNonQuery(sql string, args ...interface{}) (int, error) }
{ "content_hash": "acdd27e5dba2ed34fa3a6b340e8b2e75", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 78, "avg_line_length": 19.153846153846153, "alnum_prop": 0.6726907630522089, "repo_name": "aprilsky/go2o", "id": "f48485ab2413b0505b89bf7af893460c6ddceb3f", "size": "628", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/github.com/atnet/gof/db/connector.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "303497" }, { "name": "Go", "bytes": "387386" }, { "name": "HTML", "bytes": "186652" }, { "name": "JavaScript", "bytes": "89531" } ], "symlink_target": "" }
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Review_model extends CI_Model { public function create() { $issue_id = $this->input->post('issue_id'); $name = $this->input->post('name_val'); $description = nl2br($this->input->post('description_val')); $type = $this->input->post('type_val'); $status = $this->input->post('status_val'); $execution_status = $this->input->post('execution_status_val'); $priority = $this->input->post('priority_val'); $notes = nl2br($this->input->post('notes_val')); $issue = $this->Issue_model->getIssue($issue_id); $position = $this->Review_model->getLastPostion($issue_id); $created_by = $this->user->first_name . ' ' . $this->user->last_name; $user_id = $this->user->id; $data = array( 'project_id' => $issue->project_id, 'issue_id' => $issue_id, 'name' => $name, 'description' => $description, 'review_type' => $type, 'status' => $status, 'execution_status' => $execution_status, 'priority' => $priority, 'notes' => $notes, 'position' => $position + 1, 'created_by' => $created_by, 'created_by_id' => $user_id, 'created_on' => date('Y-m-d g:i:s'), 'updated_on' => date('Y-m-d g:i:s') ); $query = $this->db->insert('reviews', $data); return $query; } public function edit() { $row = $this->input->post('row_id'); $name = $this->input->post('name_val'); $description = nl2br($this->input->post('description_val')); $type = $this->input->post('type_val'); $status = $this->input->post('status_val'); $execution_status = $this->input->post('execution_status_val'); $priority = $this->input->post('priority_val'); $notes = nl2br($this->input->post('notes_val')); $data = array( 'name' => $name, 'description' => $description, 'review_type' => $type, 'status' => $status, 'execution_status' => $execution_status, 'priority' => $priority, 'notes' => $notes, 'updated_on' => date('Y-m-d g:i:s') ); $this->db->where('id', $row); $query = $this->db->update('reviews', $data); return $query; } public function destroy() { $row_no = $this->input->post('row_id'); $this->db->where('id', $row_no); $query = $this->db->delete('reviews'); return $query; } public function getLastPostion($id) { $maxid = 0; $row = $this->db->query("SELECT MAX(position) AS `maxid` FROM `reviews` WHERE `issue_id` = '{$id}' ")->row(); if ($row) { return $maxid = $row->maxid; } else { return 1; } } }
{ "content_hash": "76c2dca33dfe7b4f8b252e0907f3a9b8", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 111, "avg_line_length": 29.988095238095237, "alnum_prop": 0.5855498213576816, "repo_name": "kevinmdoyle/wasabi", "id": "cef21764bbbd8283672619062d136abd1f569734", "size": "2519", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/models/Review_model.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "581" }, { "name": "CSS", "bytes": "401035" }, { "name": "HTML", "bytes": "10330962" }, { "name": "JavaScript", "bytes": "3017680" }, { "name": "PHP", "bytes": "2349325" } ], "symlink_target": "" }
package com.player; import com.prop.EquipType; public class Property { /** * 作为需要更新数据的标记 */ private boolean isChange; /** * 总和值 */ private int totalJoin; /** * 总万分比加成 */ private int totalRate; /** * 装备的属性值 */ private int[] equipData; /** * 装备的总属性 */ private int totalEquipData; /** * 等级的属性加成 */ private int levelData; /** * 角色的初始HP */ private int charHP; public Property() { equipData = new int[EquipType.COUNT]; } private void fresh() { int totalNoRateVal = totalEquipData + levelData + charHP; totalJoin = (int) ((totalNoRateVal * 1.0 * totalRate * GameConst.TEN_THOUSAND_RATE) + totalNoRateVal); isChange = false; } public void setTotalJoin(int totalJoin) { this.totalJoin = totalJoin; } public int getTotalJoin() { if (isChange) fresh(); return totalJoin; } public void addEquipData(int index, int equipData) { if (this.equipData[index] != equipData) { this.equipData[index] = equipData; totalEquipData += equipData; isChange = true; } } public void clearEquipData(int index) { totalEquipData -= this.equipData[index]; addEquipData(index, 0); } public void setLevelData(int levelData) { this.levelData = levelData; isChange = true; } public void setCharacterHP(int charHP) { this.charHP = charHP; isChange = true; } }
{ "content_hash": "be8c4e0ad94ddc47b41239920750c5bc", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 104, "avg_line_length": 17.156626506024097, "alnum_prop": 0.6214887640449438, "repo_name": "LaoZhongGu/RushServer", "id": "b5eede8e3fc0a95a91420a9777d7daba3f6ff6f1", "size": "1512", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "GameServer/src/com/player/Property.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "113" }, { "name": "Java", "bytes": "752662" }, { "name": "Shell", "bytes": "7658" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ChangeListManager"> <list default="true" id="e5d5968a-8f20-496e-9038-3ca60f9ade67" name="Default" comment="" /> <ignored path="bowser.iws" /> <ignored path=".idea/workspace.xml" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="TRACKING_ENABLED" value="true" /> <option name="SHOW_DIALOG" value="false" /> <option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="LAST_RESOLUTION" value="IGNORE" /> </component> <component name="CreatePatchCommitExecutor"> <option name="PATCH_PATH" value="" /> </component> <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> <component name="FavoritesManager"> <favorites_list name="bowser" /> </component> <component name="FileEditorManager"> <splitter split-orientation="horizontal" split-proportion="0.69687814"> <split-first> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <file leaf-file-name="bowser.js" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/src/bowser.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="597"> <caret line="364" column="20" lean-forward="false" selection-start-line="364" selection-start-column="14" selection-end-line="364" selection-end-column="20" /> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="bower.json" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/bower.json"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="289"> <caret line="17" column="4" lean-forward="true" selection-start-line="17" selection-start-column="4" selection-end-line="17" selection-end-column="4" /> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="CHANGELOG.md" pinned="false" current-in-tab="true"> <entry file="file://$PROJECT_DIR$/CHANGELOG.md"> <provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]"> <state split_layout="FIRST"> <first_editor relative-caret-position="51"> <caret line="3" column="48" lean-forward="false" selection-start-line="3" selection-start-column="48" selection-end-line="3" selection-end-column="48" /> <folding /> </first_editor> <second_editor> <js_state /> </second_editor> </state> </provider> </entry> </file> </leaf> </split-first> <split-second> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <file leaf-file-name="useragents.js" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/src/useragents.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="597"> <caret line="236" column="24" lean-forward="false" selection-start-line="236" selection-start-column="24" selection-end-line="236" selection-end-column="24" /> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="package.json" pinned="false" current-in-tab="true"> <entry file="file://$PROJECT_DIR$/package.json"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="142"> <caret line="14" column="45" lean-forward="false" selection-start-line="14" selection-start-column="45" selection-end-line="14" selection-end-column="45" /> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="README.md" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/README.md"> <provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]"> <state split_layout="FIRST"> <first_editor relative-caret-position="153"> <caret line="9" column="23" lean-forward="false" selection-start-line="9" selection-start-column="23" selection-end-line="9" selection-end-column="23" /> <folding /> </first_editor> <second_editor> <js_state /> </second_editor> </state> </provider> </entry> </file> </leaf> </split-second> </splitter> </component> <component name="FindInProjectRecents"> <findStrings> <find>android</find> <find>likeAndroid</find> <find>chromeos</find> <find>bada</find> <find>black</find> <find>firefoxOs</find> <find>macintosh</find> <find>getFirstMatch</find> <find>getSecondMatch</find> <find>EDGE</find> <find>Edge</find> <find>Windows Phone</find> <find>sailfish</find> <find>seamonkey</find> <find>utils.</find> <find>rim</find> <find>webos</find> <find>iPhone</find> <find>iPhone:</find> <find>iphone</find> <find>msedge</find> <find>Inter</find> <find>iemobile</find> <find>windowsphone</find> <find>edge</find> <find>silk</find> <find>mac</find> <find>t</find> <find>tablet</find> </findStrings> </component> <component name="Git.Settings"> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> </component> <component name="IdeDocumentHistory"> <option name="CHANGED_PATHS"> <list> <option value="$PROJECT_DIR$/.editorconfig" /> <option value="$PROJECT_DIR$/.npmignore" /> <option value="$PROJECT_DIR$/src/copyright.js" /> <option value="$PROJECT_DIR$/make/build.js" /> <option value="$PROJECT_DIR$/.gitignore" /> <option value="$PROJECT_DIR$/ISSUE_TEMPLATE.md" /> <option value="$PROJECT_DIR$/.travis.yml" /> <option value="$PROJECT_DIR$/test/test.js" /> <option value="$PROJECT_DIR$/src/useragents.js" /> <option value="$PROJECT_DIR$/src/new-bowser.js" /> <option value="$PROJECT_DIR$/src/bowser.js" /> <option value="$PROJECT_DIR$/src/utils.js" /> <option value="$PROJECT_DIR$/.babelrc" /> <option value="$PROJECT_DIR$/test/unit/utils.js" /> <option value="$PROJECT_DIR$/src/parser-browsers.js" /> <option value="$PROJECT_DIR$/README.md" /> <option value="$PROJECT_DIR$/test/unit/parser.js" /> <option value="$PROJECT_DIR$/src/parser.js" /> <option value="$PROJECT_DIR$/src/parser-os.js" /> <option value="$PROJECT_DIR$/package.json" /> <option value="$PROJECT_DIR$/bower.json" /> <option value="$PROJECT_DIR$/CHANGELOG.md" /> </list> </option> </component> <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" /> <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER"> <package-json value="$PROJECT_DIR$/package.json" /> </component> <component name="JsFlowSettings"> <service-enabled>false</service-enabled> <exe-path /> <annotation-enable>false</annotation-enable> <other-services-enabled>false</other-services-enabled> </component> <component name="JsGulpfileManager"> <detection-done>true</detection-done> <sorting>DEFINITION_ORDER</sorting> </component> <component name="NodeModulesDirectoryManager"> <handled-path value="$PROJECT_DIR$/node_modules" /> </component> <component name="ProjectFrameBounds"> <option name="y" value="22" /> <option name="width" value="1280" /> <option name="height" value="774" /> </component> <component name="ProjectView"> <navigator currentView="ProjectPane" proportions="" version="1"> <flattenPackages /> <showMembers /> <showModules /> <showLibraryContents /> <hideEmptyPackages /> <abbreviatePackageNames /> <autoscrollToSource /> <autoscrollFromSource /> <sortByType /> <manualOrder /> <foldersAlwaysOnTop value="true" /> </navigator> <panes> <pane id="Scratches" /> <pane id="Scope" /> <pane id="ProjectPane"> <subPane> <PATH> <PATH_ELEMENT> <option name="myItemId" value="bowser" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="bowser" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> </PATH> </subPane> </pane> </panes> </component> <component name="PropertiesComponent"> <property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="WebServerToolWindowFactoryState" value="false" /> <property name="HbShouldOpenHtmlAsHb" value="" /> <property name="js-jscs-nodeInterpreter" value="$USER_HOME$/.nvm/versions/node/v4.2.4/bin/node" /> <property name="editor.config.accepted" value="true" /> <property name="nodejs_interpreter_path" value="$USER_HOME$/.nvm/versions/node/v4.4.7/bin/node" /> <property name="nodejs.mocha.mocha_node_package_dir" value="$PROJECT_DIR$/node_modules/mocha" /> <property name="settings.editor.selected.configurable" value="preferences.lookFeel" /> <property name="javascript.nodejs.core.library.configured.version" value="4.4.7" /> <property name="JavaScriptPreferStrict" value="false" /> <property name="JavaScriptWeakerCompletionTypeGuess" value="true" /> </component> <component name="RecentsManager"> <key name="MoveFile.RECENT_KEYS"> <recent name="$PROJECT_DIR$" /> </key> </component> <component name="RunDashboard"> <option name="ruleStates"> <list> <RuleState> <option name="name" value="ConfigurationTypeDashboardGroupingRule" /> </RuleState> <RuleState> <option name="name" value="StatusDashboardGroupingRule" /> </RuleState> </list> </option> </component> <component name="RunManager" selected="Node.js.watch tests"> <configuration default="true" type="BashConfigurationType" factoryName="Bash"> <option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_PATH" value="/bin/bash" /> <option name="WORKING_DIRECTORY" value="" /> <option name="PARENT_ENVS" value="true" /> <option name="SCRIPT_NAME" value="" /> <option name="PARAMETERS" value="" /> <module name="" /> <envs /> <method /> </configuration> <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application"> <method /> </configuration> <configuration default="true" type="DartTestRunConfigurationType" factoryName="Dart Test"> <method /> </configuration> <configuration default="true" type="JavaScriptTestRunnerJest" factoryName="Jest"> <node-interpreter value="project" /> <working-dir value="" /> <envs /> <scope-kind value="ALL" /> <method /> </configuration> <configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma"> <config-file value="" /> <node-interpreter value="project" /> <envs /> <method /> </configuration> <configuration default="true" type="JavaScriptTestRunnerProtractor" factoryName="Protractor"> <config-file value="" /> <node-interpreter value="project" /> <envs /> <method /> </configuration> <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug"> <method /> </configuration> <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="project" working-dir=""> <method /> </configuration> <configuration default="true" type="cucumber.js" factoryName="Cucumber.js"> <option name="cucumberJsArguments" value="" /> <option name="executablePath" /> <option name="filePath" /> <method /> </configuration> <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js"> <node-interpreter>project</node-interpreter> <node-options /> <gulpfile /> <tasks /> <arguments /> <envs /> <method /> </configuration> <configuration default="true" type="js.build_tools.npm" factoryName="npm"> <command value="run" /> <scripts /> <node-interpreter value="project" /> <envs /> <method /> </configuration> <configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha"> <node-interpreter>$USER_HOME$/.nvm/versions/node/v4.2.4/bin/node</node-interpreter> <node-options /> <working-directory>$PROJECT_DIR$</working-directory> <pass-parent-env>true</pass-parent-env> <envs /> <ui>bdd</ui> <extra-mocha-options /> <test-kind>DIRECTORY</test-kind> <test-directory /> <recursive>false</recursive> <method /> </configuration> <configuration default="false" name="test" type="js.build_tools.npm" factoryName="npm"> <package-json value="$PROJECT_DIR$/package.json" /> <command value="run" /> <scripts> <script value="test" /> </scripts> <node-interpreter value="$USER_HOME$/.nvm/versions/node/v6.9.2/bin/node" /> <envs /> <method /> </configuration> <configuration default="false" name="watch tests" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="/usr/local/Cellar/node/7.8.0/bin/node" path-to-js-file="node_modules/.bin/ava" application-parameters="--verbose --watch test/unit" working-dir="$PROJECT_DIR$"> <profiling v8-profiler-path="$USER_HOME$/.nvm/versions/node/v4.4.7/lib/node_modules/v8-profiler" /> <EXTENSION ID="com.jetbrains.nodejs.remote.docker.NodeJSDockerRunConfigurationExtension"> <option name="envVars"> <list /> </option> <option name="extraHosts"> <list /> </option> <option name="links"> <list /> </option> <option name="networkDisabled" value="false" /> <option name="networkMode" value="bridge" /> <option name="portBindings"> <list /> </option> <option name="publishAllPorts" value="false" /> <option name="version" value="1" /> <option name="volumeBindings"> <list /> </option> </EXTENSION> <EXTENSION ID="com.jetbrains.nodejs.run.NodeJSProfilingRunConfigurationExtension"> <profiling v8-profiler-path="$USER_HOME$/.nvm/versions/node/v4.4.7/lib/node_modules/v8-profiler" /> </EXTENSION> <method /> </configuration> <list size="2"> <item index="0" class="java.lang.String" itemvalue="npm.test" /> <item index="1" class="java.lang.String" itemvalue="Node.js.watch tests" /> </list> </component> <component name="ShelveChangesManager" show_recycled="false"> <option name="remove_strategy" value="false" /> </component> <component name="SvnConfiguration"> <configuration /> </component> <component name="TaskManager"> <task active="true" id="Default" summary="Default task"> <changelist id="e5d5968a-8f20-496e-9038-3ca60f9ade67" name="Default" comment="" /> <created>1460663203148</created> <option name="number" value="Default" /> <option name="presentableId" value="Default" /> <updated>1460663203148</updated> <workItem from="1467903205339" duration="2348000" /> <workItem from="1469530933856" duration="577000" /> <workItem from="1469613736440" duration="843000" /> <workItem from="1470856356825" duration="1760000" /> <workItem from="1471694116386" duration="3831000" /> <workItem from="1472504254866" duration="2038000" /> <workItem from="1472506362075" duration="69000" /> <workItem from="1472594666841" duration="2699000" /> <workItem from="1472640870661" duration="1938000" /> <workItem from="1472806795867" duration="910000" /> <workItem from="1474185796367" duration="13000" /> <workItem from="1474188003327" duration="3018000" /> <workItem from="1474314087540" duration="1938000" /> <workItem from="1474359763987" duration="11000" /> <workItem from="1474916352416" duration="284000" /> <workItem from="1475653755459" duration="30000" /> <workItem from="1477903203162" duration="2196000" /> <workItem from="1478186752996" duration="320000" /> <workItem from="1478187077648" duration="1126000" /> <workItem from="1478298430363" duration="2567000" /> <workItem from="1480969963547" duration="957000" /> <workItem from="1482500551547" duration="211000" /> <workItem from="1482503774910" duration="735000" /> <workItem from="1483826622613" duration="503000" /> <workItem from="1485119874288" duration="3226000" /> <workItem from="1490357099078" duration="447000" /> <workItem from="1490993891079" duration="6576000" /> <workItem from="1491136107895" duration="7722000" /> <workItem from="1491239706765" duration="714000" /> <workItem from="1491249803179" duration="1984000" /> <workItem from="1491336207678" duration="1618000" /> <workItem from="1491674896468" duration="1676000" /> <workItem from="1491725583169" duration="20809000" /> <workItem from="1491825357873" duration="935000" /> <workItem from="1491858641932" duration="606000" /> <workItem from="1491933288606" duration="2000" /> <workItem from="1491935322145" duration="643000" /> <workItem from="1491936995311" duration="2957000" /> <workItem from="1492110236327" duration="1850000" /> <workItem from="1492272289300" duration="985000" /> <workItem from="1492276168333" duration="10503000" /> <workItem from="1493559521213" duration="367000" /> <workItem from="1493573087749" duration="12000" /> <workItem from="1493573143412" duration="671000" /> <workItem from="1493712648190" duration="26000" /> <workItem from="1493983048502" duration="1970000" /> <workItem from="1495133393210" duration="379000" /> </task> <servers /> </component> <component name="TimeTrackingManager"> <option name="totallyTimeSpent" value="97600000" /> </component> <component name="TodoView"> <todo-panel id="selected-file"> <is-autoscroll-to-source value="true" /> </todo-panel> <todo-panel id="all"> <are-packages-shown value="true" /> <is-autoscroll-to-source value="true" /> </todo-panel> </component> <component name="ToolWindowManager"> <frame x="0" y="22" width="1280" height="774" extended-state="6" /> <editor active="true" /> <layout> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2112788" sideWeight="0.4957265" order="0" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.35470086" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="npm" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.26923078" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39939025" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.1790416" sideWeight="0.50427353" order="2" side_tool="true" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> </layout> </component> <component name="TypeScriptGeneratedFilesManager"> <option name="processedProjectFiles" value="true" /> </component> <component name="Vcs.Log.UiProperties"> <option name="RECENTLY_FILTERED_USER_GROUPS"> <collection /> </option> <option name="RECENTLY_FILTERED_BRANCH_GROUPS"> <collection /> </option> </component> <component name="VcsContentAnnotationSettings"> <option name="myLimit" value="2678400000" /> </component> <component name="XDebuggerManager"> <breakpoint-manager /> <watches-manager> <configuration name="NodeJSConfigurationType"> <watch expression="browsersList" language="JavaScript" /> </configuration> </watches-manager> </component> <component name="editorHistoryManager"> <entry file="file://$PROJECT_DIR$/src/useragents.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/src/bowser.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="546" column="14" lean-forward="false" selection-start-line="546" selection-start-column="9" selection-end-line="546" selection-end-column="14" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/test.old.js" /> <entry file="file://$PROJECT_DIR$/package.json"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/package.json"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="9" column="17" lean-forward="false" selection-start-line="9" selection-start-column="17" selection-end-line="9" selection-end-column="17" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/bower.json"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/src/useragents.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/src/bowser.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/package.json"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/README.md"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="57" column="25" lean-forward="false" selection-start-line="57" selection-start-column="25" selection-end-line="57" selection-end-column="25" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/src/useragents.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="291" column="160" lean-forward="false" selection-start-line="291" selection-start-column="154" selection-end-line="291" selection-end-column="160" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/package.json"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="6" column="12" lean-forward="false" selection-start-line="6" selection-start-column="12" selection-end-line="6" selection-end-column="12" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/src/bowser.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="219" column="42" lean-forward="false" selection-start-line="219" selection-start-column="42" selection-end-line="219" selection-end-column="42" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/README.md"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/package.json"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="6" column="12" lean-forward="false" selection-start-line="6" selection-start-column="12" selection-end-line="6" selection-end-column="12" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/.travis.yml"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="5" column="27" lean-forward="false" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="27" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/src/bowser.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="219" column="42" lean-forward="false" selection-start-line="219" selection-start-column="42" selection-end-line="219" selection-end-column="42" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/.editorconfig"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="14" column="28" lean-forward="false" selection-start-line="14" selection-start-column="28" selection-end-line="14" selection-end-column="28" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/src/useragents.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/test.old.js" /> <entry file="file://$PROJECT_DIR$/.editorconfig"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="6" column="7" lean-forward="false" selection-start-line="6" selection-start-column="7" selection-end-line="6" selection-end-column="7" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/.npmignore"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="3" column="0" lean-forward="false" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/.gitignore"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="4" column="0" lean-forward="false" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/Makefile"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="5" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="5" /> </state> </provider> </entry> <entry file="jar://$APPLICATION_HOME_DIR$/plugins/JavaScriptLanguage/lib/JavaScriptLanguage.jar!/com/intellij/lang/javascript/index/predefined/EcmaScript.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="132" column="0" lean-forward="false" selection-start-line="132" selection-start-column="0" selection-end-line="132" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/typings.d.ts"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/npm-debug.log" /> <entry file="file://$PROJECT_DIR$/.travis.yml"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="32"> <caret line="2" column="11" lean-forward="false" selection-start-line="2" selection-start-column="11" selection-end-line="2" selection-end-column="11" /> </state> </provider> </entry> <entry file="jar://$APPLICATION_HOME_DIR$/plugins/JavaScriptLanguage/lib/JavaScriptLanguage.jar!/com/intellij/lang/javascript/index/predefined/HTML5.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="599"> <caret line="1343" column="0" lean-forward="false" selection-start-line="1343" selection-start-column="0" selection-end-line="1343" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/src/new-bowser.js" /> <entry file="file://$PROJECT_DIR$/bowser.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="165"> <caret line="463" column="0" lean-forward="false" selection-start-line="463" selection-start-column="0" selection-end-line="463" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/node_modules/smoosh/lib/smoosh/index.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/node_modules/smoosh/index.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="35" lean-forward="true" selection-start-line="0" selection-start-column="35" selection-end-line="0" selection-end-column="35" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/make/build.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="10" lean-forward="false" selection-start-line="0" selection-start-column="10" selection-end-line="0" selection-end-column="10" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/test/unit/bowser.js" /> <entry file="file://$PROJECT_DIR$/test.old.js" /> <entry file="file://$PROJECT_DIR$/.babelrc" /> <entry file="file://$PROJECT_DIR$/node_modules/sinon/lib/sinon.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="285"> <caret line="19" column="9" lean-forward="true" selection-start-line="19" selection-start-column="9" selection-end-line="19" selection-end-column="9" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/LICENSE"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="45"> <caret line="3" column="11" lean-forward="true" selection-start-line="3" selection-start-column="11" selection-end-line="3" selection-end-column="11" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/src/parser.js" /> <entry file="file://$PROJECT_DIR$/src/useragents.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="597"> <caret line="236" column="24" lean-forward="false" selection-start-line="236" selection-start-column="24" selection-end-line="236" selection-end-column="24" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/src/parser-browsers.js" /> <entry file="file://$PROJECT_DIR$/test/unit/parser.js" /> <entry file="file://$PROJECT_DIR$/README.md"> <provider editor-type-id="text-editor"> <state relative-caret-position="810"> <caret line="54" column="43" lean-forward="false" selection-start-line="54" selection-start-column="43" selection-end-line="54" selection-end-column="43" /> </state> </provider> <provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]"> <state split_layout="FIRST"> <first_editor relative-caret-position="153"> <caret line="9" column="23" lean-forward="false" selection-start-line="9" selection-start-column="23" selection-end-line="9" selection-end-column="23" /> <folding /> </first_editor> <second_editor> <js_state /> </second_editor> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/test/unit/utils.js" /> <entry file="file://$PROJECT_DIR$/src/utils.js" /> <entry file="file://$PROJECT_DIR$/src/parser-os.js" /> <entry file="file://$PROJECT_DIR$/src/bowser.js"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="597"> <caret line="364" column="20" lean-forward="false" selection-start-line="364" selection-start-column="14" selection-end-line="364" selection-end-column="20" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/package.json"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="142"> <caret line="14" column="45" lean-forward="false" selection-start-line="14" selection-start-column="45" selection-end-line="14" selection-end-column="45" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/bower.json"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="289"> <caret line="17" column="4" lean-forward="true" selection-start-line="17" selection-start-column="4" selection-end-line="17" selection-end-column="4" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/CHANGELOG.md"> <provider editor-type-id="text-editor"> <state relative-caret-position="30"> <caret line="2" column="0" lean-forward="false" selection-start-line="2" selection-start-column="0" selection-end-line="4" selection-end-column="57" /> </state> </provider> <provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]"> <state split_layout="FIRST"> <first_editor relative-caret-position="51"> <caret line="3" column="48" lean-forward="false" selection-start-line="3" selection-start-column="48" selection-end-line="3" selection-end-column="48" /> <folding /> </first_editor> <second_editor> <js_state /> </second_editor> </state> </provider> </entry> </component> </project>
{ "content_hash": "48bfd0afc4be3ba6e8f4ad4260ea9b03", "timestamp": "", "source": "github", "line_count": 800, "max_line_length": 281, "avg_line_length": 51.11375, "alnum_prop": 0.6297962876916681, "repo_name": "alexburner/spectrogram.party", "id": "3ea4c6c181691c4af2be7097fab2993ebba030a3", "size": "40891", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "node_modules/bowser/.idea/workspace.xml", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4100" }, { "name": "HTML", "bytes": "690" }, { "name": "JavaScript", "bytes": "2017" }, { "name": "TypeScript", "bytes": "32196" } ], "symlink_target": "" }
"""Tests for perfkitbenchmarker.publisher.""" import collections import csv import io import json import re import tempfile import uuid import unittest import mock from perfkitbenchmarker import publisher from perfkitbenchmarker import sample from perfkitbenchmarker import vm_util class PrettyPrintStreamPublisherTestCase(unittest.TestCase): def testDefaultsToStdout(self): with mock.patch('sys.stdout') as mock_stdout: instance = publisher.PrettyPrintStreamPublisher() self.assertEqual(mock_stdout, instance.stream) def testSucceedsWithNoSamples(self): stream = io.BytesIO() instance = publisher.PrettyPrintStreamPublisher(stream) instance.PublishSamples([]) self.assertRegexpMatches( stream.getvalue(), r'^\s*-+PerfKitBenchmarker\sResults\sSummary-+\s*$') def testWritesToStream(self): stream = io.BytesIO() instance = publisher.PrettyPrintStreamPublisher(stream) samples = [{'test': 'testb', 'metric': '1', 'value': 1.0, 'unit': 'MB', 'metadata': {}}, {'test': 'testb', 'metric': '2', 'value': 14.0, 'unit': 'MB', 'metadata': {}}, {'test': 'testa', 'metric': '3', 'value': 47.0, 'unit': 'us', 'metadata': {}}] instance.PublishSamples(samples) value = stream.getvalue() self.assertRegexpMatches(value, re.compile(r'TESTA.*TESTB', re.DOTALL)) class LogPublisherTestCase(unittest.TestCase): def testCallsLoggerAtCorrectLevel(self): logger = mock.MagicMock() level = mock.MagicMock() instance = publisher.LogPublisher(logger=logger, level=level) instance.PublishSamples([{'test': 'testa'}, {'test': 'testb'}]) logger.log.assert_called_once_with(level, mock.ANY) class NewlineDelimitedJSONPublisherTestCase(unittest.TestCase): def setUp(self): self.fp = tempfile.NamedTemporaryFile(prefix='perfkit-test-', suffix='.json') self.addCleanup(self.fp.close) self.instance = publisher.NewlineDelimitedJSONPublisher(self.fp.name) def testEmptyInput(self): self.instance.PublishSamples([]) self.assertEqual('', self.fp.read()) def testMetadataConvertedToLabels(self): samples = [{'test': 'testa', 'metadata': collections.OrderedDict([('key', 'value'), ('foo', 'bar')])}] self.instance.PublishSamples(samples) d = json.load(self.fp) self.assertDictEqual({'test': 'testa', 'labels': '|key:value|,|foo:bar|'}, d) def testJSONRecordPerLine(self): samples = [{'test': 'testa', 'metadata': {'key': 'val'}}, {'test': 'testb', 'metadata': {'key2': 'val2'}}] self.instance.PublishSamples(samples) self.assertRaises(ValueError, json.load, self.fp) self.fp.seek(0) result = [json.loads(i) for i in self.fp] self.assertListEqual([{u'test': u'testa', u'labels': u'|key:val|'}, {u'test': u'testb', u'labels': u'|key2:val2|'}], result) class BigQueryPublisherTestCase(unittest.TestCase): def setUp(self): p = mock.patch(publisher.__name__ + '.vm_util', spec=publisher.vm_util) self.mock_vm_util = p.start() publisher.vm_util.NamedTemporaryFile = vm_util.NamedTemporaryFile self.mock_vm_util.GetTempDir.return_value = tempfile.gettempdir() self.addCleanup(p.stop) self.samples = [{'test': 'testa', 'metadata': {}}, {'test': 'testb', 'metadata': {}}] self.table = 'samples_mart.results' def testNoSamples(self): instance = publisher.BigQueryPublisher(self.table) instance.PublishSamples([]) self.assertEqual([], self.mock_vm_util.IssueRetryableCommand.mock_calls) def testNoProject(self): instance = publisher.BigQueryPublisher(self.table) instance.PublishSamples(self.samples) self.mock_vm_util.IssueRetryableCommand.assert_called_once_with( ['bq', 'load', '--source_format=NEWLINE_DELIMITED_JSON', self.table, mock.ANY]) def testServiceAccountFlags_MissingPrivateKey(self): self.assertRaises(ValueError, publisher.BigQueryPublisher, self.table, service_account=mock.MagicMock()) def testServiceAccountFlags_MissingServiceAccount(self): self.assertRaises(ValueError, publisher.BigQueryPublisher, self.table, service_account_private_key_file=mock.MagicMock()) def testServiceAccountFlags_BothSpecified(self): instance = publisher.BigQueryPublisher( self.table, service_account=mock.MagicMock(), service_account_private_key_file=mock.MagicMock()) instance.PublishSamples(self.samples) # No error self.mock_vm_util.IssueRetryableCommand.assert_called_once_with(mock.ANY) class CloudStoragePublisherTestCase(unittest.TestCase): def setUp(self): p = mock.patch(publisher.__name__ + '.vm_util', spec=publisher.vm_util) self.mock_vm_util = p.start() publisher.vm_util.NamedTemporaryFile = vm_util.NamedTemporaryFile self.mock_vm_util.GetTempDir.return_value = tempfile.gettempdir() self.addCleanup(p.stop) p = mock.patch(publisher.__name__ + '.time', spec=publisher.time) self.mock_time = p.start() self.addCleanup(p.stop) p = mock.patch(publisher.__name__ + '.uuid', spec=publisher.uuid) self.mock_uuid = p.start() self.addCleanup(p.stop) self.samples = [{'test': 'testa', 'metadata': {}}, {'test': 'testb', 'metadata': {}}] def testPublishSamples(self): self.mock_time.time.return_value = 1417647763.387665 self.mock_uuid.uuid4.return_value = uuid.UUID( 'be428eb3-a54a-4615-b7ca-f962b729c7ab') instance = publisher.CloudStoragePublisher('test-bucket') instance.PublishSamples(self.samples) self.mock_vm_util.IssueRetryableCommand.assert_called_once_with( ['gsutil', 'cp', mock.ANY, 'gs://test-bucket/141764776338_be428eb']) class SampleCollectorTestCase(unittest.TestCase): def setUp(self): self.instance = publisher.SampleCollector(publishers=[]) self.sample = sample.Sample('widgets', 100, 'oz', {'foo': 'bar'}) self.benchmark = 'test!' self.benchmark_spec = mock.MagicMock() p = mock.patch(publisher.__name__ + '.FLAGS') self.mock_flags = p.start() self.addCleanup(p.stop) self.mock_flags.product_name = 'PerfKitBenchmarker' def _VerifyResult(self, contains_metadata=True): self.assertEqual(1, len(self.instance.samples)) collector_sample = self.instance.samples[0] metadata = collector_sample.pop('metadata') self.assertDictContainsSubset( { 'value': 100, 'metric': 'widgets', 'unit': 'oz', 'test': self.benchmark, 'product_name': 'PerfKitBenchmarker' }, collector_sample) if contains_metadata: self.assertDictContainsSubset({'foo': 'bar'}, metadata) else: self.assertNotIn('foo', metadata) def testAddSamples_SampleClass(self): samples = [self.sample] self.instance.AddSamples(samples, self.benchmark, self.benchmark_spec) self._VerifyResult() def testAddSamples_WithTimestamp(self): timestamp_sample = sample.Sample('widgets', 100, 'oz', {}, 1.0) samples = [timestamp_sample] self.instance.AddSamples(samples, self.benchmark, self.benchmark_spec) self.assertDictContainsSubset( { 'timestamp': 1.0 }, self.instance.samples[0]) class DefaultMetadataProviderTestCase(unittest.TestCase): def setUp(self): p = mock.patch(publisher.__name__ + '.FLAGS') self.mock_flags = p.start() self.mock_flags.configure_mock(metadata=[], num_striped_disks=1) self.addCleanup(p.stop) self.maxDiff = None p = mock.patch(publisher.__name__ + '.version', VERSION='v1') p.start() self.addCleanup(p.stop) # Need iops=None in self.mock_disk because otherwise doing # mock_disk.iops returns a mock.MagicMock, which is not None, # which defeats the getattr check in # publisher.DefaultMetadataProvider. self.mock_disk = mock.MagicMock(disk_size=20, num_striped_disks=1, iops=None) self.mock_vm = mock.MagicMock(CLOUD='GCP', zone='us-central1-a', machine_type='n1-standard-1', image='ubuntu-14-04', scratch_disks=[], hostname='Hostname') self.mock_vm.GetMachineTypeDict.return_value = { 'machine_type': self.mock_vm.machine_type} self.mock_spec = mock.MagicMock(vm_groups={'default': [self.mock_vm]}, vms=[self.mock_vm]) self.default_meta = {'perfkitbenchmarker_version': 'v1', 'cloud': self.mock_vm.CLOUD, 'zone': 'us-central1-a', 'machine_type': self.mock_vm.machine_type, 'image': self.mock_vm.image, 'vm_count': 1, 'num_striped_disks': 1, 'hostnames': 'Hostname'} def _RunTest(self, spec, expected, input_metadata=None): input_metadata = input_metadata or {} instance = publisher.DefaultMetadataProvider() result = instance.AddMetadata(input_metadata, self.mock_spec) self.assertIsNot(input_metadata, result, msg='Input metadata was not copied.') self.assertDictEqual(expected, result) def testAddMetadata_ScratchDiskUndefined(self): del self.mock_spec.scratch_disk meta = self.default_meta.copy() meta.pop('num_striped_disks') self._RunTest(self.mock_spec, meta) def testAddMetadata_NoScratchDisk(self): self.mock_spec.scratch_disk = False meta = self.default_meta.copy() meta.pop('num_striped_disks') self._RunTest(self.mock_spec, meta) def testAddMetadata_WithScratchDisk(self): self.mock_disk.configure_mock(disk_type='disk-type') self.mock_vm.configure_mock(scratch_disks=[self.mock_disk]) expected = self.default_meta.copy() expected.update(scratch_disk_size=20, scratch_disk_type='disk-type', data_disk_0_size=20, data_disk_0_type='disk-type', data_disk_0_num_stripes=1) self._RunTest(self.mock_spec, expected) def testAddMetadata_DiskSizeNone(self): # This situation can happen with static VMs self.mock_disk.configure_mock(disk_type='disk-type', disk_size=None) self.mock_vm.configure_mock(scratch_disks=[self.mock_disk]) expected = self.default_meta.copy() expected.update(scratch_disk_size=None, scratch_disk_type='disk-type', data_disk_0_size=None, data_disk_0_type='disk-type', data_disk_0_num_stripes=1) self._RunTest(self.mock_spec, expected) def testAddMetadata_PIOPS(self): self.mock_disk.configure_mock(disk_type='disk-type', iops=1000) self.mock_vm.configure_mock(scratch_disks=[self.mock_disk]) expected = self.default_meta.copy() expected.update(scratch_disk_size=20, scratch_disk_type='disk-type', scratch_disk_iops=1000, data_disk_0_size=20, data_disk_0_type='disk-type', data_disk_0_num_stripes=1, aws_provisioned_iops=1000) self._RunTest(self.mock_spec, expected) def testDiskMetadata(self): self.mock_disk.configure_mock(disk_type='disk-type', metadata={'foo': 'bar'}) self.mock_vm.configure_mock(scratch_disks=[self.mock_disk]) expected = self.default_meta.copy() expected.update(scratch_disk_size=20, scratch_disk_type='disk-type', data_disk_0_size=20, data_disk_0_type='disk-type', data_disk_0_num_stripes=1, data_disk_0_foo='bar') self._RunTest(self.mock_spec, expected) def testDiskLegacyDiskType(self): self.mock_disk.configure_mock(disk_type='disk-type', metadata={'foo': 'bar', 'legacy_disk_type': 'remote_ssd'}) self.mock_vm.configure_mock(scratch_disks=[self.mock_disk]) expected = self.default_meta.copy() expected.update(scratch_disk_size=20, scratch_disk_type='remote_ssd', data_disk_0_size=20, data_disk_0_type='disk-type', data_disk_0_num_stripes=1, data_disk_0_foo='bar', data_disk_0_legacy_disk_type='remote_ssd') self._RunTest(self.mock_spec, expected) class CSVPublisherTestCase(unittest.TestCase): def setUp(self): self.tf = tempfile.NamedTemporaryFile(prefix='perfkit-csv-publisher', suffix='.csv') self.addCleanup(self.tf.close) def testWritesToStream(self): instance = publisher.CSVPublisher(self.tf.name) samples = [{'test': 'testb', 'metric': '1', 'value': 1.0, 'unit': 'MB', 'metadata': {}}, {'test': 'testb', 'metric': '2', 'value': 14.0, 'unit': 'MB', 'metadata': {}}, {'test': 'testa', 'metric': '3', 'value': 47.0, 'unit': 'us', 'metadata': {}}] instance.PublishSamples(samples) self.tf.seek(0) rows = list(csv.DictReader(self.tf)) self.assertItemsEqual(['1', '2', '3'], [i['metric'] for i in rows]) def testUsesUnionOfMetaKeys(self): instance = publisher.CSVPublisher(self.tf.name) samples = [{'test': 'testb', 'metric': '1', 'value': 1.0, 'unit': 'MB', 'metadata': {'key1': 'value1'}}, {'test': 'testb', 'metric': '2', 'value': 14.0, 'unit': 'MB', 'metadata': {'key1': 'value2'}}, {'test': 'testa', 'metric': '3', 'value': 47.0, 'unit': 'us', 'metadata': {'key3': 'value3'}}] instance.PublishSamples(samples) self.tf.seek(0) reader = csv.DictReader(self.tf) rows = list(reader) self.assertEqual(['key1', 'key3'], reader.fieldnames[-2:]) self.assertEqual(3, len(rows))
{ "content_hash": "904ea0e7676915553b96158e9e335f60", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 79, "avg_line_length": 38.261780104712045, "alnum_prop": 0.601464148877942, "repo_name": "xiaolihope/PerfKitBenchmarker-1.7.0", "id": "0a7ddc8850915e22116047822632dc3c09de8509", "size": "15226", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/publisher_test.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Lua", "bytes": "1547" }, { "name": "Python", "bytes": "1727478" }, { "name": "Shell", "bytes": "23457" } ], "symlink_target": "" }
package org.apache.phoenix.end2end; import org.apache.phoenix.thirdparty.com.google.common.base.Joiner; import org.apache.phoenix.thirdparty.com.google.common.base.Throwables; import org.apache.phoenix.thirdparty.com.google.common.collect.Lists; import org.apache.phoenix.thirdparty.com.google.common.collect.Maps; import com.google.protobuf.RpcCallback; import com.google.protobuf.RpcController; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.AuthUtil; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.LocalHBaseCluster; import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.Predicate; import org.apache.hadoop.hbase.client.ConnectionFactory; import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.security.AccessDeniedException; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.security.access.AccessControlClient; import org.apache.hadoop.hbase.security.access.AccessControlUtil; import org.apache.hadoop.hbase.security.access.AccessController; import org.apache.hadoop.hbase.security.access.Permission; import org.apache.hadoop.hbase.security.access.UserPermission; import org.apache.hadoop.hbase.shaded.protobuf.ResponseConverter; import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread; import org.apache.phoenix.coprocessor.MetaDataProtocol; import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData; import org.apache.phoenix.jdbc.PhoenixStatement; import org.apache.phoenix.query.BaseTest; import org.apache.phoenix.query.QueryConstants; import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.schema.NewerSchemaAlreadyExistsException; import org.apache.phoenix.schema.TableNotFoundException; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.SchemaUtil; import org.junit.Before; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.lang.reflect.UndeclaredThrowableException; import java.security.PrivilegedExceptionAction; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.concurrent.Callable; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public abstract class BasePermissionsIT extends BaseTest { private static final Logger LOGGER = LoggerFactory.getLogger(BasePermissionsIT.class); private static final int WAIT_TIME = 10000; private static final String SUPER_USER = System.getProperty("user.name"); static HBaseTestingUtility testUtil; private static final Set<String> PHOENIX_SYSTEM_TABLES = new HashSet<>(Arrays.asList("SYSTEM.CATALOG", "SYSTEM.SEQUENCE", "SYSTEM.STATS", "SYSTEM.FUNCTION", "SYSTEM.MUTEX", "SYSTEM.CHILD_LINK", "SYSTEM.TRANSFORM")); private static final Set<String> PHOENIX_SYSTEM_TABLES_IDENTIFIERS = new HashSet<>(Arrays.asList("SYSTEM.\"CATALOG\"", "SYSTEM.\"SEQUENCE\"", "SYSTEM.\"STATS\"", "SYSTEM.\"FUNCTION\"", "SYSTEM.\"MUTEX\"", "SYSTEM.\"CHILD_LINK\"", "SYSTEM.\"TRANSFORM\"")); private static final String SYSTEM_SEQUENCE_IDENTIFIER = QueryConstants.SYSTEM_SCHEMA_NAME + "." + "\"" + PhoenixDatabaseMetaData.SYSTEM_SEQUENCE_TABLE+ "\""; private static final String SYSTEM_MUTEX_IDENTIFIER = QueryConstants.SYSTEM_SCHEMA_NAME + "." + "\"" + PhoenixDatabaseMetaData.SYSTEM_MUTEX_TABLE_NAME + "\""; static final Set<String> PHOENIX_NAMESPACE_MAPPED_SYSTEM_TABLES = new HashSet<>(Arrays.asList( "SYSTEM:CATALOG", "SYSTEM:SEQUENCE", "SYSTEM:STATS", "SYSTEM:FUNCTION", "SYSTEM:MUTEX", "SYSTEM:CHILD_LINK","SYSTEM:TRANSFORM")); // Create Multiple users so that we can use Hadoop UGI to run tasks as various users // Permissions can be granted or revoke by superusers and admins only // DON'T USE HADOOP UserGroupInformation class to create testing users since HBase misses some of its functionality // Instead use org.apache.hadoop.hbase.security.User class for testing purposes. // Super User has all the access protected static User superUser1 = null; protected static User superUser2 = null; // Regular users are granted and revoked permissions as needed protected User regularUser1 = null; protected User regularUser2 = null; protected User regularUser3 = null; protected User regularUser4 = null; // Group User is equivalent of regular user but inside a group // Permissions can be granted to group should affect this user static final String GROUP_SYSTEM_ACCESS = "group_system_access"; private User groupUser = null; // Unpriviledged User doesn't have any access and is denied for every action User unprivilegedUser = null; private static final int NUM_RECORDS = 5; boolean isNamespaceMapped; private String schemaName; private String tableName; private String fullTableName; private String idx1TableName; private String idx2TableName; private String idx3TableName; private String localIdx1TableName; private String view1TableName; private String view2TableName; BasePermissionsIT(final boolean isNamespaceMapped) throws Exception { this.isNamespaceMapped = isNamespaceMapped; this.tableName = generateUniqueName(); } static void initCluster(boolean isNamespaceMapped) throws Exception { initCluster(isNamespaceMapped, false); } static void initCluster(boolean isNamespaceMapped, boolean useCustomAccessController) throws Exception { if (null != testUtil) { testUtil.shutdownMiniCluster(); testUtil = null; } testUtil = new HBaseTestingUtility(); Configuration config = testUtil.getConfiguration(); enablePhoenixHBaseAuthorization(config, useCustomAccessController); configureNamespacesOnServer(config, isNamespaceMapped); configureStatsConfigurations(config); config.setBoolean(LocalHBaseCluster.ASSIGN_RANDOM_PORTS, true); testUtil.startMiniCluster(1); superUser1 = User.createUserForTesting(config, SUPER_USER, new String[0]); superUser2 = User.createUserForTesting(config, "superUser2", new String[0]); } @Before public void initUsersAndTables() { Configuration configuration = testUtil.getConfiguration(); regularUser1 = User.createUserForTesting(configuration, "regularUser1_" + generateUniqueName(), new String[0]); regularUser2 = User.createUserForTesting(configuration, "regularUser2_" + generateUniqueName(), new String[0]); regularUser3 = User.createUserForTesting(configuration, "regularUser3_" + generateUniqueName(), new String[0]); regularUser4 = User.createUserForTesting(configuration, "regularUser4_" + generateUniqueName(), new String[0]); groupUser = User.createUserForTesting(testUtil.getConfiguration(), "groupUser_" + generateUniqueName() , new String[] {GROUP_SYSTEM_ACCESS}); unprivilegedUser = User.createUserForTesting(configuration, "unprivilegedUser_" + generateUniqueName(), new String[0]); schemaName = generateUniqueName(); tableName = generateUniqueName(); fullTableName = schemaName + "." + tableName; idx1TableName = tableName + "_IDX1"; idx2TableName = tableName + "_IDX2"; idx3TableName = tableName + "_IDX3"; localIdx1TableName = tableName + "_LIDX1"; view1TableName = tableName + "_V1"; view2TableName = tableName + "_V2"; } private static void enablePhoenixHBaseAuthorization(Configuration config, boolean useCustomAccessController) { config.set("hbase.superuser", SUPER_USER + "," + "superUser2"); config.set("hbase.security.authorization", Boolean.TRUE.toString()); config.set("hbase.security.exec.permission.checks", Boolean.TRUE.toString()); if(useCustomAccessController) { config.set("hbase.coprocessor.master.classes", CustomAccessController.class.getName()); config.set("hbase.coprocessor.region.classes", CustomAccessController.class.getName()); config.set("hbase.coprocessor.regionserver.classes", CustomAccessController.class.getName()); } else { config.set("hbase.coprocessor.master.classes", "org.apache.hadoop.hbase.security.access.AccessController"); config.set("hbase.coprocessor.region.classes", "org.apache.hadoop.hbase.security.access.AccessController"); config.set("hbase.coprocessor.regionserver.classes", "org.apache.hadoop.hbase.security.access.AccessController"); } config.set(QueryServices.PHOENIX_ACLS_ENABLED,"true"); config.set("hbase.regionserver.wal.codec", "org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec"); } private static void configureNamespacesOnServer(Configuration conf, boolean isNamespaceMapped) { conf.set(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, Boolean.toString(isNamespaceMapped)); } private static void configureStatsConfigurations(Configuration conf) { conf.set(QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, Long.toString(20)); conf.set(QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, Long.toString(5)); conf.set(QueryServices.MAX_SERVER_METADATA_CACHE_TIME_TO_LIVE_MS_ATTRIB, Long.toString(5)); conf.set(QueryServices.USE_STATS_FOR_PARALLELIZATION, Boolean.toString(true)); } public static HBaseTestingUtility getUtility(){ return testUtil; } // Utility functions to grant permissions with HBase API void grantPermissions(String toUser, Set<String> tablesToGrant, Permission.Action... actions) throws Throwable { updateACLs(getUtility(), new Callable<Void>() { @Override public Void call() throws Exception { try { for (String table : tablesToGrant) { AccessControlClient.grant(getUtility().getConnection(), TableName.valueOf(table), toUser, null, null, actions); } return null; } catch (Throwable t) { if (t instanceof Exception) { throw (Exception) t; } else { throw new Exception(t); } } } }); } void grantPermissions(String toUser, String namespace, Permission.Action... actions) throws Throwable { updateACLs(getUtility(), new Callable<Void>() { @Override public Void call() throws Exception { try { AccessControlClient.grant(getUtility().getConnection(), namespace, toUser, actions); return null; } catch (Throwable t) { if (t instanceof Exception) { throw (Exception) t; } else { throw new Exception(t); } } } }); } void grantPermissions(String groupEntry, Permission.Action... actions) throws Throwable { updateACLs(getUtility(), new Callable<Void>() { @Override public Void call() throws Exception { try { AccessControlClient.grant(getUtility().getConnection(), groupEntry, actions); return null; } catch (Throwable t) { if (t instanceof Exception) { throw (Exception) t; } else { throw new Exception(t); } } } }); } void revokePermissions(String toUser, Set<String> tablesToGrant, Permission.Action... actions) throws Throwable { updateACLs(getUtility(), new Callable<Void>() { @Override public Void call() throws Exception { try { for (String table : tablesToGrant) { AccessControlClient.revoke(getUtility().getConnection(), TableName.valueOf(table), toUser, null, null, actions); } return null; } catch (Throwable t) { if (t instanceof Exception) { throw (Exception) t; } else { throw new Exception(t); } } } }); } private Properties getClientProperties(String tenantId) { Properties props = new Properties(); if(tenantId != null) { props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); } props.setProperty(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, Boolean.toString(isNamespaceMapped)); return props; } public Connection getConnection() throws SQLException { return getConnection(null); } public Connection getConnection(String tenantId) throws SQLException { return DriverManager.getConnection(getUrl(), getClientProperties(tenantId)); } protected static String getUrl() { return "jdbc:phoenix:localhost:" + testUtil.getZkCluster().getClientPort() + ":/hbase"; } private static Set<String> getHBaseTables() throws IOException { Set<String> tables = new HashSet<>(); for (TableName tn : testUtil.getHBaseAdmin().listTableNames()) { tables.add(tn.getNameAsString()); } return tables; } // UG Object // 1. Instance of String --> represents GROUP name // 2. Instance of User --> represents HBase user AccessTestAction grantPermissions(final String actions, final Object ug, final String tableOrSchemaList, final boolean isSchema) throws SQLException { return grantPermissions(actions, ug, Collections.singleton(tableOrSchemaList), isSchema); } private AccessTestAction grantPermissions(final String actions, final Object ug, final Set<String> tableOrSchemaList, final boolean isSchema) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { BasePermissionsIT.updateACLs(getUtility(), new Callable<Void>() { @Override public Void call() throws Exception { try { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { for(String tableOrSchema : tableOrSchemaList) { String grantStmtSQL = "GRANT '" + actions + "' ON " + (isSchema ? " SCHEMA " : " TABLE ") + tableOrSchema + " TO " + ((ug instanceof String) ? (" GROUP " + "'" + ug + "'") : ("'" + ((User)ug).getShortName() + "'")); LOGGER.info("Grant Permissions SQL: " + grantStmtSQL); assertFalse(stmt.execute(grantStmtSQL)); } } return null; } catch (Throwable t) { if (t instanceof Exception) { throw (Exception) t; } else { throw new Exception(t); } } } }); return null; } }; } private AccessTestAction grantPermissions(final String actions, final User user) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { BasePermissionsIT.updateACLs(getUtility(), new Callable<Void>() { @Override public Void call() throws Exception { try { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { String grantStmtSQL = "GRANT '" + actions + "' TO " + " '" + user.getShortName() + "'"; LOGGER.info("Grant Permissions SQL: " + grantStmtSQL); assertFalse(stmt.execute(grantStmtSQL)); } return null; } catch (Throwable t) { if (t instanceof Exception) { throw (Exception) t; } else { throw new Exception(t); } } } }); return null; } }; } private AccessTestAction revokePermissions(final Object ug, final String tableOrSchemaList, final boolean isSchema) throws SQLException { return revokePermissions(ug, Collections.singleton(tableOrSchemaList), isSchema); } private AccessTestAction revokePermissions(final Object ug, final Set<String> tableOrSchemaList, final boolean isSchema) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { BasePermissionsIT.updateACLs(getUtility(), new Callable<Void>() { @Override public Void call() throws Exception { try { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { for(String tableOrSchema : tableOrSchemaList) { String revokeStmtSQL = "REVOKE ON " + (isSchema ? " SCHEMA " : " TABLE ") + tableOrSchema + " FROM " + ((ug instanceof String) ? (" GROUP " + "'" + ug + "'") : ("'" + ((User)ug).getShortName() + "'")); LOGGER.info("Revoke Permissions SQL: " + revokeStmtSQL); assertFalse(stmt.execute(revokeStmtSQL)); } } return null; } catch (Throwable t) { if (t instanceof Exception) { throw (Exception) t; } else { throw new Exception(t); } } } }); return null; } }; } private AccessTestAction revokePermissions(final Object ug) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { BasePermissionsIT.updateACLs(getUtility(), new Callable<Void>() { @Override public Void call() throws Exception { try { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { String revokeStmtSQL = "REVOKE FROM " + ((ug instanceof String) ? (" GROUP " + "'" + ug + "'") : ("'" + ((User)ug).getShortName() + "'")); LOGGER.info("Revoke Permissions SQL: " + revokeStmtSQL); assertFalse(stmt.execute(revokeStmtSQL)); } return null; } catch (Throwable t) { if (t instanceof Exception) { throw (Exception) t; } else { throw new Exception(t); } } } }); return null; } }; } // Attempts to get a Phoenix Connection // New connections could create SYSTEM tables if appropriate perms are granted private AccessTestAction getConnectionAction() throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection();) { } return null; } }; } AccessTestAction createSchema(final String schemaName) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { if (isNamespaceMapped) { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { assertFalse(stmt.execute("CREATE SCHEMA " + schemaName)); } } return null; } }; } AccessTestAction dropSchema(final String schemaName) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { if (isNamespaceMapped) { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { assertFalse(stmt.execute("DROP SCHEMA " + schemaName)); } } return null; } }; } AccessTestAction createTable(final String tableName) throws SQLException { return createTable(tableName, NUM_RECORDS); } AccessTestAction createTable(final String tableName, int numRecordsToInsert) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { assertFalse(stmt.execute("CREATE TABLE " + tableName + "(pk INTEGER not null primary key, data VARCHAR, val integer)")); try (PreparedStatement pstmt = conn.prepareStatement("UPSERT INTO " + tableName + " values(?, ?, ?)")) { for (int i = 0; i < numRecordsToInsert; i++) { pstmt.setInt(1, i); pstmt.setString(2, Integer.toString(i)); pstmt.setInt(3, i); assertEquals(1, pstmt.executeUpdate()); } } conn.commit(); } return null; } }; } AccessTestAction updateStatsOnTable(final String tableName) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { assertFalse(stmt.execute("UPDATE STATISTICS " + tableName + " SET \"" + QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB + "\" = 5")); } return null; } }; } private AccessTestAction createMultiTenantTable(final String tableName) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { assertFalse(stmt.execute("CREATE TABLE " + tableName + "(ORG_ID VARCHAR NOT NULL, PREFIX CHAR(3) NOT NULL, DATA VARCHAR, VAL INTEGER CONSTRAINT PK PRIMARY KEY (ORG_ID, PREFIX)) MULTI_TENANT=TRUE")); try (PreparedStatement pstmt = conn.prepareStatement("UPSERT INTO " + tableName + " values(?, ?, ?, ?)")) { for (int i = 0; i < NUM_RECORDS; i++) { pstmt.setString(1, "o" + i); pstmt.setString(2, "pr" + i); pstmt.setString(3, Integer.toString(i)); pstmt.setInt(4, i); assertEquals(1, pstmt.executeUpdate()); } } conn.commit(); } return null; } }; } private AccessTestAction dropTable(final String tableName) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { assertFalse(stmt.execute(String.format("DROP TABLE IF EXISTS %s CASCADE", tableName))); } return null; } }; } private AccessTestAction deleteDataFromStatsTable() throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { conn.setAutoCommit(true); assertNotEquals(0, stmt.executeUpdate("DELETE FROM SYSTEM.STATS")); } return null; } }; } private AccessTestAction readStatsAfterTableDelete(String physicalTableName) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { conn.setAutoCommit(true); ResultSet rs = stmt.executeQuery("SELECT count(*) from SYSTEM.STATS" + " WHERE PHYSICAL_NAME = '"+ physicalTableName +"'"); rs.next(); assertEquals(0, rs.getInt(1)); } return null; } }; } // Attempts to read given table without verifying data // AccessDeniedException is only triggered when ResultSet#next() method is called // The first call triggers HBase Scan object // The Statement#executeQuery() method returns an iterator and doesn't interact with HBase API at all private AccessTestAction readTableWithoutVerification(final String tableName) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement()) { ResultSet rs = stmt.executeQuery("SELECT * FROM " + tableName); assertNotNull(rs); while (rs.next()) { } } return null; } }; } private AccessTestAction readTable(final String tableName) throws SQLException { return readTable(tableName,null); } private AccessTestAction readTable(final String tableName, final String indexName) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement()) { String readTableSQL = "SELECT "+(indexName!=null?"/*+ INDEX("+tableName+" "+indexName+")*/":"")+" pk, data, val FROM " + tableName +" where data >= '0'"; ResultSet rs = stmt.executeQuery(readTableSQL); assertNotNull(rs); int i = 0; while (rs.next()) { assertEquals(i, rs.getInt(1)); assertEquals(Integer.toString(i), rs.getString(2)); assertEquals(i, rs.getInt(3)); i++; } assertEquals(NUM_RECORDS, i); } return null; } }; } private AccessTestAction readMultiTenantTableWithoutIndex(final String tableName) throws SQLException { return readMultiTenantTableWithoutIndex(tableName, null); } private AccessTestAction readMultiTenantTableWithoutIndex(final String tableName, final String tenantId) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(tenantId); Statement stmt = conn.createStatement()) { // Accessing all the data from the table avoids the use of index String readTableSQL = "SELECT data, val FROM " + tableName; ResultSet rs = stmt.executeQuery(readTableSQL); assertNotNull(rs); int i = 0; String explainPlan = Joiner.on(" ").join(((PhoenixStatement)stmt).getQueryPlan().getExplainPlan().getPlanSteps()); rs = stmt.executeQuery(readTableSQL); if(tenantId != null) { rs.next(); assertFalse(explainPlan.contains("_IDX_")); assertEquals(((PhoenixConnection)conn).getTenantId().toString(), tenantId); // For tenant ID "o3", the value in table will be 3 assertEquals(Character.toString(tenantId.charAt(1)), rs.getString(1)); // Only 1 record is inserted per Tenant assertFalse(rs.next()); } else { while(rs.next()) { assertEquals(Integer.toString(i), rs.getString(1)); assertEquals(i, rs.getInt(2)); i++; } assertEquals(NUM_RECORDS, i); } } return null; } }; } private AccessTestAction readMultiTenantTableWithIndex(final String tableName) throws SQLException { return readMultiTenantTableWithIndex(tableName, null); } private AccessTestAction readMultiTenantTableWithIndex(final String tableName, final String tenantId) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(tenantId); Statement stmt = conn.createStatement()) { // Accessing only the 'data' from the table uses index since index tables are built on 'data' column String readTableSQL = "SELECT data FROM " + tableName; ResultSet rs = stmt.executeQuery(readTableSQL); assertNotNull(rs); int i = 0; String explainPlan = Joiner.on(" ").join(((PhoenixStatement) stmt).getQueryPlan().getExplainPlan().getPlanSteps()); assertTrue(explainPlan.contains("_IDX_")); rs = stmt.executeQuery(readTableSQL); if (tenantId != null) { rs.next(); assertEquals(((PhoenixConnection) conn).getTenantId().toString(), tenantId); // For tenant ID "o3", the value in table will be 3 assertEquals(Character.toString(tenantId.charAt(1)), rs.getString(1)); // Only 1 record is inserted per Tenant assertFalse(rs.next()); } else { while (rs.next()) { assertEquals(Integer.toString(i), rs.getString(1)); i++; } assertEquals(NUM_RECORDS, i); } } return null; } }; } private AccessTestAction addProperties(final String tableName, final String property, final String value) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { assertFalse(stmt.execute("ALTER TABLE " + tableName + " SET " + property + "=" + value)); } return null; } }; } AccessTestAction addColumn(final String tableName, final String columnName) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { assertFalse(stmt.execute("ALTER TABLE " + tableName + " ADD "+columnName+" varchar")); } return null; } }; } private AccessTestAction dropColumn(final String tableName, final String columnName) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { assertFalse(stmt.execute("ALTER TABLE " + tableName + " DROP COLUMN "+columnName)); } return null; } }; } private AccessTestAction createIndex(final String indexName, final String dataTable) throws SQLException { return createIndex(indexName, dataTable, null); } private AccessTestAction createIndex(final String indexName, final String dataTable, final String tenantId) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(tenantId); Statement stmt = conn.createStatement();) { assertFalse(stmt.execute("CREATE INDEX " + indexName + " on " + dataTable + "(data)")); } return null; } }; } private AccessTestAction createLocalIndex(final String indexName, final String dataTable) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { assertFalse(stmt.execute("CREATE LOCAL INDEX " + indexName + " on " + dataTable + "(data)")); } return null; } }; } private AccessTestAction dropIndex(final String indexName, final String dataTable) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { assertFalse(stmt.execute("DROP INDEX " + indexName + " on " + dataTable)); } return null; } }; } private AccessTestAction rebuildIndex(final String indexName, final String dataTable) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { assertFalse(stmt.execute("ALTER INDEX " + indexName + " on " + dataTable + " DISABLE")); assertFalse(stmt.execute("ALTER INDEX " + indexName + " on " + dataTable + " REBUILD")); } return null; } }; } private AccessTestAction dropView(final String viewName) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { assertFalse(stmt.execute(String.format("DROP VIEW %s CASCADE", viewName))); } return null; } }; } AccessTestAction createView(final String viewName, final String dataTable) throws SQLException { return createView(viewName, dataTable, null); } private AccessTestAction createView(final String viewName, final String dataTable, final String tenantId) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(tenantId); Statement stmt = conn.createStatement();) { String viewStmtSQL = "CREATE VIEW " + viewName + " AS SELECT * FROM " + dataTable; assertFalse(stmt.execute(viewStmtSQL)); } return null; } }; } interface AccessTestAction extends PrivilegedExceptionAction<Object> { } /** This fails only in case of ADE or empty list for any of the users. */ void verifyAllowed(AccessTestAction action, User... users) throws Exception { if(users.length == 0) { throw new Exception("Action needs at least one user to run"); } for (User user : users) { verifyAllowed(user, action); } } private void verifyAllowed(User user, AccessTestAction... actions) throws Exception { for (AccessTestAction action : actions) { try { Object obj = user.runAs(action); if (obj != null && obj instanceof List<?>) { List<?> results = (List<?>) obj; if (results.isEmpty()) { fail("Empty non null results from action for user '" + user.getShortName() + "'"); } } } catch (AccessDeniedException ade) { fail("Expected action to pass for user '" + user.getShortName() + "' but was denied"); } } } /** This passes only if desired exception is caught for all users. */ <T> void verifyDenied(AccessTestAction action, Class<T> exception, User... users) throws Exception { if(users.length == 0) { throw new Exception("Action needs at least one user to run"); } for (User user : users) { verifyDenied(user, exception, action); } } /** This passes only if desired exception is caught for all users. */ private <T> void verifyDenied(User user, Class<T> exception, AccessTestAction... actions) throws Exception { for (AccessTestAction action : actions) { try { user.runAs(action); fail("Expected exception was not thrown for user '" + user.getShortName() + "'"); } catch (IOException e) { fail("Expected exception was not thrown for user '" + user.getShortName() + "'"); } catch (UndeclaredThrowableException ute) { Throwable ex = ute.getUndeclaredThrowable(); // HBase AccessDeniedException(ADE) is handled in different ways in different parts of code // 1. Wrap HBase ADE in PhoenixIOException (Mostly for create, delete statements) // 2. Wrap HBase ADE in ExecutionException (Mostly for scans) // 3. Directly throwing HBase ADE or custom msg with HBase ADE // Thus we iterate over the chain of throwables and find ADE for(Throwable throwable : Throwables.getCausalChain(ex)) { if(exception.equals(throwable.getClass())) { if(throwable instanceof AccessDeniedException) { validateAccessDeniedException((AccessDeniedException) throwable); } return; } } } catch(RuntimeException ex) { // This can occur while accessing tabledescriptors from client by the unprivileged user if (ex.getCause() instanceof AccessDeniedException) { // expected result validateAccessDeniedException((AccessDeniedException) ex.getCause()); return; } } fail("Expected exception was not thrown for user '" + user.getShortName() + "'"); } } String surroundWithDoubleQuotes(String input) { return "\"" + input + "\""; } private void validateAccessDeniedException(AccessDeniedException ade) { String msg = ade.getMessage(); assertTrue("Exception contained unexpected message: '" + msg + "'", !msg.contains("is not the scanner owner")); } @Test public void testSystemTablePermissions() throws Throwable { verifyAllowed(createTable(tableName), superUser1); verifyAllowed(readTable(tableName), superUser1); Set<String> tables = getHBaseTables(); if(isNamespaceMapped) { assertTrue("HBase tables do not include expected Phoenix tables: " + tables, tables.containsAll(PHOENIX_NAMESPACE_MAPPED_SYSTEM_TABLES)); } else { assertTrue("HBase tables do not include expected Phoenix tables: " + tables, tables.containsAll(PHOENIX_SYSTEM_TABLES)); } // Grant permission to the system tables for the unprivileged user superUser1.runAs(new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { try { if(isNamespaceMapped) { grantPermissions(regularUser1.getShortName(), PHOENIX_NAMESPACE_MAPPED_SYSTEM_TABLES, Permission.Action.EXEC, Permission.Action.READ); } else { grantPermissions(regularUser1.getShortName(), PHOENIX_SYSTEM_TABLES, Permission.Action.EXEC, Permission.Action.READ); } grantPermissions(regularUser1.getShortName(), Collections.singleton(tableName), Permission.Action.READ,Permission.Action.EXEC); } catch (Throwable e) { if (e instanceof Exception) { throw (Exception) e; } else { throw new Exception(e); } } return null; } }); // Make sure that the unprivileged user can now read the table verifyAllowed(readTable(tableName), regularUser1); //This verification is added to test PHOENIX-5178 superUser1.runAs(new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { try { if (isNamespaceMapped) { grantPermissions(regularUser1.getShortName(),"SYSTEM", Permission.Action.ADMIN); } return null; } catch (Throwable e) { throw new Exception(e); } } }); if (isNamespaceMapped) { verifyAllowed(() -> { Properties props = new Properties(); props.setProperty( QueryServices.IS_NAMESPACE_MAPPING_ENABLED, Boolean.toString(isNamespaceMapped)); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(MetaDataProtocol .MIN_SYSTEM_TABLE_TIMESTAMP)); //Impersonate meta connection try (Connection metaConnection = DriverManager.getConnection(getUrl(), props); Statement stmt = metaConnection.createStatement()) { stmt.executeUpdate( "CREATE SCHEMA IF NOT EXISTS SYSTEM"); } catch (NewerSchemaAlreadyExistsException e) { // ignore } return null; }, regularUser1); } } private void grantSystemTableAccess(User superUser, User... users) throws Exception { for(User user : users) { if(isNamespaceMapped) { verifyAllowed(grantPermissions("RX", user, QueryConstants.SYSTEM_SCHEMA_NAME, true), superUser); } else { verifyAllowed(grantPermissions("RX", user, PHOENIX_SYSTEM_TABLES_IDENTIFIERS, false), superUser); } verifyAllowed(grantPermissions("RWX", user, SYSTEM_SEQUENCE_IDENTIFIER, false), superUser); verifyAllowed(grantPermissions("RWX", user, SYSTEM_MUTEX_IDENTIFIER, false), superUser); } } private void revokeSystemTableAccess(User superUser, User... users) throws Exception { for(User user : users) { if(isNamespaceMapped) { verifyAllowed(revokePermissions(user, QueryConstants.SYSTEM_SCHEMA_NAME, true), superUser); verifyAllowed(revokePermissions(user, SYSTEM_SEQUENCE_IDENTIFIER, false), superUser); verifyAllowed(revokePermissions(user, SYSTEM_MUTEX_IDENTIFIER, false), superUser); } else { verifyAllowed(revokePermissions(user, PHOENIX_SYSTEM_TABLES_IDENTIFIERS, false), superUser); } } } /** * Verify that READ and EXECUTE permissions are required on SYSTEM tables to get a Phoenix Connection * Tests grant revoke permissions per user 1. if NS enabled -> on namespace 2. If NS disabled -> on tables */ @Test // this test needs to be run first public void aTestRXPermsReqdForPhoenixConn() throws Exception { if(isNamespaceMapped) { // NS is enabled, CQSI tries creating SYSCAT, we get NamespaceNotFoundException exception for "SYSTEM" NS // We create custom ADE and throw it (and ignore NamespaceNotFoundException) // This is because we didn't had CREATE perms to create "SYSTEM" NS verifyDenied(getConnectionAction(), AccessDeniedException.class, regularUser1); } else { // NS is disabled, CQSI tries creating SYSCAT, Two cases here // 1. First client ever --> Gets ADE, runs client server compatibility check again and gets TableNotFoundException since SYSCAT doesn't exist // 2. Any other client --> Gets ADE, runs client server compatibility check again and gets AccessDeniedException since it doesn't have EXEC perms verifyDenied(getConnectionAction(), org.apache.hadoop.hbase.TableNotFoundException.class, regularUser1); } //Initialize Phoenix to avoid timeouts later try (Connection conn = getConnection(); Statement stmt = conn.createStatement();) { stmt.execute("select * from system.catalog"); } // Phoenix Client caches connection per user // If we grant permissions, get a connection and then revoke it, we can still get the cached connection // However it will fail for other read queries // Thus this test grants and revokes for 2 users, so that both functionality can be tested. grantSystemTableAccess(superUser1, regularUser1, regularUser2); verifyAllowed(getConnectionAction(), regularUser1); revokeSystemTableAccess(superUser1, regularUser2); verifyDenied(getConnectionAction(), AccessDeniedException.class, regularUser2); } /** * Superuser grants admin perms to user1, who will in-turn grant admin perms to user2 * Not affected with namespace props * Tests grant revoke permissions on per user global level */ @Test public void testSuperUserCanChangePerms() throws Throwable { // Grant System Table access to all users, else they can't create a Phoenix connection grantSystemTableAccess(superUser1, regularUser1, regularUser2, unprivilegedUser); verifyAllowed(grantPermissions("A", regularUser1), superUser1); verifyAllowed(readTableWithoutVerification(PhoenixDatabaseMetaData.SYSTEM_CATALOG), regularUser1); verifyAllowed(grantPermissions("A", regularUser2), regularUser1); verifyAllowed(revokePermissions(regularUser1), superUser1); verifyDenied(grantPermissions("A", regularUser3), AccessDeniedException.class, regularUser1); // Don't grant ADMIN perms to unprivilegedUser, thus unprivilegedUser is unable to control other permissions. verifyAllowed(getConnectionAction(), unprivilegedUser); verifyDenied(grantPermissions("ARX", regularUser4), AccessDeniedException.class, unprivilegedUser); } /** * Test to verify READ permissions on table, indexes and views * Tests automatic grant revoke of permissions per user on a table */ @Test public void testReadPermsOnTableIndexAndView() throws Exception { grantSystemTableAccess(superUser1, regularUser1, regularUser2, unprivilegedUser); // Create new schema and grant CREATE permissions to a user if(isNamespaceMapped) { verifyAllowed(createSchema(schemaName), superUser1); verifyAllowed(grantPermissions("C", regularUser1, schemaName, true), superUser1); } else { verifyAllowed(grantPermissions("C", regularUser1, surroundWithDoubleQuotes(SchemaUtil.SCHEMA_FOR_DEFAULT_NAMESPACE), true), superUser1); } // Create new table. Create indexes, views and view indexes on top of it. Verify the contents by querying it verifyAllowed(createTable(fullTableName), regularUser1); verifyAllowed(readTable(fullTableName), regularUser1); verifyAllowed(createIndex(idx1TableName, fullTableName), regularUser1); verifyAllowed(createIndex(idx2TableName, fullTableName), regularUser1); verifyAllowed(createLocalIndex(localIdx1TableName, fullTableName), regularUser1); verifyAllowed(createView(view1TableName, fullTableName), regularUser1); verifyAllowed(createIndex(idx3TableName, view1TableName), regularUser1); // RegularUser2 doesn't have any permissions. It can get a PhoenixConnection // However it cannot query table, indexes or views without READ perms verifyAllowed(getConnectionAction(), regularUser2); verifyDenied(readTable(fullTableName), AccessDeniedException.class, regularUser2); verifyDenied(readTable(fullTableName, idx1TableName), AccessDeniedException.class, regularUser2); verifyDenied(readTable(view1TableName), AccessDeniedException.class, regularUser2); verifyDenied(readTableWithoutVerification(schemaName + "." + idx1TableName), AccessDeniedException.class, regularUser2); // Grant READ permissions to RegularUser2 on the table // Permissions should propagate automatically to relevant physical tables such as global index and view index. verifyAllowed(grantPermissions("RX", regularUser2, fullTableName, false), regularUser1); // Granting permissions directly to index tables should fail verifyDenied(grantPermissions("W", regularUser2, schemaName + "." + idx1TableName, false), AccessDeniedException.class, regularUser1); // Granting permissions directly to views should fail. We expect TableNotFoundException since VIEWS are not physical tables verifyDenied(grantPermissions("W", regularUser2, schemaName + "." + view1TableName, false), TableNotFoundException.class, regularUser1); // Verify that all other access are successful now verifyAllowed(readTable(fullTableName), regularUser2); verifyAllowed(readTable(fullTableName, idx1TableName), regularUser2); verifyAllowed(readTable(fullTableName, idx2TableName), regularUser2); verifyAllowed(readTable(fullTableName, localIdx1TableName), regularUser2); verifyAllowed(readTableWithoutVerification(schemaName + "." + idx1TableName), regularUser2); verifyAllowed(readTable(view1TableName), regularUser2); verifyAllowed(readMultiTenantTableWithIndex(view1TableName), regularUser2); // Revoke READ permissions to RegularUser2 on the table // Permissions should propagate automatically to relevant physical tables such as global index and view index. verifyAllowed(revokePermissions(regularUser2, fullTableName, false), regularUser1); // READ query should fail now verifyDenied(readTable(fullTableName), AccessDeniedException.class, regularUser2); verifyDenied(readTableWithoutVerification(schemaName + "." + idx1TableName), AccessDeniedException.class, regularUser2); } /** * Test to verify READ permissions on table, indexes and views * Tests automatic grant revoke of permissions per user on a table */ @Test public void testReadPermsOnTableIndexAndViewOnLowerCaseSchema() throws Exception { grantSystemTableAccess(superUser1, regularUser1, regularUser2, unprivilegedUser); schemaName = "\"" + schemaName.toLowerCase() + "\""; fullTableName = schemaName + "." + tableName; // Create new schema and grant CREATE permissions to a user if(isNamespaceMapped) { verifyAllowed(createSchema(schemaName), superUser1); verifyAllowed(grantPermissions("C", regularUser1, schemaName, true), superUser1); } else { verifyAllowed(grantPermissions("C", regularUser1, surroundWithDoubleQuotes(SchemaUtil.SCHEMA_FOR_DEFAULT_NAMESPACE), true), superUser1); } // Create new table. Create indexes, views and view indexes on top of it. Verify the contents by querying it verifyAllowed(createTable(fullTableName), regularUser1); verifyAllowed(readTable(fullTableName), regularUser1); verifyAllowed(createIndex(idx1TableName, fullTableName), regularUser1); verifyAllowed(createIndex(idx2TableName, fullTableName), regularUser1); verifyAllowed(createLocalIndex(localIdx1TableName, fullTableName), regularUser1); verifyAllowed(createView(view1TableName, fullTableName), regularUser1); verifyAllowed(createIndex(idx3TableName, view1TableName), regularUser1); // RegularUser2 doesn't have any permissions. It can get a PhoenixConnection // However it cannot query table, indexes or views without READ perms verifyAllowed(getConnectionAction(), regularUser2); verifyDenied(readTable(fullTableName), AccessDeniedException.class, regularUser2); verifyDenied(readTable(fullTableName, idx1TableName), AccessDeniedException.class, regularUser2); verifyDenied(readTable(view1TableName), AccessDeniedException.class, regularUser2); verifyDenied(readTableWithoutVerification(schemaName + "." + idx1TableName), AccessDeniedException.class, regularUser2); // Grant READ permissions to RegularUser2 on the table // Permissions should propagate automatically to relevant physical tables such as global index and view index. verifyAllowed(grantPermissions("RX", regularUser2, fullTableName, false), regularUser1); // Granting permissions directly to index tables should fail verifyDenied(grantPermissions("W", regularUser2, schemaName + "." + idx1TableName, false), AccessDeniedException.class, regularUser1); // Granting permissions directly to views should fail. We expect TableNotFoundException since VIEWS are not physical tables verifyDenied(grantPermissions("W", regularUser2, schemaName + "." + view1TableName, false), TableNotFoundException.class, regularUser1); // Verify that all other access are successful now verifyAllowed(readTable(fullTableName), regularUser2); verifyAllowed(readTable(fullTableName, idx1TableName), regularUser2); verifyAllowed(readTable(fullTableName, idx2TableName), regularUser2); verifyAllowed(readTable(fullTableName, localIdx1TableName), regularUser2); verifyAllowed(readTableWithoutVerification(schemaName + "." + idx1TableName), regularUser2); verifyAllowed(readTable(view1TableName), regularUser2); verifyAllowed(readMultiTenantTableWithIndex(view1TableName), regularUser2); // Revoke READ permissions to RegularUser2 on the table // Permissions should propagate automatically to relevant physical tables such as global index and view index. verifyAllowed(revokePermissions(regularUser2, fullTableName, false), regularUser1); // READ query should fail now verifyDenied(readTable(fullTableName), AccessDeniedException.class, regularUser2); verifyDenied(readTableWithoutVerification(schemaName + "." + idx1TableName), AccessDeniedException.class, regularUser2); } /** * Verifies permissions for users present inside a group */ @Test public void testGroupUserPerms() throws Exception { if(isNamespaceMapped) { verifyAllowed(createSchema(schemaName), superUser1); } verifyAllowed(createTable(fullTableName), superUser1); // Grant SYSTEM table access to GROUP_SYSTEM_ACCESS and regularUser1 verifyAllowed(grantPermissions("RX", GROUP_SYSTEM_ACCESS, PHOENIX_SYSTEM_TABLES_IDENTIFIERS, false), superUser1); grantSystemTableAccess(superUser1, regularUser1); // Grant Permissions to Groups (Should be automatically applicable to all users inside it) verifyAllowed(grantPermissions("ARX", GROUP_SYSTEM_ACCESS, fullTableName, false), superUser1); verifyAllowed(readTable(fullTableName), groupUser); // GroupUser is an admin and can grant perms to other users verifyDenied(readTable(fullTableName), AccessDeniedException.class, regularUser1); verifyAllowed(grantPermissions("RX", regularUser1, fullTableName, false), groupUser); verifyAllowed(readTable(fullTableName), regularUser1); // Revoke the perms and try accessing data again verifyAllowed(revokePermissions(GROUP_SYSTEM_ACCESS, fullTableName, false), superUser1); verifyDenied(readTable(fullTableName), AccessDeniedException.class, groupUser); } /** * Tests permissions for MultiTenant Tables and view index tables */ @Test public void testMultiTenantTables() throws Exception { grantSystemTableAccess(superUser1, regularUser1, regularUser2, regularUser3); if(isNamespaceMapped) { verifyAllowed(createSchema(schemaName), superUser1); verifyAllowed(grantPermissions("C", regularUser1, schemaName, true), superUser1); } else { verifyAllowed(grantPermissions("C", regularUser1, surroundWithDoubleQuotes(SchemaUtil.SCHEMA_FOR_DEFAULT_NAMESPACE), true), superUser1); } // Create MultiTenant Table (View Index Table should be automatically created) // At this point, the index table doesn't contain any data verifyAllowed(createMultiTenantTable(fullTableName), regularUser1); // RegularUser2 doesn't have access yet, RegularUser1 should have RWXCA on the table verifyDenied(readMultiTenantTableWithoutIndex(fullTableName), AccessDeniedException.class, regularUser2); // Grant perms to base table (Should propagate to View Index as well) verifyAllowed(grantPermissions("RX", regularUser2, fullTableName, false), regularUser1); // Try reading full table verifyAllowed(readMultiTenantTableWithoutIndex(fullTableName), regularUser2); // Create tenant specific views on the table using tenant specific Phoenix Connection verifyAllowed(createView(view1TableName, fullTableName, "o1"), regularUser1); verifyAllowed(createView(view2TableName, fullTableName, "o2"), regularUser1); // Create indexes on those views using tenant specific Phoenix Connection // It is not possible to create indexes on tenant specific views without tenant connection verifyAllowed(createIndex(idx1TableName, view1TableName, "o1"), regularUser1); verifyAllowed(createIndex(idx2TableName, view2TableName, "o2"), regularUser1); // Read the tables as regularUser2, with and without the use of Index table // If perms are propagated correctly, then both of them should work // The test checks if the query plan uses the index table by searching for "_IDX_" string // _IDX_ is the prefix used with base table name to derieve the name of view index table verifyAllowed(readMultiTenantTableWithIndex(view1TableName, "o1"), regularUser2); verifyAllowed(readMultiTenantTableWithoutIndex(view2TableName, "o2"), regularUser2); } /** * Grant RX permissions on the schema to regularUser1, * Creating view on a table with that schema by regularUser1 should be allowed */ @Test public void testCreateViewOnTableWithRXPermsOnSchema() throws Exception { grantSystemTableAccess(superUser1, regularUser1, regularUser2, regularUser3); if(isNamespaceMapped) { verifyAllowed(createSchema(schemaName), superUser1); verifyAllowed(createTable(fullTableName), superUser1); verifyAllowed(grantPermissions("RX", regularUser1, schemaName, true), superUser1); } else { verifyAllowed(createTable(fullTableName), superUser1); verifyAllowed(grantPermissions("RX", regularUser1, surroundWithDoubleQuotes(SchemaUtil.SCHEMA_FOR_DEFAULT_NAMESPACE), true), superUser1); } verifyAllowed(createView(view1TableName, fullTableName), regularUser1); } protected void grantSystemTableAccess() throws Exception{ try (Connection conn = getConnection()) { if (isNamespaceMapped) { grantPermissions(regularUser1.getShortName(), PHOENIX_NAMESPACE_MAPPED_SYSTEM_TABLES, Permission.Action.READ, Permission.Action.EXEC); grantPermissions(unprivilegedUser.getShortName(), PHOENIX_NAMESPACE_MAPPED_SYSTEM_TABLES, Permission.Action.READ, Permission.Action.EXEC); grantPermissions(AuthUtil.toGroupEntry(GROUP_SYSTEM_ACCESS), PHOENIX_NAMESPACE_MAPPED_SYSTEM_TABLES, Permission.Action.READ, Permission.Action.EXEC); // Local Index requires WRITE permission on SYSTEM.SEQUENCE TABLE. grantPermissions(regularUser1.getName(), Collections.singleton("SYSTEM:SEQUENCE"), Permission.Action.WRITE, Permission.Action.READ, Permission.Action.EXEC); grantPermissions(unprivilegedUser.getName(), Collections.singleton("SYSTEM:SEQUENCE"), Permission.Action.WRITE, Permission.Action.READ, Permission.Action.EXEC); grantPermissions(regularUser1.getShortName(), Collections.singleton("SYSTEM:MUTEX"), Permission.Action.WRITE, Permission.Action.READ, Permission.Action.EXEC); grantPermissions(unprivilegedUser.getShortName(), Collections.singleton("SYSTEM:MUTEX"), Permission.Action.WRITE, Permission.Action.READ, Permission.Action.EXEC); } else { grantPermissions(regularUser1.getName(), PHOENIX_SYSTEM_TABLES, Permission.Action.READ, Permission.Action.EXEC); grantPermissions(unprivilegedUser.getName(), PHOENIX_SYSTEM_TABLES, Permission.Action.READ, Permission.Action.EXEC); grantPermissions(AuthUtil.toGroupEntry(GROUP_SYSTEM_ACCESS), PHOENIX_SYSTEM_TABLES, Permission.Action.READ, Permission.Action.EXEC); // Local Index requires WRITE permission on SYSTEM.SEQUENCE TABLE. grantPermissions(regularUser1.getName(), Collections.singleton("SYSTEM.SEQUENCE"), Permission.Action.WRITE, Permission.Action.READ, Permission.Action.EXEC); grantPermissions(unprivilegedUser.getName(), Collections.singleton("SYSTEM:SEQUENCE"), Permission.Action.WRITE, Permission.Action.READ, Permission.Action.EXEC); grantPermissions(regularUser1.getShortName(), Collections.singleton("SYSTEM.MUTEX"), Permission.Action.WRITE, Permission.Action.READ, Permission.Action.EXEC); grantPermissions(unprivilegedUser.getShortName(), Collections.singleton("SYSTEM.MUTEX"), Permission.Action.WRITE, Permission.Action.READ, Permission.Action.EXEC); } } catch (Throwable e) { if (e instanceof Exception) { throw (Exception)e; } else { throw new Exception(e); } } } @Test public void testAutomaticGrantWithIndexAndView() throws Throwable { final String schema = "TEST_INDEX_VIEW"; final String tableName = "TABLE_DDL_PERMISSION_IT"; final String phoenixTableName = schema + "." + tableName; final String indexName1 = tableName + "_IDX1"; final String indexName2 = tableName + "_IDX2"; final String lIndexName1 = tableName + "_LIDX1"; final String viewName1 = schema+"."+tableName + "_V1"; final String viewName2 = schema+"."+tableName + "_V2"; final String viewName3 = schema+"."+tableName + "_V3"; final String viewName4 = schema+"."+tableName + "_V4"; final String viewIndexName1 = tableName + "_VIDX1"; final String viewIndexName2 = tableName + "_VIDX2"; grantSystemTableAccess(); superUser1.runAs(new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { try { verifyAllowed(createSchema(schema), superUser1); //Neded Global ADMIN for flush operation during drop table grantPermissions(regularUser1.getName(), Permission.Action.ADMIN); if (isNamespaceMapped) { grantPermissions(regularUser1.getName(), schema, Permission.Action.CREATE); grantPermissions(AuthUtil.toGroupEntry(GROUP_SYSTEM_ACCESS), schema, Permission.Action.CREATE); } else { grantPermissions(regularUser1.getName(), NamespaceDescriptor.DEFAULT_NAMESPACE.getName(), Permission.Action.CREATE); grantPermissions(AuthUtil.toGroupEntry(GROUP_SYSTEM_ACCESS), NamespaceDescriptor.DEFAULT_NAMESPACE.getName(), Permission.Action.CREATE); } } catch (Throwable e) { if (e instanceof Exception) { throw (Exception)e; } else { throw new Exception(e); } } return null; } }); verifyAllowed(createTable(phoenixTableName), regularUser1); verifyAllowed(createIndex(indexName1, phoenixTableName), regularUser1); verifyAllowed(createView(viewName1, phoenixTableName), regularUser1); verifyAllowed(createLocalIndex(lIndexName1, phoenixTableName), regularUser1); verifyAllowed(createIndex(viewIndexName1, viewName1), regularUser1); verifyAllowed(createIndex(viewIndexName2, viewName1), regularUser1); verifyAllowed(createView(viewName4, viewName1), regularUser1); verifyAllowed(readTable(phoenixTableName), regularUser1); verifyDenied(createIndex(indexName2, phoenixTableName), AccessDeniedException.class, unprivilegedUser); verifyDenied(createView(viewName2, phoenixTableName),AccessDeniedException.class, unprivilegedUser); verifyDenied(createView(viewName3, viewName1), AccessDeniedException.class, unprivilegedUser); verifyDenied(dropView(viewName1), AccessDeniedException.class, unprivilegedUser); verifyDenied(dropIndex(indexName1, phoenixTableName), AccessDeniedException.class, unprivilegedUser); verifyDenied(dropTable(phoenixTableName), AccessDeniedException.class, unprivilegedUser); verifyDenied(rebuildIndex(indexName1, phoenixTableName), AccessDeniedException.class, unprivilegedUser); verifyDenied(addColumn(phoenixTableName, "val1"), AccessDeniedException.class, unprivilegedUser); verifyDenied(dropColumn(phoenixTableName, "val"), AccessDeniedException.class, unprivilegedUser); verifyDenied(addProperties(phoenixTableName, "GUIDE_POSTS_WIDTH", "100"), AccessDeniedException.class, unprivilegedUser); // Granting read permission to unprivileged user, now he should be able to create view but not index grantPermissions(unprivilegedUser.getShortName(), Collections.singleton( SchemaUtil.getPhysicalHBaseTableName(schema, tableName, isNamespaceMapped).getString()), Permission.Action.READ, Permission.Action.EXEC); grantPermissions(AuthUtil.toGroupEntry(GROUP_SYSTEM_ACCESS), Collections.singleton( SchemaUtil.getPhysicalHBaseTableName(schema, tableName, isNamespaceMapped).getString()), Permission.Action.READ, Permission.Action.EXEC); verifyDenied(createIndex(indexName2, phoenixTableName), AccessDeniedException.class, unprivilegedUser); verifyAllowed(createView(viewName2, phoenixTableName), unprivilegedUser); verifyAllowed(createView(viewName3, viewName1), unprivilegedUser); // Grant create permission in namespace if (isNamespaceMapped) { grantPermissions(unprivilegedUser.getShortName(), schema, Permission.Action.CREATE); } else { grantPermissions(unprivilegedUser.getShortName(), NamespaceDescriptor.DEFAULT_NAMESPACE.getName(), Permission.Action.CREATE); } // we should be able to read the data from another index as well to which we have not given any access to // this user verifyAllowed(readTable(phoenixTableName, indexName1), unprivilegedUser); verifyAllowed(readTable(phoenixTableName), regularUser1); verifyAllowed(rebuildIndex(indexName1, phoenixTableName), regularUser1); verifyAllowed(addColumn(phoenixTableName, "val1"), regularUser1); verifyAllowed(addProperties(phoenixTableName, "GUIDE_POSTS_WIDTH", "100"), regularUser1); verifyAllowed(dropView(viewName1), regularUser1); verifyAllowed(dropView(viewName2), regularUser1); verifyAllowed(dropColumn(phoenixTableName, "val1"), regularUser1); verifyAllowed(dropIndex(indexName1, phoenixTableName), regularUser1); verifyAllowed(dropTable(phoenixTableName), regularUser1); // check again with super users verifyAllowed(createTable(phoenixTableName), superUser2); verifyAllowed(createIndex(indexName1, phoenixTableName), superUser2); verifyAllowed(createView(viewName1, phoenixTableName), superUser2); verifyAllowed(readTable(phoenixTableName), superUser2); verifyAllowed(dropView(viewName1), superUser2); verifyAllowed(dropTable(phoenixTableName), superUser2); } @Test public void testDeletingStatsShouldNotFailWithADEWhenTableDropped() throws Throwable { final String schema = "STATS_ENABLED"; final String tableName = "DELETE_TABLE_IT"; final String phoenixTableName = schema + "." + tableName; final String indexName1 = tableName + "_IDX1"; final String lIndexName1 = tableName + "_LIDX1"; final String viewName1 = schema+"."+tableName + "_V1"; final String viewIndexName1 = tableName + "_VIDX1"; grantSystemTableAccess(); superUser1.runAs(new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { try { verifyAllowed(createSchema(schema), superUser1); //Neded Global ADMIN for flush operation during drop table grantPermissions(regularUser1.getName(), Permission.Action.ADMIN); if (isNamespaceMapped) { grantPermissions(regularUser1.getName(), schema, Permission.Action.CREATE); grantPermissions(AuthUtil.toGroupEntry(GROUP_SYSTEM_ACCESS), schema, Permission.Action.CREATE); } else { grantPermissions(regularUser1.getName(), NamespaceDescriptor.DEFAULT_NAMESPACE.getName(), Permission.Action.CREATE); grantPermissions(AuthUtil.toGroupEntry(GROUP_SYSTEM_ACCESS), NamespaceDescriptor.DEFAULT_NAMESPACE.getName(), Permission.Action.CREATE); } } catch (Throwable e) { if (e instanceof Exception) { throw (Exception)e; } else { throw new Exception(e); } } return null; } }); verifyAllowed(createTable(phoenixTableName, 100), regularUser1); verifyAllowed(createIndex(indexName1,phoenixTableName),regularUser1); verifyAllowed(createLocalIndex(lIndexName1, phoenixTableName), regularUser1); verifyAllowed(createView(viewName1,phoenixTableName),regularUser1); verifyAllowed(createIndex(viewIndexName1, viewName1), regularUser1); verifyAllowed(updateStatsOnTable(phoenixTableName), regularUser1); Thread.sleep(10000); // Normal deletes should fail when no write permissions given on stats table. verifyDenied(deleteDataFromStatsTable(), AccessDeniedException.class, regularUser1); verifyAllowed(dropIndex(viewIndexName1, viewName1), regularUser1); verifyAllowed(dropView(viewName1),regularUser1); verifyAllowed(dropIndex(indexName1, phoenixTableName), regularUser1); Thread.sleep(3000); verifyAllowed(readStatsAfterTableDelete(SchemaUtil.getPhysicalHBaseTableName( schema, indexName1, isNamespaceMapped).getString()), regularUser1); verifyAllowed(dropIndex(lIndexName1, phoenixTableName), regularUser1); verifyAllowed(dropTable(phoenixTableName), regularUser1); Thread.sleep(3000); verifyAllowed(readStatsAfterTableDelete(SchemaUtil.getPhysicalHBaseTableName( schema, tableName, isNamespaceMapped).getString()), regularUser1); } @Test public void testUpsertIntoImmutableTable() throws Throwable { final String schema = generateUniqueName(); final String tableName = generateUniqueName(); final String phoenixTableName = schema + "." + tableName; grantSystemTableAccess(); superUser1.runAs(new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { try { verifyAllowed(createSchema(schema), superUser1); verifyAllowed(onlyCreateImmutableTable(phoenixTableName), superUser1); } catch (Throwable e) { if (e instanceof Exception) { throw (Exception) e; } else { throw new Exception(e); } } return null; } }); if (isNamespaceMapped) { grantPermissions(unprivilegedUser.getShortName(), schema, Permission.Action.WRITE, Permission.Action.READ, Permission.Action.EXEC); } else { grantPermissions(unprivilegedUser.getShortName(), NamespaceDescriptor.DEFAULT_NAMESPACE.getName(), Permission.Action.WRITE, Permission.Action.READ, Permission.Action.EXEC); } verifyAllowed(upsertRowsIntoTable(phoenixTableName), unprivilegedUser); verifyAllowed(readTable(phoenixTableName), unprivilegedUser); } AccessTestAction onlyCreateImmutableTable(final String tableName) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement()) { assertFalse(stmt.execute("CREATE IMMUTABLE TABLE " + tableName + "(pk INTEGER not null primary key, data VARCHAR, val integer)")); } return null; } }; } AccessTestAction upsertRowsIntoTable(final String tableName) throws SQLException { return new AccessTestAction() { @Override public Object run() throws Exception { try (Connection conn = getConnection()) { try (PreparedStatement pstmt = conn.prepareStatement( "UPSERT INTO " + tableName + " values(?, ?, ?)")) { for (int i = 0; i < NUM_RECORDS; i++) { pstmt.setInt(1, i); pstmt.setString(2, Integer.toString(i)); pstmt.setInt(3, i); assertEquals(1, pstmt.executeUpdate()); } } conn.commit(); } return null; } }; } public static class CustomAccessController extends AccessController { Configuration configuration; boolean aclRegion; @Override public void start(CoprocessorEnvironment env) throws IOException { super.start(env); configuration = env.getConfiguration(); if(env instanceof RegionCoprocessorEnvironment) { aclRegion = AccessControlClient.ACL_TABLE_NAME. equals(((RegionCoprocessorEnvironment) env).getRegion(). getTableDescriptor().getTableName()); } } @Override public void getUserPermissions(RpcController controller, AccessControlProtos.GetUserPermissionsRequest request, RpcCallback<AccessControlProtos.GetUserPermissionsResponse> done) { if(aclRegion) { super.getUserPermissions(controller,request,done); return; } AccessControlProtos.GetUserPermissionsResponse response = null; org.apache.hadoop.hbase.client.Connection connection; try { connection = ConnectionFactory.createConnection(configuration); } catch (IOException e) { // pass exception back up ResponseConverter.setControllerException(controller, new IOException(e)); return; } try { final List<UserPermission> perms = new ArrayList<>(); if(request.getType() == AccessControlProtos.Permission.Type.Table) { final TableName table = request.hasTableName() ? ProtobufUtil.toTableName(request.getTableName()) : null; perms.addAll(AccessControlClient.getUserPermissions(connection, table.getNameAsString())); } else if(request.getType() == AccessControlProtos.Permission.Type.Namespace) { final String namespace = request.hasNamespaceName() ? request.getNamespaceName().toStringUtf8() : null; perms.addAll(AccessControlClient.getUserPermissions(connection, AuthUtil.toGroupEntry(namespace))); } response = AccessControlUtil.buildGetUserPermissionsResponse(perms); } catch (Throwable ioe) { // pass exception back up ResponseConverter.setControllerException(controller, new IOException(ioe)); } if(connection != null) { try { connection.close(); } catch (IOException e) { } } done.run(response); } } // Copied from org.apache.hadoop.hbase.security.access.SecureTestUtil because it's not visible // there private static List<AccessController> getAccessControllers(MiniHBaseCluster cluster) { List<AccessController> result = Lists.newArrayList(); for (RegionServerThread t: cluster.getLiveRegionServerThreads()) { for (HRegion region: t.getRegionServer().getOnlineRegionsLocalContext()) { Coprocessor cp = region.getCoprocessorHost() .findCoprocessor(AccessController.class.getName()); if (cp != null) { result.add((AccessController)cp); } } } return result; } // Copied from org.apache.hadoop.hbase.security.access.SecureTestUtil because it's not visible // there private static Map<AccessController,Long> getAuthManagerMTimes(MiniHBaseCluster cluster) { Map<AccessController,Long> result = Maps.newHashMap(); for (AccessController ac: getAccessControllers(cluster)) { result.put(ac, ac.getAuthManager().getMTime()); } return result; } // Copied from org.apache.hadoop.hbase.security.access.SecureTestUtil because it's not visible // there @SuppressWarnings("rawtypes") public static void updateACLs(final HBaseTestingUtility util, Callable c) throws Exception { // Get the current mtimes for all access controllers final Map<AccessController,Long> oldMTimes = getAuthManagerMTimes(util.getHBaseCluster()); // Run the update action c.call(); // Wait until mtimes for all access controllers have incremented util.waitFor(WAIT_TIME, 100, new Predicate<IOException>() { @Override public boolean evaluate() { Map<AccessController,Long> mtimes = getAuthManagerMTimes(util.getHBaseCluster()); for (Map.Entry<AccessController,Long> e: mtimes.entrySet()) { if (!oldMTimes.containsKey(e.getKey())) { LOGGER.error("Snapshot of AccessController state does not include instance on region " + e.getKey().getRegion().getRegionInfo().getRegionNameAsString()); // Error out the predicate, we will try again return false; } long old = oldMTimes.get(e.getKey()); long now = e.getValue(); if (now <= old) { LOGGER.info("AccessController on region " + e.getKey().getRegion().getRegionInfo().getRegionNameAsString() + " has not updated: mtime=" + now); return false; } } return true; } }); } }
{ "content_hash": "ef348ef1cceece6299add8c4fcbdda26", "timestamp": "", "source": "github", "line_count": 1727, "max_line_length": 174, "avg_line_length": 49.47307469600463, "alnum_prop": 0.6121956928838951, "repo_name": "apurtell/phoenix", "id": "c9fc1a71981d3417ee704f857369c55c92e5ab93", "size": "86237", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "phoenix-core/src/it/java/org/apache/phoenix/end2end/BasePermissionsIT.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "6417" }, { "name": "GAP", "bytes": "51593" }, { "name": "HTML", "bytes": "18971" }, { "name": "Java", "bytes": "21607197" }, { "name": "JavaScript", "bytes": "217517" }, { "name": "Python", "bytes": "163375" }, { "name": "Shell", "bytes": "154101" } ], "symlink_target": "" }
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.vaadin.osgi</groupId> <artifactId>tablebundle</artifactId> <version>0.0.1</version> <packaging>bundle</packaging> <name>Table bundle</name> <properties> <vaadin.version>7.3.4</vaadin.version> </properties> <dependencies> <dependency> <groupId>org.vaadin.osgi</groupId> <artifactId>demo-app</artifactId> <version>0.0.1</version> <classifier>classes</classifier> <scope>provided</scope> </dependency> <dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin-server</artifactId> <version>${vaadin.version}</version> <scope>provided</scope> </dependency> <!-- OSGi dependency --> <dependency> <groupId>org.osgi</groupId> <artifactId>org.osgi.core</artifactId> <version>5.0.0</version> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>2.5.3</version> <extensions>true</extensions> <configuration> <instructions> <Bundle-Activator>org.vaadin.osgi.tablefactory.TableFactoryActivator</Bundle-Activator> </instructions> </configuration> </plugin> </plugins> </build> </project>
{ "content_hash": "901dadfd174b73914c414d2859116bca", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 104, "avg_line_length": 27.225806451612904, "alnum_prop": 0.6872037914691943, "repo_name": "mhosio/vaadin-osgi-demo", "id": "e341edd3d5fd9f14f7a23e636852c9778d561f2a", "size": "1688", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tablebundle/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "282225" }, { "name": "Java", "bytes": "33889" } ], "symlink_target": "" }
package com.amazonaws.services.ec2.model; import javax.annotation.Generated; /** * */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public enum PlacementGroupState { Pending("pending"), Available("available"), Deleting("deleting"), Deleted("deleted"); private String value; private PlacementGroupState(String value) { this.value = value; } @Override public String toString() { return this.value; } /** * Use this in place of valueOf. * * @param value * real value * @return PlacementGroupState corresponding to the value */ public static PlacementGroupState fromValue(String value) { if (value == null || "".equals(value)) { throw new IllegalArgumentException("Value cannot be null or empty!"); } for (PlacementGroupState enumEntry : PlacementGroupState.values()) { if (enumEntry.toString().equals(value)) { return enumEntry; } } throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); } }
{ "content_hash": "c96b934d69d85d63a87fe3ea34d53da1", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 91, "avg_line_length": 23.708333333333332, "alnum_prop": 0.6098418277680141, "repo_name": "dagnir/aws-sdk-java", "id": "ac3c467329e3ca950d5811a981adeedd39d5f1c2", "size": "1718", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/PlacementGroupState.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "157317" }, { "name": "Gherkin", "bytes": "25556" }, { "name": "Java", "bytes": "165755153" }, { "name": "Scilab", "bytes": "3561" } ], "symlink_target": "" }
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. '//------------------------------------------------------------------------------------------------- '// '// Error code and strings for Compiler errors '// '// ERRIDs should be defined in the following ranges: '// '// 500 - 999 - non localized ERRID (main DLL) '// 30000 - 59999 - localized ERRID (intl DLL) '// '// The convention for naming ERRID's that take replacement strings is to give '// them a number following the name (from 1-9) that indicates how many '// arguments they expect. '// '// DO NOT USE ANY NUMBERS EXCEPT THOSE EXPLICITLY LISTED AS BEING AVAILABLE. '// IF YOU REUSE A NUMBER, LOCALIZATION WILL BE SCREWED UP! '// '//------------------------------------------------------------------------------------------------- ' //------------------------------------------------------------------------------------------------- ' // ' // ' // Manages the parse and compile errors. ' // ' //------------------------------------------------------------------------------------------------- Namespace Microsoft.CodeAnalysis.VisualBasic Friend Enum ERRID Void = InternalErrorCode.Void Unknown = InternalErrorCode.Unknown ERR_None = 0 ' ERR_InitError = 2000 unused in Roslyn ERR_FileNotFound = 2001 ' WRN_FileAlreadyIncluded = 2002 'unused in Roslyn. 'ERR_DuplicateResponseFile = 2003 unused in Roslyn. 'ERR_NoMemory = 2004 ERR_ArgumentRequired = 2006 WRN_BadSwitch = 2007 ERR_NoSources = 2008 ERR_SwitchNeedsBool = 2009 'ERR_CompileFailed = 2010 unused in Roslyn. ERR_NoResponseFile = 2011 ERR_CantOpenFileWrite = 2012 ERR_InvalidSwitchValue = 2014 ERR_BinaryFile = 2015 ERR_BadCodepage = 2016 ERR_LibNotFound = 2017 'ERR_MaximumErrors = 2020 unused in Roslyn. ERR_IconFileAndWin32ResFile = 2023 'WRN_ReservedReference = 2024 ' unused by native compiler due to bug. WRN_NoConfigInResponseFile = 2025 ' WRN_InvalidWarningId = 2026 ' unused in Roslyn. 'ERR_WatsonSendNotOptedIn = 2027 ' WRN_SwitchNoBool = 2028 'unused in Roslyn ERR_NoSourcesOut = 2029 ERR_NeedModule = 2030 ERR_InvalidAssemblyName = 2031 FTL_InputFileNameTooLong = 2032 ' new in Roslyn ERR_ConflictingManifestSwitches = 2033 WRN_IgnoreModuleManifest = 2034 'ERR_NoDefaultManifest = 2035 'ERR_InvalidSwitchValue1 = 2036 WRN_BadUILang = 2038 ' new in Roslyn ERR_VBCoreNetModuleConflict = 2042 ERR_InvalidFormatForGuidForOption = 2043 ERR_MissingGuidForOption = 2044 ERR_BadChecksumAlgorithm = 2045 ERR_MutuallyExclusiveOptions = 2046 '// The naming convention is that if your error requires arguments, to append '// the number of args taken, e.g. AmbiguousName2 '// ERR_InvalidInNamespace = 30001 ERR_UndefinedType1 = 30002 ERR_MissingNext = 30003 ERR_IllegalCharConstant = 30004 '//If you make any change involving these errors, such as creating more specific versions for use '//in other contexts, please make sure to appropriately modify Bindable::ResolveOverloadingShouldSkipBadMember ERR_UnreferencedAssemblyEvent3 = 30005 ERR_UnreferencedModuleEvent3 = 30006 ' ERR_UnreferencedAssemblyBase3 = 30007 ERR_UnreferencedModuleBase3 = 30008 ' ERR_UnreferencedAssemblyImplements3 = 30009 ERR_UnreferencedModuleImplements3 = 30010 'ERR_CodegenError = 30011 ERR_LbExpectedEndIf = 30012 ERR_LbNoMatchingIf = 30013 ERR_LbBadElseif = 30014 ERR_InheritsFromRestrictedType1 = 30015 ERR_InvOutsideProc = 30016 ERR_DelegateCantImplement = 30018 ERR_DelegateCantHandleEvents = 30019 ERR_IsOperatorRequiresReferenceTypes1 = 30020 ERR_TypeOfRequiresReferenceType1 = 30021 ERR_ReadOnlyHasSet = 30022 ERR_WriteOnlyHasGet = 30023 ERR_InvInsideProc = 30024 ERR_EndProp = 30025 ERR_EndSubExpected = 30026 ERR_EndFunctionExpected = 30027 ERR_LbElseNoMatchingIf = 30028 ERR_CantRaiseBaseEvent = 30029 ERR_TryWithoutCatchOrFinally = 30030 ' ERR_FullyQualifiedNameTooLong1 = 30031 ' Deprecated in favor of ERR_TooLongMetadataName ERR_EventsCantBeFunctions = 30032 ' ERR_IdTooLong = 30033 ' Deprecated in favor of ERR_TooLongMetadataName ERR_MissingEndBrack = 30034 ERR_Syntax = 30035 ERR_Overflow = 30036 ERR_IllegalChar = 30037 ERR_StrictDisallowsObjectOperand1 = 30038 ERR_LoopControlMustNotBeProperty = 30039 ERR_MethodBodyNotAtLineStart = 30040 ERR_MaximumNumberOfErrors = 30041 ERR_UseOfKeywordNotInInstanceMethod1 = 30043 ERR_UseOfKeywordFromStructure1 = 30044 ERR_BadAttributeConstructor1 = 30045 ERR_ParamArrayWithOptArgs = 30046 ERR_ExpectedArray1 = 30049 ERR_ParamArrayNotArray = 30050 ERR_ParamArrayRank = 30051 ERR_ArrayRankLimit = 30052 ERR_AsNewArray = 30053 ERR_TooManyArgs1 = 30057 ERR_ExpectedCase = 30058 ERR_RequiredConstExpr = 30059 ERR_RequiredConstConversion2 = 30060 ERR_InvalidMe = 30062 ERR_ReadOnlyAssignment = 30064 ERR_ExitSubOfFunc = 30065 ERR_ExitPropNot = 30066 ERR_ExitFuncOfSub = 30067 ERR_LValueRequired = 30068 ERR_ForIndexInUse1 = 30069 ERR_NextForMismatch1 = 30070 ERR_CaseElseNoSelect = 30071 ERR_CaseNoSelect = 30072 ERR_CantAssignToConst = 30074 ERR_NamedSubscript = 30075 ERR_ExpectedEndIf = 30081 ERR_ExpectedEndWhile = 30082 ERR_ExpectedLoop = 30083 ERR_ExpectedNext = 30084 ERR_ExpectedEndWith = 30085 ERR_ElseNoMatchingIf = 30086 ERR_EndIfNoMatchingIf = 30087 ERR_EndSelectNoSelect = 30088 ERR_ExitDoNotWithinDo = 30089 ERR_EndWhileNoWhile = 30090 ERR_LoopNoMatchingDo = 30091 ERR_NextNoMatchingFor = 30092 ERR_EndWithWithoutWith = 30093 ERR_MultiplyDefined1 = 30094 ERR_ExpectedEndSelect = 30095 ERR_ExitForNotWithinFor = 30096 ERR_ExitWhileNotWithinWhile = 30097 ERR_ReadOnlyProperty1 = 30098 ERR_ExitSelectNotWithinSelect = 30099 ERR_BranchOutOfFinally = 30101 ERR_QualNotObjectRecord1 = 30103 ERR_TooFewIndices = 30105 ERR_TooManyIndices = 30106 ERR_EnumNotExpression1 = 30107 ERR_TypeNotExpression1 = 30108 ERR_ClassNotExpression1 = 30109 ERR_StructureNotExpression1 = 30110 ERR_InterfaceNotExpression1 = 30111 ERR_NamespaceNotExpression1 = 30112 ERR_BadNamespaceName1 = 30113 ERR_XmlPrefixNotExpression = 30114 ERR_MultipleExtends = 30121 'ERR_NoStopInDebugger = 30122 'ERR_NoEndInDebugger = 30123 ERR_PropMustHaveGetSet = 30124 ERR_WriteOnlyHasNoWrite = 30125 ERR_ReadOnlyHasNoGet = 30126 ERR_BadAttribute1 = 30127 ' ERR_BadSecurityAttribute1 = 30128 ' we're now reporting more detailed diagnostics: ERR_SecurityAttributeMissingAction or ERR_SecurityAttributeInvalidAction 'ERR_BadAssemblyAttribute1 = 30129 'ERR_BadModuleAttribute1 = 30130 ' ERR_ModuleSecurityAttributeNotAllowed1 = 30131 ' We now report ERR_SecurityAttributeInvalidTarget instead. ERR_LabelNotDefined1 = 30132 'ERR_NoGotosInDebugger = 30133 'ERR_NoLabelsInDebugger = 30134 'ERR_NoSyncLocksInDebugger = 30135 ERR_ErrorCreatingWin32ResourceFile = 30136 'ERR_ErrorSavingWin32ResourceFile = 30137 abandoned. no longer "saving" a temporary resource file. ERR_UnableToCreateTempFile = 30138 'changed from ERR_UnableToCreateTempFileInPath1. now takes only one argument 'ERR_ErrorSettingManifestOption = 30139 'ERR_ErrorCreatingManifest = 30140 'ERR_UnableToCreateALinkAPI = 30141 'ERR_UnableToGenerateRefToMetaDataFile1 = 30142 'ERR_UnableToEmbedResourceFile1 = 30143 ' We now report ERR_UnableToOpenResourceFile1 instead. 'ERR_UnableToLinkResourceFile1 = 30144 ' We now report ERR_UnableToOpenResourceFile1 instead. 'ERR_UnableToEmitAssembly = 30145 'ERR_UnableToSignAssembly = 30146 'ERR_NoReturnsInDebugger = 30147 ERR_RequiredNewCall2 = 30148 ERR_UnimplementedMember3 = 30149 ' ERR_UnimplementedProperty3 = 30154 ERR_BadWithRef = 30157 ' ERR_ExpectedNewableClass1 = 30166 unused in Roslyn. We now report nothing ' ERR_TypeConflict7 = 30175 unused in Roslyn. We now report BC30179 ERR_DuplicateAccessCategoryUsed = 30176 ERR_DuplicateModifierCategoryUsed = 30177 ERR_DuplicateSpecifier = 30178 ERR_TypeConflict6 = 30179 ERR_UnrecognizedTypeKeyword = 30180 ERR_ExtraSpecifiers = 30181 ERR_UnrecognizedType = 30182 ERR_InvalidUseOfKeyword = 30183 ERR_InvalidEndEnum = 30184 ERR_MissingEndEnum = 30185 'ERR_NoUsingInDebugger = 30186 ERR_ExpectedDeclaration = 30188 ERR_ParamArrayMustBeLast = 30192 ERR_SpecifiersInvalidOnInheritsImplOpt = 30193 ERR_ExpectedSpecifier = 30195 ERR_ExpectedComma = 30196 ERR_ExpectedAs = 30197 ERR_ExpectedRparen = 30198 ERR_ExpectedLparen = 30199 ERR_InvalidNewInType = 30200 ERR_ExpectedExpression = 30201 ERR_ExpectedOptional = 30202 ERR_ExpectedIdentifier = 30203 ERR_ExpectedIntLiteral = 30204 ERR_ExpectedEOS = 30205 ERR_ExpectedForOptionStmt = 30206 ERR_InvalidOptionCompare = 30207 ERR_ExpectedOptionCompare = 30208 ERR_StrictDisallowImplicitObject = 30209 ERR_StrictDisallowsImplicitProc = 30210 ERR_StrictDisallowsImplicitArgs = 30211 ERR_InvalidParameterSyntax = 30213 ERR_ExpectedSubFunction = 30215 ERR_ExpectedStringLiteral = 30217 ERR_MissingLibInDeclare = 30218 ERR_DelegateNoInvoke1 = 30220 ERR_MissingIsInTypeOf = 30224 ERR_DuplicateOption1 = 30225 ERR_ModuleCantInherit = 30230 ERR_ModuleCantImplement = 30231 ERR_BadImplementsType = 30232 ERR_BadConstFlags1 = 30233 ERR_BadWithEventsFlags1 = 30234 ERR_BadDimFlags1 = 30235 ERR_DuplicateParamName1 = 30237 ERR_LoopDoubleCondition = 30238 ERR_ExpectedRelational = 30239 ERR_ExpectedExitKind = 30240 ERR_ExpectedNamedArgument = 30241 ERR_BadMethodFlags1 = 30242 ERR_BadEventFlags1 = 30243 ERR_BadDeclareFlags1 = 30244 ERR_BadLocalConstFlags1 = 30246 ERR_BadLocalDimFlags1 = 30247 ERR_ExpectedConditionalDirective = 30248 ERR_ExpectedEQ = 30249 ERR_ConstructorNotFound1 = 30251 ERR_InvalidEndInterface = 30252 ERR_MissingEndInterface = 30253 ERR_InheritsFrom2 = 30256 ERR_InheritanceCycle1 = 30257 ERR_InheritsFromNonClass = 30258 ERR_MultiplyDefinedType3 = 30260 ERR_BadOverrideAccess2 = 30266 ERR_CantOverrideNotOverridable2 = 30267 ERR_DuplicateProcDef1 = 30269 ERR_BadInterfaceMethodFlags1 = 30270 ERR_NamedParamNotFound2 = 30272 ERR_BadInterfacePropertyFlags1 = 30273 ERR_NamedArgUsedTwice2 = 30274 ERR_InterfaceCantUseEventSpecifier1 = 30275 ERR_TypecharNoMatch2 = 30277 ERR_ExpectedSubOrFunction = 30278 ERR_BadEmptyEnum1 = 30280 ERR_InvalidConstructorCall = 30282 ERR_CantOverrideConstructor = 30283 ERR_OverrideNotNeeded3 = 30284 ERR_ExpectedDot = 30287 ERR_DuplicateLocals1 = 30288 ERR_InvInsideEndsProc = 30289 ERR_LocalSameAsFunc = 30290 ERR_RecordEmbeds2 = 30293 ERR_RecordCycle2 = 30294 ERR_InterfaceCycle1 = 30296 ERR_SubNewCycle2 = 30297 ERR_SubNewCycle1 = 30298 ERR_InheritsFromCantInherit3 = 30299 ERR_OverloadWithOptional2 = 30300 ERR_OverloadWithReturnType2 = 30301 ERR_TypeCharWithType1 = 30302 ERR_TypeCharOnSub = 30303 ERR_OverloadWithDefault2 = 30305 ERR_MissingSubscript = 30306 ERR_OverrideWithDefault2 = 30307 ERR_OverrideWithOptional2 = 30308 ERR_FieldOfValueFieldOfMarshalByRef3 = 30310 ERR_TypeMismatch2 = 30311 ERR_CaseAfterCaseElse = 30321 ERR_ConvertArrayMismatch4 = 30332 ERR_ConvertObjectArrayMismatch3 = 30333 ERR_ForLoopType1 = 30337 ERR_OverloadWithByref2 = 30345 ERR_InheritsFromNonInterface = 30354 ERR_BadInterfaceOrderOnInherits = 30357 ERR_DuplicateDefaultProps1 = 30359 ERR_DefaultMissingFromProperty2 = 30361 ERR_OverridingPropertyKind2 = 30362 ERR_NewInInterface = 30363 ERR_BadFlagsOnNew1 = 30364 ERR_OverloadingPropertyKind2 = 30366 ERR_NoDefaultNotExtend1 = 30367 ERR_OverloadWithArrayVsParamArray2 = 30368 ERR_BadInstanceMemberAccess = 30369 ERR_ExpectedRbrace = 30370 ERR_ModuleAsType1 = 30371 ERR_NewIfNullOnNonClass = 30375 'ERR_NewIfNullOnAbstractClass1 = 30376 ERR_CatchAfterFinally = 30379 ERR_CatchNoMatchingTry = 30380 ERR_FinallyAfterFinally = 30381 ERR_FinallyNoMatchingTry = 30382 ERR_EndTryNoTry = 30383 ERR_ExpectedEndTry = 30384 ERR_BadDelegateFlags1 = 30385 ERR_NoConstructorOnBase2 = 30387 ERR_InaccessibleSymbol2 = 30389 ERR_InaccessibleMember3 = 30390 ERR_CatchNotException1 = 30392 ERR_ExitTryNotWithinTry = 30393 ERR_BadRecordFlags1 = 30395 ERR_BadEnumFlags1 = 30396 ERR_BadInterfaceFlags1 = 30397 ERR_OverrideWithByref2 = 30398 ERR_MyBaseAbstractCall1 = 30399 ERR_IdentNotMemberOfInterface4 = 30401 '//We intentionally use argument '3' for the delegate name. This makes generating overload resolution errors '//easy. To make it more clear that were doing this, we name the message DelegateBindingMismatch3_2. '//This differentiates its from DelegateBindingMismatch3_3, which actually takes 3 parameters instead of 2. '//This is a workaround, but it makes the logic for reporting overload resolution errors easier error report more straight forward. 'ERR_DelegateBindingMismatch3_2 = 30408 ERR_WithEventsRequiresClass = 30412 ERR_WithEventsAsStruct = 30413 ERR_ConvertArrayRankMismatch2 = 30414 ERR_RedimRankMismatch = 30415 ERR_StartupCodeNotFound1 = 30420 ERR_ConstAsNonConstant = 30424 ERR_InvalidEndSub = 30429 ERR_InvalidEndFunction = 30430 ERR_InvalidEndProperty = 30431 ERR_ModuleCantUseMethodSpecifier1 = 30433 ERR_ModuleCantUseEventSpecifier1 = 30434 ERR_StructCantUseVarSpecifier1 = 30435 'ERR_ModuleCantUseMemberSpecifier1 = 30436 Now reporting BC30735 ERR_InvalidOverrideDueToReturn2 = 30437 ERR_ConstantWithNoValue = 30438 ERR_ExpressionOverflow1 = 30439 'ERR_ExpectedEndTryCatch = 30441 - No Longer Reported. Removed per bug 926779 'ERR_ExpectedEndTryFinally = 30442 - No Longer Reported. Removed per bug 926779 ERR_DuplicatePropertyGet = 30443 ERR_DuplicatePropertySet = 30444 ' ERR_ConstAggregate = 30445 Now giving BC30424 ERR_NameNotDeclared1 = 30451 ERR_BinaryOperands3 = 30452 ERR_ExpectedProcedure = 30454 ERR_OmittedArgument2 = 30455 ERR_NameNotMember2 = 30456 'ERR_NoTypeNamesAvailable = 30458 ERR_EndClassNoClass = 30460 ERR_BadClassFlags1 = 30461 ERR_ImportsMustBeFirst = 30465 ERR_NonNamespaceOrClassOnImport2 = 30467 ERR_TypecharNotallowed = 30468 ERR_ObjectReferenceNotSupplied = 30469 ERR_MyClassNotInClass = 30470 ERR_IndexedNotArrayOrProc = 30471 ERR_EventSourceIsArray = 30476 ERR_SharedConstructorWithParams = 30479 ERR_SharedConstructorIllegalSpec1 = 30480 ERR_ExpectedEndClass = 30481 ERR_UnaryOperand2 = 30487 ERR_BadFlagsWithDefault1 = 30490 ERR_VoidValue = 30491 ERR_ConstructorFunction = 30493 'ERR_LineTooLong = 30494 - No longer reported. Removed per 926916 ERR_InvalidLiteralExponent = 30495 ERR_NewCannotHandleEvents = 30497 ERR_CircularEvaluation1 = 30500 ERR_BadFlagsOnSharedMeth1 = 30501 ERR_BadFlagsOnSharedProperty1 = 30502 ERR_BadFlagsOnStdModuleProperty1 = 30503 ERR_SharedOnProcThatImpl = 30505 ERR_NoWithEventsVarOnHandlesList = 30506 ERR_AccessMismatch6 = 30508 ERR_InheritanceAccessMismatch5 = 30509 ERR_NarrowingConversionDisallowed2 = 30512 ERR_NoArgumentCountOverloadCandidates1 = 30516 ERR_NoViableOverloadCandidates1 = 30517 ERR_NoCallableOverloadCandidates2 = 30518 ERR_NoNonNarrowingOverloadCandidates2 = 30519 ERR_ArgumentNarrowing3 = 30520 ERR_NoMostSpecificOverload2 = 30521 ERR_NotMostSpecificOverload = 30522 ERR_OverloadCandidate2 = 30523 ERR_NoGetProperty1 = 30524 ERR_NoSetProperty1 = 30526 'ERR_ArrayType2 = 30528 ERR_ParamTypingInconsistency = 30529 ERR_ParamNameFunctionNameCollision = 30530 ERR_DateToDoubleConversion = 30532 ERR_DoubleToDateConversion = 30533 ERR_ZeroDivide = 30542 ERR_TryAndOnErrorDoNotMix = 30544 ERR_PropertyAccessIgnored = 30545 ERR_InterfaceNoDefault1 = 30547 ERR_InvalidAssemblyAttribute1 = 30548 ERR_InvalidModuleAttribute1 = 30549 ERR_AmbiguousInUnnamedNamespace1 = 30554 ERR_DefaultMemberNotProperty1 = 30555 ERR_AmbiguousInNamespace2 = 30560 ERR_AmbiguousInImports2 = 30561 ERR_AmbiguousInModules2 = 30562 ' ERR_AmbiguousInApplicationObject2 = 30563 ' comment out in Dev10 ERR_ArrayInitializerTooFewDimensions = 30565 ERR_ArrayInitializerTooManyDimensions = 30566 ERR_InitializerTooFewElements1 = 30567 ERR_InitializerTooManyElements1 = 30568 ERR_NewOnAbstractClass = 30569 ERR_DuplicateNamedImportAlias1 = 30572 ERR_DuplicatePrefix = 30573 ERR_StrictDisallowsLateBinding = 30574 ' ERR_PropertyMemberSyntax = 30576 unused in Roslyn ERR_AddressOfOperandNotMethod = 30577 ERR_EndExternalSource = 30578 ERR_ExpectedEndExternalSource = 30579 ERR_NestedExternalSource = 30580 ERR_AddressOfNotDelegate1 = 30581 ERR_SyncLockRequiresReferenceType1 = 30582 ERR_MethodAlreadyImplemented2 = 30583 ERR_DuplicateInInherits1 = 30584 ERR_NamedParamArrayArgument = 30587 ERR_OmittedParamArrayArgument = 30588 ERR_ParamArrayArgumentMismatch = 30589 ERR_EventNotFound1 = 30590 'ERR_NoDefaultSource = 30591 ERR_ModuleCantUseVariableSpecifier1 = 30593 ERR_SharedEventNeedsSharedHandler = 30594 ERR_ExpectedMinus = 30601 ERR_InterfaceMemberSyntax = 30602 ERR_InvInsideInterface = 30603 ERR_InvInsideEndsInterface = 30604 ERR_BadFlagsInNotInheritableClass1 = 30607 ERR_UnimplementedMustOverride = 30609 ' substituted into ERR_BaseOnlyClassesMustBeExplicit2 ERR_BaseOnlyClassesMustBeExplicit2 = 30610 ERR_NegativeArraySize = 30611 ERR_MyClassAbstractCall1 = 30614 ERR_EndDisallowedInDllProjects = 30615 ERR_BlockLocalShadowing1 = 30616 ERR_ModuleNotAtNamespace = 30617 ERR_NamespaceNotAtNamespace = 30618 ERR_InvInsideEndsEnum = 30619 ERR_InvalidOptionStrict = 30620 ERR_EndStructureNoStructure = 30621 ERR_EndModuleNoModule = 30622 ERR_EndNamespaceNoNamespace = 30623 ERR_ExpectedEndStructure = 30624 ERR_ExpectedEndModule = 30625 ERR_ExpectedEndNamespace = 30626 ERR_OptionStmtWrongOrder = 30627 ERR_StructCantInherit = 30628 ERR_NewInStruct = 30629 ERR_InvalidEndGet = 30630 ERR_MissingEndGet = 30631 ERR_InvalidEndSet = 30632 ERR_MissingEndSet = 30633 ERR_InvInsideEndsProperty = 30634 ERR_DuplicateWriteabilityCategoryUsed = 30635 ERR_ExpectedGreater = 30636 ERR_AttributeStmtWrongOrder = 30637 ERR_NoExplicitArraySizes = 30638 ERR_BadPropertyFlags1 = 30639 ERR_InvalidOptionExplicit = 30640 ERR_MultipleParameterSpecifiers = 30641 ERR_MultipleOptionalParameterSpecifiers = 30642 ERR_UnsupportedProperty1 = 30643 ERR_InvalidOptionalParameterUsage1 = 30645 ERR_ReturnFromNonFunction = 30647 ERR_UnterminatedStringLiteral = 30648 ERR_UnsupportedType1 = 30649 ERR_InvalidEnumBase = 30650 ERR_ByRefIllegal1 = 30651 '//If you make any change involving these errors, such as creating more specific versions for use '//in other contexts, please make sure to appropriately modify Bindable::ResolveOverloadingShouldSkipBadMember ERR_UnreferencedAssembly3 = 30652 ERR_UnreferencedModule3 = 30653 ERR_ReturnWithoutValue = 30654 ' ERR_CantLoadStdLibrary1 = 30655 roslyn doesn't use special messages when well-known assemblies cannot be loaded. ERR_UnsupportedField1 = 30656 ERR_UnsupportedMethod1 = 30657 ERR_NoNonIndexProperty1 = 30658 ERR_BadAttributePropertyType1 = 30659 ERR_LocalsCannotHaveAttributes = 30660 ERR_PropertyOrFieldNotDefined1 = 30661 ERR_InvalidAttributeUsage2 = 30662 ERR_InvalidMultipleAttributeUsage1 = 30663 ERR_CantThrowNonException = 30665 ERR_MustBeInCatchToRethrow = 30666 ERR_ParamArrayMustBeByVal = 30667 ERR_UseOfObsoleteSymbol2 = 30668 ERR_RedimNoSizes = 30670 ERR_InitWithMultipleDeclarators = 30671 ERR_InitWithExplicitArraySizes = 30672 ERR_EndSyncLockNoSyncLock = 30674 ERR_ExpectedEndSyncLock = 30675 ERR_NameNotEvent2 = 30676 ERR_AddOrRemoveHandlerEvent = 30677 ERR_UnrecognizedEnd = 30678 ERR_ArrayInitForNonArray2 = 30679 ERR_EndRegionNoRegion = 30680 ERR_ExpectedEndRegion = 30681 ERR_InheritsStmtWrongOrder = 30683 ERR_AmbiguousAcrossInterfaces3 = 30685 ERR_DefaultPropertyAmbiguousAcrossInterfaces4 = 30686 ERR_InterfaceEventCantUse1 = 30688 ERR_ExecutableAsDeclaration = 30689 ERR_StructureNoDefault1 = 30690 ' ERR_TypeMemberAsExpression2 = 30691 Now giving BC30109 ERR_MustShadow2 = 30695 'ERR_OverloadWithOptionalTypes2 = 30696 ERR_OverrideWithOptionalTypes2 = 30697 'ERR_UnableToGetTempPath = 30698 'ERR_NameNotDeclaredDebug1 = 30699 '// This error should never be seen. 'ERR_NoSideEffects = 30700 'ERR_InvalidNothing = 30701 'ERR_IndexOutOfRange1 = 30702 'ERR_RuntimeException2 = 30703 'ERR_RuntimeException = 30704 'ERR_ObjectReferenceIsNothing1 = 30705 '// This error should never be seen. 'ERR_ExpressionNotValidInEE = 30706 'ERR_UnableToEvaluateExpression = 30707 'ERR_UnableToEvaluateLoops = 30708 'ERR_NoDimsInDebugger = 30709 ERR_ExpectedEndOfExpression = 30710 'ERR_SetValueNotAllowedOnNonLeafFrame = 30711 'ERR_UnableToClassInformation1 = 30712 'ERR_NoExitInDebugger = 30713 'ERR_NoResumeInDebugger = 30714 'ERR_NoCatchInDebugger = 30715 'ERR_NoFinallyInDebugger = 30716 'ERR_NoTryInDebugger = 30717 'ERR_NoSelectInDebugger = 30718 'ERR_NoCaseInDebugger = 30719 'ERR_NoOnErrorInDebugger = 30720 'ERR_EvaluationAborted = 30721 'ERR_EvaluationTimeout = 30722 'ERR_EvaluationNoReturnValue = 30723 'ERR_NoErrorStatementInDebugger = 30724 'ERR_NoThrowStatementInDebugger = 30725 'ERR_NoWithContextInDebugger = 30726 ERR_StructsCannotHandleEvents = 30728 ERR_OverridesImpliesOverridable = 30730 'ERR_NoAddressOfInDebugger = 30731 'ERR_EvaluationOfWebMethods = 30732 ERR_LocalNamedSameAsParam1 = 30734 ERR_ModuleCantUseTypeSpecifier1 = 30735 'ERR_EvaluationBadStartPoint = 30736 ERR_InValidSubMainsFound1 = 30737 ERR_MoreThanOneValidMainWasFound2 = 30738 'ERR_NoRaiseEventOfInDebugger = 30739 'ERR_InvalidCast2 = 30741 ERR_CannotConvertValue2 = 30742 'ERR_ArrayElementIsNothing = 30744 'ERR_InternalCompilerError = 30747 'ERR_InvalidCast1 = 30748 'ERR_UnableToGetValue = 30749 'ERR_UnableToLoadType1 = 30750 'ERR_UnableToGetTypeInformationFor1 = 30751 ERR_OnErrorInSyncLock = 30752 ERR_NarrowingConversionCollection2 = 30753 ERR_GotoIntoTryHandler = 30754 ERR_GotoIntoSyncLock = 30755 ERR_GotoIntoWith = 30756 ERR_GotoIntoFor = 30757 ERR_BadAttributeNonPublicConstructor = 30758 'ERR_ArrayElementIsNothing1 = 30759 'ERR_ObjectReferenceIsNothing = 30760 ' ERR_StarliteDisallowsLateBinding = 30762 ' ERR_StarliteBadDeclareFlags = 30763 ' ERR_NoStarliteOverloadResolution = 30764 'ERR_NoSupportFileIOKeywords1 = 30766 ' ERR_NoSupportGetStatement = 30767 - starlite error message ' ERR_NoSupportLineKeyword = 30768 cut from Roslyn ' ERR_StarliteDisallowsEndStatement = 30769 cut from Roslyn ERR_DefaultEventNotFound1 = 30770 ERR_InvalidNonSerializedUsage = 30772 'ERR_NoContinueInDebugger = 30780 ERR_ExpectedContinueKind = 30781 ERR_ContinueDoNotWithinDo = 30782 ERR_ContinueForNotWithinFor = 30783 ERR_ContinueWhileNotWithinWhile = 30784 ERR_DuplicateParameterSpecifier = 30785 ERR_ModuleCantUseDLLDeclareSpecifier1 = 30786 ERR_StructCantUseDLLDeclareSpecifier1 = 30791 ERR_TryCastOfValueType1 = 30792 ERR_TryCastOfUnconstrainedTypeParam1 = 30793 ERR_AmbiguousDelegateBinding2 = 30794 ERR_SharedStructMemberCannotSpecifyNew = 30795 ERR_GenericSubMainsFound1 = 30796 ERR_GeneralProjectImportsError3 = 30797 ERR_InvalidTypeForAliasesImport2 = 30798 ERR_UnsupportedConstant2 = 30799 ERR_ObsoleteArgumentsNeedParens = 30800 ERR_ObsoleteLineNumbersAreLabels = 30801 ERR_ObsoleteStructureNotType = 30802 'ERR_ObsoleteDecimalNotCurrency = 30803 cut from Roslyn ERR_ObsoleteObjectNotVariant = 30804 'ERR_ObsoleteArrayBounds = 30805 unused in Roslyn ERR_ObsoleteLetSetNotNeeded = 30807 ERR_ObsoletePropertyGetLetSet = 30808 ERR_ObsoleteWhileWend = 30809 'ERR_ObsoleteStaticMethod = 30810 cut from Roslyn ERR_ObsoleteRedimAs = 30811 ERR_ObsoleteOptionalWithoutValue = 30812 ERR_ObsoleteGosub = 30814 'ERR_ObsoleteFileIOKeywords1 = 30815 cut from Roslyn 'ERR_ObsoleteDebugKeyword1 = 30816 cut from Roslyn ERR_ObsoleteOnGotoGosub = 30817 'ERR_ObsoleteMathCompatKeywords1 = 30818 cut from Roslyn 'ERR_ObsoleteMathKeywords2 = 30819 cut from Roslyn 'ERR_ObsoleteLsetKeyword1 = 30820 cut from Roslyn 'ERR_ObsoleteRsetKeyword1 = 30821 cut from Roslyn 'ERR_ObsoleteNullKeyword1 = 30822 cut from Roslyn 'ERR_ObsoleteEmptyKeyword1 = 30823 cut from Roslyn ERR_ObsoleteEndIf = 30826 ERR_ObsoleteExponent = 30827 ERR_ObsoleteAsAny = 30828 ERR_ObsoleteGetStatement = 30829 'ERR_ObsoleteLineKeyword = 30830 cut from Roslyn ERR_OverrideWithArrayVsParamArray2 = 30906 '// CONSIDER :harishk - improve this error message ERR_CircularBaseDependencies4 = 30907 ERR_NestedBase2 = 30908 ERR_AccessMismatchOutsideAssembly4 = 30909 ERR_InheritanceAccessMismatchOutside3 = 30910 ERR_UseOfObsoletePropertyAccessor3 = 30911 ERR_UseOfObsoletePropertyAccessor2 = 30912 ERR_AccessMismatchImplementedEvent6 = 30914 ERR_AccessMismatchImplementedEvent4 = 30915 ERR_InheritanceCycleInImportedType1 = 30916 ERR_NoNonObsoleteConstructorOnBase3 = 30917 ERR_NoNonObsoleteConstructorOnBase4 = 30918 ERR_RequiredNonObsoleteNewCall3 = 30919 ERR_RequiredNonObsoleteNewCall4 = 30920 ERR_InheritsTypeArgAccessMismatch7 = 30921 ERR_InheritsTypeArgAccessMismatchOutside5 = 30922 'ERR_AccessMismatchTypeArgImplEvent7 = 30923 unused in Roslyn 'ERR_AccessMismatchTypeArgImplEvent5 = 30924 unused in Roslyn ERR_PartialTypeAccessMismatch3 = 30925 ERR_PartialTypeBadMustInherit1 = 30926 ERR_MustOverOnNotInheritPartClsMem1 = 30927 ERR_BaseMismatchForPartialClass3 = 30928 ERR_PartialTypeTypeParamNameMismatch3 = 30931 ERR_PartialTypeConstraintMismatch1 = 30932 ERR_LateBoundOverloadInterfaceCall1 = 30933 ERR_RequiredAttributeConstConversion2 = 30934 ERR_AmbiguousOverrides3 = 30935 ERR_OverriddenCandidate1 = 30936 ERR_AmbiguousImplements3 = 30937 ERR_AddressOfNotCreatableDelegate1 = 30939 'ERR_ReturnFromEventMethod = 30940 unused in Roslyn 'ERR_BadEmptyStructWithCustomEvent1 = 30941 ERR_ComClassGenericMethod = 30943 ERR_SyntaxInCastOp = 30944 'ERR_UnimplementedBadMemberEvent = 30945 Cut in Roslyn 'ERR_EvaluationStopRequested = 30946 'ERR_EvaluationSuspendRequested = 30947 'ERR_EvaluationUnscheduledFiber = 30948 ERR_ArrayInitializerForNonConstDim = 30949 ERR_DelegateBindingFailure3 = 30950 'ERR_DelegateBindingTypeInferenceFails2 = 30952 'ERR_ConstraintViolationError1 = 30953 'ERR_ConstraintsFailedForInferredArgs2 = 30954 'ERR_TypeMismatchDLLProjectMix6 = 30955 'ERR_EvaluationPriorTimeout = 30957 'ERR_EvaluationENCObjectOutdated = 30958 ' Obsolete ERR_TypeRefFromMetadataToVBUndef = 30960 'ERR_TypeMismatchMixedDLLs6 = 30961 'ERR_ReferencedAssemblyCausesCycle3 = 30962 'ERR_AssemblyRefAssembly2 = 30963 'ERR_AssemblyRefProject2 = 30964 'ERR_ProjectRefAssembly2 = 30965 'ERR_ProjectRefProject2 = 30966 'ERR_ReferencedAssembliesAmbiguous4 = 30967 'ERR_ReferencedAssembliesAmbiguous6 = 30968 'ERR_ReferencedProjectsAmbiguous4 = 30969 'ERR_GeneralErrorMixedDLLs5 = 30970 'ERR_GeneralErrorDLLProjectMix5 = 30971 ERR_StructLayoutAttributeNotAllowed = 30972 'ERR_ClassNotLoadedDuringDebugging = 30973 'ERR_UnableToEvaluateComment = 30974 'ERR_ForIndexInUse = 30975 'ERR_NextForMismatch = 30976 ERR_IterationVariableShadowLocal1 = 30978 ERR_InvalidOptionInfer = 30979 ERR_CircularInference1 = 30980 ERR_InAccessibleOverridingMethod5 = 30981 ERR_NoSuitableWidestType1 = 30982 ERR_AmbiguousWidestType3 = 30983 ERR_ExpectedAssignmentOperatorInInit = 30984 ERR_ExpectedQualifiedNameInInit = 30985 ERR_ExpectedLbrace = 30987 ERR_UnrecognizedTypeOrWith = 30988 ERR_DuplicateAggrMemberInit1 = 30989 ERR_NonFieldPropertyAggrMemberInit1 = 30990 ERR_SharedMemberAggrMemberInit1 = 30991 ERR_ParameterizedPropertyInAggrInit1 = 30992 ERR_NoZeroCountArgumentInitCandidates1 = 30993 ERR_AggrInitInvalidForObject = 30994 'ERR_BadWithRefInConstExpr = 30995 ERR_InitializerExpected = 30996 ERR_LineContWithCommentOrNoPrecSpace = 30999 ' ERR_MemberNotFoundForNoPia = 31000 not used in Roslyn. This looks to be a VB EE message ERR_InvInsideEnum = 31001 ERR_InvInsideBlock = 31002 ERR_UnexpectedExpressionStatement = 31003 ERR_WinRTEventWithoutDelegate = 31004 ERR_SecurityCriticalAsyncInClassOrStruct = 31005 ERR_SecurityCriticalAsync = 31006 ERR_BadModuleFile1 = 31007 ERR_BadRefLib1 = 31011 'ERR_UnableToLoadDll1 = 31013 'ERR_BadDllEntrypoint2 = 31014 'ERR_BadOutputFile1 = 31019 'ERR_BadOutputStream = 31020 'ERR_DeadBackgroundThread = 31021 'ERR_XMLParserError = 31023 'ERR_UnableToCreateMetaDataAPI = 31024 'ERR_UnableToOpenFile1 = 31027 ERR_EventHandlerSignatureIncompatible2 = 31029 ERR_ProjectCCError1 = 31030 'ERR_ProjectCCError0 = 31031 ERR_InterfaceImplementedTwice1 = 31033 ERR_InterfaceNotImplemented1 = 31035 ERR_AmbiguousImplementsMember3 = 31040 'ERR_BadInterfaceMember = 31041 ERR_ImplementsOnNew = 31042 ERR_ArrayInitInStruct = 31043 ERR_EventTypeNotDelegate = 31044 ERR_ProtectedTypeOutsideClass = 31047 ERR_DefaultPropertyWithNoParams = 31048 ERR_InitializerInStruct = 31049 ERR_DuplicateImport1 = 31051 ERR_BadModuleFlags1 = 31052 ERR_ImplementsStmtWrongOrder = 31053 ERR_MemberConflictWithSynth4 = 31058 ERR_SynthMemberClashesWithSynth7 = 31059 ERR_SynthMemberClashesWithMember5 = 31060 ERR_MemberClashesWithSynth6 = 31061 ERR_SetHasOnlyOneParam = 31063 ERR_SetValueNotPropertyType = 31064 ERR_SetHasToBeByVal1 = 31065 ERR_StructureCantUseProtected = 31067 ERR_BadInterfaceDelegateSpecifier1 = 31068 ERR_BadInterfaceEnumSpecifier1 = 31069 ERR_BadInterfaceClassSpecifier1 = 31070 ERR_BadInterfaceStructSpecifier1 = 31071 'ERR_WarningTreatedAsError = 31072 'ERR_DelegateConstructorMissing1 = 31074 unused in Roslyn ERR_UseOfObsoleteSymbolNoMessage1 = 31075 ERR_MetaDataIsNotAssembly = 31076 ERR_MetaDataIsNotModule = 31077 ERR_ReferenceComparison3 = 31080 ERR_CatchVariableNotLocal1 = 31082 ERR_ModuleMemberCantImplement = 31083 ERR_EventDelegatesCantBeFunctions = 31084 ERR_InvalidDate = 31085 ERR_CantOverride4 = 31086 ERR_CantSpecifyArraysOnBoth = 31087 ERR_NotOverridableRequiresOverrides = 31088 ERR_PrivateTypeOutsideType = 31089 ERR_TypeRefResolutionError3 = 31091 ERR_ParamArrayWrongType = 31092 ERR_CoClassMissing2 = 31094 ERR_InvalidMeReference = 31095 ERR_InvalidImplicitMeReference = 31096 ERR_RuntimeMemberNotFound2 = 31097 'ERR_RuntimeClassNotFound1 = 31098 ERR_BadPropertyAccessorFlags = 31099 ERR_BadPropertyAccessorFlagsRestrict = 31100 ERR_OnlyOneAccessorForGetSet = 31101 ERR_NoAccessibleSet = 31102 ERR_NoAccessibleGet = 31103 ERR_WriteOnlyNoAccessorFlag = 31104 ERR_ReadOnlyNoAccessorFlag = 31105 ERR_BadPropertyAccessorFlags1 = 31106 ERR_BadPropertyAccessorFlags2 = 31107 ERR_BadPropertyAccessorFlags3 = 31108 ERR_InAccessibleCoClass3 = 31109 ERR_MissingValuesForArraysInApplAttrs = 31110 ERR_ExitEventMemberNotInvalid = 31111 ERR_InvInsideEndsEvent = 31112 'ERR_EventMemberSyntax = 31113 abandoned per KevinH analysis. Roslyn bug 1637 ERR_MissingEndEvent = 31114 ERR_MissingEndAddHandler = 31115 ERR_MissingEndRemoveHandler = 31116 ERR_MissingEndRaiseEvent = 31117 'ERR_EndAddHandlerNotAtLineStart = 31118 'ERR_EndRemoveHandlerNotAtLineStart = 31119 'ERR_EndRaiseEventNotAtLineStart = 31120 ERR_CustomEventInvInInterface = 31121 ERR_CustomEventRequiresAs = 31122 ERR_InvalidEndEvent = 31123 ERR_InvalidEndAddHandler = 31124 ERR_InvalidEndRemoveHandler = 31125 ERR_InvalidEndRaiseEvent = 31126 ERR_DuplicateAddHandlerDef = 31127 ERR_DuplicateRemoveHandlerDef = 31128 ERR_DuplicateRaiseEventDef = 31129 ERR_MissingAddHandlerDef1 = 31130 ERR_MissingRemoveHandlerDef1 = 31131 ERR_MissingRaiseEventDef1 = 31132 ERR_EventAddRemoveHasOnlyOneParam = 31133 ERR_EventAddRemoveByrefParamIllegal = 31134 ERR_SpecifiersInvOnEventMethod = 31135 ERR_AddRemoveParamNotEventType = 31136 ERR_RaiseEventShapeMismatch1 = 31137 ERR_EventMethodOptionalParamIllegal1 = 31138 ERR_CantReferToMyGroupInsideGroupType1 = 31139 ERR_InvalidUseOfCustomModifier = 31140 ERR_InvalidOptionStrictCustom = 31141 ERR_ObsoleteInvalidOnEventMember = 31142 ERR_DelegateBindingIncompatible2 = 31143 ERR_ExpectedXmlName = 31146 ERR_UndefinedXmlPrefix = 31148 ERR_DuplicateXmlAttribute = 31149 ERR_MismatchedXmlEndTag = 31150 ERR_MissingXmlEndTag = 31151 ERR_ReservedXmlPrefix = 31152 ERR_MissingVersionInXmlDecl = 31153 ERR_IllegalAttributeInXmlDecl = 31154 ERR_QuotedEmbeddedExpression = 31155 ERR_VersionMustBeFirstInXmlDecl = 31156 ERR_AttributeOrder = 31157 'ERR_UnexpectedXmlName = 31158 ERR_ExpectedXmlEndEmbedded = 31159 ERR_ExpectedXmlEndPI = 31160 ERR_ExpectedXmlEndComment = 31161 ERR_ExpectedXmlEndCData = 31162 ERR_ExpectedSQuote = 31163 ERR_ExpectedQuote = 31164 ERR_ExpectedLT = 31165 ERR_StartAttributeValue = 31166 ERR_ExpectedDiv = 31167 ERR_NoXmlAxesLateBinding = 31168 ERR_IllegalXmlStartNameChar = 31169 ERR_IllegalXmlNameChar = 31170 ERR_IllegalXmlCommentChar = 31171 ERR_EmbeddedExpression = 31172 ERR_ExpectedXmlWhiteSpace = 31173 ERR_IllegalProcessingInstructionName = 31174 ERR_DTDNotSupported = 31175 'ERR_IllegalXmlChar = 31176 unused in Dev10 ERR_IllegalXmlWhiteSpace = 31177 ERR_ExpectedSColon = 31178 ERR_ExpectedXmlBeginEmbedded = 31179 ERR_XmlEntityReference = 31180 ERR_InvalidAttributeValue1 = 31181 ERR_InvalidAttributeValue2 = 31182 ERR_ReservedXmlNamespace = 31183 ERR_IllegalDefaultNamespace = 31184 'ERR_RequireAggregateInitializationImpl = 31185 ERR_QualifiedNameNotAllowed = 31186 ERR_ExpectedXmlns = 31187 'ERR_DefaultNamespaceNotSupported = 31188 Not reported by Dev10. ERR_IllegalXmlnsPrefix = 31189 ERR_XmlFeaturesNotAvailable = 31190 'ERR_UnableToEmbedUacManifest = 31191 now reporting ErrorCreatingWin32ResourceFile ERR_UnableToReadUacManifest2 = 31192 'ERR_UseValueForXmlExpression3 = 31193 ' Replaced by WRN_UseValueForXmlExpression3 ERR_TypeMismatchForXml3 = 31194 ERR_BinaryOperandsForXml4 = 31195 'ERR_XmlFeaturesNotAvailableDebugger = 31196 ERR_FullWidthAsXmlDelimiter = 31197 'ERR_XmlRequiresParens = 31198 No Longer Reported. Removed per 926946. ERR_XmlEndCDataNotAllowedInContent = 31198 'ERR_UacALink3Missing = 31199 not used in Roslyn. 'ERR_XmlFeaturesNotSupported = 31200 not detected by the Roslyn compiler ERR_EventImplRemoveHandlerParamWrong = 31201 ERR_MixingWinRTAndNETEvents = 31202 ERR_AddParamWrongForWinRT = 31203 ERR_RemoveParamWrongForWinRT = 31204 ERR_ReImplementingWinRTInterface5 = 31205 ERR_ReImplementingWinRTInterface4 = 31206 ERR_XmlEndElementNoMatchingStart = 31207 ERR_UndefinedTypeOrNamespace1 = 31208 ERR_BadInterfaceInterfaceSpecifier1 = 31209 ERR_TypeClashesWithVbCoreType4 = 31210 ERR_SecurityAttributeMissingAction = 31211 ERR_SecurityAttributeInvalidAction = 31212 ERR_SecurityAttributeInvalidActionAssembly = 31213 ERR_SecurityAttributeInvalidActionTypeOrMethod = 31214 ERR_PrincipalPermissionInvalidAction = 31215 ERR_PermissionSetAttributeInvalidFile = 31216 ERR_PermissionSetAttributeFileReadError = 31217 ERR_ExpectedWarningKeyword = 31218 '// NOTE: If you add any new errors that may be attached to a symbol during meta-import when it is marked as bad, '// particularly if it applies to method symbols, please appropriately modify Bindable::ResolveOverloadingShouldSkipBadMember. '// Failure to do so may break customer code. '// AVAILABLE 31219-31390 ERR_InvalidSubsystemVersion = 31391 ERR_LibAnycpu32bitPreferredConflict = 31392 ERR_RestrictedAccess = 31393 ERR_RestrictedConversion1 = 31394 ERR_NoTypecharInLabel = 31395 ERR_RestrictedType1 = 31396 ERR_NoTypecharInAlias = 31398 ERR_NoAccessibleConstructorOnBase = 31399 ERR_BadStaticLocalInStruct = 31400 ERR_DuplicateLocalStatic1 = 31401 ERR_ImportAliasConflictsWithType2 = 31403 ERR_CantShadowAMustOverride1 = 31404 'ERR_OptionalsCantBeStructs = 31405 ERR_MultipleEventImplMismatch3 = 31407 ERR_BadSpecifierCombo2 = 31408 ERR_MustBeOverloads2 = 31409 'ERR_CantOverloadOnMultipleInheritance = 31410 ERR_MustOverridesInClass1 = 31411 ERR_HandlesSyntaxInClass = 31412 ERR_SynthMemberShadowsMustOverride5 = 31413 'ERR_CantImplementNonVirtual3 = 31415 unused in Roslyn ' ERR_MemberShadowsSynthMustOverride5 = 31416 unused in Roslyn ERR_CannotOverrideInAccessibleMember = 31417 ERR_HandlesSyntaxInModule = 31418 ERR_IsNotOpRequiresReferenceTypes1 = 31419 ERR_ClashWithReservedEnumMember1 = 31420 ERR_MultiplyDefinedEnumMember2 = 31421 ERR_BadUseOfVoid = 31422 ERR_EventImplMismatch5 = 31423 ERR_ForwardedTypeUnavailable3 = 31424 ERR_TypeFwdCycle2 = 31425 ERR_BadTypeInCCExpression = 31426 ERR_BadCCExpression = 31427 ERR_VoidArrayDisallowed = 31428 ERR_MetadataMembersAmbiguous3 = 31429 ERR_TypeOfExprAlwaysFalse2 = 31430 ERR_OnlyPrivatePartialMethods1 = 31431 ERR_PartialMethodsMustBePrivate = 31432 ERR_OnlyOnePartialMethodAllowed2 = 31433 ERR_OnlyOneImplementingMethodAllowed3 = 31434 ERR_PartialMethodMustBeEmpty = 31435 ERR_PartialMethodsMustBeSub1 = 31437 ERR_PartialMethodGenericConstraints2 = 31438 ERR_PartialDeclarationImplements1 = 31439 ERR_NoPartialMethodInAddressOf1 = 31440 ERR_ImplementationMustBePrivate2 = 31441 ERR_PartialMethodParamNamesMustMatch3 = 31442 ERR_PartialMethodTypeParamNameMismatch3 = 31443 ERR_PropertyDoesntImplementAllAccessors = 31444 ERR_InvalidAttributeUsageOnAccessor = 31445 ERR_NestedTypeInInheritsClause2 = 31446 ERR_TypeInItsInheritsClause1 = 31447 ERR_BaseTypeReferences2 = 31448 ERR_IllegalBaseTypeReferences3 = 31449 ERR_InvalidCoClass1 = 31450 ERR_InvalidOutputName = 31451 ERR_InvalidFileAlignment = 31452 ERR_InvalidDebugInformationFormat = 31453 '// NOTE: If you add any new errors that may be attached to a symbol during meta-import when it is marked as bad, '// particularly if it applies to method symbols, please appropriately modify Bindable::ResolveOverloadingShouldSkipBadMember. '// Failure to do so may break customer code. '// AVAILABLE 31451 - 31497 ERR_ConstantStringTooLong = 31498 ERR_MustInheritEventNotOverridden = 31499 ERR_BadAttributeSharedProperty1 = 31500 ERR_BadAttributeReadOnlyProperty1 = 31501 ERR_DuplicateResourceName1 = 31502 ERR_AttributeMustBeClassNotStruct1 = 31503 ERR_AttributeMustInheritSysAttr = 31504 'ERR_AttributeMustHaveAttrUsageAttr = 31505 unused in Roslyn. ERR_AttributeCannotBeAbstract = 31506 ' ERR_AttributeCannotHaveMustOverride = 31507 - reported by dev10 but error is redundant. ERR_AttributeCannotBeAbstract covers this case. 'ERR_CantFindCORSystemDirectory = 31508 ERR_UnableToOpenResourceFile1 = 31509 'ERR_BadAttributeConstField1 = 31510 ERR_BadAttributeNonPublicProperty1 = 31511 ERR_STAThreadAndMTAThread0 = 31512 'ERR_STAThreadAndMTAThread1 = 31513 '//If you make any change involving this error, such as creating a more specific version for use '//in a particular context, please make sure to appropriately modify Bindable::ResolveOverloadingShouldSkipBadMember ERR_IndirectUnreferencedAssembly4 = 31515 ERR_BadAttributeNonPublicType1 = 31516 ERR_BadAttributeNonPublicContType2 = 31517 'ERR_AlinkManifestFilepathTooLong = 31518 this scenario reports a more generic error ERR_BadMetaDataReference1 = 31519 ' ERR_ErrorApplyingSecurityAttribute1 = 31520 ' ' we're now reporting more detailed diagnostics: ERR_SecurityAttributeMissingAction, ERR_SecurityAttributeInvalidAction, ERR_SecurityAttributeInvalidActionAssembly or ERR_SecurityAttributeInvalidActionTypeOrMethod 'ERR_DuplicateModuleAttribute1 = 31521 ERR_DllImportOnNonEmptySubOrFunction = 31522 ERR_DllImportNotLegalOnDeclare = 31523 ERR_DllImportNotLegalOnGetOrSet = 31524 'ERR_TypeImportedFromDiffAssemVersions3 = 31525 ERR_DllImportOnGenericSubOrFunction = 31526 ERR_ComClassOnGeneric = 31527 '//If you make any change involving this error, such as creating a more specific version for use '//in a particular context, please make sure to appropriately modify Bindable::ResolveOverloadingShouldSkipBadMember 'ERR_IndirectUnreferencedAssembly3 = 31528 ERR_DllImportOnInstanceMethod = 31529 ERR_DllImportOnInterfaceMethod = 31530 ERR_DllImportNotLegalOnEventMethod = 31531 '//If you make any change involving these errors, such as creating more specific versions for use '//in other contexts, please make sure to appropriately modify Bindable::ResolveOverloadingShouldSkipBadMember 'ERR_IndirectUnreferencedProject3 = 31532 'ERR_IndirectUnreferencedProject2 = 31533 ERR_FriendAssemblyBadArguments = 31534 ERR_FriendAssemblyStrongNameRequired = 31535 'ERR_FriendAssemblyRejectBinding = 31536 EDMAURER This has been replaced with two, more specific errors ERR_FriendRefNotEqualToThis and ERR_FriendRefSigningMismatch. ERR_FriendAssemblyNameInvalid = 31537 ERR_FriendAssemblyBadAccessOverride2 = 31538 ERR_AbsentReferenceToPIA1 = 31539 'ERR_CorlibMissingPIAClasses1 = 31540 EDMAURER Roslyn uses the ordinary missing required type message ERR_CannotLinkClassWithNoPIA1 = 31541 ERR_InvalidStructMemberNoPIA1 = 31542 ERR_NoPIAAttributeMissing2 = 31543 ERR_NestedGlobalNamespace = 31544 'ERR_NewCoClassNoPIA = 31545 EDMAURER Roslyn gives 31541 'ERR_EventNoPIANoDispID = 31546 'ERR_EventNoPIANoGuid1 = 31547 'ERR_EventNoPIANoComEventInterface1 = 31548 ERR_PIAHasNoAssemblyGuid1 = 31549 'ERR_StructureExplicitFieldLacksOffset = 31550 'ERR_CannotLinkEventInterfaceWithNoPIA1 = 31551 ERR_DuplicateLocalTypes3 = 31552 ERR_PIAHasNoTypeLibAttribute1 = 31553 ' ERR_NoPiaEventsMissingSystemCore = 31554 use ordinary missing required type ' ERR_SourceInterfaceMustExist = 31555 ERR_SourceInterfaceMustBeInterface = 31556 ERR_EventNoPIANoBackingMember = 31557 ERR_NestedInteropType = 31558 ' used to be ERR_InvalidInteropType ERR_IsNestedIn2 = 31559 ERR_LocalTypeNameClash2 = 31560 ERR_InteropMethodWithBody1 = 31561 ERR_UseOfLocalBeforeDeclaration1 = 32000 ERR_UseOfKeywordFromModule1 = 32001 'ERR_UseOfKeywordOutsideClass1 = 32002 'ERR_SymbolFromUnreferencedProject3 = 32004 ERR_BogusWithinLineIf = 32005 ERR_CharToIntegralTypeMismatch1 = 32006 ERR_IntegralToCharTypeMismatch1 = 32007 ERR_NoDirectDelegateConstruction1 = 32008 ERR_MethodMustBeFirstStatementOnLine = 32009 ERR_AttrAssignmentNotFieldOrProp1 = 32010 ERR_StrictDisallowsObjectComparison1 = 32013 ERR_NoConstituentArraySizes = 32014 ERR_FileAttributeNotAssemblyOrModule = 32015 ERR_FunctionResultCannotBeIndexed1 = 32016 ERR_ArgumentSyntax = 32017 ERR_ExpectedResumeOrGoto = 32019 ERR_ExpectedAssignmentOperator = 32020 ERR_NamedArgAlsoOmitted2 = 32021 ERR_CannotCallEvent1 = 32022 ERR_ForEachCollectionDesignPattern1 = 32023 ERR_DefaultValueForNonOptionalParam = 32024 ' ERR_RegionWithinMethod = 32025 removed this limitation in Roslyn 'ERR_SpecifiersInvalidOnNamespace = 32026 abandoned, now giving 'Specifiers and attributes are not valid on this statement.' ERR_ExpectedDotAfterMyBase = 32027 ERR_ExpectedDotAfterMyClass = 32028 ERR_StrictArgumentCopyBackNarrowing3 = 32029 ERR_LbElseifAfterElse = 32030 'ERR_EndSubNotAtLineStart = 32031 'ERR_EndFunctionNotAtLineStart = 32032 'ERR_EndGetNotAtLineStart = 32033 'ERR_EndSetNotAtLineStart = 32034 ERR_StandaloneAttribute = 32035 ERR_NoUniqueConstructorOnBase2 = 32036 ERR_ExtraNextVariable = 32037 ERR_RequiredNewCallTooMany2 = 32038 ERR_ForCtlVarArraySizesSpecified = 32039 ERR_BadFlagsOnNewOverloads = 32040 ERR_TypeCharOnGenericParam = 32041 ERR_TooFewGenericArguments1 = 32042 ERR_TooManyGenericArguments1 = 32043 ERR_GenericConstraintNotSatisfied2 = 32044 ERR_TypeOrMemberNotGeneric1 = 32045 ERR_NewIfNullOnGenericParam = 32046 ERR_MultipleClassConstraints1 = 32047 ERR_ConstNotClassInterfaceOrTypeParam1 = 32048 ERR_DuplicateTypeParamName1 = 32049 ERR_UnboundTypeParam2 = 32050 ERR_IsOperatorGenericParam1 = 32052 ERR_ArgumentCopyBackNarrowing3 = 32053 ERR_ShadowingGenericParamWithMember1 = 32054 ERR_GenericParamBase2 = 32055 ERR_ImplementsGenericParam = 32056 'ERR_ExpressionCannotBeGeneric1 = 32058 unused in Roslyn ERR_OnlyNullLowerBound = 32059 ERR_ClassConstraintNotInheritable1 = 32060 ERR_ConstraintIsRestrictedType1 = 32061 ERR_GenericParamsOnInvalidMember = 32065 ERR_GenericArgsOnAttributeSpecifier = 32066 ERR_AttrCannotBeGenerics = 32067 ERR_BadStaticLocalInGenericMethod = 32068 ERR_SyntMemberShadowsGenericParam3 = 32070 ERR_ConstraintAlreadyExists1 = 32071 ERR_InterfacePossiblyImplTwice2 = 32072 ERR_ModulesCannotBeGeneric = 32073 ERR_GenericClassCannotInheritAttr = 32074 ERR_DeclaresCantBeInGeneric = 32075 'ERR_GenericTypeRequiresTypeArgs1 = 32076 ERR_OverrideWithConstraintMismatch2 = 32077 ERR_ImplementsWithConstraintMismatch3 = 32078 ERR_OpenTypeDisallowed = 32079 ERR_HandlesInvalidOnGenericMethod = 32080 ERR_MultipleNewConstraints = 32081 ERR_MustInheritForNewConstraint2 = 32082 ERR_NoSuitableNewForNewConstraint2 = 32083 ERR_BadGenericParamForNewConstraint2 = 32084 ERR_NewArgsDisallowedForTypeParam = 32085 ERR_DuplicateRawGenericTypeImport1 = 32086 ERR_NoTypeArgumentCountOverloadCand1 = 32087 ERR_TypeArgsUnexpected = 32088 ERR_NameSameAsMethodTypeParam1 = 32089 ERR_TypeParamNameFunctionNameCollision = 32090 'ERR_OverloadsMayUnify2 = 32091 unused in Roslyn ERR_BadConstraintSyntax = 32092 ERR_OfExpected = 32093 ERR_ArrayOfRawGenericInvalid = 32095 ERR_ForEachAmbiguousIEnumerable1 = 32096 ERR_IsNotOperatorGenericParam1 = 32097 ERR_TypeParamQualifierDisallowed = 32098 ERR_TypeParamMissingCommaOrRParen = 32099 ERR_TypeParamMissingAsCommaOrRParen = 32100 ERR_MultipleReferenceConstraints = 32101 ERR_MultipleValueConstraints = 32102 ERR_NewAndValueConstraintsCombined = 32103 ERR_RefAndValueConstraintsCombined = 32104 ERR_BadTypeArgForStructConstraint2 = 32105 ERR_BadTypeArgForRefConstraint2 = 32106 ERR_RefAndClassTypeConstrCombined = 32107 ERR_ValueAndClassTypeConstrCombined = 32108 ERR_ConstraintClashIndirectIndirect4 = 32109 ERR_ConstraintClashDirectIndirect3 = 32110 ERR_ConstraintClashIndirectDirect3 = 32111 ERR_ConstraintCycleLink2 = 32112 ERR_ConstraintCycle2 = 32113 ERR_TypeParamWithStructConstAsConst = 32114 ERR_NullableDisallowedForStructConstr1 = 32115 'ERR_NoAccessibleNonGeneric1 = 32117 'ERR_NoAccessibleGeneric1 = 32118 ERR_ConflictingDirectConstraints3 = 32119 ERR_InterfaceUnifiesWithInterface2 = 32120 ERR_BaseUnifiesWithInterfaces3 = 32121 ERR_InterfaceBaseUnifiesWithBase4 = 32122 ERR_InterfaceUnifiesWithBase3 = 32123 ERR_OptionalsCantBeStructGenericParams = 32124 'TODO: remove 'ERR_InterfaceMethodImplsUnify3 = 32125 ERR_AddressOfNullableMethod = 32126 ERR_IsOperatorNullable1 = 32127 ERR_IsNotOperatorNullable1 = 32128 'ERR_NullableOnEnum = 32129 'ERR_NoNullableType = 32130 unused in Roslyn ERR_ClassInheritsBaseUnifiesWithInterfaces3 = 32131 ERR_ClassInheritsInterfaceBaseUnifiesWithBase4 = 32132 ERR_ClassInheritsInterfaceUnifiesWithBase3 = 32133 ERR_ShadowingTypeOutsideClass1 = 32200 ERR_PropertySetParamCollisionWithValue = 32201 'ERR_EventNameTooLong = 32204 ' Deprecated in favor of ERR_TooLongMetadataName 'ERR_WithEventsNameTooLong = 32205 ' Deprecated in favor of ERR_TooLongMetadataName ERR_SxSIndirectRefHigherThanDirectRef3 = 32207 ERR_DuplicateReference2 = 32208 'ERR_SxSLowerVerIndirectRefNotEmitted4 = 32209 not used in Roslyn ERR_DuplicateReferenceStrong = 32210 ERR_IllegalCallOrIndex = 32303 ERR_ConflictDefaultPropertyAttribute = 32304 'ERR_ClassCannotCreated = 32400 ERR_BadAttributeUuid2 = 32500 ERR_ComClassAndReservedAttribute1 = 32501 ERR_ComClassRequiresPublicClass2 = 32504 ERR_ComClassReservedDispIdZero1 = 32505 ERR_ComClassReservedDispId1 = 32506 ERR_ComClassDuplicateGuids1 = 32507 ERR_ComClassCantBeAbstract0 = 32508 ERR_ComClassRequiresPublicClass1 = 32509 'ERR_DefaultCharSetAttributeNotSupported = 32510 ERR_UnknownOperator = 33000 ERR_DuplicateConversionCategoryUsed = 33001 ERR_OperatorNotOverloadable = 33002 ERR_InvalidHandles = 33003 ERR_InvalidImplements = 33004 ERR_EndOperatorExpected = 33005 ERR_EndOperatorNotAtLineStart = 33006 ERR_InvalidEndOperator = 33007 ERR_ExitOperatorNotValid = 33008 ERR_ParamArrayIllegal1 = 33009 ERR_OptionalIllegal1 = 33010 ERR_OperatorMustBePublic = 33011 ERR_OperatorMustBeShared = 33012 ERR_BadOperatorFlags1 = 33013 ERR_OneParameterRequired1 = 33014 ERR_TwoParametersRequired1 = 33015 ERR_OneOrTwoParametersRequired1 = 33016 ERR_ConvMustBeWideningOrNarrowing = 33017 ERR_OperatorDeclaredInModule = 33018 ERR_InvalidSpecifierOnNonConversion1 = 33019 ERR_UnaryParamMustBeContainingType1 = 33020 ERR_BinaryParamMustBeContainingType1 = 33021 ERR_ConvParamMustBeContainingType1 = 33022 ERR_OperatorRequiresBoolReturnType1 = 33023 ERR_ConversionToSameType = 33024 ERR_ConversionToInterfaceType = 33025 ERR_ConversionToBaseType = 33026 ERR_ConversionToDerivedType = 33027 ERR_ConversionToObject = 33028 ERR_ConversionFromInterfaceType = 33029 ERR_ConversionFromBaseType = 33030 ERR_ConversionFromDerivedType = 33031 ERR_ConversionFromObject = 33032 ERR_MatchingOperatorExpected2 = 33033 ERR_UnacceptableLogicalOperator3 = 33034 ERR_ConditionOperatorRequired3 = 33035 ERR_CopyBackTypeMismatch3 = 33037 ERR_ForLoopOperatorRequired2 = 33038 ERR_UnacceptableForLoopOperator2 = 33039 ERR_UnacceptableForLoopRelOperator2 = 33040 ERR_OperatorRequiresIntegerParameter1 = 33041 ERR_CantSpecifyNullableOnBoth = 33100 ERR_BadTypeArgForStructConstraintNull = 33101 ERR_CantSpecifyArrayAndNullableOnBoth = 33102 ERR_CantSpecifyTypeCharacterOnIIF = 33103 ERR_IllegalOperandInIIFCount = 33104 ERR_IllegalOperandInIIFName = 33105 ERR_IllegalOperandInIIFConversion = 33106 ERR_IllegalCondTypeInIIF = 33107 ERR_CantCallIIF = 33108 ERR_CantSpecifyAsNewAndNullable = 33109 ERR_IllegalOperandInIIFConversion2 = 33110 ERR_BadNullTypeInCCExpression = 33111 ERR_NullableImplicit = 33112 '// NOTE: If you add any new errors that may be attached to a symbol during meta-import when it is marked as bad, '// particularly if it applies to method symbols, please appropriately modify Bindable::ResolveOverloadingShouldSkipBadMember. '// Failure to do so may break customer code. '// AVAILABLE 33113 - 34999 ERR_MissingRuntimeHelper = 35000 'ERR_NoStdModuleAttribute = 35001 ' Note: we're now reporting a use site error in this case. 'ERR_NoOptionTextAttribute = 35002 ERR_DuplicateResourceFileName1 = 35003 ERR_ExpectedDotAfterGlobalNameSpace = 36000 ERR_NoGlobalExpectedIdentifier = 36001 ERR_NoGlobalInHandles = 36002 ERR_ElseIfNoMatchingIf = 36005 ERR_BadAttributeConstructor2 = 36006 ERR_EndUsingWithoutUsing = 36007 ERR_ExpectedEndUsing = 36008 ERR_GotoIntoUsing = 36009 ERR_UsingRequiresDisposePattern = 36010 ERR_UsingResourceVarNeedsInitializer = 36011 ERR_UsingResourceVarCantBeArray = 36012 ERR_OnErrorInUsing = 36013 ERR_PropertyNameConflictInMyCollection = 36015 ERR_InvalidImplicitVar = 36016 ERR_ObjectInitializerRequiresFieldName = 36530 ERR_ExpectedFrom = 36531 ERR_LambdaBindingMismatch1 = 36532 ERR_CannotLiftByRefParamQuery1 = 36533 ERR_ExpressionTreeNotSupported = 36534 ERR_CannotLiftStructureMeQuery = 36535 ERR_InferringNonArrayType1 = 36536 ERR_ByRefParamInExpressionTree = 36538 'ERR_ObjectInitializerBadValue = 36543 '// If you change this message, make sure to change message for QueryDuplicateAnonTypeMemberName1 as well! ERR_DuplicateAnonTypeMemberName1 = 36547 ERR_BadAnonymousTypeForExprTree = 36548 ERR_CannotLiftAnonymousType1 = 36549 ERR_ExtensionOnlyAllowedOnModuleSubOrFunction = 36550 ERR_ExtensionMethodNotInModule = 36551 ERR_ExtensionMethodNoParams = 36552 ERR_ExtensionMethodOptionalFirstArg = 36553 ERR_ExtensionMethodParamArrayFirstArg = 36554 '// If you change this message, make sure to change message for QueryAnonymousTypeFieldNameInference as well! 'ERR_BadOrCircularInitializerReference = 36555 ERR_AnonymousTypeFieldNameInference = 36556 ERR_NameNotMemberOfAnonymousType2 = 36557 ERR_ExtensionAttributeInvalid = 36558 ERR_AnonymousTypePropertyOutOfOrder1 = 36559 '// If you change this message, make sure to change message for QueryAnonymousTypeDisallowsTypeChar as well! ERR_AnonymousTypeDisallowsTypeChar = 36560 ERR_ExtensionMethodUncallable1 = 36561 ERR_ExtensionMethodOverloadCandidate3 = 36562 ERR_DelegateBindingMismatch = 36563 ERR_DelegateBindingTypeInferenceFails = 36564 ERR_TooManyArgs = 36565 ERR_NamedArgAlsoOmitted1 = 36566 ERR_NamedArgUsedTwice1 = 36567 ERR_NamedParamNotFound1 = 36568 ERR_OmittedArgument1 = 36569 ERR_UnboundTypeParam1 = 36572 ERR_ExtensionMethodOverloadCandidate2 = 36573 ERR_AnonymousTypeNeedField = 36574 ERR_AnonymousTypeNameWithoutPeriod = 36575 ERR_AnonymousTypeExpectedIdentifier = 36576 'ERR_NoAnonymousTypeInitializersInDebugger = 36577 'ERR_TooFewGenericArguments = 36578 'ERR_TooManyGenericArguments = 36579 'ERR_DelegateBindingMismatch3_3 = 36580 unused in Roslyn 'ERR_DelegateBindingTypeInferenceFails3 = 36581 ERR_TooManyArgs2 = 36582 ERR_NamedArgAlsoOmitted3 = 36583 ERR_NamedArgUsedTwice3 = 36584 ERR_NamedParamNotFound3 = 36585 ERR_OmittedArgument3 = 36586 ERR_UnboundTypeParam3 = 36589 ERR_TooFewGenericArguments2 = 36590 ERR_TooManyGenericArguments2 = 36591 ERR_ExpectedInOrEq = 36592 ERR_ExpectedQueryableSource = 36593 ERR_QueryOperatorNotFound = 36594 ERR_CannotUseOnErrorGotoWithClosure = 36595 ERR_CannotGotoNonScopeBlocksWithClosure = 36597 ERR_CannotLiftRestrictedTypeQuery = 36598 ERR_QueryAnonymousTypeFieldNameInference = 36599 ERR_QueryDuplicateAnonTypeMemberName1 = 36600 ERR_QueryAnonymousTypeDisallowsTypeChar = 36601 ERR_ReadOnlyInClosure = 36602 ERR_ExprTreeNoMultiDimArrayCreation = 36603 ERR_ExprTreeNoLateBind = 36604 ERR_ExpectedBy = 36605 ERR_QueryInvalidControlVariableName1 = 36606 ERR_ExpectedIn = 36607 'ERR_QueryStartsWithLet = 36608 'ERR_NoQueryExpressionsInDebugger = 36609 ERR_QueryNameNotDeclared = 36610 '// Available 36611 ERR_NestedFunctionArgumentNarrowing3 = 36612 '// If you change this message, make sure to change message for QueryAnonTypeFieldXMLNameInference as well! ERR_AnonTypeFieldXMLNameInference = 36613 ERR_QueryAnonTypeFieldXMLNameInference = 36614 ERR_ExpectedInto = 36615 'ERR_AggregateStartsWithLet = 36616 ERR_TypeCharOnAggregation = 36617 ERR_ExpectedOn = 36618 ERR_ExpectedEquals = 36619 ERR_ExpectedAnd = 36620 ERR_EqualsTypeMismatch = 36621 ERR_EqualsOperandIsBad = 36622 '// see 30581 (lambda version of addressof) ERR_LambdaNotDelegate1 = 36625 '// see 30939 (lambda version of addressof) ERR_LambdaNotCreatableDelegate1 = 36626 'ERR_NoLambdaExpressionsInDebugger = 36627 ERR_CannotInferNullableForVariable1 = 36628 ERR_NullableTypeInferenceNotSupported = 36629 ERR_ExpectedJoin = 36631 ERR_NullableParameterMustSpecifyType = 36632 ERR_IterationVariableShadowLocal2 = 36633 ERR_LambdasCannotHaveAttributes = 36634 ERR_LambdaInSelectCaseExpr = 36635 ERR_AddressOfInSelectCaseExpr = 36636 ERR_NullableCharNotSupported = 36637 '// The follow error messages are paired with other query specific messages above. Please '// make sure to keep the two in sync ERR_CannotLiftStructureMeLambda = 36638 ERR_CannotLiftByRefParamLambda1 = 36639 ERR_CannotLiftRestrictedTypeLambda = 36640 ERR_LambdaParamShadowLocal1 = 36641 ERR_StrictDisallowImplicitObjectLambda = 36642 ERR_CantSpecifyParamsOnLambdaParamNoType = 36643 ERR_TypeInferenceFailure1 = 36644 ERR_TypeInferenceFailure2 = 36645 ERR_TypeInferenceFailure3 = 36646 ERR_TypeInferenceFailureNoExplicit1 = 36647 ERR_TypeInferenceFailureNoExplicit2 = 36648 ERR_TypeInferenceFailureNoExplicit3 = 36649 ERR_TypeInferenceFailureAmbiguous1 = 36650 ERR_TypeInferenceFailureAmbiguous2 = 36651 ERR_TypeInferenceFailureAmbiguous3 = 36652 ERR_TypeInferenceFailureNoExplicitAmbiguous1 = 36653 ERR_TypeInferenceFailureNoExplicitAmbiguous2 = 36654 ERR_TypeInferenceFailureNoExplicitAmbiguous3 = 36655 ERR_TypeInferenceFailureNoBest1 = 36656 ERR_TypeInferenceFailureNoBest2 = 36657 ERR_TypeInferenceFailureNoBest3 = 36658 ERR_TypeInferenceFailureNoExplicitNoBest1 = 36659 ERR_TypeInferenceFailureNoExplicitNoBest2 = 36660 ERR_TypeInferenceFailureNoExplicitNoBest3 = 36661 ERR_DelegateBindingMismatchStrictOff2 = 36663 'ERR_TooDeepNestingOfParensInLambdaParam = 36664 - No Longer Reported. Removed per 926942 ' ERR_InaccessibleReturnTypeOfSymbol1 = 36665 ERR_InaccessibleReturnTypeOfMember2 = 36666 ERR_LocalNamedSameAsParamInLambda1 = 36667 ERR_MultilineLambdasCannotContainOnError = 36668 'ERR_BranchOutOfMultilineLambda = 36669 obsolete - was not even reported in Dev10 any more. ERR_LambdaBindingMismatch2 = 36670 ERR_MultilineLambdaShadowLocal1 = 36671 ERR_StaticInLambda = 36672 ERR_MultilineLambdaMissingSub = 36673 ERR_MultilineLambdaMissingFunction = 36674 ERR_StatementLambdaInExpressionTree = 36675 ' //ERR_StrictDisallowsImplicitLambda = 36676 ' // replaced by LambdaNoType and LambdaNoTypeObjectDisallowed and LambdaTooManyTypesObjectDisallowed ERR_AttributeOnLambdaReturnType = 36677 ERR_ExpectedIdentifierOrGroup = 36707 ERR_UnexpectedGroup = 36708 ERR_DelegateBindingMismatchStrictOff3 = 36709 ERR_DelegateBindingIncompatible3 = 36710 ERR_ArgumentNarrowing2 = 36711 ERR_OverloadCandidate1 = 36712 ERR_AutoPropertyInitializedInStructure = 36713 ERR_InitializedExpandedProperty = 36714 ERR_NewExpandedProperty = 36715 ERR_LanguageVersion = 36716 ERR_ArrayInitNoType = 36717 ERR_NotACollection1 = 36718 ERR_NoAddMethod1 = 36719 ERR_CantCombineInitializers = 36720 ERR_EmptyAggregateInitializer = 36721 ERR_VarianceDisallowedHere = 36722 ERR_VarianceInterfaceNesting = 36723 ERR_VarianceOutParamDisallowed1 = 36724 ERR_VarianceInParamDisallowed1 = 36725 ERR_VarianceOutParamDisallowedForGeneric3 = 36726 ERR_VarianceInParamDisallowedForGeneric3 = 36727 ERR_VarianceOutParamDisallowedHere2 = 36728 ERR_VarianceInParamDisallowedHere2 = 36729 ERR_VarianceOutParamDisallowedHereForGeneric4 = 36730 ERR_VarianceInParamDisallowedHereForGeneric4 = 36731 ERR_VarianceTypeDisallowed2 = 36732 ERR_VarianceTypeDisallowedForGeneric4 = 36733 ERR_LambdaTooManyTypesObjectDisallowed = 36734 ERR_VarianceTypeDisallowedHere3 = 36735 ERR_VarianceTypeDisallowedHereForGeneric5 = 36736 ERR_AmbiguousCastConversion2 = 36737 ERR_VariancePreventsSynthesizedEvents2 = 36738 ERR_NestingViolatesCLS1 = 36739 ERR_VarianceOutNullableDisallowed2 = 36740 ERR_VarianceInNullableDisallowed2 = 36741 ERR_VarianceOutByValDisallowed1 = 36742 ERR_VarianceInReturnDisallowed1 = 36743 ERR_VarianceOutConstraintDisallowed1 = 36744 ERR_VarianceInReadOnlyPropertyDisallowed1 = 36745 ERR_VarianceOutWriteOnlyPropertyDisallowed1 = 36746 ERR_VarianceOutPropertyDisallowed1 = 36747 ERR_VarianceInPropertyDisallowed1 = 36748 ERR_VarianceOutByRefDisallowed1 = 36749 ERR_VarianceInByRefDisallowed1 = 36750 ERR_LambdaNoType = 36751 ' //ERR_NoReturnStatementsForMultilineLambda = 36752 ' // replaced by LambdaNoType and LambdaNoTypeObjectDisallowed 'ERR_CollectionInitializerArity2 = 36753 ERR_VarianceConversionFailedOut6 = 36754 ERR_VarianceConversionFailedIn6 = 36755 ERR_VarianceIEnumerableSuggestion3 = 36756 ERR_VarianceConversionFailedTryOut4 = 36757 ERR_VarianceConversionFailedTryIn4 = 36758 ERR_AutoPropertyCantHaveParams = 36759 ERR_IdentityDirectCastForFloat = 36760 ERR_TypeDisallowsElements = 36807 ERR_TypeDisallowsAttributes = 36808 ERR_TypeDisallowsDescendants = 36809 'ERR_XmlSchemaCompileError = 36810 ERR_TypeOrMemberNotGeneric2 = 36907 ERR_ExtensionMethodCannotBeLateBound = 36908 ERR_TypeInferenceArrayRankMismatch1 = 36909 ERR_QueryStrictDisallowImplicitObject = 36910 ERR_IfNoType = 36911 ERR_IfNoTypeObjectDisallowed = 36912 ERR_IfTooManyTypesObjectDisallowed = 36913 ERR_ArrayInitNoTypeObjectDisallowed = 36914 ERR_ArrayInitTooManyTypesObjectDisallowed = 36915 ERR_LambdaNoTypeObjectDisallowed = 36916 ERR_OverloadsModifierInModule = 36917 ERR_SubRequiresSingleStatement = 36918 ERR_SubDisallowsStatement = 36919 ERR_SubRequiresParenthesesLParen = 36920 ERR_SubRequiresParenthesesDot = 36921 ERR_SubRequiresParenthesesBang = 36922 ERR_CannotEmbedInterfaceWithGeneric = 36923 ERR_CannotUseGenericTypeAcrossAssemblyBoundaries = 36924 ERR_CannotUseGenericBaseTypeAcrossAssemblyBoundaries = 36925 ERR_BadAsyncByRefParam = 36926 ERR_BadIteratorByRefParam = 36927 ERR_BadAsyncExpressionLambda = 36928 ERR_BadAsyncInQuery = 36929 ERR_BadGetAwaiterMethod1 = 36930 'ERR_ExpressionTreeContainsAwait = 36931 ERR_RestrictedResumableType1 = 36932 ERR_BadAwaitNothing = 36933 ERR_AsyncSubMain = 36934 ERR_PartialMethodsMustNotBeAsync1 = 36935 ERR_InvalidAsyncIteratorModifiers = 36936 ERR_BadAwaitNotInAsyncMethodOrLambda = 36937 ERR_BadIteratorReturn = 36938 ERR_BadYieldInTryHandler = 36939 ERR_BadYieldInNonIteratorMethod = 36940 '// unused 36941 ERR_BadReturnValueInIterator = 36942 ERR_BadAwaitInTryHandler = 36943 ERR_BadAwaitObject = 36944 ERR_BadAsyncReturn = 36945 ERR_BadResumableAccessReturnVariable = 36946 ERR_BadIteratorExpressionLambda = 36947 'ERR_AwaitLibraryMissing = 36948 'ERR_AwaitPattern1 = 36949 ERR_ConstructorAsync = 36950 ERR_InvalidLambdaModifier = 36951 ERR_ReturnFromNonGenericTaskAsync = 36952 ERR_BadAutoPropertyFlags1 = 36953 ERR_BadOverloadCandidates2 = 36954 ERR_BadStaticInitializerInResumable = 36955 ERR_ResumablesCannotContainOnError = 36956 ERR_FriendRefNotEqualToThis = 36957 ERR_FriendRefSigningMismatch = 36958 ERR_FailureSigningAssembly = 36960 ERR_SignButNoPrivateKey = 36961 ERR_InvalidVersionFormat = 36962 ERR_ExpectedSingleScript = 36963 ERR_ReferenceDirectiveOnlyAllowedInScripts = 36964 ERR_NamespaceNotAllowedInScript = 36965 ERR_KeywordNotAllowedInScript = 36966 ERR_ReservedAssemblyName = 36968 ERR_ConstructorCannotBeDeclaredPartial = 36969 ERR_ModuleEmitFailure = 36970 ERR_ParameterNotValidForType = 36971 ERR_MarshalUnmanagedTypeNotValidForFields = 36972 ERR_MarshalUnmanagedTypeOnlyValidForFields = 36973 ERR_AttributeParameterRequired1 = 36974 ERR_AttributeParameterRequired2 = 36975 ERR_InvalidVersionFormat2 = 36976 ERR_InvalidAssemblyCultureForExe = 36977 ERR_InvalidMultipleAttributeUsageInNetModule2 = 36978 ERR_SecurityAttributeInvalidTarget = 36979 ERR_PublicKeyFileFailure = 36980 ERR_PublicKeyContainerFailure = 36981 ERR_InvalidAssemblyCulture = 36982 ERR_EncUpdateFailedMissingAttribute = 36983 ERR_CantAwaitAsyncSub1 = 37001 ERR_ResumableLambdaInExpressionTree = 37050 ERR_DllImportOnResumableMethod = 37051 ERR_CannotLiftRestrictedTypeResumable1 = 37052 ERR_BadIsCompletedOnCompletedGetResult2 = 37053 ERR_SynchronizedAsyncMethod = 37054 ERR_BadAsyncReturnOperand1 = 37055 ERR_DoesntImplementAwaitInterface2 = 37056 ERR_BadAwaitInNonAsyncMethod = 37057 ERR_BadAwaitInNonAsyncVoidMethod = 37058 ERR_BadAwaitInNonAsyncLambda = 37059 ERR_LoopControlMustNotAwait = 37060 ERR_MyGroupCollectionAttributeCycle = 37201 ERR_LiteralExpected = 37202 ERR_PartialMethodDefaultParameterValueMismatch2 = 37203 ERR_PartialMethodParamArrayMismatch2 = 37204 ERR_NetModuleNameMismatch = 37205 ERR_BadCompilationOption = 37206 ERR_CmdOptionConflictsSource = 37207 ' unused 37208 ERR_InvalidSignaturePublicKey = 37209 ERR_CollisionWithPublicTypeInModule = 37210 ERR_ExportedTypeConflictsWithDeclaration = 37211 ERR_ExportedTypesConflict = 37212 ERR_AgnosticToMachineModule = 37213 ERR_ConflictingMachineModule = 37214 ERR_CryptoHashFailed = 37215 ERR_CantHaveWin32ResAndManifest = 37216 ERR_ForwardedTypeConflictsWithDeclaration = 37217 ERR_ForwardedTypeConflictsWithExportedType = 37218 ERR_ForwardedTypesConflict = 37219 ERR_TooLongMetadataName = 37220 ERR_MissingNetModuleReference = 37221 ERR_UnsupportedModule1 = 37222 ERR_UnsupportedEvent1 = 37223 ERR_NetModuleNameMustBeUnique = 37224 ERR_PDBWritingFailed = 37225 ERR_ParamDefaultValueDiffersFromAttribute = 37226 ERR_ResourceInModule = 37227 ERR_FieldHasMultipleDistinctConstantValues = 37228 ERR_AmbiguousInNamespaces2 = 37229 ERR_EncNoPIAReference = 37230 ERR_LinkedNetmoduleMetadataMustProvideFullPEImage = 37231 ERR_CantReadRulesetFile = 37232 ERR_MetadataReferencesNotSupported = 37233 ERR_PlatformDoesntSupport = 37234 ERR_CantUseRequiredAttribute = 37235 ERR_EncodinglessSyntaxTree = 37236 ERR_InvalidFormatSpecifier = 37237 ERR_CannotBeMadeNullable1 = 37238 ERR_BadConditionalWithRef = 37239 ERR_NullPropagatingOpInExpressionTree = 37240 ERR_TooLongOrComplexExpression = 37241 ERR_BadPdbData = 37242 ERR_AutoPropertyCantBeWriteOnly = 37243 ERR_ExpressionDoesntHaveName = 37244 ERR_InvalidNameOfSubExpression = 37245 ERR_MethodTypeArgsUnexpected = 37246 ERR_InReferencedAssembly = 37247 ERR_EncReferenceToAddedMember = 37248 ERR_InterpolationFormatWhitespace = 37249 ERR_InterpolationAlignmentOutOfRange = 37250 ERR_InterpolatedStringFactoryError = 37251 ERR_DebugEntryPointNotSourceMethodDefinition = 37252 ERR_InvalidPathMap = 37253 ERR_PublicSignNoKey = 37254 ERR_TooManyUserStrings = 37255 ERR_PeWritingFailure = 37256 ERR_OptionMustBeAbsolutePath = 37257 ERR_SourceLinkRequiresPortablePdb = 37258 ERR_LastPlusOne '// WARNINGS BEGIN HERE WRN_UseOfObsoleteSymbol2 = 40000 WRN_MustOverloadBase4 = 40003 WRN_OverrideType5 = 40004 WRN_MustOverride2 = 40005 WRN_DefaultnessShadowed4 = 40007 WRN_UseOfObsoleteSymbolNoMessage1 = 40008 WRN_AssemblyGeneration0 = 40009 WRN_AssemblyGeneration1 = 40010 WRN_ComClassNoMembers1 = 40011 WRN_SynthMemberShadowsMember5 = 40012 WRN_MemberShadowsSynthMember6 = 40014 WRN_SynthMemberShadowsSynthMember7 = 40018 WRN_UseOfObsoletePropertyAccessor3 = 40019 WRN_UseOfObsoletePropertyAccessor2 = 40020 ' WRN_MemberShadowsMemberInModule5 = 40021 ' no repro in legacy test, most probably not reachable. Unused in Roslyn. ' WRN_SynthMemberShadowsMemberInModule5 = 40022 ' no repro in legacy test, most probably not reachable. Unused in Roslyn. ' WRN_MemberShadowsSynthMemberInModule6 = 40023 ' no repro in legacy test, most probably not reachable. Unused in Roslyn. ' WRN_SynthMemberShadowsSynthMemberMod7 = 40024 ' no repro in legacy test, most probably not reachable. Unused in Roslyn. WRN_FieldNotCLSCompliant1 = 40025 WRN_BaseClassNotCLSCompliant2 = 40026 WRN_ProcTypeNotCLSCompliant1 = 40027 WRN_ParamNotCLSCompliant1 = 40028 WRN_InheritedInterfaceNotCLSCompliant2 = 40029 WRN_CLSMemberInNonCLSType3 = 40030 WRN_NameNotCLSCompliant1 = 40031 WRN_EnumUnderlyingTypeNotCLS1 = 40032 WRN_NonCLSMemberInCLSInterface1 = 40033 WRN_NonCLSMustOverrideInCLSType1 = 40034 WRN_ArrayOverloadsNonCLS2 = 40035 WRN_RootNamespaceNotCLSCompliant1 = 40038 WRN_RootNamespaceNotCLSCompliant2 = 40039 WRN_GenericConstraintNotCLSCompliant1 = 40040 WRN_TypeNotCLSCompliant1 = 40041 WRN_OptionalValueNotCLSCompliant1 = 40042 WRN_CLSAttrInvalidOnGetSet = 40043 WRN_TypeConflictButMerged6 = 40046 ' WRN_TypeConflictButMerged7 = 40047 ' deprecated WRN_ShadowingGenericParamWithParam1 = 40048 WRN_CannotFindStandardLibrary1 = 40049 WRN_EventDelegateTypeNotCLSCompliant2 = 40050 WRN_DebuggerHiddenIgnoredOnProperties = 40051 WRN_SelectCaseInvalidRange = 40052 WRN_CLSEventMethodInNonCLSType3 = 40053 WRN_ExpectedInitComponentCall2 = 40054 WRN_NamespaceCaseMismatch3 = 40055 WRN_UndefinedOrEmptyNamespaceOrClass1 = 40056 WRN_UndefinedOrEmptyProjectNamespaceOrClass1 = 40057 'WRN_InterfacesWithNoPIAMustHaveGuid1 = 40058 ' Not reported by Dev11. WRN_IndirectRefToLinkedAssembly2 = 40059 WRN_DelaySignButNoKey = 40060 WRN_UnimplementedCommandLineSwitch = 40998 ' WRN_DuplicateAssemblyAttribute1 = 41000 'unused in Roslyn WRN_NoNonObsoleteConstructorOnBase3 = 41001 WRN_NoNonObsoleteConstructorOnBase4 = 41002 WRN_RequiredNonObsoleteNewCall3 = 41003 WRN_RequiredNonObsoleteNewCall4 = 41004 WRN_MissingAsClauseinOperator = 41005 WRN_ConstraintsFailedForInferredArgs2 = 41006 WRN_ConditionalNotValidOnFunction = 41007 WRN_UseSwitchInsteadOfAttribute = 41008 '// AVAILABLE 41009 - 41199 WRN_ReferencedAssemblyDoesNotHaveStrongName = 41997 WRN_RecursiveAddHandlerCall = 41998 WRN_ImplicitConversionCopyBack = 41999 WRN_MustShadowOnMultipleInheritance2 = 42000 ' WRN_ObsoleteClassInitialize = 42001 ' deprecated ' WRN_ObsoleteClassTerminate = 42002 ' deprecated WRN_RecursiveOperatorCall = 42004 ' WRN_IndirectlyImplementedBaseMember5 = 42014 ' deprecated ' WRN_ImplementedBaseMember4 = 42015 ' deprecated WRN_ImplicitConversionSubst1 = 42016 '// populated by 42350/42332/42336/42337/42338/42339/42340 WRN_LateBindingResolution = 42017 WRN_ObjectMath1 = 42018 WRN_ObjectMath2 = 42019 WRN_ObjectAssumedVar1 = 42020 ' // populated by 42111/42346 WRN_ObjectAssumed1 = 42021 ' // populated by 42347/41005/42341/42342/42344/42345/42334/42343 WRN_ObjectAssumedProperty1 = 42022 ' // populated by 42348 '// AVAILABLE 42023 WRN_UnusedLocal = 42024 WRN_SharedMemberThroughInstance = 42025 WRN_RecursivePropertyCall = 42026 WRN_OverlappingCatch = 42029 WRN_DefAsgUseNullRefByRef = 42030 WRN_DuplicateCatch = 42031 WRN_ObjectMath1Not = 42032 WRN_BadChecksumValExtChecksum = 42033 WRN_MultipleDeclFileExtChecksum = 42034 WRN_BadGUIDFormatExtChecksum = 42035 WRN_ObjectMathSelectCase = 42036 WRN_EqualToLiteralNothing = 42037 WRN_NotEqualToLiteralNothing = 42038 '// AVAILABLE 42039 - 42098 WRN_UnusedLocalConst = 42099 '// UNAVAILABLE 42100 WRN_ComClassInterfaceShadows5 = 42101 WRN_ComClassPropertySetObject1 = 42102 '// only reference types are considered for definite assignment. '// DefAsg's are all under VB_advanced WRN_DefAsgUseNullRef = 42104 WRN_DefAsgNoRetValFuncRef1 = 42105 WRN_DefAsgNoRetValOpRef1 = 42106 WRN_DefAsgNoRetValPropRef1 = 42107 WRN_DefAsgUseNullRefByRefStr = 42108 WRN_DefAsgUseNullRefStr = 42109 ' WRN_FieldInForNotExplicit = 42110 'unused in Roslyn WRN_StaticLocalNoInference = 42111 '// AVAILABLE 42112 - 42202 ' WRN_SxSHigherIndirectRefEmitted4 = 42203 'unused in Roslyn ' WRN_ReferencedAssembliesAmbiguous6 = 42204 'unused in Roslyn ' WRN_ReferencedAssembliesAmbiguous4 = 42205 'unused in Roslyn ' WRN_MaximumNumberOfWarnings = 42206 'unused in Roslyn WRN_InvalidAssemblyName = 42207 '// AVAILABLE 42209 - 42299 WRN_XMLDocBadXMLLine = 42300 WRN_XMLDocMoreThanOneCommentBlock = 42301 WRN_XMLDocNotFirstOnLine = 42302 WRN_XMLDocInsideMethod = 42303 WRN_XMLDocParseError1 = 42304 WRN_XMLDocDuplicateXMLNode1 = 42305 WRN_XMLDocIllegalTagOnElement2 = 42306 WRN_XMLDocBadParamTag2 = 42307 WRN_XMLDocParamTagWithoutName = 42308 WRN_XMLDocCrefAttributeNotFound1 = 42309 WRN_XMLMissingFileOrPathAttribute1 = 42310 WRN_XMLCannotWriteToXMLDocFile2 = 42311 WRN_XMLDocWithoutLanguageElement = 42312 WRN_XMLDocReturnsOnWriteOnlyProperty = 42313 WRN_XMLDocOnAPartialType = 42314 WRN_XMLDocReturnsOnADeclareSub = 42315 WRN_XMLDocStartTagWithNoEndTag = 42316 WRN_XMLDocBadGenericParamTag2 = 42317 WRN_XMLDocGenericParamTagWithoutName = 42318 WRN_XMLDocExceptionTagWithoutCRef = 42319 WRN_XMLDocInvalidXMLFragment = 42320 WRN_XMLDocBadFormedXML = 42321 WRN_InterfaceConversion2 = 42322 WRN_LiftControlVariableLambda = 42324 ' 42325 unused, was abandoned, now used in unit test "EnsureLegacyWarningsAreMaintained". Please update test if you are going to use this number. WRN_LambdaPassedToRemoveHandler = 42326 WRN_LiftControlVariableQuery = 42327 WRN_RelDelegatePassedToRemoveHandler = 42328 ' WRN_QueryMissingAsClauseinVarDecl = 42329 ' unused in Roslyn. ' WRN_LiftUsingVariableInLambda1 = 42330 ' unused in Roslyn. ' WRN_LiftUsingVariableInQuery1 = 42331 ' unused in Roslyn. WRN_AmbiguousCastConversion2 = 42332 '// substitutes into 42016 WRN_VarianceDeclarationAmbiguous3 = 42333 WRN_ArrayInitNoTypeObjectAssumed = 42334 WRN_TypeInferenceAssumed3 = 42335 WRN_VarianceConversionFailedOut6 = 42336 '// substitutes into 42016 WRN_VarianceConversionFailedIn6 = 42337 '// substitutes into 42016 WRN_VarianceIEnumerableSuggestion3 = 42338 '// substitutes into 42016 WRN_VarianceConversionFailedTryOut4 = 42339 '// substitutes into 42016 WRN_VarianceConversionFailedTryIn4 = 42340 '// substitutes into 42016 WRN_IfNoTypeObjectAssumed = 42341 WRN_IfTooManyTypesObjectAssumed = 42342 WRN_ArrayInitTooManyTypesObjectAssumed = 42343 WRN_LambdaNoTypeObjectAssumed = 42344 WRN_LambdaTooManyTypesObjectAssumed = 42345 WRN_MissingAsClauseinVarDecl = 42346 WRN_MissingAsClauseinFunction = 42347 WRN_MissingAsClauseinProperty = 42348 WRN_ObsoleteIdentityDirectCastForValueType = 42349 WRN_ImplicitConversion2 = 42350 ' // substitutes into 42016 WRN_MutableStructureInUsing = 42351 WRN_MutableGenericStructureInUsing = 42352 WRN_DefAsgNoRetValFuncVal1 = 42353 WRN_DefAsgNoRetValOpVal1 = 42354 WRN_DefAsgNoRetValPropVal1 = 42355 WRN_AsyncLacksAwaits = 42356 WRN_AsyncSubCouldBeFunction = 42357 WRN_UnobservedAwaitableExpression = 42358 WRN_UnobservedAwaitableDelegate = 42359 WRN_PrefixAndXmlnsLocalName = 42360 WRN_UseValueForXmlExpression3 = 42361 ' Replaces ERR_UseValueForXmlExpression3 'WRN_PDBConstantStringValueTooLong = 42363 we gave up on this warning. See comments in commonCompilation.Emit() WRN_ReturnTypeAttributeOnWriteOnlyProperty = 42364 ' // AVAILABLE 42365 WRN_InvalidVersionFormat = 42366 WRN_MainIgnored = 42367 WRN_EmptyPrefixAndXmlnsLocalName = 42368 WRN_DefAsgNoRetValWinRtEventVal1 = 42369 WRN_AssemblyAttributeFromModuleIsOverridden = 42370 WRN_RefCultureMismatch = 42371 WRN_ConflictingMachineAssembly = 42372 WRN_PdbLocalNameTooLong = 42373 WRN_PdbUsingNameTooLong = 42374 WRN_XMLDocCrefToTypeParameter = 42375 WRN_AnalyzerCannotBeCreated = 42376 WRN_NoAnalyzerInAssembly = 42377 WRN_UnableToLoadAnalyzer = 42378 ' // AVAILABLE 42379 - 49998 ERRWRN_Last = WRN_UnableToLoadAnalyzer + 1 '// HIDDENS AND INFOS BEGIN HERE HDN_UnusedImportClause = 50000 HDN_UnusedImportStatement = 50001 INF_UnableToLoadSomeTypesInAnalyzer = 50002 ' // AVAILABLE 50003 - 54999 ' Adding diagnostic arguments from resx file IDS_ProjectSettingsLocationName = 56000 IDS_FunctionReturnType = 56001 IDS_TheSystemCannotFindThePathSpecified = 56002 ' available: 56003 IDS_MSG_ADDMODULE = 56004 IDS_MSG_ADDLINKREFERENCE = 56005 IDS_MSG_ADDREFERENCE = 56006 IDS_LogoLine1 = 56007 IDS_LogoLine2 = 56008 IDS_VBCHelp = 56009 IDS_InvalidPreprocessorConstantType = 56010 IDS_ToolName = 56011 ' Feature codes FEATURE_AutoProperties FEATURE_LineContinuation FEATURE_StatementLambdas FEATURE_CoContraVariance FEATURE_CollectionInitializers FEATURE_SubLambdas FEATURE_ArrayLiterals FEATURE_AsyncExpressions FEATURE_Iterators FEATURE_GlobalNamespace FEATURE_NullPropagatingOperator FEATURE_NameOfExpressions FEATURE_ReadonlyAutoProperties FEATURE_RegionsEverywhere FEATURE_MultilineStringLiterals FEATURE_CObjInAttributeArguments FEATURE_LineContinuationComments FEATURE_TypeOfIsNot FEATURE_YearFirstDateLiterals FEATURE_WarningDirectives FEATURE_PartialModules FEATURE_PartialInterfaces FEATURE_ImplementingReadonlyOrWriteonlyPropertyWithReadwrite FEATURE_DigitSeparators FEATURE_BinaryLiterals FEATURE_IOperation End Enum End Namespace
{ "content_hash": "b6a02170a53beac5ca0afcec3016fb86", "timestamp": "", "source": "github", "line_count": 1963, "max_line_length": 270, "avg_line_length": 44.86398369842078, "alnum_prop": 0.6974042785120589, "repo_name": "Shiney/roslyn", "id": "410d7d75944335aa067794fab1ce7f2cb57c3edf", "size": "88070", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Compilers/VisualBasic/Portable/Errors/Errors.vb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "15866" }, { "name": "C#", "bytes": "82456101" }, { "name": "C++", "bytes": "4865" }, { "name": "F#", "bytes": "3632" }, { "name": "Groovy", "bytes": "7564" }, { "name": "Makefile", "bytes": "3606" }, { "name": "PowerShell", "bytes": "55019" }, { "name": "Shell", "bytes": "7239" }, { "name": "Visual Basic", "bytes": "61718026" } ], "symlink_target": "" }
import 'mocha'; import { expect, } from 'chai'; import * as sinon from 'sinon'; import { forAwaitEach, isAsyncIterable, createAsyncIterator } from 'iterall'; import { createRejectionIterable } from '../utils/rejection-iterable'; describe('createRejectionIterable', () => { it('should return a valid AsyncIterator from Promise', () => { const iterator = createRejectionIterable(new Error('test error')); expect(isAsyncIterable(iterator)).to.eq(true); }); it('should not trigger next callback, only catch error', (done) => { const iterator = createRejectionIterable(new Error('test error')); const spy = sinon.spy(); const doneSpy = sinon.spy(); forAwaitEach(createAsyncIterator(iterator) as any, spy) .then(doneSpy) .catch((e) => { expect(e.message).to.eq('test error'); expect(spy.callCount).to.eq(0); expect(doneSpy.callCount).to.eq(0); done(); }); }); it('next promise should always reject', (done) => { const iterator = createRejectionIterable(new Error('test error')); const spy = sinon.spy(); iterator.next() .then(spy) .catch((e) => { expect(e.message).to.eq('test error'); expect(spy.callCount).to.eq(0); done(); }); }); });
{ "content_hash": "496428a82c4f5cd0962d50c1680af414", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 77, "avg_line_length": 29.767441860465116, "alnum_prop": 0.62578125, "repo_name": "Tobino/subscriptions-transport-ws", "id": "12613524c896783c5f381db333d50c59a77a669e", "size": "1280", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/test/rejection-iterable.ts", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "761" }, { "name": "TypeScript", "bytes": "123960" } ], "symlink_target": "" }
package org.apache.geronimo.jetty8; import org.apache.geronimo.gbean.GBeanLifecycle; import org.apache.geronimo.gbean.annotation.GBean; import org.apache.geronimo.gbean.annotation.ParamReference; /** * This gbean calls {@link WebAppContextWrapper#fullyStarted()} when it starts. * This gbean is configured with lowest priority and therefore is started last. * * @version $Rev$ $Date$ */ @GBean public class WebAppContextManager implements GBeanLifecycle { private final WebAppContextWrapper webApp; public WebAppContextManager(@ParamReference(name = "webApp") WebAppContextWrapper webApp) { this.webApp = webApp; } public void doFail() { } public void doStart() throws Exception { webApp.fullyStarted(); } public void doStop() throws Exception { } }
{ "content_hash": "c0a5c887663f249c9daa5ad4cc494864", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 95, "avg_line_length": 24.38235294117647, "alnum_prop": 0.7165259348612787, "repo_name": "apache/geronimo", "id": "fddbb89da73865af993e2268186943d474cdf20d", "size": "1642", "binary": false, "copies": "2", "ref": "refs/heads/trunk", "path": "plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextManager.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "29627" }, { "name": "CSS", "bytes": "47972" }, { "name": "HTML", "bytes": "838469" }, { "name": "Java", "bytes": "8975734" }, { "name": "JavaScript", "bytes": "906" }, { "name": "Shell", "bytes": "32814" }, { "name": "XSLT", "bytes": "4468" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using MultiChannelTodo.Core.Api.Models; namespace MultiChannelTodo.Core.Api { public class Startup { public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) .AddEnvironmentVariables("NetCore_"); Configuration = builder.Build(); } public IConfigurationRoot Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddCors(); // Add framework services. services.AddMvc(); services.AddSwaggerGen(); services.Configure<ConfigurationOptions>(Configuration); services.AddSingleton<ITodoItemRepository, TodoItemRepository>(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); app.UseCors(builder => builder.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); app.UseStaticFiles(); app.UseMvc(); app.UseSwagger(); app.UseSwaggerUi(); } } }
{ "content_hash": "c10e2dde47a11f899f8f7a01f89cdc3c", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 109, "avg_line_length": 34.526315789473685, "alnum_prop": 0.663109756097561, "repo_name": "melcom/MultiChannelTodo", "id": "03fc2f6332c835d877dd03356809161cf4f99c58", "size": "1970", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/MultiChannelTodo.Core.Api/Startup.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "24952" }, { "name": "CSS", "bytes": "626" }, { "name": "HTML", "bytes": "13326" }, { "name": "JavaScript", "bytes": "213134" }, { "name": "PowerShell", "bytes": "471" }, { "name": "Ruby", "bytes": "1030" } ], "symlink_target": "" }
[![Version](http://allthebadges.io/latin-language-toolkit/llt-helpers/badge_fury.png)](http://allthebadges.io/latin-language-toolkit/llt-helpers/badge_fury) [![Dependencies](http://allthebadges.io/latin-language-toolkit/llt-helpers/gemnasium.png)](http://allthebadges.io/latin-language-toolkit/llt-helpers/gemnasium) [![Build Status](http://allthebadges.io/latin-language-toolkit/llt-helpers/travis.png)](http://allthebadges.io/latin-language-toolkit/llt-helpers/travis) [![Coverage](http://allthebadges.io/latin-language-toolkit/llt-helpers/coveralls.png)](http://allthebadges.io/latin-language-toolkit/llt-helpers/coveralls) [![Code Climate](http://allthebadges.io/latin-language-toolkit/llt-helpers/code_climate.png)](http://allthebadges.io/latin-language-toolkit/llt-helpers/code_climate) Includes various helper modules used by several llt-gems. ## Installation Add this line to your application's Gemfile: gem 'llt-helpers' And then execute: $ bundle Or install it yourself as: $ gem install llt-helpers ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
{ "content_hash": "2105d38dfb0796ae5fa392dc21a0a9cf", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 165, "avg_line_length": 43.758620689655174, "alnum_prop": 0.7675334909377463, "repo_name": "latin-language-toolkit/llt-helpers", "id": "b8826e4f57ba4a4f691ed8870ad0babb342cfb17", "size": "1285", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "47858" } ], "symlink_target": "" }
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE191_Integer_Underflow__char_fscanf_sub_05.c Label Definition File: CWE191_Integer_Underflow.label.xml Template File: sources-sinks-05.tmpl.c */ /* * @description * CWE: 191 Integer Underflow * BadSource: fscanf Read data from the console using fscanf() * GoodSource: Set data to a small, non-zero number (negative two) * Sinks: sub * GoodSink: Ensure there will not be an underflow before subtracting 1 from data * BadSink : Subtract 1 from data, which can cause an Underflow * Flow Variant: 05 Control flow: if(staticTrue) and if(staticFalse) * * */ #include "std_testcase.h" /* The two variables below are not defined as "const", but are never assigned any other value, so a tool should be able to identify that reads of these will always return their initialized values. */ static int staticTrue = 1; /* true */ static int staticFalse = 0; /* false */ #ifndef OMITBAD void CWE191_Integer_Underflow__char_fscanf_sub_05_bad() { char data; data = ' '; if(staticTrue) { /* POTENTIAL FLAW: Use a value input from the console */ fscanf (stdin, "%c", &data); } if(staticTrue) { { /* POTENTIAL FLAW: Subtracting 1 from data could cause an underflow */ char result = data - 1; printHexCharLine(result); } } } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodB2G1() - use badsource and goodsink by changing the second staticTrue to staticFalse */ static void goodB2G1() { char data; data = ' '; if(staticTrue) { /* POTENTIAL FLAW: Use a value input from the console */ fscanf (stdin, "%c", &data); } if(staticFalse) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); } else { /* FIX: Add a check to prevent an underflow from occurring */ if (data > CHAR_MIN) { char result = data - 1; printHexCharLine(result); } else { printLine("data value is too large to perform subtraction."); } } } /* goodB2G2() - use badsource and goodsink by reversing the blocks in the second if */ static void goodB2G2() { char data; data = ' '; if(staticTrue) { /* POTENTIAL FLAW: Use a value input from the console */ fscanf (stdin, "%c", &data); } if(staticTrue) { /* FIX: Add a check to prevent an underflow from occurring */ if (data > CHAR_MIN) { char result = data - 1; printHexCharLine(result); } else { printLine("data value is too large to perform subtraction."); } } } /* goodG2B1() - use goodsource and badsink by changing the first staticTrue to staticFalse */ static void goodG2B1() { char data; data = ' '; if(staticFalse) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); } else { /* FIX: Use a small, non-zero value that will not cause an underflow in the sinks */ data = -2; } if(staticTrue) { { /* POTENTIAL FLAW: Subtracting 1 from data could cause an underflow */ char result = data - 1; printHexCharLine(result); } } } /* goodG2B2() - use goodsource and badsink by reversing the blocks in the first if */ static void goodG2B2() { char data; data = ' '; if(staticTrue) { /* FIX: Use a small, non-zero value that will not cause an underflow in the sinks */ data = -2; } if(staticTrue) { { /* POTENTIAL FLAW: Subtracting 1 from data could cause an underflow */ char result = data - 1; printHexCharLine(result); } } } void CWE191_Integer_Underflow__char_fscanf_sub_05_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); } #endif /* OMITGOOD */ /* 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 int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE191_Integer_Underflow__char_fscanf_sub_05_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE191_Integer_Underflow__char_fscanf_sub_05_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
{ "content_hash": "fd23de2b00947885c53b88217d311371", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 94, "avg_line_length": 27.12972972972973, "alnum_prop": 0.5823869296672644, "repo_name": "maurer/tiamat", "id": "68c08623cc4946bf2213e43bb144fafcf1163257", "size": "5019", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "samples/Juliet/testcases/CWE191_Integer_Underflow/s01/CWE191_Integer_Underflow__char_fscanf_sub_05.c", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
#ifndef itkTemporalDataObject_h #define itkTemporalDataObject_h #include "itkDataObject.h" #include "itkRingBuffer.h" #include "itkTemporalRegion.h" #include "ITKVideoCoreExport.h" namespace itk { /** \class TemporalDataObject * \brief DataObject subclass with knowledge of temporal region * * This class represents a data object that relies on temporal regions. It uses * an itk::RingBuffer to store DataObject pointers in sequential order. The * pointers in the ring buffer should correspond to the BufferedTemporalRegion. * The LargestPossibleTemporalRegion should indicate the maximum extent that * data object is logically capable of holding, and the RequestedTemporalRegion * is used in the pipeline to request that a certain temporal region be * buffered * * \ingroup ITKVideoCore */ class ITKVideoCore_EXPORT TemporalDataObject : public DataObject { public: /** Standard class typedefs */ typedef TemporalDataObject Self; typedef DataObject Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; typedef WeakPointer< const Self > ConstWeakPointer; typedef RingBuffer<DataObject> BufferType; typedef TemporalRegion TemporalRegionType; /** Enum for defining the way in which to compare temporal regions */ typedef enum {Frame, RealTime, FrameAndRealTime} TemporalUnitType; itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(TemporalDataObject, DataObject); /** Get the type of temporal units we care about (Defaults to Frame)*/ virtual TemporalUnitType GetTemporalUnit() const; /** Explicity set temporal units (Defaults to Frame)*/ virtual void SetTemporalUnitToFrame(); virtual void SetTemporalUnitToRealTime(); virtual void SetTemporalUnitToFrameAndRealTime(); /** Get/Set the number of frames that the internal buffer can hold */ SizeValueType GetNumberOfBuffers(); void SetNumberOfBuffers(SizeValueType num); virtual void SetLargestPossibleTemporalRegion( const TemporalRegionType & region); virtual const TemporalRegionType & GetLargestPossibleTemporalRegion() const; virtual void SetBufferedTemporalRegion(const TemporalRegionType & region); virtual const TemporalRegionType & GetBufferedTemporalRegion() const; virtual void SetRequestedTemporalRegion(const TemporalRegionType & region); virtual const TemporalRegionType & GetRequestedTemporalRegion() const; /** Get the portion of the requested region that is not covered by the * buffered region */ virtual const TemporalRegionType GetUnbufferedRequestedTemporalRegion(); virtual void SetRequestedRegionToLargestPossibleRegion() ITK_OVERRIDE; virtual bool RequestedRegionIsOutsideOfTheBufferedRegion() ITK_OVERRIDE; virtual bool VerifyRequestedRegion() ITK_OVERRIDE; virtual void CopyInformation(const DataObject *) ITK_OVERRIDE; virtual void SetRequestedRegion(const DataObject *) ITK_OVERRIDE; virtual void Graft(const DataObject *) ITK_OVERRIDE; protected: TemporalDataObject(); virtual ~TemporalDataObject(); virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE; /** Buffer for holding component data objects */ BufferType::Pointer m_DataObjectBuffer; /** We want to keep track of our regions in time. **/ TemporalRegionType m_LargestPossibleTemporalRegion; TemporalRegionType m_RequestedTemporalRegion; TemporalRegionType m_BufferedTemporalRegion; TemporalUnitType m_TemporalUnit; private: ITK_DISALLOW_COPY_AND_ASSIGN(TemporalDataObject); }; // end class TemporalDataObject } // end namespace itk #endif
{ "content_hash": "d33db8a43498a8d19d2a90d4a9c7933a", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 79, "avg_line_length": 33.73394495412844, "alnum_prop": 0.7764481914604296, "repo_name": "zachary-williamson/ITK", "id": "a95a1ed61c2f6445dbe498d14ab813973e6db72e", "size": "4452", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Modules/Video/Core/include/itkTemporalDataObject.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Bison", "bytes": "20428" }, { "name": "C", "bytes": "25368914" }, { "name": "C#", "bytes": "1714" }, { "name": "C++", "bytes": "47570050" }, { "name": "CMake", "bytes": "2128497" }, { "name": "CSS", "bytes": "24960" }, { "name": "FORTRAN", "bytes": "2241251" }, { "name": "HTML", "bytes": "208088" }, { "name": "Io", "bytes": "1833" }, { "name": "Java", "bytes": "29970" }, { "name": "Makefile", "bytes": "11691" }, { "name": "Objective-C", "bytes": "72946" }, { "name": "Objective-C++", "bytes": "6591" }, { "name": "OpenEdge ABL", "bytes": "85139" }, { "name": "Perl", "bytes": "19692" }, { "name": "Prolog", "bytes": "4406" }, { "name": "Python", "bytes": "882000" }, { "name": "Ruby", "bytes": "296" }, { "name": "Shell", "bytes": "128777" }, { "name": "Tcl", "bytes": "74786" }, { "name": "XSLT", "bytes": "194772" } ], "symlink_target": "" }
/* Public task tracking */ var jquery = require('jquery'); function poll_task (data) { var defer = jquery.Deferred(), tries = 5; function poll_task_loop () { jquery .getJSON(data.url) .success(function (task) { if (task.finished) { if (task.success) { defer.resolve(); } else { defer.reject({message: task.error}); } } else { setTimeout(poll_task_loop, 2000); } }) .error(function (error) { console.error('Error polling task:', error); tries -= 1; if (tries > 0) { setTimeout(poll_task_loop, 2000); } else { var error_msg = error.responseJSON.detail || error.statusText; defer.reject({message: error_msg}); } }); } setTimeout(poll_task_loop, 2000); return defer; } function trigger_task (url) { var defer = jquery.Deferred(); $.ajax({ method: 'POST', url: url, success: function (data) { poll_task(data) .then(function () { defer.resolve(); }) .fail(function (error) { // The poll_task function defer will only reject with // normalized error objects defer.reject(error); }); }, error: function (error) { var error_msg = error.responseJSON.detail || error.statusText; defer.reject({message: error_msg}); } }); return defer; } module.exports = { poll_task: poll_task, trigger_task: trigger_task };
{ "content_hash": "df3090745fdbf159f45714906dd34d7f", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 82, "avg_line_length": 26.694444444444443, "alnum_prop": 0.4292403746097815, "repo_name": "techtonik/readthedocs.org", "id": "ee0d995dd67927e5207a6f916d68db000a582129", "size": "1922", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "readthedocs/core/static-src/core/js/tasks.js", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "4515" }, { "name": "CSS", "bytes": "55493" }, { "name": "HTML", "bytes": "194633" }, { "name": "JavaScript", "bytes": "438957" }, { "name": "Makefile", "bytes": "4594" }, { "name": "Python", "bytes": "893745" }, { "name": "Shell", "bytes": "367" } ], "symlink_target": "" }
package info.fingo.urlopia.request.occasional.events; import info.fingo.urlopia.request.Request; public record OccasionalRequestCanceled(Request request) {}
{ "content_hash": "f93fa841666830a8dbbe7e103637dc17", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 59, "avg_line_length": 31.8, "alnum_prop": 0.8364779874213837, "repo_name": "fingo/urlopia", "id": "564863f4a49c072ab632e3698b85cb3464904efd", "size": "159", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/info/fingo/urlopia/request/occasional/events/OccasionalRequestCanceled.java", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "192" }, { "name": "Groovy", "bytes": "279445" }, { "name": "HTML", "bytes": "3130" }, { "name": "Handlebars", "bytes": "4732" }, { "name": "Java", "bytes": "485055" }, { "name": "JavaScript", "bytes": "425423" }, { "name": "SCSS", "bytes": "21661" }, { "name": "Shell", "bytes": "89" }, { "name": "TypeScript", "bytes": "12659" } ], "symlink_target": "" }
import argparse import logging import helper import puller if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-v', '--verbose', help='increase logging verbosity', action='store_true') parser.add_argument('-c', '--conf', type=str, help='configuration file for saver and api calls') parser.add_argument('-l', '--log', type=str, help='path for program log') args = parser.parse_args() # setting log level if args.verbose: log_level = logging.DEBUG else: log_level = logging.INFO # setting log location if args.log is not None: logfile = args.log else: logfile = './hntracker.log' # setting up log logging.basicConfig(filename=logfile, level=log_level, format='%(asctime)s %(message)s') logger = logging.getLogger(__name__) # checking if conf is present if args.conf is None: helper.fatal('no configuraton file set', logger) api_caller = puller.HNCaller(args.conf, logger) csv_saver = saver.HNSaver(args.conf, logger) logger.info('beginning api call run') run_api(api_caller, csv_saver) logger.info('completed api call run') # cleaning up log logger.debug('closing log') logger.close() def run_api(caller, saver): url = caller.construct_call() stories = process_call(url) csv_saver.save_csv(stories)
{ "content_hash": "370aecf84622b3793848b918e2249af7", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 72, "avg_line_length": 26.462962962962962, "alnum_prop": 0.6319104268719384, "repo_name": "jakubtuchol/HNTracker", "id": "359ace7e8452637c7750acaf3f245253e70101e5", "size": "1429", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/__main__.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "9865" } ], "symlink_target": "" }
package org.hl7.v3; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ObservationFoodIntoleranceType. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="ObservationFoodIntoleranceType"> * &lt;restriction base="{urn:hl7-org:v3}cs"> * &lt;enumeration value="FINT"/> * &lt;enumeration value="FALG"/> * &lt;enumeration value="FNAINT"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "ObservationFoodIntoleranceType") @XmlEnum public enum ObservationFoodIntoleranceType { FINT, FALG, FNAINT; public String value() { return name(); } public static ObservationFoodIntoleranceType fromValue(String v) { return valueOf(v); } }
{ "content_hash": "126819a0ec152aece7d45ca22f6e6c59", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 95, "avg_line_length": 22.65, "alnum_prop": 0.6434878587196468, "repo_name": "KRMAssociatesInc/eHMP", "id": "38a592682775015798f0e50caaa98d503fd8f85c", "size": "906", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/mvi/org/hl7/v3/ObservationFoodIntoleranceType.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "10075" }, { "name": "CSS", "bytes": "1228354" }, { "name": "CoffeeScript", "bytes": "30627" }, { "name": "FreeMarker", "bytes": "12950" }, { "name": "Genshi", "bytes": "6980967" }, { "name": "Gherkin", "bytes": "2803173" }, { "name": "Groovy", "bytes": "27170" }, { "name": "HTML", "bytes": "2911048" }, { "name": "Java", "bytes": "15034883" }, { "name": "JavaScript", "bytes": "14292592" }, { "name": "M", "bytes": "771002" }, { "name": "PHP", "bytes": "3146" }, { "name": "Pascal", "bytes": "1280773" }, { "name": "Python", "bytes": "4483" }, { "name": "Ruby", "bytes": "2310218" }, { "name": "Shell", "bytes": "39641" }, { "name": "XSLT", "bytes": "327236" } ], "symlink_target": "" }
if [ "${NACL_ARCH}" = "pnacl" ]; then NACLPORTS_CFLAGS+=" -std=gnu89" fi TestStep() { return 0 if [ ${NACL_ARCH} == "pnacl" ]; then # Run once for each architecture. local pexe=test/testil local script=${pexe}.sh TranslateAndWriteSelLdrScript ${pexe} x86-32 ${pexe}.x86-32.nexe ${script} (cd test && make check) TranslateAndWriteSelLdrScript ${pexe} x86-64 ${pexe}.x86-64.nexe ${script} (cd test && make check) else local nexe=test/testil local script=${nexe}.sh WriteSelLdrScript ${script} ${nexe} (cd test && make check) fi }
{ "content_hash": "7de385c597275f50f1b39a04b52df2e9", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 78, "avg_line_length": 22.615384615384617, "alnum_prop": 0.6258503401360545, "repo_name": "kosyak/naclports_samsung-smart-tv", "id": "39a8b9e36abb7adb0100c792fcf0a7547d978a84", "size": "772", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "ports/devil/build.sh", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "490269" }, { "name": "C++", "bytes": "73296" }, { "name": "CSS", "bytes": "953" }, { "name": "JavaScript", "bytes": "119776" }, { "name": "Python", "bytes": "87876" }, { "name": "Shell", "bytes": "205848" } ], "symlink_target": "" }
import React, { Component } from 'react'; import { connect } from 'react-redux'; import { Input, Picker, Item, Footer, FooterTab, Container, Header, Title, Content, Button, Icon, Text, Left, Right, Body, List, ListItem, View } from 'native-base'; import { Actions } from 'react-native-router-flux'; import styles from './styles'; import I18n from '../../translations/'; class CompaniesList extends Component { constructor(props) { super(props); this.state={seached:''} } render() { return ( <Container style={styles.container}> <Header> <Left> <Button transparent onPress={() => Actions.pop()}> <Icon name="arrow-back" /> </Button> </Left> <Body> <Title>{I18n.t('settingsCompaniesListTitle')}</Title> </Body> </Header> <Content> <Item rounded style={{marginTop:15,marginBottom:15,marginLeft: 20, marginRight: 20,}}> <Icon name="ios-search" /> <Input placeholder={I18n.t('search')} value={this.state.seached} onChangeText={((value)=>this.setState({seached:value}))} /> </Item> <List dataArray={this.props.companies.filter((company)=>company.name.toLowerCase().includes(this.state.seached.toLowerCase()))} renderRow={(company)=> <ListItem button onPress={()=>Actions.companyEdit({company})} > <Body> <Text>{company.name}</Text> </Body> <Right> <Icon name="arrow-forward" /> </Right> </ListItem> } /> </Content> <Footer> <FooterTab> <Button onPress={Actions.companyAdd} iconLeft style={{ flexDirection: 'row', borderColor: 'white', borderWidth: 0.5 }}> <Icon active style={{ color: 'white' }} name="add" /> <Text style={{ color: 'white' }} >{I18n.t('company')}</Text> </Button> </FooterTab> </Footer> </Container> ); } } function bindAction(dispatch) { return { }; } const mapStateToProps = state => ({ companies: state.updateCompanies.companies, }); export default connect(mapStateToProps, bindAction)(CompaniesList);
{ "content_hash": "27c9bb3c79f7ff085635635f1de3ce23", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 165, "avg_line_length": 31.726027397260275, "alnum_prop": 0.5509499136442142, "repo_name": "bsusta/HelpdeskAppTemplate", "id": "1d4cf930ba77442ba3593786a1b26c4440f70c1d", "size": "2317", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "js/components/companiesList/index.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "292765" }, { "name": "Ruby", "bytes": "4747" } ], "symlink_target": "" }
import { Component, OnInit } from '@angular/core'; import { Router, RouteParams } from '@angular/router-deprecated'; import { Instance } from './instance'; import { InstanceService } from './instance.service'; @Component({ selector: 'am-instances', templateUrl: 'app/instance/instances.component.html' }) export class InstancesComponent implements OnInit { applicationId: number; instances: Instance[]; constructor( private router: Router, private routeParams: RouteParams, private instanceService: InstanceService) { } ngOnInit() { this.applicationId = +this.routeParams.get('id'); this.getInstances(); } getInstances() { this.instanceService.getInstances(this.applicationId) .then((results) => { this.instances = results; }); } }
{ "content_hash": "2e8ca65442bdd6c031a5a698693a6127", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 65, "avg_line_length": 26.393939393939394, "alnum_prop": 0.634902411021814, "repo_name": "distracted/app-manager-ui", "id": "08fba3ba7a7e753758958ed8180d330440ff5258", "size": "871", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/instance/instances.component.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2426" }, { "name": "HTML", "bytes": "20940" }, { "name": "JavaScript", "bytes": "1450" }, { "name": "TypeScript", "bytes": "12651" } ], "symlink_target": "" }
package productsdemo.dao; import productsdemo.beans.Product; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; public class HibernateProductDao implements ProductDao { @PersistenceContext private EntityManager entityManager; @Override public Product findById(Integer id) { return entityManager.find(Product.class, id); } @Override public void create(Product product) { entityManager.persist(product); } @Override public void update(Product product) { entityManager.merge(product); } @Override public void delete(Integer id) { entityManager.remove(findById(id)); } }
{ "content_hash": "67bed53120cbcdd70b3342595c246ec0", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 56, "avg_line_length": 21.78125, "alnum_prop": 0.7073170731707317, "repo_name": "yurchello/javalessons", "id": "f10c0d99237c511324915d3bf8757f1aa1756f4a", "size": "697", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "productdemo/src/main/java/productsdemo/dao/HibernateProductDao.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "16103" } ], "symlink_target": "" }
#nullable disable namespace PasPasPas.Typings.Serialization { internal class TypeIoBase { } }
{ "content_hash": "9c12e8937795899a78dcf90ff516b3a8", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 43, "avg_line_length": 17.333333333333332, "alnum_prop": 0.7307692307692307, "repo_name": "prjm/paspaspas", "id": "0af79b257b6727403070fe9d4742203a9d167212", "size": "106", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "PasPasPas.Typings/src/Serialization/TypeIoBase.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "3376141" } ], "symlink_target": "" }