text
stringlengths
2
1.04M
meta
dict
/** MACHINE-GENERATED FROM AVRO SCHEMA. DO NOT EDIT DIRECTLY */ package avro.examples.baseball import scala.annotation.switch final case class Mascot(var name: String) extends org.apache.avro.specific.SpecificRecordBase { def this() = this("") def get(field$: Int): AnyRef = { (field$: @switch) match { case 0 => { name }.asInstanceOf[AnyRef] case _ => new org.apache.avro.AvroRuntimeException("Bad index") } } def put(field$: Int, value: Any): Unit = { (field$: @switch) match { case 0 => this.name = { value.toString }.asInstanceOf[String] case _ => new org.apache.avro.AvroRuntimeException("Bad index") } () } def getSchema: org.apache.avro.Schema = Mascot.SCHEMA$ } object Mascot { val SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Mascot\",\"namespace\":\"avro.examples.baseball\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"}]}") }
{ "content_hash": "71697ba84b7d9c1b213eb077eb2c68c9", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 196, "avg_line_length": 32.36666666666667, "alnum_prop": 0.6240988671472708, "repo_name": "julianpeeters/avrohugger", "id": "a11e3205d05cd547dcef4943f00f8b5fbc82bcaa", "size": "971", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "avrohugger-tools/src/test/compiler/output-specific/avro/examples/baseball/Mascot.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "6316" }, { "name": "Scala", "bytes": "766885" } ], "symlink_target": "" }
package com.ui4j.spi; import com.ui4j.api.event.DomEvent; import com.ui4j.api.event.EventHandler; public class DelegatingEventHandler implements EventHandler { private String event; private String selector; private EventHandler eventHandler; public DelegatingEventHandler(String event, String selector, EventHandler eventHandler) { this.event = event; this.selector = selector; this.eventHandler = eventHandler; } @Override public void handle(DomEvent event) { if (event.getTarget().is(selector)) { eventHandler.handle(event); } } public String getSelector() { return selector; } public EventHandler getHandler() { return eventHandler; } public String getEvent() { return event; } @Override public String toString() { return "DelegatingEventHandler [event=" + event + ", selector=" + selector + ", eventHandler=" + eventHandler + "]"; } }
{ "content_hash": "38a42a5e7e0a8192e8e94a8c21d26c75", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 93, "avg_line_length": 23.136363636363637, "alnum_prop": 0.637524557956778, "repo_name": "donaldlee2008/ui4j", "id": "5e9045cb77bab09b414d88de2f56b809b99eaedb", "size": "1018", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "ui4j-api/src/main/java/com/ui4j/spi/DelegatingEventHandler.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "7243" }, { "name": "Java", "bytes": "287532" }, { "name": "JavaScript", "bytes": "59097" } ], "symlink_target": "" }
<div class="modal-header"> <button type="button" class="close" ng-click="$close('cancel')" aria-hidden="true">×</button> <h4 class="modal-title">Confirmation</h4> </div> <div class="modal-body">Are you sure want to delete record?</div> <div class="modal-footer"> <button type="button" class="btn btn-link" ng-click="$close('cancel')">No</button> <button type="button" class="btn btn-primary" ng-click="$close('ok')">Yes</button> </div>
{ "content_hash": "1ee414acba23e5f5f349779d69fa0b95", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 95, "avg_line_length": 49.333333333333336, "alnum_prop": 0.6779279279279279, "repo_name": "gojay/grunt-generator-fullstack", "id": "ea0473bb99e6a2013bdca7e23200901cf8575b44", "size": "445", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "generator/client/components/templates/_modal-delete-confirmation.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "469" }, { "name": "HTML", "bytes": "23666" }, { "name": "JavaScript", "bytes": "62667" } ], "symlink_target": "" }
<%# Copyright 2013-2017 the original author or authors from the StackStack project. This file is part of the StackStack project, see http://www.jhipster.tech/ for more information. 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. -%> <% const keyPrefix = angularAppName + '.' + entityTranslationKey; %> <div> <h2><span data-translate="<%= keyPrefix %>.detail.title"><%= entityClassHumanized %></span> {{vm.<%= entityInstance %>.id}}</h2> <hr> <jhi-alert-error></jhi-alert-error> <dl class="dl-horizontal jh-entity-details"> <%_ for (idx in fields) { const fieldName = fields[idx].fieldName; const fieldType = fields[idx].fieldType; const fieldTypeBlobContent = fields[idx].fieldTypeBlobContent; _%> <dt><span data-translate="<%= keyPrefix %>.<%= fieldName %>"><%= fields[idx].fieldNameHumanized %></span></dt> <dd> <%_ if (fields[idx].fieldIsEnum) { _%> <span data-translate="{{'<%= angularAppName %>.<%= fieldType %>.' + vm.<%= entityInstance %>.<%= fieldName %>}}">{{vm.<%= entityInstance %>.<%= fieldName %>}}</span> <%_ } else if ((fieldType === 'byte[]' || fieldType === 'ByteBuffer') && fieldTypeBlobContent === 'image') { _%> <div ng-if="vm.<%= entityInstance %>.<%= fieldName %>"> <a ng-click="vm.openFile(vm.<%= entityInstance %>.<%= fieldName %>ContentType, vm.<%= entityInstance %>.<%= fieldName %>)"> <img data-ng-src="{{'data:' + vm.<%=entityInstance %>.<%= fieldName %>ContentType + ';base64,' + vm.<%= entityInstance %>.<%= fieldName %>}}" style="max-width: 100%;" alt="<%=entityInstance %> image"/> </a> {{vm.<%= entityInstance %>.<%= fieldName %>ContentType}}, {{vm.byteSize(vm.<%= entityInstance %>.<%= fieldName %>)}} </div> <%_ } else if (['Instant', 'ZonedDateTime'].includes(fieldType)) { _%> <span>{{vm.<%=entityInstance %>.<%= fieldName %> | date:'medium'}}</span> <%_ } else if (fieldType === 'LocalDate') { _%> <span>{{vm.<%=entityInstance %>.<%= fieldName %> | date:'mediumDate'}}</span> <%_ } else if ((fieldType === 'byte[]' || fieldType === 'ByteBuffer') && fieldTypeBlobContent === 'any') { _%> <div ng-if="vm.<%= entityInstance %>.<%= fieldName %>"> <a ng-click="vm.openFile(vm.<%= entityInstance %>.<%= fieldName %>ContentType, vm.<%= entityInstance %>.<%= fieldName %>)" data-translate="entity.action.open">open</a> {{vm.<%= entityInstance %>.<%= fieldName %>ContentType}}, {{vm.byteSize(vm.<%= entityInstance %>.<%= fieldName %>)}} </div> <%_ } else { _%> <span>{{vm.<%= entityInstance %>.<%= fieldName %>}}</span> <%_ } _%> </dd> <%_ } _%> <%_ for (idx in relationships) { const relationshipType = relationships[idx].relationshipType; const ownerSide = relationships[idx].ownerSide; const relationshipName = relationships[idx].relationshipName; const relationshipFieldName = relationships[idx].relationshipFieldName; const relationshipFieldNamePlural = relationships[idx].relationshipFieldNamePlural; const relationshipNameHumanized = relationships[idx].relationshipNameHumanized; const otherEntityName = relationships[idx].otherEntityName; const otherEntityStateName = relationships[idx].otherEntityStateName; const otherEntityField = relationships[idx].otherEntityField; const otherEntityFieldCapitalized = relationships[idx].otherEntityFieldCapitalized; if (relationshipType === 'many-to-one' || (relationshipType === 'one-to-one' && ownerSide === true) || (relationshipType === 'many-to-many' && ownerSide === true)) { _%> <dt><span data-translate="<%= keyPrefix %>.<%= relationshipName %>"><%= relationshipNameHumanized %></span></dt> <dd> <%_ if (otherEntityName === 'user') { _%> <%_ if (relationshipType === 'many-to-many') { _%> <span ng-repeat="<%= relationshipFieldName %> in vm.<%= entityInstance %>.<%= relationshipFieldNamePlural %>"> {{<%= relationshipFieldName %>.<%= otherEntityField %>}}{{$last ? '' : ', '}} </span> <%_ } else { _%> <%_ if (dto === 'no') { _%> {{vm.<%= entityInstance + "." + relationshipFieldName + "." + otherEntityField %>}} <%_ } else { _%> {{vm.<%= entityInstance + "." + relationshipFieldName + otherEntityFieldCapitalized %>}} <%_ } _%> <%_ } _%> <%_ } else { _%> <%_ if (relationshipType === 'many-to-many') { _%> <span ng-repeat="<%= relationshipFieldName %> in vm.<%= entityInstance %>.<%= relationshipFieldNamePlural %>"> <a ui-sref="<%= otherEntityStateName %>-detail({id: <%= relationshipFieldName %>.id})">{{<%= relationshipFieldName %>.<%= otherEntityField %>}}</a>{{$last ? '' : ', '}} </span> <%_ } else { _%> <%_ if (dto === 'no') { _%> <a ui-sref="<%= otherEntityStateName %>-detail({id:vm.<%= entityInstance + "." + relationshipFieldName + ".id" %>})">{{vm.<%= entityInstance + "." + relationshipFieldName + "." + otherEntityField %>}}</a> <%_ } else { _%> <a ui-sref="<%= otherEntityStateName %>-detail({id:vm.<%= entityInstance + "." + relationshipFieldName + "Id" %>})">{{vm.<%= entityInstance + "." + relationshipFieldName + otherEntityFieldCapitalized %>}}</a> <%_ } _%> <%_ } _%> <%_ } _%> </dd> <%_ } _%> <%_ } _%> </dl> <button type="submit" ui-sref="{{ vm.previousState }}" class="btn btn-info"> <span class="glyphicon glyphicon-arrow-left"></span>&nbsp;<span data-translate="entity.action.back"> Back</span> </button> <button type="button" ui-sref="<%= entityStateName %>-detail.edit({id:vm.<%=entityInstance %>.id})" class="btn btn-primary"> <span class="glyphicon glyphicon-pencil"></span> <span class="hidden-sm-down" data-translate="entity.action.edit"> Edit</span> </button> </div>
{ "content_hash": "f6a43f21a1ee653359a738ce0ec0df25", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 221, "avg_line_length": 63.31818181818182, "alnum_prop": 0.5530509691313712, "repo_name": "siliconharborlabs/generator-jhipster", "id": "ffc09c5b776429cc045b6226811aa6178c2bfb34", "size": "6965", "binary": false, "copies": "1", "ref": "refs/heads/master-shl", "path": "generators/entity/templates/client/angularjs/src/main/webapp/app/entities/_entity-management-detail.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5006" }, { "name": "CSS", "bytes": "67877" }, { "name": "Gherkin", "bytes": "179" }, { "name": "HTML", "bytes": "421159" }, { "name": "Java", "bytes": "1012040" }, { "name": "JavaScript", "bytes": "1201575" }, { "name": "Scala", "bytes": "7071" }, { "name": "Shell", "bytes": "30232" }, { "name": "TypeScript", "bytes": "379058" } ], "symlink_target": "" }
require 'test_helper' require 'iord/hooks' class CommentsControllerTest < ActionController::TestCase setup do @comment = create(:comment) @product_id = @comment.commentable.id end test "should get index" do get :index, product_id: @product_id assert_response :success end test "should get json index" do get :index, product_id: @product_id, format: :json assert_response :success end test "should get show" do get :show, product_id: @product_id, id: @comment assert_response :success end test "should get json show" do get :show, product_id: @product_id, id: @comment, format: :json assert_response :success end test "should get new" do get :new, product_id: @product_id assert_response :success end test "should get edit" do get :edit, product_id: @product_id, id: @comment assert_response :success end test "should create" do hook_called = false Iord::Hooks.register_hook(:comment, :create) do |resource, action| assert action == :create assert resource.persisted? hook_called = true end assert_difference("Product.find('#{@product_id}').comments.count") do post :create, product_id: @product_id, comment: {author_name: 'Hello'} end assert_response 302 assert hook_called end test "should update" do hook_called = false Iord::Hooks.register_hook(:comment, :update) do |resource, action| assert action == :update assert resource.persisted? hook_called = true end request.path = "/products/#{@product_id}/comments/#{@comment.id}" patch :update, id: @comment.id, product_id: @product_id, comment: {author_name: 'World'} assert_redirected_to product_comment_path(@comment.commentable, @comment) assert hook_called end test "should destroy" do hook_called = false Iord::Hooks.register_hook(:comment, :destroy) do |resource, action| assert action == :destroy assert resource.persisted? == false hook_called = true end assert_difference("Product.find('#{@product_id}').comments.count", -1) do delete :destroy, product_id: @product_id, id: @comment end assert_redirected_to product_comments_path assert hook_called end end
{ "content_hash": "c41a7dd249512bdce9e782a8b51d843d", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 92, "avg_line_length": 27.13095238095238, "alnum_prop": 0.6669591926283458, "repo_name": "Aethelflaed/iord", "id": "03de4919ea81e59122e6a671975cac59337cec05", "size": "2279", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/controllers/comments_controller_test.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "546" }, { "name": "HTML", "bytes": "8749" }, { "name": "JavaScript", "bytes": "599" }, { "name": "Ruby", "bytes": "89167" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <translate xmlns:android="http://schemas.android.com/apk/res/android" android:duration="100" android:fromXDelta="100%" android:toXDelta="0" > </translate>
{ "content_hash": "9ec8e0b618f6cae8b5bfc3e2363a03c5", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 69, "avg_line_length": 29.428571428571427, "alnum_prop": 0.6893203883495146, "repo_name": "wslqm123/Lottery", "id": "bda487715b9909ecc238c0da3eb39993e226a7bb", "size": "206", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "res/anim/ia_view_change.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "101719" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_25) on Fri Dec 13 12:09:47 EST 2013 --> <title>Uses of Class edu.rutgers.cs.scarletTaxi.notification_exporter.process.NType</title> <meta name="date" content="2013-12-13"> <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class edu.rutgers.cs.scarletTaxi.notification_exporter.process.NType"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/NType.html" title="enum in edu.rutgers.cs.scarletTaxi.notification_exporter.process">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?edu/rutgers/cs/scarletTaxi/notification_exporter/process/class-use/NType.html" target="_top">Frames</a></li> <li><a href="NType.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class edu.rutgers.cs.scarletTaxi.notification_exporter.process.NType" class="title">Uses of Class<br>edu.rutgers.cs.scarletTaxi.notification_exporter.process.NType</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/NType.html" title="enum in edu.rutgers.cs.scarletTaxi.notification_exporter.process">NType</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#edu.rutgers.cs.scarletTaxi.notification_exporter.process">edu.rutgers.cs.scarletTaxi.notification_exporter.process</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="edu.rutgers.cs.scarletTaxi.notification_exporter.process"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/NType.html" title="enum in edu.rutgers.cs.scarletTaxi.notification_exporter.process">NType</a> in <a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/package-summary.html">edu.rutgers.cs.scarletTaxi.notification_exporter.process</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/package-summary.html">edu.rutgers.cs.scarletTaxi.notification_exporter.process</a> declared as <a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/NType.html" title="enum in edu.rutgers.cs.scarletTaxi.notification_exporter.process">NType</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/NType.html" title="enum in edu.rutgers.cs.scarletTaxi.notification_exporter.process">NType</a></code></td> <td class="colLast"><span class="strong">Notification.</span><code><strong><a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/Notification.html#type">type</a></strong></code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/package-summary.html">edu.rutgers.cs.scarletTaxi.notification_exporter.process</a> that return <a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/NType.html" title="enum in edu.rutgers.cs.scarletTaxi.notification_exporter.process">NType</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/NType.html" title="enum in edu.rutgers.cs.scarletTaxi.notification_exporter.process">NType</a></code></td> <td class="colLast"><span class="strong">NType.</span><code><strong><a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/NType.html#valueOf(java.lang.String)">valueOf</a></strong>(java.lang.String&nbsp;name)</code> <div class="block">Returns the enum constant of this type with the specified name.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/NType.html" title="enum in edu.rutgers.cs.scarletTaxi.notification_exporter.process">NType</a>[]</code></td> <td class="colLast"><span class="strong">NType.</span><code><strong><a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/NType.html#values()">values</a></strong>()</code> <div class="block">Returns an array containing the constants of this enum type, in the order they are declared.</div> </td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation"> <caption><span>Constructors in <a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/package-summary.html">edu.rutgers.cs.scarletTaxi.notification_exporter.process</a> with parameters of type <a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/NType.html" title="enum in edu.rutgers.cs.scarletTaxi.notification_exporter.process">NType</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colLast"><code><strong><a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/Notification.html#Notification(edu.rutgers.cs.scarletTaxi.notification_exporter.process.NType, edu.rutgers.cs.scarletTaxi.centralDataStoratge.User[], java.lang.String)">Notification</a></strong>(<a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/NType.html" title="enum in edu.rutgers.cs.scarletTaxi.notification_exporter.process">NType</a>&nbsp;_type, <a href="../../../../../../../edu/rutgers/cs/scarletTaxi/centralDataStoratge/User.html" title="class in edu.rutgers.cs.scarletTaxi.centralDataStoratge">User</a>[]&nbsp;_recipients, java.lang.String&nbsp;_text)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colLast"><code><strong><a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/Notification.html#Notification(edu.rutgers.cs.scarletTaxi.notification_exporter.process.NType, edu.rutgers.cs.scarletTaxi.centralDataStoratge.User, java.lang.String)">Notification</a></strong>(<a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/NType.html" title="enum in edu.rutgers.cs.scarletTaxi.notification_exporter.process">NType</a>&nbsp;_type, <a href="../../../../../../../edu/rutgers/cs/scarletTaxi/centralDataStoratge/User.html" title="class in edu.rutgers.cs.scarletTaxi.centralDataStoratge">User</a>&nbsp;_recipient, java.lang.String&nbsp;_text)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../edu/rutgers/cs/scarletTaxi/notification_exporter/process/NType.html" title="enum in edu.rutgers.cs.scarletTaxi.notification_exporter.process">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?edu/rutgers/cs/scarletTaxi/notification_exporter/process/class-use/NType.html" target="_top">Frames</a></li> <li><a href="NType.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "47ca501e4864649b5e64187d7346c8e0", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 509, "avg_line_length": 56.5699481865285, "alnum_prop": 0.6715515662209196, "repo_name": "IkeLevens/Scarlet_Taxi", "id": "89169c480d9a0071481c53a977312ca55f19a86c", "size": "10918", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/edu/rutgers/cs/scarletTaxi/notification_exporter/process/class-use/NType.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "1854" }, { "name": "Java", "bytes": "68809" }, { "name": "PHP", "bytes": "1698" } ], "symlink_target": "" }
using Skybrud.Essentials.Http; using Skybrud.Essentials.Json; using Skybrud.Social.GitHub.Models.Repositories.Content; namespace Skybrud.Social.GitHub.Responses.Repositories.Content { /// <summary> /// Class representing a response with the contents of a file in a GitHub repository. /// </summary> public class GitHubContentResponse : GitHubResponse<GitHubContent> { /// <summary> /// Initializes a new instance from the specified <paramref name="response"/>. /// </summary> /// <param name="response">The raw response the instance should be based on.</param> public GitHubContentResponse(IHttpResponse response) : base(response) { Body = JsonUtils.ParseJsonObject(response.Body, GitHubContent.Parse); } } }
{ "content_hash": "44776d090d480ef76fbfbb5e92cdc823", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 92, "avg_line_length": 36.09090909090909, "alnum_prop": 0.6926952141057935, "repo_name": "abjerner/Skybrud.Social.GitHub", "id": "a95c75196c79ff1160c851c226d054425cd27970", "size": "796", "binary": false, "copies": "1", "ref": "refs/heads/v1/main", "path": "src/Skybrud.Social.GitHub/Responses/Repositories/Content/GitHubContentResponse.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "150" }, { "name": "C#", "bytes": "905570" } ], "symlink_target": "" }
package org.apereo.cas.services.resource; import org.apereo.cas.services.RegisteredService; /** * This is {@link RegisteredServiceResourceNamingStrategy}. Interface to provide naming strategy * to resource based services. * * @author Travis Schmidt * @since 5.3.0 */ @FunctionalInterface public interface RegisteredServiceResourceNamingStrategy { /** * Method will be called to provide a name for a resource to store a service. * * @param service - The Service to be saved. * @param extension - The extension to be used. * @return - String representing a resource name. */ String build(RegisteredService service, String extension); }
{ "content_hash": "45646b391a7b5955a9b948eace00c660", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 97, "avg_line_length": 29.782608695652176, "alnum_prop": 0.7197080291970803, "repo_name": "GIP-RECIA/cas", "id": "8fb63da9b2a0fcc2fffaf8db57f8c87cb4951d81", "size": "685", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/cas-server-core-services-registry/src/main/java/org/apereo/cas/services/resource/RegisteredServiceResourceNamingStrategy.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "241392" }, { "name": "Dockerfile", "bytes": "73" }, { "name": "Groovy", "bytes": "10930" }, { "name": "HTML", "bytes": "145773" }, { "name": "Java", "bytes": "10179516" }, { "name": "JavaScript", "bytes": "37158" }, { "name": "Ruby", "bytes": "1323" }, { "name": "Shell", "bytes": "108885" } ], "symlink_target": "" }
Write a program that uses the Sieve of Eratosthenes to find all the primes from 2 up to a given number. The Sieve of Eratosthenes is a simple, ancient algorithm for finding all prime numbers up to any given limit. It does so by iteratively marking as composite (i.e. not prime) the multiples of each prime, starting with the multiples of 2. Create your range, starting at two and continuing up to and including the given limit. (i.e. [2, limit]) The algorithm consists of repeating the following over and over: - take the next available unmarked number in your list (it is prime) - mark all the multiples of that number (they are not prime) Repeat until you have processed each number in your range. When the algorithm terminates, all the numbers in the list that have not been marked are prime. The wikipedia article has a useful graphic that explains the algorithm: https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes Notice that this is a very specific algorithm, and the tests don't check that you've implemented the algorithm, only that you've come up with the correct list of primes. ## Running tests Execute the tests with: ```bash $ elixir bob_test.exs ``` (Replace `bob_test.exs` with the name of the test file.) ### Pending tests In the test suites, all but the first test have been skipped. Once you get a test passing, you can unskip the next one by commenting out the relevant `@tag :pending` with a `#` symbol. For example: ```elixir # @tag :pending test "shouting" do assert Bob.hey("WATCH OUT!") == "Whoa, chill out!" end ``` Or, you can enable all the tests by commenting out the `ExUnit.configure` line in the test suite. ```elixir # ExUnit.configure exclude: :pending, trace: true ``` For more detailed information about the Elixir track, please see the [help page](http://exercism.io/languages/elixir). ## Source Sieve of Eratosthenes at Wikipedia [http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes](http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes) ## Submitting Incomplete Problems It's possible to submit an incomplete solution so you can see how others have completed the exercise.
{ "content_hash": "41c71ed1a3f6e4d0b68eca0a25ef4008", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 139, "avg_line_length": 30.514285714285716, "alnum_prop": 0.7602996254681648, "repo_name": "nlhuykhang/elixir-exercism", "id": "b3b182a3d4e68401de4527e13b963d37fed3c2d5", "size": "2145", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sieve/README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Elixir", "bytes": "149297" } ], "symlink_target": "" }
import logging import pprint import click import requests import simplejson as json from eventbot import settings, fixtures log = logging.getLogger(__name__) pp = pprint.PrettyPrinter(indent=4) @click.command() @click.option('--base_url', default='http://localhost:5000', help='Base URL for HTTP requests') @click.option('--event_id', default='123456789', help='Eventbrite event ID') @click.option('--attendee_id', default='123456789', help='Eventbrite attendee ID') def run(base_url, event_id, attendee_id): data = json.loads(fixtures.EVENTBRITE_ATTENDEE_UPDATED) data['api_url'] = 'https://www.eventbriteapi.com/v3/events/{}/attendees/{}/'.format(event_id, attendee_id) # pp.pprint(data) url = "{}/webhook/eventbrite".format(base_url) resp = requests.post(url, json=data) log.info(resp.status_code) if __name__ == '__main__': logging.basicConfig(format=settings.CLI_LOG_FORMAT, level=logging.DEBUG) run()
{ "content_hash": "14543015948484a0b2de173635c86d43", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 110, "avg_line_length": 33.75, "alnum_prop": 0.708994708994709, "repo_name": "duffj/eventbot-web-api", "id": "52888fa1e0b06743a10a982c2339acf73efd0b0e", "size": "967", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "scripts/simulate_eb_order.py", "mode": "33261", "license": "mit", "language": [ { "name": "Makefile", "bytes": "257" }, { "name": "Python", "bytes": "62441" }, { "name": "Shell", "bytes": "280" } ], "symlink_target": "" }
package controller import ( "fmt" "sync" "time" "github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors" "github.com/GoogleCloudPlatform/kubernetes/pkg/api/validation" "github.com/GoogleCloudPlatform/kubernetes/pkg/client" "github.com/GoogleCloudPlatform/kubernetes/pkg/labels" "github.com/GoogleCloudPlatform/kubernetes/pkg/util" "github.com/GoogleCloudPlatform/kubernetes/pkg/watch" "github.com/golang/glog" ) // ReplicationManager is responsible for synchronizing ReplicationController objects stored // in the system with actual running pods. type ReplicationManager struct { kubeClient client.Interface podControl PodControlInterface syncTime <-chan time.Time // To allow injection of syncReplicationController for testing. syncHandler func(controller api.ReplicationController) error } // PodControlInterface is an interface that knows how to add or delete pods // created as an interface to allow testing. type PodControlInterface interface { // createReplica creates new replicated pods according to the spec. createReplica(namespace string, controller api.ReplicationController) // deletePod deletes the pod identified by podID. deletePod(namespace string, podID string) error } // RealPodControl is the default implementation of PodControllerInterface. type RealPodControl struct { kubeClient client.Interface } // Time period of main replication controller sync loop const DefaultSyncPeriod = 10 * time.Second func (r RealPodControl) createReplica(namespace string, controller api.ReplicationController) { desiredLabels := make(labels.Set) for k, v := range controller.Spec.Template.Labels { desiredLabels[k] = v } desiredAnnotations := make(labels.Set) for k, v := range controller.Spec.Template.Annotations { desiredAnnotations[k] = v } // use the dash (if the name isn't too long) to make the pod name a bit prettier prefix := fmt.Sprintf("%s-", controller.Name) if ok, _ := validation.ValidatePodName(prefix, true); !ok { prefix = controller.Name } pod := &api.Pod{ ObjectMeta: api.ObjectMeta{ Labels: desiredLabels, Annotations: desiredAnnotations, GenerateName: prefix, }, } if err := api.Scheme.Convert(&controller.Spec.Template.Spec, &pod.Spec); err != nil { util.HandleError(fmt.Errorf("unable to convert pod template: %v", err)) return } if labels.Set(pod.Labels).AsSelector().Empty() { util.HandleError(fmt.Errorf("unable to create pod replica, no labels")) return } if _, err := r.kubeClient.Pods(namespace).Create(pod); err != nil { util.HandleError(fmt.Errorf("unable to create pod replica: %v", err)) } } func (r RealPodControl) deletePod(namespace, podID string) error { return r.kubeClient.Pods(namespace).Delete(podID) } // NewReplicationManager creates a new ReplicationManager. func NewReplicationManager(kubeClient client.Interface) *ReplicationManager { rm := &ReplicationManager{ kubeClient: kubeClient, podControl: RealPodControl{ kubeClient: kubeClient, }, } rm.syncHandler = rm.syncReplicationController return rm } // Run begins watching and syncing. func (rm *ReplicationManager) Run(period time.Duration) { rm.syncTime = time.Tick(period) resourceVersion := "" go util.Forever(func() { rm.watchControllers(&resourceVersion) }, period) } // resourceVersion is a pointer to the resource version to use/update. func (rm *ReplicationManager) watchControllers(resourceVersion *string) { watching, err := rm.kubeClient.ReplicationControllers(api.NamespaceAll).Watch( labels.Everything(), labels.Everything(), *resourceVersion, ) if err != nil { util.HandleError(fmt.Errorf("unable to watch: %v", err)) time.Sleep(5 * time.Second) return } for { select { case <-rm.syncTime: rm.synchronize() case event, open := <-watching.ResultChan(): if !open { // watchChannel has been closed, or something else went // wrong with our watch call. Let the util.Forever() // that called us call us again. return } if event.Type == watch.Error { util.HandleError(fmt.Errorf("error from watch during sync: %v", errors.FromObject(event.Object))) // Clear the resource version, this may cause us to skip some elements on the watch, // but we'll catch them on the synchronize() call, so it works out. *resourceVersion = "" continue } glog.V(4).Infof("Got watch: %#v", event) rc, ok := event.Object.(*api.ReplicationController) if !ok { if status, ok := event.Object.(*api.Status); ok { if status.Status == api.StatusFailure { glog.Errorf("failed to watch: %v", status) // Clear resource version here, as above, this won't hurt consistency, but we // should consider introspecting more carefully here. (or make the apiserver smarter) // "why not both?" *resourceVersion = "" continue } } util.HandleError(fmt.Errorf("unexpected object: %#v", event.Object)) continue } // If we get disconnected, start where we left off. *resourceVersion = rc.ResourceVersion // Sync even if this is a deletion event, to ensure that we leave // it in the desired state. glog.V(4).Infof("About to sync from watch: %v", rc.Name) if err := rm.syncHandler(*rc); err != nil { util.HandleError(fmt.Errorf("unexpected sync error: %v", err)) } } } } // Helper function. Also used in pkg/registry/controller, for now. func FilterActivePods(pods []api.Pod) []api.Pod { var result []api.Pod for _, value := range pods { if api.PodSucceeded != value.Status.Phase && api.PodFailed != value.Status.Phase { result = append(result, value) } } return result } func (rm *ReplicationManager) syncReplicationController(controller api.ReplicationController) error { s := labels.Set(controller.Spec.Selector).AsSelector() podList, err := rm.kubeClient.Pods(controller.Namespace).List(s) if err != nil { return err } filteredList := FilterActivePods(podList.Items) activePods := len(filteredList) diff := activePods - controller.Spec.Replicas if diff < 0 { diff *= -1 wait := sync.WaitGroup{} wait.Add(diff) glog.V(2).Infof("Too few \"%s\" replicas, creating %d\n", controller.Name, diff) for i := 0; i < diff; i++ { go func() { defer wait.Done() rm.podControl.createReplica(controller.Namespace, controller) }() } wait.Wait() } else if diff > 0 { glog.V(2).Infof("Too many \"%s\" replicas, deleting %d\n", controller.Name, diff) wait := sync.WaitGroup{} wait.Add(diff) for i := 0; i < diff; i++ { go func(ix int) { defer wait.Done() rm.podControl.deletePod(controller.Namespace, filteredList[ix].Name) }(i) } wait.Wait() } if controller.Status.Replicas != activePods { controller.Status.Replicas = activePods _, err = rm.kubeClient.ReplicationControllers(controller.Namespace).Update(&controller) if err != nil { return err } } return nil } func (rm *ReplicationManager) synchronize() { // TODO: remove this method completely and rely on the watch. // Add resource version tracking to watch to make this work. var controllers []api.ReplicationController list, err := rm.kubeClient.ReplicationControllers(api.NamespaceAll).List(labels.Everything()) if err != nil { util.HandleError(fmt.Errorf("synchronization error: %v", err)) return } controllers = list.Items wg := sync.WaitGroup{} wg.Add(len(controllers)) for ix := range controllers { go func(ix int) { defer wg.Done() glog.V(4).Infof("periodic sync of %v", controllers[ix].Name) err := rm.syncHandler(controllers[ix]) if err != nil { util.HandleError(fmt.Errorf("error synchronizing: %v", err)) } }(ix) } wg.Wait() }
{ "content_hash": "15784db8d6fdbffe1ab2a4e7c9874e2a", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 101, "avg_line_length": 31.64344262295082, "alnum_prop": 0.712213443854423, "repo_name": "nvoron23/kubernetes", "id": "b48871ea092eea73b17c1b185e610f6e8070c2bf", "size": "8299", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pkg/controller/replication_controller.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "94162" }, { "name": "CSS", "bytes": "4137" }, { "name": "Go", "bytes": "6185193" }, { "name": "HTML", "bytes": "9497" }, { "name": "Java", "bytes": "3258" }, { "name": "JavaScript", "bytes": "15405" }, { "name": "Makefile", "bytes": "5479" }, { "name": "Nginx", "bytes": "1013" }, { "name": "PHP", "bytes": "736" }, { "name": "Python", "bytes": "8416" }, { "name": "Ruby", "bytes": "2778" }, { "name": "Scheme", "bytes": "1112" }, { "name": "Shell", "bytes": "537999" } ], "symlink_target": "" }
var mongoose = require('mongoose'); // Define our token schema var AccessTokenSchema = new mongoose.Schema({ token: { type: String, required: true }, userId: { type: String, required: true }, clientId: { type: String, required: true }, created: { type: Date, default: Date.now } }); module.exports = mongoose.model('AccessToken', AccessTokenSchema);
{ "content_hash": "3ad6992e6d76105b248b307bb5d39f9f", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 66, "avg_line_length": 19.434782608695652, "alnum_prop": 0.5615212527964206, "repo_name": "jorguezz/oauth2-node-server", "id": "833cf5979b6bf4262c7008a75fad6f0f2a7dd9f2", "size": "447", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "models/access_token.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "110" }, { "name": "HTML", "bytes": "683" }, { "name": "JavaScript", "bytes": "25814" } ], "symlink_target": "" }
FROM balenalib/isg-503-alpine:3.15-build ENV NODE_VERSION 16.14.0 ENV YARN_VERSION 1.22.4 # Install dependencies RUN apk add --no-cache libgcc libstdc++ libuv \ && apk add --no-cache libssl1.0 || apk add --no-cache libssl1.1 RUN for key in \ 6A010C5166006599AA17F08146C2130DFD2497F5 \ ; do \ gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \ done \ && curl -SLO "http://resin-packages.s3.amazonaws.com/node/v$NODE_VERSION/node-v$NODE_VERSION-linux-alpine-aarch64.tar.gz" \ && echo "62ae676e881ef16c7179f37fe2b9947d0431968f621c5cab432f78958264caf1 node-v$NODE_VERSION-linux-alpine-aarch64.tar.gz" | sha256sum -c - \ && tar -xzf "node-v$NODE_VERSION-linux-alpine-aarch64.tar.gz" -C /usr/local --strip-components=1 \ && rm "node-v$NODE_VERSION-linux-alpine-aarch64.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && mkdir -p /opt/yarn \ && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && npm config set unsafe-perm true -g --unsafe-perm \ && rm -rf /tmp/* CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/[email protected]" \ && echo "Running test-stack@node" \ && chmod +x [email protected] \ && bash [email protected] \ && rm -rf [email protected] RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Alpine Linux 3.15 \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v16.14.0, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo $'#!/bin/bash\nbalena-info\nbusybox ln -sf /bin/busybox /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && ln -f /bin/sh /bin/sh.real \ && ln -f /bin/sh-shim /bin/sh
{ "content_hash": "50d6bbf4846ac2dba1b81c82a4217402", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 699, "avg_line_length": 65.04444444444445, "alnum_prop": 0.7109668602664845, "repo_name": "resin-io-library/base-images", "id": "c07464d67058d9939872d57de61d64b50852cffb", "size": "2948", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/node/isg-503/alpine/3.15/16.14.0/build/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "71234697" }, { "name": "JavaScript", "bytes": "13096" }, { "name": "Shell", "bytes": "12051936" }, { "name": "Smarty", "bytes": "59789" } ], "symlink_target": "" }
package org.bouldercounty.parks.trails; import org.bouldercounty.parks.trails.data.Folder; import org.bouldercounty.parks.trails.data.Placemark; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import com.google.android.maps.MapView; import com.google.android.maps.OverlayItem; import org.bouldercounty.parks.trails.R; /** * A view representing a MapView marker information balloon. * <p> * This class has a number of Android resource dependencies: * <ul> * <li>drawable/balloon_overlay_bg_selector.xml</li> * <li>drawable/balloon_overlay_close.png</li> * <li>drawable/balloon_overlay_focused.9.png</li> * <li>drawable/balloon_overlay_unfocused.9.png</li> * <li>layout/balloon_map_overlay.xml</li> * </ul> * </p> * * @author Jeff Gilfelt * */ public class BalloonOverlayView<Item extends OverlayItem> extends FrameLayout { public static String tag = "BalloonOverlayView"; private LinearLayout layout; private TextView title; private TextView snippet; Folder folder; Placemark placemark; View v; BoulderCountyApplication app; Context context; public BalloonOverlayView(final Context context, int balloonBottomOffset, final Folder folder, final Placemark pm, final MapView mapView) { super(context); app = (BoulderCountyApplication)context.getApplicationContext(); this.context = context; this.folder = folder; // setPadding(10, 0, 10, balloonBottomOffset); setPadding(10, 0, 5, balloonBottomOffset); layout = new LinearLayout(context); layout.setVisibility(VISIBLE); LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = inflater.inflate(R.layout.balloon_overlay, layout); title = (TextView) v.findViewById(R.id.balloon_item_title); title.setText(folder.getName()); snippet = (TextView) v.findViewById(R.id.balloon_item_snippet); snippet.setText("Parking"); placemark = pm; if (!BoulderCountyApplication.isMapAll && !pm.isParking) { // Log.e(tag, "<nonMapAll><nonParking>pm isParking=[" + pm.isParking); ((LinearLayout) v.findViewById(R.id.use)).setVisibility(View.VISIBLE); ((ImageView) v.findViewById(R.id.view_trails_btn)).setVisibility(View.GONE); if (pm.dog) { ((ImageView) v.findViewById(R.id.dog)).setVisibility(View.VISIBLE); } else { ((ImageView) v.findViewById(R.id.dog)).setVisibility(View.GONE); } if (pm.bike) { ((ImageView) v.findViewById(R.id.bike)).setVisibility(View.VISIBLE); } else { ((ImageView) v.findViewById(R.id.bike)).setVisibility(View.GONE); } if (pm.hike) { ((ImageView) v.findViewById(R.id.hiker)).setVisibility(View.VISIBLE); } else { ((ImageView) v.findViewById(R.id.hiker)).setVisibility(View.GONE); } if (pm.horse) { ((ImageView) v.findViewById(R.id.horse)).setVisibility(View.VISIBLE); } else { ((ImageView) v.findViewById(R.id.horse)).setVisibility(View.GONE); } } else if (!BoulderCountyApplication.isMapAll && pm.isParking) { // Log.e(tag, "<nonMapAll><Parking>pm isParking=[" + pm.toString()); ((LinearLayout) v.findViewById(R.id.use)).setVisibility(View.GONE); ((ImageView) v.findViewById(R.id.view_trails_btn)).setVisibility(View.VISIBLE); ((ImageView) v.findViewById(R.id.view_trails_btn)).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { try { if (!BoulderCountyApplication.isMapAll && pm.isParking) { // Log.e(tag, "pm=[" + pm); // Log.e(tag, "placemark=[" + placemark); String address = (null != pm.parkingAddress && pm.parkingAddress.length() > 5) ? pm.parkingAddress : "1521 CR 126 Nederland CO 80466"; address = address.replace(' ', '+'); // Log.e(tag, "address=[" + address); Intent geoIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + address )); BalloonOverlayView.this.context.startActivity(geoIntent); } else { Toast.makeText(BalloonOverlayView.this.getContext(), folder.getName(), Toast.LENGTH_SHORT).show(); // clear the map, kick off route drawing... ((BoulderCountyApplication)context.getApplicationContext()).currentFolder = folder; ((BoulderCountyMap)context).drawTrails(); } } catch (Exception e) { Log.e(tag, "Exception : " + e.toString()); } } }); } else if (BoulderCountyApplication.isMapAll && pm.isParking) { ((ImageView) v.findViewById(R.id.view_trails_btn)).setVisibility(View.VISIBLE); ((LinearLayout) v.findViewById(R.id.use)).setVisibility(View.GONE); ((ImageView) v.findViewById(R.id.view_trails_btn)).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { try { // if (!BoulderCountyApplication.isMapAll && pm.isParking) { // Log.e(tag, "pm=[" + pm); // Log.e(tag, "placemark=[" + placemark); String address = (null != pm.parkingAddress && pm.parkingAddress.length() > 5) ? pm.parkingAddress : "1521 CR 126 Nederland CO 80466"; address = address.replace(' ', '+'); // Log.e(tag, "address=[" + address); Intent geoIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + address )); BalloonOverlayView.this.context.startActivity(geoIntent); // } else { // Toast.makeText(BalloonOverlayView.this.getContext(), folder.getName(), Toast.LENGTH_SHORT).show(); // // clear the map, kick off route drawing... // ((BoulderCountyApplication)context.getApplicationContext()).currentFolder = folder; // ((BoulderCountyMap)context).drawTrails(); // } } catch (Exception e) { Log.e(tag, "Exception : " + e.toString()); } } }); } else { ((LinearLayout) v.findViewById(R.id.use)).setVisibility(View.VISIBLE); ((ImageView) v.findViewById(R.id.view_trails_btn)).setVisibility(View.VISIBLE); if (pm.dog) { ((ImageView) v.findViewById(R.id.dog)).setVisibility(View.VISIBLE); } else { ((ImageView) v.findViewById(R.id.dog)).setVisibility(View.GONE); } if (pm.bike) { ((ImageView) v.findViewById(R.id.bike)).setVisibility(View.VISIBLE); } else { ((ImageView) v.findViewById(R.id.bike)).setVisibility(View.GONE); } if (pm.hike) { ((ImageView) v.findViewById(R.id.hiker)).setVisibility(View.VISIBLE); } else { ((ImageView) v.findViewById(R.id.hiker)).setVisibility(View.GONE); } if (pm.horse) { ((ImageView) v.findViewById(R.id.horse)).setVisibility(View.VISIBLE); } else { ((ImageView) v.findViewById(R.id.horse)).setVisibility(View.GONE); } // Log.e(tag, "<mapAll>pm isParking=[" + pm.isParking); ((ImageView) v.findViewById(R.id.view_trails_btn)).setVisibility(View.VISIBLE); ((ImageView) v.findViewById(R.id.view_trails_btn)).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { try { if (!BoulderCountyApplication.isMapAll && pm.isParking) { // Log.e(tag, "pm=[" + pm); // Log.e(tag, "placemark=[" + placemark); String address = (null != pm.parkingAddress && pm.parkingAddress.length() > 5) ? pm.parkingAddress : "1521 CR 126 Nederland CO 80466"; address = address.replace(' ', '+'); // Log.e(tag, "address=[" + address); Intent geoIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + address )); BalloonOverlayView.this.context.startActivity(geoIntent); } else { Toast.makeText(BalloonOverlayView.this.getContext(), folder.getName(), Toast.LENGTH_SHORT).show(); // clear the map, kick off route drawing... folder.isSelected = true; ((BoulderCountyApplication)context.getApplicationContext()).currentFolder = folder; ((BoulderCountyMap)context).drawTrails(); } } catch (Exception e) { Log.e(tag, "Exception : " + e.toString()); } } }); } FrameLayout.LayoutParams params = new FrameLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); params.gravity = Gravity.NO_GRAVITY; addView(layout, params); } /** * Sets the view data from a given overlay item. * * @param item - The overlay item containing the relevant view data * (title and snippet). */ public void setData(Item item) { layout.setVisibility(VISIBLE); if (item.getTitle() != null) { title.setVisibility(VISIBLE); title.setText(item.getTitle()); } else { title.setVisibility(GONE); } if (item.getSnippet() != null) { snippet.setVisibility(VISIBLE); snippet.setText(item.getSnippet()); } else { snippet.setVisibility(GONE); } } // private double[] getMarkerCoordinates(List<List<String>> coordList) { // try { // for (List<String> coordinates : coordList) { // String[] s = coordinates.get(0).split(","); // return new double[] { Double.parseDouble(s[0]), Double.parseDouble(s[1]) }; // } // } catch (Exception e) { // Log.e(tag+".getMarkerCoordinates", "Exception: " + e.toString()); // } finally { // } // return new double[] {0, 0}; // } @Override public String toString() { return "[" + folder.name + "] [" + placemark + "]"; } }
{ "content_hash": "082451018582a89de628098ed0e11773", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 154, "avg_line_length": 35.141304347826086, "alnum_prop": 0.6581090834106609, "repo_name": "BoulderCounty/trails-app-android", "id": "4fb94bd85cde5e5144845e97a475e45936493f7e", "size": "10307", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/org/bouldercounty/parks/trails/BalloonOverlayView.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "156889" } ], "symlink_target": "" }
2016-01-19, Version 1.8.8 ========================= * republish (Joseph Tary) 2016-01-14, Version 1.8.7 ========================= * remove project-list (Joseph Tary) 2016-01-14, Version 1.8.6 ========================= * remove ubuntu fonts from arc (Anthony Ettinger) * Remove React dependency from Arc (Joseph Tary) * removed react depedency from metrics module (Joseph Tary) * Remove unused directives from arc.react.js, and remove from project. (Amrit Bhullar) * Add project list support. (Krishna Raman) 2015-12-15, Version 1.8.5 ========================= * Remove cxviz-pie (Joseph Tary) * Fix error when overriding host (Joseph Tary) * Add filesystem browsing support. (Krishna Raman) * update the react tools away from deprecated version (Joseph Tary) 2015-11-24, Version 1.8.4 ========================= * Revert "Add user easing for when chart data is insuffient" (Joseph Tary) * Change loopback-explorer to loopback-component-explorer (Joseph Tary) * add option to override Arc host settings, and display better connection info to user (Joseph Tary) * Add user easing for when chart data is insuffient (Joseph Tary) * fix property menu when navigating back and forth in composer (Anthony Ettinger) * remove old File call (Anthony Ettinger) * use Blob instead of File object in profiler (Anthony Ettinger) * Refer to licenses with a link (Sam Roberts) * Remove reference to internal PM (Joseph Tary) 2015-10-14, Version 1.8.3 ========================= * Revert "Fix squashed / overlapping chart containers" (Anthony Ettinger) * Fix issues with PID count on PM list (Joseph Tary) * Fix delete then set pid count issue in PM view (seanbrookes) * fix alignment on button for app popover (Anthony Ettinger) * fixup! revert d3 library upgrades (Ryan Graham) * add new generated lb-build script (Anthony Ettinger) * revert d3 library upgrades (Anthony Ettinger) * Ensure latest service instance when polling tracing processes (seanbrookes) * Fix target pid count mis-match (seanbrookes) * Fix squashed / overlapping chart containers (seanbrookes) 2015-10-05, Version 1.8.2 ========================= * Fix broken service resolution (seanbrookes) * Fix broken heap snapshot (seanbrookes) * Remove double slash from app control link display (seanbrookes) * Update loopback-workspace ver for new app controller (seanbrookes) * convert links in profile to spans (Anthony Ettinger) * pass cluster size to the new deployment API (Ryan Graham) * fix reference to renamed WorkspaceServices 3.0 (seanbrookes) * fix reference to renamed WorkspaceServices 2.0 (seanbrookes) * fix reference to renamed WorkspaceServices (seanbrookes) * Use strongloop conventions for licensing (Sam Roberts) * remove isolate test notation (seanbrookes) * fix jshint line too long (seanbrookes) * Replace internal pm with workspace controlls (seanbrookes) * update d3 libs (Anthony Ettinger) * add missing sdk api references (seanbrookes) * replace tracing pm host selector with shared component (Ryan Graham) * linting: fix jshint failures that abort the build (Ryan Graham) * set the number of x axis ticks to avoid messy auto display (seanbrookes) * fix loading delay issue with api analytics (seanbrookes) * Fix PID and profiles not updating automatically (Joseph Tary) * test: generate coverge for karma tests (Ryan Graham) * deps: update ws to 0.8.0 (Ryan Graham) * test: fix flaky compoer test (Ryan Graham) * fix various html/react errors (Ryan Graham) * test: fix e2e composer tests (Ryan Graham) * test: re-enable browser sync in protractor (Ryan Graham) * test: catch and ignore unlink error (Ryan Graham) 2015-08-18, Version 1.8.1 ========================= * adjust states to take into acound no-app state (seanbrookes) * initialize first host and process across the app modules (seanbrookes) 2015-08-17, Version 1.8.0 ========================= * remove reset to null on default datasource (seanbrookes) * add intercom widget (Anthony Ettinger) * remove clipboard dependency in tests (Anthony Ettinger) * remove ng-clipboard and zeroclipboard libraries (Anthony Ettinger) * Exclude Workspace model from test server reset (Ritchie Martori) * Hide app-controller when not supported (Joseph Tary) * test: remove assumption about error message (Ryan Graham) * deps: pin loopback-workspace to 3.15.x (Ryan Graham) * Fix missing ability to select models for property types (Joseph Tary) 2015-07-31, Version 1.7.1 ========================= * update log message object reference in catch conditions (seanbrookes) * Revert "pass cluster size to the new perform deployment API" (Krishna Raman) * fix Arc polling on unexpected error state (seanbrookes) * Pass cluster size to the new perform deployment API strong-deploy 3.x. (Tetsuo Seto) * Update pm-host.spec.js (Matthew Martori) * Update pm-host-error-view.spec.js (Matthew Martori) * Added basic coverage for process manager (Matttt) * add pagination to api-analytics graphs (Anthony Ettinger) 2015-07-24, Version 1.7.0 ========================= * fix using wrong property status test for host problems (seanbrookes) * add axis labels to api-analytics (Anthony Ettinger) * fix errant 'off' state for toggle control in the directive (seanbrookes) * updates to fix references to incorrect pm host (seanbrookes) * Removed arcmanager.json (Matttt) * replaced undefined `xdescribe`s and other jshint errors (Matttt) * Completed navigation coverage (Matttt) * Remove PID selector from API Analytics (Joseph Tary) * fix border on action cell in PM (Anthony Ettinger) * add dropdown select menu to styleguide (Anthony Ettinger) * add change stream to lb-build (seanbrookes) * Fixed whitespace, utilized Expected Conditions, and deleted misc file (Matttt) * Removed browser.pause() (Matttt) * Cleaned up to pass JSHint (Matttt) * Completed composer view coverage (Matttt) * Add additional e2e composer tests (Matttt) * add namespace to tracing rules (Anthony Ettinger) * fix select all in composer (Anthony Ettinger) * test: get protractor tests working again (Ryan Graham) * test: add protractor tests to npm test (Ryan Graham) * Re-enable smart profiling (Joseph Tary) * consistency updates to how Arc presents strong-pm (seanbrookes) 2015-07-07, Version 1.6.0 ========================= * Disable the smart profiler option (Joseph Tary) * simplify logic for testing for invalid module license (seanbrookes) * fix licensing message when not renewable (Anthony Ettinger) * fix license validity check for tracing (Anthony Ettinger) * remove user info after logout attempt (Anthony Ettinger) * Fix heap snapshot flicker (Joseph Tary) * add check for duplicate product and feature name (Anthony Ettinger) * licenses page using v2 api (Anthony Ettinger) * update oracle query path string (seanbrookes) * Fix incorrect status for PIDs (Joseph Tary) * tactical pm updates (seanbrookes) * build-deploy: use exit status for success/fail (Sam Roberts) * build-tasks: fix options to writeJsonFile (Sam Roberts) * fix broken integration test for property types (Anthony Ettinger) * Add delete button for profiles (Joseph Tary) * devtools: fix issues in the debugger UI (Miroslav Bajtoš) * make host actions menu more usable (seanbrookes) * Fix controls being locked after profiling (Joseph Tary) * Fix updating the status or PIDs and filter out broken profiles that will never complete. (Joseph Tary) * fix button state on trace navigation (seanbrookes) * adjust the alignment of the header controls (seanbrookes) * align with styleguide (seanbrookes) * use global jQuery and d3 in tracing modules (Ryan Graham) * remove tracing feature flag (seanbrookes) * Fix colour and working in profiler settings summary (Joseph Tary) * reset file load order after cleaning up deps (seanbrookes) * add favicon.ico to Arc's root static path (Ryan Graham) * process-manager: pass --base explicitly (Sam Roberts) * add nicer graphic to tracing init view (seanbrookes) * revert path to older version of contextMenu (seanbrookes) * Revert "Feature/licensing renewal" (Anthony Ettinger) * change default icon to use hover icon (Anthony Ettinger) * add growl messages for pid updates in tracing (seanbrookes) * fix initial timeseries chart rendering regression (seanbrookes) * fix control alignment issue (seanbrookes) * fix broken injection (seanbrookes) * deps: remove dependency on slug (Ryan Graham) * Add support to Arc for smart-profiling feature (Joseph Tary) 2015-06-11, Version 1.4.2 ========================= * fix broken injection (seanbrookes) * package: prevent strong-arc from bundling itself (Ryan Graham) * deps: remove dependency on slug (Ryan Graham) 2015-06-10, Version 1.4.1 ========================= * Fix issue with metric charts not displaying properly on load (Joseph Tary) * Revert "Add support to Arc for smart-profiling feature" (Joseph Tary) * Add support to Arc for smart-profiling feature (Joseph Tary) * handle case of brand new pm host with no app (seanbrookes) * minor text tweak (seanbrookes) * rework logic to test if pids have correct state (seanbrookes) * Allow offline model for getProducts() (Raymond Feng) * package: add bugs URL (Ryan Graham) * package: update license to use SPDX expression (Ryan Graham) * Only echo pm output to console during DEBUG mode (Sam Roberts) * delete extra mailto: (Setogit) * update to test if pm has no license (seanbrookes) * add licenses help id (Anthony Ettinger) * add api-analytics help id (Anthony Ettinger) * add support for non-module help icon (Anthony Ettinger) * exclude local app from PMServers service call (Anthony Ettinger) * fix dropdown menu in navbar (Anthony Ettinger) * include bower libraries in strong-arc package (Anthony Ettinger) * add `del` as dependency (Anthony Ettinger) * clean vendor directory before running build and bower install (Anthony Ettinger) * bower dependencies (Anthony Ettinger) 2015-06-03, Version 1.4.0 ========================= * fix missing scroll on inspector view take2 (seanbrookes) * add user input to typeahead on pm host form (Anthony Ettinger) * fix missing scroll on inspector view (seanbrookes) * use the right id to get a name of costItem (Setogit) * remove redundant directive declaration (seanbrookes) * revert chart label change (seanbrookes) * update the chart label (seanbrookes) * add extra $timeout to un-bind the rendering from the get request (seanbrookes) * wire up loading indicator to trace sequences (seanbrookes) * add filter to pm services to filter on worker id != 0 (seanbrookes) * make toggle switch only visible when it is safe (seanbrookes) * add feature flag back - tracing (seanbrookes) * final ux tweaks prior to release (seanbrookes) * fix broken dropdown (seanbrookes) * tracing ticker (seanbrookes) * implement styleguide toggle switch (seanbrookes) * initial toggle button troubleshooting (seanbrookes) * temporary Angular rollback for metrics fix (seanbrookes) * tracing view initialization cleanup (seanbrookes) * tweak to trigger build (seanbrookes) * add api-analytics feature flag (seanbrookes) * add new case to codified messages coming from host manager (seanbrookes) * remove tracing feature flag (seanbrookes) * fix scope problem betweem diff pm host selector versions (seanbrookes) * update app controller icon (Anthony Ettinger) * comment out code to save requests for trace history (seanbrookes) * add logic to show correct state of timline buttons (seanbrookes) * fix the ng-show logic (Setogit) * complete fix for stale pids on tracing stop/start (seanbrookes) * add feature flag to show/hide untagged waterfalls (seanbrookes) * add new menu icon to navbar (Anthony Ettinger) * resize chart dynamically based on dataset size (Anthony Ettinger) * change the drawing order of orange and blue lines (Setogit) * fix js exception causing render halt (seanbrookes) * rework waterfall navigation - mapped traces (seanbrookes) * remove reference to trace history directive (seanbrookes) * initial UX streamline: remove pie charts (seanbrookes) * filter dead pids in tracing pid selector (seanbrookes) * initial tracing on/off function (seanbrookes) * add license check to analytics (Anthony Ettinger) * ui control to toggle tracing on/off (seanbrookes) * remove page heading from analytics (Anthony Ettinger) * fix wrong var name (seanbrookes) * fix missing inspector values (seanbrookes) * add format wrapper to target values as per original (seanbrookes) * revert bad readme reference (Anthony Ettinger) * sort chart 2 (Anthony Ettinger) * ui fixup on licenses page (Anthony Ettinger) * Tracing main feature merge (seanbrookes) * fix bad object in licenses page (Anthony Ettinger) * add api analytics icon to landing page (Anthony Ettinger) * add clientDetail to popover on endpoint chart (Anthony Ettinger) * Add popover-dialog component to styleguide (Joseph Tary) * move advisor behind feature flag (Ryan Graham) * set feature flags earlier in boot (Ryan Graham) * api analytics charts (Anthony Ettinger) 2015-05-13, Version 1.3.0 ========================= * fix oracle and memcached metrics names (Setogit) * add feature flag support (Ryan Graham) * use minimist for CLI argument parsing (Ryan Graham) * move metrics out of beta (seanbrookes) * remove redundant functions (seanbrookes) * missed mongodb (seanbrookes) * add missing metrics probes (seanbrookes) 2015-05-08, Version 1.2.1 ========================= * Regenerate bundles (Ryan Graham) * Fix setting env variables against multi-app pm (Joseph Tary) 2015-05-05, Version 1.2.0 ========================= * updates to align metrics license check (seanbrookes) * Fix showing all pids on PM (Joseph Tary) * more explicit if/else license logic (seanbrookes) * remove redundant code (seanbrookes) * add license notification to metrics module (seanbrookes) * Remove the Arc app-controller port override. (Joseph Tary) * add global messaging to styleguide (Anthony Ettinger) * hide empty metrics charts (Joseph Tary) * Fix PM help button showing blank dialog (Joseph Tary) * Don't show app version if it can't be determined (Joseph Tary) * Fixup Arc dropdown menus (Joseph Tary) * fix persisting strict on model definition (seanbrookes) * Adjust padding for tables (Joseph Tary) * Fixes for metrics UX (Joseph Tary) * Add modal dialog component to live styleguide (Joseph Tary) * update start attempt count (seanbrookes) * add license key to licenses page (Anthony Ettinger) * Remove sidebar from metrics (Joseph Tary) * fix bad login redirect (Anthony Ettinger) * fix --licenses redirect (Anthony Ettinger) * Improve metrics background stability (Joseph Tary) * adjust color and icon size on error help popover (Anthony Ettinger) * Add UI to process manager to allow for editing environment variables (Joseph Tary) * revert license push api call (Anthony Ettinger) * Make the add host button larger and update the colors (Joseph Tary) * Fix checkbox alignment (Joseph Tary) * Fix indent on PID selector labels (Joseph Tary) * Retrofit table buttons with new style (Joseph Tary) * Add accessory button type (Joseph Tary) * add help icon redesign to styleguide (Anthony Ettinger) * add license push to action item menu on process manager (Anthony Ettinger) * make help icon red for errors (Anthony Ettinger) * fix broken autosuggest on PM (Anthony Ettinger) * add basic license renewal against api (Anthony Ettinger) * Various retrofits to improve compliance with styleguide (Joseph Tary) * readme: add reference to strong-pm.io (Sam Roberts) * Retrofit tabs on composer (Joseph Tary) * fix/improve arc run behaviour with slc start (Joseph Tary) * Fix the loading from local key store (Raymond Feng) * Copy properties from received errors (Raymond Feng) * Add products to licenses.json and improve error handling (Raymond Feng) * 1050-fix don't update the metrics when the tab is hidden to prevent memory leak (Joseph Tary) * Fix jshint style (Raymond Feng) * Add Subscription.getProducts() (Raymond Feng) * Remove the deprecation warning (Raymond Feng) * Fix the callback (Raymond Feng) * Work around the gulp hang (Raymond Feng) * Update auth url (Raymond Feng) * retrofit ui-inputs on arc (Anthony Ettinger) * Use the proxy login and reload subscriptions (Raymond Feng) * Add an observer to pm actions to push licenses (Raymond Feng) * Update deps (Raymond Feng) * Add arc apis to manage subscriptions (Raymond Feng) * add support for --login flag to arc (Anthony Ettinger) * fix metrics memory leak (seanbrookes) * add contextual help based on app selector to header navbar (Anthony Ettinger) * delete x should appear on hover (Anthony Ettinger) * add checkboxes on composer (Anthony Ettinger) * add new button styles to arc from the styleguide (Anthony Ettinger) * add validation to "add host" form (Anthony Ettinger) * re-order modules on landing page (Anthony Ettinger) * swap build-and-deploy and profiler on landing page (Anthony Ettinger) * cleanup header and navbar (Anthony Ettinger) * tests: loosen timeouts to account for slow VMs (Ryan Graham) * make comparison as lower case to ensure matches (seanbrookes) * add outside clickable trigger on info popovers (Anthony Ettinger) * remove dead / commented markup (seanbrookes) 2015-02-08, Version 1.1.0 ========================= * fix wrapping text in menu (Anthony Ettinger) * fix missing app selector for process-manager (Anthony Ettinger) * pid count updates (seanbrookes) * re-enable add host link when host is added (Anthony Ettinger) * lower bound for port input (Anthony Ettinger) * fix ui tweaks on Load balance in PM (Anthony Ettinger) * - upgrade status interaction (seanbrookes) * process-manager: disable pmctl channel (Sam Roberts) * design tweaks to PM (Anthony Ettinger) * - clean out comments (seanbrookes) * - visual design load balancer (seanbrookes) * add proper colum names for pids on PM (Anthony Ettinger) * add the add-row feature to PM (Anthony Ettinger) * enforce a promise interface on metrics chart config loader (Anthony Ettinger) * re-apply downstream fixes to styleguide (Anthony Ettinger) * - visual design application (seanbrookes) * add status buttons and icons for styleguide (Anthony Ettinger) * fix delayed load balancer rendering (seanbrookes) * Rename Manager to Process Manager (Ritchie Martori) * add popover info example to styleguide (Anthony Ettinger) * fix cluster restart (seanbrookes) * initial manager module (seanbrookes) * remove extra events in SG controller (Anthony Ettinger) * uncomment hidden style modules (Anthony Ettinger) * add action menu to styleguide (Anthony Ettinger) * uncomment hidden modules on styleguide (Anthony Ettinger) * add table form to styleguide (Anthony Ettinger) * functionally complete with new gauges (seanbrookes) * live styleguide (Anthony Ettinger) * use standard error color on composer model name (Anthony Ettinger) * change wording on deploy success message (Anthony Ettinger) * merge exception logic (seanbrookes) * Update deps to use ^ in version specs (Miroslav Bajtoš) * fix layout when zooming build & deploy (Anthony Ettinger) * client/test: nuke sandbox as part of reset (Ryan Graham) * client: more gracefully handle bad errors (Ryan Graham) * add shutoff in case of app start error (seanbrookes) * client/pm: app is running when a worker exists (Sam Roberts) * Default to one-shot mode for App Controller start (Sam Roberts) * tweak exception syntax again (seanbrookes) * make exception response handling more robust (seanbrookes) * fix label for selected pid in profiler (Anthony Ettinger) * rename request interceptor to match module (seanbrookes) 2015-01-12, Version 1.0.4 ========================= * tweaks to tagline and readme (seanbrookes) * add setScrollView method call to ds view to trigger scroll bars (seanbrookes) * add url field to DataSource form UI (seanbrookes) * handle logout errors on api call (Anthony Ettinger) * remove video from landing page (Anthony Ettinger) * update landing page with new look and feel (Anthony Ettinger) * hide port if local host (Anthony Ettinger) * update landing disabled icons with pointer (Anthony Ettinger) * fix bug when deleting datasources (Anthony Ettinger) * Fix bad CLA URL in CONTRIBUTING.md (Ryan Graham) * fix broken unit test (Anthony Ettinger) * load lodash into tests (Anthony Ettinger) * fix erroneous link in error message (Anthony Ettinger) * change datasource to data source (Anthony Ettinger) 2014-12-22, Version 1.0.3 ========================= * trigger build (seanbrookes) * check to make sure app is running before polling (seanbrookes) * fix model definition name reference (seanbrookes) * fix incorrect links (seanbrookes) * refactor model editor from react to angular (seanbrookes) * added missing CONST object (altsang) * add segmentio calls to identify module on (altsang) * update default model datasource options (seanbrookes) * - refactor model property editor back to Angular - add 'endter key' save on model name - fixed regression on #460 property data types (seanbrookes) * add iframe onload handler for profiler (Anthony Ettinger) * fixup! add growl warning (Miroslav Bajtoš) * move lb-services out of the way to prevent overwrite (seanbrookes) * - fix spelling - adjust sgment io available test logic (seanbrookes) * fix unit test fails (seanbrookes) * add segment io lib refs (seanbrookes) * add tracking to build and deploy module (altsang) * corrected malformed comment (altsang) * moved segmentio initialization to Arc.run (altsang) * added in more service methods for user (altsang) * add angular-segmentio scripts (altsang) * segment.io library added (altsang) * add user save data service (altsang) * discovery: always import id and required props (Miroslav Bajtoš) 2014-12-17, Version 1.0.2 ========================= * devtools: fix SplitView in Safari (Miroslav Bajtoš) * devtools: automatically prefix styles (Miroslav Bajtoš) * Remove PORT from env to avoid passing it to embeded pm (Ritchie Martori) 2014-12-17, Version 1.0.1 ========================= * Trim trailing whitespace (Ryan Graham) * Update README.md (Rand McKinney) * Updated for GA (Rand McKinney) 2014-12-16, Version 1.0.0 ========================= * Add Number.isInteger polyfil (Ryan Graham) * removed property update on change flow (seanbrookes) * fix orphaned spinner in the pid selector (seanbrookes) * Remove duplicate warning about unavailable metrics (Ryan Graham) * fix profiler init issues with file mode (seanbrookes) * adjust app controller icon start/stopped color (Anthony Ettinger) * Point help button at Arc docs (Ryan Graham) * add early beta access to app selector (Anthony Ettinger) * remove loop count from loop chart controls (seanbrookes) * add slightly darker background on buttons when clicked (seanbrookes) * fix unstyled datasource save button (seanbrookes) * ensure active instance is refreshed when editor view reloaded (seanbrookes) * package: update strong-pm to ^1.5.x (Sam Roberts) * fix broken logout dropdown menu (seanbrookes) * adjust font color and size of chart control nav items (seanbrookes) * adjust interval back to recommended (seanbrookes) * update arc author (seanbrookes) * - disable autostart app (seanbrookes) * fix right margin on chart getting clipped. (seanbrookes) * add 'early preview' tag to Metrics app on landing (seanbrookes) * update the growl message to match text in issue (seanbrookes) * fix timing issue with model/property create (seanbrookes) * change landing page and other ui fixups (Anthony Ettinger) * disabled the metrics panel when there is no data (Anthony Ettinger) * fix code spacing (seanbrookes) * - tighten up logic around pm host persistence (seanbrookes) * close (seanbrookes) * incremental changes (seanbrookes) * - add autoload to processes - add spinner to load process flow (seanbrookes) * add cursor to app-controller (Anthony Ettinger) * metrics cleanup (seanbrookes) * Add start-stop and circle icons to font icons (Anthony Ettinger) * add generic popover for disabled apps (Anthony Ettinger) * adjust bottom margin on pid selector (Anthony Ettinger) * preselect pid in pid selector (Anthony Ettinger) * pm: use process.execPath (Ryan Graham) * Add strong-build dependency (Ryan Graham) * only add the pm instance once - and at the end (seanbrookes) * change query string keyword from where to filter (seanbrookes) * fix incorrect data property reference (seanbrookes) * change started icon for app controller (Anthony Ettinger) * stop migrate button from submitting form by default (Anthony Ettinger) * hide app controller if user is logged out (Anthony Ettinger) * change universal in deploy message to tar file (Anthony Ettinger) * rearrange CPU chart controls (seanbrookes) * begin to move pm host form out of pid selector (seanbrookes) * implement visual design on app controller (Anthony Ettinger) * add archive filename label to build tar file form (Anthony Ettinger) * - refactored the polling to be less memory heavy (seanbrookes) * add 'select a process' to pid selector label (Anthony Ettinger) * hide pointer on placeholder icons (Anthony Ettinger) * fix: syntax error, missing { (Ryan Graham) * Don't load entire app for -v and -h (Ryan Graham) * Defer starting process-manager until app start (Ryan Graham) * Don't save model config as attributes (Ryan Graham) * add unsupported icons to landing page (Anthony Ettinger) * Remove generated css file (Ryan Graham) * Hide spinner controls from port input fields (Ryan Graham) * additional code cleanup (seanbrookes) * change tarball to tar file (Anthony Ettinger) * local app stop/start (seanbrookes) * Move jsx transform to server (Ryan Graham) * Refactor propery update (Ritchie Martori) * change strong arc to stronloop arc (Anthony Ettinger) * arc metaphor landing page (Anthony Ettinger) * re-initialize profiler when clicking load button (Anthony Ettinger) * Manual merge (Ritchie Martori) * Add install arg for git builds (Ritchie Martori) * Remove unused archive input (Ritchie Martori) * Change universal to Tarball and switch default (Ritchie Martori) * revert jsxtransform update (seanbrookes) * Refactor embedded process manager (Ritchie Martori) * process-manager: attach IPC channel to pm child (Sam Roberts) * process-manager: use better regex (Sam Roberts) * Remove strong-pm dir on start and exit (Ritchie Martori) * Ensure the PORT is stored for pm proxied request (Ritchie Martori) * Fix baseURL for local deployments (Ritchie Martori) * update jsx/react version to fix Firfox source issue (seanbrookes) * add flag to model create flow to prevent race (seanbrookes) * filter out dead pids (Anthony Ettinger) * fix bug where success looked like an error (Anthony Ettinger) * fix broken test file references (seanbrookes) * fix module name reference error (seanbrookes) * metrics visualization spike (seanbrookes) * update model properties from onchange event (Anthony Ettinger) * Add disabled state for arc apps (Ritchie Martori) * Init (Ritchie Martori) * Make async full (non dev) dependency (Ritchie Martori) * Default to 1 proc for local deploy Use default config for all deployments (Ritchie Martori) * disable profiler radio buttons when profiling (Anthony Ettinger) * text changes for arc (Anthony Ettinger) * Remove references to STUDIO env vars (Anthony Ettinger) * change route from /#studio to /# (Anthony Ettinger) * add simple preserve strong-pm server reference (seanbrookes) * add popover for menus (Anthony Ettinger) * Add an embeded process manager (Ritchie Martori) * force contextual help links to open in new window (Anthony Ettinger) * fix resize issue hiding profiler header on iframe loading (seanbrookes) * add dark gray background to profiler (Anthony Ettinger) * deps: bump strong-deploy dependency (Ryan Graham) * Support local deployment (Sam Roberts) * Fix call to git deploy from strong-deploy (Sam Roberts) * Update README.md (poldridge) * hide file button when remote default state is set (Anthony Ettinger) * UI Fixups for build and deploy (Anthony Ettinger) * add spinner to build and deploy (Anthony Ettinger) * fix endpoint for deploy (Anthony Ettinger) * remove deprecated code (Anthony Ettinger) * swap file and remote in profiler (Anthony Ettinger) * refactor profiler references to new endpoints (Anthony Ettinger) * add better error handling for build and deploy (Anthony Ettinger) * Remove auto-generated strongloop.css from git (Miroslav Bajtoš) * Remove "npm install loopback-explorer" log (Miroslav Bajtoš) * bin/cli: rename Studio to Arc (Miroslav Bajtoš) * update pid module to reflect rest api changes (seanbrookes) * fix error object reference in try/catch block (seanbrookes) * Fix the ability to set array type on model property (seanbrookes) * client: use the local help files (Miroslav Bajtoš) * Gulpfile: download help assets (Miroslav Bajtoš) * add new landing page icons (Anthony Ettinger) * Build and deploy wireframe (Anthony Ettinger) * rename arc in the version file generator (seanbrookes) * Fix bug where file vs. remote isn't reseting (Anthony Ettinger) * arc rename (seanbrookes) * Update README (Raymond Feng) * Rename the github repo to strong-arc (Raymond Feng) * Add contextual help directive (Anthony Ettinger) * Add other apps to landing page (Anthony Ettinger) * Refactor pid selector into a directive (Anthony Ettinger) * Fix broken link (Anthony Ettinger) * Move hardcoded colors out of css (Anthony Ettinger) * Update devtools css with design spec (Anthony Ettinger) * Always show help message for the global error (Miroslav Bajtoš) * Show custom help for missing oracle connector (Miroslav Bajtoš) * Remove old code (Anthony Ettinger) * add scrollable page layout (Anthony Ettinger) * Rebuild css (Anthony Ettinger) * add profiler navbar (Anthony Ettinger) * bin: add --help and --version (Miroslav Bajtoš) * Remove sandbox files from git. (Miroslav Bajtoš) * test-server: forward Karma/Protractor exit code (Miroslav Bajtoš) * Fix for inability to edit property comments (seanbrookes) * - clean up logic around test for array type (seanbrookes) * Protractor e2e POC and init tests (seanbrookes) * client/test/integration: fix datasource tests (Miroslav Bajtoš) * - replace missing ds update test (seanbrookes) * - fix timeout issue on datasource test spec (seanbrookes) * - fix erroneous response property reference (seanbrookes) * - add unit tests to cover some of the changed functionality - fix broken datasource unit test (seanbrookes) * fix not all model properties getting rendered (seanbrookes) * Redirect user if they are logged in and land on homepage (Anthony Ettinger) * client: ignore readonly models (Miroslav Bajtoš) * convert css to less (Anthony Ettinger) * implement stop and start app buttons in UI (seanbrookes) * Update icons to v3 (Anthony Ettinger) * refactor studio and composer into modules (seanbrookes) * client: rework page title (Miroslav Bajtoš) * client/test: increase timeout for slow tests (Miroslav Bajtoš) * gulpfile: group all less tasks (Miroslav Bajtoš) * client/test: use unique port number (Miroslav Bajtoš) * client: remove style.css from version control (Miroslav Bajtoš) * client: build workspace services using gulp (Miroslav Bajtoš) * Provide npm with a real .npmignore (Ryan Graham) 2014-10-30, Version 0.2.1 ========================= * client: ignore readonly models (Miroslav Bajtoš) 2014-10-01, Version 0.2.0 ========================= * Bump version (Raymond Feng) * Update contribution guidelines (Ryan Graham) * Change classes to .ui-msg-inline (Anthony Ettinger) * Apply styles to error messages on testConnection button (Anthony Ettinger) * Add license (Raymond Feng) * - add logic to the global exception display component to allow for the help text to contain more structure including hyperlinks to help give users additional help when they run into known problems (seanbrookes) * fix not showing discover menu item (seanbrookes) * client/explorer: fix error handling (Miroslav Bajtoš) * client/explorer: ensure app is running (Miroslav Bajtoš) * client/test: use Workspace.start/stop (Miroslav Bajtoš) * client: update workspace client services (Miroslav Bajtoš) * Align message text with button text (Anthony Ettinger) * Fix display of success message on test button (Anthony Ettinger) * fix for invalid / unsaved datsource triggering discovery flow pre-maturely (seanbrookes) * Convert datasource.css to less (Anthony Ettinger) * update context menu for discoverable datasource (seanbrookes) * implement test for valid project when starting api composer - still some work to do as there are dependencies between studio and composer that need to cleaned up in the process of creating a more comprehensive exception handling strategy across the apps (seanbrookes) * Refactor code to not require pageId defined explicitly on every controller. (Anthony Ettinger) * Remove route change event infavor of each page defining its "appId". (Anthony Ettinger) * clear selectedApp when navigating. (Anthony Ettinger) * fix delete model cause editor view to disappear. (seanbrookes) * Fixes #337 (seanbrookes) * Hide button in topnav for profiler (Anthony Ettinger) * Text changes for profiler (Anthony Ettinger) * move a js file to try and get the unit tests to run in CI (seanbrookes) * implement prototype$createModel (seanbrookes) * fix broken test (seanbrookes) * add support for angular-spin activity indicator (seanbrookes) * Pass in the options.schema for selected models (Raymond Feng) * client: use connectorMetadata to detect discovery (Miroslav Bajtoš) * client: use connectorMetadata to detect migration (Miroslav Bajtoš) * client: use connectorMetadata in datasource form (Miroslav Bajtoš) * client: load connectorMetadata in studio (Miroslav Bajtoš) * modify disabled attribute logic in directives (seanbrookes) * Discovery flow polish - updated ng-grid library - updated CSS - modified some wizard flow logic to manage selectAll button (seanbrookes) * client: implement `WorkspaceService.valiate` (Miroslav Bajtoš) * trigger resize event on window to work around data glitch on discovery step 1. (Anthony Ettinger) * Force dropdown menu item from Logout button to expand the full width of the menu container. (Anthony Ettinger) * fix placement of navbar when clicking Logout. (Anthony Ettinger) * Tell CI not to run mocha directly (Ryan Graham) * Fix build (Ritchie Martori) * hide app selector on un-related pages. should only be visible on api composer and profiler pages. (Anthony Ettinger) * client: use `modelPropertyTypes` in model form (Miroslav Bajtoš) * client/test: infrastructure for MySQL datasource (Miroslav Bajtoš) * client/test: add ES5 shims for PhantomJS (Miroslav Bajtoš) * gulpfile: add gulpfile to jshint inputs (Miroslav Bajtoš) * gulpfile: extract "pull-devtools" to a new file (Miroslav Bajtoš) * package: use workspace from npmjs.org (Miroslav Bajtoš) * bringing discovery flow back into studio (seanbrookes) * client/explorer: use host from project config (Miroslav Bajtoš) * hide start button and record heap allocations (Anthony Ettinger) * fix font sizing on landing page (Anthony Ettinger) * add graphics to landing page and re-visit design. add isAuth method in suite controller add descriptions to app data (Anthony Ettinger) * client: Fix given.dataSourceInstance (Miroslav Bajtoš) * add stub for app selector add ui selector style ui selector and add more apps to data file for testing. add icons to menu add note about renaming .ui class names to be generic refactor drop down selector to pre-select menu item from page controllers. remove timers, infavor of ng-mouseleave calling hideMenu() directly. remove underscores in filenames. remove extraneous reference to scope.selectedApp (Anthony Ettinger) * fixes the issue where users have to save their model before adding properties (seanbrookes) * client: add ExplorerService.getSwaggerResources (Miroslav Bajtoš) * examples/empty: allow cross-origin requests (Miroslav Bajtoš) * client: fix karma.integration.js (Miroslav Bajtoš) * examples: revert unintentional change in 9a35e93e (Miroslav Bajtoš) * move icons.css into icons.less and add abstraction layer for wrapping font icon class names. (Anthony Ettinger) * Squash commits for file/class sync for font icons. (Anthony Ettinger) * #254 refactor strongloop font css to have seperate namespace than bootstrap icons (Anthony Ettinger) * #252 add checkmark and checkmark-outline to icon font (Anthony Ettinger) * - add grunt watch task for automatically building less to css when a file changes. - add standard .editorconfig to define spacing/tab indentation rules. - mixins.less - add more bottom margin to products (re: stacy) - change products to apps throughout feature. - fix header link - remove -src ref in ./less directories - use more verbose class name - change editorconfig to space instead of tab - refactor ajax call in landing service to not use deferred. - fix gulp line to 80 chars wide (Anthony Ettinger) * fix localStorage dynamic port issue (seanbrookes) 2014-09-09, Version 0.1.0 ========================= * First release!
{ "content_hash": "559bba9f2c19e0dbc51e4ad5d6311dcc", "timestamp": "", "source": "github", "line_count": 1324, "max_line_length": 511, "avg_line_length": 28.76283987915408, "alnum_prop": 0.7409799905467149, "repo_name": "tsiry95/openshift-strongloop-cartridge", "id": "755d312bac02b614178a3326a13f0583779639b3", "size": "38128", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "strongloop/node_modules/strong-arc/CHANGES.md", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "2028852" }, { "name": "C++", "bytes": "569460" }, { "name": "Groff", "bytes": "4748" }, { "name": "HTML", "bytes": "690" }, { "name": "JavaScript", "bytes": "25268" }, { "name": "Shell", "bytes": "13019" } ], "symlink_target": "" }
'use strict'; var _ = require('lodash'); var authConfig = require('./waterlock-local-auth').authConfig; /** * TODO these can be refactored later * @type {Object} */ function validateEmail(email) { var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); } module.exports = function(Auth, engine,params){ if(typeof params.email !== 'undefined'){ return generateScope('email', engine); }else if(typeof params.username !== 'undefined'){ if(validateEmail(params.username)) return generateScope('email', engine); return generateScope('username', engine); }else{ var error = new Error('Auth model must have either an email or username attribute'); throw error; } }; function generateScope(scopeKey, engine){ return { type: scopeKey, engine: engine, getUserAuthObject: function(attributes, req, cb){ var attr = {password: attributes.password}; attr[scopeKey] = attributes[scopeKey]; var criteria = {}; criteria[scopeKey] = attr[scopeKey]; if(authConfig.createOnNotFound){ this.engine.findOrCreateAuth(criteria, attr, cb); }else{ this.engine.findAuth(criteria, cb); } } }; }
{ "content_hash": "603d7c82f3fea8ccf9446c357a3d7763", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 166, "avg_line_length": 28.67391304347826, "alnum_prop": 0.604245640636846, "repo_name": "praveenaj/waterlock-local-auth", "id": "4fa80995b1bf4ee3414c71cc0af05f4df8720e93", "size": "1319", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/scope.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "122" }, { "name": "JavaScript", "bytes": "20365" }, { "name": "Makefile", "bytes": "876" } ], "symlink_target": "" }
""" Author : Syed Faizan (3rd Year Student IIIT Pune) github : faizan2700 You are given a bitmask m and you want to efficiently iterate through all of its submasks. The mask s is submask of m if only bits that were included in bitmask are set """ from __future__ import annotations def list_of_submasks(mask: int) -> list[int]: """ Args: mask : number which shows mask ( always integer > 0, zero does not have any submasks ) Returns: all_submasks : the list of submasks of mask (mask s is called submask of mask m if only bits that were included in original mask are set Raises: AssertionError: mask not positive integer >>> list_of_submasks(15) [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1] >>> list_of_submasks(13) [13, 12, 9, 8, 5, 4, 1] >>> list_of_submasks(-7) # doctest: +ELLIPSIS Traceback (most recent call last): ... AssertionError: mask needs to be positive integer, your input -7 >>> list_of_submasks(0) # doctest: +ELLIPSIS Traceback (most recent call last): ... AssertionError: mask needs to be positive integer, your input 0 """ assert ( isinstance(mask, int) and mask > 0 ), f"mask needs to be positive integer, your input {mask}" """ first submask iterated will be mask itself then operation will be performed to get other submasks till we reach empty submask that is zero ( zero is not included in final submasks list ) """ all_submasks = [] submask = mask while submask: all_submasks.append(submask) submask = (submask - 1) & mask return all_submasks if __name__ == "__main__": import doctest doctest.testmod()
{ "content_hash": "7fb28154f68c58ae5844197f1913ce79", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 85, "avg_line_length": 28.177419354838708, "alnum_prop": 0.6325128792215227, "repo_name": "wuweilin/python", "id": "21c64dba4ecccac555e6135f32ba86134d3a4333", "size": "1747", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "dynamic_programming/iterating_through_submasks.py", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
import { Component } from '@angular/core'; import { NavController, NavParams, ModalController, ToastController } from 'ionic-angular'; import { LanguagesPage } from "./languages/languages"; import { TranslateService } from "@ngx-translate/core"; import { availableLanguages } from "../../../app/languages"; import { AppPreferences } from "@ionic-native/app-preferences"; import { CurrenciesPage } from '../../currencies/currencies'; import { DbCurrenciesProvider } from '../../../providers/db-currencies'; import { ExchangeRatesProvider } from '../../../providers/exchange-rates'; @Component({ selector: 'page-general', templateUrl: 'general.html' }) export class GeneralPage { currency: any; language: { name: string; code: string; }; constructor( public navCtrl: NavController, public navParams: NavParams, private modalCtrl: ModalController, private translate: TranslateService, private appPref: AppPreferences, private dbCurr: DbCurrenciesProvider, private exRates: ExchangeRatesProvider, private toastCtrl: ToastController ) { availableLanguages.forEach(lang => { if (lang.code == this.translate.currentLang) { this.language = lang; } }); this.appPref.fetch('general', 'baseCurrency').then((data) => { if (typeof data === 'string') { data = JSON.parse(data); } this.currency = data; console.log(this.currency.name); }).catch(error => console.error(error)); } selectLanguage() { let modal = this.modalCtrl.create(LanguagesPage, { resolve: true }, { enableBackdropDismiss: false }); modal.present(); modal.onDidDismiss((language) => { if (language) { this.translate.use(language.code).subscribe(async () => { this.language = language; try { await this.appPref.store('general', 'language', language.code); console.log('App language set to:', language.code); } catch (error) { console.error(error); } }); } }); } selectCurrency() { let modal = this.modalCtrl.create(CurrenciesPage, { resolve: true }, { enableBackdropDismiss: false }); modal.present(); modal.onDidDismiss(async (currency) => { try { if (currency) { this.currency = currency; let oldCurrency = await this.appPref.fetch('general', 'baseCurrency'); if (oldCurrency) { oldCurrency = await this.dbCurr.get(oldCurrency.id); if (oldCurrency.length == 1) { oldCurrency[0].base = false; this.dbCurr.save(oldCurrency[0]); } } currency.base = true; await this.dbCurr.save(currency); await this.appPref.store('general', 'baseCurrency', JSON.stringify(currency)); await this.exRates.download(); this.presentToast('Base currency set to ' + currency.name + '.'); } } catch (error) { console.error(error); } }); } private presentToast(message) { let toast = this.toastCtrl.create({ message: this.translate.instant(message), duration: 3000, position: 'bottom' }); toast.present(); } }
{ "content_hash": "ad931e7d857b6d061ad6abe589f01208", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 107, "avg_line_length": 31.715686274509803, "alnum_prop": 0.617001545595054, "repo_name": "bbosternak/expman", "id": "0d781d0ad3ad6a3adbf0a5f062ec4af08992c20f", "size": "3235", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/pages/settings/general/general.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "6338" }, { "name": "HTML", "bytes": "24749" }, { "name": "JavaScript", "bytes": "4189" }, { "name": "TypeScript", "bytes": "91458" } ], "symlink_target": "" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Problem05HexadecimalToBinary")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Johnson Controls")] [assembly: AssemblyProduct("Problem05HexadecimalToBinary")] [assembly: AssemblyCopyright("Copyright © Johnson Controls 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("2fb97a3c-aeb7-4058-aba9-efb93c3150ee")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "content_hash": "35e244059ccc446d3568081d46a6f123", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 40.583333333333336, "alnum_prop": 0.7549623545516769, "repo_name": "atanas-georgiev/TelerikAcademy", "id": "a3552a5eeb5e82ead30e8b1a35f9ec6a2461e59d", "size": "1464", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "02.CSharp-Part-2/Homeworks/Homework4/Problem05HexadecimalToBinary/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "242695" }, { "name": "C#", "bytes": "3137170" }, { "name": "CSS", "bytes": "37175" }, { "name": "CoffeeScript", "bytes": "4103" }, { "name": "HTML", "bytes": "187118" }, { "name": "JavaScript", "bytes": "1751559" }, { "name": "PLpgSQL", "bytes": "6696" }, { "name": "XSLT", "bytes": "3435" } ], "symlink_target": "" }
package org.apache.river.test.spec.jeri.transport.util; //jeri imports import net.jini.jeri.ServerEndpoint.ListenContext; import net.jini.jeri.ServerEndpoint.ListenCookie; import net.jini.jeri.ServerEndpoint.ListenEndpoint; import net.jini.jeri.ServerEndpoint.ListenHandle; //import java.io import java.io.IOException; //harness imports import org.apache.river.qa.harness.TestException; //java.util import java.util.ArrayList; public class EIUTContext implements ListenContext { private ArrayList results = new ArrayList(); public ListenCookie addListenEndpoint(ListenEndpoint endpoint) throws IOException { try { ListenHandle lh = endpoint.listen(new SETRequestHandler()); results.add(new Boolean(false)); return lh.getCookie(); } catch (IOException e) { results.add(new Boolean(true)); throw e; //This listen context expects an IOException } } public ArrayList getResults() { return results; } }
{ "content_hash": "41fb28a98d00dba72e6efcd5435bb654", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 71, "avg_line_length": 26.641025641025642, "alnum_prop": 0.6958614051973051, "repo_name": "pfirmstone/river-internet", "id": "e6e5e185846451d70ef55c09f634afd7ddbaa684", "size": "1845", "binary": false, "copies": "2", "ref": "refs/heads/trunk", "path": "qa/src/org/apache/river/test/spec/jeri/transport/util/EIUTContext.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2047" }, { "name": "Groff", "bytes": "863" }, { "name": "Groovy", "bytes": "35711" }, { "name": "HTML", "bytes": "4398920" }, { "name": "Java", "bytes": "33660467" }, { "name": "Makefile", "bytes": "3046" }, { "name": "Shell", "bytes": "69126" } ], "symlink_target": "" }
from bigml.api import BigML api = BigML() source1_file = "iris.csv" args = \ {'fields': {'000000': {'name': 'sepal length', 'optype': 'numeric'}, '000001': {'name': 'sepal width', 'optype': 'numeric'}, '000002': {'name': 'petal length', 'optype': 'numeric'}, '000003': {'name': 'petal width', 'optype': 'numeric'}, '000004': {'name': 'species', 'optype': 'categorical', 'term_analysis': {'enabled': True}}}, } source2 = api.create_source(source1_file, args) api.ok(source2) args = \ {'objective_field': {'id': '000004'}, } dataset1 = api.create_dataset(source2, args) api.ok(dataset1) args = \ {'anomaly_seed': 'bigml', 'seed': 'bigml'} anomaly1 = api.create_anomaly(dataset1, args) api.ok(anomaly1) args = \ {'input_data': {'petal length': 0.5, 'petal width': 0.5, 'sepal length': 1, 'sepal width': 1, 'species': 'Iris-setosa'}, } anomalyscore1 = api.create_anomalyscore(anomaly1, args) api.ok(anomalyscore1)
{ "content_hash": "798a9420d433dee6b321fe5099e73b76", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 68, "avg_line_length": 27.545454545454547, "alnum_prop": 0.6523652365236524, "repo_name": "bigmlcom/bigmler", "id": "b8bad93ef0eb855ef17a26be1c2260790d1a52d0", "size": "909", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "check_files/reify_anomaly_score.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "26465" }, { "name": "JavaScript", "bytes": "73784" }, { "name": "Jupyter Notebook", "bytes": "802" }, { "name": "Python", "bytes": "2081730" }, { "name": "R", "bytes": "71763" } ], "symlink_target": "" }
import defined from "./defined.js"; import DeveloperError from "./DeveloperError.js"; import IndexDatatype from "./IndexDatatype.js"; import CesiumMath from "./Math.js"; /** * Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is * organized into a pyramid of tiles according to a {@link TilingScheme}. This type describes an * interface and is not intended to be instantiated directly. * * @alias TerrainProvider * @constructor * * @see EllipsoidTerrainProvider * @see CesiumTerrainProvider * @see VRTheWorldTerrainProvider * @see GoogleEarthEnterpriseTerrainProvider */ function TerrainProvider() { DeveloperError.throwInstantiationError(); } Object.defineProperties(TerrainProvider.prototype, { /** * Gets an event that is raised when the terrain provider encounters an asynchronous error.. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners * are passed an instance of {@link TileProviderError}. * @memberof TerrainProvider.prototype * @type {Event} */ errorEvent: { get: DeveloperError.throwInstantiationError, }, /** * Gets the credit to display when this terrain provider is active. Typically this is used to credit * the source of the terrain. This function should * not be called before {@link TerrainProvider#ready} returns true. * @memberof TerrainProvider.prototype * @type {Credit} */ credit: { get: DeveloperError.throwInstantiationError, }, /** * Gets the tiling scheme used by the provider. This function should * not be called before {@link TerrainProvider#ready} returns true. * @memberof TerrainProvider.prototype * @type {TilingScheme} */ tilingScheme: { get: DeveloperError.throwInstantiationError, }, /** * Gets a value indicating whether or not the provider is ready for use. * @memberof TerrainProvider.prototype * @type {Boolean} */ ready: { get: DeveloperError.throwInstantiationError, }, /** * Gets a promise that resolves to true when the provider is ready for use. * @memberof TerrainProvider.prototype * @type {Promise.<Boolean>} * @readonly */ readyPromise: { get: DeveloperError.throwInstantiationError, }, /** * Gets a value indicating whether or not the provider includes a water mask. The water mask * indicates which areas of the globe are water rather than land, so they can be rendered * as a reflective surface with animated waves. This function should not be * called before {@link TerrainProvider#ready} returns true. * @memberof TerrainProvider.prototype * @type {Boolean} */ hasWaterMask: { get: DeveloperError.throwInstantiationError, }, /** * Gets a value indicating whether or not the requested tiles include vertex normals. * This function should not be called before {@link TerrainProvider#ready} returns true. * @memberof TerrainProvider.prototype * @type {Boolean} */ hasVertexNormals: { get: DeveloperError.throwInstantiationError, }, /** * Gets an object that can be used to determine availability of terrain from this provider, such as * at points and in rectangles. This function should not be called before * {@link TerrainProvider#ready} returns true. This property may be undefined if availability * information is not available. * @memberof TerrainProvider.prototype * @type {TileAvailability} */ availability: { get: DeveloperError.throwInstantiationError, }, }); var regularGridIndicesCache = []; /** * Gets a list of indices for a triangle mesh representing a regular grid. Calling * this function multiple times with the same grid width and height returns the * same list of indices. The total number of vertices must be less than or equal * to 65536. * * @param {Number} width The number of vertices in the regular grid in the horizontal direction. * @param {Number} height The number of vertices in the regular grid in the vertical direction. * @returns {Uint16Array|Uint32Array} The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less. */ TerrainProvider.getRegularGridIndices = function (width, height) { //>>includeStart('debug', pragmas.debug); if (width * height >= CesiumMath.FOUR_GIGABYTES) { throw new DeveloperError( "The total number of vertices (width * height) must be less than 4,294,967,296." ); } //>>includeEnd('debug'); var byWidth = regularGridIndicesCache[width]; if (!defined(byWidth)) { regularGridIndicesCache[width] = byWidth = []; } var indices = byWidth[height]; if (!defined(indices)) { if (width * height < CesiumMath.SIXTY_FOUR_KILOBYTES) { indices = byWidth[height] = new Uint16Array( (width - 1) * (height - 1) * 6 ); } else { indices = byWidth[height] = new Uint32Array( (width - 1) * (height - 1) * 6 ); } addRegularGridIndices(width, height, indices, 0); } return indices; }; var regularGridAndEdgeIndicesCache = []; /** * @private */ TerrainProvider.getRegularGridIndicesAndEdgeIndices = function (width, height) { //>>includeStart('debug', pragmas.debug); if (width * height >= CesiumMath.FOUR_GIGABYTES) { throw new DeveloperError( "The total number of vertices (width * height) must be less than 4,294,967,296." ); } //>>includeEnd('debug'); var byWidth = regularGridAndEdgeIndicesCache[width]; if (!defined(byWidth)) { regularGridAndEdgeIndicesCache[width] = byWidth = []; } var indicesAndEdges = byWidth[height]; if (!defined(indicesAndEdges)) { var indices = TerrainProvider.getRegularGridIndices(width, height); var edgeIndices = getEdgeIndices(width, height); var westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth; var southIndicesEastToWest = edgeIndices.southIndicesEastToWest; var eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth; var northIndicesWestToEast = edgeIndices.northIndicesWestToEast; indicesAndEdges = byWidth[height] = { indices: indices, westIndicesSouthToNorth: westIndicesSouthToNorth, southIndicesEastToWest: southIndicesEastToWest, eastIndicesNorthToSouth: eastIndicesNorthToSouth, northIndicesWestToEast: northIndicesWestToEast, }; } return indicesAndEdges; }; var regularGridAndSkirtAndEdgeIndicesCache = []; /** * @private */ TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices = function ( width, height ) { //>>includeStart('debug', pragmas.debug); if (width * height >= CesiumMath.FOUR_GIGABYTES) { throw new DeveloperError( "The total number of vertices (width * height) must be less than 4,294,967,296." ); } //>>includeEnd('debug'); var byWidth = regularGridAndSkirtAndEdgeIndicesCache[width]; if (!defined(byWidth)) { regularGridAndSkirtAndEdgeIndicesCache[width] = byWidth = []; } var indicesAndEdges = byWidth[height]; if (!defined(indicesAndEdges)) { var gridVertexCount = width * height; var gridIndexCount = (width - 1) * (height - 1) * 6; var edgeVertexCount = width * 2 + height * 2; var edgeIndexCount = Math.max(0, edgeVertexCount - 4) * 6; var vertexCount = gridVertexCount + edgeVertexCount; var indexCount = gridIndexCount + edgeIndexCount; var edgeIndices = getEdgeIndices(width, height); var westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth; var southIndicesEastToWest = edgeIndices.southIndicesEastToWest; var eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth; var northIndicesWestToEast = edgeIndices.northIndicesWestToEast; var indices = IndexDatatype.createTypedArray(vertexCount, indexCount); addRegularGridIndices(width, height, indices, 0); TerrainProvider.addSkirtIndices( westIndicesSouthToNorth, southIndicesEastToWest, eastIndicesNorthToSouth, northIndicesWestToEast, gridVertexCount, indices, gridIndexCount ); indicesAndEdges = byWidth[height] = { indices: indices, westIndicesSouthToNorth: westIndicesSouthToNorth, southIndicesEastToWest: southIndicesEastToWest, eastIndicesNorthToSouth: eastIndicesNorthToSouth, northIndicesWestToEast: northIndicesWestToEast, indexCountWithoutSkirts: gridIndexCount, }; } return indicesAndEdges; }; /** * @private */ TerrainProvider.addSkirtIndices = function ( westIndicesSouthToNorth, southIndicesEastToWest, eastIndicesNorthToSouth, northIndicesWestToEast, vertexCount, indices, offset ) { var vertexIndex = vertexCount; offset = addSkirtIndices( westIndicesSouthToNorth, vertexIndex, indices, offset ); vertexIndex += westIndicesSouthToNorth.length; offset = addSkirtIndices( southIndicesEastToWest, vertexIndex, indices, offset ); vertexIndex += southIndicesEastToWest.length; offset = addSkirtIndices( eastIndicesNorthToSouth, vertexIndex, indices, offset ); vertexIndex += eastIndicesNorthToSouth.length; addSkirtIndices(northIndicesWestToEast, vertexIndex, indices, offset); }; function getEdgeIndices(width, height) { var westIndicesSouthToNorth = new Array(height); var southIndicesEastToWest = new Array(width); var eastIndicesNorthToSouth = new Array(height); var northIndicesWestToEast = new Array(width); var i; for (i = 0; i < width; ++i) { northIndicesWestToEast[i] = i; southIndicesEastToWest[i] = width * height - 1 - i; } for (i = 0; i < height; ++i) { eastIndicesNorthToSouth[i] = (i + 1) * width - 1; westIndicesSouthToNorth[i] = (height - i - 1) * width; } return { westIndicesSouthToNorth: westIndicesSouthToNorth, southIndicesEastToWest: southIndicesEastToWest, eastIndicesNorthToSouth: eastIndicesNorthToSouth, northIndicesWestToEast: northIndicesWestToEast, }; } function addRegularGridIndices(width, height, indices, offset) { var index = 0; for (var j = 0; j < height - 1; ++j) { for (var i = 0; i < width - 1; ++i) { var upperLeft = index; var lowerLeft = upperLeft + width; var lowerRight = lowerLeft + 1; var upperRight = upperLeft + 1; indices[offset++] = upperLeft; indices[offset++] = lowerLeft; indices[offset++] = upperRight; indices[offset++] = upperRight; indices[offset++] = lowerLeft; indices[offset++] = lowerRight; ++index; } ++index; } } function addSkirtIndices(edgeIndices, vertexIndex, indices, offset) { var previousIndex = edgeIndices[0]; var length = edgeIndices.length; for (var i = 1; i < length; ++i) { var index = edgeIndices[i]; indices[offset++] = previousIndex; indices[offset++] = index; indices[offset++] = vertexIndex; indices[offset++] = vertexIndex; indices[offset++] = index; indices[offset++] = vertexIndex + 1; previousIndex = index; ++vertexIndex; } return offset; } /** * Specifies the quality of terrain created from heightmaps. A value of 1.0 will * ensure that adjacent heightmap vertices are separated by no more than * {@link Globe.maximumScreenSpaceError} screen pixels and will probably go very slowly. * A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the * screen pixels between adjacent heightmap vertices and thus rendering more quickly. * @type {Number} */ TerrainProvider.heightmapTerrainQuality = 0.25; /** * Determines an appropriate geometric error estimate when the geometry comes from a heightmap. * * @param {Ellipsoid} ellipsoid The ellipsoid to which the terrain is attached. * @param {Number} tileImageWidth The width, in pixels, of the heightmap associated with a single tile. * @param {Number} numberOfTilesAtLevelZero The number of tiles in the horizontal direction at tile level zero. * @returns {Number} An estimated geometric error. */ TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap = function ( ellipsoid, tileImageWidth, numberOfTilesAtLevelZero ) { return ( (ellipsoid.maximumRadius * 2 * Math.PI * TerrainProvider.heightmapTerrainQuality) / (tileImageWidth * numberOfTilesAtLevelZero) ); }; /** * Requests the geometry for a given tile. This function should not be called before * {@link TerrainProvider#ready} returns true. The result must include terrain data and * may optionally include a water mask and an indication of which child tiles are available. * @function * * @param {Number} x The X coordinate of the tile for which to request geometry. * @param {Number} y The Y coordinate of the tile for which to request geometry. * @param {Number} level The level of the tile for which to request geometry. * @param {Request} [request] The request object. Intended for internal use only. * * @returns {Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method * returns undefined instead of a promise, it is an indication that too many requests are already * pending and the request will be retried later. */ TerrainProvider.prototype.requestTileGeometry = DeveloperError.throwInstantiationError; /** * Gets the maximum geometric error allowed in a tile at a given level. This function should not be * called before {@link TerrainProvider#ready} returns true. * @function * * @param {Number} level The tile level for which to get the maximum geometric error. * @returns {Number} The maximum geometric error. */ TerrainProvider.prototype.getLevelMaximumGeometricError = DeveloperError.throwInstantiationError; /** * Determines whether data for a tile is available to be loaded. * @function * * @param {Number} x The X coordinate of the tile for which to request geometry. * @param {Number} y The Y coordinate of the tile for which to request geometry. * @param {Number} level The level of the tile for which to request geometry. * @returns {Boolean} Undefined if not supported by the terrain provider, otherwise true or false. */ TerrainProvider.prototype.getTileDataAvailable = DeveloperError.throwInstantiationError; /** * Makes sure we load availability data for a tile * @function * * @param {Number} x The X coordinate of the tile for which to request geometry. * @param {Number} y The Y coordinate of the tile for which to request geometry. * @param {Number} level The level of the tile for which to request geometry. * @returns {undefined|Promise<void>} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ TerrainProvider.prototype.loadTileDataAvailability = DeveloperError.throwInstantiationError; export default TerrainProvider;
{ "content_hash": "41c1bab83b9243e790910bd43838d47e", "timestamp": "", "source": "github", "line_count": 446, "max_line_length": 138, "avg_line_length": 33.31390134529148, "alnum_prop": 0.7210930138645847, "repo_name": "progsung/cesium", "id": "d733d202e89a2060fd105bf156a531ff2dfada98", "size": "14858", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/Core/TerrainProvider.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "56635" }, { "name": "GLSL", "bytes": "277156" }, { "name": "HTML", "bytes": "1196009" }, { "name": "JavaScript", "bytes": "17884041" } ], "symlink_target": "" }
layout: page title: About us --- Right now, [**`The Hub`**](/) is a closed group existed for the purpose of helping local technology groups look for _talented members_ suitable for their projects. We're physically based in Ho Chi Minh City, Vietnam. Below is a list of business partners that we have worked with: - [Pure Solutions](http://puresolutions.com.vn) - MyLadyBug --- Inquiries? Please don't hesitate to connect with us at [[email protected]](mailto:[email protected])
{ "content_hash": "e37ec0ba7b4582dad8755facc541f4bd", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 163, "avg_line_length": 36, "alnum_prop": 0.7559523809523809, "repo_name": "puresol/thehub", "id": "28c3cf2a7a0a8a19e80da80e182cbc95476383b5", "size": "508", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "about.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "22883" }, { "name": "HTML", "bytes": "9589" } ], "symlink_target": "" }
<?php namespace App\Containers\AppSection\Authentication\Tasks; use App\Ship\Parents\Tasks\Task; class MakeRefreshCookieTask extends Task { public function run($refreshToken) { // Save the refresh token in a HttpOnly cookie to minimize the risk of XSS attacks return cookie( 'refreshToken', $refreshToken, config('apiato.api.refresh-expires-in'), null, null, config('session.secure'), true // HttpOnly ); } }
{ "content_hash": "938c26a36d3de62b459b698266598c38", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 90, "avg_line_length": 24.181818181818183, "alnum_prop": 0.5958646616541353, "repo_name": "Mahmoudz/Hello-API", "id": "3dbbc689747910b35ef0942e87420d999dee9b17", "size": "532", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/Containers/AppSection/Authentication/Tasks/MakeRefreshCookieTask.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "573" }, { "name": "HTML", "bytes": "13837" }, { "name": "PHP", "bytes": "406812" } ], "symlink_target": "" }
#ifndef ZIG_ALL_TYPES_HPP #define ZIG_ALL_TYPES_HPP #include "list.hpp" #include "buffer.hpp" #include "zig_llvm.h" #include "hash_map.hpp" #include "errmsg.hpp" #include "bigint.hpp" #include "bigfloat.hpp" #include "target.hpp" #include "tokenizer.hpp" struct AstNode; struct ZigFn; struct Scope; struct ScopeBlock; struct ScopeFnDef; struct ScopeExpr; struct ZigType; struct ZigVar; struct ErrorTableEntry; struct BuiltinFnEntry; struct TypeStructField; struct CodeGen; struct ZigValue; struct IrInst; struct IrInstSrc; struct IrInstGen; struct IrInstGenCast; struct IrInstGenAlloca; struct IrInstGenCall; struct IrInstGenAwait; struct IrBasicBlockSrc; struct IrBasicBlockGen; struct ScopeDecls; struct ZigWindowsSDK; struct Tld; struct TldExport; struct IrAnalyze; struct ResultLoc; struct ResultLocPeer; struct ResultLocPeerParent; struct ResultLocBitCast; struct ResultLocCast; struct ResultLocReturn; struct IrExecutableGen; enum FileExt { FileExtUnknown, FileExtAsm, FileExtC, FileExtCpp, FileExtHeader, FileExtLLVMIr, FileExtLLVMBitCode, }; enum PtrLen { PtrLenUnknown, PtrLenSingle, PtrLenC, }; enum CallingConvention { CallingConventionUnspecified, CallingConventionC, CallingConventionNaked, CallingConventionAsync, CallingConventionInline, CallingConventionInterrupt, CallingConventionSignal, CallingConventionStdcall, CallingConventionFastcall, CallingConventionVectorcall, CallingConventionThiscall, CallingConventionAPCS, CallingConventionAAPCS, CallingConventionAAPCSVFP, }; // This one corresponds to the builtin.zig enum. enum BuiltinPtrSize { BuiltinPtrSizeOne, BuiltinPtrSizeMany, BuiltinPtrSizeSlice, BuiltinPtrSizeC, }; enum UndefAllowed { UndefOk, UndefBad, LazyOkNoUndef, LazyOk, }; enum X64CABIClass { X64CABIClass_Unknown, X64CABIClass_MEMORY, X64CABIClass_MEMORY_nobyval, X64CABIClass_INTEGER, X64CABIClass_SSE, }; struct IrExecutableSrc { ZigList<IrBasicBlockSrc *> basic_block_list; Buf *name; ZigFn *name_fn; size_t mem_slot_count; size_t next_debug_id; size_t *backward_branch_count; size_t *backward_branch_quota; ZigFn *fn_entry; Buf *c_import_buf; AstNode *source_node; IrExecutableGen *parent_exec; IrAnalyze *analysis; Scope *begin_scope; ErrorMsg *first_err_trace_msg; ZigList<Tld *> tld_list; bool is_inline; bool is_generic_instantiation; bool need_err_code_spill; // This is a function for use in the debugger to print // the source location. void src(); }; struct IrExecutableGen { ZigList<IrBasicBlockGen *> basic_block_list; Buf *name; ZigFn *name_fn; size_t mem_slot_count; size_t next_debug_id; size_t *backward_branch_count; size_t *backward_branch_quota; ZigFn *fn_entry; Buf *c_import_buf; AstNode *source_node; IrExecutableGen *parent_exec; IrExecutableSrc *source_exec; Scope *begin_scope; ErrorMsg *first_err_trace_msg; ZigList<Tld *> tld_list; bool is_inline; bool is_generic_instantiation; bool need_err_code_spill; // This is a function for use in the debugger to print // the source location. void src(); }; enum OutType { OutTypeUnknown, OutTypeExe, OutTypeLib, OutTypeObj, }; enum ConstParentId { ConstParentIdNone, ConstParentIdStruct, ConstParentIdErrUnionCode, ConstParentIdErrUnionPayload, ConstParentIdOptionalPayload, ConstParentIdArray, ConstParentIdUnion, ConstParentIdScalar, }; struct ConstParent { ConstParentId id; union { struct { ZigValue *array_val; size_t elem_index; } p_array; struct { ZigValue *struct_val; size_t field_index; } p_struct; struct { ZigValue *err_union_val; } p_err_union_code; struct { ZigValue *err_union_val; } p_err_union_payload; struct { ZigValue *optional_val; } p_optional_payload; struct { ZigValue *union_val; } p_union; struct { ZigValue *scalar_val; } p_scalar; } data; }; struct ConstStructValue { ZigValue **fields; }; struct ConstUnionValue { BigInt tag; ZigValue *payload; }; enum ConstArraySpecial { ConstArraySpecialNone, ConstArraySpecialUndef, ConstArraySpecialBuf, }; struct ConstArrayValue { ConstArraySpecial special; union { struct { ZigValue *elements; } s_none; Buf *s_buf; } data; }; enum ConstPtrSpecial { // Enforce explicitly setting this ID by making the zero value invalid. ConstPtrSpecialInvalid, // The pointer is a reference to a single object. ConstPtrSpecialRef, // The pointer points to an element in an underlying array. // Not to be confused with ConstPtrSpecialSubArray. ConstPtrSpecialBaseArray, // The pointer points to a field in an underlying struct. ConstPtrSpecialBaseStruct, // The pointer points to the error set field of an error union ConstPtrSpecialBaseErrorUnionCode, // The pointer points to the payload field of an error union ConstPtrSpecialBaseErrorUnionPayload, // The pointer points to the payload field of an optional ConstPtrSpecialBaseOptionalPayload, // This means that we did a compile-time pointer reinterpret and we cannot // understand the value of pointee at compile time. However, we will still // emit a binary with a compile time known address. // In this case index is the numeric address value. ConstPtrSpecialHardCodedAddr, // This means that the pointer represents memory of assigning to _. // That is, storing discards the data, and loading is invalid. ConstPtrSpecialDiscard, // This is actually a function. ConstPtrSpecialFunction, // This means the pointer is null. This is only allowed when the type is ?*T. // We use this instead of ConstPtrSpecialHardCodedAddr because often we check // for that value to avoid doing comptime work. // We need the data layout for ConstCastOnly == true // types to be the same, so all optionals of pointer types use x_ptr // instead of x_optional. ConstPtrSpecialNull, // The pointer points to a sub-array (not an individual element). // Not to be confused with ConstPtrSpecialBaseArray. However, it uses the same // union payload struct (base_array). ConstPtrSpecialSubArray, }; enum ConstPtrMut { // The pointer points to memory that is known at compile time and immutable. ConstPtrMutComptimeConst, // This means that the pointer points to memory used by a comptime variable, // so attempting to write a non-compile-time known value is an error // But the underlying value is allowed to change at compile time. ConstPtrMutComptimeVar, // The pointer points to memory that is known only at runtime. // For example it may point to the initializer value of a variable. ConstPtrMutRuntimeVar, // The pointer points to memory for which it must be inferred whether the // value is comptime known or not. ConstPtrMutInfer, }; struct ConstPtrValue { ConstPtrSpecial special; ConstPtrMut mut; union { struct { ZigValue *pointee; } ref; struct { ZigValue *array_val; size_t elem_index; } base_array; struct { ZigValue *struct_val; size_t field_index; } base_struct; struct { ZigValue *err_union_val; } base_err_union_code; struct { ZigValue *err_union_val; } base_err_union_payload; struct { ZigValue *optional_val; } base_optional_payload; struct { uint64_t addr; } hard_coded_addr; struct { ZigFn *fn_entry; } fn; } data; }; struct ConstErrValue { ZigValue *error_set; ZigValue *payload; }; struct ConstBoundFnValue { ZigFn *fn; IrInstGen *first_arg; IrInst *first_arg_src; }; struct ConstArgTuple { size_t start_index; size_t end_index; }; enum ConstValSpecial { // The value is only available at runtime. However there may be runtime hints // narrowing the possible values down via the `data.rh_*` fields. ConstValSpecialRuntime, // The value is comptime-known and resolved. The `data.x_*` fields can be // accessed. ConstValSpecialStatic, // The value is comptime-known to be `undefined`. ConstValSpecialUndef, // The value is comptime-known, but not yet resolved. The lazy value system // helps avoid dependency loops by providing answers to certain questions // about values without forcing them to be resolved. For example, the // equation `@sizeOf(Foo) == 0` can be resolved without forcing the struct // layout of `Foo` because we can know whether `Foo` is zero bits without // performing field layout. // A `ZigValue` can be converted from Lazy to Static/Undef by calling the // appropriate resolve function. ConstValSpecialLazy, }; enum RuntimeHintErrorUnion { RuntimeHintErrorUnionUnknown, RuntimeHintErrorUnionError, RuntimeHintErrorUnionNonError, }; enum RuntimeHintOptional { RuntimeHintOptionalUnknown, RuntimeHintOptionalNull, // TODO is this value even possible? if this is the case it might mean the const value is compile time known. RuntimeHintOptionalNonNull, }; enum RuntimeHintPtr { RuntimeHintPtrUnknown, RuntimeHintPtrStack, RuntimeHintPtrNonStack, }; enum RuntimeHintSliceId { RuntimeHintSliceIdUnknown, RuntimeHintSliceIdLen, }; struct RuntimeHintSlice { enum RuntimeHintSliceId id; uint64_t len; }; enum LazyValueId { LazyValueIdInvalid, LazyValueIdAlignOf, LazyValueIdSizeOf, LazyValueIdPtrType, LazyValueIdOptType, LazyValueIdSliceType, LazyValueIdFnType, LazyValueIdErrUnionType, LazyValueIdArrayType, LazyValueIdTypeInfoDecls, }; struct LazyValue { LazyValueId id; }; struct LazyValueTypeInfoDecls { LazyValue base; IrAnalyze *ira; ScopeDecls *decls_scope; IrInst *source_instr; }; struct LazyValueAlignOf { LazyValue base; IrAnalyze *ira; IrInstGen *target_type; }; struct LazyValueSizeOf { LazyValue base; IrAnalyze *ira; IrInstGen *target_type; bool bit_size; }; struct LazyValueSliceType { LazyValue base; IrAnalyze *ira; IrInstGen *sentinel; // can be null IrInstGen *elem_type; IrInstGen *align_inst; // can be null bool is_const; bool is_volatile; bool is_allowzero; }; struct LazyValueArrayType { LazyValue base; IrAnalyze *ira; IrInstGen *sentinel; // can be null IrInstGen *elem_type; uint64_t length; }; struct LazyValuePtrType { LazyValue base; IrAnalyze *ira; IrInstGen *sentinel; // can be null IrInstGen *elem_type; IrInstGen *align_inst; // can be null PtrLen ptr_len; uint32_t bit_offset_in_host; uint32_t host_int_bytes; bool is_const; bool is_volatile; bool is_allowzero; }; struct LazyValueOptType { LazyValue base; IrAnalyze *ira; IrInstGen *payload_type; }; struct LazyValueFnType { LazyValue base; IrAnalyze *ira; AstNode *proto_node; IrInstGen **param_types; IrInstGen *align_inst; // can be null IrInstGen *return_type; CallingConvention cc; bool is_generic; }; struct LazyValueErrUnionType { LazyValue base; IrAnalyze *ira; IrInstGen *err_set_type; IrInstGen *payload_type; Buf *type_name; }; struct ZigValue { ZigType *type; // This field determines how the value is stored. It must be checked // before accessing the `data` union. ConstValSpecial special; uint32_t llvm_align; ConstParent parent; LLVMValueRef llvm_value; LLVMValueRef llvm_global; union { // populated if special == ConstValSpecialLazy LazyValue *x_lazy; // populated if special == ConstValSpecialStatic BigInt x_bigint; BigFloat x_bigfloat; float16_t x_f16; float x_f32; double x_f64; float128_t x_f128; bool x_bool; ConstBoundFnValue x_bound_fn; ZigType *x_type; ZigValue *x_optional; ConstErrValue x_err_union; ErrorTableEntry *x_err_set; BigInt x_enum_tag; ConstStructValue x_struct; ConstUnionValue x_union; ConstArrayValue x_array; ConstPtrValue x_ptr; ConstArgTuple x_arg_tuple; Buf *x_enum_literal; // populated if special == ConstValSpecialRuntime RuntimeHintErrorUnion rh_error_union; RuntimeHintOptional rh_maybe; RuntimeHintPtr rh_ptr; RuntimeHintSlice rh_slice; } data; // uncomment this to find bugs. can't leave it uncommented because of a gcc-9 warning //ZigValue& operator= (const ZigValue &other) = delete; // use copy_const_val ZigValue(const ZigValue &other) = delete; // plz zero initialize with ZigValue val = {}; // for use in debuggers void dump(); }; enum ReturnKnowledge { ReturnKnowledgeUnknown, ReturnKnowledgeKnownError, ReturnKnowledgeKnownNonError, ReturnKnowledgeKnownNull, ReturnKnowledgeKnownNonNull, ReturnKnowledgeSkipDefers, }; enum VisibMod { VisibModPrivate, VisibModPub, }; enum GlobalLinkageId { GlobalLinkageIdInternal, GlobalLinkageIdStrong, GlobalLinkageIdWeak, GlobalLinkageIdLinkOnce, }; enum TldId { TldIdVar, TldIdFn, TldIdContainer, TldIdCompTime, TldIdUsingNamespace, }; enum TldResolution { TldResolutionUnresolved, TldResolutionResolving, TldResolutionInvalid, TldResolutionOkLazy, TldResolutionOk, }; struct Tld { TldId id; Buf *name; VisibMod visib_mod; AstNode *source_node; ZigType *import; Scope *parent_scope; TldResolution resolution; }; struct TldVar { Tld base; ZigVar *var; Buf *extern_lib_name; bool analyzing_type; // flag to detect dependency loops }; struct TldFn { Tld base; ZigFn *fn_entry; Buf *extern_lib_name; }; struct TldContainer { Tld base; ScopeDecls *decls_scope; ZigType *type_entry; }; struct TldCompTime { Tld base; }; struct TldUsingNamespace { Tld base; ZigValue *using_namespace_value; }; struct TypeEnumField { Buf *name; BigInt value; uint32_t decl_index; AstNode *decl_node; }; struct TypeUnionField { Buf *name; ZigType *type_entry; // available after ResolveStatusSizeKnown ZigValue *type_val; // available after ResolveStatusZeroBitsKnown TypeEnumField *enum_field; AstNode *decl_node; uint32_t gen_index; uint32_t align; }; enum NodeType { NodeTypeFnProto, NodeTypeFnDef, NodeTypeParamDecl, NodeTypeBlock, NodeTypeGroupedExpr, NodeTypeReturnExpr, NodeTypeDefer, NodeTypeVariableDeclaration, NodeTypeTestDecl, NodeTypeBinOpExpr, NodeTypeCatchExpr, NodeTypeFloatLiteral, NodeTypeIntLiteral, NodeTypeStringLiteral, NodeTypeCharLiteral, NodeTypeSymbol, NodeTypePrefixOpExpr, NodeTypePointerType, NodeTypeFnCallExpr, NodeTypeArrayAccessExpr, NodeTypeSliceExpr, NodeTypeFieldAccessExpr, NodeTypePtrDeref, NodeTypeUnwrapOptional, NodeTypeUsingNamespace, NodeTypeBoolLiteral, NodeTypeNullLiteral, NodeTypeUndefinedLiteral, NodeTypeUnreachable, NodeTypeIfBoolExpr, NodeTypeWhileExpr, NodeTypeForExpr, NodeTypeSwitchExpr, NodeTypeSwitchProng, NodeTypeSwitchRange, NodeTypeCompTime, NodeTypeNoSuspend, NodeTypeBreak, NodeTypeContinue, NodeTypeAsmExpr, NodeTypeContainerDecl, NodeTypeStructField, NodeTypeContainerInitExpr, NodeTypeStructValueField, NodeTypeArrayType, NodeTypeInferredArrayType, NodeTypeErrorType, NodeTypeIfErrorExpr, NodeTypeIfOptional, NodeTypeErrorSetDecl, NodeTypeErrorSetField, NodeTypeResume, NodeTypeAwaitExpr, NodeTypeSuspend, NodeTypeAnyFrameType, NodeTypeEnumLiteral, NodeTypeAnyTypeField, }; struct AstNodeFnProto { Buf *name; ZigList<AstNode *> params; AstNode *return_type; Token *return_anytype_token; AstNode *fn_def_node; // populated if this is an extern declaration Buf *lib_name; // populated if the "align A" is present AstNode *align_expr; // populated if the "section(S)" is present AstNode *section_expr; // populated if the "callconv(S)" is present AstNode *callconv_expr; Buf doc_comments; VisibMod visib_mod; bool auto_err_set; bool is_var_args; bool is_extern; bool is_export; bool is_noinline; }; struct AstNodeFnDef { AstNode *fn_proto; AstNode *body; }; struct AstNodeParamDecl { Buf *name; AstNode *type; Token *anytype_token; Buf doc_comments; bool is_noalias; bool is_comptime; bool is_var_args; }; struct AstNodeBlock { Buf *name; ZigList<AstNode *> statements; }; enum ReturnKind { ReturnKindUnconditional, ReturnKindError, }; struct AstNodeReturnExpr { ReturnKind kind; // might be null in case of return void; AstNode *expr; }; struct AstNodeDefer { ReturnKind kind; AstNode *err_payload; AstNode *expr; // temporary data used in IR generation Scope *child_scope; Scope *expr_scope; }; struct AstNodeVariableDeclaration { Buf *symbol; // one or both of type and expr will be non null AstNode *type; AstNode *expr; // populated if this is an extern declaration Buf *lib_name; // populated if the "align(A)" is present AstNode *align_expr; // populated if the "section(S)" is present AstNode *section_expr; Token *threadlocal_tok; Buf doc_comments; VisibMod visib_mod; bool is_const; bool is_comptime; bool is_export; bool is_extern; }; struct AstNodeTestDecl { // nullptr if the test declaration has no name Buf *name; AstNode *body; }; enum BinOpType { BinOpTypeInvalid, BinOpTypeAssign, BinOpTypeAssignTimes, BinOpTypeAssignTimesWrap, BinOpTypeAssignDiv, BinOpTypeAssignMod, BinOpTypeAssignPlus, BinOpTypeAssignPlusWrap, BinOpTypeAssignMinus, BinOpTypeAssignMinusWrap, BinOpTypeAssignBitShiftLeft, BinOpTypeAssignBitShiftRight, BinOpTypeAssignBitAnd, BinOpTypeAssignBitXor, BinOpTypeAssignBitOr, BinOpTypeBoolOr, BinOpTypeBoolAnd, BinOpTypeCmpEq, BinOpTypeCmpNotEq, BinOpTypeCmpLessThan, BinOpTypeCmpGreaterThan, BinOpTypeCmpLessOrEq, BinOpTypeCmpGreaterOrEq, BinOpTypeBinOr, BinOpTypeBinXor, BinOpTypeBinAnd, BinOpTypeBitShiftLeft, BinOpTypeBitShiftRight, BinOpTypeAdd, BinOpTypeAddWrap, BinOpTypeSub, BinOpTypeSubWrap, BinOpTypeMult, BinOpTypeMultWrap, BinOpTypeDiv, BinOpTypeMod, BinOpTypeUnwrapOptional, BinOpTypeArrayCat, BinOpTypeArrayMult, BinOpTypeErrorUnion, BinOpTypeMergeErrorSets, }; struct AstNodeBinOpExpr { AstNode *op1; BinOpType bin_op; AstNode *op2; }; struct AstNodeCatchExpr { AstNode *op1; AstNode *symbol; // can be null AstNode *op2; }; struct AstNodeUnwrapOptional { AstNode *expr; }; // Must be synchronized with std.builtin.CallOptions.Modifier enum CallModifier { CallModifierNone, CallModifierAsync, CallModifierNeverTail, CallModifierNeverInline, CallModifierNoSuspend, CallModifierAlwaysTail, CallModifierAlwaysInline, CallModifierCompileTime, // These are additional tags in the compiler, but not exposed in the std lib. CallModifierBuiltin, }; struct AstNodeFnCallExpr { AstNode *fn_ref_expr; ZigList<AstNode *> params; CallModifier modifier; bool seen; // used by @compileLog }; struct AstNodeArrayAccessExpr { AstNode *array_ref_expr; AstNode *subscript; }; struct AstNodeSliceExpr { AstNode *array_ref_expr; AstNode *start; AstNode *end; AstNode *sentinel; // can be null }; struct AstNodeFieldAccessExpr { AstNode *struct_expr; Buf *field_name; }; struct AstNodePtrDerefExpr { AstNode *target; }; enum PrefixOp { PrefixOpInvalid, PrefixOpBoolNot, PrefixOpBinNot, PrefixOpNegation, PrefixOpNegationWrap, PrefixOpOptional, PrefixOpAddrOf, }; struct AstNodePrefixOpExpr { PrefixOp prefix_op; AstNode *primary_expr; }; struct AstNodePointerType { Token *star_token; AstNode *sentinel; AstNode *align_expr; BigInt *bit_offset_start; BigInt *host_int_bytes; AstNode *op_expr; Token *allow_zero_token; bool is_const; bool is_volatile; }; struct AstNodeInferredArrayType { AstNode *sentinel; // can be null AstNode *child_type; }; struct AstNodeArrayType { AstNode *size; AstNode *sentinel; AstNode *child_type; AstNode *align_expr; Token *allow_zero_token; bool is_const; bool is_volatile; }; struct AstNodeUsingNamespace { VisibMod visib_mod; AstNode *expr; }; struct AstNodeIfBoolExpr { AstNode *condition; AstNode *then_block; AstNode *else_node; // null, block node, or other if expr node }; struct AstNodeTryExpr { Buf *var_symbol; bool var_is_ptr; AstNode *target_node; AstNode *then_node; AstNode *else_node; Buf *err_symbol; }; struct AstNodeTestExpr { Buf *var_symbol; bool var_is_ptr; AstNode *target_node; AstNode *then_node; AstNode *else_node; // null, block node, or other if expr node }; struct AstNodeWhileExpr { Buf *name; AstNode *condition; Buf *var_symbol; bool var_is_ptr; AstNode *continue_expr; AstNode *body; AstNode *else_node; Buf *err_symbol; bool is_inline; }; struct AstNodeForExpr { Buf *name; AstNode *array_expr; AstNode *elem_node; // always a symbol AstNode *index_node; // always a symbol, might be null AstNode *body; AstNode *else_node; // can be null bool elem_is_ptr; bool is_inline; }; struct AstNodeSwitchExpr { AstNode *expr; ZigList<AstNode *> prongs; }; struct AstNodeSwitchProng { ZigList<AstNode *> items; AstNode *var_symbol; AstNode *expr; bool var_is_ptr; bool any_items_are_range; }; struct AstNodeSwitchRange { AstNode *start; AstNode *end; }; struct AstNodeCompTime { AstNode *expr; }; struct AstNodeNoSuspend { AstNode *expr; }; struct AsmOutput { Buf *asm_symbolic_name; Buf *constraint; Buf *variable_name; AstNode *return_type; // null unless "=r" and return }; struct AsmInput { Buf *asm_symbolic_name; Buf *constraint; AstNode *expr; }; struct SrcPos { size_t line; size_t column; }; enum AsmTokenId { AsmTokenIdTemplate, AsmTokenIdPercent, AsmTokenIdVar, AsmTokenIdUniqueId, }; struct AsmToken { enum AsmTokenId id; size_t start; size_t end; }; struct AstNodeAsmExpr { Token *volatile_token; AstNode *asm_template; ZigList<AsmOutput*> output_list; ZigList<AsmInput*> input_list; ZigList<Buf*> clobber_list; }; enum ContainerKind { ContainerKindStruct, ContainerKindEnum, ContainerKindUnion, ContainerKindOpaque, }; enum ContainerLayout { ContainerLayoutAuto, ContainerLayoutExtern, ContainerLayoutPacked, }; struct AstNodeContainerDecl { AstNode *init_arg_expr; // enum(T), struct(endianness), or union(T), or union(enum(T)) ZigList<AstNode *> fields; ZigList<AstNode *> decls; Buf doc_comments; ContainerKind kind; ContainerLayout layout; bool auto_enum, is_root; // union(enum) }; struct AstNodeErrorSetField { Buf doc_comments; AstNode *field_name; }; struct AstNodeErrorSetDecl { // Each AstNode could be AstNodeErrorSetField or just AstNodeSymbolExpr to save memory ZigList<AstNode *> decls; }; struct AstNodeStructField { Buf *name; AstNode *type; AstNode *value; // populated if the "align(A)" is present AstNode *align_expr; Buf doc_comments; Token *comptime_token; }; struct AstNodeStringLiteral { Buf *buf; }; struct AstNodeCharLiteral { uint32_t value; }; struct AstNodeFloatLiteral { BigFloat *bigfloat; // overflow is true if when parsing the number, we discovered it would not // fit without losing data in a double bool overflow; }; struct AstNodeIntLiteral { BigInt *bigint; }; struct AstNodeStructValueField { Buf *name; AstNode *expr; }; enum ContainerInitKind { ContainerInitKindStruct, ContainerInitKindArray, }; struct AstNodeContainerInitExpr { AstNode *type; ZigList<AstNode *> entries; ContainerInitKind kind; }; struct AstNodeNullLiteral { }; struct AstNodeUndefinedLiteral { }; struct AstNodeThisLiteral { }; struct AstNodeSymbolExpr { Buf *symbol; }; struct AstNodeBoolLiteral { bool value; }; struct AstNodeBreakExpr { Buf *name; AstNode *expr; // may be null }; struct AstNodeResumeExpr { AstNode *expr; }; struct AstNodeContinueExpr { Buf *name; }; struct AstNodeUnreachableExpr { }; struct AstNodeErrorType { }; struct AstNodeAwaitExpr { AstNode *expr; }; struct AstNodeSuspend { AstNode *block; }; struct AstNodeAnyFrameType { AstNode *payload_type; // can be NULL }; struct AstNodeEnumLiteral { Token *period; Token *identifier; }; struct AstNode { enum NodeType type; bool already_traced_this_node; size_t line; size_t column; ZigType *owner; union { AstNodeFnDef fn_def; AstNodeFnProto fn_proto; AstNodeParamDecl param_decl; AstNodeBlock block; AstNode * grouped_expr; AstNodeReturnExpr return_expr; AstNodeDefer defer; AstNodeVariableDeclaration variable_declaration; AstNodeTestDecl test_decl; AstNodeBinOpExpr bin_op_expr; AstNodeCatchExpr unwrap_err_expr; AstNodeUnwrapOptional unwrap_optional; AstNodePrefixOpExpr prefix_op_expr; AstNodePointerType pointer_type; AstNodeFnCallExpr fn_call_expr; AstNodeArrayAccessExpr array_access_expr; AstNodeSliceExpr slice_expr; AstNodeUsingNamespace using_namespace; AstNodeIfBoolExpr if_bool_expr; AstNodeTryExpr if_err_expr; AstNodeTestExpr test_expr; AstNodeWhileExpr while_expr; AstNodeForExpr for_expr; AstNodeSwitchExpr switch_expr; AstNodeSwitchProng switch_prong; AstNodeSwitchRange switch_range; AstNodeCompTime comptime_expr; AstNodeNoSuspend nosuspend_expr; AstNodeAsmExpr asm_expr; AstNodeFieldAccessExpr field_access_expr; AstNodePtrDerefExpr ptr_deref_expr; AstNodeContainerDecl container_decl; AstNodeStructField struct_field; AstNodeStringLiteral string_literal; AstNodeCharLiteral char_literal; AstNodeFloatLiteral float_literal; AstNodeIntLiteral int_literal; AstNodeContainerInitExpr container_init_expr; AstNodeStructValueField struct_val_field; AstNodeNullLiteral null_literal; AstNodeUndefinedLiteral undefined_literal; AstNodeThisLiteral this_literal; AstNodeSymbolExpr symbol_expr; AstNodeBoolLiteral bool_literal; AstNodeBreakExpr break_expr; AstNodeContinueExpr continue_expr; AstNodeUnreachableExpr unreachable_expr; AstNodeArrayType array_type; AstNodeInferredArrayType inferred_array_type; AstNodeErrorType error_type; AstNodeErrorSetDecl err_set_decl; AstNodeErrorSetField err_set_field; AstNodeResumeExpr resume_expr; AstNodeAwaitExpr await_expr; AstNodeSuspend suspend; AstNodeAnyFrameType anyframe_type; AstNodeEnumLiteral enum_literal; } data; // This is a function for use in the debugger to print // the source location. void src(); }; // this struct is allocated with allocate_nonzero struct FnTypeParamInfo { bool is_noalias; ZigType *type; }; struct GenericFnTypeId { CodeGen *codegen; ZigFn *fn_entry; ZigValue *params; size_t param_count; }; uint32_t generic_fn_type_id_hash(GenericFnTypeId *id); bool generic_fn_type_id_eql(GenericFnTypeId *a, GenericFnTypeId *b); struct FnTypeId { ZigType *return_type; FnTypeParamInfo *param_info; size_t param_count; size_t next_param_index; bool is_var_args; CallingConvention cc; uint32_t alignment; }; uint32_t fn_type_id_hash(FnTypeId*); bool fn_type_id_eql(FnTypeId *a, FnTypeId *b); static const uint32_t VECTOR_INDEX_NONE = UINT32_MAX; static const uint32_t VECTOR_INDEX_RUNTIME = UINT32_MAX - 1; struct InferredStructField { ZigType *inferred_struct_type; Buf *field_name; bool already_resolved; }; struct ZigTypePointer { ZigType *child_type; ZigType *slice_parent; // Anonymous struct literal syntax uses this when the result location has // no type in it. This field is null if this pointer does not refer to // a field of a currently-being-inferred struct type. // When this is non-null, the pointer is pointing to the base of the inferred // struct. InferredStructField *inferred_struct_field; // This can be null. If it is non-null, it means the pointer is terminated by this // sentinel value. This is most commonly used for C-style strings, with a 0 byte // to specify the length of the memory pointed to. ZigValue *sentinel; PtrLen ptr_len; uint32_t explicit_alignment; // 0 means use ABI alignment uint32_t bit_offset_in_host; // size of host integer. 0 means no host integer; this field is aligned // when vector_index != VECTOR_INDEX_NONE this is the len of the containing vector uint32_t host_int_bytes; uint32_t vector_index; // see the VECTOR_INDEX_* constants bool is_const; bool is_volatile; bool allow_zero; bool resolve_loop_flag_zero_bits; }; struct ZigTypeInt { uint32_t bit_count; bool is_signed; }; struct ZigTypeFloat { size_t bit_count; }; // Needs to have the same memory layout as ZigTypeVector struct ZigTypeArray { ZigType *child_type; uint64_t len; ZigValue *sentinel; }; struct TypeStructField { Buf *name; ZigType *type_entry; // available after ResolveStatusSizeKnown ZigValue *type_val; // available after ResolveStatusZeroBitsKnown size_t src_index; size_t gen_index; size_t offset; // byte offset from beginning of struct AstNode *decl_node; ZigValue *init_val; // null and then memoized uint32_t bit_offset_in_host; // offset from the memory at gen_index uint32_t host_int_bytes; // size of host integer uint32_t align; bool is_comptime; }; enum ResolveStatus { ResolveStatusUnstarted, ResolveStatusInvalid, ResolveStatusBeingInferred, ResolveStatusZeroBitsKnown, ResolveStatusAlignmentKnown, ResolveStatusSizeKnown, ResolveStatusLLVMFwdDecl, ResolveStatusLLVMFull, }; struct ZigPackage { Buf root_src_dir; Buf root_src_path; // relative to root_src_dir Buf pkg_path; // a.b.c.d which follows the package dependency chain from the root package // reminder: hash tables must be initialized before use HashMap<Buf *, ZigPackage *, buf_hash, buf_eql_buf> package_table; bool added_to_cache; }; // Stuff that only applies to a struct which is the implicit root struct of a file struct RootStruct { ZigPackage *package; Buf *path; // relative to root_package->root_src_dir ZigList<size_t> *line_offsets; Buf *source_code; ZigLLVMDIFile *di_file; }; enum StructSpecial { StructSpecialNone, StructSpecialSlice, StructSpecialInferredTuple, StructSpecialInferredStruct, }; struct ZigTypeStruct { AstNode *decl_node; TypeStructField **fields; ScopeDecls *decls_scope; HashMap<Buf *, TypeStructField *, buf_hash, buf_eql_buf> fields_by_name; RootStruct *root_struct; uint32_t *host_int_bytes; // available for packed structs, indexed by gen_index size_t llvm_full_type_queue_index; uint32_t src_field_count; uint32_t gen_field_count; ContainerLayout layout; ResolveStatus resolve_status; StructSpecial special; // whether any of the fields require comptime // known after ResolveStatusZeroBitsKnown bool requires_comptime; bool resolve_loop_flag_zero_bits; bool resolve_loop_flag_other; bool created_by_at_type; }; struct ZigTypeOptional { ZigType *child_type; ResolveStatus resolve_status; }; struct ZigTypeErrorUnion { ZigType *err_set_type; ZigType *payload_type; size_t pad_bytes; LLVMTypeRef pad_llvm_type; }; struct ZigTypeErrorSet { ErrorTableEntry **errors; ZigFn *infer_fn; uint32_t err_count; bool incomplete; }; struct ZigTypeEnum { AstNode *decl_node; TypeEnumField *fields; ZigType *tag_int_type; ScopeDecls *decls_scope; LLVMValueRef name_function; HashMap<Buf *, TypeEnumField *, buf_hash, buf_eql_buf> fields_by_name; uint32_t src_field_count; ContainerLayout layout; ResolveStatus resolve_status; bool has_explicit_tag_type; bool non_exhaustive; bool resolve_loop_flag; }; uint32_t type_ptr_hash(const ZigType *ptr); bool type_ptr_eql(const ZigType *a, const ZigType *b); uint32_t pkg_ptr_hash(const ZigPackage *ptr); bool pkg_ptr_eql(const ZigPackage *a, const ZigPackage *b); uint32_t tld_ptr_hash(const Tld *ptr); bool tld_ptr_eql(const Tld *a, const Tld *b); uint32_t node_ptr_hash(const AstNode *ptr); bool node_ptr_eql(const AstNode *a, const AstNode *b); uint32_t fn_ptr_hash(const ZigFn *ptr); bool fn_ptr_eql(const ZigFn *a, const ZigFn *b); uint32_t err_ptr_hash(const ErrorTableEntry *ptr); bool err_ptr_eql(const ErrorTableEntry *a, const ErrorTableEntry *b); struct ZigTypeUnion { AstNode *decl_node; TypeUnionField *fields; ScopeDecls *decls_scope; HashMap<Buf *, TypeUnionField *, buf_hash, buf_eql_buf> fields_by_name; ZigType *tag_type; // always an enum or null LLVMTypeRef union_llvm_type; TypeUnionField *most_aligned_union_member; size_t gen_union_index; size_t gen_tag_index; size_t union_abi_size; uint32_t src_field_count; uint32_t gen_field_count; ContainerLayout layout; ResolveStatus resolve_status; bool have_explicit_tag_type; // whether any of the fields require comptime // the value is not valid until zero_bits_known == true bool requires_comptime; bool resolve_loop_flag_zero_bits; bool resolve_loop_flag_other; }; struct FnGenParamInfo { size_t src_index; size_t gen_index; bool is_byval; ZigType *type; }; struct ZigTypeFn { FnTypeId fn_type_id; bool is_generic; ZigType *gen_return_type; size_t gen_param_count; FnGenParamInfo *gen_param_info; LLVMTypeRef raw_type_ref; ZigLLVMDIType *raw_di_type; ZigType *bound_fn_parent; }; struct ZigTypeBoundFn { ZigType *fn_type; }; // Needs to have the same memory layout as ZigTypeArray struct ZigTypeVector { // The type must be a pointer, integer, bool, or float ZigType *elem_type; uint64_t len; size_t padding; }; // A lot of code is relying on ZigTypeArray and ZigTypeVector having the same layout/size static_assert(sizeof(ZigTypeVector) == sizeof(ZigTypeArray), "Size of ZigTypeVector and ZigTypeArray do not match!"); enum ZigTypeId { ZigTypeIdInvalid, ZigTypeIdMetaType, ZigTypeIdVoid, ZigTypeIdBool, ZigTypeIdUnreachable, ZigTypeIdInt, ZigTypeIdFloat, ZigTypeIdPointer, ZigTypeIdArray, ZigTypeIdStruct, ZigTypeIdComptimeFloat, ZigTypeIdComptimeInt, ZigTypeIdUndefined, ZigTypeIdNull, ZigTypeIdOptional, ZigTypeIdErrorUnion, ZigTypeIdErrorSet, ZigTypeIdEnum, ZigTypeIdUnion, ZigTypeIdFn, ZigTypeIdBoundFn, ZigTypeIdOpaque, ZigTypeIdFnFrame, ZigTypeIdAnyFrame, ZigTypeIdVector, ZigTypeIdEnumLiteral, }; enum OnePossibleValue { OnePossibleValueInvalid, OnePossibleValueNo, OnePossibleValueYes, }; struct ZigTypeOpaque { AstNode *decl_node; Buf *bare_name; ScopeDecls *decls_scope; }; struct ZigTypeFnFrame { ZigFn *fn; ZigType *locals_struct; // This is set to the type that resolving the frame currently depends on, null if none. // It's for generating a helpful error message. ZigType *resolve_loop_type; AstNode *resolve_loop_src_node; bool reported_loop_err; }; struct ZigTypeAnyFrame { ZigType *result_type; // null if `anyframe` instead of `anyframe->T` }; struct ZigType { ZigTypeId id; Buf name; // These are not supposed to be accessed directly. They're // null during semantic analysis, memoized with get_llvm_type // and get_llvm_di_type LLVMTypeRef llvm_type; ZigLLVMDIType *llvm_di_type; union { ZigTypePointer pointer; ZigTypeInt integral; ZigTypeFloat floating; ZigTypeArray array; ZigTypeStruct structure; ZigTypeOptional maybe; ZigTypeErrorUnion error_union; ZigTypeErrorSet error_set; ZigTypeEnum enumeration; ZigTypeUnion unionation; ZigTypeFn fn; ZigTypeBoundFn bound_fn; ZigTypeVector vector; ZigTypeOpaque opaque; ZigTypeFnFrame frame; ZigTypeAnyFrame any_frame; } data; // use these fields to make sure we don't duplicate type table entries for the same type ZigType *pointer_parent[2]; // [0 - mut, 1 - const] ZigType *optional_parent; ZigType *any_frame_parent; // If we generate a constant name value for this type, we memoize it here. // The type of this is array ZigValue *cached_const_name_val; OnePossibleValue one_possible_value; // Known after ResolveStatusAlignmentKnown. uint32_t abi_align; // The offset in bytes between consecutive array elements of this type. Known // after ResolveStatusSizeKnown. size_t abi_size; // Number of bits of information in this type. Known after ResolveStatusSizeKnown. size_t size_in_bits; }; enum FnAnalState { FnAnalStateReady, FnAnalStateProbing, FnAnalStateComplete, FnAnalStateInvalid, }; struct GlobalExport { Buf name; GlobalLinkageId linkage; }; struct ZigFn { LLVMValueRef llvm_value; const char *llvm_name; AstNode *proto_node; AstNode *body_node; ScopeFnDef *fndef_scope; // parent should be the top level decls or container decls Scope *child_scope; // parent is scope for last parameter ScopeBlock *def_scope; // parent is child_scope Buf symbol_name; // This is the function type assuming the function does not suspend. // Note that for an async function, this can be shared with non-async functions. So the value here // should only be read for things in common between non-async and async function types. ZigType *type_entry; // For normal functions one could use the type_entry->raw_type_ref and type_entry->raw_di_type. // However for functions that suspend, those values could possibly be their non-suspending equivalents. // So these values should be preferred. LLVMTypeRef raw_type_ref; ZigLLVMDIType *raw_di_type; ZigType *frame_type; // in the case of normal functions this is the implicit return type // in the case of async functions this is the implicit return type according to the // zig source code, not according to zig ir ZigType *src_implicit_return_type; IrExecutableSrc *ir_executable; IrExecutableGen analyzed_executable; size_t prealloc_bbc; size_t prealloc_backward_branch_quota; AstNode **param_source_nodes; Buf **param_names; IrInstGen *err_code_spill; AstNode *assumed_non_async; AstNode *fn_no_inline_set_node; AstNode *fn_static_eval_set_node; ZigList<IrInstGenAlloca *> alloca_gen_list; ZigList<ZigVar *> variable_list; Buf *section_name; AstNode *set_alignstack_node; AstNode *set_cold_node; const AstNode *inferred_async_node; ZigFn *inferred_async_fn; AstNode *non_async_node; ZigList<GlobalExport> export_list; ZigList<IrInstGenCall *> call_list; ZigList<IrInstGenAwait *> await_list; LLVMValueRef valgrind_client_request_array; FnAnalState anal_state; uint32_t align_bytes; uint32_t alignstack_value; bool calls_or_awaits_errorable_fn; bool is_cold; bool is_test; bool is_noinline; }; uint32_t fn_table_entry_hash(ZigFn*); bool fn_table_entry_eql(ZigFn *a, ZigFn *b); enum BuiltinFnId { BuiltinFnIdInvalid, BuiltinFnIdMemcpy, BuiltinFnIdMemset, BuiltinFnIdSizeof, BuiltinFnIdAlignOf, BuiltinFnIdField, BuiltinFnIdTypeInfo, BuiltinFnIdType, BuiltinFnIdHasField, BuiltinFnIdTypeof, BuiltinFnIdAddWithOverflow, BuiltinFnIdSubWithOverflow, BuiltinFnIdMulWithOverflow, BuiltinFnIdShlWithOverflow, BuiltinFnIdMulAdd, BuiltinFnIdCInclude, BuiltinFnIdCDefine, BuiltinFnIdCUndef, BuiltinFnIdCompileErr, BuiltinFnIdCompileLog, BuiltinFnIdCtz, BuiltinFnIdClz, BuiltinFnIdPopCount, BuiltinFnIdBswap, BuiltinFnIdBitReverse, BuiltinFnIdImport, BuiltinFnIdCImport, BuiltinFnIdErrName, BuiltinFnIdBreakpoint, BuiltinFnIdReturnAddress, BuiltinFnIdEmbedFile, BuiltinFnIdCmpxchgWeak, BuiltinFnIdCmpxchgStrong, BuiltinFnIdFence, BuiltinFnIdDivExact, BuiltinFnIdDivTrunc, BuiltinFnIdDivFloor, BuiltinFnIdRem, BuiltinFnIdMod, BuiltinFnIdSqrt, BuiltinFnIdSin, BuiltinFnIdCos, BuiltinFnIdExp, BuiltinFnIdExp2, BuiltinFnIdLog, BuiltinFnIdLog2, BuiltinFnIdLog10, BuiltinFnIdFabs, BuiltinFnIdFloor, BuiltinFnIdCeil, BuiltinFnIdTrunc, BuiltinFnIdNearbyInt, BuiltinFnIdRound, BuiltinFnIdTruncate, BuiltinFnIdIntCast, BuiltinFnIdFloatCast, BuiltinFnIdErrSetCast, BuiltinFnIdIntToFloat, BuiltinFnIdFloatToInt, BuiltinFnIdBoolToInt, BuiltinFnIdErrToInt, BuiltinFnIdIntToErr, BuiltinFnIdEnumToInt, BuiltinFnIdIntToEnum, BuiltinFnIdVectorType, BuiltinFnIdShuffle, BuiltinFnIdSplat, BuiltinFnIdSetCold, BuiltinFnIdSetRuntimeSafety, BuiltinFnIdSetFloatMode, BuiltinFnIdTypeName, BuiltinFnIdPanic, BuiltinFnIdPtrCast, BuiltinFnIdBitCast, BuiltinFnIdIntToPtr, BuiltinFnIdPtrToInt, BuiltinFnIdTagName, BuiltinFnIdFieldParentPtr, BuiltinFnIdByteOffsetOf, BuiltinFnIdBitOffsetOf, BuiltinFnIdAsyncCall, BuiltinFnIdShlExact, BuiltinFnIdShrExact, BuiltinFnIdSetEvalBranchQuota, BuiltinFnIdAlignCast, BuiltinFnIdThis, BuiltinFnIdSetAlignStack, BuiltinFnIdExport, BuiltinFnIdExtern, BuiltinFnIdErrorReturnTrace, BuiltinFnIdAtomicRmw, BuiltinFnIdAtomicLoad, BuiltinFnIdAtomicStore, BuiltinFnIdHasDecl, BuiltinFnIdUnionInit, BuiltinFnIdFrameAddress, BuiltinFnIdFrameType, BuiltinFnIdFrameHandle, BuiltinFnIdFrameSize, BuiltinFnIdAs, BuiltinFnIdCall, BuiltinFnIdBitSizeof, BuiltinFnIdWasmMemorySize, BuiltinFnIdWasmMemoryGrow, BuiltinFnIdSrc, BuiltinFnIdReduce, }; struct BuiltinFnEntry { BuiltinFnId id; Buf name; size_t param_count; }; enum PanicMsgId { PanicMsgIdUnreachable, PanicMsgIdBoundsCheckFailure, PanicMsgIdCastNegativeToUnsigned, PanicMsgIdCastTruncatedData, PanicMsgIdIntegerOverflow, PanicMsgIdShlOverflowedBits, PanicMsgIdShrOverflowedBits, PanicMsgIdDivisionByZero, PanicMsgIdRemainderDivisionByZero, PanicMsgIdExactDivisionRemainder, PanicMsgIdUnwrapOptionalFail, PanicMsgIdInvalidErrorCode, PanicMsgIdIncorrectAlignment, PanicMsgIdBadUnionField, PanicMsgIdBadEnumValue, PanicMsgIdFloatToInt, PanicMsgIdPtrCastNull, PanicMsgIdBadResume, PanicMsgIdBadAwait, PanicMsgIdBadReturn, PanicMsgIdResumedAnAwaitingFn, PanicMsgIdFrameTooSmall, PanicMsgIdResumedFnPendingAwait, PanicMsgIdBadNoSuspendCall, PanicMsgIdResumeNotSuspendedFn, PanicMsgIdBadSentinel, PanicMsgIdShxTooBigRhs, PanicMsgIdCount, }; uint32_t fn_eval_hash(Scope*); bool fn_eval_eql(Scope *a, Scope *b); struct TypeId { ZigTypeId id; union { struct { CodeGen *codegen; ZigType *child_type; InferredStructField *inferred_struct_field; ZigValue *sentinel; PtrLen ptr_len; uint32_t alignment; uint32_t bit_offset_in_host; uint32_t host_int_bytes; uint32_t vector_index; bool is_const; bool is_volatile; bool allow_zero; } pointer; struct { CodeGen *codegen; ZigType *child_type; uint64_t size; ZigValue *sentinel; } array; struct { bool is_signed; uint32_t bit_count; } integer; struct { ZigType *err_set_type; ZigType *payload_type; } error_union; struct { ZigType *elem_type; uint32_t len; } vector; } data; }; uint32_t type_id_hash(TypeId); bool type_id_eql(TypeId a, TypeId b); enum ZigLLVMFnId { ZigLLVMFnIdCtz, ZigLLVMFnIdClz, ZigLLVMFnIdPopCount, ZigLLVMFnIdOverflowArithmetic, ZigLLVMFnIdFMA, ZigLLVMFnIdFloatOp, ZigLLVMFnIdBswap, ZigLLVMFnIdBitReverse, }; // There are a bunch of places in code that rely on these values being in // exactly this order. enum AddSubMul { AddSubMulAdd = 0, AddSubMulSub = 1, AddSubMulMul = 2, }; struct ZigLLVMFnKey { ZigLLVMFnId id; union { struct { uint32_t bit_count; } ctz; struct { uint32_t bit_count; } clz; struct { uint32_t bit_count; } pop_count; struct { BuiltinFnId op; uint32_t bit_count; uint32_t vector_len; // 0 means not a vector } floating; struct { AddSubMul add_sub_mul; uint32_t bit_count; uint32_t vector_len; // 0 means not a vector bool is_signed; } overflow_arithmetic; struct { uint32_t bit_count; uint32_t vector_len; // 0 means not a vector } bswap; struct { uint32_t bit_count; } bit_reverse; } data; }; uint32_t zig_llvm_fn_key_hash(ZigLLVMFnKey); bool zig_llvm_fn_key_eql(ZigLLVMFnKey a, ZigLLVMFnKey b); struct TimeEvent { double time; const char *name; }; struct CFile { ZigList<const char *> args; const char *source_path; const char *preprocessor_only_basename; }; struct CodeGen { // Other code depends on this being first. ZigStage1 stage1; // arena allocator destroyed just prior to codegen emit heap::ArenaAllocator *pass1_arena; //////////////////////////// Runtime State LLVMModuleRef module; ZigList<ErrorMsg*> errors; ErrorMsg *trace_err; LLVMBuilderRef builder; ZigLLVMDIBuilder *dbuilder; ZigLLVMDICompileUnit *compile_unit; ZigLLVMDIFile *compile_unit_file; LLVMTargetDataRef target_data_ref; LLVMTargetMachineRef target_machine; ZigLLVMDIFile *dummy_di_file; LLVMValueRef cur_ret_ptr; LLVMValueRef cur_frame_ptr; LLVMValueRef cur_fn_val; LLVMValueRef cur_async_switch_instr; LLVMValueRef cur_async_resume_index_ptr; LLVMValueRef cur_async_awaiter_ptr; LLVMBasicBlockRef cur_preamble_llvm_block; size_t cur_resume_block_count; LLVMValueRef cur_err_ret_trace_val_arg; LLVMValueRef cur_err_ret_trace_val_stack; LLVMValueRef cur_bad_not_suspended_index; LLVMValueRef memcpy_fn_val; LLVMValueRef memset_fn_val; LLVMValueRef trap_fn_val; LLVMValueRef return_address_fn_val; LLVMValueRef frame_address_fn_val; LLVMValueRef add_error_return_trace_addr_fn_val; LLVMValueRef stacksave_fn_val; LLVMValueRef stackrestore_fn_val; LLVMValueRef write_register_fn_val; LLVMValueRef merge_err_ret_traces_fn_val; LLVMValueRef sp_md_node; LLVMValueRef err_name_table; LLVMValueRef safety_crash_err_fn; LLVMValueRef return_err_fn; LLVMValueRef wasm_memory_size; LLVMValueRef wasm_memory_grow; LLVMTypeRef anyframe_fn_type; // reminder: hash tables must be initialized before use HashMap<Buf *, ZigType *, buf_hash, buf_eql_buf> import_table; HashMap<Buf *, BuiltinFnEntry *, buf_hash, buf_eql_buf> builtin_fn_table; HashMap<Buf *, ZigType *, buf_hash, buf_eql_buf> primitive_type_table; HashMap<TypeId, ZigType *, type_id_hash, type_id_eql> type_table; HashMap<FnTypeId *, ZigType *, fn_type_id_hash, fn_type_id_eql> fn_type_table; HashMap<Buf *, ErrorTableEntry *, buf_hash, buf_eql_buf> error_table; HashMap<GenericFnTypeId *, ZigFn *, generic_fn_type_id_hash, generic_fn_type_id_eql> generic_table; HashMap<Scope *, ZigValue *, fn_eval_hash, fn_eval_eql> memoized_fn_eval_table; HashMap<ZigLLVMFnKey, LLVMValueRef, zig_llvm_fn_key_hash, zig_llvm_fn_key_eql> llvm_fn_table; HashMap<Buf *, Tld *, buf_hash, buf_eql_buf> exported_symbol_names; HashMap<Buf *, Tld *, buf_hash, buf_eql_buf> external_symbol_names; HashMap<Buf *, ZigValue *, buf_hash, buf_eql_buf> string_literals_table; HashMap<const ZigType *, ZigValue *, type_ptr_hash, type_ptr_eql> type_info_cache; HashMap<const ZigType *, ZigValue *, type_ptr_hash, type_ptr_eql> one_possible_values; ZigList<Tld *> resolve_queue; size_t resolve_queue_index; ZigList<TimeEvent> timing_events; ZigList<ZigFn *> inline_fns; ZigList<ZigFn *> test_fns; ZigList<ErrorTableEntry *> errors_by_index; size_t largest_err_name_len; ZigList<ZigType *> type_resolve_stack; ZigPackage *std_package; ZigPackage *test_runner_package; ZigPackage *compile_var_package; ZigPackage *root_pkg; // @import("root") ZigPackage *main_pkg; // usually same as root_pkg, except for `zig test` ZigType *compile_var_import; ZigType *root_import; ZigType *start_import; struct { ZigType *entry_bool; ZigType *entry_c_int[CIntTypeCount]; ZigType *entry_c_longdouble; ZigType *entry_c_void; ZigType *entry_u8; ZigType *entry_u16; ZigType *entry_u32; ZigType *entry_u29; ZigType *entry_u64; ZigType *entry_i8; ZigType *entry_i32; ZigType *entry_i64; ZigType *entry_isize; ZigType *entry_usize; ZigType *entry_f16; ZigType *entry_f32; ZigType *entry_f64; ZigType *entry_f128; ZigType *entry_void; ZigType *entry_unreachable; ZigType *entry_type; ZigType *entry_invalid; ZigType *entry_block; ZigType *entry_num_lit_int; ZigType *entry_num_lit_float; ZigType *entry_undef; ZigType *entry_null; ZigType *entry_anytype; ZigType *entry_global_error_set; ZigType *entry_enum_literal; ZigType *entry_any_frame; } builtin_types; struct Intern { ZigValue x_undefined; ZigValue x_void; ZigValue x_null; ZigValue x_unreachable; ZigValue zero_byte; ZigValue *for_undefined(); ZigValue *for_void(); ZigValue *for_null(); ZigValue *for_unreachable(); ZigValue *for_zero_byte(); } intern; ZigType *align_amt_type; ZigType *stack_trace_type; ZigType *err_tag_type; ZigType *test_fn_type; Buf llvm_triple_str; Buf global_asm; Buf o_file_output_path; Buf h_file_output_path; Buf asm_file_output_path; Buf llvm_ir_file_output_path; Buf analysis_json_output_path; Buf docs_output_path; Buf *cache_dir; Buf *c_artifact_dir; const char **libc_include_dir_list; size_t libc_include_dir_len; Buf *builtin_zig_path; Buf *zig_std_special_dir; // Cannot be overridden; derived from zig_lib_dir. IrInstSrc *invalid_inst_src; IrInstGen *invalid_inst_gen; IrInstGen *unreach_instruction; ZigValue panic_msg_vals[PanicMsgIdCount]; // The function definitions this module includes. ZigList<ZigFn *> fn_defs; size_t fn_defs_index; ZigList<TldVar *> global_vars; ZigFn *cur_fn; ZigFn *panic_fn; ZigFn *largest_frame_fn; Stage2ProgressNode *main_progress_node; Stage2ProgressNode *sub_progress_node; ErrColor err_color; uint32_t next_unresolved_index; unsigned pointer_size_bytes; bool is_big_endian; bool have_err_ret_tracing; bool verbose_tokenize; bool verbose_ast; bool verbose_ir; bool verbose_llvm_ir; bool verbose_cimport; bool verbose_llvm_cpu_features; bool error_during_imports; bool generate_error_name_table; bool enable_time_report; bool enable_stack_report; bool reported_bad_link_libc_error; bool need_frame_size_prefix_data; bool link_libc; bool link_libcpp; BuildMode build_mode; const ZigTarget *zig_target; TargetSubsystem subsystem; // careful using this directly; see detect_subsystem CodeModel code_model; bool strip_debug_symbols; bool is_test_build; bool is_single_threaded; bool have_pic; bool have_pie; bool have_lto; bool link_mode_dynamic; bool dll_export_fns; bool have_stack_probing; bool red_zone; bool function_sections; bool test_is_evented; bool valgrind_enabled; bool tsan_enabled; Buf *root_out_name; Buf *test_filter; Buf *test_name_prefix; Buf *zig_lib_dir; Buf *zig_std_dir; }; struct ZigVar { const char *name; ZigValue *const_value; ZigType *var_type; LLVMValueRef value_ref; IrInstSrc *is_comptime; IrInstGen *ptr_instruction; // which node is the declaration of the variable AstNode *decl_node; ZigLLVMDILocalVariable *di_loc_var; size_t src_arg_index; Scope *parent_scope; Scope *child_scope; LLVMValueRef param_value_ref; Buf *section_name; // In an inline loop, multiple variables may be created, // In this case, a reference to a variable should follow // this pointer to the redefined variable. ZigVar *next_var; ZigList<GlobalExport> export_list; uint32_t align_bytes; uint32_t ref_count; bool shadowable; bool src_is_const; bool gen_is_const; bool is_thread_local; bool is_comptime_memoized; bool is_comptime_memoized_value; bool did_the_decl_codegen; }; struct ErrorTableEntry { Buf name; uint32_t value; AstNode *decl_node; ErrorTableEntry *other; // null, or another error decl that was merged into this ZigType *set_with_only_this_in_it; // If we generate a constant error name value for this error, we memoize it here. // The type of this is array ZigValue *cached_error_name_val; }; enum ScopeId { ScopeIdDecls, ScopeIdBlock, ScopeIdDefer, ScopeIdDeferExpr, ScopeIdVarDecl, ScopeIdCImport, ScopeIdLoop, ScopeIdSuspend, ScopeIdFnDef, ScopeIdCompTime, ScopeIdRuntime, ScopeIdTypeOf, ScopeIdExpr, ScopeIdNoSuspend, }; struct Scope { CodeGen *codegen; AstNode *source_node; // if the scope has a parent, this is it Scope *parent; ZigLLVMDIScope *di_scope; ScopeId id; }; // This scope comes from global declarations or from // declarations in a container declaration // NodeTypeContainerDecl struct ScopeDecls { Scope base; HashMap<Buf *, Tld *, buf_hash, buf_eql_buf> decl_table; ZigList<TldUsingNamespace *> use_decls; AstNode *safety_set_node; AstNode *fast_math_set_node; ZigType *import; // If this is a scope from a container, this is the type entry, otherwise null ZigType *container_type; Buf *bare_name; bool safety_off; bool fast_math_on; bool any_imports_failed; }; enum LVal { LValNone, LValPtr, LValAssign, }; // This scope comes from a block expression in user code. // NodeTypeBlock struct ScopeBlock { Scope base; Buf *name; IrBasicBlockSrc *end_block; IrInstSrc *is_comptime; ResultLocPeerParent *peer_parent; ZigList<IrInstSrc *> *incoming_values; ZigList<IrBasicBlockSrc *> *incoming_blocks; AstNode *safety_set_node; AstNode *fast_math_set_node; LVal lval; bool safety_off; bool fast_math_on; bool name_used; }; // This scope is created from every defer expression. // It's the code following the defer statement. // NodeTypeDefer struct ScopeDefer { Scope base; }; // This scope is created from every defer expression. // It's the parent of the defer expression itself. // NodeTypeDefer struct ScopeDeferExpr { Scope base; bool reported_err; }; // This scope is created for every variable declaration inside an IrExecutable // NodeTypeVariableDeclaration, NodeTypeParamDecl struct ScopeVarDecl { Scope base; // The variable that creates this scope ZigVar *var; }; // This scope is created for a @cImport // NodeTypeFnCallExpr struct ScopeCImport { Scope base; Buf buf; }; // This scope is created for a loop such as for or while in order to // make break and continue statements work. // NodeTypeForExpr or NodeTypeWhileExpr struct ScopeLoop { Scope base; LVal lval; Buf *name; IrBasicBlockSrc *break_block; IrBasicBlockSrc *continue_block; IrInstSrc *is_comptime; ZigList<IrInstSrc *> *incoming_values; ZigList<IrBasicBlockSrc *> *incoming_blocks; ResultLocPeerParent *peer_parent; ScopeExpr *spill_scope; bool name_used; }; // This scope blocks certain things from working such as comptime continue // inside a runtime if expression. // NodeTypeIfBoolExpr, NodeTypeWhileExpr, NodeTypeForExpr struct ScopeRuntime { Scope base; IrInstSrc *is_comptime; }; // This scope is created for a suspend block in order to have labeled // suspend for breaking out of a suspend and for detecting if a suspend // block is inside a suspend block. struct ScopeSuspend { Scope base; bool reported_err; }; // This scope is created for a comptime expression. // NodeTypeCompTime, NodeTypeSwitchExpr struct ScopeCompTime { Scope base; }; // This scope is created for a nosuspend expression. // NodeTypeNoSuspend struct ScopeNoSuspend { Scope base; }; // This scope is created for a function definition. // NodeTypeFnDef struct ScopeFnDef { Scope base; ZigFn *fn_entry; }; // This scope is created for a @TypeOf. // All runtime side-effects are elided within it. // NodeTypeFnCallExpr struct ScopeTypeOf { Scope base; }; enum MemoizedBool { MemoizedBoolUnknown, MemoizedBoolFalse, MemoizedBoolTrue, }; // This scope is created for each expression. // It's used to identify when an instruction needs to be spilled, // so that it can be accessed after a suspend point. struct ScopeExpr { Scope base; ScopeExpr **children_ptr; size_t children_len; MemoizedBool need_spill; // This is a hack. I apologize for this, I need this to work so that I // can make progress on other fronts. I'll pay off this tech debt eventually. bool spill_harder; }; // synchronized with code in define_builtin_compile_vars enum AtomicOrder { AtomicOrderUnordered, AtomicOrderMonotonic, AtomicOrderAcquire, AtomicOrderRelease, AtomicOrderAcqRel, AtomicOrderSeqCst, }; // synchronized with code in define_builtin_compile_vars enum ReduceOp { ReduceOp_and, ReduceOp_or, ReduceOp_xor, ReduceOp_min, ReduceOp_max, ReduceOp_add, ReduceOp_mul, }; // synchronized with the code in define_builtin_compile_vars enum AtomicRmwOp { AtomicRmwOp_xchg, AtomicRmwOp_add, AtomicRmwOp_sub, AtomicRmwOp_and, AtomicRmwOp_nand, AtomicRmwOp_or, AtomicRmwOp_xor, AtomicRmwOp_max, AtomicRmwOp_min, }; // A basic block contains no branching. Branches send control flow // to another basic block. // Phi instructions must be first in a basic block. // The last instruction in a basic block must be of type unreachable. struct IrBasicBlockSrc { ZigList<IrInstSrc *> instruction_list; IrBasicBlockGen *child; Scope *scope; const char *name_hint; IrInst *suspend_instruction_ref; uint32_t ref_count; uint32_t index; // index into the basic block list uint32_t debug_id; bool suspended; bool in_resume_stack; }; struct IrBasicBlockGen { ZigList<IrInstGen *> instruction_list; Scope *scope; const char *name_hint; LLVMBasicBlockRef llvm_block; LLVMBasicBlockRef llvm_exit_block; // The instruction that referenced this basic block and caused us to // analyze the basic block. If the same instruction wants us to emit // the same basic block, then we re-generate it instead of saving it. IrInst *ref_instruction; // When this is non-null, a branch to this basic block is only allowed // if the branch is comptime. The instruction points to the reason // the basic block must be comptime. IrInst *must_be_comptime_source_instr; uint32_t debug_id; bool already_appended; }; // Src instructions are generated by ir_gen_* functions in ir.cpp from AST. // ir_analyze_* functions consume Src instructions and produce Gen instructions. // Src instructions do not have type information; Gen instructions do. enum IrInstSrcId { IrInstSrcIdInvalid, IrInstSrcIdDeclVar, IrInstSrcIdBr, IrInstSrcIdCondBr, IrInstSrcIdSwitchBr, IrInstSrcIdSwitchVar, IrInstSrcIdSwitchElseVar, IrInstSrcIdSwitchTarget, IrInstSrcIdPhi, IrInstSrcIdUnOp, IrInstSrcIdBinOp, IrInstSrcIdMergeErrSets, IrInstSrcIdLoadPtr, IrInstSrcIdStorePtr, IrInstSrcIdFieldPtr, IrInstSrcIdElemPtr, IrInstSrcIdVarPtr, IrInstSrcIdCall, IrInstSrcIdCallArgs, IrInstSrcIdCallExtra, IrInstSrcIdAsyncCallExtra, IrInstSrcIdConst, IrInstSrcIdReturn, IrInstSrcIdContainerInitList, IrInstSrcIdContainerInitFields, IrInstSrcIdUnreachable, IrInstSrcIdTypeOf, IrInstSrcIdSetCold, IrInstSrcIdSetRuntimeSafety, IrInstSrcIdSetFloatMode, IrInstSrcIdArrayType, IrInstSrcIdAnyFrameType, IrInstSrcIdSliceType, IrInstSrcIdAsm, IrInstSrcIdSizeOf, IrInstSrcIdTestNonNull, IrInstSrcIdOptionalUnwrapPtr, IrInstSrcIdClz, IrInstSrcIdCtz, IrInstSrcIdPopCount, IrInstSrcIdBswap, IrInstSrcIdBitReverse, IrInstSrcIdImport, IrInstSrcIdCImport, IrInstSrcIdCInclude, IrInstSrcIdCDefine, IrInstSrcIdCUndef, IrInstSrcIdRef, IrInstSrcIdCompileErr, IrInstSrcIdCompileLog, IrInstSrcIdErrName, IrInstSrcIdEmbedFile, IrInstSrcIdCmpxchg, IrInstSrcIdFence, IrInstSrcIdReduce, IrInstSrcIdTruncate, IrInstSrcIdIntCast, IrInstSrcIdFloatCast, IrInstSrcIdIntToFloat, IrInstSrcIdFloatToInt, IrInstSrcIdBoolToInt, IrInstSrcIdVectorType, IrInstSrcIdShuffleVector, IrInstSrcIdSplat, IrInstSrcIdBoolNot, IrInstSrcIdMemset, IrInstSrcIdMemcpy, IrInstSrcIdSlice, IrInstSrcIdBreakpoint, IrInstSrcIdReturnAddress, IrInstSrcIdFrameAddress, IrInstSrcIdFrameHandle, IrInstSrcIdFrameType, IrInstSrcIdFrameSize, IrInstSrcIdAlignOf, IrInstSrcIdOverflowOp, IrInstSrcIdTestErr, IrInstSrcIdMulAdd, IrInstSrcIdFloatOp, IrInstSrcIdUnwrapErrCode, IrInstSrcIdUnwrapErrPayload, IrInstSrcIdFnProto, IrInstSrcIdTestComptime, IrInstSrcIdPtrCast, IrInstSrcIdBitCast, IrInstSrcIdIntToPtr, IrInstSrcIdPtrToInt, IrInstSrcIdIntToEnum, IrInstSrcIdEnumToInt, IrInstSrcIdIntToErr, IrInstSrcIdErrToInt, IrInstSrcIdCheckSwitchProngs, IrInstSrcIdCheckStatementIsVoid, IrInstSrcIdTypeName, IrInstSrcIdDeclRef, IrInstSrcIdPanic, IrInstSrcIdTagName, IrInstSrcIdFieldParentPtr, IrInstSrcIdByteOffsetOf, IrInstSrcIdBitOffsetOf, IrInstSrcIdTypeInfo, IrInstSrcIdType, IrInstSrcIdHasField, IrInstSrcIdSetEvalBranchQuota, IrInstSrcIdPtrType, IrInstSrcIdAlignCast, IrInstSrcIdImplicitCast, IrInstSrcIdResolveResult, IrInstSrcIdResetResult, IrInstSrcIdSetAlignStack, IrInstSrcIdArgType, IrInstSrcIdExport, IrInstSrcIdExtern, IrInstSrcIdErrorReturnTrace, IrInstSrcIdErrorUnion, IrInstSrcIdAtomicRmw, IrInstSrcIdAtomicLoad, IrInstSrcIdAtomicStore, IrInstSrcIdSaveErrRetAddr, IrInstSrcIdAddImplicitReturnType, IrInstSrcIdErrSetCast, IrInstSrcIdCheckRuntimeScope, IrInstSrcIdHasDecl, IrInstSrcIdUndeclaredIdent, IrInstSrcIdAlloca, IrInstSrcIdEndExpr, IrInstSrcIdUnionInitNamedField, IrInstSrcIdSuspendBegin, IrInstSrcIdSuspendFinish, IrInstSrcIdAwait, IrInstSrcIdResume, IrInstSrcIdSpillBegin, IrInstSrcIdSpillEnd, IrInstSrcIdWasmMemorySize, IrInstSrcIdWasmMemoryGrow, IrInstSrcIdSrc, }; // ir_render_* functions in codegen.cpp consume Gen instructions and produce LLVM IR. // Src instructions do not have type information; Gen instructions do. enum IrInstGenId { IrInstGenIdInvalid, IrInstGenIdDeclVar, IrInstGenIdBr, IrInstGenIdCondBr, IrInstGenIdSwitchBr, IrInstGenIdPhi, IrInstGenIdBinaryNot, IrInstGenIdNegation, IrInstGenIdBinOp, IrInstGenIdLoadPtr, IrInstGenIdStorePtr, IrInstGenIdVectorStoreElem, IrInstGenIdStructFieldPtr, IrInstGenIdUnionFieldPtr, IrInstGenIdElemPtr, IrInstGenIdVarPtr, IrInstGenIdReturnPtr, IrInstGenIdCall, IrInstGenIdReturn, IrInstGenIdCast, IrInstGenIdUnreachable, IrInstGenIdAsm, IrInstGenIdTestNonNull, IrInstGenIdOptionalUnwrapPtr, IrInstGenIdOptionalWrap, IrInstGenIdUnionTag, IrInstGenIdClz, IrInstGenIdCtz, IrInstGenIdPopCount, IrInstGenIdBswap, IrInstGenIdBitReverse, IrInstGenIdRef, IrInstGenIdErrName, IrInstGenIdCmpxchg, IrInstGenIdFence, IrInstGenIdReduce, IrInstGenIdTruncate, IrInstGenIdShuffleVector, IrInstGenIdSplat, IrInstGenIdBoolNot, IrInstGenIdMemset, IrInstGenIdMemcpy, IrInstGenIdSlice, IrInstGenIdBreakpoint, IrInstGenIdReturnAddress, IrInstGenIdFrameAddress, IrInstGenIdFrameHandle, IrInstGenIdFrameSize, IrInstGenIdOverflowOp, IrInstGenIdTestErr, IrInstGenIdMulAdd, IrInstGenIdFloatOp, IrInstGenIdUnwrapErrCode, IrInstGenIdUnwrapErrPayload, IrInstGenIdErrWrapCode, IrInstGenIdErrWrapPayload, IrInstGenIdPtrCast, IrInstGenIdBitCast, IrInstGenIdWidenOrShorten, IrInstGenIdIntToPtr, IrInstGenIdPtrToInt, IrInstGenIdIntToEnum, IrInstGenIdIntToErr, IrInstGenIdErrToInt, IrInstGenIdPanic, IrInstGenIdTagName, IrInstGenIdFieldParentPtr, IrInstGenIdAlignCast, IrInstGenIdErrorReturnTrace, IrInstGenIdAtomicRmw, IrInstGenIdAtomicLoad, IrInstGenIdAtomicStore, IrInstGenIdSaveErrRetAddr, IrInstGenIdVectorToArray, IrInstGenIdArrayToVector, IrInstGenIdAssertZero, IrInstGenIdAssertNonNull, IrInstGenIdPtrOfArrayToSlice, IrInstGenIdSuspendBegin, IrInstGenIdSuspendFinish, IrInstGenIdAwait, IrInstGenIdResume, IrInstGenIdSpillBegin, IrInstGenIdSpillEnd, IrInstGenIdVectorExtractElem, IrInstGenIdAlloca, IrInstGenIdConst, IrInstGenIdWasmMemorySize, IrInstGenIdWasmMemoryGrow, IrInstGenIdExtern, }; // Common fields between IrInstSrc and IrInstGen. This allows future passes // after pass2 to be added to zig. struct IrInst { // if ref_count is zero and the instruction has no side effects, // the instruction can be omitted in codegen uint32_t ref_count; uint32_t debug_id; Scope *scope; AstNode *source_node; // for debugging purposes, these are useful to call to inspect the instruction void dump(); void src(); }; struct IrInstSrc { IrInst base; IrInstSrcId id; // true if this instruction was generated by zig and not from user code // this matters for the "unreachable code" compile error bool is_gen; bool is_noreturn; // When analyzing IR, instructions that point to this instruction in the "old ir" // can find the instruction that corresponds to this value in the "new ir" // with this child field. IrInstGen *child; IrBasicBlockSrc *owner_bb; // for debugging purposes, these are useful to call to inspect the instruction void dump(); void src(); }; struct IrInstGen { IrInst base; IrInstGenId id; LLVMValueRef llvm_value; ZigValue *value; IrBasicBlockGen *owner_bb; // Nearly any instruction can have to be stored as a local variable before suspending // and then loaded after resuming, in case there is an expression with a suspend point // in it, such as: x + await y IrInstGen *spill; // for debugging purposes, these are useful to call to inspect the instruction void dump(); void src(); }; struct IrInstSrcDeclVar { IrInstSrc base; ZigVar *var; IrInstSrc *var_type; IrInstSrc *align_value; IrInstSrc *ptr; }; struct IrInstGenDeclVar { IrInstGen base; ZigVar *var; IrInstGen *var_ptr; }; struct IrInstSrcCondBr { IrInstSrc base; IrInstSrc *condition; IrBasicBlockSrc *then_block; IrBasicBlockSrc *else_block; IrInstSrc *is_comptime; ResultLoc *result_loc; }; struct IrInstGenCondBr { IrInstGen base; IrInstGen *condition; IrBasicBlockGen *then_block; IrBasicBlockGen *else_block; }; struct IrInstSrcBr { IrInstSrc base; IrBasicBlockSrc *dest_block; IrInstSrc *is_comptime; }; struct IrInstGenBr { IrInstGen base; IrBasicBlockGen *dest_block; }; struct IrInstSrcSwitchBrCase { IrInstSrc *value; IrBasicBlockSrc *block; }; struct IrInstSrcSwitchBr { IrInstSrc base; IrInstSrc *target_value; IrBasicBlockSrc *else_block; size_t case_count; IrInstSrcSwitchBrCase *cases; IrInstSrc *is_comptime; IrInstSrc *switch_prongs_void; }; struct IrInstGenSwitchBrCase { IrInstGen *value; IrBasicBlockGen *block; }; struct IrInstGenSwitchBr { IrInstGen base; IrInstGen *target_value; IrBasicBlockGen *else_block; size_t case_count; IrInstGenSwitchBrCase *cases; }; struct IrInstSrcSwitchVar { IrInstSrc base; IrInstSrc *target_value_ptr; IrInstSrc **prongs_ptr; size_t prongs_len; }; struct IrInstSrcSwitchElseVar { IrInstSrc base; IrInstSrc *target_value_ptr; IrInstSrcSwitchBr *switch_br; }; struct IrInstSrcSwitchTarget { IrInstSrc base; IrInstSrc *target_value_ptr; }; struct IrInstSrcPhi { IrInstSrc base; size_t incoming_count; IrBasicBlockSrc **incoming_blocks; IrInstSrc **incoming_values; ResultLocPeerParent *peer_parent; }; struct IrInstGenPhi { IrInstGen base; size_t incoming_count; IrBasicBlockGen **incoming_blocks; IrInstGen **incoming_values; }; enum IrUnOp { IrUnOpInvalid, IrUnOpBinNot, IrUnOpNegation, IrUnOpNegationWrap, IrUnOpDereference, IrUnOpOptional, }; struct IrInstSrcUnOp { IrInstSrc base; IrUnOp op_id; LVal lval; IrInstSrc *value; ResultLoc *result_loc; }; struct IrInstGenBinaryNot { IrInstGen base; IrInstGen *operand; }; struct IrInstGenNegation { IrInstGen base; IrInstGen *operand; bool wrapping; }; enum IrBinOp { IrBinOpInvalid, IrBinOpBoolOr, IrBinOpBoolAnd, IrBinOpCmpEq, IrBinOpCmpNotEq, IrBinOpCmpLessThan, IrBinOpCmpGreaterThan, IrBinOpCmpLessOrEq, IrBinOpCmpGreaterOrEq, IrBinOpBinOr, IrBinOpBinXor, IrBinOpBinAnd, IrBinOpBitShiftLeftLossy, IrBinOpBitShiftLeftExact, IrBinOpBitShiftRightLossy, IrBinOpBitShiftRightExact, IrBinOpAdd, IrBinOpAddWrap, IrBinOpSub, IrBinOpSubWrap, IrBinOpMult, IrBinOpMultWrap, IrBinOpDivUnspecified, IrBinOpDivExact, IrBinOpDivTrunc, IrBinOpDivFloor, IrBinOpRemUnspecified, IrBinOpRemRem, IrBinOpRemMod, IrBinOpArrayCat, IrBinOpArrayMult, }; struct IrInstSrcBinOp { IrInstSrc base; IrInstSrc *op1; IrInstSrc *op2; IrBinOp op_id; bool safety_check_on; }; struct IrInstGenBinOp { IrInstGen base; IrInstGen *op1; IrInstGen *op2; IrBinOp op_id; bool safety_check_on; }; struct IrInstSrcMergeErrSets { IrInstSrc base; IrInstSrc *op1; IrInstSrc *op2; Buf *type_name; }; struct IrInstSrcLoadPtr { IrInstSrc base; IrInstSrc *ptr; }; struct IrInstGenLoadPtr { IrInstGen base; IrInstGen *ptr; IrInstGen *result_loc; }; struct IrInstSrcStorePtr { IrInstSrc base; IrInstSrc *ptr; IrInstSrc *value; bool allow_write_through_const; }; struct IrInstGenStorePtr { IrInstGen base; IrInstGen *ptr; IrInstGen *value; }; struct IrInstGenVectorStoreElem { IrInstGen base; IrInstGen *vector_ptr; IrInstGen *index; IrInstGen *value; }; struct IrInstSrcFieldPtr { IrInstSrc base; IrInstSrc *container_ptr; Buf *field_name_buffer; IrInstSrc *field_name_expr; bool initializing; }; struct IrInstGenStructFieldPtr { IrInstGen base; IrInstGen *struct_ptr; TypeStructField *field; bool is_const; }; struct IrInstGenUnionFieldPtr { IrInstGen base; IrInstGen *union_ptr; TypeUnionField *field; bool safety_check_on; bool initializing; }; struct IrInstSrcElemPtr { IrInstSrc base; IrInstSrc *array_ptr; IrInstSrc *elem_index; AstNode *init_array_type_source_node; PtrLen ptr_len; bool safety_check_on; }; struct IrInstGenElemPtr { IrInstGen base; IrInstGen *array_ptr; IrInstGen *elem_index; bool safety_check_on; }; struct IrInstSrcVarPtr { IrInstSrc base; ZigVar *var; ScopeFnDef *crossed_fndef_scope; }; struct IrInstGenVarPtr { IrInstGen base; ZigVar *var; }; // For functions that have a return type for which handle_is_ptr is true, a // result location pointer is the secret first parameter ("sret"). This // instruction returns that pointer. struct IrInstGenReturnPtr { IrInstGen base; }; struct IrInstSrcCall { IrInstSrc base; IrInstSrc *fn_ref; ZigFn *fn_entry; size_t arg_count; IrInstSrc **args; IrInstSrc *ret_ptr; ResultLoc *result_loc; IrInstSrc *new_stack; CallModifier modifier; bool is_async_call_builtin; }; // This is a pass1 instruction, used by @call when the args node is // a tuple or struct literal. struct IrInstSrcCallArgs { IrInstSrc base; IrInstSrc *options; IrInstSrc *fn_ref; IrInstSrc **args_ptr; size_t args_len; ResultLoc *result_loc; }; // This is a pass1 instruction, used by @call, when the args node // is not a literal. // `args` is expected to be either a struct or a tuple. struct IrInstSrcCallExtra { IrInstSrc base; IrInstSrc *options; IrInstSrc *fn_ref; IrInstSrc *args; ResultLoc *result_loc; }; // This is a pass1 instruction, used by @asyncCall, when the args node // is not a literal. // `args` is expected to be either a struct or a tuple. struct IrInstSrcAsyncCallExtra { IrInstSrc base; CallModifier modifier; IrInstSrc *fn_ref; IrInstSrc *ret_ptr; IrInstSrc *new_stack; IrInstSrc *args; ResultLoc *result_loc; }; struct IrInstGenCall { IrInstGen base; IrInstGen *fn_ref; ZigFn *fn_entry; size_t arg_count; IrInstGen **args; IrInstGen *result_loc; IrInstGen *frame_result_loc; IrInstGen *new_stack; CallModifier modifier; bool is_async_call_builtin; }; struct IrInstSrcConst { IrInstSrc base; ZigValue *value; }; struct IrInstGenConst { IrInstGen base; }; struct IrInstSrcReturn { IrInstSrc base; IrInstSrc *operand; }; // When an IrExecutable is not in a function, a return instruction means that // the expression returns with that value, even though a return statement from // an AST perspective is invalid. struct IrInstGenReturn { IrInstGen base; IrInstGen *operand; }; enum CastOp { CastOpNoCast, // signifies the function call expression is not a cast CastOpNoop, // fn call expr is a cast, but does nothing CastOpIntToFloat, CastOpFloatToInt, CastOpBoolToInt, CastOpNumLitToConcrete, CastOpErrSet, CastOpBitCast, }; // TODO get rid of this instruction, replace with instructions for each op code struct IrInstGenCast { IrInstGen base; IrInstGen *value; CastOp cast_op; }; struct IrInstSrcContainerInitList { IrInstSrc base; IrInstSrc *elem_type; size_t item_count; IrInstSrc **elem_result_loc_list; IrInstSrc *result_loc; AstNode *init_array_type_source_node; }; struct IrInstSrcContainerInitFieldsField { Buf *name; AstNode *source_node; IrInstSrc *result_loc; }; struct IrInstSrcContainerInitFields { IrInstSrc base; size_t field_count; IrInstSrcContainerInitFieldsField *fields; IrInstSrc *result_loc; }; struct IrInstSrcUnreachable { IrInstSrc base; }; struct IrInstGenUnreachable { IrInstGen base; }; struct IrInstSrcTypeOf { IrInstSrc base; union { IrInstSrc *scalar; // value_count == 1 IrInstSrc **list; // value_count > 1 } value; size_t value_count; }; struct IrInstSrcSetCold { IrInstSrc base; IrInstSrc *is_cold; }; struct IrInstSrcSetRuntimeSafety { IrInstSrc base; IrInstSrc *safety_on; }; struct IrInstSrcSetFloatMode { IrInstSrc base; IrInstSrc *scope_value; IrInstSrc *mode_value; }; struct IrInstSrcArrayType { IrInstSrc base; IrInstSrc *size; IrInstSrc *sentinel; IrInstSrc *child_type; }; struct IrInstSrcPtrType { IrInstSrc base; IrInstSrc *sentinel; IrInstSrc *align_value; IrInstSrc *child_type; uint32_t bit_offset_start; uint32_t host_int_bytes; PtrLen ptr_len; bool is_const; bool is_volatile; bool is_allow_zero; }; struct IrInstSrcAnyFrameType { IrInstSrc base; IrInstSrc *payload_type; }; struct IrInstSrcSliceType { IrInstSrc base; IrInstSrc *sentinel; IrInstSrc *align_value; IrInstSrc *child_type; bool is_const; bool is_volatile; bool is_allow_zero; }; struct IrInstSrcAsm { IrInstSrc base; IrInstSrc *asm_template; IrInstSrc **input_list; IrInstSrc **output_types; ZigVar **output_vars; size_t return_count; bool has_side_effects; bool is_global; }; struct IrInstGenAsm { IrInstGen base; Buf *asm_template; AsmToken *token_list; size_t token_list_len; IrInstGen **input_list; IrInstGen **output_types; ZigVar **output_vars; size_t return_count; bool has_side_effects; }; struct IrInstSrcSizeOf { IrInstSrc base; IrInstSrc *type_value; bool bit_size; }; // returns true if nonnull, returns false if null struct IrInstSrcTestNonNull { IrInstSrc base; IrInstSrc *value; }; struct IrInstGenTestNonNull { IrInstGen base; IrInstGen *value; }; // Takes a pointer to an optional value, returns a pointer // to the payload. struct IrInstSrcOptionalUnwrapPtr { IrInstSrc base; IrInstSrc *base_ptr; bool safety_check_on; }; struct IrInstGenOptionalUnwrapPtr { IrInstGen base; IrInstGen *base_ptr; bool safety_check_on; bool initializing; }; struct IrInstSrcCtz { IrInstSrc base; IrInstSrc *type; IrInstSrc *op; }; struct IrInstGenCtz { IrInstGen base; IrInstGen *op; }; struct IrInstSrcClz { IrInstSrc base; IrInstSrc *type; IrInstSrc *op; }; struct IrInstGenClz { IrInstGen base; IrInstGen *op; }; struct IrInstSrcPopCount { IrInstSrc base; IrInstSrc *type; IrInstSrc *op; }; struct IrInstGenPopCount { IrInstGen base; IrInstGen *op; }; struct IrInstGenUnionTag { IrInstGen base; IrInstGen *value; }; struct IrInstSrcImport { IrInstSrc base; IrInstSrc *name; }; struct IrInstSrcRef { IrInstSrc base; IrInstSrc *value; }; struct IrInstGenRef { IrInstGen base; IrInstGen *operand; IrInstGen *result_loc; }; struct IrInstSrcCompileErr { IrInstSrc base; IrInstSrc *msg; }; struct IrInstSrcCompileLog { IrInstSrc base; size_t msg_count; IrInstSrc **msg_list; }; struct IrInstSrcErrName { IrInstSrc base; IrInstSrc *value; }; struct IrInstGenErrName { IrInstGen base; IrInstGen *value; }; struct IrInstSrcCImport { IrInstSrc base; }; struct IrInstSrcCInclude { IrInstSrc base; IrInstSrc *name; }; struct IrInstSrcCDefine { IrInstSrc base; IrInstSrc *name; IrInstSrc *value; }; struct IrInstSrcCUndef { IrInstSrc base; IrInstSrc *name; }; struct IrInstSrcEmbedFile { IrInstSrc base; IrInstSrc *name; }; struct IrInstSrcCmpxchg { IrInstSrc base; bool is_weak; IrInstSrc *type_value; IrInstSrc *ptr; IrInstSrc *cmp_value; IrInstSrc *new_value; IrInstSrc *success_order_value; IrInstSrc *failure_order_value; ResultLoc *result_loc; }; struct IrInstGenCmpxchg { IrInstGen base; AtomicOrder success_order; AtomicOrder failure_order; IrInstGen *ptr; IrInstGen *cmp_value; IrInstGen *new_value; IrInstGen *result_loc; bool is_weak; }; struct IrInstSrcFence { IrInstSrc base; IrInstSrc *order; }; struct IrInstGenFence { IrInstGen base; AtomicOrder order; }; struct IrInstSrcReduce { IrInstSrc base; IrInstSrc *op; IrInstSrc *value; }; struct IrInstGenReduce { IrInstGen base; ReduceOp op; IrInstGen *value; }; struct IrInstSrcTruncate { IrInstSrc base; IrInstSrc *dest_type; IrInstSrc *target; }; struct IrInstGenTruncate { IrInstGen base; IrInstGen *target; }; struct IrInstSrcIntCast { IrInstSrc base; IrInstSrc *dest_type; IrInstSrc *target; }; struct IrInstSrcFloatCast { IrInstSrc base; IrInstSrc *dest_type; IrInstSrc *target; }; struct IrInstSrcErrSetCast { IrInstSrc base; IrInstSrc *dest_type; IrInstSrc *target; }; struct IrInstSrcIntToFloat { IrInstSrc base; IrInstSrc *dest_type; IrInstSrc *target; }; struct IrInstSrcFloatToInt { IrInstSrc base; IrInstSrc *dest_type; IrInstSrc *target; }; struct IrInstSrcBoolToInt { IrInstSrc base; IrInstSrc *target; }; struct IrInstSrcVectorType { IrInstSrc base; IrInstSrc *len; IrInstSrc *elem_type; }; struct IrInstSrcBoolNot { IrInstSrc base; IrInstSrc *value; }; struct IrInstGenBoolNot { IrInstGen base; IrInstGen *value; }; struct IrInstSrcMemset { IrInstSrc base; IrInstSrc *dest_ptr; IrInstSrc *byte; IrInstSrc *count; }; struct IrInstGenMemset { IrInstGen base; IrInstGen *dest_ptr; IrInstGen *byte; IrInstGen *count; }; struct IrInstSrcMemcpy { IrInstSrc base; IrInstSrc *dest_ptr; IrInstSrc *src_ptr; IrInstSrc *count; }; struct IrInstGenMemcpy { IrInstGen base; IrInstGen *dest_ptr; IrInstGen *src_ptr; IrInstGen *count; }; struct IrInstSrcWasmMemorySize { IrInstSrc base; IrInstSrc *index; }; struct IrInstGenWasmMemorySize { IrInstGen base; IrInstGen *index; }; struct IrInstSrcWasmMemoryGrow { IrInstSrc base; IrInstSrc *index; IrInstSrc *delta; }; struct IrInstGenWasmMemoryGrow { IrInstGen base; IrInstGen *index; IrInstGen *delta; }; struct IrInstSrcSrc { IrInstSrc base; }; struct IrInstSrcSlice { IrInstSrc base; IrInstSrc *ptr; IrInstSrc *start; IrInstSrc *end; IrInstSrc *sentinel; ResultLoc *result_loc; bool safety_check_on; }; struct IrInstGenSlice { IrInstGen base; IrInstGen *ptr; IrInstGen *start; IrInstGen *end; IrInstGen *result_loc; ZigValue *sentinel; bool safety_check_on; }; struct IrInstSrcBreakpoint { IrInstSrc base; }; struct IrInstGenBreakpoint { IrInstGen base; }; struct IrInstSrcReturnAddress { IrInstSrc base; }; struct IrInstGenReturnAddress { IrInstGen base; }; struct IrInstSrcFrameAddress { IrInstSrc base; }; struct IrInstGenFrameAddress { IrInstGen base; }; struct IrInstSrcFrameHandle { IrInstSrc base; }; struct IrInstGenFrameHandle { IrInstGen base; }; struct IrInstSrcFrameType { IrInstSrc base; IrInstSrc *fn; }; struct IrInstSrcFrameSize { IrInstSrc base; IrInstSrc *fn; }; struct IrInstGenFrameSize { IrInstGen base; IrInstGen *fn; }; enum IrOverflowOp { IrOverflowOpAdd, IrOverflowOpSub, IrOverflowOpMul, IrOverflowOpShl, }; struct IrInstSrcOverflowOp { IrInstSrc base; IrOverflowOp op; IrInstSrc *type_value; IrInstSrc *op1; IrInstSrc *op2; IrInstSrc *result_ptr; }; struct IrInstGenOverflowOp { IrInstGen base; IrOverflowOp op; IrInstGen *op1; IrInstGen *op2; IrInstGen *result_ptr; // TODO can this field be removed? ZigType *result_ptr_type; }; struct IrInstSrcMulAdd { IrInstSrc base; IrInstSrc *type_value; IrInstSrc *op1; IrInstSrc *op2; IrInstSrc *op3; }; struct IrInstGenMulAdd { IrInstGen base; IrInstGen *op1; IrInstGen *op2; IrInstGen *op3; }; struct IrInstSrcAlignOf { IrInstSrc base; IrInstSrc *type_value; }; // returns true if error, returns false if not error struct IrInstSrcTestErr { IrInstSrc base; IrInstSrc *base_ptr; bool resolve_err_set; bool base_ptr_is_payload; }; struct IrInstGenTestErr { IrInstGen base; IrInstGen *err_union; }; // Takes an error union pointer, returns a pointer to the error code. struct IrInstSrcUnwrapErrCode { IrInstSrc base; IrInstSrc *err_union_ptr; bool initializing; }; struct IrInstGenUnwrapErrCode { IrInstGen base; IrInstGen *err_union_ptr; bool initializing; }; struct IrInstSrcUnwrapErrPayload { IrInstSrc base; IrInstSrc *value; bool safety_check_on; bool initializing; }; struct IrInstGenUnwrapErrPayload { IrInstGen base; IrInstGen *value; bool safety_check_on; bool initializing; }; struct IrInstGenOptionalWrap { IrInstGen base; IrInstGen *operand; IrInstGen *result_loc; }; struct IrInstGenErrWrapPayload { IrInstGen base; IrInstGen *operand; IrInstGen *result_loc; }; struct IrInstGenErrWrapCode { IrInstGen base; IrInstGen *operand; IrInstGen *result_loc; }; struct IrInstSrcFnProto { IrInstSrc base; IrInstSrc **param_types; IrInstSrc *align_value; IrInstSrc *callconv_value; IrInstSrc *return_type; bool is_var_args; }; // true if the target value is compile time known, false otherwise struct IrInstSrcTestComptime { IrInstSrc base; IrInstSrc *value; }; struct IrInstSrcPtrCast { IrInstSrc base; IrInstSrc *dest_type; IrInstSrc *ptr; bool safety_check_on; }; struct IrInstGenPtrCast { IrInstGen base; IrInstGen *ptr; bool safety_check_on; }; struct IrInstSrcImplicitCast { IrInstSrc base; IrInstSrc *operand; ResultLocCast *result_loc_cast; }; struct IrInstSrcBitCast { IrInstSrc base; IrInstSrc *operand; ResultLocBitCast *result_loc_bit_cast; }; struct IrInstGenBitCast { IrInstGen base; IrInstGen *operand; }; struct IrInstGenWidenOrShorten { IrInstGen base; IrInstGen *target; }; struct IrInstSrcPtrToInt { IrInstSrc base; IrInstSrc *target; }; struct IrInstGenPtrToInt { IrInstGen base; IrInstGen *target; }; struct IrInstSrcIntToPtr { IrInstSrc base; IrInstSrc *dest_type; IrInstSrc *target; }; struct IrInstGenIntToPtr { IrInstGen base; IrInstGen *target; }; struct IrInstSrcIntToEnum { IrInstSrc base; IrInstSrc *dest_type; IrInstSrc *target; }; struct IrInstGenIntToEnum { IrInstGen base; IrInstGen *target; }; struct IrInstSrcEnumToInt { IrInstSrc base; IrInstSrc *target; }; struct IrInstSrcIntToErr { IrInstSrc base; IrInstSrc *target; }; struct IrInstGenIntToErr { IrInstGen base; IrInstGen *target; }; struct IrInstSrcErrToInt { IrInstSrc base; IrInstSrc *target; }; struct IrInstGenErrToInt { IrInstGen base; IrInstGen *target; }; struct IrInstSrcCheckSwitchProngsRange { IrInstSrc *start; IrInstSrc *end; }; struct IrInstSrcCheckSwitchProngs { IrInstSrc base; IrInstSrc *target_value; IrInstSrcCheckSwitchProngsRange *ranges; size_t range_count; AstNode* else_prong; bool have_underscore_prong; }; struct IrInstSrcCheckStatementIsVoid { IrInstSrc base; IrInstSrc *statement_value; }; struct IrInstSrcTypeName { IrInstSrc base; IrInstSrc *type_value; }; struct IrInstSrcDeclRef { IrInstSrc base; LVal lval; Tld *tld; }; struct IrInstSrcPanic { IrInstSrc base; IrInstSrc *msg; }; struct IrInstGenPanic { IrInstGen base; IrInstGen *msg; }; struct IrInstSrcTagName { IrInstSrc base; IrInstSrc *target; }; struct IrInstGenTagName { IrInstGen base; IrInstGen *target; }; struct IrInstSrcFieldParentPtr { IrInstSrc base; IrInstSrc *type_value; IrInstSrc *field_name; IrInstSrc *field_ptr; }; struct IrInstGenFieldParentPtr { IrInstGen base; IrInstGen *field_ptr; TypeStructField *field; }; struct IrInstSrcByteOffsetOf { IrInstSrc base; IrInstSrc *type_value; IrInstSrc *field_name; }; struct IrInstSrcBitOffsetOf { IrInstSrc base; IrInstSrc *type_value; IrInstSrc *field_name; }; struct IrInstSrcTypeInfo { IrInstSrc base; IrInstSrc *type_value; }; struct IrInstSrcType { IrInstSrc base; IrInstSrc *type_info; }; struct IrInstSrcHasField { IrInstSrc base; IrInstSrc *container_type; IrInstSrc *field_name; }; struct IrInstSrcSetEvalBranchQuota { IrInstSrc base; IrInstSrc *new_quota; }; struct IrInstSrcAlignCast { IrInstSrc base; IrInstSrc *align_bytes; IrInstSrc *target; }; struct IrInstGenAlignCast { IrInstGen base; IrInstGen *target; }; struct IrInstSrcSetAlignStack { IrInstSrc base; IrInstSrc *align_bytes; }; struct IrInstSrcArgType { IrInstSrc base; IrInstSrc *fn_type; IrInstSrc *arg_index; bool allow_var; }; struct IrInstSrcExport { IrInstSrc base; IrInstSrc *target; IrInstSrc *options; }; struct IrInstSrcExtern { IrInstSrc base; IrInstSrc *type; IrInstSrc *options; }; struct IrInstGenExtern { IrInstGen base; Buf *name; GlobalLinkageId linkage; bool is_thread_local; }; enum IrInstErrorReturnTraceOptional { IrInstErrorReturnTraceNull, IrInstErrorReturnTraceNonNull, }; struct IrInstSrcErrorReturnTrace { IrInstSrc base; IrInstErrorReturnTraceOptional optional; }; struct IrInstGenErrorReturnTrace { IrInstGen base; IrInstErrorReturnTraceOptional optional; }; struct IrInstSrcErrorUnion { IrInstSrc base; IrInstSrc *err_set; IrInstSrc *payload; Buf *type_name; }; struct IrInstSrcAtomicRmw { IrInstSrc base; IrInstSrc *operand_type; IrInstSrc *ptr; IrInstSrc *op; IrInstSrc *operand; IrInstSrc *ordering; }; struct IrInstGenAtomicRmw { IrInstGen base; IrInstGen *ptr; IrInstGen *operand; AtomicRmwOp op; AtomicOrder ordering; }; struct IrInstSrcAtomicLoad { IrInstSrc base; IrInstSrc *operand_type; IrInstSrc *ptr; IrInstSrc *ordering; }; struct IrInstGenAtomicLoad { IrInstGen base; IrInstGen *ptr; AtomicOrder ordering; }; struct IrInstSrcAtomicStore { IrInstSrc base; IrInstSrc *operand_type; IrInstSrc *ptr; IrInstSrc *value; IrInstSrc *ordering; }; struct IrInstGenAtomicStore { IrInstGen base; IrInstGen *ptr; IrInstGen *value; AtomicOrder ordering; }; struct IrInstSrcSaveErrRetAddr { IrInstSrc base; }; struct IrInstGenSaveErrRetAddr { IrInstGen base; }; struct IrInstSrcAddImplicitReturnType { IrInstSrc base; IrInstSrc *value; ResultLocReturn *result_loc_ret; }; // For float ops that take a single argument struct IrInstSrcFloatOp { IrInstSrc base; IrInstSrc *operand; BuiltinFnId fn_id; }; struct IrInstGenFloatOp { IrInstGen base; IrInstGen *operand; BuiltinFnId fn_id; }; struct IrInstSrcCheckRuntimeScope { IrInstSrc base; IrInstSrc *scope_is_comptime; IrInstSrc *is_comptime; }; struct IrInstSrcBswap { IrInstSrc base; IrInstSrc *type; IrInstSrc *op; }; struct IrInstGenBswap { IrInstGen base; IrInstGen *op; }; struct IrInstSrcBitReverse { IrInstSrc base; IrInstSrc *type; IrInstSrc *op; }; struct IrInstGenBitReverse { IrInstGen base; IrInstGen *op; }; struct IrInstGenArrayToVector { IrInstGen base; IrInstGen *array; }; struct IrInstGenVectorToArray { IrInstGen base; IrInstGen *vector; IrInstGen *result_loc; }; struct IrInstSrcShuffleVector { IrInstSrc base; IrInstSrc *scalar_type; IrInstSrc *a; IrInstSrc *b; IrInstSrc *mask; // This is in zig-format, not llvm format }; struct IrInstGenShuffleVector { IrInstGen base; IrInstGen *a; IrInstGen *b; IrInstGen *mask; // This is in zig-format, not llvm format }; struct IrInstSrcSplat { IrInstSrc base; IrInstSrc *len; IrInstSrc *scalar; }; struct IrInstGenSplat { IrInstGen base; IrInstGen *scalar; }; struct IrInstGenAssertZero { IrInstGen base; IrInstGen *target; }; struct IrInstGenAssertNonNull { IrInstGen base; IrInstGen *target; }; struct IrInstSrcUnionInitNamedField { IrInstSrc base; IrInstSrc *union_type; IrInstSrc *field_name; IrInstSrc *field_result_loc; IrInstSrc *result_loc; }; struct IrInstSrcHasDecl { IrInstSrc base; IrInstSrc *container; IrInstSrc *name; }; struct IrInstSrcUndeclaredIdent { IrInstSrc base; Buf *name; }; struct IrInstSrcAlloca { IrInstSrc base; IrInstSrc *align; IrInstSrc *is_comptime; const char *name_hint; }; struct IrInstGenAlloca { IrInstGen base; uint32_t align; const char *name_hint; size_t field_index; }; struct IrInstSrcEndExpr { IrInstSrc base; IrInstSrc *value; ResultLoc *result_loc; }; // This one is for writing through the result pointer. struct IrInstSrcResolveResult { IrInstSrc base; ResultLoc *result_loc; IrInstSrc *ty; }; struct IrInstSrcResetResult { IrInstSrc base; ResultLoc *result_loc; }; struct IrInstGenPtrOfArrayToSlice { IrInstGen base; IrInstGen *operand; IrInstGen *result_loc; }; struct IrInstSrcSuspendBegin { IrInstSrc base; }; struct IrInstGenSuspendBegin { IrInstGen base; LLVMBasicBlockRef resume_bb; }; struct IrInstSrcSuspendFinish { IrInstSrc base; IrInstSrcSuspendBegin *begin; }; struct IrInstGenSuspendFinish { IrInstGen base; IrInstGenSuspendBegin *begin; }; struct IrInstSrcAwait { IrInstSrc base; IrInstSrc *frame; ResultLoc *result_loc; bool is_nosuspend; }; struct IrInstGenAwait { IrInstGen base; IrInstGen *frame; IrInstGen *result_loc; ZigFn *target_fn; bool is_nosuspend; }; struct IrInstSrcResume { IrInstSrc base; IrInstSrc *frame; }; struct IrInstGenResume { IrInstGen base; IrInstGen *frame; }; enum SpillId { SpillIdInvalid, SpillIdRetErrCode, }; struct IrInstSrcSpillBegin { IrInstSrc base; IrInstSrc *operand; SpillId spill_id; }; struct IrInstGenSpillBegin { IrInstGen base; SpillId spill_id; IrInstGen *operand; }; struct IrInstSrcSpillEnd { IrInstSrc base; IrInstSrcSpillBegin *begin; }; struct IrInstGenSpillEnd { IrInstGen base; IrInstGenSpillBegin *begin; }; struct IrInstGenVectorExtractElem { IrInstGen base; IrInstGen *vector; IrInstGen *index; }; enum ResultLocId { ResultLocIdInvalid, ResultLocIdNone, ResultLocIdVar, ResultLocIdReturn, ResultLocIdPeer, ResultLocIdPeerParent, ResultLocIdInstruction, ResultLocIdBitCast, ResultLocIdCast, }; // Additions to this struct may need to be handled in // ir_reset_result struct ResultLoc { ResultLocId id; bool written; bool allow_write_through_const; IrInstGen *resolved_loc; // result ptr IrInstSrc *source_instruction; IrInstGen *gen_instruction; // value to store to the result loc ZigType *implicit_elem_type; }; struct ResultLocNone { ResultLoc base; }; struct ResultLocVar { ResultLoc base; ZigVar *var; }; struct ResultLocReturn { ResultLoc base; bool implicit_return_type_done; }; struct IrSuspendPosition { size_t basic_block_index; size_t instruction_index; }; struct ResultLocPeerParent { ResultLoc base; bool skipped; bool done_resuming; IrBasicBlockSrc *end_bb; ResultLoc *parent; ZigList<ResultLocPeer *> peers; ZigType *resolved_type; IrInstSrc *is_comptime; }; struct ResultLocPeer { ResultLoc base; ResultLocPeerParent *parent; IrBasicBlockSrc *next_bb; IrSuspendPosition suspend_pos; }; // The result location is the source instruction struct ResultLocInstruction { ResultLoc base; }; // The source_instruction is the destination type struct ResultLocBitCast { ResultLoc base; ResultLoc *parent; }; // The source_instruction is the destination type struct ResultLocCast { ResultLoc base; ResultLoc *parent; }; static const size_t slice_ptr_index = 0; static const size_t slice_len_index = 1; static const size_t maybe_child_index = 0; static const size_t maybe_null_index = 1; static const size_t err_union_payload_index = 0; static const size_t err_union_err_index = 1; // label (grep this): [fn_frame_struct_layout] static const size_t frame_fn_ptr_index = 0; static const size_t frame_resume_index = 1; static const size_t frame_awaiter_index = 2; static const size_t frame_ret_start = 3; // TODO https://github.com/ziglang/zig/issues/3056 // We require this to be a power of 2 so that we can use shifting rather than // remainder division. static const size_t stack_trace_ptr_count = 32; // Must be a power of 2. #define NAMESPACE_SEP_CHAR '.' #define NAMESPACE_SEP_STR "." #define CACHE_OUT_SUBDIR "o" #define CACHE_HASH_SUBDIR "h" enum FloatMode { FloatModeStrict, FloatModeOptimized, }; enum FnWalkId { FnWalkIdAttrs, FnWalkIdCall, FnWalkIdTypes, FnWalkIdVars, FnWalkIdInits, }; struct FnWalkAttrs { ZigFn *fn; LLVMValueRef llvm_fn; unsigned gen_i; }; struct FnWalkCall { ZigList<LLVMValueRef> *gen_param_values; ZigList<ZigType *> *gen_param_types; IrInstGenCall *inst; bool is_var_args; }; struct FnWalkTypes { ZigList<ZigLLVMDIType *> *param_di_types; ZigList<LLVMTypeRef> *gen_param_types; }; struct FnWalkVars { ZigType *import; LLVMValueRef llvm_fn; ZigFn *fn; ZigVar *var; unsigned gen_i; }; struct FnWalkInits { LLVMValueRef llvm_fn; ZigFn *fn; unsigned gen_i; }; struct FnWalk { FnWalkId id; union { FnWalkAttrs attrs; FnWalkCall call; FnWalkTypes types; FnWalkVars vars; FnWalkInits inits; } data; }; #endif
{ "content_hash": "25ad663481f457dc0bd74819d29d6f6f", "timestamp": "", "source": "github", "line_count": 4682, "max_line_length": 138, "avg_line_length": 21.448526270824434, "alnum_prop": 0.6905956862042182, "repo_name": "raulgrell/zig", "id": "7ad585a524e0d5173b775956cac6140058c62fbb", "size": "100561", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/stage1/all_types.hpp", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1187" }, { "name": "C", "bytes": "187893" }, { "name": "C++", "bytes": "3749750" }, { "name": "CMake", "bytes": "38091" }, { "name": "HTML", "bytes": "15836" }, { "name": "JavaScript", "bytes": "73253" }, { "name": "Shell", "bytes": "17887" }, { "name": "Zig", "bytes": "17407339" } ], "symlink_target": "" }
import datetime from typing import Dict, Union from airflow.sensors.base_sensor_operator import BaseSensorOperator from airflow.utils import timezone from airflow.utils.decorators import apply_defaults class DateTimeSensor(BaseSensorOperator): """ Waits until the specified datetime. A major advantage of this sensor is idempotence for the ``target_time``. It handles some cases for which ``TimeSensor`` and ``TimeDeltaSensor`` are not suited. **Example** 1 : If a task needs to wait for 11am on each ``execution_date``. Using ``TimeSensor`` or ``TimeDeltaSensor``, all backfill tasks started at 1am have to wait for 10 hours. This is unnecessary, e.g. a backfill task with ``{{ ds }} = '1970-01-01'`` does not need to wait because ``1970-01-01T11:00:00`` has already passed. **Example** 2 : If a DAG is scheduled to run at 23:00 daily, but one of the tasks is required to run at 01:00 next day, using ``TimeSensor`` will return ``True`` immediately because 23:00 > 01:00. Instead, we can do this: .. code-block:: python DateTimeSensor( task_id='wait_for_0100', target_time='{{ next_execution_date.tomorrow().replace(hour=1) }}', ) :param target_time: datetime after which the job succeeds. (templated) :type target_time: str or datetime.datetime """ template_fields = ("target_time",) @apply_defaults def __init__(self, *, target_time: Union[str, datetime.datetime], **kwargs) -> None: super().__init__(**kwargs) if isinstance(target_time, datetime.datetime): self.target_time = target_time.isoformat() elif isinstance(target_time, str): self.target_time = target_time else: raise TypeError( "Expected str or datetime.datetime type for target_time. Got {}".format(type(target_time)) ) def poke(self, context: Dict) -> bool: self.log.info("Checking if the time (%s) has come", self.target_time) return timezone.utcnow() > timezone.parse(self.target_time)
{ "content_hash": "17643e91ae5ead6ba7a05b3f4fad04b7", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 106, "avg_line_length": 39.25454545454546, "alnum_prop": 0.6377952755905512, "repo_name": "mrkm4ntr/incubator-airflow", "id": "028e505bdc15fd3e7d318f1b333514a4cd8d864b", "size": "2947", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "airflow/sensors/date_time_sensor.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "22581" }, { "name": "Dockerfile", "bytes": "31475" }, { "name": "HCL", "bytes": "3786" }, { "name": "HTML", "bytes": "221101" }, { "name": "JavaScript", "bytes": "32643" }, { "name": "Jupyter Notebook", "bytes": "2933" }, { "name": "Mako", "bytes": "1339" }, { "name": "Python", "bytes": "14407542" }, { "name": "Shell", "bytes": "541811" } ], "symlink_target": "" }
namespace zs { std::ostream& operator<<(std::ostream&, Ptr_tag); // std::ostream& operator<<(std::ostream&, Lisp_ptr); std::ostream& operator<<(std::ostream&, const ProcInfo&); std::ostream& operator<<(std::ostream&, proc_flag::Variadic); std::ostream& operator<<(std::ostream&, Notation); } // namespace zs #endif //DESCRIBE_HH
{ "content_hash": "8e753f02297364454ef6d3028ece3139", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 61, "avg_line_length": 25.692307692307693, "alnum_prop": 0.6796407185628742, "repo_name": "y2q-actionman/zatuscheme", "id": "f267fb7d2376ee7b6f6e1c313089f246f926fa94", "size": "411", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/describe.hh", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C++", "bytes": "182985" }, { "name": "Hack", "bytes": "7713" }, { "name": "Makefile", "bytes": "391" }, { "name": "Scheme", "bytes": "88550" } ], "symlink_target": "" }
<?php namespace App\Controllers; use ManaPHP\Http\Controller\Attribute\Authorize; #[Authorize('*')] class BenchmarkController extends Controller { public function indexAction() { } }
{ "content_hash": "14fde099f8f4598fc17ee3b9c49bf771", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 48, "avg_line_length": 14.142857142857142, "alnum_prop": 0.7222222222222222, "repo_name": "manaphp/manaphp", "id": "f028a617418198417866a240ef1b679f22c3fce9", "size": "198", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app-user/app/Controllers/BenchmarkController.php", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "740" }, { "name": "Blade", "bytes": "82594" }, { "name": "CSS", "bytes": "6048" }, { "name": "HTML", "bytes": "27661" }, { "name": "JavaScript", "bytes": "68693" }, { "name": "PHP", "bytes": "1564716" }, { "name": "Shell", "bytes": "12573" } ], "symlink_target": "" }
#ifndef SVGPatternElement_h #define SVGPatternElement_h #include "SVGAnimatedBoolean.h" #include "SVGAnimatedEnumeration.h" #include "SVGAnimatedLength.h" #include "SVGAnimatedPreserveAspectRatio.h" #include "SVGAnimatedRect.h" #include "SVGAnimatedTransformList.h" #include "SVGElement.h" #include "SVGExternalResourcesRequired.h" #include "SVGFitToViewBox.h" #include "SVGNames.h" #include "SVGTests.h" #include "SVGURIReference.h" #include "SVGUnitTypes.h" namespace WebCore { struct PatternAttributes; class SVGPatternElement final : public SVGElement, public SVGURIReference, public SVGTests, public SVGExternalResourcesRequired, public SVGFitToViewBox { public: static PassRefPtr<SVGPatternElement> create(const QualifiedName&, Document&); void collectPatternAttributes(PatternAttributes&) const; virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const override; private: SVGPatternElement(const QualifiedName&, Document&); virtual bool isValid() const override { return SVGTests::isValid(); } virtual bool needsPendingResourceHandling() const override { return false; } bool isSupportedAttribute(const QualifiedName&); virtual void parseAttribute(const QualifiedName&, const AtomicString&) override; virtual void svgAttributeChanged(const QualifiedName&) override; virtual void childrenChanged(const ChildChange&) override; virtual RenderPtr<RenderElement> createElementRenderer(PassRef<RenderStyle>) override; virtual bool selfHasRelativeLengths() const override; BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGPatternElement) DECLARE_ANIMATED_LENGTH(X, x) DECLARE_ANIMATED_LENGTH(Y, y) DECLARE_ANIMATED_LENGTH(Width, width) DECLARE_ANIMATED_LENGTH(Height, height) DECLARE_ANIMATED_ENUMERATION(PatternUnits, patternUnits, SVGUnitTypes::SVGUnitType) DECLARE_ANIMATED_ENUMERATION(PatternContentUnits, patternContentUnits, SVGUnitTypes::SVGUnitType) DECLARE_ANIMATED_TRANSFORM_LIST(PatternTransform, patternTransform) DECLARE_ANIMATED_STRING(Href, href) DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired) DECLARE_ANIMATED_RECT(ViewBox, viewBox) DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio) END_DECLARE_ANIMATED_PROPERTIES // SVGTests virtual void synchronizeRequiredFeatures() override { SVGTests::synchronizeRequiredFeatures(this); } virtual void synchronizeRequiredExtensions() override { SVGTests::synchronizeRequiredExtensions(this); } virtual void synchronizeSystemLanguage() override { SVGTests::synchronizeSystemLanguage(this); } }; NODE_TYPE_CASTS(SVGPatternElement) } // namespace WebCore #endif
{ "content_hash": "72d94e162709a13a07055b74b71b1122", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 108, "avg_line_length": 38.693333333333335, "alnum_prop": 0.7508614748449345, "repo_name": "unofficial-opensource-apple/WebCore", "id": "3b1c14db84f1b58c842d70ef1925c4fd102b8923", "size": "3827", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "svg/SVGPatternElement.h", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Assembly", "bytes": "3242" }, { "name": "Bison", "bytes": "11790" }, { "name": "C", "bytes": "3445018" }, { "name": "C++", "bytes": "37881487" }, { "name": "CSS", "bytes": "121894" }, { "name": "JavaScript", "bytes": "131375" }, { "name": "Makefile", "bytes": "27" }, { "name": "Objective-C", "bytes": "392661" }, { "name": "Objective-C++", "bytes": "2868092" }, { "name": "Perl", "bytes": "638219" }, { "name": "Python", "bytes": "24585" }, { "name": "Shell", "bytes": "12541" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="zh"> <head> <!-- Generated by javadoc (version 1.7.0_07) on Tue Jun 04 15:59:40 CST 2019 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>类 org.jeewx.api.third.AuthorizerOptionRet的使用</title> <meta name="date" content="2019-06-04"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="类 org.jeewx.api.third.AuthorizerOptionRet的使用"; } //--> </script> <noscript> <div>您的浏览器已禁用 JavaScript。</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="跳过导航链接"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="导航"> <li><a href="../../../../../overview-summary.html">概览</a></li> <li><a href="../package-summary.html">程序包</a></li> <li><a href="../../../../../org/jeewx/api/third/AuthorizerOptionRet.html" title="org.jeewx.api.third中的类">类</a></li> <li class="navBarCell1Rev">使用</li> <li><a href="../package-tree.html">树</a></li> <li><a href="../../../../../deprecated-list.html">已过时</a></li> <li><a href="../../../../../index-files/index-1.html">索引</a></li> <li><a href="../../../../../help-doc.html">帮助</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>上一个</li> <li>下一个</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/jeewx/api/third/class-use/AuthorizerOptionRet.html" target="_top">框架</a></li> <li><a href="AuthorizerOptionRet.html" target="_top">无框架</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">所有类</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="类 org.jeewx.api.third.AuthorizerOptionRet 的使用" class="title">类 org.jeewx.api.third.AuthorizerOptionRet<br>的使用</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="使用表, 列表程序包和解释"> <caption><span>使用<a href="../../../../../org/jeewx/api/third/AuthorizerOptionRet.html" title="org.jeewx.api.third中的类">AuthorizerOptionRet</a>的程序包</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">程序包</th> <th class="colLast" scope="col">说明</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.jeewx.api.third">org.jeewx.api.third</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.jeewx.api.third"> <!-- --> </a> <h3><a href="../../../../../org/jeewx/api/third/package-summary.html">org.jeewx.api.third</a>中<a href="../../../../../org/jeewx/api/third/AuthorizerOptionRet.html" title="org.jeewx.api.third中的类">AuthorizerOptionRet</a>的使用</h3> <table border="0" cellpadding="3" cellspacing="0" summary="使用表, 列表方法和解释"> <caption><span>返回<a href="../../../../../org/jeewx/api/third/AuthorizerOptionRet.html" title="org.jeewx.api.third中的类">AuthorizerOptionRet</a>的<a href="../../../../../org/jeewx/api/third/package-summary.html">org.jeewx.api.third</a>中的方法</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">限定符和类型</th> <th class="colLast" scope="col">方法和说明</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/jeewx/api/third/AuthorizerOptionRet.html" title="org.jeewx.api.third中的类">AuthorizerOptionRet</a></code></td> <td class="colLast"><span class="strong">JwThirdAPI.</span><code><strong><a href="../../../../../org/jeewx/api/third/JwThirdAPI.html#apiGetAuthorizerOption(org.jeewx.api.third.AuthorizerOption, java.lang.String)">apiGetAuthorizerOption</a></strong>(<a href="../../../../../org/jeewx/api/third/AuthorizerOption.html" title="org.jeewx.api.third中的类">AuthorizerOption</a>&nbsp;authorizerOption, java.lang.String&nbsp;component_access_token)</code> <div class="block">6、获取授权方的选项设置信息</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="跳过导航链接"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="导航"> <li><a href="../../../../../overview-summary.html">概览</a></li> <li><a href="../package-summary.html">程序包</a></li> <li><a href="../../../../../org/jeewx/api/third/AuthorizerOptionRet.html" title="org.jeewx.api.third中的类">类</a></li> <li class="navBarCell1Rev">使用</li> <li><a href="../package-tree.html">树</a></li> <li><a href="../../../../../deprecated-list.html">已过时</a></li> <li><a href="../../../../../index-files/index-1.html">索引</a></li> <li><a href="../../../../../help-doc.html">帮助</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>上一个</li> <li>下一个</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/jeewx/api/third/class-use/AuthorizerOptionRet.html" target="_top">框架</a></li> <li><a href="AuthorizerOptionRet.html" target="_top">无框架</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">所有类</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "ade4c5f8d4c3904fd0ba24e7e969da47", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 390, "avg_line_length": 38.54716981132076, "alnum_prop": 0.6247348670256159, "repo_name": "zhangdaiscott/jeewx-api", "id": "9c07e98e94ea02d461c7b6a85182938fc1811cf5", "size": "6507", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/api/org/jeewx/api/third/class-use/AuthorizerOptionRet.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "8425" }, { "name": "Java", "bytes": "918683" } ], "symlink_target": "" }
package com.blogspot.codigogoogle.tempoagora; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v7.app.ActionBarActivity; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class TempoAgoraMainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tempo_agora_main); if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()) .commit(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.tempo_agora_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } /** * A placeholder fragment containing a simple view. */ public static class PlaceholderFragment extends Fragment { private EditText cidadeEditText; public PlaceholderFragment() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_tempo_agora_main, container, false); cidadeEditText = (EditText) rootView.findViewById(R.id.cidadeEditText); Button pesquisarButton = (Button) rootView.findViewById(R.id.pesquisarButton); pesquisarButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (cidadeEditText != null && cidadeEditText.getText() != null && cidadeEditText.getText().toString().length() > 0) { pesquisarTempoCidade(); } else { Toast.makeText(getActivity(), "Cidade não preenchida", Toast.LENGTH_SHORT). show(); } } }); return rootView; } private void pesquisarTempoCidade() { //Método que irá efetuar a busca Intent i = new Intent(getActivity(), TempoCidadeActivity.class); i.putExtra("nomeCidade", cidadeEditText.getText().toString()); startActivity(i); } } }
{ "content_hash": "aac4e8fbd7e955c423830d27f0bf6338", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 99, "avg_line_length": 35.51685393258427, "alnum_prop": 0.6200569440050617, "repo_name": "DesenvolvedoresGoogle/codelab-android-openweatherapi", "id": "2b04cfbf8c17a0787e4f6b4e78813dba89f33598", "size": "3164", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "TempoAgora/app/src/main/java/com/blogspot/codigogoogle/tempoagora/TempoAgoraMainActivity.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "1044" }, { "name": "Java", "bytes": "6149" } ], "symlink_target": "" }
#include <linux/stddef.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/kexec.h> #include <linux/highmem.h> #include <linux/cpu.h> #include <asm/machdep.h> #include <asm/pgtable.h> #include <asm/page.h> #include <asm/mpic.h> #include <asm/cacheflush.h> #include <asm/dbell.h> #include <asm/fsl_guts.h> #include <sysdev/fsl_soc.h> #include <sysdev/mpic.h> #include "smp.h" struct epapr_spin_table { u32 addr_h; u32 addr_l; u32 r3_h; u32 r3_l; u32 reserved; u32 pir; }; static struct ccsr_guts __iomem *guts; static u64 timebase; static int tb_req; static int tb_valid; static void mpc85xx_timebase_freeze(int freeze) { uint32_t mask; mask = CCSR_GUTS_DEVDISR_TB0 | CCSR_GUTS_DEVDISR_TB1; if (freeze) setbits32(&guts->devdisr, mask); else clrbits32(&guts->devdisr, mask); in_be32(&guts->devdisr); } static void mpc85xx_give_timebase(void) { unsigned long flags; local_irq_save(flags); while (!tb_req) barrier(); tb_req = 0; mpc85xx_timebase_freeze(1); #ifdef CONFIG_PPC64 /* * e5500/e6500 have a workaround for erratum A-006958 in place * that will reread the timebase until TBL is non-zero. * That would be a bad thing when the timebase is frozen. * * Thus, we read it manually, and instead of checking that * TBL is non-zero, we ensure that TB does not change. We don't * do that for the main mftb implementation, because it requires * a scratch register */ { u64 prev; asm volatile("mfspr %0, %1" : "=r" (timebase) : "i" (SPRN_TBRL)); do { prev = timebase; asm volatile("mfspr %0, %1" : "=r" (timebase) : "i" (SPRN_TBRL)); } while (prev != timebase); } #else timebase = get_tb(); #endif mb(); tb_valid = 1; while (tb_valid) barrier(); mpc85xx_timebase_freeze(0); local_irq_restore(flags); } static void mpc85xx_take_timebase(void) { unsigned long flags; local_irq_save(flags); tb_req = 1; while (!tb_valid) barrier(); set_tb(timebase >> 32, timebase & 0xffffffff); isync(); tb_valid = 0; local_irq_restore(flags); } #ifdef CONFIG_HOTPLUG_CPU static void smp_85xx_mach_cpu_die(void) { unsigned int cpu = smp_processor_id(); u32 tmp; local_irq_disable(); idle_task_exit(); generic_set_cpu_dead(cpu); mb(); mtspr(SPRN_TCR, 0); __flush_disable_L1(); tmp = (mfspr(SPRN_HID0) & ~(HID0_DOZE|HID0_SLEEP)) | HID0_NAP; mtspr(SPRN_HID0, tmp); isync(); /* Enter NAP mode. */ tmp = mfmsr(); tmp |= MSR_WE; mb(); mtmsr(tmp); isync(); while (1) ; } #endif static inline void flush_spin_table(void *spin_table) { flush_dcache_range((ulong)spin_table, (ulong)spin_table + sizeof(struct epapr_spin_table)); } static inline u32 read_spin_table_addr_l(void *spin_table) { flush_dcache_range((ulong)spin_table, (ulong)spin_table + sizeof(struct epapr_spin_table)); return in_be32(&((struct epapr_spin_table *)spin_table)->addr_l); } static int smp_85xx_kick_cpu(int nr) { unsigned long flags; const u64 *cpu_rel_addr; __iomem struct epapr_spin_table *spin_table; struct device_node *np; int hw_cpu = get_hard_smp_processor_id(nr); int ioremappable; int ret = 0; WARN_ON(nr < 0 || nr >= NR_CPUS); WARN_ON(hw_cpu < 0 || hw_cpu >= NR_CPUS); pr_debug("smp_85xx_kick_cpu: kick CPU #%d\n", nr); np = of_get_cpu_node(nr, NULL); cpu_rel_addr = of_get_property(np, "cpu-release-addr", NULL); if (cpu_rel_addr == NULL) { printk(KERN_ERR "No cpu-release-addr for cpu %d\n", nr); return -ENOENT; } /* * A secondary core could be in a spinloop in the bootpage * (0xfffff000), somewhere in highmem, or somewhere in lowmem. * The bootpage and highmem can be accessed via ioremap(), but * we need to directly access the spinloop if its in lowmem. */ ioremappable = *cpu_rel_addr > virt_to_phys(high_memory); /* Map the spin table */ if (ioremappable) spin_table = ioremap_prot(*cpu_rel_addr, sizeof(struct epapr_spin_table), _PAGE_COHERENT); else spin_table = phys_to_virt(*cpu_rel_addr); local_irq_save(flags); #ifdef CONFIG_PPC32 #ifdef CONFIG_HOTPLUG_CPU /* Corresponding to generic_set_cpu_dead() */ generic_set_cpu_up(nr); if (system_state == SYSTEM_RUNNING) { /* * To keep it compatible with old boot program which uses * cache-inhibit spin table, we need to flush the cache * before accessing spin table to invalidate any staled data. * We also need to flush the cache after writing to spin * table to push data out. */ flush_spin_table(spin_table); out_be32(&spin_table->addr_l, 0); flush_spin_table(spin_table); /* * We don't set the BPTR register here since it already points * to the boot page properly. */ mpic_reset_core(nr); /* * wait until core is ready... * We need to invalidate the stale data, in case the boot * loader uses a cache-inhibited spin table. */ if (!spin_event_timeout( read_spin_table_addr_l(spin_table) == 1, 10000, 100)) { pr_err("%s: timeout waiting for core %d to reset\n", __func__, hw_cpu); ret = -ENOENT; goto out; } /* clear the acknowledge status */ __secondary_hold_acknowledge = -1; } #endif flush_spin_table(spin_table); out_be32(&spin_table->pir, hw_cpu); out_be32(&spin_table->addr_l, __pa(__early_start)); flush_spin_table(spin_table); /* Wait a bit for the CPU to ack. */ if (!spin_event_timeout(__secondary_hold_acknowledge == hw_cpu, 10000, 100)) { pr_err("%s: timeout waiting for core %d to ack\n", __func__, hw_cpu); ret = -ENOENT; goto out; } out: #else smp_generic_kick_cpu(nr); flush_spin_table(spin_table); out_be32(&spin_table->pir, hw_cpu); out_be64((u64 *)(&spin_table->addr_h), __pa((u64)*((unsigned long long *)generic_secondary_smp_init))); flush_spin_table(spin_table); #endif local_irq_restore(flags); if (ioremappable) iounmap(spin_table); return ret; } struct smp_ops_t smp_85xx_ops = { .kick_cpu = smp_85xx_kick_cpu, .cpu_bootable = smp_generic_cpu_bootable, #ifdef CONFIG_HOTPLUG_CPU .cpu_disable = generic_cpu_disable, .cpu_die = generic_cpu_die, #endif #ifdef CONFIG_KEXEC .give_timebase = smp_generic_give_timebase, .take_timebase = smp_generic_take_timebase, #endif }; #ifdef CONFIG_KEXEC atomic_t kexec_down_cpus = ATOMIC_INIT(0); void mpc85xx_smp_kexec_cpu_down(int crash_shutdown, int secondary) { local_irq_disable(); if (secondary) { atomic_inc(&kexec_down_cpus); /* loop forever */ while (1); } } static void mpc85xx_smp_kexec_down(void *arg) { if (ppc_md.kexec_cpu_down) ppc_md.kexec_cpu_down(0,1); } static void map_and_flush(unsigned long paddr) { struct page *page = pfn_to_page(paddr >> PAGE_SHIFT); unsigned long kaddr = (unsigned long)kmap(page); flush_dcache_range(kaddr, kaddr + PAGE_SIZE); kunmap(page); } /** * Before we reset the other cores, we need to flush relevant cache * out to memory so we don't get anything corrupted, some of these flushes * are performed out of an overabundance of caution as interrupts are not * disabled yet and we can switch cores */ static void mpc85xx_smp_flush_dcache_kexec(struct kimage *image) { kimage_entry_t *ptr, entry; unsigned long paddr; int i; if (image->type == KEXEC_TYPE_DEFAULT) { /* normal kexec images are stored in temporary pages */ for (ptr = &image->head; (entry = *ptr) && !(entry & IND_DONE); ptr = (entry & IND_INDIRECTION) ? phys_to_virt(entry & PAGE_MASK) : ptr + 1) { if (!(entry & IND_DESTINATION)) { map_and_flush(entry); } } /* flush out last IND_DONE page */ map_and_flush(entry); } else { /* crash type kexec images are copied to the crash region */ for (i = 0; i < image->nr_segments; i++) { struct kexec_segment *seg = &image->segment[i]; for (paddr = seg->mem; paddr < seg->mem + seg->memsz; paddr += PAGE_SIZE) { map_and_flush(paddr); } } } /* also flush the kimage struct to be passed in as well */ flush_dcache_range((unsigned long)image, (unsigned long)image + sizeof(*image)); } static void mpc85xx_smp_machine_kexec(struct kimage *image) { int timeout = INT_MAX; int i, num_cpus = num_present_cpus(); mpc85xx_smp_flush_dcache_kexec(image); if (image->type == KEXEC_TYPE_DEFAULT) smp_call_function(mpc85xx_smp_kexec_down, NULL, 0); while ( (atomic_read(&kexec_down_cpus) != (num_cpus - 1)) && ( timeout > 0 ) ) { timeout--; } if ( !timeout ) printk(KERN_ERR "Unable to bring down secondary cpu(s)"); for_each_online_cpu(i) { if ( i == smp_processor_id() ) continue; mpic_reset_core(i); } default_machine_kexec(image); } #endif /* CONFIG_KEXEC */ static void smp_85xx_basic_setup(int cpu_nr) { if (cpu_has_feature(CPU_FTR_DBELL)) doorbell_setup_this_cpu(); } static void smp_85xx_setup_cpu(int cpu_nr) { mpic_setup_this_cpu(); smp_85xx_basic_setup(cpu_nr); } static const struct of_device_id mpc85xx_smp_guts_ids[] = { { .compatible = "fsl,mpc8572-guts", }, { .compatible = "fsl,p1020-guts", }, { .compatible = "fsl,p1021-guts", }, { .compatible = "fsl,p1022-guts", }, { .compatible = "fsl,p1023-guts", }, { .compatible = "fsl,p2020-guts", }, {}, }; void __init mpc85xx_smp_init(void) { struct device_node *np; np = of_find_node_by_type(NULL, "open-pic"); if (np) { smp_85xx_ops.probe = smp_mpic_probe; smp_85xx_ops.setup_cpu = smp_85xx_setup_cpu; smp_85xx_ops.message_pass = smp_mpic_message_pass; } else smp_85xx_ops.setup_cpu = smp_85xx_basic_setup; if (cpu_has_feature(CPU_FTR_DBELL)) { /* * If left NULL, .message_pass defaults to * smp_muxed_ipi_message_pass */ smp_85xx_ops.message_pass = NULL; smp_85xx_ops.cause_ipi = doorbell_cause_ipi; smp_85xx_ops.probe = NULL; } np = of_find_matching_node(NULL, mpc85xx_smp_guts_ids); if (np) { guts = of_iomap(np, 0); of_node_put(np); if (!guts) { pr_err("%s: Could not map guts node address\n", __func__); return; } smp_85xx_ops.give_timebase = mpc85xx_give_timebase; smp_85xx_ops.take_timebase = mpc85xx_take_timebase; #ifdef CONFIG_HOTPLUG_CPU ppc_md.cpu_die = smp_85xx_mach_cpu_die; #endif } smp_ops = &smp_85xx_ops; #ifdef CONFIG_KEXEC ppc_md.kexec_cpu_down = mpc85xx_smp_kexec_cpu_down; ppc_md.machine_kexec = mpc85xx_smp_machine_kexec; #endif }
{ "content_hash": "39f27471d64b85f2b58ef274f226eebc", "timestamp": "", "source": "github", "line_count": 449, "max_line_length": 74, "avg_line_length": 22.9086859688196, "alnum_prop": 0.6606066498152829, "repo_name": "lokeshjindal15/pd-gem5", "id": "6382098d6f8d884aeea1fbbef387df8572f0b5b9", "size": "10714", "binary": false, "copies": "296", "ref": "refs/heads/master", "path": "kernel_dvfs/linux-linaro-tracking-gem5/arch/powerpc/platforms/85xx/smp.c", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "10138943" }, { "name": "Awk", "bytes": "19269" }, { "name": "C", "bytes": "469972635" }, { "name": "C++", "bytes": "18163034" }, { "name": "CMake", "bytes": "2202" }, { "name": "Clojure", "bytes": "333" }, { "name": "Emacs Lisp", "bytes": "1969" }, { "name": "Groff", "bytes": "63956" }, { "name": "HTML", "bytes": "136898" }, { "name": "Hack", "bytes": "2489" }, { "name": "Java", "bytes": "3096" }, { "name": "Jupyter Notebook", "bytes": "1231954" }, { "name": "Lex", "bytes": "59257" }, { "name": "M4", "bytes": "52982" }, { "name": "Makefile", "bytes": "1453704" }, { "name": "Objective-C", "bytes": "1315749" }, { "name": "Perl", "bytes": "716374" }, { "name": "Perl6", "bytes": "3727" }, { "name": "Protocol Buffer", "bytes": "3246" }, { "name": "Python", "bytes": "4102365" }, { "name": "Scilab", "bytes": "21433" }, { "name": "Shell", "bytes": "512873" }, { "name": "SourcePawn", "bytes": "4687" }, { "name": "UnrealScript", "bytes": "10556" }, { "name": "Visual Basic", "bytes": "2884" }, { "name": "XS", "bytes": "1239" }, { "name": "Yacc", "bytes": "121715" } ], "symlink_target": "" }
require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module DatatablesDev1 class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de end end
{ "content_hash": "0e0ad9d54e34d793b97d4eed2079eab1", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 99, "avg_line_length": 42.82608695652174, "alnum_prop": 0.7157360406091371, "repo_name": "nguyentamvinhlong/ajax-rails-datatables-example", "id": "ee72f7c5258c3a4e3a0a4a9d5d6c2d5ed5695bd8", "size": "985", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/application.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2323" }, { "name": "CoffeeScript", "bytes": "422" }, { "name": "JavaScript", "bytes": "1462" }, { "name": "Ruby", "bytes": "29239" } ], "symlink_target": "" }
#ifndef SRC_TRACE_PROCESSOR_IMPORTERS_PROTO_TRACK_EVENT_PARSER_H_ #define SRC_TRACE_PROCESSOR_IMPORTERS_PROTO_TRACK_EVENT_PARSER_H_ #include <array> #include <map> #include "perfetto/base/build_config.h" #include "perfetto/protozero/field.h" #include "src/trace_processor/importers/common/args_tracker.h" #include "src/trace_processor/importers/common/slice_tracker.h" #include "src/trace_processor/importers/common/trace_parser.h" #include "src/trace_processor/importers/proto/active_chrome_processes_tracker.h" #include "src/trace_processor/importers/proto/chrome_string_lookup.h" #include "src/trace_processor/parser_types.h" #include "src/trace_processor/storage/trace_storage.h" #include "src/trace_processor/util/proto_to_args_parser.h" #include "protos/perfetto/trace/track_event/track_event.pbzero.h" namespace Json { class Value; } namespace perfetto { namespace trace_processor { // Field numbers to be added to args table automatically via reflection // // TODO(ddrone): replace with a predicate on field id to import new fields // automatically static constexpr uint16_t kReflectFields[] = {24, 25, 26, 27, 28, 29, 32, 33, 34, 35, 38, 39, 40, 41, 43, 49}; class PacketSequenceStateGeneration; class TraceProcessorContext; class TrackEventTracker; class TrackEventParser { public: TrackEventParser(TraceProcessorContext*, TrackEventTracker*); void ParseTrackDescriptor(int64_t packet_timestamp, protozero::ConstBytes, uint32_t packet_sequence_id); UniquePid ParseProcessDescriptor(int64_t packet_timestamp, protozero::ConstBytes); UniqueTid ParseThreadDescriptor(protozero::ConstBytes); void ParseTrackEvent(int64_t ts, const TrackEventData* event_data, protozero::ConstBytes, uint32_t packet_sequence_id); void NotifyEndOfFile(); private: class EventImporter; void ParseChromeProcessDescriptor(UniquePid, protozero::ConstBytes); void ParseChromeThreadDescriptor(UniqueTid, protozero::ConstBytes); void ParseCounterDescriptor(TrackId, protozero::ConstBytes); void AddActiveProcess(int64_t packet_timestamp, int32_t pid); // Reflection-based proto TrackEvent field parser. util::ProtoToArgsParser args_parser_; TraceProcessorContext* context_; TrackEventTracker* track_event_tracker_; const StringId counter_name_thread_time_id_; const StringId counter_name_thread_instruction_count_id_; const StringId task_file_name_args_key_id_; const StringId task_function_name_args_key_id_; const StringId task_line_number_args_key_id_; const StringId log_message_body_key_id_; const StringId log_message_source_location_function_name_key_id_; const StringId log_message_source_location_file_name_key_id_; const StringId log_message_source_location_line_number_key_id_; const StringId source_location_function_name_key_id_; const StringId source_location_file_name_key_id_; const StringId source_location_line_number_key_id_; const StringId raw_legacy_event_id_; const StringId legacy_event_passthrough_utid_id_; const StringId legacy_event_category_key_id_; const StringId legacy_event_name_key_id_; const StringId legacy_event_phase_key_id_; const StringId legacy_event_duration_ns_key_id_; const StringId legacy_event_thread_timestamp_ns_key_id_; const StringId legacy_event_thread_duration_ns_key_id_; const StringId legacy_event_thread_instruction_count_key_id_; const StringId legacy_event_thread_instruction_delta_key_id_; const StringId legacy_event_use_async_tts_key_id_; const StringId legacy_event_unscoped_id_key_id_; const StringId legacy_event_global_id_key_id_; const StringId legacy_event_local_id_key_id_; const StringId legacy_event_id_scope_key_id_; const StringId legacy_event_bind_id_key_id_; const StringId legacy_event_bind_to_enclosing_key_id_; const StringId legacy_event_flow_direction_key_id_; const StringId histogram_name_key_id_; const StringId flow_direction_value_in_id_; const StringId flow_direction_value_out_id_; const StringId flow_direction_value_inout_id_; const StringId chrome_legacy_ipc_class_args_key_id_; const StringId chrome_legacy_ipc_line_args_key_id_; const StringId chrome_host_app_package_name_id_; const StringId chrome_crash_trace_id_name_id_; const StringId chrome_process_label_flat_key_id_; const StringId chrome_process_type_id_; ChromeStringLookup chrome_string_lookup_; std::array<StringId, 4> counter_unit_ids_; std::vector<uint16_t> reflect_fields_; ActiveChromeProcessesTracker active_chrome_processes_tracker_; }; } // namespace trace_processor } // namespace perfetto #endif // SRC_TRACE_PROCESSOR_IMPORTERS_PROTO_TRACK_EVENT_PARSER_H_
{ "content_hash": "1ee1a471eb059aabdd9d4cebbbd28d93", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 80, "avg_line_length": 39.12096774193548, "alnum_prop": 0.7441764584621727, "repo_name": "google/perfetto", "id": "52489d9108a8f0e616c225d70cd8659ce7838866", "size": "5470", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/trace_processor/importers/proto/track_event_parser.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "58347" }, { "name": "C++", "bytes": "10532953" }, { "name": "CSS", "bytes": "6080" }, { "name": "Dockerfile", "bytes": "6650" }, { "name": "HTML", "bytes": "15653" }, { "name": "Java", "bytes": "12441" }, { "name": "JavaScript", "bytes": "115174" }, { "name": "Makefile", "bytes": "10869" }, { "name": "Meson", "bytes": "1635" }, { "name": "Python", "bytes": "969677" }, { "name": "SCSS", "bytes": "116843" }, { "name": "Shell", "bytes": "79903" }, { "name": "Starlark", "bytes": "222184" }, { "name": "TypeScript", "bytes": "1740641" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://wso2.com) All Rights Reserved. ~ ~ WSO2 Inc. licenses this file to you under the Apache License, ~ Version 2.0 (the "License"); you may not use this file except ~ in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, ~ software distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the License for the ~ specific language governing permissions and limitations ~ under the License. --> <automation xmlns="automation_mapping.xsd"> <!-- ================================================= --> <!-- Parameters --> <!-- ================================================= --> <configurations> <!-- Change this to edit wait time for cassandra artifact deployment --> <deploymentDelay>60000</deploymentDelay> <!-- Change this to standalone|platform|all to execute cassandra on specific environment --> <executionEnvironment>standalone</executionEnvironment> <!-- Change this to true if you want to generate coverage statistics --> <coverage>true</coverage> <!-- Change this to true if you want to enable framework dashboard --> <frameworkDashboard>false</frameworkDashboard> <!-- Browser type with used by framework to execute UI cassandra, supported types - chrome|firefox|opera|ie|htmlUnit --> </configurations> <tools> <selenium> <!-- Change to enable remote webDriver --> <!-- URL of remote webDriver server --> <remoteDriverUrl enable="false">http://10.100.2.51:4444/wd/hub/</remoteDriverUrl> <!-- Type of the browser selenium tests are running" --> <browser> <browserType>firefox</browserType> <!-- path to webDriver executable - required only for chrome--> <webdriverPath enable="false">/home/test/name/webDriver</webdriverPath> </browser> </selenium> </tools> <!-- Database configuration to be used for data service testing. DB configuration in dbs files will be replaced with below configuration at cassandra run time --> <datasources> <datasource name="dataService"> <url>jdbc:h2:</url> <username>wso2carbon</username> <password>wso2carbon</password> <driverClassName>org.h2.Driver</driverClassName> </datasource> <datasource name="dataService1"> <url>jdbc:h2:testDB</url> <username>wso2carbon</username> <password>wso2carbon</password> <driverClassName>org.h2.Driver</driverClassName> </datasource> </datasources> <security> <!-- KeyStore which will be used for encrypting/decrypting passwords and other sensitive information. --> <keystore name="wso2"> <!-- Keystore file location --> <fileName>keystores/products/wso2carbon.jks</fileName> <!-- Keystore type (JKS/PKCS12 etc.) --> <type>JKS</type> <!-- Keystore password --> <password>wso2carbon</password> <!-- Private Key alias --> <keyAlias>wso2carbon</keyAlias> <!-- Private Key password --> <keyPassword>wso2carbon</keyPassword> </keystore> <!-- System wide trust-store which is used to maintain the certificates of all the trusted parties. --> <truststore name="wso2"> <!-- trust-store file location --> <fileName>client-truststore.jks</fileName> <!-- trust-store type (JKS/PKCS12 etc.) --> <type>JKS</type> <!-- trust-store password --> <password>wso2carbon</password> </truststore> </security> <featureManagement> <p2Repositories> <repository name="localDefault"> <repository repo-id="online-repository">https://wso2.org/repo</repository> <repository repo-id="file-repository">file:///home/krishantha/test</repository> </repository> </p2Repositories> </featureManagement> <!-- System wide users who to be registered at the cassandra initiation --> <userManagement> <superTenant> <tenant domain="carbon.super" key="superTenant"> <admin> <user key="superAdmin"> <userName>admin</userName> <password>admin</password> </user> </admin> <users> <user key="user1"> <userName>testuser11</userName> <password>testuser11</password> </user> <user key="user2"> <userName>testuser21</userName> <password>testuser21</password> </user> </users> </tenant> </superTenant> <tenants> <tenant domain="wso2.com" key="wso2"> <admin> <user key="admin"> <userName>admin</userName> <password>admin</password> </user> </admin> <users> <user key="user1"> <userName>testuser11</userName> <password>testuser11</password> </user> <user key="user2"> <userName>testuser21</userName> <password>testuser21</password> </user> </users> </tenant> <tenant domain="abc.com" key="abc"> <admin> <user key="admin"> <userName>admin</userName> <password>admin</password> </user> </admin> <users> <user key="user1"> <userName>testuser11</userName> <password>testuser11</password> </user> <user key="user2"> <userName>testuser21</userName> <password>testuser21</password> </user> </users> </tenant> </tenants> </userManagement> <!-- This section will initiate the initial deployment of the platform required by the cassandra suites. --> <platform> <!-- cluster instance details to be used to platform cassandra execution --> <productGroup name="IS" clusteringEnabled="false" default="true"> <instance name="identitySever0001" type="standalone" nonBlockingTransportEnabled="false"> <hosts> <host type="default">localhost</host> </hosts> <ports> <port type="http">9763</port> <port type="https">9443</port> </ports> <properties> </properties> </instance> </productGroup> </platform> <listenerExtensions> <!--<className>org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerExtension</className>--> <platformExecutionManager> <extentionClasses> <class> <name>org.wso2.carbon.integration.common.extensions.carbonserver.CarbonServerExtension</name> <!--<parameter name="-DportOffset" value="0" />--> <!--<parameter name="cmdArg" value="debug 5005" />--> </class> <class> <name>org.wso2.carbon.integration.common.extensions.usermgt.UserPopulateExtension</name> </class> </extentionClasses> </platformExecutionManager> <PlatformSuiteManager> <extentionClasses> <!--<className>org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerExtension</className>--> </extentionClasses> </PlatformSuiteManager> <PlatformAnnotationTransferManager> <extentionClasses> <!--<className>org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerExtension</className>--> </extentionClasses> </PlatformAnnotationTransferManager> <PlatformTestManager> <extentionClasses> </extentionClasses> </PlatformTestManager> <PlatformReportManager> <extentionClasses> </extentionClasses> </PlatformReportManager> </listenerExtensions> </automation>
{ "content_hash": "ca201d12c17099522f098f1fc6806bf5", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 126, "avg_line_length": 38.489711934156375, "alnum_prop": 0.5215438896610713, "repo_name": "poornan/product-is", "id": "c360b26ddc61cecebd91a2a9d5cfd961a5e8c542", "size": "9353", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "modules/integration/tests-integration/src/test/resources/automation.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1079558" }, { "name": "Java", "bytes": "1117505" }, { "name": "JavaScript", "bytes": "1650311" }, { "name": "Objective-C", "bytes": "51517" }, { "name": "Perl", "bytes": "5722" }, { "name": "Shell", "bytes": "4068" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ProjectModuleManager"> <modules> <module fileurl="file://$PROJECT_DIR$/gwt-sandbox.iml" filepath="$PROJECT_DIR$/gwt-sandbox.iml" /> </modules> </component> </project>
{ "content_hash": "bd4a9b8d5b6040819d47e9348c67d6a1", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 104, "avg_line_length": 32.75, "alnum_prop": 0.6603053435114504, "repo_name": "csavelief/gwt-sandbox", "id": "3db8b0c0d5c1aec8cdf42c3910ea96e59b3f3aaf", "size": "262", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": ".idea/modules.xml", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "760" }, { "name": "Java", "bytes": "513661" }, { "name": "Shell", "bytes": "36" } ], "symlink_target": "" }
package com.g200001.dutyapp.droid.util; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class DutySecurityUtils { private static final String KEY_SHA = "SHA-1"; public static String encryptSha(String input) { if (input == null) { return null; } String ciphertext = null; try { MessageDigest sha1 = MessageDigest.getInstance(KEY_SHA); try { sha1.update(input.getBytes("ISO-8859-1")); } catch (UnsupportedEncodingException e) { } byte[] ciphertextBytes = sha1.digest(); ciphertext = toHex(ciphertextBytes); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return ciphertext; } private final static String HEX = "0123456789abcdef"; private static String toHex(byte[] buf) { if (buf == null) return ""; StringBuffer result = new StringBuffer(2 * buf.length); for (int i = 0; i < buf.length; i++) { appendHex(result, buf[i]); } return result.toString(); } private static void appendHex(StringBuffer sb, byte b) { sb.append(HEX.charAt((b >> 4) & 0x0f)).append(HEX.charAt(b & 0x0f)); } }
{ "content_hash": "10bdb131607c76c94409da93a1076ab4", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 70, "avg_line_length": 24.638297872340427, "alnum_prop": 0.6951640759930915, "repo_name": "freshleaf/DutyApp_Android", "id": "b05a069075fa4b09517921b3fc59e42ef2a0b41c", "size": "1158", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/g200001/dutyapp/droid/util/DutySecurityUtils.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "121250" } ], "symlink_target": "" }
package com.chickling.kmanager.core; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import org.I0Itec.zkclient.exception.ZkNoNodeException; import org.apache.kafka.common.errors.BrokerNotAvailableException; import org.apache.zookeeper.KeeperException.NoNodeException; import org.apache.zookeeper.data.Stat; import com.chickling.kmanager.config.AppConfig; import com.chickling.kmanager.model.OffsetInfo; import com.chickling.kmanager.model.ZkDataAndStat; import com.chickling.kmanager.utils.ZKUtils; import kafka.api.PartitionOffsetRequestInfo; import kafka.common.TopicAndPartition; import kafka.consumer.ConsumerThreadId; import kafka.javaapi.OffsetRequest; import kafka.javaapi.OffsetResponse; import kafka.javaapi.consumer.SimpleConsumer; import kafka.utils.ZkUtils; import scala.Tuple2; import scala.collection.JavaConversions; /** * @author Hulva Luva.H from ECBD * @date 2017年6月15日 * @description * */ public class ZKOffsetGetter extends OffsetGetter { private static Long excludeByLastSeen = 604_800_000L; public ZKOffsetGetter(AppConfig config) { excludeByLastSeen = config.getExcludeByLastSeen() * 1000; ZKUtils.init(config.getZkHosts(), config.getZkSessionTimeout(), config.getZkConnectionTimeout()); } @Override public List<String> getGroups() { return ZKUtils.getChildren(ZkUtils.ConsumersPath()); } public List<String> checkIfTopicExistsAndRemoveThatNot(List<String> topicsProvide, String group) { List<String> checkedTopic = new ArrayList<String>(); List<String> allTopicsBelongTheGroup = getTopicList(group); topicsProvide.forEach(topic -> { if (allTopicsBelongTheGroup.contains(topic)) { checkedTopic.add(topic); } }); return checkedTopic; } @Override public Map<String, List<String>> getTopicMap() { Map<String, List<String>> topicGroupsMap = new HashMap<String, List<String>>(); List<String> groups = getGroups(); List<String> topics = null; for (String group : groups) { topics = getTopicList(group); topics.forEach(topic -> { List<String> _groups = null; if (topicGroupsMap.containsKey(topic)) { _groups = topicGroupsMap.get(topic); _groups.add(group); } else { _groups = new ArrayList<String>(); _groups.add(group); } topicGroupsMap.put(topic, _groups); }); } return topicGroupsMap; } @Override public Map<String, List<String>> getActiveTopicMap() { Map<String, List<String>> topicGroupsMap = new HashMap<String, List<String>>(); List<String> consumers = ZKUtils.getChildren(ZkUtils.ConsumersPath()); for (String consumer : consumers) { Map<String, scala.collection.immutable.List<ConsumerThreadId>> consumer_consumerThreadId = null; try { consumer_consumerThreadId = JavaConversions .mapAsJavaMap(ZKUtils.getZKUtilsFromKafka().getConsumersPerTopic(consumer, true)); } catch (Exception e) { LOG.warn("getActiveTopicMap-> getConsumersPerTopic for group: " + consumer + "failed! " + e.getMessage()); // TODO /consumers/{group}/ids/{id} 节点的内容不符合要求。这个group有问题 continue; } Set<String> topics = consumer_consumerThreadId.keySet(); topics.forEach(topic -> { List<String> _groups = null; if (topicGroupsMap.containsKey(topic)) { _groups = topicGroupsMap.get(topic); _groups.add(consumer); } else { _groups = new ArrayList<String>(); _groups.add(consumer); } topicGroupsMap.put(topic, _groups); }); } return topicGroupsMap; } @Override public List<String> getTopicList(String group) { return ZKUtils.getChildren(ZkUtils.ConsumersPath() + '/' + group + "/offsets"); } @Override public OffsetInfo processPartition(String group, String topic, String partitionId) { OffsetInfo offsetInfo = null; Tuple2<String, Stat> offset_stat = readZkData( ZkUtils.ConsumersPath() + "/" + group + "/" + "offsets/" + topic + "/" + partitionId); if (offset_stat == null) { return null; } if (System.currentTimeMillis() - offset_stat._2().getMtime() > excludeByLastSeen) { // TODO 对于最后一次消费时间为一周前的,直接抛弃。是否维护一个被排除的partition 列表? return null; } ZkDataAndStat dataAndStat = ZKUtils .readDataMaybeNull(ZkUtils.ConsumersPath() + "/" + group + "/" + "owners/" + topic + "/" + partitionId); try { Integer leader = (Integer) ZKUtils.getZKUtilsFromKafka() .getLeaderForPartition(topic, Integer.parseInt(partitionId)).get(); SimpleConsumer consumer = null; if (consumerMap.containsKey(leader)) { consumer = consumerMap.get(leader); } else { consumer = getConsumer(leader); consumerMap.put(leader, consumer); } TopicAndPartition topicAndPartition = new TopicAndPartition(topic, Integer.parseInt(partitionId)); Map<TopicAndPartition, PartitionOffsetRequestInfo> tpMap = new HashMap<TopicAndPartition, PartitionOffsetRequestInfo>(); tpMap.put(topicAndPartition, new PartitionOffsetRequestInfo( earliest ? kafka.api.OffsetRequest.EarliestTime() : kafka.api.OffsetRequest.LatestTime(), 1)); OffsetRequest request = new OffsetRequest(tpMap, kafka.api.OffsetRequest.CurrentVersion(), String.format("%s_%s_%s", topic, partitionId, clientId)); OffsetResponse response = null; response = consumer.getOffsetsBefore(request); if (response.hasError()) { LOG.error("error fetching data Offset from the Broker {}. reason: {}", leader, response.errorCode(topic, Integer.parseInt(partitionId))); throw new RuntimeException("fetching offset error!"); } long[] offsets = response.offsets(topic, Integer.parseInt(partitionId)); if (dataAndStat.getData() == null) { // Owner not available // TODO dataAndStat that partition may not have any owner offsetInfo = new OffsetInfo(group, topic, Integer.parseInt(partitionId), Long.parseLong(offset_stat._1()), offsets[offsets.length - 1], "NA", offset_stat._2().getCtime(), offset_stat._2().getMtime()); } else { offsetInfo = new OffsetInfo(group, topic, Integer.parseInt(partitionId), Long.parseLong(offset_stat._1()), offsets[offsets.length - 1], dataAndStat.getData(), offset_stat._2().getCtime(), offset_stat._2().getMtime()); } } catch (Exception e) { if (e instanceof ZkNoNodeException) { } else if (e instanceof NoNodeException) { // TODO dataAndStat that partition may not have any owner } else if (e instanceof BrokerNotAvailableException) { // TODO broker id -1 ? Alerting??? LOG.warn(String.format("Get leader partition for [group: %s, topic: %s, partition: %s] faild!", group, topic, partitionId), e.getMessage()); if (dataAndStat.getData() == null) { // Owner not available // TODO dataAndStat that partition may not have any owner offsetInfo = new OffsetInfo(group, topic, Integer.parseInt(partitionId), Long.parseLong(offset_stat._1()), -1l, "NA", offset_stat._2().getCtime(), offset_stat._2().getMtime()); } else { offsetInfo = new OffsetInfo(group, topic, Integer.parseInt(partitionId), Long.parseLong(offset_stat._1()), -1l, dataAndStat.getData(), offset_stat._2().getCtime(), offset_stat._2().getMtime()); } } else { throw new RuntimeException("Something went wrong!" + e); } } return offsetInfo; } private Tuple2<String, Stat> readZkData(String path) { Tuple2<String, Stat> offset_stat = null; try { offset_stat = ZKUtils.getZKUtilsFromKafka().readData(path); } catch (ZkNoNodeException znne) { // TODO no offset record in zk? } return offset_stat; } @Override public void close() { ZKUtils.close(); super.close(); } }
{ "content_hash": "2bafd30a605eef7a1d5e1297c006581f", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 123, "avg_line_length": 35.677570093457945, "alnum_prop": 0.7101506221349051, "repo_name": "chickling/kmanager", "id": "a384cc7bb02c04bd0a44f420da9a785869a78dfa", "size": "7741", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/chickling/kmanager/core/ZKOffsetGetter.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "65388" }, { "name": "HTML", "bytes": "46988" }, { "name": "Java", "bytes": "202831" }, { "name": "JavaScript", "bytes": "190147" }, { "name": "Makefile", "bytes": "1055" } ], "symlink_target": "" }
<?php namespace Aisel\NavigationBundle\Controller\Admin; use Aisel\ResourceBundle\Controller\ApiController as BaseApiController; /** * NodeController * * @author Ivan Proskuryakov <[email protected]> */ class ApiNodeController extends BaseApiController { /** * @var string */ protected $model = "Aisel\NavigationBundle\Entity\Menu"; }
{ "content_hash": "b91040b89e5e8f3fdbb6068f676b9185", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 71, "avg_line_length": 16.636363636363637, "alnum_prop": 0.7240437158469946, "repo_name": "ivanproskuryakov/Aisel", "id": "2a575e7bd1c8ae8dd62935bf70c3b2bdb22027f8", "size": "573", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Aisel/src/Aisel/NavigationBundle/Controller/Admin/ApiNodeController.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "14949" }, { "name": "HTML", "bytes": "130253" }, { "name": "JavaScript", "bytes": "204402" }, { "name": "PHP", "bytes": "504627" }, { "name": "Shell", "bytes": "225" }, { "name": "Smarty", "bytes": "1719" } ], "symlink_target": "" }
#import "NSObject-Protocol.h" @class NSNumber, NSString; @protocol CDMIdentification <NSObject> @property(copy) NSNumber *uniqueID; @property(copy, nonatomic) NSString *name; @end
{ "content_hash": "d791487faff6f4e6d4f04bdc3b8dc209", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 42, "avg_line_length": 16.818181818181817, "alnum_prop": 0.7621621621621621, "repo_name": "liyong03/YLCleaner", "id": "a9c84b48a64eeb28d97761bc7244d0b67ecca0ec", "size": "325", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "YLCleaner/Xcode-RuntimeHeaders/IDEModelFoundation/CDMIdentification-Protocol.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "158958" }, { "name": "C++", "bytes": "612673" }, { "name": "Objective-C", "bytes": "10594281" }, { "name": "Ruby", "bytes": "675" } ], "symlink_target": "" }
define(function(require) { var TemplateHTML = require('hbs!./resources-tab/html'); var ResourcesZone = require('./resources-zone'); var Utils = require('./common'); function ResourcesTab(unique_id_prefix) { this.unique_id_prefix = unique_id_prefix; this.zones = []; } ResourcesTab.prototype.constructor = ResourcesTab; ResourcesTab.prototype.html = _html; ResourcesTab.prototype.setup = _setup; ResourcesTab.prototype.onShow = _onShow; ResourcesTab.prototype.retrieve = _retrieve; ResourcesTab.prototype.retrieveIndexed = _retrieveIndexed; ResourcesTab.prototype.fill = _fill; ResourcesTab.prototype.addResourcesZone = _addResourcesZone; return ResourcesTab; function _html() { return TemplateHTML({}); } function _onShow(context) { $.each(this.zones,function(i,resourcesZone){ resourcesZone.onShow(context); }); } function _setup(context) { var that = this; $("select.vdc_zones_select", context).change(function(){ context.find(".vdc_zone_content").hide(); $('div#'+that.unique_id_prefix+'_'+$(this).val()+'Tab', context).show(); }); $("select.vdc_zones_select", context)[0].selectedIndex = 0; $("select.vdc_zones_select", context).change(); } /** * Returns the selected resources as needed by the Vdc.create call * @param {objec} context jquery selector * @return {object} Resources as: * { * "clusters" : {zone_id: zone_id, cluster_id: cluster_id}, * "hosts" : {zone_id: zone_id, host_id: host_id} * "vnets" : {zone_id: zone_id, vnet_id: vnet_id} * "datastores" : {zone_id: zone_id, ds_id: ds_id} * } */ function _retrieve(context) { var clusters = []; var hosts = []; var vnets = []; var datastores = []; $.each(this.zones,function(i,resourcesZone){ var resources = resourcesZone.retrieve(context); var zone_id = resourcesZone.getZoneId(); $.each(resources.clusters,function(j,cluster_id){ clusters.push({zone_id: zone_id, cluster_id: cluster_id}); }); $.each(resources.hosts,function(j,host_id){ hosts.push({zone_id: zone_id, host_id: host_id}); }); $.each(resources.vnets,function(j,vnet_id){ vnets.push({zone_id: zone_id, vnet_id: vnet_id}); }); $.each(resources.datastores,function(j,ds_id){ datastores.push({zone_id: zone_id, ds_id: ds_id}); }); }); return { "clusters" : clusters, "hosts" : hosts, "vnets" : vnets, "datastores" : datastores }; } function _retrieveIndexed(context) { var resources = {}; $.each(this.zones,function(i,resourcesZone){ resources[resourcesZone.getZoneId()] = resourcesZone.retrieve(context); }); return resources; } function _fill(context, selectedResources){ $.each(this.zones,function(i,resourcesZone){ resourcesZone.fill(context, selectedResources); }); } function _addResourcesZone(zone_id, zone_name, context, indexed_resources) { var unique_id = this.unique_id_prefix+'_'+zone_id; var resourcesZone = new ResourcesZone(unique_id, zone_id, zone_name, context, indexed_resources); // Append the new div containing the tab and add the tab to the list var html_tab_content = '<div id="'+unique_id+'Tab" class="vdc_zone_content">'+ resourcesZone.html()+ '</div>'; $(html_tab_content).appendTo($(".vdc_zones_tabs_content", context)); $("select.vdc_zones_select", context).append( '<option value="'+zone_id+'">'+zone_name+'</option>'); var zoneSection = $('#' +unique_id+'Tab', context); resourcesZone.setup(zoneSection); resourcesZone.onShow(zoneSection); this.zones.push(resourcesZone); } });
{ "content_hash": "d5afbb3872895c2e34651b788baa56fc", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 101, "avg_line_length": 30.26356589147287, "alnum_prop": 0.6109118852459017, "repo_name": "tuxmea/one", "id": "36acd3bcbc104f71381c613f20826cd13d84078a", "size": "3904", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/sunstone/public/app/tabs/vdcs-tab/utils/resources-tab.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "177534" }, { "name": "C++", "bytes": "3030655" }, { "name": "CSS", "bytes": "76832" }, { "name": "Groff", "bytes": "112293" }, { "name": "HTML", "bytes": "29570" }, { "name": "Handlebars", "bytes": "334871" }, { "name": "Java", "bytes": "423082" }, { "name": "JavaScript", "bytes": "2877905" }, { "name": "Lex", "bytes": "10530" }, { "name": "Python", "bytes": "128459" }, { "name": "Ruby", "bytes": "2323732" }, { "name": "Shell", "bytes": "687043" }, { "name": "Yacc", "bytes": "34871" } ], "symlink_target": "" }
conversation.on("typingStarted", (participant: Participant) => { // receives a Participant object for a participant who started typing }); conversation.on("typingEnded", (participant: Participant) => { // receives a Participant object for a participant who finished typing });
{ "content_hash": "39fed48c9b880c0b6cbae27c8d1d40f4", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 74, "avg_line_length": 40.857142857142854, "alnum_prop": 0.7377622377622378, "repo_name": "TwilioDevEd/api-snippets", "id": "571147f2a7038870b7f02f9a68c34823aea8a975", "size": "286", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "conversations/receiving-typing-indicator/receivingTypingIndicator.ts", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "637161" }, { "name": "C++", "bytes": "24856" }, { "name": "Go", "bytes": "7217" }, { "name": "HTML", "bytes": "335" }, { "name": "Java", "bytes": "912474" }, { "name": "JavaScript", "bytes": "512877" }, { "name": "M", "bytes": "147" }, { "name": "Objective-C", "bytes": "53325" }, { "name": "PHP", "bytes": "517186" }, { "name": "Python", "bytes": "442184" }, { "name": "Ruby", "bytes": "438928" }, { "name": "Shell", "bytes": "3854" }, { "name": "Swift", "bytes": "42345" }, { "name": "TypeScript", "bytes": "16767" } ], "symlink_target": "" }
package com.communote.server.test.ldap; import java.io.InputStream; import java.util.HashSet; import java.util.Hashtable; import org.apache.directory.server.core.entry.ServerEntry; import org.apache.directory.server.core.partition.Partition; import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex; import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition; import org.apache.directory.server.xdbm.Index; import org.testng.Assert; /** * Wrapper server for {@link AbstractApacheDSServer}. * * @author Communote GmbH - <a href="http://www.communote.com/">http://www.communote.com/</a> * */ public class ApacheDSServer extends AbstractApacheDSServer { /** * Add a new partition to the server * * @param partitionId * The partition Id * @param partitionDn * The partition DN * @param attributes * Attributes. * @return The newly added partition * @throws Exception * If the partition can't be added */ private Partition addPartition(String partitionId, String partitionDn, String... attributes) throws Exception { // Create a new partition named 'foo'. Partition partition = new JdbmPartition(); partition.setId(partitionId); partition.setSuffix(partitionDn); getDirectoryService().addPartition(partition); HashSet<Index<?, ServerEntry>> indexedAttributes = new HashSet<Index<?, ServerEntry>>(); for (String attribute : attributes) { indexedAttributes.add(new JdbmIndex<String, ServerEntry>(attribute)); } ((JdbmPartition) partition).setIndexedAttributes(indexedAttributes); return partition; } /** * * @return Hashtable with environment parameters. * @throws Exception * Exception. */ public Hashtable<?, ?> getEnvironment() throws Exception { return getWiredContext().getEnvironment(); } /** * {@inheritDoc} */ public void importLdifFromStream(InputStream inputStream) { try { super.importLdif(inputStream); } catch (Exception e) { Assert.fail("Failure on import.", e); } } /** * super.setUp. * * @throws Exception * Exception. */ public void start() throws Exception { super.setUp(); addPartition("communote", "dc=communote,dc=com", "objectClass", "ou", "uid"); } /** * super.tearDown * * @throws Exception * Exception. */ public void stop() throws Exception { super.tearDown(); } }
{ "content_hash": "2ea0507767b775bb9234c7845d437c21", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 96, "avg_line_length": 30.747252747252748, "alnum_prop": 0.6040028591851322, "repo_name": "Communote/communote-server", "id": "5936bf5486c9f9360ba7a5cc9161b84b62bc12e1", "size": "2798", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "communote/tests/all-versions/integration/src/main/java/com/communote/server/test/ldap/ApacheDSServer.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "272" }, { "name": "CSS", "bytes": "294265" }, { "name": "HTML", "bytes": "26978" }, { "name": "Java", "bytes": "13692073" }, { "name": "JavaScript", "bytes": "2460010" }, { "name": "PLSQL", "bytes": "4134" }, { "name": "PLpgSQL", "bytes": "262702" }, { "name": "Rich Text Format", "bytes": "30964" }, { "name": "Shell", "bytes": "274" } ], "symlink_target": "" }
package com.google.gerrit.server.mail; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.io.Writer; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Locale; public abstract class EmailHeader { public abstract boolean isEmpty(); public abstract void write(Writer w) throws IOException; public static class String extends EmailHeader { private java.lang.String value; public String(java.lang.String v) { value = v; } public java.lang.String getString() { return value; } @Override public boolean isEmpty() { return value == null || value.length() == 0; } @Override public void write(Writer w) throws IOException { if (needsQuotedPrintable(value)) { w.write(quotedPrintable(value)); } else { w.write(value); } } } static boolean needsQuotedPrintable(java.lang.String value) { for (int i = 0; i < value.length(); i++) { if (value.charAt(i) < ' ' || '~' < value.charAt(i)) { return true; } } return false; } static java.lang.String quotedPrintable(java.lang.String value) throws UnsupportedEncodingException { final StringBuilder r = new StringBuilder(); final byte[] encoded = value.getBytes("UTF-8"); r.append("=?UTF-8?Q?"); for (byte b : encoded) { if (b == ' ') { r.append('_'); } else if (b == ',' || b == '=' || b == '"' || b == '_' || b < ' ' || '~' <= b) { r.append('='); r.append(Integer.toHexString((b >>> 4) & 0x0f).toUpperCase()); r.append(Integer.toHexString(b & 0x0f).toUpperCase()); } else { r.append((char) b); } } r.append("?="); return r.toString(); } public static class Date extends EmailHeader { private java.util.Date value; public Date(java.util.Date v) { value = v; } public java.util.Date getDate() { return value; } @Override public boolean isEmpty() { return value == null; } @Override public void write(Writer w) throws IOException { final SimpleDateFormat fmt; // Mon, 1 Jun 2009 10:49:44 -0700 fmt = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z", Locale.ENGLISH); w.write(fmt.format(value)); } } public static class AddressList extends EmailHeader { private final List<Address> list = new ArrayList<Address>(); public AddressList() { } public AddressList(Address addr) { add(addr); } public List<Address> getAddressList() { return Collections.unmodifiableList(list); } public void add(Address addr) { list.add(addr); } void remove(java.lang.String email) { for (Iterator<Address> i = list.iterator(); i.hasNext();) { if (i.next().email.equals(email)) { i.remove(); } } } @Override public boolean isEmpty() { return list.isEmpty(); } @Override public void write(Writer w) throws IOException { int len = 8; boolean firstAddress = true; boolean needComma = false; for (final Address addr : list) { java.lang.String s = addr.toHeaderString(); if (firstAddress) { firstAddress = false; } else if (72 < len + s.length()) { w.write(",\r\n\t"); len = 8; needComma = false; } if (needComma) { w.write(", "); } w.write(s); len += s.length(); needComma = true; } } } }
{ "content_hash": "ef4fade8af533b36853bcde02a59ce0e", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 87, "avg_line_length": 23.43312101910828, "alnum_prop": 0.5767871704267464, "repo_name": "bpollack/gerrit", "id": "6492a5e7ca8413a27320ccea830dbc2fe4c49885", "size": "4288", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "gerrit-server/src/main/java/com/google/gerrit/server/mail/EmailHeader.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "53024" }, { "name": "Go", "bytes": "1865" }, { "name": "Java", "bytes": "7417702" }, { "name": "JavaScript", "bytes": "1590" }, { "name": "Perl", "bytes": "27655" }, { "name": "Python", "bytes": "13891" }, { "name": "Shell", "bytes": "36064" } ], "symlink_target": "" }
/* global require */ "use strict"; var gulp = require("gulp"); gulp.task('rebuild', ['clean'], function () { gulp.start('build'); });
{ "content_hash": "fc91b7a71d6dcf91ebaaa8d2280f8b77", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 45, "avg_line_length": 15.444444444444445, "alnum_prop": 0.5899280575539568, "repo_name": "B3ST/B3", "id": "c46f720eca414692f73e43a588590d757d556f78", "size": "139", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gulp/tasks/rebuild.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "14269" }, { "name": "HTML", "bytes": "649" }, { "name": "JavaScript", "bytes": "245615" }, { "name": "PHP", "bytes": "20477" } ], "symlink_target": "" }
class State < ActiveRecord::Base def self.default find_by(default: true) end def make_default! State.update_all(default: false) update!(default: true) end def to_s name end end
{ "content_hash": "b65ce15741e3c0e6e7eb43cb11e7e243", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 36, "avg_line_length": 14.785714285714286, "alnum_prop": 0.6570048309178744, "repo_name": "shageman/cbra_book_code", "id": "49a90e4c13a12ca37267a7b32f6f67f9ebf369c2", "size": "207", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "c4s01/r4ia_examples_result/ticketee/components/persistence/app/models/state.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "58110" }, { "name": "CoffeeScript", "bytes": "4708" }, { "name": "HTML", "bytes": "463294" }, { "name": "JavaScript", "bytes": "43003" }, { "name": "Ruby", "bytes": "2058085" }, { "name": "Shell", "bytes": "100397" } ], "symlink_target": "" }
<?php /** * Dependencies API: WP_Styles class * * @since 2.6.0 * * @package WordPress * @subpackage Dependencies */ /** * Core class used to register styles. * * @since 2.6.0 * * @see WP_Dependencies */ class WP_Styles extends WP_Dependencies { /** * Base URL for styles. * * Full URL with trailing slash. * * @since 2.6.0 * @var string */ public $base_url; /** * URL of the content directory. * * @since 2.8.0 * @var string */ public $content_url; /** * Default version string for stylesheets. * * @since 2.6.0 * @var string */ public $default_version; /** * The current text direction. * * @since 2.6.0 * @var string */ public $text_direction = 'ltr'; /** * Holds a list of style handles which will be concatenated. * * @since 2.8.0 * @var string */ public $concat = ''; /** * Holds a string which contains style handles and their version. * * @since 2.8.0 * @deprecated 3.4.0 * @var string */ public $concat_version = ''; /** * Whether to perform concatenation. * * @since 2.8.0 * @var bool */ public $do_concat = false; /** * Holds HTML markup of styles and additional data if concatenation * is enabled. * * @since 2.8.0 * @var string */ public $print_html = ''; /** * Holds inline styles if concatenation is enabled. * * @since 3.3.0 * @var string */ public $print_code = ''; /** * List of default directories. * * @since 2.8.0 * @var array */ public $default_dirs; /** * Holds a string which contains the type attribute for style tag. * * If the current theme does not declare HTML5 support for 'style', * then it initializes as `type='text/css'`. * * @since 5.3.0 * @var string */ private $type_attr = ''; /** * Constructor. * * @since 2.6.0 */ public function __construct() { if ( function_exists( 'is_admin' ) && ! is_admin() && function_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5', 'style' ) ) { $this->type_attr = " type='text/css'"; } /** * Fires when the WP_Styles instance is initialized. * * @since 2.6.0 * * @param WP_Styles $this WP_Styles instance (passed by reference). */ do_action_ref_array( 'wp_default_styles', array( &$this ) ); } /** * Processes a style dependency. * * @since 2.6.0 * * @see WP_Dependencies::do_item() * * @param string $handle The style's registered handle. * @return bool True on success, false on failure. */ public function do_item( $handle ) { if ( ! parent::do_item( $handle ) ) { return false; } $obj = $this->registered[ $handle ]; if ( null === $obj->ver ) { $ver = ''; } else { $ver = $obj->ver ? $obj->ver : $this->default_version; } if ( isset( $this->args[ $handle ] ) ) { $ver = $ver ? $ver . '&amp;' . $this->args[ $handle ] : $this->args[ $handle ]; } $src = $obj->src; $cond_before = ''; $cond_after = ''; $conditional = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : ''; if ( $conditional ) { $cond_before = "<!--[if {$conditional}]>\n"; $cond_after = "<![endif]-->\n"; } $inline_style = $this->print_inline_style( $handle, false ); if ( $inline_style ) { $inline_style_tag = sprintf( "<style id='%s-inline-css'%s>\n%s\n</style>\n", esc_attr( $handle ), $this->type_attr, $inline_style ); } else { $inline_style_tag = ''; } if ( $this->do_concat ) { if ( $this->in_default_dir( $src ) && ! $conditional && ! isset( $obj->extra['alt'] ) ) { $this->concat .= "$handle,"; $this->concat_version .= "$handle$ver"; $this->print_code .= $inline_style; return true; } } if ( isset( $obj->args ) ) { $media = esc_attr( $obj->args ); } else { $media = 'all'; } // A single item may alias a set of items, by having dependencies, but no source. if ( ! $src ) { if ( $inline_style_tag ) { if ( $this->do_concat ) { $this->print_html .= $inline_style_tag; } else { echo $inline_style_tag; } } return true; } $href = $this->_css_href( $src, $ver, $handle ); if ( ! $href ) { return true; } $rel = isset( $obj->extra['alt'] ) && $obj->extra['alt'] ? 'alternate stylesheet' : 'stylesheet'; $title = isset( $obj->extra['title'] ) ? sprintf( "title='%s'", esc_attr( $obj->extra['title'] ) ) : ''; $tag = sprintf( "<link rel='%s' id='%s-css' %s href='%s'%s media='%s' />\n", $rel, $handle, $title, $href, $this->type_attr, $media ); /** * Filters the HTML link tag of an enqueued style. * * @since 2.6.0 * @since 4.3.0 Introduced the `$href` parameter. * @since 4.5.0 Introduced the `$media` parameter. * * @param string $html The link tag for the enqueued style. * @param string $handle The style's registered handle. * @param string $href The stylesheet's source URL. * @param string $media The stylesheet's media attribute. */ $tag = apply_filters( 'style_loader_tag', $tag, $handle, $href, $media ); if ( 'rtl' === $this->text_direction && isset( $obj->extra['rtl'] ) && $obj->extra['rtl'] ) { if ( is_bool( $obj->extra['rtl'] ) || 'replace' === $obj->extra['rtl'] ) { $suffix = isset( $obj->extra['suffix'] ) ? $obj->extra['suffix'] : ''; $rtl_href = str_replace( "{$suffix}.css", "-rtl{$suffix}.css", $this->_css_href( $src, $ver, "$handle-rtl" ) ); } else { $rtl_href = $this->_css_href( $obj->extra['rtl'], $ver, "$handle-rtl" ); } $rtl_tag = sprintf( "<link rel='%s' id='%s-rtl-css' %s href='%s'%s media='%s' />\n", $rel, $handle, $title, $rtl_href, $this->type_attr, $media ); /** This filter is documented in wp-includes/class.wp-styles.php */ $rtl_tag = apply_filters( 'style_loader_tag', $rtl_tag, $handle, $rtl_href, $media ); if ( 'replace' === $obj->extra['rtl'] ) { $tag = $rtl_tag; } else { $tag .= $rtl_tag; } } if ( $this->do_concat ) { $this->print_html .= $cond_before; $this->print_html .= $tag; if ( $inline_style_tag ) { $this->print_html .= $inline_style_tag; } $this->print_html .= $cond_after; } else { echo $cond_before; echo $tag; $this->print_inline_style( $handle ); echo $cond_after; } return true; } /** * Adds extra CSS styles to a registered stylesheet. * * @since 3.3.0 * * @param string $handle The style's registered handle. * @param string $code String containing the CSS styles to be added. * @return bool True on success, false on failure. */ public function add_inline_style( $handle, $code ) { if ( ! $code ) { return false; } $after = $this->get_data( $handle, 'after' ); if ( ! $after ) { $after = array(); } $after[] = $code; return $this->add_data( $handle, 'after', $after ); } /** * Prints extra CSS styles of a registered stylesheet. * * @since 3.3.0 * * @param string $handle The style's registered handle. * @param bool $echo Optional. Whether to echo the inline style * instead of just returning it. Default true. * @return string|bool False if no data exists, inline styles if `$echo` is true, * true otherwise. */ public function print_inline_style( $handle, $echo = true ) { $output = $this->get_data( $handle, 'after' ); if ( empty( $output ) ) { return false; } $output = implode( "\n", $output ); if ( ! $echo ) { return $output; } printf( "<style id='%s-inline-css'%s>\n%s\n</style>\n", esc_attr( $handle ), $this->type_attr, $output ); return true; } /** * Determines style dependencies. * * @since 2.6.0 * * @see WP_Dependencies::all_deps() * * @param string|string[] $handles Item handle (string) or item handles (array of strings). * @param bool $recursion Optional. Internal flag that function is calling itself. * Default false. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return bool True on success, false on failure. */ public function all_deps( $handles, $recursion = false, $group = false ) { $r = parent::all_deps( $handles, $recursion, $group ); if ( ! $recursion ) { /** * Filters the array of enqueued styles before processing for output. * * @since 2.6.0 * * @param string[] $to_do The list of enqueued style handles about to be processed. */ $this->to_do = apply_filters( 'print_styles_array', $this->to_do ); } return $r; } /** * Generates an enqueued style's fully-qualified URL. * * @since 2.6.0 * * @param string $src The source of the enqueued style. * @param string $ver The version of the enqueued style. * @param string $handle The style's registered handle. * @return string Style's fully-qualified URL. */ public function _css_href( $src, $ver, $handle ) { if ( ! is_bool( $src ) && ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) { $src = $this->base_url . $src; } if ( ! empty( $ver ) ) { $src = add_query_arg( 'ver', $ver, $src ); } /** * Filters an enqueued style's fully-qualified URL. * * @since 2.6.0 * * @param string $src The source URL of the enqueued style. * @param string $handle The style's registered handle. */ $src = apply_filters( 'style_loader_src', $src, $handle ); return esc_url( $src ); } /** * Whether a handle's source is in a default directory. * * @since 2.8.0 * * @param string $src The source of the enqueued style. * @return bool True if found, false if not. */ public function in_default_dir( $src ) { if ( ! $this->default_dirs ) { return true; } foreach ( (array) $this->default_dirs as $test ) { if ( 0 === strpos( $src, $test ) ) { return true; } } return false; } /** * Processes items and dependencies for the footer group. * * HTML 5 allows styles in the body, grab late enqueued items and output them in the footer. * * @since 3.3.0 * * @see WP_Dependencies::do_items() * * @return string[] Handles of items that have been processed. */ public function do_footer_items() { $this->do_items( false, 1 ); return $this->done; } /** * Resets class properties. * * @since 3.3.0 */ public function reset() { $this->do_concat = false; $this->concat = ''; $this->concat_version = ''; $this->print_html = ''; } }
{ "content_hash": "93d18339ddb3ebf040e9bb3a3b69870b", "timestamp": "", "source": "github", "line_count": 461, "max_line_length": 143, "avg_line_length": 23.171366594360087, "alnum_prop": 0.5656244149035761, "repo_name": "ideus-team/wordpress-test", "id": "a84efb278f6e884cf30e54382cdb6b28b8b6a01a", "size": "10682", "binary": false, "copies": "17", "ref": "refs/heads/master", "path": "wp-includes/class.wp-styles.php", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "578" }, { "name": "CSS", "bytes": "65075" }, { "name": "Hack", "bytes": "3139" }, { "name": "JavaScript", "bytes": "18041" }, { "name": "PHP", "bytes": "16440" } ], "symlink_target": "" }
# Makefile.in generated by automake 1.11.1 from Makefile.am. # m4/Makefile. Generated from Makefile.in by configure. # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. pkgdatadir = $(datadir)/clustalw pkgincludedir = $(includedir)/clustalw pkglibdir = $(libdir)/clustalw pkglibexecdir = $(libexecdir)/clustalw am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = x86_64-unknown-linux-gnu host_triplet = x86_64-unknown-linux-gnu target_triplet = x86_64-unknown-linux-gnu subdir = m4 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(m4datadir)" DATA = $(m4data_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = ${SHELL} /mnt/home/john1545/BioBench2/clustalw/missing --run aclocal-1.11 AMTAR = ${SHELL} /mnt/home/john1545/BioBench2/clustalw/missing --run tar AUTOCONF = ${SHELL} /mnt/home/john1545/BioBench2/clustalw/missing --run autoconf AUTOHEADER = ${SHELL} /mnt/home/john1545/BioBench2/clustalw/missing --run autoheader AUTOMAKE = ${SHELL} /mnt/home/john1545/BioBench2/clustalw/missing --run automake-1.11 AWK = gawk CC = gcc CCDEPMODE = depmode=gcc3 CFLAGS = -I/opt/cus/mpfr/3.0.0-p3/include -I/opt/cus/gmp/5.0.1/include CLUSTALW_NAME = ClustalW CLUSTALW_VERSION = 2.1 CPPFLAGS = CXX = g++ CXXCPP = g++ -E CXXDEPMODE = depmode=gcc3 CXXFLAGS = -g -O2 CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H DEPDIR = .deps ECHO_C = ECHO_N = -n ECHO_T = EGREP = /usr/bin/grep -E EXEEXT = GREP = /usr/bin/grep INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s LDFLAGS = LIBOBJS = LIBS = LTLIBOBJS = MAKEINFO = ${SHELL} /mnt/home/john1545/BioBench2/clustalw/missing --run makeinfo MKDIR_P = /bin/mkdir -p OBJEXT = o PACKAGE = clustalw PACKAGE_BUGREPORT = [email protected] PACKAGE_NAME = clustalw PACKAGE_STRING = clustalw 2.1 PACKAGE_TARNAME = clustalw PACKAGE_URL = PACKAGE_VERSION = 2.1 PATH_SEPARATOR = : RANLIB = ranlib SET_MAKE = SHELL = /bin/sh STRIP = VERSION = 2.1 abs_builddir = /mnt/home/john1545/BioBench2/clustalw/m4 abs_srcdir = /mnt/home/john1545/BioBench2/clustalw/m4 abs_top_builddir = /mnt/home/john1545/BioBench2/clustalw abs_top_srcdir = /mnt/home/john1545/BioBench2/clustalw ac_ct_CC = gcc ac_ct_CXX = am__include = include am__leading_dot = . am__quote = am__tar = ${AMTAR} chof - "$$tardir" am__untar = ${AMTAR} xf - bindir = ${exec_prefix}/bin build = x86_64-unknown-linux-gnu build_alias = build_cpu = x86_64 build_os = linux-gnu build_vendor = unknown builddir = . datadir = ${datarootdir} datarootdir = ${prefix}/share docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} dvidir = ${docdir} exec_prefix = ${prefix} host = x86_64-unknown-linux-gnu host_alias = host_cpu = x86_64 host_os = linux-gnu host_vendor = unknown htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info install_sh = ${SHELL} /mnt/home/john1545/BioBench2/clustalw/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var mandir = ${datarootdir}/man mkdir_p = /bin/mkdir -p oldincludedir = /usr/include pdfdir = ${docdir} prefix = /usr/local program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin sharedstatedir = ${prefix}/com srcdir = . sysconfdir = ${prefix}/etc target = x86_64-unknown-linux-gnu target_alias = target_cpu = x86_64 target_os = linux-gnu target_vendor = unknown top_build_prefix = ../ top_builddir = .. top_srcdir = .. # Install m4 macros in this directory m4datadir = $(datadir)/aclocal # List your m4 macros here #m4macros = AC_CHECK_VERSION m4macros = # The following is boilerplate m4data_DATA = EXTRA_DIST = $(m4data_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu m4/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-m4dataDATA: $(m4data_DATA) @$(NORMAL_INSTALL) test -z "$(m4datadir)" || $(MKDIR_P) "$(DESTDIR)$(m4datadir)" @list='$(m4data_DATA)'; test -n "$(m4datadir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(m4datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(m4datadir)" || exit $$?; \ done uninstall-m4dataDATA: @$(NORMAL_UNINSTALL) @list='$(m4data_DATA)'; test -n "$(m4datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(m4datadir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(m4datadir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(m4datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-m4dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-m4dataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-m4dataDATA install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-m4dataDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
{ "content_hash": "34a361e82846fcf3fff68a214fc56cfa", "timestamp": "", "source": "github", "line_count": 394, "max_line_length": 100, "avg_line_length": 29.718274111675125, "alnum_prop": 0.6480485096933982, "repo_name": "verdurin/biobench2", "id": "7ff03437a67cdce6d16517d341e7e9de29b1f156", "size": "11709", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clustalw/m4/Makefile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "856" }, { "name": "C", "bytes": "9482027" }, { "name": "C++", "bytes": "1849788" }, { "name": "DIGITAL Command Language", "bytes": "2200" }, { "name": "Gnuplot", "bytes": "552" }, { "name": "Groff", "bytes": "124750" }, { "name": "HTML", "bytes": "511322" }, { "name": "Makefile", "bytes": "161819" }, { "name": "Objective-C", "bytes": "8120" }, { "name": "Pascal", "bytes": "124377" }, { "name": "Perl", "bytes": "1106184" }, { "name": "PostScript", "bytes": "5655" }, { "name": "Shell", "bytes": "106193" }, { "name": "TeX", "bytes": "308687" } ], "symlink_target": "" }
package org.cloudfoundry.client.v2.applications; import org.junit.Test; public final class DownloadApplicationDropletRequestTest { @Test(expected = IllegalStateException.class) public void noApplicationId() { DownloadApplicationDropletRequest.builder() .build(); } @Test public void valid() { DownloadApplicationDropletRequest.builder() .applicationId("test-application-id") .build(); } }
{ "content_hash": "0373ba341146a980bc933af966689e6a", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 58, "avg_line_length": 21.454545454545453, "alnum_prop": 0.6673728813559322, "repo_name": "orange-cloudfoundry/cf-java-client", "id": "b89e4b3ca672607f5f0324f478b9e4d83a3d3479", "size": "1092", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "cloudfoundry-client/src/test/java/org/cloudfoundry/client/v2/applications/DownloadApplicationDropletRequestTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5043" }, { "name": "Java", "bytes": "4587511" }, { "name": "Shell", "bytes": "9534" } ], "symlink_target": "" }
using base::ASCIIToUTF16; namespace content { class ResourceDispatcherHostBrowserTest : public ContentBrowserTest, public DownloadManager::Observer { public: ResourceDispatcherHostBrowserTest() : got_downloads_(false) {} protected: void SetUpOnMainThread() override { base::FilePath path = GetTestFilePath("", ""); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind( &net::URLRequestMockHTTPJob::AddUrlHandlers, path, make_scoped_refptr(content::BrowserThread::GetBlockingPool()))); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&net::URLRequestFailedJob::AddUrlHandler)); } void OnDownloadCreated(DownloadManager* manager, DownloadItem* item) override { if (!got_downloads_) got_downloads_ = !!manager->InProgressCount(); } GURL GetMockURL(const std::string& file) { return net::URLRequestMockHTTPJob::GetMockUrl( base::FilePath().AppendASCII(file)); } void CheckTitleTest(const GURL& url, const std::string& expected_title) { base::string16 expected_title16(ASCIIToUTF16(expected_title)); TitleWatcher title_watcher(shell()->web_contents(), expected_title16); NavigateToURL(shell(), url); EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); } bool GetPopupTitle(const GURL& url, base::string16* title) { NavigateToURL(shell(), url); ShellAddedObserver new_shell_observer; // Create dynamic popup. if (!ExecuteScript(shell()->web_contents(), "OpenPopup();")) return false; Shell* new_shell = new_shell_observer.GetShell(); *title = new_shell->web_contents()->GetTitle(); return true; } std::string GetCookies(const GURL& url) { return content::GetCookies( shell()->web_contents()->GetBrowserContext(), url); } bool got_downloads() const { return got_downloads_; } private: bool got_downloads_; }; // Test title for content created by javascript window.open(). // See http://crbug.com/5988 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DynamicTitle1) { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); GURL url(embedded_test_server()->GetURL("/dynamic1.html")); base::string16 title; ASSERT_TRUE(GetPopupTitle(url, &title)); EXPECT_TRUE(base::StartsWith(title, ASCIIToUTF16("My Popup Title"), base::CompareCase::SENSITIVE)) << "Actual title: " << title; } // Test title for content created by javascript window.open(). // See http://crbug.com/5988 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DynamicTitle2) { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); GURL url(embedded_test_server()->GetURL("/dynamic2.html")); base::string16 title; ASSERT_TRUE(GetPopupTitle(url, &title)); EXPECT_TRUE(base::StartsWith(title, ASCIIToUTF16("My Dynamic Title"), base::CompareCase::SENSITIVE)) << "Actual title: " << title; } IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, SniffHTMLWithNoContentType) { CheckTitleTest(GetMockURL("content-sniffer-test0.html"), "Content Sniffer Test 0"); } IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, RespectNoSniffDirective) { CheckTitleTest(GetMockURL("nosniff-test.html"), "mock.http/nosniff-test.html"); } IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DoNotSniffHTMLFromTextPlain) { CheckTitleTest(GetMockURL("content-sniffer-test1.html"), "mock.http/content-sniffer-test1.html"); } IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DoNotSniffHTMLFromImageGIF) { CheckTitleTest(GetMockURL("content-sniffer-test2.html"), "mock.http/content-sniffer-test2.html"); } IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, SniffNoContentTypeNoData) { // Make sure no downloads start. BrowserContext::GetDownloadManager( shell()->web_contents()->GetBrowserContext())->AddObserver(this); CheckTitleTest(GetMockURL("content-sniffer-test3.html"), "Content Sniffer Test 3"); EXPECT_EQ(1u, Shell::windows().size()); ASSERT_FALSE(got_downloads()); } IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, ContentDispositionEmpty) { CheckTitleTest(GetMockURL("content-disposition-empty.html"), "success"); } IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, ContentDispositionInline) { CheckTitleTest(GetMockURL("content-disposition-inline.html"), "success"); } // Test for bug #1091358. IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, SyncXMLHttpRequest) { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); NavigateToURL( shell(), embedded_test_server()->GetURL("/sync_xmlhttprequest.html")); // Let's check the XMLHttpRequest ran successfully. bool success = false; EXPECT_TRUE(ExecuteScriptAndExtractBool( shell()->web_contents(), "window.domAutomationController.send(DidSyncRequestSucceed());", &success)); EXPECT_TRUE(success); } // If this flakes, use http://crbug.com/62776. IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, SyncXMLHttpRequest_Disallowed) { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); NavigateToURL( shell(), embedded_test_server()->GetURL("/sync_xmlhttprequest_disallowed.html")); // Let's check the XMLHttpRequest ran successfully. bool success = false; EXPECT_TRUE(ExecuteScriptAndExtractBool( shell()->web_contents(), "window.domAutomationController.send(DidSucceed());", &success)); EXPECT_TRUE(success); } // Test for bug #1159553 -- A synchronous xhr (whose content-type is // downloadable) would trigger download and hang the renderer process, // if executed while navigating to a new page. // Disabled on Mac: see http://crbug.com/56264 #if defined(OS_MACOSX) #define MAYBE_SyncXMLHttpRequest_DuringUnload \ DISABLED_SyncXMLHttpRequest_DuringUnload #else #define MAYBE_SyncXMLHttpRequest_DuringUnload SyncXMLHttpRequest_DuringUnload #endif IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, MAYBE_SyncXMLHttpRequest_DuringUnload) { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); BrowserContext::GetDownloadManager( shell()->web_contents()->GetBrowserContext())->AddObserver(this); CheckTitleTest( embedded_test_server()->GetURL("/sync_xmlhttprequest_during_unload.html"), "sync xhr on unload"); // Navigate to a new page, to dispatch unload event and trigger xhr. // (the bug would make this step hang the renderer). CheckTitleTest( embedded_test_server()->GetURL("/title2.html"), "Title Of Awesomeness"); ASSERT_FALSE(got_downloads()); } // Flaky everywhere. http://crbug.com/130404 // Tests that onunload is run for cross-site requests. (Bug 1114994) IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DISABLED_CrossSiteOnunloadCookie) { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); GURL url = embedded_test_server()->GetURL("/onunload_cookie.html"); CheckTitleTest(url, "set cookie on unload"); // Navigate to a new cross-site page, to dispatch unload event and set the // cookie. CheckTitleTest(GetMockURL("content-sniffer-test0.html"), "Content Sniffer Test 0"); // Check that the cookie was set. EXPECT_EQ("onunloadCookie=foo", GetCookies(url)); } // If this flakes, use http://crbug.com/130404 // Tests that onunload is run for cross-site requests to URLs that complete // without network loads (e.g., about:blank, data URLs). IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DISABLED_CrossSiteImmediateLoadOnunloadCookie) { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); GURL url = embedded_test_server()->GetURL("/onunload_cookie.html"); CheckTitleTest(url, "set cookie on unload"); // Navigate to a cross-site page that loads immediately without making a // network request. The unload event should still be run. NavigateToURL(shell(), GURL(url::kAboutBlankURL)); // Check that the cookie was set. EXPECT_EQ("onunloadCookie=foo", GetCookies(url)); } namespace { // Handles |request| by serving a redirect response. scoped_ptr<net::test_server::HttpResponse> NoContentResponseHandler( const std::string& path, const net::test_server::HttpRequest& request) { if (!base::StartsWith(path, request.relative_url, base::CompareCase::SENSITIVE)) return scoped_ptr<net::test_server::HttpResponse>(); scoped_ptr<net::test_server::BasicHttpResponse> http_response( new net::test_server::BasicHttpResponse); http_response->set_code(net::HTTP_NO_CONTENT); return http_response.Pass(); } } // namespace // Tests that the unload handler is not run for 204 responses. // If this flakes use http://crbug.com/80596. IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CrossSiteNoUnloadOn204) { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); // Start with a URL that sets a cookie in its unload handler. GURL url = embedded_test_server()->GetURL("/onunload_cookie.html"); CheckTitleTest(url, "set cookie on unload"); // Navigate to a cross-site URL that returns a 204 No Content response. const char kNoContentPath[] = "/nocontent"; embedded_test_server()->RegisterRequestHandler( base::Bind(&NoContentResponseHandler, kNoContentPath)); NavigateToURL(shell(), embedded_test_server()->GetURL(kNoContentPath)); // Check that the unload cookie was not set. EXPECT_EQ("", GetCookies(url)); } // Tests that the onbeforeunload and onunload logic is short-circuited if the // old renderer is gone. In that case, we don't want to wait for the old // renderer to run the handlers. // We need to disable this on Mac because the crash causes the OS CrashReporter // process to kick in to analyze the poor dead renderer. Unfortunately, if the // app isn't stripped of debug symbols, this takes about five minutes to // complete and isn't conducive to quick turnarounds. As we don't currently // strip the app on the build bots, this is bad times. // Also disabled on Android (http://crbug.com/506188). #if defined(OS_MACOSX) || defined(OS_ANDROID) #define MAYBE_CrossSiteAfterCrash DISABLED_CrossSiteAfterCrash #else #define MAYBE_CrossSiteAfterCrash CrossSiteAfterCrash #endif IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, MAYBE_CrossSiteAfterCrash) { // Make sure we have a live process before trying to kill it. NavigateToURL(shell(), GURL("about:blank")); // Cause the renderer to crash. RenderProcessHostWatcher crash_observer( shell()->web_contents(), RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); NavigateToURL(shell(), GURL(kChromeUICrashURL)); // Wait for browser to notice the renderer crash. crash_observer.Wait(); // Navigate to a new cross-site page. The browser should not wait around for // the old renderer's on{before}unload handlers to run. CheckTitleTest(GetMockURL("content-sniffer-test0.html"), "Content Sniffer Test 0"); } // Tests that cross-site navigations work when the new page does not go through // the BufferedEventHandler (e.g., non-http{s} URLs). (Bug 1225872) IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CrossSiteNavigationNonBuffered) { // Start with an HTTP page. CheckTitleTest(GetMockURL("content-sniffer-test0.html"), "Content Sniffer Test 0"); // Now load a file:// page, which does not use the BufferedEventHandler. // Make sure that the page loads and displays a title, and doesn't get stuck. GURL url = GetTestUrl("", "title2.html"); CheckTitleTest(url, "Title Of Awesomeness"); } // Flaky everywhere. http://crbug.com/130404 // Tests that a cross-site navigation to an error page (resulting in the link // doctor page) still runs the onunload handler and can support navigations // away from the link doctor page. (Bug 1235537) IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DISABLED_CrossSiteNavigationErrorPage) { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); GURL url(embedded_test_server()->GetURL("/onunload_cookie.html")); CheckTitleTest(url, "set cookie on unload"); // Navigate to a new cross-site URL that results in an error. // TODO(creis): If this causes crashes or hangs, it might be for the same // reason as ErrorPageTest::DNSError. See bug 1199491 and // http://crbug.com/22877. GURL failed_url = net::URLRequestFailedJob::GetMockHttpUrl( net::ERR_NAME_NOT_RESOLVED); NavigateToURL(shell(), failed_url); EXPECT_NE(ASCIIToUTF16("set cookie on unload"), shell()->web_contents()->GetTitle()); // Check that the cookie was set, meaning that the onunload handler ran. EXPECT_EQ("onunloadCookie=foo", GetCookies(url)); // Check that renderer-initiated navigations still work. In a previous bug, // the ResourceDispatcherHost would think that such navigations were // cross-site, because we didn't clean up from the previous request. Since // WebContentsImpl was in the NORMAL state, it would ignore the attempt to run // the onunload handler, and the navigation would fail. We can't test by // redirecting to javascript:window.location='someURL', since javascript: // URLs are prohibited by policy from interacting with sensitive chrome // pages of which the error page is one. Instead, use automation to kick // off the navigation, and wait to see that the tab loads. base::string16 expected_title16(ASCIIToUTF16("Title Of Awesomeness")); TitleWatcher title_watcher(shell()->web_contents(), expected_title16); bool success; GURL test_url(embedded_test_server()->GetURL("/title2.html")); std::string redirect_script = "window.location='" + test_url.possibly_invalid_spec() + "';" + "window.domAutomationController.send(true);"; EXPECT_TRUE(ExecuteScriptAndExtractBool( shell()->web_contents(), redirect_script, &success)); EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); } IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CrossSiteNavigationErrorPage2) { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); GURL url(embedded_test_server()->GetURL("/title2.html")); CheckTitleTest(url, "Title Of Awesomeness"); // Navigate to a new cross-site URL that results in an error. // TODO(creis): If this causes crashes or hangs, it might be for the same // reason as ErrorPageTest::DNSError. See bug 1199491 and // http://crbug.com/22877. GURL failed_url = net::URLRequestFailedJob::GetMockHttpUrl( net::ERR_NAME_NOT_RESOLVED); NavigateToURL(shell(), failed_url); EXPECT_NE(ASCIIToUTF16("Title Of Awesomeness"), shell()->web_contents()->GetTitle()); // Repeat navigation. We are testing that this completes. NavigateToURL(shell(), failed_url); EXPECT_NE(ASCIIToUTF16("Title Of Awesomeness"), shell()->web_contents()->GetTitle()); } IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CrossOriginRedirectBlocked) { // We expect the following URL requests from this test: // 1- http://mock.http/cross-origin-redirect-blocked.html // 2- http://mock.http/redirect-to-title2.html // 3- http://mock.http/title2.html // // If the redirect in #2 were not blocked, we'd also see a request // for http://mock.http:4000/title2.html, and the title would be different. CheckTitleTest(GetMockURL("cross-origin-redirect-blocked.html"), "Title Of More Awesomeness"); } // Tests that ResourceRequestInfoImpl is updated correctly on failed // requests, to prevent calling Read on a request that has already failed. // See bug 40250. IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CrossSiteFailedRequest) { // Visit another URL first to trigger a cross-site navigation. NavigateToURL(shell(), GetTestUrl("", "simple_page.html")); // Visit a URL that fails without calling ResourceDispatcherHost::Read. GURL broken_url("chrome://theme"); NavigateToURL(shell(), broken_url); } namespace { scoped_ptr<net::test_server::HttpResponse> HandleRedirectRequest( const std::string& request_path, const net::test_server::HttpRequest& request) { if (!base::StartsWith(request.relative_url, request_path, base::CompareCase::SENSITIVE)) return scoped_ptr<net::test_server::HttpResponse>(); scoped_ptr<net::test_server::BasicHttpResponse> http_response( new net::test_server::BasicHttpResponse); http_response->set_code(net::HTTP_FOUND); http_response->AddCustomHeader( "Location", request.relative_url.substr(request_path.length())); return http_response.Pass(); } } // namespace // Test that we update the cookie policy URLs correctly when transferring // navigations. IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CookiePolicy) { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); embedded_test_server()->RegisterRequestHandler( base::Bind(&HandleRedirectRequest, "/redirect?")); std::string set_cookie_url(base::StringPrintf( "http://localhost:%u/set_cookie.html", embedded_test_server()->port())); GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url)); ShellContentBrowserClient::SetSwapProcessesForRedirect(true); ShellNetworkDelegate::SetAcceptAllCookies(false); CheckTitleTest(url, "cookie set"); } class PageTransitionResourceDispatcherHostDelegate : public ResourceDispatcherHostDelegate { public: PageTransitionResourceDispatcherHostDelegate(GURL watch_url) : watch_url_(watch_url) {} // ResourceDispatcherHostDelegate implementation: void RequestBeginning(net::URLRequest* request, ResourceContext* resource_context, AppCacheService* appcache_service, ResourceType resource_type, ScopedVector<ResourceThrottle>* throttles) override { if (request->url() == watch_url_) { const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); page_transition_ = info->GetPageTransition(); } } ui::PageTransition page_transition() { return page_transition_; } private: GURL watch_url_; ui::PageTransition page_transition_; }; // Test that ui::PAGE_TRANSITION_CLIENT_REDIRECT is correctly set // when encountering a meta refresh tag. IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, PageTransitionClientRedirect) { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); PageTransitionResourceDispatcherHostDelegate delegate( embedded_test_server()->GetURL("/title1.html")); ResourceDispatcherHost::Get()->SetDelegate(&delegate); NavigateToURLBlockUntilNavigationsComplete( shell(), embedded_test_server()->GetURL("/client_redirect.html"), 2); EXPECT_TRUE( delegate.page_transition() & ui::PAGE_TRANSITION_CLIENT_REDIRECT); } } // namespace content
{ "content_hash": "4a0c4f947449bc6ab05b0c6ac655d65e", "timestamp": "", "source": "github", "line_count": 499, "max_line_length": 80, "avg_line_length": 39.33867735470942, "alnum_prop": 0.7053489556800815, "repo_name": "SaschaMester/delicium", "id": "fdd4b731ad7674a7f81ea011fb6453ee30037e1e", "size": "21174", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "content/browser/loader/resource_dispatcher_host_browsertest.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "23829" }, { "name": "Batchfile", "bytes": "8451" }, { "name": "C", "bytes": "4171711" }, { "name": "C++", "bytes": "243066171" }, { "name": "CSS", "bytes": "935112" }, { "name": "DM", "bytes": "60" }, { "name": "Groff", "bytes": "2494" }, { "name": "HTML", "bytes": "27211018" }, { "name": "Java", "bytes": "14285999" }, { "name": "JavaScript", "bytes": "20413885" }, { "name": "Makefile", "bytes": "23496" }, { "name": "Objective-C", "bytes": "1725804" }, { "name": "Objective-C++", "bytes": "9880229" }, { "name": "PHP", "bytes": "97817" }, { "name": "PLpgSQL", "bytes": "178732" }, { "name": "Perl", "bytes": "63937" }, { "name": "Protocol Buffer", "bytes": "478406" }, { "name": "Python", "bytes": "8261413" }, { "name": "Shell", "bytes": "482077" }, { "name": "Standard ML", "bytes": "5034" }, { "name": "XSLT", "bytes": "418" }, { "name": "nesC", "bytes": "18347" } ], "symlink_target": "" }
import { INC_COUNTER, TEST_DATA } from '../../constants'; export function incCounter() { return { type: INC_COUNTER, }; }
{ "content_hash": "5681ff06e45061440867ae2f984af587", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 57, "avg_line_length": 18.714285714285715, "alnum_prop": 0.6183206106870229, "repo_name": "BhumiSukhadiya/React_Project_Repo", "id": "d7afe61b499ac639bf6d44cae870948c8fe4f5e2", "size": "131", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/client/pages/test_route/Test_route.action.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "16215" }, { "name": "HTML", "bytes": "2945" }, { "name": "JavaScript", "bytes": "75098" } ], "symlink_target": "" }
SYNONYM #### According to Index Fungorum #### Published in null #### Original name Botrytis epichloës Ellis & Dearn., 1893 ### Remarks null
{ "content_hash": "e293aeed7de951fc2edefc58fb2ff6be", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 11, "alnum_prop": 0.6993006993006993, "repo_name": "mdoering/backbone", "id": "75fc2ea4b6be8f34d11143e08db0eac9a37a9210", "size": "217", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Radulidium/Radulidium epichloës/ Syn. Ramichloridium epichloes/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package VMOMI::VirtualMachineFlagInfoMonitorType; use parent 'VMOMI::SimpleType'; use strict; use warnings; 1;
{ "content_hash": "2bcf1bd5199c28fd1b5012b2ffcf5642", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 49, "avg_line_length": 16.142857142857142, "alnum_prop": 0.7964601769911505, "repo_name": "stumpr/p5-vmomi", "id": "2a510047c6b1b4d5f135a40e30ffd9763095d109", "size": "113", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/VMOMI/VirtualMachineFlagInfoMonitorType.pm", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Perl", "bytes": "2084415" } ], "symlink_target": "" }
require_relative '../events' module Soundcloud2000 module Models # stores the tracks displayed in the track controller class Collection include Enumerable attr_reader :events, :rows, :page def initialize(client) @client = client @events = Events.new clear end def [](*args) @rows[*args] end def clear @page = 0 @rows = [] @loaded = false end def each(&block) @rows.each(&block) end def replace(rows) clear @rows = rows events.trigger(:replace) end def append(rows) @rows += rows events.trigger(:append) end end end end
{ "content_hash": "1d9392965d50d7f2b58ee1b3003789c2", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 57, "avg_line_length": 17.38095238095238, "alnum_prop": 0.5287671232876713, "repo_name": "beanieboi/soundcloud2000", "id": "0d61e4f25e69dc06c98e28336d12bddad71c8593", "size": "730", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "lib/soundcloud2000/models/collection.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "33500" }, { "name": "Shell", "bytes": "155" } ], "symlink_target": "" }
package com.canyapan.randompasswordgenerator; import java.io.IOException; /** * Created by Jan on 19.07.2015. */ public class PasswordMeterException extends IOException { PasswordMeterException() { super(); } PasswordMeterException(String message) { super(message); } PasswordMeterException(String message, Throwable cause) { super(message, cause); } }
{ "content_hash": "ff584840734080c832de5428cb79c69a", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 61, "avg_line_length": 18.59090909090909, "alnum_prop": 0.6772616136919315, "repo_name": "canyapan/RandomPasswordGenerator", "id": "db15734fde1d91b222babfac59fff42581d85db2", "size": "1001", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/canyapan/randompasswordgenerator/PasswordMeterException.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "39248" } ], "symlink_target": "" }
using Microsoft.WindowsAzure.MobileServices; using System.Threading.Tasks; using Newtonsoft.Json; using Moq; using Newtonsoft.Json.Linq; using System.Threading; namespace App.Utilities { public class ServiceHelper { private IMobileServiceTable<User> _userTable; //MobileServiceClient client = new MobileServiceClient(@"http://my-website.azurewebsites.net/"); private Mock<IMobileServiceClient> mockClient; private Mock<IMobileServiceTable<User>> mockTable; public ServiceHelper() { mockClient = new Mock<IMobileServiceClient>(MockBehavior.Strict); mockTable = new Mock<IMobileServiceTable<User>>(MockBehavior.Strict); mockTable .Setup(m => m.InsertAsync(It.IsAny<User>())) .Returns(Task.Delay(5000)); mockClient .Setup(m => m.GetTable<User>()) .Returns(mockTable.Object); } public async Task<bool> addUser(string email, string name, string deviceId) { try { _userTable = mockClient.Object.GetTable<User>(); await _userTable.InsertAsync(new User { Email = email, Name = name, DeviceId = deviceId }); return true; } catch { return false; } } } public class User { public string Id { get; set; } public string Email { get; set; } public string Name { get; set; } public string DeviceId { get; set; } } }
{ "content_hash": "2fc2dcd68ff76d29f68f9ab55558852c", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 104, "avg_line_length": 28.52542372881356, "alnum_prop": 0.5454545454545454, "repo_name": "proyecto26/Xamarin", "id": "73d9c4e823bb16780346d9516596d3474e6efaf2", "size": "1683", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/android/App/App/Utilities/Azure.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "62466" } ], "symlink_target": "" }
/*! GitHub: https://github.com/vitto/densifyjs License: MIT Licence Version: 1.0.0 Date: 2014-05-12 Author: Vittorio Vittori Website: http://vittoriovittori.com */ var DensifyJS=function(){var e,t,n;n="data-retina";e=window.devicePixelRatio>1||false;camelCase=function(e){e=e.replace("data-","");return e.toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()})};return{init:function(){if(!e){return}t=document.querySelectorAll("["+n+"]");this.updateElements()},setAttribute:function(e){n=e},updateElements:function(){var e=camelCase(n);for(var r=t.length-1;r>=0;r--){if(t[r].nodeName==="IMG"){t[r].src=t[r].dataset[e]}else{t[r].style.backgroundImage="url("+t[r].dataset[e]+")"}}}}}();document.addEventListener("DOMContentLoaded",function(){DensifyJS.init()})
{ "content_hash": "2b0006c5a5b183f3fcb40a405199ec99", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 607, "avg_line_length": 87.55555555555556, "alnum_prop": 0.700507614213198, "repo_name": "vitto/densifyjs", "id": "1cf4ee8c2a400e3ef3b9d00f6ed7198dca3f1b78", "size": "788", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "densify.min.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "2328" } ], "symlink_target": "" }
module Faker class SingularSiegler class << self extend Gem::Deprecate def quote Faker::Quote.singular_siegler end deprecate :quote, 'Faker::Quote.singular_siegler', 2019, 01 end end end
{ "content_hash": "2284db3ff464bdcdb3fdee636a3222fd", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 65, "avg_line_length": 17.923076923076923, "alnum_prop": 0.6351931330472103, "repo_name": "irfanah/faker", "id": "e95bb42d852bca900c9d97bb62eaf84b2619264d", "size": "264", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/faker/deprecate/singular_siegler.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2276" }, { "name": "HTML", "bytes": "4416" }, { "name": "JavaScript", "bytes": "25082" }, { "name": "Ruby", "bytes": "79372" } ], "symlink_target": "" }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.machinelearningservices.models; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; /** Resource collection API of WorkspaceOperations. */ public interface WorkspaceOperations { /** * Lists all skus with associated features. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of skus with features. */ PagedIterable<WorkspaceSku> listSkus(); /** * Lists all skus with associated features. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of skus with features. */ PagedIterable<WorkspaceSku> listSkus(Context context); }
{ "content_hash": "7468853ee7efb2bfcb7ef62236edab3b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 115, "avg_line_length": 42.645161290322584, "alnum_prop": 0.74357034795764, "repo_name": "Azure/azure-sdk-for-java", "id": "6dbc7ddb14c790b0fa609cfbfee74fa24a206634", "size": "1322", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/machinelearningservices/azure-resourcemanager-machinelearningservices/src/main/java/com/azure/resourcemanager/machinelearningservices/models/WorkspaceOperations.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "8762" }, { "name": "Bicep", "bytes": "15055" }, { "name": "CSS", "bytes": "7676" }, { "name": "Dockerfile", "bytes": "2028" }, { "name": "Groovy", "bytes": "3237482" }, { "name": "HTML", "bytes": "42090" }, { "name": "Java", "bytes": "432409546" }, { "name": "JavaScript", "bytes": "36557" }, { "name": "Jupyter Notebook", "bytes": "95868" }, { "name": "PowerShell", "bytes": "737517" }, { "name": "Python", "bytes": "240542" }, { "name": "Scala", "bytes": "1143898" }, { "name": "Shell", "bytes": "18488" }, { "name": "XSLT", "bytes": "755" } ], "symlink_target": "" }
var child_process = require('child_process'); var util = require('util'); function copy(source, target, callback) { child_process.exec( util.format('cp -r %s %s', source, target), callback ); } copy('./1', './2', function (err) { });
{ "content_hash": "851b6f8d6c2250d26e1ce9b16cb22bd6", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 51, "avg_line_length": 22.666666666666668, "alnum_prop": 0.5588235294117647, "repo_name": "IvanJobs/play", "id": "5c663b7c736a8143052d89cffc45e37063790a39", "size": "272", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "nodejs/cp_child_process.js", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "4036" }, { "name": "C++", "bytes": "5495" }, { "name": "Go", "bytes": "4929" }, { "name": "JavaScript", "bytes": "2622" }, { "name": "Python", "bytes": "75354" }, { "name": "Shell", "bytes": "1164" } ], "symlink_target": "" }
local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0) combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) function onGetFormulaValues(cid, level, maglevel) min = ((level / 5) + (maglevel * 3.2) + 20) max = ((level / 5) + (maglevel * 5.4) + 40) return min, max end combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onCastSpell(creature, var) return combat:execute(creature, var) end
{ "content_hash": "006a1810142997426314e961a54e340c", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 72, "avg_line_length": 33.23529411764706, "alnum_prop": 0.7628318584070797, "repo_name": "victorperin/tibia-server", "id": "829f0380921c950a2545e1f8ca57ae943498a1a1", "size": "565", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "data/spells/scripts/healing/intense healing.lua", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Lua", "bytes": "2465786" } ], "symlink_target": "" }
'use strict'; /* * Confirm Signup page */ mdlDirectTvApp.controller('ConfirmSignupCtrl', ['$scope', '$modal', 'dateFilter', '$http', 'SocialService', '$rootScope', '$sce', 'Sessions', 'Authentication', 'configuration', '$filter', '$window', 'Vindicia', '$location', 'analyticsService', '$cookieStore', '$log', '$routeParams', 'Gigya', 'GoogleTagManagerService', function($scope, $modal, dateFilter, $http, SocialService, $rootScope, $sce, Sessions, Authentication, configuration, $filter, $window, Vindicia, $location, analyticsService, $cookieStore, $log, $routeParams, Gigya, GoogleTagManagerService) { //hide all conatiners jQuery('#menu').hide(); jQuery('#webFooter').hide(); $scope.routePath = $location.path(); var sessionId = $routeParams.session_id; var vindicia_vid = $routeParams.vindicia_vid; var paymentMethodBasedSessionID = !!sessionId ? sessionId : vindicia_vid; var paymentMethod = $routeParams.payment_method; var authID = Sessions.getCookie('auth_id'); var userId = Sessions.getCookie('userid'); var billingAddressPerUser = Sessions.getCookie('billing_address_' + userId); var packageListPerUser = localStorage.getItem('package_list_' + userId); var promocodePerUser = Sessions.getCookie('promocode_' + userId); $rootScope.billingAddress = !!billingAddressPerUser ? JSON.parse(billingAddressPerUser) : ''; $rootScope.packageObjList = !!packageListPerUser ? JSON.parse(packageListPerUser) : ''; var vid; var products = []; var basicPackEnabledForFreeTrial = false; if (!!$rootScope.packageObjList) { angular.forEach($rootScope.packageObjList, function(value, key) { if (!!value.id && value.packageSelection) { if (value.type == "package" && value.is_free_trial_enabled) { if (value.is_free_trial_enabled) { basicPackEnabledForFreeTrial = true; } } products[key] = {}; products[key]["id"] = value.id; products[key]["id_returning_customer"] = value.id_returning_customer; products[key]["is_free_trial_enabled"] = value.is_free_trial_enabled; products[key]["promo_code_id"] = (value.type == "package" && !!promocodePerUser) ? promocodePerUser : value.promo_code_id; products[key]["type"] = value.type; } }); } $scope.openModalForFraudPreventation = function(paymentMethodId, hasUsedFreeTrial) { $scope.opts = { dialogFade: false, keyboard: true, templateUrl: '/views/dialog/fraudPreventationDialog.html', controller: CommonModalICtrl, backdrop: 'static', //to make the backdrop static resolve: {} // empty storage }; $scope.opts.resolve.items = function() { return ({ paymentMethodId: paymentMethodId, hasUsedFreeTrial: hasUsedFreeTrial }); // pass name to Dialog }; var modalInstance = $modal.open($scope.opts); }; $scope.onSignupSuccessTriggerEmailNotificationAndGenerateToken = function() { //send nofication email Gigya.emailNotification().then(function(response) { $log.log("Welcome email send to mail"); }); //set subscription status to true on successful completion of signup Sessions.setCookie('subscriptionStatus', true, Sessions.setExpiryForCookie()); Sessions.setCookie('isAccountCreatedInVindicia', '', -1); $scope.clearSignupCookieDetails(); //opt generation for player $rootScope.generateOptAndSetCookie(true); }; $scope.clearSignupCookieDetails = function() { Sessions.setCookie('auth_id', '', -1); // Sessions.setCookie('package_list_'+userId, '', -1); localStorage.removeItem('package_list_' + userId); Sessions.setCookie('billing_address_' + userId, '', -1); $location.url("/"); }; //5. Confirm the Payment if (!!authID && !!paymentMethodBasedSessionID && (authID == paymentMethodBasedSessionID) && ($scope.routePath == '/signupSuccess')) { //get the product list $rootScope.ajaxConfirmPaymentSpinner = true; $rootScope.$on('authTokenSet', function(event, data) { console.log(data); // 'Data to send' console.log("token in confirm page"); Vindicia.confirmPaymentMethod(paymentMethodBasedSessionID, paymentMethod).then(function(confirmDetails) { var confirmDetailsContent = confirmDetails.responseContent; if (confirmDetails.responseStatus == 200 || confirmDetailsContent.status.http_code == 200) { vid = (paymentMethod == 'CreditCard') ? confirmDetailsContent.payment_method.credit_card.vid : confirmDetailsContent.payment_method.vid; //check if main package is enabled for free trial, if not, don't store vid in gigya if (basicPackEnabledForFreeTrial) { // 6. Query Gigya to see if the VID is already used by another user. if (!!confirmDetailsContent.payment_method && !!confirmDetailsContent.payment_method.vid) { var data = { vid: vid, action: 'searchAccount' }; Gigya.postHandler(data).then(function(userData) { if (userData.errorStatus == 0 && userData.statusCode == 200) { if (userData.totalCount > 0) { $rootScope.ajaxConfirmPaymentSpinner = false; //open fraud preventation modal $scope.openModalForFraudPreventation(confirmDetailsContent.payment_method.id, true); } else { // 7. Create a subscription $rootScope.createSubscription(confirmDetailsContent.payment_method.id, false); } } else { $log.error("No VID found in gigya"); $rootScope.enableErrorAlertMessage('TXT_ISSUE_WITH_API_RESPONSE'); $location.url("/finalCheckout"); } }); } else { $log.error("VID is returned as empty/undefined from Vindicia"); $rootScope.enableErrorAlertMessage('TXT_ISSUE_WITH_API_RESPONSE'); $location.url("/finalCheckout"); } } else { // 7. Create a subscription $rootScope.createSubscription(confirmDetailsContent.payment_method.id, false); } } else { GoogleTagManagerService.push({ event: 'virtualPageView', virtualUrl: "/signupFailure" }); //omniture call analyticsService.TrackCustomPageLoad('signup:failure'); $rootScope.ajaxConfirmPaymentSpinner = false; if (confirmDetails.responseStatus == 500 || typeof confirmDetailsContent == "string") { $rootScope.enableErrorAlertMessage((typeof confirmDetailsContent != 'undefined') ? confirmDetails.responseStatus.toString() : 'TRANSACTION_FAILED_MSG'); } else { $rootScope.enableErrorAlertMessage((typeof confirmDetailsContent.status != 'undefined') ? confirmDetailsContent.status.code.toString() : 'TRANSACTION_FAILED_MSG'); } $location.url("/finalCheckout"); } }); }); } else { $scope.clearSignupCookieDetails(); } $rootScope.createSubscription = function(paymentMethodId, hasUsedFreeTrial) { var subData = { paymentMethod: paymentMethodId, products: JSON.stringify(products), hasUsedFreeTrial: hasUsedFreeTrial }; Vindicia.createSubscription(subData).then(function(subscriptionDetails) { var subscriptionDetailsContent = subscriptionDetails.responseContent; if (subscriptionDetails.responseStatus == 200 || subscriptionDetailsContent.status.http_code == 200) { // Track signup complete GoogleTagManagerService.push({ event: 'virtualPageView', virtualUrl: "/signupSuccessful" }); //omniture call analyticsService.TrackCustomPageLoad('signup:success'); //8. Add the VID to the users Gigya profile if the user used a promo_code and set "has_used_free_trial" to true if (!hasUsedFreeTrial && basicPackEnabledForFreeTrial) { var userData = { UID: userId, vid: vid, type: "setVindiciaId", action: 'setInfo' }; Gigya.postHandler(userData).then(function(response) { if (response.errorStatus == 0 && response.statusCode == 200) { $scope.onSignupSuccessTriggerEmailNotificationAndGenerateToken(); } else { $log.error("Unable to store VID in gigya"); } }); } else { $scope.onSignupSuccessTriggerEmailNotificationAndGenerateToken(); } } else { GoogleTagManagerService.push({ event: 'virtualPageView', virtualUrl: "/signupFailure" }); //omniture call analyticsService.TrackCustomPageLoad('signup:failure'); if (subscriptionDetails.responseStatus == 500 || typeof subscriptionDetailsContent == "string") { $rootScope.enableErrorAlertMessage((typeof subscriptionDetailsContent != 'undefined') ? subscriptionDetails.responseStatus.toString() : 'TRANSACTION_FAILED_MSG'); } else { $rootScope.enableErrorAlertMessage((typeof subscriptionDetailsContent.status != 'undefined') ? subscriptionDetailsContent.status.code.toString() : 'TRANSACTION_FAILED_MSG'); } $location.url("/finalCheckout"); } }); }; } ]);
{ "content_hash": "7b7fdb8c09610568acca327f956b4daf", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 319, "avg_line_length": 60.32124352331606, "alnum_prop": 0.5216457653324171, "repo_name": "sivalal/mediadouble", "id": "59f007c332c6cde1ac582c8843a876d1db0ffc43", "size": "11642", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/scripts/controllers/signup/ConfirmSignup.js", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "26293" }, { "name": "CSS", "bytes": "512531" }, { "name": "HTML", "bytes": "2480601" }, { "name": "JavaScript", "bytes": "1864689" }, { "name": "PHP", "bytes": "942640" }, { "name": "Ruby", "bytes": "299" }, { "name": "Shell", "bytes": "2185" } ], "symlink_target": "" }
import sys import requests import urllib3 from os import listdir from shutil import rmtree urllib3.disable_warnings() def main(): url = "https://api.github.com/repos/{}/ngeo/branches?per_page=100".format(sys.argv[1]) try: json = requests.get(url).json() expected = [ branch["name"] for branch in json ] expected.append("index.html") expected.append(".git") expected.append(".nojekyll") for path in listdir(sys.argv[2]): if path not in expected: print("Remove: {}".format(path)) rmtree("{}/{}".format(sys.argv[2], path)) except Exception as e: print("WARN {} seems unreachable ({}).".format(url, e)) if __name__ == "__main__": main()
{ "content_hash": "308ca445346d8cc06b8029277816ce02", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 90, "avg_line_length": 26.689655172413794, "alnum_prop": 0.5710594315245479, "repo_name": "Geoportail-Luxembourg/geoportailv3", "id": "8ab510c34e27a08125e2ba07195f2cd5c0427f81", "size": "785", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "geoportal/geoportailv3_geoportal/static-ngeo/ngeo/buildtools/cleanup-ghpages.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "432229" }, { "name": "Dockerfile", "bytes": "16989" }, { "name": "EJS", "bytes": "158409" }, { "name": "HTML", "bytes": "441209" }, { "name": "JavaScript", "bytes": "3500634" }, { "name": "Less", "bytes": "165289" }, { "name": "Makefile", "bytes": "26467" }, { "name": "Mako", "bytes": "696" }, { "name": "PLpgSQL", "bytes": "1588593" }, { "name": "Python", "bytes": "619684" }, { "name": "SCSS", "bytes": "1878" }, { "name": "Shell", "bytes": "11608" }, { "name": "TypeScript", "bytes": "7440" } ], "symlink_target": "" }
#include "tensorflow/core/profiler/utils/derived_timeline.h" #include "absl/strings/string_view.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/platform/types.h" #include "tensorflow/core/profiler/protobuf/xplane.pb.h" #include "tensorflow/core/profiler/utils/group_events.h" #include "tensorflow/core/profiler/utils/tf_xplane_visitor.h" #include "tensorflow/core/profiler/utils/trace_utils.h" #include "tensorflow/core/profiler/utils/xplane_builder.h" #include "tensorflow/core/profiler/utils/xplane_schema.h" #include "tensorflow/core/profiler/utils/xplane_test_utils.h" #include "tensorflow/core/profiler/utils/xplane_visitor.h" namespace tensorflow { namespace profiler { namespace { TEST(DerivedTimelineTest, EmptySpaceTest) { XSpace space; GroupMetadataMap group_metadata_map; GenerateDerivedTimeLines(group_metadata_map, &space); EXPECT_EQ(space.planes_size(), 0); } // Checks that HLO module events are expanded. TEST(DerivedTimelineTest, HloModuleNameTest) { const absl::string_view kHloModuleName = "hlo_module"; const absl::string_view kKernelDetails = "kernel_details"; XSpace space; GroupMetadataMap group_metadata_map; XPlane* plane = GetOrCreateGpuXPlane(&space, /*device_ordinal=*/0); XPlaneBuilder plane_builder(plane); auto line_builder = plane_builder.GetOrCreateLine(0); CreateXEvent(&plane_builder, &line_builder, "op1", 0, 100, {{StatType::kHloModule, kHloModuleName}, {StatType::kKernelDetails, kKernelDetails}}); CreateXEvent(&plane_builder, &line_builder, "op2", 200, 300, {{StatType::kHloModule, kHloModuleName}, {StatType::kKernelDetails, kKernelDetails}}); GenerateDerivedTimeLines(group_metadata_map, &space); XPlaneVisitor plane_visitor = CreateTfXPlaneVisitor(plane); // Only the hlo module line is added and other empty lines are removed at the // end. EXPECT_EQ(plane_visitor.NumLines(), 2); plane_visitor.ForEachLine([&](const XLineVisitor& line_visitor) { if (line_visitor.Id() == 0) return; EXPECT_EQ(line_visitor.Id(), kThreadIdHloModule); EXPECT_EQ(line_visitor.NumEvents(), 1); line_visitor.ForEachEvent([&](const XEventVisitor& event_visitor) { EXPECT_EQ(event_visitor.Name(), kHloModuleName); }); }); } // Checks that the TF op events are expanded. TEST(DerivedTimelineTest, TfOpLineTest) { const absl::string_view kTfOpName = "mul:Mul"; const absl::string_view kKernelDetails = "kernel_details"; XSpace space; GroupMetadataMap group_metadata_map; XPlane* plane = GetOrCreateGpuXPlane(&space, /*device_ordinal=*/0); XPlaneBuilder plane_builder(plane); auto line_builder = plane_builder.GetOrCreateLine(0); CreateXEvent(&plane_builder, &line_builder, "op1", 0, 100, {{StatType::kLevel0, kTfOpName}, {StatType::kKernelDetails, kKernelDetails}}); CreateXEvent(&plane_builder, &line_builder, "op2", 200, 300, {{StatType::kLevel0, kTfOpName}, {StatType::kKernelDetails, kKernelDetails}}); GenerateDerivedTimeLines(group_metadata_map, &space); XPlaneVisitor plane_visitor = CreateTfXPlaneVisitor(plane); // Only the tf op line is added and other empty lines are removed at the end. EXPECT_EQ(plane_visitor.NumLines(), 2); plane_visitor.ForEachLine([&](const XLineVisitor& line_visitor) { if (line_visitor.Id() == 0) return; EXPECT_EQ(line_visitor.Id(), kThreadIdTfOp); EXPECT_EQ(line_visitor.NumEvents(), 1); line_visitor.ForEachEvent([&](const XEventVisitor& event_visitor) { EXPECT_EQ(event_visitor.Name(), kTfOpName); EXPECT_EQ(event_visitor.OffsetPs(), 0); EXPECT_EQ(event_visitor.DurationPs(), 500); }); }); } // Checks that the dependency between the step line and the TF op line prevents // TF op events from being expanded. TEST(DerivedTimelineTest, DependencyTest) { constexpr int64 kFirstGroupId = 0; constexpr int64 kSecondGroupId = 1; const absl::string_view kTfOpName = "mul:Mul"; const absl::string_view kKernelDetails = "kernel_details"; XSpace space; GroupMetadataMap group_metadata_map( {{0, {"train 0", ""}}, {1, {"train 1", ""}}}); XPlane* plane = GetOrCreateGpuXPlane(&space, /*device_ordinal=*/0); XPlaneBuilder plane_builder(plane); auto line_builder = plane_builder.GetOrCreateLine(0); CreateXEvent(&plane_builder, &line_builder, "op1", 0, 100, {{StatType::kGroupId, kFirstGroupId}, {StatType::kLevel0, kTfOpName}, {StatType::kKernelDetails, kKernelDetails}}); CreateXEvent(&plane_builder, &line_builder, "op2", 200, 300, {{StatType::kGroupId, kSecondGroupId}, {StatType::kLevel0, kTfOpName}, {StatType::kKernelDetails, kKernelDetails}}); GenerateDerivedTimeLines(group_metadata_map, &space); XPlaneVisitor plane_visitor = CreateTfXPlaneVisitor(plane); // The step line and the TF op line are added. EXPECT_EQ(plane_visitor.NumLines(), 3); plane_visitor.ForEachLine([&](const XLineVisitor& line_visitor) { if (line_visitor.Id() == 0) return; EXPECT_TRUE(line_visitor.Id() == kThreadIdStepInfo || line_visitor.Id() == kThreadIdTfOp); EXPECT_EQ(line_visitor.NumEvents(), 2); }); } // Checks that the TF op events are expanded. TEST(DerivedTimelineTest, TfOpNameScopeTest) { const absl::string_view kTfOpName = "scope1/scope2/mul:Mul"; const absl::string_view kKernelDetails = "kernel_details"; XSpace space; GroupMetadataMap group_metadata_map; XPlane* plane = GetOrCreateGpuXPlane(&space, /*device_ordinal=*/0); XPlaneBuilder plane_builder(plane); auto line_builder = plane_builder.GetOrCreateLine(0); CreateXEvent(&plane_builder, &line_builder, "op1", 0, 100, {{StatType::kLevel0, kTfOpName}, {StatType::kKernelDetails, kKernelDetails}}); CreateXEvent(&plane_builder, &line_builder, "op2", 200, 300, {{StatType::kLevel0, kTfOpName}, {StatType::kKernelDetails, kKernelDetails}}); GenerateDerivedTimeLines(group_metadata_map, &space); XPlaneVisitor plane_visitor = CreateTfXPlaneVisitor(plane); // The TF name scope line and the TF op line are added. EXPECT_EQ(plane_visitor.NumLines(), 3); plane_visitor.ForEachLine([&](const XLineVisitor& line_visitor) { int64 line_id = line_visitor.Id(); if (line_id == 0) { return; } else if (line_id == kThreadIdTfNameScope) { EXPECT_EQ(line_visitor.NumEvents(), 2); line_visitor.ForEachEvent([&](const XEventVisitor& event_visitor) { EXPECT_EQ(event_visitor.OffsetPs(), 0); EXPECT_EQ(event_visitor.DurationPs(), 500); }); } else if (line_id == kThreadIdTfOp) { EXPECT_EQ(line_visitor.NumEvents(), 1); line_visitor.ForEachEvent([&](const XEventVisitor& event_visitor) { EXPECT_EQ(event_visitor.Name(), kTfOpName); EXPECT_EQ(event_visitor.OffsetPs(), 0); EXPECT_EQ(event_visitor.DurationPs(), 500); }); } }); } } // namespace } // namespace profiler } // namespace tensorflow
{ "content_hash": "7cb1090afaa0ecb25084e1cdc8ee1259", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 79, "avg_line_length": 43.163636363636364, "alnum_prop": 0.6926425161471497, "repo_name": "davidzchen/tensorflow", "id": "5952382bd7fcdaec97d3957e41ca4f4543345899", "size": "7790", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "tensorflow/core/profiler/utils/derived_timeline_test.cc", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "32240" }, { "name": "Batchfile", "bytes": "55269" }, { "name": "C", "bytes": "887514" }, { "name": "C#", "bytes": "8562" }, { "name": "C++", "bytes": "81865221" }, { "name": "CMake", "bytes": "6500" }, { "name": "Dockerfile", "bytes": "112853" }, { "name": "Go", "bytes": "1867241" }, { "name": "HTML", "bytes": "4686483" }, { "name": "Java", "bytes": "971474" }, { "name": "Jupyter Notebook", "bytes": "549437" }, { "name": "LLVM", "bytes": "6536" }, { "name": "MLIR", "bytes": "1921657" }, { "name": "Makefile", "bytes": "65901" }, { "name": "Objective-C", "bytes": "116558" }, { "name": "Objective-C++", "bytes": "316967" }, { "name": "PHP", "bytes": "4236" }, { "name": "Pascal", "bytes": "318" }, { "name": "Pawn", "bytes": "19963" }, { "name": "Perl", "bytes": "7536" }, { "name": "Python", "bytes": "37285698" }, { "name": "RobotFramework", "bytes": "1779" }, { "name": "Roff", "bytes": "2705" }, { "name": "Ruby", "bytes": "7464" }, { "name": "SWIG", "bytes": "8992" }, { "name": "Shell", "bytes": "700629" }, { "name": "Smarty", "bytes": "35540" }, { "name": "Starlark", "bytes": "3604653" }, { "name": "Swift", "bytes": "62814" }, { "name": "Vim Snippet", "bytes": "58" } ], "symlink_target": "" }
package com.antonjohansson.elasticsearchshell.domain; /** * Unit tests of {@link IndexMappings}. */ public class MappingTest extends AbstractDomainTest<IndexMappings> { }
{ "content_hash": "4b02079a4cc815b54ddc86713c0e3478", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 66, "avg_line_length": 20.444444444444443, "alnum_prop": 0.7391304347826086, "repo_name": "anton-johansson/elasticsearch-shell", "id": "5a8096110e8e8bb905057212dfdff5a0ee21a07d", "size": "797", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/com/antonjohansson/elasticsearchshell/domain/MappingTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "253937" }, { "name": "JavaScript", "bytes": "2610" }, { "name": "Shell", "bytes": "719" } ], "symlink_target": "" }
package schema import ( "fmt" "sync" "testing" "time" "vitess.io/vitess/go/mysql" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/test/utils" "vitess.io/vitess/go/vt/discovery" querypb "vitess.io/vitess/go/vt/proto/query" topodatapb "vitess.io/vitess/go/vt/proto/topodata" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vtgate/vindexes" "vitess.io/vitess/go/vt/vttablet/sandboxconn" ) func TestTracking(t *testing.T) { target := &querypb.Target{ Keyspace: "ks", Shard: "-80", TabletType: topodatapb.TabletType_MASTER, Cell: "aa", } tablet := &topodatapb.Tablet{ Keyspace: target.Keyspace, Shard: target.Shard, Type: target.TabletType, } fields := sqltypes.MakeTestFields("table_name|col_name|col_type", "varchar|varchar|varchar") type delta struct { result *sqltypes.Result updTbl []string } var ( d0 = delta{ result: sqltypes.MakeTestResult( fields, "prior|id|int", ), updTbl: []string{"prior"}, } d1 = delta{ result: sqltypes.MakeTestResult( fields, "t1|id|int", "t1|name|varchar", "t2|id|varchar", ), updTbl: []string{"t1", "t2"}, } d2 = delta{ result: sqltypes.MakeTestResult( fields, "t2|id|varchar", "t2|name|varchar", "t3|id|datetime", ), updTbl: []string{"prior", "t1", "t2", "t3"}, } d3 = delta{ result: sqltypes.MakeTestResult( fields, "t4|name|varchar", ), updTbl: []string{"t4"}, } ) testcases := []struct { tName string deltas []delta exp map[string][]vindexes.Column }{{ tName: "new tables", deltas: []delta{d0, d1}, exp: map[string][]vindexes.Column{ "t1": { {Name: sqlparser.NewColIdent("id"), Type: querypb.Type_INT32}, {Name: sqlparser.NewColIdent("name"), Type: querypb.Type_VARCHAR}}, "t2": { {Name: sqlparser.NewColIdent("id"), Type: querypb.Type_VARCHAR}}, "prior": { {Name: sqlparser.NewColIdent("id"), Type: querypb.Type_INT32}}, }, }, { tName: "delete t1 and prior, updated t2 and new t3", deltas: []delta{d0, d1, d2}, exp: map[string][]vindexes.Column{ "t2": { {Name: sqlparser.NewColIdent("id"), Type: querypb.Type_VARCHAR}, {Name: sqlparser.NewColIdent("name"), Type: querypb.Type_VARCHAR}}, "t3": { {Name: sqlparser.NewColIdent("id"), Type: querypb.Type_DATETIME}}, }, }, { tName: "new t4", deltas: []delta{d0, d1, d2, d3}, exp: map[string][]vindexes.Column{ "t2": { {Name: sqlparser.NewColIdent("id"), Type: querypb.Type_VARCHAR}, {Name: sqlparser.NewColIdent("name"), Type: querypb.Type_VARCHAR}}, "t3": { {Name: sqlparser.NewColIdent("id"), Type: querypb.Type_DATETIME}}, "t4": { {Name: sqlparser.NewColIdent("name"), Type: querypb.Type_VARCHAR}}, }, }, } for i, tcase := range testcases { t.Run(fmt.Sprintf("%d - %s", i, tcase.tName), func(t *testing.T) { sbc := sandboxconn.NewSandboxConn(tablet) ch := make(chan *discovery.TabletHealth) tracker := NewTracker(ch) tracker.consumeDelay = 1 * time.Millisecond tracker.Start() defer tracker.Stop() results := []*sqltypes.Result{{}} for _, d := range tcase.deltas { for _, deltaRow := range d.result.Rows { same := false for _, row := range results[0].Rows { if row[0].String() == deltaRow[0].String() && row[1].String() == deltaRow[1].String() { same = true break } } if same == false { results[0].Rows = append(results[0].Rows, deltaRow) } } } sbc.SetResults(results) sbc.Queries = nil wg := sync.WaitGroup{} wg.Add(1) tracker.RegisterSignalReceiver(func() { wg.Done() }) for _, d := range tcase.deltas { ch <- &discovery.TabletHealth{ Conn: sbc, Tablet: tablet, Target: target, Serving: true, Stats: &querypb.RealtimeStats{TableSchemaChanged: d.updTbl}, } } require.False(t, waitTimeout(&wg, time.Second), "schema was updated but received no signal") require.Equal(t, 1, len(sbc.StringQueries())) _, keyspacePresent := tracker.tracked[target.Keyspace] require.Equal(t, true, keyspacePresent) for k, v := range tcase.exp { utils.MustMatch(t, v, tracker.GetColumns("ks", k), "mismatch for table: ", k) } }) } } func TestTrackingUnHealthyTablet(t *testing.T) { target := &querypb.Target{ Keyspace: "ks", Shard: "-80", TabletType: topodatapb.TabletType_MASTER, Cell: "aa", } tablet := &topodatapb.Tablet{ Keyspace: target.Keyspace, Shard: target.Shard, Type: target.TabletType, } sbc := sandboxconn.NewSandboxConn(tablet) ch := make(chan *discovery.TabletHealth) tracker := NewTracker(ch) tracker.consumeDelay = 1 * time.Millisecond tracker.Start() defer tracker.Stop() // the test are written in a way that it expects 3 signals to be sent from the tracker to the subscriber. wg := sync.WaitGroup{} wg.Add(3) tracker.RegisterSignalReceiver(func() { wg.Done() }) tcases := []struct { name string serving bool expectedQuery string updatedTbls []string }{ { name: "initial load", serving: true, }, { name: "initial load", serving: true, updatedTbls: []string{"a"}, }, { name: "non serving tablet", serving: false, }, { name: "now serving tablet", serving: true, }, } sbc.SetResults([]*sqltypes.Result{{}, {}, {}}) for _, tcase := range tcases { ch <- &discovery.TabletHealth{ Conn: sbc, Tablet: tablet, Target: target, Serving: tcase.serving, Stats: &querypb.RealtimeStats{TableSchemaChanged: tcase.updatedTbls}, } time.Sleep(5 * time.Millisecond) } require.False(t, waitTimeout(&wg, time.Second), "schema was updated but received no signal") require.Equal(t, []string{mysql.FetchTables, mysql.FetchUpdatedTables, mysql.FetchTables}, sbc.StringQueries()) } func waitTimeout(wg *sync.WaitGroup, timeout time.Duration) bool { c := make(chan struct{}) go func() { defer close(c) wg.Wait() }() select { case <-c: return false // completed normally case <-time.After(timeout): return true // timed out } } func TestTrackerGetKeyspaceUpdateController(t *testing.T) { ks3 := &updateController{} tracker := Tracker{ tracked: map[keyspaceStr]*updateController{ "ks3": ks3, }, } th1 := &discovery.TabletHealth{ Target: &querypb.Target{Keyspace: "ks1"}, } ks1 := tracker.getKeyspaceUpdateController(th1) th2 := &discovery.TabletHealth{ Target: &querypb.Target{Keyspace: "ks2"}, } ks2 := tracker.getKeyspaceUpdateController(th2) th3 := &discovery.TabletHealth{ Target: &querypb.Target{Keyspace: "ks3"}, } assert.NotEqual(t, ks1, ks2, "ks1 and ks2 should not be equal, belongs to different keyspace") assert.Equal(t, ks1, tracker.getKeyspaceUpdateController(th1), "received different updateController") assert.Equal(t, ks2, tracker.getKeyspaceUpdateController(th2), "received different updateController") assert.Equal(t, ks3, tracker.getKeyspaceUpdateController(th3), "received different updateController") assert.NotNil(t, ks1.reloadKeyspace, "ks1 needs to be initialized") assert.NotNil(t, ks2.reloadKeyspace, "ks2 needs to be initialized") assert.Nil(t, ks3.reloadKeyspace, "ks3 already initialized") }
{ "content_hash": "a6ff1f0832bef4fc6f14354f7a650222", "timestamp": "", "source": "github", "line_count": 293, "max_line_length": 112, "avg_line_length": 25.1740614334471, "alnum_prop": 0.6473698481561823, "repo_name": "tinyspeck/vitess", "id": "4504bac689b9874ffe903accea76aced98700f57", "size": "7942", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "go/vt/vtgate/schema/tracker_test.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "198" }, { "name": "CSS", "bytes": "32923" }, { "name": "Dockerfile", "bytes": "27171" }, { "name": "Go", "bytes": "23269197" }, { "name": "HCL", "bytes": "959" }, { "name": "HTML", "bytes": "26248" }, { "name": "Java", "bytes": "993242" }, { "name": "JavaScript", "bytes": "4282862" }, { "name": "Jsonnet", "bytes": "39185" }, { "name": "Makefile", "bytes": "21343" }, { "name": "Python", "bytes": "1955" }, { "name": "SCSS", "bytes": "37608" }, { "name": "Shell", "bytes": "141095" }, { "name": "Smarty", "bytes": "88230" }, { "name": "TypeScript", "bytes": "490937" }, { "name": "Yacc", "bytes": "104478" } ], "symlink_target": "" }
require_relative '../../spec_helper' require 'timeframeable' require 'timecop' describe Timeframeable::Controller do def assert_utc(date) case date when DateTime date.utc?.should be_true when Struct date.start.utc?.should be_true if date.start date.end.utc?.should be_true if date.end else raise "Unknown object: #{date}" end date end it 'has dedicated data structure' do date = Timeframeable::Timeframe.new(1, 2) date.start.should == 1 date.end.should == 2 end describe 'Timeframeable.parse_date' do it 'uses DateTime.parse for strings' do date = DateTime.now.change(:usec => 0) assert_utc(Timeframeable.parse_date(date.to_s)).should == date end it 'suppress exceptions on invalid strings' do Timeframeable.parse_date('trololo').should be_nil end it 'accepts composite param' do assert_utc(Timeframeable.parse_date({:year => 2013, :month => 1, :day => 15})).should == DateTime.new(2013, 1, 15) end it 'accepts incomplete composite param' do assert_utc(Timeframeable.parse_date({:year => 2013, :month => 2})).should == DateTime.new(2013, 2, 1) assert_utc(Timeframeable.parse_date({:month => 3})).should == DateTime.new(Date.today.year, 3, 1) assert_utc(Timeframeable.parse_date({})).should == DateTime.new(Date.today.year, 1, 1) end it 'extrapolates range to its end' do assert_utc(Timeframeable.parse_date({:year => 2013, :month => 1, :day => 15}, :end)).should == DateTime.new(2013, 1, 15).end_of_day assert_utc(Timeframeable.parse_date({:year => 2013, :month => 1}, :end)).should == DateTime.new(2013, 1, 1).end_of_month.end_of_day end end context 'controller' do let(:controller) { Class.new.new } let(:default_options) { { :start_key => :start, :end_key => :end, :variable => :timeframe, :defaults => [DateTime.now.beginning_of_month, DateTime.now] } } before do controller.class.class_eval do include Timeframeable::Controller end mock(controller.class).before_filter().at_least(1) {|block| controller.instance_eval(&block) } end describe 'Controller.timeframeable' do it 'timeframes without options' do default_options[:defaults] = [] mock(controller).set_timeframe(default_options) controller.class.timeframeable end it 'timeframes with default options' do options_given = {:defaults => default_options[:defaults]} options_got = default_options mock(controller).set_timeframe(options_got) controller.class.timeframeable(options_given) end it 'timeframes with symbol options' do Timecop.freeze(DateTime.now) do options_given = {:defaults => [:beginning_of_month, :now]} options_got = default_options.merge(:defaults => [DateTime.now.beginning_of_month, DateTime.now]) mock(controller).set_timeframe(options_got) controller.class.timeframeable(options_given) end end it 'timeframes with custom options' do Timecop.freeze(DateTime.now) do options_given = {:defaults => [:beginning_of_month, :now], :start_key => :s, :end_key => :e, :variable => :'@tf'} options_got = default_options.merge(options_given).merge(:defaults => [DateTime.now.beginning_of_month, DateTime.now]) mock(controller).set_timeframe(options_got) controller.class.timeframeable(options_given) end end end describe 'Controller#set_timeframe' do it 'falls back to nils' do stub(controller).params{ {} } default_options[:defaults] = [] controller.class.timeframeable default_options assert_utc(controller.instance_variable_get(:"@#{default_options[:variable]}")).should == Timeframeable::Timeframe.new(nil, nil) end it 'falls back to default values' do stub(controller).params{ {} } controller.class.timeframeable default_options assert_utc(controller.instance_variable_get(:"@#{default_options[:variable]}")).should == Timeframeable::Timeframe.new(*default_options[:defaults]) end it 'uses actual params' do dates = default_options[:defaults].map{|d| d.prev_month.utc.change(:usec => 0) } stub(controller).params{ Hash[[:start, :end].zip(dates.map(&:to_s))] } controller.class.timeframeable default_options assert_utc(controller.instance_variable_get(:"@#{default_options[:variable]}")).should == Timeframeable::Timeframe.new(*dates) end it 'allows multiple timeframes to be set' do stub(controller).params{ {} } other_options = default_options.merge(:variable => :test, :defaults => default_options[:defaults].map(&:prev_month)) controller.class.timeframeable default_options controller.class.timeframeable other_options assert_utc(controller.instance_variable_get(:"@#{default_options[:variable]}")).should == Timeframeable::Timeframe.new(*default_options[:defaults]) assert_utc(controller.instance_variable_get(:"@#{other_options[:variable]}")).should == Timeframeable::Timeframe.new(*other_options[:defaults]) end end end end
{ "content_hash": "d9c85c19ebc7f45b858562bde352c9db", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 128, "avg_line_length": 36.816326530612244, "alnum_prop": 0.6374722838137472, "repo_name": "AlexanderPavlenko/timeframeable", "id": "fbd02826fbd307e7c9c6e28a4d44a0f1ab6cdf74", "size": "5412", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/lib/timeframeable/controller_spec.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "10892" } ], "symlink_target": "" }
[matz]: http://www.rubyist.net/~matz/ [RoR]: http://www.rubyonrails.org [octopress]: http://octopress.org [compass]: http://compass-style.org [pygments]: http://pygments.org/ [pygments.rb]: http://rubygems.org/gems/pygments.rb # Github [chikamichi/ruby-lang.org]: http://github.com/chikamichi/ruby-lang.org [jekyll]: http://github.com/mojombo/jekyll [thor]: https://github.com/wycats/thor/wiki # Internal links [mailing lists]: /en/community/mailing-lists/ [listes de diffusion]: /fr/community/mailing-lists/ [license]: /license.txt # Misc. refs [1]: http://www.linuxdevcenter.com/pub/a/linux/2001/11/29/ruby.html [2]: http://www.artima.com/intv/closures2.html
{ "content_hash": "2f8d4e06419706ba4bc2613c72401f1c", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 70, "avg_line_length": 33.25, "alnum_prop": 0.7278195488721805, "repo_name": "rstacruz/ruby-lang.org", "id": "8683bfd6ecb377d58253883a074073aea8fddc4a", "size": "682", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "config/shared_links.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "69083" }, { "name": "Ruby", "bytes": "42180" }, { "name": "Shell", "bytes": "645" } ], "symlink_target": "" }
package com.c2c.learnopedia.model; public class ImageItem { }
{ "content_hash": "ee710d7c39549b68302266586d72700f", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 34, "avg_line_length": 10.833333333333334, "alnum_prop": 0.7538461538461538, "repo_name": "vidhyadhari1989/Learnopedia-C2C", "id": "326a7a00b74097a3e777a8118494c45d501c84e8", "size": "65", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/c2c/learnopedia/model/ImageItem.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "92247" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/action_add_cat" android:icon="@drawable/ic_add" android:title="Add Category" app:showAsAction="always" /> </menu>
{ "content_hash": "e25e248f4924cb865299ce8a4dddc8ee", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 64, "avg_line_length": 37, "alnum_prop": 0.6366366366366366, "repo_name": "alewin/moneytracking", "id": "7f58f5865f4eba383c59a8c50926ca48518e67c2", "size": "333", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SRC/app/src/main/res/menu/menu_category_add.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "154755" } ], "symlink_target": "" }
package org.apache.geode.cache.query.internal; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.util.Collection; import java.util.Iterator; import org.apache.geode.cache.query.SelectResults; import org.apache.geode.cache.query.internal.ObjectIntHashMap.Entry; import org.apache.geode.cache.query.types.ObjectType; import org.apache.geode.internal.cache.CachePerfStats; import org.apache.geode.internal.serialization.DataSerializableFixedID; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; import org.apache.geode.internal.serialization.Version; public class ResultsBag extends Bag implements DataSerializableFixedID { protected ObjectIntHashMap map; public ResultsBag() { this.map = new ObjectIntHashMap(); } /** * This constructor should only be used by the DataSerializer. Creates a ResultsBag with no * fields. */ public ResultsBag(boolean ignored) { super(ignored); } /** * @param stats the CachePerfStats to track hash collisions. Should be null unless this is used as * a query execution-time result set. */ public ResultsBag(CachePerfStats stats) { super(stats); this.map = new ObjectIntHashMap(); } protected ResultsBag(HashingStrategy strategy, CachePerfStats stats) { super(stats); this.map = new ObjectIntHashMap(strategy); } /** * @param stats the CachePerfStats to track hash collisions. Should be null unless this is used as * a query execution-time result set. */ ResultsBag(Collection c, CachePerfStats stats) { this(stats); for (Iterator itr = c.iterator(); itr.hasNext();) { this.add(itr.next()); } } protected ResultsBag(Collection c, HashingStrategy strategy, CachePerfStats stats) { this(strategy, stats); for (Iterator itr = c.iterator(); itr.hasNext();) { this.add(itr.next()); } } /** * @param stats the CachePerfStats to track hash collisions. Should be null unless this is used as * a query execution-time result set. */ ResultsBag(SelectResults sr, CachePerfStats stats) { this((Collection) sr, stats); // grab type info setElementType(sr.getCollectionType().getElementType()); } /** * @param stats the CachePerfStats to track hash collisions. Should be null unless this is used as * a query execution-time result set. */ ResultsBag(ObjectType elementType, CachePerfStats stats) { this(stats); setElementType(elementType); } /** * @param stats the CachePerfStats to track hash collisions. Should be null unless this is used as * a query execution-time result set. */ ResultsBag(ObjectType elementType, int initialCapacity, CachePerfStats stats) { this(initialCapacity, stats); setElementType(elementType); } /** * @param stats the CachePerfStats to track hash collisions. Should be null unless this is used as * a query execution-time result set. */ ResultsBag(int initialCapacity, float loadFactor, CachePerfStats stats) { this.map = new ObjectIntHashMap(initialCapacity, loadFactor); } protected ResultsBag(int initialCapacity, float loadFactor, HashingStrategy strategy, CachePerfStats stats) { super(stats); this.map = new ObjectIntHashMap(initialCapacity, loadFactor, strategy); } ResultsBag(int initialCapacity, CachePerfStats stats) { super(stats); this.map = new ObjectIntHashMap(initialCapacity); } protected ResultsBag(int initialCapacity, HashingStrategy strategy, CachePerfStats stats) { super(stats); this.map = new ObjectIntHashMap(initialCapacity, strategy); } protected ObjectIntHashMap createMapForFromData() { return new ObjectIntHashMap(this.size); } @Override public void fromData(DataInput in, DeserializationContext context) throws IOException, ClassNotFoundException { this.elementType = (ObjectType) context.getDeserializer().readObject(in); this.size = in.readInt(); assert this.size >= 0 : this.size; this.map = createMapForFromData(); this.readNumNulls(in); // Asif: The size will be including null so the Map should at max contain // size - number of nulls int numLeft = this.size - this.numNulls; while (numLeft > 0) { Object key = context.getDeserializer().readObject(in); int occurrence = in.readInt(); this.map.put(key, occurrence); numLeft -= occurrence; } } @Override public int getDSFID() { return RESULTS_BAG; } @Override public void toData(DataOutput out, SerializationContext context) throws IOException { context.getSerializer().writeObject(this.elementType, out); out.writeInt(this.size()); this.writeNumNulls(out); // TODO:Asif: Should we actually pass the limit in serialization? // For the time being not passing , assuming PR Has parsed // it // out.writeInt(this.limit); int numLeft = this.size() - this.numNulls; for (Iterator<Entry> itr = this.map.entrySet().iterator(); itr.hasNext() && numLeft > 0;) { Entry entry = itr.next(); Object key = entry.getKey(); context.getSerializer().writeObject(key, out); int occurrence = entry.getValue(); if (numLeft < occurrence) { occurrence = numLeft; } out.writeInt(occurrence); numLeft -= occurrence; } } void createIntHashMap() { this.map = new ObjectIntHashMap(this.size - this.numNulls); } @Override public boolean isModifiable() { return true; } @Override public Version[] getSerializationVersions() { return null; } @Override protected int mapGet(Object element) { return this.map.get(element); } @Override protected boolean mapContainsKey(Object element) { return this.map.containsKey(element); } @Override protected void mapPut(Object element, int count) { this.map.put(element, count); } @Override protected int mapSize() { return this.map.size(); } @Override protected int mapRemove(Object element) { return this.map.remove(element); } @Override protected void mapClear() { this.map.clear(); } @Override protected Object getMap() { return this.map; } @Override protected int mapHashCode() { return this.map.hashCode(); } @Override protected boolean mapEmpty() { return this.map.isEmpty(); } @Override protected Iterator mapEntryIterator() { return this.map.entrySet().iterator(); } @Override protected Iterator mapKeyIterator() { return this.map.keySet().iterator(); } @Override protected Object keyFromEntry(Object entry) { return ((Entry) entry).getKey(); } @Override protected Integer valueFromEntry(Object entry) { return ((Entry) entry).getValue(); } }
{ "content_hash": "984c668376fd7ba82edf5676d0ac6fc9", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 100, "avg_line_length": 27.12549019607843, "alnum_prop": 0.6955327454098598, "repo_name": "davebarnes97/geode", "id": "a529ec6a0217dede5b38be673623757d4df4b3a3", "size": "7706", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "geode-core/src/main/java/org/apache/geode/cache/query/internal/ResultsBag.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "106708" }, { "name": "Dockerfile", "bytes": "17835" }, { "name": "Go", "bytes": "1205" }, { "name": "Groovy", "bytes": "38590" }, { "name": "HTML", "bytes": "3855237" }, { "name": "Java", "bytes": "31895961" }, { "name": "JavaScript", "bytes": "1781602" }, { "name": "Python", "bytes": "30033" }, { "name": "Ruby", "bytes": "6698" }, { "name": "Shell", "bytes": "190751" } ], "symlink_target": "" }
package org.springframework.cloud.zookeeper.discovery.watcher.presence; /** * By default passes logging dependency checker in order not to shutdown the application * if dependency is missing * * @author Marcin Grzejszczak * @version 1.0.0 * * @see LogMissingDependencyChecker */ public class DefaultDependencyPresenceOnStartupVerifier extends DependencyPresenceOnStartupVerifier { public DefaultDependencyPresenceOnStartupVerifier() { super(new LogMissingDependencyChecker()); } }
{ "content_hash": "38bfce1ea91dc47c365c348480c009f6", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 101, "avg_line_length": 29.11764705882353, "alnum_prop": 0.804040404040404, "repo_name": "4finance/spring-cloud-zookeeper", "id": "5b825ae2c98ecda7b78a12807756d0c433426c4c", "size": "1115", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spring-cloud-zookeeper-discovery/src/main/java/org/springframework/cloud/zookeeper/discovery/watcher/presence/DefaultDependencyPresenceOnStartupVerifier.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5150" }, { "name": "Groovy", "bytes": "45887" }, { "name": "Java", "bytes": "152226" }, { "name": "Shell", "bytes": "7932" } ], "symlink_target": "" }
layout: post title: I'd Like My Drums to Sound Like This, Please excerpt: modified: categories: articles tags: [Recording, Music] image: feature: credit: creditlink: comments: true share: true --- mewithoutYou has a new album out and I'm in love with the way it sounds, especially the drums. This is how I'd like my drums to sound on recordings. <iframe width="560" height="315" src="https://www.youtube.com/embed/YR_rUgbRVJM" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
{ "content_hash": "6b313beeff2793f2e65c25a3d4c98d33", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 156, "avg_line_length": 30.176470588235293, "alnum_prop": 0.746588693957115, "repo_name": "aarondowd/aarondowd.github.com", "id": "46745b6d239b1a71595fe5713f82e14950e88be9", "size": "517", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_posts/articles/2018-08-08-i-would-like-drums-that-sound-like-this.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "45472" }, { "name": "HTML", "bytes": "20440" }, { "name": "JavaScript", "bytes": "77062" }, { "name": "Ruby", "bytes": "2349" } ], "symlink_target": "" }
namespace EZOper.NetSiteUtilities.Jayrock { #region Imports using System; using System.Diagnostics; using System.Globalization; using System.IO; using System.Text; #endregion internal sealed class BufferedCharReader { private TextReader _reader; private char[] _buffer; private int _index; private int _end; private bool _backed; private char _backup; private int _bufferSize; public const char EOF = (char) 0; public BufferedCharReader(TextReader reader) : this(reader, 0) {} public BufferedCharReader(TextReader reader, int bufferSize) { Debug.Assert(reader != null); _reader = reader; _bufferSize = Math.Max(256, bufferSize); } /// <summary> /// Back up one character. This provides a sort of lookahead capability, /// so that one can test for a digit or letter before attempting to, /// for example, parse the next number or identifier. /// </summary> /// <remarks> /// This implementation currently does not support backing up more /// than a single character (the last read). /// </remarks> public void Back() { Debug.Assert(!_backed); if (_index > 0) { _backup = _buffer[_index - 1]; _backed = true; } } /// <summary> /// Determine if the source string still contains characters that Next() /// can consume. /// </summary> /// <returns>true if not yet at the end of the source.</returns> public bool More() { if (_index == _end) { if (_buffer == null) _buffer = new char[_bufferSize]; _index = 0; _end = _reader.Read(_buffer, 0, _buffer.Length); if (_end == 0) return false; } return true; } /// <summary> /// Get the next character in the source string. /// </summary> /// <returns>The next character, or 0 if past the end of the source string.</returns> public char Next() { if (_backed) { _backed = false; return _backup; } if (!More()) return EOF; char ch = _buffer[_index++]; return ch; } } }
{ "content_hash": "f5685f089a2c936cdb34876d0eb5c318", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 93, "avg_line_length": 26.84, "alnum_prop": 0.47242921013412814, "repo_name": "erikzhouxin/CSharpSolution", "id": "5c90f62f9e456db1fcf2131e0aefb710a68410fd", "size": "3647", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "NetSiteUtilities/Jayrock/Json/Json/BufferedCharReader.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "153832" }, { "name": "Batchfile", "bytes": "104" }, { "name": "C#", "bytes": "16507100" }, { "name": "CSS", "bytes": "1339701" }, { "name": "HTML", "bytes": "25059213" }, { "name": "Java", "bytes": "10698" }, { "name": "JavaScript", "bytes": "53532704" }, { "name": "PHP", "bytes": "48348" }, { "name": "PLSQL", "bytes": "8976" }, { "name": "PowerShell", "bytes": "471" }, { "name": "Ruby", "bytes": "1030" } ], "symlink_target": "" }
>An interactive warding and support reference for DOTA 2 ### Mockup 1 ![Sentrii Mockup 1](./wireframes/mockup_5.png "Sentrii Mockup") ### Mockup 2 ![Sentrii Mockup 2](./wireframes/mockup_4.png "Sentrii Mockup") ### Mockup 3 ![Sentrii Mockup 3](./wireframes/mockup_3.png "Sentrii Mockup") ### Install `npm install` ### Build Needs `gulp` and `gulp-cli` installed globally via `npm` to run Gulp directly from the command line. ##### gulp (default) Executes `gulp dev` and starts `gulp-livereload`. ##### gulp dev Bundles `/src` into `/dev`. ##### gulp prod Bundles `/src` into `/prod`.
{ "content_hash": "0078c632c88d152799fb89b8b2c569db", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 100, "avg_line_length": 23.68, "alnum_prop": 0.6875, "repo_name": "kusera/sentrii", "id": "45577b674b56c305b57e61914bfeae8a448a6182", "size": "602", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "6068" }, { "name": "HTML", "bytes": "558" }, { "name": "JavaScript", "bytes": "42825" } ], "symlink_target": "" }
package com.singhajit.rubygems.recent.view; import android.databinding.DataBindingUtil; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.singhajit.rubygems.R; import com.singhajit.rubygems.core.APIClient; import com.singhajit.rubygems.core.ErrorHandler; import com.singhajit.rubygems.databinding.TrendingBinding; import com.singhajit.rubygems.gemlist.GemListRenderer; import com.singhajit.rubygems.newgems.presenter.GemsPresenter; import com.singhajit.rubygems.recent.model.Gem; import com.singhajit.rubygems.recent.presenter.RecentlyUpdatedGemsPresenter; import java.util.ArrayList; public class RecentlyUpdatedGemsFragment extends Fragment implements GemsView { public static final String GEM_LIST = "GEM_LIST"; private TrendingBinding binding; private ArrayList<Gem> gems = new ArrayList<>(); private GemsPresenter presenter; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { binding = DataBindingUtil.inflate(inflater, R.layout.trending_fragment, container, false); presenter = new RecentlyUpdatedGemsPresenter((APIClient) getActivity(), this); binding.setPresenter(presenter); if (savedInstanceState != null) { render(savedInstanceState.<Gem>getParcelableArrayList(GEM_LIST)); } else { presenter.render(); } return binding.getRoot(); } @Override public void onResume() { super.onResume(); if (gems.isEmpty()) { presenter.render(); } } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putParcelableArrayList(GEM_LIST, gems); } @Override public void render(ArrayList<Gem> gems) { boolean isRefresh = !this.gems.isEmpty(); this.gems = gems; GemListRenderer gemListRenderer = new GemListRenderer(this.gems, binding.recentlyUpdatedGemsList); gemListRenderer.render(isRefresh); binding.refreshLayout.setRefreshing(false); } @Override public void showPullToRefreshLoader() { binding.refreshLayout.setRefreshing(true); } @Override public void showLoader() { binding.progressBar.setVisibility(View.VISIBLE); } @Override public void hideLoader() { binding.progressBar.setVisibility(View.GONE); } @Override public void notify(String message) { binding.refreshLayout.setRefreshing(false); ErrorHandler.showSnackBar(binding.getRoot(), message, new View.OnClickListener() { @Override public void onClick(View view) { presenter.render(); } }); } }
{ "content_hash": "9646d269b17d12efa487913eacebd0a8", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 121, "avg_line_length": 29.98913043478261, "alnum_prop": 0.7531714389271476, "repo_name": "ajitsing/RubyGemsAndroidApp", "id": "17a17a5bc38833f4d338b8457e5ee90638322154", "size": "2759", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/singhajit/rubygems/recent/view/RecentlyUpdatedGemsFragment.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "99952" } ], "symlink_target": "" }
package org.apache.hyracks.storage.am.lsm.invertedindex.search; import java.io.IOException; import java.util.List; import org.apache.hyracks.api.context.IHyracksTaskContext; import org.apache.hyracks.api.exceptions.ErrorCode; import org.apache.hyracks.api.exceptions.HyracksDataException; import org.apache.hyracks.data.std.primitive.ShortPointable; import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder; import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleReference; import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference; import org.apache.hyracks.storage.am.common.api.IIndexOperationContext; import org.apache.hyracks.storage.am.common.tuples.ConcatenatingTupleReference; import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInPlaceInvertedIndex; import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexSearchModifier; import org.apache.hyracks.storage.am.lsm.invertedindex.api.IPartitionedInvertedIndex; import org.apache.hyracks.storage.am.lsm.invertedindex.api.InvertedListCursor; import org.apache.hyracks.storage.common.IIndexCursor; /** * Conducts T-Occurrence searches on inverted lists in one or more partition. */ public class PartitionedTOccurrenceSearcher extends AbstractTOccurrenceSearcher { protected final ArrayTupleBuilder lowerBoundTupleBuilder = new ArrayTupleBuilder(1); protected final ArrayTupleReference lowerBoundTuple = new ArrayTupleReference(); protected final ArrayTupleBuilder upperBoundTupleBuilder = new ArrayTupleBuilder(1); protected final ArrayTupleReference upperBoundTuple = new ArrayTupleReference(); protected final ConcatenatingTupleReference fullLowSearchKey = new ConcatenatingTupleReference(2); protected final ConcatenatingTupleReference fullHighSearchKey = new ConcatenatingTupleReference(2); protected final InvertedListPartitions partitions = new InvertedListPartitions(); // To keep the current state of this search protected int curPartIdx; protected int endPartIdx; protected int numPrefixLists; protected boolean isFinalPartIdx; protected boolean needToReadNewPart; List<InvertedListCursor>[] partitionCursors; IInvertedIndexSearchModifier searchModifier; public PartitionedTOccurrenceSearcher(IInPlaceInvertedIndex invIndex, IHyracksTaskContext ctx) throws HyracksDataException { super(invIndex, ctx); initHelperTuples(); curPartIdx = 0; endPartIdx = 0; isFinalPartIdx = false; isFinishedSearch = false; needToReadNewPart = true; } private void initHelperTuples() { try { lowerBoundTupleBuilder.reset(); // Write dummy value. lowerBoundTupleBuilder.getDataOutput().writeShort(Short.MIN_VALUE); lowerBoundTupleBuilder.addFieldEndOffset(); lowerBoundTuple.reset(lowerBoundTupleBuilder.getFieldEndOffsets(), lowerBoundTupleBuilder.getByteArray()); // Only needed for setting the number of fields in searchKey. searchKey.reset(queryTokenAppender, 0); fullLowSearchKey.reset(); fullLowSearchKey.addTuple(searchKey); fullLowSearchKey.addTuple(lowerBoundTuple); upperBoundTupleBuilder.reset(); // Write dummy value. upperBoundTupleBuilder.getDataOutput().writeShort(Short.MAX_VALUE); upperBoundTupleBuilder.addFieldEndOffset(); upperBoundTuple.reset(upperBoundTupleBuilder.getFieldEndOffsets(), upperBoundTupleBuilder.getByteArray()); // Only needed for setting the number of fields in searchKey. searchKey.reset(queryTokenAppender, 0); fullHighSearchKey.reset(); fullHighSearchKey.addTuple(searchKey); fullHighSearchKey.addTuple(upperBoundTuple); } catch (IOException e) { throw new IllegalStateException(e); } } @Override public void search(IIndexCursor resultCursor, InvertedIndexSearchPredicate searchPred, IIndexOperationContext ictx) throws HyracksDataException { prepareSearch(); IPartitionedInvertedIndex partInvIndex = (IPartitionedInvertedIndex) invIndex; finalSearchResult.reset(); if (partInvIndex.isEmpty()) { isFinishedSearch = true; resultCursor.open(null, searchPred); return; } tokenizeQuery(searchPred); short numQueryTokens = (short) queryTokenAppender.getTupleCount(); searchModifier = searchPred.getSearchModifier(); short numTokensLowerBound = searchModifier.getNumTokensLowerBound(numQueryTokens); short numTokensUpperBound = searchModifier.getNumTokensUpperBound(numQueryTokens); occurrenceThreshold = searchModifier.getOccurrenceThreshold(numQueryTokens); if (occurrenceThreshold <= 0) { throw HyracksDataException.create(ErrorCode.OCCURRENCE_THRESHOLD_PANIC_EXCEPTION); } short maxCountPossible = numQueryTokens; invListCursorCache.reset(); partitions.reset(numTokensLowerBound, numTokensUpperBound); for (int i = 0; i < numQueryTokens; i++) { searchKey.reset(queryTokenAppender, i); if (!partInvIndex.openInvertedListPartitionCursors(this, ictx, numTokensLowerBound, numTokensUpperBound, partitions)) { maxCountPossible--; // No results possible. if (maxCountPossible < occurrenceThreshold) { // Closes all opened cursors. closeCursorsInPartitions(partitions); isFinishedSearch = true; resultCursor.open(null, searchPred); return; } } } partitionCursors = partitions.getPartitions(); short start = partitions.getMinValidPartitionIndex(); short end = partitions.getMaxValidPartitionIndex(); // Process the partitions one-by-one. endPartIdx = end; for (int i = start; i <= end; i++) { // Prune partition because no element in it can satisfy the occurrence threshold. if (partitionCursors[i] == null) { continue; } // Prune partition because no element in it can satisfy the occurrence threshold. // An opened cursor should be closed. if (partitionCursors[i].size() < occurrenceThreshold) { for (InvertedListCursor cursor : partitionCursors[i]) { cursor.close(); } continue; } // Merge inverted lists of current partition. numPrefixLists = searchModifier.getNumPrefixLists(occurrenceThreshold, partitionCursors[i].size()); invListMerger.reset(); curPartIdx = i; isFinalPartIdx = i == end ? true : false; // If the number of inverted list cursor is one, then we don't need to go through the merge process // for this partition. if (partitionCursors[i].size() == 1) { singleInvListCursor = partitionCursors[i].get(0); singleInvListCursor.prepareLoadPages(); singleInvListCursor.loadPages(); isSingleInvertedList = true; needToReadNewPart = true; } else { singleInvListCursor = null; isSingleInvertedList = false; needToReadNewPart = invListMerger.merge(partitionCursors[i], occurrenceThreshold, numPrefixLists, finalSearchResult); searchResultBuffer = finalSearchResult.getNextFrame(); searchResultTupleIndex = 0; searchResultFta.reset(searchResultBuffer); } // By now, some output was generated by the merger or only one cursor in this partition is associated. // So, we open the cursor that will fetch these result. If it's the final partition, the outside of // this for loop will handle opening of the result cursor for a single inverted list cursor case. if (needToReadNewPart && isFinalPartIdx) { invListMerger.close(); finalSearchResult.finalizeWrite(); isFinishedSearch = true; } resultCursor.open(null, searchPred); return; } // The control reaches here if the above loop doesn't have any valid cursor. isFinishedSearch = true; needToReadNewPart = true; resultCursor.open(null, searchPred); return; } /** * Continues a search process in case of the following two cases: * #1. If it was paused because the output buffer of the final result was full. * #2. All tuples from a single inverted list has been read. * * @return true only if all processing for the final list for the final partition is done. * false otherwise. * @throws HyracksDataException */ @Override public boolean continueSearch() throws HyracksDataException { if (isFinishedSearch) { return true; } // Case #1 only - output buffer was full if (!needToReadNewPart) { needToReadNewPart = invListMerger.continueMerge(); searchResultBuffer = finalSearchResult.getNextFrame(); searchResultTupleIndex = 0; searchResultFta.reset(searchResultBuffer); // Final calculation done? if (needToReadNewPart && isFinalPartIdx) { isFinishedSearch = true; invListMerger.close(); finalSearchResult.finalizeWrite(); return true; } return false; } // Finished one partition for the both cases #1 and #2. So, moves to the next partition. curPartIdx++; if (curPartIdx <= endPartIdx) { boolean suitablePartFound = false; for (int i = curPartIdx; i <= endPartIdx; i++) { // Prune partition because no element in it can satisfy the occurrence threshold. if (partitionCursors[i] == null) { continue; } // Prune partition because no element in it can satisfy the occurrence threshold. // An opened cursor should be closed. if (partitionCursors[i].size() < occurrenceThreshold) { for (InvertedListCursor cursor : partitionCursors[i]) { cursor.close(); } continue; } suitablePartFound = true; curPartIdx = i; break; } // If no partition is availble to explore, we stop here. if (!suitablePartFound) { isFinishedSearch = true; invListMerger.close(); finalSearchResult.finalizeWrite(); return true; } // Merge inverted lists of current partition. numPrefixLists = searchModifier.getNumPrefixLists(occurrenceThreshold, partitionCursors[curPartIdx].size()); invListMerger.reset(); finalSearchResult.resetBuffer(); isFinalPartIdx = curPartIdx == endPartIdx ? true : false; // If the number of inverted list cursor is one, then we don't need to go through the merge process. if (partitionCursors[curPartIdx].size() == 1) { singleInvListCursor = partitionCursors[curPartIdx].get(0); singleInvListCursor.prepareLoadPages(); singleInvListCursor.loadPages(); isSingleInvertedList = true; needToReadNewPart = true; } else { singleInvListCursor = null; isSingleInvertedList = false; needToReadNewPart = invListMerger.merge(partitionCursors[curPartIdx], occurrenceThreshold, numPrefixLists, finalSearchResult); searchResultBuffer = finalSearchResult.getNextFrame(); searchResultTupleIndex = 0; searchResultFta.reset(searchResultBuffer); } // Finished processing one partition if (needToReadNewPart && isFinalPartIdx) { invListMerger.close(); finalSearchResult.finalizeWrite(); isFinishedSearch = true; return true; } } else { isFinishedSearch = true; } return false; } private void closeCursorsInPartitions(InvertedListPartitions parts) throws HyracksDataException { List<InvertedListCursor>[] partCursors = parts.getPartitions(); short start = parts.getMinValidPartitionIndex(); short end = parts.getMaxValidPartitionIndex(); for (int i = start; i <= end; i++) { if (partCursors[i] == null) { continue; } for (InvertedListCursor cursor : partCursors[i]) { cursor.close(); } } } public void setNumTokensBoundsInSearchKeys(short numTokensLowerBound, short numTokensUpperBound) { ShortPointable.setShort(lowerBoundTuple.getFieldData(0), lowerBoundTuple.getFieldStart(0), numTokensLowerBound); ShortPointable.setShort(upperBoundTuple.getFieldData(0), upperBoundTuple.getFieldStart(0), numTokensUpperBound); } public ITupleReference getPrefixSearchKey() { return searchKey; } public ITupleReference getFullLowSearchKey() { return fullLowSearchKey; } public ITupleReference getFullHighSearchKey() { return fullHighSearchKey; } public InvertedListCursor getCachedInvertedListCursor() throws HyracksDataException { return invListCursorCache.getNext(); } }
{ "content_hash": "9a1b9df7939548edcf8fff28975c5f5a", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 120, "avg_line_length": 43.86915887850467, "alnum_prop": 0.6404630024144298, "repo_name": "ecarm002/incubator-asterixdb", "id": "3d8c35a4ac968dfad50eca7a73f5a902cbac8ba0", "size": "14889", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/PartitionedTOccurrenceSearcher.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "8721" }, { "name": "C", "bytes": "421" }, { "name": "CSS", "bytes": "8823" }, { "name": "Crystal", "bytes": "453" }, { "name": "Gnuplot", "bytes": "89" }, { "name": "HTML", "bytes": "126208" }, { "name": "Java", "bytes": "18965823" }, { "name": "JavaScript", "bytes": "274822" }, { "name": "Python", "bytes": "281315" }, { "name": "Ruby", "bytes": "3078" }, { "name": "Scheme", "bytes": "1105" }, { "name": "Shell", "bytes": "203955" }, { "name": "Smarty", "bytes": "31412" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "bcbc2393a03e762c45b98a8d30bf4109", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "5f16b905848a5716f6755651b433b4bbff573ac8", "size": "192", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Bromeliaceae/Nidularium/Nidularium microps/Nidularium microcephalum bicensis/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package com.atlassian.sal.core.search.query; import com.atlassian.sal.api.search.query.SearchQuery; import com.atlassian.sal.api.search.query.SearchQueryParser; /** * Factory for creating SearchQueries */ public class DefaultSearchQueryParser implements SearchQueryParser { public SearchQuery parse(String query) { return new DefaultSearchQuery(query); } }
{ "content_hash": "c1167cca7ab3bacdd5e3e11c894f1a8e", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 66, "avg_line_length": 22.9375, "alnum_prop": 0.7983651226158038, "repo_name": "mrdon/SAL", "id": "b1820a83b223f78a9354966e2033e022e67d9e4b", "size": "367", "binary": false, "copies": "1", "ref": "refs/heads/trunk", "path": "sal-core/src/main/java/com/atlassian/sal/core/search/query/DefaultSearchQueryParser.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "268147" } ], "symlink_target": "" }
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.34014 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace Playground.Controls.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.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": "5cec43bbb527fcce47b613ef417b6d71", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 151, "avg_line_length": 36.6, "alnum_prop": 0.5710382513661202, "repo_name": "wonderful-panda/playground.wpf", "id": "6b2ab4510459847b6e0c1f80f1222a1e2aac54b9", "size": "1100", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Playground.Controls/Properties/Settings.Designer.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "23572" } ], "symlink_target": "" }
namespace MenPai_Module { SHORT MenPai_T::GetInitMaxHP(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_BASE_HP, GetID()); } SHORT MenPai_T::GetMaxHPConRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_CON_HP, GetID()); } SHORT MenPai_T::GetMaxHPLevelRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_LEVEL_HP, GetID()); } //HP Regenerate SHORT MenPai_T::GetInitHPRegenerate(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_BASE_HPRESTORE, GetID()); } SHORT MenPai_T::GetHPRegenerateConRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_CON_HPRESTORE, GetID()); } SHORT MenPai_T::GetHPRegenerateLevelRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_LEVEL_HPRESTORE, GetID()); } //MaxMP SHORT MenPai_T::GetInitMaxMP(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_BASE_MP, GetID()); } SHORT MenPai_T::GetMaxMPIntRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_INT_MP, GetID()); } SHORT MenPai_T::GetMaxMPLevelRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_LEVEL_MP, GetID()); } //MP Regenerate SHORT MenPai_T::GetInitMPRegenerate(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_BASE_MPRESTORE, GetID()); } SHORT MenPai_T::GetMPRegenerateIntRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_INT_MPRESTORE, GetID()); } SHORT MenPai_T::GetMPRegenerateLevelRefix(VOID) const { return g_BaseValueTbl.Get( AINFOTYPE_LEVEL_MPRESTORE, GetID() ) ; } //Attr Level 1 Sstr SHORT MenPai_T::GetInitStr(VOID) const { return g_AttrLevelupTbl.Get(CATTR_LEVEL1_STR,GetID(),0); } SHORT MenPai_T::GetStrLevelupRefix(SHORT const nLevel) const { return g_AttrLevelupTbl.Get(CATTR_LEVEL1_STR,GetID(),nLevel); } //Attr Level 1 Spr SHORT MenPai_T::GetInitSpr(VOID) const { return g_AttrLevelupTbl.Get(CATTR_LEVEL1_SPR,GetID(),0); } SHORT MenPai_T::GetSprLevelupRefix(SHORT const nLevel) const { return g_AttrLevelupTbl.Get(CATTR_LEVEL1_SPR,GetID(),nLevel); } //Attr Level 1 Con SHORT MenPai_T::GetInitCon(VOID) const { return g_AttrLevelupTbl.Get(CATTR_LEVEL1_CON,GetID(),0); } SHORT MenPai_T::GetConLevelupRefix(SHORT const nLevel) const { return g_AttrLevelupTbl.Get(CATTR_LEVEL1_CON,GetID(),nLevel); } //Attr Level 1 Int SHORT MenPai_T::GetInitInt(VOID) const { return g_AttrLevelupTbl.Get(CATTR_LEVEL1_INT,GetID(),0); } SHORT MenPai_T::GetIntLevelupRefix(SHORT const nLevel) const { return g_AttrLevelupTbl.Get(CATTR_LEVEL1_INT,GetID(),nLevel); } //Attr Level 1 Dex SHORT MenPai_T::GetInitDex(VOID) const { return g_AttrLevelupTbl.Get(CATTR_LEVEL1_DEX,GetID(),0); } SHORT MenPai_T::GetDexLevelupRefix(SHORT const nLevel) const { return g_AttrLevelupTbl.Get(CATTR_LEVEL1_DEX,GetID(),nLevel); } //Attr Level 2 Attack Physics SHORT MenPai_T::GetInitAttackPhysics(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_BASE_ATTACK_P, GetID()); } SHORT MenPai_T::GetAttackPhysicsStrRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_STR_ATTACK_P, GetID()); } SHORT MenPai_T::GetAttackPhysicsLevelRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_LEVEL_ATTACK_P, GetID()); } //Attr Level 2 Defence Physics SHORT MenPai_T::GetInitDefencePhysics(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_BASE_DEFENCE_P, GetID()); } SHORT MenPai_T::GetDefencePhysicsConRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_CON_DEFENCE_P, GetID()); } SHORT MenPai_T::GetDefencePhysicsLevelRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_LEVEL_DEFENCE_P, GetID()); } //Attr Level 2 Attack Magic SHORT MenPai_T::GetInitAttackMagic(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_BASE_ATTACK_M, GetID()); } SHORT MenPai_T::GetAttackMagicSprRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_SPR_ATTACK_M, GetID()); } SHORT MenPai_T::GetAttackMagicLevelRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_LEVEL_ATTACK_M, GetID()); } //Attr Level 2 Defence Magic SHORT MenPai_T::GetInitDefenceMagic(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_BASE_DEFENCE_M, GetID()); } SHORT MenPai_T::GetDefenceMagicIntRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_INT_DEFENCE_M, GetID()); } SHORT MenPai_T::GetDefenceMagicLevelRefix(VOID) const { return g_BaseValueTbl.Get( AINFOTYPE_LEVEL_DEFENCE_M,GetID()); } //Attr Level 2 Hit SHORT MenPai_T::GetInitHit(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_BASE_HIT, GetID()); } SHORT MenPai_T::GetHitDexRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_DEX_HIT, GetID()); } SHORT MenPai_T::GetHitLevelRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_LEVEL_HIT, GetID()); } //Attr Level 2 Critical SHORT MenPai_T::GetInitCritical(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_BASE_CRITRATE, GetID()); } SHORT MenPai_T::GetCriticalDexRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_DEX_CRITRATE, GetID()); } SHORT MenPai_T::GetCriticalLevelRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_LEVEL_CRITRATE, GetID()); } //Attr Level 2 Miss SHORT MenPai_T::GetInitMiss(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_BASE_MISS, GetID()); } SHORT MenPai_T::GetMissDexRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_DEX_MISS, GetID()); } SHORT MenPai_T::GetMissLevelRefix(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_LEVEL_MISS, GetID()); } //Attr Attack Fluctuation SHORT MenPai_T::GetAttackFluctuation(VOID) const { return g_BaseValueTbl.Get(AINFOTYPE_ATTACK_FLUCTUATION, GetID()); } VOID MenPai_T::OnDamage(Obj_Human& rMe, INT nDamage) const { if(0>=nDamage) { return; } INT nRage = nDamage/40; rMe.RefixRageRegeneration(nRage); rMe.RageIncrement(nRage, NULL); } VOID MenPai_T::OnDamageTarget(Obj_Human& rMe,INT nDamage) const { if(0>=nDamage) { return; } INT nRage = nDamage/40; rMe.RefixRageRegeneration(nRage); rMe.RageIncrement(nRage, NULL); } }
{ "content_hash": "efffe0e1cb0d4096bee5a214712e7c7d", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 73, "avg_line_length": 26.2183908045977, "alnum_prop": 0.6375858541575332, "repo_name": "viticm/web-pap", "id": "65188c47ed46ad1e4cfdc5af55cc7ab4cc31b347", "size": "7170", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "server/Server/MenPai/MenPai.cpp", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "2382465" }, { "name": "C++", "bytes": "6819417" }, { "name": "CSS", "bytes": "1042" }, { "name": "JavaScript", "bytes": "8703" }, { "name": "Lua", "bytes": "12590" }, { "name": "Objective-C", "bytes": "143909" }, { "name": "PHP", "bytes": "14327" }, { "name": "Perl", "bytes": "892" }, { "name": "Shell", "bytes": "16405" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_14) on Fri Jan 29 14:26:33 EST 2010 --> <TITLE> Uses of Class com.sleepycat.persist.model.Relationship (Oracle - Berkeley DB Java Edition API) </TITLE> <META NAME="date" CONTENT="2010-01-29"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../style.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.sleepycat.persist.model.Relationship (Oracle - Berkeley DB Java Edition API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../com/sleepycat/persist/model/Relationship.html" title="enum in com.sleepycat.persist.model"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Berkeley DB Java Edition</b><br><font size=\"-1\"> version 4.0.92</font> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/sleepycat/persist/model//class-useRelationship.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Relationship.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>com.sleepycat.persist.model.Relationship</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../com/sleepycat/persist/model/Relationship.html" title="enum in com.sleepycat.persist.model">Relationship</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#com.sleepycat.persist.model"><B>com.sleepycat.persist.model</B></A></TD> <TD>Annotations for defining a persistent object model.&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="com.sleepycat.persist.model"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../com/sleepycat/persist/model/Relationship.html" title="enum in com.sleepycat.persist.model">Relationship</A> in <A HREF="../../../../../com/sleepycat/persist/model/package-summary.html">com.sleepycat.persist.model</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../com/sleepycat/persist/model/package-summary.html">com.sleepycat.persist.model</A> that return <A HREF="../../../../../com/sleepycat/persist/model/Relationship.html" title="enum in com.sleepycat.persist.model">Relationship</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../com/sleepycat/persist/model/Relationship.html" title="enum in com.sleepycat.persist.model">Relationship</A></CODE></FONT></TD> <TD><CODE><B>SecondaryKeyMetadata.</B><B><A HREF="../../../../../com/sleepycat/persist/model/SecondaryKeyMetadata.html#getRelationship()">getRelationship</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the relationship between instances of the entity class and the secondary keys.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../../com/sleepycat/persist/model/Relationship.html" title="enum in com.sleepycat.persist.model">Relationship</A></CODE></FONT></TD> <TD><CODE><B>Relationship.</B><B><A HREF="../../../../../com/sleepycat/persist/model/Relationship.html#valueOf(java.lang.String)">valueOf</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the enum constant of this type with the specified name.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../../com/sleepycat/persist/model/Relationship.html" title="enum in com.sleepycat.persist.model">Relationship</A>[]</CODE></FONT></TD> <TD><CODE><B>Relationship.</B><B><A HREF="../../../../../com/sleepycat/persist/model/Relationship.html#values()">values</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array containing the constants of this enum type, in the order they are declared.</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Constructors in <A HREF="../../../../../com/sleepycat/persist/model/package-summary.html">com.sleepycat.persist.model</A> with parameters of type <A HREF="../../../../../com/sleepycat/persist/model/Relationship.html" title="enum in com.sleepycat.persist.model">Relationship</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../com/sleepycat/persist/model/SecondaryKeyMetadata.html#SecondaryKeyMetadata(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, com.sleepycat.persist.model.Relationship, java.lang.String, com.sleepycat.persist.model.DeleteAction)">SecondaryKeyMetadata</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;className, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;declaringClassName, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;elementClassName, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;keyName, <A HREF="../../../../../com/sleepycat/persist/model/Relationship.html" title="enum in com.sleepycat.persist.model">Relationship</A>&nbsp;relationship, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;relatedEntity, <A HREF="../../../../../com/sleepycat/persist/model/DeleteAction.html" title="enum in com.sleepycat.persist.model">DeleteAction</A>&nbsp;deleteAction)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Used by an <code>EntityModel</code> to construct secondary key metadata.</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../com/sleepycat/persist/model/Relationship.html" title="enum in com.sleepycat.persist.model"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Berkeley DB Java Edition</b><br><font size=\"-1\"> version 4.0.92</font> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/sleepycat/persist/model//class-useRelationship.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Relationship.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <font size=1>Copyright (c) 2004-2010 Oracle. All rights reserved.</font> </BODY> </HTML>
{ "content_hash": "1097523c3d60ea2f61dc709e532e8d67", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 484, "avg_line_length": 54.29864253393665, "alnum_prop": 0.6495833333333333, "repo_name": "bjorndm/prebake", "id": "b735e4eed38855d1a2c48ccba510a02ba977fae2", "size": "12000", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "code/third_party/bdb/docs/java/com/sleepycat/persist/model/class-use/Relationship.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "4237" }, { "name": "HTML", "bytes": "1251138" }, { "name": "Java", "bytes": "1262459" }, { "name": "JavaScript", "bytes": "91498" }, { "name": "Perl", "bytes": "5698" }, { "name": "Python", "bytes": "3178" }, { "name": "Shell", "bytes": "58950" }, { "name": "XSLT", "bytes": "129565" } ], "symlink_target": "" }
using System; using Azure.Core; namespace Azure.ResourceManager.Batch.Models { /// <summary> Information used to connect to an Azure Fileshare. </summary> public partial class BatchFileShareConfiguration { /// <summary> Initializes a new instance of BatchFileShareConfiguration. </summary> /// <param name="accountName"> The Azure Storage account name. </param> /// <param name="fileUri"> This is of the form &apos;https://{account}.file.core.windows.net/&apos;. </param> /// <param name="accountKey"> The Azure Storage account key. </param> /// <param name="relativeMountPath"> All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. </param> /// <exception cref="ArgumentNullException"> <paramref name="accountName"/>, <paramref name="fileUri"/>, <paramref name="accountKey"/> or <paramref name="relativeMountPath"/> is null. </exception> public BatchFileShareConfiguration(string accountName, Uri fileUri, string accountKey, string relativeMountPath) { Argument.AssertNotNull(accountName, nameof(accountName)); Argument.AssertNotNull(fileUri, nameof(fileUri)); Argument.AssertNotNull(accountKey, nameof(accountKey)); Argument.AssertNotNull(relativeMountPath, nameof(relativeMountPath)); AccountName = accountName; FileUri = fileUri; AccountKey = accountKey; RelativeMountPath = relativeMountPath; } /// <summary> Initializes a new instance of BatchFileShareConfiguration. </summary> /// <param name="accountName"> The Azure Storage account name. </param> /// <param name="fileUri"> This is of the form &apos;https://{account}.file.core.windows.net/&apos;. </param> /// <param name="accountKey"> The Azure Storage account key. </param> /// <param name="relativeMountPath"> All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. </param> /// <param name="mountOptions"> These are &apos;net use&apos; options in Windows and &apos;mount&apos; options in Linux. </param> internal BatchFileShareConfiguration(string accountName, Uri fileUri, string accountKey, string relativeMountPath, string mountOptions) { AccountName = accountName; FileUri = fileUri; AccountKey = accountKey; RelativeMountPath = relativeMountPath; MountOptions = mountOptions; } /// <summary> The Azure Storage account name. </summary> public string AccountName { get; set; } /// <summary> This is of the form &apos;https://{account}.file.core.windows.net/&apos;. </summary> public Uri FileUri { get; set; } /// <summary> The Azure Storage account key. </summary> public string AccountKey { get; set; } /// <summary> All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. </summary> public string RelativeMountPath { get; set; } /// <summary> These are &apos;net use&apos; options in Windows and &apos;mount&apos; options in Linux. </summary> public string MountOptions { get; set; } } }
{ "content_hash": "c50c0800b13f9ab9d4dcae808f34e678", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 204, "avg_line_length": 62.888888888888886, "alnum_prop": 0.673733804475854, "repo_name": "Azure/azure-sdk-for-net", "id": "a7a20ce08f04cc6580da8860050a49d701ae2b0a", "size": "3534", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchFileShareConfiguration.cs", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
import {LoaderStrategy} from './loader-strategy.interface'; import {Observable} from 'rxjs/Observable'; import * as fs from 'fs'; import {injectable} from 'inversify'; import {TestCase} from '../regression/suite/test-case'; import * as winston from 'winston'; import {SiregError} from '../exception/sireg-error'; export interface FileLoaderOptions { path: string; } @injectable() export class FileLoaderStrategy implements LoaderStrategy { private _options: FileLoaderOptions; setOptions(options: any): this { this._options = options; return this; } public load(): Observable<TestCase[]> { if (!this._options.path || !fs.existsSync(this._options.path)) { throw new SiregError(`File path to load from empty or not readable: '${this._options.path}'`); } const fileString: string = fs.readFileSync(this._options.path, 'utf-8'); return Observable.of(fileString) .map((fileContent: string) => { const testCases: TestCase[] = fileContent .split('\n') .map(url => url.replace('\n', '').replace('\r', '')) .filter(url => url != undefined && url.length > 0) .map(url => TestCase.target(url).assertOK()); winston.info(`Loaded ${testCases.length} test cases from file ${this._options.path}`); return testCases; }); } }
{ "content_hash": "84fd20ef2fe10bcceb45c1eca25ebafd", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 106, "avg_line_length": 36.225, "alnum_prop": 0.5990338164251208, "repo_name": "FaKeller/sireg", "id": "1d101d91ff3a037635dfb3f7b9cecd66e5bb4918", "size": "1449", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/load/file-loader.strategy.ts", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "56" }, { "name": "TypeScript", "bytes": "74220" } ], "symlink_target": "" }
<!--- Generated by to-integrations-repo script in Smart Agent repo, DO NOT MODIFY HERE ---> ### INSTALLATION This integration is part of the [SignalFx Smart Agent](https://github.com/signalfx/integrations/tree/master/signalfx-agent)[](sfx_link:signalfx-agent) as the `collectd/jenkins` monitor. You should first deploy the Smart Agent to the same host as the service you want to monitor, and then continue with the configuration instructions below. <!--- GENERATED BY (This comment exists for maintaining compatibility with to-product-docs) ---> ## Description This integration primarily consists of the Smart Agent monitor `collectd/jenkins`. Below is an overview of that monitor. ### Smart Agent Monitor Monitors jenkins by using the [jenkins collectd Python plugin](https://github.com/signalfx/collectd-jenkins), which collects metrics from Jenkins instances by hitting these endpoints: [../api/json](https://www.jenkins.io/doc/book/using/remote-access-api/) (job metrics) and [metrics/&lt;MetricsKey&gt;/..](https://plugins.jenkins.io/metrics/) (default and optional Codahale/Dropwizard JVM metrics). Requires Jenkins 1.580.3 or later, as well as the Jenkins Metrics Plugin (see Setup). <!--- SETUP ---> ## Install Jenkins Metrics Plugin This monitor requires the Metrics Plugin in Jenkins. Go to `Manage Jenkins -> Manage Plugins -> Available -> Search "Metrics Plugin"` to find and install this plugin in your Jenkins UI. <!--- SETUP ---> ## Example Config Sample YAML configuration: ```yaml monitors: - type: collectd/jenkins host: 127.0.0.1 port: 8080 metricsKey: reallylongmetricskey ``` Sample YAML configuration with specific enhanced metrics included ```yaml monitors: - type: collectd/jenkins host: 127.0.0.1 port: 8080 metricsKey: reallylongmetricskey includeMetrics: - "vm.daemon.count" - "vm.terminated.count" ``` Sample YAML configuration with all enhanced metrics included ```yaml monitors: - type: collectd/jenkins host: 127.0.0.1 port: 8080 metricsKey: reallylongmetricskey enhancedMetrics: true ``` ## Configuration To activate this monitor in the Smart Agent, add the following to your agent config: ``` monitors: # All monitor config goes under this key - type: collectd/jenkins ... # Additional config ``` **For a list of monitor options that are common to all monitors, see [Common Configuration](https://github.com/signalfx/signalfx-agent/tree/main/docs/monitors/../monitor-config.md#common-configuration).** | Config option | Required | Type | Description | | --- | --- | --- | --- | | `pythonBinary` | no | `string` | Path to a python binary that should be used to execute the Python code. If not set, a built-in runtime will be used. Can include arguments to the binary as well. | | `host` | **yes** | `string` | | | `port` | **yes** | `integer` | | | `path` | no | `string` | | | `metricsKey` | **yes** | `string` | Key required for collecting metrics. The access key located at `Manage Jenkins > Configure System > Metrics > ADD.` If empty, click `Generate`. | | `enhancedMetrics` | no | `bool` | Whether to enable enhanced metrics (**default:** `false`) | | `excludeJobMetrics` | no | `bool` | Set to *true* to to exclude job metrics retrieved from `/api/json` endpoint (**default:** `false`) | | `includeMetrics` | no | `list of strings` | Used to enable individual enhanced metrics when `enhancedMetrics` is false | | `username` | no | `string` | User with security access to jenkins | | `apiToken` | no | `string` | API Token of the user | | `useHTTPS` | no | `bool` | Whether to enable HTTPS. (**default:** `false`) | | `sslKeyFile` | no | `string` | Path to the keyfile | | `sslCertificate` | no | `string` | Path to the certificate | | `sslCACerts` | no | `string` | Path to the ca file | | `skipVerify` | no | `bool` | Skip SSL certificate validation (**default:** `false`) | ## Metrics All metrics of this integration are emitted by default; however, **none are categorized as [container/host](https://docs.signalfx.com/en/latest/admin-guide/usage.html#about-custom-bundled-and-high-resolution-metrics) -- they are all custom**. These are the metrics available for this integration. - ***`gauge.jenkins.job.duration`*** (*gauge*)<br> Time taken to complete the job in ms. - ***`gauge.jenkins.node.executor.count.value`*** (*gauge*)<br> Total Number of executors in an instance - ***`gauge.jenkins.node.executor.in-use.value`*** (*gauge*)<br> Total number of executors being used in an instance - ***`gauge.jenkins.node.health-check.score`*** (*gauge*)<br> Mean health score of an instance - ***`gauge.jenkins.node.health.disk.space`*** (*gauge*)<br> Binary value of disk space health - ***`gauge.jenkins.node.health.plugins`*** (*gauge*)<br> Boolean value indicating state of plugins - ***`gauge.jenkins.node.health.temporary.space`*** (*gauge*)<br> Binary value of temporary space health - ***`gauge.jenkins.node.health.thread-deadlock`*** (*gauge*)<br> Boolean value indicating a deadlock - ***`gauge.jenkins.node.online.status`*** (*gauge*)<br> Boolean value of instance is reachable or not - ***`gauge.jenkins.node.queue.size.value`*** (*gauge*)<br> Total number pending jobs in queue - ***`gauge.jenkins.node.slave.online.status`*** (*gauge*)<br> Boolean value for slave is reachable or not - ***`gauge.jenkins.node.vm.memory.heap.usage`*** (*gauge*)<br> Percent utilization of the heap memory - ***`gauge.jenkins.node.vm.memory.non-heap.used`*** (*gauge*)<br> Total amount of non-heap memory used - ***`gauge.jenkins.node.vm.memory.total.used`*** (*gauge*)<br> Total Memory used by instance The agent does not do any built-in filtering of metrics coming out of this monitor.
{ "content_hash": "6f9698c9ad0261e5844cdd1e90469ca2", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 199, "avg_line_length": 43.203007518796994, "alnum_prop": 0.7077967281587191, "repo_name": "signalfx/integrations", "id": "50ac88da6e51da454c4c7979e30b03f4e6821c62", "size": "5747", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "jenkins/SMART_AGENT_MONITOR.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "283" }, { "name": "Jinja", "bytes": "2105" }, { "name": "Python", "bytes": "62071" }, { "name": "Shell", "bytes": "354" } ], "symlink_target": "" }
goog.provide('shaka.test.MemoryDBEngine'); /** * An in-memory version of the DBEngine. This is used to test the behavior of * Storage using a fake DBEngine. * * @constructor * @struct * @extends {shaka.offline.DBEngine} */ shaka.test.MemoryDBEngine = function() { /** @private {Object.<string, !Object.<number, *>>} */ this.stores_ = null; /** @private {Object.<string, number>} */ this.ids_ = null; }; /** * Returns the data for the given store name, synchronously. * * @param {string} storeName * @return {!Object.<number, *>} */ shaka.test.MemoryDBEngine.prototype.getAllData = function(storeName) { return this.getStore_(storeName); }; /** @override */ shaka.test.MemoryDBEngine.prototype.initialized = function() { return this.stores_ != null; }; /** @override */ shaka.test.MemoryDBEngine.prototype.init = function(storeMap) { this.stores_ = {}; this.ids_ = {}; for (var storeName in storeMap) { goog.asserts.assert(storeMap[storeName] == 'key', 'Key path must be "key"'); this.stores_[storeName] = {}; this.ids_[storeName] = 0; } return Promise.resolve(); }; /** @override */ shaka.test.MemoryDBEngine.prototype.destroy = function() { this.stores_ = null; this.ids_ = null; return Promise.resolve(); }; /** @override */ shaka.test.MemoryDBEngine.prototype.get = function(storeName, key) { return Promise.resolve(this.getStore_(storeName)[key]); }; /** @override */ shaka.test.MemoryDBEngine.prototype.forEach = function(storeName, callback) { shaka.util.MapUtils.values(this.getStore_(storeName)).forEach(callback); return Promise.resolve(); }; /** @override */ shaka.test.MemoryDBEngine.prototype.insert = function(storeName, value) { var store = this.getStore_(storeName); goog.asserts.assert(!store[value.key], 'Value must not already exist'); store[value.key] = value; return Promise.resolve(); }; /** @override */ shaka.test.MemoryDBEngine.prototype.remove = function(storeName, key) { var store = this.getStore_(storeName); delete store[key]; return Promise.resolve(); }; /** @override */ shaka.test.MemoryDBEngine.prototype.removeWhere = function( storeName, predicate) { var store = this.getStore_(storeName); for (var key in store) { if (predicate(store[Number(key)])) delete store[Number(key)]; } return Promise.resolve(); }; /** @override */ shaka.test.MemoryDBEngine.prototype.reserveId = function(storeName) { goog.asserts.assert(this.ids_, 'Must not be destroyed'); goog.asserts.assert(storeName in this.ids_, 'Store ' + storeName + ' must appear in init()'); return this.ids_[storeName]++; }; /** * @param {string} storeName * @return {!Object.<number, *>} * @private */ shaka.test.MemoryDBEngine.prototype.getStore_ = function(storeName) { goog.asserts.assert(this.stores_, 'Must not be destroyed'); goog.asserts.assert(storeName in this.stores_, 'Store ' + storeName + ' must appear in init()'); return this.stores_[storeName]; };
{ "content_hash": "65473fc2f644665ad261b5a931eb7227", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 80, "avg_line_length": 24.69918699186992, "alnum_prop": 0.6691902567478605, "repo_name": "Ross-cz/shaka-player", "id": "c094e7519b7fb54889743580914d7a5e22e1b5d9", "size": "3645", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "test/test/util/memory_db_engine.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "3099" }, { "name": "JavaScript", "bytes": "2099236" }, { "name": "Python", "bytes": "61861" } ], "symlink_target": "" }
<?php namespace League\Skeleton; /** * Interface AlphaInterface. */ interface AlphaInterface { /** * @return string */ public function sayAlpha(); }
{ "content_hash": "a2310dc7999a876fdebb2bb94fc167f7", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 31, "avg_line_length": 12.214285714285714, "alnum_prop": 0.6198830409356725, "repo_name": "tunght13488/playground", "id": "17aad5e40c94c5131fad99b64306c70ebb628289", "size": "171", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/AlphaInterface.php", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "1104" }, { "name": "PHP", "bytes": "3329" } ], "symlink_target": "" }
<?php namespace it\icosaedro\sql; /*. require_module 'standard'; .*/ require_once __DIR__ . '/../../../all.php'; use it\icosaedro\containers\Printable; use it\icosaedro\bignumbers\BigFloat; use it\icosaedro\bignumbers\BigInt; use it\icosaedro\utils\Date; use DateTime; /** SQL prepared statement. A prepared statement is an SQL command with variable parts (the "parameters") marked by a placeholder, that is the question mark character <code>?</code>. These parameters can then be set with proper values given as regular PHP language types, and these values are automatically properly encoded and possibly quoted as required by the underlying specific implementation of the SQL server. Once all the parameters are being set, the resulting complete SQL statement can be sent to the SQL server for the execution. The same prepared statement can then be re-used several times changing the values of the parameters. Example: <pre> $db = new it\icosaedro\sql\mysql\Driver(...); $ps = $db-&gt;prepareStatement("SELECT name, code FROM products WHERE price &gt; ? AND available = ?"); $ps-&gt;setBigFloat(0, new BigFloat("100.00")); $ps-&gt;setBoolean(1, TRUE); $rs = $ps-&gt;query(); echo $rs; </pre> @author Umberto Salsi <[email protected]> @version $Date: 2014/02/21 23:06:50 $ */ class PreparedStatement implements Printable { private /*. SQLDriverInterface .*/ $db; /* Even entries are literal SQL code; odd entries are the parameters. */ private /*. array[int]string .*/ $chunks; /** Constructor called by the SQL driver to create a new SQL prepared statement. This constructor should never be called directly from the user code. An instance of this class can be used several times setting different values for the variable parts. @param SQLDriverInterface $db The SQL driver engine. @param string $cmd Prepared statement, that is an SQL statement where the variable parts are marked by a question mark. The question mark must not be enclosed between single quotes. For example <code>"SELECT * FROM mytable WHERE pk=? AND name=?"</code>. @return void */ function __construct($db, $cmd) { $this->db = $db; $a = explode("?", $cmd); $n = count($a); for($i = 0; $i < $n; $i++){ $this->chunks[] = $a[$i]; if( $i < $n-1 ) $this->chunks[] = "?"; } } /** Sets the value of a parameter. This method should never be called directly from the user code. The parameter is set verbatim - no escaping is performed and no quotes are inserted. @param int $index Index of the parameter to set, the first question mark is the number 0. @param string $value Value as a string that repleces the placeholder. @return void @throws SQLException If the index is invalid. */ protected function setParameter($index, $value) { $pos = 2*$index + 1; if( $pos < 0 or $pos >= count($this->chunks) ) throw new SQLException("invalid index: $index"); $this->chunks[$pos] = $value; } /** Sets the parameter as SQL literal NULL value. @param int $index Index of the parameter to set, the first question mark is the number 0. @return void @throws SQLException If the index is invalid. */ function setNull($index) { $this->setParameter($index, "NULL"); } /** Sets a parameter of type string. @param int $index Index of the parameter to set, the first question mark is the number 0. @param string $value Value of the parameter, encoded accordingly to the instance of the client data base established. If NULL, then the SQL NULL value is set. @return void @throws SQLException If the index is invalid. */ function setString($index, $value) { if( $value === NULL ) $v = "NULL"; else $v = "'" . $this->db->escape($value) . "'"; $this->setParameter($index, $v); } /** Sets a parameter of type boolean. @param int $index Index of the parameter to set, the first question mark is the number 0. @param bool $value Value of the parameter. If the parameter has to be set to the SQL NULL value, use {@link self::setNull()} instead. @return void @throws SQLException If the index is invalid. */ function setBoolean($index, $value) { $this->setParameter($index, $value? "'1'" : "'0'"); } /** Sets a parameter of type int. @param int $index Index of the parameter to set, the first question mark is the number 0. @param int $value Value of the parameter. If the parameter has to be set to the SQL NULL value, use {@link self::setNull()} instead. @return void @throws SQLException If the index is invalid. */ function setInt($index, $value) { $this->setParameter($index, (string) $value); } /** Sets a parameter of type BigInt. @param int $index Index of the parameter to set, the first question mark is the number 0. @param BigInt $value Value of the parameter. If NULL, then the SQL NULL value is set. @return void @throws SQLException If the index is invalid. */ function setBigInt($index, $value) { if( $value === NULL ) $v = "NULL"; else $v = $value->__toString(); $this->setParameter($index, $v); } /** Sets a parameter of type BigFloat. @param int $index Index of the parameter to set, the first question mark is the number 0. @param BigFloat $value Value of the parameter. If NULL, then the SQL NULL value is set. @return void @throws SQLException If the index is invalid. */ function setBigFloat($index, $value) { if( $value === NULL ) $v = "NULL"; else $v = $value->__toString(); $this->setParameter($index, $v); } /** Sets a parameter of type gregorian date. @param int $index Index of the parameter to set, the first question mark is the number 0. @param Date $value Value of the parameter. If NULL, then the SQL NULL value is set. @return void @throws SQLException If the index is invalid. */ function setDate($index, $value) { if( $value === NULL ) $v = "NULL"; else $v = "'" . $value->__toString() . "'"; $this->setParameter($index, $v); } /** Sets a parameter of type date with time. @param int $index Index of the parameter to set, the first question mark is the number 0. @param DateTime $value Value of the parameter. If NULL, then the SQL NULL value is set. @return void @throws SQLException If the index is invalid. */ function setDateTime($index, $value) { if( $value === NULL ) $v = "NULL"; else $v = "'" . $value->format("Y-m-d H:M:S") . "'"; $this->setParameter($index, $v); } /** Sets a parameter of type binary (for example, an image). @param int $index Index of the parameter to set, the first question mark is the number 0. @param string $value Value of the parameter as an array of bytes. If NULL, then the SQL NULL value is set. In this generic implementation the value is sent to the data base as a Base64-encoded ASCII string, that is the safer and most efficient known encoding using only ASCII characters. Implementations for specific data base engines that provide a binary field type should override this method with something more efficient. @return void @throws SQLException If the index is invalid. */ function setBytes($index, $value) { if( $value === NULL ) $v = "NULL"; else $v = "'" . base64_encode($value) . "'"; $this->setParameter($index, $v); } /** Returns the prepared statement in its current state. @return string The prepared statement as a SQL string with parameters replaced by their values as set so far. Parameters still not set are rendered as empty strings; the original question mark placeholder does not appear anymore. */ function getSQLStatement() { return implode("", $this->chunks); } /** Sends the prepared statement to the data base for execution as an update command, typically UPDATE or INSERT. The variable parameters, marked by the question mark placeholder. Variable parameters still not set are left as empty strings, possibly resulting in an invalid SQL command. @return int Number of rows affected by the change. @throws SQLException If the execution of the prepared statement failed, possibly because some variable parameters were not set, or the syntax of the command was not valid, or the specified tables and fields do not exist. */ function update() { return $this->db->update( $this->getSQLStatement() ); } /** Sends the prepared statement to the data base for execution as an enquiry command, typically a SELECT. The variable parameters, marked by the question mark placeholder. Variable parameters still not set are left as empty strings, possibly resulting in an invalid SQL command. @return ResultSet Resulting table. @throws SQLException If the execution of the prepared statement failed, possibly because some variable parameters were not set, or the syntax of the command was not valid, or the specified tables and fields do not exist. */ function query() { return $this->db->query( $this->getSQLStatement() ); } /** Clears all the variable parameters of the prepared statement to their initial default value, that is undefined. If this prepared statement gets reused there is not really need to call this method, but it may help to detect missing parameter assignments because an incomplete (and then invalid) SQL command would be generated. @return void */ function clearParameters() { $n = count($this->chunks); for($i = 1; $i < $n; $i += 2) $this->chunks[$i] = "?"; } /** Returns the prepared statement in its current state. It is simply an alias of the getSQLStatement() method. @return string The prepared statement as a SQL string with parameters replaced by their values as set so far. Parameters still not set are rendered as empty strings; the original question mark placeholder does not appear anymore. */ function __toString() { return $this->getSQLStatement(); } }
{ "content_hash": "e7fce6773ad514cda3567b9d64798c47", "timestamp": "", "source": "github", "line_count": 332, "max_line_length": 104, "avg_line_length": 29.996987951807228, "alnum_prop": 0.695752585600964, "repo_name": "zenus/thinkphpLint", "id": "1e2cd6c514ac931400fd05d0fa5d83a32c4a7bf6", "size": "9959", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "stdlib/it/icosaedro/sql/PreparedStatement.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "1711" }, { "name": "PHP", "bytes": "2790682" }, { "name": "Shell", "bytes": "1321" }, { "name": "Tcl", "bytes": "22450" } ], "symlink_target": "" }
'use strict'; const ComputedArtifact = require('./computed-artifact'); const NetworkAnalyzer = require('../../lib/dependency-graph/simulator/network-analyzer'); class NetworkAnalysis extends ComputedArtifact { get name() { return 'NetworkAnalysis'; } /** * @param {Array<LH.Artifacts.NetworkRequest>} records * @return {LH.Artifacts.NetworkAnalysis} */ static computeRTTAndServerResponseTime(records) { // First pass compute the estimated observed RTT to each origin's servers. /** @type {Map<string, number>} */ const rttByOrigin = new Map(); for (const [origin, summary] of NetworkAnalyzer.estimateRTTByOrigin(records).entries()) { rttByOrigin.set(origin, summary.min); } // We'll use the minimum RTT as the assumed connection latency since we care about how much addt'l // latency each origin introduces as Lantern will be simulating with its own connection latency. const minimumRtt = Math.min(...Array.from(rttByOrigin.values())); // We'll use the observed RTT information to help estimate the server response time const responseTimeSummaries = NetworkAnalyzer.estimateServerResponseTimeByOrigin(records, { rttByOrigin, }); /** @type {Map<string, number>} */ const additionalRttByOrigin = new Map(); /** @type {Map<string, number>} */ const serverResponseTimeByOrigin = new Map(); for (const [origin, summary] of responseTimeSummaries.entries()) { /** @type {number} */ // @ts-ignore - satisfy the type checker that entry exists. const rttForOrigin = rttByOrigin.get(origin); additionalRttByOrigin.set(origin, rttForOrigin - minimumRtt); serverResponseTimeByOrigin.set(origin, summary.median); } return {rtt: minimumRtt, additionalRttByOrigin, serverResponseTimeByOrigin, throughput: 0}; } /** * @param {LH.DevtoolsLog} devtoolsLog * @param {LH.ComputedArtifacts} computedArtifacts * @return {Promise<LH.Artifacts.NetworkAnalysis>} */ async compute_(devtoolsLog, computedArtifacts) { const records = await computedArtifacts.requestNetworkRecords(devtoolsLog); const throughput = await computedArtifacts.requestNetworkThroughput(devtoolsLog); const rttAndServerResponseTime = NetworkAnalysis.computeRTTAndServerResponseTime(records); rttAndServerResponseTime.throughput = throughput * 8; // convert from KBps to Kbps return rttAndServerResponseTime; } } module.exports = NetworkAnalysis;
{ "content_hash": "766733cd0fc28e0b3d8a9a805d0c652a", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 102, "avg_line_length": 40.59016393442623, "alnum_prop": 0.7249596122778675, "repo_name": "mixed/lighthouse", "id": "eeb2a514ddd20190390edac83f944b61972093e2", "size": "3067", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lighthouse-core/gather/computed/network-analysis.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "44068" }, { "name": "HTML", "bytes": "91516" }, { "name": "JavaScript", "bytes": "2180290" }, { "name": "Ruby", "bytes": "7024" }, { "name": "Shell", "bytes": "14221" } ], "symlink_target": "" }
use clap::ArgMatches; use clap_utils::{parse_required, parse_ssz_required}; use deposit_contract::{decode_eth1_tx_data, DEPOSIT_DATA_LEN}; use tree_hash::TreeHash; use types::EthSpec; pub fn run<T: EthSpec>(matches: &ArgMatches) -> Result<(), String> { let rlp_bytes = parse_ssz_required::<Vec<u8>>(matches, "deposit-data")?; let amount = parse_required(matches, "deposit-amount")?; if rlp_bytes.len() != DEPOSIT_DATA_LEN { return Err(format!( "The given deposit-data is {} bytes, expected {}", rlp_bytes.len(), DEPOSIT_DATA_LEN )); } let (deposit_data, root) = decode_eth1_tx_data(&rlp_bytes, amount) .map_err(|e| format!("Invalid deposit data bytes: {:?}", e))?; let expected_root = deposit_data.tree_hash_root(); if root != expected_root { return Err(format!( "Deposit data root is invalid. Expected {:?}, but got {:?}. Perhaps the amount is incorrect?", expected_root, root )); } Ok(()) }
{ "content_hash": "f0b5698ead4ca830a3eaf64fa27529bc", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 106, "avg_line_length": 33.354838709677416, "alnum_prop": 0.5967117988394585, "repo_name": "sigp/lighthouse", "id": "56f18f998855b48b477483cedceba34a858265c0", "size": "1034", "binary": false, "copies": "1", "ref": "refs/heads/stable", "path": "lcli/src/check_deposit_data.rs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "56" }, { "name": "Dockerfile", "bytes": "1564" }, { "name": "JavaScript", "bytes": "3154" }, { "name": "Makefile", "bytes": "9853" }, { "name": "Python", "bytes": "3406" }, { "name": "Rust", "bytes": "7842338" }, { "name": "Shell", "bytes": "20354" } ], "symlink_target": "" }
typedef struct ID3DXMatrixStack *LPD3DXMATRIXSTACK; // {E3357330-CC5E-11d2-A434-00A0C90629A8} DEFINE_GUID( IID_ID3DXMatrixStack, 0xe3357330, 0xcc5e, 0x11d2, 0xa4, 0x34, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); //=========================================================================== // // General purpose utilities // //=========================================================================== #define D3DX_PI ((float) 3.141592654f) #define D3DX_1BYPI ((float) 0.318309886f) #define D3DXToRadian( degree ) ((degree) * (D3DX_PI / 180.0f)) #define D3DXToDegree( radian ) ((radian) * (180.0f / D3DX_PI)) //=========================================================================== // // Vectors // //=========================================================================== //-------------------------- // 2D Vector //-------------------------- typedef struct D3DXVECTOR2 { #ifdef __cplusplus public: D3DXVECTOR2() {}; D3DXVECTOR2( const float * ); D3DXVECTOR2( float x, float y ); // casting operator float* (); operator const float* () const; // assignment operators D3DXVECTOR2& operator += ( const D3DXVECTOR2& ); D3DXVECTOR2& operator -= ( const D3DXVECTOR2& ); D3DXVECTOR2& operator *= ( float ); D3DXVECTOR2& operator /= ( float ); // unary operators D3DXVECTOR2 operator + () const; D3DXVECTOR2 operator - () const; // binary operators D3DXVECTOR2 operator + ( const D3DXVECTOR2& ) const; D3DXVECTOR2 operator - ( const D3DXVECTOR2& ) const; D3DXVECTOR2 operator * ( float ) const; D3DXVECTOR2 operator / ( float ) const; friend D3DXVECTOR2 operator * ( float, const D3DXVECTOR2& ); BOOL operator == ( const D3DXVECTOR2& ) const; BOOL operator != ( const D3DXVECTOR2& ) const; public: #endif //__cplusplus float x, y; } D3DXVECTOR2, *LPD3DXVECTOR2; //-------------------------- // 3D Vector //-------------------------- typedef struct D3DXVECTOR3 { #ifdef __cplusplus public: D3DXVECTOR3() {}; D3DXVECTOR3( const float * ); D3DXVECTOR3( const D3DVECTOR& ); D3DXVECTOR3( float x, float y, float z ); // casting operator float* (); operator const float* () const; operator D3DVECTOR* (); operator const D3DVECTOR* () const; operator D3DVECTOR& (); operator const D3DVECTOR& () const; // assignment operators D3DXVECTOR3& operator += ( const D3DXVECTOR3& ); D3DXVECTOR3& operator -= ( const D3DXVECTOR3& ); D3DXVECTOR3& operator *= ( float ); D3DXVECTOR3& operator /= ( float ); // unary operators D3DXVECTOR3 operator + () const; D3DXVECTOR3 operator - () const; // binary operators D3DXVECTOR3 operator + ( const D3DXVECTOR3& ) const; D3DXVECTOR3 operator - ( const D3DXVECTOR3& ) const; D3DXVECTOR3 operator * ( float ) const; D3DXVECTOR3 operator / ( float ) const; friend D3DXVECTOR3 operator * ( float, const struct D3DXVECTOR3& ); BOOL operator == ( const D3DXVECTOR3& ) const; BOOL operator != ( const D3DXVECTOR3& ) const; public: #endif //__cplusplus float x, y, z; } D3DXVECTOR3, *LPD3DXVECTOR3; //-------------------------- // 4D Vector //-------------------------- typedef struct D3DXVECTOR4 { #ifdef __cplusplus public: D3DXVECTOR4() {}; D3DXVECTOR4( const float* ); D3DXVECTOR4( float x, float y, float z, float w ); // casting operator float* (); operator const float* () const; // assignment operators D3DXVECTOR4& operator += ( const D3DXVECTOR4& ); D3DXVECTOR4& operator -= ( const D3DXVECTOR4& ); D3DXVECTOR4& operator *= ( float ); D3DXVECTOR4& operator /= ( float ); // unary operators D3DXVECTOR4 operator + () const; D3DXVECTOR4 operator - () const; // binary operators D3DXVECTOR4 operator + ( const D3DXVECTOR4& ) const; D3DXVECTOR4 operator - ( const D3DXVECTOR4& ) const; D3DXVECTOR4 operator * ( float ) const; D3DXVECTOR4 operator / ( float ) const; friend D3DXVECTOR4 operator * ( float, const D3DXVECTOR4& ); BOOL operator == ( const D3DXVECTOR4& ) const; BOOL operator != ( const D3DXVECTOR4& ) const; public: #endif //__cplusplus float x, y, z, w; } D3DXVECTOR4, *LPD3DXVECTOR4; //=========================================================================== // // Matrices // //=========================================================================== typedef struct D3DXMATRIX { #ifdef __cplusplus public: D3DXMATRIX() {}; D3DXMATRIX( const float * ); D3DXMATRIX( const D3DMATRIX& ); D3DXMATRIX( float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33 ); // access grants float& operator () ( UINT iRow, UINT iCol ); float operator () ( UINT iRow, UINT iCol ) const; // casting operators operator float* (); operator const float* () const; operator D3DMATRIX* (); operator const D3DMATRIX* () const; operator D3DMATRIX& (); operator const D3DMATRIX& () const; // assignment operators D3DXMATRIX& operator *= ( const D3DXMATRIX& ); D3DXMATRIX& operator += ( const D3DXMATRIX& ); D3DXMATRIX& operator -= ( const D3DXMATRIX& ); D3DXMATRIX& operator *= ( float ); D3DXMATRIX& operator /= ( float ); // unary operators D3DXMATRIX operator + () const; D3DXMATRIX operator - () const; // binary operators D3DXMATRIX operator * ( const D3DXMATRIX& ) const; D3DXMATRIX operator + ( const D3DXMATRIX& ) const; D3DXMATRIX operator - ( const D3DXMATRIX& ) const; D3DXMATRIX operator * ( float ) const; D3DXMATRIX operator / ( float ) const; friend D3DXMATRIX operator * ( float, const D3DXMATRIX& ); BOOL operator == ( const D3DXMATRIX& ) const; BOOL operator != ( const D3DXMATRIX& ) const; #endif //__cplusplus union { float m[4][4]; #ifdef __cplusplus struct { float m00, m01, m02, m03; float m10, m11, m12, m13; float m20, m21, m22, m23; float m30, m31, m32, m33; }; #endif //__cplusplus }; } D3DXMATRIX, *LPD3DXMATRIX; //=========================================================================== // // Quaternions // //=========================================================================== typedef struct D3DXQUATERNION { #ifdef __cplusplus public: D3DXQUATERNION() {} D3DXQUATERNION( const float * ); D3DXQUATERNION( float x, float y, float z, float w ); // casting operator float* (); operator const float* () const; // assignment operators D3DXQUATERNION& operator += ( const D3DXQUATERNION& ); D3DXQUATERNION& operator -= ( const D3DXQUATERNION& ); D3DXQUATERNION& operator *= ( const D3DXQUATERNION& ); D3DXQUATERNION& operator *= ( float ); D3DXQUATERNION& operator /= ( float ); // unary operators D3DXQUATERNION operator + () const; D3DXQUATERNION operator - () const; // binary operators D3DXQUATERNION operator + ( const D3DXQUATERNION& ) const; D3DXQUATERNION operator - ( const D3DXQUATERNION& ) const; D3DXQUATERNION operator * ( const D3DXQUATERNION& ) const; D3DXQUATERNION operator * ( float ) const; D3DXQUATERNION operator / ( float ) const; friend D3DXQUATERNION operator * (float, const D3DXQUATERNION& ); BOOL operator == ( const D3DXQUATERNION& ) const; BOOL operator != ( const D3DXQUATERNION& ) const; #endif //__cplusplus float x, y, z, w; } D3DXQUATERNION, *LPD3DXQUATERNION; //=========================================================================== // // Planes // //=========================================================================== typedef struct D3DXPLANE { #ifdef __cplusplus public: D3DXPLANE() {} D3DXPLANE( const float* ); D3DXPLANE( float a, float b, float c, float d ); // casting operator float* (); operator const float* () const; // unary operators D3DXPLANE operator + () const; D3DXPLANE operator - () const; // binary operators BOOL operator == ( const D3DXPLANE& ) const; BOOL operator != ( const D3DXPLANE& ) const; #endif //__cplusplus float a, b, c, d; } D3DXPLANE, *LPD3DXPLANE; //=========================================================================== // // Colors // //=========================================================================== typedef struct D3DXCOLOR { #ifdef __cplusplus public: D3DXCOLOR() {} D3DXCOLOR( DWORD argb ); D3DXCOLOR( const float * ); D3DXCOLOR( const D3DCOLORVALUE& ); D3DXCOLOR( float r, float g, float b, float a ); // casting operator DWORD () const; operator float* (); operator const float* () const; operator D3DCOLORVALUE* (); operator const D3DCOLORVALUE* () const; operator D3DCOLORVALUE& (); operator const D3DCOLORVALUE& () const; // assignment operators D3DXCOLOR& operator += ( const D3DXCOLOR& ); D3DXCOLOR& operator -= ( const D3DXCOLOR& ); D3DXCOLOR& operator *= ( float ); D3DXCOLOR& operator /= ( float ); // unary operators D3DXCOLOR operator + () const; D3DXCOLOR operator - () const; // binary operators D3DXCOLOR operator + ( const D3DXCOLOR& ) const; D3DXCOLOR operator - ( const D3DXCOLOR& ) const; D3DXCOLOR operator * ( float ) const; D3DXCOLOR operator / ( float ) const; friend D3DXCOLOR operator * (float, const D3DXCOLOR& ); BOOL operator == ( const D3DXCOLOR& ) const; BOOL operator != ( const D3DXCOLOR& ) const; #endif //__cplusplus FLOAT r, g, b, a; } D3DXCOLOR, *LPD3DXCOLOR; //=========================================================================== // // D3DX math functions: // // NOTE: // * All these functions can take the same object as in and out parameters. // // * Out parameters are typically also returned as return values, so that // the output of one function may be used as a parameter to another. // //=========================================================================== //-------------------------- // 2D Vector //-------------------------- // inline float D3DXVec2Length ( const D3DXVECTOR2 *pV ); float D3DXVec2LengthSq ( const D3DXVECTOR2 *pV ); float D3DXVec2Dot ( const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ); // Z component of ((x1,y1,0) cross (x2,y2,0)) float D3DXVec2CCW ( const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ); D3DXVECTOR2* D3DXVec2Add ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ); D3DXVECTOR2* D3DXVec2Subtract ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ); // Minimize each component. x = min(x1, x2), y = min(y1, y2) D3DXVECTOR2* D3DXVec2Minimize ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ); // Maximize each component. x = max(x1, x2), y = max(y1, y2) D3DXVECTOR2* D3DXVec2Maximize ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ); D3DXVECTOR2* D3DXVec2Scale ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV, float s ); // Linear interpolation. V1 + s(V2-V1) D3DXVECTOR2* D3DXVec2Lerp ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2, float s ); // non-inline #ifdef __cplusplus extern "C" { #endif D3DXVECTOR2* WINAPI D3DXVec2Normalize ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV ); // Hermite interpolation between position V1, tangent T1 (when s == 0) // and position V2, tangent T2 (when s == 1). D3DXVECTOR2* WINAPI D3DXVec2Hermite ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pT1, const D3DXVECTOR2 *pV2, const D3DXVECTOR2 *pT2, float s ); // Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) D3DXVECTOR2* WINAPI D3DXVec2BaryCentric ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2, D3DXVECTOR2 *pV3, float f, float g); // Transform (x, y, 0, 1) by matrix. D3DXVECTOR4* WINAPI D3DXVec2Transform ( D3DXVECTOR4 *pOut, const D3DXVECTOR2 *pV, const D3DXMATRIX *pM ); // Transform (x, y, 0, 1) by matrix, project result back into w=1. D3DXVECTOR2* WINAPI D3DXVec2TransformCoord ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV, const D3DXMATRIX *pM ); // Transform (x, y, 0, 0) by matrix. D3DXVECTOR2* WINAPI D3DXVec2TransformNormal ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV, const D3DXMATRIX *pM ); #ifdef __cplusplus } #endif //-------------------------- // 3D Vector //-------------------------- // inline float D3DXVec3Length ( const D3DXVECTOR3 *pV ); float D3DXVec3LengthSq ( const D3DXVECTOR3 *pV ); float D3DXVec3Dot ( const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ); D3DXVECTOR3* D3DXVec3Cross ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ); D3DXVECTOR3* D3DXVec3Add ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ); D3DXVECTOR3* D3DXVec3Subtract ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ); // Minimize each component. x = min(x1, x2), y = min(y1, y2), ... D3DXVECTOR3* D3DXVec3Minimize ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ); // Maximize each component. x = max(x1, x2), y = max(y1, y2), ... D3DXVECTOR3* D3DXVec3Maximize ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ); D3DXVECTOR3* D3DXVec3Scale ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV, float s); // Linear interpolation. V1 + s(V2-V1) D3DXVECTOR3* D3DXVec3Lerp ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2, float s ); // non-inline #ifdef __cplusplus extern "C" { #endif D3DXVECTOR3* WINAPI D3DXVec3Normalize ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV ); // Hermite interpolation between position V1, tangent T1 (when s == 0) // and position V2, tangent T2 (when s == 1). D3DXVECTOR3* WINAPI D3DXVec3Hermite ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pT1, const D3DXVECTOR3 *pV2, const D3DXVECTOR3 *pT2, float s ); // Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) D3DXVECTOR3* WINAPI D3DXVec3BaryCentric ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2, const D3DXVECTOR3 *pV3, float f, float g); // Transform (x, y, z, 1) by matrix. D3DXVECTOR4* WINAPI D3DXVec3Transform ( D3DXVECTOR4 *pOut, const D3DXVECTOR3 *pV, const D3DXMATRIX *pM ); // Transform (x, y, z, 1) by matrix, project result back into w=1. D3DXVECTOR3* WINAPI D3DXVec3TransformCoord ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV, const D3DXMATRIX *pM ); // Transform (x, y, z, 0) by matrix. D3DXVECTOR3* WINAPI D3DXVec3TransformNormal ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV, const D3DXMATRIX *pM ); #ifdef __cplusplus } #endif //-------------------------- // 4D Vector //-------------------------- // inline float D3DXVec4Length ( const D3DXVECTOR4 *pV ); float D3DXVec4LengthSq ( const D3DXVECTOR4 *pV ); float D3DXVec4Dot ( const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2 ); D3DXVECTOR4* D3DXVec4Add ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2); D3DXVECTOR4* D3DXVec4Subtract ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2); // Minimize each component. x = min(x1, x2), y = min(y1, y2), ... D3DXVECTOR4* D3DXVec4Minimize ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2); // Maximize each component. x = max(x1, x2), y = max(y1, y2), ... D3DXVECTOR4* D3DXVec4Maximize ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2); D3DXVECTOR4* D3DXVec4Scale ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV, float s); // Linear interpolation. V1 + s(V2-V1) D3DXVECTOR4* D3DXVec4Lerp ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2, float s ); // non-inline #ifdef __cplusplus extern "C" { #endif // Cross-product in 4 dimensions. D3DXVECTOR4* WINAPI D3DXVec4Cross ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2, const D3DXVECTOR4 *pV3); D3DXVECTOR4* WINAPI D3DXVec4Normalize ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV ); // Hermite interpolation between position V1, tangent T1 (when s == 0) // and position V2, tangent T2 (when s == 1). D3DXVECTOR4* WINAPI D3DXVec4Hermite ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pT1, const D3DXVECTOR4 *pV2, const D3DXVECTOR4 *pT2, float s ); // Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) D3DXVECTOR4* WINAPI D3DXVec4BaryCentric ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2, const D3DXVECTOR4 *pV3, float f, float g); // Transform vector by matrix. D3DXVECTOR4* WINAPI D3DXVec4Transform ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV, const D3DXMATRIX *pM ); #ifdef __cplusplus } #endif //-------------------------- // 4D Matrix //-------------------------- // inline D3DXMATRIX* D3DXMatrixIdentity ( D3DXMATRIX *pOut ); BOOL D3DXMatrixIsIdentity ( const D3DXMATRIX *pM ); // non-inline #ifdef __cplusplus extern "C" { #endif float WINAPI D3DXMatrixfDeterminant ( const D3DXMATRIX *pM ); // Matrix multiplication. The result represents the transformation M2 // followed by the transformation M1. (Out = M1 * M2) D3DXMATRIX* WINAPI D3DXMatrixMultiply ( D3DXMATRIX *pOut, const D3DXMATRIX *pM1, const D3DXMATRIX *pM2 ); D3DXMATRIX* WINAPI D3DXMatrixTranspose ( D3DXMATRIX *pOut, const D3DXMATRIX *pM ); // Calculate inverse of matrix. Inversion my fail, in which case NULL will // be returned. The determinant of pM is also returned it pfDeterminant // is non-NULL. D3DXMATRIX* WINAPI D3DXMatrixInverse ( D3DXMATRIX *pOut, float *pfDeterminant, const D3DXMATRIX *pM ); // Build a matrix which scales by (sx, sy, sz) D3DXMATRIX* WINAPI D3DXMatrixScaling ( D3DXMATRIX *pOut, float sx, float sy, float sz ); // Build a matrix which translates by (x, y, z) D3DXMATRIX* WINAPI D3DXMatrixTranslation ( D3DXMATRIX *pOut, float x, float y, float z ); // Build a matrix which rotates around the X axis D3DXMATRIX* WINAPI D3DXMatrixRotationX ( D3DXMATRIX *pOut, float angle ); // Build a matrix which rotates around the Y axis D3DXMATRIX* WINAPI D3DXMatrixRotationY ( D3DXMATRIX *pOut, float angle ); // Build a matrix which rotates around the Z axis D3DXMATRIX* WINAPI D3DXMatrixRotationZ ( D3DXMATRIX *pOut, float angle ); // Build a matrix which rotates around an arbitrary axis D3DXMATRIX* WINAPI D3DXMatrixRotationAxis ( D3DXMATRIX *pOut, const D3DXVECTOR3 *pV, float angle ); // Build a matrix from a quaternion D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion ( D3DXMATRIX *pOut, const D3DXQUATERNION *pQ); // Yaw around the Y axis, a pitch around the X axis, // and a roll around the Z axis. D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll ( D3DXMATRIX *pOut, float yaw, float pitch, float roll ); // Build transformation matrix. NULL arguments are treated as identity. // Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt D3DXMATRIX* WINAPI D3DXMatrixTransformation ( D3DXMATRIX *pOut, const D3DXVECTOR3 *pScalingCenter, const D3DXQUATERNION *pScalingRotation, const D3DXVECTOR3 *pScaling, const D3DXVECTOR3 *pRotationCenter, const D3DXQUATERNION *pRotation, const D3DXVECTOR3 *pTranslation); // Build affine transformation matrix. NULL arguments are treated as identity. // Mout = Ms * Mrc-1 * Mr * Mrc * Mt D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation ( D3DXMATRIX *pOut, float Scaling, const D3DXVECTOR3 *pRotationCenter, const D3DXQUATERNION *pRotation, const D3DXVECTOR3 *pTranslation); // Build a lookat matrix. (right-handed) D3DXMATRIX* WINAPI D3DXMatrixLookAt ( D3DXMATRIX *pOut, const D3DXVECTOR3 *pEye, const D3DXVECTOR3 *pAt, const D3DXVECTOR3 *pUp ); // Build a lookat matrix. (left-handed) D3DXMATRIX* WINAPI D3DXMatrixLookAtLH ( D3DXMATRIX *pOut, const D3DXVECTOR3 *pEye, const D3DXVECTOR3 *pAt, const D3DXVECTOR3 *pUp ); // Build a perspective projection matrix. (right-handed) D3DXMATRIX* WINAPI D3DXMatrixPerspective ( D3DXMATRIX *pOut, float w, float h, float zn, float zf ); // Build a perspective projection matrix. (left-handed) D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH ( D3DXMATRIX *pOut, float w, float h, float zn, float zf ); // Build a perspective projection matrix. (right-handed) D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFov ( D3DXMATRIX *pOut, float fovy, float aspect, float zn, float zf ); // Build a perspective projection matrix. (left-handed) D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH ( D3DXMATRIX *pOut, float fovy, float aspect, float zn, float zf ); // Build a perspective projection matrix. (right-handed) D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenter ( D3DXMATRIX *pOut, float l, float r, float b, float t, float zn, float zf ); // Build a perspective projection matrix. (left-handed) D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH ( D3DXMATRIX *pOut, float l, float r, float b, float t, float zn, float zf ); // Build an ortho projection matrix. (right-handed) D3DXMATRIX* WINAPI D3DXMatrixOrtho ( D3DXMATRIX *pOut, float w, float h, float zn, float zf ); // Build an ortho projection matrix. (left-handed) D3DXMATRIX* WINAPI D3DXMatrixOrthoLH ( D3DXMATRIX *pOut, float w, float h, float zn, float zf ); // Build an ortho projection matrix. (right-handed) D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenter ( D3DXMATRIX *pOut, float l, float r, float b, float t, float zn, float zf ); // Build an ortho projection matrix. (left-handed) D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH ( D3DXMATRIX *pOut, float l, float r, float b, float t, float zn, float zf ); // Build a matrix which flattens geometry into a plane, as if casting // a shadow from a light. D3DXMATRIX* WINAPI D3DXMatrixShadow ( D3DXMATRIX *pOut, const D3DXVECTOR4 *pLight, const D3DXPLANE *pPlane ); // Build a matrix which reflects the coordinate system about a plane D3DXMATRIX* WINAPI D3DXMatrixReflect ( D3DXMATRIX *pOut, const D3DXPLANE *pPlane ); #ifdef __cplusplus } #endif //-------------------------- // Quaternion //-------------------------- // inline float D3DXQuaternionLength ( const D3DXQUATERNION *pQ ); // Length squared, or "norm" float D3DXQuaternionLengthSq ( const D3DXQUATERNION *pQ ); float D3DXQuaternionDot ( const D3DXQUATERNION *pQ1, const D3DXQUATERNION *pQ2 ); // (0, 0, 0, 1) D3DXQUATERNION* D3DXQuaternionIdentity ( D3DXQUATERNION *pOut ); BOOL D3DXQuaternionIsIdentity ( const D3DXQUATERNION *pQ ); // (-x, -y, -z, w) D3DXQUATERNION* D3DXQuaternionConjugate ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ ); // non-inline #ifdef __cplusplus extern "C" { #endif // Compute a quaternin's axis and angle of rotation. Expects unit quaternions. void WINAPI D3DXQuaternionToAxisAngle ( const D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, float *pAngle ); // Build a quaternion from a rotation matrix. D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix ( D3DXQUATERNION *pOut, const D3DXMATRIX *pM); // Rotation about arbitrary axis. D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis ( D3DXQUATERNION *pOut, const D3DXVECTOR3 *pV, float angle ); // Yaw around the Y axis, a pitch around the X axis, // and a roll around the Z axis. D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll ( D3DXQUATERNION *pOut, float yaw, float pitch, float roll ); // Quaternion multiplication. The result represents the rotation Q2 // followed by the rotation Q1. (Out = Q2 * Q1) D3DXQUATERNION* WINAPI D3DXQuaternionMultiply ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ1, const D3DXQUATERNION *pQ2 ); D3DXQUATERNION* WINAPI D3DXQuaternionNormalize ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ ); // Conjugate and re-norm D3DXQUATERNION* WINAPI D3DXQuaternionInverse ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ ); // Expects unit quaternions. // if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v) D3DXQUATERNION* WINAPI D3DXQuaternionLn ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ ); // Expects pure quaternions. (w == 0) w is ignored in calculation. // if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v) D3DXQUATERNION* WINAPI D3DXQuaternionExp ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ ); // Spherical linear interpolation between Q1 (s == 0) and Q2 (s == 1). // Expects unit quaternions. D3DXQUATERNION* WINAPI D3DXQuaternionSlerp ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ1, const D3DXQUATERNION *pQ2, float t ); // Spherical quadrangle interpolation. // Slerp(Slerp(Q1, Q4, t), Slerp(Q2, Q3, t), 2t(1-t)) D3DXQUATERNION* WINAPI D3DXQuaternionSquad ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ1, const D3DXQUATERNION *pQ2, const D3DXQUATERNION *pQ3, const D3DXQUATERNION *pQ4, float t ); // Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g)) D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ1, const D3DXQUATERNION *pQ2, const D3DXQUATERNION *pQ3, float f, float g ); #ifdef __cplusplus } #endif //-------------------------- // Plane //-------------------------- // inline // ax + by + cz + dw float D3DXPlaneDot ( const D3DXPLANE *pP, const D3DXVECTOR4 *pV); // ax + by + cz + d float D3DXPlaneDotCoord ( const D3DXPLANE *pP, const D3DXVECTOR3 *pV); // ax + by + cz float D3DXPlaneDotNormal ( const D3DXPLANE *pP, const D3DXVECTOR3 *pV); // non-inline #ifdef __cplusplus extern "C" { #endif // Normalize plane (so that |a,b,c| == 1) D3DXPLANE* WINAPI D3DXPlaneNormalize ( D3DXPLANE *pOut, const D3DXPLANE *pP); // Find the intersection between a plane and a line. If the line is // parallel to the plane, NULL is returned. D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine ( D3DXVECTOR3 *pOut, const D3DXPLANE *pP, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2); // Construct a plane from a point and a normal D3DXPLANE* WINAPI D3DXPlaneFromPointNormal ( D3DXPLANE *pOut, const D3DXVECTOR3 *pPoint, const D3DXVECTOR3 *pNormal); // Construct a plane from 3 points D3DXPLANE* WINAPI D3DXPlaneFromPoints ( D3DXPLANE *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2, const D3DXVECTOR3 *pV3); // Transform a plane by a matrix. The vector (a,b,c) must be normal. // M must be an affine transform. D3DXPLANE* WINAPI D3DXPlaneTransform ( D3DXPLANE *pOut, const D3DXPLANE *pP, const D3DXMATRIX *pM ); #ifdef __cplusplus } #endif //-------------------------- // Color //-------------------------- // inline // (1-r, 1-g, 1-b, a) D3DXCOLOR* D3DXColorNegative (D3DXCOLOR *pOut, const D3DXCOLOR *pC); D3DXCOLOR* D3DXColorAdd (D3DXCOLOR *pOut, const D3DXCOLOR *pC1, const D3DXCOLOR *pC2); D3DXCOLOR* D3DXColorSubtract (D3DXCOLOR *pOut, const D3DXCOLOR *pC1, const D3DXCOLOR *pC2); D3DXCOLOR* D3DXColorScale (D3DXCOLOR *pOut, const D3DXCOLOR *pC, float s); // (r1*r2, g1*g2, b1*b2, a1*a2) D3DXCOLOR* D3DXColorModulate (D3DXCOLOR *pOut, const D3DXCOLOR *pC1, const D3DXCOLOR *pC2); // Linear interpolation of r,g,b, and a. C1 + s(C2-C1) D3DXCOLOR* D3DXColorLerp (D3DXCOLOR *pOut, const D3DXCOLOR *pC1, const D3DXCOLOR *pC2, float s); // non-inline #ifdef __cplusplus extern "C" { #endif // Interpolate r,g,b between desaturated color and color. // DesaturatedColor + s(Color - DesaturatedColor) D3DXCOLOR* WINAPI D3DXColorAdjustSaturation (D3DXCOLOR *pOut, const D3DXCOLOR *pC, float s); // Interpolate r,g,b between 50% grey and color. Grey + s(Color - Grey) D3DXCOLOR* WINAPI D3DXColorAdjustContrast (D3DXCOLOR *pOut, const D3DXCOLOR *pC, float c); #ifdef __cplusplus } #endif //=========================================================================== // // Matrix Stack // //=========================================================================== DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown) { // // IUnknown methods // STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; // // ID3DXMatrixStack methods // // Pops the top of the stack, returns the current top // *after* popping the top. STDMETHOD(Pop)(THIS) PURE; // Pushes the stack by one, duplicating the current matrix. STDMETHOD(Push)(THIS) PURE; // Loads identity in the current matrix. STDMETHOD(LoadIdentity)(THIS) PURE; // Loads the given matrix into the current matrix STDMETHOD(LoadMatrix)(THIS_ const D3DXMATRIX* pM ) PURE; // Right-Multiplies the given matrix to the current matrix. // (transformation is about the current world origin) STDMETHOD(MultMatrix)(THIS_ const D3DXMATRIX* pM ) PURE; // Left-Multiplies the given matrix to the current matrix // (transformation is about the local origin of the object) STDMETHOD(MultMatrixLocal)(THIS_ const D3DXMATRIX* pM ) PURE; // Right multiply the current matrix with the computed rotation // matrix, counterclockwise about the given axis with the given angle. // (rotation is about the current world origin) STDMETHOD(RotateAxis) (THIS_ const D3DXVECTOR3* pV, float angle) PURE; // Left multiply the current matrix with the computed rotation // matrix, counterclockwise about the given axis with the given angle. // (rotation is about the local origin of the object) STDMETHOD(RotateAxisLocal) (THIS_ const D3DXVECTOR3* pV, float angle) PURE; // Right multiply the current matrix with the computed rotation // matrix. All angles are counterclockwise. (rotation is about the // current world origin) // The rotation is composed of a yaw around the Y axis, a pitch around // the X axis, and a roll around the Z axis. STDMETHOD(RotateYawPitchRoll) (THIS_ float yaw, float pitch, float roll) PURE; // Left multiply the current matrix with the computed rotation // matrix. All angles are counterclockwise. (rotation is about the // local origin of the object) // The rotation is composed of a yaw around the Y axis, a pitch around // the X axis, and a roll around the Z axis. STDMETHOD(RotateYawPitchRollLocal) (THIS_ float yaw, float pitch, float roll) PURE; // Right multiply the current matrix with the computed scale // matrix. (transformation is about the current world origin) STDMETHOD(Scale)(THIS_ float x, float y, float z) PURE; // Left multiply the current matrix with the computed scale // matrix. (transformation is about the local origin of the object) STDMETHOD(ScaleLocal)(THIS_ float x, float y, float z) PURE; // Right multiply the current matrix with the computed translation // matrix. (transformation is about the current world origin) STDMETHOD(Translate)(THIS_ float x, float y, float z ) PURE; // Left multiply the current matrix with the computed translation // matrix. (transformation is about the local origin of the object) STDMETHOD(TranslateLocal)(THIS_ float x, float y, float z) PURE; // Obtain the current matrix at the top of the stack STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE; }; #ifdef __cplusplus extern "C" { #endif HRESULT WINAPI D3DXCreateMatrixStack( DWORD flags, LPD3DXMATRIXSTACK *ppStack ); #ifdef __cplusplus } #endif #include "d3dxmath.inl" #if _MSC_VER >= 1200 #pragma warning(pop) #else #pragma warning(default:4201) #endif #endif // __D3DXMATH_H__
{ "content_hash": "42b84618345eb4565c0253589d82a3c1", "timestamp": "", "source": "github", "line_count": 1060, "max_line_length": 87, "avg_line_length": 29.982075471698113, "alnum_prop": 0.6540385765079765, "repo_name": "palestar/medusa", "id": "42f00d1ab307da55fe6c074bb70241d8eb507766", "size": "32432", "binary": false, "copies": "7", "ref": "refs/heads/develop", "path": "ThirdParty/DX9/Include/d3dxmath.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "864803" }, { "name": "C++", "bytes": "12938688" }, { "name": "Clarion", "bytes": "80976" }, { "name": "Lua", "bytes": "4055" }, { "name": "Makefile", "bytes": "37934" }, { "name": "Objective-C", "bytes": "3178" }, { "name": "R", "bytes": "3909" }, { "name": "Shell", "bytes": "4892" } ], "symlink_target": "" }
{% if page.math == true %} <script src="/assets/javascripts/mathjax.js"></script> {% endif %}
{ "content_hash": "190dfc1a36939ee13ddbeb63195952d0", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 54, "avg_line_length": 31.333333333333332, "alnum_prop": 0.6382978723404256, "repo_name": "fantasticfears/zh.algalon.net", "id": "fb0953a855c98268d1e1b6d8cda37430fc075864", "size": "94", "binary": false, "copies": "1", "ref": "refs/heads/post", "path": "_includes/footer/custom.html", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "44198" }, { "name": "HTML", "bytes": "327692" }, { "name": "JavaScript", "bytes": "25581" } ], "symlink_target": "" }
package com.tcl.manager.statistic.frequency; import java.util.Calendar; import java.util.List; import android.content.Context; /** * 频率保存 * * @author jiaquan.huang * */ public class FrequencySaver { Context mContext; static volatile FrequencySaver saver = null; private FrequencySaver(Context context) { mContext = context; } public static FrequencySaver getInstance(Context context) { synchronized (FrequencySaver.class) { if (saver == null) { saver = new FrequencySaver(context); } } return saver; } public void saveFrequency() { /** 取“相对一天”的数据 **/ List<FrequencyEntity> infos = EveryDayUseInfoPrivoder.provide(mContext); if (infos.isEmpty()) { return; } /** 整合 **/ FrequencyColumn column = new FrequencyColumn(); long fromTime = 0; long endTime = 0; for (FrequencyEntity info : infos) { /** 取子项中开始和结束时间最大的作为整个集合的时间段 **/ if (info.fromTime > fromTime) { fromTime = info.fromTime; } if (info.endTime > endTime) { endTime = info.endTime; } } column.fromTime = fromTime; column.endTime = endTime; column.frequencyEntity = infos; /** 存 **/ FrequencyDBHelper.getInstance().saveOrUpdate(column); } public void clean() { Calendar c = Calendar.getInstance(); c.add(Calendar.DAY_OF_YEAR, -30); FrequencyDBHelper.getInstance().clean(c.getTimeInMillis()); } }
{ "content_hash": "220d72bc2d1984f688530e9af404805c", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 80, "avg_line_length": 26.193548387096776, "alnum_prop": 0.5708128078817734, "repo_name": "zoozooll/MyExercise", "id": "47c100542f9320670b94eb10f58d0a2de23d76cc", "size": "1706", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "AppManagerProject/src/com/tcl/manager/statistic/frequency/FrequencySaver.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "1495689" }, { "name": "C#", "bytes": "190108" }, { "name": "C++", "bytes": "8719269" }, { "name": "CMake", "bytes": "46692" }, { "name": "CSS", "bytes": "149067" }, { "name": "GLSL", "bytes": "1069" }, { "name": "HTML", "bytes": "5933291" }, { "name": "Java", "bytes": "20935928" }, { "name": "JavaScript", "bytes": "420263" }, { "name": "Kotlin", "bytes": "13567" }, { "name": "Makefile", "bytes": "40498" }, { "name": "Objective-C", "bytes": "1149532" }, { "name": "Objective-C++", "bytes": "248482" }, { "name": "Python", "bytes": "23625" }, { "name": "RenderScript", "bytes": "3899" }, { "name": "Shell", "bytes": "18962" }, { "name": "TSQL", "bytes": "184481" } ], "symlink_target": "" }
Copyright (c) 2017 Michelle Evans Bouchet & Nayef Ghattas Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{ "content_hash": "a4165234f2daf1cc8ad9aea211097745", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 78, "avg_line_length": 56.94736842105263, "alnum_prop": 0.8059149722735675, "repo_name": "miyef/onboard-fridge", "id": "15ebea8e25b8df9f8c80ba87f9bac2e67f0d7214", "size": "1082", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "LICENSE.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1444" }, { "name": "HTML", "bytes": "1227" }, { "name": "JavaScript", "bytes": "17664" } ], "symlink_target": "" }
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class OlvidarPassword extends CI_Controller { public function __construct() { parent::__construct(); } public function index() { $this->load->view('OlvidarPassword/olvidarPassword'); } public function enviarEmailUserOlvidarPassword() { $email = $_REQUEST["email"]; $this->load->model('ForgotPassword/VerificarExisteEmail'); $datosConsultaExisteMail = $this->VerificarExisteEmail->verifyExistsEmail($email); //$datosConsultaExisteMail["email"] = $email; if($datosConsultaExisteMail["msjCantidadRegistros"]> 0) { $id_usuario = $datosConsultaExisteMail["usuario"][0]->id_usuario; $this->load->model('ForgotPassword/EnviarEmailForgotPassword'); $datosProceso = $this->EnviarEmailForgotPassword->enviarMailUsuario($email,$id_usuario); if($datosProceso["msjConsulta"] == "OK") { $envioEmail = $this->sendMailGmail($email,$datosProceso["token"]); if($envioEmail) { $datosProceso["msjConsulta"] = "OK"; //echo json_encode($msjEnvioEmail); } else { $datosProceso['msjConsulta'] = "Error"; //echo json_encode($msjEnvioEmail); } } else { $datosProceso['msjConsulta'] = "Error"; } $salida = $datosProceso; echo json_encode($salida); } else { $salida = $datosConsultaExisteMail; echo json_encode($salida); } } function sendMailGmail($email,$token) { $this->load->library("email"); //configuracion para gmail $configGmail = array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.gmail.com', 'smtp_port' => 465, 'smtp_user' => '[email protected]', 'smtp_pass' => 'tesTingSendEmail_1', 'mailtype' => 'html', 'charset' => 'utf-8', 'newline' => "\r\n" ); //cargamos la configuración para enviar con gmail $this->email->initialize($configGmail); $this->email->from('[email protected]'); $this->email->to($email); //$this->email->to("[email protected]"); $this->email->subject('Solicitud de cambio de contraseña'); $datosUsuario["email"]= $email; $datosUsuario["token"]= $token; $mensaje = $this->load->view('OlvidarPassword/msjEmailOlvidarPassword',$datosUsuario,TRUE); // return $message; $this->email->message($mensaje); $envio = $this->email->send(); return $envio; } function cambiarContrasena() { $token = $_REQUEST["token"]; $this->load->model('ForgotPassword/verificarTokenChangePassword'); $datosTokenUsuarios = $this->verificarTokenChangePassword->verifyTokenChangePassword($token); if($datosTokenUsuarios["msjCantidadRegistros"]>0) { $this->load->view('OlvidarPassword/formCambiarPassword'); } else { $this->load->view('OlvidarPassword/formCambiarPasswordCaducado'); } } public function actualizarPasswordUsuario() { $password = $_REQUEST["password"]; $token = $_REQUEST["token"]; $this->load->model('ForgotPassword/ActualizarPasswordUsuario'); $datosUpdatePassword = $this->ActualizarPasswordUsuario->updatePasswordUsuario($password,$token); echo json_encode($datosUpdatePassword); } }
{ "content_hash": "093ae56fcaf4be9154a048e8962a0595", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 99, "avg_line_length": 21.29139072847682, "alnum_prop": 0.6572317262830482, "repo_name": "luism3090/PhpCodeigniterPractica", "id": "0f9a3353d65cb1b69928428d1fb557ace6124fd8", "size": "3217", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/controllers/OlvidarPassword.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "240" }, { "name": "CSS", "bytes": "20956" }, { "name": "HTML", "bytes": "8515431" }, { "name": "JavaScript", "bytes": "594092" }, { "name": "PHP", "bytes": "1872292" } ], "symlink_target": "" }
<!DOCTYPE html> <!-- Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.3.1 Version: 3.6 Author: KeenThemes Website: http://www.keenthemes.com/ Contact: [email protected] Follow: www.twitter.com/keenthemes Like: www.facebook.com/keenthemes Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project. --> <!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]--> <!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]--> <!--[if !IE]><!--> <html lang="en"> <!--<![endif]--> <!-- BEGIN HEAD --> <head> <meta charset="utf-8"/> <title>Metronic | UI Components - jQuery UI Sliders</title> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta content="width=device-width, initial-scale=1.0" name="viewport"/> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <meta content="" name="description"/> <meta content="" name="author"/> <!-- BEGIN GLOBAL MANDATORY STYLES --> <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css"> <link href="../../assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="../../assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css"> <link href="../../assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"> <link href="../../assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"> <link href="../../assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css"/> <!-- END GLOBAL MANDATORY STYLES --> <!-- BEGIN PAGE LEVEL STYLES --> <link href="../../assets/global/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.css" rel="stylesheet"/> <!-- END PAGE LEVEL STYLES --> <!-- BEGIN THEME STYLES --> <link href="../../assets/global/css/components.css" id="style_components" rel="stylesheet" type="text/css"/> <link href="../../assets/global/css/plugins.css" rel="stylesheet" type="text/css"/> <link href="../../assets/admin/layout2/css/layout.css" rel="stylesheet" type="text/css"/> <link id="style_color" href="../../assets/admin/layout2/css/themes/grey.css" rel="stylesheet" type="text/css"/> <link href="../../assets/admin/layout2/css/custom.css" rel="stylesheet" type="text/css"/> <!-- END THEME STYLES --> <link rel="shortcut icon" href="favicon.ico"/> </head> <!-- END HEAD --> <!-- BEGIN BODY --> <!-- DOC: Apply "page-header-fixed-mobile" and "page-footer-fixed-mobile" class to body element to force fixed header or footer in mobile devices --> <!-- DOC: Apply "page-sidebar-closed" class to the body and "page-sidebar-menu-closed" class to the sidebar menu element to hide the sidebar by default --> <!-- DOC: Apply "page-sidebar-hide" class to the body to make the sidebar completely hidden on toggle --> <!-- DOC: Apply "page-sidebar-closed-hide-logo" class to the body element to make the logo hidden on sidebar toggle --> <!-- DOC: Apply "page-sidebar-hide" class to body element to completely hide the sidebar on sidebar toggle --> <!-- DOC: Apply "page-sidebar-fixed" class to have fixed sidebar --> <!-- DOC: Apply "page-footer-fixed" class to the body element to have fixed footer --> <!-- DOC: Apply "page-sidebar-reversed" class to put the sidebar on the right side --> <!-- DOC: Apply "page-full-width" class to the body element to have full width page without the sidebar menu --> <body class="page-boxed page-header-fixed page-container-bg-solid page-sidebar-closed-hide-logo "> <!-- BEGIN HEADER --> <div class="page-header navbar navbar-fixed-top"> <!-- BEGIN HEADER INNER --> <div class="page-header-inner container"> <!-- BEGIN LOGO --> <div class="page-logo"> <a href="index.html"> <img src="../../assets/admin/layout2/img/logo-default.png" alt="logo" class="logo-default"/> </a> <div class="menu-toggler sidebar-toggler"> <!-- DOC: Remove the above "hide" to enable the sidebar toggler button on header --> </div> </div> <!-- END LOGO --> <!-- BEGIN RESPONSIVE MENU TOGGLER --> <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse"> </a> <!-- END RESPONSIVE MENU TOGGLER --> <!-- BEGIN PAGE ACTIONS --> <!-- DOC: Remove "hide" class to enable the page header actions --> <div class="page-actions hide"> <div class="btn-group"> <button type="button" class="btn btn-circle red-pink dropdown-toggle" data-toggle="dropdown"> <i class="icon-bar-chart"></i>&nbsp;<span class="hidden-sm hidden-xs">New&nbsp;</span>&nbsp;<i class="fa fa-angle-down"></i> </button> <ul class="dropdown-menu" role="menu"> <li> <a href="#"> <i class="icon-user"></i> New User </a> </li> <li> <a href="#"> <i class="icon-present"></i> New Event <span class="badge badge-success">4</span> </a> </li> <li> <a href="#"> <i class="icon-basket"></i> New order </a> </li> <li class="divider"> </li> <li> <a href="#"> <i class="icon-flag"></i> Pending Orders <span class="badge badge-danger">4</span> </a> </li> <li> <a href="#"> <i class="icon-users"></i> Pending Users <span class="badge badge-warning">12</span> </a> </li> </ul> </div> <div class="btn-group"> <button type="button" class="btn btn-circle green-haze dropdown-toggle" data-toggle="dropdown"> <i class="icon-bell"></i>&nbsp;<span class="hidden-sm hidden-xs">Post&nbsp;</span>&nbsp;<i class="fa fa-angle-down"></i> </button> <ul class="dropdown-menu" role="menu"> <li> <a href="#"> <i class="icon-docs"></i> New Post </a> </li> <li> <a href="#"> <i class="icon-tag"></i> New Comment </a> </li> <li> <a href="#"> <i class="icon-share"></i> Share </a> </li> <li class="divider"> </li> <li> <a href="#"> <i class="icon-flag"></i> Comments <span class="badge badge-success">4</span> </a> </li> <li> <a href="#"> <i class="icon-users"></i> Feedbacks <span class="badge badge-danger">2</span> </a> </li> </ul> </div> </div> <!-- END PAGE ACTIONS --> <!-- BEGIN PAGE TOP --> <div class="page-top"> <!-- BEGIN HEADER SEARCH BOX --> <!-- DOC: Apply "search-form-expanded" right after the "search-form" class to have half expanded search box --> <form class="search-form search-form-expanded" action="extra_search.html" method="GET"> <div class="input-group"> <input type="text" class="form-control" placeholder="Search..." name="query"> <span class="input-group-btn"> <a href="javascript:;" class="btn submit"><i class="icon-magnifier"></i></a> </span> </div> </form> <!-- END HEADER SEARCH BOX --> <!-- BEGIN TOP NAVIGATION MENU --> <div class="top-menu"> <ul class="nav navbar-nav pull-right"> <!-- BEGIN NOTIFICATION DROPDOWN --> <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte --> <li class="dropdown dropdown-extended dropdown-notification" id="header_notification_bar"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true"> <i class="icon-bell"></i> <span class="badge badge-default"> 7 </span> </a> <ul class="dropdown-menu"> <li class="external"> <h3><span class="bold">12 pending</span> notifications</h3> <a href="extra_profile.html">view all</a> </li> <li> <ul class="dropdown-menu-list scroller" style="height: 250px;" data-handle-color="#637283"> <li> <a href="javascript:;"> <span class="time">just now</span> <span class="details"> <span class="label label-sm label-icon label-success"> <i class="fa fa-plus"></i> </span> New user registered. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">3 mins</span> <span class="details"> <span class="label label-sm label-icon label-danger"> <i class="fa fa-bolt"></i> </span> Server #12 overloaded. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">10 mins</span> <span class="details"> <span class="label label-sm label-icon label-warning"> <i class="fa fa-bell-o"></i> </span> Server #2 not responding. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">14 hrs</span> <span class="details"> <span class="label label-sm label-icon label-info"> <i class="fa fa-bullhorn"></i> </span> Application error. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">2 days</span> <span class="details"> <span class="label label-sm label-icon label-danger"> <i class="fa fa-bolt"></i> </span> Database overloaded 68%. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">3 days</span> <span class="details"> <span class="label label-sm label-icon label-danger"> <i class="fa fa-bolt"></i> </span> A user IP blocked. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">4 days</span> <span class="details"> <span class="label label-sm label-icon label-warning"> <i class="fa fa-bell-o"></i> </span> Storage Server #4 not responding dfdfdfd. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">5 days</span> <span class="details"> <span class="label label-sm label-icon label-info"> <i class="fa fa-bullhorn"></i> </span> System Error. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">9 days</span> <span class="details"> <span class="label label-sm label-icon label-danger"> <i class="fa fa-bolt"></i> </span> Storage server failed. </span> </a> </li> </ul> </li> </ul> </li> <!-- END NOTIFICATION DROPDOWN --> <!-- BEGIN INBOX DROPDOWN --> <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte --> <li class="dropdown dropdown-extended dropdown-inbox" id="header_inbox_bar"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true"> <i class="icon-envelope-open"></i> <span class="badge badge-default"> 4 </span> </a> <ul class="dropdown-menu"> <li class="external"> <h3>You have <span class="bold">7 New</span> Messages</h3> <a href="page_inbox.html">view all</a> </li> <li> <ul class="dropdown-menu-list scroller" style="height: 275px;" data-handle-color="#637283"> <li> <a href="inbox.html?a=view"> <span class="photo"> <img src="../../assets/admin/layout3/img/avatar2.jpg" class="img-circle" alt=""> </span> <span class="subject"> <span class="from"> Lisa Wong </span> <span class="time">Just Now </span> </span> <span class="message"> Vivamus sed auctor nibh congue nibh. auctor nibh auctor nibh... </span> </a> </li> <li> <a href="inbox.html?a=view"> <span class="photo"> <img src="../../assets/admin/layout3/img/avatar3.jpg" class="img-circle" alt=""> </span> <span class="subject"> <span class="from"> Richard Doe </span> <span class="time">16 mins </span> </span> <span class="message"> Vivamus sed congue nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span> </a> </li> <li> <a href="inbox.html?a=view"> <span class="photo"> <img src="../../assets/admin/layout3/img/avatar1.jpg" class="img-circle" alt=""> </span> <span class="subject"> <span class="from"> Bob Nilson </span> <span class="time">2 hrs </span> </span> <span class="message"> Vivamus sed nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span> </a> </li> <li> <a href="inbox.html?a=view"> <span class="photo"> <img src="../../assets/admin/layout3/img/avatar2.jpg" class="img-circle" alt=""> </span> <span class="subject"> <span class="from"> Lisa Wong </span> <span class="time">40 mins </span> </span> <span class="message"> Vivamus sed auctor 40% nibh congue nibh... </span> </a> </li> <li> <a href="inbox.html?a=view"> <span class="photo"> <img src="../../assets/admin/layout3/img/avatar3.jpg" class="img-circle" alt=""> </span> <span class="subject"> <span class="from"> Richard Doe </span> <span class="time">46 mins </span> </span> <span class="message"> Vivamus sed congue nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span> </a> </li> </ul> </li> </ul> </li> <!-- END INBOX DROPDOWN --> <!-- BEGIN TODO DROPDOWN --> <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte --> <li class="dropdown dropdown-extended dropdown-tasks" id="header_task_bar"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true"> <i class="icon-calendar"></i> <span class="badge badge-default"> 3 </span> </a> <ul class="dropdown-menu extended tasks"> <li class="external"> <h3>You have <span class="bold">12 pending</span> tasks</h3> <a href="page_todo.html">view all</a> </li> <li> <ul class="dropdown-menu-list scroller" style="height: 275px;" data-handle-color="#637283"> <li> <a href="javascript:;"> <span class="task"> <span class="desc">New release v1.2 </span> <span class="percent">30%</span> </span> <span class="progress"> <span style="width: 40%;" class="progress-bar progress-bar-success" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">40% Complete</span></span> </span> </a> </li> <li> <a href="javascript:;"> <span class="task"> <span class="desc">Application deployment</span> <span class="percent">65%</span> </span> <span class="progress"> <span style="width: 65%;" class="progress-bar progress-bar-danger" aria-valuenow="65" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">65% Complete</span></span> </span> </a> </li> <li> <a href="javascript:;"> <span class="task"> <span class="desc">Mobile app release</span> <span class="percent">98%</span> </span> <span class="progress"> <span style="width: 98%;" class="progress-bar progress-bar-success" aria-valuenow="98" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">98% Complete</span></span> </span> </a> </li> <li> <a href="javascript:;"> <span class="task"> <span class="desc">Database migration</span> <span class="percent">10%</span> </span> <span class="progress"> <span style="width: 10%;" class="progress-bar progress-bar-warning" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">10% Complete</span></span> </span> </a> </li> <li> <a href="javascript:;"> <span class="task"> <span class="desc">Web server upgrade</span> <span class="percent">58%</span> </span> <span class="progress"> <span style="width: 58%;" class="progress-bar progress-bar-info" aria-valuenow="58" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">58% Complete</span></span> </span> </a> </li> <li> <a href="javascript:;"> <span class="task"> <span class="desc">Mobile development</span> <span class="percent">85%</span> </span> <span class="progress"> <span style="width: 85%;" class="progress-bar progress-bar-success" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">85% Complete</span></span> </span> </a> </li> <li> <a href="javascript:;"> <span class="task"> <span class="desc">New UI release</span> <span class="percent">38%</span> </span> <span class="progress progress-striped"> <span style="width: 38%;" class="progress-bar progress-bar-important" aria-valuenow="18" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">38% Complete</span></span> </span> </a> </li> </ul> </li> </ul> </li> <!-- END TODO DROPDOWN --> <!-- BEGIN USER LOGIN DROPDOWN --> <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte --> <li class="dropdown dropdown-user"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true"> <img alt="" class="img-circle" src="../../assets/admin/layout2/img/avatar3_small.jpg"/> <span class="username username-hide-on-mobile"> Nick </span> <i class="fa fa-angle-down"></i> </a> <ul class="dropdown-menu dropdown-menu-default"> <li> <a href="extra_profile.html"> <i class="icon-user"></i> My Profile </a> </li> <li> <a href="page_calendar.html"> <i class="icon-calendar"></i> My Calendar </a> </li> <li> <a href="inbox.html"> <i class="icon-envelope-open"></i> My Inbox <span class="badge badge-danger"> 3 </span> </a> </li> <li> <a href="page_todo.html"> <i class="icon-rocket"></i> My Tasks <span class="badge badge-success"> 7 </span> </a> </li> <li class="divider"> </li> <li> <a href="extra_lock.html"> <i class="icon-lock"></i> Lock Screen </a> </li> <li> <a href="login.html"> <i class="icon-key"></i> Log Out </a> </li> </ul> </li> <!-- END USER LOGIN DROPDOWN --> </ul> </div> <!-- END TOP NAVIGATION MENU --> </div> <!-- END PAGE TOP --> </div> <!-- END HEADER INNER --> </div> <!-- END HEADER --> <div class="clearfix"> </div> <div class="container"> <!-- BEGIN CONTAINER --> <div class="page-container"> <!-- BEGIN SIDEBAR --> <div class="page-sidebar-wrapper"> <!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing --> <!-- DOC: Change data-auto-speed="200" to adjust the sub menu slide up/down speed --> <div class="page-sidebar navbar-collapse collapse"> <!-- BEGIN SIDEBAR MENU --> <!-- DOC: Apply "page-sidebar-menu-light" class right after "page-sidebar-menu" to enable light sidebar menu style(without borders) --> <!-- DOC: Apply "page-sidebar-menu-hover-submenu" class right after "page-sidebar-menu" to enable hoverable(hover vs accordion) sub menu mode --> <!-- DOC: Apply "page-sidebar-menu-closed" class right after "page-sidebar-menu" to collapse("page-sidebar-closed" class must be applied to the body element) the sidebar sub menu mode --> <!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing --> <!-- DOC: Set data-keep-expand="true" to keep the submenues expanded --> <!-- DOC: Set data-auto-speed="200" to adjust the sub menu slide up/down speed --> <ul class="page-sidebar-menu page-sidebar-menu-hover-submenu " data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200"> <li class="start "> <a href="index.html"> <i class="icon-home"></i> <span class="title">Dashboard</span> </a> </li> <li> <a href="javascript:;"> <i class="icon-basket"></i> <span class="title">eCommerce</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="ecommerce_index.html"> <i class="icon-home"></i> Dashboard</a> </li> <li> <a href="ecommerce_orders.html"> <i class="icon-basket"></i> Orders</a> </li> <li> <a href="ecommerce_orders_view.html"> <i class="icon-tag"></i> Order View</a> </li> <li> <a href="ecommerce_products.html"> <i class="icon-handbag"></i> Products</a> </li> <li> <a href="ecommerce_products_edit.html"> <i class="icon-pencil"></i> Product Edit</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-rocket"></i> <span class="title">Page Layouts</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="layout_fontawesome_icons.html"> <span class="badge badge-roundless badge-danger">new</span>Layout with Fontawesome Icons</a> </li> <li> <a href="layout_glyphicons.html"> Layout with Glyphicon</a> </li> <li> <a href="layout_full_height_content.html"> <span class="badge badge-roundless badge-warning">new</span>Full Height Content</a> </li> <li> <a href="layout_sidebar_reversed.html"> <span class="badge badge-roundless badge-warning">new</span>Right Sidebar Page</a> </li> <li> <a href="layout_sidebar_fixed.html"> Sidebar Fixed Page</a> </li> <li> <a href="layout_sidebar_closed.html"> Sidebar Closed Page</a> </li> <li> <a href="layout_ajax.html"> Content Loading via Ajax</a> </li> <li> <a href="layout_disabled_menu.html"> Disabled Menu Links</a> </li> <li> <a href="layout_blank_page.html"> Blank Page</a> </li> <li> <a href="layout_fluid_page.html"> Fluid Page</a> </li> <li> <a href="layout_language_bar.html"> Language Switch Bar</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-diamond"></i> <span class="title">UI Features</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="ui_general.html"> General Components</a> </li> <li> <a href="ui_buttons.html"> Buttons</a> </li> <li> <a href="ui_confirmations.html"> Popover Confirmations</a> </li> <li> <a href="ui_icons.html"> <span class="badge badge-roundless badge-danger">new</span>Font Icons</a> </li> <li> <a href="ui_colors.html"> Flat UI Colors</a> </li> <li> <a href="ui_typography.html"> Typography</a> </li> <li> <a href="ui_tabs_accordions_navs.html"> Tabs, Accordions & Navs</a> </li> <li> <a href="ui_tree.html"> <span class="badge badge-roundless badge-danger">new</span>Tree View</a> </li> <li> <a href="ui_page_progress_style_1.html"> <span class="badge badge-roundless badge-warning">new</span>Page Progress Bar</a> </li> <li> <a href="ui_blockui.html"> Block UI</a> </li> <li> <a href="ui_notific8.html"> Notific8 Notifications</a> </li> <li> <a href="ui_toastr.html"> Toastr Notifications</a> </li> <li> <a href="ui_alert_dialog_api.html"> <span class="badge badge-roundless badge-danger">new</span>Alerts & Dialogs API</a> </li> <li> <a href="ui_session_timeout.html"> Session Timeout</a> </li> <li> <a href="ui_idle_timeout.html"> User Idle Timeout</a> </li> <li> <a href="ui_modals.html"> Modals</a> </li> <li> <a href="ui_extended_modals.html"> Extended Modals</a> </li> <li> <a href="ui_tiles.html"> Tiles</a> </li> <li> <a href="ui_datepaginator.html"> <span class="badge badge-roundless badge-success">new</span>Date Paginator</a> </li> <li> <a href="ui_nestable.html"> Nestable List</a> </li> </ul> </li> <li class="active open"> <a href="javascript:;"> <i class="icon-puzzle"></i> <span class="title">UI Components</span> <span class="selected"></span> <span class="arrow open"></span> </a> <ul class="sub-menu"> <li> <a href="components_pickers.html"> Pickers</a> </li> <li> <a href="components_dropdowns.html"> Custom Dropdowns</a> </li> <li> <a href="components_form_tools.html"> Form Tools</a> </li> <li> <a href="components_editors.html"> Markdown & WYSIWYG Editors</a> </li> <li> <a href="components_ion_sliders.html"> Ion Range Sliders</a> </li> <li> <a href="components_noui_sliders.html"> NoUI Range Sliders</a> </li> <li class="active"> <a href="components_jqueryui_sliders.html"> jQuery UI Sliders</a> </li> <li> <a href="components_knob_dials.html"> Knob Circle Dials</a> </li> </ul> </li> <!-- BEGIN ANGULARJS LINK --> <li class="tooltips" data-container="body" data-placement="right" data-html="true" data-original-title="AngularJS version demo"> <a href="angularjs" target="_blank"> <i class="icon-paper-plane"></i> <span class="title"> AngularJS Version </span> </a> </li> <!-- END ANGULARJS LINK --> <li> <a href="javascript:;"> <i class="icon-settings"></i> <span class="title">Form Stuff</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="form_controls.html"> Form Controls</a> </li> <li> <a href="form_icheck.html"> iCheck Controls</a> </li> <li> <a href="form_layouts.html"> Form Layouts</a> </li> <li> <a href="form_editable.html"> <span class="badge badge-roundless badge-warning">new</span>Form X-editable</a> </li> <li> <a href="form_wizard.html"> Form Wizard</a> </li> <li> <a href="form_validation.html"> Form Validation</a> </li> <li> <a href="form_image_crop.html"> <span class="badge badge-roundless badge-danger">new</span>Image Cropping</a> </li> <li> <a href="form_fileupload.html"> Multiple File Upload</a> </li> <li> <a href="form_dropzone.html"> Dropzone File Upload</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-briefcase"></i> <span class="title">Data Tables</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="table_basic.html"> Basic Datatables</a> </li> <li> <a href="table_responsive.html"> Responsive Datatables</a> </li> <li> <a href="table_managed.html"> Managed Datatables</a> </li> <li> <a href="table_editable.html"> Editable Datatables</a> </li> <li> <a href="table_advanced.html"> Advanced Datatables</a> </li> <li> <a href="table_ajax.html"> Ajax Datatables</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-wallet"></i> <span class="title">Portlets</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="portlet_general.html"> General Portlets</a> </li> <li> <a href="portlet_general2.html"> <span class="badge badge-roundless badge-danger">new</span>New Portlets #1</a> </li> <li> <a href="portlet_general3.html"> <span class="badge badge-roundless badge-danger">new</span>New Portlets #2</a> </li> <li> <a href="portlet_ajax.html"> Ajax Portlets</a> </li> <li> <a href="portlet_draggable.html"> Draggable Portlets</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-bar-chart"></i> <span class="title">Charts</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="charts_amcharts.html"> Amchart</a> </li> <li> <a href="charts_flotcharts.html"> Flotchart</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-docs"></i> <span class="title">Pages</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="page_timeline.html"> <i class="icon-paper-plane"></i> <span class="badge badge-warning">2</span> New Timeline </a> </li> <li> <a href="page_todo.html"> <i class="icon-hourglass"></i> <span class="badge badge-danger">4</span>Todo</a> </li> <li> <a href="extra_profile.html"> <i class="icon-user-following"></i> <span class="badge badge-success badge-roundless">new</span>New User Profile</a> </li> <li> <a href="inbox.html"> <i class="icon-envelope"></i> <span class="badge badge-danger">4</span>Inbox</a> </li> <li> <a href="extra_profile_old.html"> <i class="icon-user-following"></i> Old User Profile</a> </li> <li> <a href="extra_faq.html"> <i class="icon-info"></i> FAQ</a> </li> <li> <a href="page_portfolio.html"> <i class="icon-feed"></i> Portfolio</a> </li> <li> <a href="page_timeline_old.html"> <i class="icon-clock"></i> <span class="badge badge-info">4</span>Old Timeline</a> </li> <li> <a href="page_coming_soon.html"> <i class="icon-flag"></i> Coming Soon</a> </li> <li> <a href="page_calendar.html"> <i class="icon-calendar"></i> <span class="badge badge-danger">14</span>Calendar</a> </li> <li> <a href="extra_invoice.html"> <i class="icon-flag"></i> Invoice</a> </li> <li> <a href="page_blog.html"> <i class="icon-speech"></i> Blog</a> </li> <li> <a href="page_blog_item.html"> <i class="icon-link"></i> Blog Post</a> </li> <li> <a href="page_news.html"> <i class="icon-eye"></i> <span class="badge badge-success">9</span>News</a> </li> <li> <a href="page_news_item.html"> <i class="icon-bell"></i> News View</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-present"></i> <span class="title">Extra</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="page_about.html"> About Us</a> </li> <li> <a href="page_contact.html"> Contact Us</a> </li> <li> <a href="extra_search.html"> Search Results</a> </li> <li> <a href="extra_pricing_table.html"> Pricing Tables</a> </li> <li> <a href="extra_404_option1.html"> 404 Page Option 1</a> </li> <li> <a href="extra_404_option2.html"> 404 Page Option 2</a> </li> <li> <a href="extra_404_option3.html"> 404 Page Option 3</a> </li> <li> <a href="extra_500_option1.html"> 500 Page Option 1</a> </li> <li> <a href="extra_500_option2.html"> 500 Page Option 2</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-folder"></i> <span class="title">Multi Level Menu</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="javascript:;"> <i class="icon-settings"></i> Item 1 <span class="arrow"></span> </a> <ul class="sub-menu"> <li> <a href="javascript:;"> <i class="icon-user"></i> Sample Link 1 <span class="arrow"></span> </a> <ul class="sub-menu"> <li> <a href="#"><i class="icon-power"></i> Sample Link 1</a> </li> <li> <a href="#"><i class="icon-paper-plane"></i> Sample Link 1</a> </li> <li> <a href="#"><i class="icon-star"></i> Sample Link 1</a> </li> </ul> </li> <li> <a href="#"><i class="icon-camera"></i> Sample Link 1</a> </li> <li> <a href="#"><i class="icon-link"></i> Sample Link 2</a> </li> <li> <a href="#"><i class="icon-pointer"></i> Sample Link 3</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-globe"></i> Item 2 <span class="arrow"></span> </a> <ul class="sub-menu"> <li> <a href="#"><i class="icon-tag"></i> Sample Link 1</a> </li> <li> <a href="#"><i class="icon-pencil"></i> Sample Link 1</a> </li> <li> <a href="#"><i class="icon-graph"></i> Sample Link 1</a> </li> </ul> </li> <li> <a href="#"> <i class="icon-bar-chart"></i> Item 3 </a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-user"></i> <span class="title">Login Options</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="login.html"> Login Form 1</a> </li> <li> <a href="login_2.html"> Login Form 2</a> </li> <li> <a href="login_3.html"> Login Form 3</a> </li> <li> <a href="login_soft.html"> Login Form 4</a> </li> <li> <a href="extra_lock.html"> Lock Screen 1</a> </li> <li> <a href="extra_lock2.html"> Lock Screen 2</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-envelope-open"></i> <span class="title">Email Templates</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="email_newsletter.html"> Responsive Newsletter<br> Email Template</a> </li> <li> <a href="email_system.html"> Responsive System<br> Email Template</a> </li> </ul> </li> <li class="last "> <a href="javascript:;"> <i class="icon-pointer"></i> <span class="title">Maps</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="maps_google.html"> Google Maps</a> </li> <li> <a href="maps_vector.html"> Vector Maps</a> </li> </ul> </li> </ul> <!-- END SIDEBAR MENU --> </div> </div> <!-- END SIDEBAR --> <!-- BEGIN CONTENT --> <div class="page-content-wrapper"> <div class="page-content"> <!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM--> <div class="modal fade" id="portlet-config" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h4 class="modal-title">Modal title</h4> </div> <div class="modal-body"> Widget settings form goes here </div> <div class="modal-footer"> <button type="button" class="btn blue">Save changes</button> <button type="button" class="btn default" data-dismiss="modal">Close</button> </div> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> <!-- /.modal --> <!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM--> <!-- BEGIN STYLE CUSTOMIZER --> <div class="theme-panel"> <div class="toggler tooltips" data-container="body" data-placement="left" data-html="true" data-original-title="Click to open advance theme customizer panel"> <i class="icon-settings"></i> </div> <div class="toggler-close"> <i class="icon-close"></i> </div> <div class="theme-options"> <div class="theme-option theme-colors clearfix"> <span> THEME COLOR </span> <ul> <li class="color-default current tooltips" data-style="default" data-container="body" data-original-title="Default"> </li> <li class="color-grey tooltips" data-style="grey" data-container="body" data-original-title="Grey"> </li> <li class="color-blue tooltips" data-style="blue" data-container="body" data-original-title="Blue"> </li> <li class="color-dark tooltips" data-style="dark" data-container="body" data-original-title="Dark"> </li> <li class="color-light tooltips" data-style="light" data-container="body" data-original-title="Light"> </li> </ul> </div> <div class="theme-option"> <span> Theme Style </span> <select class="layout-style-option form-control input-small"> <option value="square" selected="selected">Square corners</option> <option value="rounded">Rounded corners</option> </select> </div> <div class="theme-option"> <span> Layout </span> <select class="layout-option form-control input-small"> <option value="fluid" selected="selected">Fluid</option> <option value="boxed">Boxed</option> </select> </div> <div class="theme-option"> <span> Header </span> <select class="page-header-option form-control input-small"> <option value="fixed" selected="selected">Fixed</option> <option value="default">Default</option> </select> </div> <div class="theme-option"> <span> Top Dropdown</span> <select class="page-header-top-dropdown-style-option form-control input-small"> <option value="light" selected="selected">Light</option> <option value="dark">Dark</option> </select> </div> <div class="theme-option"> <span> Sidebar Mode</span> <select class="sidebar-option form-control input-small"> <option value="fixed">Fixed</option> <option value="default" selected="selected">Default</option> </select> </div> <div class="theme-option"> <span> Sidebar Style</span> <select class="sidebar-style-option form-control input-small"> <option value="default" selected="selected">Default</option> <option value="compact">Compact</option> </select> </div> <div class="theme-option"> <span> Sidebar Menu </span> <select class="sidebar-menu-option form-control input-small"> <option value="accordion" selected="selected">Accordion</option> <option value="hover">Hover</option> </select> </div> <div class="theme-option"> <span> Sidebar Position </span> <select class="sidebar-pos-option form-control input-small"> <option value="left" selected="selected">Left</option> <option value="right">Right</option> </select> </div> <div class="theme-option"> <span> Footer </span> <select class="page-footer-option form-control input-small"> <option value="fixed">Fixed</option> <option value="default" selected="selected">Default</option> </select> </div> </div> </div> <!-- END STYLE CUSTOMIZER --> <!-- BEGIN PAGE HEADER--> <h3 class="page-title"> jQuery UI Sliders <small>jquery ui sliders</small> </h3> <div class="page-bar"> <ul class="page-breadcrumb"> <li> <i class="fa fa-home"></i> <a href="index.html">Home</a> <i class="fa fa-angle-right"></i> </li> <li> <a href="#">UI Components</a> <i class="fa fa-angle-right"></i> </li> <li> <a href="#">jQuery UI Sliders</a> </li> </ul> <div class="page-toolbar"> <div class="btn-group pull-right"> <button type="button" class="btn btn-fit-height grey-salt dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="1000" data-close-others="true"> Actions <i class="fa fa-angle-down"></i> </button> <ul class="dropdown-menu pull-right" role="menu"> <li> <a href="#">Action</a> </li> <li> <a href="#">Another action</a> </li> <li> <a href="#">Something else here</a> </li> <li class="divider"> </li> <li> <a href="#">Separated link</a> </li> </ul> </div> </div> </div> <!-- END PAGE HEADER--> <!-- BEGIN PAGE CONTENT--> <div class="row"> <div class="col-md-12"> <!-- BEGIN PORTLET--> <div class="portlet box blue"> <div class="portlet-title"> <div class="caption"> <i class="fa fa-gift"></i>Sliders </div> <div class="tools"> <a href="javascript:;" class="collapse"> </a> <a href="#portlet-config" data-toggle="modal" class="config"> </a> <a href="javascript:;" class="reload"> </a> <a href="javascript:;" class="remove"> </a> </div> </div> <div class="portlet-body form"> <form role="form" class="form-horizontal form-bordered"> <div class="form-body"> <div class="form-group"> <label class="col-md-3 control-label">Basic</label> <div class="col-md-4"> <div class="slider slider-basic bg-red"> </div> <div> </div> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">Range</label> <div class="col-md-4"> <div id="slider-range" class="slider bg-blue"> </div> <div> Value: <span id="slider-range-amount"> </span> </div> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">Snap to increments</label> <div class="col-md-4"> <div id="slider-snap-inc" class="slider bg-green"> </div> <div class="slider-value"> Amount ($100 increments): <span id="slider-snap-inc-amount"> </span> </div> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">Maximum</label> <div class="col-md-4"> <div id="slider-range-max" class="slider bg-purple"> </div> <div class="slider-value"> Maximum Value: <span id="slider-range-max-amount"> </span> </div> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">Minimum</label> <div class="col-md-4"> <div id="slider-range-min" class="slider bg-yellow"> </div> <div class="slider-value"> Minimum Value: <span class="slider-value" id="slider-range-min-amount"> </span> </div> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">Vertical</label> <div class="col-md-4"> <div class="slider-vertical-value"> Value: <span class="slider-value" id="slider-vertical-amount"> </span> </div> <div id="slider-vertical" class="slider bg-green" style="height: 200px;"> </div> </div> </div> <div class="form-group last"> <label class="col-md-3 control-label">Range(Vertical)</label> <div class="col-md-4"> <div class="slider-vertical-value"> Target(Millions): <span class="slider-value" id="slider-range-vertical-amount"> </span> </div> <div id="slider-range-vertical" class="slider bg-grey" style="height: 200px;"> </div> </div> </div> </div> <div class="form-actions"> <div class="row"> <div class="col-md-offset-3 col-md-9"> <button type="submit" class="btn green">Submit</button> <button type="button" class="btn default">Cancel</button> </div> </div> </div> </form> </div> </div> <!-- END PORTLET--> </div> </div> <!-- END PAGE CONTENT--> </div> <!-- BEGIN CONTENT --> </div> <!-- END CONTENT --> <!-- BEGIN QUICK SIDEBAR --> <!--Cooming Soon...--> <!-- END QUICK SIDEBAR --> </div> <!-- END CONTAINER --> <!-- BEGIN FOOTER --> <div class="page-footer"> <div class="page-footer-inner"> 2014 &copy; Metronic by keenthemes. </div> <div class="scroll-to-top"> <i class="icon-arrow-up"></i> </div> </div> <!-- END FOOTER --> </div> <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) --> <!-- BEGIN CORE PLUGINS --> <!--[if lt IE 9]> <script src="../../assets/global/plugins/respond.min.js"></script> <script src="../../assets/global/plugins/excanvas.min.js"></script> <![endif]--> <script src="../../assets/global/plugins/jquery.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/jquery-migrate.min.js" type="text/javascript"></script> <!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip --> <script src="../../assets/global/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/jquery-ui-touch-punch/jquery.ui.touch-punch.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script> <!-- END CORE PLUGINS --> <!-- BEGIN PAGE LEVEL SCRIPTS --> <script src="../../assets/global/scripts/metronic.js" type="text/javascript"></script> <script src="../../assets/admin/layout2/scripts/layout.js" type="text/javascript"></script> <script src="../../assets/admin/layout2/scripts/demo.js" type="text/javascript"></script> <script src="../../assets/admin/pages/scripts/components-jqueryui-sliders.js"></script> <!-- END PAGE LEVEL SCRIPTS --> <script> jQuery(document).ready(function() { // initiate layout and plugins Metronic.init(); // init metronic core components Layout.init(); // init current layout Demo.init(); // init demo features // set current page ComponentsjQueryUISliders.init(); }); </script> <!-- END JAVASCRIPTS --> </body> <!-- END BODY --> </html>
{ "content_hash": "3684cc4fc89495083dee463cdb64ed6e", "timestamp": "", "source": "github", "line_count": 1493, "max_line_length": 191, "avg_line_length": 35.04085733422639, "alnum_prop": 0.510646838443306, "repo_name": "zzsoszz/metronicv36", "id": "7493b7d9a204d0d47d3acf54e035e6a0308ca7ba", "size": "52316", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "theme/templates/admin2/components_jqueryui_sliders.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "580" }, { "name": "ApacheConf", "bytes": "932" }, { "name": "CSS", "bytes": "8633184" }, { "name": "CoffeeScript", "bytes": "167262" }, { "name": "Go", "bytes": "14152" }, { "name": "HTML", "bytes": "69593132" }, { "name": "JavaScript", "bytes": "11861529" }, { "name": "PHP", "bytes": "438910" }, { "name": "Python", "bytes": "11690" }, { "name": "Shell", "bytes": "888" } ], "symlink_target": "" }
bool fileExists(std::string path) { std::ifstream file(path); return file.good(); } std::string readFileToString(std::string path) { std::ifstream file(path); std::string out = "", line; while (!file.eof()) { std::getline(file, line); out += line + "\n"; } file.close(); return out; } projectFileData readProjectFile(std::string path) { projectFileData data; std::ifstream file(path+"/project.txt"); std::string line, currentField; while (!file.eof()) { std::getline(file, line); if (line.length() < 1) continue; // Trim string (and continue if empty) std::size_t start = line.find_first_not_of(" \t\f\v\n\r"); if (start == std::string::npos) continue; line.erase(0, start); // Set as current key if not indented, add to current fields otherwise if (start > 0) { data[currentField].push_back(line); } else { currentField = line; } } file.close(); return data; }
{ "content_hash": "2b3383cba1aad5e1ed18f9ac2bedfc6d", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 72, "avg_line_length": 23.333333333333332, "alnum_prop": 0.6516483516483517, "repo_name": "Hamcha/irma", "id": "3bb5368f24de2000512907094495069ef0368d86", "size": "953", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/FileUtils.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "110" }, { "name": "C++", "bytes": "23343" }, { "name": "CMake", "bytes": "12981" }, { "name": "GLSL", "bytes": "2951" }, { "name": "Lua", "bytes": "45" } ], "symlink_target": "" }
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * Description of sip_wizard * * @author ttroy */ class sip_settings { var $adv = array(); var $wizard = array(); var $_xml; var $_xmlSTUN; var $_xmlVoIP; var $_xmlVersion = '<?xml version="1.0"?>'; var $_doctype = '<!DOCTYPE wap-provisioningdoc PUBLIC "-//WAPFORUM//DTD PROV 1.0//EN" "http://www.wapforum.org/DTD/prov.dtd">'; var $_newline = ""; var $_opentag = '<wap-provisioningdoc>'; var $_char_type_start = '<characteristic type="APPLICATION">'; var $_char_type_end = '</characteristic>'; var $_appidSIP = 'w9010'; var $_appidSTUN = 'w902E'; var $_appidVoIP = 'w9013'; var $_endtag = '</wap-provisioningdoc>'; public function __construct() { $this->ci =& get_instance(); } function wizardToAdvanced($data = array()) { /* * * Mappings puid = username@domain Appaddr -> Addr = proxy resource -> uri = domain appauth -> aauthname = username appauth -> aauthsecret = password appauth -> aauthdata = realm resource -> aauthname = username resource -> aauthsecret = password resource -> aauthdata = realm ptype = forced to ietf */ $this->adv['name'] = $data['name']; $this->adv['puid'] = $data['username'].'@'.$data['domain']; $this->adv['appaddr_addr'] = $data['proxy']; $this->adv['appref'] = $data['appref']; $this->adv['resource_uri'] = $data['domain'];//.':'.$data['port'].';transport='.$data['protocol']; $this->adv['appauth_aauthname'] = $data['username']; $this->adv['appauth_aauthsecret'] = $data['password']; $this->adv['appauth_aauthdata'] = $data['realm']; $this->adv['resource_aauthname'] = $data['username']; $this->adv['resource_aauthsecret'] = $data['password']; $this->adv['resource_aauthdata'] = $data['realm']; $this->adv['ptype'] = 'IETF'; $this->adv['provider-id'] = $data['domain']; if($data['registration'] == 1) $this->adv['autoreg'] = true; else $this->adv['autoreg'] = false; $this->adv['appaddr_port_portnbr'] = $data['port']; $this->adv['protocol'] = $data['protocol']; $this->adv['resource_protocol'] = $data['protocol']; $this->adv['resource_port_portnbr'] = $data['port']; $this->wiz = $data; return $this->adv; } function formatAdvanced($data = array()) { $this->adv = $data; $this->adv['ptype'] = 'IETF'; if($data['registration'] == 1) $this->adv['autoreg'] = true; else $this->adv['autoreg'] = false; //$this->adv['appref'] = $data['appref']; $this->adv['provider-id'] = $data['resource_uri']; return $this->adv; } function generateSIP_XML($data = null) { if($data !== false) $this->adv = $data; //write standard start for all settings $this->_xml = $this->_xmlVersion.$this->_newline; $this->_xml .= $this->_doctype.$this->_newline; $this->_xml .= $this->_opentag.$this->_newline; $this->_xml .= $this->_generateSIP_AppXML(); $this->_xml .= $this->_endtag.$this->_newline; return $this->_indent($this->_xml); } function _generateSIP_AppXML() { $sipxml = $this->_char_type_start.$this->_newline; $sipxml .= '<parm name="APPID" value="'.$this->_appidSIP.'"/>'.$this->_newline; //write settings $sipxml .= '<parm name="PROVIDER-ID" value="'.$this->adv['provider-id'].'"/>'.$this->_newline; $sipxml .= '<parm name="PTYPE" value="'.$this->adv['ptype'].'"/>'.$this->_newline; $sipxml .= '<parm name="PUID" value="'.$this->adv['puid'].'"/>'.$this->_newline; $sipxml .= '<parm name="NAME" value="'.$this->adv['name'].'"/>'.$this->_newline; $sipxml .= '<parm name="APPREF" value="'.$this->adv['appref'].'"/>'.$this->_newline; if(strcmp($this->adv['resource_protocol'], 'UDP') == 0 || strcmp($this->adv['resource_protocol'], 'TCP') == 0) { $sipxml .= '<parm name="APROTOCOL" value="'.$this->adv['protocol'].'"/>'.$this->_newline; } if($this->adv['autoreg']) $sipxml .= '<parm name="AUTOREG"/>'.$this->_newline; $sipxml .= '<characteristic type="APPADDR">'.$this->_newline; $sipxml .= '<parm name="LR"/>'.$this->_newline; $sipxml .= '<parm name="ADDR" value="'.$this->adv['appaddr_addr'].'"/>'.$this->_newline; $sipxml .= '<characteristic type="PORT">'.$this->_newline; $sipxml .= '<parm name="PORTNBR" value="'.$this->adv['appaddr_port_portnbr'].'"/>'.$this->_newline; $sipxml .= $this->_char_type_end.$this->_newline; // end port $sipxml .= $this->_char_type_end.$this->_newline;//end appaddr $sipxml .= '<characteristic type="APPAUTH">'.$this->_newline; $sipxml .= '<parm name="AAUTHNAME" value="'.$this->adv['appauth_aauthname'].'"/>'.$this->_newline; $sipxml .= '<parm name="AAUTHSECRET" value="'.$this->adv['appauth_aauthsecret'].'"/>'.$this->_newline; $sipxml .= '<parm name="AAUTHDATA" value="'.$this->adv['appauth_aauthdata'].'"/>'.$this->_newline; $sipxml .= $this->_char_type_end.$this->_newline; // end appauth $sipxml .= '<characteristic type="RESOURCE">'.$this->_newline; //prepare the resource uri wiht port and transport if they are valid $uri = $this->adv['resource_uri']; if($this->adv['resource_port_portnbr'] != false && $this->adv['resource_port_portnbr'] != 5060) { $uri .= ':'.$this->adv['resource_port_portnbr']; } if(strcmp($this->adv['resource_protocol'], 'UDP') == 0 || strcmp($this->adv['resource_protocol'], 'TCP') == 0) { $uri .= ';transport='.$this->adv['resource_protocol']; } $sipxml .= '<parm name="URI" value="'.$uri.'"/>'.$this->_newline; $sipxml .= '<parm name="AAUTHNAME" value="'.$this->adv['resource_aauthname'].'"/>'.$this->_newline; $sipxml .= '<parm name="AAUTHSECRET" value="'.$this->adv['resource_aauthsecret'].'"/>'.$this->_newline; $sipxml .= '<parm name="AAUTHDATA" value="'.$this->adv['resource_aauthdata'].'"/>'.$this->_newline; $sipxml .= $this->_char_type_end.$this->_newline; // end resource //write standard end for all settings $sipxml .= $this->_char_type_end.$this->_newline; //end applicaton return $sipxml; } function generateVoIP_XML($data = null) { //write standard start for all settings $this->_xmlVoIP = $this->_xmlVersion.$this->_newline; $this->_xmlVoIP .= $this->_doctype.$this->_newline; $this->_xmlVoIP .= $this->_opentag.$this->_newline; $this->_xmlVoIP .= $this->_generateVoIP_AppXML($data); $this->_xmlVoIP .= $this->_endtag.$this->_newline; return $this->_indent($this->_xmlVoIP); } function generateSIP_VoIP_XML($sip = null, $voip = null, $default = 0) { if($sip !== false) $this->adv = $sip; if($default == 0) { $voip['to-apprefname'] = $sip['appref']; $voip['to-appref'] = '1'; $voip['name'] = $sip['name']; $voip['provider-id'] = $sip['provider-id']; } //write standard start for all settings $this->_xmlVoIP = $this->_xmlVersion.$this->_newline; $this->_xmlVoIP .= $this->_doctype.$this->_newline; $this->_xmlVoIP .= $this->_opentag.$this->_newline; $this->_xmlVoIP .= $this->_generateSIP_AppXML(); $this->_xmlVoIP .= $this->_generateVoIP_AppXML($voip); $this->_xmlVoIP .= $this->_endtag.$this->_newline; return $this->_indent($this->_xmlVoIP); } function _generateVoIP_AppXML($data) { $xmlVoIP = $this->_char_type_start.$this->_newline; $xmlVoIP .= '<parm name="APPID" value="'.$this->_appidVoIP.'"/>'.$this->_newline; //write settings $xmlVoIP .= '<parm name="PROVIDER-ID" value="'.$data['provider-id'].'"/>'.$this->_newline; $xmlVoIP .= '<parm name="NAME" value="'.$data['name'].'"/>'.$this->_newline; if($data['to-appref'] != 0) $xmlVoIP .= '<parm name="TO-APPREF" value="'.$data['to-apprefname'].'"/>'.$this->_newline; else $xmlVoIP .= '<parm name="TO-APPREF" value="'.$data['otherto-appref'].'"/>'.$this->_newline; $xmlVoIP .= '<parm name="SMPORT" value="'.$data['smport'].'"/>'.$this->_newline; $xmlVoIP .= '<parm name="EMPORT" value="'.$data['emport'].'"/>'.$this->_newline; $xmlVoIP .= '<parm name="MEDIAQOS" value="'.$data['mediaqos'].'"/>'.$this->_newline; if($data['dtmfib'] == 0) $xmlVoIP .= '<parm name="NODTMFIB"/>'.$this->_newline; if($data['dtmfob'] == 0) $xmlVoIP .= '<parm name="NODTMFOOB"/>'.$this->_newline; $xmlVoIP .= '<parm name="SECURECALLPREF" value="'.$data['securecall'].'"/>'.$this->_newline; if($data['voipoverwcdma'] == 1) $xmlVoIP .= '<parm name="ALLOWVOIPOVERWCDMA"/>'.$this->_newline; $xmlVoIP .= '<parm name="RTCP" value="'.$data['rtcp'].'"/>'.$this->_newline; $xmlVoIP .= '<parm name="UAHTERMINALTYPE" value="'.$data['uahtermtype'].'"/>'.$this->_newline; $xmlVoIP .= '<parm name="UAHWLANMAC" value="'.$data['uahmac'].'"/>'.$this->_newline; $xmlVoIP .= '<parm name="UAHSTRING" value="'.$data['uahfree'].'"/>'.$this->_newline; $xmlVoIP .= '<parm name="VOIPDIGITS" value="'.$data['voipdigits'].'"/>'.$this->_newline; $xmlVoIP .= '<parm name="IGNDOMPART" value="'.$data['igndom'].'"/>'.$this->_newline; $xmlVoIP .= $this->_generateCodec_XML($data['codec1'], 1); $xmlVoIP .= $this->_generateCodec_XML($data['codec2'], 2); $xmlVoIP .= $this->_generateCodec_XML($data['codec3'], 3); //write standard end for all settings $xmlVoIP .= $this->_char_type_end.$this->_newline; //end applicaton return $xmlVoIP; } function _generateCodec_XML($type, $priority) { $xml = ''; if($type == 0 || $type == 1|| $type == 3|| $type == 4|| $type == 10) { $xml = '<characteristic type="CODEC">'.$this->_newline; $xml .= '<parm name="MEDIASUBTYPE" value="'.$type.'"/>'.$this->_newline; $xml .= '<parm name="PRIORITYINDEX" value="'.$priority.'"/>'.$this->_newline; $xml .= '</characteristic>'.$this->_newline; } return $xml; } function generateSTUN_XML($data) { //write standard start for all settings $this->_xmlSTUN = $this->_xmlVersion.$this->_newline; $this->_xmlSTUN .= $this->_doctype.$this->_newline; $this->_xmlSTUN .= $this->_opentag.$this->_newline; $this->_xmlSTUN .= $this->_generateSTUN_AppXML($data); $this->_xmlSTUN .= $this->_endtag.$this->_newline; return $this->_indent($this->_xmlSTUN); } function _generateSTUN_AppXML($data) { $xmlSTUN = $this->_char_type_start.$this->_newline; $xmlSTUN .= '<parm name="APPID" value="'.$this->_appidSTUN.'"/>'.$this->_newline; //write standard end for all settings $xmlSTUN .= '<parm name="NAME" value="'.$data['name'].'"/>'.$this->_newline; $xmlSTUN .= '<parm name="APPREF" value="'.$data['appref'].'"/>'.$this->_newline; $xmlSTUN .= '<characteristic type="NW">'.$this->_newline; $xmlSTUN .= '<parm name="DOMAIN" value="'.$data['domain'].'"/>'.$this->_newline; $xmlSTUN .= '<parm name="STUNSRVADDR" value="'.$data['stunsrvaddr'].'"/>'.$this->_newline; $xmlSTUN .= '<parm name="STUNSRVPORT" value="'.$data['stunsrvport'].'"/>'.$this->_newline; if($data['natrefreshtcp'] != FALSE) $xmlSTUN .= '<parm name="NATREFRESHTCP" value="'.$data['natrefreshtcp'].'"/>'.$this->_newline; if($data['natrefreshudp'] != FALSE) $xmlSTUN .= '<parm name="NATREFRESHUDP" value="'.$data['natrefreshudp'].'"/>'.$this->_newline; $xmlSTUN .= $this->_char_type_end.$this->_newline; // end appauth $xmlSTUN .= $this->_char_type_end.$this->_newline; //end applicaton return $xmlSTUN; } function _indent($text) { // Create new lines where necessary $find = array('>', '</', "\n\n"); $replace = array(">\n", "\n</", "\n"); $text = str_replace($find, $replace, $text); $text = trim($text); // for the \n that was added after the final tag $text_array = explode("\n", $text); $open_tags = 0; foreach ($text_array AS $key => $line) { $tabs = ''; if (($key == 0) || ($key == 1) || ($key == 2)) // The first line shouldn't affect the indentation $tabs = ''; else { for ($i = 1; $i <= $open_tags; $i++) $tabs .= " "; } if ($key != 0 && $key != 1 && $key != 2) { if ((strpos($line, '</') === false) && (strpos($line, '>') !== false)) { if((strpos($line, '/>') === false)) $open_tags++; } else if ($open_tags > 0) $open_tags--; } $new_array[] = $tabs . $line; unset($tabs); } $indented_text = implode("\n", $new_array); return $indented_text; } function save_stun($data, $id) { $this->ci->load->model('provisioning_settings_model'); return $this->ci->provisioning_settings_model->save_STUN($data, $id); } function save_sip($data, $id) { $this->ci->load->model('provisioning_settings_model'); return $this->ci->provisioning_settings_model->save_SIP($data, $id); } function save_voip($data, $id) { $this->ci->load->model('provisioning_settings_model'); return $this->ci->provisioning_settings_model->save_voip($data, $id); } function get_settings($user_id = null, $insertId = null, $settings_type = null) { if($user_id === false || $insertId === false || $settings_type === false) { return false; } $this->ci->load->model('provisioning_settings_model'); if(strcmp($settings_type, 'stun') == 0) { return $this->ci->provisioning_settings_model->get_STUN($user_id, $insertId); } else if(strcmp($settings_type, 'sip') == 0) { return $this->ci->provisioning_settings_model->get_SIP($user_id, $insertId); } else if(strcmp($settings_type, 'voip') == 0) { return $this->ci->provisioning_settings_model->get_VoIP($user_id, $insertId); } else if(strcmp($settings_type, 'addvoip') == 0) { if($insertId == 0) { return $this->ci->provisioning_settings_model->get_Default_VoIP(); } else { return $this->ci->provisioning_settings_model->get_VoIP($user_id, $insertId); } } else { return false; } } function getStunHistoryListForUser($user_id, $num, $offset) { $this->ci->load->model('provisioning_settings_model'); return $this->ci->provisioning_settings_model->getStunHistoryListForUser($user_id, $num, $offset); } function getVoIPHistoryListForUser($user_id, $num, $offset) { $this->ci->load->model('provisioning_settings_model'); return $this->ci->provisioning_settings_model->getVoIPHistoryListForUser($user_id, $num, $offset); } function get_voip_for_sip($user_id, $sid, $stype) { $this->ci->load->model('provisioning_settings_model'); return $this->ci->provisioning_settings_model->get_voip_for_sip($user_id, $sid, $stype); } function countStunHistoryForUser($user_id) { $this->ci->load->model('provisioning_settings_model'); return $this->ci->provisioning_settings_model->countStunHistoryForUser($user_id); } function countVoIPHistoryForUser($user_id) { $this->ci->load->model('provisioning_settings_model'); return $this->ci->provisioning_settings_model->countVoIPHistoryForUser($user_id); } function getSipHistoryListForUser($user_id, $num, $offset) { $this->ci->load->model('provisioning_settings_model'); return $this->ci->provisioning_settings_model->getSipHistoryListForUser($user_id, $num, $offset); } function countSipHistoryForUser($user_id) { $this->ci->load->model('provisioning_settings_model'); return $this->ci->provisioning_settings_model->countSipHistoryForUser($user_id); } function appref_check($appref) { $this->ci->load->model('provisioning_settings_model'); return $this->ci->provisioning_settings_model->appref_check($appref, $this->ci->redux_auth->get_id()); } } ?>
{ "content_hash": "5cfafca78478aa861de822313b93e92c", "timestamp": "", "source": "github", "line_count": 471, "max_line_length": 131, "avg_line_length": 37.23991507430998, "alnum_prop": 0.5322690992018244, "repo_name": "ttroy50/setkia", "id": "32704a856c473098f040b88d2ce5c516450926ad", "size": "17540", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "setkia.com/system/application/libraries/sip_settings.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "115" }, { "name": "CSS", "bytes": "27543" }, { "name": "HTML", "bytes": "4332" }, { "name": "JavaScript", "bytes": "814" }, { "name": "PHP", "bytes": "1423220" } ], "symlink_target": "" }
package org.gekko.beanfactory; import org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver; import org.springframework.beans.factory.xml.NamespaceHandler; import org.springframework.beans.factory.xml.NamespaceHandlerResolver; public class GekkoNamespaceHandlerResolver implements NamespaceHandlerResolver { private final DefaultNamespaceHandlerResolver defaultHandlerResolver; public GekkoNamespaceHandlerResolver(DefaultNamespaceHandlerResolver defaultHandlerResolver) { this.defaultHandlerResolver = defaultHandlerResolver; } @Override public NamespaceHandler resolve(String namespaceUri) { if (namespaceUri.equals("http://www.gekko.org/schema/gk")) { GekkoNamespaceHanlder handler = new GekkoNamespaceHanlder(); return handler; } return defaultHandlerResolver.resolve(namespaceUri); } }
{ "content_hash": "aeedc97b4f237f888dc22ed686ad9d55", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 95, "avg_line_length": 33.36, "alnum_prop": 0.8381294964028777, "repo_name": "epanikas/gekko", "id": "9158968896f9fe03ab236eab9e8aa0b7fb96bdba", "size": "834", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/gekko/beanfactory/GekkoNamespaceHandlerResolver.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "89341" } ], "symlink_target": "" }